import { TypedTransaction } from '@ethereumjs/tx'; import { Transaction as BbcTransaction, types } from '@binance-chain/javascript-sdk'; export const SIDE_CHAIN_IDS = [ 'bsc', 'chapel', 'Binance-Chain-Tigris', 'Binance-Chain-Ganges', ] as const; export type ISideChainId = typeof SIDE_CHAIN_IDS[number]; export const CHAIN_IDS = [ '1', // eth-mainnet '3', // eth-testnet '56', // bsc-mainnet '97', // bsc-testnet 'Binance-Chain-Tigris', // bbc-mainnet 'Binance-Chain-Ganges', // bbc-testnet ] as const; export type IChainIds = typeof CHAIN_IDS[number]; export type INetwork = { url: string; chainId: IChainIds; baseChain?: string; hardfork?: string; }; export type IAsset = { networkSymbol: string; decimals: number; contractAddress?: string; }; export interface ITxData { from: string; to: string; value: string; data?: string; nonce?: number; network: INetwork; asset?: IAsset; type?: '1' | '2' | '3'; gas?: { gasPrice?: string; gasLimit?: string; maxPriorityFeePerGas?: string; maxFeePerGas?: string; }; } export interface IBbcTxData extends ITxData { memo?: string; message?: types.BaseMsg; fee?: string; } export interface IGasLimit { to: string; data?: string; network: INetwork; asset: IAsset; } export type ISign = { signedTx: string; signedApprovalTx?: string; }; export interface ITxReceipt { tx: TypedTransaction | BbcTransaction; fee: string; approvalTx?: TypedTransaction | BbcTransaction; sign: (privateKey: string) => ISign; send: (tx: ISign) => Promise<{ transactionHash: string }>; }