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

# stake()

> Create staking request transaction.

This method calls [`/solana/{network}/staking/stake`](/reference/solana-staking-stake) to create a new unsigned transaction which, if signed and broadcasted, will create a new staking request.

<CodeGroup>
  ```javascript JavaScript theme={null}
  await client.solana.stake({
    feePayer: '9i5cTqci1W6DHdYfT7WbiNhP5DXvnPNTXvS9fTBFfuSw',
    fromPublicKey: '9i5cTqci1W6DHdYfT7WbiNhP5DXvnPNTXvS9fTBFfuSw',
    amount: '1002282880',
  });
  ```
</CodeGroup>

## Parameters

|                                                                                                                                                                                                                                         |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **network** *string*<br />Solana network:<br />`mainnet-beta` — production network.<br />`testnet` — testnet.<br />If not specified, the method will use the default value from the [constructor](/docs/staking-sdk-stakingapiclient) . |
| **feePayer** *string, required*<br />Account address that will pay the fee for the transaction.                                                                                                                                         |
| **fromPublicKey** *string, required*<br />Account address from which the staking account will be created.                                                                                                                               |
| **nonceAccount** *string*<br />Account address that keeps the value of the nonce.                                                                                                                                                       |
| **computeUnitLimit** *number ≥ 1*<br />Maximum computational effort limit for the transaction measured in compute units.                                                                                                                |
| **computeUnitPrice** *number ≥ 1*<br />Price of a compute unit for the transaction in micro-lamports (1 microLamport = 10⁻⁶ lamports).                                                                                                  |
| **stakeAuthority** *string*<br />Account address that can perform staking operations with the staking account. If not specified, rights will be taken from the `fromPublicKey` parameter.                                               |
| **withdrawAuthority** *string*<br />Account address that can perform withdrawal operations with the staking account. If not specified, rights will be taken from the `fromPublicKey` parameter.                                         |
| **amount** *string, required*<br />Amount of tokens to stake in lamports (1 SOL = 10⁹ lamports). Min amount is `'1002282880'`.                                                                                                          |

## Result

The method returns a JSON object that contains a base64-encoded unsigned transaction and some metadata about it.

You can decode the transaction using [`decodeTransaction()`](/docs/staking-sdk-solana-decodetransaction) or pass it directly to [`signWithKeypairs()`](/docs/staking-sdk-solana-signwithkeypairs).

<CodeGroup>
  ```json JSON theme={null}
  {
    "feePayer": "9i5cTqci1W6DHdYfT7WbiNhP5DXvnPNTXvS9fTBFfuSw",
    "fromPublicKey": "9i5cTqci1W6DHdYfT7WbiNhP5DXvnPNTXvS9fTBFfuSw",
    "stakeAccount": "6ZuLUCwVTvuQJrN1HrpoHJheQUw9Zk8CtiD3CEpHiA9E",
    "stakeAuthority": "9i5cTqci1W6DHdYfT7WbiNhP5DXvnPNTXvS9fTBFfuSw",
    "withdrawAuthority": "9i5cTqci1W6DHdYfT7WbiNhP5DXvnPNTXvS9fTBFfuSw",
    "amount": 1,
    "unsignedTransaction": "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAcJjkQt4XcX43Vk8FZ7QbUVXSF5oo9jt7x2Dm0E9ut/y+jagnMHpK8BDHt0PpssHwXGD2fBxS6MWBoxptD2u9TvrgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA1NjSeWM5+GSJdoQd43Al9SVVXC9FfWGwbe7icpomwAUGodgXkTdUKpg0N73+KnqyVX9TXIp4citopJ3AAAAAAAah2BelAgULaAeR5s5tuI4eW3FQ9h/GeQpOtNEAAAAABqfVFxjHdMkoVmOYaR1etoteuKObS21cc1VbIQAAAAAGp9UXGSxcUSGMyUw9SvF/WNruCJuh/UTj29mKAAAAAAan1RcZNYTQ/u2bs0MdEyBr5UQoG1e4VmzFN1/0AAAAijW940iwWddz25ZC37fI0ue5fa+eTbC2ynBM3b0t4pcDAgMAAQBgAwAAAI5ELeF3F+N1ZPBWe0G1FV0heaKPY7e8dg5tBPbrf8voBAAAAAAAAABzZWVkgJaYAAAAAADIAAAAAAAAAAah2BeRN1QqmDQ3vf4qerJVf1NcinhyK2ikncAAAAAABAIBB3QAAAAAjkQt4XcX43Vk8FZ7QbUVXSF5oo9jt7x2Dm0E9ut/y+iORC3hdxfjdWTwVntBtRVdIXmij2O3vHYObQT263/L6AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQGAQMGCAUABAIAAAA=",
    "createdAt": "2023-08-24T08:14:50.455Z"
  }
  ```
</CodeGroup>

|                                                                                                                                                                           |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **feePayer** *string*<br />Account address that will pay the fee for the transaction.                                                                                     |
| **fromPublicKey** *string*<br />Account address from which the staking account will be created.                                                                           |
| **stakeAccount** *string*<br />Account address that stores tokens for staking.                                                                                            |
| **stakeAuthority** *string*<br />Account address that can perform staking operations with staking account.                                                                |
| **withdrawAuthority** *string*<br />Account address that can perform withdrawal operation with staking account.                                                           |
| **amount** *number*<br />Amount of tokens to stake in lamports (1 SOl = 10⁹ lamports). Min amount is `1002282880`.                                                        |
| **unsignedTransaction** *string*<br />Unsigned transaction in Base64 encrypted format. Sign the transaction and submit it to the blockchain to perform the called action. |
| **createdAt** string<br />Timestamp of the transaction in the ISO 8601 format.                                                                                            |


## Related topics

- [decodeTransaction()](/docs/staking-sdk-solana-decodetransaction.md)
- [signWithKeypairs()](/docs/staking-sdk-solana-signwithkeypairs.md)
- [Staking API reference](/reference/solana-staking-stake.md)
