BitGo / BitGoJS

BitGo JavaScript SDK
https://developers.bitgo.com/
Apache License 2.0
353 stars 272 forks source link

Tx outputs does not match with expected txParams recipients #4501

Closed bobozarb closed 4 months ago

bobozarb commented 5 months ago

I've been trying to carry out a sol:usdc transfer but I keep getting the below error message.

{"error":"Tx outputs does not match with expected txParams recipients","message":"Tx outputs does not match with expected txParams recipients","bitgoJsVersion":"38.2.1","bitgoExpressVersion":"9.62.3"}


transaction prebuild: {
  walletId: 'zzzz65a1baxxx',
  wallet: <ref *1> Wallet {
    bitgo: BitGo {
      _authVersion: 2,
      _hmacVerification: true,
      _version: '38.2.1',
      cookiesPropagationEnabled: false,
      _baseUrl: 'https://app.bitgo.com',
      env: 'prod',
      _env: 'prod',
      _baseApiUrl: 'https://app.bitgo.com/api/v1',
      _baseApiUrlV2: 'https://app.bitgo.com/api/v2',
      _token: 'xx',
      _userAgent: 'BitGoExpress/9.62.3 BitGoJS/38.2.1 python-requests/2.27.1',
      _refreshToken: undefined,
      _clientId: undefined,
      _clientSecret: undefined,
      _keychains: null,
      _wallets: null,
      _validate: true,
      _proxy: undefined
    },
    baseCoin: SolToken {
      bitgo: [BitGo],
      _url: 'https://app.bitgo.com/api/v2/',
      _wallets: [Wallets],
      _keychains: [Keychains],
      _webhooks: [Webhooks],
      _pendingApprovals: [PendingApprovals],
      _enterprises: [Enterprises],
      _markets: [Markets],
      _staticsCoin: [AccountCoin],
      tokenConfig: [Object]
    },
    _wallet: {
      id: 'xxxx',
      users: [Array],
      coin: 'sol',
      label: 'USDCSOL',
      m: 2,
      n: 3,
      keys: [Array],
      keySignatures: {},
      enterprise: 'xxxx',
      tags: [Array],
      disableTransactionNotifications: false,
      freeze: {},
      deleted: false,
      approvalsRequired: 1,
      isCold: false,
      coinSpecific: [Object],
      admin: [Object],
      clientFlags: [],
      walletFlags: [],
      allowBackupKeySigning: false,
      recoverable: true,
      startDate: '2024-01-12T22:16:38.000Z',
      type: 'hot',
      buildDefaults: {},
      customChangeKeySignatures: {},
      hasLargeNumberOfAddresses: false,
      multisigType: 'tss',
      config: {},
      balanceString: 'xxxx',
      confirmedBalanceString: 'xxxx',
      spendableBalanceString: 'xxxx',
      receiveAddress: [Object],
      pendingApprovals: []
    },
    tssUtils: EddsaUtils {
      bitgo: [BitGo],
      baseCoin: [SolToken],
      _wallet: [Circular *1]
    }
  },
  txRequestId: '76517e35-e240-46a2-b0c7-e0783c93e5ca',
  txHex: 'xxxx',
  buildParams: {
    recipients: [ [Object] ],
    sequenceId: 'TxfkjhgQWpovcza3',
    type: 'transfer'
  },
  feeInfo: { fee: 5000, feeString: '5000' }
}
Trace: Error: Tx outputs does not match with expected txParams recipients

Payload:

>>>zend_payload = {'walletPassphrase':WALLETPASSPHRASE, 'type':'transfer', 
'address':"5xXkctijnr9TbzJWoTvPQSaKX89sm8HkpDWZ4kPxKcnR", 'amount':2000000, 'sequenceId':'Ghdsaqputy'}
>>> send_url = "https://localhost:4000/api/v2/sol:usdc/wallet/6x5a1ba4650xxxxxxxxxxxxx/sendcoins"
>>> rex = requests.post(send_url, data=json.dumps(zend_payload), headers=bitgo_headers)

What am I missing?

Node version: v20.12.2 yarn version: v1.22.21

robsoh09 commented 5 months ago

whats your body tokenName: sol:usdc?

are you trying to send usdc:sol out from a solana wallet?

bobozarb commented 4 months ago

The issue has been fixed. I had to pass the field tokenName. Also, I was trying to send out sol:usdc