import { AxiosRequestConfig } from 'axios'; import { BigNumber, PopulatedTransaction, Signer } from 'ethers'; import * as E from 'fp-ts/Either'; import * as T from 'fp-ts/Task'; import * as TE from 'fp-ts/TaskEither'; import { Branded } from 'io-ts'; import { AddMetadataSchemaToCollectionParams, AddMetadataSchemaToCollectionResult, CreateCollectionParams, CreateCollectionsResult, CreateProjectParams, CreateProjectResult, ERC721Token, EthAddress, ExchangeProvider, GetAwaitingOrderStatusResponse, GetMetadataSchemaParams, GetMetadataSchemaResult, GetProjectParams, HexadecimalString, ImmutableCreateExchangeV3Params, ImmutableCreateExchangeV3Response, ImmutableExchangeType, ImmutableExchangeTypeV3, ImmutableGetNFTPrimaryTransactionsHistoryResult, ImmutableGetNFTPrimaryTransactionStatusResponse, ImmutableGetNFTSecondaryTransactionsHistoryResult, ImmutableGetNFTSecondaryTransactionStatusResponse, ImmutableGetPrimaryTransactionsHistoryParams, ImmutableGetPrimaryTransactionsHistoryParamsTS, ImmutableGetSecondaryTransactionsHistoryParams, ImmutableGetSecondaryTransactionsHistoryParamsTS, ImmutableMethodParams, ImmutableMethodResults, ImmutableNFTCheckoutPrimaryParams, ImmutableNFTCheckoutPrimaryResponse, ImmutableNFTCheckoutSecondaryParams, ImmutableNFTCheckoutSecondaryResponse, MintableERC721Token, OrderParams, PositiveBigNumber, ProjectResult, ProjectsResult, Token, UpdateCollectionParams, UpdateCollectionsResults, UpdateMetadataSchemaByNameParams, UpdateMetadataSchemaByNameResult, VerifyOTPParams, VerifyOTPResponse } from '../types'; import { ImmutableXWallet } from './ImmutableXWallet'; export declare type ImmutableXClientParams = { publicApiUrl: string; apiKey?: string; signer?: Signer; gasLimit?: string; gasPrice?: string; starkContractAddress?: string; registrationContractAddress?: string; enableDebug?: boolean; }; export declare const V2 = "v2"; export declare const V3 = "v3"; export declare class ImmutableXClient { private publicApiUrl; private wallet; private contractAddress; private registrationContractAddress; private _address; private _starkPublicKey; private enableDebug; private readonly apiKey?; private agent; private requests; constructor(publicApiUrl: string, wallet: ImmutableXWallet, contractAddress: EthAddress, registrationContractAddress: EthAddress, _address: EthAddress, _starkPublicKey: HexadecimalString, enableDebug?: boolean, apiKey?: string | undefined); static buildF(params: ImmutableXClientParams): TE.TaskEither; private signEthMessageAsync; private signEthMessage; getERC20Balance(owner: string, contractAddress: string): Promise; getERC20Allowance(contractAddress: string, owner: string, spender?: string): Promise; hasERC20Allowance(contractAddress: string, amount: string | BigNumber, owner: string, spender?: string): Promise; static build({ publicApiUrl, signer, starkContractAddress, registrationContractAddress, gasLimit, gasPrice, enableDebug, apiKey, }: ImmutableXClientParams): Promise; get address(): Branded; get starkPublicKey(): Branded; buildOptions(): AxiosRequestConfig; private replaceApiVersion; private get; private post; private delete; registerImxF(params: ImmutableMethodParams.ImmutableRegisterParams): TE.TaskEither; registerEthAddress(etherKey: string, starkPublicKey: string): Promise; fullWithdrawal(contractAddress: string, starkPublicKey: string, vaultId: string): Promise; getUserF(params: ImmutableMethodParams.ImmutableGetUserParams): TE.TaskEither; getUser(params: ImmutableMethodParams.ImmutableGetUserParamsTS): Promise<{ accounts: Branded[]; }>; registerImx(params: ImmutableMethodParams.ImmutableRegisterParamsTS): Promise<{ tx_hash: string; }>; isRegisteredF(params: ImmutableMethodParams.ImmutableGetUserParams): TE.TaskEither; isRegistered(params: ImmutableMethodParams.ImmutableGetUserParamsTS): Promise; isRegisteredStarkF(starkPublicKey: string): T.Task; isRegisteredStark(starkPublicKey: string): Promise; registerF(params: ImmutableMethodParams.ImmutableRegisterParams): TE.TaskEither; register(params: ImmutableMethodParams.ImmutableRegisterParamsTS): Promise; registerStarkF({ etherKey, starkPublicKey, operatorSignature, }: ImmutableMethodParams.ImmutableStarkRegisterParams): TE.TaskEither; registerStark(params: ImmutableMethodParams.ImmutableStarkRegisterParamsTS): Promise; getSignableRegistrationF({ etherKey, starkPublicKey, }: ImmutableMethodParams.ImmutableGetSignableRegistrationParams): TE.TaskEither; getSignableRegistration(params: ImmutableMethodParams.ImmutableGetSignableRegistrationParamsTS): Promise<{ operator_signature: string; }>; mintNFTF({ tokenAddress, }: ImmutableMethodParams.ImmutableMintNFTParams): TE.TaskEither; mintNFT(params: ImmutableMethodParams.ImmutableMintNFTParamsTS): Promise; approveNFTF(params: ImmutableMethodParams.ImmutableStarkApproveNFTParams): TE.TaskEither; approveNFT(params: ImmutableMethodParams.ImmutableStarkApproveNFTParamsTS): Promise; approveERC20F(params: ImmutableMethodParams.ImmutableStarkApproveERC20Params): TE.TaskEither; approveERC20(params: ImmutableMethodParams.ImmutableStarkApproveERC20ParamsTS): Promise; depositF({ user, token, quantity, }: ImmutableMethodParams.ImmutableGetSignableDepositParams): TE.TaskEither; depositFv3({ user, token, quantity, }: ImmutableMethodParams.ImmutableGetSignableDepositParams, signableDepositResult: ImmutableMethodResults.ImmutableGetSignableDepositResult): TE.TaskEither; private depositFv4; deposit(params: ImmutableMethodParams.ImmutableGetSignableDepositParamsTS): Promise; depositCancel(starkPublicKey: string, token: Token, vaultId: string): Promise; depositReclaim(starkPublicKey: string, token: Token, vaultId: string): Promise; prepareWithdrawalF({ user, token, quantity, }: ImmutableMethodParams.ImmutablePrepareWithdrawalParams): TE.TaskEither; private prepareWithdrawalFv1; private prepareWithdrawalFv2; prepareWithdrawal(params: ImmutableMethodParams.ImmutablePrepareWithdrawalParamsTS): Promise; processMintableToken(mintableToken: ImmutableMethodResults.ImmutableGetMintableTokenResult, token: ERC721Token): MintableERC721Token; completeWithdrawalF({ starkPublicKey, token, }: ImmutableMethodParams.ImmutableCompleteWithdrawalParams): TE.TaskEither; registerAndCompleteWithdrawalF({ starkPublicKey, token, }: ImmutableMethodParams.ImmutableCompleteWithdrawalParams): TE.TaskEither; private registerAndCompleteWithdrawalAllF; private completeWithdrawalAllF; private getCompleteWithdrawalAllParamsF; private withdrawalAll; private completeWithdrawalV1F; completeWithdrawal(params: ImmutableMethodParams.ImmutableCompleteWithdrawalParamsTS): Promise; registerAndCompleteWithdrawal(params: ImmutableMethodParams.ImmutableCompleteWithdrawalParamsTS): Promise; transferF({ sender, token, quantity, receiver, }: ImmutableMethodParams.ImmutableTransferParams): TE.TaskEither; transfer(params: ImmutableMethodParams.ImmutableTransferParamsTS): Promise; burnF({ sender, token, quantity, }: ImmutableMethodParams.ImmutableBurnParams): TE.TaskEither; burn(params: ImmutableMethodParams.ImmutableBurnParamsTS): Promise; signMessage(message: ImmutableMethodParams.ImmutableSignParams): TE.TaskEither; mintF(params: ImmutableMethodParams.ImmutableOffchainMintParams): TE.TaskEither; mint(params: ImmutableMethodParams.ImmutableOffchainMintParamsTS): Promise; mintV2F(params: ImmutableMethodParams.ImmutableOffchainMintV2Params): TE.TaskEither; mintV2(params: ImmutableMethodParams.ImmutableOffchainMintV2ParamsTS): Promise; mintV2Testing(params: ImmutableMethodParams.ImmutableOffchainMintV2ParamsTS): Promise; calculateMakerOrderAmountsF(params: ImmutableMethodParams.ImmutableGetSignableOrderParams): TE.TaskEither; createTradeRequestV3F({ user, orderId, fees, expiration_timestamp, }: ImmutableMethodParams.ImmutableGetSignableTradeV3Params): TE.TaskEither; createOrderRequestV3F({ user, tokenSell, tokenBuy, amountSell, amountBuy, fees, splitFees, expiration_timestamp, }: ImmutableMethodParams.ImmutableGetSignableOrderParams): TE.TaskEither; private formatFeesForRequest; private formatAuxiliaryFeesForQueryString; createOrderV3F({ user, tokenSell, tokenBuy, amountSell, amountBuy, fees, splitFees, expiration_timestamp, }: ImmutableMethodParams.ImmutableGetSignableOrderParams): TE.TaskEither; createOrderV3(params: ImmutableMethodParams.ImmutableGetSignableOrderParamsTS): Promise; cancelOrderV3F(orderId: ImmutableMethodParams.ImmutableCancelOrderParamsTS): TE.TaskEither; cancelOrderV3(params: ImmutableMethodParams.ImmutableCancelOrderParamsTS): Promise; createTradeV3F({ user, orderId, fees, }: ImmutableMethodParams.ImmutableGetSignableTradeV3Params): TE.TaskEither; createTradeV3(params: ImmutableMethodParams.ImmutableGetSignableTradeParamsTS): Promise; getTokenF(params: ImmutableMethodParams.ImmutableGetTokenParams): TE.TaskEither; getToken(params: ImmutableMethodParams.ImmutableGetTokenParamsTS): Promise; listTokensF(params: ImmutableMethodParams.ImmutableListTokensParams): TE.TaskEither; listTokens(params: ImmutableMethodParams.ImmutableListTokensParamsTS): Promise; getBalancesF(params: ImmutableMethodParams.ImmutableGetBalancesParams): TE.TaskEither; getBalances(params: ImmutableMethodParams.ImmutableGetBalancesParams): Promise; getBalanceF(params: ImmutableMethodParams.ImmutableGetBalanceParams): TE.TaskEither; getBalance(params: ImmutableMethodParams.ImmutableGetBalanceParamsTS): Promise; listBalancesF({ user, symbols, cursor, }: ImmutableMethodParams.ImmutableListBalancesParams): TE.TaskEither; listBalances(params: ImmutableMethodParams.ImmutableListBalancesParamsTS): Promise; getMintableTokenF(params: ImmutableMethodParams.ImmutableGetMintableTokenParams): TE.TaskEither; getMintableToken(params: ImmutableMethodParams.ImmutableGetMintableTokenParamsTS): Promise; getVaults(starkPublicKey: string): Promise; getOrderV3F({ orderId, include_fees, auxiliaryFees, }: ImmutableMethodParams.ImmutableGetOrderParams): TE.TaskEither; getOrderV3(params: ImmutableMethodParams.ImmutableGetOrderParamsTS): Promise; getOrdersV3F(query: ImmutableMethodParams.ImmutableGetOrdersParams): TE.TaskEither; getOrdersV3(params?: ImmutableMethodParams.ImmutableGetOrdersParamsTS): Promise; getAssetsF(query: ImmutableMethodParams.ImmutableGetAssetsParams): TE.TaskEither; getAssets(params?: ImmutableMethodParams.ImmutableGetAssetsParamsTS): Promise; getAssetF({ address, id, include_fees, }: ImmutableMethodParams.ImmutableGetAssetParams): TE.TaskEither; getAsset(params: ImmutableMethodParams.ImmutableGetAssetParamsTS): Promise; getApplicationsF(query?: ImmutableMethodParams.ImmutableGetApplicationsParams): TE.TaskEither; getApplications(params?: ImmutableMethodParams.ImmutableGetApplicationsParamsTS): Promise; getTradeV3F({ id, }: ImmutableMethodParams.ImmutableGetTradeParams): TE.TaskEither; getTradeV3(params: ImmutableMethodParams.ImmutableGetTradeParamsTS): Promise; getCollectionsF(query: ImmutableMethodParams.ImmutableGetCollectionsParams): TE.TaskEither; getCollections(params: ImmutableMethodParams.ImmutableGetCollectionsParamsTS): Promise; getCollectionF({ address, }: ImmutableMethodParams.ImmutableGetCollectionParams): TE.TaskEither; getCollection(params: ImmutableMethodParams.ImmutableGetCollectionParamsTS): Promise; getDepositsF(query?: ImmutableMethodParams.ImmutableGetDepositsParams): TE.TaskEither; getDeposits(params?: ImmutableMethodParams.ImmutableGetDepositsParamsTS): Promise; getDepositF({ id, }: ImmutableMethodParams.ImmutableGetDepositParams): TE.TaskEither; getDeposit(params: ImmutableMethodParams.ImmutableGetDepositParamsTS): Promise; getTransferF({ id, }: ImmutableMethodParams.ImmutableGetTransferParams): TE.TaskEither; getTransfer(params: ImmutableMethodParams.ImmutableGetTransferParamsTS): Promise; private getSignableTransferV2F; private getSignableTransferV2; private convertToGetSignableTransferV2Params; transferV2F(params: ImmutableMethodParams.ImmutableTransferV2Params): TE.TaskEither; transferV2(params: ImmutableMethodParams.ImmutableTransferV2ParamsTS): Promise; getBurn(params: ImmutableMethodParams.ImmutableGetBurnParamsTS): Promise; getWithdrawalF({ id, }: ImmutableMethodParams.ImmutableGetWithdrawalParams): TE.TaskEither; getWithdrawal(params: ImmutableMethodParams.ImmutableGetWithdrawalParamsTS): Promise; getWithdrawalsF(query?: ImmutableMethodParams.ImmutableGetWithdrawalsParams): TE.TaskEither; getWithdrawals(params?: ImmutableMethodParams.ImmutableGetWithdrawalsParamsTS): Promise; getTransfersF(query?: ImmutableMethodParams.ImmutableGetTransfersParams): TE.TaskEither; getTransfers(params?: ImmutableMethodParams.ImmutableGetTransfersParamsTS): Promise; getExchangesF(params?: ImmutableMethodParams.ImmutableGetExchangesParams): TE.TaskEither; getExchanges(params?: ImmutableMethodParams.ImmutableGetExchangesParamsTS): Promise; getBurnsF(query?: ImmutableMethodParams.ImmutableGetBurnsParams): TE.TaskEither; getBurns(params?: ImmutableMethodParams.ImmutableGetBurnsParamsTS): Promise; getPaginatedResults(params: P, fn: (params: P) => TE.TaskEither): TE.TaskEither; getTradesV3F(query?: ImmutableMethodParams.ImmutableGetTradesParams): TE.TaskEither; getTradesV3(params?: ImmutableMethodParams.ImmutableGetTradesParamsTS): Promise; getLastAvailableNonce(starkPublicKey: string): Promise<{ Nonce: string; }>; getTokenBody(token: Token): any; getMintableERC721TokenBody(token: Token): any; parseTokenBody(token: any): any; decodeImmutableGetSignableTransferV2Result(result: any): E.Either; private decodeForFunction; private signableTransferDetails; createExchangeTransfer(exchangeId: number, { sender, token, quantity, receiver, }: ImmutableMethodParams.ImmutableTransferParams): Promise; createExchange(walletAddress: string, provider?: ExchangeProvider, type?: string): Promise; getExchange(exchange_id: number): Promise; getMoonpaySignature(req: ImmutableMethodResults.ImmutableGetMoonpaySignatureRequest): Promise; getMoonpaySellSignature(req: ImmutableMethodResults.ImmutableGetMoonpaySellSignatureRequest): Promise; getMoonpayPrimarySellSignature(req: ImmutableMethodResults.ImmutableGetMoonpayPrimarySellSignatureRequest): Promise; handleSignatureRequest(body: any): Promise<{ request: string; signature: string; }>; getCurrencies(exchangeType: ImmutableExchangeType): Promise; getCurrenciesV3(exchangeType: ImmutableExchangeTypeV3, provider?: ExchangeProvider, include_limits?: boolean): Promise; getCurrencyLimits(provider?: ExchangeProvider): Promise; private getAuthenticationHeaders; createProject(params: CreateProjectParams): Promise; getProjects(params?: ImmutableMethodParams.ImmutablePaginatedParamsTS): Promise; getProject(params: GetProjectParams): Promise; createCollection(params: CreateCollectionParams): Promise; updateCollection(contractAddress: string, params: UpdateCollectionParams): Promise; addMetadataSchemaToCollection(contractAddress: string, params: AddMetadataSchemaToCollectionParams): Promise; updateMetadataSchemaByName(name: string, contractAddress: string, params: UpdateMetadataSchemaByNameParams): Promise; getMetadataSchema(params: GetMetadataSchemaParams): Promise; verifyOTP(params: VerifyOTPParams): Promise; getAwaitingOrderStatus(requestId: string): Promise; getNFTPrimaryTransactionStatus(transactionId: string): Promise; getPrimaryTransactionsHistoryF(params?: ImmutableGetPrimaryTransactionsHistoryParams): TE.TaskEither; getPrimaryTransactionsHistory(params?: ImmutableGetPrimaryTransactionsHistoryParamsTS): Promise; createExchangeV3(params: ImmutableCreateExchangeV3Params): Promise; nftCheckoutPrimary(params: ImmutableNFTCheckoutPrimaryParams): Promise; nftCheckoutSecondary(params: ImmutableNFTCheckoutSecondaryParams): Promise; getNFTSecondaryTransactionStatus(transactionId: string): Promise; getSecondaryTransactionsHistoryF(params?: ImmutableGetSecondaryTransactionsHistoryParams): TE.TaskEither; getSecondaryTransactionsHistory(params?: ImmutableGetSecondaryTransactionsHistoryParamsTS): Promise; getStarkExContractMajorVersion(): TE.TaskEither; private getStarkExContractVersion; private parseMajorVersion; getEncodeEthAssetInfo({ token, }: ImmutableMethodParams.ImmutableGetEncodeETHAssetInfoParams): TE.TaskEither; getEncodeERC20AssetInfo({ token, }: ImmutableMethodParams.ImmutableGetEncodeERC20AssetInfoParams): TE.TaskEither; getEncodeERC721AssetInfo({ token, }: ImmutableMethodParams.ImmutableGetEncodeERC721AssetInfoParams): TE.TaskEither; getEncodeMintableERC721AssetInfo({ token, }: ImmutableMethodParams.ImmutableGetEncodeMintableERC721AssetInfoParams): TE.TaskEither; } export default ImmutableXClient;