Skip to content

Latest commit

 

History

History
45 lines (37 loc) · 2.11 KB

File metadata and controls

45 lines (37 loc) · 2.11 KB

TypeScript Solana staking with Fireblocks wallet

sequenceDiagram
    autonumber
    participant StakeClient as Sample stake<br> client application
    participant StakeAPI as Stake Intent API
    participant Blockchain as Solana RPC
    participant TSM1 as Fireblocks wallet<br> API

    StakeClient ->> StakeAPI: get StakeIntent unsigned tx data <br>(amount, validator vote account, delegator)
    StakeClient ->> StakeClient: construct unsigned tx
    StakeClient ->> Blockchain: get blockchain inputs (gas fee) for new tx<br>(sender wallet)
    StakeClient ->> Blockchain: check delegator account balance for stake<br>(sender wallet)
    StakeClient ->> TSM1: request signature (unsigned tx hash)
    TSM1 -->> StakeClient: return signature
    StakeClient ->> Blockchain: broadcast full signed tx<br>(signed tx)
Loading

Prerequisites

Step 1. Set environment variables in .env

cd solana-staking/fireblocks/nodejs/
cp .env.example .env
  • update .env with API keys, Fireblocks Vault ID

Step 2. Install package dependancies

npm install

Step 3. Launch solana-stake-fb.ts to generate the Stake Intent request, sign the request with Fireblocks and broadcast the transaction

npm run start solana-stake-fb.ts