airgap-coin-lib
Version:
The airgap-coin-lib is a protocol agnostic library to prepare, sign and broadcast cryptocurrency transactions.
70 lines (69 loc) • 4.43 kB
TypeScript
import BigNumber from '../../../../dependencies/src/bignumber.js-9.0.0/bignumber';
import { SubstrateNetwork } from '../../SubstrateNetwork';
import { SubstrateAccountInfo } from '../data/account/SubstrateAccountInfo';
import { SubstrateAddress } from '../data/account/SubstrateAddress';
import { SubstrateRegistration } from '../data/account/SubstrateRegistration';
import { SubstrateCall } from '../data/metadata/decorator/call/SubstrateCall';
import { SCALEAccountId } from '../data/scale/type/SCALEAccountId';
import { SCALEArray } from '../data/scale/type/SCALEArray';
import { SCALECompactInt } from '../data/scale/type/SCALECompactInt';
import { SCALEData } from '../data/scale/type/SCALEData';
import { SCALETuple } from '../data/scale/type/SCALETuple';
import { SubstrateActiveEraInfo } from '../data/staking/SubstrateActiveEraInfo';
import { SubstrateEraElectionStatus } from '../data/staking/SubstrateEraElectionStatus';
import { SubstrateEraRewardPoints } from '../data/staking/SubstrateEraRewardPoints';
import { SubstrateExposure } from '../data/staking/SubstrateExposure';
import { SubstrateNominations } from '../data/staking/SubstrateNominations';
import { SubstratePayee } from '../data/staking/SubstratePayee';
import { SubstrateSlashingSpans } from '../data/staking/SubstrateSlashingSpans';
import { SubstrateStakingLedger } from '../data/staking/SubstrateStakingLedger';
import { SubstrateValidatorPrefs } from '../data/staking/SubstrateValidatorPrefs';
import { SubstrateRuntimeVersion } from '../data/state/SubstrateRuntimeVersion';
import { SubstrateTransactionType } from '../data/transaction/SubstrateTransaction';
import { SubstrateNodeCache } from './SubstrateNodeCache';
export declare class SubstrateNodeClient {
private readonly network;
private readonly baseURL;
private readonly cache;
private metadata;
private runtimeVersion;
private readonly lastFees;
private initApiPromise;
constructor(network: SubstrateNetwork, baseURL: string, cache?: SubstrateNodeCache);
getAccountInfo(address: SubstrateAddress): Promise<SubstrateAccountInfo | null>;
getExistentialDeposit(): Promise<BigNumber>;
getTransactionMetadata(type: SubstrateTransactionType): Promise<SubstrateCall>;
getTransferFeeEstimate(transactionBytes: Uint8Array | string): Promise<BigNumber | null>;
saveLastFee(type: SubstrateTransactionType, fee: BigNumber): void;
getSavedLastFee(type: SubstrateTransactionType, defaultValue?: 'null' | 'largest'): BigNumber | null;
getFirstBlockHash(): Promise<string | null>;
getLastBlockHash(): Promise<string | null>;
getCurrentHeight(): Promise<BigNumber>;
getCurrentEraIndex(): Promise<BigNumber | null>;
getRuntimeVersion(): Promise<SubstrateRuntimeVersion | null>;
getBonded(address: SubstrateAddress): Promise<SubstrateAddress | null>;
getNominations(address: SubstrateAddress): Promise<SubstrateNominations | null>;
getRewardPoints(eraIndex: number): Promise<SubstrateEraRewardPoints | null>;
getValidatorReward(eraIndex: number): Promise<BigNumber | null>;
getStakersClipped(eraIndex: number, validator: SubstrateAddress): Promise<SubstrateExposure | null>;
getRewardDestination(address: SubstrateAddress): Promise<SubstratePayee | null>;
getStakingLedger(address: SubstrateAddress): Promise<SubstrateStakingLedger | null>;
getValidators(): Promise<SubstrateAddress[] | null>;
getValidatorExposure(eraIndex: number, address: SubstrateAddress): Promise<SubstrateExposure | null>;
getElectionStatus(): Promise<SubstrateEraElectionStatus | null>;
getIdentityOf(address: SubstrateAddress): Promise<SubstrateRegistration | null>;
getSuperOf(address: SubstrateAddress): Promise<SCALETuple<SCALEAccountId, SCALEData> | null>;
getSubsOf(address: SubstrateAddress): Promise<SCALETuple<SCALECompactInt, SCALEArray<SCALEAccountId>> | null>;
getValidatorPrefs(eraIndex: number, address: SubstrateAddress): Promise<SubstrateValidatorPrefs | null>;
getExpectedEraDuration(): Promise<BigNumber | null>;
getActiveEraInfo(): Promise<SubstrateActiveEraInfo | null>;
getSlashingSpan(address: SubstrateAddress): Promise<SubstrateSlashingSpans | null>;
submitTransaction(encoded: string): Promise<string>;
private getBlockHash;
private fromStorage;
private getCall;
private getConstant;
private initApi;
private initCache;
private send;
}