Skip to content

Bug: TypeError: Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method. #129

@renlong

Description

@renlong

Bug Description

withdraw3 method will throw this error in ReactNative environment.
This error is in executeUserSignedAction function.

const [finalAction, signature] = "wallet" in config
     ? [fullAction, await signUserSignedAction({ wallet: leader, action: fullAction, types })]
     : await signMultiSigUserSigned(config, fullAction, types, walletAddress, nonce);

change to

let finalAction;
let signature;
if ("wallet" in config) {
    finalAction = fullAction;
    signature = await signUserSignedAction({ wallet: leader, action: fullAction, types });
} else {
    [finalAction, signature] = await signMultiSigUserSigned(config, fullAction, types, walletAddress, nonce);
}

will be fine.
I don't know why, but it works.

Code to Reproduce

Environment

  • @nktkas/hyperliquid version: 0.32.1
  • Runtime environment and its version:
  • React Native

Additional Context (optional)

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions