airgap-coin-lib
Version:
The airgap-coin-lib is a protocol agnostic library to prepare, sign and broadcast cryptocurrency transactions.
50 lines (49 loc) • 2.55 kB
TypeScript
import BigNumber from '../dependencies/src/bignumber.js-9.0.0/bignumber';
import { IAirGapTransaction, IProtocolTransactionCursor, IAirGapTransactionResult } from '../interfaces/IAirGapTransaction';
import { FeeDefaults, ICoinProtocol } from '../protocols/ICoinProtocol';
import { AirGapWallet } from './AirGapWallet';
export declare enum TimeUnit {
Hours = "hours",
Days = "days",
Minutes = "minutes"
}
export interface MarketDataSample {
time: number;
close: number;
high: number;
low: number;
open: number;
volumefrom: number;
volumeto: number;
}
export interface AirGapWalletPriceService {
getCurrentMarketPrice(protocol: ICoinProtocol, baseSymbol: string): Promise<BigNumber>;
getMarketPricesOverTime(protocol: ICoinProtocol, timeUnit: TimeUnit, numberOfMinutes: number, date: Date, baseSymbol: string): Promise<MarketDataSample[]>;
}
export declare class AirGapMarketWallet extends AirGapWallet {
protocol: ICoinProtocol;
publicKey: string;
isExtendedPublicKey: boolean;
derivationPath: string;
priceService: AirGapWalletPriceService;
addressIndex?: number | undefined;
currentBalance: BigNumber | undefined;
_currentMarketPrice: BigNumber | undefined;
_marketPriceOverTime: MarketDataSample[] | undefined;
private synchronizePromise?;
get currentMarketPrice(): BigNumber | undefined;
set currentMarketPrice(marketPrice: BigNumber | undefined);
get marketPriceOverTime(): MarketDataSample[] | undefined;
set marketPriceOverTime(marketPrices: MarketDataSample[] | undefined);
constructor(protocol: ICoinProtocol, publicKey: string, isExtendedPublicKey: boolean, derivationPath: string, priceService: AirGapWalletPriceService, addressIndex?: number | undefined);
synchronize(): Promise<void>;
setProtocol(protocol: ICoinProtocol): Promise<void>;
fetchCurrentMarketPrice(baseSymbol?: string): Promise<BigNumber>;
getMarketPricesOverTime(timeUnit: TimeUnit, numberOfMinutes: number, date: Date, baseSymbol?: string): Promise<MarketDataSample[]>;
private addressesToCheck;
balanceOf(): Promise<BigNumber>;
fetchTransactions(limit: number, cursor?: IProtocolTransactionCursor): Promise<IAirGapTransactionResult>;
getMaxTransferValue(recipients: string[], fee?: string): Promise<BigNumber>;
prepareTransaction(recipients: string[], values: string[], fee: string, data?: unknown): Promise<IAirGapTransaction>;
estimateFees(recipients: string[], values: string[], data?: unknown): Promise<FeeDefaults>;
}