Overview
The stake.fish SDK provides JavaScript/TypeScript libraries for staking operations across multiple blockchain networks. Each SDK offers a unified, chain-specific interface for delegating, undelegating, and managing stakes with stake.fish validators.
Available SDKs
| Package | Chain | Install |
|---|---|---|
@stakefish/sdk-sui | Sui | npm install @stakefish/sdk-sui |
@stakefish/sdk-cosmos | Cosmos Hub | npm install @stakefish/sdk-cosmos |
@stakefish/sdk-cardano | Cardano | npm install @stakefish/sdk-cardano |
@stakefish/sdk-monad | Monad | npm install @stakefish/sdk-monad |
@stakefish/sdk-polygon | Polygon | npm install @stakefish/sdk-polygon |
General Usage Pattern
All stake.fish SDKs follow a consistent four-step workflow:
1. Initialize
Create an instance of the chain-specific class with your configuration:
import { Sui } from '@stakefish/sdk-sui';
import { Cosmos } from '@stakefish/sdk-cosmos';
import { Cardano } from '@stakefish/sdk-cardano';
const sui = new Sui();
const cosmos = new Cosmos({ rpcUrl, apiUrl, memo });
const cardano = new Cardano({ blockfrostProjectId, memo });Important: The
memoparameter is used to identify institutional clients and must be agreed upon with stake.fish prior to production use. Please contact stake.fish to obtain your unique memo string.
2. Prepare Transaction
Create an unsigned transaction for the desired staking operation:
// Delegation
const unsignedTx = await chain.delegate(delegatorAddress, amount);
// Undelegation
const unsignedTx = await chain.undelegate(delegatorAddress, ...);
// Chain-specific operations (rewards, redelegation, etc.)3. Sign Transaction
Sign the unsigned transaction offline using your private key or keys:
const signedTx = await chain.sign(privateKey, unsignedTx);Note: Signing is performed entirely offline and does not require network connectivity. Private keys never leave your environment.
4. Broadcast Transaction
Submit the signed transaction to the network:
const result = await chain.broadcast(signedTx);
console.log('Transaction ID:', result.txId);The broadcast method optionally waits for transaction inclusion by default and returns the transaction hash upon success.
Chain-Specific Documentation
For detailed API references, configuration options, and examples, see the individual SDK documentation:
Security Notes
- Private keys and mnemonics should be kept secure and never committed to version control
- All signing operations are performed locally—keys are never transmitted over the network
- Use environment variables or secure key management solutions for credentials
Updated 3 days ago
