/// import { CoinFamily, BaseCoin as StaticsBaseCoin } from '@aloe2/statics'; import { BaseCoin, BitGoBase, KeyPair, ParsedTransaction, ParseTransactionOptions, SignedTransaction, SignTransactionOptions, TransactionExplanation, TransactionFee, TransactionPrebuild as BaseTransactionPrebuild, TransactionRecipient as Recipient, VerifyAddressOptions, VerifyTransactionOptions } from '@aloe2/sdk-core'; import { Interface } from './lib'; export declare const MINIMUM_TRON_MSIG_TRANSACTION_FEE = 1000000; export interface TronSignTransactionOptions extends SignTransactionOptions { txPrebuild: TransactionPrebuild; prv: string; } export interface TxInfo { recipients: Recipient[]; from: string; txid: string; } export interface TronTransactionExplanation extends TransactionExplanation { expiration: number; timestamp: number; } export interface TransactionPrebuild extends BaseTransactionPrebuild { txHex: string; txInfo: TxInfo; feeInfo: TransactionFee; } export interface ExplainTransactionOptions { txHex?: string; halfSigned?: { txHex: string; }; feeInfo: TransactionFee; } export interface RecoveryOptions { userKey: string; backupKey: string; bitgoKey: string; recoveryDestination: string; krsProvider?: string; walletPassphrase?: string; } export interface RecoveryTransaction { tx: TransactionPrebuild; recoveryAmount: number; } export declare enum NodeTypes { Full = 0, Solidity = 1 } /** * This structure is not a complete model of the AccountResponse from a node. */ export interface AccountResponse { address: string; balance: number; owner_permission: { keys: [Interface.PermissionKey]; }; active_permission: [{ keys: [Interface.PermissionKey]; }]; } export declare class Trx extends BaseCoin { protected readonly _staticsCoin: Readonly; constructor(bitgo: BitGoBase, staticsCoin?: Readonly); getChain(): string; getFamily(): CoinFamily; getFullName(): string; getBaseFactor(): number; /** @inheritdoc */ transactionDataAllowed(): boolean; static createInstance(bitgo: BitGoBase, staticsCoin?: Readonly): BaseCoin; /** * Flag for sending value of 0 * @returns {boolean} True if okay to send 0 value, false otherwise */ valuelessTransferAllowed(): boolean; /** * Checks if this is a valid base58 or hex address * @param address */ isValidAddress(address: string): boolean; /** * Checks if this is a valid hex address * @param address hex address */ isValidHexAddress(address: string): boolean; /** * Generate ed25519 key pair * * @param seed * @returns {Object} object with generated pub, prv */ generateKeyPair(seed?: Buffer): KeyPair; isValidXpub(xpub: string): boolean; isValidPub(pub: string): boolean; parseTransaction(params: ParseTransactionOptions): Promise; isWalletAddress(params: VerifyAddressOptions): boolean; verifyTransaction(params: VerifyTransactionOptions): Promise; /** * Assemble keychain and half-sign prebuilt transaction * * @param params * @param params.txPrebuild {Object} prebuild object returned by platform * @param params.prv {String} user prv * @param params.wallet.addressVersion {String} this is the version of the Algorand multisig address generation format * @returns Bluebird */ signTransaction(params: TronSignTransactionOptions): Promise; /** * Return boolean indicating whether input is valid seed for the coin * * @param prv - the prv to be checked */ isValidXprv(prv: string): boolean; /** * Convert a message to string in hexadecimal format. * * @param message {Buffer|String} message to sign * @return the message as a hexadecimal string */ toHexString(message: string | Buffer): string; /** * Sign message with private key * * @param key * @param message */ signMessage(key: KeyPair, message: string | Buffer): Promise; /** * Converts an xpub to a uncompressed pub * @param xpub */ xpubToUncompressedPub(xpub: string): string; /** * Modify prebuild before sending it to the server. * @param buildParams The whitelisted parameters for this prebuild */ getExtraPrebuildParams(buildParams: any): Promise; pubToHexAddress(pub: string): string; xprvToCompressedPrv(xprv: string): string; /** * Make a query to Trongrid for information such as balance, token balance, solidity calls * @param query {Object} key-value pairs of parameters to append after /api * @returns {Object} response from Trongrid */ private recoveryPost; /** * Query our explorer for the balance of an address * @param address {String} the address encoded in hex * @returns {BigNumber} address balance */ private getAccountFromNode; /** * Retrieves our build transaction from a node. * @param toAddr hex-encoded address * @param fromAddr hex-encoded address * @param amount */ private getBuildTransaction; /** * Throws an error if any keys in the ownerKeys collection don't match the keys array we pass * @param ownerKeys * @param keys */ checkPermissions(ownerKeys: { address: string; weight: number; }[], keys: string[]): void; /** * Builds a funds recovery transaction without BitGo. * We need to do three queries during this: * 1) Node query - how much money is in the account * 2) Build transaction - build our transaction for the amount * 3) Send signed build - send our signed build to a public node * @param params */ recover(params: RecoveryOptions): Promise; /** * Explain a Tron transaction from txHex * @param params */ explainTransaction(params: ExplainTransactionOptions): Promise; } //# sourceMappingURL=trx.d.ts.map