import {IChains} from "../chains"; import {IReturnResult} from "../../config"; export interface ITron extends IChains { // 方法名称 readonly functionName: ITronFunctionName // 获取 ethers.js utils方法 readonly getUtils: () => any // 获取手续费 readonly getFee: (gasLimit: string, gasPrice: string) => string // 获取 new TronWeb() readonly getWallet: (privateKey?: string) => any // 获取合约 readonly getContract: (address: string, abi: string, privateKey?: string) => any // 将地址转换成hex readonly getAddressToHex: (address: string) => string // 将hex转换成地址 readonly getAddressFromHex: (address: string) => string // 将Trx地址转换成Evm地址 readonly getAddrToEvm: (address: string) => string // 将Evm地址转换成Trx地址 readonly getEvmToAddr: (address: string) => string // 获取 encodeParams readonly getEncodeParams: (address: string) => Promise // 获取地址授权额度 readonly getAllowance: (address: string, exchangeAddress: string, contractAddress: string, abi: string) => Promise> // 签名授权额度 readonly signApprove: (privateKey: string, exchangeAddress: string, contractAddress: string, abi: string, value?: string) => Promise> // 签名交易 readonly signTransaction: (privateKey: string | undefined, contract: string, functionName: string, feeLimit: number, params: ITronSignTransactionParams[]) => Promise> // api readonly api: IApi } export interface IApi { // 获取trc20交易记录 getTxListTrc20: (type: string, address: string, size: number) => Promise // 获取交易记录 getTxList: (type: string, address: string, size: number) => Promise // 获取账户详细 getAccounts: (address: string) => Promise getTrc10Details: (contract: string) => Promise } export type ITronSignTransactionParams = { type: string, value: any } // 方法名称 export type ITronFunctionName = { // 交易 transfer: 'transfer(address,uint256)', // 授权 approve: 'approve(address,uint256)' }