@story-protocol/core-sdk 1.0.0-rc.2 → 1.0.0-rc.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -107,6 +107,73 @@ function _createClass(Constructor, protoProps, staticProps) {
107
107
  return Constructor;
108
108
  }
109
109
 
110
+ function _arrayLikeToArray(arr, len) {
111
+ if (len == null || len > arr.length) len = arr.length;
112
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
113
+ return arr2;
114
+ }
115
+
116
+ function _unsupportedIterableToArray(o, minLen) {
117
+ if (!o) return;
118
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
119
+ var n = Object.prototype.toString.call(o).slice(8, -1);
120
+ if (n === "Object" && o.constructor) n = o.constructor.name;
121
+ if (n === "Map" || n === "Set") return Array.from(o);
122
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
123
+ }
124
+
125
+ function _createForOfIteratorHelper(o, allowArrayLike) {
126
+ var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
127
+ if (!it) {
128
+ if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
129
+ if (it) o = it;
130
+ var i = 0;
131
+ var F = function () {};
132
+ return {
133
+ s: F,
134
+ n: function () {
135
+ if (i >= o.length) return {
136
+ done: true
137
+ };
138
+ return {
139
+ done: false,
140
+ value: o[i++]
141
+ };
142
+ },
143
+ e: function (e) {
144
+ throw e;
145
+ },
146
+ f: F
147
+ };
148
+ }
149
+ throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
150
+ }
151
+ var normalCompletion = true,
152
+ didErr = false,
153
+ err;
154
+ return {
155
+ s: function () {
156
+ it = it.call(o);
157
+ },
158
+ n: function () {
159
+ var step = it.next();
160
+ normalCompletion = step.done;
161
+ return step;
162
+ },
163
+ e: function (e) {
164
+ didErr = true;
165
+ err = e;
166
+ },
167
+ f: function () {
168
+ try {
169
+ if (!normalCompletion && it.return != null) it.return();
170
+ } finally {
171
+ if (didErr) throw err;
172
+ }
173
+ }
174
+ };
175
+ }
176
+
110
177
  function _regeneratorRuntime() {
111
178
  _regeneratorRuntime = function () {
112
179
  return e;
@@ -440,73 +507,6 @@ function _asyncToGenerator(fn) {
440
507
  };
441
508
  }
442
509
 
443
- function _arrayLikeToArray(arr, len) {
444
- if (len == null || len > arr.length) len = arr.length;
445
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
446
- return arr2;
447
- }
448
-
449
- function _unsupportedIterableToArray(o, minLen) {
450
- if (!o) return;
451
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
452
- var n = Object.prototype.toString.call(o).slice(8, -1);
453
- if (n === "Object" && o.constructor) n = o.constructor.name;
454
- if (n === "Map" || n === "Set") return Array.from(o);
455
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
456
- }
457
-
458
- function _createForOfIteratorHelper(o, allowArrayLike) {
459
- var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
460
- if (!it) {
461
- if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
462
- if (it) o = it;
463
- var i = 0;
464
- var F = function () {};
465
- return {
466
- s: F,
467
- n: function () {
468
- if (i >= o.length) return {
469
- done: true
470
- };
471
- return {
472
- done: false,
473
- value: o[i++]
474
- };
475
- },
476
- e: function (e) {
477
- throw e;
478
- },
479
- f: F
480
- };
481
- }
482
- throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
483
- }
484
- var normalCompletion = true,
485
- didErr = false,
486
- err;
487
- return {
488
- s: function () {
489
- it = it.call(o);
490
- },
491
- n: function () {
492
- var step = it.next();
493
- normalCompletion = step.done;
494
- return step;
495
- },
496
- e: function (e) {
497
- didErr = true;
498
- err = e;
499
- },
500
- f: function () {
501
- try {
502
- if (!normalCompletion && it.return != null) it.return();
503
- } finally {
504
- if (didErr) throw err;
505
- }
506
- }
507
- };
508
- }
509
-
510
510
  function parseToBigInt(num) {
511
511
  return BigInt(num);
512
512
  }
@@ -7331,6 +7331,21 @@ var IpAssetRegistryClient = /*#__PURE__*/function (_IpAssetRegistryReadO) {
7331
7331
 
7332
7332
  // Contract IpRoyaltyVaultImpl =============================================================
7333
7333
 
7334
+ /**
7335
+ * IpRoyaltyVaultImplRoyaltyTokensCollectedEvent
7336
+ *
7337
+ * @param ancestorIpId address
7338
+ * @param royaltyTokensCollected uint256
7339
+ */
7340
+
7341
+ /**
7342
+ * IpRoyaltyVaultImplSnapshotCompletedEvent
7343
+ *
7344
+ * @param snapshotId uint256
7345
+ * @param snapshotTimestamp uint256
7346
+ * @param unclaimedTokens uint32
7347
+ */
7348
+
7334
7349
  /**
7335
7350
  * IpRoyaltyVaultImplClaimableRevenueRequest
7336
7351
  *
@@ -7360,22 +7375,138 @@ var IpAssetRegistryClient = /*#__PURE__*/function (_IpAssetRegistryReadO) {
7360
7375
  */
7361
7376
 
7362
7377
  /**
7363
- * contract IpRoyaltyVaultImpl readonly method
7378
+ * contract IpRoyaltyVaultImpl event
7364
7379
  */
7365
- var IpRoyaltyVaultImplReadOnlyClient = /*#__PURE__*/function () {
7366
- function IpRoyaltyVaultImplReadOnlyClient(rpcClient, address) {
7380
+ var IpRoyaltyVaultImplEventClient = /*#__PURE__*/function () {
7381
+ function IpRoyaltyVaultImplEventClient(rpcClient, address) {
7367
7382
  var _rpcClient$chain5;
7368
- _classCallCheck(this, IpRoyaltyVaultImplReadOnlyClient);
7383
+ _classCallCheck(this, IpRoyaltyVaultImplEventClient);
7369
7384
  this.address = address || getAddress(ipRoyaltyVaultImplAddress, (_rpcClient$chain5 = rpcClient.chain) === null || _rpcClient$chain5 === void 0 ? void 0 : _rpcClient$chain5.id);
7370
7385
  this.rpcClient = rpcClient;
7371
7386
  }
7372
7387
 
7388
+ /**
7389
+ * event RoyaltyTokensCollected for contract IpRoyaltyVaultImpl
7390
+ */
7391
+ return _createClass(IpRoyaltyVaultImplEventClient, [{
7392
+ key: "watchRoyaltyTokensCollectedEvent",
7393
+ value: function watchRoyaltyTokensCollectedEvent(_onLogs6) {
7394
+ return this.rpcClient.watchContractEvent({
7395
+ abi: ipRoyaltyVaultImplAbi,
7396
+ address: this.address,
7397
+ eventName: "RoyaltyTokensCollected",
7398
+ onLogs: function onLogs(evs) {
7399
+ evs.forEach(function (it) {
7400
+ return _onLogs6(it.transactionHash, it.args);
7401
+ });
7402
+ }
7403
+ });
7404
+ }
7405
+
7406
+ /**
7407
+ * parse tx receipt event RoyaltyTokensCollected for contract IpRoyaltyVaultImpl
7408
+ */
7409
+ }, {
7410
+ key: "parseTxRoyaltyTokensCollectedEvent",
7411
+ value: function parseTxRoyaltyTokensCollectedEvent(txReceipt) {
7412
+ var targetLogs = [];
7413
+ var _iterator6 = _createForOfIteratorHelper(txReceipt.logs),
7414
+ _step6;
7415
+ try {
7416
+ for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
7417
+ var log = _step6.value;
7418
+ try {
7419
+ var event = viem.decodeEventLog({
7420
+ abi: ipRoyaltyVaultImplAbi,
7421
+ eventName: "RoyaltyTokensCollected",
7422
+ data: log.data,
7423
+ topics: log.topics
7424
+ });
7425
+ if (event.eventName === "RoyaltyTokensCollected") {
7426
+ targetLogs.push(event.args);
7427
+ }
7428
+ } catch (e) {
7429
+ /* empty */
7430
+ }
7431
+ }
7432
+ } catch (err) {
7433
+ _iterator6.e(err);
7434
+ } finally {
7435
+ _iterator6.f();
7436
+ }
7437
+ return targetLogs;
7438
+ }
7439
+
7440
+ /**
7441
+ * event SnapshotCompleted for contract IpRoyaltyVaultImpl
7442
+ */
7443
+ }, {
7444
+ key: "watchSnapshotCompletedEvent",
7445
+ value: function watchSnapshotCompletedEvent(_onLogs7) {
7446
+ return this.rpcClient.watchContractEvent({
7447
+ abi: ipRoyaltyVaultImplAbi,
7448
+ address: this.address,
7449
+ eventName: "SnapshotCompleted",
7450
+ onLogs: function onLogs(evs) {
7451
+ evs.forEach(function (it) {
7452
+ return _onLogs7(it.transactionHash, it.args);
7453
+ });
7454
+ }
7455
+ });
7456
+ }
7457
+
7458
+ /**
7459
+ * parse tx receipt event SnapshotCompleted for contract IpRoyaltyVaultImpl
7460
+ */
7461
+ }, {
7462
+ key: "parseTxSnapshotCompletedEvent",
7463
+ value: function parseTxSnapshotCompletedEvent(txReceipt) {
7464
+ var targetLogs = [];
7465
+ var _iterator7 = _createForOfIteratorHelper(txReceipt.logs),
7466
+ _step7;
7467
+ try {
7468
+ for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
7469
+ var log = _step7.value;
7470
+ try {
7471
+ var event = viem.decodeEventLog({
7472
+ abi: ipRoyaltyVaultImplAbi,
7473
+ eventName: "SnapshotCompleted",
7474
+ data: log.data,
7475
+ topics: log.topics
7476
+ });
7477
+ if (event.eventName === "SnapshotCompleted") {
7478
+ targetLogs.push(event.args);
7479
+ }
7480
+ } catch (e) {
7481
+ /* empty */
7482
+ }
7483
+ }
7484
+ } catch (err) {
7485
+ _iterator7.e(err);
7486
+ } finally {
7487
+ _iterator7.f();
7488
+ }
7489
+ return targetLogs;
7490
+ }
7491
+ }]);
7492
+ }();
7493
+
7494
+ /**
7495
+ * contract IpRoyaltyVaultImpl readonly method
7496
+ */
7497
+ var IpRoyaltyVaultImplReadOnlyClient = /*#__PURE__*/function (_IpRoyaltyVaultImplEv) {
7498
+ function IpRoyaltyVaultImplReadOnlyClient(rpcClient, address) {
7499
+ _classCallCheck(this, IpRoyaltyVaultImplReadOnlyClient);
7500
+ return _callSuper(this, IpRoyaltyVaultImplReadOnlyClient, [rpcClient, address]);
7501
+ }
7502
+
7373
7503
  /**
7374
7504
  * method claimableRevenue for contract IpRoyaltyVaultImpl
7375
7505
  *
7376
7506
  * @param request IpRoyaltyVaultImplClaimableRevenueRequest
7377
7507
  * @return Promise<IpRoyaltyVaultImplClaimableRevenueResponse>
7378
7508
  */
7509
+ _inherits(IpRoyaltyVaultImplReadOnlyClient, _IpRoyaltyVaultImplEv);
7379
7510
  return _createClass(IpRoyaltyVaultImplReadOnlyClient, [{
7380
7511
  key: "claimableRevenue",
7381
7512
  value: (function () {
@@ -7437,7 +7568,7 @@ var IpRoyaltyVaultImplReadOnlyClient = /*#__PURE__*/function () {
7437
7568
  return ipId;
7438
7569
  }())
7439
7570
  }]);
7440
- }();
7571
+ }(IpRoyaltyVaultImplEventClient);
7441
7572
 
7442
7573
  /**
7443
7574
  * contract IpRoyaltyVaultImpl write method
@@ -7573,24 +7704,64 @@ var IpRoyaltyVaultImplClient = /*#__PURE__*/function (_IpRoyaltyVaultImplRe) {
7573
7704
  return _collectRoyaltyTokens.apply(this, arguments);
7574
7705
  }
7575
7706
  return collectRoyaltyTokens;
7576
- }())
7577
- }]);
7578
- }(IpRoyaltyVaultImplReadOnlyClient);
7579
-
7580
- // Contract LicenseRegistry =============================================================
7581
-
7582
- /**
7583
- * LicenseRegistryExpirationTimeSetEvent
7584
- *
7585
- * @param ipId address
7586
- * @param expireTime uint256
7587
- */
7588
-
7589
- /**
7590
- * LicenseRegistryGovernanceUpdatedEvent
7591
- *
7592
- * @param newGovernance address
7593
- */
7707
+ }()
7708
+ /**
7709
+ * method snapshot for contract IpRoyaltyVaultImpl
7710
+ *
7711
+ * @param request IpRoyaltyVaultImplSnapshotRequest
7712
+ * @return Promise<WriteContractReturnType>
7713
+ */
7714
+ )
7715
+ }, {
7716
+ key: "snapshot",
7717
+ value: (function () {
7718
+ var _snapshot = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15() {
7719
+ var _yield$this$rpcClient11, call;
7720
+ return _regeneratorRuntime().wrap(function _callee15$(_context15) {
7721
+ while (1) switch (_context15.prev = _context15.next) {
7722
+ case 0:
7723
+ _context15.next = 2;
7724
+ return this.rpcClient.simulateContract({
7725
+ abi: ipRoyaltyVaultImplAbi,
7726
+ address: this.address,
7727
+ functionName: "snapshot",
7728
+ account: this.wallet.account
7729
+ });
7730
+ case 2:
7731
+ _yield$this$rpcClient11 = _context15.sent;
7732
+ call = _yield$this$rpcClient11.request;
7733
+ _context15.next = 6;
7734
+ return this.wallet.writeContract(call);
7735
+ case 6:
7736
+ return _context15.abrupt("return", _context15.sent);
7737
+ case 7:
7738
+ case "end":
7739
+ return _context15.stop();
7740
+ }
7741
+ }, _callee15, this);
7742
+ }));
7743
+ function snapshot() {
7744
+ return _snapshot.apply(this, arguments);
7745
+ }
7746
+ return snapshot;
7747
+ }())
7748
+ }]);
7749
+ }(IpRoyaltyVaultImplReadOnlyClient);
7750
+
7751
+ // Contract LicenseRegistry =============================================================
7752
+
7753
+ /**
7754
+ * LicenseRegistryExpirationTimeSetEvent
7755
+ *
7756
+ * @param ipId address
7757
+ * @param expireTime uint256
7758
+ */
7759
+
7760
+ /**
7761
+ * LicenseRegistryGovernanceUpdatedEvent
7762
+ *
7763
+ * @param newGovernance address
7764
+ */
7594
7765
 
7595
7766
  /**
7596
7767
  * LicenseRegistryInitializedEvent
@@ -7846,14 +8017,14 @@ var LicenseRegistryEventClient = /*#__PURE__*/function () {
7846
8017
  */
7847
8018
  return _createClass(LicenseRegistryEventClient, [{
7848
8019
  key: "watchExpirationTimeSetEvent",
7849
- value: function watchExpirationTimeSetEvent(_onLogs6) {
8020
+ value: function watchExpirationTimeSetEvent(_onLogs8) {
7850
8021
  return this.rpcClient.watchContractEvent({
7851
8022
  abi: licenseRegistryAbi,
7852
8023
  address: this.address,
7853
8024
  eventName: "ExpirationTimeSet",
7854
8025
  onLogs: function onLogs(evs) {
7855
8026
  evs.forEach(function (it) {
7856
- return _onLogs6(it.transactionHash, it.args);
8027
+ return _onLogs8(it.transactionHash, it.args);
7857
8028
  });
7858
8029
  }
7859
8030
  });
@@ -7866,11 +8037,11 @@ var LicenseRegistryEventClient = /*#__PURE__*/function () {
7866
8037
  key: "parseTxExpirationTimeSetEvent",
7867
8038
  value: function parseTxExpirationTimeSetEvent(txReceipt) {
7868
8039
  var targetLogs = [];
7869
- var _iterator6 = _createForOfIteratorHelper(txReceipt.logs),
7870
- _step6;
8040
+ var _iterator8 = _createForOfIteratorHelper(txReceipt.logs),
8041
+ _step8;
7871
8042
  try {
7872
- for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
7873
- var log = _step6.value;
8043
+ for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
8044
+ var log = _step8.value;
7874
8045
  try {
7875
8046
  var event = viem.decodeEventLog({
7876
8047
  abi: licenseRegistryAbi,
@@ -7886,9 +8057,9 @@ var LicenseRegistryEventClient = /*#__PURE__*/function () {
7886
8057
  }
7887
8058
  }
7888
8059
  } catch (err) {
7889
- _iterator6.e(err);
8060
+ _iterator8.e(err);
7890
8061
  } finally {
7891
- _iterator6.f();
8062
+ _iterator8.f();
7892
8063
  }
7893
8064
  return targetLogs;
7894
8065
  }
@@ -7898,14 +8069,14 @@ var LicenseRegistryEventClient = /*#__PURE__*/function () {
7898
8069
  */
7899
8070
  }, {
7900
8071
  key: "watchGovernanceUpdatedEvent",
7901
- value: function watchGovernanceUpdatedEvent(_onLogs7) {
8072
+ value: function watchGovernanceUpdatedEvent(_onLogs9) {
7902
8073
  return this.rpcClient.watchContractEvent({
7903
8074
  abi: licenseRegistryAbi,
7904
8075
  address: this.address,
7905
8076
  eventName: "GovernanceUpdated",
7906
8077
  onLogs: function onLogs(evs) {
7907
8078
  evs.forEach(function (it) {
7908
- return _onLogs7(it.transactionHash, it.args);
8079
+ return _onLogs9(it.transactionHash, it.args);
7909
8080
  });
7910
8081
  }
7911
8082
  });
@@ -7918,11 +8089,11 @@ var LicenseRegistryEventClient = /*#__PURE__*/function () {
7918
8089
  key: "parseTxGovernanceUpdatedEvent",
7919
8090
  value: function parseTxGovernanceUpdatedEvent(txReceipt) {
7920
8091
  var targetLogs = [];
7921
- var _iterator7 = _createForOfIteratorHelper(txReceipt.logs),
7922
- _step7;
8092
+ var _iterator9 = _createForOfIteratorHelper(txReceipt.logs),
8093
+ _step9;
7923
8094
  try {
7924
- for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
7925
- var log = _step7.value;
8095
+ for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
8096
+ var log = _step9.value;
7926
8097
  try {
7927
8098
  var event = viem.decodeEventLog({
7928
8099
  abi: licenseRegistryAbi,
@@ -7938,9 +8109,9 @@ var LicenseRegistryEventClient = /*#__PURE__*/function () {
7938
8109
  }
7939
8110
  }
7940
8111
  } catch (err) {
7941
- _iterator7.e(err);
8112
+ _iterator9.e(err);
7942
8113
  } finally {
7943
- _iterator7.f();
8114
+ _iterator9.f();
7944
8115
  }
7945
8116
  return targetLogs;
7946
8117
  }
@@ -7950,14 +8121,14 @@ var LicenseRegistryEventClient = /*#__PURE__*/function () {
7950
8121
  */
7951
8122
  }, {
7952
8123
  key: "watchInitializedEvent",
7953
- value: function watchInitializedEvent(_onLogs8) {
8124
+ value: function watchInitializedEvent(_onLogs10) {
7954
8125
  return this.rpcClient.watchContractEvent({
7955
8126
  abi: licenseRegistryAbi,
7956
8127
  address: this.address,
7957
8128
  eventName: "Initialized",
7958
8129
  onLogs: function onLogs(evs) {
7959
8130
  evs.forEach(function (it) {
7960
- return _onLogs8(it.transactionHash, it.args);
8131
+ return _onLogs10(it.transactionHash, it.args);
7961
8132
  });
7962
8133
  }
7963
8134
  });
@@ -7970,11 +8141,11 @@ var LicenseRegistryEventClient = /*#__PURE__*/function () {
7970
8141
  key: "parseTxInitializedEvent",
7971
8142
  value: function parseTxInitializedEvent(txReceipt) {
7972
8143
  var targetLogs = [];
7973
- var _iterator8 = _createForOfIteratorHelper(txReceipt.logs),
7974
- _step8;
8144
+ var _iterator10 = _createForOfIteratorHelper(txReceipt.logs),
8145
+ _step10;
7975
8146
  try {
7976
- for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
7977
- var log = _step8.value;
8147
+ for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
8148
+ var log = _step10.value;
7978
8149
  try {
7979
8150
  var event = viem.decodeEventLog({
7980
8151
  abi: licenseRegistryAbi,
@@ -7990,9 +8161,9 @@ var LicenseRegistryEventClient = /*#__PURE__*/function () {
7990
8161
  }
7991
8162
  }
7992
8163
  } catch (err) {
7993
- _iterator8.e(err);
8164
+ _iterator10.e(err);
7994
8165
  } finally {
7995
- _iterator8.f();
8166
+ _iterator10.f();
7996
8167
  }
7997
8168
  return targetLogs;
7998
8169
  }
@@ -8002,14 +8173,14 @@ var LicenseRegistryEventClient = /*#__PURE__*/function () {
8002
8173
  */
8003
8174
  }, {
8004
8175
  key: "watchLicenseTemplateRegisteredEvent",
8005
- value: function watchLicenseTemplateRegisteredEvent(_onLogs9) {
8176
+ value: function watchLicenseTemplateRegisteredEvent(_onLogs11) {
8006
8177
  return this.rpcClient.watchContractEvent({
8007
8178
  abi: licenseRegistryAbi,
8008
8179
  address: this.address,
8009
8180
  eventName: "LicenseTemplateRegistered",
8010
8181
  onLogs: function onLogs(evs) {
8011
8182
  evs.forEach(function (it) {
8012
- return _onLogs9(it.transactionHash, it.args);
8183
+ return _onLogs11(it.transactionHash, it.args);
8013
8184
  });
8014
8185
  }
8015
8186
  });
@@ -8022,11 +8193,11 @@ var LicenseRegistryEventClient = /*#__PURE__*/function () {
8022
8193
  key: "parseTxLicenseTemplateRegisteredEvent",
8023
8194
  value: function parseTxLicenseTemplateRegisteredEvent(txReceipt) {
8024
8195
  var targetLogs = [];
8025
- var _iterator9 = _createForOfIteratorHelper(txReceipt.logs),
8026
- _step9;
8196
+ var _iterator11 = _createForOfIteratorHelper(txReceipt.logs),
8197
+ _step11;
8027
8198
  try {
8028
- for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
8029
- var log = _step9.value;
8199
+ for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
8200
+ var log = _step11.value;
8030
8201
  try {
8031
8202
  var event = viem.decodeEventLog({
8032
8203
  abi: licenseRegistryAbi,
@@ -8042,9 +8213,9 @@ var LicenseRegistryEventClient = /*#__PURE__*/function () {
8042
8213
  }
8043
8214
  }
8044
8215
  } catch (err) {
8045
- _iterator9.e(err);
8216
+ _iterator11.e(err);
8046
8217
  } finally {
8047
- _iterator9.f();
8218
+ _iterator11.f();
8048
8219
  }
8049
8220
  return targetLogs;
8050
8221
  }
@@ -8054,14 +8225,14 @@ var LicenseRegistryEventClient = /*#__PURE__*/function () {
8054
8225
  */
8055
8226
  }, {
8056
8227
  key: "watchMintingLicenseConfigSetForIpEvent",
8057
- value: function watchMintingLicenseConfigSetForIpEvent(_onLogs10) {
8228
+ value: function watchMintingLicenseConfigSetForIpEvent(_onLogs12) {
8058
8229
  return this.rpcClient.watchContractEvent({
8059
8230
  abi: licenseRegistryAbi,
8060
8231
  address: this.address,
8061
8232
  eventName: "MintingLicenseConfigSetForIP",
8062
8233
  onLogs: function onLogs(evs) {
8063
8234
  evs.forEach(function (it) {
8064
- return _onLogs10(it.transactionHash, it.args);
8235
+ return _onLogs12(it.transactionHash, it.args);
8065
8236
  });
8066
8237
  }
8067
8238
  });
@@ -8074,11 +8245,11 @@ var LicenseRegistryEventClient = /*#__PURE__*/function () {
8074
8245
  key: "parseTxMintingLicenseConfigSetForIpEvent",
8075
8246
  value: function parseTxMintingLicenseConfigSetForIpEvent(txReceipt) {
8076
8247
  var targetLogs = [];
8077
- var _iterator10 = _createForOfIteratorHelper(txReceipt.logs),
8078
- _step10;
8248
+ var _iterator12 = _createForOfIteratorHelper(txReceipt.logs),
8249
+ _step12;
8079
8250
  try {
8080
- for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
8081
- var log = _step10.value;
8251
+ for (_iterator12.s(); !(_step12 = _iterator12.n()).done;) {
8252
+ var log = _step12.value;
8082
8253
  try {
8083
8254
  var event = viem.decodeEventLog({
8084
8255
  abi: licenseRegistryAbi,
@@ -8094,9 +8265,9 @@ var LicenseRegistryEventClient = /*#__PURE__*/function () {
8094
8265
  }
8095
8266
  }
8096
8267
  } catch (err) {
8097
- _iterator10.e(err);
8268
+ _iterator12.e(err);
8098
8269
  } finally {
8099
- _iterator10.f();
8270
+ _iterator12.f();
8100
8271
  }
8101
8272
  return targetLogs;
8102
8273
  }
@@ -8106,14 +8277,14 @@ var LicenseRegistryEventClient = /*#__PURE__*/function () {
8106
8277
  */
8107
8278
  }, {
8108
8279
  key: "watchMintingLicenseConfigSetLicenseEvent",
8109
- value: function watchMintingLicenseConfigSetLicenseEvent(_onLogs11) {
8280
+ value: function watchMintingLicenseConfigSetLicenseEvent(_onLogs13) {
8110
8281
  return this.rpcClient.watchContractEvent({
8111
8282
  abi: licenseRegistryAbi,
8112
8283
  address: this.address,
8113
8284
  eventName: "MintingLicenseConfigSetLicense",
8114
8285
  onLogs: function onLogs(evs) {
8115
8286
  evs.forEach(function (it) {
8116
- return _onLogs11(it.transactionHash, it.args);
8287
+ return _onLogs13(it.transactionHash, it.args);
8117
8288
  });
8118
8289
  }
8119
8290
  });
@@ -8126,11 +8297,11 @@ var LicenseRegistryEventClient = /*#__PURE__*/function () {
8126
8297
  key: "parseTxMintingLicenseConfigSetLicenseEvent",
8127
8298
  value: function parseTxMintingLicenseConfigSetLicenseEvent(txReceipt) {
8128
8299
  var targetLogs = [];
8129
- var _iterator11 = _createForOfIteratorHelper(txReceipt.logs),
8130
- _step11;
8300
+ var _iterator13 = _createForOfIteratorHelper(txReceipt.logs),
8301
+ _step13;
8131
8302
  try {
8132
- for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
8133
- var log = _step11.value;
8303
+ for (_iterator13.s(); !(_step13 = _iterator13.n()).done;) {
8304
+ var log = _step13.value;
8134
8305
  try {
8135
8306
  var event = viem.decodeEventLog({
8136
8307
  abi: licenseRegistryAbi,
@@ -8146,9 +8317,9 @@ var LicenseRegistryEventClient = /*#__PURE__*/function () {
8146
8317
  }
8147
8318
  }
8148
8319
  } catch (err) {
8149
- _iterator11.e(err);
8320
+ _iterator13.e(err);
8150
8321
  } finally {
8151
- _iterator11.f();
8322
+ _iterator13.f();
8152
8323
  }
8153
8324
  return targetLogs;
8154
8325
  }
@@ -8158,14 +8329,14 @@ var LicenseRegistryEventClient = /*#__PURE__*/function () {
8158
8329
  */
8159
8330
  }, {
8160
8331
  key: "watchUpgradedEvent",
8161
- value: function watchUpgradedEvent(_onLogs12) {
8332
+ value: function watchUpgradedEvent(_onLogs14) {
8162
8333
  return this.rpcClient.watchContractEvent({
8163
8334
  abi: licenseRegistryAbi,
8164
8335
  address: this.address,
8165
8336
  eventName: "Upgraded",
8166
8337
  onLogs: function onLogs(evs) {
8167
8338
  evs.forEach(function (it) {
8168
- return _onLogs12(it.transactionHash, it.args);
8339
+ return _onLogs14(it.transactionHash, it.args);
8169
8340
  });
8170
8341
  }
8171
8342
  });
@@ -8178,11 +8349,11 @@ var LicenseRegistryEventClient = /*#__PURE__*/function () {
8178
8349
  key: "parseTxUpgradedEvent",
8179
8350
  value: function parseTxUpgradedEvent(txReceipt) {
8180
8351
  var targetLogs = [];
8181
- var _iterator12 = _createForOfIteratorHelper(txReceipt.logs),
8182
- _step12;
8352
+ var _iterator14 = _createForOfIteratorHelper(txReceipt.logs),
8353
+ _step14;
8183
8354
  try {
8184
- for (_iterator12.s(); !(_step12 = _iterator12.n()).done;) {
8185
- var log = _step12.value;
8355
+ for (_iterator14.s(); !(_step14 = _iterator14.n()).done;) {
8356
+ var log = _step14.value;
8186
8357
  try {
8187
8358
  var event = viem.decodeEventLog({
8188
8359
  abi: licenseRegistryAbi,
@@ -8198,125 +8369,862 @@ var LicenseRegistryEventClient = /*#__PURE__*/function () {
8198
8369
  }
8199
8370
  }
8200
8371
  } catch (err) {
8201
- _iterator12.e(err);
8372
+ _iterator14.e(err);
8202
8373
  } finally {
8203
- _iterator12.f();
8374
+ _iterator14.f();
8204
8375
  }
8205
8376
  return targetLogs;
8206
8377
  }
8207
8378
  }]);
8208
8379
  }();
8209
8380
 
8210
- // Contract LicensingModule =============================================================
8211
-
8212
- /**
8213
- * LicensingModuleLicenseTokensMintedEvent
8214
- *
8215
- * @param caller address
8216
- * @param licensorIpId address
8217
- * @param licenseTemplate address
8218
- * @param licenseTermsId uint256
8219
- * @param amount uint256
8220
- * @param receiver address
8221
- * @param startLicenseTokenId uint256
8222
- */
8223
-
8224
- /**
8225
- * LicensingModuleAttachLicenseTermsRequest
8226
- *
8227
- * @param ipId address
8228
- * @param licenseTemplate address
8229
- * @param licenseTermsId uint256
8230
- */
8231
-
8232
- /**
8233
- * LicensingModuleMintLicenseTokensRequest
8234
- *
8235
- * @param licensorIpId address
8236
- * @param licenseTemplate address
8237
- * @param licenseTermsId uint256
8238
- * @param amount uint256
8239
- * @param receiver address
8240
- * @param royaltyContext bytes
8241
- */
8242
-
8243
- /**
8244
- * LicensingModuleRegisterDerivativeRequest
8245
- *
8246
- * @param childIpId address
8247
- * @param parentIpIds address[]
8248
- * @param licenseTermsIds uint256[]
8249
- * @param licenseTemplate address
8250
- * @param royaltyContext bytes
8251
- */
8252
-
8253
- /**
8254
- * LicensingModuleRegisterDerivativeWithLicenseTokensRequest
8255
- *
8256
- * @param childIpId address
8257
- * @param licenseTokenIds uint256[]
8258
- * @param royaltyContext bytes
8259
- */
8260
-
8261
8381
  /**
8262
- * contract LicensingModule event
8382
+ * contract LicenseRegistry readonly method
8263
8383
  */
8264
- var LicensingModuleEventClient = /*#__PURE__*/function () {
8265
- function LicensingModuleEventClient(rpcClient, address) {
8266
- var _rpcClient$chain7;
8267
- _classCallCheck(this, LicensingModuleEventClient);
8268
- this.address = address || getAddress(licensingModuleAddress, (_rpcClient$chain7 = rpcClient.chain) === null || _rpcClient$chain7 === void 0 ? void 0 : _rpcClient$chain7.id);
8269
- this.rpcClient = rpcClient;
8384
+ var LicenseRegistryReadOnlyClient = /*#__PURE__*/function (_LicenseRegistryEvent) {
8385
+ function LicenseRegistryReadOnlyClient(rpcClient, address) {
8386
+ _classCallCheck(this, LicenseRegistryReadOnlyClient);
8387
+ return _callSuper(this, LicenseRegistryReadOnlyClient, [rpcClient, address]);
8270
8388
  }
8271
8389
 
8272
8390
  /**
8273
- * event LicenseTokensMinted for contract LicensingModule
8391
+ * method EXPIRATION_TIME for contract LicenseRegistry
8392
+ *
8393
+ * @param request LicenseRegistryExpirationTimeRequest
8394
+ * @return Promise<LicenseRegistryExpirationTimeResponse>
8274
8395
  */
8275
- return _createClass(LicensingModuleEventClient, [{
8276
- key: "watchLicenseTokensMintedEvent",
8277
- value: function watchLicenseTokensMintedEvent(_onLogs13) {
8278
- return this.rpcClient.watchContractEvent({
8279
- abi: licensingModuleAbi,
8280
- address: this.address,
8281
- eventName: "LicenseTokensMinted",
8282
- onLogs: function onLogs(evs) {
8283
- evs.forEach(function (it) {
8284
- return _onLogs13(it.transactionHash, it.args);
8285
- });
8286
- }
8287
- });
8288
- }
8289
-
8396
+ _inherits(LicenseRegistryReadOnlyClient, _LicenseRegistryEvent);
8397
+ return _createClass(LicenseRegistryReadOnlyClient, [{
8398
+ key: "expirationTime",
8399
+ value: (function () {
8400
+ var _expirationTime = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16() {
8401
+ return _regeneratorRuntime().wrap(function _callee16$(_context16) {
8402
+ while (1) switch (_context16.prev = _context16.next) {
8403
+ case 0:
8404
+ _context16.next = 2;
8405
+ return this.rpcClient.readContract({
8406
+ abi: licenseRegistryAbi,
8407
+ address: this.address,
8408
+ functionName: "EXPIRATION_TIME"
8409
+ });
8410
+ case 2:
8411
+ return _context16.abrupt("return", _context16.sent);
8412
+ case 3:
8413
+ case "end":
8414
+ return _context16.stop();
8415
+ }
8416
+ }, _callee16, this);
8417
+ }));
8418
+ function expirationTime() {
8419
+ return _expirationTime.apply(this, arguments);
8420
+ }
8421
+ return expirationTime;
8422
+ }()
8290
8423
  /**
8291
- * parse tx receipt event LicenseTokensMinted for contract LicensingModule
8424
+ * method UPGRADE_INTERFACE_VERSION for contract LicenseRegistry
8425
+ *
8426
+ * @param request LicenseRegistryUpgradeInterfaceVersionRequest
8427
+ * @return Promise<LicenseRegistryUpgradeInterfaceVersionResponse>
8292
8428
  */
8429
+ )
8293
8430
  }, {
8294
- key: "parseTxLicenseTokensMintedEvent",
8295
- value: function parseTxLicenseTokensMintedEvent(txReceipt) {
8296
- var targetLogs = [];
8297
- var _iterator13 = _createForOfIteratorHelper(txReceipt.logs),
8298
- _step13;
8299
- try {
8300
- for (_iterator13.s(); !(_step13 = _iterator13.n()).done;) {
8301
- var log = _step13.value;
8302
- try {
8303
- var event = viem.decodeEventLog({
8304
- abi: licensingModuleAbi,
8305
- eventName: "LicenseTokensMinted",
8306
- data: log.data,
8307
- topics: log.topics
8308
- });
8309
- if (event.eventName === "LicenseTokensMinted") {
8310
- targetLogs.push(event.args);
8311
- }
8312
- } catch (e) {
8313
- /* empty */
8431
+ key: "upgradeInterfaceVersion",
8432
+ value: (function () {
8433
+ var _upgradeInterfaceVersion = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17() {
8434
+ return _regeneratorRuntime().wrap(function _callee17$(_context17) {
8435
+ while (1) switch (_context17.prev = _context17.next) {
8436
+ case 0:
8437
+ _context17.next = 2;
8438
+ return this.rpcClient.readContract({
8439
+ abi: licenseRegistryAbi,
8440
+ address: this.address,
8441
+ functionName: "UPGRADE_INTERFACE_VERSION"
8442
+ });
8443
+ case 2:
8444
+ return _context17.abrupt("return", _context17.sent);
8445
+ case 3:
8446
+ case "end":
8447
+ return _context17.stop();
8314
8448
  }
8315
- }
8316
- } catch (err) {
8317
- _iterator13.e(err);
8449
+ }, _callee17, this);
8450
+ }));
8451
+ function upgradeInterfaceVersion() {
8452
+ return _upgradeInterfaceVersion.apply(this, arguments);
8453
+ }
8454
+ return upgradeInterfaceVersion;
8455
+ }()
8456
+ /**
8457
+ * method disputeModule for contract LicenseRegistry
8458
+ *
8459
+ * @param request LicenseRegistryDisputeModuleRequest
8460
+ * @return Promise<LicenseRegistryDisputeModuleResponse>
8461
+ */
8462
+ )
8463
+ }, {
8464
+ key: "disputeModule",
8465
+ value: (function () {
8466
+ var _disputeModule = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18() {
8467
+ return _regeneratorRuntime().wrap(function _callee18$(_context18) {
8468
+ while (1) switch (_context18.prev = _context18.next) {
8469
+ case 0:
8470
+ _context18.next = 2;
8471
+ return this.rpcClient.readContract({
8472
+ abi: licenseRegistryAbi,
8473
+ address: this.address,
8474
+ functionName: "disputeModule"
8475
+ });
8476
+ case 2:
8477
+ return _context18.abrupt("return", _context18.sent);
8478
+ case 3:
8479
+ case "end":
8480
+ return _context18.stop();
8481
+ }
8482
+ }, _callee18, this);
8483
+ }));
8484
+ function disputeModule() {
8485
+ return _disputeModule.apply(this, arguments);
8486
+ }
8487
+ return disputeModule;
8488
+ }()
8489
+ /**
8490
+ * method exists for contract LicenseRegistry
8491
+ *
8492
+ * @param request LicenseRegistryExistsRequest
8493
+ * @return Promise<LicenseRegistryExistsResponse>
8494
+ */
8495
+ )
8496
+ }, {
8497
+ key: "exists",
8498
+ value: (function () {
8499
+ var _exists = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19(request) {
8500
+ return _regeneratorRuntime().wrap(function _callee19$(_context19) {
8501
+ while (1) switch (_context19.prev = _context19.next) {
8502
+ case 0:
8503
+ _context19.next = 2;
8504
+ return this.rpcClient.readContract({
8505
+ abi: licenseRegistryAbi,
8506
+ address: this.address,
8507
+ functionName: "exists",
8508
+ args: [request.licenseTemplate, request.licenseTermsId]
8509
+ });
8510
+ case 2:
8511
+ return _context19.abrupt("return", _context19.sent);
8512
+ case 3:
8513
+ case "end":
8514
+ return _context19.stop();
8515
+ }
8516
+ }, _callee19, this);
8517
+ }));
8518
+ function exists(_x14) {
8519
+ return _exists.apply(this, arguments);
8520
+ }
8521
+ return exists;
8522
+ }()
8523
+ /**
8524
+ * method getAttachedLicenseTerms for contract LicenseRegistry
8525
+ *
8526
+ * @param request LicenseRegistryGetAttachedLicenseTermsRequest
8527
+ * @return Promise<LicenseRegistryGetAttachedLicenseTermsResponse>
8528
+ */
8529
+ )
8530
+ }, {
8531
+ key: "getAttachedLicenseTerms",
8532
+ value: (function () {
8533
+ var _getAttachedLicenseTerms = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20(request) {
8534
+ var result;
8535
+ return _regeneratorRuntime().wrap(function _callee20$(_context20) {
8536
+ while (1) switch (_context20.prev = _context20.next) {
8537
+ case 0:
8538
+ _context20.next = 2;
8539
+ return this.rpcClient.readContract({
8540
+ abi: licenseRegistryAbi,
8541
+ address: this.address,
8542
+ functionName: "getAttachedLicenseTerms",
8543
+ args: [request.ipId, request.index]
8544
+ });
8545
+ case 2:
8546
+ result = _context20.sent;
8547
+ return _context20.abrupt("return", {
8548
+ licenseTemplate: result[0],
8549
+ licenseTermsId: result[1]
8550
+ });
8551
+ case 4:
8552
+ case "end":
8553
+ return _context20.stop();
8554
+ }
8555
+ }, _callee20, this);
8556
+ }));
8557
+ function getAttachedLicenseTerms(_x15) {
8558
+ return _getAttachedLicenseTerms.apply(this, arguments);
8559
+ }
8560
+ return getAttachedLicenseTerms;
8561
+ }()
8562
+ /**
8563
+ * method getAttachedLicenseTermsCount for contract LicenseRegistry
8564
+ *
8565
+ * @param request LicenseRegistryGetAttachedLicenseTermsCountRequest
8566
+ * @return Promise<LicenseRegistryGetAttachedLicenseTermsCountResponse>
8567
+ */
8568
+ )
8569
+ }, {
8570
+ key: "getAttachedLicenseTermsCount",
8571
+ value: (function () {
8572
+ var _getAttachedLicenseTermsCount = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21(request) {
8573
+ return _regeneratorRuntime().wrap(function _callee21$(_context21) {
8574
+ while (1) switch (_context21.prev = _context21.next) {
8575
+ case 0:
8576
+ _context21.next = 2;
8577
+ return this.rpcClient.readContract({
8578
+ abi: licenseRegistryAbi,
8579
+ address: this.address,
8580
+ functionName: "getAttachedLicenseTermsCount",
8581
+ args: [request.ipId]
8582
+ });
8583
+ case 2:
8584
+ return _context21.abrupt("return", _context21.sent);
8585
+ case 3:
8586
+ case "end":
8587
+ return _context21.stop();
8588
+ }
8589
+ }, _callee21, this);
8590
+ }));
8591
+ function getAttachedLicenseTermsCount(_x16) {
8592
+ return _getAttachedLicenseTermsCount.apply(this, arguments);
8593
+ }
8594
+ return getAttachedLicenseTermsCount;
8595
+ }()
8596
+ /**
8597
+ * method getDefaultLicenseTerms for contract LicenseRegistry
8598
+ *
8599
+ * @param request LicenseRegistryGetDefaultLicenseTermsRequest
8600
+ * @return Promise<LicenseRegistryGetDefaultLicenseTermsResponse>
8601
+ */
8602
+ )
8603
+ }, {
8604
+ key: "getDefaultLicenseTerms",
8605
+ value: (function () {
8606
+ var _getDefaultLicenseTerms = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee22() {
8607
+ var result;
8608
+ return _regeneratorRuntime().wrap(function _callee22$(_context22) {
8609
+ while (1) switch (_context22.prev = _context22.next) {
8610
+ case 0:
8611
+ _context22.next = 2;
8612
+ return this.rpcClient.readContract({
8613
+ abi: licenseRegistryAbi,
8614
+ address: this.address,
8615
+ functionName: "getDefaultLicenseTerms"
8616
+ });
8617
+ case 2:
8618
+ result = _context22.sent;
8619
+ return _context22.abrupt("return", {
8620
+ licenseTemplate: result[0],
8621
+ licenseTermsId: result[1]
8622
+ });
8623
+ case 4:
8624
+ case "end":
8625
+ return _context22.stop();
8626
+ }
8627
+ }, _callee22, this);
8628
+ }));
8629
+ function getDefaultLicenseTerms() {
8630
+ return _getDefaultLicenseTerms.apply(this, arguments);
8631
+ }
8632
+ return getDefaultLicenseTerms;
8633
+ }()
8634
+ /**
8635
+ * method getDerivativeIp for contract LicenseRegistry
8636
+ *
8637
+ * @param request LicenseRegistryGetDerivativeIpRequest
8638
+ * @return Promise<LicenseRegistryGetDerivativeIpResponse>
8639
+ */
8640
+ )
8641
+ }, {
8642
+ key: "getDerivativeIp",
8643
+ value: (function () {
8644
+ var _getDerivativeIp = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee23(request) {
8645
+ var result;
8646
+ return _regeneratorRuntime().wrap(function _callee23$(_context23) {
8647
+ while (1) switch (_context23.prev = _context23.next) {
8648
+ case 0:
8649
+ _context23.next = 2;
8650
+ return this.rpcClient.readContract({
8651
+ abi: licenseRegistryAbi,
8652
+ address: this.address,
8653
+ functionName: "getDerivativeIp",
8654
+ args: [request.parentIpId, request.index]
8655
+ });
8656
+ case 2:
8657
+ result = _context23.sent;
8658
+ return _context23.abrupt("return", {
8659
+ childIpId: result
8660
+ });
8661
+ case 4:
8662
+ case "end":
8663
+ return _context23.stop();
8664
+ }
8665
+ }, _callee23, this);
8666
+ }));
8667
+ function getDerivativeIp(_x17) {
8668
+ return _getDerivativeIp.apply(this, arguments);
8669
+ }
8670
+ return getDerivativeIp;
8671
+ }()
8672
+ /**
8673
+ * method getDerivativeIpCount for contract LicenseRegistry
8674
+ *
8675
+ * @param request LicenseRegistryGetDerivativeIpCountRequest
8676
+ * @return Promise<LicenseRegistryGetDerivativeIpCountResponse>
8677
+ */
8678
+ )
8679
+ }, {
8680
+ key: "getDerivativeIpCount",
8681
+ value: (function () {
8682
+ var _getDerivativeIpCount = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee24(request) {
8683
+ return _regeneratorRuntime().wrap(function _callee24$(_context24) {
8684
+ while (1) switch (_context24.prev = _context24.next) {
8685
+ case 0:
8686
+ _context24.next = 2;
8687
+ return this.rpcClient.readContract({
8688
+ abi: licenseRegistryAbi,
8689
+ address: this.address,
8690
+ functionName: "getDerivativeIpCount",
8691
+ args: [request.parentIpId]
8692
+ });
8693
+ case 2:
8694
+ return _context24.abrupt("return", _context24.sent);
8695
+ case 3:
8696
+ case "end":
8697
+ return _context24.stop();
8698
+ }
8699
+ }, _callee24, this);
8700
+ }));
8701
+ function getDerivativeIpCount(_x18) {
8702
+ return _getDerivativeIpCount.apply(this, arguments);
8703
+ }
8704
+ return getDerivativeIpCount;
8705
+ }()
8706
+ /**
8707
+ * method getExpireTime for contract LicenseRegistry
8708
+ *
8709
+ * @param request LicenseRegistryGetExpireTimeRequest
8710
+ * @return Promise<LicenseRegistryGetExpireTimeResponse>
8711
+ */
8712
+ )
8713
+ }, {
8714
+ key: "getExpireTime",
8715
+ value: (function () {
8716
+ var _getExpireTime = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee25(request) {
8717
+ return _regeneratorRuntime().wrap(function _callee25$(_context25) {
8718
+ while (1) switch (_context25.prev = _context25.next) {
8719
+ case 0:
8720
+ _context25.next = 2;
8721
+ return this.rpcClient.readContract({
8722
+ abi: licenseRegistryAbi,
8723
+ address: this.address,
8724
+ functionName: "getExpireTime",
8725
+ args: [request.ipId]
8726
+ });
8727
+ case 2:
8728
+ return _context25.abrupt("return", _context25.sent);
8729
+ case 3:
8730
+ case "end":
8731
+ return _context25.stop();
8732
+ }
8733
+ }, _callee25, this);
8734
+ }));
8735
+ function getExpireTime(_x19) {
8736
+ return _getExpireTime.apply(this, arguments);
8737
+ }
8738
+ return getExpireTime;
8739
+ }()
8740
+ /**
8741
+ * method getGovernance for contract LicenseRegistry
8742
+ *
8743
+ * @param request LicenseRegistryGetGovernanceRequest
8744
+ * @return Promise<LicenseRegistryGetGovernanceResponse>
8745
+ */
8746
+ )
8747
+ }, {
8748
+ key: "getGovernance",
8749
+ value: (function () {
8750
+ var _getGovernance = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee26() {
8751
+ return _regeneratorRuntime().wrap(function _callee26$(_context26) {
8752
+ while (1) switch (_context26.prev = _context26.next) {
8753
+ case 0:
8754
+ _context26.next = 2;
8755
+ return this.rpcClient.readContract({
8756
+ abi: licenseRegistryAbi,
8757
+ address: this.address,
8758
+ functionName: "getGovernance"
8759
+ });
8760
+ case 2:
8761
+ return _context26.abrupt("return", _context26.sent);
8762
+ case 3:
8763
+ case "end":
8764
+ return _context26.stop();
8765
+ }
8766
+ }, _callee26, this);
8767
+ }));
8768
+ function getGovernance() {
8769
+ return _getGovernance.apply(this, arguments);
8770
+ }
8771
+ return getGovernance;
8772
+ }()
8773
+ /**
8774
+ * method getMintingLicenseConfig for contract LicenseRegistry
8775
+ *
8776
+ * @param request LicenseRegistryGetMintingLicenseConfigRequest
8777
+ * @return Promise<LicenseRegistryGetMintingLicenseConfigResponse>
8778
+ */
8779
+ )
8780
+ }, {
8781
+ key: "getMintingLicenseConfig",
8782
+ value: (function () {
8783
+ var _getMintingLicenseConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27(request) {
8784
+ return _regeneratorRuntime().wrap(function _callee27$(_context27) {
8785
+ while (1) switch (_context27.prev = _context27.next) {
8786
+ case 0:
8787
+ _context27.next = 2;
8788
+ return this.rpcClient.readContract({
8789
+ abi: licenseRegistryAbi,
8790
+ address: this.address,
8791
+ functionName: "getMintingLicenseConfig",
8792
+ args: [request.ipId, request.licenseTemplate, request.licenseTermsId]
8793
+ });
8794
+ case 2:
8795
+ return _context27.abrupt("return", _context27.sent);
8796
+ case 3:
8797
+ case "end":
8798
+ return _context27.stop();
8799
+ }
8800
+ }, _callee27, this);
8801
+ }));
8802
+ function getMintingLicenseConfig(_x20) {
8803
+ return _getMintingLicenseConfig.apply(this, arguments);
8804
+ }
8805
+ return getMintingLicenseConfig;
8806
+ }()
8807
+ /**
8808
+ * method getParentIp for contract LicenseRegistry
8809
+ *
8810
+ * @param request LicenseRegistryGetParentIpRequest
8811
+ * @return Promise<LicenseRegistryGetParentIpResponse>
8812
+ */
8813
+ )
8814
+ }, {
8815
+ key: "getParentIp",
8816
+ value: (function () {
8817
+ var _getParentIp = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee28(request) {
8818
+ var result;
8819
+ return _regeneratorRuntime().wrap(function _callee28$(_context28) {
8820
+ while (1) switch (_context28.prev = _context28.next) {
8821
+ case 0:
8822
+ _context28.next = 2;
8823
+ return this.rpcClient.readContract({
8824
+ abi: licenseRegistryAbi,
8825
+ address: this.address,
8826
+ functionName: "getParentIp",
8827
+ args: [request.childIpId, request.index]
8828
+ });
8829
+ case 2:
8830
+ result = _context28.sent;
8831
+ return _context28.abrupt("return", {
8832
+ parentIpId: result
8833
+ });
8834
+ case 4:
8835
+ case "end":
8836
+ return _context28.stop();
8837
+ }
8838
+ }, _callee28, this);
8839
+ }));
8840
+ function getParentIp(_x21) {
8841
+ return _getParentIp.apply(this, arguments);
8842
+ }
8843
+ return getParentIp;
8844
+ }()
8845
+ /**
8846
+ * method getParentIpCount for contract LicenseRegistry
8847
+ *
8848
+ * @param request LicenseRegistryGetParentIpCountRequest
8849
+ * @return Promise<LicenseRegistryGetParentIpCountResponse>
8850
+ */
8851
+ )
8852
+ }, {
8853
+ key: "getParentIpCount",
8854
+ value: (function () {
8855
+ var _getParentIpCount = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee29(request) {
8856
+ return _regeneratorRuntime().wrap(function _callee29$(_context29) {
8857
+ while (1) switch (_context29.prev = _context29.next) {
8858
+ case 0:
8859
+ _context29.next = 2;
8860
+ return this.rpcClient.readContract({
8861
+ abi: licenseRegistryAbi,
8862
+ address: this.address,
8863
+ functionName: "getParentIpCount",
8864
+ args: [request.childIpId]
8865
+ });
8866
+ case 2:
8867
+ return _context29.abrupt("return", _context29.sent);
8868
+ case 3:
8869
+ case "end":
8870
+ return _context29.stop();
8871
+ }
8872
+ }, _callee29, this);
8873
+ }));
8874
+ function getParentIpCount(_x22) {
8875
+ return _getParentIpCount.apply(this, arguments);
8876
+ }
8877
+ return getParentIpCount;
8878
+ }()
8879
+ /**
8880
+ * method hasDerivativeIps for contract LicenseRegistry
8881
+ *
8882
+ * @param request LicenseRegistryHasDerivativeIpsRequest
8883
+ * @return Promise<LicenseRegistryHasDerivativeIpsResponse>
8884
+ */
8885
+ )
8886
+ }, {
8887
+ key: "hasDerivativeIps",
8888
+ value: (function () {
8889
+ var _hasDerivativeIps = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee30(request) {
8890
+ return _regeneratorRuntime().wrap(function _callee30$(_context30) {
8891
+ while (1) switch (_context30.prev = _context30.next) {
8892
+ case 0:
8893
+ _context30.next = 2;
8894
+ return this.rpcClient.readContract({
8895
+ abi: licenseRegistryAbi,
8896
+ address: this.address,
8897
+ functionName: "hasDerivativeIps",
8898
+ args: [request.parentIpId]
8899
+ });
8900
+ case 2:
8901
+ return _context30.abrupt("return", _context30.sent);
8902
+ case 3:
8903
+ case "end":
8904
+ return _context30.stop();
8905
+ }
8906
+ }, _callee30, this);
8907
+ }));
8908
+ function hasDerivativeIps(_x23) {
8909
+ return _hasDerivativeIps.apply(this, arguments);
8910
+ }
8911
+ return hasDerivativeIps;
8912
+ }()
8913
+ /**
8914
+ * method hasIpAttachedLicenseTerms for contract LicenseRegistry
8915
+ *
8916
+ * @param request LicenseRegistryHasIpAttachedLicenseTermsRequest
8917
+ * @return Promise<LicenseRegistryHasIpAttachedLicenseTermsResponse>
8918
+ */
8919
+ )
8920
+ }, {
8921
+ key: "hasIpAttachedLicenseTerms",
8922
+ value: (function () {
8923
+ var _hasIpAttachedLicenseTerms = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee31(request) {
8924
+ return _regeneratorRuntime().wrap(function _callee31$(_context31) {
8925
+ while (1) switch (_context31.prev = _context31.next) {
8926
+ case 0:
8927
+ _context31.next = 2;
8928
+ return this.rpcClient.readContract({
8929
+ abi: licenseRegistryAbi,
8930
+ address: this.address,
8931
+ functionName: "hasIpAttachedLicenseTerms",
8932
+ args: [request.ipId, request.licenseTemplate, request.licenseTermsId]
8933
+ });
8934
+ case 2:
8935
+ return _context31.abrupt("return", _context31.sent);
8936
+ case 3:
8937
+ case "end":
8938
+ return _context31.stop();
8939
+ }
8940
+ }, _callee31, this);
8941
+ }));
8942
+ function hasIpAttachedLicenseTerms(_x24) {
8943
+ return _hasIpAttachedLicenseTerms.apply(this, arguments);
8944
+ }
8945
+ return hasIpAttachedLicenseTerms;
8946
+ }()
8947
+ /**
8948
+ * method isDerivativeIp for contract LicenseRegistry
8949
+ *
8950
+ * @param request LicenseRegistryIsDerivativeIpRequest
8951
+ * @return Promise<LicenseRegistryIsDerivativeIpResponse>
8952
+ */
8953
+ )
8954
+ }, {
8955
+ key: "isDerivativeIp",
8956
+ value: (function () {
8957
+ var _isDerivativeIp = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee32(request) {
8958
+ return _regeneratorRuntime().wrap(function _callee32$(_context32) {
8959
+ while (1) switch (_context32.prev = _context32.next) {
8960
+ case 0:
8961
+ _context32.next = 2;
8962
+ return this.rpcClient.readContract({
8963
+ abi: licenseRegistryAbi,
8964
+ address: this.address,
8965
+ functionName: "isDerivativeIp",
8966
+ args: [request.childIpId]
8967
+ });
8968
+ case 2:
8969
+ return _context32.abrupt("return", _context32.sent);
8970
+ case 3:
8971
+ case "end":
8972
+ return _context32.stop();
8973
+ }
8974
+ }, _callee32, this);
8975
+ }));
8976
+ function isDerivativeIp(_x25) {
8977
+ return _isDerivativeIp.apply(this, arguments);
8978
+ }
8979
+ return isDerivativeIp;
8980
+ }()
8981
+ /**
8982
+ * method isRegisteredLicenseTemplate for contract LicenseRegistry
8983
+ *
8984
+ * @param request LicenseRegistryIsRegisteredLicenseTemplateRequest
8985
+ * @return Promise<LicenseRegistryIsRegisteredLicenseTemplateResponse>
8986
+ */
8987
+ )
8988
+ }, {
8989
+ key: "isRegisteredLicenseTemplate",
8990
+ value: (function () {
8991
+ var _isRegisteredLicenseTemplate = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee33(request) {
8992
+ return _regeneratorRuntime().wrap(function _callee33$(_context33) {
8993
+ while (1) switch (_context33.prev = _context33.next) {
8994
+ case 0:
8995
+ _context33.next = 2;
8996
+ return this.rpcClient.readContract({
8997
+ abi: licenseRegistryAbi,
8998
+ address: this.address,
8999
+ functionName: "isRegisteredLicenseTemplate",
9000
+ args: [request.licenseTemplate]
9001
+ });
9002
+ case 2:
9003
+ return _context33.abrupt("return", _context33.sent);
9004
+ case 3:
9005
+ case "end":
9006
+ return _context33.stop();
9007
+ }
9008
+ }, _callee33, this);
9009
+ }));
9010
+ function isRegisteredLicenseTemplate(_x26) {
9011
+ return _isRegisteredLicenseTemplate.apply(this, arguments);
9012
+ }
9013
+ return isRegisteredLicenseTemplate;
9014
+ }()
9015
+ /**
9016
+ * method licensingModule for contract LicenseRegistry
9017
+ *
9018
+ * @param request LicenseRegistryLicensingModuleRequest
9019
+ * @return Promise<LicenseRegistryLicensingModuleResponse>
9020
+ */
9021
+ )
9022
+ }, {
9023
+ key: "licensingModule",
9024
+ value: (function () {
9025
+ var _licensingModule = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee34() {
9026
+ return _regeneratorRuntime().wrap(function _callee34$(_context34) {
9027
+ while (1) switch (_context34.prev = _context34.next) {
9028
+ case 0:
9029
+ _context34.next = 2;
9030
+ return this.rpcClient.readContract({
9031
+ abi: licenseRegistryAbi,
9032
+ address: this.address,
9033
+ functionName: "licensingModule"
9034
+ });
9035
+ case 2:
9036
+ return _context34.abrupt("return", _context34.sent);
9037
+ case 3:
9038
+ case "end":
9039
+ return _context34.stop();
9040
+ }
9041
+ }, _callee34, this);
9042
+ }));
9043
+ function licensingModule() {
9044
+ return _licensingModule.apply(this, arguments);
9045
+ }
9046
+ return licensingModule;
9047
+ }()
9048
+ /**
9049
+ * method proxiableUUID for contract LicenseRegistry
9050
+ *
9051
+ * @param request LicenseRegistryProxiableUuidRequest
9052
+ * @return Promise<LicenseRegistryProxiableUuidResponse>
9053
+ */
9054
+ )
9055
+ }, {
9056
+ key: "proxiableUuid",
9057
+ value: (function () {
9058
+ var _proxiableUuid = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee35() {
9059
+ return _regeneratorRuntime().wrap(function _callee35$(_context35) {
9060
+ while (1) switch (_context35.prev = _context35.next) {
9061
+ case 0:
9062
+ _context35.next = 2;
9063
+ return this.rpcClient.readContract({
9064
+ abi: licenseRegistryAbi,
9065
+ address: this.address,
9066
+ functionName: "proxiableUUID"
9067
+ });
9068
+ case 2:
9069
+ return _context35.abrupt("return", _context35.sent);
9070
+ case 3:
9071
+ case "end":
9072
+ return _context35.stop();
9073
+ }
9074
+ }, _callee35, this);
9075
+ }));
9076
+ function proxiableUuid() {
9077
+ return _proxiableUuid.apply(this, arguments);
9078
+ }
9079
+ return proxiableUuid;
9080
+ }()
9081
+ /**
9082
+ * method verifyMintLicenseToken for contract LicenseRegistry
9083
+ *
9084
+ * @param request LicenseRegistryVerifyMintLicenseTokenRequest
9085
+ * @return Promise<LicenseRegistryVerifyMintLicenseTokenResponse>
9086
+ */
9087
+ )
9088
+ }, {
9089
+ key: "verifyMintLicenseToken",
9090
+ value: (function () {
9091
+ var _verifyMintLicenseToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee36(request) {
9092
+ return _regeneratorRuntime().wrap(function _callee36$(_context36) {
9093
+ while (1) switch (_context36.prev = _context36.next) {
9094
+ case 0:
9095
+ _context36.next = 2;
9096
+ return this.rpcClient.readContract({
9097
+ abi: licenseRegistryAbi,
9098
+ address: this.address,
9099
+ functionName: "verifyMintLicenseToken",
9100
+ args: [request.licensorIpId, request.licenseTemplate, request.licenseTermsId, request.isMintedByIpOwner]
9101
+ });
9102
+ case 2:
9103
+ return _context36.abrupt("return", _context36.sent);
9104
+ case 3:
9105
+ case "end":
9106
+ return _context36.stop();
9107
+ }
9108
+ }, _callee36, this);
9109
+ }));
9110
+ function verifyMintLicenseToken(_x27) {
9111
+ return _verifyMintLicenseToken.apply(this, arguments);
9112
+ }
9113
+ return verifyMintLicenseToken;
9114
+ }())
9115
+ }]);
9116
+ }(LicenseRegistryEventClient);
9117
+
9118
+ // Contract LicensingModule =============================================================
9119
+
9120
+ /**
9121
+ * LicensingModuleLicenseTokensMintedEvent
9122
+ *
9123
+ * @param caller address
9124
+ * @param licensorIpId address
9125
+ * @param licenseTemplate address
9126
+ * @param licenseTermsId uint256
9127
+ * @param amount uint256
9128
+ * @param receiver address
9129
+ * @param startLicenseTokenId uint256
9130
+ */
9131
+
9132
+ /**
9133
+ * LicensingModuleAttachLicenseTermsRequest
9134
+ *
9135
+ * @param ipId address
9136
+ * @param licenseTemplate address
9137
+ * @param licenseTermsId uint256
9138
+ */
9139
+
9140
+ /**
9141
+ * LicensingModuleMintLicenseTokensRequest
9142
+ *
9143
+ * @param licensorIpId address
9144
+ * @param licenseTemplate address
9145
+ * @param licenseTermsId uint256
9146
+ * @param amount uint256
9147
+ * @param receiver address
9148
+ * @param royaltyContext bytes
9149
+ */
9150
+
9151
+ /**
9152
+ * LicensingModuleRegisterDerivativeRequest
9153
+ *
9154
+ * @param childIpId address
9155
+ * @param parentIpIds address[]
9156
+ * @param licenseTermsIds uint256[]
9157
+ * @param licenseTemplate address
9158
+ * @param royaltyContext bytes
9159
+ */
9160
+
9161
+ /**
9162
+ * LicensingModuleRegisterDerivativeWithLicenseTokensRequest
9163
+ *
9164
+ * @param childIpId address
9165
+ * @param licenseTokenIds uint256[]
9166
+ * @param royaltyContext bytes
9167
+ */
9168
+
9169
+ /**
9170
+ * contract LicensingModule event
9171
+ */
9172
+ var LicensingModuleEventClient = /*#__PURE__*/function () {
9173
+ function LicensingModuleEventClient(rpcClient, address) {
9174
+ var _rpcClient$chain7;
9175
+ _classCallCheck(this, LicensingModuleEventClient);
9176
+ this.address = address || getAddress(licensingModuleAddress, (_rpcClient$chain7 = rpcClient.chain) === null || _rpcClient$chain7 === void 0 ? void 0 : _rpcClient$chain7.id);
9177
+ this.rpcClient = rpcClient;
9178
+ }
9179
+
9180
+ /**
9181
+ * event LicenseTokensMinted for contract LicensingModule
9182
+ */
9183
+ return _createClass(LicensingModuleEventClient, [{
9184
+ key: "watchLicenseTokensMintedEvent",
9185
+ value: function watchLicenseTokensMintedEvent(_onLogs15) {
9186
+ return this.rpcClient.watchContractEvent({
9187
+ abi: licensingModuleAbi,
9188
+ address: this.address,
9189
+ eventName: "LicenseTokensMinted",
9190
+ onLogs: function onLogs(evs) {
9191
+ evs.forEach(function (it) {
9192
+ return _onLogs15(it.transactionHash, it.args);
9193
+ });
9194
+ }
9195
+ });
9196
+ }
9197
+
9198
+ /**
9199
+ * parse tx receipt event LicenseTokensMinted for contract LicensingModule
9200
+ */
9201
+ }, {
9202
+ key: "parseTxLicenseTokensMintedEvent",
9203
+ value: function parseTxLicenseTokensMintedEvent(txReceipt) {
9204
+ var targetLogs = [];
9205
+ var _iterator15 = _createForOfIteratorHelper(txReceipt.logs),
9206
+ _step15;
9207
+ try {
9208
+ for (_iterator15.s(); !(_step15 = _iterator15.n()).done;) {
9209
+ var log = _step15.value;
9210
+ try {
9211
+ var event = viem.decodeEventLog({
9212
+ abi: licensingModuleAbi,
9213
+ eventName: "LicenseTokensMinted",
9214
+ data: log.data,
9215
+ topics: log.topics
9216
+ });
9217
+ if (event.eventName === "LicenseTokensMinted") {
9218
+ targetLogs.push(event.args);
9219
+ }
9220
+ } catch (e) {
9221
+ /* empty */
9222
+ }
9223
+ }
9224
+ } catch (err) {
9225
+ _iterator15.e(err);
8318
9226
  } finally {
8319
- _iterator13.f();
9227
+ _iterator15.f();
8320
9228
  }
8321
9229
  return targetLogs;
8322
9230
  }
@@ -8345,12 +9253,12 @@ var LicensingModuleClient = /*#__PURE__*/function (_LicensingModuleEvent) {
8345
9253
  return _createClass(LicensingModuleClient, [{
8346
9254
  key: "attachLicenseTerms",
8347
9255
  value: (function () {
8348
- var _attachLicenseTerms = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee48(request) {
8349
- var _yield$this$rpcClient23, call;
8350
- return _regeneratorRuntime().wrap(function _callee48$(_context48) {
8351
- while (1) switch (_context48.prev = _context48.next) {
9256
+ var _attachLicenseTerms = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee49(request) {
9257
+ var _yield$this$rpcClient24, call;
9258
+ return _regeneratorRuntime().wrap(function _callee49$(_context49) {
9259
+ while (1) switch (_context49.prev = _context49.next) {
8352
9260
  case 0:
8353
- _context48.next = 2;
9261
+ _context49.next = 2;
8354
9262
  return this.rpcClient.simulateContract({
8355
9263
  abi: licensingModuleAbi,
8356
9264
  address: this.address,
@@ -8359,17 +9267,17 @@ var LicensingModuleClient = /*#__PURE__*/function (_LicensingModuleEvent) {
8359
9267
  args: [request.ipId, request.licenseTemplate, request.licenseTermsId]
8360
9268
  });
8361
9269
  case 2:
8362
- _yield$this$rpcClient23 = _context48.sent;
8363
- call = _yield$this$rpcClient23.request;
8364
- _context48.next = 6;
9270
+ _yield$this$rpcClient24 = _context49.sent;
9271
+ call = _yield$this$rpcClient24.request;
9272
+ _context49.next = 6;
8365
9273
  return this.wallet.writeContract(call);
8366
9274
  case 6:
8367
- return _context48.abrupt("return", _context48.sent);
9275
+ return _context49.abrupt("return", _context49.sent);
8368
9276
  case 7:
8369
9277
  case "end":
8370
- return _context48.stop();
9278
+ return _context49.stop();
8371
9279
  }
8372
- }, _callee48, this);
9280
+ }, _callee49, this);
8373
9281
  }));
8374
9282
  function attachLicenseTerms(_x40) {
8375
9283
  return _attachLicenseTerms.apply(this, arguments);
@@ -8386,12 +9294,12 @@ var LicensingModuleClient = /*#__PURE__*/function (_LicensingModuleEvent) {
8386
9294
  }, {
8387
9295
  key: "mintLicenseTokens",
8388
9296
  value: (function () {
8389
- var _mintLicenseTokens = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee49(request) {
8390
- var _yield$this$rpcClient24, call;
8391
- return _regeneratorRuntime().wrap(function _callee49$(_context49) {
8392
- while (1) switch (_context49.prev = _context49.next) {
9297
+ var _mintLicenseTokens = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee50(request) {
9298
+ var _yield$this$rpcClient25, call;
9299
+ return _regeneratorRuntime().wrap(function _callee50$(_context50) {
9300
+ while (1) switch (_context50.prev = _context50.next) {
8393
9301
  case 0:
8394
- _context49.next = 2;
9302
+ _context50.next = 2;
8395
9303
  return this.rpcClient.simulateContract({
8396
9304
  abi: licensingModuleAbi,
8397
9305
  address: this.address,
@@ -8400,17 +9308,17 @@ var LicensingModuleClient = /*#__PURE__*/function (_LicensingModuleEvent) {
8400
9308
  args: [request.licensorIpId, request.licenseTemplate, request.licenseTermsId, request.amount, request.receiver, request.royaltyContext]
8401
9309
  });
8402
9310
  case 2:
8403
- _yield$this$rpcClient24 = _context49.sent;
8404
- call = _yield$this$rpcClient24.request;
8405
- _context49.next = 6;
9311
+ _yield$this$rpcClient25 = _context50.sent;
9312
+ call = _yield$this$rpcClient25.request;
9313
+ _context50.next = 6;
8406
9314
  return this.wallet.writeContract(call);
8407
9315
  case 6:
8408
- return _context49.abrupt("return", _context49.sent);
9316
+ return _context50.abrupt("return", _context50.sent);
8409
9317
  case 7:
8410
9318
  case "end":
8411
- return _context49.stop();
9319
+ return _context50.stop();
8412
9320
  }
8413
- }, _callee49, this);
9321
+ }, _callee50, this);
8414
9322
  }));
8415
9323
  function mintLicenseTokens(_x41) {
8416
9324
  return _mintLicenseTokens.apply(this, arguments);
@@ -8427,12 +9335,12 @@ var LicensingModuleClient = /*#__PURE__*/function (_LicensingModuleEvent) {
8427
9335
  }, {
8428
9336
  key: "registerDerivative",
8429
9337
  value: (function () {
8430
- var _registerDerivative = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee50(request) {
8431
- var _yield$this$rpcClient25, call;
8432
- return _regeneratorRuntime().wrap(function _callee50$(_context50) {
8433
- while (1) switch (_context50.prev = _context50.next) {
9338
+ var _registerDerivative = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee51(request) {
9339
+ var _yield$this$rpcClient26, call;
9340
+ return _regeneratorRuntime().wrap(function _callee51$(_context51) {
9341
+ while (1) switch (_context51.prev = _context51.next) {
8434
9342
  case 0:
8435
- _context50.next = 2;
9343
+ _context51.next = 2;
8436
9344
  return this.rpcClient.simulateContract({
8437
9345
  abi: licensingModuleAbi,
8438
9346
  address: this.address,
@@ -8441,17 +9349,17 @@ var LicensingModuleClient = /*#__PURE__*/function (_LicensingModuleEvent) {
8441
9349
  args: [request.childIpId, request.parentIpIds, request.licenseTermsIds, request.licenseTemplate, request.royaltyContext]
8442
9350
  });
8443
9351
  case 2:
8444
- _yield$this$rpcClient25 = _context50.sent;
8445
- call = _yield$this$rpcClient25.request;
8446
- _context50.next = 6;
9352
+ _yield$this$rpcClient26 = _context51.sent;
9353
+ call = _yield$this$rpcClient26.request;
9354
+ _context51.next = 6;
8447
9355
  return this.wallet.writeContract(call);
8448
9356
  case 6:
8449
- return _context50.abrupt("return", _context50.sent);
9357
+ return _context51.abrupt("return", _context51.sent);
8450
9358
  case 7:
8451
9359
  case "end":
8452
- return _context50.stop();
9360
+ return _context51.stop();
8453
9361
  }
8454
- }, _callee50, this);
9362
+ }, _callee51, this);
8455
9363
  }));
8456
9364
  function registerDerivative(_x42) {
8457
9365
  return _registerDerivative.apply(this, arguments);
@@ -8468,12 +9376,12 @@ var LicensingModuleClient = /*#__PURE__*/function (_LicensingModuleEvent) {
8468
9376
  }, {
8469
9377
  key: "registerDerivativeWithLicenseTokens",
8470
9378
  value: (function () {
8471
- var _registerDerivativeWithLicenseTokens = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee51(request) {
8472
- var _yield$this$rpcClient26, call;
8473
- return _regeneratorRuntime().wrap(function _callee51$(_context51) {
8474
- while (1) switch (_context51.prev = _context51.next) {
9379
+ var _registerDerivativeWithLicenseTokens = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee52(request) {
9380
+ var _yield$this$rpcClient27, call;
9381
+ return _regeneratorRuntime().wrap(function _callee52$(_context52) {
9382
+ while (1) switch (_context52.prev = _context52.next) {
8475
9383
  case 0:
8476
- _context51.next = 2;
9384
+ _context52.next = 2;
8477
9385
  return this.rpcClient.simulateContract({
8478
9386
  abi: licensingModuleAbi,
8479
9387
  address: this.address,
@@ -8482,17 +9390,17 @@ var LicensingModuleClient = /*#__PURE__*/function (_LicensingModuleEvent) {
8482
9390
  args: [request.childIpId, request.licenseTokenIds, request.royaltyContext]
8483
9391
  });
8484
9392
  case 2:
8485
- _yield$this$rpcClient26 = _context51.sent;
8486
- call = _yield$this$rpcClient26.request;
8487
- _context51.next = 6;
9393
+ _yield$this$rpcClient27 = _context52.sent;
9394
+ call = _yield$this$rpcClient27.request;
9395
+ _context52.next = 6;
8488
9396
  return this.wallet.writeContract(call);
8489
9397
  case 6:
8490
- return _context51.abrupt("return", _context51.sent);
9398
+ return _context52.abrupt("return", _context52.sent);
8491
9399
  case 7:
8492
9400
  case "end":
8493
- return _context51.stop();
9401
+ return _context52.stop();
8494
9402
  }
8495
- }, _callee51, this);
9403
+ }, _callee52, this);
8496
9404
  }));
8497
9405
  function registerDerivativeWithLicenseTokens(_x43) {
8498
9406
  return _registerDerivativeWithLicenseTokens.apply(this, arguments);
@@ -8669,14 +9577,14 @@ var PiLicenseTemplateEventClient = /*#__PURE__*/function () {
8669
9577
  */
8670
9578
  return _createClass(PiLicenseTemplateEventClient, [{
8671
9579
  key: "watchDerivativeApprovedEvent",
8672
- value: function watchDerivativeApprovedEvent(_onLogs14) {
9580
+ value: function watchDerivativeApprovedEvent(_onLogs16) {
8673
9581
  return this.rpcClient.watchContractEvent({
8674
9582
  abi: piLicenseTemplateAbi,
8675
9583
  address: this.address,
8676
9584
  eventName: "DerivativeApproved",
8677
9585
  onLogs: function onLogs(evs) {
8678
9586
  evs.forEach(function (it) {
8679
- return _onLogs14(it.transactionHash, it.args);
9587
+ return _onLogs16(it.transactionHash, it.args);
8680
9588
  });
8681
9589
  }
8682
9590
  });
@@ -8689,11 +9597,11 @@ var PiLicenseTemplateEventClient = /*#__PURE__*/function () {
8689
9597
  key: "parseTxDerivativeApprovedEvent",
8690
9598
  value: function parseTxDerivativeApprovedEvent(txReceipt) {
8691
9599
  var targetLogs = [];
8692
- var _iterator14 = _createForOfIteratorHelper(txReceipt.logs),
8693
- _step14;
9600
+ var _iterator16 = _createForOfIteratorHelper(txReceipt.logs),
9601
+ _step16;
8694
9602
  try {
8695
- for (_iterator14.s(); !(_step14 = _iterator14.n()).done;) {
8696
- var log = _step14.value;
9603
+ for (_iterator16.s(); !(_step16 = _iterator16.n()).done;) {
9604
+ var log = _step16.value;
8697
9605
  try {
8698
9606
  var event = viem.decodeEventLog({
8699
9607
  abi: piLicenseTemplateAbi,
@@ -8709,9 +9617,9 @@ var PiLicenseTemplateEventClient = /*#__PURE__*/function () {
8709
9617
  }
8710
9618
  }
8711
9619
  } catch (err) {
8712
- _iterator14.e(err);
9620
+ _iterator16.e(err);
8713
9621
  } finally {
8714
- _iterator14.f();
9622
+ _iterator16.f();
8715
9623
  }
8716
9624
  return targetLogs;
8717
9625
  }
@@ -8721,14 +9629,14 @@ var PiLicenseTemplateEventClient = /*#__PURE__*/function () {
8721
9629
  */
8722
9630
  }, {
8723
9631
  key: "watchInitializedEvent",
8724
- value: function watchInitializedEvent(_onLogs15) {
9632
+ value: function watchInitializedEvent(_onLogs17) {
8725
9633
  return this.rpcClient.watchContractEvent({
8726
9634
  abi: piLicenseTemplateAbi,
8727
9635
  address: this.address,
8728
9636
  eventName: "Initialized",
8729
9637
  onLogs: function onLogs(evs) {
8730
9638
  evs.forEach(function (it) {
8731
- return _onLogs15(it.transactionHash, it.args);
9639
+ return _onLogs17(it.transactionHash, it.args);
8732
9640
  });
8733
9641
  }
8734
9642
  });
@@ -8741,11 +9649,11 @@ var PiLicenseTemplateEventClient = /*#__PURE__*/function () {
8741
9649
  key: "parseTxInitializedEvent",
8742
9650
  value: function parseTxInitializedEvent(txReceipt) {
8743
9651
  var targetLogs = [];
8744
- var _iterator15 = _createForOfIteratorHelper(txReceipt.logs),
8745
- _step15;
9652
+ var _iterator17 = _createForOfIteratorHelper(txReceipt.logs),
9653
+ _step17;
8746
9654
  try {
8747
- for (_iterator15.s(); !(_step15 = _iterator15.n()).done;) {
8748
- var log = _step15.value;
9655
+ for (_iterator17.s(); !(_step17 = _iterator17.n()).done;) {
9656
+ var log = _step17.value;
8749
9657
  try {
8750
9658
  var event = viem.decodeEventLog({
8751
9659
  abi: piLicenseTemplateAbi,
@@ -8761,9 +9669,9 @@ var PiLicenseTemplateEventClient = /*#__PURE__*/function () {
8761
9669
  }
8762
9670
  }
8763
9671
  } catch (err) {
8764
- _iterator15.e(err);
9672
+ _iterator17.e(err);
8765
9673
  } finally {
8766
- _iterator15.f();
9674
+ _iterator17.f();
8767
9675
  }
8768
9676
  return targetLogs;
8769
9677
  }
@@ -8773,14 +9681,14 @@ var PiLicenseTemplateEventClient = /*#__PURE__*/function () {
8773
9681
  */
8774
9682
  }, {
8775
9683
  key: "watchLicenseTermsRegisteredEvent",
8776
- value: function watchLicenseTermsRegisteredEvent(_onLogs16) {
9684
+ value: function watchLicenseTermsRegisteredEvent(_onLogs18) {
8777
9685
  return this.rpcClient.watchContractEvent({
8778
9686
  abi: piLicenseTemplateAbi,
8779
9687
  address: this.address,
8780
9688
  eventName: "LicenseTermsRegistered",
8781
9689
  onLogs: function onLogs(evs) {
8782
9690
  evs.forEach(function (it) {
8783
- return _onLogs16(it.transactionHash, it.args);
9691
+ return _onLogs18(it.transactionHash, it.args);
8784
9692
  });
8785
9693
  }
8786
9694
  });
@@ -8793,11 +9701,11 @@ var PiLicenseTemplateEventClient = /*#__PURE__*/function () {
8793
9701
  key: "parseTxLicenseTermsRegisteredEvent",
8794
9702
  value: function parseTxLicenseTermsRegisteredEvent(txReceipt) {
8795
9703
  var targetLogs = [];
8796
- var _iterator16 = _createForOfIteratorHelper(txReceipt.logs),
8797
- _step16;
9704
+ var _iterator18 = _createForOfIteratorHelper(txReceipt.logs),
9705
+ _step18;
8798
9706
  try {
8799
- for (_iterator16.s(); !(_step16 = _iterator16.n()).done;) {
8800
- var log = _step16.value;
9707
+ for (_iterator18.s(); !(_step18 = _iterator18.n()).done;) {
9708
+ var log = _step18.value;
8801
9709
  try {
8802
9710
  var event = viem.decodeEventLog({
8803
9711
  abi: piLicenseTemplateAbi,
@@ -8813,9 +9721,9 @@ var PiLicenseTemplateEventClient = /*#__PURE__*/function () {
8813
9721
  }
8814
9722
  }
8815
9723
  } catch (err) {
8816
- _iterator16.e(err);
9724
+ _iterator18.e(err);
8817
9725
  } finally {
8818
- _iterator16.f();
9726
+ _iterator18.f();
8819
9727
  }
8820
9728
  return targetLogs;
8821
9729
  }
@@ -8841,23 +9749,23 @@ var PiLicenseTemplateReadOnlyClient = /*#__PURE__*/function (_PiLicenseTemplateE
8841
9749
  return _createClass(PiLicenseTemplateReadOnlyClient, [{
8842
9750
  key: "accessController",
8843
9751
  value: (function () {
8844
- var _accessController = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee53() {
8845
- return _regeneratorRuntime().wrap(function _callee53$(_context53) {
8846
- while (1) switch (_context53.prev = _context53.next) {
9752
+ var _accessController = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee54() {
9753
+ return _regeneratorRuntime().wrap(function _callee54$(_context54) {
9754
+ while (1) switch (_context54.prev = _context54.next) {
8847
9755
  case 0:
8848
- _context53.next = 2;
9756
+ _context54.next = 2;
8849
9757
  return this.rpcClient.readContract({
8850
9758
  abi: piLicenseTemplateAbi,
8851
9759
  address: this.address,
8852
9760
  functionName: "ACCESS_CONTROLLER"
8853
9761
  });
8854
9762
  case 2:
8855
- return _context53.abrupt("return", _context53.sent);
9763
+ return _context54.abrupt("return", _context54.sent);
8856
9764
  case 3:
8857
9765
  case "end":
8858
- return _context53.stop();
9766
+ return _context54.stop();
8859
9767
  }
8860
- }, _callee53, this);
9768
+ }, _callee54, this);
8861
9769
  }));
8862
9770
  function accessController() {
8863
9771
  return _accessController.apply(this, arguments);
@@ -8874,23 +9782,23 @@ var PiLicenseTemplateReadOnlyClient = /*#__PURE__*/function (_PiLicenseTemplateE
8874
9782
  }, {
8875
9783
  key: "ipAccountRegistry",
8876
9784
  value: (function () {
8877
- var _ipAccountRegistry = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee54() {
8878
- return _regeneratorRuntime().wrap(function _callee54$(_context54) {
8879
- while (1) switch (_context54.prev = _context54.next) {
9785
+ var _ipAccountRegistry = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee55() {
9786
+ return _regeneratorRuntime().wrap(function _callee55$(_context55) {
9787
+ while (1) switch (_context55.prev = _context55.next) {
8880
9788
  case 0:
8881
- _context54.next = 2;
9789
+ _context55.next = 2;
8882
9790
  return this.rpcClient.readContract({
8883
9791
  abi: piLicenseTemplateAbi,
8884
9792
  address: this.address,
8885
9793
  functionName: "IP_ACCOUNT_REGISTRY"
8886
9794
  });
8887
9795
  case 2:
8888
- return _context54.abrupt("return", _context54.sent);
9796
+ return _context55.abrupt("return", _context55.sent);
8889
9797
  case 3:
8890
9798
  case "end":
8891
- return _context54.stop();
9799
+ return _context55.stop();
8892
9800
  }
8893
- }, _callee54, this);
9801
+ }, _callee55, this);
8894
9802
  }));
8895
9803
  function ipAccountRegistry() {
8896
9804
  return _ipAccountRegistry.apply(this, arguments);
@@ -8907,23 +9815,23 @@ var PiLicenseTemplateReadOnlyClient = /*#__PURE__*/function (_PiLicenseTemplateE
8907
9815
  }, {
8908
9816
  key: "licenseNft",
8909
9817
  value: (function () {
8910
- var _licenseNft = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee55() {
8911
- return _regeneratorRuntime().wrap(function _callee55$(_context55) {
8912
- while (1) switch (_context55.prev = _context55.next) {
9818
+ var _licenseNft = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee56() {
9819
+ return _regeneratorRuntime().wrap(function _callee56$(_context56) {
9820
+ while (1) switch (_context56.prev = _context56.next) {
8913
9821
  case 0:
8914
- _context55.next = 2;
9822
+ _context56.next = 2;
8915
9823
  return this.rpcClient.readContract({
8916
9824
  abi: piLicenseTemplateAbi,
8917
9825
  address: this.address,
8918
9826
  functionName: "LICENSE_NFT"
8919
9827
  });
8920
9828
  case 2:
8921
- return _context55.abrupt("return", _context55.sent);
9829
+ return _context56.abrupt("return", _context56.sent);
8922
9830
  case 3:
8923
9831
  case "end":
8924
- return _context55.stop();
9832
+ return _context56.stop();
8925
9833
  }
8926
- }, _callee55, this);
9834
+ }, _callee56, this);
8927
9835
  }));
8928
9836
  function licenseNft() {
8929
9837
  return _licenseNft.apply(this, arguments);
@@ -8940,23 +9848,23 @@ var PiLicenseTemplateReadOnlyClient = /*#__PURE__*/function (_PiLicenseTemplateE
8940
9848
  }, {
8941
9849
  key: "licenseRegistry",
8942
9850
  value: (function () {
8943
- var _licenseRegistry = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee56() {
8944
- return _regeneratorRuntime().wrap(function _callee56$(_context56) {
8945
- while (1) switch (_context56.prev = _context56.next) {
9851
+ var _licenseRegistry = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee57() {
9852
+ return _regeneratorRuntime().wrap(function _callee57$(_context57) {
9853
+ while (1) switch (_context57.prev = _context57.next) {
8946
9854
  case 0:
8947
- _context56.next = 2;
9855
+ _context57.next = 2;
8948
9856
  return this.rpcClient.readContract({
8949
9857
  abi: piLicenseTemplateAbi,
8950
9858
  address: this.address,
8951
9859
  functionName: "LICENSE_REGISTRY"
8952
9860
  });
8953
9861
  case 2:
8954
- return _context56.abrupt("return", _context56.sent);
9862
+ return _context57.abrupt("return", _context57.sent);
8955
9863
  case 3:
8956
9864
  case "end":
8957
- return _context56.stop();
9865
+ return _context57.stop();
8958
9866
  }
8959
- }, _callee56, this);
9867
+ }, _callee57, this);
8960
9868
  }));
8961
9869
  function licenseRegistry() {
8962
9870
  return _licenseRegistry.apply(this, arguments);
@@ -8973,23 +9881,23 @@ var PiLicenseTemplateReadOnlyClient = /*#__PURE__*/function (_PiLicenseTemplateE
8973
9881
  }, {
8974
9882
  key: "royaltyModule",
8975
9883
  value: (function () {
8976
- var _royaltyModule = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee57() {
8977
- return _regeneratorRuntime().wrap(function _callee57$(_context57) {
8978
- while (1) switch (_context57.prev = _context57.next) {
9884
+ var _royaltyModule = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee58() {
9885
+ return _regeneratorRuntime().wrap(function _callee58$(_context58) {
9886
+ while (1) switch (_context58.prev = _context58.next) {
8979
9887
  case 0:
8980
- _context57.next = 2;
9888
+ _context58.next = 2;
8981
9889
  return this.rpcClient.readContract({
8982
9890
  abi: piLicenseTemplateAbi,
8983
9891
  address: this.address,
8984
9892
  functionName: "ROYALTY_MODULE"
8985
9893
  });
8986
9894
  case 2:
8987
- return _context57.abrupt("return", _context57.sent);
9895
+ return _context58.abrupt("return", _context58.sent);
8988
9896
  case 3:
8989
9897
  case "end":
8990
- return _context57.stop();
9898
+ return _context58.stop();
8991
9899
  }
8992
- }, _callee57, this);
9900
+ }, _callee58, this);
8993
9901
  }));
8994
9902
  function royaltyModule() {
8995
9903
  return _royaltyModule.apply(this, arguments);
@@ -9006,11 +9914,11 @@ var PiLicenseTemplateReadOnlyClient = /*#__PURE__*/function (_PiLicenseTemplateE
9006
9914
  }, {
9007
9915
  key: "exists",
9008
9916
  value: (function () {
9009
- var _exists2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee58(request) {
9010
- return _regeneratorRuntime().wrap(function _callee58$(_context58) {
9011
- while (1) switch (_context58.prev = _context58.next) {
9917
+ var _exists2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee59(request) {
9918
+ return _regeneratorRuntime().wrap(function _callee59$(_context59) {
9919
+ while (1) switch (_context59.prev = _context59.next) {
9012
9920
  case 0:
9013
- _context58.next = 2;
9921
+ _context59.next = 2;
9014
9922
  return this.rpcClient.readContract({
9015
9923
  abi: piLicenseTemplateAbi,
9016
9924
  address: this.address,
@@ -9018,12 +9926,12 @@ var PiLicenseTemplateReadOnlyClient = /*#__PURE__*/function (_PiLicenseTemplateE
9018
9926
  args: [request.licenseTermsId]
9019
9927
  });
9020
9928
  case 2:
9021
- return _context58.abrupt("return", _context58.sent);
9929
+ return _context59.abrupt("return", _context59.sent);
9022
9930
  case 3:
9023
9931
  case "end":
9024
- return _context58.stop();
9932
+ return _context59.stop();
9025
9933
  }
9026
- }, _callee58, this);
9934
+ }, _callee59, this);
9027
9935
  }));
9028
9936
  function exists(_x45) {
9029
9937
  return _exists2.apply(this, arguments);
@@ -9040,11 +9948,11 @@ var PiLicenseTemplateReadOnlyClient = /*#__PURE__*/function (_PiLicenseTemplateE
9040
9948
  }, {
9041
9949
  key: "getEarlierExpireTime",
9042
9950
  value: (function () {
9043
- var _getEarlierExpireTime = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee59(request) {
9044
- return _regeneratorRuntime().wrap(function _callee59$(_context59) {
9045
- while (1) switch (_context59.prev = _context59.next) {
9951
+ var _getEarlierExpireTime = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee60(request) {
9952
+ return _regeneratorRuntime().wrap(function _callee60$(_context60) {
9953
+ while (1) switch (_context60.prev = _context60.next) {
9046
9954
  case 0:
9047
- _context59.next = 2;
9955
+ _context60.next = 2;
9048
9956
  return this.rpcClient.readContract({
9049
9957
  abi: piLicenseTemplateAbi,
9050
9958
  address: this.address,
@@ -9052,12 +9960,12 @@ var PiLicenseTemplateReadOnlyClient = /*#__PURE__*/function (_PiLicenseTemplateE
9052
9960
  args: [request.licenseTermsIds, request.start]
9053
9961
  });
9054
9962
  case 2:
9055
- return _context59.abrupt("return", _context59.sent);
9963
+ return _context60.abrupt("return", _context60.sent);
9056
9964
  case 3:
9057
9965
  case "end":
9058
- return _context59.stop();
9966
+ return _context60.stop();
9059
9967
  }
9060
- }, _callee59, this);
9968
+ }, _callee60, this);
9061
9969
  }));
9062
9970
  function getEarlierExpireTime(_x46) {
9063
9971
  return _getEarlierExpireTime.apply(this, arguments);
@@ -9074,11 +9982,11 @@ var PiLicenseTemplateReadOnlyClient = /*#__PURE__*/function (_PiLicenseTemplateE
9074
9982
  }, {
9075
9983
  key: "getExpireTime",
9076
9984
  value: (function () {
9077
- var _getExpireTime2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee60(request) {
9078
- return _regeneratorRuntime().wrap(function _callee60$(_context60) {
9079
- while (1) switch (_context60.prev = _context60.next) {
9985
+ var _getExpireTime2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee61(request) {
9986
+ return _regeneratorRuntime().wrap(function _callee61$(_context61) {
9987
+ while (1) switch (_context61.prev = _context61.next) {
9080
9988
  case 0:
9081
- _context60.next = 2;
9989
+ _context61.next = 2;
9082
9990
  return this.rpcClient.readContract({
9083
9991
  abi: piLicenseTemplateAbi,
9084
9992
  address: this.address,
@@ -9086,12 +9994,12 @@ var PiLicenseTemplateReadOnlyClient = /*#__PURE__*/function (_PiLicenseTemplateE
9086
9994
  args: [request.licenseTermsId, request.start]
9087
9995
  });
9088
9996
  case 2:
9089
- return _context60.abrupt("return", _context60.sent);
9997
+ return _context61.abrupt("return", _context61.sent);
9090
9998
  case 3:
9091
9999
  case "end":
9092
- return _context60.stop();
10000
+ return _context61.stop();
9093
10001
  }
9094
- }, _callee60, this);
10002
+ }, _callee61, this);
9095
10003
  }));
9096
10004
  function getExpireTime(_x47) {
9097
10005
  return _getExpireTime2.apply(this, arguments);
@@ -9108,12 +10016,12 @@ var PiLicenseTemplateReadOnlyClient = /*#__PURE__*/function (_PiLicenseTemplateE
9108
10016
  }, {
9109
10017
  key: "getLicenseTermsId",
9110
10018
  value: (function () {
9111
- var _getLicenseTermsId = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee61(request) {
10019
+ var _getLicenseTermsId = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee62(request) {
9112
10020
  var result;
9113
- return _regeneratorRuntime().wrap(function _callee61$(_context61) {
9114
- while (1) switch (_context61.prev = _context61.next) {
10021
+ return _regeneratorRuntime().wrap(function _callee62$(_context62) {
10022
+ while (1) switch (_context62.prev = _context62.next) {
9115
10023
  case 0:
9116
- _context61.next = 2;
10024
+ _context62.next = 2;
9117
10025
  return this.rpcClient.readContract({
9118
10026
  abi: piLicenseTemplateAbi,
9119
10027
  address: this.address,
@@ -9121,15 +10029,15 @@ var PiLicenseTemplateReadOnlyClient = /*#__PURE__*/function (_PiLicenseTemplateE
9121
10029
  args: [request.terms]
9122
10030
  });
9123
10031
  case 2:
9124
- result = _context61.sent;
9125
- return _context61.abrupt("return", {
10032
+ result = _context62.sent;
10033
+ return _context62.abrupt("return", {
9126
10034
  selectedLicenseTermsId: result
9127
10035
  });
9128
10036
  case 4:
9129
10037
  case "end":
9130
- return _context61.stop();
10038
+ return _context62.stop();
9131
10039
  }
9132
- }, _callee61, this);
10040
+ }, _callee62, this);
9133
10041
  }));
9134
10042
  function getLicenseTermsId(_x48) {
9135
10043
  return _getLicenseTermsId.apply(this, arguments);
@@ -9146,23 +10054,23 @@ var PiLicenseTemplateReadOnlyClient = /*#__PURE__*/function (_PiLicenseTemplateE
9146
10054
  }, {
9147
10055
  key: "getMetadataUri",
9148
10056
  value: (function () {
9149
- var _getMetadataUri = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee62() {
9150
- return _regeneratorRuntime().wrap(function _callee62$(_context62) {
9151
- while (1) switch (_context62.prev = _context62.next) {
10057
+ var _getMetadataUri = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee63() {
10058
+ return _regeneratorRuntime().wrap(function _callee63$(_context63) {
10059
+ while (1) switch (_context63.prev = _context63.next) {
9152
10060
  case 0:
9153
- _context62.next = 2;
10061
+ _context63.next = 2;
9154
10062
  return this.rpcClient.readContract({
9155
10063
  abi: piLicenseTemplateAbi,
9156
10064
  address: this.address,
9157
10065
  functionName: "getMetadataURI"
9158
10066
  });
9159
10067
  case 2:
9160
- return _context62.abrupt("return", _context62.sent);
10068
+ return _context63.abrupt("return", _context63.sent);
9161
10069
  case 3:
9162
10070
  case "end":
9163
- return _context62.stop();
10071
+ return _context63.stop();
9164
10072
  }
9165
- }, _callee62, this);
10073
+ }, _callee63, this);
9166
10074
  }));
9167
10075
  function getMetadataUri() {
9168
10076
  return _getMetadataUri.apply(this, arguments);
@@ -9179,12 +10087,12 @@ var PiLicenseTemplateReadOnlyClient = /*#__PURE__*/function (_PiLicenseTemplateE
9179
10087
  }, {
9180
10088
  key: "getRoyaltyPolicy",
9181
10089
  value: (function () {
9182
- var _getRoyaltyPolicy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee63(request) {
10090
+ var _getRoyaltyPolicy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee64(request) {
9183
10091
  var result;
9184
- return _regeneratorRuntime().wrap(function _callee63$(_context63) {
9185
- while (1) switch (_context63.prev = _context63.next) {
10092
+ return _regeneratorRuntime().wrap(function _callee64$(_context64) {
10093
+ while (1) switch (_context64.prev = _context64.next) {
9186
10094
  case 0:
9187
- _context63.next = 2;
10095
+ _context64.next = 2;
9188
10096
  return this.rpcClient.readContract({
9189
10097
  abi: piLicenseTemplateAbi,
9190
10098
  address: this.address,
@@ -9192,8 +10100,8 @@ var PiLicenseTemplateReadOnlyClient = /*#__PURE__*/function (_PiLicenseTemplateE
9192
10100
  args: [request.licenseTermsId]
9193
10101
  });
9194
10102
  case 2:
9195
- result = _context63.sent;
9196
- return _context63.abrupt("return", {
10103
+ result = _context64.sent;
10104
+ return _context64.abrupt("return", {
9197
10105
  royaltyPolicy: result[0],
9198
10106
  royaltyData: result[1],
9199
10107
  mintingFee: result[2],
@@ -9201,9 +10109,9 @@ var PiLicenseTemplateReadOnlyClient = /*#__PURE__*/function (_PiLicenseTemplateE
9201
10109
  });
9202
10110
  case 4:
9203
10111
  case "end":
9204
- return _context63.stop();
10112
+ return _context64.stop();
9205
10113
  }
9206
- }, _callee63, this);
10114
+ }, _callee64, this);
9207
10115
  }));
9208
10116
  function getRoyaltyPolicy(_x49) {
9209
10117
  return _getRoyaltyPolicy.apply(this, arguments);
@@ -9220,11 +10128,11 @@ var PiLicenseTemplateReadOnlyClient = /*#__PURE__*/function (_PiLicenseTemplateE
9220
10128
  }, {
9221
10129
  key: "isDerivativeApproved",
9222
10130
  value: (function () {
9223
- var _isDerivativeApproved = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee64(request) {
9224
- return _regeneratorRuntime().wrap(function _callee64$(_context64) {
9225
- while (1) switch (_context64.prev = _context64.next) {
10131
+ var _isDerivativeApproved = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee65(request) {
10132
+ return _regeneratorRuntime().wrap(function _callee65$(_context65) {
10133
+ while (1) switch (_context65.prev = _context65.next) {
9226
10134
  case 0:
9227
- _context64.next = 2;
10135
+ _context65.next = 2;
9228
10136
  return this.rpcClient.readContract({
9229
10137
  abi: piLicenseTemplateAbi,
9230
10138
  address: this.address,
@@ -9232,12 +10140,12 @@ var PiLicenseTemplateReadOnlyClient = /*#__PURE__*/function (_PiLicenseTemplateE
9232
10140
  args: [request.licenseTokenId, request.childIpId]
9233
10141
  });
9234
10142
  case 2:
9235
- return _context64.abrupt("return", _context64.sent);
10143
+ return _context65.abrupt("return", _context65.sent);
9236
10144
  case 3:
9237
10145
  case "end":
9238
- return _context64.stop();
10146
+ return _context65.stop();
9239
10147
  }
9240
- }, _callee64, this);
10148
+ }, _callee65, this);
9241
10149
  }));
9242
10150
  function isDerivativeApproved(_x50) {
9243
10151
  return _isDerivativeApproved.apply(this, arguments);
@@ -9254,11 +10162,11 @@ var PiLicenseTemplateReadOnlyClient = /*#__PURE__*/function (_PiLicenseTemplateE
9254
10162
  }, {
9255
10163
  key: "isLicenseTransferable",
9256
10164
  value: (function () {
9257
- var _isLicenseTransferable = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee65(request) {
9258
- return _regeneratorRuntime().wrap(function _callee65$(_context65) {
9259
- while (1) switch (_context65.prev = _context65.next) {
10165
+ var _isLicenseTransferable = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee66(request) {
10166
+ return _regeneratorRuntime().wrap(function _callee66$(_context66) {
10167
+ while (1) switch (_context66.prev = _context66.next) {
9260
10168
  case 0:
9261
- _context65.next = 2;
10169
+ _context66.next = 2;
9262
10170
  return this.rpcClient.readContract({
9263
10171
  abi: piLicenseTemplateAbi,
9264
10172
  address: this.address,
@@ -9266,12 +10174,12 @@ var PiLicenseTemplateReadOnlyClient = /*#__PURE__*/function (_PiLicenseTemplateE
9266
10174
  args: [request.licenseTermsId]
9267
10175
  });
9268
10176
  case 2:
9269
- return _context65.abrupt("return", _context65.sent);
10177
+ return _context66.abrupt("return", _context66.sent);
9270
10178
  case 3:
9271
10179
  case "end":
9272
- return _context65.stop();
10180
+ return _context66.stop();
9273
10181
  }
9274
- }, _callee65, this);
10182
+ }, _callee66, this);
9275
10183
  }));
9276
10184
  function isLicenseTransferable(_x51) {
9277
10185
  return _isLicenseTransferable.apply(this, arguments);
@@ -9288,23 +10196,23 @@ var PiLicenseTemplateReadOnlyClient = /*#__PURE__*/function (_PiLicenseTemplateE
9288
10196
  }, {
9289
10197
  key: "name",
9290
10198
  value: (function () {
9291
- var _name = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee66() {
9292
- return _regeneratorRuntime().wrap(function _callee66$(_context66) {
9293
- while (1) switch (_context66.prev = _context66.next) {
10199
+ var _name = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee67() {
10200
+ return _regeneratorRuntime().wrap(function _callee67$(_context67) {
10201
+ while (1) switch (_context67.prev = _context67.next) {
9294
10202
  case 0:
9295
- _context66.next = 2;
10203
+ _context67.next = 2;
9296
10204
  return this.rpcClient.readContract({
9297
10205
  abi: piLicenseTemplateAbi,
9298
10206
  address: this.address,
9299
10207
  functionName: "name"
9300
10208
  });
9301
10209
  case 2:
9302
- return _context66.abrupt("return", _context66.sent);
10210
+ return _context67.abrupt("return", _context67.sent);
9303
10211
  case 3:
9304
10212
  case "end":
9305
- return _context66.stop();
10213
+ return _context67.stop();
9306
10214
  }
9307
- }, _callee66, this);
10215
+ }, _callee67, this);
9308
10216
  }));
9309
10217
  function name() {
9310
10218
  return _name.apply(this, arguments);
@@ -9321,11 +10229,11 @@ var PiLicenseTemplateReadOnlyClient = /*#__PURE__*/function (_PiLicenseTemplateE
9321
10229
  }, {
9322
10230
  key: "supportsInterface",
9323
10231
  value: (function () {
9324
- var _supportsInterface = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee67(request) {
9325
- return _regeneratorRuntime().wrap(function _callee67$(_context67) {
9326
- while (1) switch (_context67.prev = _context67.next) {
10232
+ var _supportsInterface = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee68(request) {
10233
+ return _regeneratorRuntime().wrap(function _callee68$(_context68) {
10234
+ while (1) switch (_context68.prev = _context68.next) {
9327
10235
  case 0:
9328
- _context67.next = 2;
10236
+ _context68.next = 2;
9329
10237
  return this.rpcClient.readContract({
9330
10238
  abi: piLicenseTemplateAbi,
9331
10239
  address: this.address,
@@ -9333,12 +10241,12 @@ var PiLicenseTemplateReadOnlyClient = /*#__PURE__*/function (_PiLicenseTemplateE
9333
10241
  args: [request.interfaceId]
9334
10242
  });
9335
10243
  case 2:
9336
- return _context67.abrupt("return", _context67.sent);
10244
+ return _context68.abrupt("return", _context68.sent);
9337
10245
  case 3:
9338
10246
  case "end":
9339
- return _context67.stop();
10247
+ return _context68.stop();
9340
10248
  }
9341
- }, _callee67, this);
10249
+ }, _callee68, this);
9342
10250
  }));
9343
10251
  function supportsInterface(_x52) {
9344
10252
  return _supportsInterface.apply(this, arguments);
@@ -9355,11 +10263,11 @@ var PiLicenseTemplateReadOnlyClient = /*#__PURE__*/function (_PiLicenseTemplateE
9355
10263
  }, {
9356
10264
  key: "toJson",
9357
10265
  value: (function () {
9358
- var _toJson = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee68(request) {
9359
- return _regeneratorRuntime().wrap(function _callee68$(_context68) {
9360
- while (1) switch (_context68.prev = _context68.next) {
10266
+ var _toJson = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee69(request) {
10267
+ return _regeneratorRuntime().wrap(function _callee69$(_context69) {
10268
+ while (1) switch (_context69.prev = _context69.next) {
9361
10269
  case 0:
9362
- _context68.next = 2;
10270
+ _context69.next = 2;
9363
10271
  return this.rpcClient.readContract({
9364
10272
  abi: piLicenseTemplateAbi,
9365
10273
  address: this.address,
@@ -9367,12 +10275,12 @@ var PiLicenseTemplateReadOnlyClient = /*#__PURE__*/function (_PiLicenseTemplateE
9367
10275
  args: [request.licenseTermsId]
9368
10276
  });
9369
10277
  case 2:
9370
- return _context68.abrupt("return", _context68.sent);
10278
+ return _context69.abrupt("return", _context69.sent);
9371
10279
  case 3:
9372
10280
  case "end":
9373
- return _context68.stop();
10281
+ return _context69.stop();
9374
10282
  }
9375
- }, _callee68, this);
10283
+ }, _callee69, this);
9376
10284
  }));
9377
10285
  function toJson(_x53) {
9378
10286
  return _toJson.apply(this, arguments);
@@ -9389,23 +10297,23 @@ var PiLicenseTemplateReadOnlyClient = /*#__PURE__*/function (_PiLicenseTemplateE
9389
10297
  }, {
9390
10298
  key: "totalRegisteredLicenseTerms",
9391
10299
  value: (function () {
9392
- var _totalRegisteredLicenseTerms = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee69() {
9393
- return _regeneratorRuntime().wrap(function _callee69$(_context69) {
9394
- while (1) switch (_context69.prev = _context69.next) {
10300
+ var _totalRegisteredLicenseTerms = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee70() {
10301
+ return _regeneratorRuntime().wrap(function _callee70$(_context70) {
10302
+ while (1) switch (_context70.prev = _context70.next) {
9395
10303
  case 0:
9396
- _context69.next = 2;
10304
+ _context70.next = 2;
9397
10305
  return this.rpcClient.readContract({
9398
10306
  abi: piLicenseTemplateAbi,
9399
10307
  address: this.address,
9400
10308
  functionName: "totalRegisteredLicenseTerms"
9401
10309
  });
9402
10310
  case 2:
9403
- return _context69.abrupt("return", _context69.sent);
10311
+ return _context70.abrupt("return", _context70.sent);
9404
10312
  case 3:
9405
10313
  case "end":
9406
- return _context69.stop();
10314
+ return _context70.stop();
9407
10315
  }
9408
- }, _callee69, this);
10316
+ }, _callee70, this);
9409
10317
  }));
9410
10318
  function totalRegisteredLicenseTerms() {
9411
10319
  return _totalRegisteredLicenseTerms.apply(this, arguments);
@@ -9422,11 +10330,11 @@ var PiLicenseTemplateReadOnlyClient = /*#__PURE__*/function (_PiLicenseTemplateE
9422
10330
  }, {
9423
10331
  key: "verifyCompatibleLicenses",
9424
10332
  value: (function () {
9425
- var _verifyCompatibleLicenses = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee70(request) {
9426
- return _regeneratorRuntime().wrap(function _callee70$(_context70) {
9427
- while (1) switch (_context70.prev = _context70.next) {
10333
+ var _verifyCompatibleLicenses = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee71(request) {
10334
+ return _regeneratorRuntime().wrap(function _callee71$(_context71) {
10335
+ while (1) switch (_context71.prev = _context71.next) {
9428
10336
  case 0:
9429
- _context70.next = 2;
10337
+ _context71.next = 2;
9430
10338
  return this.rpcClient.readContract({
9431
10339
  abi: piLicenseTemplateAbi,
9432
10340
  address: this.address,
@@ -9434,12 +10342,12 @@ var PiLicenseTemplateReadOnlyClient = /*#__PURE__*/function (_PiLicenseTemplateE
9434
10342
  args: [request.licenseTermsIds]
9435
10343
  });
9436
10344
  case 2:
9437
- return _context70.abrupt("return", _context70.sent);
10345
+ return _context71.abrupt("return", _context71.sent);
9438
10346
  case 3:
9439
10347
  case "end":
9440
- return _context70.stop();
10348
+ return _context71.stop();
9441
10349
  }
9442
- }, _callee70, this);
10350
+ }, _callee71, this);
9443
10351
  }));
9444
10352
  function verifyCompatibleLicenses(_x54) {
9445
10353
  return _verifyCompatibleLicenses.apply(this, arguments);
@@ -9471,12 +10379,12 @@ var PiLicenseTemplateClient = /*#__PURE__*/function (_PiLicenseTemplateRea) {
9471
10379
  return _createClass(PiLicenseTemplateClient, [{
9472
10380
  key: "initialize",
9473
10381
  value: (function () {
9474
- var _initialize2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee71(request) {
9475
- var _yield$this$rpcClient27, call;
9476
- return _regeneratorRuntime().wrap(function _callee71$(_context71) {
9477
- while (1) switch (_context71.prev = _context71.next) {
10382
+ var _initialize2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee72(request) {
10383
+ var _yield$this$rpcClient28, call;
10384
+ return _regeneratorRuntime().wrap(function _callee72$(_context72) {
10385
+ while (1) switch (_context72.prev = _context72.next) {
9478
10386
  case 0:
9479
- _context71.next = 2;
10387
+ _context72.next = 2;
9480
10388
  return this.rpcClient.simulateContract({
9481
10389
  abi: piLicenseTemplateAbi,
9482
10390
  address: this.address,
@@ -9485,17 +10393,17 @@ var PiLicenseTemplateClient = /*#__PURE__*/function (_PiLicenseTemplateRea) {
9485
10393
  args: [request.name, request.metadataURI]
9486
10394
  });
9487
10395
  case 2:
9488
- _yield$this$rpcClient27 = _context71.sent;
9489
- call = _yield$this$rpcClient27.request;
9490
- _context71.next = 6;
10396
+ _yield$this$rpcClient28 = _context72.sent;
10397
+ call = _yield$this$rpcClient28.request;
10398
+ _context72.next = 6;
9491
10399
  return this.wallet.writeContract(call);
9492
10400
  case 6:
9493
- return _context71.abrupt("return", _context71.sent);
10401
+ return _context72.abrupt("return", _context72.sent);
9494
10402
  case 7:
9495
10403
  case "end":
9496
- return _context71.stop();
10404
+ return _context72.stop();
9497
10405
  }
9498
- }, _callee71, this);
10406
+ }, _callee72, this);
9499
10407
  }));
9500
10408
  function initialize(_x55) {
9501
10409
  return _initialize2.apply(this, arguments);
@@ -9512,12 +10420,12 @@ var PiLicenseTemplateClient = /*#__PURE__*/function (_PiLicenseTemplateRea) {
9512
10420
  }, {
9513
10421
  key: "registerLicenseTerms",
9514
10422
  value: (function () {
9515
- var _registerLicenseTerms = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee72(request) {
9516
- var _yield$this$rpcClient28, call;
9517
- return _regeneratorRuntime().wrap(function _callee72$(_context72) {
9518
- while (1) switch (_context72.prev = _context72.next) {
10423
+ var _registerLicenseTerms = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee73(request) {
10424
+ var _yield$this$rpcClient29, call;
10425
+ return _regeneratorRuntime().wrap(function _callee73$(_context73) {
10426
+ while (1) switch (_context73.prev = _context73.next) {
9519
10427
  case 0:
9520
- _context72.next = 2;
10428
+ _context73.next = 2;
9521
10429
  return this.rpcClient.simulateContract({
9522
10430
  abi: piLicenseTemplateAbi,
9523
10431
  address: this.address,
@@ -9526,17 +10434,17 @@ var PiLicenseTemplateClient = /*#__PURE__*/function (_PiLicenseTemplateRea) {
9526
10434
  args: [request.terms]
9527
10435
  });
9528
10436
  case 2:
9529
- _yield$this$rpcClient28 = _context72.sent;
9530
- call = _yield$this$rpcClient28.request;
9531
- _context72.next = 6;
10437
+ _yield$this$rpcClient29 = _context73.sent;
10438
+ call = _yield$this$rpcClient29.request;
10439
+ _context73.next = 6;
9532
10440
  return this.wallet.writeContract(call);
9533
10441
  case 6:
9534
- return _context72.abrupt("return", _context72.sent);
10442
+ return _context73.abrupt("return", _context73.sent);
9535
10443
  case 7:
9536
10444
  case "end":
9537
- return _context72.stop();
10445
+ return _context73.stop();
9538
10446
  }
9539
- }, _callee72, this);
10447
+ }, _callee73, this);
9540
10448
  }));
9541
10449
  function registerLicenseTerms(_x56) {
9542
10450
  return _registerLicenseTerms.apply(this, arguments);
@@ -9553,12 +10461,12 @@ var PiLicenseTemplateClient = /*#__PURE__*/function (_PiLicenseTemplateRea) {
9553
10461
  }, {
9554
10462
  key: "setApproval",
9555
10463
  value: (function () {
9556
- var _setApproval = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee73(request) {
9557
- var _yield$this$rpcClient29, call;
9558
- return _regeneratorRuntime().wrap(function _callee73$(_context73) {
9559
- while (1) switch (_context73.prev = _context73.next) {
10464
+ var _setApproval = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee74(request) {
10465
+ var _yield$this$rpcClient30, call;
10466
+ return _regeneratorRuntime().wrap(function _callee74$(_context74) {
10467
+ while (1) switch (_context74.prev = _context74.next) {
9560
10468
  case 0:
9561
- _context73.next = 2;
10469
+ _context74.next = 2;
9562
10470
  return this.rpcClient.simulateContract({
9563
10471
  abi: piLicenseTemplateAbi,
9564
10472
  address: this.address,
@@ -9567,17 +10475,17 @@ var PiLicenseTemplateClient = /*#__PURE__*/function (_PiLicenseTemplateRea) {
9567
10475
  args: [request.licenseTokenId, request.childIpId, request.approved]
9568
10476
  });
9569
10477
  case 2:
9570
- _yield$this$rpcClient29 = _context73.sent;
9571
- call = _yield$this$rpcClient29.request;
9572
- _context73.next = 6;
10478
+ _yield$this$rpcClient30 = _context74.sent;
10479
+ call = _yield$this$rpcClient30.request;
10480
+ _context74.next = 6;
9573
10481
  return this.wallet.writeContract(call);
9574
10482
  case 6:
9575
- return _context73.abrupt("return", _context73.sent);
10483
+ return _context74.abrupt("return", _context74.sent);
9576
10484
  case 7:
9577
10485
  case "end":
9578
- return _context73.stop();
10486
+ return _context74.stop();
9579
10487
  }
9580
- }, _callee73, this);
10488
+ }, _callee74, this);
9581
10489
  }));
9582
10490
  function setApproval(_x57) {
9583
10491
  return _setApproval.apply(this, arguments);
@@ -9594,12 +10502,12 @@ var PiLicenseTemplateClient = /*#__PURE__*/function (_PiLicenseTemplateRea) {
9594
10502
  }, {
9595
10503
  key: "verifyMintLicenseToken",
9596
10504
  value: (function () {
9597
- var _verifyMintLicenseToken2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee74(request) {
9598
- var _yield$this$rpcClient30, call;
9599
- return _regeneratorRuntime().wrap(function _callee74$(_context74) {
9600
- while (1) switch (_context74.prev = _context74.next) {
10505
+ var _verifyMintLicenseToken2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee75(request) {
10506
+ var _yield$this$rpcClient31, call;
10507
+ return _regeneratorRuntime().wrap(function _callee75$(_context75) {
10508
+ while (1) switch (_context75.prev = _context75.next) {
9601
10509
  case 0:
9602
- _context74.next = 2;
10510
+ _context75.next = 2;
9603
10511
  return this.rpcClient.simulateContract({
9604
10512
  abi: piLicenseTemplateAbi,
9605
10513
  address: this.address,
@@ -9608,17 +10516,17 @@ var PiLicenseTemplateClient = /*#__PURE__*/function (_PiLicenseTemplateRea) {
9608
10516
  args: [request[0], request[1], request[2], request[3]]
9609
10517
  });
9610
10518
  case 2:
9611
- _yield$this$rpcClient30 = _context74.sent;
9612
- call = _yield$this$rpcClient30.request;
9613
- _context74.next = 6;
10519
+ _yield$this$rpcClient31 = _context75.sent;
10520
+ call = _yield$this$rpcClient31.request;
10521
+ _context75.next = 6;
9614
10522
  return this.wallet.writeContract(call);
9615
10523
  case 6:
9616
- return _context74.abrupt("return", _context74.sent);
10524
+ return _context75.abrupt("return", _context75.sent);
9617
10525
  case 7:
9618
10526
  case "end":
9619
- return _context74.stop();
10527
+ return _context75.stop();
9620
10528
  }
9621
- }, _callee74, this);
10529
+ }, _callee75, this);
9622
10530
  }));
9623
10531
  function verifyMintLicenseToken(_x58) {
9624
10532
  return _verifyMintLicenseToken2.apply(this, arguments);
@@ -9635,12 +10543,12 @@ var PiLicenseTemplateClient = /*#__PURE__*/function (_PiLicenseTemplateRea) {
9635
10543
  }, {
9636
10544
  key: "verifyRegisterDerivative",
9637
10545
  value: (function () {
9638
- var _verifyRegisterDerivative = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee75(request) {
9639
- var _yield$this$rpcClient31, call;
9640
- return _regeneratorRuntime().wrap(function _callee75$(_context75) {
9641
- while (1) switch (_context75.prev = _context75.next) {
10546
+ var _verifyRegisterDerivative = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee76(request) {
10547
+ var _yield$this$rpcClient32, call;
10548
+ return _regeneratorRuntime().wrap(function _callee76$(_context76) {
10549
+ while (1) switch (_context76.prev = _context76.next) {
9642
10550
  case 0:
9643
- _context75.next = 2;
10551
+ _context76.next = 2;
9644
10552
  return this.rpcClient.simulateContract({
9645
10553
  abi: piLicenseTemplateAbi,
9646
10554
  address: this.address,
@@ -9649,17 +10557,17 @@ var PiLicenseTemplateClient = /*#__PURE__*/function (_PiLicenseTemplateRea) {
9649
10557
  args: [request.childIpId, request.parentIpId, request.licenseTermsId, request.licensee]
9650
10558
  });
9651
10559
  case 2:
9652
- _yield$this$rpcClient31 = _context75.sent;
9653
- call = _yield$this$rpcClient31.request;
9654
- _context75.next = 6;
10560
+ _yield$this$rpcClient32 = _context76.sent;
10561
+ call = _yield$this$rpcClient32.request;
10562
+ _context76.next = 6;
9655
10563
  return this.wallet.writeContract(call);
9656
10564
  case 6:
9657
- return _context75.abrupt("return", _context75.sent);
10565
+ return _context76.abrupt("return", _context76.sent);
9658
10566
  case 7:
9659
10567
  case "end":
9660
- return _context75.stop();
10568
+ return _context76.stop();
9661
10569
  }
9662
- }, _callee75, this);
10570
+ }, _callee76, this);
9663
10571
  }));
9664
10572
  function verifyRegisterDerivative(_x59) {
9665
10573
  return _verifyRegisterDerivative.apply(this, arguments);
@@ -9676,31 +10584,31 @@ var PiLicenseTemplateClient = /*#__PURE__*/function (_PiLicenseTemplateRea) {
9676
10584
  }, {
9677
10585
  key: "verifyRegisterDerivativeForAllParents",
9678
10586
  value: (function () {
9679
- var _verifyRegisterDerivativeForAllParents = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee76(request) {
9680
- var _yield$this$rpcClient32, call;
9681
- return _regeneratorRuntime().wrap(function _callee76$(_context76) {
9682
- while (1) switch (_context76.prev = _context76.next) {
10587
+ var _verifyRegisterDerivativeForAllParents = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee77(request) {
10588
+ var _yield$this$rpcClient33, call;
10589
+ return _regeneratorRuntime().wrap(function _callee77$(_context77) {
10590
+ while (1) switch (_context77.prev = _context77.next) {
9683
10591
  case 0:
9684
- _context76.next = 2;
10592
+ _context77.next = 2;
9685
10593
  return this.rpcClient.simulateContract({
9686
10594
  abi: piLicenseTemplateAbi,
9687
10595
  address: this.address,
9688
10596
  functionName: "verifyRegisterDerivativeForAllParents",
9689
10597
  account: this.wallet.account,
9690
10598
  args: [request.childIpId, request.parentIpIds, request.licenseTermsIds, request.childIpOwner]
9691
- });
9692
- case 2:
9693
- _yield$this$rpcClient32 = _context76.sent;
9694
- call = _yield$this$rpcClient32.request;
9695
- _context76.next = 6;
10599
+ });
10600
+ case 2:
10601
+ _yield$this$rpcClient33 = _context77.sent;
10602
+ call = _yield$this$rpcClient33.request;
10603
+ _context77.next = 6;
9696
10604
  return this.wallet.writeContract(call);
9697
10605
  case 6:
9698
- return _context76.abrupt("return", _context76.sent);
10606
+ return _context77.abrupt("return", _context77.sent);
9699
10607
  case 7:
9700
10608
  case "end":
9701
- return _context76.stop();
10609
+ return _context77.stop();
9702
10610
  }
9703
- }, _callee76, this);
10611
+ }, _callee77, this);
9704
10612
  }));
9705
10613
  function verifyRegisterDerivativeForAllParents(_x60) {
9706
10614
  return _verifyRegisterDerivativeForAllParents.apply(this, arguments);
@@ -9742,12 +10650,12 @@ var RoyaltyModuleClient = /*#__PURE__*/function () {
9742
10650
  return _createClass(RoyaltyModuleClient, [{
9743
10651
  key: "payRoyaltyOnBehalf",
9744
10652
  value: (function () {
9745
- var _payRoyaltyOnBehalf = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee77(request) {
9746
- var _yield$this$rpcClient33, call;
9747
- return _regeneratorRuntime().wrap(function _callee77$(_context77) {
9748
- while (1) switch (_context77.prev = _context77.next) {
10653
+ var _payRoyaltyOnBehalf = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee78(request) {
10654
+ var _yield$this$rpcClient34, call;
10655
+ return _regeneratorRuntime().wrap(function _callee78$(_context78) {
10656
+ while (1) switch (_context78.prev = _context78.next) {
9749
10657
  case 0:
9750
- _context77.next = 2;
10658
+ _context78.next = 2;
9751
10659
  return this.rpcClient.simulateContract({
9752
10660
  abi: royaltyModuleAbi,
9753
10661
  address: this.address,
@@ -9756,17 +10664,17 @@ var RoyaltyModuleClient = /*#__PURE__*/function () {
9756
10664
  args: [request.receiverIpId, request.payerIpId, request.token, request.amount]
9757
10665
  });
9758
10666
  case 2:
9759
- _yield$this$rpcClient33 = _context77.sent;
9760
- call = _yield$this$rpcClient33.request;
9761
- _context77.next = 6;
10667
+ _yield$this$rpcClient34 = _context78.sent;
10668
+ call = _yield$this$rpcClient34.request;
10669
+ _context78.next = 6;
9762
10670
  return this.wallet.writeContract(call);
9763
10671
  case 6:
9764
- return _context77.abrupt("return", _context77.sent);
10672
+ return _context78.abrupt("return", _context78.sent);
9765
10673
  case 7:
9766
10674
  case "end":
9767
- return _context77.stop();
10675
+ return _context78.stop();
9768
10676
  }
9769
- }, _callee77, this);
10677
+ }, _callee78, this);
9770
10678
  }));
9771
10679
  function payRoyaltyOnBehalf(_x61) {
9772
10680
  return _payRoyaltyOnBehalf.apply(this, arguments);
@@ -9823,11 +10731,11 @@ var RoyaltyPolicyLapReadOnlyClient = /*#__PURE__*/function () {
9823
10731
  return _createClass(RoyaltyPolicyLapReadOnlyClient, [{
9824
10732
  key: "getRoyaltyData",
9825
10733
  value: (function () {
9826
- var _getRoyaltyData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee78(request) {
9827
- return _regeneratorRuntime().wrap(function _callee78$(_context78) {
9828
- while (1) switch (_context78.prev = _context78.next) {
10734
+ var _getRoyaltyData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee79(request) {
10735
+ return _regeneratorRuntime().wrap(function _callee79$(_context79) {
10736
+ while (1) switch (_context79.prev = _context79.next) {
9829
10737
  case 0:
9830
- _context78.next = 2;
10738
+ _context79.next = 2;
9831
10739
  return this.rpcClient.readContract({
9832
10740
  abi: royaltyPolicyLapAbi,
9833
10741
  address: this.address,
@@ -9835,12 +10743,12 @@ var RoyaltyPolicyLapReadOnlyClient = /*#__PURE__*/function () {
9835
10743
  args: [request.ipId]
9836
10744
  });
9837
10745
  case 2:
9838
- return _context78.abrupt("return", _context78.sent);
10746
+ return _context79.abrupt("return", _context79.sent);
9839
10747
  case 3:
9840
10748
  case "end":
9841
- return _context78.stop();
10749
+ return _context79.stop();
9842
10750
  }
9843
- }, _callee78, this);
10751
+ }, _callee79, this);
9844
10752
  }));
9845
10753
  function getRoyaltyData(_x62) {
9846
10754
  return _getRoyaltyData.apply(this, arguments);
@@ -9872,12 +10780,12 @@ var RoyaltyPolicyLapClient = /*#__PURE__*/function (_RoyaltyPolicyLapRead) {
9872
10780
  return _createClass(RoyaltyPolicyLapClient, [{
9873
10781
  key: "onRoyaltyPayment",
9874
10782
  value: (function () {
9875
- var _onRoyaltyPayment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee79(request) {
9876
- var _yield$this$rpcClient34, call;
9877
- return _regeneratorRuntime().wrap(function _callee79$(_context79) {
9878
- while (1) switch (_context79.prev = _context79.next) {
10783
+ var _onRoyaltyPayment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee80(request) {
10784
+ var _yield$this$rpcClient35, call;
10785
+ return _regeneratorRuntime().wrap(function _callee80$(_context80) {
10786
+ while (1) switch (_context80.prev = _context80.next) {
9879
10787
  case 0:
9880
- _context79.next = 2;
10788
+ _context80.next = 2;
9881
10789
  return this.rpcClient.simulateContract({
9882
10790
  abi: royaltyPolicyLapAbi,
9883
10791
  address: this.address,
@@ -9886,17 +10794,17 @@ var RoyaltyPolicyLapClient = /*#__PURE__*/function (_RoyaltyPolicyLapRead) {
9886
10794
  args: [request.caller, request.ipId, request.token, request.amount]
9887
10795
  });
9888
10796
  case 2:
9889
- _yield$this$rpcClient34 = _context79.sent;
9890
- call = _yield$this$rpcClient34.request;
9891
- _context79.next = 6;
10797
+ _yield$this$rpcClient35 = _context80.sent;
10798
+ call = _yield$this$rpcClient35.request;
10799
+ _context80.next = 6;
9892
10800
  return this.wallet.writeContract(call);
9893
10801
  case 6:
9894
- return _context79.abrupt("return", _context79.sent);
10802
+ return _context80.abrupt("return", _context80.sent);
9895
10803
  case 7:
9896
10804
  case "end":
9897
- return _context79.stop();
10805
+ return _context80.stop();
9898
10806
  }
9899
- }, _callee79, this);
10807
+ }, _callee80, this);
9900
10808
  }));
9901
10809
  function onRoyaltyPayment(_x63) {
9902
10810
  return _onRoyaltyPayment.apply(this, arguments);
@@ -9914,6 +10822,7 @@ var IPAssetClient = /*#__PURE__*/function () {
9914
10822
  this.ipAssetRegistryClient = new IpAssetRegistryClient(rpcClient, wallet);
9915
10823
  this.licensingModuleClient = new LicensingModuleClient(this.rpcClient, wallet);
9916
10824
  this.licenseTemplateClient = new PiLicenseTemplateClient(this.rpcClient, wallet);
10825
+ this.licenseRegistryReadOnlyClient = new LicenseRegistryReadOnlyClient(this.rpcClient);
9917
10826
  }
9918
10827
 
9919
10828
  /**
@@ -9929,12 +10838,12 @@ var IPAssetClient = /*#__PURE__*/function () {
9929
10838
  key: "register",
9930
10839
  value: (function () {
9931
10840
  var _register = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(request) {
9932
- var tokenId, _request$txOptions, ipId, txHash, txReceipt, targetLogs;
10841
+ var _request$txOptions, tokenId, ipId, txHash, txReceipt, targetLogs;
9933
10842
  return _regeneratorRuntime().wrap(function _callee$(_context) {
9934
10843
  while (1) switch (_context.prev = _context.next) {
9935
10844
  case 0:
9936
- tokenId = parseToBigInt(request.tokenId);
9937
- _context.prev = 1;
10845
+ _context.prev = 0;
10846
+ tokenId = BigInt(request.tokenId);
9938
10847
  _context.next = 4;
9939
10848
  return this.isNFTRegistered(request.tokenContract, tokenId);
9940
10849
  case 4:
@@ -9978,13 +10887,13 @@ var IPAssetClient = /*#__PURE__*/function () {
9978
10887
  break;
9979
10888
  case 21:
9980
10889
  _context.prev = 21;
9981
- _context.t0 = _context["catch"](1);
10890
+ _context.t0 = _context["catch"](0);
9982
10891
  handleError(_context.t0, "Failed to register IP");
9983
10892
  case 24:
9984
10893
  case "end":
9985
10894
  return _context.stop();
9986
10895
  }
9987
- }, _callee, this, [[1, 21]]);
10896
+ }, _callee, this, [[0, 21]]);
9988
10897
  }));
9989
10898
  function register(_x) {
9990
10899
  return _register.apply(this, arguments);
@@ -10009,12 +10918,83 @@ var IPAssetClient = /*#__PURE__*/function () {
10009
10918
  key: "registerDerivative",
10010
10919
  value: (function () {
10011
10920
  var _registerDerivative = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(request) {
10012
- var _request$txOptions2, txHash;
10921
+ var _request$txOptions2, _iterator, _step, parentId, i, isAttachedLicenseTerms, txHash;
10013
10922
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
10014
10923
  while (1) switch (_context2.prev = _context2.next) {
10015
10924
  case 0:
10016
10925
  _context2.prev = 0;
10017
10926
  _context2.next = 3;
10927
+ return this.isIpIdRegistered(request.childIpId);
10928
+ case 3:
10929
+ if (_context2.sent) {
10930
+ _context2.next = 5;
10931
+ break;
10932
+ }
10933
+ throw new Error("IP asset must be registered before registering derivative");
10934
+ case 5:
10935
+ _iterator = _createForOfIteratorHelper(request.parentIpIds);
10936
+ _context2.prev = 6;
10937
+ _iterator.s();
10938
+ case 8:
10939
+ if ((_step = _iterator.n()).done) {
10940
+ _context2.next = 16;
10941
+ break;
10942
+ }
10943
+ parentId = _step.value;
10944
+ _context2.next = 12;
10945
+ return this.isIpIdRegistered(parentId);
10946
+ case 12:
10947
+ if (_context2.sent) {
10948
+ _context2.next = 14;
10949
+ break;
10950
+ }
10951
+ throw new Error("Parent IP asset must be registered before registering derivative");
10952
+ case 14:
10953
+ _context2.next = 8;
10954
+ break;
10955
+ case 16:
10956
+ _context2.next = 21;
10957
+ break;
10958
+ case 18:
10959
+ _context2.prev = 18;
10960
+ _context2.t0 = _context2["catch"](6);
10961
+ _iterator.e(_context2.t0);
10962
+ case 21:
10963
+ _context2.prev = 21;
10964
+ _iterator.f();
10965
+ return _context2.finish(21);
10966
+ case 24:
10967
+ if (!(request.parentIpIds.length !== request.licenseTermsIds.length)) {
10968
+ _context2.next = 26;
10969
+ break;
10970
+ }
10971
+ throw new Error("Parent IP IDs and License terms IDs must be provided in pairs");
10972
+ case 26:
10973
+ i = 0;
10974
+ case 27:
10975
+ if (!(i < request.parentIpIds.length)) {
10976
+ _context2.next = 36;
10977
+ break;
10978
+ }
10979
+ _context2.next = 30;
10980
+ return this.licenseRegistryReadOnlyClient.hasIpAttachedLicenseTerms({
10981
+ ipId: request.parentIpIds[i],
10982
+ licenseTemplate: request.licenseTemplate || this.licenseTemplateClient.address,
10983
+ licenseTermsId: BigInt(request.licenseTermsIds[i])
10984
+ });
10985
+ case 30:
10986
+ isAttachedLicenseTerms = _context2.sent;
10987
+ if (isAttachedLicenseTerms) {
10988
+ _context2.next = 33;
10989
+ break;
10990
+ }
10991
+ throw new Error("License terms must be attached to the parent ipId before registering derivative");
10992
+ case 33:
10993
+ i++;
10994
+ _context2.next = 27;
10995
+ break;
10996
+ case 36:
10997
+ _context2.next = 38;
10018
10998
  return this.licensingModuleClient.registerDerivative({
10019
10999
  childIpId: request.childIpId,
10020
11000
  parentIpIds: request.parentIpIds,
@@ -10024,36 +11004,36 @@ var IPAssetClient = /*#__PURE__*/function () {
10024
11004
  licenseTemplate: request.licenseTemplate || this.licenseTemplateClient.address,
10025
11005
  royaltyContext: viem.zeroAddress
10026
11006
  });
10027
- case 3:
11007
+ case 38:
10028
11008
  txHash = _context2.sent;
10029
11009
  if (!((_request$txOptions2 = request.txOptions) !== null && _request$txOptions2 !== void 0 && _request$txOptions2.waitForTransaction)) {
10030
- _context2.next = 10;
11010
+ _context2.next = 45;
10031
11011
  break;
10032
11012
  }
10033
- _context2.next = 7;
11013
+ _context2.next = 42;
10034
11014
  return this.rpcClient.waitForTransactionReceipt({
10035
11015
  hash: txHash
10036
11016
  });
10037
- case 7:
11017
+ case 42:
10038
11018
  return _context2.abrupt("return", {
10039
11019
  txHash: txHash
10040
11020
  });
10041
- case 10:
11021
+ case 45:
10042
11022
  return _context2.abrupt("return", {
10043
11023
  txHash: txHash
10044
11024
  });
10045
- case 11:
10046
- _context2.next = 16;
11025
+ case 46:
11026
+ _context2.next = 51;
10047
11027
  break;
10048
- case 13:
10049
- _context2.prev = 13;
10050
- _context2.t0 = _context2["catch"](0);
10051
- handleError(_context2.t0, "Failed to register derivative");
10052
- case 16:
11028
+ case 48:
11029
+ _context2.prev = 48;
11030
+ _context2.t1 = _context2["catch"](0);
11031
+ handleError(_context2.t1, "Failed to register derivative");
11032
+ case 51:
10053
11033
  case "end":
10054
11034
  return _context2.stop();
10055
11035
  }
10056
- }, _callee2, this, [[0, 13]]);
11036
+ }, _callee2, this, [[0, 48], [6, 18, 21, 24]]);
10057
11037
  }));
10058
11038
  function registerDerivative(_x2) {
10059
11039
  return _registerDerivative.apply(this, arguments);
@@ -10082,6 +11062,15 @@ var IPAssetClient = /*#__PURE__*/function () {
10082
11062
  case 0:
10083
11063
  _context3.prev = 0;
10084
11064
  _context3.next = 3;
11065
+ return this.isIpIdRegistered(request.childIpId);
11066
+ case 3:
11067
+ if (_context3.sent) {
11068
+ _context3.next = 5;
11069
+ break;
11070
+ }
11071
+ throw new Error("IP asset must be registered before registering derivative with license tokens");
11072
+ case 5:
11073
+ _context3.next = 7;
10085
11074
  return this.licensingModuleClient.registerDerivativeWithLicenseTokens({
10086
11075
  childIpId: request.childIpId,
10087
11076
  licenseTokenIds: request.licenseTokenIds.map(function (id) {
@@ -10089,36 +11078,36 @@ var IPAssetClient = /*#__PURE__*/function () {
10089
11078
  }),
10090
11079
  royaltyContext: viem.zeroAddress
10091
11080
  });
10092
- case 3:
11081
+ case 7:
10093
11082
  txHash = _context3.sent;
10094
11083
  if (!((_request$txOptions3 = request.txOptions) !== null && _request$txOptions3 !== void 0 && _request$txOptions3.waitForTransaction)) {
10095
- _context3.next = 10;
11084
+ _context3.next = 14;
10096
11085
  break;
10097
11086
  }
10098
- _context3.next = 7;
11087
+ _context3.next = 11;
10099
11088
  return this.rpcClient.waitForTransactionReceipt({
10100
11089
  hash: txHash
10101
11090
  });
10102
- case 7:
11091
+ case 11:
10103
11092
  return _context3.abrupt("return", {
10104
11093
  txHash: txHash
10105
11094
  });
10106
- case 10:
11095
+ case 14:
10107
11096
  return _context3.abrupt("return", {
10108
11097
  txHash: txHash
10109
11098
  });
10110
- case 11:
10111
- _context3.next = 16;
11099
+ case 15:
11100
+ _context3.next = 20;
10112
11101
  break;
10113
- case 13:
10114
- _context3.prev = 13;
11102
+ case 17:
11103
+ _context3.prev = 17;
10115
11104
  _context3.t0 = _context3["catch"](0);
10116
11105
  handleError(_context3.t0, "Failed to register derivative with license tokens");
10117
- case 16:
11106
+ case 20:
10118
11107
  case "end":
10119
11108
  return _context3.stop();
10120
11109
  }
10121
- }, _callee3, this, [[0, 13]]);
11110
+ }, _callee3, this, [[0, 17]]);
10122
11111
  }));
10123
11112
  function registerDerivativeWithLicenseTokens(_x3) {
10124
11113
  return _registerDerivativeWithLicenseTokens.apply(this, arguments);
@@ -10135,7 +11124,7 @@ var IPAssetClient = /*#__PURE__*/function () {
10135
11124
  case 0:
10136
11125
  _context4.next = 2;
10137
11126
  return this.ipAssetRegistryClient.ipId({
10138
- chainId: parseToBigInt(chain[this.chainId]),
11127
+ chainId: BigInt(chain[this.chainId]),
10139
11128
  tokenContract: tokenAddress,
10140
11129
  tokenId: tokenId
10141
11130
  });
@@ -10159,6 +11148,30 @@ var IPAssetClient = /*#__PURE__*/function () {
10159
11148
  }
10160
11149
  return isNFTRegistered;
10161
11150
  }()
11151
+ }, {
11152
+ key: "isIpIdRegistered",
11153
+ value: function () {
11154
+ var _isIpIdRegistered = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(ipId) {
11155
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
11156
+ while (1) switch (_context5.prev = _context5.next) {
11157
+ case 0:
11158
+ _context5.next = 2;
11159
+ return this.ipAssetRegistryClient.isRegistered({
11160
+ id: ipId
11161
+ });
11162
+ case 2:
11163
+ return _context5.abrupt("return", _context5.sent);
11164
+ case 3:
11165
+ case "end":
11166
+ return _context5.stop();
11167
+ }
11168
+ }, _callee5, this);
11169
+ }));
11170
+ function isIpIdRegistered(_x6) {
11171
+ return _isIpIdRegistered.apply(this, arguments);
11172
+ }
11173
+ return isIpIdRegistered;
11174
+ }()
10162
11175
  }]);
10163
11176
  }();
10164
11177
 
@@ -10268,49 +11281,25 @@ var LicenseClient = /*#__PURE__*/function () {
10268
11281
  this.licenseTemplateClient = new PiLicenseTemplateClient(this.rpcClient, this.wallet);
10269
11282
  this.licensingModuleClient = new LicensingModuleClient(this.rpcClient, this.wallet);
10270
11283
  this.royaltyPolicyLAPClient = new RoyaltyPolicyLapClient(this.rpcClient, this.wallet);
11284
+ this.licenseRegistryReadOnlyClient = new LicenseRegistryReadOnlyClient(this.rpcClient);
11285
+ this.ipAssetRegistryClient = new IpAssetRegistryClient(rpcClient, wallet);
10271
11286
  }
11287
+ /**
11288
+ * Convenient function to register a PIL non commercial social remix license to the registry
11289
+ * @param request The request object that contains all data needed to register a PIL non commercial social remix license.
11290
+ * @param request.txOptions [Optional] The transaction options.
11291
+ * @returns A Promise that resolves to an object containing the optional transaction hash and optional license terms Id.
11292
+ * @emits LicenseTermsRegistered (licenseTermsId, licenseTemplate, licenseTerms);
11293
+ */
10272
11294
  return _createClass(LicenseClient, [{
10273
- key: "getLicenseTermsId",
10274
- value: function () {
10275
- var _getLicenseTermsId = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(request) {
10276
- var licenseRes;
10277
- return _regeneratorRuntime().wrap(function _callee$(_context) {
10278
- while (1) switch (_context.prev = _context.next) {
10279
- case 0:
10280
- _context.next = 2;
10281
- return this.licenseTemplateClient.getLicenseTermsId({
10282
- terms: request
10283
- });
10284
- case 2:
10285
- licenseRes = _context.sent;
10286
- return _context.abrupt("return", Number(licenseRes.selectedLicenseTermsId));
10287
- case 4:
10288
- case "end":
10289
- return _context.stop();
10290
- }
10291
- }, _callee, this);
10292
- }));
10293
- function getLicenseTermsId(_x) {
10294
- return _getLicenseTermsId.apply(this, arguments);
10295
- }
10296
- return getLicenseTermsId;
10297
- }()
10298
- /**
10299
- * Convenient function to register a PIL non commercial social remix license to the registry
10300
- * @param request The request object that contains all data needed to register a PIL non commercial social remix license.
10301
- * @param request.txOptions [Optional] The transaction options.
10302
- * @returns A Promise that resolves to an object containing the optional transaction hash and optional license ID.
10303
- * @emits LicenseTermsRegistered (licenseTermsId, licenseTemplate, licenseTerms);
10304
- */
10305
- }, {
10306
11295
  key: "registerNonComSocialRemixingPIL",
10307
11296
  value: (function () {
10308
- var _registerNonComSocialRemixingPIL = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(request) {
11297
+ var _registerNonComSocialRemixingPIL = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(request) {
10309
11298
  var _request$txOptions, licenseTerms, licenseTermsId, txHash, txReceipt, targetLogs;
10310
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
10311
- while (1) switch (_context2.prev = _context2.next) {
11299
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
11300
+ while (1) switch (_context.prev = _context.next) {
10312
11301
  case 0:
10313
- _context2.prev = 0;
11302
+ _context.prev = 0;
10314
11303
  licenseTerms = {
10315
11304
  transferable: true,
10316
11305
  royaltyPolicy: viem.zeroAddress,
@@ -10329,57 +11318,57 @@ var LicenseClient = /*#__PURE__*/function () {
10329
11318
  derivativeRevCelling: BigInt(0),
10330
11319
  currency: viem.zeroAddress
10331
11320
  };
10332
- _context2.next = 4;
11321
+ _context.next = 4;
10333
11322
  return this.getLicenseTermsId(licenseTerms);
10334
11323
  case 4:
10335
- licenseTermsId = _context2.sent;
11324
+ licenseTermsId = _context.sent;
10336
11325
  if (!(licenseTermsId !== 0)) {
10337
- _context2.next = 7;
11326
+ _context.next = 7;
10338
11327
  break;
10339
11328
  }
10340
- return _context2.abrupt("return", {
11329
+ return _context.abrupt("return", {
10341
11330
  licenseTermsId: licenseTermsId.toString()
10342
11331
  });
10343
11332
  case 7:
10344
- _context2.next = 9;
11333
+ _context.next = 9;
10345
11334
  return this.licenseTemplateClient.registerLicenseTerms({
10346
11335
  terms: licenseTerms
10347
11336
  });
10348
11337
  case 9:
10349
- txHash = _context2.sent;
11338
+ txHash = _context.sent;
10350
11339
  if (!((_request$txOptions = request.txOptions) !== null && _request$txOptions !== void 0 && _request$txOptions.waitForTransaction)) {
10351
- _context2.next = 18;
11340
+ _context.next = 18;
10352
11341
  break;
10353
11342
  }
10354
- _context2.next = 13;
11343
+ _context.next = 13;
10355
11344
  return this.rpcClient.waitForTransactionReceipt({
10356
11345
  hash: txHash
10357
11346
  });
10358
11347
  case 13:
10359
- txReceipt = _context2.sent;
11348
+ txReceipt = _context.sent;
10360
11349
  targetLogs = this.licenseTemplateClient.parseTxLicenseTermsRegisteredEvent(txReceipt);
10361
- return _context2.abrupt("return", {
11350
+ return _context.abrupt("return", {
10362
11351
  txHash: txHash,
10363
11352
  licenseTermsId: targetLogs[0].licenseTermsId.toString()
10364
11353
  });
10365
11354
  case 18:
10366
- return _context2.abrupt("return", {
11355
+ return _context.abrupt("return", {
10367
11356
  txHash: txHash
10368
11357
  });
10369
11358
  case 19:
10370
- _context2.next = 24;
11359
+ _context.next = 24;
10371
11360
  break;
10372
11361
  case 21:
10373
- _context2.prev = 21;
10374
- _context2.t0 = _context2["catch"](0);
10375
- handleError(_context2.t0, "Failed to register non commercial social remixing PIL");
11362
+ _context.prev = 21;
11363
+ _context.t0 = _context["catch"](0);
11364
+ handleError(_context.t0, "Failed to register non commercial social remixing PIL");
10376
11365
  case 24:
10377
11366
  case "end":
10378
- return _context2.stop();
11367
+ return _context.stop();
10379
11368
  }
10380
- }, _callee2, this, [[0, 21]]);
11369
+ }, _callee, this, [[0, 21]]);
10381
11370
  }));
10382
- function registerNonComSocialRemixingPIL(_x2) {
11371
+ function registerNonComSocialRemixingPIL(_x) {
10383
11372
  return _registerNonComSocialRemixingPIL.apply(this, arguments);
10384
11373
  }
10385
11374
  return registerNonComSocialRemixingPIL;
@@ -10392,19 +11381,19 @@ var LicenseClient = /*#__PURE__*/function () {
10392
11381
  * the token must be registered in story protocol.
10393
11382
  * @param request.royaltyPolicy The address of the royalty policy contract which required to StoryProtocol in advance.
10394
11383
  * @param request.txOptions [Optional] The transaction options.
10395
- * @returns A Promise that resolves to an object containing the optional transaction hash and optional license ID.
11384
+ * @returns A Promise that resolves to an object containing the optional transaction hash and optional license terms Id.
10396
11385
  * @emits LicenseTermsRegistered (licenseTermsId, licenseTemplate, licenseTerms);
10397
11386
  */
10398
11387
  )
10399
11388
  }, {
10400
11389
  key: "registerCommercialUsePIL",
10401
11390
  value: (function () {
10402
- var _registerCommercialUsePIL = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(request) {
11391
+ var _registerCommercialUsePIL = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(request) {
10403
11392
  var _request$txOptions2, licenseTerms, licenseTermsId, txHash, txReceipt, targetLogs;
10404
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
10405
- while (1) switch (_context3.prev = _context3.next) {
11393
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
11394
+ while (1) switch (_context2.prev = _context2.next) {
10406
11395
  case 0:
10407
- _context3.prev = 0;
11396
+ _context2.prev = 0;
10408
11397
  licenseTerms = {
10409
11398
  transferable: true,
10410
11399
  royaltyPolicy: this.royaltyPolicyLAPClient.address,
@@ -10423,57 +11412,57 @@ var LicenseClient = /*#__PURE__*/function () {
10423
11412
  derivativeRevCelling: BigInt(0),
10424
11413
  currency: request.currency
10425
11414
  };
10426
- _context3.next = 4;
11415
+ _context2.next = 4;
10427
11416
  return this.getLicenseTermsId(licenseTerms);
10428
11417
  case 4:
10429
- licenseTermsId = _context3.sent;
11418
+ licenseTermsId = _context2.sent;
10430
11419
  if (!(licenseTermsId !== 0)) {
10431
- _context3.next = 7;
11420
+ _context2.next = 7;
10432
11421
  break;
10433
11422
  }
10434
- return _context3.abrupt("return", {
11423
+ return _context2.abrupt("return", {
10435
11424
  licenseTermsId: licenseTermsId.toString()
10436
11425
  });
10437
11426
  case 7:
10438
- _context3.next = 9;
11427
+ _context2.next = 9;
10439
11428
  return this.licenseTemplateClient.registerLicenseTerms({
10440
11429
  terms: licenseTerms
10441
11430
  });
10442
11431
  case 9:
10443
- txHash = _context3.sent;
11432
+ txHash = _context2.sent;
10444
11433
  if (!((_request$txOptions2 = request.txOptions) !== null && _request$txOptions2 !== void 0 && _request$txOptions2.waitForTransaction)) {
10445
- _context3.next = 18;
11434
+ _context2.next = 18;
10446
11435
  break;
10447
11436
  }
10448
- _context3.next = 13;
11437
+ _context2.next = 13;
10449
11438
  return this.rpcClient.waitForTransactionReceipt({
10450
11439
  hash: txHash
10451
11440
  });
10452
11441
  case 13:
10453
- txReceipt = _context3.sent;
11442
+ txReceipt = _context2.sent;
10454
11443
  targetLogs = this.licenseTemplateClient.parseTxLicenseTermsRegisteredEvent(txReceipt);
10455
- return _context3.abrupt("return", {
11444
+ return _context2.abrupt("return", {
10456
11445
  txHash: txHash,
10457
11446
  licenseTermsId: targetLogs[0].licenseTermsId.toString()
10458
11447
  });
10459
11448
  case 18:
10460
- return _context3.abrupt("return", {
11449
+ return _context2.abrupt("return", {
10461
11450
  txHash: txHash
10462
11451
  });
10463
11452
  case 19:
10464
- _context3.next = 24;
11453
+ _context2.next = 24;
10465
11454
  break;
10466
11455
  case 21:
10467
- _context3.prev = 21;
10468
- _context3.t0 = _context3["catch"](0);
10469
- handleError(_context3.t0, "Failed to register commercial use PIL");
11456
+ _context2.prev = 21;
11457
+ _context2.t0 = _context2["catch"](0);
11458
+ handleError(_context2.t0, "Failed to register commercial use PIL");
10470
11459
  case 24:
10471
11460
  case "end":
10472
- return _context3.stop();
11461
+ return _context2.stop();
10473
11462
  }
10474
- }, _callee3, this, [[0, 21]]);
11463
+ }, _callee2, this, [[0, 21]]);
10475
11464
  }));
10476
- function registerCommercialUsePIL(_x3) {
11465
+ function registerCommercialUsePIL(_x2) {
10477
11466
  return _registerCommercialUsePIL.apply(this, arguments);
10478
11467
  }
10479
11468
  return registerCommercialUsePIL;
@@ -10486,19 +11475,19 @@ var LicenseClient = /*#__PURE__*/function () {
10486
11475
  * @param request.currency The ERC20 token to be used to pay the minting fee. the token must be registered in story protocol.
10487
11476
  * @param request.royaltyPolicy The address of the royalty policy contract which required to StoryProtocol in advance.
10488
11477
  * @param request.txOptions [Optional] The transaction options.
10489
- * @returns A Promise that resolves to an object containing the optional transaction hash and optional license ID.
11478
+ * @returns A Promise that resolves to an object containing the optional transaction hash and optional license terms Id.
10490
11479
  * @emits LicenseTermsRegistered (licenseTermsId, licenseTemplate, licenseTerms);
10491
11480
  */
10492
11481
  )
10493
11482
  }, {
10494
11483
  key: "registerCommercialRemixPIL",
10495
11484
  value: (function () {
10496
- var _registerCommercialRemixPIL = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(request) {
11485
+ var _registerCommercialRemixPIL = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(request) {
10497
11486
  var _request$txOptions3, licenseTerms, licenseTermsId, txHash, txReceipt, targetLogs;
10498
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
10499
- while (1) switch (_context4.prev = _context4.next) {
11487
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
11488
+ while (1) switch (_context3.prev = _context3.next) {
10500
11489
  case 0:
10501
- _context4.prev = 0;
11490
+ _context3.prev = 0;
10502
11491
  licenseTerms = {
10503
11492
  transferable: true,
10504
11493
  royaltyPolicy: this.royaltyPolicyLAPClient.address,
@@ -10517,57 +11506,57 @@ var LicenseClient = /*#__PURE__*/function () {
10517
11506
  derivativeRevCelling: BigInt(0),
10518
11507
  currency: request.currency
10519
11508
  };
10520
- _context4.next = 4;
11509
+ _context3.next = 4;
10521
11510
  return this.getLicenseTermsId(licenseTerms);
10522
11511
  case 4:
10523
- licenseTermsId = _context4.sent;
11512
+ licenseTermsId = _context3.sent;
10524
11513
  if (!(licenseTermsId !== 0)) {
10525
- _context4.next = 7;
11514
+ _context3.next = 7;
10526
11515
  break;
10527
11516
  }
10528
- return _context4.abrupt("return", {
11517
+ return _context3.abrupt("return", {
10529
11518
  licenseTermsId: licenseTermsId.toString()
10530
11519
  });
10531
11520
  case 7:
10532
- _context4.next = 9;
11521
+ _context3.next = 9;
10533
11522
  return this.licenseTemplateClient.registerLicenseTerms({
10534
11523
  terms: licenseTerms
10535
11524
  });
10536
11525
  case 9:
10537
- txHash = _context4.sent;
11526
+ txHash = _context3.sent;
10538
11527
  if (!((_request$txOptions3 = request.txOptions) !== null && _request$txOptions3 !== void 0 && _request$txOptions3.waitForTransaction)) {
10539
- _context4.next = 18;
11528
+ _context3.next = 18;
10540
11529
  break;
10541
11530
  }
10542
- _context4.next = 13;
11531
+ _context3.next = 13;
10543
11532
  return this.rpcClient.waitForTransactionReceipt({
10544
11533
  hash: txHash
10545
11534
  });
10546
11535
  case 13:
10547
- txReceipt = _context4.sent;
11536
+ txReceipt = _context3.sent;
10548
11537
  targetLogs = this.licenseTemplateClient.parseTxLicenseTermsRegisteredEvent(txReceipt);
10549
- return _context4.abrupt("return", {
11538
+ return _context3.abrupt("return", {
10550
11539
  txHash: txHash,
10551
11540
  licenseTermsId: targetLogs[0].licenseTermsId.toString()
10552
11541
  });
10553
11542
  case 18:
10554
- return _context4.abrupt("return", {
11543
+ return _context3.abrupt("return", {
10555
11544
  txHash: txHash
10556
11545
  });
10557
11546
  case 19:
10558
- _context4.next = 24;
11547
+ _context3.next = 24;
10559
11548
  break;
10560
11549
  case 21:
10561
- _context4.prev = 21;
10562
- _context4.t0 = _context4["catch"](0);
10563
- handleError(_context4.t0, "Failed to register commercial remix PIL");
11550
+ _context3.prev = 21;
11551
+ _context3.t0 = _context3["catch"](0);
11552
+ handleError(_context3.t0, "Failed to register commercial remix PIL");
10564
11553
  case 24:
10565
11554
  case "end":
10566
- return _context4.stop();
11555
+ return _context3.stop();
10567
11556
  }
10568
- }, _callee4, this, [[0, 21]]);
11557
+ }, _callee3, this, [[0, 21]]);
10569
11558
  }));
10570
- function registerCommercialRemixPIL(_x4) {
11559
+ function registerCommercialRemixPIL(_x3) {
10571
11560
  return _registerCommercialRemixPIL.apply(this, arguments);
10572
11561
  }
10573
11562
  return registerCommercialRemixPIL;
@@ -10589,43 +11578,69 @@ var LicenseClient = /*#__PURE__*/function () {
10589
11578
  }, {
10590
11579
  key: "attachLicenseTerms",
10591
11580
  value: (function () {
10592
- var _attachLicenseTerms = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(request) {
11581
+ var _attachLicenseTerms = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(request) {
10593
11582
  var _request$txOptions4;
10594
- var txHash;
10595
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
10596
- while (1) switch (_context5.prev = _context5.next) {
11583
+ var isRegistered, isAttachedLicenseTerms, txHash;
11584
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
11585
+ while (1) switch (_context4.prev = _context4.next) {
10597
11586
  case 0:
10598
- _context5.next = 2;
11587
+ _context4.next = 2;
11588
+ return this.ipAssetRegistryClient.isRegistered({
11589
+ id: request.ipId
11590
+ });
11591
+ case 2:
11592
+ isRegistered = _context4.sent;
11593
+ if (isRegistered) {
11594
+ _context4.next = 5;
11595
+ break;
11596
+ }
11597
+ throw new Error("IP asset must be registered before attaching license terms");
11598
+ case 5:
11599
+ _context4.next = 7;
11600
+ return this.licenseRegistryReadOnlyClient.hasIpAttachedLicenseTerms({
11601
+ ipId: request.ipId,
11602
+ licenseTemplate: request.licenseTemplate || this.licenseTemplateClient.address,
11603
+ licenseTermsId: BigInt(request.licenseTermsId)
11604
+ });
11605
+ case 7:
11606
+ isAttachedLicenseTerms = _context4.sent;
11607
+ if (!isAttachedLicenseTerms) {
11608
+ _context4.next = 10;
11609
+ break;
11610
+ }
11611
+ throw new Error("License terms are already attached to the IP");
11612
+ case 10:
11613
+ _context4.next = 12;
10599
11614
  return this.licensingModuleClient.attachLicenseTerms({
10600
11615
  ipId: request.ipId,
10601
11616
  licenseTemplate: request.licenseTemplate || this.licenseTemplateClient.address,
10602
11617
  licenseTermsId: BigInt(request.licenseTermsId)
10603
11618
  });
10604
- case 2:
10605
- txHash = _context5.sent;
11619
+ case 12:
11620
+ txHash = _context4.sent;
10606
11621
  if (!((_request$txOptions4 = request.txOptions) !== null && _request$txOptions4 !== void 0 && _request$txOptions4.waitForTransaction)) {
10607
- _context5.next = 9;
11622
+ _context4.next = 19;
10608
11623
  break;
10609
11624
  }
10610
- _context5.next = 6;
11625
+ _context4.next = 16;
10611
11626
  return this.rpcClient.waitForTransactionReceipt({
10612
11627
  hash: txHash
10613
11628
  });
10614
- case 6:
10615
- return _context5.abrupt("return", {
11629
+ case 16:
11630
+ return _context4.abrupt("return", {
10616
11631
  txHash: txHash
10617
11632
  });
10618
- case 9:
10619
- return _context5.abrupt("return", {
11633
+ case 19:
11634
+ return _context4.abrupt("return", {
10620
11635
  txHash: txHash
10621
11636
  });
10622
- case 10:
11637
+ case 20:
10623
11638
  case "end":
10624
- return _context5.stop();
11639
+ return _context4.stop();
10625
11640
  }
10626
- }, _callee5, this);
11641
+ }, _callee4, this);
10627
11642
  }));
10628
- function attachLicenseTerms(_x5) {
11643
+ function attachLicenseTerms(_x4) {
10629
11644
  return _attachLicenseTerms.apply(this, arguments);
10630
11645
  }
10631
11646
  return attachLicenseTerms;
@@ -10656,13 +11671,27 @@ var LicenseClient = /*#__PURE__*/function () {
10656
11671
  }, {
10657
11672
  key: "mintLicenseTokens",
10658
11673
  value: (function () {
10659
- var _mintLicenseTokens = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(request) {
10660
- var _request$txOptions5, txHash, txReceipt, targetLogs;
10661
- return _regeneratorRuntime().wrap(function _callee6$(_context6) {
10662
- while (1) switch (_context6.prev = _context6.next) {
11674
+ var _mintLicenseTokens = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(request) {
11675
+ var _request$txOptions5, isAttachedLicenseTerms, txHash, txReceipt, targetLogs;
11676
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
11677
+ while (1) switch (_context5.prev = _context5.next) {
10663
11678
  case 0:
10664
- _context6.prev = 0;
10665
- _context6.next = 3;
11679
+ _context5.prev = 0;
11680
+ _context5.next = 3;
11681
+ return this.licenseRegistryReadOnlyClient.hasIpAttachedLicenseTerms({
11682
+ ipId: request.licensorIpId,
11683
+ licenseTemplate: request.licenseTemplate || this.licenseTemplateClient.address,
11684
+ licenseTermsId: BigInt(request.licenseTermsId)
11685
+ });
11686
+ case 3:
11687
+ isAttachedLicenseTerms = _context5.sent;
11688
+ if (isAttachedLicenseTerms) {
11689
+ _context5.next = 6;
11690
+ break;
11691
+ }
11692
+ throw new Error("License terms are not attached to the IP");
11693
+ case 6:
11694
+ _context5.next = 8;
10666
11695
  return this.licensingModuleClient.mintLicenseTokens({
10667
11696
  licensorIpId: request.licensorIpId,
10668
11697
  licenseTemplate: request.licenseTemplate || this.licenseTemplateClient.address,
@@ -10671,45 +11700,71 @@ var LicenseClient = /*#__PURE__*/function () {
10671
11700
  receiver: request.receiver || this.wallet.account.address,
10672
11701
  royaltyContext: viem.zeroAddress
10673
11702
  });
10674
- case 3:
10675
- txHash = _context6.sent;
11703
+ case 8:
11704
+ txHash = _context5.sent;
10676
11705
  if (!((_request$txOptions5 = request.txOptions) !== null && _request$txOptions5 !== void 0 && _request$txOptions5.waitForTransaction)) {
10677
- _context6.next = 12;
11706
+ _context5.next = 17;
10678
11707
  break;
10679
11708
  }
10680
- _context6.next = 7;
11709
+ _context5.next = 12;
10681
11710
  return this.rpcClient.waitForTransactionReceipt({
10682
11711
  hash: txHash
10683
11712
  });
10684
- case 7:
10685
- txReceipt = _context6.sent;
11713
+ case 12:
11714
+ txReceipt = _context5.sent;
10686
11715
  targetLogs = this.licensingModuleClient.parseTxLicenseTokensMintedEvent(txReceipt);
10687
- return _context6.abrupt("return", {
11716
+ return _context5.abrupt("return", {
10688
11717
  txHash: txHash,
10689
11718
  licenseTokenId: targetLogs[0].startLicenseTokenId.toString()
10690
11719
  });
10691
- case 12:
10692
- return _context6.abrupt("return", {
11720
+ case 17:
11721
+ return _context5.abrupt("return", {
10693
11722
  txHash: txHash
10694
11723
  });
10695
- case 13:
10696
- _context6.next = 18;
10697
- break;
10698
- case 15:
10699
- _context6.prev = 15;
10700
- _context6.t0 = _context6["catch"](0);
10701
- handleError(_context6.t0, "Failed to mint license tokens");
10702
11724
  case 18:
11725
+ _context5.next = 23;
11726
+ break;
11727
+ case 20:
11728
+ _context5.prev = 20;
11729
+ _context5.t0 = _context5["catch"](0);
11730
+ handleError(_context5.t0, "Failed to mint license tokens");
11731
+ case 23:
10703
11732
  case "end":
10704
- return _context6.stop();
11733
+ return _context5.stop();
10705
11734
  }
10706
- }, _callee6, this, [[0, 15]]);
11735
+ }, _callee5, this, [[0, 20]]);
10707
11736
  }));
10708
- function mintLicenseTokens(_x6) {
11737
+ function mintLicenseTokens(_x5) {
10709
11738
  return _mintLicenseTokens.apply(this, arguments);
10710
11739
  }
10711
11740
  return mintLicenseTokens;
10712
11741
  }())
11742
+ }, {
11743
+ key: "getLicenseTermsId",
11744
+ value: function () {
11745
+ var _getLicenseTermsId = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(request) {
11746
+ var licenseRes;
11747
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
11748
+ while (1) switch (_context6.prev = _context6.next) {
11749
+ case 0:
11750
+ _context6.next = 2;
11751
+ return this.licenseTemplateClient.getLicenseTermsId({
11752
+ terms: request
11753
+ });
11754
+ case 2:
11755
+ licenseRes = _context6.sent;
11756
+ return _context6.abrupt("return", Number(licenseRes.selectedLicenseTermsId));
11757
+ case 4:
11758
+ case "end":
11759
+ return _context6.stop();
11760
+ }
11761
+ }, _callee6, this);
11762
+ }));
11763
+ function getLicenseTermsId(_x6) {
11764
+ return _getLicenseTermsId.apply(this, arguments);
11765
+ }
11766
+ return getLicenseTermsId;
11767
+ }()
10713
11768
  }]);
10714
11769
  }();
10715
11770
 
@@ -11096,84 +12151,69 @@ var RoyaltyClient = /*#__PURE__*/function () {
11096
12151
 
11097
12152
  /**
11098
12153
  * Allows ancestors to claim the royalty tokens and any accrued revenue tokens
11099
- * @param request - the licensing parameters for the Programmable IP License v1 (PIL) standard.
12154
+ * @param request - The request object that contains all data needed to collect royalty tokens.
11100
12155
  * @param request.ancestorIpId The ip id of the ancestor to whom the royalty tokens belong to.
12156
+ * @param request.royaltyVaultIpId The id of the royalty vault.
11101
12157
  * @param request.txOptions [Optional] The transaction options.
11102
- * @returns Tx hash for the transaction.
11103
- * @emits RoyaltyTokensCollected (ancestorIpId, ancestorsRoyalty)
12158
+ * @returns A Promise that resolves to an object containing the transaction hash and optional the amount of royalty tokens collected if waitForTxn is set to true.
12159
+ * @emits RoyaltyTokensCollected (ancestorIpId, royaltyTokensCollected)
11104
12160
  */
11105
12161
  return _createClass(RoyaltyClient, [{
11106
12162
  key: "collectRoyaltyTokens",
11107
12163
  value: (function () {
11108
12164
  var _collectRoyaltyTokens = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(request) {
11109
- var proxyAddress, txHash;
12165
+ var _request$txOptions, proxyAddress, ipRoyaltyVault, txHash, txReceipt, targetLogs;
11110
12166
  return _regeneratorRuntime().wrap(function _callee$(_context) {
11111
12167
  while (1) switch (_context.prev = _context.next) {
11112
12168
  case 0:
11113
12169
  _context.prev = 0;
11114
12170
  _context.next = 3;
11115
- return this.getProxyAddress(request.derivativeId);
12171
+ return this.getRoyaltyVaultProxyAddress(request.royaltyVaultIpId);
11116
12172
  case 3:
11117
12173
  proxyAddress = _context.sent;
11118
- if (proxyAddress) {
11119
- _context.next = 6;
11120
- break;
11121
- }
11122
- throw new Error("Proxy address not found");
11123
- case 6:
11124
- _context.next = 8;
11125
- return this.royaltyVaultImplClient.collectRoyaltyTokens({
12174
+ ipRoyaltyVault = new IpRoyaltyVaultImplClient(this.rpcClient, this.wallet, proxyAddress);
12175
+ _context.next = 7;
12176
+ return ipRoyaltyVault.collectRoyaltyTokens({
11126
12177
  ancestorIpId: request.ancestorIpId
11127
12178
  });
11128
- case 8:
12179
+ case 7:
11129
12180
  txHash = _context.sent;
12181
+ if (!((_request$txOptions = request.txOptions) !== null && _request$txOptions !== void 0 && _request$txOptions.waitForTransaction)) {
12182
+ _context.next = 16;
12183
+ break;
12184
+ }
12185
+ _context.next = 11;
12186
+ return this.rpcClient.waitForTransactionReceipt({
12187
+ hash: txHash
12188
+ });
12189
+ case 11:
12190
+ txReceipt = _context.sent;
12191
+ targetLogs = ipRoyaltyVault.parseTxRoyaltyTokensCollectedEvent(txReceipt);
12192
+ return _context.abrupt("return", {
12193
+ txHash: txHash,
12194
+ royaltyTokensCollected: targetLogs[0].royaltyTokensCollected.toString()
12195
+ });
12196
+ case 16:
11130
12197
  return _context.abrupt("return", {
11131
12198
  txHash: txHash
11132
12199
  });
11133
- case 12:
11134
- _context.prev = 12;
12200
+ case 17:
12201
+ _context.next = 22;
12202
+ break;
12203
+ case 19:
12204
+ _context.prev = 19;
11135
12205
  _context.t0 = _context["catch"](0);
11136
12206
  handleError(_context.t0, "Failed to collect royalty tokens");
11137
- case 15:
12207
+ case 22:
11138
12208
  case "end":
11139
12209
  return _context.stop();
11140
12210
  }
11141
- }, _callee, this, [[0, 12]]);
12211
+ }, _callee, this, [[0, 19]]);
11142
12212
  }));
11143
12213
  function collectRoyaltyTokens(_x) {
11144
12214
  return _collectRoyaltyTokens.apply(this, arguments);
11145
12215
  }
11146
12216
  return collectRoyaltyTokens;
11147
- }())
11148
- }, {
11149
- key: "getProxyAddress",
11150
- value: function () {
11151
- var _getProxyAddress = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(derivativeID) {
11152
- var data;
11153
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
11154
- while (1) switch (_context2.prev = _context2.next) {
11155
- case 0:
11156
- _context2.next = 2;
11157
- return this.royaltyPolicyLAPClient.getRoyaltyData({
11158
- ipId: derivativeID
11159
- });
11160
- case 2:
11161
- data = _context2.sent;
11162
- if (!(Array.isArray(data) && data[1])) {
11163
- _context2.next = 5;
11164
- break;
11165
- }
11166
- return _context2.abrupt("return", data[1]);
11167
- case 5:
11168
- case "end":
11169
- return _context2.stop();
11170
- }
11171
- }, _callee2, this);
11172
- }));
11173
- function getProxyAddress(_x2) {
11174
- return _getProxyAddress.apply(this, arguments);
11175
- }
11176
- return getProxyAddress;
11177
12217
  }()
11178
12218
  /**
11179
12219
  * Allows the function caller to pay royalties to the receiver IP asset on behalf of the payer IP asset.
@@ -11184,18 +12224,18 @@ var RoyaltyClient = /*#__PURE__*/function () {
11184
12224
  * @param request.amount The amount to pay.
11185
12225
  * @param request.txOptions [Optional] The transaction options.
11186
12226
  * @returns A Promise that resolves to an object containing the transaction hash.
11187
- * @emits RoyaltyPaid (receiverIpId, payerIpId, msg.sender, token, amount)
11188
12227
  */
12228
+ )
11189
12229
  }, {
11190
12230
  key: "payRoyaltyOnBehalf",
11191
12231
  value: (function () {
11192
- var _payRoyaltyOnBehalf = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(request) {
11193
- var _request$txOptions, txHash;
11194
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
11195
- while (1) switch (_context3.prev = _context3.next) {
12232
+ var _payRoyaltyOnBehalf = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(request) {
12233
+ var _request$txOptions2, txHash;
12234
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
12235
+ while (1) switch (_context2.prev = _context2.next) {
11196
12236
  case 0:
11197
- _context3.prev = 0;
11198
- _context3.next = 3;
12237
+ _context2.prev = 0;
12238
+ _context2.next = 3;
11199
12239
  return this.royaltyModuleClient.payRoyaltyOnBehalf({
11200
12240
  receiverIpId: request.receiverIpId,
11201
12241
  payerIpId: request.payerIpId,
@@ -11203,34 +12243,179 @@ var RoyaltyClient = /*#__PURE__*/function () {
11203
12243
  amount: request.amount
11204
12244
  });
11205
12245
  case 3:
11206
- txHash = _context3.sent;
11207
- if (!((_request$txOptions = request.txOptions) !== null && _request$txOptions !== void 0 && _request$txOptions.waitForTransaction)) {
11208
- _context3.next = 7;
12246
+ txHash = _context2.sent;
12247
+ if (!((_request$txOptions2 = request.txOptions) !== null && _request$txOptions2 !== void 0 && _request$txOptions2.waitForTransaction)) {
12248
+ _context2.next = 10;
11209
12249
  break;
11210
12250
  }
11211
- _context3.next = 7;
12251
+ _context2.next = 7;
11212
12252
  return this.rpcClient.waitForTransactionReceipt({
11213
12253
  hash: txHash
11214
12254
  });
11215
12255
  case 7:
11216
- return _context3.abrupt("return", {
12256
+ return _context2.abrupt("return", {
12257
+ txHash: txHash
12258
+ });
12259
+ case 10:
12260
+ return _context2.abrupt("return", {
11217
12261
  txHash: txHash
11218
12262
  });
12263
+ case 11:
12264
+ _context2.next = 16;
12265
+ break;
12266
+ case 13:
12267
+ _context2.prev = 13;
12268
+ _context2.t0 = _context2["catch"](0);
12269
+ handleError(_context2.t0, "Failed to pay royalty on behalf");
12270
+ case 16:
12271
+ case "end":
12272
+ return _context2.stop();
12273
+ }
12274
+ }, _callee2, this, [[0, 13]]);
12275
+ }));
12276
+ function payRoyaltyOnBehalf(_x2) {
12277
+ return _payRoyaltyOnBehalf.apply(this, arguments);
12278
+ }
12279
+ return payRoyaltyOnBehalf;
12280
+ }()
12281
+ /**
12282
+ * Calculates the amount of revenue token claimable by a token holder at certain snapshot.
12283
+ * @param request - The request object that contains all data needed to claim Revenue.
12284
+ * @param request.royaltyVaultIpId The id of the royalty vault.
12285
+ * @param request.account The address of the token holder.
12286
+ * @param request.snapshotId The snapshot id.
12287
+ * @param request.token The revenue token to claim.
12288
+ * @param request.txOptions [Optional] The transaction options.
12289
+ * @returns A Promise that contains the amount of revenue token claimable
12290
+ */
12291
+ )
12292
+ }, {
12293
+ key: "claimableRevenue",
12294
+ value: (function () {
12295
+ var _claimableRevenue = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(request) {
12296
+ var proxyAddress, ipRoyaltyVault;
12297
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
12298
+ while (1) switch (_context3.prev = _context3.next) {
12299
+ case 0:
12300
+ _context3.prev = 0;
12301
+ _context3.next = 3;
12302
+ return this.getRoyaltyVaultProxyAddress(request.royaltyVaultIpId);
12303
+ case 3:
12304
+ proxyAddress = _context3.sent;
12305
+ ipRoyaltyVault = new IpRoyaltyVaultImplClient(this.rpcClient, this.wallet, proxyAddress);
12306
+ _context3.next = 7;
12307
+ return ipRoyaltyVault.claimableRevenue({
12308
+ account: request.account,
12309
+ snapshotId: BigInt(request.snapshotId),
12310
+ token: request.token
12311
+ });
12312
+ case 7:
12313
+ return _context3.abrupt("return", _context3.sent);
11219
12314
  case 10:
11220
12315
  _context3.prev = 10;
11221
12316
  _context3.t0 = _context3["catch"](0);
11222
- handleError(_context3.t0, "Failed to pay royalty on behalf");
12317
+ handleError(_context3.t0, "Failed to calculate claimable revenue");
11223
12318
  case 13:
11224
12319
  case "end":
11225
12320
  return _context3.stop();
11226
12321
  }
11227
12322
  }, _callee3, this, [[0, 10]]);
11228
12323
  }));
11229
- function payRoyaltyOnBehalf(_x3) {
11230
- return _payRoyaltyOnBehalf.apply(this, arguments);
12324
+ function claimableRevenue(_x3) {
12325
+ return _claimableRevenue.apply(this, arguments);
11231
12326
  }
11232
- return payRoyaltyOnBehalf;
12327
+ return claimableRevenue;
12328
+ }()
12329
+ /**
12330
+ * Snapshots the claimable revenue and royalty token amounts.
12331
+ * @param request - The request object that contains all data needed to snapshot.
12332
+ * @param request.royaltyVaultIpId The id of the royalty vault.
12333
+ * @param request.txOptions [Optional] The transaction options.
12334
+ * @returns A Promise that resolves to an object containing the transaction hash and optional snapshotId if waitForTxn is set to true.
12335
+ * @emits SnapshotCompleted (snapshotId, snapshotTimestamp, unclaimedTokens).
12336
+ */
12337
+ )
12338
+ }, {
12339
+ key: "snapshot",
12340
+ value: (function () {
12341
+ var _snapshot = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(request) {
12342
+ var _request$txOptions3, proxyAddress, ipRoyaltyVault, txHash, txReceipt, targetLogs;
12343
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
12344
+ while (1) switch (_context4.prev = _context4.next) {
12345
+ case 0:
12346
+ _context4.prev = 0;
12347
+ _context4.next = 3;
12348
+ return this.getRoyaltyVaultProxyAddress(request.royaltyVaultIpId);
12349
+ case 3:
12350
+ proxyAddress = _context4.sent;
12351
+ ipRoyaltyVault = new IpRoyaltyVaultImplClient(this.rpcClient, this.wallet, proxyAddress);
12352
+ _context4.next = 7;
12353
+ return ipRoyaltyVault.snapshot();
12354
+ case 7:
12355
+ txHash = _context4.sent;
12356
+ if (!((_request$txOptions3 = request.txOptions) !== null && _request$txOptions3 !== void 0 && _request$txOptions3.waitForTransaction)) {
12357
+ _context4.next = 16;
12358
+ break;
12359
+ }
12360
+ _context4.next = 11;
12361
+ return this.rpcClient.waitForTransactionReceipt({
12362
+ hash: txHash
12363
+ });
12364
+ case 11:
12365
+ txReceipt = _context4.sent;
12366
+ targetLogs = ipRoyaltyVault.parseTxSnapshotCompletedEvent(txReceipt);
12367
+ return _context4.abrupt("return", {
12368
+ txHash: txHash,
12369
+ snapshotId: targetLogs[0].snapshotId
12370
+ });
12371
+ case 16:
12372
+ return _context4.abrupt("return", {
12373
+ txHash: txHash
12374
+ });
12375
+ case 17:
12376
+ _context4.next = 22;
12377
+ break;
12378
+ case 19:
12379
+ _context4.prev = 19;
12380
+ _context4.t0 = _context4["catch"](0);
12381
+ handleError(_context4.t0, "Failed to snapshot");
12382
+ case 22:
12383
+ case "end":
12384
+ return _context4.stop();
12385
+ }
12386
+ }, _callee4, this, [[0, 19]]);
12387
+ }));
12388
+ function snapshot(_x4) {
12389
+ return _snapshot.apply(this, arguments);
12390
+ }
12391
+ return snapshot;
11233
12392
  }())
12393
+ }, {
12394
+ key: "getRoyaltyVaultProxyAddress",
12395
+ value: function () {
12396
+ var _getRoyaltyVaultProxyAddress = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(royaltyVaultIpId) {
12397
+ var data;
12398
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
12399
+ while (1) switch (_context5.prev = _context5.next) {
12400
+ case 0:
12401
+ _context5.next = 2;
12402
+ return this.royaltyPolicyLAPClient.getRoyaltyData({
12403
+ ipId: royaltyVaultIpId
12404
+ });
12405
+ case 2:
12406
+ data = _context5.sent;
12407
+ return _context5.abrupt("return", data[1]);
12408
+ case 4:
12409
+ case "end":
12410
+ return _context5.stop();
12411
+ }
12412
+ }, _callee5, this);
12413
+ }));
12414
+ function getRoyaltyVaultProxyAddress(_x5) {
12415
+ return _getRoyaltyVaultProxyAddress.apply(this, arguments);
12416
+ }
12417
+ return getRoyaltyVaultProxyAddress;
12418
+ }()
11234
12419
  }]);
11235
12420
  }();
11236
12421