signWithKeypairs()
Sign a Transaction using one or more keypairs.
This method accepts an unsigned transaction (or its base64-encoded representation) and a set of keypairs (or private keys) and signs the transaction with the keys.
Note that for the resulting transaction to be valid, you must provide the keys or keypairs corresponding to all the public keys that were originally passed when creating the transaction via stake(), withdraw() or deactivate().
client.solana.signWithKeypairs(unsignedTx, [keypair1, keypair2]);This method is intended for testing purposes only.
Using this method requires passing private keys directly to the running code, which is often not safe. We strongly recommend signing transactions via dedicated software or hardware wallets, such as Phantom or Solflare.
Parameters
unsignedTx Transaction or string, required |
keypairs array, required |
Result
Returns a signed Transaction object. If the method was called with an existing transaction object (not base64-encoded), all modifications will be done on that object, and the same object will be returned.
You can pass the signed transaction to verifyTransaction() and sendTransaction().
What's next?
- verifyTransaction()
- sendTransaction()
- Staking API reference
Updated about 19 hours ago