import { BaseCoreSDK } from "./../mixins/base-core-sdk"; import * as subgraph from "../subgraph"; import { TransactionResponse, TransactionRequest, Log, Web3LibAdapter, FullOfferArgs, SellerOfferArgs } from "@bosonprotocol/common"; import { BigNumberish, BigNumber } from "@ethersproject/bignumber"; import { getSignatureParameters, StructuredData } from "../utils/signature"; export declare class ExchangesMixin extends BaseCoreSDK { /** * Returns exchange entity from subgraph. * @param exchangeId - ID of exchange entity. * @param queryVars - Optional query variables to skip, order or filter. * @returns Exchange entity from subgraph. */ getExchangeById(exchangeId: BigNumberish, queryVars?: subgraph.GetExchangeByIdQueryQueryVariables): Promise; /** * Returns exchange entities from subgraph. * @param queryVars - Optional query variables to skip, order or filter. * @returns Exchange entities from subgraph. */ getExchanges(queryVars?: subgraph.GetExchangesQueryQueryVariables): Promise; /** * Commits to a seller initiated offer by calling the `ExchangeCommitFacet`. * This transaction only succeeds if the seller has deposited enough funds to lock the offer's sellerDeposit. * @param offerId - ID of offer to commit to. * @param overrides - Optional overrides. * @returns Transaction response. */ commitToOffer(offerId: BigNumberish, overrides: Partial<{ buyer: string; returnTxInfo: true; }>): Promise; commitToOffer(offerId: BigNumberish, overrides?: Partial<{ buyer: string; returnTxInfo?: false | undefined; }>): Promise; /** * Commits to a buyer initiated offer by calling the `ExchangeCommitFacet`. * This transaction only succeeds if the buyer has deposited enough funds to lock the offer's price. * @param offerId - ID of offer to commit to. * @param overrides - Optional overrides. * @returns Transaction response. */ commitToBuyerOffer(offerId: BigNumberish, sellerParams: SellerOfferArgs, overrides: Partial<{ returnTxInfo: true; }>): Promise; commitToBuyerOffer(offerId: BigNumberish, sellerParams?: SellerOfferArgs, overrides?: Partial<{ returnTxInfo?: false | undefined; }>): Promise; /** * Commits to a conditional offer by calling the `ExchangeHandlerContract`. * This transaction only succeeds if the seller has deposited funds. * @param offerId - ID of offer to commit to. * @param tokenId - ID of the token to use for the conditional commit * @param overrides - Optional overrides. * @returns Transaction response. */ commitToConditionalOffer(offerId: BigNumberish, tokenId: BigNumberish, overrides: Partial<{ buyer: string; returnTxInfo: true; }>): Promise; commitToConditionalOffer(offerId: BigNumberish, tokenId: BigNumberish, overrides?: Partial<{ buyer: string; returnTxInfo?: false | undefined; }>): Promise; /** * Creates an offer and commits to it immediately. * @param createOfferAndCommitArgs - Offer and commit arguments. * @param overrides - Optional overrides. * @returns Transaction response. */ createOfferAndCommit(createOfferAndCommitArgs: FullOfferArgs, overrides: Partial<{ contractAddress: string; txRequest: TransactionRequest; returnTxInfo: true; }>): Promise; createOfferAndCommit(createOfferAndCommitArgs: FullOfferArgs, overrides?: Partial<{ contractAddress: string; txRequest: TransactionRequest; returnTxInfo?: false | undefined; }>): Promise; /** * Signs the full offer data for an off-chain buyer- or seller-initiated offer. * @param args - Arguments including `fullOfferArgsUnsigned` and `returnTypedDataToSign`. * @returns Either the structured data to sign or the signature parameters, depending on `returnTypedDataToSign`. */ signFullOffer(args: { fullOfferArgsUnsigned: Omit; returnTypedDataToSign: true; }): Promise; signFullOffer(args: { fullOfferArgsUnsigned: Omit; returnTypedDataToSign?: false; }): Promise>; /** * Utility method to retrieve the created `exchangeId` from logs after calling `commitToOffer` or `commitToBuyerOffer`. * @param logs - Logs to search in. * @returns Created exchange id. */ getCommittedExchangeIdFromLogs(logs: Log[]): string | null; /** * Revokes an existing voucher by calling the `ExchangeHandlerContract`. * Callable by seller `assistant`. * @param exchangeId - ID of exchange to revoke. * @returns Transaction response. */ revokeVoucher(exchangeId: BigNumberish, returnTxInfo: true): Promise; revokeVoucher(exchangeId: BigNumberish, returnTxInfo?: false | undefined): Promise; /** * Cancels an existing voucher by calling the `ExchangeHandlerContract`. * Callable by buyer. * @param exchangeId - ID of exchange to cancel. * @returns Transaction response. */ cancelVoucher(exchangeId: BigNumberish, returnTxInfo: true): Promise; cancelVoucher(exchangeId: BigNumberish, returnTxInfo?: false | undefined): Promise; /** * Redeems an existing voucher by calling the `ExchangeHandlerContract`. * Callable by buyer. * @param exchangeId - ID of exchange to redeem. * @returns Transaction response. */ redeemVoucher(exchangeId: BigNumberish, returnTxInfo: true): Promise; redeemVoucher(exchangeId: BigNumberish, returnTxInfo?: false | undefined): Promise; /** * Completes an existing voucher by calling the `ExchangeHandlerContract`. * Callable by buyer or seller assistant. * @param exchangeId - ID of exchange to complete. * @returns Transaction response. */ completeExchange(exchangeId: BigNumberish, returnTxInfo: true): Promise; completeExchange(exchangeId: BigNumberish, returnTxInfo?: false | undefined): Promise; /** * Completes a batch of existing vouchers by calling the `ExchangeHandlerContract`. * Callable by buyer or seller assistant. * @param exchangeIds - IDs of exchange to complete. * @returns Transaction response. */ completeExchangeBatch(exchangeIds: BigNumberish[], returnTxInfo: true): Promise; completeExchangeBatch(exchangeIds: BigNumberish[], returnTxInfo?: false | undefined): Promise; /** * Expires an existing voucher by calling the `ExchangeHandlerContract`. * @param exchangeId - ID of exchange to expire. * @returns Transaction response. */ expireVoucher(exchangeId: BigNumberish, returnTxInfo: true): Promise; expireVoucher(exchangeId: BigNumberish, returnTxInfo?: false | undefined): Promise; getExchangeTokenId(exchangeId: BigNumberish, offerId: BigNumberish): BigNumber; parseTokenId(tokenId: BigNumberish): { offerId: BigNumber; exchangeId: BigNumber; }; } //# sourceMappingURL=mixin.d.ts.map