@lifi/types
Version:
Types for the LI.FI stack
122 lines • 4.47 kB
JavaScript
export var SVMPriorityFeeLevel;
(function (SVMPriorityFeeLevel) {
SVMPriorityFeeLevel["NORMAL"] = "NORMAL";
SVMPriorityFeeLevel["FAST"] = "FAST";
SVMPriorityFeeLevel["ULTRA"] = "ULTRA";
})(SVMPriorityFeeLevel || (SVMPriorityFeeLevel = {}));
/**
* RECOMMENDED and SAFEST are deprecated as of 28.06.24
* https://lifi.atlassian.net/browse/LF-8826
*/
export const Orders = ['RECOMMENDED', 'FASTEST', 'CHEAPEST', 'SAFEST'];
export const ExecutionTypes = ['transaction', 'message', 'all'];
/**
* @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',
// Intent is waiting for funds to arrive at the smart contract account
'INTENT_AWAITING_FUNDS',
// Intent funds detected, preparing execution
'INTENT_READY',
// Intent is being executed by solver
'INTENT_EXECUTING',
// Intent execution failed, solver retrying
'INTENT_FAILED_RETRYABLE',
// Intent simulation failed, solver retrying
'INTENT_SIMULATION_FAILURE',
];
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);
export const TokensSortOrders = [
'marketCapUSD',
'priceUSD',
'volumeUSD24H',
'fdvUSD',
];
const _LIFuelState = ['PENDING', 'DONE', 'NOT_FOUND'];
export var IntegratorFeeType;
(function (IntegratorFeeType) {
IntegratorFeeType["FIXED"] = "FIXED";
IntegratorFeeType["SHARED"] = "SHARED";
IntegratorFeeType["DYNAMIC"] = "DYNAMIC";
})(IntegratorFeeType || (IntegratorFeeType = {}));
export const TypedDataPrimaryTypes = [
'Permit',
'PermitTransferFrom',
'PermitBatchTransferFrom',
'PermitWitnessTransferFrom',
'PermitBatchWitnessTransferFrom',
'Order',
'HyperliquidTransaction:UsdSend',
'HyperliquidTransaction:SpotSend',
'HyperliquidTransaction:SendAsset',
'HyperliquidTransaction:Withdraw',
'HyperliquidTransaction:ApproveAgent',
'Agent',
'NonceMapping',
'HyperliquidTransaction:ApproveBuilderFee',
];
//# sourceMappingURL=api.js.map