@usesamxyz/sdk
v0.1.0
Published
TypeScript SDK for SAM, the Smart Asset Management yield engine on Sui.
Maintainers
Readme
@usesamxyz/sdk
TypeScript SDK for SAM, the Smart Asset Management yield engine on Sui. It wraps the on-chain vaults with a typed client for reading state and building deposit, redeem and rebalance transactions.
Install
npm install @usesamxyz/sdk @mysten/suiUsage
import { SamClient, MAINNET, getVault } from '@usesamxyz/sdk';
const sam = new SamClient({ config: MAINNET });
const vault = getVault(MAINNET, 'samUSDC');
const state = await sam.getVaultState(vault.id);
const allocations = await sam.getAllocations(vault.id);
console.log(state, allocations);Exports
@usesamxyz/sdk exposes the high-level SamClient, network config (MAINNET, CONFIGS), vault helpers, types and fixed18 helpers. The client resolves all on-chain package addresses for you.
License
MIT. Provided as-is, no warranty. See the disclaimer at usesam.xyz.
