/****************************************************************************** * * (C) 2022 AhnLab Blockchain Company, Inc. All rights reserved. * Any part of this source code can not be copied with any method without * prior written permission from the author or authorized person. * ******************************************************************************/ /// import { BigNumber, ethers, UnsignedTransaction } from 'ethers'; import { Account } from '../../schema/model'; export declare enum TX_SOURCE { TRANSFER = 0, ONETIME_DAPP = 1, REGISTER_AUTOCONFIRM = 2, AUTOCONFIRM = 3, ERC20 = 4, SPEEDUP = 5, CANCEL = 6 } export interface MakeUnsignedTxInput { to: string; from: string; value: number; data?: Buffer; gasPrice?: string; gas?: string; nonce?: number; chainId?: number; } export interface SendTxInput { to: string; value?: string; chainId?: number; from?: string; data?: string; gas?: string; nonce?: number; gasLimit?: string; domainName?: string; funcName?: string; resolve?: any; reject?: any; txType?: string; type?: string; payload: any; feeRatio?: string; gasPrice?: string; maxFeePerGas?: string; maxPriorityFeePerGas?: string; } export interface SendTokenTxInput { to: string; value?: string; chainId?: number; from?: string; data?: string; gas?: string; nonce?: number; gasLimit?: string; domainName?: string; funcName?: string; resolve?: any; reject?: any; txType?: string; type?: string; payload: any; feeRatio?: string; gasPrice?: string; maxFeePerGas?: string; maxPriorityFeePerGas?: string; tokenSymbol: string; assetId: string; tokenDecimal: number; contractAddress: string; mpcToken?: string; } export interface AddTxInput { txParams?: TxParams; type?: TX_SOURCE; autoconfirm?: Autoconfirm; payload?: any; res?: any; tabId?: any; dappAlertId?: string; network: NetworkModel; account: AppAccount; resolve?: any; reject?: Function; dappInfo?: any; txSource: TX_SOURCE; txId?: string; nonce?: number; txType?: TxType; maxFeePerGas?: string; maxPriorityFeePerGas?: string; dappResolve?: any; dappReject?: any; tokenInfo?: TokenInfo; tokenSendTo?: string; releaseLock?: Function; } export interface AppAccount extends Account { index?: string; hdPath?: string; accountDetail?: any; } export interface TokenInfo { tokenSymbol: string; assetId: string; tokenDecimal: number; contractAddress: string; } export interface createUnsignedTxForTransferingNativeCurrencyDto { gasPrice?: string; maxFeePerGas?: string; maxPriorityFeePerGas?: string; to: string; value: string; chainId: number; gasLimit: string; txType?: TxType; nonce?: string; } export interface CreateUnsignedTxForTransferingTokenDto { to: string; gasPrice?: string; maxFeePerGas?: string; maxPriorityFeePerGas?: string; value: string; chainId: number; gasLimit: string; txType: TxType; nonce: string; decimal: number; contractAddress: string; } export interface TxParams { to: string; value?: string; gasPrice?: string; gasLimit: string; chainId: number; data?: string; type?: string | number; feeRatio?: string; maxFeePerGas?: string; maxPriorityFeePerGas?: string; tokenSymbol?: string; assetId?: string; tokenDecimal?: number; contractAddress?: string; nonce?: number; } export interface Autoconfirm { tabId: number; dappAlertId: string; } export interface AssetModel { id: string; decimal: number; balance: string; formattedBalance: string; name?: string; iconUrl?: string; symbol?: string; networkId?: string; contractAddress?: string; address?: string; hide?: boolean; createdAt?: number; } export interface GasFeeModel { estimatedGasFeeTimeBounds: any; gasEstimateType: string; gasFeeEstimates: { estimatedBaseFee: string; high: GasFeeEstimateItem; medium: GasFeeEstimateItem; low: GasFeeEstimateItem; }; } export interface GasFeeEstimateItem { maxWaitTimeEstimate: number; minWaitTimeEstimate: number; suggestedMaxFeePerGas: string; suggestedMaxPriorityFeePerGas: string; } export interface ConnectedDomainModel { domainName: string; accountIds: number[]; aaid: number; iconUrl: string; id: string; } export interface RequestTxApprovalInput { userId: number; walletId: number; pubKey?: string; unsignedTx: UnsignedTransaction; hash: string; } export interface MpcSignInput { txHash: string; mpcToken: string; accountId: number; } export interface MpcUnlockDto { hashMessage: string; EncPV: string; password: string; } export interface DappTxInput { from?: string; to?: string; domainName: string; data?: string; funcName: string; gasPrice?: string; gasLimit: string; res?: any; payload?: any; value?: string; network?: NetworkModel; gas?: any; defaultGasLimit?: any; klayType?: string; feeRatio?: string; chainId: number; maxPriorityFeePerGas?: string; maxFeePerGas?: string; baseFeePerGas?: string; gasFee?: any; resolve?: any; reject?: any; } export interface GetEstimateGasLimitDto { contractAddress: string; to: string; } export interface DappTxReqParam { data: string; from: string; gasPrice?: string; gas?: string; to: string; value: string; type?: string; feeRatio?: string; } export interface EtherscanTx { blockNumber: string; timeStamp: string; hash: string; nonce: string; blockHash: string; transactionIndex: string; from: string; to: string; value: string; gas: string; gasPrice: string; isError: string; txreceipt_status: string; input: string; contractAddress: string; cumulativeGasUsed: string; gasUsed: string; confirmations: string; maxPriorityFeePerGas?: string; maxFeePerGas?: string; } export interface DappTx { from: string; to: string; timeStamp: string; value: string; txType: string; status: TxStatus; gasPrice: BigNumber; gasLimit: string; hash: string; domainName: string; funcName: string; autoconfirm: boolean; chainId: number; networkId: string; } export interface QueueTx extends ethers.providers.TransactionResponse { status: TxStatus; timeStamp: string; isTokenTx?: boolean; } export interface NetworkModel { id: string; name: string; rpcUrl: string; chainId: number; target: string; isCustom: boolean; symbol?: string; blockExplorerUrl?: string; iconUrl?: string; EIPS?: { '1559': boolean; }; assetName?: string; } export interface SuggestedTokenModel { image?: string; address: string; balance: string; decimals: number; symbol: string; tokenName: string; } export declare enum TxStatus { FAILED = "failed", DROPPED = "dropped", APPROVED = "approved", SUMMITTED = "submitted", CONFIRMED = "confirmed" } export declare enum TxType { CANCEL = "cancel", RETRY = "retry", TOKEN_METHOD_TRANSFER = "transfer", TOKEN_METHOD_TRANSFER_FROM = "transferfrom", TOKEN_METHOD_APPROVE = "approve", INCOMING = "incoming", SENT_ETHER = "sentEther", CONTRACT_INTERACTION = "contractInteraction", DEPLOY_CONTRACT = "contractDeployment" } export declare enum TxEventKey { CANCEL = "cancel", RETRY = "retry", APPROVED = "approved", SUMMITTED = "submitted", CONFIRMED = "confirmed" } export interface TxModel { id: string; hash?: string; to: string; from: string; value: string; gasPrice: string; status: TxStatus; chainId: number; assetId?: string; timeStamp?: string; domainName?: string; funcName?: string; isAutoconfirm?: boolean; tokenSymbol?: string; tokenDecimal?: number; contractAddress?: string; symbol?: string; nonce: number; aaid: number; gasLimit: string; history?: TxHistory[]; data?: string; type?: string; txSource: TX_SOURCE; txType?: TxType; tabId?: number; dappAlertId?: string; confirmations?: number; maxPriorityFeePerGas?: string; maxFeePerGas?: string; networkId: string; signer?: string; } export interface IncomingTxModel { id: string; hash?: string; to: string; from: string; value: string; gasPrice: string; gasUsed?: string; blockNumber?: string; status: TxStatus; chainId: number; assetId?: string; timeStamp?: string; aaid: number; tokenSymbol?: string; tokenDecimal?: number; symbol?: string; maxFeePerGas?: string; maxPriorityFeePerGas?: string; } export interface TxHistory { eventKey: string; gasPrice?: string; value?: string; timestamp: number; message?: string; } export interface GasnowDataModel { rapid: Number; fast: Number; standard: Number; slow: Number; } export interface GasDataModel { gasPrice?: string; maxFeePerGas?: string; maxPriorityFeePerGas?: string; } export interface LedgerUpdateTxToFailedDto { txId: string; message: string; }