TypeScript SDK
Official TypeScript SDK for Limen
Installation
Install via npm, yarn, or pnpm
npm install @limen/sdkAPI Reference
Complete API documentation
Documentation
Guides and tutorials
Installation
Install the Limen SDK using your preferred package manager
npm install @limen/sdk
# or
yarn add @limen/sdk
# or
pnpm add @limen/sdkQuick Start
Basic usage example with the SDK
import { Limen } from '@limen/sdk';
// Initialize SDK
const limen = new Limen({
sequencerUrl: 'http://localhost:8545',
suiRpcUrl: 'https://fullnode.testnet.sui.io',
rollupId: '0x...',
});
// Get balance
const balance = await limen.getBalance('0x...');
// Send transaction
const txHash = await limen.sendTransaction({
from: '0x...',
to: '0x...',
value: BigInt('1000000000'), // 1 SUI (9 decimals)
signature: '0x...',
});
// Wait for confirmation
const receipt = await limen.waitForTransaction(txHash);API Methods
Complete list of available SDK methods
Account
getBalance(address: string)Get account balance on L3
Returns:
Promise<bigint>getAccount(address: string)Get full account information
Returns:
Promise<AccountInfo>Transactions
sendTransaction(tx: SignedTransaction)Send a signed transaction to L3
Returns:
Promise<string>getTransactionReceipt(txHash: string)Get transaction receipt
Returns:
Promise<TransactionReceipt | null>waitForTransaction(txHash: string)Wait for transaction confirmation
Returns:
Promise<TransactionReceipt>Bridge
deposit(l3Address: string, amount: bigint)Deposit SUI from L1 to L3
Returns:
Promise<string>initiateWithdrawal(recipient: string, amount: bigint)Initiate withdrawal from L3 to L1
Returns:
Promise<string>State
getStateRoot()Get current state root
Returns:
Promise<string>getBatchNumber()Get current batch number
Returns:
Promise<number>