@solinkify/depin
v0.2.0
Published
Solinkify DePIN node-operator SDK — staking tiers, PDA helpers, weighted score, and epoch reward math for the $SINKY relay network on Solana.
Maintainers
Readme
@solinkify/depin
Node-operator SDK for the Solinkify DePIN relay network on Solana: staking
tiers, PDA helpers, weighted-score and epoch-reward math, and thin instruction
wrappers for register_node / add_stake / unstake / claim_reward —
everything mirrors the on-chain program, so what you compute locally is what
the contract enforces.
Run a node, relay Solinkify traffic (Jalur B), earn a share of protocol fees: 0.375% of every relayed payment goes to the relaying node directly plus 0.375% into the epoch reward pool, split by weighted score.
Install
npm install @solinkify/depin @coral-xyz/anchor @solana/web3.js @solana/spl-tokenStaking tiers (tokenomics v2, enforced on-chain)
| Tier | Min stake | Multiplier | |---|---|---| | Lite | 25 $SINKY | 1.0× | | Bronze | 100 $SINKY | 1.0× | | Silver | 500 $SINKY | 1.5× | | Gold | 2,000 $SINKY | 2.5× |
import { getTierFromStake, TIER_THRESHOLDS, MIN_STAKE, formatSinky } from '@solinkify/depin';
getTierFromStake(2_000n * 1_000_000_000n); // 'Gold' (raw units, 9 decimals)Reward weight = stake × multiplier × uptime — calculateWeightedScore()
mirrors the on-chain formula exactly.
Quick start
import { createDepinClient, deriveNodeOperatorPda } from '@solinkify/depin';
// Requires env: NEXT_PUBLIC_RPC_URL, NEXT_PUBLIC_PROGRAM_ID, NEXT_PUBLIC_SINKY_MINT
const client = createDepinClient(provider, idl); // AnchorProvider + program IDL
await client.registerNode({ stakeAmount: 100n * 1_000_000_000n, provider, idl }); // Bronze
const node = await client.fetchNodeOperator(wallet.publicKey);
const est = await client.estimateReward(wallet.publicKey);Fee routing (Jalur A/B)
computeFees() reproduces the on-chain split so dashboards and nodes can
display exact expected amounts:
- Jalur A (direct): 99% seller · 0.9% treasury · 0.1% team
- Jalur B (via node): 99% seller · 0.375% relaying node · 0.375% epoch pool · 0.15% treasury · 0.1% team
Program
- Program id:
A8qSJCS2uxxnEMdCcpjX2L8hUUMydoeCi5xq5qvzS22B(same on devnet & mainnet) - PDAs:
["node_operator", operator],["epoch_state", epoch_num]
License
MIT © Solinkify
