/// import { Connection, PublicKey } from "@solana/web3.js"; import { EscrowFetcher as FetcherV0 } from "escrow-sdk-v0"; import { EscrowFetcher as FetcherV1, OfferQuotes, MarketClient } from "../../index"; import { IOfferDataInfo, ITradeDataInfo, Version } from "../types"; import { BN } from "@project-serum/anchor"; import { Wallet } from "@project-serum/anchor/dist/cjs/provider"; import { TransactionBuilder } from "@orca-so/common-sdk"; import Decimal from "decimal.js"; export declare class EscrowRouter { pubkeyV0?: PublicKey; configIdV0?: string; pubkeyV1: PublicKey; marketIdV1: string; configIdV1: string; fetcherV0?: FetcherV0; fetcherV1: FetcherV1; constructor(connection: Connection, pubkeyV1: PublicKey, configIdV1: string, pubkeyV0?: PublicKey, configIdV0?: string); /** * @dev get trade by status and side optionally * @param tradeStatus : Awaiting | Deposited | Disputed | Released | Canceled * @param side : Buy | Sell (if not provided, will return both buy and sell) * @returns ITradeDataInfo[] */ getTradesByStatus(tradeStatus: object, side?: object): Promise; getOffersByStatus(offerStatus: object, side?: object): Promise; getTradesByBuyerAddress(buyerAddress: PublicKey): Promise<(ITradeDataInfo | null)[]>; getTradesBySellerAddress(sellerAddress: PublicKey): Promise<(ITradeDataInfo | null)[]>; /** * a function to get trade data by trade id */ getTradeDataByID(tradeId: BN, version?: Version, refresh?: boolean): Promise; getTrades(startTradeIdV0: BN, startTradeIdV1: BN): Promise; /** * a function to get offer data by offer id */ getOfferDataByID(offerId: BN, version?: Version): Promise; /** * a function to get offer data by offer id */ getTradesByOfferId(offerId: BN, version?: Version): Promise; getOffersByMakerAddress(makerAddress: PublicKey, version?: Version): Promise; /** * a function to make a new offer * @param wallet user wallet * @param tokenMint mint of token that user want to create offer with * @param bondType type of bond. Can either be Spl or Native. Use "BondType" value from sdk * @param minTradeSize minimum size of trade can be created from the offer. Should be between "0.2" and "1" * @param tokenAmount total amount of token that user want to create offer with * @param fiatAmount equivalent number of fiat amount * @returns */ makeOffer(wallet: Wallet, tokenMint: PublicKey, side: object, bondType: object, minTradeSize: Decimal, tokenAmount: BN, rate: number, fiatCurrency: string, encryptedBankName: string | null, encryptedAccountNumber: string | null, encryptedAccountName: string | null, nonce: string | null): Promise<{ tx: TransactionBuilder; id: BN; }>; /** * @param tradeAmount Raw token amount */ matchingEngineWithExactCryptoAmount(marketClient: MarketClient, user: PublicKey, tradeAmount: BN, offerQuotes: OfferQuotes, useBondless: boolean, takerBondType: object): Promise<{ txs: TransactionBuilder[]; ids: BN[][]; }>; /** * @param tradeAmount UI fiat amount */ matchingEngineWithExactFiatAmount(marketClient: MarketClient, user: PublicKey, tradeAmount: number, offerQuotes: OfferQuotes, useBondless: boolean, takerBondType: object): Promise<{ txs: TransactionBuilder[]; ids: BN[][]; }>; /** * @param tradeAmount Raw token amount */ requestCreateTradeWithExactCryptoAmount(wallet: Wallet, offerDataInfo: IOfferDataInfo, tradeAmount: BN, expectedRate: number, takerBondType: object, useBondless?: boolean, buyOfferAccount?: PublicKey): Promise<{ tx: TransactionBuilder; id: BN; }>; /** * @param tradeAmount UI fiat amount */ requestCreateTradeWithExactFiatAmount(wallet: Wallet, offerDataInfo: IOfferDataInfo, tradeAmount: number, expectedRate: number, takerBondType: object, useBondless?: boolean, buyOfferAccount?: PublicKey): Promise<{ tx: TransactionBuilder; id: BN; }>; cancelTrade(wallet: Wallet, tradeData: ITradeDataInfo): Promise; /** * @dev can handle both versions */ cancelOffer(wallet: Wallet, offerData: IOfferDataInfo): Promise; release(wallet: Wallet, tradeData: ITradeDataInfo): Promise; callArbitrator(wallet: Wallet, tradeData: ITradeDataInfo): Promise; resolveDispute(wallet: Wallet, tradeData: ITradeDataInfo, disputeAction: object, compensationAction: object): Promise; }