import { Provider } from '@portal-hq/provider' import { type DkgData, type ILogger, IPortalProvider, KeychainAdapter, type LogLevel, PortalError, Shares, Storage, } from '@portal-hq/utils' import Portal from './src/index' import { BackupMethods } from './src/mpc' import { MpcErrorCodes } from './src/mpc/errors' import type { EvmReceiptPollerOptions } from './src/yield/evmReceiptPoller' export type GatewayLike = GatewayConfig | string // Interfaces export interface FeatureFlags { enableSdkPerformanceMetrics?: boolean isMultiBackupEnabled?: boolean useEnclaveMPCApi?: boolean /** Per-curve override for max presignatures (e.g. { SECP256K1: 3, ED25519: 2 }). */ maxPresignaturesPerCurve?: Partial> usePresignatures?: boolean } export interface EnclaveSignRequest { method: string params: string share: string chainId: string rpcUrl: string metadataStr: string clientPlatform: string clientPlatformVersion: string } export interface EnclaveSignResponse { data: string error?: { id: string message: string } } export interface SignResult { data?: string error?: { id?: string message?: string } } export enum SignerType { binary = 'binary', enclave = 'enclave', } export interface BackupOptions { custom?: Storage firebase?: Storage gdrive?: Storage icloud?: Storage passkey?: Storage password?: Storage unknown?: Storage } export interface Address { id: string network: Network value: string } export interface DappOnNetwork { clientUrl?: string dapp: Dapp id: string network: Network } export interface Dapp { id: string name: string addresses: Address[] dappOnNetworks: DappOnNetwork[] image: DappImage } export interface DappImage { id: string filename: string data: string } export interface EncryptedData { cipherText: string privateKey: string } export interface EncryptResult { data: EncryptData error: PortalError } export interface EncryptedDataWithPassword { cipherText: string } export interface EncryptResultWithPassword { data: EncryptDataWithPassword error: PortalError } export interface DecryptData { plaintext: string } export interface DecryptResult { data: DecryptData error: PortalError } export interface GatewayConfig { [key: string]: string } export interface GenerateLegacyResult { data: { address: string dkgResult: DkgData } error: PortalError } export interface FetchedSharePair { id: string createdAt: string status: PortalSharePairStatus } export interface orgShares { secp256k1: string ed25519?: string } export type EjectedKeys = { secp256k1Key?: string ed25519Key?: string } export interface GenerateResult { data: { curve: string share: DkgData } error: PortalError } export interface MpcErrorData { id: MpcErrorCodes /** @deprecated Use `id` instead. Legacy numeric error code for backward compatibility */ code: MpcErrorCodes message: (str?: string) => string } export interface Network { id: string chainId: string name: string } export interface PortalMobileMpc { backup: ( apiKey: string, host: string, dkgResult: string, apiHost: string, metadata: string, ) => Promise backupSecp256k1: ( apiKey: string, host: string, dkgResult: string, apiHost: string, metadata: string, ) => Promise backupEd25519: ( apiKey: string, host: string, dkgResult: string, apiHost: string, metadata: string, ) => Promise generate: ( apiKey: string, host: string, apiHost: string, metadata: string, ) => Promise generateSecp256k1: ( apiKey: string, host: string, apiHost: string, metadata: string, ) => Promise generateEd25519: ( apiKey: string, host: string, apiHost: string, metadata: string, ) => Promise recoverBackup: ( apiKey: string, host: string, dkgResult: string, apiHost: string, metadata: string, ) => Promise recoverSigning: ( apiKey: string, host: string, dkgResult: string, apiHost: string, metadata: string, ) => Promise recoverSigningSecp256k1: ( apiKey: string, host: string, dkgResult: string, apiHost: string, metadata: string, ) => Promise recoverSigningEd25519: ( apiKey: string, host: string, dkgResult: string, apiHost: string, metadata: string, ) => Promise sign: ( apiKey: string, host: string, dkgResult: string, method: string, params: string, rpcUrl: string, chainId: string, metadata: string, ) => Promise encrypt: (data: string) => Promise decrypt: (key: string, cipherText: string) => Promise encryptWithPassword: (data: string, password: string) => Promise decryptWithPassword: (password: string, cipherText: string) => Promise ejectSecp256k1: ( dkgResultOne: string, dkgResultOne: string, ) => Promise ejectEd25519: (dkgResultOne: string, dkgResultOne: string) => Promise formatShares: (shares: string) => Promise getCustodianIdClientIdHashes: ( custodianIdClientIdJson: string, ) => Promise presign: ( apiKey: string, host: string, share: string, metadata: string, ) => Promise signWithPresignature: ( apiKey: string, host: string, share: string, presignatureData: string, method: string, params: string, rpcUrl: string, chainId: string, metadata: string, ) => Promise } export interface PortalApiOptions { apiKey: string host: string provider: IPortalProvider featureFlags?: FeatureFlags } export interface PortalMpcOptions { // Required apiKey: string keychain: KeychainAdapter backup: BackupOptions portal: Portal // Optional isSimulator?: boolean host?: string version?: string apiHost?: string } export type { LogLevel, ILogger } export interface PortalOptions { // Required apiKey: string backup: BackupOptions gatewayConfig: GatewayLike // Optional chainId?: number isSimulator?: boolean autoApprove?: boolean version?: string keychain?: KeychainAdapter apiHost?: string mpcHost?: string enclaveMPCHost?: string webSocketHost?: string featureFlags?: FeatureFlags logLevel?: LogLevel logger?: ILogger } export interface RotateData { share: DkgData } export interface RotateResult { data: RotateData error: PortalError } export interface RotateResult { data: RotateData error: PortalMpcError } export interface EjectResult { privateKey: string error: PortalMpcError } export interface RNRSA { generate: () => Promise generateKeys: (keySize: number) => Promise encrypt: (data: string, key: string) => Promise decrypt: (data: string, key: string) => Promise encrypt64: (data: string, key: string) => Promise decrypt64: (data: string, key: string) => Promise sign: (data: string, key: string) => Promise signWithAlgorithm: ( data: string, key: string, signature?: TypeCrypto, ) => Promise sign64: (data: string, key: string) => Promise sign64WithAlgorithm: ( data: string, key: string, signature?: TypeCrypto, ) => Promise verify: ( data: string, secretToVerify: string, key: string, ) => Promise verifyWithAlgorithm: ( data: string, secretToVerify: string, key: string, signature?: TypeCrypto, ) => Promise verify64: ( data: string, secretToVerify: string, key: string, ) => Promise verify64WithAlgorithm: ( data: string, secretToVerify: string, key: string, signature?: TypeCrypto, ) => Promise SHA256withRSA: string SHA512withRSA: string SHA1withRSA: string SHA256withECDSA: string SHA512withECDSA: string SHA1withECDSA: string } export interface SignData { R: string S: string } export interface SignResult { data: SignData error: PortalError } export interface Eip155Transaction { from: string to: string data?: string value?: string } export interface BuildEip155TransactionResponse { transaction: Eip155Transaction metadata: BuildEip155TransactionMetadata error?: string } export interface BuildSolanaTransactionResponse { transaction: string // Base64 encoded transaction metadata: BuildSolanaTransactionMetadata error?: string } export interface BuildEip155TransactionMetadata { amount?: string fromAddress?: string toAddress?: string tokenAddress?: string tokenDecimals?: number rawAmount?: string } export interface BuildSolanaTransactionMetadata { amount?: string fromAddress?: string toAddress?: string tokenMintAddress?: string tokenDecimals?: number tokenProgramId?: string tokenExtensions?: string[] rawAmount?: string lastValidBlockHeight?: string serializedTransactionBase64Encoded?: string serializedTransactionBase58Encoded?: string unsignedTransactionMessage?: SolanaTransactionMessage } export interface BitcoinP2wpkhTransaction { signatureHashes: string[] rawTxHex: string } export interface BuildBitcoinP2wpkhTransactionResponse { transaction: BitcoinP2wpkhTransaction metadata: BuildBitcoinTransactionMetadata error?: string } export interface BuildBitcoinTransactionMetadata { amount: string fromAddress: string toAddress: string tokenAddress?: string tokenDecimals: number tokenSymbol?: string rawAmount: string } export interface BroadcastParam { signatures: string[] rawTxHex: string } export interface BroadcastBitcoinP2wpkhTransactionResponseData { txHash: string } export interface BroadcastBitcoinP2wpkhTransactionMetadata { chainId: string clientId: string } export interface BroadcastBitcoinP2wpkhTransactionResponse { data: BroadcastBitcoinP2wpkhTransactionResponseData metadata: BroadcastBitcoinP2wpkhTransactionMetadata } export interface SendAssetResponse { txHash: string } export interface SolanaTransactionMessage { signatures?: null | string[] message?: { accountKeys?: string[] header?: { numRequiredSignatures?: number numReadonlySignedAccounts?: number numReadonlyUnsignedAccounts?: number } instructions?: { programIdIndex?: number accounts?: number[] data?: string }[] recentBlockhash?: string } } export interface FundParams { amount: string token: string } export interface FundResponseData { explorerUrl: string txHash: string } export interface FundResponseMetadata { amount: string chainId: string clientId: string custodianId: string environmentId: string token: string } export interface FundResponseError { id: string message: string } export interface FundResponse { data?: FundResponseData metadata: FundResponseMetadata error?: FundResponseError } export type { ScreenAddressRequest, ScanEVMRequest, ScanEip712Request, ScanSolanaRequest, ScanNftRequest, ScanTokenRequest, ScanUrlRequest, ScreenAddressApiResponse, ScanEVMResponse, ScanEip712Response, ScanSolanaResponse, ScanNftResponse, ScanTokenResponse, ScanUrlResponse, ScreenAddressResponse, TransactionRiskData, TypedMessageRiskData, SolanaTransactionRiskData, Finding, Asset, BalanceChange, Flag, Event, Exposure, FlaggedInteraction, ScanNftRequestItem, ScanNftResponseItem, ScanTokenRequestItem, ScanTokenResponseItem, } from './src/security/hypernative/types' export type { BlockaidScanEvmTxRequest, BlockaidScanEvmTxResponse, BlockaidScanSolanaTxRequest, BlockaidScanSolanaTxResponse, BlockaidAddressScanRequest, BlockaidAddressScanResponse, BlockaidBulkTokenScanRequest, BlockaidBulkTokenScanResponse, BlockaidSiteScanRequest, BlockaidSiteScanResponse, } from './src/security/blockaid/types' export type YieldXyzRateType = 'APR' | 'APY' export type YieldXyzYieldSource = | 'staking' | 'restaking' | 'protocol_incentive' | 'points' | 'lending_interest' | 'mev' | 'real_world_asset_yield' | 'validator_commission' export type YieldXyzMechanicsType = | 'staking' | 'restaking' | 'lending' | 'vault' | 'fixed_yield' | 'real_world_asset' export type YieldXyzRewardSchedule = | 'block' | 'hour' | 'day' | 'week' | 'month' | 'era' | 'epoch' | 'campaign' export type YieldXyzRewardClaiming = 'auto' | 'manual' export type YieldXyzSort = | 'statusEnterAsc' | 'statusEnterDesc' | 'statusExitAsc' | 'statusExitDesc' export type YieldXyzNetwork = | 'eip155:1' | 'ethereum' | 'ethereum-goerli' | 'ethereum-holesky' | 'ethereum-sepolia' | 'ethereum-hoodi' | 'arbitrum' | 'base' | 'base-sepolia' | 'gnosis' | 'optimism' | 'polygon' | 'polygon-amoy' | 'starknet' | 'zksync' | 'linea' | 'unichain' | 'avalanche-c' | 'avalanche-c-atomic' | 'avalanche-p' | 'binance' | 'celo' | 'fantom' | 'harmony' | 'moonriver' | 'okc' | 'viction' | 'core' | 'sonic' | 'katana' | 'hyperevm' | 'agoric' | 'akash' | 'axelar' | 'band-protocol' | 'bitsong' | 'canto' | 'chihuahua' | 'comdex' | 'coreum' | 'cosmos' | 'crescent' | 'cronos' | 'cudos' | 'desmos' | 'dydx' | 'evmos' | 'fetch-ai' | 'gravity-bridge' | 'injective' | 'irisnet' | 'juno' | 'kava' | 'ki-network' | 'mars-protocol' | 'nym' | 'okex-chain' | 'onomy' | 'osmosis' | 'persistence' | 'quicksilver' | 'regen' | 'secret' | 'sentinel' | 'sommelier' | 'stafi' | 'stargaze' | 'stride' | 'teritori' | 'tgrade' | 'umee' | 'sei' | 'mantra' | 'celestia' | 'saga' | 'zetachain' | 'dymension' | 'humansai' | 'neutron' | 'polkadot' | 'kusama' | 'westend' | 'bittensor' | 'binancebeacon' | 'cardano' | 'near' | 'solana' | 'solana-devnet' | 'stellar' | 'stellar-testnet' | 'tezos' | 'tron' | 'ton' | 'ton-testnet' export interface YieldXyzToken { symbol: string name: string decimals?: number network?: string address?: string logoURI?: string isPoints?: boolean coinGeckoId?: string } export interface YieldXyzRewardRateComponent { rate: number rateType: YieldXyzRateType token: YieldXyzToken yieldSource: YieldXyzYieldSource description: string } export interface YieldXyzRewardRate { total: number rateType: YieldXyzRateType components: YieldXyzRewardRateComponent[] } export interface YieldXyzLockupPeriod { seconds: number } export interface YieldXyzCooldownPeriod { seconds: number } export interface YieldXyzWarmupPeriod { seconds: number } export interface YieldXyzFee { deposit: number withdrawal: number performance: number management: number } export interface YieldXyzEntryLimits { minimum: string | null maximum: string | null } export interface YieldXyzPossibleFeeTakingMechanisms { depositFee: boolean managementFee: boolean performanceFee: boolean validatorRebates: boolean } export type YieldXyzArgumentFieldName = | 'amount' | 'validatorAddress' | 'validatorAddresses' | 'receiverAddress' | 'providerId' | 'duration' | 'inputToken' | 'subnetId' | 'tronResource' | 'feeConfigurationId' | 'cosmosPubKey' | 'tezosPubKey' | 'cAddressBech' | 'pAddressBech' | 'executionMode' | 'ledgerWalletApiCompatible' | 'useMaxAmount' | 'inputTokenNetwork' export type YieldXyzArgumentFieldType = | 'string' | 'number' | 'address' | 'enum' | 'boolean' export interface YieldXyzArgumentField { name: YieldXyzArgumentFieldName type: YieldXyzArgumentFieldType label: string description?: string required?: boolean options?: string[] optionsRef?: string default?: Record placeholder?: string minimum?: string | null maximum?: string | null isArray?: boolean } export interface YieldXyzArgument { fields: YieldXyzArgumentField[] notes?: string } export interface YieldXyzArguments { enter: YieldXyzArgument exit: YieldXyzArgument manage?: YieldXyzArgument balance?: YieldXyzArgument } export interface YieldXyzMechanics { type: YieldXyzMechanicsType requiresValidatorSelection: boolean rewardSchedule: YieldXyzRewardSchedule rewardClaiming: YieldXyzRewardClaiming gasFeeToken: YieldXyzToken lockupPeriod?: YieldXyzLockupPeriod cooldownPeriod?: YieldXyzCooldownPeriod warmupPeriod?: YieldXyzWarmupPeriod fee?: YieldXyzFee entryLimits: YieldXyzEntryLimits supportsLedgerWalletApi: boolean extraTransactionFormatsSupported?: string[] arguments: YieldXyzArguments possibleFeeTakingMechanisms: YieldXyzPossibleFeeTakingMechanisms } export interface YieldXyzStatistics { tvlUsd: string | null tvl: string | null tvlRaw: string | null uniqueUsers: number | null averagePositionSizeUsd: string | null averagePositionSize: string | null } export interface YieldXyzStatus { enter: boolean exit: boolean } export interface YieldXyzMetadata { name: string logoURI: string description: string documentation: string underMaintenance: boolean deprecated: boolean supportedStandards: string[] } export interface YieldOpportunity { id: string network: string inputTokens: YieldXyzToken[] outputToken: YieldXyzToken token: YieldXyzToken rewardRate: YieldXyzRewardRate statistics?: YieldXyzStatistics status: YieldXyzStatus metadata: YieldXyzMetadata mechanics: YieldXyzMechanics providerId: string tags: string[] /** Present on some API payloads (e.g. default yields with includeOpportunities). */ tokens?: YieldXyzToken[] chainId?: string state?: Record risk?: Record } /** Single entry from GET .../yields/defaults */ export interface YieldDefaultYieldEntry { yieldId: string | null opportunity: YieldOpportunity | null } /** Map keys are `{caip2}:{TOKEN_SYMBOL}` (e.g. `eip155:1:ETH`, `solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp:SOL`). */ export type YieldDefaultYieldsMap = Record export interface YieldXyzGetYieldDefaultsRequest { includeOpportunities?: boolean } export interface YieldXyzGetYieldDefaultsResponse { data: YieldDefaultYieldsMap } export interface YieldXyzRevshareTier { minRevShare: number maxRevShare: number } export interface YieldXyzRevshare { trial?: YieldXyzRevshareTier standard?: YieldXyzRevshareTier pro?: YieldXyzRevshareTier } export interface YieldXyzProvider { name: string uniqueId: string website: string rank: number preferred: boolean revshare: YieldXyzRevshare } export interface YieldXyzValidator { address: string name?: string logoURI?: string website?: string rewardRate?: YieldXyzRewardRate provider?: YieldXyzProvider commission?: number tvlUsd?: string tvl?: string tvlRaw?: string votingPower?: number preferred?: boolean minimumStake?: string remainingPossibleStake?: string remainingSlots?: number nominatorCount?: number status?: string providerId?: string pricePerShare?: string subnetId?: number subnetName?: string marketCap?: string tokenSymbol?: string } export interface YieldXyzGetYieldValidatorsResponse { data: { validators?: YieldXyzValidator[] rawResponse?: { validators?: YieldXyzValidator[] items?: YieldXyzValidator[] } } } export type YieldXyzActionIntent = 'enter' | 'manage' | 'exit' export type YieldXyzActionType = | 'STAKE' | 'UNSTAKE' | 'CLAIM_REWARDS' | 'RESTAKE_REWARDS' | 'WITHDRAW' | 'WITHDRAW_ALL' | 'RESTAKE' | 'CLAIM_UNSTAKED' | 'UNLOCK_LOCKED' | 'STAKE_LOCKED' | 'VOTE' | 'REVOKE' | 'VOTE_LOCKED' | 'REVOTE' | 'REBOND' | 'MIGRATE' | 'VERIFY_WITHDRAW_CREDENTIALS' | 'DELEGATE' export type YieldManageAction = YieldXyzActionType export type YieldXyzActionTransactionStatus = | 'NOT_FOUND' | 'CREATED' | 'BLOCKED' | 'WAITING_FOR_SIGNATURE' | 'SIGNED' | 'BROADCASTED' | 'PENDING' | 'CONFIRMED' | 'FAILED' | 'SKIPPED' export type YieldXyzActionTransactionType = | 'SWAP' | 'DEPOSIT' | 'APPROVAL' | 'STAKE' | 'CLAIM_UNSTAKED' | 'CLAIM_REWARDS' | 'RESTAKE_REWARDS' | 'UNSTAKE' | 'SPLIT' | 'MERGE' | 'LOCK' | 'UNLOCK' | 'SUPPLY' | 'BRIDGE' | 'VOTE' | 'REVOKE' | 'RESTAKE' | 'REBOND' | 'WITHDRAW' | 'WITHDRAW_ALL' | 'CREATE_ACCOUNT' | 'REVEAL' | 'MIGRATE' | 'DELEGATE' | 'UNDELEGATE' | 'UTXO_P_TO_C_IMPORT' | 'UTXO_C_TO_P_IMPORT' | 'WRAP' | 'UNWRAP' | 'UNFREEZE_LEGACY' | 'UNFREEZE_LEGACY_BANDWIDTH' | 'UNFREEZE_LEGACY_ENERGY' | 'UNFREEZE_BANDWIDTH' | 'UNFREEZE_ENERGY' | 'FREEZE_BANDWIDTH' | 'FREEZE_ENERGY' | 'UNDELEGATE_BANDWIDTH' | 'UNDELEGATE_ENERGY' | 'P2P_NODE_REQUEST' | 'CREATE_EIGENPOD' | 'VERIFY_WITHDRAW_CREDENTIALS' | 'START_CHECKPOINT' | 'VERIFY_CHECKPOINT_PROOFS' | 'QUEUE_WITHDRAWALS' | 'COMPLETE_QUEUED_WITHDRAWALS' | 'LUGANODES_PROVISION' | 'LUGANODES_EXIT_REQUEST' | 'INFSTONES_PROVISION' | 'INFSTONES_EXIT_REQUEST' | 'INFSTONES_CLAIM_REQUEST' export type YieldXyzActionExecutionPattern = | 'synchronous' | 'asynchronous' | 'batched' export type YieldXyzActionStatus = | 'CANCELED' | 'CREATED' | 'WAITING_FOR_NEXT' | 'PROCESSING' | 'FAILED' | 'SUCCESS' | 'STALE' export interface YieldXyzActionTransaction { id: string title: string network: YieldXyzNetwork | string status: YieldXyzActionTransactionStatus type: YieldXyzActionTransactionType hash: string | null createdAt: string broadcastedAt: string | null signedTransaction: string | null unsignedTransaction: string | Record | null annotatedTransaction?: Record | null structuredTransaction?: Record | null stepIndex: number description?: string error?: string | null gasEstimate: string | null explorerUrl?: string | null isMessage?: boolean } export interface GasEstimate { amount: string gasLimit: string token: YieldXyzToken } export interface YieldUnsignedTransaction { to: string from?: string data: string value?: string gasLimit?: string maxFeePerGas?: string maxPriorityFeePerGas?: string nonce?: number type?: number chainId?: number } export type YieldTransactionStatus = | 'pending' | 'submitted' | 'confirmed' | 'failed' export interface YieldXyzEnterArguments { amount?: string validatorAddress?: string validatorAddresses?: string[] providerId?: string duration?: number inputToken?: string subnetId?: number tronResource?: 'BANDWIDTH' | 'ENERGY' feeConfigurationId?: string cosmosPubKey?: string tezosPubKey?: string cAddressBech?: string pAddressBech?: string executionMode?: 'individual' | 'batched' ledgerWalletApiCompatible?: boolean } export interface YieldXyzGetYieldsRequest { offset?: number limit?: number network?: string networks?: string[] yieldId?: string yieldIds?: string[] type?: YieldXyzMechanicsType types?: YieldXyzMechanicsType[] hasCooldownPeriod?: boolean hasWarmupPeriod?: boolean token?: string inputToken?: string inputTokens?: string[] provider?: string providers?: string[] search?: string sort?: YieldXyzSort } export interface YieldXyzGetYieldsResponse { data: { rawResponse: { items: YieldOpportunity[] limit: number offset: number total: number errors?: YieldXyzError[] } } } export interface YieldXyzEnterRequest { yieldId: string address?: string amount?: string arguments?: YieldXyzEnterArguments } export interface YieldXyzEnterYieldResponse { data: { rawResponse: { id: string intent: YieldXyzActionIntent type: YieldXyzActionType yieldId: string address: string amount: string | null amountRaw: string | null amountUsd: string | null transactions: YieldXyzActionTransaction[] executionPattern: YieldXyzActionExecutionPattern rawArguments: YieldXyzEnterArguments | null createdAt: string completedAt: string | null status: YieldXyzActionStatus } } } export interface YieldXyzExitRequest { yieldId: string address?: string amount?: string arguments?: YieldXyzEnterArguments } export interface YieldXyzExitResponse { data: { rawResponse: { id: string intent: YieldXyzActionIntent type: YieldXyzActionType yieldId: string address: string amount: string | null amountRaw: string | null amountUsd: string | null transactions: YieldXyzActionTransaction[] executionPattern: YieldXyzActionExecutionPattern rawArguments: YieldXyzEnterArguments | null createdAt: string completedAt: string | null status: YieldXyzActionStatus } } } export interface YieldXyzManageYieldRequest { yieldId: string address?: string action: YieldXyzActionType arguments?: YieldXyzEnterArguments passthrough?: string } export interface YieldXyzManageYieldResponse { data: { rawResponse: { id: string intent: YieldXyzActionIntent type: YieldXyzActionType yieldId: string address: string amount: string | null amountRaw: string | null amountUsd: string | null transactions: YieldXyzActionTransaction[] executionPattern: YieldXyzActionExecutionPattern rawArguments: YieldXyzEnterArguments | null createdAt: string completedAt: string | null status: YieldXyzActionStatus } } } export interface YieldXyzTrackTransactionRequest { transactionId: string hash: string } export interface YieldXyzTrackTransactionResponse { data: { rawResponse: { success: boolean transactionId: string status?: YieldXyzActionTransactionStatus } } } /** * Progress event for yield deposit/withdraw high-level flows. * * ## Common lifecycle events (shared with other high-level flows): * - `signing` → about to call signAndSendTransaction * - `submitted` → hash received from signAndSendTransaction * - `confirming` → waiting for on-chain confirmation to reach required depth * - `confirmed` → on-chain confirmation complete; about to track */ export interface YieldSubmitProgress { /** * - `signing`: about to call signAndSendTransaction * - `submitted`: hash received from signAndSendTransaction * - `confirming`: waiting for on-chain confirmation to reach required depth * - `confirmed`: on-chain confirmation complete; about to track */ step: 'signing' | 'submitted' | 'confirming' | 'confirmed' index: number total: number hash?: string } /** * **Full CAIP-2** chain id for high-level yield deposit/withdraw (same string as in Portal yield * defaults map keys before the final `:`), e.g. `eip155:11155111`, * `solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp`. No aliases or numeric shortcuts — pass the exact id. */ export type YieldXyzDepositWithdrawChain = string /** * High-level yield deposit / withdraw using an explicit Portal `yieldId` (no defaults lookup). * * @example * ```ts * await portal.yield.yieldxyz.deposit({ * yieldId: 'ethereum-usdc-aave-v3-lending', * amount: '1000000', * address: walletAddress, * }) * ``` */ export interface YieldDepositParamsByYieldId { yieldId: string amount: string address: string arguments?: YieldXyzEnterArguments } /** * High-level yield deposit / withdraw: the SDK resolves `yieldId` by fetching Portal yield * defaults and reading the entry for `{chain}:{token}`. Pass `token` **exactly** as that map key * suffix (same casing/symbol the API returns). * * @example * ```ts * await portal.yield.yieldxyz.deposit({ * chain: 'eip155:1', * token: 'USDC', * amount: '1000000', * address: walletAddress, * }) * ``` */ export interface YieldDepositParamsByChainAndToken { chain: YieldXyzDepositWithdrawChain token: string amount: string address: string arguments?: YieldXyzEnterArguments } /** * High-level yield deposit parameters: either {@link YieldDepositParamsByYieldId} or * {@link YieldDepositParamsByChainAndToken}. When `yieldId` is a non-empty string (after trim), it * is used directly and defaults lookup is skipped; otherwise `chain` and `token` are required. * At runtime, a non-empty `yieldId` takes precedence over any also-present `chain` / `token`. */ export type YieldDepositParams = | YieldDepositParamsByYieldId | YieldDepositParamsByChainAndToken /** Same union as {@link YieldDepositParams}. */ export type YieldWithdrawParams = YieldDepositParams /** * Status of a yield submission operation. * - SUCCESS: All transactions confirmed successfully (or no waitForConfirmation configured - optimistic) * - PARTIAL_SUCCESS: Some transactions confirmed, but not all * - FAILED: Transaction failed on-chain (status 0x0) or first confirmation returned false */ export type YieldSubmitResultStatus = 'SUCCESS' | 'PARTIAL_SUCCESS' | 'FAILED' /** * Result of high-level deposit. When the call used `chain` + `token`, those are echoed on the * result; when only `yieldId` was passed, `chain` and `token` are omitted. */ export interface YieldDepositResult { hashes: string[] yieldId: string status: YieldSubmitResultStatus chain?: string token?: string yieldOpportunityDetails: { yieldId: string intent?: YieldXyzActionIntent type?: YieldXyzActionType executionPattern?: YieldXyzActionExecutionPattern status?: YieldXyzActionStatus amount?: string | null amountUsd?: string | null } } /** * Result of high-level withdraw. Same `chain` / `token` echo rules as {@link YieldDepositResult}. */ export interface YieldWithdrawResult { hashes: string[] yieldId: string status: YieldSubmitResultStatus chain?: string token?: string yieldOpportunityDetails: { yieldId: string intent?: YieldXyzActionIntent type?: YieldXyzActionType executionPattern?: YieldXyzActionExecutionPattern status?: YieldXyzActionStatus amount?: string | null amountUsd?: string | null } } /** Options for deposit/withdraw high-level methods (e.g. onProgress). */ export interface YieldSubmitOptions { onProgress?: (event: YieldSubmitProgress) => void /** * Per-call signer override. Takes priority over the instance-level setter * ({@link YieldXyz.setSignAndSendTransaction}) when provided. * Useful for one-off calls that need a different signer without reconfiguring the instance. */ signAndSendTransaction?: ( transaction: unknown, network: string, ) => Promise /** * Optional per-call override for post-submit confirmation logic. * Called for **every** transaction on **any** chain (EVM and non-EVM). * Takes priority over {@link Portal.waitForConfirmation}. * * When omitted, `Portal.waitForConfirmation` is used for EVM Yield networks * (`eth_getTransactionReceipt` via `gatewayConfig`), so multi-step EVM flows stay * nonce-safe without extra integrator code. * * Use this override when you need: * - A specific number of block confirmations (e.g. wait for 12 blocks). * - Custom Solana finality checks. * - Your own RPC endpoint for polling. * - To disable waiting entirely (pass `() => Promise.resolve()`). */ waitForConfirmation?: ( txHash: string, network: string, ) => Promise /** * Per-call tuning for the built-in EVM receipt poller used when `waitForConfirmation` * is not provided and the standalone `evmRequestFn` fallback is active. * When omitted, the built-in defaults (4 s poll interval, 5 min timeout) are used. */ evmPollerOptions?: EvmReceiptPollerOptions } export interface YieldXyzGetBalancesQuery { address: string network: YieldXyzNetwork | string yieldId?: string } export interface YieldXyzGetBalancesRequest { queries: YieldXyzGetBalancesQuery[] } export interface YieldXyzBalancePendingAction { intent: YieldXyzActionIntent type: YieldXyzActionType passthrough: string arguments: YieldXyzArgument } export interface YieldBalanceItem { address: string type: | 'active' | 'entering' | 'exiting' | 'withdrawable' | 'claimable' | 'locked' amount: string amountRaw: string date: string | null feeConfigurationId: string pendingActions: YieldXyzBalancePendingAction[] token: YieldXyzToken validator?: YieldXyzValidator | null validators?: YieldXyzValidator[] amountUsd?: string | null isEarning: boolean } export interface YieldBalance { yieldId: string balances: YieldBalanceItem[] } export interface YieldBalanceError { yieldId: string error: string } export interface YieldXyzGetBalancesResponse { data: { rawResponse: { items: YieldBalance[] errors: YieldBalanceError[] } } } export interface YieldXyzGetTransactionRequest { transactionId: string } export interface YieldXyzGetTransactionResponse { data: { rawResponse: YieldXyzActionTransaction } } export interface YieldXyzGetHistoricalActionsRequest { offset?: number limit?: number address?: string status?: YieldXyzActionStatus intent?: YieldXyzActionIntent type?: YieldXyzActionType yieldId?: string } export interface YieldXyzGetHistoricalActionsResponse { data: { rawResponse: { total: number offset: number limit: number items: YieldXyzHistoricalActionItem[] } } } export interface YieldXyzHistoricalActionItem { id: string intent: YieldXyzActionIntent type: YieldXyzActionType yieldId: string address: string amount: string | null amountRaw: string | null amountUsd: string | null transactions: YieldXyzActionTransaction[] executionPattern: YieldXyzActionExecutionPattern rawArguments: YieldXyzEnterArguments | null createdAt: string completedAt: string | null status: YieldXyzActionStatus } export interface YieldXyzError { error: { code: string message: string details?: Record } timestamp: string requestId?: string } export interface YieldTransactionResult { transactionHash: string status: YieldTransactionStatus blockNumber?: number explorerUrl?: string } export type YieldDiscoverParams = YieldXyzGetYieldsRequest export type YieldDiscoverResponse = YieldXyzGetYieldsResponse export type YieldEnterParams = YieldXyzEnterRequest export type YieldExitParams = YieldXyzExitRequest export type YieldManageParams = YieldXyzManageYieldRequest export type YieldBalancesResponse = YieldXyzGetBalancesResponse export type YieldHistoricalActionsResponse = YieldXyzGetHistoricalActionsResponse export type YieldActionResponse = YieldXyzEnterYieldResponse export interface YieldGetBalancesParams { network?: string yieldId?: string address?: string } export interface YieldGetHistoricalActionsParams { network?: string yieldId?: string limit?: number offset?: number address?: string } export type LifiRoutesOrder = 'FASTEST' | 'CHEAPEST' export type LifiQuoteOrder = 'FASTEST' | 'CHEAPEST' export type LifiStepType = 'swap' | 'cross' | 'lifi' | 'protocol' export type LifiGasCostType = 'SUM' | 'APPROVE' | 'SEND' export type LifiErrorType = 'NO_QUOTE' export type LifiErrorCode = | 'NO_POSSIBLE_ROUTE' | 'INSUFFICIENT_LIQUIDITY' | 'TOOL_TIMEOUT' | 'UNKNOWN_ERROR' | 'RPC_ERROR' | 'AMOUNT_TOO_LOW' | 'AMOUNT_TOO_HIGH' | 'FEES_HIGHER_THAN_AMOUNT' | 'DIFFERENT_RECIPIENT_NOT_SUPPORTED' | 'TOOL_SPECIFIC_ERROR' | 'CANNOT_GUARANTEE_MIN_AMOUNT' | 'RATE_LIMIT_EXCEEDED' export type LifiTransferStatus = | 'NOT_FOUND' | 'INVALID' | 'PENDING' | 'DONE' | 'FAILED' export type LifiTransferSubstatus = | 'WAIT_SOURCE_CONFIRMATIONS' | 'WAIT_DESTINATION_TRANSACTION' | 'BRIDGE_NOT_AVAILABLE' | 'CHAIN_NOT_AVAILABLE' | 'REFUND_IN_PROGRESS' | 'UNKNOWN_ERROR' | 'COMPLETED' | 'PARTIAL' | 'REFUNDED' export type LifiStatusBridge = | 'hop' | 'cbridge' | 'celercircle' | 'optimism' | 'polygon' | 'arbitrum' | 'avalanche' | 'across' | 'gnosis' | 'omni' | 'relay' | 'celerim' | 'symbiosis' | 'thorswap' | 'squid' | 'allbridge' | 'mayan' | 'debridge' | 'chainflip' export type LifiTimingStrategyType = 'minWaitTime' export interface LifiToken { address: string symbol: string decimals: number chainId: string name: string coinKey?: string logoURI?: string priceUSD?: string } export interface LifiToolDetails { key?: string name?: string logoURI?: string webUrl?: string } export interface LifiAction { fromChainId: string fromAmount: string fromToken: LifiToken toChainId: string toToken: LifiToken slippage?: number fromAddress?: string toAddress?: string destinationGasConsumption?: string } export interface LifiFeeSplit { integratorFee?: string lifiFee?: string } export interface LifiFeeCost { name: string percentage: string token: LifiToken amountUSD: string included: boolean description?: string amount?: string feeSplit?: LifiFeeSplit } export interface LifiGasCost { type: LifiGasCostType amount: string token: LifiToken price?: string estimate?: string limit?: string amountUSD?: string } export interface LifiBid { user?: string router?: string initiator?: string sendingChainId?: string sendingAssetId?: string amount?: string receivingChainId?: string receivingAssetId?: string amountReceived?: string receivingAddress?: string transactionId?: string expiry?: number callDataHash?: string callTo?: string encryptedCallData?: string sendingChainTxManagerAddress?: string receivingChainTxManagerAddress?: string bidExpiry?: number } export interface LifiEstimateData { bid?: LifiBid bidSignature?: string gasFeeInReceivingToken?: string totalFee?: string metaTxRelayerFee?: string routerFee?: string } export interface LifiEstimate { tool: string fromAmount: string toAmount: string toAmountMin: string approvalAddress: string executionDuration: number fromAmountUSD?: string toAmountUSD?: string feeCosts?: LifiFeeCost[] gasCosts?: LifiGasCost[] data?: LifiEstimateData } export interface LifiInternalStep { id: string type: LifiStepType tool: string toolDetails: LifiToolDetails action: LifiAction estimate: LifiEstimate } export interface LifiStep { id: string type: LifiStepType tool: string action: LifiAction toolDetails?: LifiToolDetails estimate?: LifiEstimate includedSteps?: LifiInternalStep[] integrator?: string referrer?: string execution?: any transactionRequest?: LifiTransactionRequest transactionId?: string gasCostUSD?: string fromAddress?: string toAddress?: string containsSwitchChain?: boolean } export interface LifiTransactionRequest { chainId?: string data: string from?: string gasLimit?: string gasPrice?: string maxFeePerGas?: string maxPriorityFeePerGas?: string to?: string value?: string } export interface LifiRoute { id: string fromChainId: string fromAmountUSD: string fromAmount: string fromToken: LifiToken toChainId: string toAmountUSD: string toAmount: string toAmountMin: string toToken: LifiToken steps: LifiStep[] gasCostUSD?: string fromAddress?: string toAddress?: string containsSwitchChain?: boolean tags?: string[] } export interface LifiSubpathError { errorType?: LifiErrorType code?: LifiErrorCode action?: LifiAction tool?: string message?: string } export interface LifiFilteredRoute { overallPath?: string reason?: string } export interface LifiFailedRoute { overallPath?: string subpaths?: Record } export interface LifiUnavailableRoutes { filteredOut?: LifiFilteredRoute[] failed?: LifiFailedRoute[] } export interface LifiToolsConfiguration { allow?: string[] deny?: string[] prefer?: string[] } export interface LifiTimingStrategy { strategy?: LifiTimingStrategyType minWaitTimeMs?: number startingExpectedResults?: number reduceEveryMs?: number } export interface LifiTimingOptions { swapStepTimingStrategies?: LifiTimingStrategy[] routeTimingStrategies?: LifiTimingStrategy[] } export interface LifiRoutesRequestOptions { insurance?: boolean integrator?: string slippage?: number bridges?: LifiToolsConfiguration exchanges?: LifiToolsConfiguration order?: LifiRoutesOrder allowSwitchChain?: boolean allowDestinationCall?: boolean referrer?: string fee?: number maxPriceImpact?: number timing?: LifiTimingOptions } export interface LifiRoutesRequest { fromChainId: string fromAmount: string fromTokenAddress: string toChainId: string toTokenAddress: string options?: LifiRoutesRequestOptions fromAddress?: string toAddress?: string fromAmountForGas?: string } export interface LifiRoutesRawResponse { routes: LifiRoute[] unavailableRoutes?: LifiUnavailableRoutes } export interface LifiRoutesData { rawResponse: LifiRoutesRawResponse } export interface LifiRoutesResponse { data?: LifiRoutesData error?: string } export interface LifiQuoteRequest { fromChain: string toChain: string fromToken: string toToken: string fromAddress: string fromAmount: string toAddress?: string order?: LifiQuoteOrder slippage?: number integrator?: string fee?: number referrer?: string allowBridges?: string[] allowExchanges?: string[] denyBridges?: string[] denyExchanges?: string[] preferBridges?: string[] preferExchanges?: string[] allowDestinationCall?: boolean fromAmountForGas?: string maxPriceImpact?: number swapStepTimingStrategies?: string[] routeTimingStrategies?: string[] skipSimulation?: boolean } export interface LifiQuoteData { rawResponse: LifiStep } export interface LifiQuoteResponse { data?: LifiQuoteData error?: string } export interface LifiQuoteErrorResponse { message: string errors?: LifiUnavailableRoutes } export interface LifiStatusRequest { txHash: string bridge?: LifiStatusBridge fromChain?: string toChain?: string } export interface LifiIncludedSwapStep { tool?: string toolDetails?: LifiToolDetails fromAmount?: string fromToken?: LifiToken toAmount?: string toToken?: LifiToken bridgedAmount?: string } export interface LifiTransactionInfo { txHash: string txLink: string amount: string amountUSD?: string token: LifiToken chainId: string gasToken?: LifiToken gasAmount?: string gasAmountUSD?: string gasPrice?: string gasUsed?: string timestamp?: number value?: string includedSteps?: LifiIncludedSwapStep[] } export interface LifiReceivingInfo { chainId?: string txHash?: string txLink?: string token?: LifiToken amount?: string gasToken?: LifiToken gasAmount?: string gasAmountUSD?: string gasPrice?: string gasUsed?: string timestamp?: number value?: string includedSteps?: LifiIncludedSwapStep[] } export interface LifiMetadata { integrator?: string } export interface LifiStatusRawResponse { sending: LifiTransactionInfo receiving?: LifiReceivingInfo feeCosts?: LifiFeeCost[] status: LifiTransferStatus substatus?: LifiTransferSubstatus substatusMessage?: string tool: string transactionId?: string fromAddress?: string toAddress?: string lifiExplorerLink?: string bridgeExplorerLink?: string metadata?: LifiMetadata } export interface LifiStatusData { rawResponse: LifiStatusRawResponse } export interface LifiStatusResponse { data?: LifiStatusData error?: string } /** Options for {@link ILifi.pollStatus} and per-step status polling in {@link ILifi.tradeAsset}. */ export interface LifiPollStatusOptions { /** Interval between polls in ms. @default 10000 */ everyMs?: number /** Delay before the first status request. @default 0 for pollStatus; tradeAsset uses 10000 unless overridden. */ initialDelayMs?: number /** @default 600000 (10 minutes) */ timeoutMs?: number /** Stop after this many consecutive hard errors (excludes indexer “not ready” cases). @default 10 */ maxConsecutiveErrors?: number backoff?: { factor: number maxIntervalMs: number } } /** * Progress events for LiFi cross-chain swap execution. * * ## Common lifecycle events (shared with other trading modules): * - `fetching_routes` → route discovery * - `signing` → transaction signing * - `submitted` → transaction broadcasted * - `confirming` → waiting for on-chain confirmation * - `complete` → entire flow finished successfully * - `failed` → flow failed at any stage * * ## LiFi-specific events (multi-step + protocol polling): * - `route_selected` → chosen route from available routes * - `preparing_step` → fetching executable transaction for current step * - `lifi_pending` → on-chain confirmed, polling LiFi status API * - `step_done` → current step reached terminal LiFi status */ export type LifiTradeAssetProgressStatus = | 'fetching_routes' | 'route_selected' | 'preparing_step' | 'signing' | 'submitted' | 'confirming' | 'lifi_pending' | 'step_done' | 'complete' | 'failed' export interface LifiTradeAssetProgressData { routeIndex?: number stepIndex?: number totalSteps?: number route?: LifiRoute step?: LifiStep txHash?: string lifiStatus?: LifiStatusRawResponse errorMessage?: string } export interface LifiTradeAssetParams { fromChain: string toChain: string fromToken: string toToken: string /** Same as {@link LifiQuoteRequest.fromAmount} (smallest units). */ amount: string fromAddress: string toAddress?: string routeOptions?: LifiRoutesRequestOptions /** Index into `routes` from getRoutes; default 0. */ routeIndex?: number onProgress?: ( status: LifiTradeAssetProgressStatus, data: LifiTradeAssetProgressData, ) => void /** Overrides default status polling between steps. */ statusPoll?: LifiPollStatusOptions } /** * Optional per-call options for {@link ILifi.tradeAsset}. * Follows the same pattern as Yield's {@link YieldSubmitOptions}. */ export interface LifiTradeAssetOptions { /** * Per-call signer for submitting each prepared route step transaction. * Use the same signer shape as Yield high-level submit methods. */ signAndSendTransaction?: ( transaction: unknown, network: string, ) => Promise /** * Per-call override for post-submit on-chain confirmation (EVM receipt polling). * Takes priority over any LiFi internal EVM poller fallback. * * Use this override when you need: * - A specific number of block confirmations * - Custom timeout behavior * - Your own RPC endpoint for polling * - To disable waiting entirely (pass `() => Promise.resolve()`) */ waitForConfirmation?: ( txHash: string, network: string, ) => Promise /** * Per-call EVM JSON-RPC function used by the built-in receipt poller fallback when * `waitForConfirmation` is not provided. */ evmRequestFn?: ( method: string, params: unknown[], network: string, ) => Promise /** * Per-call tuning for the built-in EVM receipt poller. * Only used when no `waitForConfirmation` is provided. * When omitted, the built-in defaults are used. */ evmPollerOptions?: EvmReceiptPollerOptions } export interface LifiTradeAssetResult { hashes: string[] steps: LifiStep[] route: LifiRoute } export type LifiStepTransactionRequest = LifiStep export interface LifiStepTransactionData { rawResponse: LifiStep } export interface LifiStepTransactionResponse { data?: LifiStepTransactionData error?: string } export interface ZeroExQuoteRequest { chainId: string buyToken: string sellToken: string sellAmount: string txOrigin?: string swapFeeRecipient?: string swapFeeBps?: number swapFeeToken?: string tradeSurplusRecipient?: string gasPrice?: string slippageBps?: number excludedSources?: string sellEntireBalance?: 'true' | 'false' } export interface ZeroExPriceRequest { chainId: string buyToken: string sellToken: string sellAmount: string txOrigin?: string swapFeeRecipient?: string swapFeeBps?: number swapFeeToken?: string tradeSurplusRecipient?: string gasPrice?: string slippageBps?: number excludedSources?: string sellEntireBalance?: 'true' | 'false' } export interface ZeroExSourcesResponse { data?: { rawResponse: { sources: string[] zid: string } } error?: string } export interface ZeroExTransaction { data: string from: string gas: string gasPrice: string to: string value: string } export interface ZeroExFees { integratorFee?: { amount: string token: string type: string } | null zeroExFee?: { billingType: string feeAmount: string feeToken: string feeType: string } | null gasFee?: { amount: string token: string type: string } | null } export interface ZeroExIssues { allowance?: { actual: string spender: string } | null balance?: { token: string actual: string expected: string } | null simulationIncomplete?: boolean invalidSourcesPassed?: string[] } export interface ZeroExRoute { path?: string[] } export interface ZeroExTokenMetadata { symbol?: string decimals?: number tax?: string } export interface ZeroExQuoteData { blockNumber?: string buyAmount: string buyToken?: string fees?: ZeroExFees | null issues?: ZeroExIssues | null liquidityAvailable?: boolean minBuyAmount?: string route?: ZeroExRoute | null sellAmount: string sellToken?: string tokenMetadata?: ZeroExTokenMetadata | null totalNetworkFee?: string transaction: ZeroExTransaction price?: string estimatedGas?: string cost?: number } export interface ZeroExQuoteResponse { data: { rawResponse: ZeroExQuoteData } error?: string } /** * Progress events for 0x swap execution. * * ## Common lifecycle events (shared with other trading modules): * - `fetching_quote` → quote discovery * - `signing` → transaction signing * - `submitted` → transaction broadcasted * - `confirming` → waiting for on-chain confirmation * - `confirmed` → on-chain confirmation completed (flow finished) * - `failed` → flow failed at any stage * * ## 0x-specific behavior: * Single transaction flow with no protocol-level status polling after chain confirmation. */ export type ZeroXTradeAssetProgressStatus = | 'fetching_quote' | 'signing' | 'submitted' | 'confirming' | 'confirmed' | 'failed' export interface ZeroXTradeAssetProgressData { txHash?: string errorMessage?: string buyAmount?: string sellAmount?: string transaction?: ZeroExTransaction } export interface ZeroXTradeAssetParams extends Omit< ZeroExQuoteRequest, 'txOrigin' > { /** * Sender address of the swap transaction. * Mirrors LiFi's `fromAddress` naming for cross-protocol consistency. */ fromAddress?: string onProgress?: ( status: ZeroXTradeAssetProgressStatus, data: ZeroXTradeAssetProgressData, ) => void /** Passed through to the 0x `getQuote` request body when set. */ zeroXApiKey?: string } export interface ZeroXTradeAssetResult { hashes: string[] } /** Per-call execution hooks for {@link IZeroX.tradeAsset}. */ export interface ZeroXTradeAssetOptions { /** Per-call signer for broadcasting the quote transaction. */ signAndSendTransaction?: ( transaction: unknown, network: string, ) => Promise /** Per-call confirmation waiter for the submitted hash. */ waitForConfirmation?: ( txHash: string, network: string, ) => Promise } export interface ZeroExPriceData { blockNumber?: string buyAmount: string buyToken?: string fees?: ZeroExFees | null gas?: string gasPrice?: string issues?: ZeroExIssues | null liquidityAvailable?: boolean minBuyAmount?: string route?: ZeroExRoute | null sellAmount: string sellToken?: string tokenMetadata?: ZeroExTokenMetadata | null totalNetworkFee?: string price?: string estimatedGas?: string } export interface ZeroExPriceResponse { data: { rawResponse: ZeroExPriceData } error?: string } export interface ZeroExIssues { allowance?: { actual: string spender: string } | null balance?: { token: string actual: string expected: string } | null simulationIncomplete: boolean invalidSourcesPassed: string[] } export interface AssetsResponse { nativeBalance?: NativeBalance tokenBalances?: TokenBalance[] nfts?: Nft[] } export interface NativeBalance { balance?: string decimals?: number name?: string rawBalance?: string symbol?: string metadata?: NativeBalanceMetadata } export interface NativeBalanceMetadata { logo?: string thumbnail?: string } export interface TokenBalance { balance?: string decimals?: number name?: string rawBalance?: string symbol?: string metadata?: TokenBalanceMetadata } export interface TokenBalanceMetadata { tokenAddress?: string verifiedContract?: boolean totalSupply?: string rawTotalSupply?: string percentageRelativeToTotalSupply?: number } export interface Nft { nftID?: string name?: string description?: string imageURL?: string chainID?: string contractAddress?: string tokenID?: string collection?: NftCollection lastSale?: NftLastSale rarity?: NftRarity floorPrice?: NftFloorPrice detailedInfo?: NftDetailedInfo } export interface NftFloorPrice { price?: number currency?: string } export { BackupMethods, BackupMethodsUpperCase } from './src/mpc'