@lifi/sdk
Advanced tools
Comparing version
@@ -1,2 +0,2 @@ | ||
import { Route, Step, Token } from '@lifi/types'; | ||
import { LifiStep, Route, Token } from '@lifi/types'; | ||
/** | ||
@@ -22,6 +22,6 @@ * Predefined hook that decrypts calldata using EIP-1193 compliant wallet functions. | ||
* Converts a quote to Route | ||
* @param {Step} step - Step returned from the quote endpoint. | ||
* @param {LifiStep} step - Step returned from the quote endpoint. | ||
* @return {Route} - The route to be executed. | ||
* @throws {ValidationError} Throws a ValidationError if the step has missing values. | ||
*/ | ||
export declare const convertQuoteToRoute: (step: Step) => Route; | ||
export declare const convertQuoteToRoute: (step: LifiStep) => Route; |
@@ -84,3 +84,3 @@ "use strict"; | ||
* Converts a quote to Route | ||
* @param {Step} step - Step returned from the quote endpoint. | ||
* @param {LifiStep} step - Step returned from the quote endpoint. | ||
* @return {Route} - The route to be executed. | ||
@@ -96,7 +96,2 @@ * @throws {ValidationError} Throws a ValidationError if the step has missing values. | ||
} | ||
const lifiStep = { | ||
...step, | ||
type: 'lifi', | ||
includedSteps: [], | ||
}; | ||
const route = { | ||
@@ -112,3 +107,3 @@ fromToken: step.action.fromToken, | ||
toAmountUSD: step.estimate.toAmountUSD, | ||
steps: [lifiStep], | ||
steps: [step], | ||
toAmountMin: step.estimate.toAmountMin, | ||
@@ -115,0 +110,0 @@ insurance: { state: 'NOT_INSURABLE', feeAmountUsd: '0' }, |
import { FallbackProvider } from '@ethersproject/providers'; | ||
import { ChainId, ChainKey, ConnectionsRequest, ConnectionsResponse, ContractCallQuoteRequest, ExtendedChain, GasRecommendationRequest, GasRecommendationResponse, GetStatusRequest, LifiStep, PossibilitiesRequest, PossibilitiesResponse, QuoteRequest, RequestOptions, RoutesRequest, RoutesResponse, StatusResponse, Step, Token, TokenAmount, TokensRequest, TokensResponse, ToolsRequest, ToolsResponse } from '@lifi/types'; | ||
import { ChainId, ChainKey, ConnectionsRequest, ConnectionsResponse, ContractCallQuoteRequest, ExtendedChain, GasRecommendationRequest, GasRecommendationResponse, GetStatusRequest, LifiStep, PossibilitiesRequest, PossibilitiesResponse, QuoteRequest, RequestOptions, RoutesRequest, RoutesResponse, StatusResponse, Token, TokenAmount, TokensRequest, TokensResponse, ToolsRequest, ToolsResponse } from '@lifi/types'; | ||
import { Signer } from 'ethers'; | ||
@@ -52,3 +52,3 @@ import { ApproveTokenRequest, RevokeApprovalRequest } from './allowance'; | ||
*/ | ||
getQuote: (request: QuoteRequest, options?: RequestOptions) => Promise<Step>; | ||
getQuote: (request: QuoteRequest, options?: RequestOptions) => Promise<LifiStep>; | ||
/** | ||
@@ -59,3 +59,3 @@ * Get a quote for a destination contract call | ||
*/ | ||
getContractCallQuote: (request: ContractCallQuoteRequest, options?: RequestOptions) => Promise<Step>; | ||
getContractCallQuote: (request: ContractCallQuoteRequest, options?: RequestOptions) => Promise<LifiStep>; | ||
/** | ||
@@ -94,3 +94,3 @@ * Check the status of a transfer. For cross chain transfers, the "bridge" parameter is required. | ||
* Get the transaction data for a single step of a route | ||
* @param {Step} step - The step object. | ||
* @param {LifiStep} step - The step object. | ||
* @return {Promise<Step>} The step populated with the transaction data. | ||
@@ -97,0 +97,0 @@ * @throws {LifiError} Throws a LifiError if request fails. |
@@ -151,3 +151,3 @@ "use strict"; | ||
* Get the transaction data for a single step of a route | ||
* @param {Step} step - The step object. | ||
* @param {LifiStep} step - The step object. | ||
* @return {Promise<Step>} The step populated with the transaction data. | ||
@@ -154,0 +154,0 @@ * @throws {LifiError} Throws a LifiError if request fails. |
import { ConnectionsRequest, ConnectionsResponse, ContractCallQuoteRequest, GasRecommendationRequest, GasRecommendationResponse, GetStatusRequest, LifiStep, QuoteRequest, RequestOptions, TokensRequest, TokensResponse } from '@lifi/types'; | ||
import { ChainId, ChainKey, ExtendedChain, PossibilitiesRequest, PossibilitiesResponse, RoutesRequest, RoutesResponse, StatusResponse, Step, Token, ToolsRequest, ToolsResponse } from '../types'; | ||
import { ChainId, ChainKey, ExtendedChain, PossibilitiesRequest, PossibilitiesResponse, RoutesRequest, RoutesResponse, StatusResponse, Token, ToolsRequest, ToolsResponse } from '../types'; | ||
declare const _default: { | ||
getChains: (options?: RequestOptions | undefined) => Promise<ExtendedChain[]>; | ||
getContractCallQuote: (requestConfig: ContractCallQuoteRequest, options?: RequestOptions | undefined) => Promise<Step>; | ||
getContractCallQuote: (requestConfig: ContractCallQuoteRequest, options?: RequestOptions | undefined) => Promise<LifiStep>; | ||
getGasRecommendation: ({ chainId, fromChain, fromToken }: GasRecommendationRequest, options?: RequestOptions | undefined) => Promise<GasRecommendationResponse>; | ||
getPossibilities: (requestConfig?: PossibilitiesRequest | undefined, options?: RequestOptions | undefined) => Promise<PossibilitiesResponse>; | ||
getQuote: (requestConfig: QuoteRequest, options?: RequestOptions | undefined) => Promise<Step>; | ||
getQuote: (requestConfig: QuoteRequest, options?: RequestOptions | undefined) => Promise<LifiStep>; | ||
getRoutes: (requestConfig: RoutesRequest, options?: RequestOptions | undefined) => Promise<RoutesResponse>; | ||
@@ -10,0 +10,0 @@ getStatus: (requestConfig: GetStatusRequest, options?: RequestOptions | undefined) => Promise<StatusResponse>; |
export declare const name = "@lifi/sdk"; | ||
export declare const version = "2.0.0-beta.7"; | ||
export declare const version = "2.0.0-beta.8"; |
@@ -5,2 +5,2 @@ "use strict"; | ||
exports.name = '@lifi/sdk'; | ||
exports.version = '2.0.0-beta.7'; | ||
exports.version = '2.0.0-beta.8'; |
@@ -1,2 +0,2 @@ | ||
import { Route, Step, Token } from '@lifi/types'; | ||
import { LifiStep, Route, Token } from '@lifi/types'; | ||
/** | ||
@@ -22,6 +22,6 @@ * Predefined hook that decrypts calldata using EIP-1193 compliant wallet functions. | ||
* Converts a quote to Route | ||
* @param {Step} step - Step returned from the quote endpoint. | ||
* @param {LifiStep} step - Step returned from the quote endpoint. | ||
* @return {Route} - The route to be executed. | ||
* @throws {ValidationError} Throws a ValidationError if the step has missing values. | ||
*/ | ||
export declare const convertQuoteToRoute: (step: Step) => Route; | ||
export declare const convertQuoteToRoute: (step: LifiStep) => Route; |
@@ -76,3 +76,3 @@ import { request } from './request'; | ||
* Converts a quote to Route | ||
* @param {Step} step - Step returned from the quote endpoint. | ||
* @param {LifiStep} step - Step returned from the quote endpoint. | ||
* @return {Route} - The route to be executed. | ||
@@ -88,7 +88,2 @@ * @throws {ValidationError} Throws a ValidationError if the step has missing values. | ||
} | ||
const lifiStep = { | ||
...step, | ||
type: 'lifi', | ||
includedSteps: [], | ||
}; | ||
const route = { | ||
@@ -104,3 +99,3 @@ fromToken: step.action.fromToken, | ||
toAmountUSD: step.estimate.toAmountUSD, | ||
steps: [lifiStep], | ||
steps: [step], | ||
toAmountMin: step.estimate.toAmountMin, | ||
@@ -107,0 +102,0 @@ insurance: { state: 'NOT_INSURABLE', feeAmountUsd: '0' }, |
import { FallbackProvider } from '@ethersproject/providers'; | ||
import { ChainId, ChainKey, ConnectionsRequest, ConnectionsResponse, ContractCallQuoteRequest, ExtendedChain, GasRecommendationRequest, GasRecommendationResponse, GetStatusRequest, LifiStep, PossibilitiesRequest, PossibilitiesResponse, QuoteRequest, RequestOptions, RoutesRequest, RoutesResponse, StatusResponse, Step, Token, TokenAmount, TokensRequest, TokensResponse, ToolsRequest, ToolsResponse } from '@lifi/types'; | ||
import { ChainId, ChainKey, ConnectionsRequest, ConnectionsResponse, ContractCallQuoteRequest, ExtendedChain, GasRecommendationRequest, GasRecommendationResponse, GetStatusRequest, LifiStep, PossibilitiesRequest, PossibilitiesResponse, QuoteRequest, RequestOptions, RoutesRequest, RoutesResponse, StatusResponse, Token, TokenAmount, TokensRequest, TokensResponse, ToolsRequest, ToolsResponse } from '@lifi/types'; | ||
import { Signer } from 'ethers'; | ||
@@ -52,3 +52,3 @@ import { ApproveTokenRequest, RevokeApprovalRequest } from './allowance'; | ||
*/ | ||
getQuote: (request: QuoteRequest, options?: RequestOptions) => Promise<Step>; | ||
getQuote: (request: QuoteRequest, options?: RequestOptions) => Promise<LifiStep>; | ||
/** | ||
@@ -59,3 +59,3 @@ * Get a quote for a destination contract call | ||
*/ | ||
getContractCallQuote: (request: ContractCallQuoteRequest, options?: RequestOptions) => Promise<Step>; | ||
getContractCallQuote: (request: ContractCallQuoteRequest, options?: RequestOptions) => Promise<LifiStep>; | ||
/** | ||
@@ -94,3 +94,3 @@ * Check the status of a transfer. For cross chain transfers, the "bridge" parameter is required. | ||
* Get the transaction data for a single step of a route | ||
* @param {Step} step - The step object. | ||
* @param {LifiStep} step - The step object. | ||
* @return {Promise<Step>} The step populated with the transaction data. | ||
@@ -97,0 +97,0 @@ * @throws {LifiError} Throws a LifiError if request fails. |
@@ -122,3 +122,3 @@ import { approveToken, bulkGetTokenApproval, getTokenApproval, revokeTokenApproval, } from './allowance'; | ||
* Get the transaction data for a single step of a route | ||
* @param {Step} step - The step object. | ||
* @param {LifiStep} step - The step object. | ||
* @return {Promise<Step>} The step populated with the transaction data. | ||
@@ -125,0 +125,0 @@ * @throws {LifiError} Throws a LifiError if request fails. |
import { ConnectionsRequest, ConnectionsResponse, ContractCallQuoteRequest, GasRecommendationRequest, GasRecommendationResponse, GetStatusRequest, LifiStep, QuoteRequest, RequestOptions, TokensRequest, TokensResponse } from '@lifi/types'; | ||
import { ChainId, ChainKey, ExtendedChain, PossibilitiesRequest, PossibilitiesResponse, RoutesRequest, RoutesResponse, StatusResponse, Step, Token, ToolsRequest, ToolsResponse } from '../types'; | ||
import { ChainId, ChainKey, ExtendedChain, PossibilitiesRequest, PossibilitiesResponse, RoutesRequest, RoutesResponse, StatusResponse, Token, ToolsRequest, ToolsResponse } from '../types'; | ||
declare const _default: { | ||
getChains: (options?: RequestOptions | undefined) => Promise<ExtendedChain[]>; | ||
getContractCallQuote: (requestConfig: ContractCallQuoteRequest, options?: RequestOptions | undefined) => Promise<Step>; | ||
getContractCallQuote: (requestConfig: ContractCallQuoteRequest, options?: RequestOptions | undefined) => Promise<LifiStep>; | ||
getGasRecommendation: ({ chainId, fromChain, fromToken }: GasRecommendationRequest, options?: RequestOptions | undefined) => Promise<GasRecommendationResponse>; | ||
getPossibilities: (requestConfig?: PossibilitiesRequest | undefined, options?: RequestOptions | undefined) => Promise<PossibilitiesResponse>; | ||
getQuote: (requestConfig: QuoteRequest, options?: RequestOptions | undefined) => Promise<Step>; | ||
getQuote: (requestConfig: QuoteRequest, options?: RequestOptions | undefined) => Promise<LifiStep>; | ||
getRoutes: (requestConfig: RoutesRequest, options?: RequestOptions | undefined) => Promise<RoutesResponse>; | ||
@@ -10,0 +10,0 @@ getStatus: (requestConfig: GetStatusRequest, options?: RequestOptions | undefined) => Promise<StatusResponse>; |
export declare const name = "@lifi/sdk"; | ||
export declare const version = "2.0.0-beta.7"; | ||
export declare const version = "2.0.0-beta.8"; |
export const name = '@lifi/sdk'; | ||
export const version = '2.0.0-beta.7'; | ||
export const version = '2.0.0-beta.8'; |
{ | ||
"name": "@lifi/sdk", | ||
"version": "2.0.0-beta.7", | ||
"version": "2.0.0-beta.8", | ||
"description": "LI.FI Any-to-Any Cross-Chain-Swap SDK", | ||
@@ -5,0 +5,0 @@ "main": "./dist/cjs/index.js", |
359601
-0.04%7991
-0.12%