UNPKG

@paraswap/sdk

Version:
71 lines 4.2 kB
import { GetAdaptersFunctions } from '../methods/swap/adapters'; import { GetBalancesFunctions } from '../methods/swap/balance'; import { GetRateFunctions } from '../methods/swap/rates'; import { GetSpenderFunctions } from '../methods/swap/spender'; import { GetTokensFunctions } from '../methods/swap/token'; import { BuildTxFunctions } from '../methods/swap/transaction'; import { GetSwapTxFunctions } from '../methods/swap/swapTx'; import type { ConstructBaseInput, TxHash, Address, FetcherFunction, ExtraFetchParams } from '../types'; import type { EthersProviderDeps, MinViemClient } from '../helpers'; import type Web3 from 'web3'; import type { SwapSDKMethods } from '../methods/swap'; import { BuildLimitOrderFunctions } from '../methods/limitOrders/buildOrder'; import { PostLimitOrderFunctions } from '../methods/limitOrders/postOrder'; import { GetLimitOrdersFunctions } from '../methods/limitOrders/getOrders'; import { GetLimitOrdersContractFunctions } from '../methods/limitOrders/getOrdersContract'; import { BuildLimitOrdersTxFunctions } from '../methods/limitOrders/transaction'; import { LimitOrderHandlers } from '../methods/limitOrders'; import { GetNFTOrdersContractFunctions } from '../methods/nftOrders/getOrdersContract'; import { GetNFTOrdersFunctions } from '../methods/nftOrders/getOrders'; import { BuildNFTOrderFunctions } from '../methods/nftOrders/buildOrder'; import { PostNFTOrderFunctions } from '../methods/nftOrders/postOrder'; import { BuildNFTOrdersTxFunctions } from '../methods/nftOrders/transaction'; import { NFTOrderHandlers } from '../methods/nftOrders'; import type { AxiosRequirement } from '../helpers/fetchers/axios'; import { DeltaOrderHandlers } from '../methods/delta'; import { BuildDeltaOrderFunctions } from '../methods/delta/buildDeltaOrder'; import { GetDeltaOrdersFunctions } from '../methods/delta/getDeltaOrders'; import { GetDeltaPriceFunctions } from '../methods/delta/getDeltaPrice'; import { GetDeltaContractFunctions } from '../methods/delta/getDeltaContract'; import { GetPartnerFeeFunctions } from '../methods/delta/getPartnerFee'; import { PostDeltaOrderFunctions } from '../methods/delta/postDeltaOrder'; import { GetQuoteFunctions } from '../methods/quote/getQuote'; export type SwapFetchMethods = GetBalancesFunctions & GetTokensFunctions & GetSpenderFunctions & BuildTxFunctions & GetAdaptersFunctions & GetRateFunctions & GetSwapTxFunctions; export type LimitOrdersFetchMethods = GetLimitOrdersContractFunctions & GetLimitOrdersFunctions & BuildLimitOrderFunctions & PostLimitOrderFunctions & BuildLimitOrdersTxFunctions; export type NFTOrdersFetchMethods = GetNFTOrdersContractFunctions & GetNFTOrdersFunctions & BuildNFTOrderFunctions & PostNFTOrderFunctions & BuildNFTOrdersTxFunctions; export type DeltaFetchMethods = BuildDeltaOrderFunctions & GetDeltaOrdersFunctions & GetDeltaPriceFunctions & GetDeltaContractFunctions & GetPartnerFeeFunctions & PostDeltaOrderFunctions; export type SimpleFetchSDK = { swap: SwapFetchMethods; limitOrders: LimitOrdersFetchMethods; nftOrders: NFTOrdersFetchMethods; delta: DeltaFetchMethods; quote: QuoteFetchMethods; } & Required<ConstructBaseInput>; export type QuoteFetchMethods = GetQuoteFunctions; export type SimpleSDK = { swap: SwapSDKMethods<TxHash>; limitOrders: LimitOrderHandlers<TxHash>; nftOrders: NFTOrderHandlers<TxHash>; delta: DeltaOrderHandlers<TxHash>; quote: QuoteFetchMethods; } & Required<ConstructBaseInput>; export type FetcherOptions = ({ axios: AxiosRequirement; } | { fetch: typeof fetch; } | { fetcher: FetcherFunction; }) & ExtraFetchParams; type SimpleOptions = ConstructBaseInput & FetcherOptions; export type ProviderOptions = (EthersProviderDeps | { web3: Web3; } | { viemClient: MinViemClient; }) & { account: Address; }; /** @description construct SDK with methods that fetch from API and optionally with blockchain provider calling methods */ export declare function constructSimpleSDK(options: SimpleOptions): SimpleFetchSDK; export declare function constructSimpleSDK(options: SimpleOptions, providerOptions: ProviderOptions): SimpleSDK; export {}; //# sourceMappingURL=simple.d.ts.map