diff --git a/.gitignore b/.gitignore index 5d1a8414e..aa014740d 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,7 @@ build/** dist/** .next/** generated +*.log # yarn .pnp.* diff --git a/contracts/accounts.js b/contracts/accounts.js index eb295db04..afd948d98 100644 --- a/contracts/accounts.js +++ b/contracts/accounts.js @@ -69,6 +69,12 @@ const ACCOUNT_12 = { privateKey: "35253a0b89df66fa7c4fb98e46925f6e8804b55a80e2e1c3f22cb1b90a11567b" }; +const ACCOUNT_13 = { + address: "0xC448891cE3d85d141C43E9D95236B7C735bd74BB", + privateKey: + "0x23b745a17fdcdfcc13a8d5af456898700cd798b25ef5ef3767ae859cc8114df1" +}; + const ACCOUNTS = [ ACCOUNT_1, ACCOUNT_2, @@ -81,7 +87,8 @@ const ACCOUNTS = [ ACCOUNT_9, ACCOUNT_10, ACCOUNT_11, - ACCOUNT_12 + ACCOUNT_12, + ACCOUNT_13 ]; module.exports = { @@ -97,5 +104,6 @@ module.exports = { ACCOUNT_9, ACCOUNT_10, ACCOUNT_11, - ACCOUNT_12 + ACCOUNT_12, + ACCOUNT_13 }; diff --git a/contracts/hardhat.config.js b/contracts/hardhat.config.js index 87ce1440c..85f8dc9a5 100644 --- a/contracts/hardhat.config.js +++ b/contracts/hardhat.config.js @@ -25,7 +25,18 @@ const accountsFromEnv = process.env.DEPLOYER_PK * @type import('hardhat/config').HardhatUserConfig */ module.exports = { - solidity: "0.8.9", + solidity: { + version: "0.8.9", + settings: { + optimizer: { + enabled: true, + runs: 200, + details: { + yul: true + } + } + } + }, networks: { hardhat: { allowUnlimitedContractSize: true, diff --git a/contracts/protocol-contracts b/contracts/protocol-contracts index 752ba8bd0..38c7ba384 160000 --- a/contracts/protocol-contracts +++ b/contracts/protocol-contracts @@ -1 +1 @@ -Subproject commit 752ba8bd0830109c1d5ec555e615172b0c270d20 +Subproject commit 38c7ba384e55486aee4ea76bb80b4f29d1a86175 diff --git a/contracts/scripts/deploy.js b/contracts/scripts/deploy.js index 901b9d8a8..6e9dfd680 100644 --- a/contracts/scripts/deploy.js +++ b/contracts/scripts/deploy.js @@ -3,334 +3,30 @@ process.env.CONFIRMATIONS = 1; // required for deployProtocolConfigFacet() process.env.DEPLOYER_GAS_LIMIT_TEST = gasLimit; process.env.AUTH_TOKEN_OWNERS_LOCAL = ""; process.env.TIP_MULTIPLIER = "10"; +process.env.ADMIN_ADDRESS_LOCAL = "0x5131738127d2E5Edc999b1634342833667eBC8Bc"; // any non-zero address +require("dotenv").config({ + path: "./protocol-contracts/.env" +}); /* eslint @typescript-eslint/no-var-requires: "off" */ -const hre = require("hardhat"); -const ethers = hre.ethers; -const protocolConfig = require("../protocol-contracts/scripts/config/protocol-parameters"); -const authTokenAddresses = require("../protocol-contracts/scripts/config/auth-token-addresses"); - -const Role = require("../protocol-contracts/scripts/domain/Role"); -const { - deployProtocolDiamond -} = require("../protocol-contracts/scripts/util/deploy-protocol-diamond.js"); -const { - deployProtocolClients -} = require("../protocol-contracts/scripts/util/deploy-protocol-clients.js"); -const { - deployProtocolConfigFacet -} = require("../protocol-contracts/scripts/util/deploy-protocol-config-facet.js"); -const { - deployProtocolHandlerFacets -} = require("../protocol-contracts/scripts/util/deploy-protocol-handler-facets.js"); -const { - deploymentComplete -} = require("../protocol-contracts/scripts/util/utils"); const { - deployMockTokens, - deployAndMintMockNFTAuthTokens -} = require("../protocol-contracts/scripts/util/deploy-mock-tokens"); -const { oneMonth } = require("../protocol-contracts/test/util/constants"); -const AuthTokenType = require("../protocol-contracts/scripts/domain/AuthTokenType"); + deploySuite +} = require("../protocol-contracts/scripts/deploy-suite.js"); -function getConfig(network) { - return [ - { - token: protocolConfig.TOKEN[network], - treasury: protocolConfig.TREASURY[network], - voucherBeacon: protocolConfig.BEACON[network], - beaconProxy: protocolConfig.BEACON_PROXY[network] - }, - { - ...protocolConfig.limits, - minDisputePeriod: "1" - }, - protocolConfig.fees - ]; -} - -/** - * Get the contract addresses for supported NFT Auth token contracts - * @returns {lensAddress: string, ensAddress: string} - */ -function getAuthTokenContracts(network) { - if (network === "localhost") { - return { - lensAddress: "0x2bdCC0de6bE1f7D2ee689a0342D76F52E8EFABa3", - ensAddress: "0x7969c5eD335650692Bc04293B07F5BF2e7A673C0" - }; - } - return { - lensAddress: authTokenAddresses.LENS[network], - ensAddress: authTokenAddresses.ENS[network] - }; -} - -/** - * Get a list of no-arg initializer facet names to be cut into the Diamond - */ -function getNoArgFacetNames() { - return [ - "AccountHandlerFacet", - "SellerHandlerFacet", - "BuyerHandlerFacet", - "DisputeResolverHandlerFacet", - "AgentHandlerFacet", - "BundleHandlerFacet", - "DisputeHandlerFacet", - "ExchangeHandlerFacet", - "FundsHandlerFacet", - "GroupHandlerFacet", - "MetaTransactionsHandlerFacet", - "OfferHandlerFacet", - "OrchestrationHandlerFacet", - "TwinHandlerFacet", - "PauseHandlerFacet" - ]; -} +const { + deployAndMintMockNFTAuthTokens, + deployMockTokens +} = require("../protocol-contracts/scripts/util/deploy-mock-tokens.js"); async function main() { - console.log("compile"); - // Compile everything (in case run by node) - await hre.run("compile"); - - // Deployed contracts - let contracts = []; - - // Output script header - const divider = "-".repeat(80); - console.log( - `${divider}\nBoson Protocol V2 Contract Suite Deployer\n${divider}` - ); - console.log(`⛓ Network: ${hre.network.name}\n📅 ${new Date()}`); - - // Get the protocol config - const config = getConfig(hre.network.name); - const authTokenContracts = getAuthTokenContracts(hre.network.name); - - // Get the accounts - const accounts = await ethers.getSigners(); - const deployerSigner = accounts[0]; - const deployer = deployerSigner.address; - const disputeResolverSigner = accounts[1]; - const disputeResolver = disputeResolverSigner.address; - console.log( - "🔱 Deployer account: ", - deployer ? deployer : "not found" && process.exit() - ); - console.log(divider); - - if (hre.network.name === "localhost" || !config[0].token) { - console.log(`\n💎 Deploying mock tokens...`); - const [mockBosonToken] = await deployMockTokens(gasLimit); - deploymentComplete("BosonToken", mockBosonToken.address, [], "", contracts); - config[0].token = mockBosonToken.address; - } - - console.log( - `\n💎 Deploying AccessController, ProtocolDiamond, and Diamond utility facets...` - ); - - // Deploy the Diamond - const [protocolDiamond, dlf, dcf, erc165f, accessController, diamondArgs] = - await deployProtocolDiamond(gasLimit); - deploymentComplete( - "AccessController", - accessController.address, - [], - "", - contracts - ); - deploymentComplete("DiamondLoupeFacet", dlf.address, [], "", contracts); - deploymentComplete("DiamondCutFacet", dcf.address, [], "", contracts); - deploymentComplete("ERC165Facet", erc165f.address, [], "", contracts); - deploymentComplete( - "ProtocolDiamond", - protocolDiamond.address, - diamondArgs, - "", - contracts - ); - - console.log(`\n💎 Deploying and initializing protocol facets...`); - - // Temporarily grant UPGRADER role to deployer account - await accessController.grantRole(Role.UPGRADER, deployer); - - const { - facets: [configHandlerFacet] - } = await deployProtocolConfigFacet(protocolDiamond, config, gasLimit); - deploymentComplete( - "ConfigHandlerFacet", - configHandlerFacet.address, - [], - "", - contracts - ); - - // Deploy and cut facets - const deployedFacets = await deployProtocolHandlerFacets( - protocolDiamond, - getNoArgFacetNames(), - gasLimit - ); - for (let i = 0; i < deployedFacets.length; i++) { - const deployedFacet = deployedFacets[i]; - deploymentComplete( - deployedFacet.name, - deployedFacet.contract.address, - [], - "", - contracts - ); - } - - console.log(`\n⧉ Deploying Protocol Client implementation/proxy pairs...`); - - // Deploy the Protocol Client implementation/proxy pairs - const protocolClientArgs = [protocolDiamond.address]; - const [impls, beacons, proxies] = await deployProtocolClients( - protocolClientArgs, - gasLimit - ); - const [bosonVoucherImpl] = impls; - const [bosonClientBeacon] = beacons; - const [bosonVoucherProxy] = proxies; - - // Gather the complete args that were used to create the proxies - const bosonVoucherProxyArgs = [ - ...protocolClientArgs, - bosonVoucherImpl.address - ]; - - // Report and prepare for verification - deploymentComplete( - "BosonVoucher Logic", - bosonVoucherImpl.address, - [], - "", - contracts - ); - deploymentComplete( - "BosonVoucher Beacon", - bosonClientBeacon.address, - [], - "", - contracts - ); - deploymentComplete( - "BosonVoucher Proxy", - bosonVoucherProxy.address, - bosonVoucherProxyArgs, - "", - contracts - ); - - console.log(`\n🌐️Configuring and granting roles...`); - - // Cast Diamond to the IBosonConfigHandler interface for further interaction with it - const bosonConfigHandler = await ethers.getContractAt( - "IBosonConfigHandler", - protocolDiamond.address - ); - - // Add Voucher NFT addresses to protocol config - await bosonConfigHandler.setVoucherBeaconAddress(bosonClientBeacon.address); - await bosonConfigHandler.setBeaconProxyAddress(bosonVoucherProxy.address); - - //Add NFT auth token addresses to protocol config - await bosonConfigHandler.setAuthTokenContract( - AuthTokenType.Lens, - authTokenContracts.lensAddress - ); - await bosonConfigHandler.setAuthTokenContract( - AuthTokenType.ENS, - authTokenContracts.ensAddress - ); - - console.log( - `✅ ConfigHandlerFacet updated with remaining post-initialization config.` - ); - - // Add roles to contracts and addresses that need it - // Renounce temporarily granted UPGRADER role for deployer account - await accessController.renounceRole(Role.UPGRADER, deployer); - await accessController.grantRole(Role.PROTOCOL, protocolDiamond.address); - - console.log(`✅ Granted roles to appropriate contract and addresses.`); - - // Some custom stuff for e2e setup - if (["localhost", "hardhat"].includes(hre.network.name)) { - console.log(`\n🌐️Custom stuff for e2e setup...`); - - // Deploy ERC20-compliant mock token for testing - const [foreign20Token, foreign721Token, foreign1155Token] = - await deployMockTokens(gasLimit, [ - "Foreign20", - "Foreign721", - "Foreign1155" - ]); - deploymentComplete("Foreign20", foreign20Token.address, [], "", contracts); - deploymentComplete( - "Foreign721", - foreign721Token.address, - [], - "", - contracts - ); - deploymentComplete( - "Foreign1155", - foreign1155Token.address, - [], - "", - contracts - ); - - await deployAndMintMockNFTAuthTokens(); - - // Create and activate default dispute resolver - const accountHandler = await ethers.getContractAt( - "IBosonAccountHandler", - protocolDiamond.address - ); - const response = await accountHandler - .connect(disputeResolverSigner) - .createDisputeResolver( - { - id: "1", - escalationResponsePeriod: oneMonth.toString(), - operator: disputeResolver, - admin: disputeResolver, - clerk: disputeResolver, - treasury: disputeResolver, - // TODO: use valid uri - metadataUri: `ipfs://disputeResolver1`, - active: true - }, - [ - { - tokenAddress: ethers.constants.AddressZero, - tokenName: "Native", - feeAmount: "0" - }, - { - tokenAddress: foreign20Token.address, - tokenName: "Foreign20", - feeAmount: "0" - } - ], - [] - ); - const receipt = await response.wait(); - const event = receipt.events.find( - (event) => event.event === "DisputeResolverCreated" - ); - const disputeResolverId = event.args.disputeResolverId; + await deploySuite("localhost", undefined); + await deployAndMintMockNFTAuthTokens(); + const mockTokens = ["Foreign20", "Foreign721", "Foreign1155"]; + const deployedTokens = await deployMockTokens([...mockTokens]); + for (const [index, mockToken] of Object.entries(mockTokens)) { console.log( - `✅ Dispute resolver created. ID: ${disputeResolverId} Wallet: ${disputeResolver}` + `✅ Mock token ${mockToken} has been deployed at ${deployedTokens[index].address}` ); - await accountHandler.activateDisputeResolver(disputeResolverId); - console.log(`✅ Dispute resolver activated`); } } diff --git a/e2e/docker-compose.yml b/e2e/docker-compose.yml index 30025c1be..fe905eb24 100644 --- a/e2e/docker-compose.yml +++ b/e2e/docker-compose.yml @@ -19,9 +19,11 @@ services: hardhat-node: build: ../contracts - image: hardhat-node:752ba8bd0830109c1d5ec555e615172b0c270d20_0 + image: hardhat-node:38c7ba384e55486aee4ea76bb80b4f29d1a86175 ports: - "8545:8545" + volumes: + - ../contracts/scripts/deploy.js:/app/scripts/deploy.js graph-node: image: graphprotocol/graph-node:v0.27.0 # TODO: find out why ^0.28.0 not starting to index diff --git a/e2e/meta-tx-gateway/package.json b/e2e/meta-tx-gateway/package.json index 37af2810f..1fe1bd43e 100644 --- a/e2e/meta-tx-gateway/package.json +++ b/e2e/meta-tx-gateway/package.json @@ -23,7 +23,6 @@ }, "homepage": "https://github.com/bosonprotocol/core-components#readme", "dependencies": { - "@bosonprotocol/common": "^1.20.2", "cors": "^2.8.5", "dotenv": "^16.0.2", "ethers": "^5.7.0", @@ -31,7 +30,8 @@ "express-validator": "^6.14.2", "morgan": "^1.10.0", "ts-command-line-args": "^2.3.1", - "winston": "^3.8.2" + "winston": "^3.8.2", + "yup": "^0.32.11" }, "devDependencies": { "@types/cors": "^2.8.12", diff --git a/e2e/meta-tx-gateway/src/services/meta-tx.ts b/e2e/meta-tx-gateway/src/services/meta-tx.ts index ef2a5ec19..57bc4c1a1 100644 --- a/e2e/meta-tx-gateway/src/services/meta-tx.ts +++ b/e2e/meta-tx-gateway/src/services/meta-tx.ts @@ -1,6 +1,6 @@ import { logger } from "./../utils/logger"; import { ContractTransaction } from "ethers"; -import { abis } from "@bosonprotocol/common"; +import * as abis from "@bosonprotocol/common/src/abis"; import { Interface } from "@ethersproject/abi"; import { ethers } from "ethers"; import { Config, getConfig } from "../config"; diff --git a/e2e/meta-tx-gateway/tsconfig.json b/e2e/meta-tx-gateway/tsconfig.json index 2cefe16f2..14dc80cff 100644 --- a/e2e/meta-tx-gateway/tsconfig.json +++ b/e2e/meta-tx-gateway/tsconfig.json @@ -2,10 +2,14 @@ "compilerOptions": { "module": "commonjs", "target": "es6", - "rootDir": "./", + // "rootDir": "./", "esModuleInterop": true, "outDir": "./build", - "resolveJsonModule": true + "resolveJsonModule": true, + "paths": { + "@bosonprotocol/common": ["../../packages/common"], + "@bosonprotocol/metadata": ["../../packages/metadata"] + } }, "include": ["src", "index.ts"] } diff --git a/e2e/run-e2e-services.sh b/e2e/run-e2e-services.sh index ffe9dc7bc..342a35f39 100755 --- a/e2e/run-e2e-services.sh +++ b/e2e/run-e2e-services.sh @@ -10,7 +10,7 @@ function cleanup() { cd e2e -docker-compose up -d +docker-compose up -d --build echo "Waiting for services..." sleep 15 diff --git a/e2e/tests/accounts.test.ts b/e2e/tests/accounts.test.ts index 54b4d284f..1a0069459 100644 --- a/e2e/tests/accounts.test.ts +++ b/e2e/tests/accounts.test.ts @@ -1,5 +1,5 @@ import { ZERO_ADDRESS } from "./../../packages/core-sdk/tests/mocks"; -import { Wallet, BigNumber } from "ethers"; +import { BigNumber } from "ethers"; import { MSEC_PER_DAY, MSEC_PER_SEC @@ -33,7 +33,7 @@ describe("CoreSDK - accounts", () => { const ethDisputeResolutionFee = { tokenAddress: constants.AddressZero, tokenName: "Native", - feeAmount: utils.parseEther("1") + feeAmount: utils.parseEther("0") }; test("create", async () => { @@ -55,7 +55,7 @@ describe("CoreSDK - accounts", () => { } ); - expect(disputeResolver.active).toBeFalsy(); + expect(disputeResolver.active).toBeTruthy(); expect(disputeResolver.admin).toBe(disputeResolverAddress); expect(disputeResolver.clerk).toBe(disputeResolverAddress); expect(disputeResolver.operator).toBe(disputeResolverAddress); @@ -68,14 +68,14 @@ describe("CoreSDK - accounts", () => { ); }); - test("activate", async () => { - const fundedWallet = await createFundedWallet(protocolAdminWallet); + test("update", async () => { + const { coreSDK, fundedWallet } = await initCoreSDKWithFundedWallet( + protocolAdminWallet + ); const disputeResolverAddress = fundedWallet.address.toLowerCase(); - const { disputeResolver } = await createDisputeResolver( - fundedWallet, - protocolAdminWallet, - { + const { disputeResolver: disputeResolverBeforeUpdate } = + await createDisputeResolver(fundedWallet, protocolAdminWallet, { operator: disputeResolverAddress, clerk: disputeResolverAddress, admin: disputeResolverAddress, @@ -84,39 +84,7 @@ describe("CoreSDK - accounts", () => { escalationResponsePeriodInMS, fees: [], sellerAllowList: [] - }, - { - activate: true - } - ); - - expect(disputeResolver.active).toBeTruthy(); - }); - - test("update", async () => { - const { coreSDK, fundedWallet } = await initCoreSDKWithFundedWallet( - protocolAdminWallet - ); - const disputeResolverAddress = fundedWallet.address.toLowerCase(); - - const { disputeResolver: disputeResolverBeforeUpdate } = - await createDisputeResolver( - fundedWallet, - protocolAdminWallet, - { - operator: disputeResolverAddress, - clerk: disputeResolverAddress, - admin: disputeResolverAddress, - treasury: disputeResolverAddress, - metadataUri, - escalationResponsePeriodInMS, - fees: [], - sellerAllowList: [] - }, - { - activate: true - } - ); + }); const { coreSDK: coreSDK2, fundedWallet: randomWallet } = await initCoreSDKWithFundedWallet(seedWallet3); @@ -186,18 +154,17 @@ describe("CoreSDK - accounts", () => { treasury: disputeResolverAddress, metadataUri, escalationResponsePeriodInMS, - fees: [], + fees: [ethDisputeResolutionFee], sellerAllowList: [] - }, - { - activate: true } ); - + const secondFee = { + tokenAddress: "0x0000000000000000000000000000000000000001", + tokenName: "Not-Native", + feeAmount: utils.parseEther("0") + }; await ( - await coreSDK.addFeesToDisputeResolver(disputeResolver.id, [ - ethDisputeResolutionFee - ]) + await coreSDK.addFeesToDisputeResolver(disputeResolver.id, [secondFee]) ).wait(); await waitForGraphNodeIndexing(); @@ -216,6 +183,18 @@ describe("CoreSDK - accounts", () => { ); expect(disputeResolverAfterUpdate.fees[0].token.decimals).toBe("18"); expect(disputeResolverAfterUpdate.fees[0].token.symbol).toBe("ETH"); + + expect(disputeResolverAfterUpdate.fees[1].tokenAddress).toBe( + secondFee.tokenAddress + ); + expect(disputeResolverAfterUpdate.fees[1].tokenName).toBe( + secondFee.tokenName + ); + expect(disputeResolverAfterUpdate.fees[1].feeAmount).toBe( + secondFee.feeAmount.toString() + ); + expect(disputeResolverAfterUpdate.fees[1].token.decimals).toBe("0"); + expect(disputeResolverAfterUpdate.fees[1].token.symbol).toBe("unknown"); }); test("remove fees", async () => { @@ -225,23 +204,16 @@ describe("CoreSDK - accounts", () => { const disputeResolverAddress = fundedWallet.address.toLowerCase(); const { disputeResolver: disputeResolverBeforeUpdate } = - await createDisputeResolver( - fundedWallet, - protocolAdminWallet, - { - operator: disputeResolverAddress, - clerk: disputeResolverAddress, - admin: disputeResolverAddress, - treasury: disputeResolverAddress, - metadataUri, - escalationResponsePeriodInMS, - fees: [ethDisputeResolutionFee], - sellerAllowList: [] - }, - { - activate: true - } - ); + await createDisputeResolver(fundedWallet, protocolAdminWallet, { + operator: disputeResolverAddress, + clerk: disputeResolverAddress, + admin: disputeResolverAddress, + treasury: disputeResolverAddress, + metadataUri, + escalationResponsePeriodInMS, + fees: [ethDisputeResolutionFee], + sellerAllowList: [] + }); await ( await coreSDK.removeFeesFromDisputeResolver( @@ -279,9 +251,6 @@ describe("CoreSDK - accounts", () => { escalationResponsePeriodInMS, fees: [], sellerAllowList: [] - }, - { - activate: true } ); @@ -308,23 +277,16 @@ describe("CoreSDK - accounts", () => { const disputeResolverAddress = fundedWallet.address.toLowerCase(); const { disputeResolver: disputeResolverBeforeUpdate } = - await createDisputeResolver( - fundedWallet, - protocolAdminWallet, - { - operator: disputeResolverAddress, - clerk: disputeResolverAddress, - admin: disputeResolverAddress, - treasury: disputeResolverAddress, - metadataUri, - escalationResponsePeriodInMS, - fees: [], - sellerAllowList: [seller.id] - }, - { - activate: true - } - ); + await createDisputeResolver(fundedWallet, protocolAdminWallet, { + operator: disputeResolverAddress, + clerk: disputeResolverAddress, + admin: disputeResolverAddress, + treasury: disputeResolverAddress, + metadataUri, + escalationResponsePeriodInMS, + fees: [], + sellerAllowList: [seller.id] + }); await ( await coreSDK.removeSellersFromDisputeResolverAllowList( diff --git a/e2e/tests/core-sdk.test.ts b/e2e/tests/core-sdk.test.ts index 1b10a15cb..2f382faf2 100644 --- a/e2e/tests/core-sdk.test.ts +++ b/e2e/tests/core-sdk.test.ts @@ -5,7 +5,6 @@ import { ExchangeFieldsFragment } from "./../../packages/core-sdk/src/subgraph"; import { utils, constants, BigNumber, BigNumberish } from "ethers"; - import { mockCreateOfferArgs } from "../../packages/common/tests/mocks"; import { CoreSDK } from "../../packages/core-sdk/src"; import { @@ -34,7 +33,8 @@ import { createOfferWithCondition, createSellerAndOfferWithCondition, createSeller, - createSellerAndOffer + createSellerAndOffer, + createDisputeResolverIfRequired } from "./utils"; import { EvaluationMethod, TokenType } from "@bosonprotocol/common"; @@ -45,6 +45,10 @@ const buyerWallet2 = seedWallet6; // be sure the seedWallet is not used by anoth jest.setTimeout(60_000); describe("core-sdk", () => { + beforeAll(async () => { + await createDisputeResolverIfRequired(); + }); + describe("core user flows", () => { test("create seller and offer", async () => { const { coreSDK, fundedWallet } = await initCoreSDKWithFundedWallet( diff --git a/e2e/tests/meta-tx.test.ts b/e2e/tests/meta-tx.test.ts index 4eb94c3f9..31c7e5bc5 100644 --- a/e2e/tests/meta-tx.test.ts +++ b/e2e/tests/meta-tx.test.ts @@ -18,7 +18,9 @@ import { seedWallet11, ensureMintedERC1155, MOCK_ERC1155_ADDRESS, - initCoreSDKWithFundedWallet + initCoreSDKWithFundedWallet, + createDisputeResolverIfRequired, + seedWallet13 } from "./utils"; import { CoreSDK } from "../../packages/core-sdk/src"; import EvaluationMethod from "../../contracts/protocol-contracts/scripts/domain/EvaluationMethod"; @@ -39,6 +41,7 @@ describe("meta-tx", () => { let offerToCommit: OfferFieldsFragment; beforeAll(async () => { + await createDisputeResolverIfRequired(); await ensureCreatedSeller(sellerWallet); await ensureMintedAndAllowedTokens([sellerWallet]); // do not approve for buyer (we expect commit to do it when needed) @@ -60,17 +63,27 @@ describe("meta-tx", () => { if (existingSeller) { // Change all addresses used by the seller to be able to create another one with the original address // Useful when repeating the test suite on the same contracts - const randomWallet = Wallet.createRandom(); const updateTx = await newSellerCoreSDK.updateSeller({ id: existingSeller.id, - admin: randomWallet.address, - operator: randomWallet.address, - clerk: randomWallet.address, - treasury: randomWallet.address, + admin: seedWallet13.address, + operator: seedWallet13.address, + clerk: seedWallet13.address, + treasury: seedWallet13.address, authTokenId: "0", authTokenType: 0 }); await updateTx.wait(); + const randomSellerCoreSDK = initCoreSDKWithWallet(seedWallet13); + const optinTx = await randomSellerCoreSDK.optInToSellerUpdate({ + id: existingSeller.id, + fieldsToUpdate: { + admin: true, + operator: true, + clerk: true, + authToken: true + } + }); + await optinTx.wait(); } // Random seller signs meta tx diff --git a/e2e/tests/native-meta-tx.test.ts b/e2e/tests/native-meta-tx.test.ts index b59c0f4f5..9cb74b7de 100644 --- a/e2e/tests/native-meta-tx.test.ts +++ b/e2e/tests/native-meta-tx.test.ts @@ -2,7 +2,8 @@ import { BigNumber } from "ethers"; import { seedWallet12, initCoreSDKWithWallet, - MOCK_ERC20_ADDRESS + MOCK_ERC20_ADDRESS, + createDisputeResolverIfRequired } from "./utils"; const seedWallet = seedWallet12; // be sure the seedWallet is not used by another test (to allow concurrent run) @@ -13,6 +14,9 @@ const coreSDK = initCoreSDKWithWallet(seedWallet); jest.setTimeout(60_000); describe("native-meta-tx", () => { + beforeAll(async () => { + await createDisputeResolverIfRequired(); + }); test("approve ERC20 token", async () => { const allowanceBefore = await coreSDK.getProtocolAllowance( MOCK_ERC20_ADDRESS diff --git a/e2e/tests/utils.ts b/e2e/tests/utils.ts index f8b98eaf5..b6eb26d36 100644 --- a/e2e/tests/utils.ts +++ b/e2e/tests/utils.ts @@ -7,6 +7,7 @@ import { providers, Wallet, utils, + constants, Contract, BigNumber, BigNumberish @@ -32,7 +33,8 @@ import { ACCOUNT_9, ACCOUNT_10, ACCOUNT_11, - ACCOUNT_12 + ACCOUNT_12, + ACCOUNT_13 } from "../../contracts/accounts"; import { MOCK_ERC1155_ABI, @@ -43,6 +45,10 @@ import { import { BaseMetadata } from "@bosonprotocol/metadata/src/base"; import { SellerFieldsFragment } from "../../packages/core-sdk/src/subgraph"; import { ZERO_ADDRESS } from "../../packages/core-sdk/tests/mocks"; +import { + MSEC_PER_DAY, + MSEC_PER_SEC +} from "../../packages/common/src/utils/timestamp"; export const MOCK_ERC20_ADDRESS = getDefaultConfig("local").contracts.testErc20 || @@ -82,6 +88,7 @@ export const seedWallet7 = new Wallet(ACCOUNT_7.privateKey, provider); export const seedWallet8 = new Wallet(ACCOUNT_8.privateKey, provider); export const seedWallet9 = new Wallet(ACCOUNT_9.privateKey, provider); export const seedWallet11 = new Wallet(ACCOUNT_11.privateKey, provider); +export const seedWallet13 = new Wallet(ACCOUNT_13.privateKey, provider); // seedWallets used by native-meta-tx test export const seedWallet12 = new Wallet(ACCOUNT_12.privateKey, provider); // seedWallets used by productV1 test @@ -261,17 +268,14 @@ export async function ensureMintedERC1155( export async function createDisputeResolver( drWallet: Wallet, protocolWallet: Wallet, - disputeResolverToCreate: accounts.CreateDisputeResolverArgs, - options: Partial<{ - activate: boolean; - }> = {} + disputeResolverToCreate: accounts.CreateDisputeResolverArgs ) { const drCoreSDK = initCoreSDKWithWallet(drWallet); const protocolAdminCoreSDK = initCoreSDKWithWallet(protocolWallet); - const receipt = await ( await drCoreSDK.createDisputeResolver(disputeResolverToCreate) ).wait(); + const disputeResolverId = drCoreSDK.getDisputeResolverIdFromLogs( receipt.logs ); @@ -280,12 +284,6 @@ export async function createDisputeResolver( throw new Error("Failed to create dispute resolver"); } - if (options.activate && disputeResolverId) { - await ( - await protocolAdminCoreSDK.activateDisputeResolver(disputeResolverId) - ).wait(); - } - await waitForGraphNodeIndexing(); const disputeResolver = await drCoreSDK.getDisputeResolverById( @@ -300,6 +298,50 @@ export async function createDisputeResolver( }; } +export async function createDisputeResolverIfRequired() { + const protocolAdminWallet = deployerWallet; + + const { coreSDK, fundedWallet } = await initCoreSDKWithFundedWallet( + protocolAdminWallet + ); + const ethDisputeResolutionFee = { + tokenAddress: constants.AddressZero, + tokenName: "Native", + feeAmount: utils.parseEther("0") + }; + const erc20DisputeResolutionFee = { + tokenAddress: MOCK_ERC20_ADDRESS, + tokenName: "erc20", + feeAmount: utils.parseEther("0") + }; + const disputeResolverId = 1; + const dr = await coreSDK.getDisputeResolverById(disputeResolverId); + if (dr && !dr.fees.length) { + await ( + await coreSDK.addFeesToDisputeResolver(disputeResolverId, [ + ethDisputeResolutionFee, + erc20DisputeResolutionFee + ]) + ).wait(); + await waitForGraphNodeIndexing(); + } else if (!dr) { + const metadataUri = "ipfs://dispute-resolver-uri"; + const escalationResponsePeriodInMS = 90 * MSEC_PER_DAY - 1 * MSEC_PER_SEC; + const disputeResolverAddress = fundedWallet.address; + + await createDisputeResolver(fundedWallet, protocolAdminWallet, { + operator: disputeResolverAddress, + clerk: disputeResolverAddress, + admin: disputeResolverAddress, + treasury: disputeResolverAddress, + metadataUri, + escalationResponsePeriodInMS, + fees: [ethDisputeResolutionFee, erc20DisputeResolutionFee], + sellerAllowList: [] + }); + } +} + export async function createOffer( coreSDK: CoreSDK, offerParams?: Partial @@ -402,9 +444,11 @@ export async function createSellerAndOfferWithCondition( const createdOfferId = coreSDK.getCreatedOfferIdFromLogs( createOfferTxReceipt.logs ); - + if (createdOfferId === null) { + throw new Error("Failed to create offer with condition"); + } await waitForGraphNodeIndexing(); - const offer = await coreSDK.getOfferById(createdOfferId as string); + const offer = await coreSDK.getOfferById(createdOfferId); return offer; } @@ -432,7 +476,10 @@ export async function createSeller( ); await waitForGraphNodeIndexing(); - const seller = await coreSDK.getSellerById(createdSellerId as string); + if (createdSellerId === null) { + throw new Error("Failed to create seller"); + } + const seller = await coreSDK.getSellerById(createdSellerId); return seller; } @@ -503,9 +550,11 @@ export async function createSellerAndOffer( const createdOfferId = coreSDK.getCreatedOfferIdFromLogs( createOfferTxReceipt.logs ); - + if (createdOfferId === null) { + throw new Error("Failed to create offer"); + } await waitForGraphNodeIndexing(); - const offer = await coreSDK.getOfferById(createdOfferId as string); + const offer = await coreSDK.getOfferById(createdOfferId); return offer; } @@ -537,7 +586,7 @@ export async function mintLensToken( // Mint the token in the mocked LENS contract for the future seller const tx = await lensContract.connect(wallet).mint(to, tokenId); - tx.wait(); + await tx.wait(); return tokenId; } diff --git a/package-lock.json b/package-lock.json index 1a4f7ed6c..cb5e3b3ef 100644 --- a/package-lock.json +++ b/package-lock.json @@ -36,7 +36,6 @@ "version": "1.2.4", "license": "ISC", "dependencies": { - "@bosonprotocol/common": "^1.20.2", "cors": "^2.8.5", "dotenv": "^16.0.2", "ethers": "^5.7.0", @@ -44,7 +43,8 @@ "express-validator": "^6.14.2", "morgan": "^1.10.0", "ts-command-line-args": "^2.3.1", - "winston": "^3.8.2" + "winston": "^3.8.2", + "yup": "^0.32.11" }, "devDependencies": { "@types/cors": "^2.8.12", @@ -49859,7 +49859,7 @@ "@storybook/ui": "6.5.12", "@types/node": "^14.0.10 || ^16.0.0", "@types/webpack": "^4.41.26", - "autoprefixer": "10.4.5", + "autoprefixer": "^9.8.6", "babel-loader": "^8.0.0", "case-sensitive-paths-webpack-plugin": "^2.3.0", "core-js": "^3.8.2", @@ -56562,8 +56562,7 @@ "dev": true }, "autoprefixer": { - "version": "10.4.5", - "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.5.tgz", + "version": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.5.tgz", "integrity": "sha512-Fvd8yCoA7lNX/OUllvS+aS1I7WRBclGXsepbvT8ZaPgrH24rgXpZzF0/6Hh3ZEkwg+0AES/Osd196VZmYoEFtw==", "dev": true, "requires": { @@ -67787,7 +67786,6 @@ "meta-tx-gateway": { "version": "file:e2e/meta-tx-gateway", "requires": { - "@bosonprotocol/common": "^1.20.2", "@types/cors": "^2.8.12", "@types/express": "^4.17.13", "@types/morgan": "^1.9.3", @@ -67809,7 +67807,8 @@ "ts-node": "^10.9.1", "ts-node-dev": "^2.0.0", "typescript": "^4.8.3", - "winston": "^3.8.2" + "winston": "^3.8.2", + "yup": "^0.32.11" } }, "methods": { @@ -70928,7 +70927,7 @@ "@csstools/postcss-text-decoration-shorthand": "^1.0.0", "@csstools/postcss-trigonometric-functions": "^1.0.2", "@csstools/postcss-unset-value": "^1.0.2", - "autoprefixer": "10.4.5", + "autoprefixer": "^10.4.11", "browserslist": "^4.21.3", "css-blank-pseudo": "^3.0.3", "css-has-pseudo": "^3.0.4", diff --git a/packages/common/src/abis/IBosonAccountHandler.json b/packages/common/src/abis/IBosonAccountHandler.json index 9d4254903..98b4d10bf 100644 --- a/packages/common/src/abis/IBosonAccountHandler.json +++ b/packages/common/src/abis/IBosonAccountHandler.json @@ -238,46 +238,22 @@ }, { "components": [ - { - "internalType": "uint256", - "name": "id", - "type": "uint256" - }, + { "internalType": "uint256", "name": "id", "type": "uint256" }, { "internalType": "uint256", "name": "escalationResponsePeriod", "type": "uint256" }, - { - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "internalType": "address", - "name": "admin", - "type": "address" - }, - { - "internalType": "address", - "name": "clerk", - "type": "address" - }, + { "internalType": "address", "name": "operator", "type": "address" }, + { "internalType": "address", "name": "admin", "type": "address" }, + { "internalType": "address", "name": "clerk", "type": "address" }, { "internalType": "address payable", "name": "treasury", "type": "address" }, - { - "internalType": "string", - "name": "metadataUri", - "type": "string" - }, - { - "internalType": "bool", - "name": "active", - "type": "bool" - } + { "internalType": "string", "name": "metadataUri", "type": "string" }, + { "internalType": "bool", "name": "active", "type": "bool" } ], "indexed": false, "internalType": "struct BosonTypes.DisputeResolver", @@ -650,46 +626,22 @@ }, { "components": [ - { - "internalType": "uint256", - "name": "id", - "type": "uint256" - }, + { "internalType": "uint256", "name": "id", "type": "uint256" }, { "internalType": "uint256", "name": "escalationResponsePeriod", "type": "uint256" }, - { - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "internalType": "address", - "name": "admin", - "type": "address" - }, - { - "internalType": "address", - "name": "clerk", - "type": "address" - }, + { "internalType": "address", "name": "operator", "type": "address" }, + { "internalType": "address", "name": "admin", "type": "address" }, + { "internalType": "address", "name": "clerk", "type": "address" }, { "internalType": "address payable", "name": "treasury", "type": "address" }, - { - "internalType": "string", - "name": "metadataUri", - "type": "string" - }, - { - "internalType": "bool", - "name": "active", - "type": "bool" - } + { "internalType": "string", "name": "metadataUri", "type": "string" }, + { "internalType": "bool", "name": "active", "type": "bool" } ], "indexed": false, "internalType": "struct BosonTypes.DisputeResolver", @@ -1004,36 +956,16 @@ }, { "components": [ - { - "internalType": "uint256", - "name": "id", - "type": "uint256" - }, - { - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "internalType": "address", - "name": "admin", - "type": "address" - }, - { - "internalType": "address", - "name": "clerk", - "type": "address" - }, + { "internalType": "uint256", "name": "id", "type": "uint256" }, + { "internalType": "address", "name": "operator", "type": "address" }, + { "internalType": "address", "name": "admin", "type": "address" }, + { "internalType": "address", "name": "clerk", "type": "address" }, { "internalType": "address payable", "name": "treasury", "type": "address" }, - { - "internalType": "bool", - "name": "active", - "type": "bool" - } + { "internalType": "bool", "name": "active", "type": "bool" } ], "indexed": false, "internalType": "struct BosonTypes.Seller", @@ -1042,11 +974,7 @@ }, { "components": [ - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, + { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "enum BosonTypes.AuthTokenType", "name": "tokenType", @@ -1068,19 +996,6 @@ "name": "SellerUpdated", "type": "event" }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_disputeResolverId", - "type": "uint256" - } - ], - "name": "activateDisputeResolver", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { diff --git a/packages/common/src/abis/IBosonExchangeHandler.json b/packages/common/src/abis/IBosonExchangeHandler.json index fab289f4d..aeb91b005 100644 --- a/packages/common/src/abis/IBosonExchangeHandler.json +++ b/packages/common/src/abis/IBosonExchangeHandler.json @@ -630,6 +630,29 @@ "stateMutability": "payable", "type": "function" }, + { + "inputs": [ + { + "internalType": "address payable", + "name": "_buyer", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_offerId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_exchangeId", + "type": "uint256" + } + ], + "name": "commitToPreMintedOffer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { diff --git a/packages/common/src/abis/IBosonMetaTransactionsHandler.json b/packages/common/src/abis/IBosonMetaTransactionsHandler.json index 73fc3e156..0f436f082 100644 --- a/packages/common/src/abis/IBosonMetaTransactionsHandler.json +++ b/packages/common/src/abis/IBosonMetaTransactionsHandler.json @@ -1,4 +1,29 @@ [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32[]", + "name": "functionNameHashes", + "type": "bytes32[]" + }, + { + "indexed": false, + "internalType": "bool", + "name": "isAllowlisted", + "type": "bool" + }, + { + "indexed": true, + "internalType": "address", + "name": "executedBy", + "type": "address" + } + ], + "name": "FunctionsAllowlisted", + "type": "event" + }, { "anonymous": false, "inputs": [ @@ -79,6 +104,44 @@ "stateMutability": "payable", "type": "function" }, + { + "inputs": [ + { + "internalType": "string", + "name": "_functionName", + "type": "string" + } + ], + "name": "isFunctionAllowlisted", + "outputs": [ + { + "internalType": "bool", + "name": "isAllowlisted", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_functionNameHash", + "type": "bytes32" + } + ], + "name": "isFunctionAllowlisted", + "outputs": [ + { + "internalType": "bool", + "name": "isAllowlisted", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { @@ -102,5 +165,23 @@ ], "stateMutability": "view", "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32[]", + "name": "_functionNameHashes", + "type": "bytes32[]" + }, + { + "internalType": "bool", + "name": "_isAllowlisted", + "type": "bool" + } + ], + "name": "setAllowlistedFunctions", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" } ] diff --git a/packages/common/src/abis/IBosonOfferHandler.json b/packages/common/src/abis/IBosonOfferHandler.json index 2eacb3351..f3660212e 100644 --- a/packages/common/src/abis/IBosonOfferHandler.json +++ b/packages/common/src/abis/IBosonOfferHandler.json @@ -241,6 +241,43 @@ "name": "OfferVoided", "type": "event" }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "offerId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "sellerId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "startExchangeId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "endExchangeId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "executedBy", + "type": "address" + } + ], + "name": "RangeReserved", + "type": "event" + }, { "inputs": [ { @@ -755,6 +792,24 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_offerId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_length", + "type": "uint256" + } + ], + "name": "reserveRange", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { diff --git a/packages/common/src/abis/IBosonOrchestrationHandler.json b/packages/common/src/abis/IBosonOrchestrationHandler.json index 02207a635..aa65980ae 100644 --- a/packages/common/src/abis/IBosonOrchestrationHandler.json +++ b/packages/common/src/abis/IBosonOrchestrationHandler.json @@ -280,73 +280,6 @@ "name": "BuyerUpdated", "type": "event" }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "disputeResolverId", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "id", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "escalationResponsePeriod", - "type": "uint256" - }, - { - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "internalType": "address", - "name": "admin", - "type": "address" - }, - { - "internalType": "address", - "name": "clerk", - "type": "address" - }, - { - "internalType": "address payable", - "name": "treasury", - "type": "address" - }, - { - "internalType": "string", - "name": "metadataUri", - "type": "string" - }, - { - "internalType": "bool", - "name": "active", - "type": "bool" - } - ], - "indexed": false, - "internalType": "struct BosonTypes.DisputeResolver", - "name": "disputeResolver", - "type": "tuple" - }, - { - "indexed": true, - "internalType": "address", - "name": "executedBy", - "type": "address" - } - ], - "name": "DisputeResolverActivated", - "type": "event" - }, { "anonymous": false, "inputs": [ @@ -692,73 +625,6 @@ "name": "DisputeResolverUpdatePending", "type": "event" }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "disputeResolverId", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "id", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "escalationResponsePeriod", - "type": "uint256" - }, - { - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "internalType": "address", - "name": "admin", - "type": "address" - }, - { - "internalType": "address", - "name": "clerk", - "type": "address" - }, - { - "internalType": "address payable", - "name": "treasury", - "type": "address" - }, - { - "internalType": "string", - "name": "metadataUri", - "type": "string" - }, - { - "internalType": "bool", - "name": "active", - "type": "bool" - } - ], - "indexed": false, - "internalType": "struct BosonTypes.DisputeResolver", - "name": "disputeResolver", - "type": "tuple" - }, - { - "indexed": true, - "internalType": "address", - "name": "executedBy", - "type": "address" - } - ], - "name": "DisputeResolverUpdated", - "type": "event" - }, { "anonymous": false, "inputs": [ @@ -1173,6 +1039,43 @@ "name": "OfferVoided", "type": "event" }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "offerId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "sellerId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "startExchangeId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "endExchangeId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "executedBy", + "type": "address" + } + ], + "name": "RangeReserved", + "type": "event" + }, { "anonymous": false, "inputs": [ @@ -1460,81 +1363,6 @@ "name": "SellerUpdatePending", "type": "event" }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "sellerId", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "id", - "type": "uint256" - }, - { - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "internalType": "address", - "name": "admin", - "type": "address" - }, - { - "internalType": "address", - "name": "clerk", - "type": "address" - }, - { - "internalType": "address payable", - "name": "treasury", - "type": "address" - }, - { - "internalType": "bool", - "name": "active", - "type": "bool" - } - ], - "indexed": false, - "internalType": "struct BosonTypes.Seller", - "name": "seller", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "internalType": "enum BosonTypes.AuthTokenType", - "name": "tokenType", - "type": "uint8" - } - ], - "indexed": false, - "internalType": "struct BosonTypes.AuthToken", - "name": "authToken", - "type": "tuple" - }, - { - "indexed": true, - "internalType": "address", - "name": "executedBy", - "type": "address" - } - ], - "name": "SellerUpdated", - "type": "event" - }, { "anonymous": false, "inputs": [ @@ -2383,20 +2211,1637 @@ "type": "uint256" }, { - "internalType": "address", - "name": "operator", - "type": "address" + "internalType": "uint256", + "name": "sellerId", + "type": "uint256" }, { - "internalType": "address", - "name": "admin", - "type": "address" + "internalType": "uint256", + "name": "price", + "type": "uint256" }, { - "internalType": "address", - "name": "clerk", - "type": "address" - }, + "internalType": "uint256", + "name": "sellerDeposit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "buyerCancelPenalty", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "quantityAvailable", + "type": "uint256" + }, + { + "internalType": "address", + "name": "exchangeToken", + "type": "address" + }, + { + "internalType": "string", + "name": "metadataUri", + "type": "string" + }, + { + "internalType": "string", + "name": "metadataHash", + "type": "string" + }, + { + "internalType": "bool", + "name": "voided", + "type": "bool" + } + ], + "internalType": "struct BosonTypes.Offer", + "name": "_offer", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "validFrom", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "validUntil", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "voucherRedeemableFrom", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "voucherRedeemableUntil", + "type": "uint256" + } + ], + "internalType": "struct BosonTypes.OfferDates", + "name": "_offerDates", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "disputePeriod", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "voucherValid", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "resolutionPeriod", + "type": "uint256" + } + ], + "internalType": "struct BosonTypes.OfferDurations", + "name": "_offerDurations", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "_disputeResolverId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_reservedRangeLength", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_groupId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_agentId", + "type": "uint256" + } + ], + "name": "createPremintedOfferAddToGroup", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sellerId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "price", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sellerDeposit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "buyerCancelPenalty", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "quantityAvailable", + "type": "uint256" + }, + { + "internalType": "address", + "name": "exchangeToken", + "type": "address" + }, + { + "internalType": "string", + "name": "metadataUri", + "type": "string" + }, + { + "internalType": "string", + "name": "metadataHash", + "type": "string" + }, + { + "internalType": "bool", + "name": "voided", + "type": "bool" + } + ], + "internalType": "struct BosonTypes.Offer", + "name": "_offer", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "validFrom", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "validUntil", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "voucherRedeemableFrom", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "voucherRedeemableUntil", + "type": "uint256" + } + ], + "internalType": "struct BosonTypes.OfferDates", + "name": "_offerDates", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "disputePeriod", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "voucherValid", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "resolutionPeriod", + "type": "uint256" + } + ], + "internalType": "struct BosonTypes.OfferDurations", + "name": "_offerDurations", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "_disputeResolverId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_reservedRangeLength", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sellerId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "supplyAvailable", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "tokenAddress", + "type": "address" + }, + { + "internalType": "enum BosonTypes.TokenType", + "name": "tokenType", + "type": "uint8" + } + ], + "internalType": "struct BosonTypes.Twin", + "name": "_twin", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "_agentId", + "type": "uint256" + } + ], + "name": "createPremintedOfferAndTwinWithBundle", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sellerId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "price", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sellerDeposit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "buyerCancelPenalty", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "quantityAvailable", + "type": "uint256" + }, + { + "internalType": "address", + "name": "exchangeToken", + "type": "address" + }, + { + "internalType": "string", + "name": "metadataUri", + "type": "string" + }, + { + "internalType": "string", + "name": "metadataHash", + "type": "string" + }, + { + "internalType": "bool", + "name": "voided", + "type": "bool" + } + ], + "internalType": "struct BosonTypes.Offer", + "name": "_offer", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "validFrom", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "validUntil", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "voucherRedeemableFrom", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "voucherRedeemableUntil", + "type": "uint256" + } + ], + "internalType": "struct BosonTypes.OfferDates", + "name": "_offerDates", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "disputePeriod", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "voucherValid", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "resolutionPeriod", + "type": "uint256" + } + ], + "internalType": "struct BosonTypes.OfferDurations", + "name": "_offerDurations", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "_disputeResolverId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_reservedRangeLength", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "enum BosonTypes.EvaluationMethod", + "name": "method", + "type": "uint8" + }, + { + "internalType": "enum BosonTypes.TokenType", + "name": "tokenType", + "type": "uint8" + }, + { + "internalType": "address", + "name": "tokenAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "threshold", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxCommits", + "type": "uint256" + } + ], + "internalType": "struct BosonTypes.Condition", + "name": "_condition", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "_agentId", + "type": "uint256" + } + ], + "name": "createPremintedOfferWithCondition", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sellerId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "price", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sellerDeposit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "buyerCancelPenalty", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "quantityAvailable", + "type": "uint256" + }, + { + "internalType": "address", + "name": "exchangeToken", + "type": "address" + }, + { + "internalType": "string", + "name": "metadataUri", + "type": "string" + }, + { + "internalType": "string", + "name": "metadataHash", + "type": "string" + }, + { + "internalType": "bool", + "name": "voided", + "type": "bool" + } + ], + "internalType": "struct BosonTypes.Offer", + "name": "_offer", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "validFrom", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "validUntil", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "voucherRedeemableFrom", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "voucherRedeemableUntil", + "type": "uint256" + } + ], + "internalType": "struct BosonTypes.OfferDates", + "name": "_offerDates", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "disputePeriod", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "voucherValid", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "resolutionPeriod", + "type": "uint256" + } + ], + "internalType": "struct BosonTypes.OfferDurations", + "name": "_offerDurations", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "_disputeResolverId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_reservedRangeLength", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "enum BosonTypes.EvaluationMethod", + "name": "method", + "type": "uint8" + }, + { + "internalType": "enum BosonTypes.TokenType", + "name": "tokenType", + "type": "uint8" + }, + { + "internalType": "address", + "name": "tokenAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "threshold", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxCommits", + "type": "uint256" + } + ], + "internalType": "struct BosonTypes.Condition", + "name": "_condition", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sellerId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "supplyAvailable", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "tokenAddress", + "type": "address" + }, + { + "internalType": "enum BosonTypes.TokenType", + "name": "tokenType", + "type": "uint8" + } + ], + "internalType": "struct BosonTypes.Twin", + "name": "_twin", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "_agentId", + "type": "uint256" + } + ], + "name": "createPremintedOfferWithConditionAndTwinAndBundle", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "internalType": "address", + "name": "admin", + "type": "address" + }, + { + "internalType": "address", + "name": "clerk", + "type": "address" + }, + { + "internalType": "address payable", + "name": "treasury", + "type": "address" + }, + { + "internalType": "bool", + "name": "active", + "type": "bool" + } + ], + "internalType": "struct BosonTypes.Seller", + "name": "_seller", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sellerId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "price", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sellerDeposit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "buyerCancelPenalty", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "quantityAvailable", + "type": "uint256" + }, + { + "internalType": "address", + "name": "exchangeToken", + "type": "address" + }, + { + "internalType": "string", + "name": "metadataUri", + "type": "string" + }, + { + "internalType": "string", + "name": "metadataHash", + "type": "string" + }, + { + "internalType": "bool", + "name": "voided", + "type": "bool" + } + ], + "internalType": "struct BosonTypes.Offer", + "name": "_offer", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "validFrom", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "validUntil", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "voucherRedeemableFrom", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "voucherRedeemableUntil", + "type": "uint256" + } + ], + "internalType": "struct BosonTypes.OfferDates", + "name": "_offerDates", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "disputePeriod", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "voucherValid", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "resolutionPeriod", + "type": "uint256" + } + ], + "internalType": "struct BosonTypes.OfferDurations", + "name": "_offerDurations", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "_disputeResolverId", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "enum BosonTypes.AuthTokenType", + "name": "tokenType", + "type": "uint8" + } + ], + "internalType": "struct BosonTypes.AuthToken", + "name": "_authToken", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "string", + "name": "contractURI", + "type": "string" + }, + { + "internalType": "uint256", + "name": "royaltyPercentage", + "type": "uint256" + } + ], + "internalType": "struct BosonTypes.VoucherInitValues", + "name": "_voucherInitValues", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "_agentId", + "type": "uint256" + } + ], + "name": "createSellerAndOffer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "internalType": "address", + "name": "admin", + "type": "address" + }, + { + "internalType": "address", + "name": "clerk", + "type": "address" + }, + { + "internalType": "address payable", + "name": "treasury", + "type": "address" + }, + { + "internalType": "bool", + "name": "active", + "type": "bool" + } + ], + "internalType": "struct BosonTypes.Seller", + "name": "_seller", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sellerId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "price", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sellerDeposit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "buyerCancelPenalty", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "quantityAvailable", + "type": "uint256" + }, + { + "internalType": "address", + "name": "exchangeToken", + "type": "address" + }, + { + "internalType": "string", + "name": "metadataUri", + "type": "string" + }, + { + "internalType": "string", + "name": "metadataHash", + "type": "string" + }, + { + "internalType": "bool", + "name": "voided", + "type": "bool" + } + ], + "internalType": "struct BosonTypes.Offer", + "name": "_offer", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "validFrom", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "validUntil", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "voucherRedeemableFrom", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "voucherRedeemableUntil", + "type": "uint256" + } + ], + "internalType": "struct BosonTypes.OfferDates", + "name": "_offerDates", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "disputePeriod", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "voucherValid", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "resolutionPeriod", + "type": "uint256" + } + ], + "internalType": "struct BosonTypes.OfferDurations", + "name": "_offerDurations", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "_disputeResolverId", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sellerId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "supplyAvailable", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "tokenAddress", + "type": "address" + }, + { + "internalType": "enum BosonTypes.TokenType", + "name": "tokenType", + "type": "uint8" + } + ], + "internalType": "struct BosonTypes.Twin", + "name": "_twin", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "enum BosonTypes.AuthTokenType", + "name": "tokenType", + "type": "uint8" + } + ], + "internalType": "struct BosonTypes.AuthToken", + "name": "_authToken", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "string", + "name": "contractURI", + "type": "string" + }, + { + "internalType": "uint256", + "name": "royaltyPercentage", + "type": "uint256" + } + ], + "internalType": "struct BosonTypes.VoucherInitValues", + "name": "_voucherInitValues", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "_agentId", + "type": "uint256" + } + ], + "name": "createSellerAndOfferAndTwinWithBundle", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "internalType": "address", + "name": "admin", + "type": "address" + }, + { + "internalType": "address", + "name": "clerk", + "type": "address" + }, + { + "internalType": "address payable", + "name": "treasury", + "type": "address" + }, + { + "internalType": "bool", + "name": "active", + "type": "bool" + } + ], + "internalType": "struct BosonTypes.Seller", + "name": "_seller", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sellerId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "price", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sellerDeposit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "buyerCancelPenalty", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "quantityAvailable", + "type": "uint256" + }, + { + "internalType": "address", + "name": "exchangeToken", + "type": "address" + }, + { + "internalType": "string", + "name": "metadataUri", + "type": "string" + }, + { + "internalType": "string", + "name": "metadataHash", + "type": "string" + }, + { + "internalType": "bool", + "name": "voided", + "type": "bool" + } + ], + "internalType": "struct BosonTypes.Offer", + "name": "_offer", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "validFrom", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "validUntil", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "voucherRedeemableFrom", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "voucherRedeemableUntil", + "type": "uint256" + } + ], + "internalType": "struct BosonTypes.OfferDates", + "name": "_offerDates", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "disputePeriod", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "voucherValid", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "resolutionPeriod", + "type": "uint256" + } + ], + "internalType": "struct BosonTypes.OfferDurations", + "name": "_offerDurations", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "_disputeResolverId", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "enum BosonTypes.EvaluationMethod", + "name": "method", + "type": "uint8" + }, + { + "internalType": "enum BosonTypes.TokenType", + "name": "tokenType", + "type": "uint8" + }, + { + "internalType": "address", + "name": "tokenAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "threshold", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxCommits", + "type": "uint256" + } + ], + "internalType": "struct BosonTypes.Condition", + "name": "_condition", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "enum BosonTypes.AuthTokenType", + "name": "tokenType", + "type": "uint8" + } + ], + "internalType": "struct BosonTypes.AuthToken", + "name": "_authToken", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "string", + "name": "contractURI", + "type": "string" + }, + { + "internalType": "uint256", + "name": "royaltyPercentage", + "type": "uint256" + } + ], + "internalType": "struct BosonTypes.VoucherInitValues", + "name": "_voucherInitValues", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "_agentId", + "type": "uint256" + } + ], + "name": "createSellerAndOfferWithCondition", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "internalType": "address", + "name": "admin", + "type": "address" + }, + { + "internalType": "address", + "name": "clerk", + "type": "address" + }, + { + "internalType": "address payable", + "name": "treasury", + "type": "address" + }, + { + "internalType": "bool", + "name": "active", + "type": "bool" + } + ], + "internalType": "struct BosonTypes.Seller", + "name": "_seller", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sellerId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "price", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sellerDeposit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "buyerCancelPenalty", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "quantityAvailable", + "type": "uint256" + }, + { + "internalType": "address", + "name": "exchangeToken", + "type": "address" + }, + { + "internalType": "string", + "name": "metadataUri", + "type": "string" + }, + { + "internalType": "string", + "name": "metadataHash", + "type": "string" + }, + { + "internalType": "bool", + "name": "voided", + "type": "bool" + } + ], + "internalType": "struct BosonTypes.Offer", + "name": "_offer", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "validFrom", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "validUntil", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "voucherRedeemableFrom", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "voucherRedeemableUntil", + "type": "uint256" + } + ], + "internalType": "struct BosonTypes.OfferDates", + "name": "_offerDates", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "disputePeriod", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "voucherValid", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "resolutionPeriod", + "type": "uint256" + } + ], + "internalType": "struct BosonTypes.OfferDurations", + "name": "_offerDurations", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "_disputeResolverId", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "enum BosonTypes.EvaluationMethod", + "name": "method", + "type": "uint8" + }, + { + "internalType": "enum BosonTypes.TokenType", + "name": "tokenType", + "type": "uint8" + }, + { + "internalType": "address", + "name": "tokenAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "threshold", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxCommits", + "type": "uint256" + } + ], + "internalType": "struct BosonTypes.Condition", + "name": "_condition", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sellerId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "supplyAvailable", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "tokenAddress", + "type": "address" + }, + { + "internalType": "enum BosonTypes.TokenType", + "name": "tokenType", + "type": "uint8" + } + ], + "internalType": "struct BosonTypes.Twin", + "name": "_twin", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "enum BosonTypes.AuthTokenType", + "name": "tokenType", + "type": "uint8" + } + ], + "internalType": "struct BosonTypes.AuthToken", + "name": "_authToken", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "string", + "name": "contractURI", + "type": "string" + }, + { + "internalType": "uint256", + "name": "royaltyPercentage", + "type": "uint256" + } + ], + "internalType": "struct BosonTypes.VoucherInitValues", + "name": "_voucherInitValues", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "_agentId", + "type": "uint256" + } + ], + "name": "createSellerAndOfferWithConditionAndTwinAndBundle", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "internalType": "address", + "name": "admin", + "type": "address" + }, + { + "internalType": "address", + "name": "clerk", + "type": "address" + }, { "internalType": "address payable", "name": "treasury", @@ -2523,6 +3968,11 @@ "name": "_disputeResolverId", "type": "uint256" }, + { + "internalType": "uint256", + "name": "_reservedRangeLength", + "type": "uint256" + }, { "components": [ { @@ -2563,7 +4013,7 @@ "type": "uint256" } ], - "name": "createSellerAndOffer", + "name": "createSellerAndPremintedOffer", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -2718,6 +4168,11 @@ "name": "_disputeResolverId", "type": "uint256" }, + { + "internalType": "uint256", + "name": "_reservedRangeLength", + "type": "uint256" + }, { "components": [ { @@ -2800,7 +4255,7 @@ "type": "uint256" } ], - "name": "createSellerAndOfferAndTwinWithBundle", + "name": "createSellerAndPremintedOfferAndTwinWithBundle", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -2955,6 +4410,11 @@ "name": "_disputeResolverId", "type": "uint256" }, + { + "internalType": "uint256", + "name": "_reservedRangeLength", + "type": "uint256" + }, { "components": [ { @@ -3032,7 +4492,7 @@ "type": "uint256" } ], - "name": "createSellerAndOfferWithCondition", + "name": "createSellerAndPremintedOfferWithCondition", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -3187,6 +4647,11 @@ "name": "_disputeResolverId", "type": "uint256" }, + { + "internalType": "uint256", + "name": "_reservedRangeLength", + "type": "uint256" + }, { "components": [ { @@ -3306,9 +4771,22 @@ "type": "uint256" } ], - "name": "createSellerAndOfferWithConditionAndTwinAndBundle", + "name": "createSellerAndPremintedOfferWithConditionAndTwinAndBundle", "outputs": [], "stateMutability": "nonpayable", "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_exchangeId", + "type": "uint256" + } + ], + "name": "raiseAndEscalateDispute", + "outputs": [], + "stateMutability": "payable", + "type": "function" } ] diff --git a/packages/common/src/abis/IBosonVoucher.json b/packages/common/src/abis/IBosonVoucher.json index 3d3372be3..2edfc2af8 100644 --- a/packages/common/src/abis/IBosonVoucher.json +++ b/packages/common/src/abis/IBosonVoucher.json @@ -62,6 +62,52 @@ "name": "ContractURIChanged", "type": "event" }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "offerId", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "offerId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "start", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "length", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minted", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lastBurnedTokenId", + "type": "uint256" + } + ], + "indexed": false, + "internalType": "struct IBosonVoucher.Range", + "name": "range", + "type": "tuple" + } + ], + "name": "RangeReserved", + "type": "event" + }, { "anonymous": false, "inputs": [ @@ -162,6 +208,19 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_offerId", + "type": "uint256" + } + ], + "name": "burnPremintedVouchers", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { @@ -207,6 +266,71 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_offerId", + "type": "uint256" + } + ], + "name": "getAvailablePreMints", + "outputs": [ + { + "internalType": "uint256", + "name": "count", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_offerId", + "type": "uint256" + } + ], + "name": "getRangeByOfferId", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "offerId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "start", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "length", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minted", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lastBurnedTokenId", + "type": "uint256" + } + ], + "internalType": "struct IBosonVoucher.Range", + "name": "range", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "getRoyaltyPercentage", @@ -307,6 +431,47 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_offerId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "preMint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_offerId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_start", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_length", + "type": "uint256" + } + ], + "name": "reserveRange", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { diff --git a/packages/common/src/configs.ts b/packages/common/src/configs.ts index 83852802f..b71be7b54 100644 --- a/packages/common/src/configs.ts +++ b/packages/common/src/configs.ts @@ -116,8 +116,8 @@ export const defaultConfigs: ProtocolConfig[] = [ theGraphIpfsUrl: "https://api.thegraph.com/ipfs/api/v0", ipfsMetadataUrl: "https://ipfs.infura.io:5001", contracts: { - // from https://github.com/bosonprotocol/boson-protocol-contracts/commit/8be49ba4ff83e80542e4a89bf674b0799f1ee913 - protocolDiamond: "0x5099CA7839e1580bD0C12FC5FECfA45147886BeB" + // from https://github.com/bosonprotocol/boson-protocol-contracts/commit/38c7ba384e55486aee4ea76bb80b4f29d1a86175 + protocolDiamond: "0xf9719c7e641964D83cC50ea2d4d0D4e6C300d50E" }, metaTx: { relayerUrl: "https://api.biconomy.io" @@ -158,16 +158,16 @@ export const defaultConfigs: ProtocolConfig[] = [ theGraphIpfsUrl: "http://127.0.0.1:5001", ipfsMetadataUrl: "http://127.0.0.1:5001", contracts: { - protocolDiamond: "0x2279B7A0a67DB372996a5FaB50D91eAA73d2eBe6", - testErc20: "0xb7278A61aa25c888815aFC32Ad3cC52fF24fE575", // Foreign20 contract - testErc721: "0xCD8a1C3ba11CF5ECfa6267617243239504a98d90", // Foreign721 contract - testErc1155: "0x82e01223d51Eb87e16A03E24687EDF0F294da6f1" // Foreign1155 contract + protocolDiamond: "0xDc64a140Aa3E981100a9becA4E685f962f0cF6C9", + testErc20: "0x95401dc811bb5740090279Ba06cfA8fcF6113778", // Foreign20 contract + testErc721: "0x998abeb3E57409262aE5b751f60747921B33613E", // Foreign721 contract + testErc1155: "0x70e0bA845a1A0F2DA3359C97E0285013525FFC49" // Foreign1155 contract }, metaTx: { relayerUrl: "http://localhost:8888" }, lens: { - LENS_HUB_CONTRACT: "0x2bdCC0de6bE1f7D2ee689a0342D76F52E8EFABa3", + LENS_HUB_CONTRACT: "0x851356ae760d987E095750cCeb3bC6014560891C", // see contracts/protocol-contracts/scripts/config -> LENS -> localhost LENS_PERIPHERY_CONTRACT: "0x0000000000000000000000000000000000000000" } } diff --git a/packages/core-sdk/src/accounts/handler.ts b/packages/core-sdk/src/accounts/handler.ts index fadd743b0..5508683cd 100644 --- a/packages/core-sdk/src/accounts/handler.ts +++ b/packages/core-sdk/src/accounts/handler.ts @@ -9,7 +9,6 @@ import { encodeCreateSeller, encodeUpdateSeller, encodeCreateDisputeResolver, - encodeActivateDisputeResolver, encodeAddFeesToDisputeResolver, encodeAddSellersToAllowList, encodeRemoveFeesFromDisputeResolver, @@ -76,17 +75,6 @@ export async function createDisputeResolver(args: { }); } -export async function activateDisputeResolver(args: { - disputeResolverId: BigNumberish; - contractAddress: string; - web3Lib: Web3LibAdapter; -}) { - return args.web3Lib.sendTransaction({ - to: args.contractAddress, - data: encodeActivateDisputeResolver(args.disputeResolverId) - }); -} - export async function addFeesToDisputeResolver(args: { disputeResolverId: BigNumberish; fees: DisputeResolutionFee[]; diff --git a/packages/core-sdk/src/accounts/interface.ts b/packages/core-sdk/src/accounts/interface.ts index 723ce9242..6c82a4c2d 100644 --- a/packages/core-sdk/src/accounts/interface.ts +++ b/packages/core-sdk/src/accounts/interface.ts @@ -61,13 +61,6 @@ export function encodeCreateDisputeResolver(args: CreateDisputeResolverArgs) { ]); } -export function encodeActivateDisputeResolver(disputeResolverId: BigNumberish) { - return bosonAccountHandlerIface.encodeFunctionData( - "activateDisputeResolver", - [disputeResolverId] - ); -} - export function encodeAddFeesToDisputeResolver(args: { disputeResolverId: BigNumberish; fees: DisputeResolutionFee[]; diff --git a/packages/core-sdk/src/accounts/mixin.ts b/packages/core-sdk/src/accounts/mixin.ts index 930968d93..b011ee43b 100644 --- a/packages/core-sdk/src/accounts/mixin.ts +++ b/packages/core-sdk/src/accounts/mixin.ts @@ -493,22 +493,6 @@ export class AccountsMixin extends BaseCoreSDK { }); } - /** - * Activates a dispute resolver account by calling the `AccountHandlerFacet` contract. - * Note, that the caller needs to have the ADMIN role. - * @param disputeResolverId - Id of dispute resolver to activate. - * @returns Transaction response. - */ - public async activateDisputeResolver( - disputeResolverId: BigNumberish - ): Promise { - return accounts.handler.activateDisputeResolver({ - disputeResolverId, - contractAddress: this._protocolDiamond, - web3Lib: this._web3Lib - }); - } - /** * Adds fees to a dispute resolver account by calling the `AccountHandlerFacet` * contract. Note, that the caller must be the specified `admin` address of the dispute diff --git a/packages/core-sdk/src/erc721/handler.ts b/packages/core-sdk/src/erc721/handler.ts index c268ba63c..f134b1001 100644 --- a/packages/core-sdk/src/erc721/handler.ts +++ b/packages/core-sdk/src/erc721/handler.ts @@ -7,9 +7,11 @@ export async function balanceOf(args: { owner: string; web3Lib: Web3LibAdapter; }): Promise { + const data = erc721Iface.encodeFunctionData("balanceOf", [args.owner]); + const result = await args.web3Lib.call({ to: args.contractAddress, - data: erc721Iface.encodeFunctionData("balanceOf", [args.owner]) + data: data }); const [balance] = erc721Iface.decodeFunctionResult("balanceOf", result); diff --git a/packages/ethers-sdk/src/contracts/ERC1155.ts b/packages/ethers-sdk/src/contracts/ERC1155.ts new file mode 100644 index 000000000..dcea0f445 --- /dev/null +++ b/packages/ethers-sdk/src/contracts/ERC1155.ts @@ -0,0 +1,443 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import { + BaseContract, + BigNumber, + BigNumberish, + BytesLike, + CallOverrides, + ContractTransaction, + Overrides, + PopulatedTransaction, + Signer, + utils, +} from "ethers"; +import { FunctionFragment, Result, EventFragment } from "@ethersproject/abi"; +import { Listener, Provider } from "@ethersproject/providers"; +import { TypedEventFilter, TypedEvent, TypedListener, OnEvent } from "./common"; + +export interface ERC1155Interface extends utils.Interface { + contractName: "ERC1155"; + functions: { + "balanceOf(address,uint256)": FunctionFragment; + "balanceOfBatch(address[],uint256[])": FunctionFragment; + "isApprovedForAll(address,address)": FunctionFragment; + "safeBatchTransferFrom(address,address,uint256[],uint256[],bytes)": FunctionFragment; + "safeTransferFrom(address,address,uint256,uint256,bytes)": FunctionFragment; + "setApprovalForAll(address,bool)": FunctionFragment; + "supportsInterface(bytes4)": FunctionFragment; + }; + + encodeFunctionData( + functionFragment: "balanceOf", + values: [string, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "balanceOfBatch", + values: [string[], BigNumberish[]] + ): string; + encodeFunctionData( + functionFragment: "isApprovedForAll", + values: [string, string] + ): string; + encodeFunctionData( + functionFragment: "safeBatchTransferFrom", + values: [string, string, BigNumberish[], BigNumberish[], BytesLike] + ): string; + encodeFunctionData( + functionFragment: "safeTransferFrom", + values: [string, string, BigNumberish, BigNumberish, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "setApprovalForAll", + values: [string, boolean] + ): string; + encodeFunctionData( + functionFragment: "supportsInterface", + values: [BytesLike] + ): string; + + decodeFunctionResult(functionFragment: "balanceOf", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "balanceOfBatch", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "isApprovedForAll", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "safeBatchTransferFrom", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "safeTransferFrom", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setApprovalForAll", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "supportsInterface", + data: BytesLike + ): Result; + + events: { + "ApprovalForAll(address,address,bool)": EventFragment; + "TransferBatch(address,address,address,uint256[],uint256[])": EventFragment; + "TransferSingle(address,address,address,uint256,uint256)": EventFragment; + }; + + getEvent(nameOrSignatureOrTopic: "ApprovalForAll"): EventFragment; + getEvent(nameOrSignatureOrTopic: "TransferBatch"): EventFragment; + getEvent(nameOrSignatureOrTopic: "TransferSingle"): EventFragment; +} + +export type ApprovalForAllEvent = TypedEvent< + [string, string, boolean], + { _owner: string; _operator: string; _approved: boolean } +>; + +export type ApprovalForAllEventFilter = TypedEventFilter; + +export type TransferBatchEvent = TypedEvent< + [string, string, string, BigNumber[], BigNumber[]], + { + _operator: string; + _from: string; + _to: string; + _ids: BigNumber[]; + _amounts: BigNumber[]; + } +>; + +export type TransferBatchEventFilter = TypedEventFilter; + +export type TransferSingleEvent = TypedEvent< + [string, string, string, BigNumber, BigNumber], + { + _operator: string; + _from: string; + _to: string; + _id: BigNumber; + _amount: BigNumber; + } +>; + +export type TransferSingleEventFilter = TypedEventFilter; + +export interface ERC1155 extends BaseContract { + contractName: "ERC1155"; + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + interface: ERC1155Interface; + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>; + + listeners( + eventFilter?: TypedEventFilter + ): Array>; + listeners(eventName?: string): Array; + removeAllListeners( + eventFilter: TypedEventFilter + ): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + + functions: { + balanceOf( + _owner: string, + _id: BigNumberish, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + balanceOfBatch( + _owners: string[], + _ids: BigNumberish[], + overrides?: CallOverrides + ): Promise<[BigNumber[]]>; + + isApprovedForAll( + _owner: string, + _operator: string, + overrides?: CallOverrides + ): Promise<[boolean] & { isOperator: boolean }>; + + safeBatchTransferFrom( + _from: string, + _to: string, + _ids: BigNumberish[], + _amounts: BigNumberish[], + _data: BytesLike, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + safeTransferFrom( + _from: string, + _to: string, + _id: BigNumberish, + _amount: BigNumberish, + _data: BytesLike, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + setApprovalForAll( + _operator: string, + _approved: boolean, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + supportsInterface( + _interfaceID: BytesLike, + overrides?: CallOverrides + ): Promise<[boolean]>; + }; + + balanceOf( + _owner: string, + _id: BigNumberish, + overrides?: CallOverrides + ): Promise; + + balanceOfBatch( + _owners: string[], + _ids: BigNumberish[], + overrides?: CallOverrides + ): Promise; + + isApprovedForAll( + _owner: string, + _operator: string, + overrides?: CallOverrides + ): Promise; + + safeBatchTransferFrom( + _from: string, + _to: string, + _ids: BigNumberish[], + _amounts: BigNumberish[], + _data: BytesLike, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + safeTransferFrom( + _from: string, + _to: string, + _id: BigNumberish, + _amount: BigNumberish, + _data: BytesLike, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + setApprovalForAll( + _operator: string, + _approved: boolean, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + supportsInterface( + _interfaceID: BytesLike, + overrides?: CallOverrides + ): Promise; + + callStatic: { + balanceOf( + _owner: string, + _id: BigNumberish, + overrides?: CallOverrides + ): Promise; + + balanceOfBatch( + _owners: string[], + _ids: BigNumberish[], + overrides?: CallOverrides + ): Promise; + + isApprovedForAll( + _owner: string, + _operator: string, + overrides?: CallOverrides + ): Promise; + + safeBatchTransferFrom( + _from: string, + _to: string, + _ids: BigNumberish[], + _amounts: BigNumberish[], + _data: BytesLike, + overrides?: CallOverrides + ): Promise; + + safeTransferFrom( + _from: string, + _to: string, + _id: BigNumberish, + _amount: BigNumberish, + _data: BytesLike, + overrides?: CallOverrides + ): Promise; + + setApprovalForAll( + _operator: string, + _approved: boolean, + overrides?: CallOverrides + ): Promise; + + supportsInterface( + _interfaceID: BytesLike, + overrides?: CallOverrides + ): Promise; + }; + + filters: { + "ApprovalForAll(address,address,bool)"( + _owner?: string | null, + _operator?: string | null, + _approved?: null + ): ApprovalForAllEventFilter; + ApprovalForAll( + _owner?: string | null, + _operator?: string | null, + _approved?: null + ): ApprovalForAllEventFilter; + + "TransferBatch(address,address,address,uint256[],uint256[])"( + _operator?: string | null, + _from?: string | null, + _to?: string | null, + _ids?: null, + _amounts?: null + ): TransferBatchEventFilter; + TransferBatch( + _operator?: string | null, + _from?: string | null, + _to?: string | null, + _ids?: null, + _amounts?: null + ): TransferBatchEventFilter; + + "TransferSingle(address,address,address,uint256,uint256)"( + _operator?: string | null, + _from?: string | null, + _to?: string | null, + _id?: null, + _amount?: null + ): TransferSingleEventFilter; + TransferSingle( + _operator?: string | null, + _from?: string | null, + _to?: string | null, + _id?: null, + _amount?: null + ): TransferSingleEventFilter; + }; + + estimateGas: { + balanceOf( + _owner: string, + _id: BigNumberish, + overrides?: CallOverrides + ): Promise; + + balanceOfBatch( + _owners: string[], + _ids: BigNumberish[], + overrides?: CallOverrides + ): Promise; + + isApprovedForAll( + _owner: string, + _operator: string, + overrides?: CallOverrides + ): Promise; + + safeBatchTransferFrom( + _from: string, + _to: string, + _ids: BigNumberish[], + _amounts: BigNumberish[], + _data: BytesLike, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + safeTransferFrom( + _from: string, + _to: string, + _id: BigNumberish, + _amount: BigNumberish, + _data: BytesLike, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + setApprovalForAll( + _operator: string, + _approved: boolean, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + supportsInterface( + _interfaceID: BytesLike, + overrides?: CallOverrides + ): Promise; + }; + + populateTransaction: { + balanceOf( + _owner: string, + _id: BigNumberish, + overrides?: CallOverrides + ): Promise; + + balanceOfBatch( + _owners: string[], + _ids: BigNumberish[], + overrides?: CallOverrides + ): Promise; + + isApprovedForAll( + _owner: string, + _operator: string, + overrides?: CallOverrides + ): Promise; + + safeBatchTransferFrom( + _from: string, + _to: string, + _ids: BigNumberish[], + _amounts: BigNumberish[], + _data: BytesLike, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + safeTransferFrom( + _from: string, + _to: string, + _id: BigNumberish, + _amount: BigNumberish, + _data: BytesLike, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + setApprovalForAll( + _operator: string, + _approved: boolean, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + supportsInterface( + _interfaceID: BytesLike, + overrides?: CallOverrides + ): Promise; + }; +} diff --git a/packages/ethers-sdk/src/contracts/IBosonAccountHandler.ts b/packages/ethers-sdk/src/contracts/IBosonAccountHandler.ts index 5e1c04740..6ccb1febe 100644 --- a/packages/ethers-sdk/src/contracts/IBosonAccountHandler.ts +++ b/packages/ethers-sdk/src/contracts/IBosonAccountHandler.ts @@ -136,7 +136,6 @@ export declare namespace BosonTypes { export interface IBosonAccountHandlerInterface extends utils.Interface { contractName: "IBosonAccountHandler"; functions: { - "activateDisputeResolver(uint256)": FunctionFragment; "addFeesToDisputeResolver(uint256,(address,string,uint256)[])": FunctionFragment; "addSellersToAllowList(uint256,uint256[])": FunctionFragment; "areSellersAllowed(uint256,uint256[])": FunctionFragment; @@ -152,6 +151,8 @@ export interface IBosonAccountHandlerInterface extends utils.Interface { "getSeller(uint256)": FunctionFragment; "getSellerByAddress(address)": FunctionFragment; "getSellerByAuthToken((uint256,uint8))": FunctionFragment; + "optInToDisputeResolverUpdate(uint256,uint8[])": FunctionFragment; + "optInToSellerUpdate(uint256,uint8[])": FunctionFragment; "removeFeesFromDisputeResolver(uint256,address[])": FunctionFragment; "removeSellersFromAllowList(uint256,uint256[])": FunctionFragment; "updateAgent((uint256,uint256,address,bool))": FunctionFragment; @@ -160,10 +161,6 @@ export interface IBosonAccountHandlerInterface extends utils.Interface { "updateSeller((uint256,address,address,address,address,bool),(uint256,uint8))": FunctionFragment; }; - encodeFunctionData( - functionFragment: "activateDisputeResolver", - values: [BigNumberish] - ): string; encodeFunctionData( functionFragment: "addFeesToDisputeResolver", values: [BigNumberish, BosonTypes.DisputeResolverFeeStruct[]] @@ -232,6 +229,14 @@ export interface IBosonAccountHandlerInterface extends utils.Interface { functionFragment: "getSellerByAuthToken", values: [BosonTypes.AuthTokenStruct] ): string; + encodeFunctionData( + functionFragment: "optInToDisputeResolverUpdate", + values: [BigNumberish, BigNumberish[]] + ): string; + encodeFunctionData( + functionFragment: "optInToSellerUpdate", + values: [BigNumberish, BigNumberish[]] + ): string; encodeFunctionData( functionFragment: "removeFeesFromDisputeResolver", values: [BigNumberish, string[]] @@ -257,10 +262,6 @@ export interface IBosonAccountHandlerInterface extends utils.Interface { values: [BosonTypes.SellerStruct, BosonTypes.AuthTokenStruct] ): string; - decodeFunctionResult( - functionFragment: "activateDisputeResolver", - data: BytesLike - ): Result; decodeFunctionResult( functionFragment: "addFeesToDisputeResolver", data: BytesLike @@ -312,6 +313,14 @@ export interface IBosonAccountHandlerInterface extends utils.Interface { functionFragment: "getSellerByAuthToken", data: BytesLike ): Result; + decodeFunctionResult( + functionFragment: "optInToDisputeResolverUpdate", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "optInToSellerUpdate", + data: BytesLike + ): Result; decodeFunctionResult( functionFragment: "removeFeesFromDisputeResolver", data: BytesLike @@ -348,8 +357,12 @@ export interface IBosonAccountHandlerInterface extends utils.Interface { "DisputeResolverCreated(uint256,tuple,tuple[],uint256[],address)": EventFragment; "DisputeResolverFeesAdded(uint256,tuple[],address)": EventFragment; "DisputeResolverFeesRemoved(uint256,address[],address)": EventFragment; + "DisputeResolverUpdateApplied(uint256,tuple,tuple,address)": EventFragment; + "DisputeResolverUpdatePending(uint256,tuple,address)": EventFragment; "DisputeResolverUpdated(uint256,tuple,address)": EventFragment; "SellerCreated(uint256,tuple,address,tuple,address)": EventFragment; + "SellerUpdateApplied(uint256,tuple,tuple,tuple,tuple,address)": EventFragment; + "SellerUpdatePending(uint256,tuple,tuple,address)": EventFragment; "SellerUpdated(uint256,tuple,tuple,address)": EventFragment; }; @@ -363,8 +376,16 @@ export interface IBosonAccountHandlerInterface extends utils.Interface { getEvent(nameOrSignatureOrTopic: "DisputeResolverCreated"): EventFragment; getEvent(nameOrSignatureOrTopic: "DisputeResolverFeesAdded"): EventFragment; getEvent(nameOrSignatureOrTopic: "DisputeResolverFeesRemoved"): EventFragment; + getEvent( + nameOrSignatureOrTopic: "DisputeResolverUpdateApplied" + ): EventFragment; + getEvent( + nameOrSignatureOrTopic: "DisputeResolverUpdatePending" + ): EventFragment; getEvent(nameOrSignatureOrTopic: "DisputeResolverUpdated"): EventFragment; getEvent(nameOrSignatureOrTopic: "SellerCreated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "SellerUpdateApplied"): EventFragment; + getEvent(nameOrSignatureOrTopic: "SellerUpdatePending"): EventFragment; getEvent(nameOrSignatureOrTopic: "SellerUpdated"): EventFragment; } @@ -492,6 +513,36 @@ export type DisputeResolverFeesRemovedEvent = TypedEvent< export type DisputeResolverFeesRemovedEventFilter = TypedEventFilter; +export type DisputeResolverUpdateAppliedEvent = TypedEvent< + [ + BigNumber, + BosonTypes.DisputeResolverStructOutput, + BosonTypes.DisputeResolverStructOutput, + string + ], + { + disputeResolverId: BigNumber; + disputeResolver: BosonTypes.DisputeResolverStructOutput; + pendingDisputeResolver: BosonTypes.DisputeResolverStructOutput; + executedBy: string; + } +>; + +export type DisputeResolverUpdateAppliedEventFilter = + TypedEventFilter; + +export type DisputeResolverUpdatePendingEvent = TypedEvent< + [BigNumber, BosonTypes.DisputeResolverStructOutput, string], + { + disputeResolverId: BigNumber; + pendingDisputeResolver: BosonTypes.DisputeResolverStructOutput; + executedBy: string; + } +>; + +export type DisputeResolverUpdatePendingEventFilter = + TypedEventFilter; + export type DisputeResolverUpdatedEvent = TypedEvent< [BigNumber, BosonTypes.DisputeResolverStructOutput, string], { @@ -523,6 +574,46 @@ export type SellerCreatedEvent = TypedEvent< export type SellerCreatedEventFilter = TypedEventFilter; +export type SellerUpdateAppliedEvent = TypedEvent< + [ + BigNumber, + BosonTypes.SellerStructOutput, + BosonTypes.SellerStructOutput, + BosonTypes.AuthTokenStructOutput, + BosonTypes.AuthTokenStructOutput, + string + ], + { + sellerId: BigNumber; + seller: BosonTypes.SellerStructOutput; + pendingSeller: BosonTypes.SellerStructOutput; + authToken: BosonTypes.AuthTokenStructOutput; + pendingAuthToken: BosonTypes.AuthTokenStructOutput; + executedBy: string; + } +>; + +export type SellerUpdateAppliedEventFilter = + TypedEventFilter; + +export type SellerUpdatePendingEvent = TypedEvent< + [ + BigNumber, + BosonTypes.SellerStructOutput, + BosonTypes.AuthTokenStructOutput, + string + ], + { + sellerId: BigNumber; + pendingSeller: BosonTypes.SellerStructOutput; + pendingAuthToken: BosonTypes.AuthTokenStructOutput; + executedBy: string; + } +>; + +export type SellerUpdatePendingEventFilter = + TypedEventFilter; + export type SellerUpdatedEvent = TypedEvent< [ BigNumber, @@ -568,11 +659,6 @@ export interface IBosonAccountHandler extends BaseContract { removeListener: OnEvent; functions: { - activateDisputeResolver( - _disputeResolverId: BigNumberish, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - addFeesToDisputeResolver( _disputeResolverId: BigNumberish, _disputeResolverFees: BosonTypes.DisputeResolverFeeStruct[], @@ -718,6 +804,18 @@ export interface IBosonAccountHandler extends BaseContract { } >; + optInToDisputeResolverUpdate( + _disputeResolverId: BigNumberish, + _fieldsToUpdate: BigNumberish[], + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + optInToSellerUpdate( + _sellerId: BigNumberish, + _fieldsToUpdate: BigNumberish[], + overrides?: Overrides & { from?: string | Promise } + ): Promise; + removeFeesFromDisputeResolver( _disputeResolverId: BigNumberish, _feeTokenAddresses: string[], @@ -752,11 +850,6 @@ export interface IBosonAccountHandler extends BaseContract { ): Promise; }; - activateDisputeResolver( - _disputeResolverId: BigNumberish, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - addFeesToDisputeResolver( _disputeResolverId: BigNumberish, _disputeResolverFees: BosonTypes.DisputeResolverFeeStruct[], @@ -900,6 +993,18 @@ export interface IBosonAccountHandler extends BaseContract { } >; + optInToDisputeResolverUpdate( + _disputeResolverId: BigNumberish, + _fieldsToUpdate: BigNumberish[], + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + optInToSellerUpdate( + _sellerId: BigNumberish, + _fieldsToUpdate: BigNumberish[], + overrides?: Overrides & { from?: string | Promise } + ): Promise; + removeFeesFromDisputeResolver( _disputeResolverId: BigNumberish, _feeTokenAddresses: string[], @@ -934,11 +1039,6 @@ export interface IBosonAccountHandler extends BaseContract { ): Promise; callStatic: { - activateDisputeResolver( - _disputeResolverId: BigNumberish, - overrides?: CallOverrides - ): Promise; - addFeesToDisputeResolver( _disputeResolverId: BigNumberish, _disputeResolverFees: BosonTypes.DisputeResolverFeeStruct[], @@ -1082,6 +1182,18 @@ export interface IBosonAccountHandler extends BaseContract { } >; + optInToDisputeResolverUpdate( + _disputeResolverId: BigNumberish, + _fieldsToUpdate: BigNumberish[], + overrides?: CallOverrides + ): Promise; + + optInToSellerUpdate( + _sellerId: BigNumberish, + _fieldsToUpdate: BigNumberish[], + overrides?: CallOverrides + ): Promise; + removeFeesFromDisputeResolver( _disputeResolverId: BigNumberish, _feeTokenAddresses: string[], @@ -1231,6 +1343,30 @@ export interface IBosonAccountHandler extends BaseContract { executedBy?: string | null ): DisputeResolverFeesRemovedEventFilter; + "DisputeResolverUpdateApplied(uint256,tuple,tuple,address)"( + disputeResolverId?: BigNumberish | null, + disputeResolver?: null, + pendingDisputeResolver?: null, + executedBy?: string | null + ): DisputeResolverUpdateAppliedEventFilter; + DisputeResolverUpdateApplied( + disputeResolverId?: BigNumberish | null, + disputeResolver?: null, + pendingDisputeResolver?: null, + executedBy?: string | null + ): DisputeResolverUpdateAppliedEventFilter; + + "DisputeResolverUpdatePending(uint256,tuple,address)"( + disputeResolverId?: BigNumberish | null, + pendingDisputeResolver?: null, + executedBy?: string | null + ): DisputeResolverUpdatePendingEventFilter; + DisputeResolverUpdatePending( + disputeResolverId?: BigNumberish | null, + pendingDisputeResolver?: null, + executedBy?: string | null + ): DisputeResolverUpdatePendingEventFilter; + "DisputeResolverUpdated(uint256,tuple,address)"( disputeResolverId?: BigNumberish | null, disputeResolver?: null, @@ -1257,6 +1393,36 @@ export interface IBosonAccountHandler extends BaseContract { executedBy?: string | null ): SellerCreatedEventFilter; + "SellerUpdateApplied(uint256,tuple,tuple,tuple,tuple,address)"( + sellerId?: BigNumberish | null, + seller?: null, + pendingSeller?: null, + authToken?: null, + pendingAuthToken?: null, + executedBy?: string | null + ): SellerUpdateAppliedEventFilter; + SellerUpdateApplied( + sellerId?: BigNumberish | null, + seller?: null, + pendingSeller?: null, + authToken?: null, + pendingAuthToken?: null, + executedBy?: string | null + ): SellerUpdateAppliedEventFilter; + + "SellerUpdatePending(uint256,tuple,tuple,address)"( + sellerId?: BigNumberish | null, + pendingSeller?: null, + pendingAuthToken?: null, + executedBy?: string | null + ): SellerUpdatePendingEventFilter; + SellerUpdatePending( + sellerId?: BigNumberish | null, + pendingSeller?: null, + pendingAuthToken?: null, + executedBy?: string | null + ): SellerUpdatePendingEventFilter; + "SellerUpdated(uint256,tuple,tuple,address)"( sellerId?: BigNumberish | null, seller?: null, @@ -1272,11 +1438,6 @@ export interface IBosonAccountHandler extends BaseContract { }; estimateGas: { - activateDisputeResolver( - _disputeResolverId: BigNumberish, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - addFeesToDisputeResolver( _disputeResolverId: BigNumberish, _disputeResolverFees: BosonTypes.DisputeResolverFeeStruct[], @@ -1356,6 +1517,18 @@ export interface IBosonAccountHandler extends BaseContract { overrides?: CallOverrides ): Promise; + optInToDisputeResolverUpdate( + _disputeResolverId: BigNumberish, + _fieldsToUpdate: BigNumberish[], + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + optInToSellerUpdate( + _sellerId: BigNumberish, + _fieldsToUpdate: BigNumberish[], + overrides?: Overrides & { from?: string | Promise } + ): Promise; + removeFeesFromDisputeResolver( _disputeResolverId: BigNumberish, _feeTokenAddresses: string[], @@ -1391,11 +1564,6 @@ export interface IBosonAccountHandler extends BaseContract { }; populateTransaction: { - activateDisputeResolver( - _disputeResolverId: BigNumberish, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - addFeesToDisputeResolver( _disputeResolverId: BigNumberish, _disputeResolverFees: BosonTypes.DisputeResolverFeeStruct[], @@ -1475,6 +1643,18 @@ export interface IBosonAccountHandler extends BaseContract { overrides?: CallOverrides ): Promise; + optInToDisputeResolverUpdate( + _disputeResolverId: BigNumberish, + _fieldsToUpdate: BigNumberish[], + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + optInToSellerUpdate( + _sellerId: BigNumberish, + _fieldsToUpdate: BigNumberish[], + overrides?: Overrides & { from?: string | Promise } + ): Promise; + removeFeesFromDisputeResolver( _disputeResolverId: BigNumberish, _feeTokenAddresses: string[], diff --git a/packages/ethers-sdk/src/contracts/IBosonExchangeHandler.ts b/packages/ethers-sdk/src/contracts/IBosonExchangeHandler.ts index 3f9158f15..639a782c2 100644 --- a/packages/ethers-sdk/src/contracts/IBosonExchangeHandler.ts +++ b/packages/ethers-sdk/src/contracts/IBosonExchangeHandler.ts @@ -218,6 +218,7 @@ export interface IBosonExchangeHandlerInterface extends utils.Interface { functions: { "cancelVoucher(uint256)": FunctionFragment; "commitToOffer(address,uint256)": FunctionFragment; + "commitToPreMintedOffer(address,uint256,uint256)": FunctionFragment; "completeExchange(uint256)": FunctionFragment; "completeExchangeBatch(uint256[])": FunctionFragment; "expireVoucher(uint256)": FunctionFragment; @@ -240,6 +241,10 @@ export interface IBosonExchangeHandlerInterface extends utils.Interface { functionFragment: "commitToOffer", values: [string, BigNumberish] ): string; + encodeFunctionData( + functionFragment: "commitToPreMintedOffer", + values: [string, BigNumberish, BigNumberish] + ): string; encodeFunctionData( functionFragment: "completeExchange", values: [BigNumberish] @@ -297,6 +302,10 @@ export interface IBosonExchangeHandlerInterface extends utils.Interface { functionFragment: "commitToOffer", data: BytesLike ): Result; + decodeFunctionResult( + functionFragment: "commitToPreMintedOffer", + data: BytesLike + ): Result; decodeFunctionResult( functionFragment: "completeExchange", data: BytesLike @@ -605,6 +614,13 @@ export interface IBosonExchangeHandler extends BaseContract { overrides?: PayableOverrides & { from?: string | Promise } ): Promise; + commitToPreMintedOffer( + _buyer: string, + _offerId: BigNumberish, + _exchangeId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + completeExchange( _exchangeId: BigNumberish, overrides?: Overrides & { from?: string | Promise } @@ -692,6 +708,13 @@ export interface IBosonExchangeHandler extends BaseContract { overrides?: PayableOverrides & { from?: string | Promise } ): Promise; + commitToPreMintedOffer( + _buyer: string, + _offerId: BigNumberish, + _exchangeId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + completeExchange( _exchangeId: BigNumberish, overrides?: Overrides & { from?: string | Promise } @@ -773,6 +796,13 @@ export interface IBosonExchangeHandler extends BaseContract { overrides?: CallOverrides ): Promise; + commitToPreMintedOffer( + _buyer: string, + _offerId: BigNumberish, + _exchangeId: BigNumberish, + overrides?: CallOverrides + ): Promise; + completeExchange( _exchangeId: BigNumberish, overrides?: CallOverrides @@ -1071,6 +1101,13 @@ export interface IBosonExchangeHandler extends BaseContract { overrides?: PayableOverrides & { from?: string | Promise } ): Promise; + commitToPreMintedOffer( + _buyer: string, + _offerId: BigNumberish, + _exchangeId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + completeExchange( _exchangeId: BigNumberish, overrides?: Overrides & { from?: string | Promise } @@ -1143,6 +1180,13 @@ export interface IBosonExchangeHandler extends BaseContract { overrides?: PayableOverrides & { from?: string | Promise } ): Promise; + commitToPreMintedOffer( + _buyer: string, + _offerId: BigNumberish, + _exchangeId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + completeExchange( _exchangeId: BigNumberish, overrides?: Overrides & { from?: string | Promise } diff --git a/packages/ethers-sdk/src/contracts/IBosonGroupHandler.ts b/packages/ethers-sdk/src/contracts/IBosonGroupHandler.ts new file mode 100644 index 000000000..12ce5cdb3 --- /dev/null +++ b/packages/ethers-sdk/src/contracts/IBosonGroupHandler.ts @@ -0,0 +1,417 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import { + BaseContract, + BigNumber, + BigNumberish, + BytesLike, + CallOverrides, + ContractTransaction, + Overrides, + PopulatedTransaction, + Signer, + utils, +} from "ethers"; +import { FunctionFragment, Result, EventFragment } from "@ethersproject/abi"; +import { Listener, Provider } from "@ethersproject/providers"; +import { TypedEventFilter, TypedEvent, TypedListener, OnEvent } from "./common"; + +export declare namespace BosonTypes { + export type GroupStruct = { + id: BigNumberish; + sellerId: BigNumberish; + offerIds: BigNumberish[]; + }; + + export type GroupStructOutput = [BigNumber, BigNumber, BigNumber[]] & { + id: BigNumber; + sellerId: BigNumber; + offerIds: BigNumber[]; + }; + + export type ConditionStruct = { + method: BigNumberish; + tokenType: BigNumberish; + tokenAddress: string; + tokenId: BigNumberish; + threshold: BigNumberish; + maxCommits: BigNumberish; + }; + + export type ConditionStructOutput = [ + number, + number, + string, + BigNumber, + BigNumber, + BigNumber + ] & { + method: number; + tokenType: number; + tokenAddress: string; + tokenId: BigNumber; + threshold: BigNumber; + maxCommits: BigNumber; + }; +} + +export interface IBosonGroupHandlerInterface extends utils.Interface { + contractName: "IBosonGroupHandler"; + functions: { + "addOffersToGroup(uint256,uint256[])": FunctionFragment; + "createGroup((uint256,uint256,uint256[]),(uint8,uint8,address,uint256,uint256,uint256))": FunctionFragment; + "getGroup(uint256)": FunctionFragment; + "getNextGroupId()": FunctionFragment; + "removeOffersFromGroup(uint256,uint256[])": FunctionFragment; + "setGroupCondition(uint256,(uint8,uint8,address,uint256,uint256,uint256))": FunctionFragment; + }; + + encodeFunctionData( + functionFragment: "addOffersToGroup", + values: [BigNumberish, BigNumberish[]] + ): string; + encodeFunctionData( + functionFragment: "createGroup", + values: [BosonTypes.GroupStruct, BosonTypes.ConditionStruct] + ): string; + encodeFunctionData( + functionFragment: "getGroup", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "getNextGroupId", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "removeOffersFromGroup", + values: [BigNumberish, BigNumberish[]] + ): string; + encodeFunctionData( + functionFragment: "setGroupCondition", + values: [BigNumberish, BosonTypes.ConditionStruct] + ): string; + + decodeFunctionResult( + functionFragment: "addOffersToGroup", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "createGroup", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "getGroup", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "getNextGroupId", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "removeOffersFromGroup", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setGroupCondition", + data: BytesLike + ): Result; + + events: { + "GroupCreated(uint256,uint256,tuple,tuple,address)": EventFragment; + "GroupUpdated(uint256,uint256,tuple,tuple,address)": EventFragment; + }; + + getEvent(nameOrSignatureOrTopic: "GroupCreated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "GroupUpdated"): EventFragment; +} + +export type GroupCreatedEvent = TypedEvent< + [ + BigNumber, + BigNumber, + BosonTypes.GroupStructOutput, + BosonTypes.ConditionStructOutput, + string + ], + { + groupId: BigNumber; + sellerId: BigNumber; + group: BosonTypes.GroupStructOutput; + condition: BosonTypes.ConditionStructOutput; + executedBy: string; + } +>; + +export type GroupCreatedEventFilter = TypedEventFilter; + +export type GroupUpdatedEvent = TypedEvent< + [ + BigNumber, + BigNumber, + BosonTypes.GroupStructOutput, + BosonTypes.ConditionStructOutput, + string + ], + { + groupId: BigNumber; + sellerId: BigNumber; + group: BosonTypes.GroupStructOutput; + condition: BosonTypes.ConditionStructOutput; + executedBy: string; + } +>; + +export type GroupUpdatedEventFilter = TypedEventFilter; + +export interface IBosonGroupHandler extends BaseContract { + contractName: "IBosonGroupHandler"; + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + interface: IBosonGroupHandlerInterface; + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>; + + listeners( + eventFilter?: TypedEventFilter + ): Array>; + listeners(eventName?: string): Array; + removeAllListeners( + eventFilter: TypedEventFilter + ): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + + functions: { + addOffersToGroup( + _groupId: BigNumberish, + _offerIds: BigNumberish[], + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + createGroup( + _group: BosonTypes.GroupStruct, + _condition: BosonTypes.ConditionStruct, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + getGroup( + _groupId: BigNumberish, + overrides?: CallOverrides + ): Promise< + [ + boolean, + BosonTypes.GroupStructOutput, + BosonTypes.ConditionStructOutput + ] & { + exists: boolean; + group: BosonTypes.GroupStructOutput; + condition: BosonTypes.ConditionStructOutput; + } + >; + + getNextGroupId( + overrides?: CallOverrides + ): Promise<[BigNumber] & { nextGroupId: BigNumber }>; + + removeOffersFromGroup( + _groupId: BigNumberish, + _offerIds: BigNumberish[], + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + setGroupCondition( + _groupId: BigNumberish, + _condition: BosonTypes.ConditionStruct, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + }; + + addOffersToGroup( + _groupId: BigNumberish, + _offerIds: BigNumberish[], + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + createGroup( + _group: BosonTypes.GroupStruct, + _condition: BosonTypes.ConditionStruct, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + getGroup( + _groupId: BigNumberish, + overrides?: CallOverrides + ): Promise< + [ + boolean, + BosonTypes.GroupStructOutput, + BosonTypes.ConditionStructOutput + ] & { + exists: boolean; + group: BosonTypes.GroupStructOutput; + condition: BosonTypes.ConditionStructOutput; + } + >; + + getNextGroupId(overrides?: CallOverrides): Promise; + + removeOffersFromGroup( + _groupId: BigNumberish, + _offerIds: BigNumberish[], + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + setGroupCondition( + _groupId: BigNumberish, + _condition: BosonTypes.ConditionStruct, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + callStatic: { + addOffersToGroup( + _groupId: BigNumberish, + _offerIds: BigNumberish[], + overrides?: CallOverrides + ): Promise; + + createGroup( + _group: BosonTypes.GroupStruct, + _condition: BosonTypes.ConditionStruct, + overrides?: CallOverrides + ): Promise; + + getGroup( + _groupId: BigNumberish, + overrides?: CallOverrides + ): Promise< + [ + boolean, + BosonTypes.GroupStructOutput, + BosonTypes.ConditionStructOutput + ] & { + exists: boolean; + group: BosonTypes.GroupStructOutput; + condition: BosonTypes.ConditionStructOutput; + } + >; + + getNextGroupId(overrides?: CallOverrides): Promise; + + removeOffersFromGroup( + _groupId: BigNumberish, + _offerIds: BigNumberish[], + overrides?: CallOverrides + ): Promise; + + setGroupCondition( + _groupId: BigNumberish, + _condition: BosonTypes.ConditionStruct, + overrides?: CallOverrides + ): Promise; + }; + + filters: { + "GroupCreated(uint256,uint256,tuple,tuple,address)"( + groupId?: BigNumberish | null, + sellerId?: BigNumberish | null, + group?: null, + condition?: null, + executedBy?: string | null + ): GroupCreatedEventFilter; + GroupCreated( + groupId?: BigNumberish | null, + sellerId?: BigNumberish | null, + group?: null, + condition?: null, + executedBy?: string | null + ): GroupCreatedEventFilter; + + "GroupUpdated(uint256,uint256,tuple,tuple,address)"( + groupId?: BigNumberish | null, + sellerId?: BigNumberish | null, + group?: null, + condition?: null, + executedBy?: string | null + ): GroupUpdatedEventFilter; + GroupUpdated( + groupId?: BigNumberish | null, + sellerId?: BigNumberish | null, + group?: null, + condition?: null, + executedBy?: string | null + ): GroupUpdatedEventFilter; + }; + + estimateGas: { + addOffersToGroup( + _groupId: BigNumberish, + _offerIds: BigNumberish[], + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + createGroup( + _group: BosonTypes.GroupStruct, + _condition: BosonTypes.ConditionStruct, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + getGroup( + _groupId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getNextGroupId(overrides?: CallOverrides): Promise; + + removeOffersFromGroup( + _groupId: BigNumberish, + _offerIds: BigNumberish[], + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + setGroupCondition( + _groupId: BigNumberish, + _condition: BosonTypes.ConditionStruct, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + }; + + populateTransaction: { + addOffersToGroup( + _groupId: BigNumberish, + _offerIds: BigNumberish[], + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + createGroup( + _group: BosonTypes.GroupStruct, + _condition: BosonTypes.ConditionStruct, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + getGroup( + _groupId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getNextGroupId(overrides?: CallOverrides): Promise; + + removeOffersFromGroup( + _groupId: BigNumberish, + _offerIds: BigNumberish[], + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + setGroupCondition( + _groupId: BigNumberish, + _condition: BosonTypes.ConditionStruct, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + }; +} diff --git a/packages/ethers-sdk/src/contracts/IBosonMetaTransactionsHandler.ts b/packages/ethers-sdk/src/contracts/IBosonMetaTransactionsHandler.ts index 7aa5f0119..cc9c5155a 100644 --- a/packages/ethers-sdk/src/contracts/IBosonMetaTransactionsHandler.ts +++ b/packages/ethers-sdk/src/contracts/IBosonMetaTransactionsHandler.ts @@ -8,6 +8,7 @@ import { BytesLike, CallOverrides, ContractTransaction, + Overrides, PayableOverrides, PopulatedTransaction, Signer, @@ -22,7 +23,9 @@ export interface IBosonMetaTransactionsHandlerInterface contractName: "IBosonMetaTransactionsHandler"; functions: { "executeMetaTransaction(address,string,bytes,uint256,bytes32,bytes32,uint8)": FunctionFragment; + "isFunctionAllowlisted(string)": FunctionFragment; "isUsedNonce(address,uint256)": FunctionFragment; + "setAllowlistedFunctions(bytes32[],bool)": FunctionFragment; }; encodeFunctionData( @@ -37,27 +40,53 @@ export interface IBosonMetaTransactionsHandlerInterface BigNumberish ] ): string; + encodeFunctionData( + functionFragment: "isFunctionAllowlisted", + values: [string] + ): string; encodeFunctionData( functionFragment: "isUsedNonce", values: [string, BigNumberish] ): string; + encodeFunctionData( + functionFragment: "setAllowlistedFunctions", + values: [BytesLike[], boolean] + ): string; decodeFunctionResult( functionFragment: "executeMetaTransaction", data: BytesLike ): Result; + decodeFunctionResult( + functionFragment: "isFunctionAllowlisted", + data: BytesLike + ): Result; decodeFunctionResult( functionFragment: "isUsedNonce", data: BytesLike ): Result; + decodeFunctionResult( + functionFragment: "setAllowlistedFunctions", + data: BytesLike + ): Result; events: { + "FunctionsAllowlisted(bytes32[],bool,address)": EventFragment; "MetaTransactionExecuted(address,address,string,uint256)": EventFragment; }; + getEvent(nameOrSignatureOrTopic: "FunctionsAllowlisted"): EventFragment; getEvent(nameOrSignatureOrTopic: "MetaTransactionExecuted"): EventFragment; } +export type FunctionsAllowlistedEvent = TypedEvent< + [string[], boolean, string], + { functionNameHashes: string[]; isAllowlisted: boolean; executedBy: string } +>; + +export type FunctionsAllowlistedEventFilter = + TypedEventFilter; + export type MetaTransactionExecutedEvent = TypedEvent< [string, string, string, BigNumber], { @@ -110,11 +139,27 @@ export interface IBosonMetaTransactionsHandler extends BaseContract { overrides?: PayableOverrides & { from?: string | Promise } ): Promise; + "isFunctionAllowlisted(string)"( + _functionName: string, + overrides?: CallOverrides + ): Promise<[boolean] & { isAllowlisted: boolean }>; + + "isFunctionAllowlisted(bytes32)"( + _functionNameHash: BytesLike, + overrides?: CallOverrides + ): Promise<[boolean] & { isAllowlisted: boolean }>; + isUsedNonce( _associatedAddress: string, _nonce: BigNumberish, overrides?: CallOverrides ): Promise<[boolean]>; + + setAllowlistedFunctions( + _functionNameHashes: BytesLike[], + _isAllowlisted: boolean, + overrides?: Overrides & { from?: string | Promise } + ): Promise; }; executeMetaTransaction( @@ -128,12 +173,28 @@ export interface IBosonMetaTransactionsHandler extends BaseContract { overrides?: PayableOverrides & { from?: string | Promise } ): Promise; + "isFunctionAllowlisted(string)"( + _functionName: string, + overrides?: CallOverrides + ): Promise; + + "isFunctionAllowlisted(bytes32)"( + _functionNameHash: BytesLike, + overrides?: CallOverrides + ): Promise; + isUsedNonce( _associatedAddress: string, _nonce: BigNumberish, overrides?: CallOverrides ): Promise; + setAllowlistedFunctions( + _functionNameHashes: BytesLike[], + _isAllowlisted: boolean, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + callStatic: { executeMetaTransaction( _userAddress: string, @@ -146,14 +207,41 @@ export interface IBosonMetaTransactionsHandler extends BaseContract { overrides?: CallOverrides ): Promise; + "isFunctionAllowlisted(string)"( + _functionName: string, + overrides?: CallOverrides + ): Promise; + + "isFunctionAllowlisted(bytes32)"( + _functionNameHash: BytesLike, + overrides?: CallOverrides + ): Promise; + isUsedNonce( _associatedAddress: string, _nonce: BigNumberish, overrides?: CallOverrides ): Promise; + + setAllowlistedFunctions( + _functionNameHashes: BytesLike[], + _isAllowlisted: boolean, + overrides?: CallOverrides + ): Promise; }; filters: { + "FunctionsAllowlisted(bytes32[],bool,address)"( + functionNameHashes?: null, + isAllowlisted?: null, + executedBy?: string | null + ): FunctionsAllowlistedEventFilter; + FunctionsAllowlisted( + functionNameHashes?: null, + isAllowlisted?: null, + executedBy?: string | null + ): FunctionsAllowlistedEventFilter; + "MetaTransactionExecuted(address,address,string,uint256)"( userAddress?: string | null, relayerAddress?: string | null, @@ -180,11 +268,27 @@ export interface IBosonMetaTransactionsHandler extends BaseContract { overrides?: PayableOverrides & { from?: string | Promise } ): Promise; + "isFunctionAllowlisted(string)"( + _functionName: string, + overrides?: CallOverrides + ): Promise; + + "isFunctionAllowlisted(bytes32)"( + _functionNameHash: BytesLike, + overrides?: CallOverrides + ): Promise; + isUsedNonce( _associatedAddress: string, _nonce: BigNumberish, overrides?: CallOverrides ): Promise; + + setAllowlistedFunctions( + _functionNameHashes: BytesLike[], + _isAllowlisted: boolean, + overrides?: Overrides & { from?: string | Promise } + ): Promise; }; populateTransaction: { @@ -199,10 +303,26 @@ export interface IBosonMetaTransactionsHandler extends BaseContract { overrides?: PayableOverrides & { from?: string | Promise } ): Promise; + "isFunctionAllowlisted(string)"( + _functionName: string, + overrides?: CallOverrides + ): Promise; + + "isFunctionAllowlisted(bytes32)"( + _functionNameHash: BytesLike, + overrides?: CallOverrides + ): Promise; + isUsedNonce( _associatedAddress: string, _nonce: BigNumberish, overrides?: CallOverrides ): Promise; + + setAllowlistedFunctions( + _functionNameHashes: BytesLike[], + _isAllowlisted: boolean, + overrides?: Overrides & { from?: string | Promise } + ): Promise; }; } diff --git a/packages/ethers-sdk/src/contracts/IBosonOfferHandler.ts b/packages/ethers-sdk/src/contracts/IBosonOfferHandler.ts index bc35cd5a7..c781c5586 100644 --- a/packages/ethers-sdk/src/contracts/IBosonOfferHandler.ts +++ b/packages/ethers-sdk/src/contracts/IBosonOfferHandler.ts @@ -127,6 +127,7 @@ export interface IBosonOfferHandlerInterface extends utils.Interface { "getNextOfferId()": FunctionFragment; "getOffer(uint256)": FunctionFragment; "isOfferVoided(uint256)": FunctionFragment; + "reserveRange(uint256,uint256)": FunctionFragment; "voidOffer(uint256)": FunctionFragment; "voidOfferBatch(uint256[])": FunctionFragment; }; @@ -175,6 +176,10 @@ export interface IBosonOfferHandlerInterface extends utils.Interface { functionFragment: "isOfferVoided", values: [BigNumberish] ): string; + encodeFunctionData( + functionFragment: "reserveRange", + values: [BigNumberish, BigNumberish] + ): string; encodeFunctionData( functionFragment: "voidOffer", values: [BigNumberish] @@ -213,6 +218,10 @@ export interface IBosonOfferHandlerInterface extends utils.Interface { functionFragment: "isOfferVoided", data: BytesLike ): Result; + decodeFunctionResult( + functionFragment: "reserveRange", + data: BytesLike + ): Result; decodeFunctionResult(functionFragment: "voidOffer", data: BytesLike): Result; decodeFunctionResult( functionFragment: "voidOfferBatch", @@ -223,11 +232,13 @@ export interface IBosonOfferHandlerInterface extends utils.Interface { "OfferCreated(uint256,uint256,tuple,tuple,tuple,tuple,tuple,uint256,address)": EventFragment; "OfferExtended(uint256,uint256,uint256,address)": EventFragment; "OfferVoided(uint256,uint256,address)": EventFragment; + "RangeReserved(uint256,uint256,uint256,uint256,address)": EventFragment; }; getEvent(nameOrSignatureOrTopic: "OfferCreated"): EventFragment; getEvent(nameOrSignatureOrTopic: "OfferExtended"): EventFragment; getEvent(nameOrSignatureOrTopic: "OfferVoided"): EventFragment; + getEvent(nameOrSignatureOrTopic: "RangeReserved"): EventFragment; } export type OfferCreatedEvent = TypedEvent< @@ -276,6 +287,19 @@ export type OfferVoidedEvent = TypedEvent< export type OfferVoidedEventFilter = TypedEventFilter; +export type RangeReservedEvent = TypedEvent< + [BigNumber, BigNumber, BigNumber, BigNumber, string], + { + offerId: BigNumber; + sellerId: BigNumber; + startExchangeId: BigNumber; + endExchangeId: BigNumber; + executedBy: string; + } +>; + +export type RangeReservedEventFilter = TypedEventFilter; + export interface IBosonOfferHandler extends BaseContract { contractName: "IBosonOfferHandler"; connect(signerOrProvider: Signer | Provider | string): this; @@ -369,6 +393,12 @@ export interface IBosonOfferHandler extends BaseContract { overrides?: CallOverrides ): Promise<[boolean, boolean] & { exists: boolean; offerVoided: boolean }>; + reserveRange( + _offerId: BigNumberish, + _length: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + voidOffer( _offerId: BigNumberish, overrides?: Overrides & { from?: string | Promise } @@ -443,6 +473,12 @@ export interface IBosonOfferHandler extends BaseContract { overrides?: CallOverrides ): Promise<[boolean, boolean] & { exists: boolean; offerVoided: boolean }>; + reserveRange( + _offerId: BigNumberish, + _length: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + voidOffer( _offerId: BigNumberish, overrides?: Overrides & { from?: string | Promise } @@ -517,6 +553,12 @@ export interface IBosonOfferHandler extends BaseContract { overrides?: CallOverrides ): Promise<[boolean, boolean] & { exists: boolean; offerVoided: boolean }>; + reserveRange( + _offerId: BigNumberish, + _length: BigNumberish, + overrides?: CallOverrides + ): Promise; + voidOffer(_offerId: BigNumberish, overrides?: CallOverrides): Promise; voidOfferBatch( @@ -572,6 +614,21 @@ export interface IBosonOfferHandler extends BaseContract { sellerId?: BigNumberish | null, executedBy?: string | null ): OfferVoidedEventFilter; + + "RangeReserved(uint256,uint256,uint256,uint256,address)"( + offerId?: BigNumberish | null, + sellerId?: BigNumberish | null, + startExchangeId?: null, + endExchangeId?: null, + executedBy?: string | null + ): RangeReservedEventFilter; + RangeReserved( + offerId?: BigNumberish | null, + sellerId?: BigNumberish | null, + startExchangeId?: null, + endExchangeId?: null, + executedBy?: string | null + ): RangeReservedEventFilter; }; estimateGas: { @@ -622,6 +679,12 @@ export interface IBosonOfferHandler extends BaseContract { overrides?: CallOverrides ): Promise; + reserveRange( + _offerId: BigNumberish, + _length: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + voidOffer( _offerId: BigNumberish, overrides?: Overrides & { from?: string | Promise } @@ -681,6 +744,12 @@ export interface IBosonOfferHandler extends BaseContract { overrides?: CallOverrides ): Promise; + reserveRange( + _offerId: BigNumberish, + _length: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + voidOffer( _offerId: BigNumberish, overrides?: Overrides & { from?: string | Promise } diff --git a/packages/ethers-sdk/src/contracts/IBosonOrchestrationHandler.ts b/packages/ethers-sdk/src/contracts/IBosonOrchestrationHandler.ts index 874984425..a2b999b64 100644 --- a/packages/ethers-sdk/src/contracts/IBosonOrchestrationHandler.ts +++ b/packages/ethers-sdk/src/contracts/IBosonOrchestrationHandler.ts @@ -9,6 +9,7 @@ import { CallOverrides, ContractTransaction, Overrides, + PayableOverrides, PopulatedTransaction, Signer, utils, @@ -321,10 +322,19 @@ export interface IBosonOrchestrationHandlerInterface extends utils.Interface { "createOfferAndTwinWithBundle((uint256,uint256,uint256,uint256,uint256,uint256,address,string,string,bool),(uint256,uint256,uint256,uint256),(uint256,uint256,uint256),uint256,(uint256,uint256,uint256,uint256,uint256,address,uint8),uint256)": FunctionFragment; "createOfferWithCondition((uint256,uint256,uint256,uint256,uint256,uint256,address,string,string,bool),(uint256,uint256,uint256,uint256),(uint256,uint256,uint256),uint256,(uint8,uint8,address,uint256,uint256,uint256),uint256)": FunctionFragment; "createOfferWithConditionAndTwinAndBundle((uint256,uint256,uint256,uint256,uint256,uint256,address,string,string,bool),(uint256,uint256,uint256,uint256),(uint256,uint256,uint256),uint256,(uint8,uint8,address,uint256,uint256,uint256),(uint256,uint256,uint256,uint256,uint256,address,uint8),uint256)": FunctionFragment; + "createPremintedOfferAddToGroup((uint256,uint256,uint256,uint256,uint256,uint256,address,string,string,bool),(uint256,uint256,uint256,uint256),(uint256,uint256,uint256),uint256,uint256,uint256,uint256)": FunctionFragment; + "createPremintedOfferAndTwinWithBundle((uint256,uint256,uint256,uint256,uint256,uint256,address,string,string,bool),(uint256,uint256,uint256,uint256),(uint256,uint256,uint256),uint256,uint256,(uint256,uint256,uint256,uint256,uint256,address,uint8),uint256)": FunctionFragment; + "createPremintedOfferWithCondition((uint256,uint256,uint256,uint256,uint256,uint256,address,string,string,bool),(uint256,uint256,uint256,uint256),(uint256,uint256,uint256),uint256,uint256,(uint8,uint8,address,uint256,uint256,uint256),uint256)": FunctionFragment; + "createPremintedOfferWithConditionAndTwinAndBundle((uint256,uint256,uint256,uint256,uint256,uint256,address,string,string,bool),(uint256,uint256,uint256,uint256),(uint256,uint256,uint256),uint256,uint256,(uint8,uint8,address,uint256,uint256,uint256),(uint256,uint256,uint256,uint256,uint256,address,uint8),uint256)": FunctionFragment; "createSellerAndOffer((uint256,address,address,address,address,bool),(uint256,uint256,uint256,uint256,uint256,uint256,address,string,string,bool),(uint256,uint256,uint256,uint256),(uint256,uint256,uint256),uint256,(uint256,uint8),(string,uint256),uint256)": FunctionFragment; "createSellerAndOfferAndTwinWithBundle((uint256,address,address,address,address,bool),(uint256,uint256,uint256,uint256,uint256,uint256,address,string,string,bool),(uint256,uint256,uint256,uint256),(uint256,uint256,uint256),uint256,(uint256,uint256,uint256,uint256,uint256,address,uint8),(uint256,uint8),(string,uint256),uint256)": FunctionFragment; "createSellerAndOfferWithCondition((uint256,address,address,address,address,bool),(uint256,uint256,uint256,uint256,uint256,uint256,address,string,string,bool),(uint256,uint256,uint256,uint256),(uint256,uint256,uint256),uint256,(uint8,uint8,address,uint256,uint256,uint256),(uint256,uint8),(string,uint256),uint256)": FunctionFragment; "createSellerAndOfferWithConditionAndTwinAndBundle((uint256,address,address,address,address,bool),(uint256,uint256,uint256,uint256,uint256,uint256,address,string,string,bool),(uint256,uint256,uint256,uint256),(uint256,uint256,uint256),uint256,(uint8,uint8,address,uint256,uint256,uint256),(uint256,uint256,uint256,uint256,uint256,address,uint8),(uint256,uint8),(string,uint256),uint256)": FunctionFragment; + "createSellerAndPremintedOffer((uint256,address,address,address,address,bool),(uint256,uint256,uint256,uint256,uint256,uint256,address,string,string,bool),(uint256,uint256,uint256,uint256),(uint256,uint256,uint256),uint256,uint256,(uint256,uint8),(string,uint256),uint256)": FunctionFragment; + "createSellerAndPremintedOfferAndTwinWithBundle((uint256,address,address,address,address,bool),(uint256,uint256,uint256,uint256,uint256,uint256,address,string,string,bool),(uint256,uint256,uint256,uint256),(uint256,uint256,uint256),uint256,uint256,(uint256,uint256,uint256,uint256,uint256,address,uint8),(uint256,uint8),(string,uint256),uint256)": FunctionFragment; + "createSellerAndPremintedOfferWithCondition((uint256,address,address,address,address,bool),(uint256,uint256,uint256,uint256,uint256,uint256,address,string,string,bool),(uint256,uint256,uint256,uint256),(uint256,uint256,uint256),uint256,uint256,(uint8,uint8,address,uint256,uint256,uint256),(uint256,uint8),(string,uint256),uint256)": FunctionFragment; + "createSellerAndPremintedOfferWithConditionAndTwinAndBundle((uint256,address,address,address,address,bool),(uint256,uint256,uint256,uint256,uint256,uint256,address,string,string,bool),(uint256,uint256,uint256,uint256),(uint256,uint256,uint256),uint256,uint256,(uint8,uint8,address,uint256,uint256,uint256),(uint256,uint256,uint256,uint256,uint256,address,uint8),(uint256,uint8),(string,uint256),uint256)": FunctionFragment; + "raiseAndEscalateDispute(uint256)": FunctionFragment; }; encodeFunctionData( @@ -372,6 +382,55 @@ export interface IBosonOrchestrationHandlerInterface extends utils.Interface { BigNumberish ] ): string; + encodeFunctionData( + functionFragment: "createPremintedOfferAddToGroup", + values: [ + BosonTypes.OfferStruct, + BosonTypes.OfferDatesStruct, + BosonTypes.OfferDurationsStruct, + BigNumberish, + BigNumberish, + BigNumberish, + BigNumberish + ] + ): string; + encodeFunctionData( + functionFragment: "createPremintedOfferAndTwinWithBundle", + values: [ + BosonTypes.OfferStruct, + BosonTypes.OfferDatesStruct, + BosonTypes.OfferDurationsStruct, + BigNumberish, + BigNumberish, + BosonTypes.TwinStruct, + BigNumberish + ] + ): string; + encodeFunctionData( + functionFragment: "createPremintedOfferWithCondition", + values: [ + BosonTypes.OfferStruct, + BosonTypes.OfferDatesStruct, + BosonTypes.OfferDurationsStruct, + BigNumberish, + BigNumberish, + BosonTypes.ConditionStruct, + BigNumberish + ] + ): string; + encodeFunctionData( + functionFragment: "createPremintedOfferWithConditionAndTwinAndBundle", + values: [ + BosonTypes.OfferStruct, + BosonTypes.OfferDatesStruct, + BosonTypes.OfferDurationsStruct, + BigNumberish, + BigNumberish, + BosonTypes.ConditionStruct, + BosonTypes.TwinStruct, + BigNumberish + ] + ): string; encodeFunctionData( functionFragment: "createSellerAndOffer", values: [ @@ -428,6 +487,70 @@ export interface IBosonOrchestrationHandlerInterface extends utils.Interface { BigNumberish ] ): string; + encodeFunctionData( + functionFragment: "createSellerAndPremintedOffer", + values: [ + BosonTypes.SellerStruct, + BosonTypes.OfferStruct, + BosonTypes.OfferDatesStruct, + BosonTypes.OfferDurationsStruct, + BigNumberish, + BigNumberish, + BosonTypes.AuthTokenStruct, + BosonTypes.VoucherInitValuesStruct, + BigNumberish + ] + ): string; + encodeFunctionData( + functionFragment: "createSellerAndPremintedOfferAndTwinWithBundle", + values: [ + BosonTypes.SellerStruct, + BosonTypes.OfferStruct, + BosonTypes.OfferDatesStruct, + BosonTypes.OfferDurationsStruct, + BigNumberish, + BigNumberish, + BosonTypes.TwinStruct, + BosonTypes.AuthTokenStruct, + BosonTypes.VoucherInitValuesStruct, + BigNumberish + ] + ): string; + encodeFunctionData( + functionFragment: "createSellerAndPremintedOfferWithCondition", + values: [ + BosonTypes.SellerStruct, + BosonTypes.OfferStruct, + BosonTypes.OfferDatesStruct, + BosonTypes.OfferDurationsStruct, + BigNumberish, + BigNumberish, + BosonTypes.ConditionStruct, + BosonTypes.AuthTokenStruct, + BosonTypes.VoucherInitValuesStruct, + BigNumberish + ] + ): string; + encodeFunctionData( + functionFragment: "createSellerAndPremintedOfferWithConditionAndTwinAndBundle", + values: [ + BosonTypes.SellerStruct, + BosonTypes.OfferStruct, + BosonTypes.OfferDatesStruct, + BosonTypes.OfferDurationsStruct, + BigNumberish, + BigNumberish, + BosonTypes.ConditionStruct, + BosonTypes.TwinStruct, + BosonTypes.AuthTokenStruct, + BosonTypes.VoucherInitValuesStruct, + BigNumberish + ] + ): string; + encodeFunctionData( + functionFragment: "raiseAndEscalateDispute", + values: [BigNumberish] + ): string; decodeFunctionResult( functionFragment: "createOfferAddToGroup", @@ -445,6 +568,22 @@ export interface IBosonOrchestrationHandlerInterface extends utils.Interface { functionFragment: "createOfferWithConditionAndTwinAndBundle", data: BytesLike ): Result; + decodeFunctionResult( + functionFragment: "createPremintedOfferAddToGroup", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "createPremintedOfferAndTwinWithBundle", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "createPremintedOfferWithCondition", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "createPremintedOfferWithConditionAndTwinAndBundle", + data: BytesLike + ): Result; decodeFunctionResult( functionFragment: "createSellerAndOffer", data: BytesLike @@ -461,6 +600,26 @@ export interface IBosonOrchestrationHandlerInterface extends utils.Interface { functionFragment: "createSellerAndOfferWithConditionAndTwinAndBundle", data: BytesLike ): Result; + decodeFunctionResult( + functionFragment: "createSellerAndPremintedOffer", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "createSellerAndPremintedOfferAndTwinWithBundle", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "createSellerAndPremintedOfferWithCondition", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "createSellerAndPremintedOfferWithConditionAndTwinAndBundle", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "raiseAndEscalateDispute", + data: BytesLike + ): Result; events: { "AgentCreated(uint256,tuple,address)": EventFragment; @@ -470,18 +629,20 @@ export interface IBosonOrchestrationHandlerInterface extends utils.Interface { "BundleCreated(uint256,uint256,tuple,address)": EventFragment; "BuyerCreated(uint256,tuple,address)": EventFragment; "BuyerUpdated(uint256,tuple,address)": EventFragment; - "DisputeResolverActivated(uint256,tuple,address)": EventFragment; "DisputeResolverCreated(uint256,tuple,tuple[],uint256[],address)": EventFragment; "DisputeResolverFeesAdded(uint256,tuple[],address)": EventFragment; "DisputeResolverFeesRemoved(uint256,address[],address)": EventFragment; - "DisputeResolverUpdated(uint256,tuple,address)": EventFragment; + "DisputeResolverUpdateApplied(uint256,tuple,tuple,address)": EventFragment; + "DisputeResolverUpdatePending(uint256,tuple,address)": EventFragment; "GroupCreated(uint256,uint256,tuple,tuple,address)": EventFragment; "GroupUpdated(uint256,uint256,tuple,tuple,address)": EventFragment; "OfferCreated(uint256,uint256,tuple,tuple,tuple,tuple,tuple,uint256,address)": EventFragment; "OfferExtended(uint256,uint256,uint256,address)": EventFragment; "OfferVoided(uint256,uint256,address)": EventFragment; + "RangeReserved(uint256,uint256,uint256,uint256,address)": EventFragment; "SellerCreated(uint256,tuple,address,tuple,address)": EventFragment; - "SellerUpdated(uint256,tuple,tuple,address)": EventFragment; + "SellerUpdateApplied(uint256,tuple,tuple,tuple,tuple,address)": EventFragment; + "SellerUpdatePending(uint256,tuple,tuple,address)": EventFragment; "TwinCreated(uint256,uint256,tuple,address)": EventFragment; "TwinDeleted(uint256,uint256,address)": EventFragment; "TwinTransferFailed(uint256,address,uint256,uint256,uint256,address)": EventFragment; @@ -495,18 +656,24 @@ export interface IBosonOrchestrationHandlerInterface extends utils.Interface { getEvent(nameOrSignatureOrTopic: "BundleCreated"): EventFragment; getEvent(nameOrSignatureOrTopic: "BuyerCreated"): EventFragment; getEvent(nameOrSignatureOrTopic: "BuyerUpdated"): EventFragment; - getEvent(nameOrSignatureOrTopic: "DisputeResolverActivated"): EventFragment; getEvent(nameOrSignatureOrTopic: "DisputeResolverCreated"): EventFragment; getEvent(nameOrSignatureOrTopic: "DisputeResolverFeesAdded"): EventFragment; getEvent(nameOrSignatureOrTopic: "DisputeResolverFeesRemoved"): EventFragment; - getEvent(nameOrSignatureOrTopic: "DisputeResolverUpdated"): EventFragment; + getEvent( + nameOrSignatureOrTopic: "DisputeResolverUpdateApplied" + ): EventFragment; + getEvent( + nameOrSignatureOrTopic: "DisputeResolverUpdatePending" + ): EventFragment; getEvent(nameOrSignatureOrTopic: "GroupCreated"): EventFragment; getEvent(nameOrSignatureOrTopic: "GroupUpdated"): EventFragment; getEvent(nameOrSignatureOrTopic: "OfferCreated"): EventFragment; getEvent(nameOrSignatureOrTopic: "OfferExtended"): EventFragment; getEvent(nameOrSignatureOrTopic: "OfferVoided"): EventFragment; + getEvent(nameOrSignatureOrTopic: "RangeReserved"): EventFragment; getEvent(nameOrSignatureOrTopic: "SellerCreated"): EventFragment; - getEvent(nameOrSignatureOrTopic: "SellerUpdated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "SellerUpdateApplied"): EventFragment; + getEvent(nameOrSignatureOrTopic: "SellerUpdatePending"): EventFragment; getEvent(nameOrSignatureOrTopic: "TwinCreated"): EventFragment; getEvent(nameOrSignatureOrTopic: "TwinDeleted"): EventFragment; getEvent(nameOrSignatureOrTopic: "TwinTransferFailed"): EventFragment; @@ -593,18 +760,6 @@ export type BuyerUpdatedEvent = TypedEvent< export type BuyerUpdatedEventFilter = TypedEventFilter; -export type DisputeResolverActivatedEvent = TypedEvent< - [BigNumber, BosonTypes.DisputeResolverStructOutput, string], - { - disputeResolverId: BigNumber; - disputeResolver: BosonTypes.DisputeResolverStructOutput; - executedBy: string; - } ->; - -export type DisputeResolverActivatedEventFilter = - TypedEventFilter; - export type DisputeResolverCreatedEvent = TypedEvent< [ BigNumber, @@ -649,17 +804,35 @@ export type DisputeResolverFeesRemovedEvent = TypedEvent< export type DisputeResolverFeesRemovedEventFilter = TypedEventFilter; -export type DisputeResolverUpdatedEvent = TypedEvent< - [BigNumber, BosonTypes.DisputeResolverStructOutput, string], +export type DisputeResolverUpdateAppliedEvent = TypedEvent< + [ + BigNumber, + BosonTypes.DisputeResolverStructOutput, + BosonTypes.DisputeResolverStructOutput, + string + ], { disputeResolverId: BigNumber; disputeResolver: BosonTypes.DisputeResolverStructOutput; + pendingDisputeResolver: BosonTypes.DisputeResolverStructOutput; + executedBy: string; + } +>; + +export type DisputeResolverUpdateAppliedEventFilter = + TypedEventFilter; + +export type DisputeResolverUpdatePendingEvent = TypedEvent< + [BigNumber, BosonTypes.DisputeResolverStructOutput, string], + { + disputeResolverId: BigNumber; + pendingDisputeResolver: BosonTypes.DisputeResolverStructOutput; executedBy: string; } >; -export type DisputeResolverUpdatedEventFilter = - TypedEventFilter; +export type DisputeResolverUpdatePendingEventFilter = + TypedEventFilter; export type GroupCreatedEvent = TypedEvent< [ @@ -745,6 +918,19 @@ export type OfferVoidedEvent = TypedEvent< export type OfferVoidedEventFilter = TypedEventFilter; +export type RangeReservedEvent = TypedEvent< + [BigNumber, BigNumber, BigNumber, BigNumber, string], + { + offerId: BigNumber; + sellerId: BigNumber; + startExchangeId: BigNumber; + endExchangeId: BigNumber; + executedBy: string; + } +>; + +export type RangeReservedEventFilter = TypedEventFilter; + export type SellerCreatedEvent = TypedEvent< [ BigNumber, @@ -764,22 +950,45 @@ export type SellerCreatedEvent = TypedEvent< export type SellerCreatedEventFilter = TypedEventFilter; -export type SellerUpdatedEvent = TypedEvent< +export type SellerUpdateAppliedEvent = TypedEvent< [ BigNumber, BosonTypes.SellerStructOutput, + BosonTypes.SellerStructOutput, + BosonTypes.AuthTokenStructOutput, BosonTypes.AuthTokenStructOutput, string ], { sellerId: BigNumber; seller: BosonTypes.SellerStructOutput; + pendingSeller: BosonTypes.SellerStructOutput; authToken: BosonTypes.AuthTokenStructOutput; + pendingAuthToken: BosonTypes.AuthTokenStructOutput; executedBy: string; } >; -export type SellerUpdatedEventFilter = TypedEventFilter; +export type SellerUpdateAppliedEventFilter = + TypedEventFilter; + +export type SellerUpdatePendingEvent = TypedEvent< + [ + BigNumber, + BosonTypes.SellerStructOutput, + BosonTypes.AuthTokenStructOutput, + string + ], + { + sellerId: BigNumber; + pendingSeller: BosonTypes.SellerStructOutput; + pendingAuthToken: BosonTypes.AuthTokenStructOutput; + executedBy: string; + } +>; + +export type SellerUpdatePendingEventFilter = + TypedEventFilter; export type TwinCreatedEvent = TypedEvent< [BigNumber, BigNumber, BosonTypes.TwinStructOutput, string], @@ -898,6 +1107,51 @@ export interface IBosonOrchestrationHandler extends BaseContract { overrides?: Overrides & { from?: string | Promise } ): Promise; + createPremintedOfferAddToGroup( + _offer: BosonTypes.OfferStruct, + _offerDates: BosonTypes.OfferDatesStruct, + _offerDurations: BosonTypes.OfferDurationsStruct, + _disputeResolverId: BigNumberish, + _reservedRangeLength: BigNumberish, + _groupId: BigNumberish, + _agentId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + createPremintedOfferAndTwinWithBundle( + _offer: BosonTypes.OfferStruct, + _offerDates: BosonTypes.OfferDatesStruct, + _offerDurations: BosonTypes.OfferDurationsStruct, + _disputeResolverId: BigNumberish, + _reservedRangeLength: BigNumberish, + _twin: BosonTypes.TwinStruct, + _agentId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + createPremintedOfferWithCondition( + _offer: BosonTypes.OfferStruct, + _offerDates: BosonTypes.OfferDatesStruct, + _offerDurations: BosonTypes.OfferDurationsStruct, + _disputeResolverId: BigNumberish, + _reservedRangeLength: BigNumberish, + _condition: BosonTypes.ConditionStruct, + _agentId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + createPremintedOfferWithConditionAndTwinAndBundle( + _offer: BosonTypes.OfferStruct, + _offerDates: BosonTypes.OfferDatesStruct, + _offerDurations: BosonTypes.OfferDurationsStruct, + _disputeResolverId: BigNumberish, + _reservedRangeLength: BigNumberish, + _condition: BosonTypes.ConditionStruct, + _twin: BosonTypes.TwinStruct, + _agentId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + createSellerAndOffer( _seller: BosonTypes.SellerStruct, _offer: BosonTypes.OfferStruct, @@ -949,6 +1203,67 @@ export interface IBosonOrchestrationHandler extends BaseContract { _agentId: BigNumberish, overrides?: Overrides & { from?: string | Promise } ): Promise; + + createSellerAndPremintedOffer( + _seller: BosonTypes.SellerStruct, + _offer: BosonTypes.OfferStruct, + _offerDates: BosonTypes.OfferDatesStruct, + _offerDurations: BosonTypes.OfferDurationsStruct, + _disputeResolverId: BigNumberish, + _reservedRangeLength: BigNumberish, + _authToken: BosonTypes.AuthTokenStruct, + _voucherInitValues: BosonTypes.VoucherInitValuesStruct, + _agentId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + createSellerAndPremintedOfferAndTwinWithBundle( + _seller: BosonTypes.SellerStruct, + _offer: BosonTypes.OfferStruct, + _offerDates: BosonTypes.OfferDatesStruct, + _offerDurations: BosonTypes.OfferDurationsStruct, + _disputeResolverId: BigNumberish, + _reservedRangeLength: BigNumberish, + _twin: BosonTypes.TwinStruct, + _authToken: BosonTypes.AuthTokenStruct, + _voucherInitValues: BosonTypes.VoucherInitValuesStruct, + _agentId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + createSellerAndPremintedOfferWithCondition( + _seller: BosonTypes.SellerStruct, + _offer: BosonTypes.OfferStruct, + _offerDates: BosonTypes.OfferDatesStruct, + _offerDurations: BosonTypes.OfferDurationsStruct, + _disputeResolverId: BigNumberish, + _reservedRangeLength: BigNumberish, + _condition: BosonTypes.ConditionStruct, + _authToken: BosonTypes.AuthTokenStruct, + _voucherInitValues: BosonTypes.VoucherInitValuesStruct, + _agentId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + createSellerAndPremintedOfferWithConditionAndTwinAndBundle( + _seller: BosonTypes.SellerStruct, + _offer: BosonTypes.OfferStruct, + _offerDates: BosonTypes.OfferDatesStruct, + _offerDurations: BosonTypes.OfferDurationsStruct, + _disputeResolverId: BigNumberish, + _reservedRangeLength: BigNumberish, + _condition: BosonTypes.ConditionStruct, + _twin: BosonTypes.TwinStruct, + _authToken: BosonTypes.AuthTokenStruct, + _voucherInitValues: BosonTypes.VoucherInitValuesStruct, + _agentId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + raiseAndEscalateDispute( + _exchangeId: BigNumberish, + overrides?: PayableOverrides & { from?: string | Promise } + ): Promise; }; createOfferAddToGroup( @@ -992,6 +1307,51 @@ export interface IBosonOrchestrationHandler extends BaseContract { overrides?: Overrides & { from?: string | Promise } ): Promise; + createPremintedOfferAddToGroup( + _offer: BosonTypes.OfferStruct, + _offerDates: BosonTypes.OfferDatesStruct, + _offerDurations: BosonTypes.OfferDurationsStruct, + _disputeResolverId: BigNumberish, + _reservedRangeLength: BigNumberish, + _groupId: BigNumberish, + _agentId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + createPremintedOfferAndTwinWithBundle( + _offer: BosonTypes.OfferStruct, + _offerDates: BosonTypes.OfferDatesStruct, + _offerDurations: BosonTypes.OfferDurationsStruct, + _disputeResolverId: BigNumberish, + _reservedRangeLength: BigNumberish, + _twin: BosonTypes.TwinStruct, + _agentId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + createPremintedOfferWithCondition( + _offer: BosonTypes.OfferStruct, + _offerDates: BosonTypes.OfferDatesStruct, + _offerDurations: BosonTypes.OfferDurationsStruct, + _disputeResolverId: BigNumberish, + _reservedRangeLength: BigNumberish, + _condition: BosonTypes.ConditionStruct, + _agentId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + createPremintedOfferWithConditionAndTwinAndBundle( + _offer: BosonTypes.OfferStruct, + _offerDates: BosonTypes.OfferDatesStruct, + _offerDurations: BosonTypes.OfferDurationsStruct, + _disputeResolverId: BigNumberish, + _reservedRangeLength: BigNumberish, + _condition: BosonTypes.ConditionStruct, + _twin: BosonTypes.TwinStruct, + _agentId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + createSellerAndOffer( _seller: BosonTypes.SellerStruct, _offer: BosonTypes.OfferStruct, @@ -1044,42 +1404,148 @@ export interface IBosonOrchestrationHandler extends BaseContract { overrides?: Overrides & { from?: string | Promise } ): Promise; - callStatic: { - createOfferAddToGroup( + createSellerAndPremintedOffer( + _seller: BosonTypes.SellerStruct, + _offer: BosonTypes.OfferStruct, + _offerDates: BosonTypes.OfferDatesStruct, + _offerDurations: BosonTypes.OfferDurationsStruct, + _disputeResolverId: BigNumberish, + _reservedRangeLength: BigNumberish, + _authToken: BosonTypes.AuthTokenStruct, + _voucherInitValues: BosonTypes.VoucherInitValuesStruct, + _agentId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + createSellerAndPremintedOfferAndTwinWithBundle( + _seller: BosonTypes.SellerStruct, + _offer: BosonTypes.OfferStruct, + _offerDates: BosonTypes.OfferDatesStruct, + _offerDurations: BosonTypes.OfferDurationsStruct, + _disputeResolverId: BigNumberish, + _reservedRangeLength: BigNumberish, + _twin: BosonTypes.TwinStruct, + _authToken: BosonTypes.AuthTokenStruct, + _voucherInitValues: BosonTypes.VoucherInitValuesStruct, + _agentId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + createSellerAndPremintedOfferWithCondition( + _seller: BosonTypes.SellerStruct, + _offer: BosonTypes.OfferStruct, + _offerDates: BosonTypes.OfferDatesStruct, + _offerDurations: BosonTypes.OfferDurationsStruct, + _disputeResolverId: BigNumberish, + _reservedRangeLength: BigNumberish, + _condition: BosonTypes.ConditionStruct, + _authToken: BosonTypes.AuthTokenStruct, + _voucherInitValues: BosonTypes.VoucherInitValuesStruct, + _agentId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + createSellerAndPremintedOfferWithConditionAndTwinAndBundle( + _seller: BosonTypes.SellerStruct, + _offer: BosonTypes.OfferStruct, + _offerDates: BosonTypes.OfferDatesStruct, + _offerDurations: BosonTypes.OfferDurationsStruct, + _disputeResolverId: BigNumberish, + _reservedRangeLength: BigNumberish, + _condition: BosonTypes.ConditionStruct, + _twin: BosonTypes.TwinStruct, + _authToken: BosonTypes.AuthTokenStruct, + _voucherInitValues: BosonTypes.VoucherInitValuesStruct, + _agentId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + raiseAndEscalateDispute( + _exchangeId: BigNumberish, + overrides?: PayableOverrides & { from?: string | Promise } + ): Promise; + + callStatic: { + createOfferAddToGroup( + _offer: BosonTypes.OfferStruct, + _offerDates: BosonTypes.OfferDatesStruct, + _offerDurations: BosonTypes.OfferDurationsStruct, + _disputeResolverId: BigNumberish, + _groupId: BigNumberish, + _agentId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + createOfferAndTwinWithBundle( + _offer: BosonTypes.OfferStruct, + _offerDates: BosonTypes.OfferDatesStruct, + _offerDurations: BosonTypes.OfferDurationsStruct, + _disputeResolverId: BigNumberish, + _twin: BosonTypes.TwinStruct, + _agentId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + createOfferWithCondition( + _offer: BosonTypes.OfferStruct, + _offerDates: BosonTypes.OfferDatesStruct, + _offerDurations: BosonTypes.OfferDurationsStruct, + _disputeResolverId: BigNumberish, + _condition: BosonTypes.ConditionStruct, + _agentId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + createOfferWithConditionAndTwinAndBundle( + _offer: BosonTypes.OfferStruct, + _offerDates: BosonTypes.OfferDatesStruct, + _offerDurations: BosonTypes.OfferDurationsStruct, + _disputeResolverId: BigNumberish, + _condition: BosonTypes.ConditionStruct, + _twin: BosonTypes.TwinStruct, + _agentId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + createPremintedOfferAddToGroup( _offer: BosonTypes.OfferStruct, _offerDates: BosonTypes.OfferDatesStruct, _offerDurations: BosonTypes.OfferDurationsStruct, _disputeResolverId: BigNumberish, + _reservedRangeLength: BigNumberish, _groupId: BigNumberish, _agentId: BigNumberish, overrides?: CallOverrides ): Promise; - createOfferAndTwinWithBundle( + createPremintedOfferAndTwinWithBundle( _offer: BosonTypes.OfferStruct, _offerDates: BosonTypes.OfferDatesStruct, _offerDurations: BosonTypes.OfferDurationsStruct, _disputeResolverId: BigNumberish, + _reservedRangeLength: BigNumberish, _twin: BosonTypes.TwinStruct, _agentId: BigNumberish, overrides?: CallOverrides ): Promise; - createOfferWithCondition( + createPremintedOfferWithCondition( _offer: BosonTypes.OfferStruct, _offerDates: BosonTypes.OfferDatesStruct, _offerDurations: BosonTypes.OfferDurationsStruct, _disputeResolverId: BigNumberish, + _reservedRangeLength: BigNumberish, _condition: BosonTypes.ConditionStruct, _agentId: BigNumberish, overrides?: CallOverrides ): Promise; - createOfferWithConditionAndTwinAndBundle( + createPremintedOfferWithConditionAndTwinAndBundle( _offer: BosonTypes.OfferStruct, _offerDates: BosonTypes.OfferDatesStruct, _offerDurations: BosonTypes.OfferDurationsStruct, _disputeResolverId: BigNumberish, + _reservedRangeLength: BigNumberish, _condition: BosonTypes.ConditionStruct, _twin: BosonTypes.TwinStruct, _agentId: BigNumberish, @@ -1137,6 +1603,67 @@ export interface IBosonOrchestrationHandler extends BaseContract { _agentId: BigNumberish, overrides?: CallOverrides ): Promise; + + createSellerAndPremintedOffer( + _seller: BosonTypes.SellerStruct, + _offer: BosonTypes.OfferStruct, + _offerDates: BosonTypes.OfferDatesStruct, + _offerDurations: BosonTypes.OfferDurationsStruct, + _disputeResolverId: BigNumberish, + _reservedRangeLength: BigNumberish, + _authToken: BosonTypes.AuthTokenStruct, + _voucherInitValues: BosonTypes.VoucherInitValuesStruct, + _agentId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + createSellerAndPremintedOfferAndTwinWithBundle( + _seller: BosonTypes.SellerStruct, + _offer: BosonTypes.OfferStruct, + _offerDates: BosonTypes.OfferDatesStruct, + _offerDurations: BosonTypes.OfferDurationsStruct, + _disputeResolverId: BigNumberish, + _reservedRangeLength: BigNumberish, + _twin: BosonTypes.TwinStruct, + _authToken: BosonTypes.AuthTokenStruct, + _voucherInitValues: BosonTypes.VoucherInitValuesStruct, + _agentId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + createSellerAndPremintedOfferWithCondition( + _seller: BosonTypes.SellerStruct, + _offer: BosonTypes.OfferStruct, + _offerDates: BosonTypes.OfferDatesStruct, + _offerDurations: BosonTypes.OfferDurationsStruct, + _disputeResolverId: BigNumberish, + _reservedRangeLength: BigNumberish, + _condition: BosonTypes.ConditionStruct, + _authToken: BosonTypes.AuthTokenStruct, + _voucherInitValues: BosonTypes.VoucherInitValuesStruct, + _agentId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + createSellerAndPremintedOfferWithConditionAndTwinAndBundle( + _seller: BosonTypes.SellerStruct, + _offer: BosonTypes.OfferStruct, + _offerDates: BosonTypes.OfferDatesStruct, + _offerDurations: BosonTypes.OfferDurationsStruct, + _disputeResolverId: BigNumberish, + _reservedRangeLength: BigNumberish, + _condition: BosonTypes.ConditionStruct, + _twin: BosonTypes.TwinStruct, + _authToken: BosonTypes.AuthTokenStruct, + _voucherInitValues: BosonTypes.VoucherInitValuesStruct, + _agentId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + raiseAndEscalateDispute( + _exchangeId: BigNumberish, + overrides?: CallOverrides + ): Promise; }; filters: { @@ -1219,17 +1746,6 @@ export interface IBosonOrchestrationHandler extends BaseContract { executedBy?: string | null ): BuyerUpdatedEventFilter; - "DisputeResolverActivated(uint256,tuple,address)"( - disputeResolverId?: BigNumberish | null, - disputeResolver?: null, - executedBy?: string | null - ): DisputeResolverActivatedEventFilter; - DisputeResolverActivated( - disputeResolverId?: BigNumberish | null, - disputeResolver?: null, - executedBy?: string | null - ): DisputeResolverActivatedEventFilter; - "DisputeResolverCreated(uint256,tuple,tuple[],uint256[],address)"( disputeResolverId?: BigNumberish | null, disputeResolver?: null, @@ -1267,16 +1783,29 @@ export interface IBosonOrchestrationHandler extends BaseContract { executedBy?: string | null ): DisputeResolverFeesRemovedEventFilter; - "DisputeResolverUpdated(uint256,tuple,address)"( + "DisputeResolverUpdateApplied(uint256,tuple,tuple,address)"( disputeResolverId?: BigNumberish | null, disputeResolver?: null, + pendingDisputeResolver?: null, executedBy?: string | null - ): DisputeResolverUpdatedEventFilter; - DisputeResolverUpdated( + ): DisputeResolverUpdateAppliedEventFilter; + DisputeResolverUpdateApplied( disputeResolverId?: BigNumberish | null, disputeResolver?: null, + pendingDisputeResolver?: null, + executedBy?: string | null + ): DisputeResolverUpdateAppliedEventFilter; + + "DisputeResolverUpdatePending(uint256,tuple,address)"( + disputeResolverId?: BigNumberish | null, + pendingDisputeResolver?: null, executedBy?: string | null - ): DisputeResolverUpdatedEventFilter; + ): DisputeResolverUpdatePendingEventFilter; + DisputeResolverUpdatePending( + disputeResolverId?: BigNumberish | null, + pendingDisputeResolver?: null, + executedBy?: string | null + ): DisputeResolverUpdatePendingEventFilter; "GroupCreated(uint256,uint256,tuple,tuple,address)"( groupId?: BigNumberish | null, @@ -1355,6 +1884,21 @@ export interface IBosonOrchestrationHandler extends BaseContract { executedBy?: string | null ): OfferVoidedEventFilter; + "RangeReserved(uint256,uint256,uint256,uint256,address)"( + offerId?: BigNumberish | null, + sellerId?: BigNumberish | null, + startExchangeId?: null, + endExchangeId?: null, + executedBy?: string | null + ): RangeReservedEventFilter; + RangeReserved( + offerId?: BigNumberish | null, + sellerId?: BigNumberish | null, + startExchangeId?: null, + endExchangeId?: null, + executedBy?: string | null + ): RangeReservedEventFilter; + "SellerCreated(uint256,tuple,address,tuple,address)"( sellerId?: BigNumberish | null, seller?: null, @@ -1370,18 +1914,35 @@ export interface IBosonOrchestrationHandler extends BaseContract { executedBy?: string | null ): SellerCreatedEventFilter; - "SellerUpdated(uint256,tuple,tuple,address)"( + "SellerUpdateApplied(uint256,tuple,tuple,tuple,tuple,address)"( sellerId?: BigNumberish | null, seller?: null, + pendingSeller?: null, authToken?: null, + pendingAuthToken?: null, executedBy?: string | null - ): SellerUpdatedEventFilter; - SellerUpdated( + ): SellerUpdateAppliedEventFilter; + SellerUpdateApplied( sellerId?: BigNumberish | null, seller?: null, + pendingSeller?: null, authToken?: null, + pendingAuthToken?: null, + executedBy?: string | null + ): SellerUpdateAppliedEventFilter; + + "SellerUpdatePending(uint256,tuple,tuple,address)"( + sellerId?: BigNumberish | null, + pendingSeller?: null, + pendingAuthToken?: null, executedBy?: string | null - ): SellerUpdatedEventFilter; + ): SellerUpdatePendingEventFilter; + SellerUpdatePending( + sellerId?: BigNumberish | null, + pendingSeller?: null, + pendingAuthToken?: null, + executedBy?: string | null + ): SellerUpdatePendingEventFilter; "TwinCreated(uint256,uint256,tuple,address)"( twinId?: BigNumberish | null, @@ -1484,6 +2045,51 @@ export interface IBosonOrchestrationHandler extends BaseContract { overrides?: Overrides & { from?: string | Promise } ): Promise; + createPremintedOfferAddToGroup( + _offer: BosonTypes.OfferStruct, + _offerDates: BosonTypes.OfferDatesStruct, + _offerDurations: BosonTypes.OfferDurationsStruct, + _disputeResolverId: BigNumberish, + _reservedRangeLength: BigNumberish, + _groupId: BigNumberish, + _agentId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + createPremintedOfferAndTwinWithBundle( + _offer: BosonTypes.OfferStruct, + _offerDates: BosonTypes.OfferDatesStruct, + _offerDurations: BosonTypes.OfferDurationsStruct, + _disputeResolverId: BigNumberish, + _reservedRangeLength: BigNumberish, + _twin: BosonTypes.TwinStruct, + _agentId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + createPremintedOfferWithCondition( + _offer: BosonTypes.OfferStruct, + _offerDates: BosonTypes.OfferDatesStruct, + _offerDurations: BosonTypes.OfferDurationsStruct, + _disputeResolverId: BigNumberish, + _reservedRangeLength: BigNumberish, + _condition: BosonTypes.ConditionStruct, + _agentId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + createPremintedOfferWithConditionAndTwinAndBundle( + _offer: BosonTypes.OfferStruct, + _offerDates: BosonTypes.OfferDatesStruct, + _offerDurations: BosonTypes.OfferDurationsStruct, + _disputeResolverId: BigNumberish, + _reservedRangeLength: BigNumberish, + _condition: BosonTypes.ConditionStruct, + _twin: BosonTypes.TwinStruct, + _agentId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + createSellerAndOffer( _seller: BosonTypes.SellerStruct, _offer: BosonTypes.OfferStruct, @@ -1535,6 +2141,67 @@ export interface IBosonOrchestrationHandler extends BaseContract { _agentId: BigNumberish, overrides?: Overrides & { from?: string | Promise } ): Promise; + + createSellerAndPremintedOffer( + _seller: BosonTypes.SellerStruct, + _offer: BosonTypes.OfferStruct, + _offerDates: BosonTypes.OfferDatesStruct, + _offerDurations: BosonTypes.OfferDurationsStruct, + _disputeResolverId: BigNumberish, + _reservedRangeLength: BigNumberish, + _authToken: BosonTypes.AuthTokenStruct, + _voucherInitValues: BosonTypes.VoucherInitValuesStruct, + _agentId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + createSellerAndPremintedOfferAndTwinWithBundle( + _seller: BosonTypes.SellerStruct, + _offer: BosonTypes.OfferStruct, + _offerDates: BosonTypes.OfferDatesStruct, + _offerDurations: BosonTypes.OfferDurationsStruct, + _disputeResolverId: BigNumberish, + _reservedRangeLength: BigNumberish, + _twin: BosonTypes.TwinStruct, + _authToken: BosonTypes.AuthTokenStruct, + _voucherInitValues: BosonTypes.VoucherInitValuesStruct, + _agentId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + createSellerAndPremintedOfferWithCondition( + _seller: BosonTypes.SellerStruct, + _offer: BosonTypes.OfferStruct, + _offerDates: BosonTypes.OfferDatesStruct, + _offerDurations: BosonTypes.OfferDurationsStruct, + _disputeResolverId: BigNumberish, + _reservedRangeLength: BigNumberish, + _condition: BosonTypes.ConditionStruct, + _authToken: BosonTypes.AuthTokenStruct, + _voucherInitValues: BosonTypes.VoucherInitValuesStruct, + _agentId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + createSellerAndPremintedOfferWithConditionAndTwinAndBundle( + _seller: BosonTypes.SellerStruct, + _offer: BosonTypes.OfferStruct, + _offerDates: BosonTypes.OfferDatesStruct, + _offerDurations: BosonTypes.OfferDurationsStruct, + _disputeResolverId: BigNumberish, + _reservedRangeLength: BigNumberish, + _condition: BosonTypes.ConditionStruct, + _twin: BosonTypes.TwinStruct, + _authToken: BosonTypes.AuthTokenStruct, + _voucherInitValues: BosonTypes.VoucherInitValuesStruct, + _agentId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + raiseAndEscalateDispute( + _exchangeId: BigNumberish, + overrides?: PayableOverrides & { from?: string | Promise } + ): Promise; }; populateTransaction: { @@ -1579,6 +2246,51 @@ export interface IBosonOrchestrationHandler extends BaseContract { overrides?: Overrides & { from?: string | Promise } ): Promise; + createPremintedOfferAddToGroup( + _offer: BosonTypes.OfferStruct, + _offerDates: BosonTypes.OfferDatesStruct, + _offerDurations: BosonTypes.OfferDurationsStruct, + _disputeResolverId: BigNumberish, + _reservedRangeLength: BigNumberish, + _groupId: BigNumberish, + _agentId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + createPremintedOfferAndTwinWithBundle( + _offer: BosonTypes.OfferStruct, + _offerDates: BosonTypes.OfferDatesStruct, + _offerDurations: BosonTypes.OfferDurationsStruct, + _disputeResolverId: BigNumberish, + _reservedRangeLength: BigNumberish, + _twin: BosonTypes.TwinStruct, + _agentId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + createPremintedOfferWithCondition( + _offer: BosonTypes.OfferStruct, + _offerDates: BosonTypes.OfferDatesStruct, + _offerDurations: BosonTypes.OfferDurationsStruct, + _disputeResolverId: BigNumberish, + _reservedRangeLength: BigNumberish, + _condition: BosonTypes.ConditionStruct, + _agentId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + createPremintedOfferWithConditionAndTwinAndBundle( + _offer: BosonTypes.OfferStruct, + _offerDates: BosonTypes.OfferDatesStruct, + _offerDurations: BosonTypes.OfferDurationsStruct, + _disputeResolverId: BigNumberish, + _reservedRangeLength: BigNumberish, + _condition: BosonTypes.ConditionStruct, + _twin: BosonTypes.TwinStruct, + _agentId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + createSellerAndOffer( _seller: BosonTypes.SellerStruct, _offer: BosonTypes.OfferStruct, @@ -1630,5 +2342,66 @@ export interface IBosonOrchestrationHandler extends BaseContract { _agentId: BigNumberish, overrides?: Overrides & { from?: string | Promise } ): Promise; + + createSellerAndPremintedOffer( + _seller: BosonTypes.SellerStruct, + _offer: BosonTypes.OfferStruct, + _offerDates: BosonTypes.OfferDatesStruct, + _offerDurations: BosonTypes.OfferDurationsStruct, + _disputeResolverId: BigNumberish, + _reservedRangeLength: BigNumberish, + _authToken: BosonTypes.AuthTokenStruct, + _voucherInitValues: BosonTypes.VoucherInitValuesStruct, + _agentId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + createSellerAndPremintedOfferAndTwinWithBundle( + _seller: BosonTypes.SellerStruct, + _offer: BosonTypes.OfferStruct, + _offerDates: BosonTypes.OfferDatesStruct, + _offerDurations: BosonTypes.OfferDurationsStruct, + _disputeResolverId: BigNumberish, + _reservedRangeLength: BigNumberish, + _twin: BosonTypes.TwinStruct, + _authToken: BosonTypes.AuthTokenStruct, + _voucherInitValues: BosonTypes.VoucherInitValuesStruct, + _agentId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + createSellerAndPremintedOfferWithCondition( + _seller: BosonTypes.SellerStruct, + _offer: BosonTypes.OfferStruct, + _offerDates: BosonTypes.OfferDatesStruct, + _offerDurations: BosonTypes.OfferDurationsStruct, + _disputeResolverId: BigNumberish, + _reservedRangeLength: BigNumberish, + _condition: BosonTypes.ConditionStruct, + _authToken: BosonTypes.AuthTokenStruct, + _voucherInitValues: BosonTypes.VoucherInitValuesStruct, + _agentId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + createSellerAndPremintedOfferWithConditionAndTwinAndBundle( + _seller: BosonTypes.SellerStruct, + _offer: BosonTypes.OfferStruct, + _offerDates: BosonTypes.OfferDatesStruct, + _offerDurations: BosonTypes.OfferDurationsStruct, + _disputeResolverId: BigNumberish, + _reservedRangeLength: BigNumberish, + _condition: BosonTypes.ConditionStruct, + _twin: BosonTypes.TwinStruct, + _authToken: BosonTypes.AuthTokenStruct, + _voucherInitValues: BosonTypes.VoucherInitValuesStruct, + _agentId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + raiseAndEscalateDispute( + _exchangeId: BigNumberish, + overrides?: PayableOverrides & { from?: string | Promise } + ): Promise; }; } diff --git a/packages/ethers-sdk/src/contracts/IBosonVoucher.ts b/packages/ethers-sdk/src/contracts/IBosonVoucher.ts index 6e9178a07..4698a37c2 100644 --- a/packages/ethers-sdk/src/contracts/IBosonVoucher.ts +++ b/packages/ethers-sdk/src/contracts/IBosonVoucher.ts @@ -17,20 +17,49 @@ import { FunctionFragment, Result, EventFragment } from "@ethersproject/abi"; import { Listener, Provider } from "@ethersproject/providers"; import { TypedEventFilter, TypedEvent, TypedListener, OnEvent } from "./common"; +export declare namespace IBosonVoucher { + export type RangeStruct = { + offerId: BigNumberish; + start: BigNumberish; + length: BigNumberish; + minted: BigNumberish; + lastBurnedTokenId: BigNumberish; + }; + + export type RangeStructOutput = [ + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber + ] & { + offerId: BigNumber; + start: BigNumber; + length: BigNumber; + minted: BigNumber; + lastBurnedTokenId: BigNumber; + }; +} + export interface IBosonVoucherInterface extends utils.Interface { contractName: "IBosonVoucher"; functions: { "approve(address,uint256)": FunctionFragment; "balanceOf(address)": FunctionFragment; + "burnPremintedVouchers(uint256)": FunctionFragment; "burnVoucher(uint256)": FunctionFragment; "contractURI()": FunctionFragment; "getApproved(uint256)": FunctionFragment; + "getAvailablePreMints(uint256)": FunctionFragment; + "getRangeByOfferId(uint256)": FunctionFragment; "getRoyaltyPercentage()": FunctionFragment; "getSellerId()": FunctionFragment; "isApprovedForAll(address,address)": FunctionFragment; "issueVoucher(uint256,address)": FunctionFragment; "name()": FunctionFragment; "ownerOf(uint256)": FunctionFragment; + "preMint(uint256,uint256)": FunctionFragment; + "reserveRange(uint256,uint256,uint256)": FunctionFragment; "royaltyInfo(uint256,uint256)": FunctionFragment; "safeTransferFrom(address,address,uint256)": FunctionFragment; "setApprovalForAll(address,bool)": FunctionFragment; @@ -48,6 +77,10 @@ export interface IBosonVoucherInterface extends utils.Interface { values: [string, BigNumberish] ): string; encodeFunctionData(functionFragment: "balanceOf", values: [string]): string; + encodeFunctionData( + functionFragment: "burnPremintedVouchers", + values: [BigNumberish] + ): string; encodeFunctionData( functionFragment: "burnVoucher", values: [BigNumberish] @@ -60,6 +93,14 @@ export interface IBosonVoucherInterface extends utils.Interface { functionFragment: "getApproved", values: [BigNumberish] ): string; + encodeFunctionData( + functionFragment: "getAvailablePreMints", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "getRangeByOfferId", + values: [BigNumberish] + ): string; encodeFunctionData( functionFragment: "getRoyaltyPercentage", values?: undefined @@ -81,6 +122,14 @@ export interface IBosonVoucherInterface extends utils.Interface { functionFragment: "ownerOf", values: [BigNumberish] ): string; + encodeFunctionData( + functionFragment: "preMint", + values: [BigNumberish, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "reserveRange", + values: [BigNumberish, BigNumberish, BigNumberish] + ): string; encodeFunctionData( functionFragment: "royaltyInfo", values: [BigNumberish, BigNumberish] @@ -121,6 +170,10 @@ export interface IBosonVoucherInterface extends utils.Interface { decodeFunctionResult(functionFragment: "approve", data: BytesLike): Result; decodeFunctionResult(functionFragment: "balanceOf", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "burnPremintedVouchers", + data: BytesLike + ): Result; decodeFunctionResult( functionFragment: "burnVoucher", data: BytesLike @@ -133,6 +186,14 @@ export interface IBosonVoucherInterface extends utils.Interface { functionFragment: "getApproved", data: BytesLike ): Result; + decodeFunctionResult( + functionFragment: "getAvailablePreMints", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getRangeByOfferId", + data: BytesLike + ): Result; decodeFunctionResult( functionFragment: "getRoyaltyPercentage", data: BytesLike @@ -151,6 +212,11 @@ export interface IBosonVoucherInterface extends utils.Interface { ): Result; decodeFunctionResult(functionFragment: "name", data: BytesLike): Result; decodeFunctionResult(functionFragment: "ownerOf", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "preMint", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "reserveRange", + data: BytesLike + ): Result; decodeFunctionResult( functionFragment: "royaltyInfo", data: BytesLike @@ -190,6 +256,7 @@ export interface IBosonVoucherInterface extends utils.Interface { "Approval(address,address,uint256)": EventFragment; "ApprovalForAll(address,address,bool)": EventFragment; "ContractURIChanged(string)": EventFragment; + "RangeReserved(uint256,tuple)": EventFragment; "RoyaltyPercentageChanged(uint256)": EventFragment; "Transfer(address,address,uint256)": EventFragment; "VoucherInitialized(uint256,uint256,string)": EventFragment; @@ -198,6 +265,7 @@ export interface IBosonVoucherInterface extends utils.Interface { getEvent(nameOrSignatureOrTopic: "Approval"): EventFragment; getEvent(nameOrSignatureOrTopic: "ApprovalForAll"): EventFragment; getEvent(nameOrSignatureOrTopic: "ContractURIChanged"): EventFragment; + getEvent(nameOrSignatureOrTopic: "RangeReserved"): EventFragment; getEvent(nameOrSignatureOrTopic: "RoyaltyPercentageChanged"): EventFragment; getEvent(nameOrSignatureOrTopic: "Transfer"): EventFragment; getEvent(nameOrSignatureOrTopic: "VoucherInitialized"): EventFragment; @@ -225,6 +293,13 @@ export type ContractURIChangedEvent = TypedEvent< export type ContractURIChangedEventFilter = TypedEventFilter; +export type RangeReservedEvent = TypedEvent< + [BigNumber, IBosonVoucher.RangeStructOutput], + { offerId: BigNumber; range: IBosonVoucher.RangeStructOutput } +>; + +export type RangeReservedEventFilter = TypedEventFilter; + export type RoyaltyPercentageChangedEvent = TypedEvent< [BigNumber], { royaltyPercentage: BigNumber } @@ -287,6 +362,11 @@ export interface IBosonVoucher extends BaseContract { overrides?: CallOverrides ): Promise<[BigNumber] & { balance: BigNumber }>; + burnPremintedVouchers( + _offerId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + burnVoucher( _exchangeId: BigNumberish, overrides?: Overrides & { from?: string | Promise } @@ -299,6 +379,20 @@ export interface IBosonVoucher extends BaseContract { overrides?: CallOverrides ): Promise<[string] & { operator: string }>; + getAvailablePreMints( + _offerId: BigNumberish, + overrides?: CallOverrides + ): Promise<[BigNumber] & { count: BigNumber }>; + + getRangeByOfferId( + _offerId: BigNumberish, + overrides?: CallOverrides + ): Promise< + [IBosonVoucher.RangeStructOutput] & { + range: IBosonVoucher.RangeStructOutput; + } + >; + getRoyaltyPercentage(overrides?: CallOverrides): Promise<[BigNumber]>; getSellerId(overrides?: CallOverrides): Promise<[BigNumber]>; @@ -322,6 +416,19 @@ export interface IBosonVoucher extends BaseContract { overrides?: CallOverrides ): Promise<[string] & { owner: string }>; + preMint( + _offerId: BigNumberish, + _amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + reserveRange( + _offerId: BigNumberish, + _start: BigNumberish, + _length: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + royaltyInfo( _tokenId: BigNumberish, _salePrice: BigNumberish, @@ -394,6 +501,11 @@ export interface IBosonVoucher extends BaseContract { balanceOf(owner: string, overrides?: CallOverrides): Promise; + burnPremintedVouchers( + _offerId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + burnVoucher( _exchangeId: BigNumberish, overrides?: Overrides & { from?: string | Promise } @@ -406,6 +518,16 @@ export interface IBosonVoucher extends BaseContract { overrides?: CallOverrides ): Promise; + getAvailablePreMints( + _offerId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getRangeByOfferId( + _offerId: BigNumberish, + overrides?: CallOverrides + ): Promise; + getRoyaltyPercentage(overrides?: CallOverrides): Promise; getSellerId(overrides?: CallOverrides): Promise; @@ -426,6 +548,19 @@ export interface IBosonVoucher extends BaseContract { ownerOf(tokenId: BigNumberish, overrides?: CallOverrides): Promise; + preMint( + _offerId: BigNumberish, + _amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + reserveRange( + _offerId: BigNumberish, + _start: BigNumberish, + _length: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + royaltyInfo( _tokenId: BigNumberish, _salePrice: BigNumberish, @@ -495,6 +630,11 @@ export interface IBosonVoucher extends BaseContract { balanceOf(owner: string, overrides?: CallOverrides): Promise; + burnPremintedVouchers( + _offerId: BigNumberish, + overrides?: CallOverrides + ): Promise; + burnVoucher( _exchangeId: BigNumberish, overrides?: CallOverrides @@ -507,6 +647,16 @@ export interface IBosonVoucher extends BaseContract { overrides?: CallOverrides ): Promise; + getAvailablePreMints( + _offerId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getRangeByOfferId( + _offerId: BigNumberish, + overrides?: CallOverrides + ): Promise; + getRoyaltyPercentage(overrides?: CallOverrides): Promise; getSellerId(overrides?: CallOverrides): Promise; @@ -527,6 +677,19 @@ export interface IBosonVoucher extends BaseContract { ownerOf(tokenId: BigNumberish, overrides?: CallOverrides): Promise; + preMint( + _offerId: BigNumberish, + _amount: BigNumberish, + overrides?: CallOverrides + ): Promise; + + reserveRange( + _offerId: BigNumberish, + _start: BigNumberish, + _length: BigNumberish, + overrides?: CallOverrides + ): Promise; + royaltyInfo( _tokenId: BigNumberish, _salePrice: BigNumberish, @@ -616,6 +779,15 @@ export interface IBosonVoucher extends BaseContract { ): ContractURIChangedEventFilter; ContractURIChanged(contractURI?: null): ContractURIChangedEventFilter; + "RangeReserved(uint256,tuple)"( + offerId?: BigNumberish | null, + range?: null + ): RangeReservedEventFilter; + RangeReserved( + offerId?: BigNumberish | null, + range?: null + ): RangeReservedEventFilter; + "RoyaltyPercentageChanged(uint256)"( royaltyPercentage?: null ): RoyaltyPercentageChangedEventFilter; @@ -655,6 +827,11 @@ export interface IBosonVoucher extends BaseContract { balanceOf(owner: string, overrides?: CallOverrides): Promise; + burnPremintedVouchers( + _offerId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + burnVoucher( _exchangeId: BigNumberish, overrides?: Overrides & { from?: string | Promise } @@ -667,6 +844,16 @@ export interface IBosonVoucher extends BaseContract { overrides?: CallOverrides ): Promise; + getAvailablePreMints( + _offerId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getRangeByOfferId( + _offerId: BigNumberish, + overrides?: CallOverrides + ): Promise; + getRoyaltyPercentage(overrides?: CallOverrides): Promise; getSellerId(overrides?: CallOverrides): Promise; @@ -690,6 +877,19 @@ export interface IBosonVoucher extends BaseContract { overrides?: CallOverrides ): Promise; + preMint( + _offerId: BigNumberish, + _amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + reserveRange( + _offerId: BigNumberish, + _start: BigNumberish, + _length: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + royaltyInfo( _tokenId: BigNumberish, _salePrice: BigNumberish, @@ -764,6 +964,11 @@ export interface IBosonVoucher extends BaseContract { overrides?: CallOverrides ): Promise; + burnPremintedVouchers( + _offerId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + burnVoucher( _exchangeId: BigNumberish, overrides?: Overrides & { from?: string | Promise } @@ -776,6 +981,16 @@ export interface IBosonVoucher extends BaseContract { overrides?: CallOverrides ): Promise; + getAvailablePreMints( + _offerId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getRangeByOfferId( + _offerId: BigNumberish, + overrides?: CallOverrides + ): Promise; + getRoyaltyPercentage( overrides?: CallOverrides ): Promise; @@ -801,6 +1016,19 @@ export interface IBosonVoucher extends BaseContract { overrides?: CallOverrides ): Promise; + preMint( + _offerId: BigNumberish, + _amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + reserveRange( + _offerId: BigNumberish, + _start: BigNumberish, + _length: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + royaltyInfo( _tokenId: BigNumberish, _salePrice: BigNumberish, diff --git a/packages/ethers-sdk/src/contracts/MockNativeMetaTransaction.ts b/packages/ethers-sdk/src/contracts/MockNativeMetaTransaction.ts new file mode 100644 index 000000000..a32920795 --- /dev/null +++ b/packages/ethers-sdk/src/contracts/MockNativeMetaTransaction.ts @@ -0,0 +1,199 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import { + BaseContract, + BigNumber, + BigNumberish, + BytesLike, + CallOverrides, + ContractTransaction, + PayableOverrides, + PopulatedTransaction, + Signer, + utils, +} from "ethers"; +import { FunctionFragment, Result, EventFragment } from "@ethersproject/abi"; +import { Listener, Provider } from "@ethersproject/providers"; +import { TypedEventFilter, TypedEvent, TypedListener, OnEvent } from "./common"; + +export interface MockNativeMetaTransactionInterface extends utils.Interface { + contractName: "MockNativeMetaTransaction"; + functions: { + "executeMetaTransaction(address,bytes,bytes32,bytes32,uint8)": FunctionFragment; + "getChainId()": FunctionFragment; + "getDomainSeperator()": FunctionFragment; + "getNonce(address)": FunctionFragment; + }; + + encodeFunctionData( + functionFragment: "executeMetaTransaction", + values: [string, BytesLike, BytesLike, BytesLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "getChainId", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "getDomainSeperator", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "getNonce", values: [string]): string; + + decodeFunctionResult( + functionFragment: "executeMetaTransaction", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "getChainId", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "getDomainSeperator", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "getNonce", data: BytesLike): Result; + + events: { + "MetaTransactionExecuted(address,address,bytes)": EventFragment; + }; + + getEvent(nameOrSignatureOrTopic: "MetaTransactionExecuted"): EventFragment; +} + +export type MetaTransactionExecutedEvent = TypedEvent< + [string, string, string], + { userAddress: string; relayerAddress: string; functionSignature: string } +>; + +export type MetaTransactionExecutedEventFilter = + TypedEventFilter; + +export interface MockNativeMetaTransaction extends BaseContract { + contractName: "MockNativeMetaTransaction"; + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + interface: MockNativeMetaTransactionInterface; + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>; + + listeners( + eventFilter?: TypedEventFilter + ): Array>; + listeners(eventName?: string): Array; + removeAllListeners( + eventFilter: TypedEventFilter + ): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + + functions: { + executeMetaTransaction( + userAddress: string, + functionSignature: BytesLike, + sigR: BytesLike, + sigS: BytesLike, + sigV: BigNumberish, + overrides?: PayableOverrides & { from?: string | Promise } + ): Promise; + + getChainId(overrides?: CallOverrides): Promise<[BigNumber]>; + + getDomainSeperator(overrides?: CallOverrides): Promise<[string]>; + + getNonce( + user: string, + overrides?: CallOverrides + ): Promise<[BigNumber] & { nonce: BigNumber }>; + }; + + executeMetaTransaction( + userAddress: string, + functionSignature: BytesLike, + sigR: BytesLike, + sigS: BytesLike, + sigV: BigNumberish, + overrides?: PayableOverrides & { from?: string | Promise } + ): Promise; + + getChainId(overrides?: CallOverrides): Promise; + + getDomainSeperator(overrides?: CallOverrides): Promise; + + getNonce(user: string, overrides?: CallOverrides): Promise; + + callStatic: { + executeMetaTransaction( + userAddress: string, + functionSignature: BytesLike, + sigR: BytesLike, + sigS: BytesLike, + sigV: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getChainId(overrides?: CallOverrides): Promise; + + getDomainSeperator(overrides?: CallOverrides): Promise; + + getNonce(user: string, overrides?: CallOverrides): Promise; + }; + + filters: { + "MetaTransactionExecuted(address,address,bytes)"( + userAddress?: null, + relayerAddress?: null, + functionSignature?: null + ): MetaTransactionExecutedEventFilter; + MetaTransactionExecuted( + userAddress?: null, + relayerAddress?: null, + functionSignature?: null + ): MetaTransactionExecutedEventFilter; + }; + + estimateGas: { + executeMetaTransaction( + userAddress: string, + functionSignature: BytesLike, + sigR: BytesLike, + sigS: BytesLike, + sigV: BigNumberish, + overrides?: PayableOverrides & { from?: string | Promise } + ): Promise; + + getChainId(overrides?: CallOverrides): Promise; + + getDomainSeperator(overrides?: CallOverrides): Promise; + + getNonce(user: string, overrides?: CallOverrides): Promise; + }; + + populateTransaction: { + executeMetaTransaction( + userAddress: string, + functionSignature: BytesLike, + sigR: BytesLike, + sigS: BytesLike, + sigV: BigNumberish, + overrides?: PayableOverrides & { from?: string | Promise } + ): Promise; + + getChainId(overrides?: CallOverrides): Promise; + + getDomainSeperator( + overrides?: CallOverrides + ): Promise; + + getNonce( + user: string, + overrides?: CallOverrides + ): Promise; + }; +} diff --git a/packages/ethers-sdk/src/contracts/factories/ERC1155__factory.ts b/packages/ethers-sdk/src/contracts/factories/ERC1155__factory.ts new file mode 100644 index 000000000..d60c56b2a --- /dev/null +++ b/packages/ethers-sdk/src/contracts/factories/ERC1155__factory.ts @@ -0,0 +1,297 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, Signer, utils } from "ethers"; +import { Provider } from "@ethersproject/providers"; +import type { ERC1155, ERC1155Interface } from "../ERC1155"; + +const _abi = [ + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "_owner", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "_operator", + type: "address", + }, + { + indexed: false, + internalType: "bool", + name: "_approved", + type: "bool", + }, + ], + name: "ApprovalForAll", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "_operator", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "_from", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "_to", + type: "address", + }, + { + indexed: false, + internalType: "uint256[]", + name: "_ids", + type: "uint256[]", + }, + { + indexed: false, + internalType: "uint256[]", + name: "_amounts", + type: "uint256[]", + }, + ], + name: "TransferBatch", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "_operator", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "_from", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "_to", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "_id", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "_amount", + type: "uint256", + }, + ], + name: "TransferSingle", + type: "event", + }, + { + inputs: [ + { + internalType: "address", + name: "_owner", + type: "address", + }, + { + internalType: "uint256", + name: "_id", + type: "uint256", + }, + ], + name: "balanceOf", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address[]", + name: "_owners", + type: "address[]", + }, + { + internalType: "uint256[]", + name: "_ids", + type: "uint256[]", + }, + ], + name: "balanceOfBatch", + outputs: [ + { + internalType: "uint256[]", + name: "", + type: "uint256[]", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "_owner", + type: "address", + }, + { + internalType: "address", + name: "_operator", + type: "address", + }, + ], + name: "isApprovedForAll", + outputs: [ + { + internalType: "bool", + name: "isOperator", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "_from", + type: "address", + }, + { + internalType: "address", + name: "_to", + type: "address", + }, + { + internalType: "uint256[]", + name: "_ids", + type: "uint256[]", + }, + { + internalType: "uint256[]", + name: "_amounts", + type: "uint256[]", + }, + { + internalType: "bytes", + name: "_data", + type: "bytes", + }, + ], + name: "safeBatchTransferFrom", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "_from", + type: "address", + }, + { + internalType: "address", + name: "_to", + type: "address", + }, + { + internalType: "uint256", + name: "_id", + type: "uint256", + }, + { + internalType: "uint256", + name: "_amount", + type: "uint256", + }, + { + internalType: "bytes", + name: "_data", + type: "bytes", + }, + ], + name: "safeTransferFrom", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "_operator", + type: "address", + }, + { + internalType: "bool", + name: "_approved", + type: "bool", + }, + ], + name: "setApprovalForAll", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes4", + name: "_interfaceID", + type: "bytes4", + }, + ], + name: "supportsInterface", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "pure", + type: "function", + }, +]; + +export class ERC1155__factory { + static readonly abi = _abi; + static createInterface(): ERC1155Interface { + return new utils.Interface(_abi) as ERC1155Interface; + } + static connect( + address: string, + signerOrProvider: Signer | Provider + ): ERC1155 { + return new Contract(address, _abi, signerOrProvider) as ERC1155; + } +} diff --git a/packages/ethers-sdk/src/contracts/factories/IBosonAccountHandler__factory.ts b/packages/ethers-sdk/src/contracts/factories/IBosonAccountHandler__factory.ts index 02813b00c..477109792 100644 --- a/packages/ethers-sdk/src/contracts/factories/IBosonAccountHandler__factory.ts +++ b/packages/ethers-sdk/src/contracts/factories/IBosonAccountHandler__factory.ts @@ -468,6 +468,188 @@ const _abi = [ name: "DisputeResolverFeesRemoved", type: "event", }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "uint256", + name: "disputeResolverId", + type: "uint256", + }, + { + components: [ + { + internalType: "uint256", + name: "id", + type: "uint256", + }, + { + internalType: "uint256", + name: "escalationResponsePeriod", + type: "uint256", + }, + { + internalType: "address", + name: "operator", + type: "address", + }, + { + internalType: "address", + name: "admin", + type: "address", + }, + { + internalType: "address", + name: "clerk", + type: "address", + }, + { + internalType: "address payable", + name: "treasury", + type: "address", + }, + { + internalType: "string", + name: "metadataUri", + type: "string", + }, + { + internalType: "bool", + name: "active", + type: "bool", + }, + ], + indexed: false, + internalType: "struct BosonTypes.DisputeResolver", + name: "disputeResolver", + type: "tuple", + }, + { + components: [ + { + internalType: "uint256", + name: "id", + type: "uint256", + }, + { + internalType: "uint256", + name: "escalationResponsePeriod", + type: "uint256", + }, + { + internalType: "address", + name: "operator", + type: "address", + }, + { + internalType: "address", + name: "admin", + type: "address", + }, + { + internalType: "address", + name: "clerk", + type: "address", + }, + { + internalType: "address payable", + name: "treasury", + type: "address", + }, + { + internalType: "string", + name: "metadataUri", + type: "string", + }, + { + internalType: "bool", + name: "active", + type: "bool", + }, + ], + indexed: false, + internalType: "struct BosonTypes.DisputeResolver", + name: "pendingDisputeResolver", + type: "tuple", + }, + { + indexed: true, + internalType: "address", + name: "executedBy", + type: "address", + }, + ], + name: "DisputeResolverUpdateApplied", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "uint256", + name: "disputeResolverId", + type: "uint256", + }, + { + components: [ + { + internalType: "uint256", + name: "id", + type: "uint256", + }, + { + internalType: "uint256", + name: "escalationResponsePeriod", + type: "uint256", + }, + { + internalType: "address", + name: "operator", + type: "address", + }, + { + internalType: "address", + name: "admin", + type: "address", + }, + { + internalType: "address", + name: "clerk", + type: "address", + }, + { + internalType: "address payable", + name: "treasury", + type: "address", + }, + { + internalType: "string", + name: "metadataUri", + type: "string", + }, + { + internalType: "bool", + name: "active", + type: "bool", + }, + ], + indexed: false, + internalType: "struct BosonTypes.DisputeResolver", + name: "pendingDisputeResolver", + type: "tuple", + }, + { + indexed: true, + internalType: "address", + name: "executedBy", + type: "address", + }, + ], + name: "DisputeResolverUpdatePending", + type: "event", + }, { anonymous: false, inputs: [ @@ -663,6 +845,44 @@ const _abi = [ name: "seller", type: "tuple", }, + { + components: [ + { + internalType: "uint256", + name: "id", + type: "uint256", + }, + { + internalType: "address", + name: "operator", + type: "address", + }, + { + internalType: "address", + name: "admin", + type: "address", + }, + { + internalType: "address", + name: "clerk", + type: "address", + }, + { + internalType: "address payable", + name: "treasury", + type: "address", + }, + { + internalType: "bool", + name: "active", + type: "bool", + }, + ], + indexed: false, + internalType: "struct BosonTypes.Seller", + name: "pendingSeller", + type: "tuple", + }, { components: [ { @@ -681,6 +901,24 @@ const _abi = [ name: "authToken", type: "tuple", }, + { + components: [ + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + { + internalType: "enum BosonTypes.AuthTokenType", + name: "tokenType", + type: "uint8", + }, + ], + indexed: false, + internalType: "struct BosonTypes.AuthToken", + name: "pendingAuthToken", + type: "tuple", + }, { indexed: true, internalType: "address", @@ -688,21 +926,158 @@ const _abi = [ type: "address", }, ], - name: "SellerUpdated", + name: "SellerUpdateApplied", type: "event", }, { + anonymous: false, inputs: [ { + indexed: true, internalType: "uint256", - name: "_disputeResolverId", + name: "sellerId", type: "uint256", }, + { + components: [ + { + internalType: "uint256", + name: "id", + type: "uint256", + }, + { + internalType: "address", + name: "operator", + type: "address", + }, + { + internalType: "address", + name: "admin", + type: "address", + }, + { + internalType: "address", + name: "clerk", + type: "address", + }, + { + internalType: "address payable", + name: "treasury", + type: "address", + }, + { + internalType: "bool", + name: "active", + type: "bool", + }, + ], + indexed: false, + internalType: "struct BosonTypes.Seller", + name: "pendingSeller", + type: "tuple", + }, + { + components: [ + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + { + internalType: "enum BosonTypes.AuthTokenType", + name: "tokenType", + type: "uint8", + }, + ], + indexed: false, + internalType: "struct BosonTypes.AuthToken", + name: "pendingAuthToken", + type: "tuple", + }, + { + indexed: true, + internalType: "address", + name: "executedBy", + type: "address", + }, ], - name: "activateDisputeResolver", - outputs: [], - stateMutability: "nonpayable", - type: "function", + name: "SellerUpdatePending", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "uint256", + name: "sellerId", + type: "uint256", + }, + { + components: [ + { + internalType: "uint256", + name: "id", + type: "uint256", + }, + { + internalType: "address", + name: "operator", + type: "address", + }, + { + internalType: "address", + name: "admin", + type: "address", + }, + { + internalType: "address", + name: "clerk", + type: "address", + }, + { + internalType: "address payable", + name: "treasury", + type: "address", + }, + { + internalType: "bool", + name: "active", + type: "bool", + }, + ], + indexed: false, + internalType: "struct BosonTypes.Seller", + name: "seller", + type: "tuple", + }, + { + components: [ + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + { + internalType: "enum BosonTypes.AuthTokenType", + name: "tokenType", + type: "uint8", + }, + ], + indexed: false, + internalType: "struct BosonTypes.AuthToken", + name: "authToken", + type: "tuple", + }, + { + indexed: true, + internalType: "address", + name: "executedBy", + type: "address", + }, + ], + name: "SellerUpdated", + type: "event", }, { inputs: [ @@ -1524,6 +1899,42 @@ const _abi = [ stateMutability: "view", type: "function", }, + { + inputs: [ + { + internalType: "uint256", + name: "_disputeResolverId", + type: "uint256", + }, + { + internalType: "enum BosonTypes.DisputeResolverUpdateFields[]", + name: "_fieldsToUpdate", + type: "uint8[]", + }, + ], + name: "optInToDisputeResolverUpdate", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "_sellerId", + type: "uint256", + }, + { + internalType: "enum BosonTypes.SellerUpdateFields[]", + name: "_fieldsToUpdate", + type: "uint8[]", + }, + ], + name: "optInToSellerUpdate", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, { inputs: [ { diff --git a/packages/ethers-sdk/src/contracts/factories/IBosonExchangeHandler__factory.ts b/packages/ethers-sdk/src/contracts/factories/IBosonExchangeHandler__factory.ts index 5fe66dc86..df1cb4762 100644 --- a/packages/ethers-sdk/src/contracts/factories/IBosonExchangeHandler__factory.ts +++ b/packages/ethers-sdk/src/contracts/factories/IBosonExchangeHandler__factory.ts @@ -641,6 +641,29 @@ const _abi = [ stateMutability: "payable", type: "function", }, + { + inputs: [ + { + internalType: "address payable", + name: "_buyer", + type: "address", + }, + { + internalType: "uint256", + name: "_offerId", + type: "uint256", + }, + { + internalType: "uint256", + name: "_exchangeId", + type: "uint256", + }, + ], + name: "commitToPreMintedOffer", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, { inputs: [ { diff --git a/packages/ethers-sdk/src/contracts/factories/IBosonGroupHandler__factory.ts b/packages/ethers-sdk/src/contracts/factories/IBosonGroupHandler__factory.ts new file mode 100644 index 000000000..420f0fa61 --- /dev/null +++ b/packages/ethers-sdk/src/contracts/factories/IBosonGroupHandler__factory.ts @@ -0,0 +1,442 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, Signer, utils } from "ethers"; +import { Provider } from "@ethersproject/providers"; +import type { + IBosonGroupHandler, + IBosonGroupHandlerInterface, +} from "../IBosonGroupHandler"; + +const _abi = [ + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "uint256", + name: "groupId", + type: "uint256", + }, + { + indexed: true, + internalType: "uint256", + name: "sellerId", + type: "uint256", + }, + { + components: [ + { + internalType: "uint256", + name: "id", + type: "uint256", + }, + { + internalType: "uint256", + name: "sellerId", + type: "uint256", + }, + { + internalType: "uint256[]", + name: "offerIds", + type: "uint256[]", + }, + ], + indexed: false, + internalType: "struct BosonTypes.Group", + name: "group", + type: "tuple", + }, + { + components: [ + { + internalType: "enum BosonTypes.EvaluationMethod", + name: "method", + type: "uint8", + }, + { + internalType: "enum BosonTypes.TokenType", + name: "tokenType", + type: "uint8", + }, + { + internalType: "address", + name: "tokenAddress", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + { + internalType: "uint256", + name: "threshold", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxCommits", + type: "uint256", + }, + ], + indexed: false, + internalType: "struct BosonTypes.Condition", + name: "condition", + type: "tuple", + }, + { + indexed: true, + internalType: "address", + name: "executedBy", + type: "address", + }, + ], + name: "GroupCreated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "uint256", + name: "groupId", + type: "uint256", + }, + { + indexed: true, + internalType: "uint256", + name: "sellerId", + type: "uint256", + }, + { + components: [ + { + internalType: "uint256", + name: "id", + type: "uint256", + }, + { + internalType: "uint256", + name: "sellerId", + type: "uint256", + }, + { + internalType: "uint256[]", + name: "offerIds", + type: "uint256[]", + }, + ], + indexed: false, + internalType: "struct BosonTypes.Group", + name: "group", + type: "tuple", + }, + { + components: [ + { + internalType: "enum BosonTypes.EvaluationMethod", + name: "method", + type: "uint8", + }, + { + internalType: "enum BosonTypes.TokenType", + name: "tokenType", + type: "uint8", + }, + { + internalType: "address", + name: "tokenAddress", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + { + internalType: "uint256", + name: "threshold", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxCommits", + type: "uint256", + }, + ], + indexed: false, + internalType: "struct BosonTypes.Condition", + name: "condition", + type: "tuple", + }, + { + indexed: true, + internalType: "address", + name: "executedBy", + type: "address", + }, + ], + name: "GroupUpdated", + type: "event", + }, + { + inputs: [ + { + internalType: "uint256", + name: "_groupId", + type: "uint256", + }, + { + internalType: "uint256[]", + name: "_offerIds", + type: "uint256[]", + }, + ], + name: "addOffersToGroup", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + components: [ + { + internalType: "uint256", + name: "id", + type: "uint256", + }, + { + internalType: "uint256", + name: "sellerId", + type: "uint256", + }, + { + internalType: "uint256[]", + name: "offerIds", + type: "uint256[]", + }, + ], + internalType: "struct BosonTypes.Group", + name: "_group", + type: "tuple", + }, + { + components: [ + { + internalType: "enum BosonTypes.EvaluationMethod", + name: "method", + type: "uint8", + }, + { + internalType: "enum BosonTypes.TokenType", + name: "tokenType", + type: "uint8", + }, + { + internalType: "address", + name: "tokenAddress", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + { + internalType: "uint256", + name: "threshold", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxCommits", + type: "uint256", + }, + ], + internalType: "struct BosonTypes.Condition", + name: "_condition", + type: "tuple", + }, + ], + name: "createGroup", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "_groupId", + type: "uint256", + }, + ], + name: "getGroup", + outputs: [ + { + internalType: "bool", + name: "exists", + type: "bool", + }, + { + components: [ + { + internalType: "uint256", + name: "id", + type: "uint256", + }, + { + internalType: "uint256", + name: "sellerId", + type: "uint256", + }, + { + internalType: "uint256[]", + name: "offerIds", + type: "uint256[]", + }, + ], + internalType: "struct BosonTypes.Group", + name: "group", + type: "tuple", + }, + { + components: [ + { + internalType: "enum BosonTypes.EvaluationMethod", + name: "method", + type: "uint8", + }, + { + internalType: "enum BosonTypes.TokenType", + name: "tokenType", + type: "uint8", + }, + { + internalType: "address", + name: "tokenAddress", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + { + internalType: "uint256", + name: "threshold", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxCommits", + type: "uint256", + }, + ], + internalType: "struct BosonTypes.Condition", + name: "condition", + type: "tuple", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getNextGroupId", + outputs: [ + { + internalType: "uint256", + name: "nextGroupId", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "_groupId", + type: "uint256", + }, + { + internalType: "uint256[]", + name: "_offerIds", + type: "uint256[]", + }, + ], + name: "removeOffersFromGroup", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "_groupId", + type: "uint256", + }, + { + components: [ + { + internalType: "enum BosonTypes.EvaluationMethod", + name: "method", + type: "uint8", + }, + { + internalType: "enum BosonTypes.TokenType", + name: "tokenType", + type: "uint8", + }, + { + internalType: "address", + name: "tokenAddress", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + { + internalType: "uint256", + name: "threshold", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxCommits", + type: "uint256", + }, + ], + internalType: "struct BosonTypes.Condition", + name: "_condition", + type: "tuple", + }, + ], + name: "setGroupCondition", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, +]; + +export class IBosonGroupHandler__factory { + static readonly abi = _abi; + static createInterface(): IBosonGroupHandlerInterface { + return new utils.Interface(_abi) as IBosonGroupHandlerInterface; + } + static connect( + address: string, + signerOrProvider: Signer | Provider + ): IBosonGroupHandler { + return new Contract(address, _abi, signerOrProvider) as IBosonGroupHandler; + } +} diff --git a/packages/ethers-sdk/src/contracts/factories/IBosonMetaTransactionsHandler__factory.ts b/packages/ethers-sdk/src/contracts/factories/IBosonMetaTransactionsHandler__factory.ts index c546408cc..d27f71548 100644 --- a/packages/ethers-sdk/src/contracts/factories/IBosonMetaTransactionsHandler__factory.ts +++ b/packages/ethers-sdk/src/contracts/factories/IBosonMetaTransactionsHandler__factory.ts @@ -10,6 +10,31 @@ import type { } from "../IBosonMetaTransactionsHandler"; const _abi = [ + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "bytes32[]", + name: "functionNameHashes", + type: "bytes32[]", + }, + { + indexed: false, + internalType: "bool", + name: "isAllowlisted", + type: "bool", + }, + { + indexed: true, + internalType: "address", + name: "executedBy", + type: "address", + }, + ], + name: "FunctionsAllowlisted", + type: "event", + }, { anonymous: false, inputs: [ @@ -90,6 +115,44 @@ const _abi = [ stateMutability: "payable", type: "function", }, + { + inputs: [ + { + internalType: "string", + name: "_functionName", + type: "string", + }, + ], + name: "isFunctionAllowlisted", + outputs: [ + { + internalType: "bool", + name: "isAllowlisted", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "_functionNameHash", + type: "bytes32", + }, + ], + name: "isFunctionAllowlisted", + outputs: [ + { + internalType: "bool", + name: "isAllowlisted", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, { inputs: [ { @@ -114,6 +177,24 @@ const _abi = [ stateMutability: "view", type: "function", }, + { + inputs: [ + { + internalType: "bytes32[]", + name: "_functionNameHashes", + type: "bytes32[]", + }, + { + internalType: "bool", + name: "_isAllowlisted", + type: "bool", + }, + ], + name: "setAllowlistedFunctions", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, ]; export class IBosonMetaTransactionsHandler__factory { diff --git a/packages/ethers-sdk/src/contracts/factories/IBosonOfferHandler__factory.ts b/packages/ethers-sdk/src/contracts/factories/IBosonOfferHandler__factory.ts index 7b5e41786..dbafed67a 100644 --- a/packages/ethers-sdk/src/contracts/factories/IBosonOfferHandler__factory.ts +++ b/packages/ethers-sdk/src/contracts/factories/IBosonOfferHandler__factory.ts @@ -252,6 +252,43 @@ const _abi = [ name: "OfferVoided", type: "event", }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "uint256", + name: "offerId", + type: "uint256", + }, + { + indexed: true, + internalType: "uint256", + name: "sellerId", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "startExchangeId", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "endExchangeId", + type: "uint256", + }, + { + indexed: true, + internalType: "address", + name: "executedBy", + type: "address", + }, + ], + name: "RangeReserved", + type: "event", + }, { inputs: [ { @@ -766,6 +803,24 @@ const _abi = [ stateMutability: "view", type: "function", }, + { + inputs: [ + { + internalType: "uint256", + name: "_offerId", + type: "uint256", + }, + { + internalType: "uint256", + name: "_length", + type: "uint256", + }, + ], + name: "reserveRange", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, { inputs: [ { diff --git a/packages/ethers-sdk/src/contracts/factories/IBosonOrchestrationHandler__factory.ts b/packages/ethers-sdk/src/contracts/factories/IBosonOrchestrationHandler__factory.ts index 9728b84c7..dab6ef91a 100644 --- a/packages/ethers-sdk/src/contracts/factories/IBosonOrchestrationHandler__factory.ts +++ b/packages/ethers-sdk/src/contracts/factories/IBosonOrchestrationHandler__factory.ts @@ -291,73 +291,6 @@ const _abi = [ name: "BuyerUpdated", type: "event", }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "uint256", - name: "disputeResolverId", - type: "uint256", - }, - { - components: [ - { - internalType: "uint256", - name: "id", - type: "uint256", - }, - { - internalType: "uint256", - name: "escalationResponsePeriod", - type: "uint256", - }, - { - internalType: "address", - name: "operator", - type: "address", - }, - { - internalType: "address", - name: "admin", - type: "address", - }, - { - internalType: "address", - name: "clerk", - type: "address", - }, - { - internalType: "address payable", - name: "treasury", - type: "address", - }, - { - internalType: "string", - name: "metadataUri", - type: "string", - }, - { - internalType: "bool", - name: "active", - type: "bool", - }, - ], - indexed: false, - internalType: "struct BosonTypes.DisputeResolver", - name: "disputeResolver", - type: "tuple", - }, - { - indexed: true, - internalType: "address", - name: "executedBy", - type: "address", - }, - ], - name: "DisputeResolverActivated", - type: "event", - }, { anonymous: false, inputs: [ @@ -578,6 +511,121 @@ const _abi = [ name: "disputeResolver", type: "tuple", }, + { + components: [ + { + internalType: "uint256", + name: "id", + type: "uint256", + }, + { + internalType: "uint256", + name: "escalationResponsePeriod", + type: "uint256", + }, + { + internalType: "address", + name: "operator", + type: "address", + }, + { + internalType: "address", + name: "admin", + type: "address", + }, + { + internalType: "address", + name: "clerk", + type: "address", + }, + { + internalType: "address payable", + name: "treasury", + type: "address", + }, + { + internalType: "string", + name: "metadataUri", + type: "string", + }, + { + internalType: "bool", + name: "active", + type: "bool", + }, + ], + indexed: false, + internalType: "struct BosonTypes.DisputeResolver", + name: "pendingDisputeResolver", + type: "tuple", + }, + { + indexed: true, + internalType: "address", + name: "executedBy", + type: "address", + }, + ], + name: "DisputeResolverUpdateApplied", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "uint256", + name: "disputeResolverId", + type: "uint256", + }, + { + components: [ + { + internalType: "uint256", + name: "id", + type: "uint256", + }, + { + internalType: "uint256", + name: "escalationResponsePeriod", + type: "uint256", + }, + { + internalType: "address", + name: "operator", + type: "address", + }, + { + internalType: "address", + name: "admin", + type: "address", + }, + { + internalType: "address", + name: "clerk", + type: "address", + }, + { + internalType: "address payable", + name: "treasury", + type: "address", + }, + { + internalType: "string", + name: "metadataUri", + type: "string", + }, + { + internalType: "bool", + name: "active", + type: "bool", + }, + ], + indexed: false, + internalType: "struct BosonTypes.DisputeResolver", + name: "pendingDisputeResolver", + type: "tuple", + }, { indexed: true, internalType: "address", @@ -585,7 +633,7 @@ const _abi = [ type: "address", }, ], - name: "DisputeResolverUpdated", + name: "DisputeResolverUpdatePending", type: "event", }, { @@ -1002,6 +1050,43 @@ const _abi = [ name: "OfferVoided", type: "event", }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "uint256", + name: "offerId", + type: "uint256", + }, + { + indexed: true, + internalType: "uint256", + name: "sellerId", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "startExchangeId", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "endExchangeId", + type: "uint256", + }, + { + indexed: true, + internalType: "address", + name: "executedBy", + type: "address", + }, + ], + name: "RangeReserved", + type: "event", + }, { anonymous: false, inputs: [ @@ -1130,6 +1215,44 @@ const _abi = [ name: "seller", type: "tuple", }, + { + components: [ + { + internalType: "uint256", + name: "id", + type: "uint256", + }, + { + internalType: "address", + name: "operator", + type: "address", + }, + { + internalType: "address", + name: "admin", + type: "address", + }, + { + internalType: "address", + name: "clerk", + type: "address", + }, + { + internalType: "address payable", + name: "treasury", + type: "address", + }, + { + internalType: "bool", + name: "active", + type: "bool", + }, + ], + indexed: false, + internalType: "struct BosonTypes.Seller", + name: "pendingSeller", + type: "tuple", + }, { components: [ { @@ -1149,14 +1272,107 @@ const _abi = [ type: "tuple", }, { - indexed: true, - internalType: "address", - name: "executedBy", - type: "address", - }, - ], - name: "SellerUpdated", - type: "event", + components: [ + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + { + internalType: "enum BosonTypes.AuthTokenType", + name: "tokenType", + type: "uint8", + }, + ], + indexed: false, + internalType: "struct BosonTypes.AuthToken", + name: "pendingAuthToken", + type: "tuple", + }, + { + indexed: true, + internalType: "address", + name: "executedBy", + type: "address", + }, + ], + name: "SellerUpdateApplied", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "uint256", + name: "sellerId", + type: "uint256", + }, + { + components: [ + { + internalType: "uint256", + name: "id", + type: "uint256", + }, + { + internalType: "address", + name: "operator", + type: "address", + }, + { + internalType: "address", + name: "admin", + type: "address", + }, + { + internalType: "address", + name: "clerk", + type: "address", + }, + { + internalType: "address payable", + name: "treasury", + type: "address", + }, + { + internalType: "bool", + name: "active", + type: "bool", + }, + ], + indexed: false, + internalType: "struct BosonTypes.Seller", + name: "pendingSeller", + type: "tuple", + }, + { + components: [ + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + { + internalType: "enum BosonTypes.AuthTokenType", + name: "tokenType", + type: "uint8", + }, + ], + indexed: false, + internalType: "struct BosonTypes.AuthToken", + name: "pendingAuthToken", + type: "tuple", + }, + { + indexed: true, + internalType: "address", + name: "executedBy", + type: "address", + }, + ], + name: "SellerUpdatePending", + type: "event", }, { anonymous: false, @@ -1461,13 +1677,1454 @@ const _abi = [ type: "uint256", }, ], - name: "createOfferAddToGroup", + name: "createOfferAddToGroup", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + components: [ + { + internalType: "uint256", + name: "id", + type: "uint256", + }, + { + internalType: "uint256", + name: "sellerId", + type: "uint256", + }, + { + internalType: "uint256", + name: "price", + type: "uint256", + }, + { + internalType: "uint256", + name: "sellerDeposit", + type: "uint256", + }, + { + internalType: "uint256", + name: "buyerCancelPenalty", + type: "uint256", + }, + { + internalType: "uint256", + name: "quantityAvailable", + type: "uint256", + }, + { + internalType: "address", + name: "exchangeToken", + type: "address", + }, + { + internalType: "string", + name: "metadataUri", + type: "string", + }, + { + internalType: "string", + name: "metadataHash", + type: "string", + }, + { + internalType: "bool", + name: "voided", + type: "bool", + }, + ], + internalType: "struct BosonTypes.Offer", + name: "_offer", + type: "tuple", + }, + { + components: [ + { + internalType: "uint256", + name: "validFrom", + type: "uint256", + }, + { + internalType: "uint256", + name: "validUntil", + type: "uint256", + }, + { + internalType: "uint256", + name: "voucherRedeemableFrom", + type: "uint256", + }, + { + internalType: "uint256", + name: "voucherRedeemableUntil", + type: "uint256", + }, + ], + internalType: "struct BosonTypes.OfferDates", + name: "_offerDates", + type: "tuple", + }, + { + components: [ + { + internalType: "uint256", + name: "disputePeriod", + type: "uint256", + }, + { + internalType: "uint256", + name: "voucherValid", + type: "uint256", + }, + { + internalType: "uint256", + name: "resolutionPeriod", + type: "uint256", + }, + ], + internalType: "struct BosonTypes.OfferDurations", + name: "_offerDurations", + type: "tuple", + }, + { + internalType: "uint256", + name: "_disputeResolverId", + type: "uint256", + }, + { + components: [ + { + internalType: "uint256", + name: "id", + type: "uint256", + }, + { + internalType: "uint256", + name: "sellerId", + type: "uint256", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + { + internalType: "uint256", + name: "supplyAvailable", + type: "uint256", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + { + internalType: "address", + name: "tokenAddress", + type: "address", + }, + { + internalType: "enum BosonTypes.TokenType", + name: "tokenType", + type: "uint8", + }, + ], + internalType: "struct BosonTypes.Twin", + name: "_twin", + type: "tuple", + }, + { + internalType: "uint256", + name: "_agentId", + type: "uint256", + }, + ], + name: "createOfferAndTwinWithBundle", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + components: [ + { + internalType: "uint256", + name: "id", + type: "uint256", + }, + { + internalType: "uint256", + name: "sellerId", + type: "uint256", + }, + { + internalType: "uint256", + name: "price", + type: "uint256", + }, + { + internalType: "uint256", + name: "sellerDeposit", + type: "uint256", + }, + { + internalType: "uint256", + name: "buyerCancelPenalty", + type: "uint256", + }, + { + internalType: "uint256", + name: "quantityAvailable", + type: "uint256", + }, + { + internalType: "address", + name: "exchangeToken", + type: "address", + }, + { + internalType: "string", + name: "metadataUri", + type: "string", + }, + { + internalType: "string", + name: "metadataHash", + type: "string", + }, + { + internalType: "bool", + name: "voided", + type: "bool", + }, + ], + internalType: "struct BosonTypes.Offer", + name: "_offer", + type: "tuple", + }, + { + components: [ + { + internalType: "uint256", + name: "validFrom", + type: "uint256", + }, + { + internalType: "uint256", + name: "validUntil", + type: "uint256", + }, + { + internalType: "uint256", + name: "voucherRedeemableFrom", + type: "uint256", + }, + { + internalType: "uint256", + name: "voucherRedeemableUntil", + type: "uint256", + }, + ], + internalType: "struct BosonTypes.OfferDates", + name: "_offerDates", + type: "tuple", + }, + { + components: [ + { + internalType: "uint256", + name: "disputePeriod", + type: "uint256", + }, + { + internalType: "uint256", + name: "voucherValid", + type: "uint256", + }, + { + internalType: "uint256", + name: "resolutionPeriod", + type: "uint256", + }, + ], + internalType: "struct BosonTypes.OfferDurations", + name: "_offerDurations", + type: "tuple", + }, + { + internalType: "uint256", + name: "_disputeResolverId", + type: "uint256", + }, + { + components: [ + { + internalType: "enum BosonTypes.EvaluationMethod", + name: "method", + type: "uint8", + }, + { + internalType: "enum BosonTypes.TokenType", + name: "tokenType", + type: "uint8", + }, + { + internalType: "address", + name: "tokenAddress", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + { + internalType: "uint256", + name: "threshold", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxCommits", + type: "uint256", + }, + ], + internalType: "struct BosonTypes.Condition", + name: "_condition", + type: "tuple", + }, + { + internalType: "uint256", + name: "_agentId", + type: "uint256", + }, + ], + name: "createOfferWithCondition", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + components: [ + { + internalType: "uint256", + name: "id", + type: "uint256", + }, + { + internalType: "uint256", + name: "sellerId", + type: "uint256", + }, + { + internalType: "uint256", + name: "price", + type: "uint256", + }, + { + internalType: "uint256", + name: "sellerDeposit", + type: "uint256", + }, + { + internalType: "uint256", + name: "buyerCancelPenalty", + type: "uint256", + }, + { + internalType: "uint256", + name: "quantityAvailable", + type: "uint256", + }, + { + internalType: "address", + name: "exchangeToken", + type: "address", + }, + { + internalType: "string", + name: "metadataUri", + type: "string", + }, + { + internalType: "string", + name: "metadataHash", + type: "string", + }, + { + internalType: "bool", + name: "voided", + type: "bool", + }, + ], + internalType: "struct BosonTypes.Offer", + name: "_offer", + type: "tuple", + }, + { + components: [ + { + internalType: "uint256", + name: "validFrom", + type: "uint256", + }, + { + internalType: "uint256", + name: "validUntil", + type: "uint256", + }, + { + internalType: "uint256", + name: "voucherRedeemableFrom", + type: "uint256", + }, + { + internalType: "uint256", + name: "voucherRedeemableUntil", + type: "uint256", + }, + ], + internalType: "struct BosonTypes.OfferDates", + name: "_offerDates", + type: "tuple", + }, + { + components: [ + { + internalType: "uint256", + name: "disputePeriod", + type: "uint256", + }, + { + internalType: "uint256", + name: "voucherValid", + type: "uint256", + }, + { + internalType: "uint256", + name: "resolutionPeriod", + type: "uint256", + }, + ], + internalType: "struct BosonTypes.OfferDurations", + name: "_offerDurations", + type: "tuple", + }, + { + internalType: "uint256", + name: "_disputeResolverId", + type: "uint256", + }, + { + components: [ + { + internalType: "enum BosonTypes.EvaluationMethod", + name: "method", + type: "uint8", + }, + { + internalType: "enum BosonTypes.TokenType", + name: "tokenType", + type: "uint8", + }, + { + internalType: "address", + name: "tokenAddress", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + { + internalType: "uint256", + name: "threshold", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxCommits", + type: "uint256", + }, + ], + internalType: "struct BosonTypes.Condition", + name: "_condition", + type: "tuple", + }, + { + components: [ + { + internalType: "uint256", + name: "id", + type: "uint256", + }, + { + internalType: "uint256", + name: "sellerId", + type: "uint256", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + { + internalType: "uint256", + name: "supplyAvailable", + type: "uint256", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + { + internalType: "address", + name: "tokenAddress", + type: "address", + }, + { + internalType: "enum BosonTypes.TokenType", + name: "tokenType", + type: "uint8", + }, + ], + internalType: "struct BosonTypes.Twin", + name: "_twin", + type: "tuple", + }, + { + internalType: "uint256", + name: "_agentId", + type: "uint256", + }, + ], + name: "createOfferWithConditionAndTwinAndBundle", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + components: [ + { + internalType: "uint256", + name: "id", + type: "uint256", + }, + { + internalType: "uint256", + name: "sellerId", + type: "uint256", + }, + { + internalType: "uint256", + name: "price", + type: "uint256", + }, + { + internalType: "uint256", + name: "sellerDeposit", + type: "uint256", + }, + { + internalType: "uint256", + name: "buyerCancelPenalty", + type: "uint256", + }, + { + internalType: "uint256", + name: "quantityAvailable", + type: "uint256", + }, + { + internalType: "address", + name: "exchangeToken", + type: "address", + }, + { + internalType: "string", + name: "metadataUri", + type: "string", + }, + { + internalType: "string", + name: "metadataHash", + type: "string", + }, + { + internalType: "bool", + name: "voided", + type: "bool", + }, + ], + internalType: "struct BosonTypes.Offer", + name: "_offer", + type: "tuple", + }, + { + components: [ + { + internalType: "uint256", + name: "validFrom", + type: "uint256", + }, + { + internalType: "uint256", + name: "validUntil", + type: "uint256", + }, + { + internalType: "uint256", + name: "voucherRedeemableFrom", + type: "uint256", + }, + { + internalType: "uint256", + name: "voucherRedeemableUntil", + type: "uint256", + }, + ], + internalType: "struct BosonTypes.OfferDates", + name: "_offerDates", + type: "tuple", + }, + { + components: [ + { + internalType: "uint256", + name: "disputePeriod", + type: "uint256", + }, + { + internalType: "uint256", + name: "voucherValid", + type: "uint256", + }, + { + internalType: "uint256", + name: "resolutionPeriod", + type: "uint256", + }, + ], + internalType: "struct BosonTypes.OfferDurations", + name: "_offerDurations", + type: "tuple", + }, + { + internalType: "uint256", + name: "_disputeResolverId", + type: "uint256", + }, + { + internalType: "uint256", + name: "_reservedRangeLength", + type: "uint256", + }, + { + internalType: "uint256", + name: "_groupId", + type: "uint256", + }, + { + internalType: "uint256", + name: "_agentId", + type: "uint256", + }, + ], + name: "createPremintedOfferAddToGroup", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + components: [ + { + internalType: "uint256", + name: "id", + type: "uint256", + }, + { + internalType: "uint256", + name: "sellerId", + type: "uint256", + }, + { + internalType: "uint256", + name: "price", + type: "uint256", + }, + { + internalType: "uint256", + name: "sellerDeposit", + type: "uint256", + }, + { + internalType: "uint256", + name: "buyerCancelPenalty", + type: "uint256", + }, + { + internalType: "uint256", + name: "quantityAvailable", + type: "uint256", + }, + { + internalType: "address", + name: "exchangeToken", + type: "address", + }, + { + internalType: "string", + name: "metadataUri", + type: "string", + }, + { + internalType: "string", + name: "metadataHash", + type: "string", + }, + { + internalType: "bool", + name: "voided", + type: "bool", + }, + ], + internalType: "struct BosonTypes.Offer", + name: "_offer", + type: "tuple", + }, + { + components: [ + { + internalType: "uint256", + name: "validFrom", + type: "uint256", + }, + { + internalType: "uint256", + name: "validUntil", + type: "uint256", + }, + { + internalType: "uint256", + name: "voucherRedeemableFrom", + type: "uint256", + }, + { + internalType: "uint256", + name: "voucherRedeemableUntil", + type: "uint256", + }, + ], + internalType: "struct BosonTypes.OfferDates", + name: "_offerDates", + type: "tuple", + }, + { + components: [ + { + internalType: "uint256", + name: "disputePeriod", + type: "uint256", + }, + { + internalType: "uint256", + name: "voucherValid", + type: "uint256", + }, + { + internalType: "uint256", + name: "resolutionPeriod", + type: "uint256", + }, + ], + internalType: "struct BosonTypes.OfferDurations", + name: "_offerDurations", + type: "tuple", + }, + { + internalType: "uint256", + name: "_disputeResolverId", + type: "uint256", + }, + { + internalType: "uint256", + name: "_reservedRangeLength", + type: "uint256", + }, + { + components: [ + { + internalType: "uint256", + name: "id", + type: "uint256", + }, + { + internalType: "uint256", + name: "sellerId", + type: "uint256", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + { + internalType: "uint256", + name: "supplyAvailable", + type: "uint256", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + { + internalType: "address", + name: "tokenAddress", + type: "address", + }, + { + internalType: "enum BosonTypes.TokenType", + name: "tokenType", + type: "uint8", + }, + ], + internalType: "struct BosonTypes.Twin", + name: "_twin", + type: "tuple", + }, + { + internalType: "uint256", + name: "_agentId", + type: "uint256", + }, + ], + name: "createPremintedOfferAndTwinWithBundle", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + components: [ + { + internalType: "uint256", + name: "id", + type: "uint256", + }, + { + internalType: "uint256", + name: "sellerId", + type: "uint256", + }, + { + internalType: "uint256", + name: "price", + type: "uint256", + }, + { + internalType: "uint256", + name: "sellerDeposit", + type: "uint256", + }, + { + internalType: "uint256", + name: "buyerCancelPenalty", + type: "uint256", + }, + { + internalType: "uint256", + name: "quantityAvailable", + type: "uint256", + }, + { + internalType: "address", + name: "exchangeToken", + type: "address", + }, + { + internalType: "string", + name: "metadataUri", + type: "string", + }, + { + internalType: "string", + name: "metadataHash", + type: "string", + }, + { + internalType: "bool", + name: "voided", + type: "bool", + }, + ], + internalType: "struct BosonTypes.Offer", + name: "_offer", + type: "tuple", + }, + { + components: [ + { + internalType: "uint256", + name: "validFrom", + type: "uint256", + }, + { + internalType: "uint256", + name: "validUntil", + type: "uint256", + }, + { + internalType: "uint256", + name: "voucherRedeemableFrom", + type: "uint256", + }, + { + internalType: "uint256", + name: "voucherRedeemableUntil", + type: "uint256", + }, + ], + internalType: "struct BosonTypes.OfferDates", + name: "_offerDates", + type: "tuple", + }, + { + components: [ + { + internalType: "uint256", + name: "disputePeriod", + type: "uint256", + }, + { + internalType: "uint256", + name: "voucherValid", + type: "uint256", + }, + { + internalType: "uint256", + name: "resolutionPeriod", + type: "uint256", + }, + ], + internalType: "struct BosonTypes.OfferDurations", + name: "_offerDurations", + type: "tuple", + }, + { + internalType: "uint256", + name: "_disputeResolverId", + type: "uint256", + }, + { + internalType: "uint256", + name: "_reservedRangeLength", + type: "uint256", + }, + { + components: [ + { + internalType: "enum BosonTypes.EvaluationMethod", + name: "method", + type: "uint8", + }, + { + internalType: "enum BosonTypes.TokenType", + name: "tokenType", + type: "uint8", + }, + { + internalType: "address", + name: "tokenAddress", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + { + internalType: "uint256", + name: "threshold", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxCommits", + type: "uint256", + }, + ], + internalType: "struct BosonTypes.Condition", + name: "_condition", + type: "tuple", + }, + { + internalType: "uint256", + name: "_agentId", + type: "uint256", + }, + ], + name: "createPremintedOfferWithCondition", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + components: [ + { + internalType: "uint256", + name: "id", + type: "uint256", + }, + { + internalType: "uint256", + name: "sellerId", + type: "uint256", + }, + { + internalType: "uint256", + name: "price", + type: "uint256", + }, + { + internalType: "uint256", + name: "sellerDeposit", + type: "uint256", + }, + { + internalType: "uint256", + name: "buyerCancelPenalty", + type: "uint256", + }, + { + internalType: "uint256", + name: "quantityAvailable", + type: "uint256", + }, + { + internalType: "address", + name: "exchangeToken", + type: "address", + }, + { + internalType: "string", + name: "metadataUri", + type: "string", + }, + { + internalType: "string", + name: "metadataHash", + type: "string", + }, + { + internalType: "bool", + name: "voided", + type: "bool", + }, + ], + internalType: "struct BosonTypes.Offer", + name: "_offer", + type: "tuple", + }, + { + components: [ + { + internalType: "uint256", + name: "validFrom", + type: "uint256", + }, + { + internalType: "uint256", + name: "validUntil", + type: "uint256", + }, + { + internalType: "uint256", + name: "voucherRedeemableFrom", + type: "uint256", + }, + { + internalType: "uint256", + name: "voucherRedeemableUntil", + type: "uint256", + }, + ], + internalType: "struct BosonTypes.OfferDates", + name: "_offerDates", + type: "tuple", + }, + { + components: [ + { + internalType: "uint256", + name: "disputePeriod", + type: "uint256", + }, + { + internalType: "uint256", + name: "voucherValid", + type: "uint256", + }, + { + internalType: "uint256", + name: "resolutionPeriod", + type: "uint256", + }, + ], + internalType: "struct BosonTypes.OfferDurations", + name: "_offerDurations", + type: "tuple", + }, + { + internalType: "uint256", + name: "_disputeResolverId", + type: "uint256", + }, + { + internalType: "uint256", + name: "_reservedRangeLength", + type: "uint256", + }, + { + components: [ + { + internalType: "enum BosonTypes.EvaluationMethod", + name: "method", + type: "uint8", + }, + { + internalType: "enum BosonTypes.TokenType", + name: "tokenType", + type: "uint8", + }, + { + internalType: "address", + name: "tokenAddress", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + { + internalType: "uint256", + name: "threshold", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxCommits", + type: "uint256", + }, + ], + internalType: "struct BosonTypes.Condition", + name: "_condition", + type: "tuple", + }, + { + components: [ + { + internalType: "uint256", + name: "id", + type: "uint256", + }, + { + internalType: "uint256", + name: "sellerId", + type: "uint256", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + { + internalType: "uint256", + name: "supplyAvailable", + type: "uint256", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + { + internalType: "address", + name: "tokenAddress", + type: "address", + }, + { + internalType: "enum BosonTypes.TokenType", + name: "tokenType", + type: "uint8", + }, + ], + internalType: "struct BosonTypes.Twin", + name: "_twin", + type: "tuple", + }, + { + internalType: "uint256", + name: "_agentId", + type: "uint256", + }, + ], + name: "createPremintedOfferWithConditionAndTwinAndBundle", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + components: [ + { + internalType: "uint256", + name: "id", + type: "uint256", + }, + { + internalType: "address", + name: "operator", + type: "address", + }, + { + internalType: "address", + name: "admin", + type: "address", + }, + { + internalType: "address", + name: "clerk", + type: "address", + }, + { + internalType: "address payable", + name: "treasury", + type: "address", + }, + { + internalType: "bool", + name: "active", + type: "bool", + }, + ], + internalType: "struct BosonTypes.Seller", + name: "_seller", + type: "tuple", + }, + { + components: [ + { + internalType: "uint256", + name: "id", + type: "uint256", + }, + { + internalType: "uint256", + name: "sellerId", + type: "uint256", + }, + { + internalType: "uint256", + name: "price", + type: "uint256", + }, + { + internalType: "uint256", + name: "sellerDeposit", + type: "uint256", + }, + { + internalType: "uint256", + name: "buyerCancelPenalty", + type: "uint256", + }, + { + internalType: "uint256", + name: "quantityAvailable", + type: "uint256", + }, + { + internalType: "address", + name: "exchangeToken", + type: "address", + }, + { + internalType: "string", + name: "metadataUri", + type: "string", + }, + { + internalType: "string", + name: "metadataHash", + type: "string", + }, + { + internalType: "bool", + name: "voided", + type: "bool", + }, + ], + internalType: "struct BosonTypes.Offer", + name: "_offer", + type: "tuple", + }, + { + components: [ + { + internalType: "uint256", + name: "validFrom", + type: "uint256", + }, + { + internalType: "uint256", + name: "validUntil", + type: "uint256", + }, + { + internalType: "uint256", + name: "voucherRedeemableFrom", + type: "uint256", + }, + { + internalType: "uint256", + name: "voucherRedeemableUntil", + type: "uint256", + }, + ], + internalType: "struct BosonTypes.OfferDates", + name: "_offerDates", + type: "tuple", + }, + { + components: [ + { + internalType: "uint256", + name: "disputePeriod", + type: "uint256", + }, + { + internalType: "uint256", + name: "voucherValid", + type: "uint256", + }, + { + internalType: "uint256", + name: "resolutionPeriod", + type: "uint256", + }, + ], + internalType: "struct BosonTypes.OfferDurations", + name: "_offerDurations", + type: "tuple", + }, + { + internalType: "uint256", + name: "_disputeResolverId", + type: "uint256", + }, + { + components: [ + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + { + internalType: "enum BosonTypes.AuthTokenType", + name: "tokenType", + type: "uint8", + }, + ], + internalType: "struct BosonTypes.AuthToken", + name: "_authToken", + type: "tuple", + }, + { + components: [ + { + internalType: "string", + name: "contractURI", + type: "string", + }, + { + internalType: "uint256", + name: "royaltyPercentage", + type: "uint256", + }, + ], + internalType: "struct BosonTypes.VoucherInitValues", + name: "_voucherInitValues", + type: "tuple", + }, + { + internalType: "uint256", + name: "_agentId", + type: "uint256", + }, + ], + name: "createSellerAndOffer", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [ + { + components: [ + { + internalType: "uint256", + name: "id", + type: "uint256", + }, + { + internalType: "address", + name: "operator", + type: "address", + }, + { + internalType: "address", + name: "admin", + type: "address", + }, + { + internalType: "address", + name: "clerk", + type: "address", + }, + { + internalType: "address payable", + name: "treasury", + type: "address", + }, + { + internalType: "bool", + name: "active", + type: "bool", + }, + ], + internalType: "struct BosonTypes.Seller", + name: "_seller", + type: "tuple", + }, { components: [ { @@ -1621,19 +3278,90 @@ const _abi = [ name: "_twin", type: "tuple", }, + { + components: [ + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + { + internalType: "enum BosonTypes.AuthTokenType", + name: "tokenType", + type: "uint8", + }, + ], + internalType: "struct BosonTypes.AuthToken", + name: "_authToken", + type: "tuple", + }, + { + components: [ + { + internalType: "string", + name: "contractURI", + type: "string", + }, + { + internalType: "uint256", + name: "royaltyPercentage", + type: "uint256", + }, + ], + internalType: "struct BosonTypes.VoucherInitValues", + name: "_voucherInitValues", + type: "tuple", + }, { internalType: "uint256", name: "_agentId", type: "uint256", }, ], - name: "createOfferAndTwinWithBundle", + name: "createSellerAndOfferAndTwinWithBundle", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [ + { + components: [ + { + internalType: "uint256", + name: "id", + type: "uint256", + }, + { + internalType: "address", + name: "operator", + type: "address", + }, + { + internalType: "address", + name: "admin", + type: "address", + }, + { + internalType: "address", + name: "clerk", + type: "address", + }, + { + internalType: "address payable", + name: "treasury", + type: "address", + }, + { + internalType: "bool", + name: "active", + type: "bool", + }, + ], + internalType: "struct BosonTypes.Seller", + name: "_seller", + type: "tuple", + }, { components: [ { @@ -1782,19 +3510,90 @@ const _abi = [ name: "_condition", type: "tuple", }, + { + components: [ + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + { + internalType: "enum BosonTypes.AuthTokenType", + name: "tokenType", + type: "uint8", + }, + ], + internalType: "struct BosonTypes.AuthToken", + name: "_authToken", + type: "tuple", + }, + { + components: [ + { + internalType: "string", + name: "contractURI", + type: "string", + }, + { + internalType: "uint256", + name: "royaltyPercentage", + type: "uint256", + }, + ], + internalType: "struct BosonTypes.VoucherInitValues", + name: "_voucherInitValues", + type: "tuple", + }, { internalType: "uint256", name: "_agentId", type: "uint256", }, ], - name: "createOfferWithCondition", + name: "createSellerAndOfferWithCondition", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [ + { + components: [ + { + internalType: "uint256", + name: "id", + type: "uint256", + }, + { + internalType: "address", + name: "operator", + type: "address", + }, + { + internalType: "address", + name: "admin", + type: "address", + }, + { + internalType: "address", + name: "clerk", + type: "address", + }, + { + internalType: "address payable", + name: "treasury", + type: "address", + }, + { + internalType: "bool", + name: "active", + type: "bool", + }, + ], + internalType: "struct BosonTypes.Seller", + name: "_seller", + type: "tuple", + }, { components: [ { @@ -1985,13 +3784,47 @@ const _abi = [ name: "_twin", type: "tuple", }, + { + components: [ + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + { + internalType: "enum BosonTypes.AuthTokenType", + name: "tokenType", + type: "uint8", + }, + ], + internalType: "struct BosonTypes.AuthToken", + name: "_authToken", + type: "tuple", + }, + { + components: [ + { + internalType: "string", + name: "contractURI", + type: "string", + }, + { + internalType: "uint256", + name: "royaltyPercentage", + type: "uint256", + }, + ], + internalType: "struct BosonTypes.VoucherInitValues", + name: "_voucherInitValues", + type: "tuple", + }, { internalType: "uint256", name: "_agentId", type: "uint256", }, ], - name: "createOfferWithConditionAndTwinAndBundle", + name: "createSellerAndOfferWithConditionAndTwinAndBundle", outputs: [], stateMutability: "nonpayable", type: "function", @@ -2146,6 +3979,11 @@ const _abi = [ name: "_disputeResolverId", type: "uint256", }, + { + internalType: "uint256", + name: "_reservedRangeLength", + type: "uint256", + }, { components: [ { @@ -2186,7 +4024,7 @@ const _abi = [ type: "uint256", }, ], - name: "createSellerAndOffer", + name: "createSellerAndPremintedOffer", outputs: [], stateMutability: "nonpayable", type: "function", @@ -2341,6 +4179,11 @@ const _abi = [ name: "_disputeResolverId", type: "uint256", }, + { + internalType: "uint256", + name: "_reservedRangeLength", + type: "uint256", + }, { components: [ { @@ -2423,7 +4266,7 @@ const _abi = [ type: "uint256", }, ], - name: "createSellerAndOfferAndTwinWithBundle", + name: "createSellerAndPremintedOfferAndTwinWithBundle", outputs: [], stateMutability: "nonpayable", type: "function", @@ -2578,6 +4421,11 @@ const _abi = [ name: "_disputeResolverId", type: "uint256", }, + { + internalType: "uint256", + name: "_reservedRangeLength", + type: "uint256", + }, { components: [ { @@ -2655,7 +4503,7 @@ const _abi = [ type: "uint256", }, ], - name: "createSellerAndOfferWithCondition", + name: "createSellerAndPremintedOfferWithCondition", outputs: [], stateMutability: "nonpayable", type: "function", @@ -2810,6 +4658,11 @@ const _abi = [ name: "_disputeResolverId", type: "uint256", }, + { + internalType: "uint256", + name: "_reservedRangeLength", + type: "uint256", + }, { components: [ { @@ -2929,11 +4782,24 @@ const _abi = [ type: "uint256", }, ], - name: "createSellerAndOfferWithConditionAndTwinAndBundle", + name: "createSellerAndPremintedOfferWithConditionAndTwinAndBundle", outputs: [], stateMutability: "nonpayable", type: "function", }, + { + inputs: [ + { + internalType: "uint256", + name: "_exchangeId", + type: "uint256", + }, + ], + name: "raiseAndEscalateDispute", + outputs: [], + stateMutability: "payable", + type: "function", + }, ]; export class IBosonOrchestrationHandler__factory { diff --git a/packages/ethers-sdk/src/contracts/factories/IBosonVoucher__factory.ts b/packages/ethers-sdk/src/contracts/factories/IBosonVoucher__factory.ts index 2a310a58b..9dfb8d03e 100644 --- a/packages/ethers-sdk/src/contracts/factories/IBosonVoucher__factory.ts +++ b/packages/ethers-sdk/src/contracts/factories/IBosonVoucher__factory.ts @@ -70,6 +70,52 @@ const _abi = [ name: "ContractURIChanged", type: "event", }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "uint256", + name: "offerId", + type: "uint256", + }, + { + components: [ + { + internalType: "uint256", + name: "offerId", + type: "uint256", + }, + { + internalType: "uint256", + name: "start", + type: "uint256", + }, + { + internalType: "uint256", + name: "length", + type: "uint256", + }, + { + internalType: "uint256", + name: "minted", + type: "uint256", + }, + { + internalType: "uint256", + name: "lastBurnedTokenId", + type: "uint256", + }, + ], + indexed: false, + internalType: "struct IBosonVoucher.Range", + name: "range", + type: "tuple", + }, + ], + name: "RangeReserved", + type: "event", + }, { anonymous: false, inputs: [ @@ -170,6 +216,19 @@ const _abi = [ stateMutability: "view", type: "function", }, + { + inputs: [ + { + internalType: "uint256", + name: "_offerId", + type: "uint256", + }, + ], + name: "burnPremintedVouchers", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, { inputs: [ { @@ -215,6 +274,71 @@ const _abi = [ stateMutability: "view", type: "function", }, + { + inputs: [ + { + internalType: "uint256", + name: "_offerId", + type: "uint256", + }, + ], + name: "getAvailablePreMints", + outputs: [ + { + internalType: "uint256", + name: "count", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "_offerId", + type: "uint256", + }, + ], + name: "getRangeByOfferId", + outputs: [ + { + components: [ + { + internalType: "uint256", + name: "offerId", + type: "uint256", + }, + { + internalType: "uint256", + name: "start", + type: "uint256", + }, + { + internalType: "uint256", + name: "length", + type: "uint256", + }, + { + internalType: "uint256", + name: "minted", + type: "uint256", + }, + { + internalType: "uint256", + name: "lastBurnedTokenId", + type: "uint256", + }, + ], + internalType: "struct IBosonVoucher.Range", + name: "range", + type: "tuple", + }, + ], + stateMutability: "view", + type: "function", + }, { inputs: [], name: "getRoyaltyPercentage", @@ -315,6 +439,47 @@ const _abi = [ stateMutability: "view", type: "function", }, + { + inputs: [ + { + internalType: "uint256", + name: "_offerId", + type: "uint256", + }, + { + internalType: "uint256", + name: "_amount", + type: "uint256", + }, + ], + name: "preMint", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "_offerId", + type: "uint256", + }, + { + internalType: "uint256", + name: "_start", + type: "uint256", + }, + { + internalType: "uint256", + name: "_length", + type: "uint256", + }, + ], + name: "reserveRange", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, { inputs: [ { diff --git a/packages/ethers-sdk/src/contracts/factories/MockNativeMetaTransaction__factory.ts b/packages/ethers-sdk/src/contracts/factories/MockNativeMetaTransaction__factory.ts new file mode 100644 index 000000000..4dea34e0d --- /dev/null +++ b/packages/ethers-sdk/src/contracts/factories/MockNativeMetaTransaction__factory.ts @@ -0,0 +1,139 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, Signer, utils } from "ethers"; +import { Provider } from "@ethersproject/providers"; +import type { + MockNativeMetaTransaction, + MockNativeMetaTransactionInterface, +} from "../MockNativeMetaTransaction"; + +const _abi = [ + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "userAddress", + type: "address", + }, + { + indexed: false, + internalType: "address payable", + name: "relayerAddress", + type: "address", + }, + { + indexed: false, + internalType: "bytes", + name: "functionSignature", + type: "bytes", + }, + ], + name: "MetaTransactionExecuted", + type: "event", + }, + { + inputs: [ + { + internalType: "address", + name: "userAddress", + type: "address", + }, + { + internalType: "bytes", + name: "functionSignature", + type: "bytes", + }, + { + internalType: "bytes32", + name: "sigR", + type: "bytes32", + }, + { + internalType: "bytes32", + name: "sigS", + type: "bytes32", + }, + { + internalType: "uint8", + name: "sigV", + type: "uint8", + }, + ], + name: "executeMetaTransaction", + outputs: [ + { + internalType: "bytes", + name: "", + type: "bytes", + }, + ], + stateMutability: "payable", + type: "function", + }, + { + inputs: [], + name: "getChainId", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getDomainSeperator", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "user", + type: "address", + }, + ], + name: "getNonce", + outputs: [ + { + internalType: "uint256", + name: "nonce", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, +]; + +export class MockNativeMetaTransaction__factory { + static readonly abi = _abi; + static createInterface(): MockNativeMetaTransactionInterface { + return new utils.Interface(_abi) as MockNativeMetaTransactionInterface; + } + static connect( + address: string, + signerOrProvider: Signer | Provider + ): MockNativeMetaTransaction { + return new Contract( + address, + _abi, + signerOrProvider + ) as MockNativeMetaTransaction; + } +} diff --git a/packages/ethers-sdk/src/contracts/index.ts b/packages/ethers-sdk/src/contracts/index.ts index 23042fbf2..50882a77d 100644 --- a/packages/ethers-sdk/src/contracts/index.ts +++ b/packages/ethers-sdk/src/contracts/index.ts @@ -1,26 +1,32 @@ /* Autogenerated file. Do not edit manually. */ /* tslint:disable */ /* eslint-disable */ +export type { ERC1155 } from "./ERC1155"; export type { ERC20 } from "./ERC20"; export type { ERC721Enumerable } from "./ERC721Enumerable"; export type { IBosonAccountHandler } from "./IBosonAccountHandler"; export type { IBosonDisputeHandler } from "./IBosonDisputeHandler"; export type { IBosonExchangeHandler } from "./IBosonExchangeHandler"; export type { IBosonFundsHandler } from "./IBosonFundsHandler"; +export type { IBosonGroupHandler } from "./IBosonGroupHandler"; export type { IBosonMetaTransactionsHandler } from "./IBosonMetaTransactionsHandler"; export type { IBosonOfferHandler } from "./IBosonOfferHandler"; export type { IBosonOrchestrationHandler } from "./IBosonOrchestrationHandler"; export type { IBosonVoucher } from "./IBosonVoucher"; +export type { MockNativeMetaTransaction } from "./MockNativeMetaTransaction"; export type { ProtocolDiamond } from "./ProtocolDiamond"; +export { ERC1155__factory } from "./factories/ERC1155__factory"; export { ERC20__factory } from "./factories/ERC20__factory"; export { ERC721Enumerable__factory } from "./factories/ERC721Enumerable__factory"; export { IBosonAccountHandler__factory } from "./factories/IBosonAccountHandler__factory"; export { IBosonDisputeHandler__factory } from "./factories/IBosonDisputeHandler__factory"; export { IBosonExchangeHandler__factory } from "./factories/IBosonExchangeHandler__factory"; export { IBosonFundsHandler__factory } from "./factories/IBosonFundsHandler__factory"; +export { IBosonGroupHandler__factory } from "./factories/IBosonGroupHandler__factory"; export { IBosonMetaTransactionsHandler__factory } from "./factories/IBosonMetaTransactionsHandler__factory"; export { IBosonOfferHandler__factory } from "./factories/IBosonOfferHandler__factory"; export { IBosonOrchestrationHandler__factory } from "./factories/IBosonOrchestrationHandler__factory"; export { IBosonVoucher__factory } from "./factories/IBosonVoucher__factory"; +export { MockNativeMetaTransaction__factory } from "./factories/MockNativeMetaTransaction__factory"; export { ProtocolDiamond__factory } from "./factories/ProtocolDiamond__factory"; diff --git a/scripts/create-dispute-resolver.ts b/scripts/create-dispute-resolver.ts index 18f078710..41b3e9694 100644 --- a/scripts/create-dispute-resolver.ts +++ b/scripts/create-dispute-resolver.ts @@ -98,15 +98,9 @@ async function main() { const disputeResolverId = coreSDKDRAdmin.getDisputeResolverIdFromLogs( receipt.logs ); - console.log(`Dispute resolver with id ${disputeResolverId} created.`); - - console.log(`Activating dispute resolver...`); - const txResponse2 = await coreSDKProtocolAdmin.activateDisputeResolver( - disputeResolverId as string + console.log( + `Dispute resolver with id ${disputeResolverId} created and activated.` ); - console.log(`Tx hash: ${txResponse2.hash}`); - await txResponse2.wait(); - console.log(`Dispute resolver with id ${disputeResolverId} activated.`); } main()