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) 3.75 kB
async function t(t,e){return t.request({method:"platform.getCurrentValidators",params:e})}async function e(t,e){const a=await t.request({method:"platform.getBalance",params:e});return{...a,balance:BigInt(a.balance),unlocked:BigInt(a.unlocked),lockedNotStakeable:BigInt(a.lockedNotStakeable),lockedStakeable:BigInt(a.lockedStakeable)}}async function a(t,e){return t.request({method:"platform.getBlock",params:e})}async function n(t,e){return t.request({method:"platform.getBlockByHeight",params:e})}async function r(t){return t.request({method:"platform.getBlockchains",params:{}})}async function o(t){const e=await t.request({method:"platform.getFeeConfig",params:{}});return{...e,maxCapacity:BigInt(e.maxCapacity),maxPerSecond:BigInt(e.maxPerSecond),minPrice:BigInt(e.minPrice),targetPerSecond:BigInt(e.targetPerSecond),excessConversionConstant:BigInt(e.excessConversionConstant)}}async function s(t){return t.request({method:"platform.getHeight",params:{}})}async function m(t,e){const a=await t.request({method:"platform.getL1Validator",params:e});return{...a,startTime:BigInt(a.startTime),weight:BigInt(a.weight),...a.minNonce&&{minNonce:BigInt(a.minNonce)},...a.balance&&{balance:BigInt(a.balance)},...a.height&&{height:BigInt(a.height)}}}async function c(t,e){const a=await t.request({method:"platform.getMinStake",params:e});return{minDelegatorStake:BigInt(a.minDelegatorStake),minValidatorStake:BigInt(a.minValidatorStake)}}async function i(t){return t.request({method:"platform.getProposedHeight",params:{}})}async function u(t,e){return t.request({method:"platform.getRewardUTXOs",params:e})}async function p(t,e){return t.request({method:"platform.getStake",params:e})}async function l(t,e){const a=await t.request({method:"platform.getCurrentSupply",params:e});return{supply:BigInt(a.supply)}}async function f(t,e){return t.request({method:"platform.getBlockchainStatus",params:e})}async function g(t){const e=await t.request({method:"platform.getFeeState",params:{}});return{...e,capacity:BigInt(e.capacity),excess:BigInt(e.excess),price:BigInt(e.price)}}async function d(t,e){return t.request({method:"platform.getStakingAssetID",params:e})}async function h(t,e){return t.request({method:"platform.getSubnet",params:e})}async function y(t,e){return t.request({method:"platform.getSubnets",params:e})}async function q(t){return t.request({method:"platform.getTimestamp",params:{}})}async function B(t,e){return t.request({method:"platform.getTotalStake",params:e})}async function k(t,e){return t.request({method:"platform.getTx",params:e})}async function S(t,e){return t.request({method:"platform.getTxStatus",params:e})}async function I(t,e){return t.request({method:"platform.getUTXOs",params:e})}async function x(t,e){return t.request({method:"platform.getAllValidatorsAt",params:e})}async function b(t,e){return t.request({method:"platform.getValidatorsAt",params:e})}async function w(t,e){return t.request({method:"platform.issueTx",params:e})}async function C(t,e){return t.request({method:"platform.sampleValidators",params:e})}async function T(t,e){return t.request({method:"platform.validates",params:e})}async function P(t,e){return t.request({method:"platform.validatedBy",params:e})}export{x as getAllValidatorsAt,e as getBalance,a as getBlock,n as getBlockByHeight,f as getBlockchainStatus,r as getBlockchains,l as getCurrentSupply,t as getCurrentValidators,o as getFeeConfig,g as getFeeState,s as getHeight,m as getL1Validator,c as getMinStake,i as getProposedHeight,u as getRewardUTXOs,p as getStake,d as getStakingAssetID,h as getSubnet,y as getSubnets,q as getTimestamp,B as getTotalStake,k as getTx,S as getTxStatus,I as getUTXOs,b as getValidatorsAt,w as issueTx,C as sampleValidators,P as validatedBy,T as validates};