@polareum/waas-sdk
v3.0.0-beta
Published
TypeScript SDK for Polareum WAAS Server
Maintainers
Readme
Polareum WAAS SDK (TypeScript)
@polareum/waas-sdk is the TypeScript/Node.js client library for Polareum WAAS Server. It exposes a typed API that follows the server path structure, so your code can call wallets, admin, network, EVM, UTXO, and supported blockchain endpoints without manually building HTTP requests.
Installation
npm install @polareum/waas-sdkBasic Usage
import { WaasClient } from '@polareum/waas-sdk';
const options = {
baseUrl: 'https://waas.polareum.com',
apiKey: 'your-api-key',
};
const client = new WaasClient(options);
const wallets = await client.wallets.listWallets({
Page: 1,
PageSize: 20,
});
const wallet = await client.wallets.generate.randomeKey({
body: {
name: 'main-wallet',
exportable: false,
},
});API Groups
The root client is organized by WAAS API path:
client.admin.wallets
client.admin.networks
client.wallets
client.wallets.generate
client.wallets.import
client.networks
client.evm
client.evm.erc20
client.evm.erc721
client.evm.erc1155
client.evm.burnable
client.evm.pausable
client.utxo
client.cardano
client.near
client.polkadot
client.ripple
client.solana
client.stellar
client.sui
client.ton
client.tronAdmin Examples
const adminWallets = await client.admin.wallets.listWallets({
Page: 1,
PageSize: 50,
ApiKeyId: undefined,
Name: undefined,
PartialName: undefined,
OrderBy: undefined,
});
const networks = await client.admin.networks.listNetworks({
Page: 1,
PageSize: 50,
Name: undefined,
PartialName: undefined,
OrderBy: undefined,
});Wallet Examples
const importedWallet = await client.wallets.import.privateKey({
body: {
name: 'imported-wallet',
privateKeyHex: '0x...',
chainCodeHex: undefined,
exportable: false,
},
});
const address = await client.wallets.getAddress({
WalletReference: 'main-wallet',
NetworkReference: 'ethereum-mainnet',
StoreAddress: true,
});
const exported = await client.wallets.export({
ref: 'main-wallet',
});EVM Examples
const nativeBalance = await client.evm.balanceOf({
NetworkReference: 'ethereum-mainnet',
Address: '0x1234...',
});
const transfer = await client.evm.transfer({
body: {
networkReference: 'ethereum-mainnet',
from: 'main-wallet',
toAddress: '0xabcd...',
amount: 0.1,
},
});
const erc20Balance = await client.evm.erc20.balanceOf({
NetworkReference: 'ethereum-mainnet',
TokenAddress: '0xtoken...',
Address: '0x1234...',
});UTXO Example
const utxoBalance = await client.utxo.balanceOf({
NetworkReference: 'bitcoin-mainnet',
Address: 'bc1...',
});
const tx = await client.utxo.transfer({
body: {
networkReference: 'bitcoin-mainnet',
from: 'main-wallet',
toAddress: 'bc1receiver...',
amount: 0.001,
},
});Notes
- Each method includes generated JSDoc comments for endpoint intent and parameter/response models.
- The API key is sent in the
X-API-Keyheader for every request. - All query parameter names are preserved exactly as defined in Swagger (for example:
Page,WalletReference,ref). - The SDK throws
WaasHttpErrorfor non-success responses.
