@lifi/types
Advanced tools
Comparing version 15.15.0 to 15.16.0-alpha.0
{ | ||
"name": "@lifi/types", | ||
"description": "Types for the LI.FI stack", | ||
"version": "15.15.0", | ||
"version": "15.16.0-alpha.0", | ||
"files": [ | ||
@@ -6,0 +6,0 @@ "src", |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.IntegratorFeeType = exports.isSubstatusFailed = exports.isSubstatusDone = exports.isSubstatusPending = exports.isContractCallsRequestWithToAmount = exports.isContractCallsRequestWithFromAmount = exports._InsuranceState = exports.Orders = void 0; | ||
exports.IntegratorFeeType = exports.isSubstatusFailed = exports.isSubstatusDone = exports.isSubstatusPending = exports.isContractCallsRequestWithToAmount = exports.isContractCallsRequestWithFromAmount = exports.isQuoteRequestWithToAmount = exports.isQuoteRequestWithFromAmount = exports._InsuranceState = exports.Orders = void 0; | ||
exports.Orders = ['RECOMMENDED', 'FASTEST', 'CHEAPEST', 'SAFEST']; | ||
@@ -10,2 +10,6 @@ exports._InsuranceState = [ | ||
]; | ||
const isQuoteRequestWithFromAmount = (r) => 'fromAmount' in r; | ||
exports.isQuoteRequestWithFromAmount = isQuoteRequestWithFromAmount; | ||
const isQuoteRequestWithToAmount = (r) => 'toAmount' in r; | ||
exports.isQuoteRequestWithToAmount = isQuoteRequestWithToAmount; | ||
const isContractCallsRequestWithFromAmount = (r) => 'fromAmount' in r; | ||
@@ -12,0 +16,0 @@ exports.isContractCallsRequestWithFromAmount = isContractCallsRequestWithFromAmount; |
@@ -14,2 +14,4 @@ /** | ||
]; | ||
export const isQuoteRequestWithFromAmount = (r) => 'fromAmount' in r; | ||
export const isQuoteRequestWithToAmount = (r) => 'toAmount' in r; | ||
export const isContractCallsRequestWithFromAmount = (r) => 'fromAmount' in r; | ||
@@ -16,0 +18,0 @@ export const isContractCallsRequestWithToAmount = (r) => 'toAmount' in r; |
@@ -218,7 +218,6 @@ import type { BridgeDefinition } from './bridges.js'; | ||
} | ||
export interface QuoteRequest extends ToolConfiguration, TimingStrings { | ||
export interface PartialQuoteRequest extends ToolConfiguration, TimingStrings { | ||
fromChain: number | string; | ||
fromToken: string; | ||
fromAddress: string; | ||
fromAmount: string; | ||
toChain: number | string; | ||
@@ -233,3 +232,2 @@ toToken: string; | ||
allowDestinationCall?: boolean; | ||
fromAmountForGas?: string; | ||
maxPriceImpact?: number; | ||
@@ -242,5 +240,12 @@ skipSimulation?: boolean; | ||
} | ||
export interface QuoteToAmountRequest extends Omit<QuoteRequest, 'fromAmount' | 'fromAmountForGas' | 'insurance'> { | ||
export interface QuoteFromAmountRequest extends PartialQuoteRequest { | ||
fromAmountForGas?: string; | ||
fromAmount: string; | ||
} | ||
export interface QuoteToAmountRequest extends PartialQuoteRequest { | ||
toAmount: string; | ||
} | ||
export type QuoteRequest = QuoteFromAmountRequest | QuoteToAmountRequest; | ||
export declare const isQuoteRequestWithFromAmount: (r: QuoteRequest) => r is QuoteFromAmountRequest; | ||
export declare const isQuoteRequestWithToAmount: (r: QuoteRequest) => r is QuoteToAmountRequest; | ||
export interface ContractCall { | ||
@@ -277,4 +282,4 @@ fromAmount: string; | ||
export type ContractCallsQuoteRequest = ContractCallsQuoteRequestFromAmount | ContractCallsQuoteRequestToAmount; | ||
export declare const isContractCallsRequestWithFromAmount: (r: ContractCallsQuoteRequestFromAmount | ContractCallsQuoteRequestToAmount) => r is ContractCallsQuoteRequestFromAmount; | ||
export declare const isContractCallsRequestWithToAmount: (r: ContractCallsQuoteRequestFromAmount | ContractCallsQuoteRequestToAmount) => r is ContractCallsQuoteRequestToAmount; | ||
export declare const isContractCallsRequestWithFromAmount: (r: ContractCallsQuoteRequest) => r is ContractCallsQuoteRequestFromAmount; | ||
export declare const isContractCallsRequestWithToAmount: (r: ContractCallsQuoteRequest) => r is ContractCallsQuoteRequestToAmount; | ||
export interface ContractCallQuoteRequest extends ToolConfiguration { | ||
@@ -281,0 +286,0 @@ fromChain: number | string; |
@@ -261,7 +261,6 @@ import type { BridgeDefinition } from './bridges.js' | ||
export interface QuoteRequest extends ToolConfiguration, TimingStrings { | ||
export interface PartialQuoteRequest extends ToolConfiguration, TimingStrings { | ||
fromChain: number | string | ||
fromToken: string | ||
fromAddress: string | ||
fromAmount: string | ||
@@ -278,3 +277,3 @@ toChain: number | string | ||
allowDestinationCall?: boolean // (default : true) // destination calls are enabled by default | ||
fromAmountForGas?: string // the amount of token to convert to gas | ||
maxPriceImpact?: number // hide routes with price impact greater than or equal to this value | ||
@@ -289,7 +288,21 @@ skipSimulation?: boolean | ||
export interface QuoteToAmountRequest | ||
extends Omit<QuoteRequest, 'fromAmount' | 'fromAmountForGas' | 'insurance'> { | ||
export interface QuoteFromAmountRequest extends PartialQuoteRequest { | ||
fromAmountForGas?: string // the amount of token to convert to gas | ||
fromAmount: string | ||
} | ||
export interface QuoteToAmountRequest extends PartialQuoteRequest { | ||
toAmount: string | ||
} | ||
export type QuoteRequest = QuoteFromAmountRequest | QuoteToAmountRequest | ||
export const isQuoteRequestWithFromAmount = ( | ||
r: QuoteRequest | ||
): r is QuoteFromAmountRequest => 'fromAmount' in r | ||
export const isQuoteRequestWithToAmount = ( | ||
r: QuoteRequest | ||
): r is QuoteToAmountRequest => 'toAmount' in r | ||
export interface ContractCall { | ||
@@ -337,8 +350,9 @@ fromAmount: string | ||
| ContractCallsQuoteRequestToAmount | ||
export const isContractCallsRequestWithFromAmount = ( | ||
r: ContractCallsQuoteRequestFromAmount | ContractCallsQuoteRequestToAmount | ||
r: ContractCallsQuoteRequest | ||
): r is ContractCallsQuoteRequestFromAmount => 'fromAmount' in r | ||
export const isContractCallsRequestWithToAmount = ( | ||
r: ContractCallsQuoteRequestFromAmount | ContractCallsQuoteRequestToAmount | ||
r: ContractCallsQuoteRequest | ||
): r is ContractCallsQuoteRequestToAmount => 'toAmount' in r | ||
@@ -345,0 +359,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
132425
2707
2