Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@cashcat/sdk

TypeScript SDK for CashCat Chain — chain config, tokens, the CCC bridge, real-yield LP staking, and the DEX. Built on viem.

Install

npm i @cashcat/sdk viem

Quick start

import { CashCatSDK, addresses, NATIVE_CASHCAT } from "@cashcat/sdk";
import { parseEther } from "viem";
import { privateKeyToAccount } from "viem/accounts";

// Read-only
const sdk = new CashCatSDK();
await sdk.token.cashcatBalance("0xYou");
await sdk.staking.poolInfo();            // reserves + CCC/CASHCAT price
await sdk.bridge.isSolvent();            // 1:1 bridge invariant

// With a signer (enables writes)
const account = privateKeyToAccount("0x…");
const w = new CashCatSDK({ account });

Tokens

await sdk.token.cccBalance("0xYou");                 // bridged CCC on CashCat Chain
await sdk.token.cccBalanceRobinhood("0xYou");        // original CCC on Robinhood
await w.token.wrap(parseEther("10"));                // CASHCAT -> WCASHCAT
await w.token.unwrap(parseEther("10"));              // WCASHCAT -> CASHCAT

Bridge (Robinhood ⇄ CashCat Chain)

// Deposit CCC on Robinhood -> bridged CCC on CashCat Chain
const { lockNonce } = await w.bridge.deposit({ amount: parseEther("100") });
await w.bridge.waitForMint(account.address, 0n);

// Withdraw: burn bridged CCC -> CCC on Robinhood
const { burnNonce } = await w.bridge.withdraw({ amount: parseEther("50") });
await w.bridge.waitForUnlock(account.address, 0n);

A relayer mints/unlocks automatically (~1 min); the SDK submits the source tx and waits for the destination balance.

Staking (real yield)

// Provide CCC + native CASHCAT liquidity, then stake the LP to earn chain revenue (WCASHCAT)
await w.staking.addLiquidity({ cccAmount: parseEther("7058"), cashcatAmount: parseEther("10") });
await w.staking.stakeAll();

await sdk.staking.pendingRewards(account.address);   // claimable WCASHCAT
await w.staking.claim();                             // getReward
await w.staking.exit();                              // unstake all + claim

DEX (swaps)

// Native CASHCAT -> CCC (routed via WCASHCAT)
const out = await sdk.dex.quote(parseEther("1"), NATIVE_CASHCAT, addresses.tokens.ccc);
await w.dex.swap({ tokenIn: NATIVE_CASHCAT, tokenOut: addresses.tokens.ccc, amountIn: parseEther("1") });

For advanced v3/v4 routing use the Universal Router at addresses.dex.universalRouter (with the non-canonical Permit2 at addresses.dex.permit2).

Chains & addresses

import { cashcat, robinhood, addresses } from "@cashcat/sdk";
// cashcat: viem Chain (id 2274228) · robinhood: viem Chain (id 4663)
// addresses.tokens / .bridge / .staking / .dex — all verified deployments

License

MIT

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages