import { BaseCoreSDK } from "./../mixins/base-core-sdk"; import * as subgraph from "../subgraph"; import * as offers from "."; import { TransactionResponse, Log, RoyaltyInfo, TransactionRequest, Web3LibAdapter, FullOfferArgs } from "@bosonprotocol/common"; import { BigNumberish } from "@ethersproject/bignumber"; import { ITokenInfo } from "../utils/tokenInfoManager"; export declare class OfferMixin extends BaseCoreSDK { /** * Creates offer by calling the `OfferHandlerFacet` contract. * This transaction only succeeds if there is an existing seller account for connected signer. * @param offerToCreate - Offer arguments. * @param overrides - Optional overrides. * @returns Transaction response. */ createOffer(offerToCreate: offers.CreateOfferArgs, overrides: Partial<{ contractAddress: string; txRequest: TransactionRequest; returnTxInfo: true; }>): Promise; createOffer(offerToCreate: offers.CreateOfferArgs, overrides?: Partial<{ contractAddress: string; txRequest: TransactionRequest; returnTxInfo?: false | undefined; }>): Promise; /** * Creates a batch of offers by calling the `OfferHandlerFacet` contract. * This transaction only succeeds if there is an existing seller account for connected signer. * @param offersToCreate - Offer arguments. * @param overrides - Optional overrides. * @returns Transaction response. */ createOfferBatch(offersToCreate: offers.CreateOfferArgs[], overrides: Partial<{ contractAddress: string; returnTxInfo: true; }>): Promise; createOfferBatch(offersToCreate: offers.CreateOfferArgs[], overrides?: Partial<{ contractAddress: string; returnTxInfo?: false | undefined; }>): Promise; /** * Utility method to retrieve the created `offerId` from logs after calling `createOffer` * or `createOfferAndSeller`. * @param logs - Logs to search in. * @returns Created offer id. */ getCreatedOfferIdFromLogs(logs: Log[]): string | null; /** * Utility method to retrieve the created `offerIds` from logs after calling `createOfferBatch` * @param logs - Logs to search in. * @returns Array of created offerIds. */ getCreatedOfferIdsFromLogs(logs: Log[]): string[]; /** * Utility method to retrieve the created `groupIds` from logs after calling `createGroup` * @param logs - Logs to search in. * @returns Array of group Ids. */ getCreatedGroupIdsFromLogs(logs: Log[]): string[]; /** * Utility method to retrieve the created `sellerId` from logs after calling `createSeller` * or `createOfferAndSeller`. * @param logs - Logs to search in. * @returns Created offer id. */ getCreatedSellerIdFromLogs(logs: Log[]): string | null; /** * Utility method to retrieve the created `buyerId` from logs after calling `createBuyer` * * @param logs - Logs to search in. * @returns Created buyer id. */ getCreatedBuyerIdFromLogs(logs: Log[]): string | null; /** * Voids an existing offer by calling the `OfferHandlerFacet` contract. * This transaction only succeeds if the connected signer is the `assistant`. * @param offerId - ID of offer to void. * @param overrides - Optional overrides. * @returns Transaction response. */ voidOffer(offerId: BigNumberish, overrides: Partial<{ contractAddress: string; returnTxInfo: true; }>): Promise; voidOffer(offerId: BigNumberish, overrides?: Partial<{ contractAddress: string; returnTxInfo?: false | undefined; }>): Promise; /** * Voids a batch of existing offers by calling the `OfferHandlerFacet` contract. * This transaction only succeeds if the connected signer is the `assistant` of all * provided offers. * @param offerIds - IDs of offers to void. * @param overrides - Optional overrides. * @returns Transaction response. */ voidOfferBatch(offerIds: BigNumberish[], overrides: Partial<{ contractAddress: string; returnTxInfo: true; }>): Promise; voidOfferBatch(offerIds: BigNumberish[], overrides?: Partial<{ contractAddress: string; returnTxInfo?: false | undefined; }>): Promise; voidNonListedOffer(fullOffer: Omit, overrides: Partial<{ contractAddress: string; returnTxInfo: true; }>): Promise; voidNonListedOffer(fullOffer: Omit, overrides?: Partial<{ contractAddress: string; returnTxInfo?: false | undefined; }>): Promise; voidNonListedOfferBatch(fullOffers: Omit[], overrides: Partial<{ contractAddress: string; returnTxInfo: true; }>): Promise; voidNonListedOfferBatch(fullOffers: Omit[], overrides?: Partial<{ contractAddress: string; returnTxInfo?: false | undefined; }>): Promise; /** * Extends an existing offer by calling the `OfferHandlerFacet` contract. * This transaction only succeeds if the connected signer is the `assistant`. * @param offerId - ID of offer to void. * @param validUntil - new validity date. * @param overrides - Optional overrides. * @returns Transaction response. */ extendOffer(offerId: BigNumberish, validUntil: BigNumberish, overrides: Partial<{ contractAddress: string; returnTxInfo: true; }>): Promise; extendOffer(offerId: BigNumberish, validUntil: BigNumberish, overrides?: Partial<{ contractAddress: string; returnTxInfo?: false | undefined; }>): Promise; /** * Extends a batch of existing offers by calling the `OfferHandlerFacet` contract. * This transaction only succeeds if the connected signer is the `assistant` of all * provided offers. * @param offerIds - IDs of offers to void. * @param validUntil - new validity date. * @param overrides - Optional overrides. * @returns Transaction response. */ extendOfferBatch(offerIds: BigNumberish[], validUntil: BigNumberish, overrides: Partial<{ contractAddress: string; returnTxInfo: true; }>): Promise; extendOfferBatch(offerIds: BigNumberish[], validUntil: BigNumberish, overrides?: Partial<{ contractAddress: string; returnTxInfo?: false | undefined; }>): Promise; /** * Returns offer from subgraph. * @param offerId - ID of offer. * @param queryVars - Optional query variables to skip, order or filter. * @returns Offer entity from subgraph. */ getOfferById(offerId: BigNumberish, queryVars?: offers.subgraph.SingleOfferQueryVariables): Promise; /** * Returns offers from subgraph. * @param queryVars - Optional query variables to skip, order or filter. * @returns Offer entities from subgraph. */ getOffers(queryVars?: subgraph.GetOffersQueryQueryVariables): Promise; /** * Renders contractual agreement for given offer. * @param offerId - Id of offer to render agreement for. * @returns Contractual agreement as string. */ renderContractualAgreementForOffer(offerId: BigNumberish): Promise; /** * Renders contractual agreement for given offer. * @param template - Mustache syntax based template. * @param offerData - Offer data. * @returns Contractual agreement as string. */ renderContractualAgreement(template: string, offerData: offers.CreateOfferArgs, offerMetadata: offers.AdditionalOfferMetadata): Promise; /** * Reserves a range of vouchers to be associated with an offer * @param offerId - Offer ID * @param overrides - Optional overrides. * @returns Transaction response. */ reserveRange(offerId: BigNumberish, length: BigNumberish, to: "seller" | "contract", overrides: Partial<{ contractAddress: string; returnTxInfo: true; }>): Promise; reserveRange(offerId: BigNumberish, length: BigNumberish, to: "seller" | "contract", overrides?: Partial<{ contractAddress: string; returnTxInfo?: false | undefined; }>): Promise; /** * Returns the current allowance of the given token by calling the contract. * @param exchangeToken - Address of exchange token. * @param overrides - Optional overrides. * @returns Allowance for given signer. */ getExchangeTokenAllowance(exchangeToken: string, overrides?: Partial<{ spender: string; owner: string; }>): Promise; /** * Returns `name`, `decimals` and `symbol` of the given token by calling the contract. * @param exchangeToken - Address exchange token. * @returns Decimals, name and symbol. */ getExchangeTokenInfo(exchangeToken: string): Promise; /** * Approves the given amount for the main protocol contract. * @param exchangeToken - Address of token to approve. * @param value - Amount of allowance. * @param overrides - Optional overrides. * @returns Transaction response. */ approveExchangeToken(exchangeToken: string, value: BigNumberish, overrides: Partial<{ spender: string; returnTxInfo: true; }>): Promise; approveExchangeToken(exchangeToken: string, value: BigNumberish, overrides?: Partial<{ spender: string; returnTxInfo?: false | undefined; }>): Promise; getProtocolAllowance(exchangeToken: string, overrides?: Partial<{ spender: string; owner: string; }>): Promise; checkTokenGatedCondition(offerId: subgraph.OfferFieldsFragment["id"], buyerAddress: string): Promise; /** * Check a given offer meets ExchangePolicy rules. * @param offerId - Id of offer to render agreement for. * @returns Contractual agreement as string. */ checkExchangePolicy(offerId: BigNumberish, rules: offers.CheckExchangePolicyRules): Promise; /** * Sets new valid royalty info to a given offer. * @param offerId - Id of the offer * @param royaltyInfo - new royaltyInfo to be applied * @param overrides - Optional overrides. * @returns Transaction response. */ updateOfferRoyaltyRecipients(offerId: BigNumberish, royaltyInfo: RoyaltyInfo, overrides: Partial<{ contractAddress: string; returnTxInfo: true; }>): Promise; updateOfferRoyaltyRecipients(offerId: BigNumberish, royaltyInfo: RoyaltyInfo, overrides?: Partial<{ contractAddress: string; returnTxInfo?: false | undefined; }>): Promise; /** * Sets new valid until date for a batch of offers. * @param offerIds - list of ids of the offers to extend * @param royaltyInfo - new royaltyInfo to be applied * @param overrides - Optional overrides. * @returns Transaction response. */ updateOfferRoyaltyRecipientsBatch(offerIds: BigNumberish[], royaltyInfo: RoyaltyInfo, overrides: Partial<{ contractAddress: string; returnTxInfo: true; }>): Promise; updateOfferRoyaltyRecipientsBatch(offerIds: BigNumberish[], royaltyInfo: RoyaltyInfo, overrides?: Partial<{ contractAddress: string; returnTxInfo?: false | undefined; }>): Promise; getOfferHash(fullOfferArgsUnsigned: Omit, overrides?: Partial<{ contractAddress: string; }>): Promise; } //# sourceMappingURL=mixin.d.ts.map