Francium-DeFi / francium-sdk

The Francium SDK.
https://francium.io/
30 stars 16 forks source link

attempting to close a position that has SOL in it's pair fails #10

Open nourel opened 2 years ago

nourel commented 2 years ago

attempting to close a position containing SOL in its pair fails.

error:

TypeError: x.pubkey.toBase58 is not a function
    at sort (/@solana/web3.js/src/transaction.ts:263:10)
    at Array.sort (<anonymous>)
    at Transaction.compileMessage (/@solana/web3.js/src/transaction.ts:261:18)
    at Transaction._compile (/@solana/web3.js/src/transaction.ts:379:26)
    at Transaction.partialSign (/@solana/web3.js/src/transaction.ts:504:26)
    at /@project-serum/anchor/src/nodewallet.ts:32:9
    at Array.map (<anonymous>)
    at NodeWallet.signAllTransactions (/@project-serum/anchor/src/nodewallet.ts:31:16)
    at /francium-sdk/dist/utils/sign.js:25:37
    at Generator.next (<anonymous>)

offending code snippet:

  console.log('------ start sign ------', trxs);
  const signed = await wallet.signAllTransactions(trxs);
  console.info('----- Sign end -----');

reproduce:

  1. Open a SOL-xxx pair position in franc or through CLI (does not matter - both fail).
  2. call Francium's getClosePositionTransactions() method
  3. call Francium's sendMultipleTransactions()