UNPKG

@avalanche-sdk/client

Version:

A TypeScript SDK for interacting with the Avalanche network through JSON-RPC APIs. This SDK provides a comprehensive set of tools to interact with all Avalanche chains (P-Chain, X-Chain, C-Chain) and various APIs, including wallet functionality for transa

2 lines (1 loc) 1.23 kB
async function e(e,a){return e.request({method:"avm.buildGenesis",params:a})}async function a(e,a){return{balances:(await e.request({method:"avm.getAllBalances",params:a})).balances.map(e=>({...e,balance:BigInt(e.balance)}))}}async function t(e,a){return e.request({method:"avm.getAssetDescription",params:a})}async function n(e,a){const t=await e.request({method:"avm.getBalance",params:a});return{...t,balance:BigInt(t.balance)}}async function r(e,a){return e.request({method:"avm.getBlock",params:a})}async function s(e,a){return e.request({method:"avm.getBlockByHeight",params:a})}async function u(e){return e.request({method:"avm.getHeight",params:{}})}async function m(e,a){return e.request({method:"avm.getTx",params:a})}async function c(e){return e.request({method:"avm.getTxFee",params:{}})}async function o(e,a){return e.request({method:"avm.getTxStatus",params:a})}async function i(e,a){return e.request({method:"avm.getUTXOs",params:a})}async function p(e,a){return e.request({method:"avm.issueTx",params:a})}export{e as buildGenesis,a as getAllBalances,t as getAssetDescription,n as getBalance,r as getBlock,s as getBlockByHeight,u as getHeight,m as getTx,c as getTxFee,o as getTxStatus,i as getUTXOs,p as issueTx};