> ## Documentation Index
> Fetch the complete documentation index at: https://docs.validationcloud.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Signing a Transaction

The code snippet below signs the staking transaction with the wallet constructed earlier.:

```javascript theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
async function signTransaction(wallet, transaction) {

  return await wallet.signTransaction({
    type: 0,
    to: transaction.to,
    from: wallet.address,
    nonce: transaction.nonce,
    gasLimit: transaction.gas,
    gasPrice: transaction.gas_price,
    data: transaction.data,
    value: transaction.value,
    chainId: ethers.toBeHex(transaction.chain_id),
  });
  
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.