okx / js-wallet-sdk

Multi-chain typescript signature sdk, supports bitcoin, ethereum, solana, cosmos, etc.
https://okx.github.io/js-wallet-sdk/#/
MIT License
211 stars 74 forks source link

solana signTransaction() #108

Closed ericwilsonxingwan closed 4 months ago

ericwilsonxingwan commented 4 months ago

When I use wallet.signTransaction to generate a solana tx, which method of solana/web3.js should I use to send the transaction? I use sendEncodedTransaction(tx) and get an error message: failed to deserialize solana_sdk::transaction::versioned::VersionedTransaction: io error: failed to fill whole buffer thanks

leverwwz commented 4 months ago

When I use wallet.signTransaction to generate a solana tx, which method of solana/web3.js should I use to send the transaction? I use sendEncodedTransaction(tx) and get an error message: failed to deserialize solana_sdk::transaction::versioned::VersionedTransaction: io error: failed to fill whole buffer thanks

========================================================================= just use post method of http to send the signed transaction as a param. for example, use curl,

curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","id":1, "method":"sendTransaction", "params":["4z4zz6dMdE3bxju8aETexPv62Ta4mguLTPyDgdAcihsJvmeipde26Vy1ayDRfbi4VHoanYB5CZJyHJhAjGns63Y6jwcwERqymn92CEk2qcvEYWk3dfbZSf7QRK5VQf34FVb9mXXXXXXXXXXXXXXXXXXXXXXXX"]}' https://api.devnet.solana.com/ |jq

leverwwz commented 4 months ago

for sendEncodedTransaction, it is base64 encoded tx, but signed tx generate by our sdk is encoded base58. i think it is the problem.