slipstream-sdk
v1.0.3
Published
TypeScript SDK for Slipstream Proxy Server
Downloads
22
Maintainers
Readme
Slipstream SDK
Slipstream SDK is a TypeScript library for interacting with the Slipstream relayer service. It enables seamless gasless transactions and provides easy access to relayer health, transaction status, fee estimation, relayer information, and network limits.
Features
- Health Checks: Ping the relayer and check its uptime and supported chains.
- Transaction Relaying: Relay gasless transactions across supported networks.
- Fee Estimation: Get fee estimates for transactions.
- Status Tracking: Query the status of submitted transactions.
- Relayer Information: Fetch relayer details, supported chains, and balances.
- Safety Limits: Retrieve network fee settings and limits.
Installation
npm install slipstream-sdkUsage
import { SlipstreamSDK, SlipstreamSDKConfig } from "slipstream-sdk";
const config: SlipstreamSDKConfig = { timeout: 30000 };
const sdk = new SlipstreamSDK(config);
// Health check
const health = await sdk.ping();
// Relay transaction
const relayResponse = await sdk.relayTransaction({
chainId: 84532,
request: {
fromAddress: "...",
toAddress: "...",
tokenContract: "...",
transferAmount: "...",
relayerServiceFee: "...",
transactionNonce: "...",
expirationDeadline: "..."
},
signature: "..."
});
// Get transaction status
const status = await sdk.getTransactionStatus("0xTransactionHash");
// Estimate fee
const fee = await sdk.getFeeEstimate({
chainId: "84532",
tokenSymbol: "ETH",
amount: "0.1"
});API Overview
ping(): Get relayer health status.pingRelayer(): Detailed relayer health.relayTransaction(body: RelayRequest): Relay a gasless transaction.getTransactionStatus(hash: string): Check transaction status.getFeeEstimate(params): Estimate transaction fee.getRelayerInfo(): Fetch relayer info.getSafetyLimits(chainId: string): Get network fee limits.getNetworkStatus(chainId: string): Check network status.
Configuration
You can configure the SDK with an optional timeout:
const config: SlipstreamSDKConfig = {
timeout: 30000 // in milliseconds
};Supported Chains
The SDK supports multiple chains, including Kadena, Base, and Arbitrum. See src/types/transaction.ts for details.
License
MIT
