UNPKG

@openocean.finance/widget-types

Version:

Types for the OpenOcean Widget

78 lines 3.02 kB
export const Orders = ['RECOMMENDED', 'FASTEST', 'CHEAPEST', 'SAFEST']; /** * @deprecated _InsuranceState is deprecated and will be removed in future versions. */ export const _InsuranceState = [ 'INSURED', 'INSURABLE', 'NOT_INSURABLE', ]; export var TokenHistoricGranularity; (function (TokenHistoricGranularity) { TokenHistoricGranularity["THIRTY_MIN"] = "30min"; TokenHistoricGranularity["HOUR"] = "hour"; TokenHistoricGranularity["DAY"] = "day"; TokenHistoricGranularity["OVER_DAY"] = ">day"; })(TokenHistoricGranularity || (TokenHistoricGranularity = {})); export const isContractCallsRequestWithFromAmount = (r) => 'fromAmount' in r; export const isContractCallsRequestWithToAmount = (r) => 'toAmount' in r; const _StatusMessage = [ // The transaction was not found -- likely not mined yet 'NOT_FOUND', // A third party service is not available 'INVALID', // The transfer is pending 'PENDING', // The transfer is done 'DONE', // The transfer failed 'FAILED', ]; const _SubstatusPending = [ // The bridge is waiting for additional confirmations 'WAIT_SOURCE_CONFIRMATIONS', // The off-chain logic is in progress, waiting for the destination tx to be mined 'WAIT_DESTINATION_TRANSACTION', // The bridge API / subgraph is temporarily unavailable 'BRIDGE_NOT_AVAILABLE', // The RPC for source/destination chain is temporarily unavailable 'CHAIN_NOT_AVAILABLE', // A refund has been requested and is in progress 'REFUND_IN_PROGRESS', // We cannot determine the status of the transfer 'UNKNOWN_ERROR', ]; const _SubstatusDone = [ // The transfer was successful 'COMPLETED', // The transfer was partially successful // This can happen for specific bridges like Across // which may provide alternative tokens in case of low liquidity 'PARTIAL', // The transfer was not successful but it has been refunded 'REFUNDED', ]; const _SubstatusFailed = [ // The amount in the request exceeds the allowance 'INSUFFICIENT_ALLOWANCE', // The token amount is not enough to execute the transfer 'INSUFFICIENT_BALANCE', // The gas limit is lower than tx would consume 'OUT_OF_GAS', // The requested quote is expired and can’t be processed anymore 'EXPIRED', // Slippage conditions were not met 'SLIPPAGE_EXCEEDED', // We cannot determine the cause of the failure 'UNKNOWN_FAILED_ERROR', ]; export const isSubstatusPending = (substatus) => _SubstatusPending.includes(substatus); export const isSubstatusDone = (substatus) => _SubstatusDone.includes(substatus); export const isSubstatusFailed = (substatus) => _SubstatusFailed.includes(substatus); const _LIFuelState = ['PENDING', 'DONE', 'NOT_FOUND']; export var IntegratorFeeType; (function (IntegratorFeeType) { IntegratorFeeType["FIXED"] = "FIXED"; IntegratorFeeType["SHARED"] = "SHARED"; })(IntegratorFeeType || (IntegratorFeeType = {})); //# sourceMappingURL=api.js.map