stable-layer-sdk

Web & Frontend Development
v1.0.0
Benign

A TypeScript SDK for interacting with the Stable Layer protocol on the Sui blockchain.

558 downloads558 installsby @k66inthesky

Setup & Installation

Install command

clawhub install k66inthesky/stable-layer-sdk

If the CLI is not installed:

Install command

npx clawhub@latest install k66inthesky/stable-layer-sdk

Or install with OpenClaw CLI:

Install command

openclaw skills install k66inthesky/stable-layer-sdk

or paste the repo link into your assistant's chat

Install command

https://github.com/openclaw/skills/tree/main/skills/k66inthesky/stable-layer-sdk

What This Skill Does

TypeScript SDK for the Stable Layer protocol on the Sui blockchain. Supports minting and burning stablecoins by depositing or redeeming USDC, and claiming yield farming rewards from vault farms.

Wraps raw Sui transaction construction into typed methods, removing the need to manually compose Move calls for minting, burning, and reward claiming.

When to Use It

  • Minting BtcUSDC by depositing USDC on Sui mainnet
  • Burning stablecoins to redeem USDC
  • Claiming accumulated yield farming rewards
  • Querying total stablecoin supply across coin types
  • Integrating Stable Layer transactions into a dApp
View original SKILL.md file
# 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

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

## API Reference

### StableLayerClient

```typescript
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.

| Parameter       | Type          | Description                                      |
| --------------- | ------------- | ------------------------------------------------ |
| `tx`            | `Transaction` | Sui transaction object                           |
| `stableCoinType`| `string`      | Target stablecoin type (e.g. `0x...::btc_usdc::BtcUSDC`) |
| `usdcCoin`      | `Coin`        | Input USDC coin reference                        |
| `amount`        | `bigint`      | Amount to mint                                   |
| `autoTransfer`  | `boolean?`    | If `false`, returns the resulting Coin object     |

#### `buildBurnTx(options)`

Burn stablecoins to redeem USDC.

| Parameter       | Type          | Description                          |
| --------------- | ------------- | ------------------------------------ |
| `tx`            | `Transaction` | Sui transaction object               |
| `stableCoinType`| `string`      | Stablecoin type to burn              |
| `amount`        | `bigint?`     | Specific amount to burn              |
| `all`           | `boolean?`    | If `true`, burn entire balance       |

#### `buildClaimTx(options)`

Claim accumulated yield farming rewards.

| Parameter       | Type          | Description                          |
| --------------- | ------------- | ------------------------------------ |
| `tx`            | `Transaction` | Sui transaction object               |
| `stableCoinType`| `string`      | Stablecoin 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

```typescript
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

```typescript
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

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

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

### Query Supply

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

Example Workflow

Here's how your AI assistant might use this skill in practice.

INPUT

User asks: Minting BtcUSDC by depositing USDC on Sui mainnet

AGENT
  1. 1Minting BtcUSDC by depositing USDC on Sui mainnet
  2. 2Burning stablecoins to redeem USDC
  3. 3Claiming accumulated yield farming rewards
  4. 4Querying total stablecoin supply across coin types
  5. 5Integrating Stable Layer transactions into a dApp
OUTPUT
A TypeScript SDK for interacting with the Stable Layer protocol on the Sui blockchain.

Share this skill

Security Audits

VirusTotalBenign
OpenClawBenign
View full report

These signals reflect official OpenClaw status values. A Suspicious status means the skill should be used with extra caution.

Details

LanguageMarkdown
Last updatedMar 1, 2026