Skip to main content

SDK Reference

The VelumX SDK is the primary way for developers to interact with the gasless transaction infrastructure.

Installation

npm install @velumx/sdk

Initialization

Always initialize the VelumXClient with a reference to your secure backend proxy.
import { VelumXClient } from '@velumx/sdk';

const velumx = new VelumXClient({
  paymasterUrl: '/api/velumx/proxy', // Point to your backend proxy
  network: 'mainnet'
});

Core Methods

estimateFee()

Estimates the required fee in your chosen SIP-010 token based on estimated gas units.
const estimate = await velumx.estimateFee({
  estimatedGas: 100000
});
The modern, comprehensive method for requesting Stacks-native sponsorship for any transaction.
const result = await velumx.sponsor(signedTx, {
  feeAmount: '250000', // e.g. 0.25 USDCx
  userId: 'optional-user-id'
});

executeGenericAction() (Coming Soon)

A high-level wrapper for performing any supported protocol action without manual contract encoding.