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)
`
`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)
`