stable-layer-sdk

# Stable Layer SDK

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "stable-layer-sdk" with this command: npx skills add k66inthesky/stable-layer-sdk

Stable Layer SDK

A TypeScript SDK for interacting with the Stable Layer protocol on the Sui blockchain. It supports minting and burning stablecoins, and claiming yield farming rewards.

Installation

npm install stable-layer-sdk @mysten/sui @mysten/bcs

API Reference

StableLayerClient

import { StableLayerClient } from "stable-layer-sdk";

const client = new StableLayerClient({
  network: "mainnet" | "testnet",
  sender: "0xYOUR_SUI_ADDRESS",
});

Transaction Methods

buildMintTx(options)

Mint stablecoins by depositing USDC. Automatically deposits into vault farm.

ParameterTypeDescription
txTransactionSui transaction object
stableCoinTypestringTarget stablecoin type (e.g. 0x...::btc_usdc::BtcUSDC)
usdcCoinCoinInput USDC coin reference
amountbigintAmount to mint
autoTransferboolean?If false, returns the resulting Coin object

buildBurnTx(options)

Burn stablecoins to redeem USDC.

ParameterTypeDescription
txTransactionSui transaction object
stableCoinTypestringStablecoin type to burn
amountbigint?Specific amount to burn
allboolean?If true, burn entire balance

buildClaimTx(options)

Claim accumulated yield farming rewards.

ParameterTypeDescription
txTransactionSui transaction object
stableCoinTypestringStablecoin type to claim rewards for

Query Methods

getTotalSupply()

Returns the total stablecoin supply across all coin types.

getTotalSupplyByCoinType(type: string)

Returns the supply for a specific stablecoin type.

Usage Examples

Mint Stablecoins

import { Transaction, coinWithBalance } from "@mysten/sui/transactions";
import { SuiClient, getFullnodeUrl } from "@mysten/sui/client";
import { Ed25519Keypair } from "@mysten/sui/keypairs/ed25519";
import { StableLayerClient } from "stable-layer-sdk";

const client = new StableLayerClient({
  network: "mainnet",
  sender: "0xYOUR_ADDRESS",
});

const suiClient = new SuiClient({ url: getFullnodeUrl("mainnet") });
const keypair = Ed25519Keypair.fromSecretKey(YOUR_PRIVATE_KEY);

const tx = new Transaction();
await client.buildMintTx({
  tx,
  stableCoinType: "0x6d9fc...::btc_usdc::BtcUSDC",
  usdcCoin: coinWithBalance({
    balance: BigInt(1_000_000),
    type: "0xdba34...::usdc::USDC",
  })(tx),
  amount: BigInt(1_000_000),
});

const result = await suiClient.signAndExecuteTransaction({
  transaction: tx,
  signer: keypair,
});

Burn Stablecoins

const tx = new Transaction();
await client.buildBurnTx({
  tx,
  stableCoinType: "0x6d9fc...::btc_usdc::BtcUSDC",
  amount: BigInt(500_000),
});

await suiClient.signAndExecuteTransaction({ transaction: tx, signer: keypair });

Claim Rewards

const tx = new Transaction();
await client.buildClaimTx({
  tx,
  stableCoinType: "0x6d9fc...::btc_usdc::BtcUSDC",
});

await suiClient.signAndExecuteTransaction({ transaction: tx, signer: keypair });

Query Supply

const totalSupply = await client.getTotalSupply();
const btcUsdcSupply = await client.getTotalSupplyByCoinType("0x6d9fc...::btc_usdc::BtcUSDC");

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Web3

Aster Futures

Aster Futures request using the Aster API. Authentication uses EIP-712 ECDSA signing with API wallet. Supports mainnet.

Registry SourceRecently Updated
Web3

Flap Skills

创建 V5 代币(0 税或税收,四档分配);USDT 买入、按数量或按比例卖出;做市刷量(每轮 5 买 5 卖,启动销毁 5 万枚,无 USDT 时卖回 funder 后继续,日志北京时间)。说「蝴蝶技能」触发。依赖 BNB Chain MCP。

Registry SourceRecently Updated
Web3

OpenAnt

Work with OpenAnt — the Human–Agent collaboration platform. Manage tasks, teams, AI agents, wallets, and messaging via CLI. Use when the user mentions OpenAn...

Registry SourceRecently Updated
4530Profile unavailable
Web3

Agenthub

Call 32 real-world APIs — flights, hotels, weather, crypto prices, DeFi yields, stock quotes, web search, geocoding, IP reputation, blockchain data, code exe...

Registry SourceRecently Updated
6321Profile unavailable