chaingate
Version:
A complete TypeScript library for connecting to and making transactions on different blockchains
69 lines (68 loc) • 2.81 kB
TypeScript
import { CurrencyUtils } from '../CurrencyUtils';
import { EvmCurrencyInfo } from '../../CurrencyInfo';
import { EvmNetworkKey } from '../../../Client';
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';
import { ChainGateContext } from '../ChainGateContext';
export declare class EvmCurrencyUtils<CI extends EvmCurrencyInfo> extends CurrencyUtils<CI> {
currencyInfo: CI;
protected readonly network: EvmNetworkKey;
constructor(context: ChainGateContext, currencyInfo: CI, 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;
}>;
}