Axionvera SDK provides a small, modular TypeScript API for interacting with Axionvera Soroban smart contracts on Stellar. The core design goals are:
- Minimal surface area and predictable behavior
- Testability without live network dependencies (mockable RPC)
- Separation of concerns between network, transaction building, wallet signing, and contract modules
StellarClient is the gateway to Soroban RPC. It is responsible for:
- Connecting to a Soroban RPC endpoint
- Fetching accounts
- Simulating and preparing Soroban transactions
- Submitting transactions and polling for completion
networkConfig centralizes default network configuration:
- Testnet/mainnet defaults
- Network passphrase resolution
- Override support for custom RPC URLs
transactionBuilder builds contract-call transactions:
- Converts common JS/TS values into Soroban
ScVal - Produces
invokeHostFunctionoperations viaContract.call - Builds transactions that can be simulated/prepared by Soroban RPC
WalletConnector is a small interface designed to work in browsers and backends:
getPublicKey()returns the source account public keysignTransaction(xdr, networkPassphrase)returns a signed transaction XDR
The SDK includes a LocalKeypairWalletConnector implementation for Node.js usage and testing.
Contract modules provide developer-friendly APIs for specific Axionvera contracts. Each module:
- Knows the contract ID
- Exposes named methods (deposit/withdraw/etc.)
- Uses
StellarClient+WalletConnectorto build, simulate, prepare, sign, and submit transactions
VaultContract is the initial module and serves as the reference implementation for future modules.
To add a new contract module:
- Add a new file under
src/contracts/ - Implement a class that accepts
{ client, contractId, wallet? } - Reuse
transactionBuilderhelpers for contract calls - Export the module from
src/index.ts - Add Jest tests under
tests/
- Add additional contract modules (staking, governance)
- Add stronger argument typing per contract ABI
- Add richer wallet adapters (browser extension wallets, external signing)
- Add higher-level helpers for contract state queries and decoding