ChorusOne / solido

Lido for Solana is a Lido-DAO governed liquid staking protocol for the Solana blockchain.
https://chorusone.github.io/solido/
GNU General Public License v3.0
101 stars 43 forks source link

Can not confirm tx when i use a keypair instance which import by secret key. #536

Closed yihaiy closed 2 years ago

yihaiy commented 2 years ago

`const payer= web3.Keypair.fromSecretKey(Uint8Array.from(Base58.decode('my secret key string')))

let connection = new web3.Connection(web3.clusterApiUrl('mainnet-beta'), 'confirmed');

let transaction = new web3.Transaction({ feePayer: keypair.publicKey }); const depositInstruction = getDepositInstruction( payer.publicKey, payer.publicKey, MAINNET_PROGRAM_ADDRESSES, {lamports: new BN('10000000')} )

transaction.add(depositInstruction);

console.log(payer.publicKey);

web3.sendAndConfirmTransaction(connection, transaction, [keypair]).then((res) => { console.info(res) })`

`/home/arya/node_modules/@solana/web3.js/lib/index.cjs.js:2493 const pubkeySorting = x.pubkey.toBase58().localeCompare(y.pubkey.toBase58()); ^

TypeError: Cannot read properties of undefined (reading 'toBase58') at /home/arya/node_modules/@solana/web3.js/lib/index.cjs.js:2493:38 at Array.sort () at Transaction.compileMessage (/home/arya/node_modules/@solana/web3.js/lib/index.cjs.js:2492:18) at Transaction._compile (/home/arya/node_modules/@solana/web3.js/lib/index.cjs.js:2605:26) at Transaction.sign (/home/arya/node_modules/@solana/web3.js/lib/index.cjs.js:2702:26) at Connection.sendTransaction (/home/arya/node_modules/@solana/web3.js/lib/index.cjs.js:6737:21) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async Object.sendAndConfirmTransaction (/home/arya/node_modules/@solana/web3.js/lib/index.cjs.js:2977:21) `