import { providers as multicallProviders } from "@0xsequence/multicall"; import { BigNumber } from "ethers"; import { ItemType } from "../constants"; import type { InputCriteria, Item, OrderParameters } from "../types"; import { getSummedTokenAndIdentifierAmounts, TimeBasedItemParams } from "./item"; export declare type BalancesAndApprovals = { token: string; identifierOrCriteria: string; balance: BigNumber; approvedAmount: BigNumber; itemType: ItemType; }[]; export declare type InsufficientBalances = { token: string; identifierOrCriteria: string; requiredAmount: BigNumber; amountHave: BigNumber; itemType: ItemType; }[]; export declare type InsufficientApprovals = { token: string; identifierOrCriteria: string; approvedAmount: BigNumber; requiredApprovedAmount: BigNumber; operator: string; itemType: ItemType; }[]; export declare const getBalancesAndApprovals: ({ owner, items, criterias, operator, multicallProvider, }: { owner: string; items: Item[]; criterias: InputCriteria[]; operator: string; multicallProvider: multicallProviders.MulticallProvider; }) => Promise; export declare const getInsufficientBalanceAndApprovalAmounts: ({ balancesAndApprovals, tokenAndIdentifierAmounts, operator, }: { balancesAndApprovals: BalancesAndApprovals; tokenAndIdentifierAmounts: ReturnType; operator: string; }) => { insufficientBalances: InsufficientBalances; insufficientApprovals: InsufficientApprovals; }; /** * 1. The offerer should have sufficient balance of all offered items. * 2. If the order does not indicate proxy utilization, the offerer should have sufficient approvals set * for the Seaport contract for all offered ERC20, ERC721, and ERC1155 items. * 3. If the order does indicate proxy utilization, the offerer should have sufficient approvals set * for their respective proxy contract for all offered ERC20, ERC721, and ERC1155 items. */ export declare const validateOfferBalancesAndApprovals: ({ offer, criterias, balancesAndApprovals, timeBasedItemParams, throwOnInsufficientBalances, throwOnInsufficientApprovals, operator, }: { balancesAndApprovals: BalancesAndApprovals; timeBasedItemParams?: TimeBasedItemParams | undefined; throwOnInsufficientBalances?: boolean | undefined; throwOnInsufficientApprovals?: boolean | undefined; operator: string; } & Pick & { criterias: InputCriteria[]; }) => InsufficientApprovals; /** * When fulfilling a basic order, the following requirements need to be checked to ensure that the order will be fulfillable: * 1. Offer checks need to be performed to ensure that the offerer still has sufficient balance and approvals * 2. The fulfiller should have sufficient balance of all consideration items except for those with an * item type that matches the order's offered item type — by way of example, if the fulfilled order offers * an ERC20 item and requires an ERC721 item to the offerer and the same ERC20 item to another recipient, * the fulfiller needs to own the ERC721 item but does not need to own the ERC20 item as it will be sourced from the offerer. * 3. If the fulfiller does not elect to utilize a proxy, they need to have sufficient approvals set for the * Seaport contract for all ERC20, ERC721, and ERC1155 consideration items on the fulfilled order except * for ERC20 items with an item type that matches the order's offered item type. * 4. If the fulfiller does elect to utilize a proxy, they need to have sufficient approvals set for their * respective proxy contract for all ERC20, ERC721, and ERC1155 consideration items on the fulfilled order * except for ERC20 items with an item type that matches the order's offered item type. * 5. If the fulfilled order specifies Ether (or other native tokens) as consideration items, the fulfiller must * be able to supply the sum total of those items as msg.value. * * @returns the list of insufficient owner and proxy approvals */ export declare const validateBasicFulfillBalancesAndApprovals: ({ offer, consideration, offererBalancesAndApprovals, fulfillerBalancesAndApprovals, timeBasedItemParams, offererOperator, fulfillerOperator, }: { offererBalancesAndApprovals: BalancesAndApprovals; fulfillerBalancesAndApprovals: BalancesAndApprovals; timeBasedItemParams: TimeBasedItemParams; offererOperator: string; fulfillerOperator: string; } & Pick) => InsufficientApprovals; /** * When fulfilling a standard order, the following requirements need to be checked to ensure that the order will be fulfillable: * 1. Offer checks need to be performed to ensure that the offerer still has sufficient balance and approvals * 2. The fulfiller should have sufficient balance of all consideration items after receiving all offered items * — by way of example, if the fulfilled order offers an ERC20 item and requires an ERC721 item to the offerer * and the same ERC20 item to another recipient with an amount less than or equal to the offered amount, * the fulfiller does not need to own the ERC20 item as it will first be received from the offerer. * 3. If the fulfiller does not elect to utilize a proxy, they need to have sufficient approvals set for the * Seaport contract for all ERC20, ERC721, and ERC1155 consideration items on the fulfilled order. * 4. If the fulfiller does elect to utilize a proxy, they need to have sufficient approvals set for their * respective proxy contract for all ERC20, ERC721, and ERC1155 consideration items on the fulfilled order. * 5. If the fulfilled order specifies Ether (or other native tokens) as consideration items, the fulfiller must * be able to supply the sum total of those items as msg.value. * * @returns the list of insufficient owner and proxy approvals */ export declare const validateStandardFulfillBalancesAndApprovals: ({ offer, consideration, offerCriteria, considerationCriteria, offererBalancesAndApprovals, fulfillerBalancesAndApprovals, timeBasedItemParams, offererOperator, fulfillerOperator, }: Pick & { offerCriteria: InputCriteria[]; considerationCriteria: InputCriteria[]; offererBalancesAndApprovals: BalancesAndApprovals; fulfillerBalancesAndApprovals: BalancesAndApprovals; timeBasedItemParams: TimeBasedItemParams; offererOperator: string; fulfillerOperator: string; }) => InsufficientApprovals;