@story-protocol/core-sdk 1.0.0-rc.18 → 1.0.0-rc.19

Sign up to get free protection for your applications and to get access to all the features.
@@ -512,14 +512,14 @@ var iliad = viem.defineChain({
512
512
  },
513
513
  rpcUrls: {
514
514
  "default": {
515
- http: ["https://rpc.partner.testnet.storyprotocol.net"],
515
+ http: ["https://testnet.storyrpc.io"],
516
516
  webSocket: ["wss://story-network.rpc.caldera.xyz/ws"]
517
517
  }
518
518
  },
519
519
  blockExplorers: {
520
520
  "default": {
521
521
  name: "Explorer",
522
- url: "https://explorer.testnet.storyprotocol.net"
522
+ url: "https://testnet.storyscan.xyz"
523
523
  }
524
524
  },
525
525
  contracts: {
@@ -9576,22 +9576,22 @@ var spgAbi = [{
9576
9576
  name: "recipient",
9577
9577
  internalType: "address",
9578
9578
  type: "address"
9579
- }, {
9580
- name: "nftMetadata",
9581
- internalType: "string",
9582
- type: "string"
9583
9579
  }, {
9584
9580
  name: "ipMetadata",
9585
9581
  internalType: "struct IStoryProtocolGateway.IPMetadata",
9586
9582
  type: "tuple",
9587
9583
  components: [{
9588
- name: "metadataURI",
9584
+ name: "ipMetadataURI",
9589
9585
  internalType: "string",
9590
9586
  type: "string"
9591
9587
  }, {
9592
- name: "metadataHash",
9588
+ name: "ipMetadataHash",
9593
9589
  internalType: "bytes32",
9594
9590
  type: "bytes32"
9591
+ }, {
9592
+ name: "nftMetadataURI",
9593
+ internalType: "string",
9594
+ type: "string"
9595
9595
  }, {
9596
9596
  name: "nftMetadataHash",
9597
9597
  internalType: "bytes32",
@@ -9619,22 +9619,22 @@ var spgAbi = [{
9619
9619
  name: "recipient",
9620
9620
  internalType: "address",
9621
9621
  type: "address"
9622
- }, {
9623
- name: "nftMetadata",
9624
- internalType: "string",
9625
- type: "string"
9626
9622
  }, {
9627
9623
  name: "ipMetadata",
9628
9624
  internalType: "struct IStoryProtocolGateway.IPMetadata",
9629
9625
  type: "tuple",
9630
9626
  components: [{
9631
- name: "metadataURI",
9627
+ name: "ipMetadataURI",
9632
9628
  internalType: "string",
9633
9629
  type: "string"
9634
9630
  }, {
9635
- name: "metadataHash",
9631
+ name: "ipMetadataHash",
9636
9632
  internalType: "bytes32",
9637
9633
  type: "bytes32"
9634
+ }, {
9635
+ name: "nftMetadataURI",
9636
+ internalType: "string",
9637
+ type: "string"
9638
9638
  }, {
9639
9639
  name: "nftMetadataHash",
9640
9640
  internalType: "bytes32",
@@ -9756,22 +9756,22 @@ var spgAbi = [{
9756
9756
  internalType: "bytes",
9757
9757
  type: "bytes"
9758
9758
  }]
9759
- }, {
9760
- name: "nftMetadata",
9761
- internalType: "string",
9762
- type: "string"
9763
9759
  }, {
9764
9760
  name: "ipMetadata",
9765
9761
  internalType: "struct IStoryProtocolGateway.IPMetadata",
9766
9762
  type: "tuple",
9767
9763
  components: [{
9768
- name: "metadataURI",
9764
+ name: "ipMetadataURI",
9769
9765
  internalType: "string",
9770
9766
  type: "string"
9771
9767
  }, {
9772
- name: "metadataHash",
9768
+ name: "ipMetadataHash",
9773
9769
  internalType: "bytes32",
9774
9770
  type: "bytes32"
9771
+ }, {
9772
+ name: "nftMetadataURI",
9773
+ internalType: "string",
9774
+ type: "string"
9775
9775
  }, {
9776
9776
  name: "nftMetadataHash",
9777
9777
  internalType: "bytes32",
@@ -9807,22 +9807,22 @@ var spgAbi = [{
9807
9807
  name: "royaltyContext",
9808
9808
  internalType: "bytes",
9809
9809
  type: "bytes"
9810
- }, {
9811
- name: "nftMetadata",
9812
- internalType: "string",
9813
- type: "string"
9814
9810
  }, {
9815
9811
  name: "ipMetadata",
9816
9812
  internalType: "struct IStoryProtocolGateway.IPMetadata",
9817
9813
  type: "tuple",
9818
9814
  components: [{
9819
- name: "metadataURI",
9815
+ name: "ipMetadataURI",
9820
9816
  internalType: "string",
9821
9817
  type: "string"
9822
9818
  }, {
9823
- name: "metadataHash",
9819
+ name: "ipMetadataHash",
9824
9820
  internalType: "bytes32",
9825
9821
  type: "bytes32"
9822
+ }, {
9823
+ name: "nftMetadataURI",
9824
+ internalType: "string",
9825
+ type: "string"
9826
9826
  }, {
9827
9827
  name: "nftMetadataHash",
9828
9828
  internalType: "bytes32",
@@ -9895,13 +9895,17 @@ var spgAbi = [{
9895
9895
  internalType: "struct IStoryProtocolGateway.IPMetadata",
9896
9896
  type: "tuple",
9897
9897
  components: [{
9898
- name: "metadataURI",
9898
+ name: "ipMetadataURI",
9899
9899
  internalType: "string",
9900
9900
  type: "string"
9901
9901
  }, {
9902
- name: "metadataHash",
9902
+ name: "ipMetadataHash",
9903
9903
  internalType: "bytes32",
9904
9904
  type: "bytes32"
9905
+ }, {
9906
+ name: "nftMetadataURI",
9907
+ internalType: "string",
9908
+ type: "string"
9905
9909
  }, {
9906
9910
  name: "nftMetadataHash",
9907
9911
  internalType: "bytes32",
@@ -9947,13 +9951,17 @@ var spgAbi = [{
9947
9951
  internalType: "struct IStoryProtocolGateway.IPMetadata",
9948
9952
  type: "tuple",
9949
9953
  components: [{
9950
- name: "metadataURI",
9954
+ name: "ipMetadataURI",
9951
9955
  internalType: "string",
9952
9956
  type: "string"
9953
9957
  }, {
9954
- name: "metadataHash",
9958
+ name: "ipMetadataHash",
9955
9959
  internalType: "bytes32",
9956
9960
  type: "bytes32"
9961
+ }, {
9962
+ name: "nftMetadataURI",
9963
+ internalType: "string",
9964
+ type: "string"
9957
9965
  }, {
9958
9966
  name: "nftMetadataHash",
9959
9967
  internalType: "bytes32",
@@ -10114,13 +10122,17 @@ var spgAbi = [{
10114
10122
  internalType: "struct IStoryProtocolGateway.IPMetadata",
10115
10123
  type: "tuple",
10116
10124
  components: [{
10117
- name: "metadataURI",
10125
+ name: "ipMetadataURI",
10118
10126
  internalType: "string",
10119
10127
  type: "string"
10120
10128
  }, {
10121
- name: "metadataHash",
10129
+ name: "ipMetadataHash",
10122
10130
  internalType: "bytes32",
10123
10131
  type: "bytes32"
10132
+ }, {
10133
+ name: "nftMetadataURI",
10134
+ internalType: "string",
10135
+ type: "string"
10124
10136
  }, {
10125
10137
  name: "nftMetadataHash",
10126
10138
  internalType: "bytes32",
@@ -10191,13 +10203,17 @@ var spgAbi = [{
10191
10203
  internalType: "struct IStoryProtocolGateway.IPMetadata",
10192
10204
  type: "tuple",
10193
10205
  components: [{
10194
- name: "metadataURI",
10206
+ name: "ipMetadataURI",
10195
10207
  internalType: "string",
10196
10208
  type: "string"
10197
10209
  }, {
10198
- name: "metadataHash",
10210
+ name: "ipMetadataHash",
10199
10211
  internalType: "bytes32",
10200
10212
  type: "bytes32"
10213
+ }, {
10214
+ name: "nftMetadataURI",
10215
+ internalType: "string",
10216
+ type: "string"
10201
10217
  }, {
10202
10218
  name: "nftMetadataHash",
10203
10219
  internalType: "bytes32",
@@ -17527,7 +17543,6 @@ var RoyaltyPolicyLapClient = /*#__PURE__*/function (_RoyaltyPolicyLapRead) {
17527
17543
  *
17528
17544
  * @param nftContract address
17529
17545
  * @param recipient address
17530
- * @param nftMetadata string
17531
17546
  * @param ipMetadata tuple
17532
17547
  */
17533
17548
 
@@ -17536,7 +17551,6 @@ var RoyaltyPolicyLapClient = /*#__PURE__*/function (_RoyaltyPolicyLapRead) {
17536
17551
  *
17537
17552
  * @param nftContract address
17538
17553
  * @param recipient address
17539
- * @param nftMetadata string
17540
17554
  * @param ipMetadata tuple
17541
17555
  * @param terms tuple
17542
17556
  */
@@ -17546,7 +17560,6 @@ var RoyaltyPolicyLapClient = /*#__PURE__*/function (_RoyaltyPolicyLapRead) {
17546
17560
  *
17547
17561
  * @param nftContract address
17548
17562
  * @param derivData tuple
17549
- * @param nftMetadata string
17550
17563
  * @param ipMetadata tuple
17551
17564
  * @param recipient address
17552
17565
  */
@@ -17557,7 +17570,6 @@ var RoyaltyPolicyLapClient = /*#__PURE__*/function (_RoyaltyPolicyLapRead) {
17557
17570
  * @param nftContract address
17558
17571
  * @param licenseTokenIds uint256[]
17559
17572
  * @param royaltyContext bytes
17560
- * @param nftMetadata string
17561
17573
  * @param ipMetadata tuple
17562
17574
  * @param recipient address
17563
17575
  */
@@ -17770,7 +17782,7 @@ var SpgClient = /*#__PURE__*/function (_SpgEventClient) {
17770
17782
  address: this.address,
17771
17783
  functionName: "mintAndRegisterIp",
17772
17784
  account: this.wallet.account,
17773
- args: [request.nftContract, request.recipient, request.nftMetadata, request.ipMetadata]
17785
+ args: [request.nftContract, request.recipient, request.ipMetadata]
17774
17786
  });
17775
17787
  case 2:
17776
17788
  _yield$this$rpcClient46 = _context112.sent;
@@ -17805,7 +17817,7 @@ var SpgClient = /*#__PURE__*/function (_SpgEventClient) {
17805
17817
  data: viem.encodeFunctionData({
17806
17818
  abi: spgAbi,
17807
17819
  functionName: "mintAndRegisterIp",
17808
- args: [request.nftContract, request.recipient, request.nftMetadata, request.ipMetadata]
17820
+ args: [request.nftContract, request.recipient, request.ipMetadata]
17809
17821
  })
17810
17822
  };
17811
17823
  }
@@ -17830,7 +17842,7 @@ var SpgClient = /*#__PURE__*/function (_SpgEventClient) {
17830
17842
  address: this.address,
17831
17843
  functionName: "mintAndRegisterIpAndAttachPILTerms",
17832
17844
  account: this.wallet.account,
17833
- args: [request.nftContract, request.recipient, request.nftMetadata, request.ipMetadata, request.terms]
17845
+ args: [request.nftContract, request.recipient, request.ipMetadata, request.terms]
17834
17846
  });
17835
17847
  case 2:
17836
17848
  _yield$this$rpcClient47 = _context113.sent;
@@ -17865,7 +17877,7 @@ var SpgClient = /*#__PURE__*/function (_SpgEventClient) {
17865
17877
  data: viem.encodeFunctionData({
17866
17878
  abi: spgAbi,
17867
17879
  functionName: "mintAndRegisterIpAndAttachPILTerms",
17868
- args: [request.nftContract, request.recipient, request.nftMetadata, request.ipMetadata, request.terms]
17880
+ args: [request.nftContract, request.recipient, request.ipMetadata, request.terms]
17869
17881
  })
17870
17882
  };
17871
17883
  }
@@ -17890,7 +17902,7 @@ var SpgClient = /*#__PURE__*/function (_SpgEventClient) {
17890
17902
  address: this.address,
17891
17903
  functionName: "mintAndRegisterIpAndMakeDerivative",
17892
17904
  account: this.wallet.account,
17893
- args: [request.nftContract, request.derivData, request.nftMetadata, request.ipMetadata, request.recipient]
17905
+ args: [request.nftContract, request.derivData, request.ipMetadata, request.recipient]
17894
17906
  });
17895
17907
  case 2:
17896
17908
  _yield$this$rpcClient48 = _context114.sent;
@@ -17925,7 +17937,7 @@ var SpgClient = /*#__PURE__*/function (_SpgEventClient) {
17925
17937
  data: viem.encodeFunctionData({
17926
17938
  abi: spgAbi,
17927
17939
  functionName: "mintAndRegisterIpAndMakeDerivative",
17928
- args: [request.nftContract, request.derivData, request.nftMetadata, request.ipMetadata, request.recipient]
17940
+ args: [request.nftContract, request.derivData, request.ipMetadata, request.recipient]
17929
17941
  })
17930
17942
  };
17931
17943
  }
@@ -17950,7 +17962,7 @@ var SpgClient = /*#__PURE__*/function (_SpgEventClient) {
17950
17962
  address: this.address,
17951
17963
  functionName: "mintAndRegisterIpAndMakeDerivativeWithLicenseTokens",
17952
17964
  account: this.wallet.account,
17953
- args: [request.nftContract, request.licenseTokenIds, request.royaltyContext, request.nftMetadata, request.ipMetadata, request.recipient]
17965
+ args: [request.nftContract, request.licenseTokenIds, request.royaltyContext, request.ipMetadata, request.recipient]
17954
17966
  });
17955
17967
  case 2:
17956
17968
  _yield$this$rpcClient49 = _context115.sent;
@@ -17985,7 +17997,7 @@ var SpgClient = /*#__PURE__*/function (_SpgEventClient) {
17985
17997
  data: viem.encodeFunctionData({
17986
17998
  abi: spgAbi,
17987
17999
  functionName: "mintAndRegisterIpAndMakeDerivativeWithLicenseTokens",
17988
- args: [request.nftContract, request.licenseTokenIds, request.royaltyContext, request.nftMetadata, request.ipMetadata, request.recipient]
18000
+ args: [request.nftContract, request.licenseTokenIds, request.royaltyContext, request.ipMetadata, request.recipient]
17989
18001
  })
17990
18002
  };
17991
18003
  }
@@ -18500,10 +18512,11 @@ var IPAssetClient = /*#__PURE__*/function () {
18500
18512
  * @param request - The request object that contains all data needed to register IP.
18501
18513
  * @param request.nftContract The address of the NFT.
18502
18514
  * @param request.tokenId The token identifier of the NFT.
18503
- * @param request.ipMetadata - [Optional] The ipMetadata for the IP.
18504
- * @param request.ipMetadata.metadataURI [Optional] The URI of the ipMetadata for the IP.
18505
- * @param request.ipMetadata.metadataHash [Optional] The ipMetadata for the IP.
18506
- * @param request.ipMetadata.nftMetadataHash [Optional] The ipMetadata for the IP NFT.
18515
+ * @param request.ipMetadata - [Optional] The desired metadata for the newly minted NFT and newly registered IP.
18516
+ * @param request.ipMetadata.ipMetadataURI [Optional] The URI of the metadata for the IP.
18517
+ * @param request.ipMetadata.ipMetadataHash [Optional] The hash of the metadata for the IP.
18518
+ * @param request.ipMetadata.nftMetadataURI [Optional] The URI of the metadata for the NFT.
18519
+ * @param request.ipMetadata.nftMetadataHash [Optional] The hash of the metadata for the IP NFT.
18507
18520
  * @param request.deadline [Optional] The deadline for the signature in milliseconds, default is 1000ms.
18508
18521
  * @param request.txOptions [Optional] The transaction options.
18509
18522
  * @returns A Promise that resolves to an object containing the transaction hash and optional IP ID if waitForTxn is set to true.
@@ -18513,7 +18526,7 @@ var IPAssetClient = /*#__PURE__*/function () {
18513
18526
  key: "register",
18514
18527
  value: (function () {
18515
18528
  var _register = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(request) {
18516
- var _request$txOptions, tokenId, ipIdAddress, isRegistered, object, _request$txOptions2, txHash, calculatedDeadline, signature, txReceipt, targetLogs;
18529
+ var _request$ipMetadata, _request$ipMetadata2, _request$ipMetadata3, _request$ipMetadata4, _request$txOptions, tokenId, ipIdAddress, isRegistered, object, _request$txOptions2, txHash, calculatedDeadline, signature, txReceipt, targetLogs;
18517
18530
  return _regeneratorRuntime().wrap(function _callee$(_context) {
18518
18531
  while (1) switch (_context.prev = _context.next) {
18519
18532
  case 0:
@@ -18539,9 +18552,10 @@ var IPAssetClient = /*#__PURE__*/function () {
18539
18552
  tokenId: tokenId,
18540
18553
  nftContract: getAddress$1(request.nftContract, "request.nftContract"),
18541
18554
  ipMetadata: {
18542
- metadataURI: "",
18543
- metadataHash: viem.zeroHash,
18544
- nftMetadataHash: viem.zeroHash
18555
+ ipMetadataURI: ((_request$ipMetadata = request.ipMetadata) === null || _request$ipMetadata === void 0 ? void 0 : _request$ipMetadata.ipMetadataURI) || "",
18556
+ ipMetadataHash: ((_request$ipMetadata2 = request.ipMetadata) === null || _request$ipMetadata2 === void 0 ? void 0 : _request$ipMetadata2.ipMetadataHash) || viem.zeroHash,
18557
+ nftMetadataURI: ((_request$ipMetadata3 = request.ipMetadata) === null || _request$ipMetadata3 === void 0 ? void 0 : _request$ipMetadata3.nftMetadataURI) || "",
18558
+ nftMetadataHash: ((_request$ipMetadata4 = request.ipMetadata) === null || _request$ipMetadata4 === void 0 ? void 0 : _request$ipMetadata4.nftMetadataHash) || viem.zeroHash
18545
18559
  },
18546
18560
  sigMetadata: {
18547
18561
  signer: viem.zeroAddress,
@@ -18549,25 +18563,18 @@ var IPAssetClient = /*#__PURE__*/function () {
18549
18563
  signature: viem.zeroHash
18550
18564
  }
18551
18565
  };
18552
- if (request.ipMetadata && (request.ipMetadata.metadataHash !== viem.zeroHash || request.ipMetadata.metadataURI !== "" || request.ipMetadata.nftMetadataHash !== viem.zeroHash)) {
18553
- object.ipMetadata = {
18554
- metadataURI: request.ipMetadata.metadataURI || object.ipMetadata.metadataURI,
18555
- metadataHash: request.ipMetadata.metadataHash || object.ipMetadata.metadataHash,
18556
- nftMetadataHash: request.ipMetadata.nftMetadataHash || object.ipMetadata.nftMetadataHash
18557
- };
18558
- }
18559
18566
  if (!((_request$txOptions = request.txOptions) !== null && _request$txOptions !== void 0 && _request$txOptions.encodedTxDataOnly)) {
18560
- _context.next = 20;
18567
+ _context.next = 19;
18561
18568
  break;
18562
18569
  }
18563
18570
  if (!request.ipMetadata) {
18564
- _context.next = 17;
18571
+ _context.next = 16;
18565
18572
  break;
18566
18573
  }
18567
18574
  return _context.abrupt("return", {
18568
18575
  encodedTxData: this.spgClient.registerIpEncode(object)
18569
18576
  });
18570
- case 17:
18577
+ case 16:
18571
18578
  return _context.abrupt("return", {
18572
18579
  encodedTxData: this.ipAssetRegistryClient.registerEncode({
18573
18580
  tokenContract: object.nftContract,
@@ -18575,16 +18582,16 @@ var IPAssetClient = /*#__PURE__*/function () {
18575
18582
  chainid: chain[this.chainId]
18576
18583
  })
18577
18584
  });
18578
- case 18:
18579
- _context.next = 43;
18585
+ case 17:
18586
+ _context.next = 42;
18580
18587
  break;
18581
- case 20:
18588
+ case 19:
18582
18589
  if (!request.ipMetadata) {
18583
- _context.next = 31;
18590
+ _context.next = 30;
18584
18591
  break;
18585
18592
  }
18586
18593
  calculatedDeadline = getDeadline(request.deadline);
18587
- _context.next = 24;
18594
+ _context.next = 23;
18588
18595
  return getPermissionSignature({
18589
18596
  ipId: ipIdAddress,
18590
18597
  deadline: calculatedDeadline,
@@ -18601,60 +18608,60 @@ var IPAssetClient = /*#__PURE__*/function () {
18601
18608
  func: "function setAll(address,string,bytes32,bytes32)"
18602
18609
  }]
18603
18610
  });
18604
- case 24:
18611
+ case 23:
18605
18612
  signature = _context.sent;
18606
18613
  object.sigMetadata = {
18607
18614
  signer: getAddress$1(this.wallet.account.address, "wallet.account.address"),
18608
18615
  deadline: calculatedDeadline,
18609
18616
  signature: signature
18610
18617
  };
18611
- _context.next = 28;
18618
+ _context.next = 27;
18612
18619
  return this.spgClient.registerIp(object);
18613
- case 28:
18620
+ case 27:
18614
18621
  txHash = _context.sent;
18615
- _context.next = 34;
18616
- break;
18617
- case 31:
18618
18622
  _context.next = 33;
18623
+ break;
18624
+ case 30:
18625
+ _context.next = 32;
18619
18626
  return this.ipAssetRegistryClient.register({
18620
18627
  tokenContract: object.nftContract,
18621
18628
  tokenId: object.tokenId,
18622
18629
  chainid: chain[this.chainId]
18623
18630
  });
18624
- case 33:
18631
+ case 32:
18625
18632
  txHash = _context.sent;
18626
- case 34:
18633
+ case 33:
18627
18634
  if (!((_request$txOptions2 = request.txOptions) !== null && _request$txOptions2 !== void 0 && _request$txOptions2.waitForTransaction)) {
18628
- _context.next = 42;
18635
+ _context.next = 41;
18629
18636
  break;
18630
18637
  }
18631
- _context.next = 37;
18638
+ _context.next = 36;
18632
18639
  return this.rpcClient.waitForTransactionReceipt({
18633
18640
  hash: txHash
18634
18641
  });
18635
- case 37:
18642
+ case 36:
18636
18643
  txReceipt = _context.sent;
18637
18644
  targetLogs = this.ipAssetRegistryClient.parseTxIpRegisteredEvent(txReceipt);
18638
18645
  return _context.abrupt("return", {
18639
18646
  txHash: txHash,
18640
18647
  ipId: targetLogs[0].ipId
18641
18648
  });
18642
- case 42:
18649
+ case 41:
18643
18650
  return _context.abrupt("return", {
18644
18651
  txHash: txHash
18645
18652
  });
18646
- case 43:
18647
- _context.next = 48;
18653
+ case 42:
18654
+ _context.next = 47;
18648
18655
  break;
18649
- case 45:
18650
- _context.prev = 45;
18656
+ case 44:
18657
+ _context.prev = 44;
18651
18658
  _context.t0 = _context["catch"](0);
18652
18659
  handleError(_context.t0, "Failed to register IP");
18653
- case 48:
18660
+ case 47:
18654
18661
  case "end":
18655
18662
  return _context.stop();
18656
18663
  }
18657
- }, _callee, this, [[0, 45]]);
18664
+ }, _callee, this, [[0, 44]]);
18658
18665
  }));
18659
18666
  function register(_x) {
18660
18667
  return _register.apply(this, arguments);
@@ -18937,11 +18944,11 @@ var IPAssetClient = /*#__PURE__*/function () {
18937
18944
  * @param request - The request object that contains all data needed to mint and register ip.
18938
18945
  * @param request.nftContract The address of the NFT collection.
18939
18946
  * @param request.pilType The type of the PIL.
18940
- * @param request.ipMetadata - [Optional] The ipMetadata for the IP.
18941
- * @param request.ipMetadata.metadataURI [Optional] The URI of the ipMetadata for the IP.
18942
- * @param request.ipMetadata.metadataHash [Optional] The ipMetadata for the IP.
18943
- * @param request.ipMetadata.nftMetadataHash [Optional] The ipMetadata for the IP NFT.
18944
- * @param request.nftMetadata [Optional] The desired metadata for the newly minted NFT.
18947
+ * @param request.ipMetadata - [Optional] The desired metadata for the newly minted NFT and newly registered IP.
18948
+ * @param request.ipMetadata.ipMetadataURI [Optional] The URI of the metadata for the IP.
18949
+ * @param request.ipMetadata.ipMetadataHash [Optional] The hash of the metadata for the IP.
18950
+ * @param request.ipMetadata.nftMetadataURI [Optional] The URI of the metadata for the NFT.
18951
+ * @param request.ipMetadata.nftMetadataHash [Optional] The hash of the metadata for the IP NFT.
18945
18952
  * @param request.recipient [Optional] The address of the recipient of the minted NFT.
18946
18953
  * @param request.mintingFee [Optional] The fee to be paid when minting a license.
18947
18954
  * @param request.commercialRevShare [Optional] Percentage of revenue that must be shared with the licensor.
@@ -18956,7 +18963,7 @@ var IPAssetClient = /*#__PURE__*/function () {
18956
18963
  key: "mintAndRegisterIpAssetWithPilTerms",
18957
18964
  value: (function () {
18958
18965
  var _mintAndRegisterIpAssetWithPilTerms = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(request) {
18959
- var _request$txOptions7, licenseTerm, object, _request$txOptions8, txHash, txReceipt, iPRegisteredLog, licenseTermsId;
18966
+ var _request$ipMetadata5, _request$ipMetadata6, _request$ipMetadata7, _request$ipMetadata8, _request$txOptions7, licenseTerm, object, _request$txOptions8, txHash, txReceipt, iPRegisteredLog, licenseTermsId;
18960
18967
  return _regeneratorRuntime().wrap(function _callee4$(_context4) {
18961
18968
  while (1) switch (_context4.prev = _context4.next) {
18962
18969
  case 0:
@@ -18978,40 +18985,33 @@ var IPAssetClient = /*#__PURE__*/function () {
18978
18985
  recipient: request.recipient && getAddress$1(request.recipient, "request.recipient") || this.wallet.account.address,
18979
18986
  terms: licenseTerm,
18980
18987
  ipMetadata: {
18981
- metadataURI: "",
18982
- metadataHash: viem.zeroHash,
18983
- nftMetadataHash: viem.zeroHash
18984
- },
18985
- nftMetadata: request.nftMetadata || ""
18988
+ ipMetadataURI: ((_request$ipMetadata5 = request.ipMetadata) === null || _request$ipMetadata5 === void 0 ? void 0 : _request$ipMetadata5.ipMetadataURI) || "",
18989
+ ipMetadataHash: ((_request$ipMetadata6 = request.ipMetadata) === null || _request$ipMetadata6 === void 0 ? void 0 : _request$ipMetadata6.ipMetadataHash) || viem.zeroHash,
18990
+ nftMetadataURI: ((_request$ipMetadata7 = request.ipMetadata) === null || _request$ipMetadata7 === void 0 ? void 0 : _request$ipMetadata7.nftMetadataURI) || "",
18991
+ nftMetadataHash: ((_request$ipMetadata8 = request.ipMetadata) === null || _request$ipMetadata8 === void 0 ? void 0 : _request$ipMetadata8.nftMetadataHash) || viem.zeroHash
18992
+ }
18986
18993
  };
18987
- if (request.ipMetadata && (request.ipMetadata.metadataHash !== viem.zeroHash || request.ipMetadata.metadataURI !== "" || request.ipMetadata.nftMetadataHash !== viem.zeroHash)) {
18988
- object.ipMetadata = {
18989
- metadataURI: request.ipMetadata.metadataURI || object.ipMetadata.metadataURI,
18990
- metadataHash: request.ipMetadata.metadataHash || object.ipMetadata.metadataHash,
18991
- nftMetadataHash: request.ipMetadata.nftMetadataHash || object.ipMetadata.nftMetadataHash
18992
- };
18993
- }
18994
18994
  if (!((_request$txOptions7 = request.txOptions) !== null && _request$txOptions7 !== void 0 && _request$txOptions7.encodedTxDataOnly)) {
18995
- _context4.next = 10;
18995
+ _context4.next = 9;
18996
18996
  break;
18997
18997
  }
18998
18998
  return _context4.abrupt("return", {
18999
18999
  encodedTxData: this.spgClient.mintAndRegisterIpAndAttachPilTermsEncode(object)
19000
19000
  });
19001
- case 10:
19002
- _context4.next = 12;
19001
+ case 9:
19002
+ _context4.next = 11;
19003
19003
  return this.spgClient.mintAndRegisterIpAndAttachPilTerms(object);
19004
- case 12:
19004
+ case 11:
19005
19005
  txHash = _context4.sent;
19006
19006
  if (!((_request$txOptions8 = request.txOptions) !== null && _request$txOptions8 !== void 0 && _request$txOptions8.waitForTransaction)) {
19007
- _context4.next = 20;
19007
+ _context4.next = 19;
19008
19008
  break;
19009
19009
  }
19010
- _context4.next = 16;
19010
+ _context4.next = 15;
19011
19011
  return this.rpcClient.waitForTransactionReceipt({
19012
19012
  hash: txHash
19013
19013
  });
19014
- case 16:
19014
+ case 15:
19015
19015
  txReceipt = _context4.sent;
19016
19016
  iPRegisteredLog = this.ipAssetRegistryClient.parseTxIpRegisteredEvent(txReceipt)[0];
19017
19017
  licenseTermsId = this.licensingModuleClient.parseTxLicenseTermsAttachedEvent(txReceipt)[0].licenseTermsId;
@@ -19021,22 +19021,22 @@ var IPAssetClient = /*#__PURE__*/function () {
19021
19021
  licenseTermsId: licenseTermsId,
19022
19022
  tokenId: iPRegisteredLog.tokenId
19023
19023
  });
19024
- case 20:
19024
+ case 19:
19025
19025
  return _context4.abrupt("return", {
19026
19026
  txHash: txHash
19027
19027
  });
19028
- case 21:
19029
- _context4.next = 26;
19028
+ case 20:
19029
+ _context4.next = 25;
19030
19030
  break;
19031
- case 23:
19032
- _context4.prev = 23;
19031
+ case 22:
19032
+ _context4.prev = 22;
19033
19033
  _context4.t0 = _context4["catch"](0);
19034
19034
  handleError(_context4.t0, "Failed to mint and register IP and attach PIL terms");
19035
- case 26:
19035
+ case 25:
19036
19036
  case "end":
19037
19037
  return _context4.stop();
19038
19038
  }
19039
- }, _callee4, this, [[0, 23]]);
19039
+ }, _callee4, this, [[0, 22]]);
19040
19040
  }));
19041
19041
  function mintAndRegisterIpAssetWithPilTerms(_x4) {
19042
19042
  return _mintAndRegisterIpAssetWithPilTerms.apply(this, arguments);
@@ -19049,10 +19049,11 @@ var IPAssetClient = /*#__PURE__*/function () {
19049
19049
  * @param request.nftContract The address of the NFT collection.
19050
19050
  * @param request.tokenId The ID of the NFT.
19051
19051
  * @param request.pilType The type of the PIL.
19052
- * @param request.ipMetadata - [Optional] The desired ipMetadata for the newly registered IP.
19053
- * @param request.ipMetadata.metadataURI [Optional] The the ipMetadata for the IP hash.
19054
- * @param request.ipMetadata.metadataHash [Optional] The ipMetadata for the IP.
19055
- * @param request.ipMetadata.nftMetadataHash [Optional] The ipMetadata for the IP NFT.
19052
+ * @param request.ipMetadata - [Optional] The desired metadata for the newly minted NFT and newly registered IP.
19053
+ * @param request.ipMetadata.ipMetadataURI [Optional] The URI of the metadata for the IP.
19054
+ * @param request.ipMetadata.ipMetadataHash [Optional] The hash of the metadata for the IP.
19055
+ * @param request.ipMetadata.nftMetadataURI [Optional] The URI of the metadata for the NFT.
19056
+ * @param request.ipMetadata.nftMetadataHash [Optional] The hash of the metadata for the IP NFT.
19056
19057
  * @param request.deadline [Optional] The deadline for the signature in milliseconds, default is 1000ms.
19057
19058
  * @param request.mintingFee [Optional] The fee to be paid when minting a license.
19058
19059
  * @param request.commercialRevShare [Optional] Percentage of revenue that must be shared with the licensor.
@@ -19066,7 +19067,7 @@ var IPAssetClient = /*#__PURE__*/function () {
19066
19067
  key: "registerIpAndAttachPilTerms",
19067
19068
  value: (function () {
19068
19069
  var _registerIpAndAttachPilTerms = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(request) {
19069
- var _request$txOptions9, ipIdAddress, isRegistered, licenseTerm, calculatedDeadline, sigAttachSignature, object, sigMetadataSignature, _request$txOptions10, txHash, txReceipt, log;
19070
+ var _request$ipMetadata9, _request$ipMetadata10, _request$ipMetadata11, _request$ipMetadata12, _request$txOptions9, ipIdAddress, isRegistered, licenseTerm, calculatedDeadline, sigAttachSignature, object, sigMetadataSignature, _request$txOptions10, txHash, txReceipt, log;
19070
19071
  return _regeneratorRuntime().wrap(function _callee5$(_context5) {
19071
19072
  while (1) switch (_context5.prev = _context5.next) {
19072
19073
  case 0:
@@ -19127,9 +19128,10 @@ var IPAssetClient = /*#__PURE__*/function () {
19127
19128
  tokenId: request.tokenId,
19128
19129
  terms: licenseTerm,
19129
19130
  ipMetadata: {
19130
- metadataURI: "",
19131
- metadataHash: viem.zeroHash,
19132
- nftMetadataHash: viem.zeroHash
19131
+ ipMetadataURI: ((_request$ipMetadata9 = request.ipMetadata) === null || _request$ipMetadata9 === void 0 ? void 0 : _request$ipMetadata9.ipMetadataURI) || "",
19132
+ ipMetadataHash: ((_request$ipMetadata10 = request.ipMetadata) === null || _request$ipMetadata10 === void 0 ? void 0 : _request$ipMetadata10.ipMetadataHash) || viem.zeroHash,
19133
+ nftMetadataURI: ((_request$ipMetadata11 = request.ipMetadata) === null || _request$ipMetadata11 === void 0 ? void 0 : _request$ipMetadata11.nftMetadataURI) || "",
19134
+ nftMetadataHash: ((_request$ipMetadata12 = request.ipMetadata) === null || _request$ipMetadata12 === void 0 ? void 0 : _request$ipMetadata12.nftMetadataHash) || viem.zeroHash
19133
19135
  },
19134
19136
  sigMetadata: {
19135
19137
  signer: viem.zeroAddress,
@@ -19142,14 +19144,7 @@ var IPAssetClient = /*#__PURE__*/function () {
19142
19144
  signature: sigAttachSignature
19143
19145
  }
19144
19146
  };
19145
- if (request.ipMetadata && (request.ipMetadata.metadataHash !== viem.zeroHash || request.ipMetadata.metadataURI !== "" || request.ipMetadata.nftMetadataHash !== viem.zeroHash)) {
19146
- object.ipMetadata = {
19147
- metadataURI: request.ipMetadata.metadataURI || object.ipMetadata.metadataURI,
19148
- metadataHash: request.ipMetadata.metadataHash || object.ipMetadata.metadataHash,
19149
- nftMetadataHash: request.ipMetadata.nftMetadataHash || object.ipMetadata.nftMetadataHash
19150
- };
19151
- }
19152
- _context5.next = 21;
19147
+ _context5.next = 20;
19153
19148
  return getPermissionSignature({
19154
19149
  ipId: ipIdAddress,
19155
19150
  deadline: calculatedDeadline,
@@ -19166,7 +19161,7 @@ var IPAssetClient = /*#__PURE__*/function () {
19166
19161
  func: "function setAll(address,string,bytes32,bytes32)"
19167
19162
  }]
19168
19163
  });
19169
- case 21:
19164
+ case 20:
19170
19165
  sigMetadataSignature = _context5.sent;
19171
19166
  object.sigMetadata = {
19172
19167
  signer: getAddress$1(this.wallet.account.address, "wallet.account.address"),
@@ -19174,26 +19169,26 @@ var IPAssetClient = /*#__PURE__*/function () {
19174
19169
  signature: sigMetadataSignature
19175
19170
  };
19176
19171
  if (!((_request$txOptions9 = request.txOptions) !== null && _request$txOptions9 !== void 0 && _request$txOptions9.encodedTxDataOnly)) {
19177
- _context5.next = 27;
19172
+ _context5.next = 26;
19178
19173
  break;
19179
19174
  }
19180
19175
  return _context5.abrupt("return", {
19181
19176
  encodedTxData: this.spgClient.registerIpAndAttachPilTermsEncode(object)
19182
19177
  });
19183
- case 27:
19184
- _context5.next = 29;
19178
+ case 26:
19179
+ _context5.next = 28;
19185
19180
  return this.spgClient.registerIpAndAttachPilTerms(object);
19186
- case 29:
19181
+ case 28:
19187
19182
  txHash = _context5.sent;
19188
19183
  if (!((_request$txOptions10 = request.txOptions) !== null && _request$txOptions10 !== void 0 && _request$txOptions10.waitForTransaction)) {
19189
- _context5.next = 36;
19184
+ _context5.next = 35;
19190
19185
  break;
19191
19186
  }
19192
- _context5.next = 33;
19187
+ _context5.next = 32;
19193
19188
  return this.rpcClient.waitForTransactionReceipt({
19194
19189
  hash: txHash
19195
19190
  });
19196
- case 33:
19191
+ case 32:
19197
19192
  txReceipt = _context5.sent;
19198
19193
  log = this.licensingModuleClient.parseTxLicenseTermsAttachedEvent(txReceipt)[0];
19199
19194
  return _context5.abrupt("return", {
@@ -19201,22 +19196,22 @@ var IPAssetClient = /*#__PURE__*/function () {
19201
19196
  licenseTermsId: log.licenseTermsId,
19202
19197
  ipId: log.ipId
19203
19198
  });
19204
- case 36:
19199
+ case 35:
19205
19200
  return _context5.abrupt("return", {
19206
19201
  txHash: txHash
19207
19202
  });
19208
- case 37:
19209
- _context5.next = 42;
19203
+ case 36:
19204
+ _context5.next = 41;
19210
19205
  break;
19211
- case 39:
19212
- _context5.prev = 39;
19206
+ case 38:
19207
+ _context5.prev = 38;
19213
19208
  _context5.t0 = _context5["catch"](0);
19214
19209
  handleError(_context5.t0, "Failed to register IP and attach PIL terms");
19215
- case 42:
19210
+ case 41:
19216
19211
  case "end":
19217
19212
  return _context5.stop();
19218
19213
  }
19219
- }, _callee5, this, [[0, 39]]);
19214
+ }, _callee5, this, [[0, 38]]);
19220
19215
  }));
19221
19216
  function registerIpAndAttachPilTerms(_x5) {
19222
19217
  return _registerIpAndAttachPilTerms.apply(this, arguments);
@@ -19232,10 +19227,11 @@ var IPAssetClient = /*#__PURE__*/function () {
19232
19227
  * @param request.derivData.parentIpIds The IDs of the parent IPs to link the registered derivative IP.
19233
19228
  * @param request.derivData.licenseTemplate [Optional] The address of the license template to be used for the linking.
19234
19229
  * @param request.derivData.licenseTermsIds The IDs of the license terms to be used for the linking.
19235
- * @param request.ipMetadata - [Optional] The desired ipMetadata for the newly registered IP.
19236
- * @param request.ipMetadata.metadataURI [Optional] The URI of the ipMetadata for the IP.
19237
- * @param request.ipMetadata.metadataHash [Optional] The ipMetadata for the IP.
19238
- * @param request.ipMetadata.nftMetadataHash [Optional] The the ipMetadata for the IP NFT.
19230
+ * @param request.ipMetadata - [Optional] The desired metadata for the newly minted NFT and newly registered IP.
19231
+ * @param request.ipMetadata.ipMetadataURI [Optional] The URI of the metadata for the IP.
19232
+ * @param request.ipMetadata.ipMetadataHash [Optional] The hash of the metadata for the IP.
19233
+ * @param request.ipMetadata.nftMetadataURI [Optional] The URI of the metadata for the NFT.
19234
+ * @param request.ipMetadata.nftMetadataHash [Optional] The hash of the metadata for the IP NFT.
19239
19235
  * @param request.deadline [Optional] The deadline for the signature in milliseconds,default is 1000ms.
19240
19236
  * @param request.txOptions [Optional] The transaction options.
19241
19237
  * @returns A Promise that resolves to an object containing the transaction hash and optional IP ID if waitForTxn is set to true.
@@ -19246,7 +19242,7 @@ var IPAssetClient = /*#__PURE__*/function () {
19246
19242
  key: "registerDerivativeIp",
19247
19243
  value: (function () {
19248
19244
  var _registerDerivativeIp = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(request) {
19249
- var _request$txOptions11, tokenId, ipIdAddress, isRegistered, i, isAttachedLicenseTerms, calculatedDeadline, sigRegisterSignature, object, sigMetadataSignature, _request$txOptions12, txHash, receipt, log;
19245
+ var _request$ipMetadata13, _request$ipMetadata14, _request$ipMetadata15, _request$ipMetadata16, _request$txOptions11, tokenId, ipIdAddress, isRegistered, i, isAttachedLicenseTerms, calculatedDeadline, sigRegisterSignature, object, sigMetadataSignature, _request$txOptions12, txHash, receipt, log;
19250
19246
  return _regeneratorRuntime().wrap(function _callee6$(_context6) {
19251
19247
  while (1) switch (_context6.prev = _context6.next) {
19252
19248
  case 0:
@@ -19339,9 +19335,10 @@ var IPAssetClient = /*#__PURE__*/function () {
19339
19335
  signature: sigRegisterSignature
19340
19336
  },
19341
19337
  ipMetadata: {
19342
- metadataURI: "",
19343
- metadataHash: viem.zeroHash,
19344
- nftMetadataHash: viem.zeroHash
19338
+ ipMetadataURI: ((_request$ipMetadata13 = request.ipMetadata) === null || _request$ipMetadata13 === void 0 ? void 0 : _request$ipMetadata13.ipMetadataURI) || "",
19339
+ ipMetadataHash: ((_request$ipMetadata14 = request.ipMetadata) === null || _request$ipMetadata14 === void 0 ? void 0 : _request$ipMetadata14.ipMetadataHash) || viem.zeroHash,
19340
+ nftMetadataURI: ((_request$ipMetadata15 = request.ipMetadata) === null || _request$ipMetadata15 === void 0 ? void 0 : _request$ipMetadata15.nftMetadataURI) || "",
19341
+ nftMetadataHash: ((_request$ipMetadata16 = request.ipMetadata) === null || _request$ipMetadata16 === void 0 ? void 0 : _request$ipMetadata16.nftMetadataHash) || viem.zeroHash
19345
19342
  },
19346
19343
  sigMetadata: {
19347
19344
  signer: viem.zeroAddress,
@@ -19349,14 +19346,7 @@ var IPAssetClient = /*#__PURE__*/function () {
19349
19346
  signature: viem.zeroHash
19350
19347
  }
19351
19348
  };
19352
- if (request.ipMetadata && (request.ipMetadata.metadataHash !== viem.zeroHash || request.ipMetadata.metadataURI !== "" || request.ipMetadata.nftMetadataHash !== viem.zeroHash)) {
19353
- object.ipMetadata = {
19354
- metadataURI: request.ipMetadata.metadataURI || object.ipMetadata.metadataURI,
19355
- metadataHash: request.ipMetadata.metadataHash || object.ipMetadata.metadataHash,
19356
- nftMetadataHash: request.ipMetadata.nftMetadataHash || object.ipMetadata.nftMetadataHash
19357
- };
19358
- }
19359
- _context6.next = 30;
19349
+ _context6.next = 29;
19360
19350
  return getPermissionSignature({
19361
19351
  ipId: ipIdAddress,
19362
19352
  deadline: calculatedDeadline,
@@ -19373,7 +19363,7 @@ var IPAssetClient = /*#__PURE__*/function () {
19373
19363
  func: "function setAll(address,string,bytes32,bytes32)"
19374
19364
  }]
19375
19365
  });
19376
- case 30:
19366
+ case 29:
19377
19367
  sigMetadataSignature = _context6.sent;
19378
19368
  object.sigMetadata = {
19379
19369
  signer: getAddress$1(this.wallet.account.address, "wallet.account.address"),
@@ -19381,48 +19371,48 @@ var IPAssetClient = /*#__PURE__*/function () {
19381
19371
  signature: sigMetadataSignature
19382
19372
  };
19383
19373
  if (!((_request$txOptions11 = request.txOptions) !== null && _request$txOptions11 !== void 0 && _request$txOptions11.encodedTxDataOnly)) {
19384
- _context6.next = 36;
19374
+ _context6.next = 35;
19385
19375
  break;
19386
19376
  }
19387
19377
  return _context6.abrupt("return", {
19388
19378
  encodedTxData: this.spgClient.registerIpAndMakeDerivativeEncode(object)
19389
19379
  });
19390
- case 36:
19391
- _context6.next = 38;
19380
+ case 35:
19381
+ _context6.next = 37;
19392
19382
  return this.spgClient.registerIpAndMakeDerivative(object);
19393
- case 38:
19383
+ case 37:
19394
19384
  txHash = _context6.sent;
19395
19385
  if (!((_request$txOptions12 = request.txOptions) !== null && _request$txOptions12 !== void 0 && _request$txOptions12.waitForTransaction)) {
19396
- _context6.next = 45;
19386
+ _context6.next = 44;
19397
19387
  break;
19398
19388
  }
19399
- _context6.next = 42;
19389
+ _context6.next = 41;
19400
19390
  return this.rpcClient.waitForTransactionReceipt({
19401
19391
  hash: txHash
19402
19392
  });
19403
- case 42:
19393
+ case 41:
19404
19394
  receipt = _context6.sent;
19405
19395
  log = this.ipAssetRegistryClient.parseTxIpRegisteredEvent(receipt)[0];
19406
19396
  return _context6.abrupt("return", {
19407
19397
  txHash: txHash,
19408
19398
  ipId: log.ipId
19409
19399
  });
19410
- case 45:
19400
+ case 44:
19411
19401
  return _context6.abrupt("return", {
19412
19402
  txHash: txHash
19413
19403
  });
19414
- case 46:
19415
- _context6.next = 51;
19404
+ case 45:
19405
+ _context6.next = 50;
19416
19406
  break;
19417
- case 48:
19418
- _context6.prev = 48;
19407
+ case 47:
19408
+ _context6.prev = 47;
19419
19409
  _context6.t0 = _context6["catch"](0);
19420
19410
  handleError(_context6.t0, "Failed to register derivative IP");
19421
- case 51:
19411
+ case 50:
19422
19412
  case "end":
19423
19413
  return _context6.stop();
19424
19414
  }
19425
- }, _callee6, this, [[0, 48]]);
19415
+ }, _callee6, this, [[0, 47]]);
19426
19416
  }));
19427
19417
  function registerDerivativeIp(_x6) {
19428
19418
  return _registerDerivativeIp.apply(this, arguments);
@@ -19437,11 +19427,11 @@ var IPAssetClient = /*#__PURE__*/function () {
19437
19427
  * @param request.derivData.parentIpIds The IDs of the parent IPs to link the registered derivative IP.
19438
19428
  * @param request.derivData.licenseTermsIds The IDs of the license terms to be used for the linking.
19439
19429
  * @param request.derivData.licenseTemplate [Optional] The address of the license template to be used for the linking.
19440
- * @param request.ipMetadata - [Optional] The desired ipMetadata for the newly registered IP.
19441
- * @param request.ipMetadata.metadataURI [Optional] The URI of the ipMetadata for the IP.
19442
- * @param request.ipMetadata.metadataHash [Optional] The ipMetadata for the IP.
19443
- * @param request.ipMetadata.nftMetadataHash [Optional] The the ipMetadata for the IP NFT.
19444
- * @param request.recipient [Optional] The address of the recipient of the minted NFT.
19430
+ * @param request.ipMetadata - [Optional] The desired metadata for the newly minted NFT and newly registered IP.
19431
+ * @param request.ipMetadata.ipMetadataURI [Optional] The URI of the metadata for the IP.
19432
+ * @param request.ipMetadata.ipMetadataHash [Optional] The hash of the metadata for the IP.
19433
+ * @param request.ipMetadata.nftMetadataURI [Optional] The URI of the metadata for the NFT.
19434
+ * @param request.ipMetadata.nftMetadataHash [Optional] The hash of the metadata for the IP NFT.* @param request.recipient [Optional] The address of the recipient of the minted NFT.
19445
19435
  * @param request.txOptions [Optional] The transaction options.
19446
19436
  * @returns A Promise that resolves to an object containing the transaction hash and optional IP ID if waitForTxn is set to true.
19447
19437
  * @emits IPRegistered (ipId, chainId, tokenContract, tokenId, name, uri, registrationDate)
@@ -19451,7 +19441,7 @@ var IPAssetClient = /*#__PURE__*/function () {
19451
19441
  key: "mintAndRegisterIpAndMakeDerivative",
19452
19442
  value: (function () {
19453
19443
  var _mintAndRegisterIpAndMakeDerivative = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(request) {
19454
- var _request$txOptions13, i, isAttachedLicenseTerms, object, _request$txOptions14, txHash, receipt, log;
19444
+ var _request$ipMetadata17, _request$ipMetadata18, _request$ipMetadata19, _request$ipMetadata20, _request$txOptions13, i, isAttachedLicenseTerms, object, _request$txOptions14, txHash, receipt, log;
19455
19445
  return _regeneratorRuntime().wrap(function _callee7$(_context7) {
19456
19446
  while (1) switch (_context7.prev = _context7.next) {
19457
19447
  case 0:
@@ -19494,64 +19484,57 @@ var IPAssetClient = /*#__PURE__*/function () {
19494
19484
  return BigInt(id);
19495
19485
  })
19496
19486
  }),
19497
- nftMetadata: request.nftMetadata || "",
19498
19487
  ipMetadata: {
19499
- metadataURI: "",
19500
- metadataHash: viem.zeroHash,
19501
- nftMetadataHash: viem.zeroHash
19488
+ ipMetadataURI: ((_request$ipMetadata17 = request.ipMetadata) === null || _request$ipMetadata17 === void 0 ? void 0 : _request$ipMetadata17.ipMetadataURI) || "",
19489
+ ipMetadataHash: ((_request$ipMetadata18 = request.ipMetadata) === null || _request$ipMetadata18 === void 0 ? void 0 : _request$ipMetadata18.ipMetadataHash) || viem.zeroHash,
19490
+ nftMetadataURI: ((_request$ipMetadata19 = request.ipMetadata) === null || _request$ipMetadata19 === void 0 ? void 0 : _request$ipMetadata19.nftMetadataURI) || "",
19491
+ nftMetadataHash: ((_request$ipMetadata20 = request.ipMetadata) === null || _request$ipMetadata20 === void 0 ? void 0 : _request$ipMetadata20.nftMetadataHash) || viem.zeroHash
19502
19492
  },
19503
19493
  recipient: request.recipient && getAddress$1(request.recipient, "request.recipient") || this.wallet.account.address
19504
19494
  });
19505
- if (request.ipMetadata && (request.ipMetadata.metadataHash !== viem.zeroHash || request.ipMetadata.metadataURI !== "" || request.ipMetadata.nftMetadataHash !== viem.zeroHash)) {
19506
- object.ipMetadata = {
19507
- metadataURI: request.ipMetadata.metadataURI || object.ipMetadata.metadataURI,
19508
- metadataHash: request.ipMetadata.metadataHash || object.ipMetadata.metadataHash,
19509
- nftMetadataHash: request.ipMetadata.nftMetadataHash || object.ipMetadata.nftMetadataHash
19510
- };
19511
- }
19512
19495
  if (!((_request$txOptions13 = request.txOptions) !== null && _request$txOptions13 !== void 0 && _request$txOptions13.encodedTxDataOnly)) {
19513
- _context7.next = 19;
19496
+ _context7.next = 18;
19514
19497
  break;
19515
19498
  }
19516
19499
  return _context7.abrupt("return", {
19517
19500
  encodedTxData: this.spgClient.mintAndRegisterIpAndMakeDerivativeEncode(object)
19518
19501
  });
19519
- case 19:
19520
- _context7.next = 21;
19502
+ case 18:
19503
+ _context7.next = 20;
19521
19504
  return this.spgClient.mintAndRegisterIpAndMakeDerivative(object);
19522
- case 21:
19505
+ case 20:
19523
19506
  txHash = _context7.sent;
19524
19507
  if (!((_request$txOptions14 = request.txOptions) !== null && _request$txOptions14 !== void 0 && _request$txOptions14.waitForTransaction)) {
19525
- _context7.next = 28;
19508
+ _context7.next = 27;
19526
19509
  break;
19527
19510
  }
19528
- _context7.next = 25;
19511
+ _context7.next = 24;
19529
19512
  return this.rpcClient.waitForTransactionReceipt({
19530
19513
  hash: txHash
19531
19514
  });
19532
- case 25:
19515
+ case 24:
19533
19516
  receipt = _context7.sent;
19534
19517
  log = this.ipAssetRegistryClient.parseTxIpRegisteredEvent(receipt)[0];
19535
19518
  return _context7.abrupt("return", {
19536
19519
  txHash: txHash,
19537
19520
  childIpId: log.ipId
19538
19521
  });
19539
- case 28:
19522
+ case 27:
19540
19523
  return _context7.abrupt("return", {
19541
19524
  txHash: txHash
19542
19525
  });
19543
- case 29:
19544
- _context7.next = 34;
19526
+ case 28:
19527
+ _context7.next = 33;
19545
19528
  break;
19546
- case 31:
19547
- _context7.prev = 31;
19529
+ case 30:
19530
+ _context7.prev = 30;
19548
19531
  _context7.t0 = _context7["catch"](0);
19549
19532
  handleError(_context7.t0, "Failed to mint and register IP and make derivative");
19550
- case 34:
19533
+ case 33:
19551
19534
  case "end":
19552
19535
  return _context7.stop();
19553
19536
  }
19554
- }, _callee7, this, [[0, 31]]);
19537
+ }, _callee7, this, [[0, 30]]);
19555
19538
  }));
19556
19539
  function mintAndRegisterIpAndMakeDerivative(_x7) {
19557
19540
  return _mintAndRegisterIpAndMakeDerivative.apply(this, arguments);