# `FireblocksSdk.Api.Staking`
[🔗](https://github.com/csokun/fireblocks_sdk/blob/v0.2.5/lib/fireblocks_sdk/api/staking.ex#L1)

# `accept_provider_term_of_service`

Approve staking terms of service.

Approve the terms of service of the staking provider. This must be called before performing a staking action for the first time with this provider.

# `claim_reawards`

Execute a Claim Rewards operation.

```
FireblocksSdk.Api.Staking.claim_reawards([
  id: "b70701f4-d7b1-4795-a8ee-b09cdb5b850d",
  chainDescriptor: "SOL",
  txNote: "claim rewards request id b70701f4-d7b1-4795-a8ee-b09cdb5b850d",
  feeLevel: :medium
])
```

Options:
* `:id` (`t:String.t/0`) - Required. id of position to claim rewards from

* `:chainDescriptor` (`t:String.t/0`) - Required.

* `:fee` (`t:String.t/0`)

* `:feeLevel`

* `:txNote` (`t:String.t/0`)

# `consolidate`

Consolidate ETH staking positions (validator consolidation).

Merges a source ETH staking position into a destination position on the beacon chain.

```
FireblocksSdk.Api.Staking.consolidate([
  chainDescriptor: "ETH",
  sourceId: "b70701f4-d7b1-4795-a8ee-b09cdb5b850d",
  destinationId: "f3432f4-34d1-43495-a8ee-jfdjnfj34i3",
  feeLevel: :medium
])
```

Options:
* `:chainDescriptor` - Required. Protocol identifier. Supported values: `ETH`, `ETH_TEST6`, `ETH_TEST_HOODI`

* `:sourceId` (`t:String.t/0`) - Required. Id of the source position to consolidate from

* `:destinationId` (`t:String.t/0`) - Required. Id of the destination position to consolidate into

* `:fee` (`t:String.t/0`) - Fee for the transaction. Only one of `fee`/`feeLevel` is required.

* `:feeLevel`

* `:txNote` (`t:String.t/0`) - The note to associate with the consolidation transaction.

# `get_chain_info`

Get chain-specific staking summary.

Return chain-specific, staking-related information summary (e.g. epoch details, lockup durations, estimated rewards, etc.)

Options:

  - `chain_descriptor`: The protocol identifier (e.g. "ETH"/"SOL"/"MATIC"/"STETH_ETH") to use

# `get_position`

Get staking position details.

Return detailed information on a staking position, including the staked amount, rewards, status and more.

# `get_positions`

List staking positions details

```
FireblocksSdk.Api.Staking.positions("SOL")
```
Options:

 - `chainDescriptor`: Use "ETH" / "SOL" / "MATIC" / "STETH_ETH" in order to obtain information related to the specific blockchain network or retrieve information about all chains that have data available by providing no argument.

# `get_positions_paginated`

List staking positions (paginated).

Returns a paginated list of staking positions. Use `pageCursor` from the response's `next` field
to fetch subsequent pages.

```
FireblocksSdk.Api.Staking.get_positions_paginated([
  pageSize: 20,
  chainDescriptor: "ETH",
  order: "DESC"
])
```

Options:
* `:pageSize` (`t:integer/0`) - Number of results per page (min: 1, max: 100). Returns a paginated `{data, next}` object. The default value is `10`.

* `:chainDescriptor` (`t:String.t/0`) - Protocol identifier to filter positions (e.g. `ETH`, `SOL`, `ATOM_COS`). If omitted, positions across all supported chains are returned.

* `:vaultAccountId` (`t:String.t/0`) - Filter positions by Fireblocks vault account ID. If omitted, positions across all vault accounts are returned.

* `:pageCursor` (`t:String.t/0`) - Cursor for the next page of results. Use the `next` value from the previous response.

* `:order` - Sort order: `ASC` or `DESC` (default: `DESC`) The default value is `"DESC"`.

# `get_positions_summary`

Get staking summary details.

Return a summary of all vaults, categorized by their status (active, inactive), the total amounts staked and total rewards per-chain.

# `get_positions_summary_by_vault`

Get staking summary details by vault

Return a summary for each vault, categorized by their status (active, inactive), the total amounts staked and total rewards per-chain.

# `get_providers`

List staking providers details

# `merge`

Perform a Solana Merge of two active stake accounts into one.

```
FireblocksSdk.Api.Staking.merge([
  chainDescriptor: "SOL",
  sourceId: "b70701f4-d7b1-4795-a8ee-b09cdb5b850f",
  destinationId: "f3432f4-34d1-43495-a8ee-jfdjnfj34i3",
  feeLevel: :medium
])
```

Options:
* `:chainDescriptor` - Required.

* `:sourceId` (`t:String.t/0`) - Required. Id of the source position to merge from

* `:destinationId` (`t:String.t/0`) - Required. Id of the destination position to merge into

* `:fee` (`t:String.t/0`)

* `:feeLevel`

* `:txNote` (`t:String.t/0`) - The note to associate with the transactions.

# `split`

Execute a Split operation on SOL/SOL_TEST stake account.

```
FireblocksSdk.Api.Staking.split([
  id: "b70701f4-d7b1-4795-a8ee-b09cdb5b850d",
  chainDescriptor: "SOL",
  amount: "20",
  txNote: "split 20 SOL out of 100 SOL, created on 02.04.23",
  feeLevel: :medium
])
```

Options:
* `:id` (`t:String.t/0`) - Required. id of position to split

* `:chainDescriptor` - Required.

* `:fee` (`t:String.t/0`)

* `:feeLevel`

* `:txNote` (`t:String.t/0`) - The note to associate with the transactions.

* `:amount` (`t:String.t/0`) - Required. Amount of tokens to be transferred to the new stake account.

# `stake`

Init Stake operation - Perform a chain-specific Stake.

```
FireblocksSdk.Api.Staking.stake([
  vaultAccountId: "22",
  providerId: "kiln",
  chainDescriptor: "SOL",
  stakeAmount: "100",
  txNote: "stake request id CcaHc2L43ZWjwCHART3oZoJvHLAe9hzT2DJNUpBzoTN1 of 100 SOL created on 02.04.23",
  feeLevel: :medium
])
```

Options:
* `:vaultAccountId` (`t:String.t/0`) - Required. The source vault account to stake from

* `:chainDescriptor` (`t:String.t/0`) - Required.

* `:providerId` (`t:String.t/0`) - Required. The unique identifier of the staking provider

* `:stakeAmount` (`t:String.t/0`) - Required. Amount of tokens to stake

* `:fee` (`t:String.t/0`)

* `:feeLevel`

* `:txNote` (`t:String.t/0`)

# `supported_chains`

List staking supported chains

# `unstake`

Execute an unstake operation.

```
FireblocksSdk.Api.Staking.unstake([
  id: "b70701f4-d7b1-4795-a8ee-b09cdb5b850d",
  chainDescriptor: "SOL",
  txNote: "unstake request id b70701f4-d7b1-4795-a8ee-b09cdb5b850d #SOL",
  feeLevel: :medium
])
```

Options:
* `:id` (`t:String.t/0`) - Required. id of position to unstake

* `:chainDescriptor` (`t:String.t/0`) - Required.

* `:fee` (`t:String.t/0`)

* `:feeLevel`

* `:txNote` (`t:String.t/0`)

* `:amount` (`t:String.t/0`) - The number of tokens to unstake. This optional field is applicable only for liquid staking and allows for a partial unstake of the position. If not provided, the entire position will be unstaked by default.

# `withdraw`

Execute a Withdraw operation.

```
FireblocksSdk.Api.Staking.withdraw([
  id: "b70701f4-d7b1-4795-a8ee-b09cdb5b850d",
  chainDescriptor: "SOL",
  txNote: "unstake request id b70701f4-d7b1-4795-a8ee-b09cdb5b850d #SOL",
  feeLevel: :medium
])
```

Options:
* `:id` (`t:String.t/0`) - Required. id of position to withdraw

* `:chainDescriptor` (`t:String.t/0`) - Required.

* `:fee` (`t:String.t/0`)

* `:feeLevel`

* `:txNote` (`t:String.t/0`)

---

*Consult [api-reference.md](api-reference.md) for complete listing*
