An open API service indexing awesome lists of open source software.

https://github.com/fireblocks/polkadot_staking_sdk

Stake Polkadot on Fireblocks
https://github.com/fireblocks/polkadot_staking_sdk

Last synced: about 1 month ago
JSON representation

Stake Polkadot on Fireblocks

Awesome Lists containing this project

README

        

# Fireblocks Polkadot staking

This script allows to stake DOT via the Fireblocks system using the RAW signing API feature.

## :warning: Breaking Change in 2.0.0 :warning:

Version 2.0.0 introduces a breaking change; as per [this forum post](https://forum.polkadot.network/t/staking-controller-deprecation-plan-staking-ui-leads-comms/2748) on Polkadot - the controller is being deprecated.

As a result the following breaking changes were introduced:

- The function `setController` will no longer work and will results in an error
- The function `bond` no longer accepts 4 arguments, instead only 3 arguments - `vaultAccountId: string, amount?: number, rewardDestination?: string` (the `controller` argument was removed)

## Getting started

1. Clone this repo locally
2. cd into the directory
3. Run:

```
npm install
```

4. Make sure that typescript is installed globally:

```
npm install -g typescript
```

**Prerequisites:**

1. Create the following vault accounts with DOT wallet within each:

a. Stash Account - holds the amount to stake

b. (optional) Proxy account - for security reasons, will get permission to sign staking operations on behalf of the stash

2. Enable RAW signing feature by contacting Fireblocks's support team

3. Set transaction authorization policy rule that governs the RAW signing operation, the policy should include the following parameters:

a. Initiator

b. Designated Signer

c. Asset - DOT

d. Source (vault accounts) - Optional

e. Authorizers - Optional

**How to stake DOT**

1. addProxy(, );

2. bond(, , , **optional** - );

reward_destination - Can be one of the following:

1. Stash (Default)

2. Staked - the rewards are sent back to the Stash and automatically bonded

**How to stake extra DOT**

1. bondExtra(, )

**How to stop staking**

1. chill(); // stash or proxy

2. unbond(, );

3. **28 days after** unbond() - withdrawUnbonded();

4. **Optional** - removeProxy(, );

**How to change controller**

1. setController(, ) // Deprecated, see update above

**How to call methods from a proxy account**

**_With the following structure of accounts:_**

1. Stash account:

```
vaultAccountId = 0
address = 131AxR1JdcYdtnzT5nqzVRwDJC5GWqP4S8bKpixdMGcwRhhQ
```

```

2. Proxy account:

```

vaultAccountId = 2
address = 14ZGCffp5gMerBPHpC75aM4y5THxfUnDrtFGebGLrQUD2sME

```

**_Following the examples in 'How To Stake DOT', we executed:_**

```

1. addProxy('1', '14ZGCffp5gMerBPHpC75aM4y5THxfUnDrtFGebGLrQUD2sME')
2. bond('0', 100, '16Co1rwKf7XdRF8JBBX5uAxP23XZKdXYp5w9pax3zY7t2Kk4')

```

```