From b6c388eb8536aeb0188ece0516910cf404c82006 Mon Sep 17 00:00:00 2001 From: Ze Date: Mon, 19 Aug 2024 23:14:46 -0700 Subject: [PATCH] release rc 17 (#231) * add onlyEncodeTransactions support (#223) * add onlyEncodeTransactions support * opti * opti * opti * add ipasset unit test case --------- Co-authored-by: Ze Co-authored-by: haodi <82733821@qq.com> * package.json Versions Update (#226) * Top-level version updated from `0.0.4` to `0.0.3` * core-sdk version updated to `1.0.0-rc.16` * Implement partner testnet (#228) * opti block explorer error (#230) * Remove no commercial license and tests * SSS * Modify state from signature with setPermission * Update wagmi/cli version * Generate contract method via partner testnet * Update implementation via partner testnet * Update unit tests * Remove sepolia chain and suport story testnet * Reset removing no commercial license * Update signature method * Update env variables * Update signature in spg * Skip react-sdk test * bump up sdk to 1.0.0-rc.17 * Approve the relate contract to permit transfer token * Update license approve method * Update signature in spg * Add approve method when call spg method * Remove API_KEY from wagmi-generate * Rename chain name * Bump up sdk to 1.0.0-rc.17 --------- Co-authored-by: LuttyYang * add onlyEncodeTransactions support (#223) * add onlyEncodeTransactions support * opti * opti * opti * add ipasset unit test case --------- Co-authored-by: Ze Co-authored-by: haodi <82733821@qq.com> * package.json Versions Update (#226) * Top-level version updated from `0.0.4` to `0.0.3` * core-sdk version updated to `1.0.0-rc.16` * Remove no commercial license and tests * SSS * Modify state from signature with setPermission * Update wagmi/cli version * Generate contract method via partner testnet * Update implementation via partner testnet * Update unit tests * Remove sepolia chain and suport story testnet * Reset removing no commercial license * Update signature method * Update env variables * Update signature in spg * Skip react-sdk test * bump up sdk to 1.0.0-rc.17 * Approve the relate contract to permit transfer token * Update license approve method * Update signature in spg * Add approve method when call spg method * Remove API_KEY from wagmi-generate * Rename chain name * Bump up sdk to 1.0.0-rc.17 --------- Co-authored-by: LuttyYang Co-authored-by: haodi <82733821@qq.com> Co-authored-by: Boris Polania Co-authored-by: Bonnie57 <146059114+bonnie57@users.noreply.github.com> Co-authored-by: Bonnie --- packages/core-sdk/.env.example | 4 +- packages/core-sdk/package.json | 2 +- packages/core-sdk/src/abi/generated.ts | 1798 +++++++++++------ packages/core-sdk/src/client.ts | 2 +- packages/core-sdk/src/index.ts | 1 + packages/core-sdk/src/resources/ipAccount.ts | 16 +- packages/core-sdk/src/resources/ipAsset.ts | 250 ++- packages/core-sdk/src/resources/license.ts | 5 +- packages/core-sdk/src/resources/nftClient.ts | 1 - packages/core-sdk/src/resources/permission.ts | 9 +- packages/core-sdk/src/types/common.ts | 2 +- packages/core-sdk/src/types/config.ts | 4 +- .../core-sdk/src/types/resources/ipAccount.ts | 4 +- .../core-sdk/src/types/resources/ipAsset.ts | 11 +- .../core-sdk/src/types/resources/license.ts | 6 +- .../src/utils/getLicenseTermsByType.ts | 16 +- packages/core-sdk/src/utils/sign.ts | 28 +- packages/core-sdk/src/utils/utils.ts | 38 +- .../core-sdk/test/integration/dispute.test.ts | 21 +- .../test/integration/ipAccount.test.ts | 58 +- .../core-sdk/test/integration/ipAsset.test.ts | 115 +- .../core-sdk/test/integration/license.test.ts | 20 +- .../test/integration/nftClient.test.ts | 4 +- .../test/integration/permission.test.ts | 22 +- .../core-sdk/test/integration/royalty.test.ts | 24 +- .../test/integration/utils/mockERC20.ts | 8 +- .../core-sdk/test/integration/utils/util.ts | 69 +- packages/core-sdk/test/unit/client.test.ts | 11 +- .../test/unit/resources/ipAccount.test.ts | 6 +- .../test/unit/resources/ipAsset.test.ts | 196 +- .../test/unit/resources/license.test.ts | 9 +- .../test/unit/resources/permission.test.ts | 13 +- .../test/unit/resources/royalty.test.ts | 81 +- .../unit/utils/getLicenseTermsByType.test.ts | 38 +- .../core-sdk/test/unit/utils/sign.test.ts | 18 +- .../core-sdk/test/unit/utils/utils.test.ts | 15 +- packages/react-sdk/.env.example | 4 +- packages/react-sdk/package.json | 1 - .../test/integration/useDispute.test.ts | 1 + .../test/integration/useIpAccount.test.ts | 16 +- .../test/integration/useIpAsset.test.ts | 2 + .../test/integration/useLicense.test.ts | 5 +- .../test/integration/usePermission.test.ts | 3 +- .../test/integration/useRoyalty.test.ts | 5 +- .../test/integration/utils/Wrapper.tsx | 9 +- .../react-sdk/test/integration/utils/util.ts | 11 +- packages/wagmi-generator/.env.example | 1 - packages/wagmi-generator/package.json | 8 +- packages/wagmi-generator/sdk.ts | 1036 +++++----- packages/wagmi-generator/wagmi.config.ts | 61 +- pnpm-lock.yaml | 578 ++---- 51 files changed, 2591 insertions(+), 2075 deletions(-) delete mode 100644 packages/wagmi-generator/.env.example diff --git a/packages/core-sdk/.env.example b/packages/core-sdk/.env.example index 5fea99ca..38419e57 100644 --- a/packages/core-sdk/.env.example +++ b/packages/core-sdk/.env.example @@ -1,2 +1,2 @@ -SEPOLIA_TEST_WALLET_ADDRESS = 0x0000000000000000000000000000000000000000 -SEPOLIA_WALLET_PRIVATE_KEY = 0x0000000000000000000000000000000000000000 +TEST_WALLET_ADDRESS = 0x0000000000000000000000000000000000000000 +WALLET_PRIVATE_KEY = 0x0000000000000000000000000000000000000000 diff --git a/packages/core-sdk/package.json b/packages/core-sdk/package.json index bf4ddf3f..6abfbbd4 100644 --- a/packages/core-sdk/package.json +++ b/packages/core-sdk/package.json @@ -1,6 +1,6 @@ { "name": "@story-protocol/core-sdk", - "version": "1.0.0-rc.16", + "version": "1.0.0-rc.17", "description": "Story Protocol Core SDK", "main": "dist/story-protocol-core-sdk.cjs.js", "module": "dist/story-protocol-core-sdk.esm.js", diff --git a/packages/core-sdk/src/abi/generated.ts b/packages/core-sdk/src/abi/generated.ts index bfce62a0..8cbed506 100644 --- a/packages/core-sdk/src/abi/generated.ts +++ b/packages/core-sdk/src/abi/generated.ts @@ -20,7 +20,7 @@ import { ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /** - * [__View Contract on Sepolia Etherscan__](https://sepolia.etherscan.io/address/0xF9936a224b3Deb6f9A4645ccAfa66f7ECe83CF0A) + * */ export const accessControllerAbi = [ { @@ -387,14 +387,14 @@ export const accessControllerAbi = [ ] as const; /** - * [__View Contract on Sepolia Etherscan__](https://sepolia.etherscan.io/address/0xF9936a224b3Deb6f9A4645ccAfa66f7ECe83CF0A) + * */ export const accessControllerAddress = { - 11155111: "0xF9936a224b3Deb6f9A4645ccAfa66f7ECe83CF0A", + 1513: "0x01d470c28822d3701Db6325333cEE9737524776E", } as const; /** - * [__View Contract on Sepolia Etherscan__](https://sepolia.etherscan.io/address/0xF9936a224b3Deb6f9A4645ccAfa66f7ECe83CF0A) + * */ export const accessControllerConfig = { address: accessControllerAddress, @@ -406,7 +406,7 @@ export const accessControllerConfig = { ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /** - * [__View Contract on Sepolia Etherscan__](https://sepolia.etherscan.io/address/0xDa498A3f7c8a88cb72201138C366bE3778dB9575) + * */ export const coreMetadataModuleAbi = [ { @@ -423,11 +423,76 @@ export const coreMetadataModuleAbi = [ name: "AccessControlled__NotIpAccount", }, { type: "error", inputs: [], name: "AccessControlled__ZeroAddress" }, + { + type: "error", + inputs: [{ name: "authority", internalType: "address", type: "address" }], + name: "AccessManagedInvalidAuthority", + }, + { + type: "error", + inputs: [ + { name: "caller", internalType: "address", type: "address" }, + { name: "delay", internalType: "uint32", type: "uint32" }, + ], + name: "AccessManagedRequiredDelay", + }, + { + type: "error", + inputs: [{ name: "caller", internalType: "address", type: "address" }], + name: "AccessManagedUnauthorized", + }, + { + type: "error", + inputs: [{ name: "target", internalType: "address", type: "address" }], + name: "AddressEmptyCode", + }, { type: "error", inputs: [], name: "CoreMetadataModule__MetadataAlreadyFrozen", }, + { type: "error", inputs: [], name: "CoreMetadataModule__ZeroAccessManager" }, + { + type: "error", + inputs: [{ name: "implementation", internalType: "address", type: "address" }], + name: "ERC1967InvalidImplementation", + }, + { type: "error", inputs: [], name: "ERC1967NonPayable" }, + { type: "error", inputs: [], name: "FailedInnerCall" }, + { type: "error", inputs: [], name: "InvalidInitialization" }, + { type: "error", inputs: [], name: "NotInitializing" }, + { type: "error", inputs: [], name: "UUPSUnauthorizedCallContext" }, + { + type: "error", + inputs: [{ name: "slot", internalType: "bytes32", type: "bytes32" }], + name: "UUPSUnsupportedProxiableUUID", + }, + { + type: "event", + anonymous: false, + inputs: [ + { + name: "authority", + internalType: "address", + type: "address", + indexed: false, + }, + ], + name: "AuthorityUpdated", + }, + { + type: "event", + anonymous: false, + inputs: [ + { + name: "version", + internalType: "uint64", + type: "uint64", + indexed: false, + }, + ], + name: "Initialized", + }, { type: "event", anonymous: false, @@ -474,6 +539,19 @@ export const coreMetadataModuleAbi = [ ], name: "NFTTokenURISet", }, + { + type: "event", + anonymous: false, + inputs: [ + { + name: "implementation", + internalType: "address", + type: "address", + indexed: true, + }, + ], + name: "Upgraded", + }, { type: "function", inputs: [], @@ -494,6 +572,20 @@ export const coreMetadataModuleAbi = [ ], stateMutability: "view", }, + { + type: "function", + inputs: [], + name: "UPGRADE_INTERFACE_VERSION", + outputs: [{ name: "", internalType: "string", type: "string" }], + stateMutability: "view", + }, + { + type: "function", + inputs: [], + name: "authority", + outputs: [{ name: "", internalType: "address", type: "address" }], + stateMutability: "view", + }, { type: "function", inputs: [{ name: "ipId", internalType: "address", type: "address" }], @@ -501,6 +593,20 @@ export const coreMetadataModuleAbi = [ outputs: [], stateMutability: "nonpayable", }, + { + type: "function", + inputs: [{ name: "accessManager", internalType: "address", type: "address" }], + name: "initialize", + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + inputs: [], + name: "isConsumingScheduledOp", + outputs: [{ name: "", internalType: "bytes4", type: "bytes4" }], + stateMutability: "view", + }, { type: "function", inputs: [{ name: "ipId", internalType: "address", type: "address" }], @@ -513,6 +619,13 @@ export const coreMetadataModuleAbi = [ inputs: [], name: "name", outputs: [{ name: "", internalType: "string", type: "string" }], + stateMutability: "pure", + }, + { + type: "function", + inputs: [], + name: "proxiableUUID", + outputs: [{ name: "", internalType: "bytes32", type: "bytes32" }], stateMutability: "view", }, { @@ -527,6 +640,13 @@ export const coreMetadataModuleAbi = [ outputs: [], stateMutability: "nonpayable", }, + { + type: "function", + inputs: [{ name: "newAuthority", internalType: "address", type: "address" }], + name: "setAuthority", + outputs: [], + stateMutability: "nonpayable", + }, { type: "function", inputs: [ @@ -555,17 +675,27 @@ export const coreMetadataModuleAbi = [ outputs: [], stateMutability: "nonpayable", }, + { + type: "function", + inputs: [ + { name: "newImplementation", internalType: "address", type: "address" }, + { name: "data", internalType: "bytes", type: "bytes" }, + ], + name: "upgradeToAndCall", + outputs: [], + stateMutability: "payable", + }, ] as const; /** - * [__View Contract on Sepolia Etherscan__](https://sepolia.etherscan.io/address/0xDa498A3f7c8a88cb72201138C366bE3778dB9575) + * */ export const coreMetadataModuleAddress = { - 11155111: "0xDa498A3f7c8a88cb72201138C366bE3778dB9575", + 1513: "0x290F414EA46b361ECFB6b430F98346CB593D02b9", } as const; /** - * [__View Contract on Sepolia Etherscan__](https://sepolia.etherscan.io/address/0xDa498A3f7c8a88cb72201138C366bE3778dB9575) + * */ export const coreMetadataModuleConfig = { address: coreMetadataModuleAddress, @@ -577,7 +707,7 @@ export const coreMetadataModuleConfig = { ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /** - * [__View Contract on Sepolia Etherscan__](https://sepolia.etherscan.io/address/0xEB7B1dd43B81A7be1fA427515a2b173B454A9832) + * */ export const disputeModuleAbi = [ { @@ -619,6 +749,7 @@ export const disputeModuleAbi = [ name: "AddressEmptyCode", }, { type: "error", inputs: [], name: "DisputeModule__NotAbleToResolve" }, + { type: "error", inputs: [], name: "DisputeModule__NotAllowedToWhitelist" }, { type: "error", inputs: [], name: "DisputeModule__NotDerivative" }, { type: "error", inputs: [], name: "DisputeModule__NotDisputeInitiator" }, { type: "error", inputs: [], name: "DisputeModule__NotInDisputeState" }, @@ -1250,14 +1381,14 @@ export const disputeModuleAbi = [ ] as const; /** - * [__View Contract on Sepolia Etherscan__](https://sepolia.etherscan.io/address/0xEB7B1dd43B81A7be1fA427515a2b173B454A9832) + * */ export const disputeModuleAddress = { - 11155111: "0xEB7B1dd43B81A7be1fA427515a2b173B454A9832", + 1513: "0xDae11663438a0958E7075F604E3a5eEe77FD3878", } as const; /** - * [__View Contract on Sepolia Etherscan__](https://sepolia.etherscan.io/address/0xEB7B1dd43B81A7be1fA427515a2b173B454A9832) + * */ export const disputeModuleConfig = { address: disputeModuleAddress, @@ -1269,7 +1400,7 @@ export const disputeModuleConfig = { ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /** - * [__View Contract on Sepolia Etherscan__](https://sepolia.etherscan.io/address/0x36a5f0D61f6Bab3C6Dde211E5a6762Cb18a8060d) + * */ export const ipAccountImplAbi = [ { @@ -1282,16 +1413,27 @@ export const ipAccountImplAbi = [ ], stateMutability: "nonpayable", }, + { type: "error", inputs: [], name: "FnSelectorNotRecognized" }, + { type: "error", inputs: [], name: "IPAccountStorage__InvalidBatchLengths" }, { type: "error", inputs: [{ name: "module", internalType: "address", type: "address" }], name: "IPAccountStorage__NotRegisteredModule", }, + { type: "error", inputs: [], name: "IPAccountStorage__ZeroIpAssetRegistry" }, + { type: "error", inputs: [], name: "IPAccountStorage__ZeroLicenseRegistry" }, + { type: "error", inputs: [], name: "IPAccountStorage__ZeroModuleRegistry" }, { type: "error", inputs: [], name: "IPAccount__ExpiredSignature" }, { type: "error", inputs: [], name: "IPAccount__InvalidCalldata" }, + { type: "error", inputs: [], name: "IPAccount__InvalidOperation" }, { type: "error", inputs: [], name: "IPAccount__InvalidSignature" }, { type: "error", inputs: [], name: "IPAccount__InvalidSigner" }, { type: "error", inputs: [], name: "IPAccount__ZeroAccessController" }, + { type: "error", inputs: [], name: "OperationNotSupported" }, + { type: "error", inputs: [], name: "SelfOwnDetected" }, + { type: "error", inputs: [], name: "Unauthorized" }, + { type: "error", inputs: [], name: "UnauthorizedCallContext" }, + { type: "error", inputs: [], name: "UpgradeFailed" }, { type: "event", anonymous: false, @@ -1306,8 +1448,8 @@ export const ipAccountImplAbi = [ { name: "data", internalType: "bytes", type: "bytes", indexed: false }, { name: "nonce", - internalType: "uint256", - type: "uint256", + internalType: "bytes32", + type: "bytes32", indexed: false, }, ], @@ -1327,8 +1469,8 @@ export const ipAccountImplAbi = [ { name: "data", internalType: "bytes", type: "bytes", indexed: false }, { name: "nonce", - internalType: "uint256", - type: "uint256", + internalType: "bytes32", + type: "bytes32", indexed: false, }, { @@ -1352,6 +1494,20 @@ export const ipAccountImplAbi = [ ], name: "ExecutedWithSig", }, + { + type: "event", + anonymous: false, + inputs: [ + { + name: "implementation", + internalType: "address", + type: "address", + indexed: true, + }, + ], + name: "Upgraded", + }, + { type: "fallback", stateMutability: "payable" }, { type: "function", inputs: [], @@ -1400,17 +1556,63 @@ export const ipAccountImplAbi = [ outputs: [{ name: "", internalType: "bytes", type: "bytes" }], stateMutability: "view", }, + { + type: "function", + inputs: [], + name: "eip712Domain", + outputs: [ + { name: "fields", internalType: "bytes1", type: "bytes1" }, + { name: "name", internalType: "string", type: "string" }, + { name: "version", internalType: "string", type: "string" }, + { name: "chainId", internalType: "uint256", type: "uint256" }, + { name: "verifyingContract", internalType: "address", type: "address" }, + { name: "salt", internalType: "bytes32", type: "bytes32" }, + { name: "extensions", internalType: "uint256[]", type: "uint256[]" }, + ], + stateMutability: "view", + }, { type: "function", inputs: [ { name: "to", internalType: "address", type: "address" }, { name: "value", internalType: "uint256", type: "uint256" }, { name: "data", internalType: "bytes", type: "bytes" }, + { name: "operation", internalType: "uint8", type: "uint8" }, ], name: "execute", outputs: [{ name: "result", internalType: "bytes", type: "bytes" }], stateMutability: "payable", }, + { + type: "function", + inputs: [ + { name: "to", internalType: "address", type: "address" }, + { name: "value", internalType: "uint256", type: "uint256" }, + { name: "data", internalType: "bytes", type: "bytes" }, + ], + name: "execute", + outputs: [{ name: "result", internalType: "bytes", type: "bytes" }], + stateMutability: "payable", + }, + { + type: "function", + inputs: [ + { + name: "calls", + internalType: "struct ERC6551.Call[]", + type: "tuple[]", + components: [ + { name: "target", internalType: "address", type: "address" }, + { name: "value", internalType: "uint256", type: "uint256" }, + { name: "data", internalType: "bytes", type: "bytes" }, + ], + }, + { name: "operation", internalType: "uint8", type: "uint8" }, + ], + name: "executeBatch", + outputs: [{ name: "results", internalType: "bytes[]", type: "bytes[]" }], + stateMutability: "payable", + }, { type: "function", inputs: [ @@ -1462,50 +1664,53 @@ export const ipAccountImplAbi = [ { type: "function", inputs: [ - { name: "signer", internalType: "address", type: "address" }, - { name: "data", internalType: "bytes", type: "bytes" }, + { name: "namespaces", internalType: "bytes32[]", type: "bytes32[]" }, + { name: "keys", internalType: "bytes32[]", type: "bytes32[]" }, ], - name: "isValidSigner", - outputs: [{ name: "", internalType: "bytes4", type: "bytes4" }], + name: "getBytes32Batch", + outputs: [{ name: "values", internalType: "bytes32[]", type: "bytes32[]" }], stateMutability: "view", }, { type: "function", inputs: [ - { name: "", internalType: "address", type: "address" }, - { name: "", internalType: "address", type: "address" }, - { name: "", internalType: "uint256[]", type: "uint256[]" }, - { name: "", internalType: "uint256[]", type: "uint256[]" }, - { name: "", internalType: "bytes", type: "bytes" }, + { name: "namespaces", internalType: "bytes32[]", type: "bytes32[]" }, + { name: "keys", internalType: "bytes32[]", type: "bytes32[]" }, ], - name: "onERC1155BatchReceived", - outputs: [{ name: "", internalType: "bytes4", type: "bytes4" }], - stateMutability: "pure", + name: "getBytesBatch", + outputs: [{ name: "values", internalType: "bytes[]", type: "bytes[]" }], + stateMutability: "view", }, { type: "function", inputs: [ - { name: "", internalType: "address", type: "address" }, - { name: "", internalType: "address", type: "address" }, - { name: "", internalType: "uint256", type: "uint256" }, - { name: "", internalType: "uint256", type: "uint256" }, - { name: "", internalType: "bytes", type: "bytes" }, + { name: "hash", internalType: "bytes32", type: "bytes32" }, + { name: "signature", internalType: "bytes", type: "bytes" }, ], - name: "onERC1155Received", - outputs: [{ name: "", internalType: "bytes4", type: "bytes4" }], - stateMutability: "pure", + name: "isValidSignature", + outputs: [{ name: "result", internalType: "bytes4", type: "bytes4" }], + stateMutability: "view", }, { type: "function", inputs: [ - { name: "", internalType: "address", type: "address" }, - { name: "", internalType: "address", type: "address" }, - { name: "", internalType: "uint256", type: "uint256" }, - { name: "", internalType: "bytes", type: "bytes" }, + { name: "signer", internalType: "address", type: "address" }, + { name: "data", internalType: "bytes", type: "bytes" }, ], - name: "onERC721Received", - outputs: [{ name: "", internalType: "bytes4", type: "bytes4" }], - stateMutability: "pure", + name: "isValidSigner", + outputs: [{ name: "result", internalType: "bytes4", type: "bytes4" }], + stateMutability: "view", + }, + { + type: "function", + inputs: [ + { name: "signer", internalType: "address", type: "address" }, + { name: "to", internalType: "address", type: "address" }, + { name: "data", internalType: "bytes", type: "bytes" }, + ], + name: "isValidSigner", + outputs: [{ name: "", internalType: "bool", type: "bool" }], + stateMutability: "view", }, { type: "function", @@ -1514,6 +1719,13 @@ export const ipAccountImplAbi = [ outputs: [{ name: "", internalType: "address", type: "address" }], stateMutability: "view", }, + { + type: "function", + inputs: [], + name: "proxiableUUID", + outputs: [{ name: "", internalType: "bytes32", type: "bytes32" }], + stateMutability: "view", + }, { type: "function", inputs: [ @@ -1534,11 +1746,31 @@ export const ipAccountImplAbi = [ outputs: [], stateMutability: "nonpayable", }, + { + type: "function", + inputs: [ + { name: "keys", internalType: "bytes32[]", type: "bytes32[]" }, + { name: "values", internalType: "bytes32[]", type: "bytes32[]" }, + ], + name: "setBytes32Batch", + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + inputs: [ + { name: "keys", internalType: "bytes32[]", type: "bytes32[]" }, + { name: "values", internalType: "bytes[]", type: "bytes[]" }, + ], + name: "setBytesBatch", + outputs: [], + stateMutability: "nonpayable", + }, { type: "function", inputs: [], name: "state", - outputs: [{ name: "", internalType: "uint256", type: "uint256" }], + outputs: [{ name: "result", internalType: "bytes32", type: "bytes32" }], stateMutability: "view", }, { @@ -1559,18 +1791,28 @@ export const ipAccountImplAbi = [ ], stateMutability: "view", }, + { + type: "function", + inputs: [ + { name: "newImplementation", internalType: "address", type: "address" }, + { name: "data", internalType: "bytes", type: "bytes" }, + ], + name: "upgradeToAndCall", + outputs: [], + stateMutability: "payable", + }, { type: "receive", stateMutability: "payable" }, ] as const; /** - * [__View Contract on Sepolia Etherscan__](https://sepolia.etherscan.io/address/0x36a5f0D61f6Bab3C6Dde211E5a6762Cb18a8060d) + * */ export const ipAccountImplAddress = { - 11155111: "0x36a5f0D61f6Bab3C6Dde211E5a6762Cb18a8060d", + 1513: "0x8F763c16753e830a8020c80f9F0131Eb8Ef52879", } as const; /** - * [__View Contract on Sepolia Etherscan__](https://sepolia.etherscan.io/address/0x36a5f0D61f6Bab3C6Dde211E5a6762Cb18a8060d) + * */ export const ipAccountImplConfig = { address: ipAccountImplAddress, @@ -1582,7 +1824,7 @@ export const ipAccountImplConfig = { ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /** - * [__View Contract on Sepolia Etherscan__](https://sepolia.etherscan.io/address/0xd43fE0d865cb5C26b1351d3eAf2E3064BE3276F6) + * */ export const ipAssetRegistryAbi = [ { @@ -1625,6 +1867,7 @@ export const ipAssetRegistryAbi = [ { type: "error", inputs: [], name: "EnforcedPause" }, { type: "error", inputs: [], name: "ExpectedPause" }, { type: "error", inputs: [], name: "FailedInnerCall" }, + { type: "error", inputs: [], name: "IPAccountRegistry_ZeroERC6551Registry" }, { type: "error", inputs: [], name: "IPAccountRegistry_ZeroIpAccountImpl" }, { type: "error", inputs: [], name: "IPAssetRegistry__AlreadyRegistered" }, { @@ -1927,17 +2170,6 @@ export const ipAssetRegistryAbi = [ outputs: [{ name: "id", internalType: "address", type: "address" }], stateMutability: "nonpayable", }, - { - type: "function", - inputs: [ - { name: "chainId", internalType: "uint256", type: "uint256" }, - { name: "tokenContract", internalType: "address", type: "address" }, - { name: "tokenId", internalType: "uint256", type: "uint256" }, - ], - name: "registerIpAccount", - outputs: [{ name: "ipAccountAddress", internalType: "address", type: "address" }], - stateMutability: "nonpayable", - }, { type: "function", inputs: [{ name: "newAuthority", internalType: "address", type: "address" }], @@ -1972,14 +2204,14 @@ export const ipAssetRegistryAbi = [ ] as const; /** - * [__View Contract on Sepolia Etherscan__](https://sepolia.etherscan.io/address/0xd43fE0d865cb5C26b1351d3eAf2E3064BE3276F6) + * */ export const ipAssetRegistryAddress = { - 11155111: "0xd43fE0d865cb5C26b1351d3eAf2E3064BE3276F6", + 1513: "0xe34A78B3d658aF7ad69Ff1EFF9012ECa025a14Be", } as const; /** - * [__View Contract on Sepolia Etherscan__](https://sepolia.etherscan.io/address/0xd43fE0d865cb5C26b1351d3eAf2E3064BE3276F6) + * */ export const ipAssetRegistryConfig = { address: ipAssetRegistryAddress, @@ -1991,7 +2223,7 @@ export const ipAssetRegistryConfig = { ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /** - * [__View Contract on Sepolia Etherscan__](https://sepolia.etherscan.io/address/0xD6c2AfB61085f1359d47159f2271BDD0EeBf19C2) + * */ export const ipRoyaltyVaultImplAbi = [ { @@ -2142,6 +2374,13 @@ export const ipRoyaltyVaultImplAbi = [ outputs: [{ name: "", internalType: "contract IDisputeModule", type: "address" }], stateMutability: "view", }, + { + type: "function", + inputs: [], + name: "IP_GRAPH_CONTRACT", + outputs: [{ name: "", internalType: "address", type: "address" }], + stateMutability: "view", + }, { type: "function", inputs: [], @@ -2248,6 +2487,16 @@ export const ipRoyaltyVaultImplAbi = [ outputs: [{ name: "", internalType: "uint256", type: "uint256" }], stateMutability: "view", }, + { + type: "function", + inputs: [ + { name: "ancestorIpId", internalType: "address", type: "address" }, + { name: "_tokens", internalType: "address[]", type: "address[]" }, + ], + name: "collectAccruedTokens", + outputs: [], + stateMutability: "nonpayable", + }, { type: "function", inputs: [{ name: "ancestorIpId", internalType: "address", type: "address" }], @@ -2255,6 +2504,16 @@ export const ipRoyaltyVaultImplAbi = [ outputs: [], stateMutability: "nonpayable", }, + { + type: "function", + inputs: [ + { name: "ancestorIpId", internalType: "address", type: "address" }, + { name: "token", internalType: "address", type: "address" }, + ], + name: "collectableAmount", + outputs: [{ name: "", internalType: "uint256", type: "uint256" }], + stateMutability: "view", + }, { type: "function", inputs: [], @@ -2407,14 +2666,14 @@ export const ipRoyaltyVaultImplAbi = [ ] as const; /** - * [__View Contract on Sepolia Etherscan__](https://sepolia.etherscan.io/address/0xD6c2AfB61085f1359d47159f2271BDD0EeBf19C2) + * */ export const ipRoyaltyVaultImplAddress = { - 11155111: "0xD6c2AfB61085f1359d47159f2271BDD0EeBf19C2", + 1513: "0xfb5b5B61c9a437E06Ba87367aaBf3766d091E3D1", } as const; /** - * [__View Contract on Sepolia Etherscan__](https://sepolia.etherscan.io/address/0xD6c2AfB61085f1359d47159f2271BDD0EeBf19C2) + * */ export const ipRoyaltyVaultImplConfig = { address: ipRoyaltyVaultImplAddress, @@ -2426,7 +2685,7 @@ export const ipRoyaltyVaultImplConfig = { ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /** - * [__View Contract on Sepolia Etherscan__](https://sepolia.etherscan.io/address/0x4f4b1bf7135C7ff1462826CCA81B048Ed19562ed) + * */ export const licenseRegistryAbi = [ { @@ -2478,6 +2737,11 @@ export const licenseRegistryAbi = [ inputs: [{ name: "childIpId", internalType: "address", type: "address" }], name: "LicenseRegistry__DerivativeAlreadyRegistered", }, + { + type: "error", + inputs: [{ name: "childIpId", internalType: "address", type: "address" }], + name: "LicenseRegistry__DerivativeIpAlreadyHasChild", + }, { type: "error", inputs: [{ name: "childIpId", internalType: "address", type: "address" }], @@ -2537,7 +2801,6 @@ export const licenseRegistryAbi = [ ], name: "LicenseRegistry__LicensorIpHasNoLicenseTerms", }, - { type: "error", inputs: [], name: "LicenseRegistry__NoParentIp" }, { type: "error", inputs: [{ name: "licenseTemplate", internalType: "address", type: "address" }], @@ -2585,6 +2848,7 @@ export const licenseRegistryAbi = [ }, { type: "error", inputs: [], name: "LicenseRegistry__ZeroAccessManager" }, { type: "error", inputs: [], name: "LicenseRegistry__ZeroDisputeModule" }, + { type: "error", inputs: [], name: "LicenseRegistry__ZeroLicenseTemplate" }, { type: "error", inputs: [], name: "LicenseRegistry__ZeroLicensingModule" }, { type: "error", @@ -2619,6 +2883,25 @@ export const licenseRegistryAbi = [ ], name: "AuthorityUpdated", }, + { + type: "event", + anonymous: false, + inputs: [ + { + name: "licenseTemplate", + internalType: "address", + type: "address", + indexed: false, + }, + { + name: "licenseTermsId", + internalType: "uint256", + type: "uint256", + indexed: false, + }, + ], + name: "DefaultLicenseTermsSet", + }, { type: "event", anonymous: false, @@ -2726,6 +3009,13 @@ export const licenseRegistryAbi = [ outputs: [{ name: "", internalType: "bytes32", type: "bytes32" }], stateMutability: "view", }, + { + type: "function", + inputs: [], + name: "IP_GRAPH_CONTRACT", + outputs: [{ name: "", internalType: "address", type: "address" }], + stateMutability: "view", + }, { type: "function", inputs: [], @@ -2939,6 +3229,7 @@ export const licenseRegistryAbi = [ { name: "parentIpIds", internalType: "address[]", type: "address[]" }, { name: "licenseTemplate", internalType: "address", type: "address" }, { name: "licenseTermsIds", internalType: "uint256[]", type: "uint256[]" }, + { name: "isUsingLicenseToken", internalType: "bool", type: "bool" }, ], name: "registerDerivativeIp", outputs: [], @@ -2968,16 +3259,6 @@ export const licenseRegistryAbi = [ outputs: [], stateMutability: "nonpayable", }, - { - type: "function", - inputs: [ - { name: "ipId", internalType: "address", type: "address" }, - { name: "expireTime", internalType: "uint256", type: "uint256" }, - ], - name: "setExpireTime", - outputs: [], - stateMutability: "nonpayable", - }, { type: "function", inputs: [ @@ -3057,14 +3338,14 @@ export const licenseRegistryAbi = [ ] as const; /** - * [__View Contract on Sepolia Etherscan__](https://sepolia.etherscan.io/address/0x4f4b1bf7135C7ff1462826CCA81B048Ed19562ed) + * */ export const licenseRegistryAddress = { - 11155111: "0x4f4b1bf7135C7ff1462826CCA81B048Ed19562ed", + 1513: "0xF542AF9a5A6E4A85a4f084D38B322516ec336097", } as const; /** - * [__View Contract on Sepolia Etherscan__](https://sepolia.etherscan.io/address/0x4f4b1bf7135C7ff1462826CCA81B048Ed19562ed) + * */ export const licenseRegistryConfig = { address: licenseRegistryAddress, @@ -3076,7 +3357,7 @@ export const licenseRegistryConfig = { ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /** - * [__View Contract on Sepolia Etherscan__](https://sepolia.etherscan.io/address/0x1333c78A821c9a576209B01a16dDCEF881cAb6f2) + * */ export const licenseTokenAbi = [ { @@ -3186,16 +3467,17 @@ export const licenseTokenAbi = [ ], name: "LicenseToken__AllLicenseTokensMustFromSameLicenseTemplate", }, - { type: "error", inputs: [], name: "LicenseToken__CallerNotLicensingModule" }, { type: "error", inputs: [ { name: "tokenId", internalType: "uint256", type: "uint256" }, - { name: "iPowner", internalType: "address", type: "address" }, - { name: "tokenOwner", internalType: "address", type: "address" }, + { name: "caller", internalType: "address", type: "address" }, + { name: "childIpIp", internalType: "address", type: "address" }, + { name: "actualTokenOwner", internalType: "address", type: "address" }, ], - name: "LicenseToken__NotLicenseTokenOwner", + name: "LicenseToken__CallerAndChildIPNotTokenOwner", }, + { type: "error", inputs: [], name: "LicenseToken__CallerNotLicensingModule" }, { type: "error", inputs: [], name: "LicenseToken__NotTransferable" }, { type: "error", @@ -3655,8 +3937,8 @@ export const licenseTokenAbi = [ { type: "function", inputs: [ + { name: "caller", internalType: "address", type: "address" }, { name: "childIpId", internalType: "address", type: "address" }, - { name: "childIpOwner", internalType: "address", type: "address" }, { name: "tokenIds", internalType: "uint256[]", type: "uint256[]" }, ], name: "validateLicenseTokensForDerivative", @@ -3670,14 +3952,14 @@ export const licenseTokenAbi = [ ] as const; /** - * [__View Contract on Sepolia Etherscan__](https://sepolia.etherscan.io/address/0x1333c78A821c9a576209B01a16dDCEF881cAb6f2) + * */ export const licenseTokenAddress = { - 11155111: "0x1333c78A821c9a576209B01a16dDCEF881cAb6f2", + 1513: "0xB31FE33De46A1FA5d4Ec669EDB049892E0A1EB4C", } as const; /** - * [__View Contract on Sepolia Etherscan__](https://sepolia.etherscan.io/address/0x1333c78A821c9a576209B01a16dDCEF881cAb6f2) + * */ export const licenseTokenConfig = { address: licenseTokenAddress, @@ -3689,7 +3971,7 @@ export const licenseTokenConfig = { ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /** - * [__View Contract on Sepolia Etherscan__](https://sepolia.etherscan.io/address/0xe89b0EaA8a0949738efA80bB531a165FB3456CBe) + * */ export const licensingModuleAbi = [ { @@ -3800,6 +4082,11 @@ export const licensingModuleAbi = [ ], name: "LicensingModule__LicenseTokenNotCompatibleForDerivative", }, + { + type: "error", + inputs: [], + name: "LicensingModule__LicensorIpNotRegistered", + }, { type: "error", inputs: [], name: "LicensingModule__MintAmountZero" }, { type: "error", inputs: [], name: "LicensingModule__NoLicenseToken" }, { type: "error", inputs: [], name: "LicensingModule__NoParentIp" }, @@ -4224,14 +4511,14 @@ export const licensingModuleAbi = [ ] as const; /** - * [__View Contract on Sepolia Etherscan__](https://sepolia.etherscan.io/address/0xe89b0EaA8a0949738efA80bB531a165FB3456CBe) + * */ export const licensingModuleAddress = { - 11155111: "0xe89b0EaA8a0949738efA80bB531a165FB3456CBe", + 1513: "0xf49da534215DA7b48E57A41d41dac25C912FCC60", } as const; /** - * [__View Contract on Sepolia Etherscan__](https://sepolia.etherscan.io/address/0xe89b0EaA8a0949738efA80bB531a165FB3456CBe) + * */ export const licensingModuleConfig = { address: licensingModuleAddress, @@ -4243,7 +4530,7 @@ export const licensingModuleConfig = { ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /** - * [__View Contract on Sepolia Etherscan__](https://sepolia.etherscan.io/address/0x2E0a668289D5C4Da6a2264aC8DF03cd600c7aAB8) + * */ export const moduleRegistryAbi = [ { type: "constructor", inputs: [], stateMutability: "nonpayable" }, @@ -4529,14 +4816,14 @@ export const moduleRegistryAbi = [ ] as const; /** - * [__View Contract on Sepolia Etherscan__](https://sepolia.etherscan.io/address/0x2E0a668289D5C4Da6a2264aC8DF03cd600c7aAB8) + * */ export const moduleRegistryAddress = { - 11155111: "0x2E0a668289D5C4Da6a2264aC8DF03cd600c7aAB8", + 1513: "0x008ac202A8545D10f25707439bE4c139Be4Df75F", } as const; /** - * [__View Contract on Sepolia Etherscan__](https://sepolia.etherscan.io/address/0x2E0a668289D5C4Da6a2264aC8DF03cd600c7aAB8) + * */ export const moduleRegistryConfig = { address: moduleRegistryAddress, @@ -4548,7 +4835,7 @@ export const moduleRegistryConfig = { ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /** - * [__View Contract on Sepolia Etherscan__](https://sepolia.etherscan.io/address/0x260B6CB6284c89dbE660c0004233f7bB99B5edE7) + * */ export const piLicenseTemplateAbi = [ { @@ -4609,6 +4896,16 @@ export const piLicenseTemplateAbi = [ inputs: [], name: "PILicenseTemplate__CommercialDisabled_CantAddCommercializers", }, + { + type: "error", + inputs: [], + name: "PILicenseTemplate__CommercialDisabled_CantAddDerivativeRevCeiling", + }, + { + type: "error", + inputs: [], + name: "PILicenseTemplate__CommercialDisabled_CantAddRevCeiling", + }, { type: "error", inputs: [], @@ -4644,6 +4941,11 @@ export const piLicenseTemplateAbi = [ inputs: [], name: "PILicenseTemplate__DerivativesDisabled_CantAddAttribution", }, + { + type: "error", + inputs: [], + name: "PILicenseTemplate__DerivativesDisabled_CantAddDerivativeRevCeiling", + }, { type: "error", inputs: [], @@ -4663,14 +4965,6 @@ export const piLicenseTemplateAbi = [ { type: "error", inputs: [], name: "PILicenseTemplate__ZeroLicenseRegistry" }, { type: "error", inputs: [], name: "PILicenseTemplate__ZeroRoyaltyModule" }, { type: "error", inputs: [], name: "ReentrancyGuardReentrantCall" }, - { - type: "error", - inputs: [ - { name: "value", internalType: "uint256", type: "uint256" }, - { name: "length", internalType: "uint256", type: "uint256" }, - ], - name: "StringsInsufficientHexLength", - }, { type: "error", inputs: [], name: "UUPSUnauthorizedCallContext" }, { type: "error", @@ -4796,6 +5090,13 @@ export const piLicenseTemplateAbi = [ outputs: [{ name: "", internalType: "contract IRoyaltyModule", type: "address" }], stateMutability: "view", }, + { + type: "function", + inputs: [], + name: "TERMS_RENDERER", + outputs: [{ name: "", internalType: "contract PILTermsRenderer", type: "address" }], + stateMutability: "view", + }, { type: "function", inputs: [], @@ -4855,7 +5156,11 @@ export const piLicenseTemplateAbi = [ components: [ { name: "transferable", internalType: "bool", type: "bool" }, { name: "royaltyPolicy", internalType: "address", type: "address" }, - { name: "mintingFee", internalType: "uint256", type: "uint256" }, + { + name: "defaultMintingFee", + internalType: "uint256", + type: "uint256", + }, { name: "expiration", internalType: "uint256", type: "uint256" }, { name: "commercialUse", internalType: "bool", type: "bool" }, { name: "commercialAttribution", internalType: "bool", type: "bool" }, @@ -4875,7 +5180,7 @@ export const piLicenseTemplateAbi = [ type: "uint32", }, { - name: "commercialRevCelling", + name: "commercialRevCeiling", internalType: "uint256", type: "uint256", }, @@ -4888,7 +5193,7 @@ export const piLicenseTemplateAbi = [ { name: "derivativesApproval", internalType: "bool", type: "bool" }, { name: "derivativesReciprocal", internalType: "bool", type: "bool" }, { - name: "derivativeRevCelling", + name: "derivativeRevCeiling", internalType: "uint256", type: "uint256", }, @@ -4909,7 +5214,11 @@ export const piLicenseTemplateAbi = [ components: [ { name: "transferable", internalType: "bool", type: "bool" }, { name: "royaltyPolicy", internalType: "address", type: "address" }, - { name: "mintingFee", internalType: "uint256", type: "uint256" }, + { + name: "defaultMintingFee", + internalType: "uint256", + type: "uint256", + }, { name: "expiration", internalType: "uint256", type: "uint256" }, { name: "commercialUse", internalType: "bool", type: "bool" }, { name: "commercialAttribution", internalType: "bool", type: "bool" }, @@ -4929,7 +5238,7 @@ export const piLicenseTemplateAbi = [ type: "uint32", }, { - name: "commercialRevCelling", + name: "commercialRevCeiling", internalType: "uint256", type: "uint256", }, @@ -4942,7 +5251,7 @@ export const piLicenseTemplateAbi = [ { name: "derivativesApproval", internalType: "bool", type: "bool" }, { name: "derivativesReciprocal", internalType: "bool", type: "bool" }, { - name: "derivativeRevCelling", + name: "derivativeRevCeiling", internalType: "uint256", type: "uint256", }, @@ -5047,7 +5356,11 @@ export const piLicenseTemplateAbi = [ components: [ { name: "transferable", internalType: "bool", type: "bool" }, { name: "royaltyPolicy", internalType: "address", type: "address" }, - { name: "mintingFee", internalType: "uint256", type: "uint256" }, + { + name: "defaultMintingFee", + internalType: "uint256", + type: "uint256", + }, { name: "expiration", internalType: "uint256", type: "uint256" }, { name: "commercialUse", internalType: "bool", type: "bool" }, { name: "commercialAttribution", internalType: "bool", type: "bool" }, @@ -5067,7 +5380,7 @@ export const piLicenseTemplateAbi = [ type: "uint32", }, { - name: "commercialRevCelling", + name: "commercialRevCeiling", internalType: "uint256", type: "uint256", }, @@ -5080,7 +5393,7 @@ export const piLicenseTemplateAbi = [ { name: "derivativesApproval", internalType: "bool", type: "bool" }, { name: "derivativesReciprocal", internalType: "bool", type: "bool" }, { - name: "derivativeRevCelling", + name: "derivativeRevCeiling", internalType: "uint256", type: "uint256", }, @@ -5189,14 +5502,14 @@ export const piLicenseTemplateAbi = [ ] as const; /** - * [__View Contract on Sepolia Etherscan__](https://sepolia.etherscan.io/address/0x260B6CB6284c89dbE660c0004233f7bB99B5edE7) + * */ export const piLicenseTemplateAddress = { - 11155111: "0x260B6CB6284c89dbE660c0004233f7bB99B5edE7", + 1513: "0x8BB1ADE72E21090Fc891e1d4b88AC5E57b27cB31", } as const; /** - * [__View Contract on Sepolia Etherscan__](https://sepolia.etherscan.io/address/0x260B6CB6284c89dbE660c0004233f7bB99B5edE7) + * */ export const piLicenseTemplateConfig = { address: piLicenseTemplateAddress, @@ -5208,7 +5521,7 @@ export const piLicenseTemplateConfig = { ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /** - * [__View Contract on Sepolia Etherscan__](https://sepolia.etherscan.io/address/0xFAE961dd2b87CD5818dbCDc2591e6AB0b50E96b0) + * */ export const royaltyModuleAbi = [ { @@ -5666,14 +5979,14 @@ export const royaltyModuleAbi = [ ] as const; /** - * [__View Contract on Sepolia Etherscan__](https://sepolia.etherscan.io/address/0xFAE961dd2b87CD5818dbCDc2591e6AB0b50E96b0) + * */ export const royaltyModuleAddress = { - 11155111: "0xFAE961dd2b87CD5818dbCDc2591e6AB0b50E96b0", + 1513: "0x968beb5432c362c12b5Be6967a5d6F1ED5A63F01", } as const; /** - * [__View Contract on Sepolia Etherscan__](https://sepolia.etherscan.io/address/0xFAE961dd2b87CD5818dbCDc2591e6AB0b50E96b0) + * */ export const royaltyModuleConfig = { address: royaltyModuleAddress, @@ -5685,7 +5998,7 @@ export const royaltyModuleConfig = { ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /** - * [__View Contract on Sepolia Etherscan__](https://sepolia.etherscan.io/address/0xAAbaf349C7a2A84564F9CC4Ac130B3f19A718E86) + * */ export const royaltyPolicyLapAbi = [ { @@ -5743,11 +6056,6 @@ export const royaltyPolicyLapAbi = [ inputs: [], name: "RoyaltyPolicyLAP__AboveRoyaltyStackLimit", }, - { - type: "error", - inputs: [], - name: "RoyaltyPolicyLAP__InvalidParentRoyaltiesLength", - }, { type: "error", inputs: [], @@ -5800,6 +6108,19 @@ export const royaltyPolicyLapAbi = [ ], name: "Initialized", }, + { + type: "event", + anonymous: false, + inputs: [ + { + name: "beacon", + internalType: "address", + type: "address", + indexed: false, + }, + ], + name: "IpRoyaltyVaultBeaconSet", + }, { type: "event", anonymous: false, @@ -5835,18 +6156,6 @@ export const royaltyPolicyLapAbi = [ type: "uint32", indexed: false, }, - { - name: "targetAncestors", - internalType: "address[]", - type: "address[]", - indexed: false, - }, - { - name: "targetRoyaltyAmount", - internalType: "uint32[]", - type: "uint32[]", - indexed: false, - }, ], name: "PolicyInitialized", }, @@ -5869,6 +6178,19 @@ export const royaltyPolicyLapAbi = [ ], name: "RevenueTokenAddedToVault", }, + { + type: "event", + anonymous: false, + inputs: [ + { + name: "interval", + internalType: "uint256", + type: "uint256", + indexed: false, + }, + ], + name: "SnapshotIntervalSet", + }, { type: "event", anonymous: false, @@ -5895,6 +6217,13 @@ export const royaltyPolicyLapAbi = [ ], name: "Upgraded", }, + { + type: "function", + inputs: [], + name: "IP_GRAPH_CONTRACT", + outputs: [{ name: "", internalType: "address", type: "address" }], + stateMutability: "view", + }, { type: "function", inputs: [], @@ -5966,8 +6295,6 @@ export const royaltyPolicyLapAbi = [ { name: "", internalType: "bool", type: "bool" }, { name: "", internalType: "address", type: "address" }, { name: "", internalType: "uint32", type: "uint32" }, - { name: "", internalType: "address[]", type: "address[]" }, - { name: "", internalType: "uint32[]", type: "uint32[]" }, ], stateMutability: "view", }, @@ -6096,14 +6423,14 @@ export const royaltyPolicyLapAbi = [ ] as const; /** - * [__View Contract on Sepolia Etherscan__](https://sepolia.etherscan.io/address/0xAAbaf349C7a2A84564F9CC4Ac130B3f19A718E86) + * */ export const royaltyPolicyLapAddress = { - 11155111: "0xAAbaf349C7a2A84564F9CC4Ac130B3f19A718E86", + 1513: "0x61A5c7570f5bDB118D65053Ba60DE87e050E664e", } as const; /** - * [__View Contract on Sepolia Etherscan__](https://sepolia.etherscan.io/address/0xAAbaf349C7a2A84564F9CC4Ac130B3f19A718E86) + * */ export const royaltyPolicyLapConfig = { address: royaltyPolicyLapAddress, @@ -6115,7 +6442,7 @@ export const royaltyPolicyLapConfig = { ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /** - * [__View Contract on Sepolia Etherscan__](https://sepolia.etherscan.io/address/0x69415CE984A79a3Cfbe3F51024C63b6C107331e3) + * */ export const spgAbi = [ { @@ -6124,6 +6451,8 @@ export const spgAbi = [ { name: "accessController", internalType: "address", type: "address" }, { name: "ipAssetRegistry", internalType: "address", type: "address" }, { name: "licensingModule", internalType: "address", type: "address" }, + { name: "licenseRegistry", internalType: "address", type: "address" }, + { name: "royaltyModule", internalType: "address", type: "address" }, { name: "coreMetadataModule", internalType: "address", type: "address" }, { name: "pilTemplate", internalType: "address", type: "address" }, { name: "licenseToken", internalType: "address", type: "address" }, @@ -6153,6 +6482,11 @@ export const spgAbi = [ inputs: [{ name: "target", internalType: "address", type: "address" }], name: "AddressEmptyCode", }, + { + type: "error", + inputs: [{ name: "account", internalType: "address", type: "address" }], + name: "AddressInsufficientBalance", + }, { type: "error", inputs: [{ name: "implementation", internalType: "address", type: "address" }], @@ -6165,6 +6499,11 @@ export const spgAbi = [ { type: "error", inputs: [], name: "SPG__CallerNotMinterRole" }, { type: "error", inputs: [], name: "SPG__EmptyLicenseTokens" }, { type: "error", inputs: [], name: "SPG__ZeroAddressParam" }, + { + type: "error", + inputs: [{ name: "token", internalType: "address", type: "address" }], + name: "SafeERC20FailedOperation", + }, { type: "error", inputs: [], name: "UUPSUnauthorizedCallContext" }, { type: "error", @@ -6250,6 +6589,13 @@ export const spgAbi = [ outputs: [{ name: "", internalType: "contract IIPAssetRegistry", type: "address" }], stateMutability: "view", }, + { + type: "function", + inputs: [], + name: "LICENSE_REGISTRY", + outputs: [{ name: "", internalType: "contract ILicenseRegistry", type: "address" }], + stateMutability: "view", + }, { type: "function", inputs: [], @@ -6277,6 +6623,13 @@ export const spgAbi = [ ], stateMutability: "view", }, + { + type: "function", + inputs: [], + name: "ROYALTY_MODULE", + outputs: [{ name: "", internalType: "contract IRoyaltyModule", type: "address" }], + stateMutability: "view", + }, { type: "function", inputs: [], @@ -6324,8 +6677,9 @@ export const spgAbi = [ inputs: [ { name: "nftContract", internalType: "address", type: "address" }, { name: "recipient", internalType: "address", type: "address" }, + { name: "nftMetadata", internalType: "string", type: "string" }, { - name: "metadata", + name: "ipMetadata", internalType: "struct IStoryProtocolGateway.IPMetadata", type: "tuple", components: [ @@ -6347,8 +6701,9 @@ export const spgAbi = [ inputs: [ { name: "nftContract", internalType: "address", type: "address" }, { name: "recipient", internalType: "address", type: "address" }, + { name: "nftMetadata", internalType: "string", type: "string" }, { - name: "metadata", + name: "ipMetadata", internalType: "struct IStoryProtocolGateway.IPMetadata", type: "tuple", components: [ @@ -6433,8 +6788,9 @@ export const spgAbi = [ { name: "royaltyContext", internalType: "bytes", type: "bytes" }, ], }, + { name: "nftMetadata", internalType: "string", type: "string" }, { - name: "metadata", + name: "ipMetadata", internalType: "struct IStoryProtocolGateway.IPMetadata", type: "tuple", components: [ @@ -6458,8 +6814,9 @@ export const spgAbi = [ { name: "nftContract", internalType: "address", type: "address" }, { name: "licenseTokenIds", internalType: "uint256[]", type: "uint256[]" }, { name: "royaltyContext", internalType: "bytes", type: "bytes" }, + { name: "nftMetadata", internalType: "string", type: "string" }, { - name: "metadata", + name: "ipMetadata", internalType: "struct IStoryProtocolGateway.IPMetadata", type: "tuple", components: [ @@ -6490,7 +6847,7 @@ export const spgAbi = [ { name: "nftContract", internalType: "address", type: "address" }, { name: "tokenId", internalType: "uint256", type: "uint256" }, { - name: "metadata", + name: "ipMetadata", internalType: "struct IStoryProtocolGateway.IPMetadata", type: "tuple", components: [ @@ -6520,7 +6877,7 @@ export const spgAbi = [ { name: "nftContract", internalType: "address", type: "address" }, { name: "tokenId", internalType: "uint256", type: "uint256" }, { - name: "metadata", + name: "ipMetadata", internalType: "struct IStoryProtocolGateway.IPMetadata", type: "tuple", components: [ @@ -6626,7 +6983,7 @@ export const spgAbi = [ ], }, { - name: "metadata", + name: "ipMetadata", internalType: "struct IStoryProtocolGateway.IPMetadata", type: "tuple", components: [ @@ -6668,7 +7025,7 @@ export const spgAbi = [ { name: "licenseTokenIds", internalType: "uint256[]", type: "uint256[]" }, { name: "royaltyContext", internalType: "bytes", type: "bytes" }, { - name: "metadata", + name: "ipMetadata", internalType: "struct IStoryProtocolGateway.IPMetadata", type: "tuple", components: [ @@ -6799,14 +7156,14 @@ export const spgAbi = [ ] as const; /** - * [__View Contract on Sepolia Etherscan__](https://sepolia.etherscan.io/address/0x69415CE984A79a3Cfbe3F51024C63b6C107331e3) + * */ export const spgAddress = { - 11155111: "0x69415CE984A79a3Cfbe3F51024C63b6C107331e3", + 1513: "0x69415CE984A79a3Cfbe3F51024C63b6C107331e3", } as const; /** - * [__View Contract on Sepolia Etherscan__](https://sepolia.etherscan.io/address/0x69415CE984A79a3Cfbe3F51024C63b6C107331e3) + * */ export const spgConfig = { address: spgAddress, abi: spgAbi } as const; @@ -6815,7 +7172,7 @@ export const spgConfig = { address: spgAddress, abi: spgAbi } as const; ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /** - * [__View Contract on Sepolia Etherscan__](https://sepolia.etherscan.io/address/0x027D258659FBdda9033f9c008AF166239EBa67c1) + * */ export const spgnftBeaconAbi = [ { @@ -6911,14 +7268,14 @@ export const spgnftBeaconAbi = [ ] as const; /** - * [__View Contract on Sepolia Etherscan__](https://sepolia.etherscan.io/address/0x027D258659FBdda9033f9c008AF166239EBa67c1) + * */ export const spgnftBeaconAddress = { - 11155111: "0x027D258659FBdda9033f9c008AF166239EBa67c1", + 1513: "0x027D258659FBdda9033f9c008AF166239EBa67c1", } as const; /** - * [__View Contract on Sepolia Etherscan__](https://sepolia.etherscan.io/address/0x027D258659FBdda9033f9c008AF166239EBa67c1) + * */ export const spgnftBeaconConfig = { address: spgnftBeaconAddress, @@ -6930,7 +7287,7 @@ export const spgnftBeaconConfig = { ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /** - * [__View Contract on Sepolia Etherscan__](https://sepolia.etherscan.io/address/0xDb6480C00B570324A122A6B35F9CAC0F87BDb3e6) + * */ export const spgnftImplAbi = [ { @@ -7204,8 +7561,8 @@ export const spgnftImplAbi = [ { name: "name", internalType: "string", type: "string" }, { name: "symbol", internalType: "string", type: "string" }, { name: "maxSupply", internalType: "uint32", type: "uint32" }, - { name: "mintCost", internalType: "uint256", type: "uint256" }, - { name: "mintToken", internalType: "address", type: "address" }, + { name: "mintFee", internalType: "uint256", type: "uint256" }, + { name: "mintFeeToken", internalType: "address", type: "address" }, { name: "owner", internalType: "address", type: "address" }, ], name: "initialize", @@ -7242,14 +7599,14 @@ export const spgnftImplAbi = [ { type: "function", inputs: [], - name: "mintCost", + name: "mintFee", outputs: [{ name: "", internalType: "uint256", type: "uint256" }], stateMutability: "view", }, { type: "function", inputs: [], - name: "mintToken", + name: "mintFeeToken", outputs: [{ name: "", internalType: "address", type: "address" }], stateMutability: "view", }, @@ -7322,15 +7679,15 @@ export const spgnftImplAbi = [ }, { type: "function", - inputs: [{ name: "cost", internalType: "uint256", type: "uint256" }], - name: "setMintCost", + inputs: [{ name: "fee", internalType: "uint256", type: "uint256" }], + name: "setMintFee", outputs: [], stateMutability: "nonpayable", }, { type: "function", inputs: [{ name: "token", internalType: "address", type: "address" }], - name: "setMintToken", + name: "setMintFeeToken", outputs: [], stateMutability: "nonpayable", }, @@ -7386,14 +7743,14 @@ export const spgnftImplAbi = [ ] as const; /** - * [__View Contract on Sepolia Etherscan__](https://sepolia.etherscan.io/address/0xDb6480C00B570324A122A6B35F9CAC0F87BDb3e6) + * */ export const spgnftImplAddress = { - 11155111: "0xDb6480C00B570324A122A6B35F9CAC0F87BDb3e6", + 1513: "0xDb6480C00B570324A122A6B35F9CAC0F87BDb3e6", } as const; /** - * [__View Contract on Sepolia Etherscan__](https://sepolia.etherscan.io/address/0xDb6480C00B570324A122A6B35F9CAC0F87BDb3e6) + * */ export const spgnftImplConfig = { address: spgnftImplAddress, @@ -7671,6 +8028,24 @@ export class AccessControllerClient extends AccessControllerEventClient { // Contract CoreMetadataModule ============================================================= +/** + * CoreMetadataModuleAuthorityUpdatedEvent + * + * @param authority address + */ +export type CoreMetadataModuleAuthorityUpdatedEvent = { + authority: Address; +}; + +/** + * CoreMetadataModuleInitializedEvent + * + * @param version uint64 + */ +export type CoreMetadataModuleInitializedEvent = { + version: bigint; +}; + /** * CoreMetadataModuleMetadataFrozenEvent * @@ -7706,10 +8081,25 @@ export type CoreMetadataModuleNftTokenUriSetEvent = { nftMetadataHash: Hex; }; +/** + * CoreMetadataModuleUpgradedEvent + * + * @param implementation address + */ +export type CoreMetadataModuleUpgradedEvent = { + implementation: Address; +}; + export type CoreMetadataModuleAccessControllerResponse = Address; export type CoreMetadataModuleIpAccountRegistryResponse = Address; +export type CoreMetadataModuleUpgradeInterfaceVersionResponse = string; + +export type CoreMetadataModuleAuthorityResponse = Address; + +export type CoreMetadataModuleIsConsumingScheduledOpResponse = Hex; + /** * CoreMetadataModuleIsMetadataFrozenRequest * @@ -7723,6 +8113,8 @@ export type CoreMetadataModuleIsMetadataFrozenResponse = boolean; export type CoreMetadataModuleNameResponse = string; +export type CoreMetadataModuleProxiableUuidResponse = Hex; + /** * CoreMetadataModuleSupportsInterfaceRequest * @@ -7743,6 +8135,15 @@ export type CoreMetadataModuleFreezeMetadataRequest = { ipId: Address; }; +/** + * CoreMetadataModuleInitializeRequest + * + * @param accessManager address + */ +export type CoreMetadataModuleInitializeRequest = { + accessManager: Address; +}; + /** * CoreMetadataModuleSetAllRequest * @@ -7758,6 +8159,15 @@ export type CoreMetadataModuleSetAllRequest = { nftMetadataHash: Hex; }; +/** + * CoreMetadataModuleSetAuthorityRequest + * + * @param newAuthority address + */ +export type CoreMetadataModuleSetAuthorityRequest = { + newAuthority: Address; +}; + /** * CoreMetadataModuleSetMetadataUriRequest * @@ -7782,6 +8192,17 @@ export type CoreMetadataModuleUpdateNftTokenUriRequest = { nftMetadataHash: Hex; }; +/** + * CoreMetadataModuleUpgradeToAndCallRequest + * + * @param newImplementation address + * @param data bytes + */ +export type CoreMetadataModuleUpgradeToAndCallRequest = { + newImplementation: Address; + data: Hex; +}; + /** * contract CoreMetadataModule event */ @@ -7794,6 +8215,88 @@ export class CoreMetadataModuleEventClient { this.rpcClient = rpcClient; } + /** + * event AuthorityUpdated for contract CoreMetadataModule + */ + public watchAuthorityUpdatedEvent( + onLogs: (txHash: Hex, ev: Partial) => void, + ): WatchContractEventReturnType { + return this.rpcClient.watchContractEvent({ + abi: coreMetadataModuleAbi, + address: this.address, + eventName: "AuthorityUpdated", + onLogs: (evs) => { + evs.forEach((it) => onLogs(it.transactionHash, it.args)); + }, + }); + } + + /** + * parse tx receipt event AuthorityUpdated for contract CoreMetadataModule + */ + public parseTxAuthorityUpdatedEvent( + txReceipt: TransactionReceipt, + ): Array { + const targetLogs: Array = []; + for (const log of txReceipt.logs) { + try { + const event = decodeEventLog({ + abi: coreMetadataModuleAbi, + eventName: "AuthorityUpdated", + data: log.data, + topics: log.topics, + }); + if (event.eventName === "AuthorityUpdated") { + targetLogs.push(event.args); + } + } catch (e) { + /* empty */ + } + } + return targetLogs; + } + + /** + * event Initialized for contract CoreMetadataModule + */ + public watchInitializedEvent( + onLogs: (txHash: Hex, ev: Partial) => void, + ): WatchContractEventReturnType { + return this.rpcClient.watchContractEvent({ + abi: coreMetadataModuleAbi, + address: this.address, + eventName: "Initialized", + onLogs: (evs) => { + evs.forEach((it) => onLogs(it.transactionHash, it.args)); + }, + }); + } + + /** + * parse tx receipt event Initialized for contract CoreMetadataModule + */ + public parseTxInitializedEvent( + txReceipt: TransactionReceipt, + ): Array { + const targetLogs: Array = []; + for (const log of txReceipt.logs) { + try { + const event = decodeEventLog({ + abi: coreMetadataModuleAbi, + eventName: "Initialized", + data: log.data, + topics: log.topics, + }); + if (event.eventName === "Initialized") { + targetLogs.push(event.args); + } + } catch (e) { + /* empty */ + } + } + return targetLogs; + } + /** * event MetadataFrozen for contract CoreMetadataModule */ @@ -7916,6 +8419,47 @@ export class CoreMetadataModuleEventClient { } return targetLogs; } + + /** + * event Upgraded for contract CoreMetadataModule + */ + public watchUpgradedEvent( + onLogs: (txHash: Hex, ev: Partial) => void, + ): WatchContractEventReturnType { + return this.rpcClient.watchContractEvent({ + abi: coreMetadataModuleAbi, + address: this.address, + eventName: "Upgraded", + onLogs: (evs) => { + evs.forEach((it) => onLogs(it.transactionHash, it.args)); + }, + }); + } + + /** + * parse tx receipt event Upgraded for contract CoreMetadataModule + */ + public parseTxUpgradedEvent( + txReceipt: TransactionReceipt, + ): Array { + const targetLogs: Array = []; + for (const log of txReceipt.logs) { + try { + const event = decodeEventLog({ + abi: coreMetadataModuleAbi, + eventName: "Upgraded", + data: log.data, + topics: log.topics, + }); + if (event.eventName === "Upgraded") { + targetLogs.push(event.args); + } + } catch (e) { + /* empty */ + } + } + return targetLogs; + } } /** @@ -7927,30 +8471,72 @@ export class CoreMetadataModuleReadOnlyClient extends CoreMetadataModuleEventCli } /** - * method ACCESS_CONTROLLER for contract CoreMetadataModule + * method ACCESS_CONTROLLER for contract CoreMetadataModule + * + * @param request CoreMetadataModuleAccessControllerRequest + * @return Promise + */ + public async accessController(): Promise { + return await this.rpcClient.readContract({ + abi: coreMetadataModuleAbi, + address: this.address, + functionName: "ACCESS_CONTROLLER", + }); + } + + /** + * method IP_ACCOUNT_REGISTRY for contract CoreMetadataModule + * + * @param request CoreMetadataModuleIpAccountRegistryRequest + * @return Promise + */ + public async ipAccountRegistry(): Promise { + return await this.rpcClient.readContract({ + abi: coreMetadataModuleAbi, + address: this.address, + functionName: "IP_ACCOUNT_REGISTRY", + }); + } + + /** + * method UPGRADE_INTERFACE_VERSION for contract CoreMetadataModule + * + * @param request CoreMetadataModuleUpgradeInterfaceVersionRequest + * @return Promise + */ + public async upgradeInterfaceVersion(): Promise { + return await this.rpcClient.readContract({ + abi: coreMetadataModuleAbi, + address: this.address, + functionName: "UPGRADE_INTERFACE_VERSION", + }); + } + + /** + * method authority for contract CoreMetadataModule * - * @param request CoreMetadataModuleAccessControllerRequest - * @return Promise + * @param request CoreMetadataModuleAuthorityRequest + * @return Promise */ - public async accessController(): Promise { + public async authority(): Promise { return await this.rpcClient.readContract({ abi: coreMetadataModuleAbi, address: this.address, - functionName: "ACCESS_CONTROLLER", + functionName: "authority", }); } /** - * method IP_ACCOUNT_REGISTRY for contract CoreMetadataModule + * method isConsumingScheduledOp for contract CoreMetadataModule * - * @param request CoreMetadataModuleIpAccountRegistryRequest - * @return Promise + * @param request CoreMetadataModuleIsConsumingScheduledOpRequest + * @return Promise */ - public async ipAccountRegistry(): Promise { + public async isConsumingScheduledOp(): Promise { return await this.rpcClient.readContract({ abi: coreMetadataModuleAbi, address: this.address, - functionName: "IP_ACCOUNT_REGISTRY", + functionName: "isConsumingScheduledOp", }); } @@ -7985,6 +8571,20 @@ export class CoreMetadataModuleReadOnlyClient extends CoreMetadataModuleEventCli }); } + /** + * method proxiableUUID for contract CoreMetadataModule + * + * @param request CoreMetadataModuleProxiableUuidRequest + * @return Promise + */ + public async proxiableUuid(): Promise { + return await this.rpcClient.readContract({ + abi: coreMetadataModuleAbi, + address: this.address, + functionName: "proxiableUUID", + }); + } + /** * method supportsInterface for contract CoreMetadataModule * @@ -8050,6 +8650,42 @@ export class CoreMetadataModuleClient extends CoreMetadataModuleReadOnlyClient { }; } + /** + * method initialize for contract CoreMetadataModule + * + * @param request CoreMetadataModuleInitializeRequest + * @return Promise + */ + public async initialize( + request: CoreMetadataModuleInitializeRequest, + ): Promise { + const { request: call } = await this.rpcClient.simulateContract({ + abi: coreMetadataModuleAbi, + address: this.address, + functionName: "initialize", + account: this.wallet.account, + args: [request.accessManager], + }); + return await this.wallet.writeContract(call as WriteContractParameters); + } + + /** + * method initialize for contract CoreMetadataModule with only encode + * + * @param request CoreMetadataModuleInitializeRequest + * @return EncodedTxData + */ + public initializeEncode(request: CoreMetadataModuleInitializeRequest): EncodedTxData { + return { + to: this.address, + data: encodeFunctionData({ + abi: coreMetadataModuleAbi, + functionName: "initialize", + args: [request.accessManager], + }), + }; + } + /** * method setAll for contract CoreMetadataModule * @@ -8084,6 +8720,42 @@ export class CoreMetadataModuleClient extends CoreMetadataModuleReadOnlyClient { }; } + /** + * method setAuthority for contract CoreMetadataModule + * + * @param request CoreMetadataModuleSetAuthorityRequest + * @return Promise + */ + public async setAuthority( + request: CoreMetadataModuleSetAuthorityRequest, + ): Promise { + const { request: call } = await this.rpcClient.simulateContract({ + abi: coreMetadataModuleAbi, + address: this.address, + functionName: "setAuthority", + account: this.wallet.account, + args: [request.newAuthority], + }); + return await this.wallet.writeContract(call as WriteContractParameters); + } + + /** + * method setAuthority for contract CoreMetadataModule with only encode + * + * @param request CoreMetadataModuleSetAuthorityRequest + * @return EncodedTxData + */ + public setAuthorityEncode(request: CoreMetadataModuleSetAuthorityRequest): EncodedTxData { + return { + to: this.address, + data: encodeFunctionData({ + abi: coreMetadataModuleAbi, + functionName: "setAuthority", + args: [request.newAuthority], + }), + }; + } + /** * method setMetadataURI for contract CoreMetadataModule * @@ -8157,6 +8829,42 @@ export class CoreMetadataModuleClient extends CoreMetadataModuleReadOnlyClient { }), }; } + + /** + * method upgradeToAndCall for contract CoreMetadataModule + * + * @param request CoreMetadataModuleUpgradeToAndCallRequest + * @return Promise + */ + public async upgradeToAndCall( + request: CoreMetadataModuleUpgradeToAndCallRequest, + ): Promise { + const { request: call } = await this.rpcClient.simulateContract({ + abi: coreMetadataModuleAbi, + address: this.address, + functionName: "upgradeToAndCall", + account: this.wallet.account, + args: [request.newImplementation, request.data], + }); + return await this.wallet.writeContract(call as WriteContractParameters); + } + + /** + * method upgradeToAndCall for contract CoreMetadataModule with only encode + * + * @param request CoreMetadataModuleUpgradeToAndCallRequest + * @return EncodedTxData + */ + public upgradeToAndCallEncode(request: CoreMetadataModuleUpgradeToAndCallRequest): EncodedTxData { + return { + to: this.address, + data: encodeFunctionData({ + abi: coreMetadataModuleAbi, + functionName: "upgradeToAndCall", + args: [request.newImplementation, request.data], + }), + }; + } } // Contract DisputeModule ============================================================= @@ -8497,7 +9205,14 @@ export class DisputeModuleClient extends DisputeModuleEventClient { // Contract IPAccountImpl ============================================================= -export type IpAccountImplStateResponse = bigint; +/** + * IpAccountImplStateResponse + * + * @param result bytes32 + */ +export type IpAccountImplStateResponse = { + result: Hex; +}; /** * IpAccountImplExecuteRequest @@ -8505,11 +9220,26 @@ export type IpAccountImplStateResponse = bigint; * @param to address * @param value uint256 * @param data bytes + * @param operation uint8 */ export type IpAccountImplExecuteRequest = { to: Address; value: bigint; data: Hex; + operation: number; +}; + +/** + * IpAccountImplExecute2Request + * + * @param to address + * @param value uint256 + * @param data bytes + */ +export type IpAccountImplExecute2Request = { + to: Address; + value: bigint; + data: Hex; }; /** @@ -8550,11 +9280,14 @@ export class IpAccountImplReadOnlyClient { * @return Promise */ public async state(): Promise { - return await this.rpcClient.readContract({ + const result = await this.rpcClient.readContract({ abi: ipAccountImplAbi, address: this.address, functionName: "state", }); + return { + result: result, + }; } } @@ -8581,7 +9314,7 @@ export class IpAccountImplClient extends IpAccountImplReadOnlyClient { address: this.address, functionName: "execute", account: this.wallet.account, - args: [request.to, request.value, request.data], + args: [request.to, request.value, request.data, request.operation], }); return await this.wallet.writeContract(call as WriteContractParameters); } @@ -8593,6 +9326,40 @@ export class IpAccountImplClient extends IpAccountImplReadOnlyClient { * @return EncodedTxData */ public executeEncode(request: IpAccountImplExecuteRequest): EncodedTxData { + return { + to: this.address, + data: encodeFunctionData({ + abi: ipAccountImplAbi, + functionName: "execute", + args: [request.to, request.value, request.data, request.operation], + }), + }; + } + + /** + * method execute for contract IPAccountImpl + * + * @param request IpAccountImplExecute2Request + * @return Promise + */ + public async execute2(request: IpAccountImplExecute2Request): Promise { + const { request: call } = await this.rpcClient.simulateContract({ + abi: ipAccountImplAbi, + address: this.address, + functionName: "execute", + account: this.wallet.account, + args: [request.to, request.value, request.data], + }); + return await this.wallet.writeContract(call as WriteContractParameters); + } + + /** + * method execute for contract IPAccountImpl with only encode + * + * @param request IpAccountImplExecute2Request + * @return EncodedTxData + */ + public execute2Encode(request: IpAccountImplExecute2Request): EncodedTxData { return { to: this.address, data: encodeFunctionData({ @@ -9347,6 +10114,17 @@ export type LicenseRegistryAuthorityUpdatedEvent = { authority: Address; }; +/** + * LicenseRegistryDefaultLicenseTermsSetEvent + * + * @param licenseTemplate address + * @param licenseTermsId uint256 + */ +export type LicenseRegistryDefaultLicenseTermsSetEvent = { + licenseTemplate: Address; + licenseTermsId: bigint; +}; + /** * LicenseRegistryExpirationTimeSetEvent * @@ -9418,6 +10196,8 @@ export type LicenseRegistryDisputeModuleResponse = Address; export type LicenseRegistryExpirationTimeResponse = Hex; +export type LicenseRegistryIpGraphContractResponse = Address; + export type LicenseRegistryLicensingModuleResponse = Address; export type LicenseRegistryUpgradeInterfaceVersionResponse = string; @@ -9701,12 +10481,14 @@ export type LicenseRegistryInitializeRequest = { * @param parentIpIds address[] * @param licenseTemplate address * @param licenseTermsIds uint256[] + * @param isUsingLicenseToken bool */ export type LicenseRegistryRegisterDerivativeIpRequest = { childIpId: Address; parentIpIds: readonly Address[]; licenseTemplate: Address; licenseTermsIds: readonly bigint[]; + isUsingLicenseToken: boolean; }; /** @@ -9738,17 +10520,6 @@ export type LicenseRegistrySetDefaultLicenseTermsRequest = { newLicenseTermsId: bigint; }; -/** - * LicenseRegistrySetExpireTimeRequest - * - * @param ipId address - * @param expireTime uint256 - */ -export type LicenseRegistrySetExpireTimeRequest = { - ipId: Address; - expireTime: bigint; -}; - /** * LicenseRegistrySetLicensingConfigForIpRequest * @@ -9849,6 +10620,47 @@ export class LicenseRegistryEventClient { return targetLogs; } + /** + * event DefaultLicenseTermsSet for contract LicenseRegistry + */ + public watchDefaultLicenseTermsSetEvent( + onLogs: (txHash: Hex, ev: Partial) => void, + ): WatchContractEventReturnType { + return this.rpcClient.watchContractEvent({ + abi: licenseRegistryAbi, + address: this.address, + eventName: "DefaultLicenseTermsSet", + onLogs: (evs) => { + evs.forEach((it) => onLogs(it.transactionHash, it.args)); + }, + }); + } + + /** + * parse tx receipt event DefaultLicenseTermsSet for contract LicenseRegistry + */ + public parseTxDefaultLicenseTermsSetEvent( + txReceipt: TransactionReceipt, + ): Array { + const targetLogs: Array = []; + for (const log of txReceipt.logs) { + try { + const event = decodeEventLog({ + abi: licenseRegistryAbi, + eventName: "DefaultLicenseTermsSet", + data: log.data, + topics: log.topics, + }); + if (event.eventName === "DefaultLicenseTermsSet") { + targetLogs.push(event.args); + } + } catch (e) { + /* empty */ + } + } + return targetLogs; + } + /** * event ExpirationTimeSet for contract LicenseRegistry */ @@ -10130,6 +10942,20 @@ export class LicenseRegistryReadOnlyClient extends LicenseRegistryEventClient { }); } + /** + * method IP_GRAPH_CONTRACT for contract LicenseRegistry + * + * @param request LicenseRegistryIpGraphContractRequest + * @return Promise + */ + public async ipGraphContract(): Promise { + return await this.rpcClient.readContract({ + abi: licenseRegistryAbi, + address: this.address, + functionName: "IP_GRAPH_CONTRACT", + }); + } + /** * method LICENSING_MODULE for contract LicenseRegistry * @@ -10610,6 +11436,7 @@ export class LicenseRegistryClient extends LicenseRegistryReadOnlyClient { request.parentIpIds, request.licenseTemplate, request.licenseTermsIds, + request.isUsingLicenseToken, ], }); return await this.wallet.writeContract(call as WriteContractParameters); @@ -10634,6 +11461,7 @@ export class LicenseRegistryClient extends LicenseRegistryReadOnlyClient { request.parentIpIds, request.licenseTemplate, request.licenseTermsIds, + request.isUsingLicenseToken, ], }), }; @@ -10725,64 +11553,28 @@ export class LicenseRegistryClient extends LicenseRegistryReadOnlyClient { const { request: call } = await this.rpcClient.simulateContract({ abi: licenseRegistryAbi, address: this.address, - functionName: "setDefaultLicenseTerms", - account: this.wallet.account, - args: [request.newLicenseTemplate, request.newLicenseTermsId], - }); - return await this.wallet.writeContract(call as WriteContractParameters); - } - - /** - * method setDefaultLicenseTerms for contract LicenseRegistry with only encode - * - * @param request LicenseRegistrySetDefaultLicenseTermsRequest - * @return EncodedTxData - */ - public setDefaultLicenseTermsEncode( - request: LicenseRegistrySetDefaultLicenseTermsRequest, - ): EncodedTxData { - return { - to: this.address, - data: encodeFunctionData({ - abi: licenseRegistryAbi, - functionName: "setDefaultLicenseTerms", - args: [request.newLicenseTemplate, request.newLicenseTermsId], - }), - }; - } - - /** - * method setExpireTime for contract LicenseRegistry - * - * @param request LicenseRegistrySetExpireTimeRequest - * @return Promise - */ - public async setExpireTime( - request: LicenseRegistrySetExpireTimeRequest, - ): Promise { - const { request: call } = await this.rpcClient.simulateContract({ - abi: licenseRegistryAbi, - address: this.address, - functionName: "setExpireTime", + functionName: "setDefaultLicenseTerms", account: this.wallet.account, - args: [request.ipId, request.expireTime], + args: [request.newLicenseTemplate, request.newLicenseTermsId], }); return await this.wallet.writeContract(call as WriteContractParameters); } /** - * method setExpireTime for contract LicenseRegistry with only encode + * method setDefaultLicenseTerms for contract LicenseRegistry with only encode * - * @param request LicenseRegistrySetExpireTimeRequest + * @param request LicenseRegistrySetDefaultLicenseTermsRequest * @return EncodedTxData */ - public setExpireTimeEncode(request: LicenseRegistrySetExpireTimeRequest): EncodedTxData { + public setDefaultLicenseTermsEncode( + request: LicenseRegistrySetDefaultLicenseTermsRequest, + ): EncodedTxData { return { to: this.address, data: encodeFunctionData({ abi: licenseRegistryAbi, - functionName: "setExpireTime", - args: [request.ipId, request.expireTime], + functionName: "setDefaultLicenseTerms", + args: [request.newLicenseTemplate, request.newLicenseTermsId], }), }; } @@ -11442,6 +12234,8 @@ export type PiLicenseTemplateLicenseRegistryResponse = Address; export type PiLicenseTemplateRoyaltyModuleResponse = Address; +export type PiLicenseTemplateTermsRendererResponse = Address; + export type PiLicenseTemplateUpgradeInterfaceVersionResponse = string; export type PiLicenseTemplateAuthorityResponse = Address; @@ -11501,19 +12295,19 @@ export type PiLicenseTemplateGetLicenseTermsResponse = { terms: { transferable: boolean; royaltyPolicy: Address; - mintingFee: bigint; + defaultMintingFee: bigint; expiration: bigint; commercialUse: boolean; commercialAttribution: boolean; commercializerChecker: Address; commercializerCheckerData: Hex; commercialRevShare: number; - commercialRevCelling: bigint; + commercialRevCeiling: bigint; derivativesAllowed: boolean; derivativesAttribution: boolean; derivativesApproval: boolean; derivativesReciprocal: boolean; - derivativeRevCelling: bigint; + derivativeRevCeiling: bigint; currency: Address; uri: string; }; @@ -11528,19 +12322,19 @@ export type PiLicenseTemplateGetLicenseTermsIdRequest = { terms: { transferable: boolean; royaltyPolicy: Address; - mintingFee: bigint; + defaultMintingFee: bigint; expiration: bigint; commercialUse: boolean; commercialAttribution: boolean; commercializerChecker: Address; commercializerCheckerData: Hex; commercialRevShare: number; - commercialRevCelling: bigint; + commercialRevCeiling: bigint; derivativesAllowed: boolean; derivativesAttribution: boolean; derivativesApproval: boolean; derivativesReciprocal: boolean; - derivativeRevCelling: bigint; + derivativeRevCeiling: bigint; currency: Address; uri: string; }; @@ -11681,19 +12475,19 @@ export type PiLicenseTemplateRegisterLicenseTermsRequest = { terms: { transferable: boolean; royaltyPolicy: Address; - mintingFee: bigint; + defaultMintingFee: bigint; expiration: bigint; commercialUse: boolean; commercialAttribution: boolean; commercializerChecker: Address; commercializerCheckerData: Hex; commercialRevShare: number; - commercialRevCelling: bigint; + commercialRevCeiling: bigint; derivativesAllowed: boolean; derivativesAttribution: boolean; derivativesApproval: boolean; derivativesReciprocal: boolean; - derivativeRevCelling: bigint; + derivativeRevCeiling: bigint; currency: Address; uri: string; }; @@ -12061,6 +12855,20 @@ export class PiLicenseTemplateReadOnlyClient extends PiLicenseTemplateEventClien }); } + /** + * method TERMS_RENDERER for contract PILicenseTemplate + * + * @param request PiLicenseTemplateTermsRendererRequest + * @return Promise + */ + public async termsRenderer(): Promise { + return await this.rpcClient.readContract({ + abi: piLicenseTemplateAbi, + address: this.address, + functionName: "TERMS_RENDERER", + }); + } + /** * method UPGRADE_INTERFACE_VERSION for contract PILicenseTemplate * @@ -12774,16 +13582,8 @@ export type RoyaltyPolicyLapGetRoyaltyDataRequest = { * @param 0 bool * @param 1 address * @param 2 uint32 - * @param 3 address[] - * @param 4 uint32[] */ -export type RoyaltyPolicyLapGetRoyaltyDataResponse = readonly [ - boolean, - Address, - number, - readonly Address[], - readonly number[], -]; +export type RoyaltyPolicyLapGetRoyaltyDataResponse = readonly [boolean, Address, number]; /** * RoyaltyPolicyLapOnRoyaltyPaymentRequest @@ -12913,12 +13713,14 @@ export type SpgCreateCollectionRequest = { * * @param nftContract address * @param recipient address - * @param metadata tuple + * @param nftMetadata string + * @param ipMetadata tuple */ export type SpgMintAndRegisterIpRequest = { nftContract: Address; recipient: Address; - metadata: { + nftMetadata: string; + ipMetadata: { metadataURI: string; metadataHash: Hex; nftMetadataHash: Hex; @@ -12930,13 +13732,15 @@ export type SpgMintAndRegisterIpRequest = { * * @param nftContract address * @param recipient address - * @param metadata tuple + * @param nftMetadata string + * @param ipMetadata tuple * @param terms tuple */ export type SpgMintAndRegisterIpAndAttachPilTermsRequest = { nftContract: Address; recipient: Address; - metadata: { + nftMetadata: string; + ipMetadata: { metadataURI: string; metadataHash: Hex; nftMetadataHash: Hex; @@ -12967,7 +13771,8 @@ export type SpgMintAndRegisterIpAndAttachPilTermsRequest = { * * @param nftContract address * @param derivData tuple - * @param metadata tuple + * @param nftMetadata string + * @param ipMetadata tuple * @param recipient address */ export type SpgMintAndRegisterIpAndMakeDerivativeRequest = { @@ -12978,7 +13783,8 @@ export type SpgMintAndRegisterIpAndMakeDerivativeRequest = { licenseTermsIds: readonly bigint[]; royaltyContext: Hex; }; - metadata: { + nftMetadata: string; + ipMetadata: { metadataURI: string; metadataHash: Hex; nftMetadataHash: Hex; @@ -12992,14 +13798,16 @@ export type SpgMintAndRegisterIpAndMakeDerivativeRequest = { * @param nftContract address * @param licenseTokenIds uint256[] * @param royaltyContext bytes - * @param metadata tuple + * @param nftMetadata string + * @param ipMetadata tuple * @param recipient address */ export type SpgMintAndRegisterIpAndMakeDerivativeWithLicenseTokensRequest = { nftContract: Address; licenseTokenIds: readonly bigint[]; royaltyContext: Hex; - metadata: { + nftMetadata: string; + ipMetadata: { metadataURI: string; metadataHash: Hex; nftMetadataHash: Hex; @@ -13012,13 +13820,13 @@ export type SpgMintAndRegisterIpAndMakeDerivativeWithLicenseTokensRequest = { * * @param nftContract address * @param tokenId uint256 - * @param metadata tuple + * @param ipMetadata tuple * @param sigMetadata tuple */ export type SpgRegisterIpRequest = { nftContract: Address; tokenId: bigint; - metadata: { + ipMetadata: { metadataURI: string; metadataHash: Hex; nftMetadataHash: Hex; @@ -13035,7 +13843,7 @@ export type SpgRegisterIpRequest = { * * @param nftContract address * @param tokenId uint256 - * @param metadata tuple + * @param ipMetadata tuple * @param terms tuple * @param sigMetadata tuple * @param sigAttach tuple @@ -13043,7 +13851,7 @@ export type SpgRegisterIpRequest = { export type SpgRegisterIpAndAttachPilTermsRequest = { nftContract: Address; tokenId: bigint; - metadata: { + ipMetadata: { metadataURI: string; metadataHash: Hex; nftMetadataHash: Hex; @@ -13085,7 +13893,7 @@ export type SpgRegisterIpAndAttachPilTermsRequest = { * @param nftContract address * @param tokenId uint256 * @param derivData tuple - * @param metadata tuple + * @param ipMetadata tuple * @param sigMetadata tuple * @param sigRegister tuple */ @@ -13098,7 +13906,7 @@ export type SpgRegisterIpAndMakeDerivativeRequest = { licenseTermsIds: readonly bigint[]; royaltyContext: Hex; }; - metadata: { + ipMetadata: { metadataURI: string; metadataHash: Hex; nftMetadataHash: Hex; @@ -13122,7 +13930,7 @@ export type SpgRegisterIpAndMakeDerivativeRequest = { * @param tokenId uint256 * @param licenseTokenIds uint256[] * @param royaltyContext bytes - * @param metadata tuple + * @param ipMetadata tuple * @param sigMetadata tuple * @param sigRegister tuple */ @@ -13131,7 +13939,7 @@ export type SpgRegisterIpAndMakeDerivativeWithLicenseTokensRequest = { tokenId: bigint; licenseTokenIds: readonly bigint[]; royaltyContext: Hex; - metadata: { + ipMetadata: { metadataURI: string; metadataHash: Hex; nftMetadataHash: Hex; @@ -13306,7 +14114,7 @@ export class SpgClient extends SpgEventClient { address: this.address, functionName: "mintAndRegisterIp", account: this.wallet.account, - args: [request.nftContract, request.recipient, request.metadata], + args: [request.nftContract, request.recipient, request.nftMetadata, request.ipMetadata], }); return await this.wallet.writeContract(call as WriteContractParameters); } @@ -13323,7 +14131,7 @@ export class SpgClient extends SpgEventClient { data: encodeFunctionData({ abi: spgAbi, functionName: "mintAndRegisterIp", - args: [request.nftContract, request.recipient, request.metadata], + args: [request.nftContract, request.recipient, request.nftMetadata, request.ipMetadata], }), }; } @@ -13342,7 +14150,13 @@ export class SpgClient extends SpgEventClient { address: this.address, functionName: "mintAndRegisterIpAndAttachPILTerms", account: this.wallet.account, - args: [request.nftContract, request.recipient, request.metadata, request.terms], + args: [ + request.nftContract, + request.recipient, + request.nftMetadata, + request.ipMetadata, + request.terms, + ], }); return await this.wallet.writeContract(call as WriteContractParameters); } @@ -13361,7 +14175,13 @@ export class SpgClient extends SpgEventClient { data: encodeFunctionData({ abi: spgAbi, functionName: "mintAndRegisterIpAndAttachPILTerms", - args: [request.nftContract, request.recipient, request.metadata, request.terms], + args: [ + request.nftContract, + request.recipient, + request.nftMetadata, + request.ipMetadata, + request.terms, + ], }), }; } @@ -13380,7 +14200,13 @@ export class SpgClient extends SpgEventClient { address: this.address, functionName: "mintAndRegisterIpAndMakeDerivative", account: this.wallet.account, - args: [request.nftContract, request.derivData, request.metadata, request.recipient], + args: [ + request.nftContract, + request.derivData, + request.nftMetadata, + request.ipMetadata, + request.recipient, + ], }); return await this.wallet.writeContract(call as WriteContractParameters); } @@ -13399,7 +14225,13 @@ export class SpgClient extends SpgEventClient { data: encodeFunctionData({ abi: spgAbi, functionName: "mintAndRegisterIpAndMakeDerivative", - args: [request.nftContract, request.derivData, request.metadata, request.recipient], + args: [ + request.nftContract, + request.derivData, + request.nftMetadata, + request.ipMetadata, + request.recipient, + ], }), }; } @@ -13422,7 +14254,8 @@ export class SpgClient extends SpgEventClient { request.nftContract, request.licenseTokenIds, request.royaltyContext, - request.metadata, + request.nftMetadata, + request.ipMetadata, request.recipient, ], }); @@ -13447,7 +14280,8 @@ export class SpgClient extends SpgEventClient { request.nftContract, request.licenseTokenIds, request.royaltyContext, - request.metadata, + request.nftMetadata, + request.ipMetadata, request.recipient, ], }), @@ -13466,7 +14300,7 @@ export class SpgClient extends SpgEventClient { address: this.address, functionName: "registerIp", account: this.wallet.account, - args: [request.nftContract, request.tokenId, request.metadata, request.sigMetadata], + args: [request.nftContract, request.tokenId, request.ipMetadata, request.sigMetadata], }); return await this.wallet.writeContract(call as WriteContractParameters); } @@ -13483,7 +14317,7 @@ export class SpgClient extends SpgEventClient { data: encodeFunctionData({ abi: spgAbi, functionName: "registerIp", - args: [request.nftContract, request.tokenId, request.metadata, request.sigMetadata], + args: [request.nftContract, request.tokenId, request.ipMetadata, request.sigMetadata], }), }; } @@ -13505,7 +14339,7 @@ export class SpgClient extends SpgEventClient { args: [ request.nftContract, request.tokenId, - request.metadata, + request.ipMetadata, request.terms, request.sigMetadata, request.sigAttach, @@ -13531,7 +14365,7 @@ export class SpgClient extends SpgEventClient { args: [ request.nftContract, request.tokenId, - request.metadata, + request.ipMetadata, request.terms, request.sigMetadata, request.sigAttach, @@ -13558,7 +14392,7 @@ export class SpgClient extends SpgEventClient { request.nftContract, request.tokenId, request.derivData, - request.metadata, + request.ipMetadata, request.sigMetadata, request.sigRegister, ], @@ -13584,7 +14418,7 @@ export class SpgClient extends SpgEventClient { request.nftContract, request.tokenId, request.derivData, - request.metadata, + request.ipMetadata, request.sigMetadata, request.sigRegister, ], @@ -13611,7 +14445,7 @@ export class SpgClient extends SpgEventClient { request.tokenId, request.licenseTokenIds, request.royaltyContext, - request.metadata, + request.ipMetadata, request.sigMetadata, request.sigRegister, ], @@ -13638,7 +14472,7 @@ export class SpgClient extends SpgEventClient { request.tokenId, request.licenseTokenIds, request.royaltyContext, - request.metadata, + request.ipMetadata, request.sigMetadata, request.sigRegister, ], @@ -13687,292 +14521,6 @@ export class SpgClient extends SpgEventClient { // Contract SPGNFTBeacon ============================================================= -/** - * SpgnftBeaconOwnershipTransferredEvent - * - * @param previousOwner address - * @param newOwner address - */ -export type SpgnftBeaconOwnershipTransferredEvent = { - previousOwner: Address; - newOwner: Address; -}; - -/** - * SpgnftBeaconUpgradedEvent - * - * @param implementation address - */ -export type SpgnftBeaconUpgradedEvent = { - implementation: Address; -}; - -export type SpgnftBeaconImplementationResponse = Address; - -export type SpgnftBeaconOwnerResponse = Address; - -/** - * SpgnftBeaconTransferOwnershipRequest - * - * @param newOwner address - */ -export type SpgnftBeaconTransferOwnershipRequest = { - newOwner: Address; -}; - -/** - * SpgnftBeaconUpgradeToRequest - * - * @param newImplementation address - */ -export type SpgnftBeaconUpgradeToRequest = { - newImplementation: Address; -}; - -/** - * contract SPGNFTBeacon event - */ -export class SpgnftBeaconEventClient { - protected readonly rpcClient: PublicClient; - public readonly address: Address; - - constructor(rpcClient: PublicClient, address?: Address) { - this.address = address || getAddress(spgnftBeaconAddress, rpcClient.chain?.id); - this.rpcClient = rpcClient; - } - - /** - * event OwnershipTransferred for contract SPGNFTBeacon - */ - public watchOwnershipTransferredEvent( - onLogs: (txHash: Hex, ev: Partial) => void, - ): WatchContractEventReturnType { - return this.rpcClient.watchContractEvent({ - abi: spgnftBeaconAbi, - address: this.address, - eventName: "OwnershipTransferred", - onLogs: (evs) => { - evs.forEach((it) => onLogs(it.transactionHash, it.args)); - }, - }); - } - - /** - * parse tx receipt event OwnershipTransferred for contract SPGNFTBeacon - */ - public parseTxOwnershipTransferredEvent( - txReceipt: TransactionReceipt, - ): Array { - const targetLogs: Array = []; - for (const log of txReceipt.logs) { - try { - const event = decodeEventLog({ - abi: spgnftBeaconAbi, - eventName: "OwnershipTransferred", - data: log.data, - topics: log.topics, - }); - if (event.eventName === "OwnershipTransferred") { - targetLogs.push(event.args); - } - } catch (e) { - /* empty */ - } - } - return targetLogs; - } - - /** - * event Upgraded for contract SPGNFTBeacon - */ - public watchUpgradedEvent( - onLogs: (txHash: Hex, ev: Partial) => void, - ): WatchContractEventReturnType { - return this.rpcClient.watchContractEvent({ - abi: spgnftBeaconAbi, - address: this.address, - eventName: "Upgraded", - onLogs: (evs) => { - evs.forEach((it) => onLogs(it.transactionHash, it.args)); - }, - }); - } - - /** - * parse tx receipt event Upgraded for contract SPGNFTBeacon - */ - public parseTxUpgradedEvent(txReceipt: TransactionReceipt): Array { - const targetLogs: Array = []; - for (const log of txReceipt.logs) { - try { - const event = decodeEventLog({ - abi: spgnftBeaconAbi, - eventName: "Upgraded", - data: log.data, - topics: log.topics, - }); - if (event.eventName === "Upgraded") { - targetLogs.push(event.args); - } - } catch (e) { - /* empty */ - } - } - return targetLogs; - } -} - -/** - * contract SPGNFTBeacon readonly method - */ -export class SpgnftBeaconReadOnlyClient extends SpgnftBeaconEventClient { - constructor(rpcClient: PublicClient, address?: Address) { - super(rpcClient, address); - } - - /** - * method implementation for contract SPGNFTBeacon - * - * @param request SpgnftBeaconImplementationRequest - * @return Promise - */ - public async implementation(): Promise { - return await this.rpcClient.readContract({ - abi: spgnftBeaconAbi, - address: this.address, - functionName: "implementation", - }); - } - - /** - * method owner for contract SPGNFTBeacon - * - * @param request SpgnftBeaconOwnerRequest - * @return Promise - */ - public async owner(): Promise { - return await this.rpcClient.readContract({ - abi: spgnftBeaconAbi, - address: this.address, - functionName: "owner", - }); - } -} - -/** - * contract SPGNFTBeacon write method - */ -export class SpgnftBeaconClient extends SpgnftBeaconReadOnlyClient { - protected readonly wallet: SimpleWalletClient; - - constructor(rpcClient: PublicClient, wallet: SimpleWalletClient, address?: Address) { - super(rpcClient, address); - this.wallet = wallet; - } - - /** - * method renounceOwnership for contract SPGNFTBeacon - * - * @param request SpgnftBeaconRenounceOwnershipRequest - * @return Promise - */ - public async renounceOwnership(): Promise { - const { request: call } = await this.rpcClient.simulateContract({ - abi: spgnftBeaconAbi, - address: this.address, - functionName: "renounceOwnership", - account: this.wallet.account, - }); - return await this.wallet.writeContract(call as WriteContractParameters); - } - - /** - * method renounceOwnership for contract SPGNFTBeacon with only encode - * - * @param request SpgnftBeaconRenounceOwnershipRequest - * @return EncodedTxData - */ - public renounceOwnershipEncode(): EncodedTxData { - return { - to: this.address, - data: encodeFunctionData({ - abi: spgnftBeaconAbi, - functionName: "renounceOwnership", - }), - }; - } - - /** - * method transferOwnership for contract SPGNFTBeacon - * - * @param request SpgnftBeaconTransferOwnershipRequest - * @return Promise - */ - public async transferOwnership( - request: SpgnftBeaconTransferOwnershipRequest, - ): Promise { - const { request: call } = await this.rpcClient.simulateContract({ - abi: spgnftBeaconAbi, - address: this.address, - functionName: "transferOwnership", - account: this.wallet.account, - args: [request.newOwner], - }); - return await this.wallet.writeContract(call as WriteContractParameters); - } - - /** - * method transferOwnership for contract SPGNFTBeacon with only encode - * - * @param request SpgnftBeaconTransferOwnershipRequest - * @return EncodedTxData - */ - public transferOwnershipEncode(request: SpgnftBeaconTransferOwnershipRequest): EncodedTxData { - return { - to: this.address, - data: encodeFunctionData({ - abi: spgnftBeaconAbi, - functionName: "transferOwnership", - args: [request.newOwner], - }), - }; - } - - /** - * method upgradeTo for contract SPGNFTBeacon - * - * @param request SpgnftBeaconUpgradeToRequest - * @return Promise - */ - public async upgradeTo(request: SpgnftBeaconUpgradeToRequest): Promise { - const { request: call } = await this.rpcClient.simulateContract({ - abi: spgnftBeaconAbi, - address: this.address, - functionName: "upgradeTo", - account: this.wallet.account, - args: [request.newImplementation], - }); - return await this.wallet.writeContract(call as WriteContractParameters); - } - - /** - * method upgradeTo for contract SPGNFTBeacon with only encode - * - * @param request SpgnftBeaconUpgradeToRequest - * @return EncodedTxData - */ - public upgradeToEncode(request: SpgnftBeaconUpgradeToRequest): EncodedTxData { - return { - to: this.address, - data: encodeFunctionData({ - abi: spgnftBeaconAbi, - functionName: "upgradeTo", - args: [request.newImplementation], - }), - }; - } -} - // Contract SPGNFTImpl ============================================================= /** @@ -14125,9 +14673,9 @@ export type SpgnftImplIsApprovedForAllRequest = { export type SpgnftImplIsApprovedForAllResponse = boolean; -export type SpgnftImplMintCostResponse = bigint; +export type SpgnftImplMintFeeResponse = bigint; -export type SpgnftImplMintTokenResponse = Address; +export type SpgnftImplMintFeeTokenResponse = Address; export type SpgnftImplNameResponse = string; @@ -14196,16 +14744,16 @@ export type SpgnftImplGrantRoleRequest = { * @param name string * @param symbol string * @param maxSupply uint32 - * @param mintCost uint256 - * @param mintToken address + * @param mintFee uint256 + * @param mintFeeToken address * @param owner address */ export type SpgnftImplInitializeRequest = { name: string; symbol: string; maxSupply: number; - mintCost: bigint; - mintToken: Address; + mintFee: bigint; + mintFeeToken: Address; owner: Address; }; @@ -14291,20 +14839,20 @@ export type SpgnftImplSetApprovalForAllRequest = { }; /** - * SpgnftImplSetMintCostRequest + * SpgnftImplSetMintFeeRequest * - * @param cost uint256 + * @param fee uint256 */ -export type SpgnftImplSetMintCostRequest = { - cost: bigint; +export type SpgnftImplSetMintFeeRequest = { + fee: bigint; }; /** - * SpgnftImplSetMintTokenRequest + * SpgnftImplSetMintFeeTokenRequest * * @param token address */ -export type SpgnftImplSetMintTokenRequest = { +export type SpgnftImplSetMintFeeTokenRequest = { token: Address; }; @@ -14742,30 +15290,30 @@ export class SpgnftImplReadOnlyClient extends SpgnftImplEventClient { } /** - * method mintCost for contract SPGNFTImpl + * method mintFee for contract SPGNFTImpl * - * @param request SpgnftImplMintCostRequest - * @return Promise + * @param request SpgnftImplMintFeeRequest + * @return Promise */ - public async mintCost(): Promise { + public async mintFee(): Promise { return await this.rpcClient.readContract({ abi: spgnftImplAbi, address: this.address, - functionName: "mintCost", + functionName: "mintFee", }); } /** - * method mintToken for contract SPGNFTImpl + * method mintFeeToken for contract SPGNFTImpl * - * @param request SpgnftImplMintTokenRequest - * @return Promise + * @param request SpgnftImplMintFeeTokenRequest + * @return Promise */ - public async mintToken(): Promise { + public async mintFeeToken(): Promise { return await this.rpcClient.readContract({ abi: spgnftImplAbi, address: this.address, - functionName: "mintToken", + functionName: "mintFeeToken", }); } @@ -14954,8 +15502,8 @@ export class SpgnftImplClient extends SpgnftImplReadOnlyClient { request.name, request.symbol, request.maxSupply, - request.mintCost, - request.mintToken, + request.mintFee, + request.mintFeeToken, request.owner, ], }); @@ -14978,8 +15526,8 @@ export class SpgnftImplClient extends SpgnftImplReadOnlyClient { request.name, request.symbol, request.maxSupply, - request.mintCost, - request.mintToken, + request.mintFee, + request.mintFeeToken, request.owner, ], }), @@ -15233,54 +15781,52 @@ export class SpgnftImplClient extends SpgnftImplReadOnlyClient { } /** - * method setMintCost for contract SPGNFTImpl + * method setMintFee for contract SPGNFTImpl * - * @param request SpgnftImplSetMintCostRequest + * @param request SpgnftImplSetMintFeeRequest * @return Promise */ - public async setMintCost( - request: SpgnftImplSetMintCostRequest, - ): Promise { + public async setMintFee(request: SpgnftImplSetMintFeeRequest): Promise { const { request: call } = await this.rpcClient.simulateContract({ abi: spgnftImplAbi, address: this.address, - functionName: "setMintCost", + functionName: "setMintFee", account: this.wallet.account, - args: [request.cost], + args: [request.fee], }); return await this.wallet.writeContract(call as WriteContractParameters); } /** - * method setMintCost for contract SPGNFTImpl with only encode + * method setMintFee for contract SPGNFTImpl with only encode * - * @param request SpgnftImplSetMintCostRequest + * @param request SpgnftImplSetMintFeeRequest * @return EncodedTxData */ - public setMintCostEncode(request: SpgnftImplSetMintCostRequest): EncodedTxData { + public setMintFeeEncode(request: SpgnftImplSetMintFeeRequest): EncodedTxData { return { to: this.address, data: encodeFunctionData({ abi: spgnftImplAbi, - functionName: "setMintCost", - args: [request.cost], + functionName: "setMintFee", + args: [request.fee], }), }; } /** - * method setMintToken for contract SPGNFTImpl + * method setMintFeeToken for contract SPGNFTImpl * - * @param request SpgnftImplSetMintTokenRequest + * @param request SpgnftImplSetMintFeeTokenRequest * @return Promise */ - public async setMintToken( - request: SpgnftImplSetMintTokenRequest, + public async setMintFeeToken( + request: SpgnftImplSetMintFeeTokenRequest, ): Promise { const { request: call } = await this.rpcClient.simulateContract({ abi: spgnftImplAbi, address: this.address, - functionName: "setMintToken", + functionName: "setMintFeeToken", account: this.wallet.account, args: [request.token], }); @@ -15288,17 +15834,17 @@ export class SpgnftImplClient extends SpgnftImplReadOnlyClient { } /** - * method setMintToken for contract SPGNFTImpl with only encode + * method setMintFeeToken for contract SPGNFTImpl with only encode * - * @param request SpgnftImplSetMintTokenRequest + * @param request SpgnftImplSetMintFeeTokenRequest * @return EncodedTxData */ - public setMintTokenEncode(request: SpgnftImplSetMintTokenRequest): EncodedTxData { + public setMintFeeTokenEncode(request: SpgnftImplSetMintFeeTokenRequest): EncodedTxData { return { to: this.address, data: encodeFunctionData({ abi: spgnftImplAbi, - functionName: "setMintToken", + functionName: "setMintFeeToken", args: [request.token], }), }; diff --git a/packages/core-sdk/src/client.ts b/packages/core-sdk/src/client.ts index 0616c241..6cd6daad 100644 --- a/packages/core-sdk/src/client.ts +++ b/packages/core-sdk/src/client.ts @@ -41,7 +41,7 @@ export class StoryClient { private constructor(config: StoryConfig) { this.config = { ...config, - chainId: config.chainId || "sepolia", + chainId: config.chainId || "iliad", }; if (!this.config.transport) { throw new Error( diff --git a/packages/core-sdk/src/index.ts b/packages/core-sdk/src/index.ts index c6c8e845..0f48dbfc 100644 --- a/packages/core-sdk/src/index.ts +++ b/packages/core-sdk/src/index.ts @@ -75,6 +75,7 @@ export type { IPAccountExecuteResponse, IPAccountExecuteWithSigRequest, IPAccountExecuteWithSigResponse, + IpAccountStateResponse, } from "./types/resources/ipAccount"; export type { diff --git a/packages/core-sdk/src/resources/ipAccount.ts b/packages/core-sdk/src/resources/ipAccount.ts index ff82d115..2d6344bb 100644 --- a/packages/core-sdk/src/resources/ipAccount.ts +++ b/packages/core-sdk/src/resources/ipAccount.ts @@ -5,13 +5,10 @@ import { IPAccountExecuteResponse, IPAccountExecuteWithSigRequest, IPAccountExecuteWithSigResponse, + IpAccountStateResponse, } from "../types/resources/ipAccount"; import { handleError } from "../utils/errors"; -import { - IpAccountImplClient, - IpAccountImplStateResponse, - SimpleWalletClient, -} from "../abi/generated"; +import { IpAccountImplClient, SimpleWalletClient } from "../abi/generated"; import { getAddress } from "../utils/utils"; export class IPAccountClient { @@ -47,9 +44,9 @@ export class IPAccountClient { }; if (request.txOptions?.encodedTxDataOnly) { - return { encodedTxData: ipAccountClient.executeEncode(req) }; + return { encodedTxData: ipAccountClient.executeEncode({ ...req, operation: 0 }) }; } else { - const txHash = await ipAccountClient.execute(req); + const txHash = await ipAccountClient.execute({ ...req, operation: 0 }); if (request.txOptions?.waitForTransaction) { await this.rpcClient.waitForTransactionReceipt({ hash: txHash }); @@ -110,12 +107,13 @@ export class IPAccountClient { * @param ipId The IP ID * @returns The nonce for transaction ordering. */ - public async getIpAccountNonce(ipId: string): Promise { + public async getIpAccountNonce(ipId: string): Promise { const ipAccount = new IpAccountImplClient( this.rpcClient, this.wallet, getAddress(ipId, "ipId"), ); - return await ipAccount.state(); + const { result: state } = await ipAccount.state(); + return state; } } diff --git a/packages/core-sdk/src/resources/ipAsset.ts b/packages/core-sdk/src/resources/ipAsset.ts index e353e646..1a864a6d 100644 --- a/packages/core-sdk/src/resources/ipAsset.ts +++ b/packages/core-sdk/src/resources/ipAsset.ts @@ -1,4 +1,16 @@ -import { Hex, PublicClient, zeroAddress, Address, zeroHash, WalletClient } from "viem"; +import { + Hex, + PublicClient, + zeroAddress, + Address, + zeroHash, + WalletClient, + toHex, + encodeAbiParameters, + encodeFunctionData, + keccak256, + toFunctionSelector, +} from "viem"; import { chain, getAddress } from "../utils/utils"; import { SupportedChainIds } from "../types/config"; @@ -32,10 +44,12 @@ import { SpgRegisterIpAndAttachPilTermsRequest, SpgRegisterIpAndMakeDerivativeRequest, SpgRegisterIpRequest, + accessControllerAbi, + ipAccountImplAbi, } from "../abi/generated"; import { getLicenseTermByType } from "../utils/getLicenseTermsByType"; import { getDeadline, getPermissionSignature } from "../utils/sign"; -import { AccessPermission } from "../types/resources/permission"; +import { AccessPermission, SetPermissionsRequest } from "../types/resources/permission"; export class IPAssetClient { public licensingModuleClient: LicensingModuleClient; @@ -71,10 +85,10 @@ export class IPAssetClient { * @param request - The request object that contains all data needed to register IP. * @param request.nftContract The address of the NFT. * @param request.tokenId The token identifier of the NFT. - * @param request.metadata - [Optional] The metadata for the IP. - * @param request.metadata.metadataURI [Optional] The URI of the metadata for the IP. - * @param request.metadata.metadataHash [Optional] The metadata for the IP. - * @param request.metadata.nftMetadataHash [Optional] The metadata for the IP NFT. + * @param request.ipMetadata - [Optional] The ipMetadata for the IP. + * @param request.ipMetadata.metadataURI [Optional] The URI of the ipMetadata for the IP. + * @param request.ipMetadata.metadataHash [Optional] The ipMetadata for the IP. + * @param request.ipMetadata.nftMetadataHash [Optional] The ipMetadata for the IP NFT. * @param request.deadline [Optional] The deadline for the signature in milliseconds, default is 1000ms. * @param request.txOptions [Optional] The transaction options. * @returns A Promise that resolves to an object containing the transaction hash and optional IP ID if waitForTxn is set to true. @@ -91,7 +105,7 @@ export class IPAssetClient { const object: SpgRegisterIpRequest = { tokenId, nftContract: getAddress(request.nftContract, "request.nftContract"), - metadata: { + ipMetadata: { metadataURI: "", metadataHash: zeroHash, nftMetadataHash: zeroHash, @@ -103,41 +117,19 @@ export class IPAssetClient { }, }; if ( - request.metadata && - (request.metadata.metadataHash !== zeroHash || - request.metadata.metadataURI !== "" || - request.metadata.nftMetadataHash !== zeroHash) + request.ipMetadata && + (request.ipMetadata.metadataHash !== zeroHash || + request.ipMetadata.metadataURI !== "" || + request.ipMetadata.nftMetadataHash !== zeroHash) ) { - object.metadata = { - metadataURI: request.metadata.metadataURI || object.metadata.metadataURI, - metadataHash: request.metadata.metadataHash || object.metadata.metadataHash, - nftMetadataHash: request.metadata.nftMetadataHash || object.metadata.nftMetadataHash, + object.ipMetadata = { + metadataURI: request.ipMetadata.metadataURI || object.ipMetadata.metadataURI, + metadataHash: request.ipMetadata.metadataHash || object.ipMetadata.metadataHash, + nftMetadataHash: request.ipMetadata.nftMetadataHash || object.ipMetadata.nftMetadataHash, }; } - const calculatedDeadline = getDeadline(request.deadline); - const signature = await getPermissionSignature({ - ipId: ipIdAddress, - deadline: calculatedDeadline, - nonce: 1, - wallet: this.wallet as WalletClient, - chainId: chain[this.chainId], - permissions: [ - { - ipId: ipIdAddress, - signer: getAddress(this.spgClient.address, "spgAddress"), - to: getAddress(this.coreMetadataModuleClient.address, "coreMetadataModuleAddress"), - permission: AccessPermission.ALLOW, - func: "function setAll(address,string,bytes32,bytes32)", - }, - ], - }); - object.sigMetadata = { - signer: getAddress(this.wallet.account!.address, "wallet.account.address"), - deadline: calculatedDeadline, - signature, - }; if (request.txOptions?.encodedTxDataOnly) { - if (request.metadata) { + if (request.ipMetadata) { return { encodedTxData: this.spgClient.registerIpEncode(object) }; } else { return { @@ -150,7 +142,29 @@ export class IPAssetClient { } } else { let txHash: Hex; - if (request.metadata) { + if (request.ipMetadata) { + const calculatedDeadline = getDeadline(request.deadline); + const signature = await getPermissionSignature({ + ipId: ipIdAddress, + deadline: calculatedDeadline, + state: toHex(0, { size: 32 }), + wallet: this.wallet as WalletClient, + chainId: chain[this.chainId], + permissions: [ + { + ipId: ipIdAddress, + signer: getAddress(this.spgClient.address, "spgAddress"), + to: getAddress(this.coreMetadataModuleClient.address, "coreMetadataModuleAddress"), + permission: AccessPermission.ALLOW, + func: "function setAll(address,string,bytes32,bytes32)", + }, + ], + }); + object.sigMetadata = { + signer: getAddress(this.wallet.account!.address, "wallet.account.address"), + deadline: calculatedDeadline, + signature, + }; txHash = await this.spgClient.registerIp(object); } else { txHash = await this.ipAssetRegistryClient.register({ @@ -300,10 +314,11 @@ export class IPAssetClient { * @param request - The request object that contains all data needed to mint and register ip. * @param request.nftContract The address of the NFT collection. * @param request.pilType The type of the PIL. - * @param request.metadata - [Optional] The metadata for the IP. - * @param request.metadata.metadataURI [Optional] The URI of the metadata for the IP. - * @param request.metadata.metadataHash [Optional] The metadata for the IP. - * @param request.metadata.nftMetadataHash [Optional] The metadata for the IP NFT. + * @param request.ipMetadata - [Optional] The ipMetadata for the IP. + * @param request.ipMetadata.metadataURI [Optional] The URI of the ipMetadata for the IP. + * @param request.ipMetadata.metadataHash [Optional] The ipMetadata for the IP. + * @param request.ipMetadata.nftMetadataHash [Optional] The ipMetadata for the IP NFT. + * @param request.nftMetadata [Optional] The desired metadata for the newly minted NFT. * @param request.recipient [Optional] The address of the recipient of the minted NFT. * @param request.mintingFee [Optional] The fee to be paid when minting a license. * @param request.commercialRevShare [Optional] Percentage of revenue that must be shared with the licensor. @@ -321,7 +336,7 @@ export class IPAssetClient { throw new Error("PIL type is required."); } const licenseTerm = getLicenseTermByType(request.pilType, { - mintingFee: request.mintingFee, + defaultMintingFee: request.mintingFee, currency: request.currency, royaltyPolicyLAPAddress: this.royaltyPolicyLAPClient.address, commercialRevShare: request.commercialRevShare, @@ -332,23 +347,29 @@ export class IPAssetClient { (request.recipient && getAddress(request.recipient, "request.recipient")) || this.wallet.account!.address, - terms: licenseTerm, - metadata: { + terms: { + ...licenseTerm, + mintingFee: BigInt(licenseTerm.defaultMintingFee), + derivativeRevCelling: licenseTerm.commercialRevCeiling, + commercialRevCelling: licenseTerm.commercialRevCeiling, + }, + ipMetadata: { metadataURI: "", metadataHash: zeroHash, nftMetadataHash: zeroHash, }, + nftMetadata: request.nftMetadata || "", }; if ( - request.metadata && - (request.metadata.metadataHash !== zeroHash || - request.metadata.metadataURI !== "" || - request.metadata.nftMetadataHash !== zeroHash) + request.ipMetadata && + (request.ipMetadata.metadataHash !== zeroHash || + request.ipMetadata.metadataURI !== "" || + request.ipMetadata.nftMetadataHash !== zeroHash) ) { - object.metadata = { - metadataURI: request.metadata.metadataURI || object.metadata.metadataURI, - metadataHash: request.metadata.metadataHash || object.metadata.metadataHash, - nftMetadataHash: request.metadata.nftMetadataHash || object.metadata.nftMetadataHash, + object.ipMetadata = { + metadataURI: request.ipMetadata.metadataURI || object.ipMetadata.metadataURI, + metadataHash: request.ipMetadata.metadataHash || object.ipMetadata.metadataHash, + nftMetadataHash: request.ipMetadata.nftMetadataHash || object.ipMetadata.nftMetadataHash, }; } if (request.txOptions?.encodedTxDataOnly) { @@ -380,10 +401,10 @@ export class IPAssetClient { * @param request.nftContract The address of the NFT collection. * @param request.tokenId The ID of the NFT. * @param request.pilType The type of the PIL. - * @param request.metadata - [Optional] The desired metadata for the newly registered IP. - * @param request.metadata.metadataURI [Optional] The the metadata for the IP hash. - * @param request.metadata.metadataHash [Optional] The metadata for the IP. - * @param request.metadata.nftMetadataHash [Optional] The metadata for the IP NFT. + * @param request.ipMetadata - [Optional] The desired ipMetadata for the newly registered IP. + * @param request.ipMetadata.metadataURI [Optional] The the ipMetadata for the IP hash. + * @param request.ipMetadata.metadataHash [Optional] The ipMetadata for the IP. + * @param request.ipMetadata.nftMetadataHash [Optional] The ipMetadata for the IP NFT. * @param request.deadline [Optional] The deadline for the signature in milliseconds, default is 1000ms. * @param request.mintingFee [Optional] The fee to be paid when minting a license. * @param request.commercialRevShare [Optional] Percentage of revenue that must be shared with the licensor. @@ -406,16 +427,23 @@ export class IPAssetClient { throw new Error(`The NFT with id ${request.tokenId} is already registered as IP.`); } const licenseTerm = getLicenseTermByType(request.pilType, { - mintingFee: request.mintingFee, + defaultMintingFee: request.mintingFee, currency: request.currency, royaltyPolicyLAPAddress: this.royaltyPolicyLAPClient.address, commercialRevShare: request.commercialRevShare, }); const calculatedDeadline = getDeadline(request.deadline); + const sigAttachSignature = await getPermissionSignature({ ipId: ipIdAddress, deadline: calculatedDeadline, - nonce: 2, + state: this.getSigSignatureState({ + ipId: ipIdAddress, + signer: getAddress(this.spgClient.address, "spgAddress"), + to: getAddress(this.coreMetadataModuleClient.address, "coreMetadataModuleAddress"), + permission: AccessPermission.ALLOW, + func: "function setAll(address,string,bytes32,bytes32)", + }), wallet: this.wallet as WalletClient, chainId: chain[this.chainId], permissions: [ @@ -431,8 +459,13 @@ export class IPAssetClient { const object: SpgRegisterIpAndAttachPilTermsRequest = { nftContract: getAddress(request.nftContract, "request.nftContract"), tokenId: request.tokenId, - terms: licenseTerm, - metadata: { + terms: { + ...licenseTerm, + mintingFee: BigInt(licenseTerm.defaultMintingFee), + derivativeRevCelling: licenseTerm.commercialRevCeiling, + commercialRevCelling: licenseTerm.commercialRevCeiling, + }, + ipMetadata: { metadataURI: "", metadataHash: zeroHash, nftMetadataHash: zeroHash, @@ -450,21 +483,21 @@ export class IPAssetClient { }; if ( - request.metadata && - (request.metadata.metadataHash !== zeroHash || - request.metadata.metadataURI !== "" || - request.metadata.nftMetadataHash !== zeroHash) + request.ipMetadata && + (request.ipMetadata.metadataHash !== zeroHash || + request.ipMetadata.metadataURI !== "" || + request.ipMetadata.nftMetadataHash !== zeroHash) ) { - object.metadata = { - metadataURI: request.metadata.metadataURI || object.metadata.metadataURI, - metadataHash: request.metadata.metadataHash || object.metadata.metadataHash, - nftMetadataHash: request.metadata.nftMetadataHash || object.metadata.nftMetadataHash, + object.ipMetadata = { + metadataURI: request.ipMetadata.metadataURI || object.ipMetadata.metadataURI, + metadataHash: request.ipMetadata.metadataHash || object.ipMetadata.metadataHash, + nftMetadataHash: request.ipMetadata.nftMetadataHash || object.ipMetadata.nftMetadataHash, }; } - const signature = await getPermissionSignature({ + const sigMetadataSignature = await getPermissionSignature({ ipId: ipIdAddress, deadline: calculatedDeadline, - nonce: 1, + state: toHex(0, { size: 32 }), wallet: this.wallet as WalletClient, chainId: chain[this.chainId], permissions: [ @@ -480,7 +513,7 @@ export class IPAssetClient { object.sigMetadata = { signer: getAddress(this.wallet.account!.address, "wallet.account.address"), deadline: calculatedDeadline, - signature, + signature: sigMetadataSignature, }; if (request.txOptions?.encodedTxDataOnly) { return { encodedTxData: this.spgClient.registerIpAndAttachPilTermsEncode(object) }; @@ -506,10 +539,10 @@ export class IPAssetClient { * @param request.derivData.parentIpIds The IDs of the parent IPs to link the registered derivative IP. * @param request.derivData.licenseTemplate [Optional] The address of the license template to be used for the linking. * @param request.derivData.licenseTermsIds The IDs of the license terms to be used for the linking. - * @param request.metadata - [Optional] The desired metadata for the newly registered IP. - * @param request.metadata.metadataURI [Optional] The URI of the metadata for the IP. - * @param request.metadata.metadataHash [Optional] The metadata for the IP. - * @param request.metadata.nftMetadataHash [Optional] The the metadata for the IP NFT. + * @param request.ipMetadata - [Optional] The desired ipMetadata for the newly registered IP. + * @param request.ipMetadata.metadataURI [Optional] The URI of the ipMetadata for the IP. + * @param request.ipMetadata.metadataHash [Optional] The ipMetadata for the IP. + * @param request.ipMetadata.nftMetadataHash [Optional] The the ipMetadata for the IP NFT. * @param request.deadline [Optional] The deadline for the signature in milliseconds,default is 1000ms. * @param request.txOptions [Optional] The transaction options. * @returns A Promise that resolves to an object containing the transaction hash and optional IP ID if waitForTxn is set to true. @@ -552,7 +585,13 @@ export class IPAssetClient { const sigRegisterSignature = await getPermissionSignature({ ipId: ipIdAddress, deadline: calculatedDeadline, - nonce: 2, + state: this.getSigSignatureState({ + ipId: ipIdAddress, + signer: getAddress(this.spgClient.address, "spgAddress"), + to: getAddress(this.coreMetadataModuleClient.address, "coreMetadataModuleAddress"), + permission: AccessPermission.ALLOW, + func: "function setAll(address,string,bytes32,bytes32)", + }), wallet: this.wallet as WalletClient, chainId: chain[this.chainId], permissions: [ @@ -584,7 +623,7 @@ export class IPAssetClient { deadline: calculatedDeadline, signature: sigRegisterSignature, }, - metadata: { + ipMetadata: { metadataURI: "", metadataHash: zeroHash, nftMetadataHash: zeroHash, @@ -596,21 +635,21 @@ export class IPAssetClient { }, }; if ( - request.metadata && - (request.metadata.metadataHash !== zeroHash || - request.metadata.metadataURI !== "" || - request.metadata.nftMetadataHash !== zeroHash) + request.ipMetadata && + (request.ipMetadata.metadataHash !== zeroHash || + request.ipMetadata.metadataURI !== "" || + request.ipMetadata.nftMetadataHash !== zeroHash) ) { - object.metadata = { - metadataURI: request.metadata.metadataURI || object.metadata.metadataURI, - metadataHash: request.metadata.metadataHash || object.metadata.metadataHash, - nftMetadataHash: request.metadata.nftMetadataHash || object.metadata.nftMetadataHash, + object.ipMetadata = { + metadataURI: request.ipMetadata.metadataURI || object.ipMetadata.metadataURI, + metadataHash: request.ipMetadata.metadataHash || object.ipMetadata.metadataHash, + nftMetadataHash: request.ipMetadata.nftMetadataHash || object.ipMetadata.nftMetadataHash, }; } - const signature = await getPermissionSignature({ + const sigMetadataSignature = await getPermissionSignature({ ipId: ipIdAddress, deadline: calculatedDeadline, - nonce: 1, + state: toHex(0, { size: 32 }), wallet: this.wallet as WalletClient, chainId: chain[this.chainId], permissions: [ @@ -626,7 +665,7 @@ export class IPAssetClient { object.sigMetadata = { signer: getAddress(this.wallet.account!.address, "wallet.account.address"), deadline: calculatedDeadline, - signature, + signature: sigMetadataSignature, }; if (request.txOptions?.encodedTxDataOnly) { return { encodedTxData: this.spgClient.registerIpAndMakeDerivativeEncode(object) }; @@ -659,4 +698,35 @@ export class IPAssetClient { private async isRegistered(ipId: Hex): Promise { return await this.ipAssetRegistryClient.isRegistered({ id: getAddress(ipId, "ipId") }); } + + private getSigSignatureState(permission: Omit) { + const data = encodeFunctionData({ + abi: accessControllerAbi, + functionName: "setPermission", + args: [ + getAddress(permission.ipId, "permission.ipId"), + getAddress(permission.signer, "permission.signer"), + getAddress(permission.to, "permission.to"), + toFunctionSelector(permission.func!), + permission.permission, + ], + }); + const sigAttachState = keccak256( + encodeAbiParameters( + [ + { name: "", type: "bytes32" }, + { name: "", type: "bytes" }, + ], + [ + toHex(0, { size: 32 }), + encodeFunctionData({ + abi: ipAccountImplAbi, + functionName: "execute", + args: [this.accessControllerClient.address, 0n, data], + }), + ], + ), + ); + return sigAttachState; + } } diff --git a/packages/core-sdk/src/resources/license.ts b/packages/core-sdk/src/resources/license.ts index 45b70cea..0e42ae97 100644 --- a/packages/core-sdk/src/resources/license.ts +++ b/packages/core-sdk/src/resources/license.ts @@ -51,6 +51,7 @@ export class LicenseClient { this.rpcClient = rpcClient; this.wallet = wallet; } + /** * Convenient function to register a PIL non commercial social remix license to the registry * @param request - [Optional] The request object that contains all data needed to register a PIL non commercial social remix license. @@ -104,7 +105,7 @@ export class LicenseClient { ): Promise { try { const licenseTerms = getLicenseTermByType(PIL_TYPE.COMMERCIAL_USE, { - mintingFee: request.mintingFee, + defaultMintingFee: request.mintingFee, currency: request.currency, royaltyPolicyLAPAddress: this.royaltyPolicyLAPClient.address, }); @@ -150,7 +151,7 @@ export class LicenseClient { ): Promise { try { const licenseTerms = getLicenseTermByType(PIL_TYPE.COMMERCIAL_REMIX, { - mintingFee: request.mintingFee, + defaultMintingFee: request.mintingFee, currency: request.currency, royaltyPolicyLAPAddress: this.royaltyPolicyLAPClient.address, commercialRevShare: request.commercialRevShare, diff --git a/packages/core-sdk/src/resources/nftClient.ts b/packages/core-sdk/src/resources/nftClient.ts index df006885..d7d468f3 100644 --- a/packages/core-sdk/src/resources/nftClient.ts +++ b/packages/core-sdk/src/resources/nftClient.ts @@ -58,7 +58,6 @@ export class NftClient { return { encodedTxData: this.spgClient.createCollectionEncode(req) }; } else { const txHash = await this.spgClient.createCollection(req); - if (request.txOptions?.waitForTransaction) { const txReceipt = await this.rpcClient.waitForTransactionReceipt({ hash: txHash }); const targetLogs = this.spgClient.parseTxCollectionCreatedEvent(txReceipt); diff --git a/packages/core-sdk/src/resources/permission.ts b/packages/core-sdk/src/resources/permission.ts index 4fe60d1c..16f75ec1 100644 --- a/packages/core-sdk/src/resources/permission.ts +++ b/packages/core-sdk/src/resources/permission.ts @@ -109,7 +109,6 @@ export class PermissionClient { const { ipId, signer, to, txOptions, func, permission, deadline } = request; await this.checkIsRegistered(ipId); const ipAccountClient = new IpAccountImplClient(this.rpcClient, this.wallet, ipId); - const nonce = (await ipAccountClient.state()) + 1n; const data = encodeFunctionData({ abi: accessControllerAbi, functionName: "setPermission", @@ -121,11 +120,13 @@ export class PermissionClient { permission, ], }); + const { result: state } = await ipAccountClient.state(); const calculatedDeadline = getDeadline(deadline); + const signature = await getPermissionSignature({ ipId, deadline: calculatedDeadline, - nonce, + state, permissions: [ { ipId, @@ -266,7 +267,6 @@ export class PermissionClient { await this.checkIsRegistered(permission.ipId); } const ipAccountClient = new IpAccountImplClient(this.rpcClient, this.wallet, ipId); - const nonce = (await ipAccountClient.state()) + 1n; const data = encodeFunctionData({ abi: accessControllerAbi, functionName: "setBatchPermissions", @@ -280,11 +280,12 @@ export class PermissionClient { })), ], }); + const { result: state } = await ipAccountClient.state(); const calculatedDeadline = getDeadline(deadline); const signature = await getPermissionSignature({ ipId, deadline: calculatedDeadline, - nonce, + state, permissions, chainId: chain[this.chainId], wallet: this.wallet as WalletClient, diff --git a/packages/core-sdk/src/types/common.ts b/packages/core-sdk/src/types/common.ts index 6ba78e4f..5014ad6f 100644 --- a/packages/core-sdk/src/types/common.ts +++ b/packages/core-sdk/src/types/common.ts @@ -9,7 +9,7 @@ export type TypedData = { export type PermissionSignatureRequest = { ipId: Address; - nonce: string | number | bigint; + state: Hex; deadline: string | number | bigint; wallet: WalletClient; chainId: string | number | bigint; diff --git a/packages/core-sdk/src/types/config.ts b/packages/core-sdk/src/types/config.ts index 226ee57a..a6b020f4 100644 --- a/packages/core-sdk/src/types/config.ts +++ b/packages/core-sdk/src/types/config.ts @@ -7,7 +7,7 @@ import { SimpleWalletClient } from "../abi/generated"; * * @public */ -export type SupportedChainIds = "11155111" | "sepolia"; +export type SupportedChainIds = "1513" | "iliad"; /** * Configuration for the SDK Client. @@ -27,8 +27,8 @@ export type UseWalletStoryConfig = { }; export type StoryConfig = { - readonly chainId?: SupportedChainIds; readonly transport: Transport; + readonly chainId?: SupportedChainIds; readonly wallet?: SimpleWalletClient; readonly account?: Account | Address; }; diff --git a/packages/core-sdk/src/types/resources/ipAccount.ts b/packages/core-sdk/src/types/resources/ipAccount.ts index f91f9367..54c6c718 100644 --- a/packages/core-sdk/src/types/resources/ipAccount.ts +++ b/packages/core-sdk/src/types/resources/ipAccount.ts @@ -1,4 +1,4 @@ -import { Address } from "viem"; +import { Address, Hex } from "viem"; import { TxOptions } from "../options"; import { EncodedTxData } from "../../abi/generated"; @@ -31,3 +31,5 @@ export type IPAccountExecuteWithSigResponse = { txHash?: string; encodedTxData?: EncodedTxData; }; + +export type IpAccountStateResponse = Hex; diff --git a/packages/core-sdk/src/types/resources/ipAsset.ts b/packages/core-sdk/src/types/resources/ipAsset.ts index 8ebdb40d..71d2305b 100644 --- a/packages/core-sdk/src/types/resources/ipAsset.ts +++ b/packages/core-sdk/src/types/resources/ipAsset.ts @@ -5,7 +5,7 @@ import { PIL_TYPE } from "./license"; import { EncodedTxData } from "../../abi/generated"; type Metadata = { - metadata?: { + ipMetadata?: { metadataURI?: string; metadataHash?: Hex; nftMetadataHash?: Hex; @@ -53,11 +53,12 @@ export type RegisterDerivativeResponse = { export type CreateIpAssetWithPilTermsRequest = { nftContract: Address; pilType: PIL_TYPE; - recipient?: Address; - mintingFee?: string; currency?: Address; + mintingFee?: string | number | bigint; + recipient?: Address; commercialRevShare?: number; txOptions?: TxOptions; + nftMetadata?: string; } & Metadata; export type CreateIpAssetWithPilTermsResponse = { @@ -90,9 +91,9 @@ export type RegisterIpAndAttachPilTermsRequest = { nftContract: Address; tokenId: bigint | string | number; pilType: PIL_TYPE; + mintingFee: string | number | bigint; + currency: Address; deadline?: bigint | number | string; - mintingFee?: string; - currency?: Address; commercialRevShare?: number; txOptions?: TxOptions; } & Metadata; diff --git a/packages/core-sdk/src/types/resources/license.ts b/packages/core-sdk/src/types/resources/license.ts index abeafd32..a128ac06 100644 --- a/packages/core-sdk/src/types/resources/license.ts +++ b/packages/core-sdk/src/types/resources/license.ts @@ -18,10 +18,10 @@ export type RegisterNonComSocialRemixingPILRequest = { }; export type LicenseTerms = { - mintingFee: bigint; + defaultMintingFee: bigint; expiration: bigint; - commercialRevCelling: bigint; - derivativeRevCelling: bigint; + commercialRevCeiling: bigint; + derivativeRevCeiling: bigint; commercializerCheckerData: Address; transferable: boolean; royaltyPolicy: Address; diff --git a/packages/core-sdk/src/utils/getLicenseTermsByType.ts b/packages/core-sdk/src/utils/getLicenseTermsByType.ts index 40e071bf..eaeabf8d 100644 --- a/packages/core-sdk/src/utils/getLicenseTermsByType.ts +++ b/packages/core-sdk/src/utils/getLicenseTermsByType.ts @@ -5,7 +5,7 @@ import { PIL_TYPE, LicenseTerms } from "../types/resources/license"; export function getLicenseTermByType( type: PIL_TYPE, term?: { - mintingFee?: string | number | bigint; + defaultMintingFee?: string | number | bigint; currency?: Hex; royaltyPolicyLAPAddress: Hex; commercialRevShare?: number; @@ -14,30 +14,30 @@ export function getLicenseTermByType( const licenseTerms: LicenseTerms = { transferable: true, royaltyPolicy: zeroAddress, - mintingFee: BigInt(0), + defaultMintingFee: BigInt(0), expiration: BigInt(0), commercialUse: false, commercialAttribution: false, commercializerChecker: zeroAddress, commercializerCheckerData: zeroAddress, commercialRevShare: 0, - commercialRevCelling: BigInt(0), + commercialRevCeiling: BigInt(0), derivativesAllowed: true, derivativesAttribution: true, derivativesApproval: false, derivativesReciprocal: true, - derivativeRevCelling: BigInt(0), + derivativeRevCeiling: BigInt(0), currency: zeroAddress, uri: "", }; if (type === PIL_TYPE.NON_COMMERCIAL_REMIX) { return licenseTerms; } else if (type === PIL_TYPE.COMMERCIAL_USE) { - if (!term || term.mintingFee === undefined || term.currency === undefined) { + if (!term || term.defaultMintingFee === undefined || term.currency === undefined) { throw new Error("mintingFee currency are required for commercial use PIL."); } licenseTerms.royaltyPolicy = getAddress(term.royaltyPolicyLAPAddress); - licenseTerms.mintingFee = BigInt(term.mintingFee); + licenseTerms.defaultMintingFee = BigInt(term.defaultMintingFee); licenseTerms.commercialUse = true; licenseTerms.commercialAttribution = true; licenseTerms.derivativesReciprocal = false; @@ -46,7 +46,7 @@ export function getLicenseTermByType( } else { if ( !term || - term.mintingFee === undefined || + term.defaultMintingFee === undefined || term.currency === undefined || term.commercialRevShare === undefined ) { @@ -58,7 +58,7 @@ export function getLicenseTermByType( throw new Error("commercialRevShare should be between 0 and 100."); } licenseTerms.royaltyPolicy = getAddress(term.royaltyPolicyLAPAddress); - licenseTerms.mintingFee = BigInt(term.mintingFee); + licenseTerms.defaultMintingFee = BigInt(term.defaultMintingFee); licenseTerms.commercialUse = true; licenseTerms.commercialAttribution = true; diff --git a/packages/core-sdk/src/utils/sign.ts b/packages/core-sdk/src/utils/sign.ts index 6eb98106..6eae23c8 100644 --- a/packages/core-sdk/src/utils/sign.ts +++ b/packages/core-sdk/src/utils/sign.ts @@ -1,6 +1,6 @@ -import { encodeFunctionData, toFunctionSelector } from "viem"; +import { encodeAbiParameters, encodeFunctionData, keccak256, toFunctionSelector } from "viem"; -import { accessControllerAbi, accessControllerAddress } from "../abi/generated"; +import { accessControllerAbi, accessControllerAddress, ipAccountImplAbi } from "../abi/generated"; import { getAddress } from "./utils"; import { defaultFunctionSelector } from "../constants/common"; import { PermissionSignatureRequest, PermissionSignatureResponse } from "../types/common"; @@ -20,7 +20,7 @@ import { PermissionSignatureRequest, PermissionSignatureResponse } from "../type export const getPermissionSignature = async ( param: PermissionSignatureRequest, ): Promise => { - const { ipId, deadline, nonce, wallet, chainId, permissions, permissionFunc } = param; + const { ipId, deadline, state, wallet, chainId, permissions, permissionFunc } = param; if (!wallet.signTypedData) { throw new Error("The wallet client does not support signTypedData, please try again."); } @@ -28,6 +28,8 @@ export const getPermissionSignature = async ( throw new Error("The wallet client does not have an account, please try again."); } const permissionFunction = permissionFunc ? permissionFunc : "setPermission"; + const accessAddress = + accessControllerAddress[Number(chainId) as keyof typeof accessControllerAddress]; const data = encodeFunctionData({ abi: accessControllerAbi, functionName: permissionFunc ? permissionFunc : "setPermission", @@ -50,6 +52,22 @@ export const getPermissionSignature = async ( })), ], }); + const nonce = keccak256( + encodeAbiParameters( + [ + { name: "", type: "bytes32" }, + { name: "", type: "bytes" }, + ], + [ + state, + encodeFunctionData({ + abi: ipAccountImplAbi, + functionName: "execute", + args: [accessAddress, 0n, data], + }), + ], + ), + ); return await wallet.signTypedData({ account: wallet.account, domain: { @@ -63,7 +81,7 @@ export const getPermissionSignature = async ( { name: "to", type: "address" }, { name: "value", type: "uint256" }, { name: "data", type: "bytes" }, - { name: "nonce", type: "uint256" }, + { name: "nonce", type: "bytes32" }, { name: "deadline", type: "uint256" }, ], }, @@ -75,7 +93,7 @@ export const getPermissionSignature = async ( ), value: BigInt(0), data, - nonce: BigInt(nonce), + nonce, deadline: BigInt(deadline), }, }); diff --git a/packages/core-sdk/src/utils/utils.ts b/packages/core-sdk/src/utils/utils.ts index 20885244..8491cb8a 100644 --- a/packages/core-sdk/src/utils/utils.ts +++ b/packages/core-sdk/src/utils/utils.ts @@ -10,8 +10,8 @@ import { isAddress, checksumAddress, Address, + defineChain, } from "viem"; -import { sepolia } from "viem/chains"; import { SupportedChainIds } from "../types/config"; @@ -76,20 +76,44 @@ export async function waitTx( ...params, }); } - +//TODO: Some information is waiting for confirmation about chain +export const storyTestChain = defineChain({ + id: 15_13, + name: "story-testnet", + nativeCurrency: { name: "IP", symbol: "IP", decimals: 18 }, + rpcUrls: { + default: { + http: ["https://rpc.partner.testnet.storyprotocol.net"], + webSocket: ["wss://story-network.rpc.caldera.xyz/ws"], + }, + }, + blockExplorers: { + default: { + name: "Explorer", + url: "https://explorer.testnet.storyprotocol.net", + }, + }, + contracts: { + multicall3: { + address: "0xcA11bde05977b3631167028862bE2a173976CA11", + blockCreated: 5882, + }, + }, + testnet: true, +}); export function chainStringToViemChain(chainId: SupportedChainIds): Chain { switch (chainId) { - case "11155111": - case "sepolia": - return sepolia; + case "1513": + case "iliad": + return storyTestChain; default: throw new Error(`chainId ${chainId as string} not supported`); } } export const chain: { [key in SupportedChainIds]: bigint } = { - sepolia: 11155111n, - 11155111: 11155111n, + iliad: 1513n, + 1513: 1513n, }; export const getAddress = (address: string, name: string, chainId?: number): Address => { diff --git a/packages/core-sdk/test/integration/dispute.test.ts b/packages/core-sdk/test/integration/dispute.test.ts index 7bb2ce56..131dcbab 100644 --- a/packages/core-sdk/test/integration/dispute.test.ts +++ b/packages/core-sdk/test/integration/dispute.test.ts @@ -1,7 +1,7 @@ import chai from "chai"; import { StoryClient } from "../../src"; import { CancelDisputeRequest, RaiseDisputeRequest } from "../../src/index"; -import { MockERC721, getStoryClientInSepolia, getTokenId } from "./utils/util"; +import { mockERC721, getStoryClient, getTokenId } from "./utils/util"; import chaiAsPromised from "chai-as-promised"; import { Address } from "viem"; import { MockERC20 } from "./utils/mockERC20"; @@ -9,22 +9,23 @@ import { MockERC20 } from "./utils/mockERC20"; chai.use(chaiAsPromised); const expect = chai.expect; -const arbitrationPolicyAddress = "0xc07Bc791CF55E718BA7D70cE650B3152BbE3325e"; +const arbitrationPolicyAddress = "0xcaEC2bD1B1fD57bC47357F688f97d57387E68E25"; describe("Dispute Functions", () => { let clientA: StoryClient; let clientB: StoryClient; - let disputeId: number; + let disputeId: bigint; let ipIdB: Address; before(async () => { - clientA = getStoryClientInSepolia(); - clientB = getStoryClientInSepolia(); + clientA = getStoryClient(); + clientB = getStoryClient(); const mockERC20 = new MockERC20(); + await mockERC20.mint(); await mockERC20.approve(arbitrationPolicyAddress); const tokenId = await getTokenId(); ipIdB = ( await clientB.ipAsset.register({ - nftContract: MockERC721, + nftContract: mockERC721, tokenId: tokenId!, txOptions: { waitForTransaction: true, @@ -43,9 +44,8 @@ describe("Dispute Functions", () => { waitForTransaction: true, }, }; - const response = await expect(clientA.dispute.raiseDispute(raiseDisputeRequest)).to.not.be - .rejected; - disputeId = response.disputeId; + const response = await clientA.dispute.raiseDispute(raiseDisputeRequest); + disputeId = response.disputeId!; expect(response.txHash).to.be.a("string").and.not.empty; expect(response.disputeId).to.be.a("bigint"); }); @@ -57,8 +57,7 @@ describe("Dispute Functions", () => { waitForTransaction: true, }, }; - const response = await expect(clientA.dispute.cancelDispute(cancelDispute)).to.not.be.rejected; - + const response = await clientA.dispute.cancelDispute(cancelDispute); expect(response.txHash).to.be.a("string").and.not.empty; }); }); diff --git a/packages/core-sdk/test/integration/ipAccount.test.ts b/packages/core-sdk/test/integration/ipAccount.test.ts index 5bfd10a8..32a44c85 100644 --- a/packages/core-sdk/test/integration/ipAccount.test.ts +++ b/packages/core-sdk/test/integration/ipAccount.test.ts @@ -1,35 +1,28 @@ import chai from "chai"; import chaiAsPromised from "chai-as-promised"; -import { AccessPermission, StoryClient, getPermissionSignature } from "../../src"; -import { - MockERC721, - getStoryClientInSepolia, - getTokenId, - sepoliaChainId, - walletClient, -} from "./utils/util"; +import { AccessPermission, StoryClient } from "../../src"; +import { mockERC721, getStoryClient, getTokenId, storyTestChainId } from "./utils/util"; import { Hex, encodeFunctionData, getAddress, toFunctionSelector } from "viem"; import { accessControllerAbi, accessControllerAddress, coreMetadataModuleAddress, } from "../../src/abi/generated"; -import { getDeadline } from "../../src/utils/sign"; chai.use(chaiAsPromised); const expect = chai.expect; -const coreMetadataModule = coreMetadataModuleAddress[sepoliaChainId]; describe("Ip Account functions", () => { let client: StoryClient; let ipId: Hex; let data: Hex; - const permissionAddress = accessControllerAddress[sepoliaChainId]; + const coreMetadataModule = coreMetadataModuleAddress[storyTestChainId]; + const permissionAddress = accessControllerAddress[storyTestChainId]; before(async () => { - client = getStoryClientInSepolia(); + client = getStoryClient(); const tokenId = await getTokenId(); const registerResult = await client.ipAsset.register({ - nftContract: MockERC721, + nftContract: mockERC721, tokenId: tokenId!, txOptions: { waitForTransaction: true, @@ -41,7 +34,7 @@ describe("Ip Account functions", () => { functionName: "setPermission", args: [ getAddress(ipId), - getAddress(process.env.SEPOLIA_TEST_WALLET_ADDRESS as Hex), + getAddress(process.env.TEST_WALLET_ADDRESS as Hex), getAddress(coreMetadataModule), toFunctionSelector("function setAll(address,string,bytes32,bytes32)"), AccessPermission.ALLOW, @@ -58,41 +51,4 @@ describe("Ip Account functions", () => { }); expect(response.txHash).to.be.a("string").and.not.empty; }); - - it("should not throw error when executeWithSig setting permission", async () => { - const state = await client.ipAccount.getIpAccountNonce(ipId); - const expectedState = state + 1n; - const deadline = getDeadline(60000n); - const signature = await getPermissionSignature({ - ipId, - wallet: walletClient, - permissions: [ - { - ipId: ipId, - signer: process.env.SEPOLIA_TEST_WALLET_ADDRESS as Hex, - to: coreMetadataModule, - permission: AccessPermission.ALLOW, - func: "function setAll(address,string,bytes32,bytes32)", - }, - ], - nonce: expectedState, - - chainId: BigInt(sepoliaChainId), - deadline: deadline, - }); - const response = await client.ipAccount.executeWithSig({ - ipId: ipId, - value: 0, - to: permissionAddress, - data: data, - deadline: deadline, - signer: process.env.SEPOLIA_TEST_WALLET_ADDRESS as Hex, - signature: signature, - txOptions: { - waitForTransaction: true, - }, - }); - - expect(response.txHash).to.be.a("string").and.not.empty; - }); }); diff --git a/packages/core-sdk/test/integration/ipAsset.test.ts b/packages/core-sdk/test/integration/ipAsset.test.ts index 98b64ecb..b5819cc7 100644 --- a/packages/core-sdk/test/integration/ipAsset.test.ts +++ b/packages/core-sdk/test/integration/ipAsset.test.ts @@ -2,8 +2,9 @@ import chai from "chai"; import { StoryClient, PIL_TYPE } from "../../src"; import { Hex, toHex } from "viem"; import chaiAsPromised from "chai-as-promised"; -import { MockERC721, getStoryClientInSepolia, getTokenId } from "./utils/util"; +import { mockERC721, getStoryClient, getTokenId, mintBySpg, storyTestChainId } from "./utils/util"; import { MockERC20 } from "./utils/mockERC20"; +import { spgAddress } from "../../src/abi/generated"; chai.use(chaiAsPromised); const expect = chai.expect; @@ -11,7 +12,7 @@ const expect = chai.expect; describe("IP Asset Functions ", () => { let client: StoryClient; before(async () => { - client = getStoryClientInSepolia(); + client = getStoryClient(); }); describe("Create IP Asset", async () => { @@ -19,19 +20,19 @@ describe("IP Asset Functions ", () => { let childIpId: Hex; let noCommercialLicenseTermsId: bigint; before(async () => { - const registerResult = await client.license.registerNonComSocialRemixingPIL({ + const res = await client.license.registerNonComSocialRemixingPIL({ txOptions: { waitForTransaction: true, }, }); - noCommercialLicenseTermsId = registerResult.licenseTermsId!; + noCommercialLicenseTermsId = res.licenseTermsId!; }); it("should not throw error when registering a IP Asset", async () => { const tokenId = await getTokenId(); const waitForTransaction: boolean = true; const response = await expect( client.ipAsset.register({ - nftContract: MockERC721, + nftContract: mockERC721, tokenId: tokenId!, txOptions: { waitForTransaction: waitForTransaction, @@ -44,30 +45,11 @@ describe("IP Asset Functions ", () => { } }); - it("should not throw error when registering a IP Asset given metadata", async () => { - const tokenId = await getTokenId(); - const waitForTransaction: boolean = true; - const response = await client.ipAsset.register({ - nftContract: MockERC721, - tokenId: tokenId!, - metadata: { - metadataURI: "test-uri", - metadataHash: toHex("test-metadata-hash", { size: 32 }), - nftMetadataHash: toHex("test-nft-metadata-hash", { size: 32 }), - }, - deadline: 1000n, - txOptions: { - waitForTransaction: waitForTransaction, - }, - }); - expect(response.ipId).to.be.a("string").and.not.empty; - }); - it("should not throw error when registering derivative", async () => { const tokenId = await getTokenId(); parentIpId = ( await client.ipAsset.register({ - nftContract: MockERC721, + nftContract: mockERC721, tokenId: tokenId!, txOptions: { waitForTransaction: true, @@ -81,16 +63,14 @@ describe("IP Asset Functions ", () => { waitForTransaction: true, }, }); - const response = await expect( - client.ipAsset.registerDerivative({ - childIpId: childIpId, - parentIpIds: [parentIpId], - licenseTermsIds: [noCommercialLicenseTermsId], - txOptions: { - waitForTransaction: true, - }, - }), - ).to.not.be.rejected; + const response = await client.ipAsset.registerDerivative({ + childIpId: childIpId, + parentIpIds: [parentIpId], + licenseTermsIds: [noCommercialLicenseTermsId], + txOptions: { + waitForTransaction: true, + }, + }); expect(response.txHash).to.be.a("string").and.not.empty; }); @@ -98,7 +78,7 @@ describe("IP Asset Functions ", () => { const tokenId = await getTokenId(); const ipId = ( await client.ipAsset.register({ - nftContract: MockERC721, + nftContract: mockERC721, tokenId: tokenId!, txOptions: { waitForTransaction: true, @@ -112,21 +92,20 @@ describe("IP Asset Functions ", () => { waitForTransaction: true, }, }); - const response = await expect( - client.ipAsset.registerDerivativeWithLicenseTokens({ - childIpId: ipId, - licenseTokenIds: [mintLicenseTokensResult.licenseTokenIds![0]], - txOptions: { - waitForTransaction: true, - }, - }), - ).to.not.be.rejected; + const response = await client.ipAsset.registerDerivativeWithLicenseTokens({ + childIpId: ipId, + licenseTokenIds: [mintLicenseTokensResult.licenseTokenIds![0]], + txOptions: { + waitForTransaction: true, + }, + }); expect(response.txHash).to.be.a("string").not.empty; }); }); describe("NFT Client (SPG)", () => { let nftContract: Hex; + before(async () => { // Create a NFT collection for this test-suite const txData = await client.nftClient.createNFTCollection({ @@ -139,14 +118,16 @@ describe("IP Asset Functions ", () => { }); expect(txData.nftContract).to.be.a("string").and.not.empty; nftContract = txData.nftContract!; + const mockERC20 = new MockERC20(); + await mockERC20.approve(spgAddress[storyTestChainId as keyof typeof spgAddress]); }); describe("should not throw error when mint and register ip and attach pil terms", async () => { - it.skip("Non-Commercial Remix", async () => { + it("Non-Commercial Remix", async () => { const result = await client.ipAsset.mintAndRegisterIpAssetWithPilTerms({ nftContract, pilType: PIL_TYPE.NON_COMMERCIAL_REMIX, - metadata: { + ipMetadata: { metadataURI: "test-uri", metadataHash: toHex("test-metadata-hash", { size: 32 }), nftMetadataHash: toHex("test-nft-metadata-hash", { size: 32 }), @@ -154,7 +135,6 @@ describe("IP Asset Functions ", () => { }); expect(result.txHash).to.be.a("string").and.not.empty; }); - it("Commercial Use", async () => { const result = await client.ipAsset.mintAndRegisterIpAssetWithPilTerms({ nftContract, @@ -162,7 +142,7 @@ describe("IP Asset Functions ", () => { commercialRevShare: 10, mintingFee: "100", currency: MockERC20.address, - metadata: { + ipMetadata: { metadataURI: "test-uri", metadataHash: toHex("test-metadata-hash", { size: 32 }), nftMetadataHash: toHex("test-nft-metadata-hash", { size: 32 }), @@ -178,7 +158,7 @@ describe("IP Asset Functions ", () => { commercialRevShare: 10, mintingFee: "100", currency: MockERC20.address, - metadata: { + ipMetadata: { metadataURI: "test-uri", metadataHash: toHex("test-metadata-hash", { size: 32 }), nftMetadataHash: toHex("test-nft-metadata-hash", { size: 32 }), @@ -203,13 +183,32 @@ describe("IP Asset Functions ", () => { expect(result.licenseTermsId).to.be.a("bigint"); }); }); - - it.skip("should not throw error when register registerDerivativeIp", async () => { - const tokenChildId = await getTokenId(nftContract); + it("should not throw error when registering a IP Asset given metadata", async () => { + const tokenId = await mintBySpg(nftContract, "test-metadata"); + const response = await client.ipAsset.register({ + nftContract, + tokenId: tokenId!, + ipMetadata: { + metadataURI: "test-uri", + metadataHash: toHex("test-metadata-hash", { size: 32 }), + nftMetadataHash: toHex("test-nft-metadata-hash", { size: 32 }), + }, + deadline: 1000n, + txOptions: { + waitForTransaction: true, + }, + }); + expect(response.ipId).to.be.a("string").and.not.empty; + }); + it("should not throw error when register registerDerivativeIp", async () => { + const tokenChildId = await mintBySpg(nftContract, "test-metadata"); const { ipId: parentIpId, licenseTermsId } = await client.ipAsset.mintAndRegisterIpAssetWithPilTerms({ nftContract, - pilType: PIL_TYPE.NON_COMMERCIAL_REMIX, + pilType: PIL_TYPE.COMMERCIAL_REMIX, + commercialRevShare: 10, + mintingFee: "100", + currency: MockERC20.address, txOptions: { waitForTransaction: true, }, @@ -230,14 +229,16 @@ describe("IP Asset Functions ", () => { expect(result.ipId).to.be.a("string").and.not.empty; }); - it.skip("should not throw error when register registerIpAndAttachPilTerms", async () => { - const tokenId = await getTokenId(nftContract); + it("should not throw error when register registerIpAndAttachPilTerms", async () => { + const tokenId = await mintBySpg(nftContract, "test-metadata"); const deadline = 1000n; const result = await client.ipAsset.registerIpAndAttachPilTerms({ nftContract: nftContract, tokenId: tokenId!, deadline, - pilType: PIL_TYPE.NON_COMMERCIAL_REMIX, + pilType: PIL_TYPE.COMMERCIAL_USE, + mintingFee: "100", + currency: MockERC20.address, txOptions: { waitForTransaction: true, }, diff --git a/packages/core-sdk/test/integration/license.test.ts b/packages/core-sdk/test/integration/license.test.ts index 020ce797..286ca110 100644 --- a/packages/core-sdk/test/integration/license.test.ts +++ b/packages/core-sdk/test/integration/license.test.ts @@ -2,8 +2,9 @@ import chai from "chai"; import { StoryClient } from "../../src"; import { Hex } from "viem"; import chaiAsPromised from "chai-as-promised"; -import { MockERC721, getStoryClientInSepolia, getTokenId } from "./utils/util"; +import { mockERC721, getStoryClient, getTokenId, storyTestChainId } from "./utils/util"; import { MockERC20 } from "./utils/mockERC20"; +import { licensingModuleAddress } from "../../src/abi/generated"; chai.use(chaiAsPromised); const expect = chai.expect; @@ -12,7 +13,7 @@ describe("License Functions", () => { let client: StoryClient; before(() => { - client = getStoryClientInSepolia(); + client = getStoryClient(); }); describe("registering license with different types", async () => { it("should not throw error when registering license with non commercial social remixing PIL", async () => { @@ -23,7 +24,6 @@ describe("License Functions", () => { }); expect(result.licenseTermsId).to.be.a("bigint"); }); - it("should not throw error when registering license with commercial use", async () => { const result = await client.license.registerCommercialUsePIL({ mintingFee: "1", @@ -55,15 +55,21 @@ describe("License Functions", () => { before(async () => { tokenId = await getTokenId(); const registerResult = await client.ipAsset.register({ - nftContract: MockERC721, + nftContract: mockERC721, tokenId: tokenId!, txOptions: { waitForTransaction: true, }, }); + const mockERC20 = new MockERC20(); + await mockERC20.approve( + licensingModuleAddress[Number(storyTestChainId) as keyof typeof licensingModuleAddress], + ); ipId = registerResult.ipId!; - - const registerLicenseResult = await client.license.registerNonComSocialRemixingPIL({ + const registerLicenseResult = await client.license.registerCommercialRemixPIL({ + mintingFee: "1", + commercialRevShare: 100, + currency: MockERC20.address, txOptions: { waitForTransaction: true, }, @@ -71,7 +77,7 @@ describe("License Functions", () => { licenseId = registerLicenseResult.licenseTermsId!; }); - it.skip("should not throw error when attach License Terms", async () => { + it("should not throw error when attach License Terms", async () => { const result = await client.license.attachLicenseTerms({ ipId: ipId, licenseTermsId: licenseId, diff --git a/packages/core-sdk/test/integration/nftClient.test.ts b/packages/core-sdk/test/integration/nftClient.test.ts index cb557014..15289986 100644 --- a/packages/core-sdk/test/integration/nftClient.test.ts +++ b/packages/core-sdk/test/integration/nftClient.test.ts @@ -1,11 +1,11 @@ import { expect } from "chai"; import { StoryClient } from "../../src"; -import { getStoryClientInSepolia } from "./utils/util"; +import { getStoryClient } from "./utils/util"; describe("nftClient Functions", () => { let client: StoryClient; before(async () => { - client = getStoryClientInSepolia(); + client = getStoryClient(); }); it("should success when create nft collection", async () => { const txData = await client.nftClient.createNFTCollection({ diff --git a/packages/core-sdk/test/integration/permission.test.ts b/packages/core-sdk/test/integration/permission.test.ts index 36db5cd4..8278a5c1 100644 --- a/packages/core-sdk/test/integration/permission.test.ts +++ b/packages/core-sdk/test/integration/permission.test.ts @@ -1,6 +1,6 @@ import chai from "chai"; import { StoryClient } from "../../src"; -import { MockERC721, getStoryClientInSepolia, getTokenId, sepoliaChainId } from "./utils/util"; +import { mockERC721, getStoryClient, getTokenId, storyTestChainId } from "./utils/util"; import { Address } from "viem"; import { AccessPermission } from "../../src/types/resources/permission"; import chaiAsPromised from "chai-as-promised"; @@ -11,14 +11,14 @@ const expect = chai.expect; describe("Permission Functions", () => { let client: StoryClient; let ipId: Address; - const coreMetadataModule = coreMetadataModuleAddress[sepoliaChainId]; + const coreMetadataModule = coreMetadataModuleAddress[storyTestChainId]; before(async () => { - client = getStoryClientInSepolia(); + client = getStoryClient(); const tokenId = await getTokenId(); ipId = ( await client.ipAsset.register({ - nftContract: MockERC721, + nftContract: mockERC721, tokenId: tokenId!, txOptions: { waitForTransaction: true, @@ -29,7 +29,7 @@ describe("Permission Functions", () => { it("should not throw error when call setPermission", async () => { const response = await client.permission.setPermission({ ipId: ipId, - signer: process.env.SEPOLIA_TEST_WALLET_ADDRESS as Address, + signer: process.env.TEST_WALLET_ADDRESS as Address, to: "0x2ac240293f12032E103458451dE8A8096c5A72E8", permission: 1, txOptions: { @@ -43,7 +43,7 @@ describe("Permission Functions", () => { it("should not throw error when call setAllPermissions", async () => { const response = await client.permission.setAllPermissions({ ipId: ipId, - signer: process.env.SEPOLIA_TEST_WALLET_ADDRESS as Address, + signer: process.env.TEST_WALLET_ADDRESS as Address, permission: AccessPermission.ALLOW, txOptions: { waitForTransaction: true, @@ -57,7 +57,7 @@ describe("Permission Functions", () => { it("should not throw error when call createSetPermissionSignature", async () => { const response = await client.permission.createSetPermissionSignature({ ipId, - signer: process.env.SEPOLIA_TEST_WALLET_ADDRESS as Address, + signer: process.env.TEST_WALLET_ADDRESS as Address, to: coreMetadataModule, func: "function setAll(address,string,bytes32,bytes32)", permission: AccessPermission.ALLOW, @@ -76,14 +76,14 @@ describe("Permission Functions", () => { permissions: [ { ipId: ipId, - signer: process.env.SEPOLIA_TEST_WALLET_ADDRESS as Address, + signer: process.env.TEST_WALLET_ADDRESS as Address, to: coreMetadataModule, permission: AccessPermission.DENY, func: "function setAll(address,string,bytes32,bytes32)", }, { ipId: ipId, - signer: process.env.SEPOLIA_TEST_WALLET_ADDRESS as Address, + signer: process.env.TEST_WALLET_ADDRESS as Address, to: coreMetadataModule, permission: AccessPermission.DENY, func: "function freezeMetadata(address)", @@ -104,14 +104,14 @@ describe("Permission Functions", () => { permissions: [ { ipId: ipId, - signer: process.env.SEPOLIA_TEST_WALLET_ADDRESS as Address, + signer: process.env.TEST_WALLET_ADDRESS as Address, to: coreMetadataModule, permission: AccessPermission.DENY, func: "function setAll(address,string,bytes32,bytes32)", }, { ipId: ipId, - signer: process.env.SEPOLIA_TEST_WALLET_ADDRESS as Address, + signer: process.env.TEST_WALLET_ADDRESS as Address, to: coreMetadataModule, permission: AccessPermission.DENY, func: "function freezeMetadata(address)", diff --git a/packages/core-sdk/test/integration/royalty.test.ts b/packages/core-sdk/test/integration/royalty.test.ts index d6d3c92a..7be423f0 100644 --- a/packages/core-sdk/test/integration/royalty.test.ts +++ b/packages/core-sdk/test/integration/royalty.test.ts @@ -2,8 +2,9 @@ import chai from "chai"; import { StoryClient } from "../../src"; import { Hex, encodeFunctionData } from "viem"; import chaiAsPromised from "chai-as-promised"; -import { MockERC721, getTokenId, getStoryClientInSepolia } from "./utils/util"; +import { mockERC721, getTokenId, getStoryClient, storyTestChainId } from "./utils/util"; import { MockERC20 } from "./utils/mockERC20"; +import { royaltyPolicyLapAddress } from "../../src/abi/generated"; chai.use(chaiAsPromised); const expect = chai.expect; @@ -12,7 +13,7 @@ describe("Test royalty Functions", () => { let client: StoryClient; before(() => { - client = getStoryClientInSepolia(); + client = getStoryClient(); }); describe("Royalty Functions", async () => { let ipId1: Hex; @@ -20,7 +21,7 @@ describe("Test royalty Functions", () => { const getIpId = async (): Promise => { const tokenId = await getTokenId(); const response = await client.ipAsset.register({ - nftContract: MockERC721, + nftContract: mockERC721, tokenId: tokenId!, txOptions: { waitForTransaction: true, @@ -55,6 +56,10 @@ describe("Test royalty Functions", () => { ipId2 = await getIpId(); const licenseTermsId = await getCommercialPolicyId(); await attachLicenseTerms(ipId1, licenseTermsId); + const mockERC20 = new MockERC20(); + await mockERC20.approve( + royaltyPolicyLapAddress[Number(storyTestChainId) as keyof typeof royaltyPolicyLapAddress], + ); await client.ipAsset.registerDerivative({ childIpId: ipId2, parentIpIds: [ipId1], @@ -78,9 +83,6 @@ describe("Test royalty Functions", () => { }); it("should not throw error when pay royalty on behalf", async () => { - const mockERC20 = new MockERC20(); - await mockERC20.approve(MockERC721); - await mockERC20.mint(); const response = await client.royalty.payRoyaltyOnBehalf({ receiverIpId: ipId1, payerIpId: ipId2, @@ -92,8 +94,8 @@ describe("Test royalty Functions", () => { }); expect(response.txHash).to.be.a("string").not.empty; }); - - it("should not throw error when snapshot", async () => { + // Because of the snapshot interval is long, so we can't get the snapshotId in the same test case. Let's skip the related test case. + it.skip("should not throw error when snapshot", async () => { const response = await client.royalty.snapshot({ royaltyVaultIpId: ipId1, txOptions: { @@ -104,7 +106,7 @@ describe("Test royalty Functions", () => { expect(response.snapshotId).to.be.a("bigint"); snapshotId = response.snapshotId!; }); - it("should not throw error when claimable revenue", async () => { + it.skip("should not throw error when claimable revenue", async () => { const response = await client.royalty.claimableRevenue({ royaltyVaultIpId: ipId1, account: ipId1, @@ -114,7 +116,7 @@ describe("Test royalty Functions", () => { expect(response).to.be.a("bigint"); }); - it("should not throw error when claim revenue by ipAccount", async () => { + it.skip("should not throw error when claim revenue by ipAccount", async () => { const response = await client.royalty.claimRevenue({ royaltyVaultIpId: ipId1, snapshotIds: [snapshotId.toString()], @@ -127,7 +129,7 @@ describe("Test royalty Functions", () => { expect(response.claimableToken).to.be.a("bigint"); }); - it("should not throw error when claim revenue by ipAccount by EOA", async () => { + it.skip("should not throw error when claim revenue by ipAccount by EOA", async () => { const proxyAddress = await client.royalty.getRoyaltyVaultAddress(ipId1); //1.transfer token to eoa await client.ipAccount.execute({ diff --git a/packages/core-sdk/test/integration/utils/mockERC20.ts b/packages/core-sdk/test/integration/utils/mockERC20.ts index 6cda74ea..568f33e2 100644 --- a/packages/core-sdk/test/integration/utils/mockERC20.ts +++ b/packages/core-sdk/test/integration/utils/mockERC20.ts @@ -14,17 +14,17 @@ import { RPC } from "./util"; export class MockERC20 { private publicClient: PublicClient; private walletClient: WalletClient; - static address: Hex = "0xB132A6B7AE652c974EE1557A3521D53d18F6739f"; + static address: Hex = "0xDE51BB12D5cef80ff2334fe1019089363F80b46e"; constructor() { const baseConfig = { - chain: chainStringToViemChain("sepolia"), + chain: chainStringToViemChain("iliad"), transport: http(RPC), } as const; this.publicClient = createPublicClient(baseConfig); this.walletClient = createWalletClient({ ...baseConfig, - account: privateKeyToAccount(process.env.SEPOLIA_WALLET_PRIVATE_KEY as Hex), + account: privateKeyToAccount(process.env.WALLET_PRIVATE_KEY as Hex), }); } @@ -91,7 +91,7 @@ export class MockERC20 { address: MockERC20.address, functionName: "mint", account: this.walletClient.account, - args: [process.env.SEPOLIA_TEST_WALLET_ADDRESS! as Address, BigInt(100000 * 10 ** 6)], + args: [process.env.TEST_WALLET_ADDRESS! as Address, BigInt(100000 * 10 ** 6)], }); const mintHash = await this.walletClient.writeContract(request); await waitTx(this.publicClient, mintHash); diff --git a/packages/core-sdk/test/integration/utils/util.ts b/packages/core-sdk/test/integration/utils/util.ts index 414b6f0b..d00de2ea 100644 --- a/packages/core-sdk/test/integration/utils/util.ts +++ b/packages/core-sdk/test/integration/utils/util.ts @@ -2,21 +2,26 @@ import { privateKeyToAccount } from "viem/accounts"; import { chainStringToViemChain } from "../../../src/utils/utils"; import { http, createPublicClient, createWalletClient, Hex, Address } from "viem"; import { StoryClient, StoryConfig } from "../../../src"; -export const RPC = "http://127.0.0.1:8545"; -export const MockERC721 = "0x7ee32b8B515dEE0Ba2F25f612A04a731eEc24F49"; +import { spgnftBeaconAddress } from "../../../src/abi/generated"; +export const RPC = "https://rpc.partner.testnet.storyprotocol.net"; +// export const RPC = "http://localhost:8545"; +export const storyTestChainId = 1513; + +export const mockERC721 = "0x30062557fd9f1bf0be03fe3782d97edea24295c9"; +export const spgNftBeacon = + spgnftBeaconAddress[Number(storyTestChainId) as keyof typeof spgnftBeaconAddress]; const baseConfig = { - chain: chainStringToViemChain("sepolia"), + chain: chainStringToViemChain("iliad"), transport: http(RPC), } as const; export const publicClient = createPublicClient(baseConfig); export const walletClient = createWalletClient({ ...baseConfig, - account: privateKeyToAccount(process.env.SEPOLIA_WALLET_PRIVATE_KEY as Hex), + account: privateKeyToAccount(process.env.WALLET_PRIVATE_KEY as Hex), }); -export const sepoliaChainId = 11155111; -export const getTokenId = async (nftContract?: Address): Promise => { +export const getTokenId = async (): Promise => { const { request } = await publicClient.simulateContract({ abi: [ { @@ -27,9 +32,9 @@ export const getTokenId = async (nftContract?: Address): Promise { +export const mintBySpg = async (nftContract: Hex, nftMetadata: string) => { + const { request } = await publicClient.simulateContract({ + abi: [ + { + inputs: [ + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "string", + name: "nftMetadata", + type: "string", + }, + ], + name: "mint", + outputs: [ + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + ], + address: nftContract, + functionName: "mint", + args: [process.env.TEST_WALLET_ADDRESS! as Address, nftMetadata], + account: walletClient.account, + }); + const hash = await walletClient.writeContract(request); + const { logs } = await publicClient.waitForTransactionReceipt({ + hash, + }); + if (logs[0].topics[3]) { + return parseInt(logs[0].topics[3], 16); + } +}; +export const getStoryClient = (): StoryClient => { const config: StoryConfig = { - chainId: "sepolia", + chainId: "iliad", transport: http(RPC), - account: privateKeyToAccount(process.env.SEPOLIA_WALLET_PRIVATE_KEY as Address), + account: privateKeyToAccount(process.env.WALLET_PRIVATE_KEY as Address), }; return StoryClient.newClient(config); }; diff --git a/packages/core-sdk/test/unit/client.test.ts b/packages/core-sdk/test/unit/client.test.ts index 10882ff8..d970e0ed 100644 --- a/packages/core-sdk/test/unit/client.test.ts +++ b/packages/core-sdk/test/unit/client.test.ts @@ -70,19 +70,10 @@ describe("Test StoryClient", () => { const account = privateKeyToAccount(generatePrivateKey()); const transport = http(rpc); const config: StoryConfig = { - chainId: "sepolia", + chainId: "iliad", transport, account, }; - const clientConfig = { - chain: sepolia, - transport: config.transport, - }; - const rpcClient = createPublicClient(clientConfig); - const wallet = createWalletClient({ - ...clientConfig, - account: account, - }); const client: StoryClient = StoryClient.newClient(config); it("client modules should not be empty", () => { diff --git a/packages/core-sdk/test/unit/resources/ipAccount.test.ts b/packages/core-sdk/test/unit/resources/ipAccount.test.ts index dda58f98..2c068af6 100644 --- a/packages/core-sdk/test/unit/resources/ipAccount.test.ts +++ b/packages/core-sdk/test/unit/resources/ipAccount.test.ts @@ -127,11 +127,13 @@ describe("Test IPAccountClient", () => { describe("Test getIpAccountNonce", () => { it("should return the state of the IP Account", async () => { - sinon.stub(IpAccountImplClient.prototype, "state").resolves(1n); + sinon + .stub(IpAccountImplClient.prototype, "state") + .resolves({ result: "0x73fcb515cee99e4991465ef586cfe2b072ebb512" }); const state = await ipAccountClient.getIpAccountNonce( "0x73fcb515cee99e4991465ef586cfe2b072ebb512", ); - expect(state).to.equal(1n); + expect(state).to.equal("0x73fcb515cee99e4991465ef586cfe2b072ebb512"); }); }); }); diff --git a/packages/core-sdk/test/unit/resources/ipAsset.test.ts b/packages/core-sdk/test/unit/resources/ipAsset.test.ts index abd16e0f..6fba1063 100644 --- a/packages/core-sdk/test/unit/resources/ipAsset.test.ts +++ b/packages/core-sdk/test/unit/resources/ipAsset.test.ts @@ -1,8 +1,16 @@ import chai from "chai"; import { createMock } from "../testUtils"; import * as sinon from "sinon"; -import { CreateIpAssetWithPilTermsRequest, IPAssetClient } from "../../../src"; -import { PublicClient, WalletClient, Account, toHex, zeroHash, LocalAccount } from "viem"; +import { CreateIpAssetWithPilTermsRequest, IPAssetClient, PIL_TYPE } from "../../../src"; +import { + PublicClient, + WalletClient, + Account, + toHex, + zeroHash, + LocalAccount, + zeroAddress, +} from "viem"; import chaiAsPromised from "chai-as-promised"; import { RegisterIpAndAttachPilTermsRequest } from "../../../src/types/resources/ipAsset"; chai.use(chaiAsPromised); @@ -12,13 +20,14 @@ describe("Test IpAssetClient", () => { let ipAssetClient: IPAssetClient; let rpcMock: PublicClient; let walletMock: WalletClient; + const nftContract = "0x1daAE3197Bc469Cb97B917aa460a12dD95c6627c"; beforeEach(() => { rpcMock = createMock(); walletMock = createMock(); const accountMock = createMock(); walletMock.account = accountMock; - ipAssetClient = new IPAssetClient(rpcMock, walletMock, "sepolia"); + ipAssetClient = new IPAssetClient(rpcMock, walletMock, "iliad"); walletMock.signTypedData = sinon .stub() .resolves("0x129f7dd802200f096221dd89d5b086e4bd3ad6eafb378a0c75e3b04fc375f997"); @@ -29,6 +38,8 @@ describe("Test IpAssetClient", () => { "0x1daAE3197Bc469Cb97B917aa460a12dD95c6627c"; (ipAssetClient.licensingModuleClient as any).address = "0x1daAE3197Bc469Cb97B917aa460a12dD95c6627c"; + (ipAssetClient.royaltyPolicyLAPClient as any).address = + "0x1daAE3197Bc469Cb97B917aa460a12dD95c6627c"; }); afterEach(() => { @@ -43,7 +54,7 @@ describe("Test IpAssetClient", () => { sinon.stub(ipAssetClient.ipAssetRegistryClient, "isRegistered").resolves(true); const res = await ipAssetClient.register({ - nftContract: "0x1daAE3197Bc469Cb97B917aa460a12dD95c6627c", + nftContract, tokenId: "3", }); @@ -59,10 +70,10 @@ describe("Test IpAssetClient", () => { try { await ipAssetClient.register({ - nftContract: "0x1daAE3197Bc469Cb97B917aa460a12dD95c6627c", + nftContract, tokenId: "3", deadline: "error", - metadata: { + ipMetadata: { metadataURI: "1", metadataHash: zeroHash, }, @@ -75,7 +86,7 @@ describe("Test IpAssetClient", () => { it("should throw account error when register given wallet have no signTypedData ", async () => { const walletMock = createMock(); walletMock.account = createMock(); - ipAssetClient = new IPAssetClient(rpcMock, walletMock, "sepolia"); + ipAssetClient = new IPAssetClient(rpcMock, walletMock, "iliad"); (ipAssetClient.spgClient as any).address = "0x1daAE3197Bc469Cb97B917aa460a12dD95c6627c"; (ipAssetClient.coreMetadataModuleClient as any).address = "0x1daAE3197Bc469Cb97B917aa460a12dD95c6627c"; @@ -86,10 +97,10 @@ describe("Test IpAssetClient", () => { try { await ipAssetClient.register({ - nftContract: "0x1daAE3197Bc469Cb97B917aa460a12dD95c6627c", + nftContract, tokenId: "3", deadline: "12321", - metadata: { + ipMetadata: { metadataURI: "", }, }); @@ -110,7 +121,7 @@ describe("Test IpAssetClient", () => { .resolves("0x129f7dd802200f096221dd89d5b086e4bd3ad6eafb378a0c75e3b04fc375f997"); const res = await ipAssetClient.register({ - nftContract: "0x1daAE3197Bc469Cb97B917aa460a12dD95c6627c", + nftContract, tokenId: "3", }); @@ -140,7 +151,7 @@ describe("Test IpAssetClient", () => { ]); const response = await ipAssetClient.register({ - nftContract: "0x1daAE3197Bc469Cb97B917aa460a12dD95c6627c", + nftContract, tokenId: "3", txOptions: { waitForTransaction: true, @@ -173,9 +184,9 @@ describe("Test IpAssetClient", () => { }, ]); const response = await ipAssetClient.register({ - nftContract: "0x1daAE3197Bc469Cb97B917aa460a12dD95c6627c", + nftContract, tokenId: "3", - metadata: { + ipMetadata: { metadataURI: "", metadataHash: zeroHash, nftMetadataHash: "0x1daAE3197Bc469Cb97B917aa460a12dD95c6627c", @@ -193,12 +204,12 @@ describe("Test IpAssetClient", () => { it("should return encoded tx data when register a IP given correct args, encodedTxDataOnly is true and metadata", async () => { sinon - .stub(ipAssetClient.ipAssetRegistryClient, "ipId") - .resolves("0xd142822Dc1674154EaF4DDF38bbF7EF8f0D8ECe4"); + .stub(ipAssetClient.ipAssetRegistryClient, "ipId") + .resolves("0xd142822Dc1674154EaF4DDF38bbF7EF8f0D8ECe4"); sinon.stub(ipAssetClient.ipAssetRegistryClient, "isRegistered").resolves(false); sinon - .stub(ipAssetClient.spgClient, "registerIp") - .resolves("0x129f7dd802200f096221dd89d5b086e4bd3ad6eafb378a0c75e3b04fc375f997"); + .stub(ipAssetClient.spgClient, "registerIp") + .resolves("0x129f7dd802200f096221dd89d5b086e4bd3ad6eafb378a0c75e3b04fc375f997"); sinon.stub(ipAssetClient.ipAssetRegistryClient, "parseTxIpRegisteredEvent").returns([ { ipId: "0xd142822Dc1674154EaF4DDF38bbF7EF8f0D8ECe4", @@ -213,7 +224,7 @@ describe("Test IpAssetClient", () => { const response = await ipAssetClient.register({ nftContract: "0x1daAE3197Bc469Cb97B917aa460a12dD95c6627c", tokenId: "3", - metadata: { + ipMetadata: { metadataURI: "", metadataHash: zeroHash, nftMetadataHash: zeroHash, @@ -234,7 +245,7 @@ describe("Test IpAssetClient", () => { sinon.stub(ipAssetClient.ipAssetRegistryClient, "register").throws(new Error("revert error")); try { await ipAssetClient.register({ - nftContract: "0x1daAE3197Bc469Cb97B917aa460a12dD95c6627c", + nftContract, tokenId: "3", txOptions: { waitForTransaction: true, @@ -385,17 +396,17 @@ describe("Test IpAssetClient", () => { it("should return encoded tx data when registerDerivative given correct childIpId, parentIpId, licenseTermsIds and encodedTxDataOnly of true ", async () => { sinon - .stub(ipAssetClient.ipAssetRegistryClient, "isRegistered") - .onCall(0) - .resolves(true) - .onCall(1) - .resolves(true); + .stub(ipAssetClient.ipAssetRegistryClient, "isRegistered") + .onCall(0) + .resolves(true) + .onCall(1) + .resolves(true); sinon - .stub(ipAssetClient.licenseRegistryReadOnlyClient, "hasIpAttachedLicenseTerms") - .resolves(true); + .stub(ipAssetClient.licenseRegistryReadOnlyClient, "hasIpAttachedLicenseTerms") + .resolves(true); sinon - .stub(ipAssetClient.licensingModuleClient, "registerDerivative") - .resolves("0x129f7dd802200f096221dd89d5b086e4bd3ad6eafb378a0c75e3b04fc375f997"); + .stub(ipAssetClient.licensingModuleClient, "registerDerivative") + .resolves("0x129f7dd802200f096221dd89d5b086e4bd3ad6eafb378a0c75e3b04fc375f997"); const res = await ipAssetClient.registerDerivative({ childIpId: "0x1daAE3197Bc469Cb97B917aa460a12dD95c6627c", @@ -409,7 +420,6 @@ describe("Test IpAssetClient", () => { expect(res.encodedTxData!.data).to.be.a("string").and.not.empty; }); - }); describe("Test ipAssetClient.registerDerivativeWithLicenseTokens", async () => { @@ -502,17 +512,17 @@ describe("Test IpAssetClient", () => { it("should return encoded tx data when registerDerivativeWithLicenseTokens given correct args and encodedTxDataOnly of true", async () => { sinon - .stub(ipAssetClient.ipAssetRegistryClient, "isRegistered") - .onCall(0) - .resolves(true) - .onCall(1) - .resolves(true); + .stub(ipAssetClient.ipAssetRegistryClient, "isRegistered") + .onCall(0) + .resolves(true) + .onCall(1) + .resolves(true); sinon - .stub(ipAssetClient.licenseTokenReadOnlyClient, "ownerOf") - .resolves("0x73fcb515cee99e4991465ef586cfe2b072ebb512"); + .stub(ipAssetClient.licenseTokenReadOnlyClient, "ownerOf") + .resolves("0x73fcb515cee99e4991465ef586cfe2b072ebb512"); sinon - .stub(ipAssetClient.licensingModuleClient, "registerDerivativeWithLicenseTokens") - .resolves("0x129f7dd802200f096221dd89d5b086e4bd3ad6eafb378a0c75e3b04fc375f997"); + .stub(ipAssetClient.licensingModuleClient, "registerDerivativeWithLicenseTokens") + .resolves("0x129f7dd802200f096221dd89d5b086e4bd3ad6eafb378a0c75e3b04fc375f997"); const res = await ipAssetClient.registerDerivativeWithLicenseTokens({ childIpId: "0xd142822Dc1674154EaF4DDF38bbF7EF8f0D8ECe4", @@ -524,14 +534,13 @@ describe("Test IpAssetClient", () => { expect(res.encodedTxData!.data).to.be.a("string").and.not.empty; }); - }); describe("Test ipAssetClient.createIpAssetWithPilTerms", async () => { it("throw PIL_TYPE error when createIpAssetWithPilTerms given PIL_TYPE is not match", async () => { try { await ipAssetClient.mintAndRegisterIpAssetWithPilTerms({ - nftContract: "0x1daAE3197Bc469Cb97B917aa460a12dD95c6627c", + nftContract, } as unknown as CreateIpAssetWithPilTermsRequest); } catch (err) { expect((err as Error).message).equal( @@ -540,13 +549,15 @@ describe("Test IpAssetClient", () => { } }); - it("should throw address error when createIpAssetWithPilTerms given nftContract is not registered", async () => { + it("should throw address error when createIpAssetWithPilTerms given nftContract is wrong address", async () => { sinon.stub(ipAssetClient.ipAssetRegistryClient, "isRegistered").resolves(false); try { await ipAssetClient.mintAndRegisterIpAssetWithPilTerms({ nftContract: "0x", - pilType: 0, + pilType: PIL_TYPE.COMMERCIAL_USE, + mintingFee: "1", + currency: zeroAddress, }); } catch (err) { expect((err as Error).message).equal( @@ -559,10 +570,12 @@ describe("Test IpAssetClient", () => { const hash = "0x129f7dd802200f096221dd89d5b086e4bd3ad6eafb378a0c75e3b04fc375f997"; sinon.stub(ipAssetClient.spgClient, "mintAndRegisterIpAndAttachPilTerms").resolves(hash); const result = await ipAssetClient.mintAndRegisterIpAssetWithPilTerms({ - nftContract: "0x1daAE3197Bc469Cb97B917aa460a12dD95c6627c", - pilType: 0, + nftContract, + pilType: PIL_TYPE.COMMERCIAL_USE, + mintingFee: "1", + currency: zeroAddress, recipient: "0x73fcb515cee99e4991465ef586cfe2b072ebb512", - metadata: { + ipMetadata: { metadataURI: "", metadataHash: toHex(0, { size: 32 }), }, @@ -594,9 +607,11 @@ describe("Test IpAssetClient", () => { }, ]); const result = await ipAssetClient.mintAndRegisterIpAssetWithPilTerms({ - nftContract: "0x1daAE3197Bc469Cb97B917aa460a12dD95c662ac", - pilType: 0, - metadata: { + nftContract, + pilType: PIL_TYPE.COMMERCIAL_USE, + mintingFee: "1", + currency: zeroAddress, + ipMetadata: { nftMetadataHash: toHex(0, { size: 32 }), }, txOptions: { @@ -616,19 +631,20 @@ describe("Test IpAssetClient", () => { const result = await ipAssetClient.mintAndRegisterIpAssetWithPilTerms({ nftContract: "0x1daAE3197Bc469Cb97B917aa460a12dD95c6627c", pilType: 0, + mintingFee: "1", + currency: zeroAddress, recipient: "0x73fcb515cee99e4991465ef586cfe2b072ebb512", - metadata: { + ipMetadata: { metadataURI: "", metadataHash: toHex(0, { size: 32 }), }, txOptions: { - encodedTxDataOnly: true - } + encodedTxDataOnly: true, + }, }); expect(result.encodedTxData!.data).to.be.a("string").and.not.empty; }); - }); describe("Test ipAssetClient.registerDerivativeIp", async () => { @@ -640,7 +656,7 @@ describe("Test IpAssetClient", () => { try { await ipAssetClient.registerDerivativeIp({ - nftContract: "0x1daAE3197Bc469Cb97B917aa460a12dD95c6627c", + nftContract, tokenId: "3", derivData: { parentIpIds: ["0xd142822Dc1674154EaF4DDF38bbF7EF8f0D8ECe4"], @@ -662,7 +678,7 @@ describe("Test IpAssetClient", () => { try { await ipAssetClient.registerDerivativeIp({ - nftContract: "0x1daAE3197Bc469Cb97B917aa460a12dD95c6627c", + nftContract, tokenId: "3", derivData: { parentIpIds: ["0xd142822Dc1674154EaF4DDF38bbF7EF8f0D8ECe4"], @@ -687,7 +703,7 @@ describe("Test IpAssetClient", () => { try { await ipAssetClient.registerDerivativeIp({ - nftContract: "0x1daAE3197Bc469Cb97B917aa460a12dD95c6627c", + nftContract, tokenId: "3", derivData: { parentIpIds: ["0xd142822Dc1674154EaF4DDF38bbF7EF8f0D8ECe4"], @@ -714,14 +730,14 @@ describe("Test IpAssetClient", () => { .resolves("0x129f7dd802200f096221dd89d5b086e4bd3ad6eafb378a0c75e3b04fc375f997"); const res = await ipAssetClient.registerDerivativeIp({ - nftContract: "0x1daAE3197Bc469Cb97B917aa460a12dD95c6627c", + nftContract, tokenId: "3", derivData: { parentIpIds: ["0xd142822Dc1674154EaF4DDF38bbF7EF8f0D8ECe4"], licenseTermsIds: ["1"], licenseTemplate: "0x1daAE3197Bc469Cb97B917aa460a12dD95c6627c", }, - metadata: { + ipMetadata: { metadataHash: toHex(0, { size: 32 }), }, }); @@ -743,14 +759,14 @@ describe("Test IpAssetClient", () => { .resolves("0x129f7dd802200f096221dd89d5b086e4bd3ad6eafb378a0c75e3b04fc375f997"); const res = await ipAssetClient.registerDerivativeIp({ - nftContract: "0x1daAE3197Bc469Cb97B917aa460a12dD95c6627c", + nftContract, tokenId: "3", derivData: { parentIpIds: ["0xd142822Dc1674154EaF4DDF38bbF7EF8f0D8ECe4"], licenseTermsIds: ["1"], licenseTemplate: "0x1daAE3197Bc469Cb97B917aa460a12dD95c6627c", }, - metadata: { + ipMetadata: { metadataHash: toHex(0, { size: 32 }), metadataURI: "", }, @@ -785,13 +801,13 @@ describe("Test IpAssetClient", () => { ]); const res = await ipAssetClient.registerDerivativeIp({ - nftContract: "0x1daAE3197Bc469Cb97B917aa460a12dD95c6627c", + nftContract, tokenId: "3", derivData: { parentIpIds: ["0xd142822Dc1674154EaF4DDF38bbF7EF8f0D8ECe4"], licenseTermsIds: ["1"], }, - metadata: { + ipMetadata: { metadataURI: "https://", nftMetadataHash: toHex("nftMetadata", { size: 32 }), }, @@ -808,15 +824,15 @@ describe("Test IpAssetClient", () => { it("should return encoded tx data when registerDerivativeIp given correct args and encodedTxDataOnly of true", async () => { sinon - .stub(ipAssetClient.ipAssetRegistryClient, "ipId") - .resolves("0x1daAE3197Bc469Cb97B917aa460a12dD95c6627c"); + .stub(ipAssetClient.ipAssetRegistryClient, "ipId") + .resolves("0x1daAE3197Bc469Cb97B917aa460a12dD95c6627c"); sinon.stub(ipAssetClient.ipAssetRegistryClient, "isRegistered").resolves(false); sinon - .stub(ipAssetClient.licenseRegistryReadOnlyClient, "hasIpAttachedLicenseTerms") - .resolves(true); + .stub(ipAssetClient.licenseRegistryReadOnlyClient, "hasIpAttachedLicenseTerms") + .resolves(true); sinon - .stub(ipAssetClient.spgClient, "registerIpAndMakeDerivative") - .resolves("0x129f7dd802200f096221dd89d5b086e4bd3ad6eafb378a0c75e3b04fc375f997"); + .stub(ipAssetClient.spgClient, "registerIpAndMakeDerivative") + .resolves("0x129f7dd802200f096221dd89d5b086e4bd3ad6eafb378a0c75e3b04fc375f997"); sinon.stub(ipAssetClient.ipAssetRegistryClient, "parseTxIpRegisteredEvent").returns([ { ipId: "0x1daAE3197Bc469Cb97B917aa460a12dD95c6627c", @@ -837,7 +853,7 @@ describe("Test IpAssetClient", () => { licenseTermsIds: ["1"], licenseTemplate: "0x1daAE3197Bc469Cb97B917aa460a12dD95c6627c", }, - metadata: { + ipMetadata: { metadataURI: "https://", nftMetadataHash: toHex("nftMetadata", { size: 32 }), }, @@ -859,14 +875,16 @@ describe("Test IpAssetClient", () => { try { await ipAssetClient.registerIpAndAttachPilTerms({ - nftContract: "0x1daAE3197Bc469Cb97B917aa460a12dD95c6627c", + nftContract, tokenId: "3", - metadata: { + ipMetadata: { metadataURI: "https://", metadataHash: toHex("metadata", { size: 32 }), nftMetadataHash: toHex("nftMetadata", { size: 32 }), }, - pilType: 0, + pilType: PIL_TYPE.COMMERCIAL_USE, + mintingFee: "1", + currency: zeroAddress, }); } catch (err) { expect((err as Error).message).equal( @@ -877,7 +895,7 @@ describe("Test IpAssetClient", () => { it("should throw PIL_TYPE error when registerIpAndAttachPilTerms given PIL_TYPE is not match", async () => { try { await ipAssetClient.registerIpAndAttachPilTerms({ - nftContract: "0x1daAE3197Bc469Cb97B917aa460a12dD95c6627c", + nftContract, tokenId: "3", } as unknown as RegisterIpAndAttachPilTermsRequest); } catch (err) { @@ -895,15 +913,17 @@ describe("Test IpAssetClient", () => { sinon.stub(ipAssetClient.ipAssetRegistryClient, "isRegistered").resolves(false); await ipAssetClient.registerIpAndAttachPilTerms({ - nftContract: "0x1daAE3197Bc469Cb97B917aa460a12dD95c6627c", + nftContract, tokenId: "3", - metadata: { + ipMetadata: { metadataHash: toHex(0, { size: 32 }), metadataURI: "", }, - pilType: 0, + pilType: PIL_TYPE.COMMERCIAL_USE, + mintingFee: "1", + currency: zeroAddress, }); - expect(stub.args[0][0].metadata).to.deep.equal({ + expect(stub.args[0][0].ipMetadata).to.deep.equal({ metadataURI: "", metadataHash: toHex(0, { size: 32 }), nftMetadataHash: toHex(0, { size: 32 }), @@ -918,12 +938,14 @@ describe("Test IpAssetClient", () => { sinon.stub(ipAssetClient.ipAssetRegistryClient, "isRegistered").resolves(false); const result = await ipAssetClient.registerIpAndAttachPilTerms({ - nftContract: "0x1daAE3197Bc469Cb97B917aa460a12dD95c6627c", + nftContract, tokenId: "3", - metadata: { + ipMetadata: { metadataHash: toHex(0, { size: 32 }), }, - pilType: 0, + pilType: PIL_TYPE.COMMERCIAL_USE, + mintingFee: "1", + currency: zeroAddress, }); expect(result.txHash).to.equal(hash); @@ -946,12 +968,14 @@ describe("Test IpAssetClient", () => { }, ]); const result = await ipAssetClient.registerIpAndAttachPilTerms({ - nftContract: "0x1daAE3197Bc469Cb97B917aa460a12dD95c662ac", + nftContract, tokenId: "3", - metadata: { + ipMetadata: { metadataURI: "https://", }, - pilType: 0, + pilType: PIL_TYPE.COMMERCIAL_USE, + mintingFee: 1, + currency: zeroAddress, txOptions: { waitForTransaction: true, }, @@ -964,8 +988,8 @@ describe("Test IpAssetClient", () => { it("should return encoded tx data when registerIpAndAttachPilTerms given correct args and encodedTxDataOnly of true", async () => { const hash = "0x129f7dd802200f096221dd89d5b086e4bd3ad6eafb378a0c75e3b04fc375f997"; sinon - .stub(ipAssetClient.ipAssetRegistryClient, "ipId") - .resolves("0x1daAE3197Bc469Cb97B917aa460a12dD95c6627c"); + .stub(ipAssetClient.ipAssetRegistryClient, "ipId") + .resolves("0x1daAE3197Bc469Cb97B917aa460a12dD95c6627c"); sinon.stub(ipAssetClient.ipAssetRegistryClient, "isRegistered").resolves(false); sinon.stub(ipAssetClient.spgClient, "registerIpAndAttachPilTerms").resolves(hash); @@ -980,10 +1004,12 @@ describe("Test IpAssetClient", () => { const result = await ipAssetClient.registerIpAndAttachPilTerms({ nftContract: "0x1daAE3197Bc469Cb97B917aa460a12dD95c662ac", tokenId: "3", - metadata: { + ipMetadata: { metadataURI: "https://", }, pilType: 0, + mintingFee: 1, + currency: zeroAddress, txOptions: { encodedTxDataOnly: true, }, diff --git a/packages/core-sdk/test/unit/resources/license.test.ts b/packages/core-sdk/test/unit/resources/license.test.ts index 5d6edb6d..5a850e53 100644 --- a/packages/core-sdk/test/unit/resources/license.test.ts +++ b/packages/core-sdk/test/unit/resources/license.test.ts @@ -34,7 +34,6 @@ describe("Test LicenseClient", () => { afterEach(() => { sinon.restore(); }); - describe("Test licenseClient.registerNonComSocialRemixingPIL", async () => { it("should return licenseTermsId when call registerNonComSocialRemixingPIL given licenseTermsId is registered", async () => { sinon @@ -56,7 +55,6 @@ describe("Test LicenseClient", () => { expect(result.txHash).to.equal(txHash); }); - it("should return txhash when call registerNonComSocialRemixingPIL given licenseTermsId is not registered and waitForTransaction of true", async () => { sinon .stub(licenseClient.licenseTemplateClient, "getLicenseTermsId") @@ -81,7 +79,6 @@ describe("Test LicenseClient", () => { expect(result.txHash).to.equal(txHash); expect(result.licenseTermsId).to.equal(1n); }); - it("should return throw error when call registerNonComSocialRemixingPIL given request fail", async () => { sinon .stub(licenseClient.licenseTemplateClient, "getLicenseTermsId") @@ -536,19 +533,19 @@ describe("Test LicenseClient", () => { terms: { transferable: true, royaltyPolicy: zeroAddress, - mintingFee: BigInt(1), + defaultMintingFee: BigInt(1), expiration: BigInt(1), commercialUse: true, commercialAttribution: true, commercializerChecker: zeroAddress, commercializerCheckerData: zeroAddress, commercialRevShare: 100, - commercialRevCelling: BigInt(1), + commercialRevCeiling: BigInt(1), derivativesAllowed: true, derivativesAttribution: true, derivativesApproval: true, derivativesReciprocal: true, - derivativeRevCelling: BigInt(1), + derivativeRevCeiling: BigInt(1), currency: zeroAddress, uri: "string", }, diff --git a/packages/core-sdk/test/unit/resources/permission.test.ts b/packages/core-sdk/test/unit/resources/permission.test.ts index 7b482ff3..86d714dd 100644 --- a/packages/core-sdk/test/unit/resources/permission.test.ts +++ b/packages/core-sdk/test/unit/resources/permission.test.ts @@ -20,11 +20,10 @@ describe("Test Permission", () => { walletMock.signTypedData = sinon .stub() .resolves("0x129f7dd802200f096221dd89d5b086e4bd3ad6eafb378a0c75e3b04fc375f997"); - permissionClient = new PermissionClient(rpcMock, walletMock, "sepolia"); - IpAccountImplClient.prototype.state = sinon.stub().resolves(1n); - walletMock.account.signTypedData = sinon + permissionClient = new PermissionClient(rpcMock, walletMock, "iliad"); + IpAccountImplClient.prototype.state = sinon .stub() - .resolves("0x129f7dd802200f096221dd89d5b086e4bd3ad6eafb378a0c75e3b04fc375f997"); + .resolves({ result: "0x2e778894d11b5308e4153f094e190496c1e0609652c19f8b87e5176484b9a56e" }); (permissionClient.accessControllerClient as any).address = "0x1daAE3197Bc469Cb97B917aa460a12dD95c6627c"; }); @@ -188,10 +187,12 @@ describe("Test Permission", () => { } }); - it("should account error when call createSetPermissionSignature given wallet has no signTypedData method", async () => { + it("should wallet error when call createSetPermissionSignature given wallet has no signTypedData method", async () => { walletMock = createMock(); - permissionClient = new PermissionClient(rpcMock, walletMock, "11155111"); + permissionClient = new PermissionClient(rpcMock, walletMock, "1513"); sinon.stub(permissionClient.ipAssetRegistryClient, "isRegistered").resolves(true); + (permissionClient.accessControllerClient as any).address = + "0x1daAE3197Bc469Cb97B917aa460a12dD95c6627c"; try { await permissionClient.createSetPermissionSignature({ diff --git a/packages/core-sdk/test/unit/resources/royalty.test.ts b/packages/core-sdk/test/unit/resources/royalty.test.ts index bcb960e4..274d5f91 100644 --- a/packages/core-sdk/test/unit/resources/royalty.test.ts +++ b/packages/core-sdk/test/unit/resources/royalty.test.ts @@ -85,9 +85,7 @@ describe("Test RoyaltyClient", () => { it("should throw royaltyVaultAddress error when call collectRoyaltyTokens given royalty vault address is 0x", async () => { sinon.stub(royaltyClient.ipAssetRegistryClient, "isRegistered").resolves(true); - sinon - .stub(royaltyClient.royaltyPolicyLapClient, "getRoyaltyData") - .resolves([true, "0x", 1, ["0x73fcb515cee99e4991465ef586cfe2b072ebb512"], [1]]); + sinon.stub(royaltyClient.royaltyPolicyLapClient, "getRoyaltyData").resolves([true, "0x", 1]); try { await royaltyClient.collectRoyaltyTokens({ @@ -105,13 +103,7 @@ describe("Test RoyaltyClient", () => { sinon.stub(royaltyClient.ipAssetRegistryClient, "isRegistered").resolves(true); sinon .stub(royaltyClient.royaltyPolicyLapClient, "getRoyaltyData") - .resolves([ - true, - "0x73fcb515cee99e4991465ef586cfe2b072ebb512", - 1, - ["0x73fcb515cee99e4991465ef586cfe2b072ebb512"], - [1], - ]); + .resolves([true, "0x73fcb515cee99e4991465ef586cfe2b072ebb512", 1]); sinon.stub(IpRoyaltyVaultImplClient.prototype, "collectRoyaltyTokens").resolves(txHash); const result = await royaltyClient.collectRoyaltyTokens({ @@ -126,13 +118,7 @@ describe("Test RoyaltyClient", () => { sinon.stub(royaltyClient.ipAssetRegistryClient, "isRegistered").resolves(true); sinon .stub(royaltyClient.royaltyPolicyLapClient, "getRoyaltyData") - .resolves([ - true, - "0x73fcb515cee99e4991465ef586cfe2b072ebb512", - 1, - ["0x73fcb515cee99e4991465ef586cfe2b072ebb512"], - [1], - ]); + .resolves([true, "0x73fcb515cee99e4991465ef586cfe2b072ebb512", 1]); sinon.stub(IpRoyaltyVaultImplClient.prototype, "collectRoyaltyTokens").resolves(txHash); sinon.stub(IpRoyaltyVaultImplClient.prototype, "parseTxRoyaltyTokensCollectedEvent").returns([ { @@ -241,10 +227,7 @@ describe("Test RoyaltyClient", () => { it("should throw royaltyVaultAddress error when call claimableRevenue given royalty vault address is 0x", async () => { sinon.stub(royaltyClient.ipAssetRegistryClient, "isRegistered").resolves(true); - sinon - .stub(royaltyClient.royaltyPolicyLapClient, "getRoyaltyData") - .resolves([true, "0x", 1, ["0x73fcb515cee99e4991465ef586cfe2b072ebb512"], [1]]); - + sinon.stub(royaltyClient.royaltyPolicyLapClient, "getRoyaltyData").resolves([true, "0x", 1]); try { await royaltyClient.claimableRevenue({ royaltyVaultIpId: "0x73fcb515cee99e4991465ef586cfe2b072ebb512", @@ -263,13 +246,7 @@ describe("Test RoyaltyClient", () => { sinon.stub(royaltyClient.ipAssetRegistryClient, "isRegistered").resolves(true); sinon .stub(royaltyClient.royaltyPolicyLapClient, "getRoyaltyData") - .resolves([ - true, - "0x73fcb515cee99e4991465ef586cfe2b072ebb512", - 1, - ["0x73fcb515cee99e4991465ef586cfe2b072ebb512"], - [1], - ]); + .resolves([true, "0x73fcb515cee99e4991465ef586cfe2b072ebb512", 1]); sinon.stub(IpRoyaltyVaultImplClient.prototype, "claimableRevenue").resolves(1); const result = await royaltyClient.claimableRevenue({ @@ -304,8 +281,7 @@ describe("Test RoyaltyClient", () => { sinon.stub(royaltyClient.ipAssetRegistryClient, "isRegistered").resolves(true); sinon .stub(royaltyClient.royaltyPolicyLapClient, "getRoyaltyData") - .resolves([true, "0x", 1, ["0x73fcb515cee99e4991465ef586cfe2b072ebb512"], [1]]); - + .resolves([true, "0x73fcb515cee99e4991465ef586cfe2b072ebb512", 1]); try { await royaltyClient.claimRevenue({ account: "0x73fcb515cee99e4991465ef586cfe2b072ebb512", @@ -324,13 +300,7 @@ describe("Test RoyaltyClient", () => { sinon.stub(royaltyClient.ipAssetRegistryClient, "isRegistered").resolves(true); sinon .stub(royaltyClient.royaltyPolicyLapClient, "getRoyaltyData") - .resolves([ - true, - "0x73fcb515cee99e4991465ef586cfe2b072ebb512", - 1, - ["0x73fcb515cee99e4991465ef586cfe2b072ebb512"], - [1], - ]); + .resolves([true, "0x73fcb515cee99e4991465ef586cfe2b072ebb512", 1]); sinon.stub(royaltyClient.ipAccountClient, "execute").resolves({ txHash }); const result = await royaltyClient.claimRevenue({ account: "0x73fcb515cee99e4991465ef586cfe2b072ebb512", @@ -345,13 +315,7 @@ describe("Test RoyaltyClient", () => { sinon.stub(royaltyClient.ipAssetRegistryClient, "isRegistered").resolves(true); sinon .stub(royaltyClient.royaltyPolicyLapClient, "getRoyaltyData") - .resolves([ - true, - "0x73fcb515cee99e4991465ef586cfe2b072ebb512", - 1, - ["0x73fcb515cee99e4991465ef586cfe2b072ebb512"], - [1], - ]); + .resolves([true, "0x73fcb515cee99e4991465ef586cfe2b072ebb512", 1]); sinon .stub(IpRoyaltyVaultImplClient.prototype, "claimRevenueBySnapshotBatch") .resolves(txHash); @@ -380,13 +344,7 @@ describe("Test RoyaltyClient", () => { sinon.stub(royaltyClient.ipAssetRegistryClient, "isRegistered").resolves(true); sinon .stub(royaltyClient.royaltyPolicyLapClient, "getRoyaltyData") - .resolves([ - true, - "0x73fcb515cee99e4991465ef586cfe2b072ebb512", - 1, - ["0x73fcb515cee99e4991465ef586cfe2b072ebb512"], - [1], - ]); + .resolves([true, "0x73fcb515cee99e4991465ef586cfe2b072ebb512", 1]); sinon .stub(IpRoyaltyVaultImplClient.prototype, "claimRevenueBySnapshotBatch") .resolves(txHash); @@ -428,10 +386,7 @@ describe("Test RoyaltyClient", () => { it("should throw royaltyVaultAddress error when call snapshot given royalty vault address is 0x", async () => { sinon.stub(royaltyClient.ipAssetRegistryClient, "isRegistered").resolves(true); - sinon - .stub(royaltyClient.royaltyPolicyLapClient, "getRoyaltyData") - .resolves([true, "0x", 1, ["0x73fcb515cee99e4991465ef586cfe2b072ebb512"], [1]]); - + sinon.stub(royaltyClient.royaltyPolicyLapClient, "getRoyaltyData").resolves([true, "0x", 1]); try { await royaltyClient.snapshot({ royaltyVaultIpId: "0x73fcb515cee99e4991465ef586cfe2b072ebb512", @@ -447,13 +402,7 @@ describe("Test RoyaltyClient", () => { sinon.stub(royaltyClient.ipAssetRegistryClient, "isRegistered").resolves(true); sinon .stub(royaltyClient.royaltyPolicyLapClient, "getRoyaltyData") - .resolves([ - true, - "0x73fcb515cee99e4991465ef586cfe2b072ebb512", - 1, - ["0x73fcb515cee99e4991465ef586cfe2b072ebb512"], - [1], - ]); + .resolves([true, "0x73fcb515cee99e4991465ef586cfe2b072ebb512", 1]); sinon.stub(IpRoyaltyVaultImplClient.prototype, "snapshot").resolves(txHash); const result = await royaltyClient.snapshot({ @@ -466,13 +415,7 @@ describe("Test RoyaltyClient", () => { sinon.stub(royaltyClient.ipAssetRegistryClient, "isRegistered").resolves(true); sinon .stub(royaltyClient.royaltyPolicyLapClient, "getRoyaltyData") - .resolves([ - true, - "0x73fcb515cee99e4991465ef586cfe2b072ebb512", - 1, - ["0x73fcb515cee99e4991465ef586cfe2b072ebb512"], - [1], - ]); + .resolves([true, "0x73fcb515cee99e4991465ef586cfe2b072ebb512", 1]); sinon.stub(IpRoyaltyVaultImplClient.prototype, "snapshot").resolves(txHash); sinon.stub(IpRoyaltyVaultImplClient.prototype, "parseTxSnapshotCompletedEvent").returns([ { diff --git a/packages/core-sdk/test/unit/utils/getLicenseTermsByType.test.ts b/packages/core-sdk/test/unit/utils/getLicenseTermsByType.test.ts index 465327b2..cc24004e 100644 --- a/packages/core-sdk/test/unit/utils/getLicenseTermsByType.test.ts +++ b/packages/core-sdk/test/unit/utils/getLicenseTermsByType.test.ts @@ -9,19 +9,19 @@ describe("Get License Terms By Type", () => { expect(result).to.deep.include({ transferable: true, commercialAttribution: false, - commercialRevCelling: 0n, + commercialRevCeiling: 0n, commercialRevShare: 0, commercialUse: false, commercializerChecker: "0x0000000000000000000000000000000000000000", commercializerCheckerData: "0x0000000000000000000000000000000000000000", currency: "0x0000000000000000000000000000000000000000", - derivativeRevCelling: 0n, + derivativeRevCeiling: 0n, derivativesAllowed: true, derivativesApproval: false, derivativesAttribution: true, derivativesReciprocal: true, expiration: 0n, - mintingFee: 0n, + defaultMintingFee: 0n, royaltyPolicy: "0x0000000000000000000000000000000000000000", uri: "", }); @@ -47,7 +47,7 @@ describe("Get License Terms By Type", () => { expect(() => getLicenseTermByType(PIL_TYPE.COMMERCIAL_USE, { royaltyPolicyLAPAddress: zeroAddress, - mintingFee: "1", + defaultMintingFee: "1", }), ).to.throw("mintingFee currency are required for commercial use PIL."); }); @@ -56,7 +56,7 @@ describe("Get License Terms By Type", () => { expect(() => getLicenseTermByType(PIL_TYPE.COMMERCIAL_USE, { royaltyPolicyLAPAddress: "wrong" as Hex, - mintingFee: "1", + defaultMintingFee: "1", currency: zeroAddress, }), ).to.throw(`Address "wrong" is invalid.`); @@ -65,24 +65,24 @@ describe("Get License Terms By Type", () => { it("it should return commercial license terms when call getLicenseTermByType given COMMERCIAL_USE and correct args", async () => { const result = getLicenseTermByType(PIL_TYPE.COMMERCIAL_USE, { royaltyPolicyLAPAddress: zeroAddress, - mintingFee: "1", + defaultMintingFee: "1", currency: zeroAddress, }); expect(result).to.deep.contain({ commercialAttribution: true, - commercialRevCelling: 0n, + commercialRevCeiling: 0n, commercialRevShare: 0, commercialUse: true, commercializerChecker: "0x0000000000000000000000000000000000000000", commercializerCheckerData: "0x0000000000000000000000000000000000000000", currency: "0x0000000000000000000000000000000000000000", - derivativeRevCelling: 0n, + derivativeRevCeiling: 0n, derivativesAllowed: true, derivativesApproval: false, derivativesAttribution: true, derivativesReciprocal: false, expiration: 0n, - mintingFee: 1n, + defaultMintingFee: 1n, royaltyPolicy: "0x0000000000000000000000000000000000000000", transferable: true, uri: "", @@ -113,7 +113,7 @@ describe("Get License Terms By Type", () => { expect(() => getLicenseTermByType(PIL_TYPE.COMMERCIAL_REMIX, { royaltyPolicyLAPAddress: zeroAddress, - mintingFee: "1", + defaultMintingFee: "1", commercialRevShare: 100, }), ).to.throw( @@ -125,7 +125,7 @@ describe("Get License Terms By Type", () => { expect(() => getLicenseTermByType(PIL_TYPE.COMMERCIAL_REMIX, { royaltyPolicyLAPAddress: "wrong" as Hex, - mintingFee: "1", + defaultMintingFee: "1", currency: zeroAddress, commercialRevShare: 100, }), @@ -136,7 +136,7 @@ describe("Get License Terms By Type", () => { expect(() => getLicenseTermByType(PIL_TYPE.COMMERCIAL_REMIX, { royaltyPolicyLAPAddress: "wrong" as Hex, - mintingFee: "1", + defaultMintingFee: "1", currency: zeroAddress, }), ).to.throw( @@ -147,25 +147,25 @@ describe("Get License Terms By Type", () => { it("it should return commercial license terms when call getLicenseTermByType given COMMERCIAL_REMIX and correct args", async () => { const result = getLicenseTermByType(PIL_TYPE.COMMERCIAL_REMIX, { royaltyPolicyLAPAddress: zeroAddress, - mintingFee: "1", + defaultMintingFee: "1", currency: zeroAddress, commercialRevShare: 100, }); expect(result).to.deep.contain({ commercialAttribution: true, - commercialRevCelling: 0n, + commercialRevCeiling: 0n, commercialRevShare: 100000000, commercialUse: true, commercializerChecker: "0x0000000000000000000000000000000000000000", commercializerCheckerData: "0x0000000000000000000000000000000000000000", currency: "0x0000000000000000000000000000000000000000", - derivativeRevCelling: 0n, + derivativeRevCeiling: 0n, derivativesAllowed: true, derivativesApproval: false, derivativesAttribution: true, derivativesReciprocal: true, expiration: 0n, - mintingFee: 1n, + defaultMintingFee: 1n, royaltyPolicy: "0x0000000000000000000000000000000000000000", transferable: true, uri: "", @@ -175,7 +175,7 @@ describe("Get License Terms By Type", () => { expect(() => getLicenseTermByType(PIL_TYPE.COMMERCIAL_REMIX, { royaltyPolicyLAPAddress: zeroAddress, - mintingFee: "1", + defaultMintingFee: "1", currency: zeroAddress, commercialRevShare: -8, }), @@ -186,7 +186,7 @@ describe("Get License Terms By Type", () => { expect(() => getLicenseTermByType(PIL_TYPE.COMMERCIAL_REMIX, { royaltyPolicyLAPAddress: zeroAddress, - mintingFee: "1", + defaultMintingFee: "1", currency: zeroAddress, commercialRevShare: 105, }), @@ -196,7 +196,7 @@ describe("Get License Terms By Type", () => { it("it get commercialRevShare correct value when call getLicenseTermByType given COMMERCIAL_REMIX and commercialRevShare is 10", async () => { const result = getLicenseTermByType(PIL_TYPE.COMMERCIAL_REMIX, { royaltyPolicyLAPAddress: zeroAddress, - mintingFee: "1", + defaultMintingFee: "1", currency: zeroAddress, commercialRevShare: 10, }); diff --git a/packages/core-sdk/test/unit/utils/sign.test.ts b/packages/core-sdk/test/unit/utils/sign.test.ts index 0dc5c2a2..7e2d3030 100644 --- a/packages/core-sdk/test/unit/utils/sign.test.ts +++ b/packages/core-sdk/test/unit/utils/sign.test.ts @@ -2,7 +2,7 @@ import { expect } from "chai"; import { getDeadline, getPermissionSignature } from "../../../src/utils/sign"; import { Hex, WalletClient, createWalletClient, http, zeroAddress } from "viem"; import { privateKeyToAccount } from "viem/accounts"; -import { sepoliaChainId } from "../../integration/utils/util"; +import { storyTestChainId } from "../../integration/utils/util"; import sinon from "sinon"; import { chainStringToViemChain } from "../../../src/utils/utils"; @@ -12,11 +12,11 @@ describe("Sign", () => { try { await getPermissionSignature({ ipId: zeroAddress, - nonce: 1, + state: "0x2e778894d11b5308e4153f094e190496c1e0609652c19f8b87e5176484b9a56e", deadline: 1000n, permissions: [], wallet: {} as WalletClient, - chainId: BigInt(sepoliaChainId), + chainId: BigInt(storyTestChainId), }); } catch (e) { expect((e as Error).message).to.equal( @@ -29,11 +29,11 @@ describe("Sign", () => { try { await getPermissionSignature({ ipId: zeroAddress, - nonce: 1, + state: "0x2e778894d11b5308e4153f094e190496c1e0609652c19f8b87e5176484b9a56e", deadline: 1000n, permissions: [], wallet: { signTypedData: () => Promise.resolve("") } as unknown as WalletClient, - chainId: BigInt(sepoliaChainId), + chainId: BigInt(storyTestChainId), }); } catch (e) { expect((e as Error).message).to.equal( @@ -44,17 +44,17 @@ describe("Sign", () => { it("should return signature when call getPermissionSignature given account support signTypedData", async () => { const walletClient = createWalletClient({ - chain: chainStringToViemChain("sepolia"), + chain: chainStringToViemChain("iliad"), transport: http(), - account: privateKeyToAccount(process.env.SEPOLIA_WALLET_PRIVATE_KEY as Hex), + account: privateKeyToAccount(process.env.WALLET_PRIVATE_KEY as Hex), }); const result = await getPermissionSignature({ ipId: zeroAddress, - nonce: 1, + state: "0x2e778894d11b5308e4153f094e190496c1e0609652c19f8b87e5176484b9a56e", deadline: 1000n, permissions: [{ ipId: zeroAddress, signer: zeroAddress, to: zeroAddress, permission: 0 }], wallet: walletClient, - chainId: BigInt(sepoliaChainId), + chainId: BigInt(storyTestChainId), }); expect(result).is.a("string").and.not.empty; }); diff --git a/packages/core-sdk/test/unit/utils/utils.test.ts b/packages/core-sdk/test/unit/utils/utils.test.ts index 7825a741..bb91d2c3 100644 --- a/packages/core-sdk/test/unit/utils/utils.test.ts +++ b/packages/core-sdk/test/unit/utils/utils.test.ts @@ -1,14 +1,13 @@ import { expect } from "chai"; import sinon from "sinon"; import * as viem from "viem"; -import { sepolia } from "viem/chains"; -import { TypedData } from "../../../src/types/common"; import { SupportedChainIds } from "../../../src/types/config"; import { waitTxAndFilterLog, chainStringToViemChain, waitTx, getAddress, + storyTestChain, } from "../../../src/utils/utils"; import { createMock } from "../testUtils"; import { licensingModuleAbi } from "../../../src/abi/generated"; @@ -153,13 +152,13 @@ describe("Test chainStringToViemChain", () => { } }); - it("should return sepolia if id is 11155111", () => { - const chain = chainStringToViemChain("11155111"); - expect(chain).to.equal(sepolia); + it("should return story testnet if id is 1513", () => { + const chain = chainStringToViemChain("1513"); + expect(chain).to.equal(storyTestChain); }); - it("should return sepolia if id is sepolia", () => { - const chain = chainStringToViemChain("sepolia"); - expect(chain).to.equal(sepolia); + it("should return story testnet if id is iliad", () => { + const chain = chainStringToViemChain("iliad"); + expect(chain).to.equal(storyTestChain); }); }); diff --git a/packages/react-sdk/.env.example b/packages/react-sdk/.env.example index b915d5a4..6115f569 100644 --- a/packages/react-sdk/.env.example +++ b/packages/react-sdk/.env.example @@ -1,2 +1,2 @@ -SEPOLIA_TEST_WALLET_ADDRESS = 0x0000000000000000000000000000000000000000 -SEPOLIA_WALLET_PRIVATE_KEY = 0x0000000000000000000000000000000000000000 \ No newline at end of file +TEST_WALLET_ADDRESS = 0x0000000000000000000000000000000000000000 +WALLET_PRIVATE_KEY = 0x0000000000000000000000000000000000000000 \ No newline at end of file diff --git a/packages/react-sdk/package.json b/packages/react-sdk/package.json index 168ce436..40123706 100644 --- a/packages/react-sdk/package.json +++ b/packages/react-sdk/package.json @@ -14,7 +14,6 @@ "scripts": { "generate": "node ./generator/index.js", "build": "pnpm run fix && preconstruct build", - "test": "jest -i", "fix": "pnpm run format:fix && pnpm run lint:fix", "format": "prettier --check .", "format:fix": "prettier --write .", diff --git a/packages/react-sdk/test/integration/useDispute.test.ts b/packages/react-sdk/test/integration/useDispute.test.ts index 47dedf5f..e7fc4040 100644 --- a/packages/react-sdk/test/integration/useDispute.test.ts +++ b/packages/react-sdk/test/integration/useDispute.test.ts @@ -1,5 +1,6 @@ import { renderHook, act, waitFor } from "@testing-library/react"; import { Address } from "viem"; + import { RaiseDisputeResponse, useDispute } from "../../src"; import { useIpAsset } from "../../src"; import Wrapper from "./utils/Wrapper"; diff --git a/packages/react-sdk/test/integration/useIpAccount.test.ts b/packages/react-sdk/test/integration/useIpAccount.test.ts index c1214358..49afb031 100644 --- a/packages/react-sdk/test/integration/useIpAccount.test.ts +++ b/packages/react-sdk/test/integration/useIpAccount.test.ts @@ -1,4 +1,12 @@ import { renderHook, act } from "@testing-library/react"; +import { + Address, + Hex, + encodeFunctionData, + getAddress, + toFunctionSelector, +} from "viem"; + import { mockERC721Address, getTokenId, walletClient } from "./utils/util"; import { AccessPermission, @@ -7,13 +15,7 @@ import { useIpAsset, } from "../../src"; import Wrapper from "./utils/Wrapper"; -import { - Address, - Hex, - encodeFunctionData, - getAddress, - toFunctionSelector, -} from "viem"; + const coreMetadataModuleAddress = "0xDa498A3f7c8a88cb72201138C366bE3778dB9575"; const permissionAddress = "0xF9936a224b3Deb6f9A4645ccAfa66f7ECe83CF0A"; const accessControllerAbi = [ diff --git a/packages/react-sdk/test/integration/useIpAsset.test.ts b/packages/react-sdk/test/integration/useIpAsset.test.ts index 3d9df668..c45de4e4 100644 --- a/packages/react-sdk/test/integration/useIpAsset.test.ts +++ b/packages/react-sdk/test/integration/useIpAsset.test.ts @@ -1,5 +1,6 @@ import { renderHook, act, waitFor } from "@testing-library/react"; import { Address, toHex } from "viem"; + import { CreateIpAssetWithPilTermsResponse, PIL_TYPE, @@ -10,6 +11,7 @@ import { import { useIpAsset } from "../../src"; import Wrapper from "./utils/Wrapper"; import { mockERC721Address, getTokenId, mockERC20Address } from "./utils/util"; + describe("useIpAsset Functions", () => { const { result: { current: ipAssetHook }, diff --git a/packages/react-sdk/test/integration/useLicense.test.ts b/packages/react-sdk/test/integration/useLicense.test.ts index 06903ade..4e165561 100644 --- a/packages/react-sdk/test/integration/useLicense.test.ts +++ b/packages/react-sdk/test/integration/useLicense.test.ts @@ -1,9 +1,10 @@ import { renderHook } from "@testing-library/react"; +import { Hex } from "viem"; +import { act } from "react"; + import { useIpAsset, useLicense } from "../../src"; import Wrapper from "./utils/Wrapper"; -import { act } from "react"; import { getTokenId, mockERC20Address, mockERC721Address } from "./utils/util"; -import { Hex } from "viem"; describe("useLicense Functions", () => { const { diff --git a/packages/react-sdk/test/integration/usePermission.test.ts b/packages/react-sdk/test/integration/usePermission.test.ts index f02b4422..b84782df 100644 --- a/packages/react-sdk/test/integration/usePermission.test.ts +++ b/packages/react-sdk/test/integration/usePermission.test.ts @@ -1,7 +1,8 @@ import { act, renderHook } from "@testing-library/react"; +import { Address } from "viem"; + import { useIpAsset, usePermission } from "../../src"; import Wrapper from "./utils/Wrapper"; -import { Address } from "viem"; import { getTokenId, mockERC721Address } from "./utils/util"; describe("usePermission Functions", () => { diff --git a/packages/react-sdk/test/integration/useRoyalty.test.ts b/packages/react-sdk/test/integration/useRoyalty.test.ts index 2625f412..237d8b75 100644 --- a/packages/react-sdk/test/integration/useRoyalty.test.ts +++ b/packages/react-sdk/test/integration/useRoyalty.test.ts @@ -1,7 +1,8 @@ -import { act, renderHook, waitFor } from "@testing-library/react"; +import { act, renderHook } from "@testing-library/react"; +import { Address, encodeFunctionData } from "viem"; + import { useIpAccount, useIpAsset, useLicense, useRoyalty } from "../../src"; import Wrapper from "./utils/Wrapper"; -import { Address, encodeFunctionData } from "viem"; import { getTokenId, mockERC20Address, mockERC721Address } from "./utils/util"; describe("useRoyalty Functions", () => { diff --git a/packages/react-sdk/test/integration/utils/Wrapper.tsx b/packages/react-sdk/test/integration/utils/Wrapper.tsx index 2fb69051..b10d8cf7 100644 --- a/packages/react-sdk/test/integration/utils/Wrapper.tsx +++ b/packages/react-sdk/test/integration/utils/Wrapper.tsx @@ -1,15 +1,16 @@ import { Address, http } from "viem"; -import { StoryProvider } from "../../../src"; import { privateKeyToAccount } from "viem/accounts"; import { ReactNode } from "react"; + +import { StoryProvider } from "../../../src"; + type Props = { children: ReactNode }; const Wrapper = ({ children }: Props) => ( {children} diff --git a/packages/react-sdk/test/integration/utils/util.ts b/packages/react-sdk/test/integration/utils/util.ts index aec30725..bcb94f95 100644 --- a/packages/react-sdk/test/integration/utils/util.ts +++ b/packages/react-sdk/test/integration/utils/util.ts @@ -8,9 +8,10 @@ import { Chain, } from "viem"; import { sepolia } from "viem/chains"; - import { SupportedChainIds } from "@story-protocol/core-sdk"; -export const RPC = "http://127.0.0.1:8545"; + +export const RPC = "https://rpc.partner.testnet.storyprotocol.net"; +// export const RPC = "http://127.0.0.1:8545"; export const mockERC721Address = "0x7ee32b8B515dEE0Ba2F25f612A04a731eEc24F49"; export const mockERC20Address = "0xB132A6B7AE652c974EE1557A3521D53d18F6739f"; @@ -30,7 +31,8 @@ const baseConfig = { export const publicClient = createPublicClient(baseConfig); export const walletClient = createWalletClient({ ...baseConfig, - account: privateKeyToAccount(process.env.SEPOLIA_WALLET_PRIVATE_KEY as Hex), + // eslint-disable-next-line turbo/no-undeclared-env-vars + account: privateKeyToAccount(process.env.WALLET_PRIVATE_KEY as Hex), }); export const getTokenId = async ( @@ -50,7 +52,8 @@ export const getTokenId = async ( ], address: nftContract || mockERC721Address, functionName: "mint", - args: [process.env.SEPOLIA_TEST_WALLET_ADDRESS as Hex], + // eslint-disable-next-line turbo/no-undeclared-env-vars + args: [process.env.WALLET_PRIVATE_KEY as Hex], account: walletClient.account, }); const hash = await walletClient.writeContract(request); diff --git a/packages/wagmi-generator/.env.example b/packages/wagmi-generator/.env.example deleted file mode 100644 index f6943cb2..00000000 --- a/packages/wagmi-generator/.env.example +++ /dev/null @@ -1 +0,0 @@ -API_KEY=000000000000000000000000000000000 \ No newline at end of file diff --git a/packages/wagmi-generator/package.json b/packages/wagmi-generator/package.json index 13e9927c..bf8c8d74 100644 --- a/packages/wagmi-generator/package.json +++ b/packages/wagmi-generator/package.json @@ -6,14 +6,14 @@ }, "devDependencies": { "@types/node": "^20.8.2", - "@wagmi/cli": "0.0.0-canary-20240313013119", + "@wagmi/cli": "^2.1.15", "@wagmi/connectors": "^4.1.14", "@wagmi/core": "^2.6.5", "abitype": "^1.0.2", "change-case": "^5.4.3", + "dotenv": "^16.3.1", "typescript": "^5.4.2", "viem": "^2.8.6", - "wagmi": "^2.5.7", - "dotenv": "^16.3.1" + "wagmi": "^2.5.7" } -} \ No newline at end of file +} diff --git a/packages/wagmi-generator/sdk.ts b/packages/wagmi-generator/sdk.ts index cd260d92..9a1c0319 100644 --- a/packages/wagmi-generator/sdk.ts +++ b/packages/wagmi-generator/sdk.ts @@ -1,537 +1,623 @@ -import {Evaluate} from "@wagmi/core/internal"; -import {Plugin} from "@wagmi/cli/dist/types/config"; -import {RequiredBy} from "viem/_types/types/utils"; -import {Contract} from "@wagmi/cli/src/config"; -import {pascalCase, camelCase} from 'change-case' -import {AbiFunction, AbiEvent, AbiParameter} from "abitype"; +import { Evaluate } from "@wagmi/core/internal"; +import { Plugin } from "@wagmi/cli/dist/types/config"; +import { RequiredBy } from "viem/_types/types/utils"; +import { Contract } from "@wagmi/cli/src/config"; +import { pascalCase, camelCase } from "change-case"; +import { AbiFunction, AbiEvent, AbiParameter } from "abitype"; export type SDKConfig = { - permissionLessSDK?: boolean - whiteList?: Record> -} + permissionLessSDK?: boolean; + whiteList?: Record>; +}; -type SDKResult = Evaluate> +type SDKResult = Evaluate>; type RunConfig = { - contracts: Array - isTypeScript: boolean, -} + contracts: Array; + isTypeScript: boolean; +}; const primitiveNeedImportMap: Record = { - Address: true, - Hex: true, -} + Address: true, + Hex: true, +}; const primitiveTypeMap = { - uint8: 'number', - uint32: 'number', - uint64: 'bigint', - uint256: 'bigint', - address: 'Address', - bytes32: 'Hex', - bytes4: 'Hex', - bytes: 'Hex', - bool: 'boolean', - string: 'string', -} - -let importUsedMap: Record> = {} + uint8: "number", + uint32: "number", + uint64: "bigint", + uint256: "bigint", + address: "Address", + bytes32: "Hex", + bytes4: "Hex", + bytes: "Hex", + bool: "boolean", + string: "string", +}; + +let importUsedMap: Record> = {}; function addImport(from: string, ...names: Array) { - if (!(from in importUsedMap)) { - importUsedMap[from] = {} - } + if (!(from in importUsedMap)) { + importUsedMap[from] = {}; + } - names.forEach(it => importUsedMap[from][it] = true) + names.forEach((it) => (importUsedMap[from][it] = true)); } function buildImport(): string { - let imports: Array = [] - for (let from in importUsedMap) { - imports.push(`import {${Object.keys(importUsedMap[from]).join(', ')}} from "${from}";`) - } - return imports.join('\n') + let imports: Array = []; + for (let from in importUsedMap) { + imports.push( + `import {${Object.keys(importUsedMap[from]).join(", ")}} from "${from}";` + ); + } + return imports.join("\n"); } function isAbiFuncOnlyRead(func: AbiFunction): boolean { - return func.stateMutability == "view" || func.stateMutability == "pure" + return func.stateMutability == "view" || func.stateMutability == "pure"; } function parameterToPrimitiveType(type: string): string { - if (type.endsWith("[]")) { - return `readonly ${parameterToPrimitiveType(type.substring(0, type.length - 2))}[]` - } else if (type in primitiveTypeMap) { - if (primitiveNeedImportMap[primitiveTypeMap[type]]) { - addImport("viem", primitiveTypeMap[type]) - } - - return primitiveTypeMap[type] - } else { - addImport("abitype", 'AbiTypeToPrimitiveType') - return `AbiTypeToPrimitiveType<'${type}'>` + if (type.endsWith("[]")) { + return `readonly ${parameterToPrimitiveType( + type.substring(0, type.length - 2) + )}[]`; + } else if (type in primitiveTypeMap) { + if (primitiveNeedImportMap[primitiveTypeMap[type]]) { + addImport("viem", primitiveTypeMap[type]); } -} -function parameterToType(type: AbiParameter, optional: boolean = false): string { - let optionalAppend = "" - if (optional) optionalAppend = " | undefined" - if ('components' in type && type.components) { - if (type.type == "tuple" || type.type == "tuple[]") { - let tupleType = generateContractTypes("", type.components, optional); - if (tupleType.valid) { - if (type.type == "tuple[]") tupleType.type += "[]" - return tupleType.type + optionalAppend - } - } + return primitiveTypeMap[type]; + } else { + addImport("abitype", "AbiTypeToPrimitiveType"); + return `AbiTypeToPrimitiveType<'${type}'>`; + } +} - addImport("abitype", 'AbiParameterToPrimitiveType') - return `AbiParameterToPrimitiveType<${JSON.stringify(type)}>` + optionalAppend - } else { - return parameterToPrimitiveType(type.type) + optionalAppend +function parameterToType( + type: AbiParameter, + optional: boolean = false +): string { + let optionalAppend = ""; + if (optional) optionalAppend = " | undefined"; + if ("components" in type && type.components) { + if (type.type == "tuple" || type.type == "tuple[]") { + let tupleType = generateContractTypes("", type.components, optional); + if (tupleType.valid) { + if (type.type == "tuple[]") tupleType.type += "[]"; + return tupleType.type + optionalAppend; + } } -} -function generateContractTypes(name: string, params: readonly AbiParameter[], optional: boolean = false) { - if (!params.length) return {valid: false} + addImport("abitype", "AbiParameterToPrimitiveType"); + return ( + `AbiParameterToPrimitiveType<${JSON.stringify(type)}>` + optionalAppend + ); + } else { + return parameterToPrimitiveType(type.type) + optionalAppend; + } +} - let comment: Array = ['\n/**']; - const typePrefix = name !== "" ? `export type ${name} =` : "" - const allHasName = params.filter(it => !it.name).length == 0 - if (name != "") { - comment.push(`* ${name}`) - comment.push(`*`) +function generateContractTypes( + name: string, + params: readonly AbiParameter[], + optional: boolean = false +) { + if (!params.length) return { valid: false }; + + let comment: Array = ["\n/**"]; + const typePrefix = name !== "" ? `export type ${name} =` : ""; + const allHasName = params.filter((it) => !it.name).length == 0; + if (name != "") { + comment.push(`* ${name}`); + comment.push(`*`); + } + + if (allHasName) { + let type: Array = []; + let args: Array = []; + type.push(`${typePrefix} {`); + for (let i = 0; i < params.length; i++) { + if (optional) { + comment.push(`* @param ${params[i].name} ${params[i].type} (optional)`); + type.push(` ${params[i].name}?: ${parameterToType(params[i])};`); + } else { + comment.push(`* @param ${params[i].name} ${params[i].type}`); + type.push(` ${params[i].name}: ${parameterToType(params[i])};`); + } + args.push(` request.${params[i].name},`); } + type.push(`}`); + comment.push(`*/`); - if (allHasName) { - let type: Array = []; - let args: Array = []; - type.push(`${typePrefix} {`) - for (let i = 0; i < params.length; i++) { - if (optional) { - comment.push(`* @param ${params[i].name} ${params[i].type} (optional)`) - type.push(` ${params[i].name}?: ${parameterToType(params[i])};`) - } else { - comment.push(`* @param ${params[i].name} ${params[i].type}`) - type.push(` ${params[i].name}: ${parameterToType(params[i])};`) - } - args.push(` request.${params[i].name},`) - } - type.push(`}`) - comment.push(`*/`) - - return { - valid: true, - comment: comment.join("\n"), - type: type.join("\n"), - args: args.join("\n"), - kind: "object", - }; - } else { - if (params.length == 1) { - return { - valid: true, - comment: "", - type: `${typePrefix} ${parameterToType(params[0], optional)}`, - args: "request", - kind: "alone" - } - } + return { + valid: true, + comment: comment.join("\n"), + type: type.join("\n"), + args: args.join("\n"), + kind: "object", + }; + } else { + if (params.length == 1) { + return { + valid: true, + comment: "", + type: `${typePrefix} ${parameterToType(params[0], optional)}`, + args: "request", + kind: "alone", + }; + } - let type: Array = []; - let args: Array = []; - type.push(`${typePrefix} readonly [`) - for (let i = 0; i < params.length; i++) { - comment.push(`* @param ${i} ${params[i].type}`) - type.push(`${parameterToType(params[i], optional)},`) - args.push(`request[${i}]`) - } - type.push(`]`) - comment.push(`*/`) - - return { - valid: true, - comment: comment.join("\n"), - type: type.join(""), - args: args.join(","), - kind: "array", - }; + let type: Array = []; + let args: Array = []; + type.push(`${typePrefix} readonly [`); + for (let i = 0; i < params.length; i++) { + comment.push(`* @param ${i} ${params[i].type}`); + type.push(`${parameterToType(params[i], optional)},`); + args.push(`request[${i}]`); } + type.push(`]`); + comment.push(`*/`); + + return { + valid: true, + comment: comment.join("\n"), + type: type.join(""), + args: args.join(","), + kind: "array", + }; + } } function generateContractFunction(contractName: string, func: AbiFunction) { - const abiName = `${camelCase(contractName)}Abi` - const indexFuncName = ('index' in func) ? `${func.name}${func.index}` : func.name - const inName = `${pascalCase(contractName)}${pascalCase(indexFuncName)}Request` - let outName = `${pascalCase(contractName)}${pascalCase(indexFuncName)}Response` - const inType = generateContractTypes(inName, func.inputs) - const outType = generateContractTypes(outName, func.outputs) - const inParams = inType.valid ? `request: ${inName}` : `` - let method = 'readContract' - - let funcLine: Array = []; - let types: Array = []; - - if (inType.valid) types.push(`${inType.comment}\n${inType.type}`) - - if (!isAbiFuncOnlyRead(func)) { - addImport('viem', 'WriteContractReturnType') - - method = 'simulateContract'; - outType.valid = true - outName = "WriteContractReturnType" - } else if (outType.valid) types.push(`${outType.comment}\n${outType.type}`) - - funcLine.push(``) - if (outType.valid) { - funcLine.push(`/**`) - funcLine.push(` * method ${func.name} for contract ${contractName}`) - funcLine.push(` *`) - funcLine.push(` * @param request ${inName}`) - funcLine.push(` * @return Promise<${outName}>`) - funcLine.push(`*/`) - funcLine.push(` public async ${camelCase(indexFuncName)}(${inParams}): Promise<${outName}> {`) - if (method == "simulateContract") { - funcLine.push(` const { request: call } = await this.rpcClient.${method}({`) - } else if (outType.kind == "object") { - funcLine.push(` const result = await this.rpcClient.${method}({`) - } else { - funcLine.push(` return await this.rpcClient.${method}({`) - } + const abiName = `${camelCase(contractName)}Abi`; + const indexFuncName = + "index" in func ? `${func.name}${func.index}` : func.name; + const inName = `${pascalCase(contractName)}${pascalCase( + indexFuncName + )}Request`; + let outName = `${pascalCase(contractName)}${pascalCase( + indexFuncName + )}Response`; + const inType = generateContractTypes(inName, func.inputs); + const outType = generateContractTypes(outName, func.outputs); + const inParams = inType.valid ? `request: ${inName}` : ``; + let method = "readContract"; + + let funcLine: Array = []; + let types: Array = []; + + if (inType.valid) types.push(`${inType.comment}\n${inType.type}`); + + if (!isAbiFuncOnlyRead(func)) { + addImport("viem", "WriteContractReturnType"); + + method = "simulateContract"; + outType.valid = true; + outName = "WriteContractReturnType"; + } else if (outType.valid) types.push(`${outType.comment}\n${outType.type}`); + + funcLine.push(``); + if (outType.valid) { + funcLine.push(`/**`); + funcLine.push(` * method ${func.name} for contract ${contractName}`); + funcLine.push(` *`); + funcLine.push(` * @param request ${inName}`); + funcLine.push(` * @return Promise<${outName}>`); + funcLine.push(`*/`); + funcLine.push( + ` public async ${camelCase( + indexFuncName + )}(${inParams}): Promise<${outName}> {` + ); + if (method == "simulateContract") { + funcLine.push( + ` const { request: call } = await this.rpcClient.${method}({` + ); + } else if (outType.kind == "object") { + funcLine.push(` const result = await this.rpcClient.${method}({`); } else { - funcLine.push(`/**`) - funcLine.push(` * method ${func.name} for contract ${contractName}`) - funcLine.push(` *`) - funcLine.push(` * @param request ${inName}`) - funcLine.push(` * @return Promise`) - funcLine.push(`*/`) - funcLine.push(` public async ${camelCase(indexFuncName)}(${inParams}): Promise {`) - funcLine.push(` await this.rpcClient.${method}({`) - } - funcLine.push(` abi: ${abiName},`) - funcLine.push(` address: this.address,`) - funcLine.push(` functionName: "${func.name}",`) - if (!isAbiFuncOnlyRead(func)) { - funcLine.push(` account: this.wallet.account,`) + funcLine.push(` return await this.rpcClient.${method}({`); } - if (inType.valid) { - funcLine.push(` args: [`) - funcLine.push(inType.args) - funcLine.push(` ],`) - } - funcLine.push(` });`) - if (method == "simulateContract") { - funcLine.push(` return await this.wallet.writeContract(call as WriteContractParameters);`) - } else if (outType.valid && outType.kind == "object") { - funcLine.push(` return {`) - if (func.outputs.length == 1) { - func.outputs.forEach(it => - funcLine.push(` ${it.name}: result,`) - ) - } else { - func.outputs.forEach((it, i) => - funcLine.push(` ${it.name}: result[${i}],`) - ) - } - funcLine.push(` };`) + } else { + funcLine.push(`/**`); + funcLine.push(` * method ${func.name} for contract ${contractName}`); + funcLine.push(` *`); + funcLine.push(` * @param request ${inName}`); + funcLine.push(` * @return Promise`); + funcLine.push(`*/`); + funcLine.push( + ` public async ${camelCase(indexFuncName)}(${inParams}): Promise {` + ); + funcLine.push(` await this.rpcClient.${method}({`); + } + funcLine.push(` abi: ${abiName},`); + funcLine.push(` address: this.address,`); + funcLine.push(` functionName: "${func.name}",`); + if (!isAbiFuncOnlyRead(func)) { + funcLine.push(` account: this.wallet.account,`); + } + if (inType.valid) { + funcLine.push(` args: [`); + funcLine.push(inType.args); + funcLine.push(` ],`); + } + funcLine.push(` });`); + if (method == "simulateContract") { + funcLine.push( + ` return await this.wallet.writeContract(call as WriteContractParameters);` + ); + } else if (outType.valid && outType.kind == "object") { + funcLine.push(` return {`); + if (func.outputs.length == 1) { + func.outputs.forEach((it) => funcLine.push(` ${it.name}: result,`)); + } else { + func.outputs.forEach((it, i) => + funcLine.push(` ${it.name}: result[${i}],`) + ); } - funcLine.push(` }`) - addImport('viem', 'WriteContractParameters') + funcLine.push(` };`); + } + funcLine.push(` }`); + addImport("viem", "WriteContractParameters"); - return {func: funcLine.join("\n"), types: types.join("\n")} + return { func: funcLine.join("\n"), types: types.join("\n") }; } function generateContractDataFunction(contractName: string, func: AbiFunction) { - const abiName = `${camelCase(contractName)}Abi` - const indexFuncName = ('index' in func) ? `${func.name}${func.index}` : func.name - const inName = `${pascalCase(contractName)}${pascalCase(indexFuncName)}Request` - const inType = generateContractTypes(inName, func.inputs) - const inParams = inType.valid ? `request: ${inName}` : `` - let method = 'readContract' - - let funcLine: Array = []; - let types: Array = []; - - if (inType.valid) types.push(`${inType.comment}\n${inType.type}`) - - addImport('viem', 'encodeFunctionData') - - funcLine.push(``) - funcLine.push(`/**`) - funcLine.push(` * method ${func.name} for contract ${contractName} with only encode`) - funcLine.push(` *`) - funcLine.push(` * @param request ${inName}`) - funcLine.push(` * @return EncodedTxData`) - funcLine.push(`*/`) - funcLine.push(` public ${camelCase(indexFuncName)}Encode(${inParams}): EncodedTxData {`) - funcLine.push(` return {`) - funcLine.push(` to: this.address,`) - funcLine.push(` data:encodeFunctionData({`) - funcLine.push(` abi: ${abiName},`) - funcLine.push(` functionName: "${func.name}",`) - if (inType.valid) { - funcLine.push(` args: [`) - funcLine.push(inType.args) - funcLine.push(` ],`) - } - funcLine.push(` }),`) - funcLine.push(` };`) - funcLine.push(` }`) - - return {func: funcLine.join("\n"), types: ""} + const abiName = `${camelCase(contractName)}Abi`; + const indexFuncName = + "index" in func ? `${func.name}${func.index}` : func.name; + const inName = `${pascalCase(contractName)}${pascalCase( + indexFuncName + )}Request`; + const inType = generateContractTypes(inName, func.inputs); + const inParams = inType.valid ? `request: ${inName}` : ``; + let method = "readContract"; + + let funcLine: Array = []; + let types: Array = []; + + if (inType.valid) types.push(`${inType.comment}\n${inType.type}`); + + addImport("viem", "encodeFunctionData"); + + funcLine.push(``); + funcLine.push(`/**`); + funcLine.push( + ` * method ${func.name} for contract ${contractName} with only encode` + ); + funcLine.push(` *`); + funcLine.push(` * @param request ${inName}`); + funcLine.push(` * @return EncodedTxData`); + funcLine.push(`*/`); + funcLine.push( + ` public ${camelCase(indexFuncName)}Encode(${inParams}): EncodedTxData {` + ); + funcLine.push(` return {`); + funcLine.push(` to: this.address,`); + funcLine.push(` data:encodeFunctionData({`); + funcLine.push(` abi: ${abiName},`); + funcLine.push(` functionName: "${func.name}",`); + if (inType.valid) { + funcLine.push(` args: [`); + funcLine.push(inType.args); + funcLine.push(` ],`); + } + funcLine.push(` }),`); + funcLine.push(` };`); + funcLine.push(` }`); + + return { func: funcLine.join("\n"), types: "" }; } function generateEventFunction(contractName: any, event: AbiEvent) { - const abiName = `${camelCase(contractName)}Abi` - const typeName = `${pascalCase(contractName)}${pascalCase(event.name)}Event` - const type = generateContractTypes(typeName, event.inputs, false) - - let funcLine: Array = []; - let types: Array = []; - - if (type.valid) { - types.push(`${type.comment}\n${type.type}`) - funcLine.push(``) - funcLine.push(`/**`) - funcLine.push(` * event ${event.name} for contract ${contractName}`) - funcLine.push(`*/`) - funcLine.push(` public watch${pascalCase(event.name)}Event(onLogs: (txHash: Hex, ev: Partial<${typeName}>) => void): WatchContractEventReturnType {`) - funcLine.push(` return this.rpcClient.watchContractEvent({`) - funcLine.push(` abi: ${abiName},`) - funcLine.push(` address: this.address,`) - funcLine.push(` eventName: '${event.name}',`) - funcLine.push(` onLogs: (evs) => {evs.forEach(it=> onLogs(it.transactionHash, it.args))},`) - funcLine.push(` })`) - funcLine.push(` }`) - funcLine.push(``) - funcLine.push(`/**`) - funcLine.push(` * parse tx receipt event ${event.name} for contract ${contractName}`) - funcLine.push(` */`) - funcLine.push(`public parseTx${pascalCase(event.name)}Event(txReceipt: TransactionReceipt): Array<${typeName}> {`) - funcLine.push(` const targetLogs: Array<${typeName}> = [];`) - funcLine.push(` for (const log of txReceipt.logs) {`) - funcLine.push(` try {`) - funcLine.push(` const event = decodeEventLog({`) - funcLine.push(` abi: ${abiName},`) - funcLine.push(` eventName: '${event.name}',`) - funcLine.push(` data: log.data,`) - funcLine.push(` topics: log.topics,`) - funcLine.push(` });`) - funcLine.push(` if (event.eventName === '${event.name}') targetLogs.push(event.args)`) - funcLine.push(` } catch (e) { /* empty */ }`) - funcLine.push(` }`) - funcLine.push(` return targetLogs`) - funcLine.push(`}`) - - addImport('viem', 'decodeEventLog', 'WatchContractEventReturnType', 'TransactionReceipt') - } - - return {func: funcLine.join("\n"), types: types.join("\n")} + const abiName = `${camelCase(contractName)}Abi`; + const typeName = `${pascalCase(contractName)}${pascalCase(event.name)}Event`; + const type = generateContractTypes(typeName, event.inputs, false); + + let funcLine: Array = []; + let types: Array = []; + + if (type.valid) { + types.push(`${type.comment}\n${type.type}`); + funcLine.push(``); + funcLine.push(`/**`); + funcLine.push(` * event ${event.name} for contract ${contractName}`); + funcLine.push(`*/`); + funcLine.push( + ` public watch${pascalCase( + event.name + )}Event(onLogs: (txHash: Hex, ev: Partial<${typeName}>) => void): WatchContractEventReturnType {` + ); + funcLine.push(` return this.rpcClient.watchContractEvent({`); + funcLine.push(` abi: ${abiName},`); + funcLine.push(` address: this.address,`); + funcLine.push(` eventName: '${event.name}',`); + funcLine.push( + ` onLogs: (evs) => {evs.forEach(it=> onLogs(it.transactionHash, it.args))},` + ); + funcLine.push(` })`); + funcLine.push(` }`); + funcLine.push(``); + funcLine.push(`/**`); + funcLine.push( + ` * parse tx receipt event ${event.name} for contract ${contractName}` + ); + funcLine.push(` */`); + funcLine.push( + `public parseTx${pascalCase( + event.name + )}Event(txReceipt: TransactionReceipt): Array<${typeName}> {` + ); + funcLine.push(` const targetLogs: Array<${typeName}> = [];`); + funcLine.push(` for (const log of txReceipt.logs) {`); + funcLine.push(` try {`); + funcLine.push(` const event = decodeEventLog({`); + funcLine.push(` abi: ${abiName},`); + funcLine.push(` eventName: '${event.name}',`); + funcLine.push(` data: log.data,`); + funcLine.push(` topics: log.topics,`); + funcLine.push(` });`); + funcLine.push( + ` if (event.eventName === '${event.name}') {targetLogs.push(event.args)}` + ); + funcLine.push(` } catch (e) { /* empty */ }`); + funcLine.push(` }`); + funcLine.push(` return targetLogs`); + funcLine.push(`}`); + + addImport( + "viem", + "decodeEventLog", + "WatchContractEventReturnType", + "TransactionReceipt" + ); + } + + return { func: funcLine.join("\n"), types: types.join("\n") }; } function generateContract(config: SDKConfig, contract: Contract): string { - const addressName = `${camelCase(contract.name)}Address` - let functionMap: Record = {} - let abiViewFunctions: Array = []; - let abiWriteFunctions: Array = []; - let abiEvents: Array = []; - for (let abiElement of contract.abi) { - switch (abiElement.type) { - case "function": - if (config.whiteList && config.whiteList[contract.name]) { - if (config.whiteList[contract.name].indexOf(abiElement.name) == -1) { - continue - } - } - - const indexAbiElement: AbiFunction & { index?: number } = abiElement - - if (!functionMap[indexAbiElement.name]) { - functionMap[indexAbiElement.name] = 1 - } else { - functionMap[indexAbiElement.name]++ - indexAbiElement.index = functionMap[indexAbiElement.name] - } - - if (isAbiFuncOnlyRead(indexAbiElement)) { - abiViewFunctions.push(indexAbiElement) - } else { - abiWriteFunctions.push(indexAbiElement) - } - break; - case "event": - if (config.whiteList && config.whiteList[contract.name]) { - if (config.whiteList[contract.name].indexOf(abiElement.name) == -1) { - continue - } - } - - abiEvents.push(abiElement) - break; + const addressName = `${camelCase(contract.name)}Address`; + let functionMap: Record = {}; + let abiViewFunctions: Array = []; + let abiWriteFunctions: Array = []; + let abiEvents: Array = []; + for (let abiElement of contract.abi) { + switch (abiElement.type) { + case "function": + if (config.whiteList && config.whiteList[contract.name]) { + if (config.whiteList[contract.name].indexOf(abiElement.name) == -1) { + continue; + } } - } - - let file: Array = []; - let types: Array = []; - if (abiEvents.length) { - addImport('viem', 'PublicClient', 'Address') - - file.push(``) - file.push(`/**`) - file.push(` * contract ${contract.name} event`) - file.push(`*/`) - file.push(`export class ${pascalCase(contract.name)}EventClient {`) - file.push(` protected readonly rpcClient: PublicClient;`) - file.push(` public readonly address: Address;`) - file.push(``) - file.push(` constructor (rpcClient: PublicClient, address?: Address) {`) - file.push(` this.address = address || getAddress(${addressName}, rpcClient.chain?.id);`) - file.push(` this.rpcClient = rpcClient;`) - file.push(` }`) - abiEvents.forEach(it => { - const data = generateEventFunction(contract.name, it) - file.push(data.func) - types.push(data.types) - }) - file.push(`}`) - } + const indexAbiElement: AbiFunction & { index?: number } = abiElement; - if (abiViewFunctions.length) { - const extend = abiEvents.length ? ` extends ${pascalCase(contract.name)}EventClient` : `` - file.push(``) - file.push(`/**`) - file.push(` * contract ${contract.name} readonly method`) - file.push(`*/`) - file.push(`export class ${pascalCase(contract.name)}ReadOnlyClient ${extend} {`) - if (!abiEvents.length) { - addImport('viem', 'PublicClient', 'Address') - file.push(` protected readonly rpcClient: PublicClient;`) - file.push(` public readonly address: Address;`) - } - file.push(``) - file.push(` constructor (rpcClient: PublicClient, address?: Address) {`) - if (abiEvents.length) { - file.push(` super(rpcClient, address);`) + if (!functionMap[indexAbiElement.name]) { + functionMap[indexAbiElement.name] = 1; } else { - file.push(` this.address = address || getAddress(${addressName}, rpcClient.chain?.id);`) - file.push(` this.rpcClient = rpcClient;`) + functionMap[indexAbiElement.name]++; + indexAbiElement.index = functionMap[indexAbiElement.name]; } - file.push(` }`) - abiViewFunctions.forEach(it => { - const data = generateContractFunction(contract.name, it) - file.push(data.func) - types.push(data.types) - }) - file.push(`}`) - } - if (abiWriteFunctions.length) { - addImport('viem', 'PublicClient', 'Address') - - const extend = abiViewFunctions.length ? - ` extends ${pascalCase(contract.name)}ReadOnlyClient` - : abiEvents.length ? ` extends ${pascalCase(contract.name)}EventClient` : `` - file.push(``) - file.push(`/**`) - file.push(` * contract ${contract.name} write method`) - file.push(`*/`) - file.push(`export class ${pascalCase(contract.name)}Client ${extend} {`) - file.push(` protected readonly wallet: SimpleWalletClient;`) - if (!extend) { - file.push(` protected readonly rpcClient: PublicClient;`) - file.push(` public readonly address: Address;`) - } - file.push(``) - file.push(` constructor (rpcClient: PublicClient, wallet: SimpleWalletClient, address?: Address) {`) - if (!extend) { - file.push(` this.address = address || getAddress(${addressName}, rpcClient.chain?.id);`) - file.push(` this.rpcClient = rpcClient;`) + if (isAbiFuncOnlyRead(indexAbiElement)) { + abiViewFunctions.push(indexAbiElement); } else { - file.push(` super(rpcClient, address);`) + abiWriteFunctions.push(indexAbiElement); + } + break; + case "event": + if (config.whiteList && config.whiteList[contract.name]) { + if (config.whiteList[contract.name].indexOf(abiElement.name) == -1) { + continue; + } } - file.push(` this.wallet = wallet;`) - file.push(` }`) - abiWriteFunctions.forEach(it => { - const data = generateContractFunction(contract.name, it) - file.push(data.func) - types.push(data.types) - - const dataFunc = generateContractDataFunction(contract.name, it) - file.push(dataFunc.func) - types.push(dataFunc.types) - }) - file.push(`}`) - } - return `// Contract ${contract.name} =============================================================\n` + - types.join("\n\n") + - "\n\n" + - file.join("\n"); + abiEvents.push(abiElement); + break; + } + } + + let file: Array = []; + let types: Array = []; + + if (abiEvents.length) { + addImport("viem", "PublicClient", "Address"); + + file.push(``); + file.push(`/**`); + file.push(` * contract ${contract.name} event`); + file.push(`*/`); + file.push(`export class ${pascalCase(contract.name)}EventClient {`); + file.push(` protected readonly rpcClient: PublicClient;`); + file.push(` public readonly address: Address;`); + file.push(``); + file.push(` constructor (rpcClient: PublicClient, address?: Address) {`); + file.push( + ` this.address = address || getAddress(${addressName}, rpcClient.chain?.id);` + ); + file.push(` this.rpcClient = rpcClient;`); + file.push(` }`); + abiEvents.forEach((it) => { + const data = generateEventFunction(contract.name, it); + file.push(data.func); + types.push(data.types); + }); + file.push(`}`); + } + + if (abiViewFunctions.length) { + const extend = abiEvents.length + ? ` extends ${pascalCase(contract.name)}EventClient` + : ``; + file.push(``); + file.push(`/**`); + file.push(` * contract ${contract.name} readonly method`); + file.push(`*/`); + file.push( + `export class ${pascalCase(contract.name)}ReadOnlyClient ${extend} {` + ); + if (!abiEvents.length) { + addImport("viem", "PublicClient", "Address"); + file.push(` protected readonly rpcClient: PublicClient;`); + file.push(` public readonly address: Address;`); + } + file.push(``); + file.push(` constructor (rpcClient: PublicClient, address?: Address) {`); + if (abiEvents.length) { + file.push(` super(rpcClient, address);`); + } else { + file.push( + ` this.address = address || getAddress(${addressName}, rpcClient.chain?.id);` + ); + file.push(` this.rpcClient = rpcClient;`); + } + file.push(` }`); + abiViewFunctions.forEach((it) => { + const data = generateContractFunction(contract.name, it); + file.push(data.func); + types.push(data.types); + }); + file.push(`}`); + } + + if (abiWriteFunctions.length) { + addImport("viem", "PublicClient", "Address"); + + const extend = abiViewFunctions.length + ? ` extends ${pascalCase(contract.name)}ReadOnlyClient` + : abiEvents.length + ? ` extends ${pascalCase(contract.name)}EventClient` + : ``; + file.push(``); + file.push(`/**`); + file.push(` * contract ${contract.name} write method`); + file.push(`*/`); + file.push(`export class ${pascalCase(contract.name)}Client ${extend} {`); + file.push(` protected readonly wallet: SimpleWalletClient;`); + if (!extend) { + file.push(` protected readonly rpcClient: PublicClient;`); + file.push(` public readonly address: Address;`); + } + file.push(``); + file.push( + ` constructor (rpcClient: PublicClient, wallet: SimpleWalletClient, address?: Address) {` + ); + if (!extend) { + file.push( + ` this.address = address || getAddress(${addressName}, rpcClient.chain?.id);` + ); + file.push(` this.rpcClient = rpcClient;`); + } else { + file.push(` super(rpcClient, address);`); + } + file.push(` this.wallet = wallet;`); + file.push(` }`); + abiWriteFunctions.forEach((it) => { + const data = generateContractFunction(contract.name, it); + file.push(data.func); + types.push(data.types); + + const dataFunc = generateContractDataFunction(contract.name, it); + file.push(dataFunc.func); + types.push(dataFunc.types); + }); + file.push(`}`); + } + + return ( + `// Contract ${contract.name} =============================================================\n` + + types.join("\n\n") + + "\n\n" + + file.join("\n") + ); } function generateCommon(config: SDKConfig) { - let file: Array = []; - file.push(`// COMMON =============================================================`) - file.push(``) - file.push(`function getAddress(address: Record, chainId?: number): Address {`) - file.push(` return address[chainId || 0] || '0x'`) - file.push(`}`) - file.push(``) - file.push(`export type EncodedTxData = {to: Address, data: Hex}`) - file.push(``) - addImport('viem', 'Address', 'Hex') - - if (config.permissionLessSDK) { - file.push(``) - file.push(`export type SimpleWalletClient<`) - file.push(` TChain extends Chain | undefined = Chain | undefined,`) - file.push(` TAccount extends Account | undefined = Account | undefined,`) - file.push(`> = {`) - file.push(` account ?: TAccount;`) - file.push(` writeContract: <`) - file.push(` const abi extends Abi | readonly unknown[],`) - file.push(` functionName extends ContractFunctionName,`) - file.push(` args extends ContractFunctionArgs<`) - file.push(` abi,`) - file.push(` 'payable' | 'nonpayable',`) - file.push(` functionName`) - file.push(` >,`) - file.push(` TChainOverride extends Chain | undefined = undefined,`) - file.push(` >(`) - file.push(` args: WriteContractParameters<`) - file.push(` abi,`) - file.push(` functionName,`) - file.push(` args,`) - file.push(` TChain,`) - file.push(` TAccount,`) - file.push(` TChainOverride`) - file.push(` >,`) - file.push(` ) => Promise`) - file.push(`};`) - file.push(``) - - addImport('viem', 'Abi', 'Account', 'Chain', 'ContractFunctionArgs', 'ContractFunctionName', 'WriteContractParameters', 'WriteContractReturnType') - } - - return file.join("\n"); + let file: Array = []; + file.push( + `// COMMON =============================================================` + ); + file.push(``); + file.push( + `function getAddress(address: Record, chainId?: number): Address {` + ); + file.push(` return address[chainId || 0] || '0x'`); + file.push(`}`); + file.push(``); + file.push(`export type EncodedTxData = {to: Address, data: Hex}`); + file.push(``); + addImport("viem", "Address", "Hex"); + + if (config.permissionLessSDK) { + file.push(``); + file.push(`export type SimpleWalletClient<`); + file.push(` TChain extends Chain | undefined = Chain | undefined,`); + file.push( + ` TAccount extends Account | undefined = Account | undefined,` + ); + file.push(`> = {`); + file.push(` account ?: TAccount;`); + file.push(` writeContract: <`); + file.push(` const abi extends Abi | readonly unknown[],`); + file.push( + ` functionName extends ContractFunctionName,` + ); + file.push(` args extends ContractFunctionArgs<`); + file.push(` abi,`); + file.push(` 'payable' | 'nonpayable',`); + file.push(` functionName`); + file.push(` >,`); + file.push(` TChainOverride extends Chain | undefined = undefined,`); + file.push(` >(`); + file.push(` args: WriteContractParameters<`); + file.push(` abi,`); + file.push(` functionName,`); + file.push(` args,`); + file.push(` TChain,`); + file.push(` TAccount,`); + file.push(` TChainOverride`); + file.push(` >,`); + file.push(` ) => Promise`); + file.push(`};`); + file.push(``); + + addImport( + "viem", + "Abi", + "Account", + "Chain", + "ContractFunctionArgs", + "ContractFunctionName", + "WriteContractParameters", + "WriteContractReturnType" + ); + } + + return file.join("\n"); } export function sdk(config: SDKConfig = {}): SDKResult { - return { - name: 'SDK', - async run(runConfig: RunConfig): Promise<{ imports?: string, prepend?: string, content: string }> { - let classFile: Array = [] - - classFile.push(generateCommon(config)) - - for (const contract of runConfig.contracts) { - classFile.push(generateContract(config, contract)) - } - - return { - imports: buildImport(), - content: classFile.join("\n\n"), - } - }, - } + return { + name: "SDK", + async run( + runConfig: RunConfig + ): Promise<{ imports?: string; prepend?: string; content: string }> { + let classFile: Array = []; + + classFile.push(generateCommon(config)); + + for (const contract of runConfig.contracts) { + classFile.push(generateContract(config, contract)); + } + + return { + imports: buildImport(), + content: classFile.join("\n\n"), + }; + }, + }; } - diff --git a/packages/wagmi-generator/wagmi.config.ts b/packages/wagmi-generator/wagmi.config.ts index 8f4793ad..a308c8a4 100644 --- a/packages/wagmi-generator/wagmi.config.ts +++ b/packages/wagmi-generator/wagmi.config.ts @@ -3,8 +3,8 @@ import { sdk } from "./sdk"; import type { Evaluate } from "@wagmi/cli/src/types"; import type { ContractConfig } from "@wagmi/cli/src/config"; import { resolveProxyContracts } from "./resolveProxyContracts"; -import {optimizedBlockExplorer} from "./optimizedBlockExplorer"; -const sepoliaChainId = 11155111; +import { optimizedBlockExplorer } from "./optimizedBlockExplorer"; +const iliadChainId = 1513; import "dotenv/config"; export default defineConfig(async () => { @@ -12,113 +12,97 @@ export default defineConfig(async () => { { name: "AccessController", address: { - [sepoliaChainId]: "0xF9936a224b3Deb6f9A4645ccAfa66f7ECe83CF0A", - // [storyTestnetId]: "0x7e253Df9b0fC872746877Fa362b2cAf32712d770", + [iliadChainId]: "0x01d470c28822d3701Db6325333cEE9737524776E", }, }, { name: "DisputeModule", address: { - [sepoliaChainId]: "0xEB7B1dd43B81A7be1fA427515a2b173B454A9832", - // [storyTestnetId]: "0x6d54456Ae5DCbDC0C9E2713cC8E650fE4f445c7C", + [iliadChainId]: "0xDae11663438a0958E7075F604E3a5eEe77FD3878", }, }, { name: "IPAccountImpl", address: { - [sepoliaChainId]: "0x36a5f0D61f6Bab3C6Dde211E5a6762Cb18a8060d", - // [storyTestnetId]: "0x38cAfD16502B1d61c6399A18d6Fa1Ea8CEca3678", + [iliadChainId]: "0x8F763c16753e830a8020c80f9F0131Eb8Ef52879", }, }, { name: "IPAssetRegistry", address: { - [sepoliaChainId]: "0xd43fE0d865cb5C26b1351d3eAf2E3064BE3276F6", - // [storyTestnetId]: "0x862de97662a1231FFc14038eC1BE93aB129D2169", + [iliadChainId]: "0xe34A78B3d658aF7ad69Ff1EFF9012ECa025a14Be", }, }, { name: "IpRoyaltyVaultImpl", address: { - [sepoliaChainId]: "0xD6c2AfB61085f1359d47159f2271BDD0EeBf19C2", - // [storyTestnetId]: "0x8Be22cc2D13ADF496a417D9C616dA4a253c68Af8", + [iliadChainId]: "0xfb5b5B61c9a437E06Ba87367aaBf3766d091E3D1", }, }, { name: "LicenseRegistry", address: { - [sepoliaChainId]: "0x4f4b1bf7135C7ff1462826CCA81B048Ed19562ed", - // [storyTestnetId]: "0x0c3D467537FAd845a78728CEdc3D9447338c5422", + [iliadChainId]: "0xF542AF9a5A6E4A85a4f084D38B322516ec336097", }, }, { name: "LicenseToken", address: { - [sepoliaChainId]: "0x1333c78A821c9a576209B01a16dDCEF881cAb6f2", - // [storyTestnetId]: "0xD40b7bCA204f96a346021e31c9ad54FF495226e7", + [iliadChainId]: "0xB31FE33De46A1FA5d4Ec669EDB049892E0A1EB4C", }, }, { name: "LicensingModule", address: { - [sepoliaChainId]: "0xe89b0EaA8a0949738efA80bB531a165FB3456CBe", - // [storyTestnetId]: "0xEeDDE5529122b621105798860F235c28FD3aBA40", + [iliadChainId]: "0xf49da534215DA7b48E57A41d41dac25C912FCC60", }, }, { name: "PILicenseTemplate", address: { - [sepoliaChainId]: "0x260B6CB6284c89dbE660c0004233f7bB99B5edE7", - // [storyTestnetId]: "0xd0Be223ae9719bBD93447ecf5289319CCf8cA227", + [iliadChainId]: "0x8BB1ADE72E21090Fc891e1d4b88AC5E57b27cB31", }, }, { name: "ModuleRegistry", address: { - [sepoliaChainId]: "0x2E0a668289D5C4Da6a2264aC8DF03cd600c7aAB8", - // [storyTestnetId]: "0xf2965E3B6251905Dd1E8671077760D07b0408cf2", + [iliadChainId]: "0x008ac202A8545D10f25707439bE4c139Be4Df75F", }, }, { name: "RoyaltyModule", address: { - [sepoliaChainId]: "0xFAE961dd2b87CD5818dbCDc2591e6AB0b50E96b0", - // [storyTestnetId]: "0x551AD8CD7893003cE00500aC2aCF1E327763D9f6", + [iliadChainId]: "0x968beb5432c362c12b5Be6967a5d6F1ED5A63F01", }, }, { name: "RoyaltyPolicyLAP", address: { - [sepoliaChainId]: "0xAAbaf349C7a2A84564F9CC4Ac130B3f19A718E86", - // [storyTestnetId]: "0x2EcdB5bD12a037dCb9De0Ab7957f35FEeF758eA6", + [iliadChainId]: "0x61A5c7570f5bDB118D65053Ba60DE87e050E664e", }, }, { name: "SPG", address: { - [sepoliaChainId]: "0x69415CE984A79a3Cfbe3F51024C63b6C107331e3", - // [storyTestnetId]: "0x2EcdB5bD12a037dCb9De0Ab7957f35FEeF758eA6", + [iliadChainId]: "0x69415CE984A79a3Cfbe3F51024C63b6C107331e3", }, }, { name: "SPGNFTBeacon", address: { - [sepoliaChainId]: "0x027D258659FBdda9033f9c008AF166239EBa67c1", - // [storyTestnetId]: "0x2EcdB5bD12a037dCb9De0Ab7957f35FEeF758eA6", + [iliadChainId]: "0x027D258659FBdda9033f9c008AF166239EBa67c1", }, }, { name: "SPGNFTImpl", address: { - [sepoliaChainId]: "0xDb6480C00B570324A122A6B35F9CAC0F87BDb3e6", - // [storyTestnetId]: "0x2EcdB5bD12a037dCb9De0Ab7957f35FEeF758eA6", + [iliadChainId]: "0xDb6480C00B570324A122A6B35F9CAC0F87BDb3e6", }, }, { name: "CoreMetadataModule", address: { - [sepoliaChainId]: "0xDa498A3f7c8a88cb72201138C366bE3778dB9575", - // [storyTestnetId]: "0x2EcdB5bD12a037dCb9De0Ab7957f35FEeF758eA6", + [iliadChainId]: "0x290F414EA46b361ECFB6b430F98346CB593D02b9", }, }, ]; @@ -127,15 +111,14 @@ export default defineConfig(async () => { contracts: [], plugins: [ optimizedBlockExplorer({ - baseUrl: "https://api-sepolia.etherscan.io/api", - name: "Etherscan", + baseUrl: "https://explorer.testnet.storyprotocol.net/api", + name: "story-testnet", getAddress: await resolveProxyContracts({ - baseUrl: "https://rpc.sepolia.org", + baseUrl: "https://rpc.partner.testnet.storyprotocol.net", contracts: contracts, - chainId: sepoliaChainId, + chainId: iliadChainId, }), contracts: contracts, - apiKey: process.env.API_KEY, }), sdk({ permissionLessSDK: true, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6d99c605..f8d8c6b1 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -31,7 +31,7 @@ importers: version: 16.4.5 viem: specifier: ^2.8.12 - version: 2.9.16(typescript@5.4.5)(zod@3.22.4) + version: 2.9.16(typescript@5.4.5)(zod@3.23.8) devDependencies: '@babel/core': specifier: ^7.23.0 @@ -147,7 +147,7 @@ importers: version: 18.3.1 viem: specifier: ^2.8.12 - version: 2.9.16(typescript@5.4.5)(zod@3.22.4) + version: 2.9.16(typescript@5.4.5)(zod@3.23.8) devDependencies: '@babel/core': specifier: ^7.23.0 @@ -224,8 +224,8 @@ importers: specifier: ^20.8.2 version: 20.12.7 '@wagmi/cli': - specifier: 0.0.0-canary-20240313013119 - version: 0.0.0-canary-20240313013119(typescript@5.4.5) + specifier: ^2.1.15 + version: 2.1.15(typescript@5.4.5) '@wagmi/connectors': specifier: ^4.1.14 version: 4.1.25(@wagmi/core@2.6.16)(react-native@0.73.6)(react@18.3.1)(typescript@5.4.5)(viem@2.9.16) @@ -246,7 +246,7 @@ importers: version: 5.4.5 viem: specifier: ^2.8.6 - version: 2.9.16(typescript@5.4.5)(zod@3.22.4) + version: 2.9.16(typescript@5.4.5)(zod@3.23.8) wagmi: specifier: ^2.5.7 version: 2.5.19(@tanstack/react-query@5.29.2)(react-native@0.73.6)(react@18.3.1)(typescript@5.4.5)(viem@2.9.16) @@ -312,16 +312,6 @@ packages: - supports-color dev: true - /@babel/generator@7.24.4: - resolution: {integrity: sha512-Xd6+v6SnjWVx/nus+y0l1sxMOTOMBkyL4+BIdbALyatQnAe/SRVjANeDPSCYaX+i1iJmuGSKf3Z+E+V/va1Hvw==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/types': 7.24.0 - '@jridgewell/gen-mapping': 0.3.5 - '@jridgewell/trace-mapping': 0.3.25 - jsesc: 2.5.2 - dev: true - /@babel/generator@7.24.7: resolution: {integrity: sha512-oipXieGC3i45Y1A41t4tAqpnEZWgB/lC6Ehh6+rOviR5XWpTtMmLN+fGjz9vOiNRt0p6RtO6DtD0pdU3vpqdSA==} engines: {node: '>=6.9.0'} @@ -332,13 +322,6 @@ packages: jsesc: 2.5.2 dev: true - /@babel/helper-annotate-as-pure@7.22.5: - resolution: {integrity: sha512-LvBTxu8bQSQkcyKOU+a1btnNFQ1dMAd0R6PyW3arXes06F6QLWLIrd681bxRPIXlrMGR3XYnW9JyML7dP3qgxg==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/types': 7.24.0 - dev: true - /@babel/helper-annotate-as-pure@7.24.7: resolution: {integrity: sha512-BaDeOonYvhdKw+JoMVkAixAAJzG2jVPIwWoKBPdYuY9b452e2rPuI9QPYh3KpofZ3pW2akOmwZLOiOsHMiqRAg==} engines: {node: '>=6.9.0'} @@ -350,7 +333,7 @@ packages: resolution: {integrity: sha512-QkBXwGgaoC2GtGZRoma6kv7Szfv06khvhFav67ZExau2RaXzy8MpHSMO2PNoP2XtmQphJQRHFfg77Bq731Yizw==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.24.0 + '@babel/types': 7.24.7 dev: true /@babel/helper-compilation-targets@7.23.6: @@ -358,7 +341,7 @@ packages: engines: {node: '>=6.9.0'} dependencies: '@babel/compat-data': 7.24.4 - '@babel/helper-validator-option': 7.23.5 + '@babel/helper-validator-option': 7.24.7 browserslist: 4.23.0 lru-cache: 5.1.1 semver: 6.3.1 @@ -371,14 +354,14 @@ packages: '@babel/core': ^7.0.0 dependencies: '@babel/core': 7.24.4 - '@babel/helper-annotate-as-pure': 7.22.5 - '@babel/helper-environment-visitor': 7.22.20 - '@babel/helper-function-name': 7.23.0 + '@babel/helper-annotate-as-pure': 7.24.7 + '@babel/helper-environment-visitor': 7.24.7 + '@babel/helper-function-name': 7.24.7 '@babel/helper-member-expression-to-functions': 7.23.0 '@babel/helper-optimise-call-expression': 7.22.5 '@babel/helper-replace-supers': 7.24.1(@babel/core@7.24.4) '@babel/helper-skip-transparent-expression-wrappers': 7.22.5 - '@babel/helper-split-export-declaration': 7.22.6 + '@babel/helper-split-export-declaration': 7.24.7 semver: 6.3.1 dev: true @@ -389,7 +372,7 @@ packages: '@babel/core': ^7.0.0 dependencies: '@babel/core': 7.24.4 - '@babel/helper-annotate-as-pure': 7.22.5 + '@babel/helper-annotate-as-pure': 7.24.7 regexpu-core: 5.3.2 semver: 6.3.1 dev: true @@ -401,7 +384,7 @@ packages: dependencies: '@babel/core': 7.24.4 '@babel/helper-compilation-targets': 7.23.6 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.7 debug: 4.3.4(supports-color@8.1.1) lodash.debounce: 4.0.8 resolve: 1.22.8 @@ -409,11 +392,6 @@ packages: - supports-color dev: true - /@babel/helper-environment-visitor@7.22.20: - resolution: {integrity: sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==} - engines: {node: '>=6.9.0'} - dev: true - /@babel/helper-environment-visitor@7.24.7: resolution: {integrity: sha512-DoiN84+4Gnd0ncbBOM9AZENV4a5ZiL39HYMyZJGZ/AZEykHYdJw0wW3kdcsh9/Kn+BRXHLkkklZ51ecPKmI1CQ==} engines: {node: '>=6.9.0'} @@ -421,14 +399,6 @@ packages: '@babel/types': 7.24.7 dev: true - /@babel/helper-function-name@7.23.0: - resolution: {integrity: sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/template': 7.24.0 - '@babel/types': 7.24.0 - dev: true - /@babel/helper-function-name@7.24.7: resolution: {integrity: sha512-FyoJTsj/PEUWu1/TYRiXTIHc8lbw+TDYkZuoE43opPS5TrI7MyONBE1oNvfguEXAD9yhQRrVBnXdXzSLQl9XnA==} engines: {node: '>=6.9.0'} @@ -437,13 +407,6 @@ packages: '@babel/types': 7.24.7 dev: true - /@babel/helper-hoist-variables@7.22.5: - resolution: {integrity: sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/types': 7.24.0 - dev: true - /@babel/helper-hoist-variables@7.24.7: resolution: {integrity: sha512-MJJwhkoGy5c4ehfoRyrJ/owKeMl19U54h27YYftT0o2teQ3FJ3nQUf/I3LlJsX4l3qlw7WRXUmiyajvHXoTubQ==} engines: {node: '>=6.9.0'} @@ -455,7 +418,7 @@ packages: resolution: {integrity: sha512-6gfrPwh7OuT6gZyJZvd6WbTfrqAo7vm4xCzAXOusKqq/vWdKXphTpj5klHKNmRUU6/QRGlBsyU9mAIPaWHlqJA==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.24.0 + '@babel/types': 7.24.7 dev: true /@babel/helper-module-imports@7.24.3: @@ -482,23 +445,20 @@ packages: '@babel/core': ^7.0.0 dependencies: '@babel/core': 7.24.4 - '@babel/helper-environment-visitor': 7.22.20 - '@babel/helper-module-imports': 7.24.3 + '@babel/helper-environment-visitor': 7.24.7 + '@babel/helper-module-imports': 7.24.7 '@babel/helper-simple-access': 7.22.5 - '@babel/helper-split-export-declaration': 7.22.6 - '@babel/helper-validator-identifier': 7.22.20 + '@babel/helper-split-export-declaration': 7.24.7 + '@babel/helper-validator-identifier': 7.24.7 + transitivePeerDependencies: + - supports-color dev: true /@babel/helper-optimise-call-expression@7.22.5: resolution: {integrity: sha512-HBwaojN0xFRx4yIvpwGqxiV2tUfl7401jlok564NgB9EHS1y6QT17FmKWm4ztqjeVdXLuC4fSvHc5ePpQjoTbw==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.24.0 - dev: true - - /@babel/helper-plugin-utils@7.24.0: - resolution: {integrity: sha512-9cUznXMG0+FxRuJfvL82QlTqIzhVW9sL0KjMPHhAOOvpQGL8QtdxnBKILjBqxlHyliz0yCa1G903ZXI/FuHy2w==} - engines: {node: '>=6.9.0'} + '@babel/types': 7.24.7 dev: true /@babel/helper-plugin-utils@7.24.7: @@ -513,8 +473,8 @@ packages: '@babel/core': ^7.0.0 dependencies: '@babel/core': 7.24.4 - '@babel/helper-annotate-as-pure': 7.22.5 - '@babel/helper-environment-visitor': 7.22.20 + '@babel/helper-annotate-as-pure': 7.24.7 + '@babel/helper-environment-visitor': 7.24.7 '@babel/helper-wrap-function': 7.22.20 dev: true @@ -525,7 +485,7 @@ packages: '@babel/core': ^7.0.0 dependencies: '@babel/core': 7.24.4 - '@babel/helper-environment-visitor': 7.22.20 + '@babel/helper-environment-visitor': 7.24.7 '@babel/helper-member-expression-to-functions': 7.23.0 '@babel/helper-optimise-call-expression': 7.22.5 dev: true @@ -534,21 +494,14 @@ packages: resolution: {integrity: sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.24.0 + '@babel/types': 7.24.7 dev: true /@babel/helper-skip-transparent-expression-wrappers@7.22.5: resolution: {integrity: sha512-tK14r66JZKiC43p8Ki33yLBVJKlQDFoA8GYN67lWCDCqoL6EMMSuM9b+Iff2jHaM/RRFYl7K+iiru7hbRqNx8Q==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.24.0 - dev: true - - /@babel/helper-split-export-declaration@7.22.6: - resolution: {integrity: sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/types': 7.24.0 + '@babel/types': 7.24.7 dev: true /@babel/helper-split-export-declaration@7.24.7: @@ -578,11 +531,6 @@ packages: engines: {node: '>=6.9.0'} dev: true - /@babel/helper-validator-option@7.23.5: - resolution: {integrity: sha512-85ttAOMLsr53VgXkTbkx8oA6YTfT4q7/HzXSLEYmjcSTJPMPQtvq1BD79Byep5xMUYbGRzEpDsjUf3dyp54IKw==} - engines: {node: '>=6.9.0'} - dev: true - /@babel/helper-validator-option@7.24.7: resolution: {integrity: sha512-yy1/KvjhV/ZCL+SM7hBrvnZJ3ZuT9OuZgIJAGpPEToANvc3iM6iDvBnRjtElWibHU6n8/LPR/EjX9EtIEYO3pw==} engines: {node: '>=6.9.0'} @@ -592,18 +540,18 @@ packages: resolution: {integrity: sha512-pms/UwkOpnQe/PDAEdV/d7dVCoBbB+R4FvYoHGZz+4VPcg7RtYy2KP7S2lbuWM6FCSgob5wshfGESbC/hzNXZw==} engines: {node: '>=6.9.0'} dependencies: - '@babel/helper-function-name': 7.23.0 - '@babel/template': 7.24.0 - '@babel/types': 7.24.0 + '@babel/helper-function-name': 7.24.7 + '@babel/template': 7.24.7 + '@babel/types': 7.24.7 dev: true /@babel/helpers@7.24.4: resolution: {integrity: sha512-FewdlZbSiwaVGlgT1DPANDuCHaDMiOo+D/IDYRFYjHOuv66xMSJ7fQwwODwRNAPkADIO/z1EoF/l2BCWlWABDw==} engines: {node: '>=6.9.0'} dependencies: - '@babel/template': 7.24.0 - '@babel/traverse': 7.24.1 - '@babel/types': 7.24.0 + '@babel/template': 7.24.7 + '@babel/traverse': 7.24.7 + '@babel/types': 7.24.7 transitivePeerDependencies: - supports-color dev: true @@ -628,14 +576,6 @@ packages: picocolors: 1.0.0 dev: true - /@babel/parser@7.24.4: - resolution: {integrity: sha512-zTvEBcghmeBma9QIGunWevvBAp4/Qu9Bdq+2k0Ot4fVMD6v3dsC9WOcRSKk7tRRyBM/53yKMJko9xOatGQAwSg==} - engines: {node: '>=6.0.0'} - hasBin: true - dependencies: - '@babel/types': 7.24.0 - dev: true - /@babel/parser@7.24.7: resolution: {integrity: sha512-9uUYRm6OqQrCqQdG1iCBwBPZgN8ciDBro2nIOFaiRz1/BCxaI7CNvQbDHvsArAC7Tw9Hda/B3U+6ui9u4HWXPw==} engines: {node: '>=6.0.0'} @@ -651,8 +591,8 @@ packages: '@babel/core': ^7.0.0 dependencies: '@babel/core': 7.24.4 - '@babel/helper-environment-visitor': 7.22.20 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-environment-visitor': 7.24.7 + '@babel/helper-plugin-utils': 7.24.7 dev: true /@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@7.24.1(@babel/core@7.24.4): @@ -662,7 +602,7 @@ packages: '@babel/core': ^7.0.0 dependencies: '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.7 dev: true /@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@7.24.1(@babel/core@7.24.4): @@ -672,7 +612,7 @@ packages: '@babel/core': ^7.13.0 dependencies: '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.7 '@babel/helper-skip-transparent-expression-wrappers': 7.22.5 '@babel/plugin-transform-optional-chaining': 7.24.1(@babel/core@7.24.4) dev: true @@ -684,8 +624,8 @@ packages: '@babel/core': ^7.0.0 dependencies: '@babel/core': 7.24.4 - '@babel/helper-environment-visitor': 7.22.20 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-environment-visitor': 7.24.7 + '@babel/helper-plugin-utils': 7.24.7 dev: true /@babel/plugin-proposal-async-generator-functions@7.20.7(@babel/core@7.24.4): @@ -804,7 +744,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.7 dev: true /@babel/plugin-syntax-bigint@7.8.3(@babel/core@7.24.4): @@ -822,7 +762,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.7 dev: true /@babel/plugin-syntax-class-static-block@7.14.5(@babel/core@7.24.4): @@ -832,7 +772,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.7 dev: true /@babel/plugin-syntax-dynamic-import@7.8.3(@babel/core@7.24.4): @@ -841,7 +781,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.7 dev: true /@babel/plugin-syntax-export-default-from@7.24.1(@babel/core@7.24.4): @@ -860,7 +800,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.7 dev: true /@babel/plugin-syntax-flow@7.24.1(@babel/core@7.24.4): @@ -880,7 +820,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.7 dev: true /@babel/plugin-syntax-import-attributes@7.24.1(@babel/core@7.24.4): @@ -890,7 +830,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.7 dev: true /@babel/plugin-syntax-import-meta@7.10.4(@babel/core@7.24.4): @@ -899,7 +839,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.7 dev: true /@babel/plugin-syntax-json-strings@7.8.3(@babel/core@7.24.4): @@ -908,17 +848,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 - dev: true - - /@babel/plugin-syntax-jsx@7.24.1(@babel/core@7.24.4): - resolution: {integrity: sha512-2eCtxZXf+kbkMIsXS4poTvT4Yu5rXiRa+9xGVT56raghjmBTKMpFNc9R4IDiB4emao9eO22Ox7CxuJG7BgExqA==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.7 dev: true /@babel/plugin-syntax-jsx@7.24.7(@babel/core@7.24.4): @@ -937,7 +867,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.7 dev: true /@babel/plugin-syntax-nullish-coalescing-operator@7.8.3(@babel/core@7.24.4): @@ -946,7 +876,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.7 dev: true /@babel/plugin-syntax-numeric-separator@7.10.4(@babel/core@7.24.4): @@ -955,7 +885,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.7 dev: true /@babel/plugin-syntax-object-rest-spread@7.8.3(@babel/core@7.24.4): @@ -964,7 +894,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.7 dev: true /@babel/plugin-syntax-optional-catch-binding@7.8.3(@babel/core@7.24.4): @@ -973,7 +903,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.7 dev: true /@babel/plugin-syntax-optional-chaining@7.8.3(@babel/core@7.24.4): @@ -982,7 +912,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.7 dev: true /@babel/plugin-syntax-private-property-in-object@7.14.5(@babel/core@7.24.4): @@ -992,7 +922,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.7 dev: true /@babel/plugin-syntax-top-level-await@7.14.5(@babel/core@7.24.4): @@ -1002,7 +932,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.7 dev: true /@babel/plugin-syntax-typescript@7.24.1(@babel/core@7.24.4): @@ -1012,7 +942,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.7 dev: true /@babel/plugin-syntax-unicode-sets-regex@7.18.6(@babel/core@7.24.4): @@ -1023,7 +953,7 @@ packages: dependencies: '@babel/core': 7.24.4 '@babel/helper-create-regexp-features-plugin': 7.22.15(@babel/core@7.24.4) - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.7 dev: true /@babel/plugin-transform-arrow-functions@7.24.1(@babel/core@7.24.4): @@ -1033,7 +963,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.7 dev: true /@babel/plugin-transform-async-generator-functions@7.24.3(@babel/core@7.24.4): @@ -1043,8 +973,8 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.24.4 - '@babel/helper-environment-visitor': 7.22.20 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-environment-visitor': 7.24.7 + '@babel/helper-plugin-utils': 7.24.7 '@babel/helper-remap-async-to-generator': 7.22.20(@babel/core@7.24.4) '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@7.24.4) dev: true @@ -1056,9 +986,11 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.24.4 - '@babel/helper-module-imports': 7.24.3 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-module-imports': 7.24.7 + '@babel/helper-plugin-utils': 7.24.7 '@babel/helper-remap-async-to-generator': 7.22.20(@babel/core@7.24.4) + transitivePeerDependencies: + - supports-color dev: true /@babel/plugin-transform-block-scoped-functions@7.24.1(@babel/core@7.24.4): @@ -1068,7 +1000,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.7 dev: true /@babel/plugin-transform-block-scoping@7.24.4(@babel/core@7.24.4): @@ -1078,7 +1010,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.7 dev: true /@babel/plugin-transform-class-properties@7.24.1(@babel/core@7.24.4): @@ -1089,7 +1021,7 @@ packages: dependencies: '@babel/core': 7.24.4 '@babel/helper-create-class-features-plugin': 7.24.4(@babel/core@7.24.4) - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.7 dev: true /@babel/plugin-transform-class-static-block@7.24.4(@babel/core@7.24.4): @@ -1100,7 +1032,7 @@ packages: dependencies: '@babel/core': 7.24.4 '@babel/helper-create-class-features-plugin': 7.24.4(@babel/core@7.24.4) - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.7 '@babel/plugin-syntax-class-static-block': 7.14.5(@babel/core@7.24.4) dev: true @@ -1111,13 +1043,13 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.24.4 - '@babel/helper-annotate-as-pure': 7.22.5 + '@babel/helper-annotate-as-pure': 7.24.7 '@babel/helper-compilation-targets': 7.23.6 - '@babel/helper-environment-visitor': 7.22.20 - '@babel/helper-function-name': 7.23.0 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-environment-visitor': 7.24.7 + '@babel/helper-function-name': 7.24.7 + '@babel/helper-plugin-utils': 7.24.7 '@babel/helper-replace-supers': 7.24.1(@babel/core@7.24.4) - '@babel/helper-split-export-declaration': 7.22.6 + '@babel/helper-split-export-declaration': 7.24.7 globals: 11.12.0 dev: true @@ -1128,8 +1060,8 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 - '@babel/template': 7.24.0 + '@babel/helper-plugin-utils': 7.24.7 + '@babel/template': 7.24.7 dev: true /@babel/plugin-transform-destructuring@7.24.1(@babel/core@7.24.4): @@ -1139,7 +1071,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.7 dev: true /@babel/plugin-transform-dotall-regex@7.24.1(@babel/core@7.24.4): @@ -1150,7 +1082,7 @@ packages: dependencies: '@babel/core': 7.24.4 '@babel/helper-create-regexp-features-plugin': 7.22.15(@babel/core@7.24.4) - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.7 dev: true /@babel/plugin-transform-duplicate-keys@7.24.1(@babel/core@7.24.4): @@ -1160,7 +1092,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.7 dev: true /@babel/plugin-transform-dynamic-import@7.24.1(@babel/core@7.24.4): @@ -1170,7 +1102,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.7 '@babel/plugin-syntax-dynamic-import': 7.8.3(@babel/core@7.24.4) dev: true @@ -1182,7 +1114,7 @@ packages: dependencies: '@babel/core': 7.24.4 '@babel/helper-builder-binary-assignment-operator-visitor': 7.22.15 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.7 dev: true /@babel/plugin-transform-export-namespace-from@7.24.1(@babel/core@7.24.4): @@ -1192,7 +1124,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.7 '@babel/plugin-syntax-export-namespace-from': 7.8.3(@babel/core@7.24.4) dev: true @@ -1214,7 +1146,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.7 '@babel/helper-skip-transparent-expression-wrappers': 7.22.5 dev: true @@ -1226,8 +1158,8 @@ packages: dependencies: '@babel/core': 7.24.4 '@babel/helper-compilation-targets': 7.23.6 - '@babel/helper-function-name': 7.23.0 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-function-name': 7.24.7 + '@babel/helper-plugin-utils': 7.24.7 dev: true /@babel/plugin-transform-json-strings@7.24.1(@babel/core@7.24.4): @@ -1237,7 +1169,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.7 '@babel/plugin-syntax-json-strings': 7.8.3(@babel/core@7.24.4) dev: true @@ -1248,7 +1180,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.7 dev: true /@babel/plugin-transform-logical-assignment-operators@7.24.1(@babel/core@7.24.4): @@ -1258,7 +1190,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.7 '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/core@7.24.4) dev: true @@ -1269,7 +1201,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.7 dev: true /@babel/plugin-transform-modules-amd@7.24.1(@babel/core@7.24.4): @@ -1280,7 +1212,9 @@ packages: dependencies: '@babel/core': 7.24.4 '@babel/helper-module-transforms': 7.23.3(@babel/core@7.24.4) - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.7 + transitivePeerDependencies: + - supports-color dev: true /@babel/plugin-transform-modules-commonjs@7.24.1(@babel/core@7.24.4): @@ -1291,8 +1225,10 @@ packages: dependencies: '@babel/core': 7.24.4 '@babel/helper-module-transforms': 7.23.3(@babel/core@7.24.4) - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.7 '@babel/helper-simple-access': 7.22.5 + transitivePeerDependencies: + - supports-color dev: true /@babel/plugin-transform-modules-systemjs@7.24.1(@babel/core@7.24.4): @@ -1302,10 +1238,12 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.24.4 - '@babel/helper-hoist-variables': 7.22.5 + '@babel/helper-hoist-variables': 7.24.7 '@babel/helper-module-transforms': 7.23.3(@babel/core@7.24.4) - '@babel/helper-plugin-utils': 7.24.0 - '@babel/helper-validator-identifier': 7.22.20 + '@babel/helper-plugin-utils': 7.24.7 + '@babel/helper-validator-identifier': 7.24.7 + transitivePeerDependencies: + - supports-color dev: true /@babel/plugin-transform-modules-umd@7.24.1(@babel/core@7.24.4): @@ -1316,7 +1254,9 @@ packages: dependencies: '@babel/core': 7.24.4 '@babel/helper-module-transforms': 7.23.3(@babel/core@7.24.4) - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.7 + transitivePeerDependencies: + - supports-color dev: true /@babel/plugin-transform-named-capturing-groups-regex@7.22.5(@babel/core@7.24.4): @@ -1327,7 +1267,7 @@ packages: dependencies: '@babel/core': 7.24.4 '@babel/helper-create-regexp-features-plugin': 7.22.15(@babel/core@7.24.4) - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.7 dev: true /@babel/plugin-transform-new-target@7.24.1(@babel/core@7.24.4): @@ -1337,7 +1277,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.7 dev: true /@babel/plugin-transform-nullish-coalescing-operator@7.24.1(@babel/core@7.24.4): @@ -1347,7 +1287,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.7 '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.24.4) dev: true @@ -1358,7 +1298,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.7 '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@7.24.4) dev: true @@ -1370,7 +1310,7 @@ packages: dependencies: '@babel/core': 7.24.4 '@babel/helper-compilation-targets': 7.23.6 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.7 '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.24.4) '@babel/plugin-transform-parameters': 7.24.1(@babel/core@7.24.4) dev: true @@ -1382,7 +1322,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.7 '@babel/helper-replace-supers': 7.24.1(@babel/core@7.24.4) dev: true @@ -1393,7 +1333,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.7 '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.24.4) dev: true @@ -1404,7 +1344,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.7 '@babel/helper-skip-transparent-expression-wrappers': 7.22.5 '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.24.4) dev: true @@ -1416,7 +1356,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.7 dev: true /@babel/plugin-transform-private-methods@7.24.1(@babel/core@7.24.4): @@ -1427,7 +1367,7 @@ packages: dependencies: '@babel/core': 7.24.4 '@babel/helper-create-class-features-plugin': 7.24.4(@babel/core@7.24.4) - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.7 dev: true /@babel/plugin-transform-private-property-in-object@7.24.1(@babel/core@7.24.4): @@ -1437,9 +1377,9 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.24.4 - '@babel/helper-annotate-as-pure': 7.22.5 + '@babel/helper-annotate-as-pure': 7.24.7 '@babel/helper-create-class-features-plugin': 7.24.4(@babel/core@7.24.4) - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.7 '@babel/plugin-syntax-private-property-in-object': 7.14.5(@babel/core@7.24.4) dev: true @@ -1450,7 +1390,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.7 dev: true /@babel/plugin-transform-react-display-name@7.24.7(@babel/core@7.24.4): @@ -1529,7 +1469,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.7 regenerator-transform: 0.15.2 dev: true @@ -1540,7 +1480,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.7 dev: true /@babel/plugin-transform-runtime@7.24.3(@babel/core@7.24.4): @@ -1567,7 +1507,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.7 dev: true /@babel/plugin-transform-spread@7.24.1(@babel/core@7.24.4): @@ -1577,7 +1517,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.7 '@babel/helper-skip-transparent-expression-wrappers': 7.22.5 dev: true @@ -1588,7 +1528,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.7 dev: true /@babel/plugin-transform-template-literals@7.24.1(@babel/core@7.24.4): @@ -1598,7 +1538,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.7 dev: true /@babel/plugin-transform-typeof-symbol@7.24.1(@babel/core@7.24.4): @@ -1608,7 +1548,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.7 dev: true /@babel/plugin-transform-typescript@7.24.4(@babel/core@7.24.4): @@ -1618,9 +1558,9 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.24.4 - '@babel/helper-annotate-as-pure': 7.22.5 + '@babel/helper-annotate-as-pure': 7.24.7 '@babel/helper-create-class-features-plugin': 7.24.4(@babel/core@7.24.4) - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.7 '@babel/plugin-syntax-typescript': 7.24.1(@babel/core@7.24.4) dev: true @@ -1631,7 +1571,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.7 dev: true /@babel/plugin-transform-unicode-property-regex@7.24.1(@babel/core@7.24.4): @@ -1642,7 +1582,7 @@ packages: dependencies: '@babel/core': 7.24.4 '@babel/helper-create-regexp-features-plugin': 7.22.15(@babel/core@7.24.4) - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.7 dev: true /@babel/plugin-transform-unicode-regex@7.24.1(@babel/core@7.24.4): @@ -1653,7 +1593,7 @@ packages: dependencies: '@babel/core': 7.24.4 '@babel/helper-create-regexp-features-plugin': 7.22.15(@babel/core@7.24.4) - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.7 dev: true /@babel/plugin-transform-unicode-sets-regex@7.24.1(@babel/core@7.24.4): @@ -1664,7 +1604,7 @@ packages: dependencies: '@babel/core': 7.24.4 '@babel/helper-create-regexp-features-plugin': 7.22.15(@babel/core@7.24.4) - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.7 dev: true /@babel/preset-env@7.24.4(@babel/core@7.24.4): @@ -1676,8 +1616,8 @@ packages: '@babel/compat-data': 7.24.4 '@babel/core': 7.24.4 '@babel/helper-compilation-targets': 7.23.6 - '@babel/helper-plugin-utils': 7.24.0 - '@babel/helper-validator-option': 7.23.5 + '@babel/helper-plugin-utils': 7.24.7 + '@babel/helper-validator-option': 7.24.7 '@babel/plugin-bugfix-firefox-class-in-computed-class-key': 7.24.4(@babel/core@7.24.4) '@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression': 7.24.1(@babel/core@7.24.4) '@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining': 7.24.1(@babel/core@7.24.4) @@ -1777,8 +1717,8 @@ packages: '@babel/core': ^7.0.0-0 || ^8.0.0-0 <8.0.0 dependencies: '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 - '@babel/types': 7.24.0 + '@babel/helper-plugin-utils': 7.24.7 + '@babel/types': 7.24.7 esutils: 2.0.3 dev: true @@ -1806,11 +1746,13 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 - '@babel/helper-validator-option': 7.23.5 - '@babel/plugin-syntax-jsx': 7.24.1(@babel/core@7.24.4) + '@babel/helper-plugin-utils': 7.24.7 + '@babel/helper-validator-option': 7.24.7 + '@babel/plugin-syntax-jsx': 7.24.7(@babel/core@7.24.4) '@babel/plugin-transform-modules-commonjs': 7.24.1(@babel/core@7.24.4) '@babel/plugin-transform-typescript': 7.24.4(@babel/core@7.24.4) + transitivePeerDependencies: + - supports-color dev: true /@babel/register@7.23.7(@babel/core@7.24.4): @@ -1838,15 +1780,6 @@ packages: regenerator-runtime: 0.14.1 dev: true - /@babel/template@7.24.0: - resolution: {integrity: sha512-Bkf2q8lMB0AFpX0NFEqSbx1OkTHf0f+0j82mkw+ZpzBnkk7e9Ql0891vlfgi+kHwOk8tQjiQHpqh4LaSa0fKEA==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/code-frame': 7.24.2 - '@babel/parser': 7.24.4 - '@babel/types': 7.24.0 - dev: true - /@babel/template@7.24.7: resolution: {integrity: sha512-jYqfPrU9JTF0PmPy1tLYHW4Mp4KlgxJD9l2nP9fD6yT/ICi554DmrWBAEYpIelzjHf1msDP3PxJIRt/nFNfBig==} engines: {node: '>=6.9.0'} @@ -1856,24 +1789,6 @@ packages: '@babel/types': 7.24.7 dev: true - /@babel/traverse@7.24.1: - resolution: {integrity: sha512-xuU6o9m68KeqZbQuDt2TcKSxUw/mrsvavlEqQ1leZ/B+C9tk6E4sRWy97WaXgvq5E+nU3cXMxv3WKOCanVMCmQ==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/code-frame': 7.24.2 - '@babel/generator': 7.24.4 - '@babel/helper-environment-visitor': 7.22.20 - '@babel/helper-function-name': 7.23.0 - '@babel/helper-hoist-variables': 7.22.5 - '@babel/helper-split-export-declaration': 7.22.6 - '@babel/parser': 7.24.4 - '@babel/types': 7.24.0 - debug: 4.3.4(supports-color@8.1.1) - globals: 11.12.0 - transitivePeerDependencies: - - supports-color - dev: true - /@babel/traverse@7.24.7: resolution: {integrity: sha512-yb65Ed5S/QAcewNPh0nZczy9JdYXkkAbIsEo+P7BE7yO3txAY30Y/oPa3QkQ5It3xVG2kpKMg9MsdxZaO31uKA==} engines: {node: '>=6.9.0'} @@ -4033,7 +3948,7 @@ packages: abitype: 0.10.3(typescript@5.4.5) axios: 1.6.8 dotenv: 16.4.5 - viem: 2.9.16(typescript@5.4.5)(zod@3.22.4) + viem: 2.9.16(typescript@5.4.5)(zod@3.23.8) transitivePeerDependencies: - bufferutil - debug @@ -4479,8 +4394,8 @@ packages: /@ungap/structured-clone@1.2.0: resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} - /@wagmi/cli@0.0.0-canary-20240313013119(typescript@5.4.5): - resolution: {integrity: sha512-9detC5+llu+6x+DeghsA8xCqEbh+CZ6r7iGkQvq3sn+PTx426a4A0TFnqyNkCHMkPPanDOy2E8busGN+yhyhVg==} + /@wagmi/cli@2.1.15(typescript@5.4.5): + resolution: {integrity: sha512-mtTxbuCDRRSd/2tPAklM+4vFOq5E/0zS5OfLE3Ax2KcUWciOnjLJ0m6BAQ6HzqY9YfWo8DXa7UqxzUBkvPYltg==} hasBin: true peerDependencies: typescript: '>=5.0.4' @@ -4488,26 +4403,27 @@ packages: typescript: optional: true dependencies: - abitype: 0.9.10(typescript@5.4.5)(zod@3.22.4) - bundle-require: 4.0.2(esbuild@0.19.12) + abitype: 1.0.6(typescript@5.4.5)(zod@3.23.8) + bundle-require: 4.2.1(esbuild@0.19.12) cac: 6.7.14 - change-case: 4.1.2 + change-case: 5.4.4 chokidar: 3.6.0 dedent: 0.7.0 dotenv: 16.4.5 dotenv-expand: 10.0.0 esbuild: 0.19.12 execa: 8.0.1 + fdir: 6.2.0(picomatch@3.0.1) find-up: 6.3.0 fs-extra: 11.2.0 - globby: 13.2.2 ora: 6.3.1 pathe: 1.1.2 picocolors: 1.0.0 + picomatch: 3.0.1 prettier: 3.2.5 typescript: 5.4.5 - viem: 2.9.16(typescript@5.4.5)(zod@3.22.4) - zod: 3.22.4 + viem: 2.9.16(typescript@5.4.5)(zod@3.23.8) + zod: 3.23.8 transitivePeerDependencies: - bufferutil - utf-8-validate @@ -4531,7 +4447,7 @@ packages: '@walletconnect/ethereum-provider': 2.11.2(react@18.3.1) '@walletconnect/modal': 2.6.2(react@18.3.1) typescript: 5.4.5 - viem: 2.9.16(typescript@5.4.5)(zod@3.22.4) + viem: 2.9.16(typescript@5.4.5)(zod@3.23.8) transitivePeerDependencies: - '@azure/app-configuration' - '@azure/cosmos' @@ -4574,7 +4490,7 @@ packages: eventemitter3: 5.0.1 mipd: 0.0.5(typescript@5.4.5) typescript: 5.4.5 - viem: 2.9.16(typescript@5.4.5)(zod@3.22.4) + viem: 2.9.16(typescript@5.4.5)(zod@3.23.8) zustand: 4.4.1(react@18.3.1) transitivePeerDependencies: - '@types/react' @@ -4978,11 +4894,11 @@ packages: typescript: 5.4.5 dev: false - /abitype@0.9.10(typescript@5.4.5)(zod@3.22.4): - resolution: {integrity: sha512-FIS7U4n7qwAT58KibwYig5iFG4K61rbhAqaQh/UWj8v1Y8mjX3F8TC9gd8cz9yT1TYel9f8nS5NO5kZp2RW0jQ==} + /abitype@0.9.8(typescript@5.4.5): + resolution: {integrity: sha512-puLifILdm+8sjyss4S+fsUN09obiT1g2YW6CtcQF+QDzxR0euzgEB29MZujC6zMk2a6SVmtttq1fc6+YFA7WYQ==} peerDependencies: typescript: '>=5.0.4' - zod: ^3 >=3.22.0 + zod: ^3 >=3.19.1 peerDependenciesMeta: typescript: optional: true @@ -4990,14 +4906,13 @@ packages: optional: true dependencies: typescript: 5.4.5 - zod: 3.22.4 dev: true - /abitype@0.9.8(typescript@5.4.5): - resolution: {integrity: sha512-puLifILdm+8sjyss4S+fsUN09obiT1g2YW6CtcQF+QDzxR0euzgEB29MZujC6zMk2a6SVmtttq1fc6+YFA7WYQ==} + /abitype@1.0.0(typescript@5.4.5)(zod@3.23.8): + resolution: {integrity: sha512-NMeMah//6bJ56H5XRj8QCV4AwuW6hB6zqz2LnhhLdcWVQOsXki6/Pn3APeqxCma62nXIcmZWdu1DlHWS74umVQ==} peerDependencies: typescript: '>=5.0.4' - zod: ^3 >=3.19.1 + zod: ^3 >=3.22.0 peerDependenciesMeta: typescript: optional: true @@ -5005,10 +4920,10 @@ packages: optional: true dependencies: typescript: 5.4.5 - dev: true + zod: 3.23.8 - /abitype@1.0.0(typescript@5.4.5)(zod@3.22.4): - resolution: {integrity: sha512-NMeMah//6bJ56H5XRj8QCV4AwuW6hB6zqz2LnhhLdcWVQOsXki6/Pn3APeqxCma62nXIcmZWdu1DlHWS74umVQ==} + /abitype@1.0.2(typescript@5.4.5): + resolution: {integrity: sha512-aFt4k2H+eiAKy/zxtnORa9iIb10BMBeWL18l8v4+QuwYEBXPxxjSB1bFZCzQmKPoj8m7j68K705l3uY+E2gAjg==} peerDependencies: typescript: '>=5.0.4' zod: ^3 >=3.22.0 @@ -5019,10 +4934,10 @@ packages: optional: true dependencies: typescript: 5.4.5 - zod: 3.22.4 + dev: true - /abitype@1.0.2(typescript@5.4.5): - resolution: {integrity: sha512-aFt4k2H+eiAKy/zxtnORa9iIb10BMBeWL18l8v4+QuwYEBXPxxjSB1bFZCzQmKPoj8m7j68K705l3uY+E2gAjg==} + /abitype@1.0.6(typescript@5.4.5)(zod@3.23.8): + resolution: {integrity: sha512-MMSqYh4+C/aVqI2RQaWqbvI4Kxo5cQV40WQ4QFtDnNzCkqChm8MuENhElmynZlO0qUy/ObkEUaXtKqYnx1Kp3A==} peerDependencies: typescript: '>=5.0.4' zod: ^3 >=3.22.0 @@ -5033,6 +4948,7 @@ packages: optional: true dependencies: typescript: 5.4.5 + zod: 3.23.8 dev: true /abort-controller@3.0.0: @@ -5587,8 +5503,8 @@ packages: engines: {node: '>=6'} dev: true - /bundle-require@4.0.2(esbuild@0.19.12): - resolution: {integrity: sha512-jwzPOChofl67PSTW2SGubV9HBQAhhR2i6nskiOThauo9dzwDUgOWQScFVaJkjEfYX+UXiD+LEx8EblQMc2wIag==} + /bundle-require@4.2.1(esbuild@0.19.12): + resolution: {integrity: sha512-7Q/6vkyYAwOmQNRw75x+4yRtZCZJXUDmHHlFdkiV0wgv/reNjtJwpu1jPJ0w2kbEpIM0uoKI3S4/f39dU7AjSA==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} peerDependencies: esbuild: '>=0.17' @@ -5659,13 +5575,6 @@ packages: resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} engines: {node: '>=6'} - /camel-case@4.1.2: - resolution: {integrity: sha512-gxGWBrTT1JuMx6R+o5PTXMmUnhnVzLQ9SNutD4YqKtI6ap897t3tKECYla6gCWEkplXnlNybEkZg9GEGxKFCgw==} - dependencies: - pascal-case: 3.1.2 - tslib: 2.6.2 - dev: true - /camelcase-keys@6.2.2: resolution: {integrity: sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==} engines: {node: '>=8'} @@ -5689,14 +5598,6 @@ packages: resolution: {integrity: sha512-JFPQs34lHKx1B5t1EpQpWH4c+29zIyn/haGsbpfq3suuV9v56enjFt23zqijxGTMwy1p/4H2tjnQMY+p1WoAyA==} dev: true - /capital-case@1.0.4: - resolution: {integrity: sha512-ds37W8CytHgwnhGGTi88pcPyR15qoNkOpYwmMMfnWqqWgESapLqvDx6huFjQ5vqWSn2Z06173XNA7LtMOeUh1A==} - dependencies: - no-case: 3.0.4 - tslib: 2.6.2 - upper-case-first: 2.0.2 - dev: true - /chai-as-promised@7.1.1(chai@4.4.1): resolution: {integrity: sha512-azL6xMoi+uxu6z4rhWQ1jbdUhOMhis2PvscD/xjLqNMkv3BPPp2JyyuTHOrf9BOosGpNQ11v6BKv/g57RXbiaA==} peerDependencies: @@ -5740,23 +5641,6 @@ packages: engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} dev: true - /change-case@4.1.2: - resolution: {integrity: sha512-bSxY2ws9OtviILG1EiY5K7NNxkqg/JnRnFxLtKQ96JaviiIxi7djMrSd0ECT9AC+lttClmYwKw53BWpOMblo7A==} - dependencies: - camel-case: 4.1.2 - capital-case: 1.0.4 - constant-case: 3.0.4 - dot-case: 3.0.4 - header-case: 2.0.4 - no-case: 3.0.4 - param-case: 3.0.4 - pascal-case: 3.1.2 - path-case: 3.0.4 - sentence-case: 3.0.4 - snake-case: 3.0.4 - tslib: 2.6.2 - dev: true - /change-case@5.4.4: resolution: {integrity: sha512-HRQyTk2/YPEkt9TnUPbOpr64Uw3KOicFWPVBb+xiHvd6eBx/qPr9xqfBFDT8P2vWsvvz4jbEkfDe71W3VyNu2w==} dev: true @@ -6047,14 +5931,6 @@ packages: engines: {node: ^14.18.0 || >=16.10.0} dev: true - /constant-case@3.0.4: - resolution: {integrity: sha512-I2hSBi7Vvs7BEuJDr5dDHfzb/Ruj3FyvFyh7KLilAjNQw3Be+xgqUBA2W6scVEcL0hL1dwPRtIqEPVUCKkSsyQ==} - dependencies: - no-case: 3.0.4 - tslib: 2.6.2 - upper-case: 2.0.2 - dev: true - /convert-source-map@1.9.0: resolution: {integrity: sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==} dev: true @@ -6493,13 +6369,6 @@ packages: webidl-conversions: 7.0.0 dev: true - /dot-case@3.0.4: - resolution: {integrity: sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w==} - dependencies: - no-case: 3.0.4 - tslib: 2.6.2 - dev: true - /dotenv-expand@10.0.0: resolution: {integrity: sha512-GopVGCpVS1UKH75VKHGuQFqS1Gusej0z4FyQkPdwjil2gNIv+LNsqBlboOzpJFZKVT95GkCyWJbBSdFEFUWI2A==} engines: {node: '>=12'} @@ -7203,6 +7072,17 @@ packages: bser: 2.1.1 dev: true + /fdir@6.2.0(picomatch@3.0.1): + resolution: {integrity: sha512-9XaWcDl0riOX5j2kYfy0kKdg7skw3IY6kA4LFT8Tk2yF9UdrADUy8D6AJuBLtf7ISm/MksumwAHE3WVbMRyCLw==} + peerDependencies: + picomatch: ^3 || ^4 + peerDependenciesMeta: + picomatch: + optional: true + dependencies: + picomatch: 3.0.1 + dev: true + /file-entry-cache@6.0.1: resolution: {integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==} engines: {node: ^10.12.0 || >=12.0.0} @@ -7517,6 +7397,7 @@ packages: /glob@7.2.3: resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} + deprecated: Glob versions prior to v9 are no longer supported dependencies: fs.realpath: 1.0.0 inflight: 1.0.6 @@ -7564,17 +7445,6 @@ packages: merge2: 1.4.1 slash: 3.0.0 - /globby@13.2.2: - resolution: {integrity: sha512-Y1zNGV+pzQdh7H39l9zgB4PJqjRNqydvdYCDG4HFXM4XuvSaQQlEc91IU1yALL8gUTDomgBAfz3XJdmUS+oo0w==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - dependencies: - dir-glob: 3.0.1 - fast-glob: 3.3.2 - ignore: 5.3.1 - merge2: 1.4.1 - slash: 4.0.0 - dev: true - /gopd@1.0.1: resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==} dependencies: @@ -7662,13 +7532,6 @@ packages: hasBin: true dev: true - /header-case@2.0.4: - resolution: {integrity: sha512-H/vuk5TEEVZwrR0lp2zed9OCo1uAILMlx0JEMgC26rzyJJ3N1v6XkwHHXJQdR2doSjcGPM6OKPYoJgf0plJ11Q==} - dependencies: - capital-case: 1.0.4 - tslib: 2.6.2 - dev: true - /hermes-estree@0.15.0: resolution: {integrity: sha512-lLYvAd+6BnOqWdnNbP/Q8xfl8LOGw4wVjfrNd9Gt8eoFzhNBRVD95n4l2ksfMVOoxuVyegs85g83KS9QOsxbVQ==} dev: true @@ -7879,6 +7742,7 @@ packages: /inflight@1.0.6: resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} + deprecated: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. dependencies: once: 1.4.0 wrappy: 1.0.2 @@ -9155,12 +9019,6 @@ packages: get-func-name: 2.0.2 dev: true - /lower-case@2.0.2: - resolution: {integrity: sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==} - dependencies: - tslib: 2.6.2 - dev: true - /lru-cache@10.2.0: resolution: {integrity: sha512-2bIM8x+VAf6JT4bKAljS1qUWgMsqZRPGJS6FSahIMPVvctcNhyVp7AJu7quxOW9jwkryBReKZY5tY5JYv2n/7Q==} engines: {node: 14 || >=16.14} @@ -9721,13 +9579,6 @@ packages: path-to-regexp: 6.2.2 dev: true - /no-case@3.0.4: - resolution: {integrity: sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==} - dependencies: - lower-case: 2.0.2 - tslib: 2.6.2 - dev: true - /nocache@3.0.4: resolution: {integrity: sha512-WDD0bdg9mbq6F4mRxEYcPWwfA1vxd0mrvKOyxI7Xj/atfRHVeutzuWByG//jfm4uPzp0y4Kj051EORCBSQMycw==} engines: {node: '>=12.0.0'} @@ -10067,7 +9918,7 @@ packages: resolution: {integrity: sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} dependencies: - yocto-queue: 1.0.0 + yocto-queue: 1.1.1 dev: true /p-locate@3.0.0: @@ -10107,13 +9958,6 @@ packages: engines: {node: '>=6'} dev: true - /param-case@3.0.4: - resolution: {integrity: sha512-RXlj7zCYokReqWpOPH9oYivUzLYZ5vAPIfEmCTNViosC78F8F0H9y7T7gG2M39ymgutxF5gcFEsyZQSph9Bp3A==} - dependencies: - dot-case: 3.0.4 - tslib: 2.6.2 - dev: true - /parent-module@1.0.1: resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} engines: {node: '>=6'} @@ -10159,20 +10003,6 @@ packages: engines: {node: '>= 0.8'} dev: true - /pascal-case@3.1.2: - resolution: {integrity: sha512-uWlGT3YSnK9x3BQJaOdcZwrnV6hPpd8jFH1/ucpiLRPh/2zCVJKS19E4GvYHvaCcACn3foXZ0cLB9Wrx1KGe5g==} - dependencies: - no-case: 3.0.4 - tslib: 2.6.2 - dev: true - - /path-case@3.0.4: - resolution: {integrity: sha512-qO4qCFjXqVTrcbPt/hQfhTQ+VhFsqNKOPtytgNKkKxSoEp3XPUQ8ObFuePylOIok5gjn69ry8XiULxCwot3Wfg==} - dependencies: - dot-case: 3.0.4 - tslib: 2.6.2 - dev: true - /path-exists@3.0.0: resolution: {integrity: sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==} engines: {node: '>=4'} @@ -10227,6 +10057,11 @@ packages: resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} engines: {node: '>=8.6'} + /picomatch@3.0.1: + resolution: {integrity: sha512-I3EurrIQMlRc9IaAZnqRR044Phh2DXY+55o7uJ0V+hYZAcQYSuFWsc9q5PvyDHUSCe1Qxn/iBz+78s86zWnGag==} + engines: {node: '>=10'} + dev: true + /pify@3.0.0: resolution: {integrity: sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==} engines: {node: '>=4'} @@ -10896,6 +10731,7 @@ packages: /rimraf@3.0.2: resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} + deprecated: Rimraf versions prior to v4 are no longer supported hasBin: true dependencies: glob: 7.2.3 @@ -11029,14 +10865,6 @@ packages: - supports-color dev: true - /sentence-case@3.0.4: - resolution: {integrity: sha512-8LS0JInaQMCRoQ7YUytAo/xUu5W2XnQxV2HI/6uM6U7CITS1RqPElr30V6uIqyMKM9lJGRVFy5/4CuzcixNYSg==} - dependencies: - no-case: 3.0.4 - tslib: 2.6.2 - upper-case-first: 2.0.2 - dev: true - /serialize-error@2.1.0: resolution: {integrity: sha512-ghgmKt5o4Tly5yEG/UJp8qTd0AN7Xalw4XBtDEKP655B699qMEtra1WlXeE6WIvdEG481JvRxULKsInq/iNysw==} engines: {node: '>=0.10.0'} @@ -11166,11 +10994,6 @@ packages: resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} engines: {node: '>=8'} - /slash@4.0.0: - resolution: {integrity: sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==} - engines: {node: '>=12'} - dev: true - /slice-ansi@2.1.0: resolution: {integrity: sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==} engines: {node: '>=6'} @@ -11193,13 +11016,6 @@ packages: yargs: 15.4.1 dev: true - /snake-case@3.0.4: - resolution: {integrity: sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg==} - dependencies: - dot-case: 3.0.4 - tslib: 2.6.2 - dev: true - /socket.io-client@4.7.5(bufferutil@4.0.8)(utf-8-validate@6.0.3): resolution: {integrity: sha512-sJ/tqHOCe7Z50JCBCXrsY3I2k03iOiUe+tj1OmKeD2lXPiGH/RUCdTZFoqVyN7l1MnpIzPrGtLcijffmeouNlQ==} engines: {node: '>=10.0.0'} @@ -12070,18 +11886,6 @@ packages: picocolors: 1.0.0 dev: true - /upper-case-first@2.0.2: - resolution: {integrity: sha512-514ppYHBaKwfJRK/pNC6c/OxfGa0obSnAl106u97Ed0I625Nin96KAjttZF6ZL3e1XLtphxnqrOi9iWgm+u+bg==} - dependencies: - tslib: 2.6.2 - dev: true - - /upper-case@2.0.2: - resolution: {integrity: sha512-KgdgDGJt2TpuwBUIjgG6lzw2GWFRCW9Qkfkiv0DxqHHLYJHmtmdUIKcZd8rHgFSjopVTlw6ggzCm1b8MFQwikg==} - dependencies: - tslib: 2.6.2 - dev: true - /uqr@0.1.2: resolution: {integrity: sha512-MJu7ypHq6QasgF5YRTjqscSzQp/W11zoUk6kvmlH+fmWEs63Y0Eib13hYFwAzagRJcVY8WVnlV+eBDUGMJ5IbA==} dev: true @@ -12212,7 +12016,7 @@ packages: - zod dev: true - /viem@2.9.16(typescript@5.4.5)(zod@3.22.4): + /viem@2.9.16(typescript@5.4.5)(zod@3.23.8): resolution: {integrity: sha512-FQRfN4G7uKEUs5DYvVrH/kZmTkwcSDpTBxnadpwG1EEP8nHm57WDpSaGN7PwSPVgJ6rMo5MENT5hgnqaNTlb2w==} peerDependencies: typescript: '>=5.0.4' @@ -12225,7 +12029,7 @@ packages: '@noble/hashes': 1.3.2 '@scure/bip32': 1.3.2 '@scure/bip39': 1.2.1 - abitype: 1.0.0(typescript@5.4.5)(zod@3.22.4) + abitype: 1.0.0(typescript@5.4.5)(zod@3.23.8) isows: 1.0.3(ws@8.13.0) typescript: 5.4.5 ws: 8.13.0 @@ -12267,7 +12071,7 @@ packages: react: 18.3.1 typescript: 5.4.5 use-sync-external-store: 1.2.0(react@18.3.1) - viem: 2.9.16(typescript@5.4.5)(zod@3.22.4) + viem: 2.9.16(typescript@5.4.5)(zod@3.23.8) transitivePeerDependencies: - '@azure/app-configuration' - '@azure/cosmos' @@ -12642,13 +12446,17 @@ packages: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} - /yocto-queue@1.0.0: - resolution: {integrity: sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==} + /yocto-queue@1.1.1: + resolution: {integrity: sha512-b4JR1PFR10y1mKjhHY9LaGo6tmrgjit7hxVIeAmyMw3jegXR4dhYqLaQF5zMXZxY7tLpMyJeLjr1C4rLmkVe8g==} engines: {node: '>=12.20'} dev: true /zod@3.22.4: resolution: {integrity: sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==} + dev: true + + /zod@3.23.8: + resolution: {integrity: sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==} /zustand@4.4.1(react@18.3.1): resolution: {integrity: sha512-QCPfstAS4EBiTQzlaGP1gmorkh/UL1Leaj2tdj+zZCZ/9bm0WS7sI2wnfD5lpOszFqWJ1DcPnGoY8RDL61uokw==}