UNPKG

chaingate

Version:

A complete TypeScript library for connecting to and making transactions on different blockchains

70 lines (69 loc) 2.91 kB
import { CurrencyUtils } from '../CurrencyUtils'; import { Client } from '@hey-api/client-fetch'; import { EvmCurrencyInfo } from '../../CurrencyInfo'; import { EvmNetworkKey, GlobalMarketsResponse } from '../../../Client'; import { TtlCache } from '../../../InternalUtils/TtlCache'; import { CurrencyAmount } from '../CurrencyAmount'; import { Address } from '../../../Wallet/entities/Address'; import { NumberLike } from '../../../InternalUtils/NumberLike'; import { PublicKey } from '../../../Wallet/entities/PublicKey'; import { PrivateKey } from '../../../Wallet/entities/Secret/implementations/PrivateKey'; export declare class EvmCurrencyUtils<CI extends EvmCurrencyInfo> extends CurrencyUtils<CI> { currencyInfo: CI; protected readonly network: EvmNetworkKey; constructor(client: Client, currencyInfo: CI, markets: TtlCache<GlobalMarketsResponse>, network: EvmNetworkKey); addressBalance(address: string): Promise<{ confirmed: CurrencyAmount<CI>; unconfirmed: CurrencyAmount<CI>; }>; addressTransactionCount(address: string): Promise<number>; callSmartContractRaw(smartContractAddress: Address, data: string): Promise<string>; estimateGas(addressFrom: string, addressTo: string, amount: CurrencyAmount<CI>, nonce: NumberLike, data: string): Promise<number>; broadcastTransaction(transactionRaw: string | Uint8Array): Promise<{ transactionId: string; }>; transactionDetails(transactionId: string): Promise<{ amount: CurrencyAmount<CI>; blockHeight: number; addressFrom: string; addressTo: string; gas: import("decimal.js").Decimal; gasPrice: CurrencyAmount<CI>; maxFeePerGas: CurrencyAmount<CI>; maxPriorityFeePerGas: CurrencyAmount<CI>; transfers: { amount: CurrencyAmount<CI>; addressFrom: string; addressTo: string; }[]; }>; getFeeRate(): Promise<import("../../../Client").EvmPossibleFees>; networkStatus(): Promise<import("../../../Client").NetworkStatus>; publicKeyToAddress(publicKey: PublicKey): string; signMessage(message: string | Uint8Array, privateKey: PrivateKey): Promise<string>; verifySignedMessage(message: string, signature: string, address: string): Promise<boolean>; latestBlock(): Promise<{ hash: string; height: number; }>; blockByHeight(blockHeight: number): Promise<{ txs: Array<string>; difficulty: number; nonce: number; sizeBytes: number; timestamp: number; height: number; parentHash: string; hash: string; }>; blockByHash(blockHash: string): Promise<{ txs: Array<string>; difficulty: number; nonce: number; sizeBytes: number; timestamp: number; height: number; parentHash: string; hash: string; }>; }