@tatumio/tron-connector
Version:
Tron Connector for Tatum API
117 lines (116 loc) • 3.58 kB
TypeScript
import { PinoLogger } from 'nestjs-pino';
import { CreateTronTrc10, CreateTronTrc20, FreezeTron, TransferTron, TransferTronTrc10, TransferTronTrc20, TronAccount, TronBlock, TronTransaction, TronTrc10 } from '@tatumio/tatum';
import { Trc20Tx } from './dto/Trc20Tx';
export declare abstract class TronService {
protected readonly logger: PinoLogger;
private static mapTransaction;
private static mapTransaction20;
private getNodeAddress;
protected constructor(logger: PinoLogger);
protected abstract isTestnet(): Promise<boolean>;
protected abstract getNodesUrl(testnet: boolean): Promise<string[]>;
protected abstract getApiKey(): string;
protected abstract getScanningApiKey(): string;
protected abstract storeKMSTransaction(txData: string, currency: string, signatureId: string[], index?: number): Promise<string>;
protected abstract completeKMSTransaction(txId: string, signatureId: string): Promise<void>;
broadcast(txData: string, signatureId?: string): Promise<{
txId: any;
failed: boolean;
} | {
txId: any;
failed?: undefined;
}>;
getBlockChainInfo(testnet?: boolean): Promise<{
testnet: boolean;
hash: string;
blockNumber: number;
}>;
getBlock(hashOrHeight: string, testnet?: boolean): Promise<TronBlock>;
getTransaction(txId: string, testnet?: boolean): Promise<TronTransaction>;
getAccount(address: string): Promise<TronAccount>;
getTransactionsByAccount(address: string, next?: string): Promise<{
transactions: TronTransaction[];
internalTransactions: TronTransaction[];
next?: string;
}>;
getTrc20TransactionsByAccount(address: string, next?: string): Promise<{
transactions: Trc20Tx[];
next?: string;
}>;
generateWallet(mnem?: string): Promise<{
mnemonic: string;
} | {
address: string;
privateKey: string;
} | {
privateKey: string;
address: string;
} | {
address: string;
secret: string;
} | {
address: any;
secret: any;
}>;
generateAddress(xpub: string, i: number): Promise<{
address: any;
}>;
generatePrivateKey(mnemonic: string, i: number): Promise<{
key: string;
}>;
sendTransaction(body: TransferTron): Promise<{
txId: any;
failed: boolean;
} | {
txId: any;
failed?: undefined;
} | {
signatureId: string;
}>;
sendTrc10Transaction(body: TransferTronTrc10): Promise<{
txId: any;
failed: boolean;
} | {
txId: any;
failed?: undefined;
} | {
signatureId: string;
}>;
sendTrc20Transaction(body: TransferTronTrc20): Promise<{
txId: any;
failed: boolean;
} | {
txId: any;
failed?: undefined;
} | {
signatureId: string;
}>;
createTrc10Transaction(body: CreateTronTrc10): Promise<{
txId: any;
failed: boolean;
} | {
txId: any;
failed?: undefined;
} | {
signatureId: string;
}>;
createTrc20Transaction(body: CreateTronTrc20): Promise<{
txId: any;
failed: boolean;
} | {
txId: any;
failed?: undefined;
} | {
signatureId: string;
}>;
freezeBalance(body: FreezeTron): Promise<{
txId: any;
failed: boolean;
} | {
txId: any;
failed?: undefined;
} | {
signatureId: string;
}>;
getTrc10Detail(id: string): Promise<TronTrc10>;
}