Skip to content

Latest commit

 

History

History
2325 lines (1424 loc) · 69.4 KB

modules.md

File metadata and controls

2325 lines (1424 loc) · 69.4 KB

@paraswap/sdk / Exports

@paraswap/sdk

Table of contents

Namespaces

Enumerations

Classes

Interfaces

Type Aliases

Variables

Functions

Type Aliases

Address

Ƭ Address: string

Defined in

src/helpers/token.ts:6


AddressOrSymbol

Ƭ AddressOrSymbol: string

Defined in

src/helpers/token.ts:10


AllSDKMethods

Ƭ AllSDKMethods<TxResponse>: Object

Type parameters

Name
TxResponse

Type declaration

Name Type
limitOrders LimitOrderHandlers<TxResponse>
nftOrders NFTOrderHandlers<TxResponse>
swap SwapSDKMethods<TxResponse>

Defined in

src/sdk/full.ts:12


ApproveTokenForLimitOrderFunctions

Ƭ ApproveTokenForLimitOrderFunctions<T>: Object

Type parameters

Name
T

Type declaration

Name Type Description
approveMakerTokenForLimitOrder ApproveToken<T> Description approving AugustusRFQ as spender for makerAsset
approveTakerTokenForLimitOrder ApproveToken<T> Description approving AugustusSwapper as spender for takerAsset for Limit Orders that will be executed through it

Defined in

src/methods/limitOrders/approveForOrder.ts:6


ApproveTokenForNFTOrderFunctions

Ƭ ApproveTokenForNFTOrderFunctions<T>: Object

Type parameters

Name
T

Type declaration

Name Type Description
approveERC20ForNFTOrder ApproveToken<T> Description approving AugustusSwapper as spender for takerAsset (ERC20) for Limit Orders that will be executed through it
approveNFTorNFTOrder ApproveNFT<T> Description approving AugustusRFQ as spender for makerAsset (NFT)

Defined in

src/methods/nftOrders/approveForOrder.ts:16


ApproveTokenFunctions

Ƭ ApproveTokenFunctions<T>: Object

Type parameters

Name
T

Type declaration

Name Type
approveToken ApproveToken<T>
approveTokenBulk ApproveTokenBulk<T>

Defined in

src/methods/swap/approve.ts:17


AssetTypeVariant

Ƭ AssetTypeVariant: typeof AssetType[keyof typeof AssetType]

Defined in

src/methods/nftOrders/helpers/types.ts:50


BuildLimitOrderFunctions

Ƭ BuildLimitOrderFunctions: Object

Type declaration

Name Type Description
buildLimitOrder BuildLimitOrder Description Build Orders that will be excuted through AugustusSwapper

Defined in

src/methods/limitOrders/buildOrder.ts:21


BuildLimitOrderInput

Ƭ BuildLimitOrderInput: Omit<BuildOrderDataInput, "chainId" | "verifyingContract" | "AugustusAddress" | "AppVersion">

Defined in

src/methods/limitOrders/buildOrder.ts:11


BuildLimitOrderTxInput

Ƭ BuildLimitOrderTxInput: BuildTxInputBaseBUYForOrders & { destDecimals: number ; orders: SwappableOrder[] ; srcDecimals: number }

Defined in

src/methods/swap/transaction.ts:110


BuildLimitOrdersTxFunctions

Ƭ BuildLimitOrdersTxFunctions: Object

Type declaration

Name Type
buildLimitOrderTx BuildLimitOrdersTx
buildSwapAndLimitOrderTx BuildSwapAndLimitOrdersTx
getLimitOrdersRate GetLimitOrdersRate

Defined in

src/methods/limitOrders/transaction.ts:46


BuildNFTOrderFunctions

Ƭ BuildNFTOrderFunctions: Object

Type declaration

Name Type Description
buildNFTOrder BuildNFTOrder Description Build Orders that will be excuted through AugustusSwapper

Defined in

src/methods/nftOrders/buildOrder.ts:20


BuildNFTOrderInput

Ƭ BuildNFTOrderInput: Omit<BuildNFTOrderDataInput, "chainId" | "verifyingContract" | "AugustusAddress">

Defined in

src/methods/nftOrders/buildOrder.ts:10


BuildNFTOrderTxInput

Ƭ BuildNFTOrderTxInput: BuildTxInputBaseBUYForOrders<"destDecimals"> & { orders: SwappableNFTOrder[] ; srcDecimals: number }

Defined in

src/methods/swap/transaction.ts:117


BuildNFTOrdersTxFunctions

Ƭ BuildNFTOrdersTxFunctions: Object

Type declaration

Name Type
buildNFTOrderTx BuildNFTOrdersTx
buildSwapAndNFTOrderTx BuildSwapAndNFTOrdersTx
getNFTOrdersRate GetNFTOrdersRate

Defined in

src/methods/nftOrders/transaction.ts:46


BuildOptions

Ƭ BuildOptions: BuildOptionsWithGasPrice | BuildOptionsWitWithMaxFee

Defined in

src/methods/swap/transaction.ts:172


BuildOptionsBase

Ƭ BuildOptionsBase: Object

Type declaration

Name Type Description
ignoreAllowance? boolean Description Allows the API to skip performing onchain allowance checks.
ignoreChecks? boolean Description Allows the API to skip performing onchain checks such as balances, allowances, as well as transaction simulations. The response does not contain gas parameter when set to true
ignoreGasEstimate? boolean Description Allows the API to skip gas checks. The response does not contain gas parameter when set to true
onlyParams? boolean Description Allows the API to return the contract parameters only.

Defined in

src/methods/swap/transaction.ts:158


BuildOptionsWitWithMaxFee

Ƭ BuildOptionsWitWithMaxFee: BuildOptionsBase & Partial<WithMaxFee>

Defined in

src/methods/swap/transaction.ts:170


BuildOptionsWithGasPrice

Ƭ BuildOptionsWithGasPrice: BuildOptionsBase & Partial<WithGasPrice>

Defined in

src/methods/swap/transaction.ts:169


BuildSwapAndLimitOrderTxInput

Ƭ BuildSwapAndLimitOrderTxInput: BuildTxInputBaseBUYForOrders & { destDecimals: number ; orders: SwappableOrder[] ; priceRoute: OptimalRate }

Defined in

src/methods/swap/transaction.ts:133


BuildSwapAndNFTOrderTxInput

Ƭ BuildSwapAndNFTOrderTxInput: BuildTxInputBaseBUYForOrders & { orders: SwappableNFTOrder[] ; priceRoute: OptimalRate }

Defined in

src/methods/swap/transaction.ts:144


BuildSwapTxInput

Ƭ BuildSwapTxInput: BuildTxInputBase & { priceRoute: OptimalRate } & TxInputAmountsPartSell | TxInputAmountsPartBuy | TxInputAmountsPartBuyOrSell

Defined in

src/methods/swap/transaction.ts:89


BuildTxFunctions

Ƭ BuildTxFunctions: Object

Type declaration

Name Type
buildTx BuildTx

Defined in

src/methods/swap/transaction.ts:180


BuildTxInput

Ƭ BuildTxInput: BuildSwapTxInput | BuildLimitOrderTxInput | BuildNFTOrderTxInput | BuildSwapAndLimitOrderTxInput | BuildSwapAndNFTOrderTxInput

Defined in

src/methods/swap/transaction.ts:151


CancelLimitOrderFunctions

Ƭ CancelLimitOrderFunctions<T>: Object

Type parameters

Name
T

Type declaration

Name Type
cancelLimitOrder CancelOrder<T>
cancelLimitOrderBulk CancelOrderBulk<T>

Defined in

src/methods/limitOrders/cancelOrder.ts:17


CancelNFTOrderFunctions

Ƭ CancelNFTOrderFunctions<T>: Object

Type parameters

Name
T

Type declaration

Name Type
cancelNFTOrder CancelOrder<T>
cancelNFTOrderBulk CancelOrderBulk<T>

Defined in

src/methods/nftOrders/cancelOrder.ts:14


ContractMethod

Ƭ ContractMethod: ContractMethodV5 | ContractMethodV6

Defined in

node_modules/@paraswap/core/build/constants.d.ts:44

node_modules/@paraswap/core/build/constants.d.ts:81


FetcherFunction

Ƭ FetcherFunction: <T, URL>(params: FetcherGetInput<URL> | FetcherPostInput<URL>) => Promise<T>

Type declaration

▸ <T, URL>(params): Promise<T>

Type parameters
Name Type
T T
URL extends string = string
Parameters
Name Type
params FetcherGetInput<URL> | FetcherPostInput<URL>
Returns

Promise<T>

Defined in

src/types.ts:58


FillOrderDirectlyFunctions

Ƭ FillOrderDirectlyFunctions<T>: Object

Type parameters

Name
T

Type declaration

Name Type
fillOrderDirectly FillOrderDirectly<T>

Defined in

src/methods/limitOrders/fillOrderDirectly.ts:7


GetAdaptersFunctions

Ƭ GetAdaptersFunctions: Object

Type declaration

Name Type
getAdapters (signal?: AbortSignal) => Promise<AdaptersAsStrings>

Defined in

src/methods/swap/adapters.ts:7


GetBalancesFunctions

Ƭ GetBalancesFunctions: Object

Type declaration

Name Type
getAllowance GetAllowance
getAllowances GetAllowances
getBalance GetBalance
getBalances GetBalances

Defined in

src/methods/swap/balance.ts:46


GetLimitOrdersContractFunctions

Ƭ GetLimitOrdersContractFunctions: Object

Type declaration

Name Type
getLimitOrdersContract GetSpender
getTokenTransferProxy GetSpender

Defined in

src/methods/limitOrders/getOrdersContract.ts:4


GetLimitOrdersFunctions

Ƭ GetLimitOrdersFunctions: Object

Type declaration

Name Type Description
getLimitOrderByHash GetLimitOrderByHash -
getLimitOrders GetLimitOrders -
getRequiredBalance GetRequiredBalance Gets fillableBalance for tokens from user's active orders. User needs to have enough balance & allowance to cover active orders before creating new orders. Param parameters to get allowance for active orders Param user to get required allowances for Param if given token, the mapping will contain that token address only Param AbortSignal passed to fetcher

Defined in

src/methods/limitOrders/getOrders.ts:51


GetNFTOrdersContractFunctions

Ƭ GetNFTOrdersContractFunctions: Object

Type declaration

Name Type
getNFTOrdersContract GetSpender
getTokenTransferProxy GetSpender

Defined in

src/methods/nftOrders/getOrdersContract.ts:4


GetNFTOrdersFunctions

Ƭ GetNFTOrdersFunctions: Object

Type declaration

Name Type
getNFTOrderByHash GetNFTOrderByHash
getNFTOrders GetNFTOrders

Defined in

src/methods/nftOrders/getOrders.ts:27


GetRateFunctions

Ƭ GetRateFunctions: Object

Type declaration

Name Type
getRate GetRate
getRateByRoute GetRateByRoute

Defined in

src/methods/swap/rates.ts:203


GetSpenderFunctions

Ƭ GetSpenderFunctions: Object

Type declaration

Name Type
getAugustusRFQ GetSpender
getAugustusSwapper GetSpender
getContracts GetContracts
getSpender GetSpender

Defined in

src/methods/swap/spender.ts:8


GetSwapTxFunctions

Ƭ GetSwapTxFunctions: Object

Type declaration

Name Type
getSwapTxData GetSwapTxData

Defined in

src/methods/swap/swapTx.ts:213


GetTokensFunctions

Ƭ GetTokensFunctions: Object

Type declaration

Name Type
getTokens GetTokens

Defined in

src/methods/swap/token.ts:11


LimitOrder

Ƭ LimitOrder: LimitOrderFromApi

Defined in

src/methods/limitOrders/helpers/types.ts:5


LimitOrderApiResponse

Ƭ LimitOrderApiResponse: Object

Type declaration

Name Type
order LimitOrderFromApi

Defined in

src/methods/limitOrders/helpers/types.ts:19


LimitOrderEvent

Ƭ LimitOrderEvent: ""

Defined in

src/methods/limitOrders/helpers/types.ts:37


LimitOrderFromApi

Ƭ LimitOrderFromApi: Object

Type declaration

Name Type Description
chainId number -
createdAt number -
expiry number -
fillableBalance string -
maker string -
makerAmount string -
makerAsset string -
makerBalance string -
nonceAndMeta string -
orderHash string -
permitMakerAsset null | string -
reservedBalance string -
signature string -
state LimitOrderState -
swappableBalance string -
taker string -
takerAmount string -
takerAsset string -
takerFromMeta string -
transactionHash null | string Description transaction with the last event pertaining to the order: OrderFilled or OrderCancelled
type LimitOrderType -
updatedAt number -

Defined in

src/methods/limitOrders/helpers/types.ts:44


LimitOrderHandlers

Ƭ LimitOrderHandlers<T>: SubmitLimitOrderFuncs & BuildLimitOrderFunctions & SignLimitOrderFunctions & PostLimitOrderFunctions & GetLimitOrdersFunctions & GetLimitOrdersContractFunctions & BuildLimitOrdersTxFunctions & CancelLimitOrderFunctions<T> & ApproveTokenForLimitOrderFunctions<T> & FillOrderDirectlyFunctions<T>

Type parameters

Name
T

Defined in

src/methods/limitOrders/index.ts:106


LimitOrderState

Ƭ LimitOrderState: "DRAFT" | "PENDING" | "FULFILLED" | "CANCELLED" | "SUSPENDED" | "EXPIRED"

Defined in

src/methods/limitOrders/helpers/types.ts:29


LimitOrderToSend

Ƭ LimitOrderToSend: OrderData & { permitMakerAsset?: string ; signature: string }

Defined in

src/methods/limitOrders/helpers/types.ts:7


LimitOrderTransaction

Ƭ LimitOrderTransaction: Object

Type declaration

Name Type
event_type "OrderFilled" | "OrderCancelled"
hash string

Defined in

src/methods/limitOrders/helpers/types.ts:39


LimitOrderType

Ƭ LimitOrderType: "LIMIT" | "P2P"

Defined in

src/methods/limitOrders/helpers/types.ts:3


LimitOrdersApiResponse

Ƭ LimitOrdersApiResponse: Object

Type declaration

Name Type
hasMore boolean
limit number
offset number
orders LimitOrderFromApi[]
total number

Defined in

src/methods/limitOrders/helpers/types.ts:12


LimitOrdersUserParams

Ƭ LimitOrdersUserParams: { maker: Address ; type: LimitOrderType } | { taker: Address ; type: LimitOrderType } & PaginationParams

Defined in

src/methods/limitOrders/getOrders.ts:26


NFTOrderApiResponse

Ƭ NFTOrderApiResponse: Object

Type declaration

Name Type
order NFTOrderFromAPI

Defined in

src/methods/nftOrders/helpers/types.ts:46


NFTOrderData

Ƭ NFTOrderData: Object

Type declaration

Name Type
expiry number
maker Address
makerAmount BigIntAsString
makerAsset BigIntAsString
makerAssetId BigIntAsString
nonceAndMeta BigIntAsString
taker Address
takerAmount BigIntAsString
takerAsset BigIntAsString
takerAssetId BigIntAsString

Defined in

src/methods/nftOrders/helpers/buildOrderData.ts:56


NFTOrderFromAPI

Ƭ NFTOrderFromAPI: NFTOrderToSend & { chainId: number ; createdAt: number ; fillableBalance: string ; makerAsset: Address ; makerAssetType: AssetTypeVariant ; makerBalance: string ; orderHash: string ; permitMakerAsset: null | string ; state: NFTOrderState ; takerAsset: Address ; takerAssetType: AssetTypeVariant ; takerFromMeta: string ; transactionHash: null | string ; type: NFTOrderType ; updatedAt: number }

Defined in

src/methods/nftOrders/helpers/types.ts:22


NFTOrderHandlers

Ƭ NFTOrderHandlers<T>: SubmitNFTOrderFuncs & BuildNFTOrderFunctions & SignNFTOrderFunctions & PostNFTOrderFunctions & GetNFTOrdersFunctions & GetNFTOrdersContractFunctions & BuildNFTOrdersTxFunctions & CancelNFTOrderFunctions<T> & ApproveTokenForNFTOrderFunctions<T>

Type parameters

Name
T

Defined in

src/methods/nftOrders/index.ts:95


NFTOrderState

Ƭ NFTOrderState: "PENDING" | "FULFILLED" | "CANCELLED" | "EXPIRED"

Defined in

src/methods/nftOrders/helpers/types.ts:20


NFTOrderToSend

Ƭ NFTOrderToSend: NFTOrderData & { permitMakerAsset?: string ; signature: string }

Defined in

src/methods/nftOrders/helpers/types.ts:12


NFTOrderTransaction

Ƭ NFTOrderTransaction: Object

Type declaration

Name Type
event_type "OrderFilled" | "OrderCancelled"
hash string

Defined in

src/methods/nftOrders/helpers/types.ts:5


NFTOrderType

Ƭ NFTOrderType: "LIMIT" | "P2P"

Defined in

src/methods/nftOrders/helpers/types.ts:10


NFTOrdersApiResponse

Ƭ NFTOrdersApiResponse: Object

Type declaration

Name Type
orders NFTOrderFromAPI[]

Defined in

src/methods/nftOrders/helpers/types.ts:43


NFTOrdersUserParams

Ƭ NFTOrdersUserParams: { maker: Address ; type: NFTOrderType } | { taker: Address ; type: NFTOrderType }

Defined in

src/methods/nftOrders/getOrders.ts:15


OptimalRate

Ƭ OptimalRate: Object

Type declaration

Name Type
bestRoute OptimalRoute[]
blockNumber number
contractAddress Address
contractMethod string
destAmount NumberAsString
destDecimals number
destToken Address
destUSD NumberAsString | null
gasCost NumberAsString
gasCostL1Wei? string
gasCostUSD NumberAsString
hmac string
maxImpact? number
maxImpactReached? boolean
maxUSDImpact? number
network number
others? OptionalRate[]
partner? string
partnerFee number
side SwapSide
srcAmount NumberAsString
srcDecimals number
srcToken Address
srcUSD NumberAsString | null
tokenTransferProxy Address
version ParaSwapVersion

Defined in

node_modules/@paraswap/core/build/types.d.ts:36


OptionalRate

Ƭ OptionalRate: Object

Type declaration

Name Type
data? any
destAmount NumberAsString
exchange string
srcAmount NumberAsString
unit? NumberAsString

Defined in

node_modules/@paraswap/core/build/types.d.ts:29


OrderData

Ƭ OrderData: Object

Type declaration

Name Type
expiry number
maker string
makerAmount string
makerAsset string
nonceAndMeta string
taker string
takerAmount string
takerAsset string

Defined in

src/methods/limitOrders/helpers/buildOrderData.ts:47


ParaSwapVersion

Ƭ ParaSwapVersion: EnumerateLiteral<typeof ParaSwapVersion>

Description

Passed to version API enpoints as ?version: to /prices and /adapters

Defined in

src/types.ts:35


PostLimitOrderFunctions

Ƭ PostLimitOrderFunctions: Object

Type declaration

Name Type
postLimitOrder PostLimitOrder
postP2POrder PostLimitOrder

Defined in

src/methods/limitOrders/postOrder.ts:16


PostNFTOrderFunctions

Ƭ PostNFTOrderFunctions: Object

Type declaration

Name Type
postNFTLimitOrder PostNFTOrder
postNFTP2POrder PostNFTOrder

Defined in

src/methods/nftOrders/postOrder.ts:16


PriceString

Ƭ PriceString: string

Defined in

src/helpers/token.ts:14


SDKConfig

Ƭ SDKConfig<TxResponse>: ConstructProviderFetchInput<TxResponse, "staticCall" | "transactCall" | "signTypedDataCall"> & ConstructFetchInput

Type parameters

Name Type
TxResponse any

Defined in

src/sdk/partial.ts:16


SignLimitOrderFunctions

Ƭ SignLimitOrderFunctions: Object

Type declaration

Name Type
signLimitOrder (signableOrderData: SignableOrderData) => Promise<string>

Defined in

src/methods/limitOrders/signOrder.ts:5


SignNFTOrderFunctions

Ƭ SignNFTOrderFunctions: Object

Type declaration

Name Type
signNFTOrder (signableOrderData: SignableNFTOrderData) => Promise<string>

Defined in

src/methods/nftOrders/signOrder.ts:5


SignableNFTOrderData

Ƭ SignableNFTOrderData: Object

Type declaration

Name Type
data NFTOrderData
domain Domain
types { OrderNFT: typeof OrderNFT }
types.OrderNFT typeof OrderNFT

Defined in

src/methods/nftOrders/helpers/buildOrderData.ts:48


SignableOrderData

Ƭ SignableOrderData: Object

Type declaration

Name Type
data OrderData
domain Domain
types { Order: typeof Order }
types.Order typeof Order

Defined in

src/methods/limitOrders/helpers/buildOrderData.ts:41


SignableTypedData

Ƭ SignableTypedData: Object

Type declaration

Name Type
data Record<string, any>
domain TypedDataDomain
types Record<string, TypedDataField[]>

Defined in

src/methods/common/orders/buildOrderData.ts:14


SimpleFetchSDK

Ƭ SimpleFetchSDK: { limitOrders: LimitOrdersFetchMethods ; nftOrders: NFTOrdersFetchMethods ; swap: SwapFetchMethods } & Required<ConstructBaseInput>

Defined in

src/sdk/simple.ts:118


SimpleSDK

Ƭ SimpleSDK: { limitOrders: LimitOrderHandlers<TxHash> ; nftOrders: NFTOrderHandlers<TxHash> ; swap: SwapSDKMethods<TxHash> } & Required<ConstructBaseInput>

Defined in

src/sdk/simple.ts:124


SimpleSDKProviderOptions

Ƭ SimpleSDKProviderOptions: EthersProviderDeps | { web3: default } & { account: Address }

Defined in

src/sdk/simple.ts:141


SubmitLimitOrderFuncs

Ƭ SubmitLimitOrderFuncs: Object

Type declaration

Name Type
submitLimitOrder SubmitLimitOrder
submitP2POrder SubmitP2POrder

Defined in

src/methods/limitOrders/index.ts:45


SubmitNFTOrderFuncs

Ƭ SubmitNFTOrderFuncs: Object

Type declaration

Name Type
submitNFTOrder SubmitNFTOrder
submitP2POrder SubmitNFTOrder

Defined in

src/methods/nftOrders/index.ts:34


SwapSDKMethods

Ƭ SwapSDKMethods<TxResponse>: GetBalancesFunctions & GetTokensFunctions & GetSpenderFunctions & ApproveTokenFunctions<TxResponse> & BuildTxFunctions & GetAdaptersFunctions & GetRateFunctions & GetSwapTxFunctions

Type parameters

Name
TxResponse

Defined in

src/methods/swap/index.ts:12


SwappableNFTOrder

Ƭ SwappableNFTOrder: SwappableOrder & { makerAssetId: string ; makerAssetType: AssetTypeVariant ; takerAssetId: string ; takerAssetType: AssetTypeVariant }

Defined in

src/methods/swap/transaction.ts:33


SwappableOrder

Ƭ SwappableOrder: OrderData & { permitMakerAsset?: string ; signature: string }

Defined in

src/methods/swap/transaction.ts:28


Token

Ƭ Token: Object

Type declaration

Name Type
address string
allowance? string
balance? string
connectors string[]
decimals number
img? string
mainConnector string
network number
symbol? string
tokenType LendingToken | TokenType

Defined in

src/helpers/token.ts:37


TxHash

Ƭ TxHash: string

Defined in

src/helpers/token.ts:18


Web3UnpromiEvent

Ƭ Web3UnpromiEvent: Pick<PromiEvent<Contract>, "on" | "once">

Defined in

src/helpers/providers/web3.ts:22

Variables

API_URL

Const API_URL: "https://api.paraswap.io"

Defined in

src/constants.ts:10


AssetType

Const AssetType: Object

Type declaration

Name Type
ERC1155 1
ERC20 0
ERC721 2

Defined in

src/methods/nftOrders/helpers/misc.ts:21


ContractMethod

Const ContractMethod: Object

Type declaration

Name Type
buy buy
buyOnUniswap buyOnUniswap
buyOnUniswapFork buyOnUniswapFork
buyOnUniswapV2Fork buyOnUniswapV2Fork
directBalancerV2GivenInSwap directBalancerV2GivenInSwap
directBalancerV2GivenOutSwap directBalancerV2GivenOutSwap
directCurveV1Swap directCurveV1Swap
directCurveV2Swap directCurveV2Swap
directUniV3Buy directUniV3Buy
directUniV3Swap directUniV3Swap
megaSwap megaSwap
multiSwap multiSwap
protectedMegaSwap protectedMegaSwap
protectedMultiSwap protectedMultiSwap
protectedSimpleBuy protectedSimpleBuy
protectedSimpleSwap protectedSimpleSwap
simpleBuy simpleBuy
simpleSwap simpleSwap
swapExactAmountIn swapExactAmountIn
swapExactAmountInOnBalancerV2 swapExactAmountInOnBalancerV2
swapExactAmountInOnCurveV1 swapExactAmountInOnCurveV1
swapExactAmountInOnCurveV2 swapExactAmountInOnCurveV2
swapExactAmountInOnUniswapV2 swapExactAmountInOnUniswapV2
swapExactAmountInOnUniswapV3 swapExactAmountInOnUniswapV3
swapExactAmountInOutOnMakerPSM swapExactAmountInOutOnMakerPSM
swapExactAmountOut swapExactAmountOut
swapExactAmountOutOnBalancerV2 swapExactAmountOutOnBalancerV2
swapExactAmountOutOnUniswapV2 swapExactAmountOutOnUniswapV2
swapExactAmountOutOnUniswapV3 swapExactAmountOutOnUniswapV3
swapOnAugustusRFQTryBatchFill swapOnAugustusRFQTryBatchFill
swapOnUniswap swapOnUniswap
swapOnUniswapFork swapOnUniswapFork
swapOnUniswapV2Fork swapOnUniswapV2Fork
swapOnZeroXv2 swapOnZeroXv2
swapOnZeroXv4 swapOnZeroXv4

Defined in

node_modules/@paraswap/core/build/constants.d.ts:44

node_modules/@paraswap/core/build/constants.d.ts:81


DEFAULT_VERSION

Const DEFAULT_VERSION: ParaSwapVersion = '5'

Defined in

src/constants.ts:11

Functions

constructAllLimitOrdersHandlers

constructAllLimitOrdersHandlers<TxResponse>(options): LimitOrderHandlers<TxResponse>

Description

construct SDK with every LimitOrders-related method, fetching from API and contract calls

Type parameters

Name
TxResponse

Parameters

Name Type
options ConstructProviderFetchInput<TxResponse, "staticCall" | "transactCall" | "signTypedDataCall">

Returns

LimitOrderHandlers<TxResponse>


constructAllNFTOrdersHandlers

constructAllNFTOrdersHandlers<TxResponse>(options): NFTOrderHandlers<TxResponse>

Description

construct SDK with every NFTOrders-related method, fetching from API and contract calls

Type parameters

Name
TxResponse

Parameters

Name Type
options ConstructProviderFetchInput<TxResponse, "staticCall" | "transactCall" | "signTypedDataCall">

Returns

NFTOrderHandlers<TxResponse>


constructApproveToken

constructApproveToken<T>(options): ApproveTokenFunctions<T>

Type parameters

Name
T

Parameters

Name Type
options ConstructProviderFetchInput<T, "transactCall">

Returns

ApproveTokenFunctions<T>


constructApproveTokenForLimitOrder

constructApproveTokenForLimitOrder<T>(options): ApproveTokenForLimitOrderFunctions<T>

Type parameters

Name
T

Parameters

Name Type
options ConstructProviderFetchInput<T, "transactCall">

Returns

ApproveTokenForLimitOrderFunctions<T>


constructApproveTokenForNFTOrder

constructApproveTokenForNFTOrder<T>(options): ApproveTokenForNFTOrderFunctions<T>

Type parameters

Name
T

Parameters

Name Type
options ConstructProviderFetchInput<T, "transactCall">

Returns

ApproveTokenForNFTOrderFunctions<T>


constructAxiosFetcher

constructAxiosFetcher(axios, extra?): FetcherFunction

Parameters

Name Type
axios AxiosRequirement
extra? ExtraFetchParams

Returns

FetcherFunction


constructBuildLimitOrder

constructBuildLimitOrder(options): BuildLimitOrderFunctions

Parameters

Name Type
options ConstructFetchInput

Returns

BuildLimitOrderFunctions


constructBuildLimitOrderTx

constructBuildLimitOrderTx(__namedParameters): BuildLimitOrdersTxFunctions

Parameters

Name Type
__namedParameters ConstructFetchInput

Returns

BuildLimitOrdersTxFunctions


constructBuildNFTOrder

constructBuildNFTOrder(options): BuildNFTOrderFunctions

Parameters

Name Type
options ConstructFetchInput

Returns

BuildNFTOrderFunctions


constructBuildNFTOrderTx

constructBuildNFTOrderTx(__namedParameters): BuildNFTOrdersTxFunctions

Parameters

Name Type
__namedParameters ConstructFetchInput

Returns

BuildNFTOrdersTxFunctions


constructBuildTx

constructBuildTx(__namedParameters): BuildTxFunctions

Parameters

Name Type
__namedParameters ConstructFetchInput

Returns

BuildTxFunctions


constructCancelLimitOrder

constructCancelLimitOrder<T>(options): CancelLimitOrderFunctions<T>

Type parameters

Name
T

Parameters

Name Type
options ConstructProviderFetchInput<T, "transactCall">

Returns

CancelLimitOrderFunctions<T>


constructCancelNFTOrder

constructCancelNFTOrder<T>(options): CancelNFTOrderFunctions<T>

Type parameters

Name
T

Parameters

Name Type
options ConstructProviderFetchInput<T, "transactCall">

Returns

CancelNFTOrderFunctions<T>


constructEthersContractCaller

constructEthersContractCaller(__namedParameters, account?): ContractCallerFunctions<ContractTransaction>

Parameters

Name Type
__namedParameters EthersProviderDeps
account? string

Returns

ContractCallerFunctions<ContractTransaction>


constructFetchFetcher

constructFetchFetcher(fetch, extra?): FetcherFunction

Parameters

Name Type
fetch (input: RequestInfo, init?: RequestInit) => Promise<Response>
extra? ExtraFetchParams

Returns

FetcherFunction


constructFillOrderDirectly

constructFillOrderDirectly<T>(options): FillOrderDirectlyFunctions<T>

Type parameters

Name
T

Parameters

Name Type
options ConstructProviderFetchInput<T, "transactCall">

Returns

FillOrderDirectlyFunctions<T>


constructFullSDK

constructFullSDK<TxResponse>(config): AllSDKMethods<TxResponse>

Description

construct SDK with every method, for swap and limitOrders

Type parameters

Name Type
TxResponse any

Parameters

Name Type
config SDKConfig<TxResponse>

Returns

AllSDKMethods<TxResponse>


constructGetAdapters

constructGetAdapters(__namedParameters): GetAdaptersFunctions

Parameters

Name Type
__namedParameters ConstructFetchInput

Returns

GetAdaptersFunctions


constructGetBalances

constructGetBalances(__namedParameters): GetBalancesFunctions

Parameters

Name Type
__namedParameters ConstructFetchInput

Returns

GetBalancesFunctions


constructGetLimitOrders

constructGetLimitOrders(__namedParameters): GetLimitOrdersFunctions

Parameters

Name Type
__namedParameters ConstructFetchInput

Returns

GetLimitOrdersFunctions


constructGetLimitOrdersContract

constructGetLimitOrdersContract(options): GetLimitOrdersContractFunctions

Parameters

Name Type
options ConstructFetchInput

Returns

GetLimitOrdersContractFunctions


constructGetNFTOrders

constructGetNFTOrders(__namedParameters): GetNFTOrdersFunctions

Parameters

Name Type
__namedParameters ConstructFetchInput

Returns

GetNFTOrdersFunctions


constructGetNFTOrdersContract

constructGetNFTOrdersContract(options): GetNFTOrdersContractFunctions

Parameters

Name Type
options ConstructFetchInput

Returns

GetNFTOrdersContractFunctions


constructGetRate

constructGetRate(__namedParameters): GetRateFunctions

Parameters

Name Type
__namedParameters ConstructFetchInput

Returns

GetRateFunctions


constructGetSpender

constructGetSpender(__namedParameters): GetSpenderFunctions

Parameters

Name Type
__namedParameters ConstructFetchInput

Returns

GetSpenderFunctions


constructGetTokens

constructGetTokens(__namedParameters): GetTokensFunctions

Parameters

Name Type
__namedParameters ConstructFetchInput

Returns

GetTokensFunctions


constructPartialSDK

constructPartialSDK<Config, Funcs>(config, ...funcs): InferWithTxResponse<Config, Funcs> & Required<ConstructBaseInput>

Description

construct composable SDK with methods you choose yourself

Type parameters

Name Type
Config extends ConstructBaseInput
Funcs extends [SDKFunction<Config>, ...SDKFunction<Config>[]]

Parameters

Name Type
config Config
...funcs Funcs

Returns

InferWithTxResponse<Config, Funcs> & Required<ConstructBaseInput>


constructPostLimitOrder

constructPostLimitOrder(__namedParameters): PostLimitOrderFunctions

Parameters

Name Type
__namedParameters ConstructFetchInput

Returns

PostLimitOrderFunctions


constructPostNFTOrder

constructPostNFTOrder(__namedParameters): PostNFTOrderFunctions

Parameters

Name Type
__namedParameters ConstructFetchInput

Returns

PostNFTOrderFunctions


constructSignLimitOrder

constructSignLimitOrder(options): SignLimitOrderFunctions

Parameters

Name Type
options Pick<ConstructProviderFetchInput<any, "signTypedDataCall">, "contractCaller">

Returns

SignLimitOrderFunctions


constructSignNFTOrder

constructSignNFTOrder(options): SignNFTOrderFunctions

Parameters

Name Type
options Pick<ConstructProviderFetchInput<any, "signTypedDataCall">, "contractCaller">

Returns

SignNFTOrderFunctions


constructSimpleSDK

constructSimpleSDK(options): SimpleFetchSDK

Description

construct SDK with methods that fetch from API and optionally with blockchain provider calling methods

Parameters

Name Type
options SimpleOptions

Returns

SimpleFetchSDK

constructSimpleSDK(options, providerOptions): SimpleSDK

Parameters

Name Type
options SimpleOptions
providerOptions SimpleSDKProviderOptions

Returns

SimpleSDK


constructSubmitLimitOrder

constructSubmitLimitOrder(options): SubmitLimitOrderFuncs

Parameters

Name Type
options ConstructProviderFetchInput<any, "signTypedDataCall">

Returns

SubmitLimitOrderFuncs


constructSubmitNFTOrder

constructSubmitNFTOrder(options): SubmitNFTOrderFuncs

Parameters

Name Type
options ConstructProviderFetchInput<any, "signTypedDataCall">

Returns

SubmitNFTOrderFuncs


constructSwapSDK

constructSwapSDK<TxResponse>(config): SwapSDKMethods<TxResponse>

Description

construct SDK with every Swap-related method, fetching from API and token approval

Type parameters

Name
TxResponse

Parameters

Name Type
config SDKConfig<TxResponse>

Returns

SwapSDKMethods<TxResponse>


constructSwapTx

constructSwapTx(__namedParameters): GetSwapTxFunctions

Parameters

Name Type
__namedParameters ConstructFetchInput

Returns

GetSwapTxFunctions


constructToken

constructToken(tokenProps): Token

Parameters

Name Type
tokenProps ConstructTokenInput

Returns

Token


constructWeb3ContractCaller

constructWeb3ContractCaller(web3, account?): ContractCallerFunctions<Web3UnpromiEvent>

Parameters

Name Type
web3 default
account? string

Returns

ContractCallerFunctions<Web3UnpromiEvent>


isAllowance

isAllowance(arg): arg is Allowance

Parameters

Name Type
arg Allowance | { message: "Not Found" = 'Not Found' }

Returns

arg is Allowance


isFetcherError

isFetcherError(error): error is FetcherError

Parameters

Name Type
error unknown

Returns

error is FetcherError