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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -80,6 +80,73 @@ function _createClass(Constructor, protoProps, staticProps) {
80
80
  return Constructor;
81
81
  }
82
82
 
83
+ function _arrayLikeToArray(arr, len) {
84
+ if (len == null || len > arr.length) len = arr.length;
85
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
86
+ return arr2;
87
+ }
88
+
89
+ function _unsupportedIterableToArray(o, minLen) {
90
+ if (!o) return;
91
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
92
+ var n = Object.prototype.toString.call(o).slice(8, -1);
93
+ if (n === "Object" && o.constructor) n = o.constructor.name;
94
+ if (n === "Map" || n === "Set") return Array.from(o);
95
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
96
+ }
97
+
98
+ function _createForOfIteratorHelper(o, allowArrayLike) {
99
+ var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
100
+ if (!it) {
101
+ if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
102
+ if (it) o = it;
103
+ var i = 0;
104
+ var F = function () {};
105
+ return {
106
+ s: F,
107
+ n: function () {
108
+ if (i >= o.length) return {
109
+ done: true
110
+ };
111
+ return {
112
+ done: false,
113
+ value: o[i++]
114
+ };
115
+ },
116
+ e: function (e) {
117
+ throw e;
118
+ },
119
+ f: F
120
+ };
121
+ }
122
+ throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
123
+ }
124
+ var normalCompletion = true,
125
+ didErr = false,
126
+ err;
127
+ return {
128
+ s: function () {
129
+ it = it.call(o);
130
+ },
131
+ n: function () {
132
+ var step = it.next();
133
+ normalCompletion = step.done;
134
+ return step;
135
+ },
136
+ e: function (e) {
137
+ didErr = true;
138
+ err = e;
139
+ },
140
+ f: function () {
141
+ try {
142
+ if (!normalCompletion && it.return != null) it.return();
143
+ } finally {
144
+ if (didErr) throw err;
145
+ }
146
+ }
147
+ };
148
+ }
149
+
83
150
  function _regeneratorRuntime() {
84
151
  _regeneratorRuntime = function () {
85
152
  return e;
@@ -413,73 +480,6 @@ function _asyncToGenerator(fn) {
413
480
  };
414
481
  }
415
482
 
416
- function _arrayLikeToArray(arr, len) {
417
- if (len == null || len > arr.length) len = arr.length;
418
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
419
- return arr2;
420
- }
421
-
422
- function _unsupportedIterableToArray(o, minLen) {
423
- if (!o) return;
424
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
425
- var n = Object.prototype.toString.call(o).slice(8, -1);
426
- if (n === "Object" && o.constructor) n = o.constructor.name;
427
- if (n === "Map" || n === "Set") return Array.from(o);
428
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
429
- }
430
-
431
- function _createForOfIteratorHelper(o, allowArrayLike) {
432
- var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
433
- if (!it) {
434
- if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
435
- if (it) o = it;
436
- var i = 0;
437
- var F = function () {};
438
- return {
439
- s: F,
440
- n: function () {
441
- if (i >= o.length) return {
442
- done: true
443
- };
444
- return {
445
- done: false,
446
- value: o[i++]
447
- };
448
- },
449
- e: function (e) {
450
- throw e;
451
- },
452
- f: F
453
- };
454
- }
455
- throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
456
- }
457
- var normalCompletion = true,
458
- didErr = false,
459
- err;
460
- return {
461
- s: function () {
462
- it = it.call(o);
463
- },
464
- n: function () {
465
- var step = it.next();
466
- normalCompletion = step.done;
467
- return step;
468
- },
469
- e: function (e) {
470
- didErr = true;
471
- err = e;
472
- },
473
- f: function () {
474
- try {
475
- if (!normalCompletion && it.return != null) it.return();
476
- } finally {
477
- if (didErr) throw err;
478
- }
479
- }
480
- };
481
- }
482
-
483
483
  function parseToBigInt(num) {
484
484
  return BigInt(num);
485
485
  }
@@ -7304,6 +7304,21 @@ var IpAssetRegistryClient = /*#__PURE__*/function (_IpAssetRegistryReadO) {
7304
7304
 
7305
7305
  // Contract IpRoyaltyVaultImpl =============================================================
7306
7306
 
7307
+ /**
7308
+ * IpRoyaltyVaultImplRoyaltyTokensCollectedEvent
7309
+ *
7310
+ * @param ancestorIpId address
7311
+ * @param royaltyTokensCollected uint256
7312
+ */
7313
+
7314
+ /**
7315
+ * IpRoyaltyVaultImplSnapshotCompletedEvent
7316
+ *
7317
+ * @param snapshotId uint256
7318
+ * @param snapshotTimestamp uint256
7319
+ * @param unclaimedTokens uint32
7320
+ */
7321
+
7307
7322
  /**
7308
7323
  * IpRoyaltyVaultImplClaimableRevenueRequest
7309
7324
  *
@@ -7333,22 +7348,138 @@ var IpAssetRegistryClient = /*#__PURE__*/function (_IpAssetRegistryReadO) {
7333
7348
  */
7334
7349
 
7335
7350
  /**
7336
- * contract IpRoyaltyVaultImpl readonly method
7351
+ * contract IpRoyaltyVaultImpl event
7337
7352
  */
7338
- var IpRoyaltyVaultImplReadOnlyClient = /*#__PURE__*/function () {
7339
- function IpRoyaltyVaultImplReadOnlyClient(rpcClient, address) {
7353
+ var IpRoyaltyVaultImplEventClient = /*#__PURE__*/function () {
7354
+ function IpRoyaltyVaultImplEventClient(rpcClient, address) {
7340
7355
  var _rpcClient$chain5;
7341
- _classCallCheck(this, IpRoyaltyVaultImplReadOnlyClient);
7356
+ _classCallCheck(this, IpRoyaltyVaultImplEventClient);
7342
7357
  this.address = address || getAddress(ipRoyaltyVaultImplAddress, (_rpcClient$chain5 = rpcClient.chain) === null || _rpcClient$chain5 === void 0 ? void 0 : _rpcClient$chain5.id);
7343
7358
  this.rpcClient = rpcClient;
7344
7359
  }
7345
7360
 
7361
+ /**
7362
+ * event RoyaltyTokensCollected for contract IpRoyaltyVaultImpl
7363
+ */
7364
+ return _createClass(IpRoyaltyVaultImplEventClient, [{
7365
+ key: "watchRoyaltyTokensCollectedEvent",
7366
+ value: function watchRoyaltyTokensCollectedEvent(_onLogs6) {
7367
+ return this.rpcClient.watchContractEvent({
7368
+ abi: ipRoyaltyVaultImplAbi,
7369
+ address: this.address,
7370
+ eventName: "RoyaltyTokensCollected",
7371
+ onLogs: function onLogs(evs) {
7372
+ evs.forEach(function (it) {
7373
+ return _onLogs6(it.transactionHash, it.args);
7374
+ });
7375
+ }
7376
+ });
7377
+ }
7378
+
7379
+ /**
7380
+ * parse tx receipt event RoyaltyTokensCollected for contract IpRoyaltyVaultImpl
7381
+ */
7382
+ }, {
7383
+ key: "parseTxRoyaltyTokensCollectedEvent",
7384
+ value: function parseTxRoyaltyTokensCollectedEvent(txReceipt) {
7385
+ var targetLogs = [];
7386
+ var _iterator6 = _createForOfIteratorHelper(txReceipt.logs),
7387
+ _step6;
7388
+ try {
7389
+ for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
7390
+ var log = _step6.value;
7391
+ try {
7392
+ var event = decodeEventLog({
7393
+ abi: ipRoyaltyVaultImplAbi,
7394
+ eventName: "RoyaltyTokensCollected",
7395
+ data: log.data,
7396
+ topics: log.topics
7397
+ });
7398
+ if (event.eventName === "RoyaltyTokensCollected") {
7399
+ targetLogs.push(event.args);
7400
+ }
7401
+ } catch (e) {
7402
+ /* empty */
7403
+ }
7404
+ }
7405
+ } catch (err) {
7406
+ _iterator6.e(err);
7407
+ } finally {
7408
+ _iterator6.f();
7409
+ }
7410
+ return targetLogs;
7411
+ }
7412
+
7413
+ /**
7414
+ * event SnapshotCompleted for contract IpRoyaltyVaultImpl
7415
+ */
7416
+ }, {
7417
+ key: "watchSnapshotCompletedEvent",
7418
+ value: function watchSnapshotCompletedEvent(_onLogs7) {
7419
+ return this.rpcClient.watchContractEvent({
7420
+ abi: ipRoyaltyVaultImplAbi,
7421
+ address: this.address,
7422
+ eventName: "SnapshotCompleted",
7423
+ onLogs: function onLogs(evs) {
7424
+ evs.forEach(function (it) {
7425
+ return _onLogs7(it.transactionHash, it.args);
7426
+ });
7427
+ }
7428
+ });
7429
+ }
7430
+
7431
+ /**
7432
+ * parse tx receipt event SnapshotCompleted for contract IpRoyaltyVaultImpl
7433
+ */
7434
+ }, {
7435
+ key: "parseTxSnapshotCompletedEvent",
7436
+ value: function parseTxSnapshotCompletedEvent(txReceipt) {
7437
+ var targetLogs = [];
7438
+ var _iterator7 = _createForOfIteratorHelper(txReceipt.logs),
7439
+ _step7;
7440
+ try {
7441
+ for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
7442
+ var log = _step7.value;
7443
+ try {
7444
+ var event = decodeEventLog({
7445
+ abi: ipRoyaltyVaultImplAbi,
7446
+ eventName: "SnapshotCompleted",
7447
+ data: log.data,
7448
+ topics: log.topics
7449
+ });
7450
+ if (event.eventName === "SnapshotCompleted") {
7451
+ targetLogs.push(event.args);
7452
+ }
7453
+ } catch (e) {
7454
+ /* empty */
7455
+ }
7456
+ }
7457
+ } catch (err) {
7458
+ _iterator7.e(err);
7459
+ } finally {
7460
+ _iterator7.f();
7461
+ }
7462
+ return targetLogs;
7463
+ }
7464
+ }]);
7465
+ }();
7466
+
7467
+ /**
7468
+ * contract IpRoyaltyVaultImpl readonly method
7469
+ */
7470
+ var IpRoyaltyVaultImplReadOnlyClient = /*#__PURE__*/function (_IpRoyaltyVaultImplEv) {
7471
+ function IpRoyaltyVaultImplReadOnlyClient(rpcClient, address) {
7472
+ _classCallCheck(this, IpRoyaltyVaultImplReadOnlyClient);
7473
+ return _callSuper(this, IpRoyaltyVaultImplReadOnlyClient, [rpcClient, address]);
7474
+ }
7475
+
7346
7476
  /**
7347
7477
  * method claimableRevenue for contract IpRoyaltyVaultImpl
7348
7478
  *
7349
7479
  * @param request IpRoyaltyVaultImplClaimableRevenueRequest
7350
7480
  * @return Promise<IpRoyaltyVaultImplClaimableRevenueResponse>
7351
7481
  */
7482
+ _inherits(IpRoyaltyVaultImplReadOnlyClient, _IpRoyaltyVaultImplEv);
7352
7483
  return _createClass(IpRoyaltyVaultImplReadOnlyClient, [{
7353
7484
  key: "claimableRevenue",
7354
7485
  value: (function () {
@@ -7410,7 +7541,7 @@ var IpRoyaltyVaultImplReadOnlyClient = /*#__PURE__*/function () {
7410
7541
  return ipId;
7411
7542
  }())
7412
7543
  }]);
7413
- }();
7544
+ }(IpRoyaltyVaultImplEventClient);
7414
7545
 
7415
7546
  /**
7416
7547
  * contract IpRoyaltyVaultImpl write method
@@ -7546,24 +7677,64 @@ var IpRoyaltyVaultImplClient = /*#__PURE__*/function (_IpRoyaltyVaultImplRe) {
7546
7677
  return _collectRoyaltyTokens.apply(this, arguments);
7547
7678
  }
7548
7679
  return collectRoyaltyTokens;
7549
- }())
7550
- }]);
7551
- }(IpRoyaltyVaultImplReadOnlyClient);
7552
-
7553
- // Contract LicenseRegistry =============================================================
7554
-
7555
- /**
7556
- * LicenseRegistryExpirationTimeSetEvent
7557
- *
7558
- * @param ipId address
7559
- * @param expireTime uint256
7560
- */
7561
-
7562
- /**
7563
- * LicenseRegistryGovernanceUpdatedEvent
7564
- *
7565
- * @param newGovernance address
7566
- */
7680
+ }()
7681
+ /**
7682
+ * method snapshot for contract IpRoyaltyVaultImpl
7683
+ *
7684
+ * @param request IpRoyaltyVaultImplSnapshotRequest
7685
+ * @return Promise<WriteContractReturnType>
7686
+ */
7687
+ )
7688
+ }, {
7689
+ key: "snapshot",
7690
+ value: (function () {
7691
+ var _snapshot = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15() {
7692
+ var _yield$this$rpcClient11, call;
7693
+ return _regeneratorRuntime().wrap(function _callee15$(_context15) {
7694
+ while (1) switch (_context15.prev = _context15.next) {
7695
+ case 0:
7696
+ _context15.next = 2;
7697
+ return this.rpcClient.simulateContract({
7698
+ abi: ipRoyaltyVaultImplAbi,
7699
+ address: this.address,
7700
+ functionName: "snapshot",
7701
+ account: this.wallet.account
7702
+ });
7703
+ case 2:
7704
+ _yield$this$rpcClient11 = _context15.sent;
7705
+ call = _yield$this$rpcClient11.request;
7706
+ _context15.next = 6;
7707
+ return this.wallet.writeContract(call);
7708
+ case 6:
7709
+ return _context15.abrupt("return", _context15.sent);
7710
+ case 7:
7711
+ case "end":
7712
+ return _context15.stop();
7713
+ }
7714
+ }, _callee15, this);
7715
+ }));
7716
+ function snapshot() {
7717
+ return _snapshot.apply(this, arguments);
7718
+ }
7719
+ return snapshot;
7720
+ }())
7721
+ }]);
7722
+ }(IpRoyaltyVaultImplReadOnlyClient);
7723
+
7724
+ // Contract LicenseRegistry =============================================================
7725
+
7726
+ /**
7727
+ * LicenseRegistryExpirationTimeSetEvent
7728
+ *
7729
+ * @param ipId address
7730
+ * @param expireTime uint256
7731
+ */
7732
+
7733
+ /**
7734
+ * LicenseRegistryGovernanceUpdatedEvent
7735
+ *
7736
+ * @param newGovernance address
7737
+ */
7567
7738
 
7568
7739
  /**
7569
7740
  * LicenseRegistryInitializedEvent
@@ -7819,14 +7990,14 @@ var LicenseRegistryEventClient = /*#__PURE__*/function () {
7819
7990
  */
7820
7991
  return _createClass(LicenseRegistryEventClient, [{
7821
7992
  key: "watchExpirationTimeSetEvent",
7822
- value: function watchExpirationTimeSetEvent(_onLogs6) {
7993
+ value: function watchExpirationTimeSetEvent(_onLogs8) {
7823
7994
  return this.rpcClient.watchContractEvent({
7824
7995
  abi: licenseRegistryAbi,
7825
7996
  address: this.address,
7826
7997
  eventName: "ExpirationTimeSet",
7827
7998
  onLogs: function onLogs(evs) {
7828
7999
  evs.forEach(function (it) {
7829
- return _onLogs6(it.transactionHash, it.args);
8000
+ return _onLogs8(it.transactionHash, it.args);
7830
8001
  });
7831
8002
  }
7832
8003
  });
@@ -7839,11 +8010,11 @@ var LicenseRegistryEventClient = /*#__PURE__*/function () {
7839
8010
  key: "parseTxExpirationTimeSetEvent",
7840
8011
  value: function parseTxExpirationTimeSetEvent(txReceipt) {
7841
8012
  var targetLogs = [];
7842
- var _iterator6 = _createForOfIteratorHelper(txReceipt.logs),
7843
- _step6;
8013
+ var _iterator8 = _createForOfIteratorHelper(txReceipt.logs),
8014
+ _step8;
7844
8015
  try {
7845
- for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
7846
- var log = _step6.value;
8016
+ for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
8017
+ var log = _step8.value;
7847
8018
  try {
7848
8019
  var event = decodeEventLog({
7849
8020
  abi: licenseRegistryAbi,
@@ -7859,9 +8030,9 @@ var LicenseRegistryEventClient = /*#__PURE__*/function () {
7859
8030
  }
7860
8031
  }
7861
8032
  } catch (err) {
7862
- _iterator6.e(err);
8033
+ _iterator8.e(err);
7863
8034
  } finally {
7864
- _iterator6.f();
8035
+ _iterator8.f();
7865
8036
  }
7866
8037
  return targetLogs;
7867
8038
  }
@@ -7871,14 +8042,14 @@ var LicenseRegistryEventClient = /*#__PURE__*/function () {
7871
8042
  */
7872
8043
  }, {
7873
8044
  key: "watchGovernanceUpdatedEvent",
7874
- value: function watchGovernanceUpdatedEvent(_onLogs7) {
8045
+ value: function watchGovernanceUpdatedEvent(_onLogs9) {
7875
8046
  return this.rpcClient.watchContractEvent({
7876
8047
  abi: licenseRegistryAbi,
7877
8048
  address: this.address,
7878
8049
  eventName: "GovernanceUpdated",
7879
8050
  onLogs: function onLogs(evs) {
7880
8051
  evs.forEach(function (it) {
7881
- return _onLogs7(it.transactionHash, it.args);
8052
+ return _onLogs9(it.transactionHash, it.args);
7882
8053
  });
7883
8054
  }
7884
8055
  });
@@ -7891,11 +8062,11 @@ var LicenseRegistryEventClient = /*#__PURE__*/function () {
7891
8062
  key: "parseTxGovernanceUpdatedEvent",
7892
8063
  value: function parseTxGovernanceUpdatedEvent(txReceipt) {
7893
8064
  var targetLogs = [];
7894
- var _iterator7 = _createForOfIteratorHelper(txReceipt.logs),
7895
- _step7;
8065
+ var _iterator9 = _createForOfIteratorHelper(txReceipt.logs),
8066
+ _step9;
7896
8067
  try {
7897
- for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
7898
- var log = _step7.value;
8068
+ for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
8069
+ var log = _step9.value;
7899
8070
  try {
7900
8071
  var event = decodeEventLog({
7901
8072
  abi: licenseRegistryAbi,
@@ -7911,9 +8082,9 @@ var LicenseRegistryEventClient = /*#__PURE__*/function () {
7911
8082
  }
7912
8083
  }
7913
8084
  } catch (err) {
7914
- _iterator7.e(err);
8085
+ _iterator9.e(err);
7915
8086
  } finally {
7916
- _iterator7.f();
8087
+ _iterator9.f();
7917
8088
  }
7918
8089
  return targetLogs;
7919
8090
  }
@@ -7923,14 +8094,14 @@ var LicenseRegistryEventClient = /*#__PURE__*/function () {
7923
8094
  */
7924
8095
  }, {
7925
8096
  key: "watchInitializedEvent",
7926
- value: function watchInitializedEvent(_onLogs8) {
8097
+ value: function watchInitializedEvent(_onLogs10) {
7927
8098
  return this.rpcClient.watchContractEvent({
7928
8099
  abi: licenseRegistryAbi,
7929
8100
  address: this.address,
7930
8101
  eventName: "Initialized",
7931
8102
  onLogs: function onLogs(evs) {
7932
8103
  evs.forEach(function (it) {
7933
- return _onLogs8(it.transactionHash, it.args);
8104
+ return _onLogs10(it.transactionHash, it.args);
7934
8105
  });
7935
8106
  }
7936
8107
  });
@@ -7943,11 +8114,11 @@ var LicenseRegistryEventClient = /*#__PURE__*/function () {
7943
8114
  key: "parseTxInitializedEvent",
7944
8115
  value: function parseTxInitializedEvent(txReceipt) {
7945
8116
  var targetLogs = [];
7946
- var _iterator8 = _createForOfIteratorHelper(txReceipt.logs),
7947
- _step8;
8117
+ var _iterator10 = _createForOfIteratorHelper(txReceipt.logs),
8118
+ _step10;
7948
8119
  try {
7949
- for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
7950
- var log = _step8.value;
8120
+ for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
8121
+ var log = _step10.value;
7951
8122
  try {
7952
8123
  var event = decodeEventLog({
7953
8124
  abi: licenseRegistryAbi,
@@ -7963,9 +8134,9 @@ var LicenseRegistryEventClient = /*#__PURE__*/function () {
7963
8134
  }
7964
8135
  }
7965
8136
  } catch (err) {
7966
- _iterator8.e(err);
8137
+ _iterator10.e(err);
7967
8138
  } finally {
7968
- _iterator8.f();
8139
+ _iterator10.f();
7969
8140
  }
7970
8141
  return targetLogs;
7971
8142
  }
@@ -7975,14 +8146,14 @@ var LicenseRegistryEventClient = /*#__PURE__*/function () {
7975
8146
  */
7976
8147
  }, {
7977
8148
  key: "watchLicenseTemplateRegisteredEvent",
7978
- value: function watchLicenseTemplateRegisteredEvent(_onLogs9) {
8149
+ value: function watchLicenseTemplateRegisteredEvent(_onLogs11) {
7979
8150
  return this.rpcClient.watchContractEvent({
7980
8151
  abi: licenseRegistryAbi,
7981
8152
  address: this.address,
7982
8153
  eventName: "LicenseTemplateRegistered",
7983
8154
  onLogs: function onLogs(evs) {
7984
8155
  evs.forEach(function (it) {
7985
- return _onLogs9(it.transactionHash, it.args);
8156
+ return _onLogs11(it.transactionHash, it.args);
7986
8157
  });
7987
8158
  }
7988
8159
  });
@@ -7995,11 +8166,11 @@ var LicenseRegistryEventClient = /*#__PURE__*/function () {
7995
8166
  key: "parseTxLicenseTemplateRegisteredEvent",
7996
8167
  value: function parseTxLicenseTemplateRegisteredEvent(txReceipt) {
7997
8168
  var targetLogs = [];
7998
- var _iterator9 = _createForOfIteratorHelper(txReceipt.logs),
7999
- _step9;
8169
+ var _iterator11 = _createForOfIteratorHelper(txReceipt.logs),
8170
+ _step11;
8000
8171
  try {
8001
- for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
8002
- var log = _step9.value;
8172
+ for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
8173
+ var log = _step11.value;
8003
8174
  try {
8004
8175
  var event = decodeEventLog({
8005
8176
  abi: licenseRegistryAbi,
@@ -8015,9 +8186,9 @@ var LicenseRegistryEventClient = /*#__PURE__*/function () {
8015
8186
  }
8016
8187
  }
8017
8188
  } catch (err) {
8018
- _iterator9.e(err);
8189
+ _iterator11.e(err);
8019
8190
  } finally {
8020
- _iterator9.f();
8191
+ _iterator11.f();
8021
8192
  }
8022
8193
  return targetLogs;
8023
8194
  }
@@ -8027,14 +8198,14 @@ var LicenseRegistryEventClient = /*#__PURE__*/function () {
8027
8198
  */
8028
8199
  }, {
8029
8200
  key: "watchMintingLicenseConfigSetForIpEvent",
8030
- value: function watchMintingLicenseConfigSetForIpEvent(_onLogs10) {
8201
+ value: function watchMintingLicenseConfigSetForIpEvent(_onLogs12) {
8031
8202
  return this.rpcClient.watchContractEvent({
8032
8203
  abi: licenseRegistryAbi,
8033
8204
  address: this.address,
8034
8205
  eventName: "MintingLicenseConfigSetForIP",
8035
8206
  onLogs: function onLogs(evs) {
8036
8207
  evs.forEach(function (it) {
8037
- return _onLogs10(it.transactionHash, it.args);
8208
+ return _onLogs12(it.transactionHash, it.args);
8038
8209
  });
8039
8210
  }
8040
8211
  });
@@ -8047,11 +8218,11 @@ var LicenseRegistryEventClient = /*#__PURE__*/function () {
8047
8218
  key: "parseTxMintingLicenseConfigSetForIpEvent",
8048
8219
  value: function parseTxMintingLicenseConfigSetForIpEvent(txReceipt) {
8049
8220
  var targetLogs = [];
8050
- var _iterator10 = _createForOfIteratorHelper(txReceipt.logs),
8051
- _step10;
8221
+ var _iterator12 = _createForOfIteratorHelper(txReceipt.logs),
8222
+ _step12;
8052
8223
  try {
8053
- for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
8054
- var log = _step10.value;
8224
+ for (_iterator12.s(); !(_step12 = _iterator12.n()).done;) {
8225
+ var log = _step12.value;
8055
8226
  try {
8056
8227
  var event = decodeEventLog({
8057
8228
  abi: licenseRegistryAbi,
@@ -8067,9 +8238,9 @@ var LicenseRegistryEventClient = /*#__PURE__*/function () {
8067
8238
  }
8068
8239
  }
8069
8240
  } catch (err) {
8070
- _iterator10.e(err);
8241
+ _iterator12.e(err);
8071
8242
  } finally {
8072
- _iterator10.f();
8243
+ _iterator12.f();
8073
8244
  }
8074
8245
  return targetLogs;
8075
8246
  }
@@ -8079,14 +8250,14 @@ var LicenseRegistryEventClient = /*#__PURE__*/function () {
8079
8250
  */
8080
8251
  }, {
8081
8252
  key: "watchMintingLicenseConfigSetLicenseEvent",
8082
- value: function watchMintingLicenseConfigSetLicenseEvent(_onLogs11) {
8253
+ value: function watchMintingLicenseConfigSetLicenseEvent(_onLogs13) {
8083
8254
  return this.rpcClient.watchContractEvent({
8084
8255
  abi: licenseRegistryAbi,
8085
8256
  address: this.address,
8086
8257
  eventName: "MintingLicenseConfigSetLicense",
8087
8258
  onLogs: function onLogs(evs) {
8088
8259
  evs.forEach(function (it) {
8089
- return _onLogs11(it.transactionHash, it.args);
8260
+ return _onLogs13(it.transactionHash, it.args);
8090
8261
  });
8091
8262
  }
8092
8263
  });
@@ -8099,11 +8270,11 @@ var LicenseRegistryEventClient = /*#__PURE__*/function () {
8099
8270
  key: "parseTxMintingLicenseConfigSetLicenseEvent",
8100
8271
  value: function parseTxMintingLicenseConfigSetLicenseEvent(txReceipt) {
8101
8272
  var targetLogs = [];
8102
- var _iterator11 = _createForOfIteratorHelper(txReceipt.logs),
8103
- _step11;
8273
+ var _iterator13 = _createForOfIteratorHelper(txReceipt.logs),
8274
+ _step13;
8104
8275
  try {
8105
- for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
8106
- var log = _step11.value;
8276
+ for (_iterator13.s(); !(_step13 = _iterator13.n()).done;) {
8277
+ var log = _step13.value;
8107
8278
  try {
8108
8279
  var event = decodeEventLog({
8109
8280
  abi: licenseRegistryAbi,
@@ -8119,9 +8290,9 @@ var LicenseRegistryEventClient = /*#__PURE__*/function () {
8119
8290
  }
8120
8291
  }
8121
8292
  } catch (err) {
8122
- _iterator11.e(err);
8293
+ _iterator13.e(err);
8123
8294
  } finally {
8124
- _iterator11.f();
8295
+ _iterator13.f();
8125
8296
  }
8126
8297
  return targetLogs;
8127
8298
  }
@@ -8131,14 +8302,14 @@ var LicenseRegistryEventClient = /*#__PURE__*/function () {
8131
8302
  */
8132
8303
  }, {
8133
8304
  key: "watchUpgradedEvent",
8134
- value: function watchUpgradedEvent(_onLogs12) {
8305
+ value: function watchUpgradedEvent(_onLogs14) {
8135
8306
  return this.rpcClient.watchContractEvent({
8136
8307
  abi: licenseRegistryAbi,
8137
8308
  address: this.address,
8138
8309
  eventName: "Upgraded",
8139
8310
  onLogs: function onLogs(evs) {
8140
8311
  evs.forEach(function (it) {
8141
- return _onLogs12(it.transactionHash, it.args);
8312
+ return _onLogs14(it.transactionHash, it.args);
8142
8313
  });
8143
8314
  }
8144
8315
  });
@@ -8151,11 +8322,11 @@ var LicenseRegistryEventClient = /*#__PURE__*/function () {
8151
8322
  key: "parseTxUpgradedEvent",
8152
8323
  value: function parseTxUpgradedEvent(txReceipt) {
8153
8324
  var targetLogs = [];
8154
- var _iterator12 = _createForOfIteratorHelper(txReceipt.logs),
8155
- _step12;
8325
+ var _iterator14 = _createForOfIteratorHelper(txReceipt.logs),
8326
+ _step14;
8156
8327
  try {
8157
- for (_iterator12.s(); !(_step12 = _iterator12.n()).done;) {
8158
- var log = _step12.value;
8328
+ for (_iterator14.s(); !(_step14 = _iterator14.n()).done;) {
8329
+ var log = _step14.value;
8159
8330
  try {
8160
8331
  var event = decodeEventLog({
8161
8332
  abi: licenseRegistryAbi,
@@ -8171,125 +8342,862 @@ var LicenseRegistryEventClient = /*#__PURE__*/function () {
8171
8342
  }
8172
8343
  }
8173
8344
  } catch (err) {
8174
- _iterator12.e(err);
8345
+ _iterator14.e(err);
8175
8346
  } finally {
8176
- _iterator12.f();
8347
+ _iterator14.f();
8177
8348
  }
8178
8349
  return targetLogs;
8179
8350
  }
8180
8351
  }]);
8181
8352
  }();
8182
8353
 
8183
- // Contract LicensingModule =============================================================
8184
-
8185
- /**
8186
- * LicensingModuleLicenseTokensMintedEvent
8187
- *
8188
- * @param caller address
8189
- * @param licensorIpId address
8190
- * @param licenseTemplate address
8191
- * @param licenseTermsId uint256
8192
- * @param amount uint256
8193
- * @param receiver address
8194
- * @param startLicenseTokenId uint256
8195
- */
8196
-
8197
- /**
8198
- * LicensingModuleAttachLicenseTermsRequest
8199
- *
8200
- * @param ipId address
8201
- * @param licenseTemplate address
8202
- * @param licenseTermsId uint256
8203
- */
8204
-
8205
- /**
8206
- * LicensingModuleMintLicenseTokensRequest
8207
- *
8208
- * @param licensorIpId address
8209
- * @param licenseTemplate address
8210
- * @param licenseTermsId uint256
8211
- * @param amount uint256
8212
- * @param receiver address
8213
- * @param royaltyContext bytes
8214
- */
8215
-
8216
- /**
8217
- * LicensingModuleRegisterDerivativeRequest
8218
- *
8219
- * @param childIpId address
8220
- * @param parentIpIds address[]
8221
- * @param licenseTermsIds uint256[]
8222
- * @param licenseTemplate address
8223
- * @param royaltyContext bytes
8224
- */
8225
-
8226
- /**
8227
- * LicensingModuleRegisterDerivativeWithLicenseTokensRequest
8228
- *
8229
- * @param childIpId address
8230
- * @param licenseTokenIds uint256[]
8231
- * @param royaltyContext bytes
8232
- */
8233
-
8234
8354
  /**
8235
- * contract LicensingModule event
8355
+ * contract LicenseRegistry readonly method
8236
8356
  */
8237
- var LicensingModuleEventClient = /*#__PURE__*/function () {
8238
- function LicensingModuleEventClient(rpcClient, address) {
8239
- var _rpcClient$chain7;
8240
- _classCallCheck(this, LicensingModuleEventClient);
8241
- this.address = address || getAddress(licensingModuleAddress, (_rpcClient$chain7 = rpcClient.chain) === null || _rpcClient$chain7 === void 0 ? void 0 : _rpcClient$chain7.id);
8242
- this.rpcClient = rpcClient;
8357
+ var LicenseRegistryReadOnlyClient = /*#__PURE__*/function (_LicenseRegistryEvent) {
8358
+ function LicenseRegistryReadOnlyClient(rpcClient, address) {
8359
+ _classCallCheck(this, LicenseRegistryReadOnlyClient);
8360
+ return _callSuper(this, LicenseRegistryReadOnlyClient, [rpcClient, address]);
8243
8361
  }
8244
8362
 
8245
8363
  /**
8246
- * event LicenseTokensMinted for contract LicensingModule
8364
+ * method EXPIRATION_TIME for contract LicenseRegistry
8365
+ *
8366
+ * @param request LicenseRegistryExpirationTimeRequest
8367
+ * @return Promise<LicenseRegistryExpirationTimeResponse>
8247
8368
  */
8248
- return _createClass(LicensingModuleEventClient, [{
8249
- key: "watchLicenseTokensMintedEvent",
8250
- value: function watchLicenseTokensMintedEvent(_onLogs13) {
8251
- return this.rpcClient.watchContractEvent({
8252
- abi: licensingModuleAbi,
8253
- address: this.address,
8254
- eventName: "LicenseTokensMinted",
8255
- onLogs: function onLogs(evs) {
8256
- evs.forEach(function (it) {
8257
- return _onLogs13(it.transactionHash, it.args);
8258
- });
8259
- }
8260
- });
8261
- }
8262
-
8369
+ _inherits(LicenseRegistryReadOnlyClient, _LicenseRegistryEvent);
8370
+ return _createClass(LicenseRegistryReadOnlyClient, [{
8371
+ key: "expirationTime",
8372
+ value: (function () {
8373
+ var _expirationTime = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16() {
8374
+ return _regeneratorRuntime().wrap(function _callee16$(_context16) {
8375
+ while (1) switch (_context16.prev = _context16.next) {
8376
+ case 0:
8377
+ _context16.next = 2;
8378
+ return this.rpcClient.readContract({
8379
+ abi: licenseRegistryAbi,
8380
+ address: this.address,
8381
+ functionName: "EXPIRATION_TIME"
8382
+ });
8383
+ case 2:
8384
+ return _context16.abrupt("return", _context16.sent);
8385
+ case 3:
8386
+ case "end":
8387
+ return _context16.stop();
8388
+ }
8389
+ }, _callee16, this);
8390
+ }));
8391
+ function expirationTime() {
8392
+ return _expirationTime.apply(this, arguments);
8393
+ }
8394
+ return expirationTime;
8395
+ }()
8263
8396
  /**
8264
- * parse tx receipt event LicenseTokensMinted for contract LicensingModule
8397
+ * method UPGRADE_INTERFACE_VERSION for contract LicenseRegistry
8398
+ *
8399
+ * @param request LicenseRegistryUpgradeInterfaceVersionRequest
8400
+ * @return Promise<LicenseRegistryUpgradeInterfaceVersionResponse>
8265
8401
  */
8402
+ )
8266
8403
  }, {
8267
- key: "parseTxLicenseTokensMintedEvent",
8268
- value: function parseTxLicenseTokensMintedEvent(txReceipt) {
8269
- var targetLogs = [];
8270
- var _iterator13 = _createForOfIteratorHelper(txReceipt.logs),
8271
- _step13;
8272
- try {
8273
- for (_iterator13.s(); !(_step13 = _iterator13.n()).done;) {
8274
- var log = _step13.value;
8275
- try {
8276
- var event = decodeEventLog({
8277
- abi: licensingModuleAbi,
8278
- eventName: "LicenseTokensMinted",
8279
- data: log.data,
8280
- topics: log.topics
8281
- });
8282
- if (event.eventName === "LicenseTokensMinted") {
8283
- targetLogs.push(event.args);
8284
- }
8285
- } catch (e) {
8286
- /* empty */
8404
+ key: "upgradeInterfaceVersion",
8405
+ value: (function () {
8406
+ var _upgradeInterfaceVersion = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17() {
8407
+ return _regeneratorRuntime().wrap(function _callee17$(_context17) {
8408
+ while (1) switch (_context17.prev = _context17.next) {
8409
+ case 0:
8410
+ _context17.next = 2;
8411
+ return this.rpcClient.readContract({
8412
+ abi: licenseRegistryAbi,
8413
+ address: this.address,
8414
+ functionName: "UPGRADE_INTERFACE_VERSION"
8415
+ });
8416
+ case 2:
8417
+ return _context17.abrupt("return", _context17.sent);
8418
+ case 3:
8419
+ case "end":
8420
+ return _context17.stop();
8287
8421
  }
8288
- }
8289
- } catch (err) {
8290
- _iterator13.e(err);
8422
+ }, _callee17, this);
8423
+ }));
8424
+ function upgradeInterfaceVersion() {
8425
+ return _upgradeInterfaceVersion.apply(this, arguments);
8426
+ }
8427
+ return upgradeInterfaceVersion;
8428
+ }()
8429
+ /**
8430
+ * method disputeModule for contract LicenseRegistry
8431
+ *
8432
+ * @param request LicenseRegistryDisputeModuleRequest
8433
+ * @return Promise<LicenseRegistryDisputeModuleResponse>
8434
+ */
8435
+ )
8436
+ }, {
8437
+ key: "disputeModule",
8438
+ value: (function () {
8439
+ var _disputeModule = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18() {
8440
+ return _regeneratorRuntime().wrap(function _callee18$(_context18) {
8441
+ while (1) switch (_context18.prev = _context18.next) {
8442
+ case 0:
8443
+ _context18.next = 2;
8444
+ return this.rpcClient.readContract({
8445
+ abi: licenseRegistryAbi,
8446
+ address: this.address,
8447
+ functionName: "disputeModule"
8448
+ });
8449
+ case 2:
8450
+ return _context18.abrupt("return", _context18.sent);
8451
+ case 3:
8452
+ case "end":
8453
+ return _context18.stop();
8454
+ }
8455
+ }, _callee18, this);
8456
+ }));
8457
+ function disputeModule() {
8458
+ return _disputeModule.apply(this, arguments);
8459
+ }
8460
+ return disputeModule;
8461
+ }()
8462
+ /**
8463
+ * method exists for contract LicenseRegistry
8464
+ *
8465
+ * @param request LicenseRegistryExistsRequest
8466
+ * @return Promise<LicenseRegistryExistsResponse>
8467
+ */
8468
+ )
8469
+ }, {
8470
+ key: "exists",
8471
+ value: (function () {
8472
+ var _exists = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19(request) {
8473
+ return _regeneratorRuntime().wrap(function _callee19$(_context19) {
8474
+ while (1) switch (_context19.prev = _context19.next) {
8475
+ case 0:
8476
+ _context19.next = 2;
8477
+ return this.rpcClient.readContract({
8478
+ abi: licenseRegistryAbi,
8479
+ address: this.address,
8480
+ functionName: "exists",
8481
+ args: [request.licenseTemplate, request.licenseTermsId]
8482
+ });
8483
+ case 2:
8484
+ return _context19.abrupt("return", _context19.sent);
8485
+ case 3:
8486
+ case "end":
8487
+ return _context19.stop();
8488
+ }
8489
+ }, _callee19, this);
8490
+ }));
8491
+ function exists(_x14) {
8492
+ return _exists.apply(this, arguments);
8493
+ }
8494
+ return exists;
8495
+ }()
8496
+ /**
8497
+ * method getAttachedLicenseTerms for contract LicenseRegistry
8498
+ *
8499
+ * @param request LicenseRegistryGetAttachedLicenseTermsRequest
8500
+ * @return Promise<LicenseRegistryGetAttachedLicenseTermsResponse>
8501
+ */
8502
+ )
8503
+ }, {
8504
+ key: "getAttachedLicenseTerms",
8505
+ value: (function () {
8506
+ var _getAttachedLicenseTerms = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20(request) {
8507
+ var result;
8508
+ return _regeneratorRuntime().wrap(function _callee20$(_context20) {
8509
+ while (1) switch (_context20.prev = _context20.next) {
8510
+ case 0:
8511
+ _context20.next = 2;
8512
+ return this.rpcClient.readContract({
8513
+ abi: licenseRegistryAbi,
8514
+ address: this.address,
8515
+ functionName: "getAttachedLicenseTerms",
8516
+ args: [request.ipId, request.index]
8517
+ });
8518
+ case 2:
8519
+ result = _context20.sent;
8520
+ return _context20.abrupt("return", {
8521
+ licenseTemplate: result[0],
8522
+ licenseTermsId: result[1]
8523
+ });
8524
+ case 4:
8525
+ case "end":
8526
+ return _context20.stop();
8527
+ }
8528
+ }, _callee20, this);
8529
+ }));
8530
+ function getAttachedLicenseTerms(_x15) {
8531
+ return _getAttachedLicenseTerms.apply(this, arguments);
8532
+ }
8533
+ return getAttachedLicenseTerms;
8534
+ }()
8535
+ /**
8536
+ * method getAttachedLicenseTermsCount for contract LicenseRegistry
8537
+ *
8538
+ * @param request LicenseRegistryGetAttachedLicenseTermsCountRequest
8539
+ * @return Promise<LicenseRegistryGetAttachedLicenseTermsCountResponse>
8540
+ */
8541
+ )
8542
+ }, {
8543
+ key: "getAttachedLicenseTermsCount",
8544
+ value: (function () {
8545
+ var _getAttachedLicenseTermsCount = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21(request) {
8546
+ return _regeneratorRuntime().wrap(function _callee21$(_context21) {
8547
+ while (1) switch (_context21.prev = _context21.next) {
8548
+ case 0:
8549
+ _context21.next = 2;
8550
+ return this.rpcClient.readContract({
8551
+ abi: licenseRegistryAbi,
8552
+ address: this.address,
8553
+ functionName: "getAttachedLicenseTermsCount",
8554
+ args: [request.ipId]
8555
+ });
8556
+ case 2:
8557
+ return _context21.abrupt("return", _context21.sent);
8558
+ case 3:
8559
+ case "end":
8560
+ return _context21.stop();
8561
+ }
8562
+ }, _callee21, this);
8563
+ }));
8564
+ function getAttachedLicenseTermsCount(_x16) {
8565
+ return _getAttachedLicenseTermsCount.apply(this, arguments);
8566
+ }
8567
+ return getAttachedLicenseTermsCount;
8568
+ }()
8569
+ /**
8570
+ * method getDefaultLicenseTerms for contract LicenseRegistry
8571
+ *
8572
+ * @param request LicenseRegistryGetDefaultLicenseTermsRequest
8573
+ * @return Promise<LicenseRegistryGetDefaultLicenseTermsResponse>
8574
+ */
8575
+ )
8576
+ }, {
8577
+ key: "getDefaultLicenseTerms",
8578
+ value: (function () {
8579
+ var _getDefaultLicenseTerms = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee22() {
8580
+ var result;
8581
+ return _regeneratorRuntime().wrap(function _callee22$(_context22) {
8582
+ while (1) switch (_context22.prev = _context22.next) {
8583
+ case 0:
8584
+ _context22.next = 2;
8585
+ return this.rpcClient.readContract({
8586
+ abi: licenseRegistryAbi,
8587
+ address: this.address,
8588
+ functionName: "getDefaultLicenseTerms"
8589
+ });
8590
+ case 2:
8591
+ result = _context22.sent;
8592
+ return _context22.abrupt("return", {
8593
+ licenseTemplate: result[0],
8594
+ licenseTermsId: result[1]
8595
+ });
8596
+ case 4:
8597
+ case "end":
8598
+ return _context22.stop();
8599
+ }
8600
+ }, _callee22, this);
8601
+ }));
8602
+ function getDefaultLicenseTerms() {
8603
+ return _getDefaultLicenseTerms.apply(this, arguments);
8604
+ }
8605
+ return getDefaultLicenseTerms;
8606
+ }()
8607
+ /**
8608
+ * method getDerivativeIp for contract LicenseRegistry
8609
+ *
8610
+ * @param request LicenseRegistryGetDerivativeIpRequest
8611
+ * @return Promise<LicenseRegistryGetDerivativeIpResponse>
8612
+ */
8613
+ )
8614
+ }, {
8615
+ key: "getDerivativeIp",
8616
+ value: (function () {
8617
+ var _getDerivativeIp = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee23(request) {
8618
+ var result;
8619
+ return _regeneratorRuntime().wrap(function _callee23$(_context23) {
8620
+ while (1) switch (_context23.prev = _context23.next) {
8621
+ case 0:
8622
+ _context23.next = 2;
8623
+ return this.rpcClient.readContract({
8624
+ abi: licenseRegistryAbi,
8625
+ address: this.address,
8626
+ functionName: "getDerivativeIp",
8627
+ args: [request.parentIpId, request.index]
8628
+ });
8629
+ case 2:
8630
+ result = _context23.sent;
8631
+ return _context23.abrupt("return", {
8632
+ childIpId: result
8633
+ });
8634
+ case 4:
8635
+ case "end":
8636
+ return _context23.stop();
8637
+ }
8638
+ }, _callee23, this);
8639
+ }));
8640
+ function getDerivativeIp(_x17) {
8641
+ return _getDerivativeIp.apply(this, arguments);
8642
+ }
8643
+ return getDerivativeIp;
8644
+ }()
8645
+ /**
8646
+ * method getDerivativeIpCount for contract LicenseRegistry
8647
+ *
8648
+ * @param request LicenseRegistryGetDerivativeIpCountRequest
8649
+ * @return Promise<LicenseRegistryGetDerivativeIpCountResponse>
8650
+ */
8651
+ )
8652
+ }, {
8653
+ key: "getDerivativeIpCount",
8654
+ value: (function () {
8655
+ var _getDerivativeIpCount = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee24(request) {
8656
+ return _regeneratorRuntime().wrap(function _callee24$(_context24) {
8657
+ while (1) switch (_context24.prev = _context24.next) {
8658
+ case 0:
8659
+ _context24.next = 2;
8660
+ return this.rpcClient.readContract({
8661
+ abi: licenseRegistryAbi,
8662
+ address: this.address,
8663
+ functionName: "getDerivativeIpCount",
8664
+ args: [request.parentIpId]
8665
+ });
8666
+ case 2:
8667
+ return _context24.abrupt("return", _context24.sent);
8668
+ case 3:
8669
+ case "end":
8670
+ return _context24.stop();
8671
+ }
8672
+ }, _callee24, this);
8673
+ }));
8674
+ function getDerivativeIpCount(_x18) {
8675
+ return _getDerivativeIpCount.apply(this, arguments);
8676
+ }
8677
+ return getDerivativeIpCount;
8678
+ }()
8679
+ /**
8680
+ * method getExpireTime for contract LicenseRegistry
8681
+ *
8682
+ * @param request LicenseRegistryGetExpireTimeRequest
8683
+ * @return Promise<LicenseRegistryGetExpireTimeResponse>
8684
+ */
8685
+ )
8686
+ }, {
8687
+ key: "getExpireTime",
8688
+ value: (function () {
8689
+ var _getExpireTime = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee25(request) {
8690
+ return _regeneratorRuntime().wrap(function _callee25$(_context25) {
8691
+ while (1) switch (_context25.prev = _context25.next) {
8692
+ case 0:
8693
+ _context25.next = 2;
8694
+ return this.rpcClient.readContract({
8695
+ abi: licenseRegistryAbi,
8696
+ address: this.address,
8697
+ functionName: "getExpireTime",
8698
+ args: [request.ipId]
8699
+ });
8700
+ case 2:
8701
+ return _context25.abrupt("return", _context25.sent);
8702
+ case 3:
8703
+ case "end":
8704
+ return _context25.stop();
8705
+ }
8706
+ }, _callee25, this);
8707
+ }));
8708
+ function getExpireTime(_x19) {
8709
+ return _getExpireTime.apply(this, arguments);
8710
+ }
8711
+ return getExpireTime;
8712
+ }()
8713
+ /**
8714
+ * method getGovernance for contract LicenseRegistry
8715
+ *
8716
+ * @param request LicenseRegistryGetGovernanceRequest
8717
+ * @return Promise<LicenseRegistryGetGovernanceResponse>
8718
+ */
8719
+ )
8720
+ }, {
8721
+ key: "getGovernance",
8722
+ value: (function () {
8723
+ var _getGovernance = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee26() {
8724
+ return _regeneratorRuntime().wrap(function _callee26$(_context26) {
8725
+ while (1) switch (_context26.prev = _context26.next) {
8726
+ case 0:
8727
+ _context26.next = 2;
8728
+ return this.rpcClient.readContract({
8729
+ abi: licenseRegistryAbi,
8730
+ address: this.address,
8731
+ functionName: "getGovernance"
8732
+ });
8733
+ case 2:
8734
+ return _context26.abrupt("return", _context26.sent);
8735
+ case 3:
8736
+ case "end":
8737
+ return _context26.stop();
8738
+ }
8739
+ }, _callee26, this);
8740
+ }));
8741
+ function getGovernance() {
8742
+ return _getGovernance.apply(this, arguments);
8743
+ }
8744
+ return getGovernance;
8745
+ }()
8746
+ /**
8747
+ * method getMintingLicenseConfig for contract LicenseRegistry
8748
+ *
8749
+ * @param request LicenseRegistryGetMintingLicenseConfigRequest
8750
+ * @return Promise<LicenseRegistryGetMintingLicenseConfigResponse>
8751
+ */
8752
+ )
8753
+ }, {
8754
+ key: "getMintingLicenseConfig",
8755
+ value: (function () {
8756
+ var _getMintingLicenseConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27(request) {
8757
+ return _regeneratorRuntime().wrap(function _callee27$(_context27) {
8758
+ while (1) switch (_context27.prev = _context27.next) {
8759
+ case 0:
8760
+ _context27.next = 2;
8761
+ return this.rpcClient.readContract({
8762
+ abi: licenseRegistryAbi,
8763
+ address: this.address,
8764
+ functionName: "getMintingLicenseConfig",
8765
+ args: [request.ipId, request.licenseTemplate, request.licenseTermsId]
8766
+ });
8767
+ case 2:
8768
+ return _context27.abrupt("return", _context27.sent);
8769
+ case 3:
8770
+ case "end":
8771
+ return _context27.stop();
8772
+ }
8773
+ }, _callee27, this);
8774
+ }));
8775
+ function getMintingLicenseConfig(_x20) {
8776
+ return _getMintingLicenseConfig.apply(this, arguments);
8777
+ }
8778
+ return getMintingLicenseConfig;
8779
+ }()
8780
+ /**
8781
+ * method getParentIp for contract LicenseRegistry
8782
+ *
8783
+ * @param request LicenseRegistryGetParentIpRequest
8784
+ * @return Promise<LicenseRegistryGetParentIpResponse>
8785
+ */
8786
+ )
8787
+ }, {
8788
+ key: "getParentIp",
8789
+ value: (function () {
8790
+ var _getParentIp = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee28(request) {
8791
+ var result;
8792
+ return _regeneratorRuntime().wrap(function _callee28$(_context28) {
8793
+ while (1) switch (_context28.prev = _context28.next) {
8794
+ case 0:
8795
+ _context28.next = 2;
8796
+ return this.rpcClient.readContract({
8797
+ abi: licenseRegistryAbi,
8798
+ address: this.address,
8799
+ functionName: "getParentIp",
8800
+ args: [request.childIpId, request.index]
8801
+ });
8802
+ case 2:
8803
+ result = _context28.sent;
8804
+ return _context28.abrupt("return", {
8805
+ parentIpId: result
8806
+ });
8807
+ case 4:
8808
+ case "end":
8809
+ return _context28.stop();
8810
+ }
8811
+ }, _callee28, this);
8812
+ }));
8813
+ function getParentIp(_x21) {
8814
+ return _getParentIp.apply(this, arguments);
8815
+ }
8816
+ return getParentIp;
8817
+ }()
8818
+ /**
8819
+ * method getParentIpCount for contract LicenseRegistry
8820
+ *
8821
+ * @param request LicenseRegistryGetParentIpCountRequest
8822
+ * @return Promise<LicenseRegistryGetParentIpCountResponse>
8823
+ */
8824
+ )
8825
+ }, {
8826
+ key: "getParentIpCount",
8827
+ value: (function () {
8828
+ var _getParentIpCount = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee29(request) {
8829
+ return _regeneratorRuntime().wrap(function _callee29$(_context29) {
8830
+ while (1) switch (_context29.prev = _context29.next) {
8831
+ case 0:
8832
+ _context29.next = 2;
8833
+ return this.rpcClient.readContract({
8834
+ abi: licenseRegistryAbi,
8835
+ address: this.address,
8836
+ functionName: "getParentIpCount",
8837
+ args: [request.childIpId]
8838
+ });
8839
+ case 2:
8840
+ return _context29.abrupt("return", _context29.sent);
8841
+ case 3:
8842
+ case "end":
8843
+ return _context29.stop();
8844
+ }
8845
+ }, _callee29, this);
8846
+ }));
8847
+ function getParentIpCount(_x22) {
8848
+ return _getParentIpCount.apply(this, arguments);
8849
+ }
8850
+ return getParentIpCount;
8851
+ }()
8852
+ /**
8853
+ * method hasDerivativeIps for contract LicenseRegistry
8854
+ *
8855
+ * @param request LicenseRegistryHasDerivativeIpsRequest
8856
+ * @return Promise<LicenseRegistryHasDerivativeIpsResponse>
8857
+ */
8858
+ )
8859
+ }, {
8860
+ key: "hasDerivativeIps",
8861
+ value: (function () {
8862
+ var _hasDerivativeIps = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee30(request) {
8863
+ return _regeneratorRuntime().wrap(function _callee30$(_context30) {
8864
+ while (1) switch (_context30.prev = _context30.next) {
8865
+ case 0:
8866
+ _context30.next = 2;
8867
+ return this.rpcClient.readContract({
8868
+ abi: licenseRegistryAbi,
8869
+ address: this.address,
8870
+ functionName: "hasDerivativeIps",
8871
+ args: [request.parentIpId]
8872
+ });
8873
+ case 2:
8874
+ return _context30.abrupt("return", _context30.sent);
8875
+ case 3:
8876
+ case "end":
8877
+ return _context30.stop();
8878
+ }
8879
+ }, _callee30, this);
8880
+ }));
8881
+ function hasDerivativeIps(_x23) {
8882
+ return _hasDerivativeIps.apply(this, arguments);
8883
+ }
8884
+ return hasDerivativeIps;
8885
+ }()
8886
+ /**
8887
+ * method hasIpAttachedLicenseTerms for contract LicenseRegistry
8888
+ *
8889
+ * @param request LicenseRegistryHasIpAttachedLicenseTermsRequest
8890
+ * @return Promise<LicenseRegistryHasIpAttachedLicenseTermsResponse>
8891
+ */
8892
+ )
8893
+ }, {
8894
+ key: "hasIpAttachedLicenseTerms",
8895
+ value: (function () {
8896
+ var _hasIpAttachedLicenseTerms = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee31(request) {
8897
+ return _regeneratorRuntime().wrap(function _callee31$(_context31) {
8898
+ while (1) switch (_context31.prev = _context31.next) {
8899
+ case 0:
8900
+ _context31.next = 2;
8901
+ return this.rpcClient.readContract({
8902
+ abi: licenseRegistryAbi,
8903
+ address: this.address,
8904
+ functionName: "hasIpAttachedLicenseTerms",
8905
+ args: [request.ipId, request.licenseTemplate, request.licenseTermsId]
8906
+ });
8907
+ case 2:
8908
+ return _context31.abrupt("return", _context31.sent);
8909
+ case 3:
8910
+ case "end":
8911
+ return _context31.stop();
8912
+ }
8913
+ }, _callee31, this);
8914
+ }));
8915
+ function hasIpAttachedLicenseTerms(_x24) {
8916
+ return _hasIpAttachedLicenseTerms.apply(this, arguments);
8917
+ }
8918
+ return hasIpAttachedLicenseTerms;
8919
+ }()
8920
+ /**
8921
+ * method isDerivativeIp for contract LicenseRegistry
8922
+ *
8923
+ * @param request LicenseRegistryIsDerivativeIpRequest
8924
+ * @return Promise<LicenseRegistryIsDerivativeIpResponse>
8925
+ */
8926
+ )
8927
+ }, {
8928
+ key: "isDerivativeIp",
8929
+ value: (function () {
8930
+ var _isDerivativeIp = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee32(request) {
8931
+ return _regeneratorRuntime().wrap(function _callee32$(_context32) {
8932
+ while (1) switch (_context32.prev = _context32.next) {
8933
+ case 0:
8934
+ _context32.next = 2;
8935
+ return this.rpcClient.readContract({
8936
+ abi: licenseRegistryAbi,
8937
+ address: this.address,
8938
+ functionName: "isDerivativeIp",
8939
+ args: [request.childIpId]
8940
+ });
8941
+ case 2:
8942
+ return _context32.abrupt("return", _context32.sent);
8943
+ case 3:
8944
+ case "end":
8945
+ return _context32.stop();
8946
+ }
8947
+ }, _callee32, this);
8948
+ }));
8949
+ function isDerivativeIp(_x25) {
8950
+ return _isDerivativeIp.apply(this, arguments);
8951
+ }
8952
+ return isDerivativeIp;
8953
+ }()
8954
+ /**
8955
+ * method isRegisteredLicenseTemplate for contract LicenseRegistry
8956
+ *
8957
+ * @param request LicenseRegistryIsRegisteredLicenseTemplateRequest
8958
+ * @return Promise<LicenseRegistryIsRegisteredLicenseTemplateResponse>
8959
+ */
8960
+ )
8961
+ }, {
8962
+ key: "isRegisteredLicenseTemplate",
8963
+ value: (function () {
8964
+ var _isRegisteredLicenseTemplate = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee33(request) {
8965
+ return _regeneratorRuntime().wrap(function _callee33$(_context33) {
8966
+ while (1) switch (_context33.prev = _context33.next) {
8967
+ case 0:
8968
+ _context33.next = 2;
8969
+ return this.rpcClient.readContract({
8970
+ abi: licenseRegistryAbi,
8971
+ address: this.address,
8972
+ functionName: "isRegisteredLicenseTemplate",
8973
+ args: [request.licenseTemplate]
8974
+ });
8975
+ case 2:
8976
+ return _context33.abrupt("return", _context33.sent);
8977
+ case 3:
8978
+ case "end":
8979
+ return _context33.stop();
8980
+ }
8981
+ }, _callee33, this);
8982
+ }));
8983
+ function isRegisteredLicenseTemplate(_x26) {
8984
+ return _isRegisteredLicenseTemplate.apply(this, arguments);
8985
+ }
8986
+ return isRegisteredLicenseTemplate;
8987
+ }()
8988
+ /**
8989
+ * method licensingModule for contract LicenseRegistry
8990
+ *
8991
+ * @param request LicenseRegistryLicensingModuleRequest
8992
+ * @return Promise<LicenseRegistryLicensingModuleResponse>
8993
+ */
8994
+ )
8995
+ }, {
8996
+ key: "licensingModule",
8997
+ value: (function () {
8998
+ var _licensingModule = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee34() {
8999
+ return _regeneratorRuntime().wrap(function _callee34$(_context34) {
9000
+ while (1) switch (_context34.prev = _context34.next) {
9001
+ case 0:
9002
+ _context34.next = 2;
9003
+ return this.rpcClient.readContract({
9004
+ abi: licenseRegistryAbi,
9005
+ address: this.address,
9006
+ functionName: "licensingModule"
9007
+ });
9008
+ case 2:
9009
+ return _context34.abrupt("return", _context34.sent);
9010
+ case 3:
9011
+ case "end":
9012
+ return _context34.stop();
9013
+ }
9014
+ }, _callee34, this);
9015
+ }));
9016
+ function licensingModule() {
9017
+ return _licensingModule.apply(this, arguments);
9018
+ }
9019
+ return licensingModule;
9020
+ }()
9021
+ /**
9022
+ * method proxiableUUID for contract LicenseRegistry
9023
+ *
9024
+ * @param request LicenseRegistryProxiableUuidRequest
9025
+ * @return Promise<LicenseRegistryProxiableUuidResponse>
9026
+ */
9027
+ )
9028
+ }, {
9029
+ key: "proxiableUuid",
9030
+ value: (function () {
9031
+ var _proxiableUuid = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee35() {
9032
+ return _regeneratorRuntime().wrap(function _callee35$(_context35) {
9033
+ while (1) switch (_context35.prev = _context35.next) {
9034
+ case 0:
9035
+ _context35.next = 2;
9036
+ return this.rpcClient.readContract({
9037
+ abi: licenseRegistryAbi,
9038
+ address: this.address,
9039
+ functionName: "proxiableUUID"
9040
+ });
9041
+ case 2:
9042
+ return _context35.abrupt("return", _context35.sent);
9043
+ case 3:
9044
+ case "end":
9045
+ return _context35.stop();
9046
+ }
9047
+ }, _callee35, this);
9048
+ }));
9049
+ function proxiableUuid() {
9050
+ return _proxiableUuid.apply(this, arguments);
9051
+ }
9052
+ return proxiableUuid;
9053
+ }()
9054
+ /**
9055
+ * method verifyMintLicenseToken for contract LicenseRegistry
9056
+ *
9057
+ * @param request LicenseRegistryVerifyMintLicenseTokenRequest
9058
+ * @return Promise<LicenseRegistryVerifyMintLicenseTokenResponse>
9059
+ */
9060
+ )
9061
+ }, {
9062
+ key: "verifyMintLicenseToken",
9063
+ value: (function () {
9064
+ var _verifyMintLicenseToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee36(request) {
9065
+ return _regeneratorRuntime().wrap(function _callee36$(_context36) {
9066
+ while (1) switch (_context36.prev = _context36.next) {
9067
+ case 0:
9068
+ _context36.next = 2;
9069
+ return this.rpcClient.readContract({
9070
+ abi: licenseRegistryAbi,
9071
+ address: this.address,
9072
+ functionName: "verifyMintLicenseToken",
9073
+ args: [request.licensorIpId, request.licenseTemplate, request.licenseTermsId, request.isMintedByIpOwner]
9074
+ });
9075
+ case 2:
9076
+ return _context36.abrupt("return", _context36.sent);
9077
+ case 3:
9078
+ case "end":
9079
+ return _context36.stop();
9080
+ }
9081
+ }, _callee36, this);
9082
+ }));
9083
+ function verifyMintLicenseToken(_x27) {
9084
+ return _verifyMintLicenseToken.apply(this, arguments);
9085
+ }
9086
+ return verifyMintLicenseToken;
9087
+ }())
9088
+ }]);
9089
+ }(LicenseRegistryEventClient);
9090
+
9091
+ // Contract LicensingModule =============================================================
9092
+
9093
+ /**
9094
+ * LicensingModuleLicenseTokensMintedEvent
9095
+ *
9096
+ * @param caller address
9097
+ * @param licensorIpId address
9098
+ * @param licenseTemplate address
9099
+ * @param licenseTermsId uint256
9100
+ * @param amount uint256
9101
+ * @param receiver address
9102
+ * @param startLicenseTokenId uint256
9103
+ */
9104
+
9105
+ /**
9106
+ * LicensingModuleAttachLicenseTermsRequest
9107
+ *
9108
+ * @param ipId address
9109
+ * @param licenseTemplate address
9110
+ * @param licenseTermsId uint256
9111
+ */
9112
+
9113
+ /**
9114
+ * LicensingModuleMintLicenseTokensRequest
9115
+ *
9116
+ * @param licensorIpId address
9117
+ * @param licenseTemplate address
9118
+ * @param licenseTermsId uint256
9119
+ * @param amount uint256
9120
+ * @param receiver address
9121
+ * @param royaltyContext bytes
9122
+ */
9123
+
9124
+ /**
9125
+ * LicensingModuleRegisterDerivativeRequest
9126
+ *
9127
+ * @param childIpId address
9128
+ * @param parentIpIds address[]
9129
+ * @param licenseTermsIds uint256[]
9130
+ * @param licenseTemplate address
9131
+ * @param royaltyContext bytes
9132
+ */
9133
+
9134
+ /**
9135
+ * LicensingModuleRegisterDerivativeWithLicenseTokensRequest
9136
+ *
9137
+ * @param childIpId address
9138
+ * @param licenseTokenIds uint256[]
9139
+ * @param royaltyContext bytes
9140
+ */
9141
+
9142
+ /**
9143
+ * contract LicensingModule event
9144
+ */
9145
+ var LicensingModuleEventClient = /*#__PURE__*/function () {
9146
+ function LicensingModuleEventClient(rpcClient, address) {
9147
+ var _rpcClient$chain7;
9148
+ _classCallCheck(this, LicensingModuleEventClient);
9149
+ this.address = address || getAddress(licensingModuleAddress, (_rpcClient$chain7 = rpcClient.chain) === null || _rpcClient$chain7 === void 0 ? void 0 : _rpcClient$chain7.id);
9150
+ this.rpcClient = rpcClient;
9151
+ }
9152
+
9153
+ /**
9154
+ * event LicenseTokensMinted for contract LicensingModule
9155
+ */
9156
+ return _createClass(LicensingModuleEventClient, [{
9157
+ key: "watchLicenseTokensMintedEvent",
9158
+ value: function watchLicenseTokensMintedEvent(_onLogs15) {
9159
+ return this.rpcClient.watchContractEvent({
9160
+ abi: licensingModuleAbi,
9161
+ address: this.address,
9162
+ eventName: "LicenseTokensMinted",
9163
+ onLogs: function onLogs(evs) {
9164
+ evs.forEach(function (it) {
9165
+ return _onLogs15(it.transactionHash, it.args);
9166
+ });
9167
+ }
9168
+ });
9169
+ }
9170
+
9171
+ /**
9172
+ * parse tx receipt event LicenseTokensMinted for contract LicensingModule
9173
+ */
9174
+ }, {
9175
+ key: "parseTxLicenseTokensMintedEvent",
9176
+ value: function parseTxLicenseTokensMintedEvent(txReceipt) {
9177
+ var targetLogs = [];
9178
+ var _iterator15 = _createForOfIteratorHelper(txReceipt.logs),
9179
+ _step15;
9180
+ try {
9181
+ for (_iterator15.s(); !(_step15 = _iterator15.n()).done;) {
9182
+ var log = _step15.value;
9183
+ try {
9184
+ var event = decodeEventLog({
9185
+ abi: licensingModuleAbi,
9186
+ eventName: "LicenseTokensMinted",
9187
+ data: log.data,
9188
+ topics: log.topics
9189
+ });
9190
+ if (event.eventName === "LicenseTokensMinted") {
9191
+ targetLogs.push(event.args);
9192
+ }
9193
+ } catch (e) {
9194
+ /* empty */
9195
+ }
9196
+ }
9197
+ } catch (err) {
9198
+ _iterator15.e(err);
8291
9199
  } finally {
8292
- _iterator13.f();
9200
+ _iterator15.f();
8293
9201
  }
8294
9202
  return targetLogs;
8295
9203
  }
@@ -8318,12 +9226,12 @@ var LicensingModuleClient = /*#__PURE__*/function (_LicensingModuleEvent) {
8318
9226
  return _createClass(LicensingModuleClient, [{
8319
9227
  key: "attachLicenseTerms",
8320
9228
  value: (function () {
8321
- var _attachLicenseTerms = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee48(request) {
8322
- var _yield$this$rpcClient23, call;
8323
- return _regeneratorRuntime().wrap(function _callee48$(_context48) {
8324
- while (1) switch (_context48.prev = _context48.next) {
9229
+ var _attachLicenseTerms = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee49(request) {
9230
+ var _yield$this$rpcClient24, call;
9231
+ return _regeneratorRuntime().wrap(function _callee49$(_context49) {
9232
+ while (1) switch (_context49.prev = _context49.next) {
8325
9233
  case 0:
8326
- _context48.next = 2;
9234
+ _context49.next = 2;
8327
9235
  return this.rpcClient.simulateContract({
8328
9236
  abi: licensingModuleAbi,
8329
9237
  address: this.address,
@@ -8332,17 +9240,17 @@ var LicensingModuleClient = /*#__PURE__*/function (_LicensingModuleEvent) {
8332
9240
  args: [request.ipId, request.licenseTemplate, request.licenseTermsId]
8333
9241
  });
8334
9242
  case 2:
8335
- _yield$this$rpcClient23 = _context48.sent;
8336
- call = _yield$this$rpcClient23.request;
8337
- _context48.next = 6;
9243
+ _yield$this$rpcClient24 = _context49.sent;
9244
+ call = _yield$this$rpcClient24.request;
9245
+ _context49.next = 6;
8338
9246
  return this.wallet.writeContract(call);
8339
9247
  case 6:
8340
- return _context48.abrupt("return", _context48.sent);
9248
+ return _context49.abrupt("return", _context49.sent);
8341
9249
  case 7:
8342
9250
  case "end":
8343
- return _context48.stop();
9251
+ return _context49.stop();
8344
9252
  }
8345
- }, _callee48, this);
9253
+ }, _callee49, this);
8346
9254
  }));
8347
9255
  function attachLicenseTerms(_x40) {
8348
9256
  return _attachLicenseTerms.apply(this, arguments);
@@ -8359,12 +9267,12 @@ var LicensingModuleClient = /*#__PURE__*/function (_LicensingModuleEvent) {
8359
9267
  }, {
8360
9268
  key: "mintLicenseTokens",
8361
9269
  value: (function () {
8362
- var _mintLicenseTokens = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee49(request) {
8363
- var _yield$this$rpcClient24, call;
8364
- return _regeneratorRuntime().wrap(function _callee49$(_context49) {
8365
- while (1) switch (_context49.prev = _context49.next) {
9270
+ var _mintLicenseTokens = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee50(request) {
9271
+ var _yield$this$rpcClient25, call;
9272
+ return _regeneratorRuntime().wrap(function _callee50$(_context50) {
9273
+ while (1) switch (_context50.prev = _context50.next) {
8366
9274
  case 0:
8367
- _context49.next = 2;
9275
+ _context50.next = 2;
8368
9276
  return this.rpcClient.simulateContract({
8369
9277
  abi: licensingModuleAbi,
8370
9278
  address: this.address,
@@ -8373,17 +9281,17 @@ var LicensingModuleClient = /*#__PURE__*/function (_LicensingModuleEvent) {
8373
9281
  args: [request.licensorIpId, request.licenseTemplate, request.licenseTermsId, request.amount, request.receiver, request.royaltyContext]
8374
9282
  });
8375
9283
  case 2:
8376
- _yield$this$rpcClient24 = _context49.sent;
8377
- call = _yield$this$rpcClient24.request;
8378
- _context49.next = 6;
9284
+ _yield$this$rpcClient25 = _context50.sent;
9285
+ call = _yield$this$rpcClient25.request;
9286
+ _context50.next = 6;
8379
9287
  return this.wallet.writeContract(call);
8380
9288
  case 6:
8381
- return _context49.abrupt("return", _context49.sent);
9289
+ return _context50.abrupt("return", _context50.sent);
8382
9290
  case 7:
8383
9291
  case "end":
8384
- return _context49.stop();
9292
+ return _context50.stop();
8385
9293
  }
8386
- }, _callee49, this);
9294
+ }, _callee50, this);
8387
9295
  }));
8388
9296
  function mintLicenseTokens(_x41) {
8389
9297
  return _mintLicenseTokens.apply(this, arguments);
@@ -8400,12 +9308,12 @@ var LicensingModuleClient = /*#__PURE__*/function (_LicensingModuleEvent) {
8400
9308
  }, {
8401
9309
  key: "registerDerivative",
8402
9310
  value: (function () {
8403
- var _registerDerivative = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee50(request) {
8404
- var _yield$this$rpcClient25, call;
8405
- return _regeneratorRuntime().wrap(function _callee50$(_context50) {
8406
- while (1) switch (_context50.prev = _context50.next) {
9311
+ var _registerDerivative = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee51(request) {
9312
+ var _yield$this$rpcClient26, call;
9313
+ return _regeneratorRuntime().wrap(function _callee51$(_context51) {
9314
+ while (1) switch (_context51.prev = _context51.next) {
8407
9315
  case 0:
8408
- _context50.next = 2;
9316
+ _context51.next = 2;
8409
9317
  return this.rpcClient.simulateContract({
8410
9318
  abi: licensingModuleAbi,
8411
9319
  address: this.address,
@@ -8414,17 +9322,17 @@ var LicensingModuleClient = /*#__PURE__*/function (_LicensingModuleEvent) {
8414
9322
  args: [request.childIpId, request.parentIpIds, request.licenseTermsIds, request.licenseTemplate, request.royaltyContext]
8415
9323
  });
8416
9324
  case 2:
8417
- _yield$this$rpcClient25 = _context50.sent;
8418
- call = _yield$this$rpcClient25.request;
8419
- _context50.next = 6;
9325
+ _yield$this$rpcClient26 = _context51.sent;
9326
+ call = _yield$this$rpcClient26.request;
9327
+ _context51.next = 6;
8420
9328
  return this.wallet.writeContract(call);
8421
9329
  case 6:
8422
- return _context50.abrupt("return", _context50.sent);
9330
+ return _context51.abrupt("return", _context51.sent);
8423
9331
  case 7:
8424
9332
  case "end":
8425
- return _context50.stop();
9333
+ return _context51.stop();
8426
9334
  }
8427
- }, _callee50, this);
9335
+ }, _callee51, this);
8428
9336
  }));
8429
9337
  function registerDerivative(_x42) {
8430
9338
  return _registerDerivative.apply(this, arguments);
@@ -8441,12 +9349,12 @@ var LicensingModuleClient = /*#__PURE__*/function (_LicensingModuleEvent) {
8441
9349
  }, {
8442
9350
  key: "registerDerivativeWithLicenseTokens",
8443
9351
  value: (function () {
8444
- var _registerDerivativeWithLicenseTokens = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee51(request) {
8445
- var _yield$this$rpcClient26, call;
8446
- return _regeneratorRuntime().wrap(function _callee51$(_context51) {
8447
- while (1) switch (_context51.prev = _context51.next) {
9352
+ var _registerDerivativeWithLicenseTokens = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee52(request) {
9353
+ var _yield$this$rpcClient27, call;
9354
+ return _regeneratorRuntime().wrap(function _callee52$(_context52) {
9355
+ while (1) switch (_context52.prev = _context52.next) {
8448
9356
  case 0:
8449
- _context51.next = 2;
9357
+ _context52.next = 2;
8450
9358
  return this.rpcClient.simulateContract({
8451
9359
  abi: licensingModuleAbi,
8452
9360
  address: this.address,
@@ -8455,17 +9363,17 @@ var LicensingModuleClient = /*#__PURE__*/function (_LicensingModuleEvent) {
8455
9363
  args: [request.childIpId, request.licenseTokenIds, request.royaltyContext]
8456
9364
  });
8457
9365
  case 2:
8458
- _yield$this$rpcClient26 = _context51.sent;
8459
- call = _yield$this$rpcClient26.request;
8460
- _context51.next = 6;
9366
+ _yield$this$rpcClient27 = _context52.sent;
9367
+ call = _yield$this$rpcClient27.request;
9368
+ _context52.next = 6;
8461
9369
  return this.wallet.writeContract(call);
8462
9370
  case 6:
8463
- return _context51.abrupt("return", _context51.sent);
9371
+ return _context52.abrupt("return", _context52.sent);
8464
9372
  case 7:
8465
9373
  case "end":
8466
- return _context51.stop();
9374
+ return _context52.stop();
8467
9375
  }
8468
- }, _callee51, this);
9376
+ }, _callee52, this);
8469
9377
  }));
8470
9378
  function registerDerivativeWithLicenseTokens(_x43) {
8471
9379
  return _registerDerivativeWithLicenseTokens.apply(this, arguments);
@@ -8642,14 +9550,14 @@ var PiLicenseTemplateEventClient = /*#__PURE__*/function () {
8642
9550
  */
8643
9551
  return _createClass(PiLicenseTemplateEventClient, [{
8644
9552
  key: "watchDerivativeApprovedEvent",
8645
- value: function watchDerivativeApprovedEvent(_onLogs14) {
9553
+ value: function watchDerivativeApprovedEvent(_onLogs16) {
8646
9554
  return this.rpcClient.watchContractEvent({
8647
9555
  abi: piLicenseTemplateAbi,
8648
9556
  address: this.address,
8649
9557
  eventName: "DerivativeApproved",
8650
9558
  onLogs: function onLogs(evs) {
8651
9559
  evs.forEach(function (it) {
8652
- return _onLogs14(it.transactionHash, it.args);
9560
+ return _onLogs16(it.transactionHash, it.args);
8653
9561
  });
8654
9562
  }
8655
9563
  });
@@ -8662,11 +9570,11 @@ var PiLicenseTemplateEventClient = /*#__PURE__*/function () {
8662
9570
  key: "parseTxDerivativeApprovedEvent",
8663
9571
  value: function parseTxDerivativeApprovedEvent(txReceipt) {
8664
9572
  var targetLogs = [];
8665
- var _iterator14 = _createForOfIteratorHelper(txReceipt.logs),
8666
- _step14;
9573
+ var _iterator16 = _createForOfIteratorHelper(txReceipt.logs),
9574
+ _step16;
8667
9575
  try {
8668
- for (_iterator14.s(); !(_step14 = _iterator14.n()).done;) {
8669
- var log = _step14.value;
9576
+ for (_iterator16.s(); !(_step16 = _iterator16.n()).done;) {
9577
+ var log = _step16.value;
8670
9578
  try {
8671
9579
  var event = decodeEventLog({
8672
9580
  abi: piLicenseTemplateAbi,
@@ -8682,9 +9590,9 @@ var PiLicenseTemplateEventClient = /*#__PURE__*/function () {
8682
9590
  }
8683
9591
  }
8684
9592
  } catch (err) {
8685
- _iterator14.e(err);
9593
+ _iterator16.e(err);
8686
9594
  } finally {
8687
- _iterator14.f();
9595
+ _iterator16.f();
8688
9596
  }
8689
9597
  return targetLogs;
8690
9598
  }
@@ -8694,14 +9602,14 @@ var PiLicenseTemplateEventClient = /*#__PURE__*/function () {
8694
9602
  */
8695
9603
  }, {
8696
9604
  key: "watchInitializedEvent",
8697
- value: function watchInitializedEvent(_onLogs15) {
9605
+ value: function watchInitializedEvent(_onLogs17) {
8698
9606
  return this.rpcClient.watchContractEvent({
8699
9607
  abi: piLicenseTemplateAbi,
8700
9608
  address: this.address,
8701
9609
  eventName: "Initialized",
8702
9610
  onLogs: function onLogs(evs) {
8703
9611
  evs.forEach(function (it) {
8704
- return _onLogs15(it.transactionHash, it.args);
9612
+ return _onLogs17(it.transactionHash, it.args);
8705
9613
  });
8706
9614
  }
8707
9615
  });
@@ -8714,11 +9622,11 @@ var PiLicenseTemplateEventClient = /*#__PURE__*/function () {
8714
9622
  key: "parseTxInitializedEvent",
8715
9623
  value: function parseTxInitializedEvent(txReceipt) {
8716
9624
  var targetLogs = [];
8717
- var _iterator15 = _createForOfIteratorHelper(txReceipt.logs),
8718
- _step15;
9625
+ var _iterator17 = _createForOfIteratorHelper(txReceipt.logs),
9626
+ _step17;
8719
9627
  try {
8720
- for (_iterator15.s(); !(_step15 = _iterator15.n()).done;) {
8721
- var log = _step15.value;
9628
+ for (_iterator17.s(); !(_step17 = _iterator17.n()).done;) {
9629
+ var log = _step17.value;
8722
9630
  try {
8723
9631
  var event = decodeEventLog({
8724
9632
  abi: piLicenseTemplateAbi,
@@ -8734,9 +9642,9 @@ var PiLicenseTemplateEventClient = /*#__PURE__*/function () {
8734
9642
  }
8735
9643
  }
8736
9644
  } catch (err) {
8737
- _iterator15.e(err);
9645
+ _iterator17.e(err);
8738
9646
  } finally {
8739
- _iterator15.f();
9647
+ _iterator17.f();
8740
9648
  }
8741
9649
  return targetLogs;
8742
9650
  }
@@ -8746,14 +9654,14 @@ var PiLicenseTemplateEventClient = /*#__PURE__*/function () {
8746
9654
  */
8747
9655
  }, {
8748
9656
  key: "watchLicenseTermsRegisteredEvent",
8749
- value: function watchLicenseTermsRegisteredEvent(_onLogs16) {
9657
+ value: function watchLicenseTermsRegisteredEvent(_onLogs18) {
8750
9658
  return this.rpcClient.watchContractEvent({
8751
9659
  abi: piLicenseTemplateAbi,
8752
9660
  address: this.address,
8753
9661
  eventName: "LicenseTermsRegistered",
8754
9662
  onLogs: function onLogs(evs) {
8755
9663
  evs.forEach(function (it) {
8756
- return _onLogs16(it.transactionHash, it.args);
9664
+ return _onLogs18(it.transactionHash, it.args);
8757
9665
  });
8758
9666
  }
8759
9667
  });
@@ -8766,11 +9674,11 @@ var PiLicenseTemplateEventClient = /*#__PURE__*/function () {
8766
9674
  key: "parseTxLicenseTermsRegisteredEvent",
8767
9675
  value: function parseTxLicenseTermsRegisteredEvent(txReceipt) {
8768
9676
  var targetLogs = [];
8769
- var _iterator16 = _createForOfIteratorHelper(txReceipt.logs),
8770
- _step16;
9677
+ var _iterator18 = _createForOfIteratorHelper(txReceipt.logs),
9678
+ _step18;
8771
9679
  try {
8772
- for (_iterator16.s(); !(_step16 = _iterator16.n()).done;) {
8773
- var log = _step16.value;
9680
+ for (_iterator18.s(); !(_step18 = _iterator18.n()).done;) {
9681
+ var log = _step18.value;
8774
9682
  try {
8775
9683
  var event = decodeEventLog({
8776
9684
  abi: piLicenseTemplateAbi,
@@ -8786,9 +9694,9 @@ var PiLicenseTemplateEventClient = /*#__PURE__*/function () {
8786
9694
  }
8787
9695
  }
8788
9696
  } catch (err) {
8789
- _iterator16.e(err);
9697
+ _iterator18.e(err);
8790
9698
  } finally {
8791
- _iterator16.f();
9699
+ _iterator18.f();
8792
9700
  }
8793
9701
  return targetLogs;
8794
9702
  }
@@ -8814,23 +9722,23 @@ var PiLicenseTemplateReadOnlyClient = /*#__PURE__*/function (_PiLicenseTemplateE
8814
9722
  return _createClass(PiLicenseTemplateReadOnlyClient, [{
8815
9723
  key: "accessController",
8816
9724
  value: (function () {
8817
- var _accessController = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee53() {
8818
- return _regeneratorRuntime().wrap(function _callee53$(_context53) {
8819
- while (1) switch (_context53.prev = _context53.next) {
9725
+ var _accessController = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee54() {
9726
+ return _regeneratorRuntime().wrap(function _callee54$(_context54) {
9727
+ while (1) switch (_context54.prev = _context54.next) {
8820
9728
  case 0:
8821
- _context53.next = 2;
9729
+ _context54.next = 2;
8822
9730
  return this.rpcClient.readContract({
8823
9731
  abi: piLicenseTemplateAbi,
8824
9732
  address: this.address,
8825
9733
  functionName: "ACCESS_CONTROLLER"
8826
9734
  });
8827
9735
  case 2:
8828
- return _context53.abrupt("return", _context53.sent);
9736
+ return _context54.abrupt("return", _context54.sent);
8829
9737
  case 3:
8830
9738
  case "end":
8831
- return _context53.stop();
9739
+ return _context54.stop();
8832
9740
  }
8833
- }, _callee53, this);
9741
+ }, _callee54, this);
8834
9742
  }));
8835
9743
  function accessController() {
8836
9744
  return _accessController.apply(this, arguments);
@@ -8847,23 +9755,23 @@ var PiLicenseTemplateReadOnlyClient = /*#__PURE__*/function (_PiLicenseTemplateE
8847
9755
  }, {
8848
9756
  key: "ipAccountRegistry",
8849
9757
  value: (function () {
8850
- var _ipAccountRegistry = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee54() {
8851
- return _regeneratorRuntime().wrap(function _callee54$(_context54) {
8852
- while (1) switch (_context54.prev = _context54.next) {
9758
+ var _ipAccountRegistry = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee55() {
9759
+ return _regeneratorRuntime().wrap(function _callee55$(_context55) {
9760
+ while (1) switch (_context55.prev = _context55.next) {
8853
9761
  case 0:
8854
- _context54.next = 2;
9762
+ _context55.next = 2;
8855
9763
  return this.rpcClient.readContract({
8856
9764
  abi: piLicenseTemplateAbi,
8857
9765
  address: this.address,
8858
9766
  functionName: "IP_ACCOUNT_REGISTRY"
8859
9767
  });
8860
9768
  case 2:
8861
- return _context54.abrupt("return", _context54.sent);
9769
+ return _context55.abrupt("return", _context55.sent);
8862
9770
  case 3:
8863
9771
  case "end":
8864
- return _context54.stop();
9772
+ return _context55.stop();
8865
9773
  }
8866
- }, _callee54, this);
9774
+ }, _callee55, this);
8867
9775
  }));
8868
9776
  function ipAccountRegistry() {
8869
9777
  return _ipAccountRegistry.apply(this, arguments);
@@ -8880,23 +9788,23 @@ var PiLicenseTemplateReadOnlyClient = /*#__PURE__*/function (_PiLicenseTemplateE
8880
9788
  }, {
8881
9789
  key: "licenseNft",
8882
9790
  value: (function () {
8883
- var _licenseNft = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee55() {
8884
- return _regeneratorRuntime().wrap(function _callee55$(_context55) {
8885
- while (1) switch (_context55.prev = _context55.next) {
9791
+ var _licenseNft = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee56() {
9792
+ return _regeneratorRuntime().wrap(function _callee56$(_context56) {
9793
+ while (1) switch (_context56.prev = _context56.next) {
8886
9794
  case 0:
8887
- _context55.next = 2;
9795
+ _context56.next = 2;
8888
9796
  return this.rpcClient.readContract({
8889
9797
  abi: piLicenseTemplateAbi,
8890
9798
  address: this.address,
8891
9799
  functionName: "LICENSE_NFT"
8892
9800
  });
8893
9801
  case 2:
8894
- return _context55.abrupt("return", _context55.sent);
9802
+ return _context56.abrupt("return", _context56.sent);
8895
9803
  case 3:
8896
9804
  case "end":
8897
- return _context55.stop();
9805
+ return _context56.stop();
8898
9806
  }
8899
- }, _callee55, this);
9807
+ }, _callee56, this);
8900
9808
  }));
8901
9809
  function licenseNft() {
8902
9810
  return _licenseNft.apply(this, arguments);
@@ -8913,23 +9821,23 @@ var PiLicenseTemplateReadOnlyClient = /*#__PURE__*/function (_PiLicenseTemplateE
8913
9821
  }, {
8914
9822
  key: "licenseRegistry",
8915
9823
  value: (function () {
8916
- var _licenseRegistry = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee56() {
8917
- return _regeneratorRuntime().wrap(function _callee56$(_context56) {
8918
- while (1) switch (_context56.prev = _context56.next) {
9824
+ var _licenseRegistry = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee57() {
9825
+ return _regeneratorRuntime().wrap(function _callee57$(_context57) {
9826
+ while (1) switch (_context57.prev = _context57.next) {
8919
9827
  case 0:
8920
- _context56.next = 2;
9828
+ _context57.next = 2;
8921
9829
  return this.rpcClient.readContract({
8922
9830
  abi: piLicenseTemplateAbi,
8923
9831
  address: this.address,
8924
9832
  functionName: "LICENSE_REGISTRY"
8925
9833
  });
8926
9834
  case 2:
8927
- return _context56.abrupt("return", _context56.sent);
9835
+ return _context57.abrupt("return", _context57.sent);
8928
9836
  case 3:
8929
9837
  case "end":
8930
- return _context56.stop();
9838
+ return _context57.stop();
8931
9839
  }
8932
- }, _callee56, this);
9840
+ }, _callee57, this);
8933
9841
  }));
8934
9842
  function licenseRegistry() {
8935
9843
  return _licenseRegistry.apply(this, arguments);
@@ -8946,23 +9854,23 @@ var PiLicenseTemplateReadOnlyClient = /*#__PURE__*/function (_PiLicenseTemplateE
8946
9854
  }, {
8947
9855
  key: "royaltyModule",
8948
9856
  value: (function () {
8949
- var _royaltyModule = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee57() {
8950
- return _regeneratorRuntime().wrap(function _callee57$(_context57) {
8951
- while (1) switch (_context57.prev = _context57.next) {
9857
+ var _royaltyModule = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee58() {
9858
+ return _regeneratorRuntime().wrap(function _callee58$(_context58) {
9859
+ while (1) switch (_context58.prev = _context58.next) {
8952
9860
  case 0:
8953
- _context57.next = 2;
9861
+ _context58.next = 2;
8954
9862
  return this.rpcClient.readContract({
8955
9863
  abi: piLicenseTemplateAbi,
8956
9864
  address: this.address,
8957
9865
  functionName: "ROYALTY_MODULE"
8958
9866
  });
8959
9867
  case 2:
8960
- return _context57.abrupt("return", _context57.sent);
9868
+ return _context58.abrupt("return", _context58.sent);
8961
9869
  case 3:
8962
9870
  case "end":
8963
- return _context57.stop();
9871
+ return _context58.stop();
8964
9872
  }
8965
- }, _callee57, this);
9873
+ }, _callee58, this);
8966
9874
  }));
8967
9875
  function royaltyModule() {
8968
9876
  return _royaltyModule.apply(this, arguments);
@@ -8979,11 +9887,11 @@ var PiLicenseTemplateReadOnlyClient = /*#__PURE__*/function (_PiLicenseTemplateE
8979
9887
  }, {
8980
9888
  key: "exists",
8981
9889
  value: (function () {
8982
- var _exists2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee58(request) {
8983
- return _regeneratorRuntime().wrap(function _callee58$(_context58) {
8984
- while (1) switch (_context58.prev = _context58.next) {
9890
+ var _exists2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee59(request) {
9891
+ return _regeneratorRuntime().wrap(function _callee59$(_context59) {
9892
+ while (1) switch (_context59.prev = _context59.next) {
8985
9893
  case 0:
8986
- _context58.next = 2;
9894
+ _context59.next = 2;
8987
9895
  return this.rpcClient.readContract({
8988
9896
  abi: piLicenseTemplateAbi,
8989
9897
  address: this.address,
@@ -8991,12 +9899,12 @@ var PiLicenseTemplateReadOnlyClient = /*#__PURE__*/function (_PiLicenseTemplateE
8991
9899
  args: [request.licenseTermsId]
8992
9900
  });
8993
9901
  case 2:
8994
- return _context58.abrupt("return", _context58.sent);
9902
+ return _context59.abrupt("return", _context59.sent);
8995
9903
  case 3:
8996
9904
  case "end":
8997
- return _context58.stop();
9905
+ return _context59.stop();
8998
9906
  }
8999
- }, _callee58, this);
9907
+ }, _callee59, this);
9000
9908
  }));
9001
9909
  function exists(_x45) {
9002
9910
  return _exists2.apply(this, arguments);
@@ -9013,11 +9921,11 @@ var PiLicenseTemplateReadOnlyClient = /*#__PURE__*/function (_PiLicenseTemplateE
9013
9921
  }, {
9014
9922
  key: "getEarlierExpireTime",
9015
9923
  value: (function () {
9016
- var _getEarlierExpireTime = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee59(request) {
9017
- return _regeneratorRuntime().wrap(function _callee59$(_context59) {
9018
- while (1) switch (_context59.prev = _context59.next) {
9924
+ var _getEarlierExpireTime = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee60(request) {
9925
+ return _regeneratorRuntime().wrap(function _callee60$(_context60) {
9926
+ while (1) switch (_context60.prev = _context60.next) {
9019
9927
  case 0:
9020
- _context59.next = 2;
9928
+ _context60.next = 2;
9021
9929
  return this.rpcClient.readContract({
9022
9930
  abi: piLicenseTemplateAbi,
9023
9931
  address: this.address,
@@ -9025,12 +9933,12 @@ var PiLicenseTemplateReadOnlyClient = /*#__PURE__*/function (_PiLicenseTemplateE
9025
9933
  args: [request.licenseTermsIds, request.start]
9026
9934
  });
9027
9935
  case 2:
9028
- return _context59.abrupt("return", _context59.sent);
9936
+ return _context60.abrupt("return", _context60.sent);
9029
9937
  case 3:
9030
9938
  case "end":
9031
- return _context59.stop();
9939
+ return _context60.stop();
9032
9940
  }
9033
- }, _callee59, this);
9941
+ }, _callee60, this);
9034
9942
  }));
9035
9943
  function getEarlierExpireTime(_x46) {
9036
9944
  return _getEarlierExpireTime.apply(this, arguments);
@@ -9047,11 +9955,11 @@ var PiLicenseTemplateReadOnlyClient = /*#__PURE__*/function (_PiLicenseTemplateE
9047
9955
  }, {
9048
9956
  key: "getExpireTime",
9049
9957
  value: (function () {
9050
- var _getExpireTime2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee60(request) {
9051
- return _regeneratorRuntime().wrap(function _callee60$(_context60) {
9052
- while (1) switch (_context60.prev = _context60.next) {
9958
+ var _getExpireTime2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee61(request) {
9959
+ return _regeneratorRuntime().wrap(function _callee61$(_context61) {
9960
+ while (1) switch (_context61.prev = _context61.next) {
9053
9961
  case 0:
9054
- _context60.next = 2;
9962
+ _context61.next = 2;
9055
9963
  return this.rpcClient.readContract({
9056
9964
  abi: piLicenseTemplateAbi,
9057
9965
  address: this.address,
@@ -9059,12 +9967,12 @@ var PiLicenseTemplateReadOnlyClient = /*#__PURE__*/function (_PiLicenseTemplateE
9059
9967
  args: [request.licenseTermsId, request.start]
9060
9968
  });
9061
9969
  case 2:
9062
- return _context60.abrupt("return", _context60.sent);
9970
+ return _context61.abrupt("return", _context61.sent);
9063
9971
  case 3:
9064
9972
  case "end":
9065
- return _context60.stop();
9973
+ return _context61.stop();
9066
9974
  }
9067
- }, _callee60, this);
9975
+ }, _callee61, this);
9068
9976
  }));
9069
9977
  function getExpireTime(_x47) {
9070
9978
  return _getExpireTime2.apply(this, arguments);
@@ -9081,12 +9989,12 @@ var PiLicenseTemplateReadOnlyClient = /*#__PURE__*/function (_PiLicenseTemplateE
9081
9989
  }, {
9082
9990
  key: "getLicenseTermsId",
9083
9991
  value: (function () {
9084
- var _getLicenseTermsId = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee61(request) {
9992
+ var _getLicenseTermsId = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee62(request) {
9085
9993
  var result;
9086
- return _regeneratorRuntime().wrap(function _callee61$(_context61) {
9087
- while (1) switch (_context61.prev = _context61.next) {
9994
+ return _regeneratorRuntime().wrap(function _callee62$(_context62) {
9995
+ while (1) switch (_context62.prev = _context62.next) {
9088
9996
  case 0:
9089
- _context61.next = 2;
9997
+ _context62.next = 2;
9090
9998
  return this.rpcClient.readContract({
9091
9999
  abi: piLicenseTemplateAbi,
9092
10000
  address: this.address,
@@ -9094,15 +10002,15 @@ var PiLicenseTemplateReadOnlyClient = /*#__PURE__*/function (_PiLicenseTemplateE
9094
10002
  args: [request.terms]
9095
10003
  });
9096
10004
  case 2:
9097
- result = _context61.sent;
9098
- return _context61.abrupt("return", {
10005
+ result = _context62.sent;
10006
+ return _context62.abrupt("return", {
9099
10007
  selectedLicenseTermsId: result
9100
10008
  });
9101
10009
  case 4:
9102
10010
  case "end":
9103
- return _context61.stop();
10011
+ return _context62.stop();
9104
10012
  }
9105
- }, _callee61, this);
10013
+ }, _callee62, this);
9106
10014
  }));
9107
10015
  function getLicenseTermsId(_x48) {
9108
10016
  return _getLicenseTermsId.apply(this, arguments);
@@ -9119,23 +10027,23 @@ var PiLicenseTemplateReadOnlyClient = /*#__PURE__*/function (_PiLicenseTemplateE
9119
10027
  }, {
9120
10028
  key: "getMetadataUri",
9121
10029
  value: (function () {
9122
- var _getMetadataUri = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee62() {
9123
- return _regeneratorRuntime().wrap(function _callee62$(_context62) {
9124
- while (1) switch (_context62.prev = _context62.next) {
10030
+ var _getMetadataUri = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee63() {
10031
+ return _regeneratorRuntime().wrap(function _callee63$(_context63) {
10032
+ while (1) switch (_context63.prev = _context63.next) {
9125
10033
  case 0:
9126
- _context62.next = 2;
10034
+ _context63.next = 2;
9127
10035
  return this.rpcClient.readContract({
9128
10036
  abi: piLicenseTemplateAbi,
9129
10037
  address: this.address,
9130
10038
  functionName: "getMetadataURI"
9131
10039
  });
9132
10040
  case 2:
9133
- return _context62.abrupt("return", _context62.sent);
10041
+ return _context63.abrupt("return", _context63.sent);
9134
10042
  case 3:
9135
10043
  case "end":
9136
- return _context62.stop();
10044
+ return _context63.stop();
9137
10045
  }
9138
- }, _callee62, this);
10046
+ }, _callee63, this);
9139
10047
  }));
9140
10048
  function getMetadataUri() {
9141
10049
  return _getMetadataUri.apply(this, arguments);
@@ -9152,12 +10060,12 @@ var PiLicenseTemplateReadOnlyClient = /*#__PURE__*/function (_PiLicenseTemplateE
9152
10060
  }, {
9153
10061
  key: "getRoyaltyPolicy",
9154
10062
  value: (function () {
9155
- var _getRoyaltyPolicy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee63(request) {
10063
+ var _getRoyaltyPolicy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee64(request) {
9156
10064
  var result;
9157
- return _regeneratorRuntime().wrap(function _callee63$(_context63) {
9158
- while (1) switch (_context63.prev = _context63.next) {
10065
+ return _regeneratorRuntime().wrap(function _callee64$(_context64) {
10066
+ while (1) switch (_context64.prev = _context64.next) {
9159
10067
  case 0:
9160
- _context63.next = 2;
10068
+ _context64.next = 2;
9161
10069
  return this.rpcClient.readContract({
9162
10070
  abi: piLicenseTemplateAbi,
9163
10071
  address: this.address,
@@ -9165,8 +10073,8 @@ var PiLicenseTemplateReadOnlyClient = /*#__PURE__*/function (_PiLicenseTemplateE
9165
10073
  args: [request.licenseTermsId]
9166
10074
  });
9167
10075
  case 2:
9168
- result = _context63.sent;
9169
- return _context63.abrupt("return", {
10076
+ result = _context64.sent;
10077
+ return _context64.abrupt("return", {
9170
10078
  royaltyPolicy: result[0],
9171
10079
  royaltyData: result[1],
9172
10080
  mintingFee: result[2],
@@ -9174,9 +10082,9 @@ var PiLicenseTemplateReadOnlyClient = /*#__PURE__*/function (_PiLicenseTemplateE
9174
10082
  });
9175
10083
  case 4:
9176
10084
  case "end":
9177
- return _context63.stop();
10085
+ return _context64.stop();
9178
10086
  }
9179
- }, _callee63, this);
10087
+ }, _callee64, this);
9180
10088
  }));
9181
10089
  function getRoyaltyPolicy(_x49) {
9182
10090
  return _getRoyaltyPolicy.apply(this, arguments);
@@ -9193,11 +10101,11 @@ var PiLicenseTemplateReadOnlyClient = /*#__PURE__*/function (_PiLicenseTemplateE
9193
10101
  }, {
9194
10102
  key: "isDerivativeApproved",
9195
10103
  value: (function () {
9196
- var _isDerivativeApproved = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee64(request) {
9197
- return _regeneratorRuntime().wrap(function _callee64$(_context64) {
9198
- while (1) switch (_context64.prev = _context64.next) {
10104
+ var _isDerivativeApproved = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee65(request) {
10105
+ return _regeneratorRuntime().wrap(function _callee65$(_context65) {
10106
+ while (1) switch (_context65.prev = _context65.next) {
9199
10107
  case 0:
9200
- _context64.next = 2;
10108
+ _context65.next = 2;
9201
10109
  return this.rpcClient.readContract({
9202
10110
  abi: piLicenseTemplateAbi,
9203
10111
  address: this.address,
@@ -9205,12 +10113,12 @@ var PiLicenseTemplateReadOnlyClient = /*#__PURE__*/function (_PiLicenseTemplateE
9205
10113
  args: [request.licenseTokenId, request.childIpId]
9206
10114
  });
9207
10115
  case 2:
9208
- return _context64.abrupt("return", _context64.sent);
10116
+ return _context65.abrupt("return", _context65.sent);
9209
10117
  case 3:
9210
10118
  case "end":
9211
- return _context64.stop();
10119
+ return _context65.stop();
9212
10120
  }
9213
- }, _callee64, this);
10121
+ }, _callee65, this);
9214
10122
  }));
9215
10123
  function isDerivativeApproved(_x50) {
9216
10124
  return _isDerivativeApproved.apply(this, arguments);
@@ -9227,11 +10135,11 @@ var PiLicenseTemplateReadOnlyClient = /*#__PURE__*/function (_PiLicenseTemplateE
9227
10135
  }, {
9228
10136
  key: "isLicenseTransferable",
9229
10137
  value: (function () {
9230
- var _isLicenseTransferable = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee65(request) {
9231
- return _regeneratorRuntime().wrap(function _callee65$(_context65) {
9232
- while (1) switch (_context65.prev = _context65.next) {
10138
+ var _isLicenseTransferable = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee66(request) {
10139
+ return _regeneratorRuntime().wrap(function _callee66$(_context66) {
10140
+ while (1) switch (_context66.prev = _context66.next) {
9233
10141
  case 0:
9234
- _context65.next = 2;
10142
+ _context66.next = 2;
9235
10143
  return this.rpcClient.readContract({
9236
10144
  abi: piLicenseTemplateAbi,
9237
10145
  address: this.address,
@@ -9239,12 +10147,12 @@ var PiLicenseTemplateReadOnlyClient = /*#__PURE__*/function (_PiLicenseTemplateE
9239
10147
  args: [request.licenseTermsId]
9240
10148
  });
9241
10149
  case 2:
9242
- return _context65.abrupt("return", _context65.sent);
10150
+ return _context66.abrupt("return", _context66.sent);
9243
10151
  case 3:
9244
10152
  case "end":
9245
- return _context65.stop();
10153
+ return _context66.stop();
9246
10154
  }
9247
- }, _callee65, this);
10155
+ }, _callee66, this);
9248
10156
  }));
9249
10157
  function isLicenseTransferable(_x51) {
9250
10158
  return _isLicenseTransferable.apply(this, arguments);
@@ -9261,23 +10169,23 @@ var PiLicenseTemplateReadOnlyClient = /*#__PURE__*/function (_PiLicenseTemplateE
9261
10169
  }, {
9262
10170
  key: "name",
9263
10171
  value: (function () {
9264
- var _name = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee66() {
9265
- return _regeneratorRuntime().wrap(function _callee66$(_context66) {
9266
- while (1) switch (_context66.prev = _context66.next) {
10172
+ var _name = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee67() {
10173
+ return _regeneratorRuntime().wrap(function _callee67$(_context67) {
10174
+ while (1) switch (_context67.prev = _context67.next) {
9267
10175
  case 0:
9268
- _context66.next = 2;
10176
+ _context67.next = 2;
9269
10177
  return this.rpcClient.readContract({
9270
10178
  abi: piLicenseTemplateAbi,
9271
10179
  address: this.address,
9272
10180
  functionName: "name"
9273
10181
  });
9274
10182
  case 2:
9275
- return _context66.abrupt("return", _context66.sent);
10183
+ return _context67.abrupt("return", _context67.sent);
9276
10184
  case 3:
9277
10185
  case "end":
9278
- return _context66.stop();
10186
+ return _context67.stop();
9279
10187
  }
9280
- }, _callee66, this);
10188
+ }, _callee67, this);
9281
10189
  }));
9282
10190
  function name() {
9283
10191
  return _name.apply(this, arguments);
@@ -9294,11 +10202,11 @@ var PiLicenseTemplateReadOnlyClient = /*#__PURE__*/function (_PiLicenseTemplateE
9294
10202
  }, {
9295
10203
  key: "supportsInterface",
9296
10204
  value: (function () {
9297
- var _supportsInterface = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee67(request) {
9298
- return _regeneratorRuntime().wrap(function _callee67$(_context67) {
9299
- while (1) switch (_context67.prev = _context67.next) {
10205
+ var _supportsInterface = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee68(request) {
10206
+ return _regeneratorRuntime().wrap(function _callee68$(_context68) {
10207
+ while (1) switch (_context68.prev = _context68.next) {
9300
10208
  case 0:
9301
- _context67.next = 2;
10209
+ _context68.next = 2;
9302
10210
  return this.rpcClient.readContract({
9303
10211
  abi: piLicenseTemplateAbi,
9304
10212
  address: this.address,
@@ -9306,12 +10214,12 @@ var PiLicenseTemplateReadOnlyClient = /*#__PURE__*/function (_PiLicenseTemplateE
9306
10214
  args: [request.interfaceId]
9307
10215
  });
9308
10216
  case 2:
9309
- return _context67.abrupt("return", _context67.sent);
10217
+ return _context68.abrupt("return", _context68.sent);
9310
10218
  case 3:
9311
10219
  case "end":
9312
- return _context67.stop();
10220
+ return _context68.stop();
9313
10221
  }
9314
- }, _callee67, this);
10222
+ }, _callee68, this);
9315
10223
  }));
9316
10224
  function supportsInterface(_x52) {
9317
10225
  return _supportsInterface.apply(this, arguments);
@@ -9328,11 +10236,11 @@ var PiLicenseTemplateReadOnlyClient = /*#__PURE__*/function (_PiLicenseTemplateE
9328
10236
  }, {
9329
10237
  key: "toJson",
9330
10238
  value: (function () {
9331
- var _toJson = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee68(request) {
9332
- return _regeneratorRuntime().wrap(function _callee68$(_context68) {
9333
- while (1) switch (_context68.prev = _context68.next) {
10239
+ var _toJson = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee69(request) {
10240
+ return _regeneratorRuntime().wrap(function _callee69$(_context69) {
10241
+ while (1) switch (_context69.prev = _context69.next) {
9334
10242
  case 0:
9335
- _context68.next = 2;
10243
+ _context69.next = 2;
9336
10244
  return this.rpcClient.readContract({
9337
10245
  abi: piLicenseTemplateAbi,
9338
10246
  address: this.address,
@@ -9340,12 +10248,12 @@ var PiLicenseTemplateReadOnlyClient = /*#__PURE__*/function (_PiLicenseTemplateE
9340
10248
  args: [request.licenseTermsId]
9341
10249
  });
9342
10250
  case 2:
9343
- return _context68.abrupt("return", _context68.sent);
10251
+ return _context69.abrupt("return", _context69.sent);
9344
10252
  case 3:
9345
10253
  case "end":
9346
- return _context68.stop();
10254
+ return _context69.stop();
9347
10255
  }
9348
- }, _callee68, this);
10256
+ }, _callee69, this);
9349
10257
  }));
9350
10258
  function toJson(_x53) {
9351
10259
  return _toJson.apply(this, arguments);
@@ -9362,23 +10270,23 @@ var PiLicenseTemplateReadOnlyClient = /*#__PURE__*/function (_PiLicenseTemplateE
9362
10270
  }, {
9363
10271
  key: "totalRegisteredLicenseTerms",
9364
10272
  value: (function () {
9365
- var _totalRegisteredLicenseTerms = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee69() {
9366
- return _regeneratorRuntime().wrap(function _callee69$(_context69) {
9367
- while (1) switch (_context69.prev = _context69.next) {
10273
+ var _totalRegisteredLicenseTerms = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee70() {
10274
+ return _regeneratorRuntime().wrap(function _callee70$(_context70) {
10275
+ while (1) switch (_context70.prev = _context70.next) {
9368
10276
  case 0:
9369
- _context69.next = 2;
10277
+ _context70.next = 2;
9370
10278
  return this.rpcClient.readContract({
9371
10279
  abi: piLicenseTemplateAbi,
9372
10280
  address: this.address,
9373
10281
  functionName: "totalRegisteredLicenseTerms"
9374
10282
  });
9375
10283
  case 2:
9376
- return _context69.abrupt("return", _context69.sent);
10284
+ return _context70.abrupt("return", _context70.sent);
9377
10285
  case 3:
9378
10286
  case "end":
9379
- return _context69.stop();
10287
+ return _context70.stop();
9380
10288
  }
9381
- }, _callee69, this);
10289
+ }, _callee70, this);
9382
10290
  }));
9383
10291
  function totalRegisteredLicenseTerms() {
9384
10292
  return _totalRegisteredLicenseTerms.apply(this, arguments);
@@ -9395,11 +10303,11 @@ var PiLicenseTemplateReadOnlyClient = /*#__PURE__*/function (_PiLicenseTemplateE
9395
10303
  }, {
9396
10304
  key: "verifyCompatibleLicenses",
9397
10305
  value: (function () {
9398
- var _verifyCompatibleLicenses = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee70(request) {
9399
- return _regeneratorRuntime().wrap(function _callee70$(_context70) {
9400
- while (1) switch (_context70.prev = _context70.next) {
10306
+ var _verifyCompatibleLicenses = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee71(request) {
10307
+ return _regeneratorRuntime().wrap(function _callee71$(_context71) {
10308
+ while (1) switch (_context71.prev = _context71.next) {
9401
10309
  case 0:
9402
- _context70.next = 2;
10310
+ _context71.next = 2;
9403
10311
  return this.rpcClient.readContract({
9404
10312
  abi: piLicenseTemplateAbi,
9405
10313
  address: this.address,
@@ -9407,12 +10315,12 @@ var PiLicenseTemplateReadOnlyClient = /*#__PURE__*/function (_PiLicenseTemplateE
9407
10315
  args: [request.licenseTermsIds]
9408
10316
  });
9409
10317
  case 2:
9410
- return _context70.abrupt("return", _context70.sent);
10318
+ return _context71.abrupt("return", _context71.sent);
9411
10319
  case 3:
9412
10320
  case "end":
9413
- return _context70.stop();
10321
+ return _context71.stop();
9414
10322
  }
9415
- }, _callee70, this);
10323
+ }, _callee71, this);
9416
10324
  }));
9417
10325
  function verifyCompatibleLicenses(_x54) {
9418
10326
  return _verifyCompatibleLicenses.apply(this, arguments);
@@ -9444,12 +10352,12 @@ var PiLicenseTemplateClient = /*#__PURE__*/function (_PiLicenseTemplateRea) {
9444
10352
  return _createClass(PiLicenseTemplateClient, [{
9445
10353
  key: "initialize",
9446
10354
  value: (function () {
9447
- var _initialize2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee71(request) {
9448
- var _yield$this$rpcClient27, call;
9449
- return _regeneratorRuntime().wrap(function _callee71$(_context71) {
9450
- while (1) switch (_context71.prev = _context71.next) {
10355
+ var _initialize2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee72(request) {
10356
+ var _yield$this$rpcClient28, call;
10357
+ return _regeneratorRuntime().wrap(function _callee72$(_context72) {
10358
+ while (1) switch (_context72.prev = _context72.next) {
9451
10359
  case 0:
9452
- _context71.next = 2;
10360
+ _context72.next = 2;
9453
10361
  return this.rpcClient.simulateContract({
9454
10362
  abi: piLicenseTemplateAbi,
9455
10363
  address: this.address,
@@ -9458,17 +10366,17 @@ var PiLicenseTemplateClient = /*#__PURE__*/function (_PiLicenseTemplateRea) {
9458
10366
  args: [request.name, request.metadataURI]
9459
10367
  });
9460
10368
  case 2:
9461
- _yield$this$rpcClient27 = _context71.sent;
9462
- call = _yield$this$rpcClient27.request;
9463
- _context71.next = 6;
10369
+ _yield$this$rpcClient28 = _context72.sent;
10370
+ call = _yield$this$rpcClient28.request;
10371
+ _context72.next = 6;
9464
10372
  return this.wallet.writeContract(call);
9465
10373
  case 6:
9466
- return _context71.abrupt("return", _context71.sent);
10374
+ return _context72.abrupt("return", _context72.sent);
9467
10375
  case 7:
9468
10376
  case "end":
9469
- return _context71.stop();
10377
+ return _context72.stop();
9470
10378
  }
9471
- }, _callee71, this);
10379
+ }, _callee72, this);
9472
10380
  }));
9473
10381
  function initialize(_x55) {
9474
10382
  return _initialize2.apply(this, arguments);
@@ -9485,12 +10393,12 @@ var PiLicenseTemplateClient = /*#__PURE__*/function (_PiLicenseTemplateRea) {
9485
10393
  }, {
9486
10394
  key: "registerLicenseTerms",
9487
10395
  value: (function () {
9488
- var _registerLicenseTerms = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee72(request) {
9489
- var _yield$this$rpcClient28, call;
9490
- return _regeneratorRuntime().wrap(function _callee72$(_context72) {
9491
- while (1) switch (_context72.prev = _context72.next) {
10396
+ var _registerLicenseTerms = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee73(request) {
10397
+ var _yield$this$rpcClient29, call;
10398
+ return _regeneratorRuntime().wrap(function _callee73$(_context73) {
10399
+ while (1) switch (_context73.prev = _context73.next) {
9492
10400
  case 0:
9493
- _context72.next = 2;
10401
+ _context73.next = 2;
9494
10402
  return this.rpcClient.simulateContract({
9495
10403
  abi: piLicenseTemplateAbi,
9496
10404
  address: this.address,
@@ -9499,17 +10407,17 @@ var PiLicenseTemplateClient = /*#__PURE__*/function (_PiLicenseTemplateRea) {
9499
10407
  args: [request.terms]
9500
10408
  });
9501
10409
  case 2:
9502
- _yield$this$rpcClient28 = _context72.sent;
9503
- call = _yield$this$rpcClient28.request;
9504
- _context72.next = 6;
10410
+ _yield$this$rpcClient29 = _context73.sent;
10411
+ call = _yield$this$rpcClient29.request;
10412
+ _context73.next = 6;
9505
10413
  return this.wallet.writeContract(call);
9506
10414
  case 6:
9507
- return _context72.abrupt("return", _context72.sent);
10415
+ return _context73.abrupt("return", _context73.sent);
9508
10416
  case 7:
9509
10417
  case "end":
9510
- return _context72.stop();
10418
+ return _context73.stop();
9511
10419
  }
9512
- }, _callee72, this);
10420
+ }, _callee73, this);
9513
10421
  }));
9514
10422
  function registerLicenseTerms(_x56) {
9515
10423
  return _registerLicenseTerms.apply(this, arguments);
@@ -9526,12 +10434,12 @@ var PiLicenseTemplateClient = /*#__PURE__*/function (_PiLicenseTemplateRea) {
9526
10434
  }, {
9527
10435
  key: "setApproval",
9528
10436
  value: (function () {
9529
- var _setApproval = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee73(request) {
9530
- var _yield$this$rpcClient29, call;
9531
- return _regeneratorRuntime().wrap(function _callee73$(_context73) {
9532
- while (1) switch (_context73.prev = _context73.next) {
10437
+ var _setApproval = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee74(request) {
10438
+ var _yield$this$rpcClient30, call;
10439
+ return _regeneratorRuntime().wrap(function _callee74$(_context74) {
10440
+ while (1) switch (_context74.prev = _context74.next) {
9533
10441
  case 0:
9534
- _context73.next = 2;
10442
+ _context74.next = 2;
9535
10443
  return this.rpcClient.simulateContract({
9536
10444
  abi: piLicenseTemplateAbi,
9537
10445
  address: this.address,
@@ -9540,17 +10448,17 @@ var PiLicenseTemplateClient = /*#__PURE__*/function (_PiLicenseTemplateRea) {
9540
10448
  args: [request.licenseTokenId, request.childIpId, request.approved]
9541
10449
  });
9542
10450
  case 2:
9543
- _yield$this$rpcClient29 = _context73.sent;
9544
- call = _yield$this$rpcClient29.request;
9545
- _context73.next = 6;
10451
+ _yield$this$rpcClient30 = _context74.sent;
10452
+ call = _yield$this$rpcClient30.request;
10453
+ _context74.next = 6;
9546
10454
  return this.wallet.writeContract(call);
9547
10455
  case 6:
9548
- return _context73.abrupt("return", _context73.sent);
10456
+ return _context74.abrupt("return", _context74.sent);
9549
10457
  case 7:
9550
10458
  case "end":
9551
- return _context73.stop();
10459
+ return _context74.stop();
9552
10460
  }
9553
- }, _callee73, this);
10461
+ }, _callee74, this);
9554
10462
  }));
9555
10463
  function setApproval(_x57) {
9556
10464
  return _setApproval.apply(this, arguments);
@@ -9567,12 +10475,12 @@ var PiLicenseTemplateClient = /*#__PURE__*/function (_PiLicenseTemplateRea) {
9567
10475
  }, {
9568
10476
  key: "verifyMintLicenseToken",
9569
10477
  value: (function () {
9570
- var _verifyMintLicenseToken2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee74(request) {
9571
- var _yield$this$rpcClient30, call;
9572
- return _regeneratorRuntime().wrap(function _callee74$(_context74) {
9573
- while (1) switch (_context74.prev = _context74.next) {
10478
+ var _verifyMintLicenseToken2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee75(request) {
10479
+ var _yield$this$rpcClient31, call;
10480
+ return _regeneratorRuntime().wrap(function _callee75$(_context75) {
10481
+ while (1) switch (_context75.prev = _context75.next) {
9574
10482
  case 0:
9575
- _context74.next = 2;
10483
+ _context75.next = 2;
9576
10484
  return this.rpcClient.simulateContract({
9577
10485
  abi: piLicenseTemplateAbi,
9578
10486
  address: this.address,
@@ -9581,17 +10489,17 @@ var PiLicenseTemplateClient = /*#__PURE__*/function (_PiLicenseTemplateRea) {
9581
10489
  args: [request[0], request[1], request[2], request[3]]
9582
10490
  });
9583
10491
  case 2:
9584
- _yield$this$rpcClient30 = _context74.sent;
9585
- call = _yield$this$rpcClient30.request;
9586
- _context74.next = 6;
10492
+ _yield$this$rpcClient31 = _context75.sent;
10493
+ call = _yield$this$rpcClient31.request;
10494
+ _context75.next = 6;
9587
10495
  return this.wallet.writeContract(call);
9588
10496
  case 6:
9589
- return _context74.abrupt("return", _context74.sent);
10497
+ return _context75.abrupt("return", _context75.sent);
9590
10498
  case 7:
9591
10499
  case "end":
9592
- return _context74.stop();
10500
+ return _context75.stop();
9593
10501
  }
9594
- }, _callee74, this);
10502
+ }, _callee75, this);
9595
10503
  }));
9596
10504
  function verifyMintLicenseToken(_x58) {
9597
10505
  return _verifyMintLicenseToken2.apply(this, arguments);
@@ -9608,12 +10516,12 @@ var PiLicenseTemplateClient = /*#__PURE__*/function (_PiLicenseTemplateRea) {
9608
10516
  }, {
9609
10517
  key: "verifyRegisterDerivative",
9610
10518
  value: (function () {
9611
- var _verifyRegisterDerivative = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee75(request) {
9612
- var _yield$this$rpcClient31, call;
9613
- return _regeneratorRuntime().wrap(function _callee75$(_context75) {
9614
- while (1) switch (_context75.prev = _context75.next) {
10519
+ var _verifyRegisterDerivative = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee76(request) {
10520
+ var _yield$this$rpcClient32, call;
10521
+ return _regeneratorRuntime().wrap(function _callee76$(_context76) {
10522
+ while (1) switch (_context76.prev = _context76.next) {
9615
10523
  case 0:
9616
- _context75.next = 2;
10524
+ _context76.next = 2;
9617
10525
  return this.rpcClient.simulateContract({
9618
10526
  abi: piLicenseTemplateAbi,
9619
10527
  address: this.address,
@@ -9622,17 +10530,17 @@ var PiLicenseTemplateClient = /*#__PURE__*/function (_PiLicenseTemplateRea) {
9622
10530
  args: [request.childIpId, request.parentIpId, request.licenseTermsId, request.licensee]
9623
10531
  });
9624
10532
  case 2:
9625
- _yield$this$rpcClient31 = _context75.sent;
9626
- call = _yield$this$rpcClient31.request;
9627
- _context75.next = 6;
10533
+ _yield$this$rpcClient32 = _context76.sent;
10534
+ call = _yield$this$rpcClient32.request;
10535
+ _context76.next = 6;
9628
10536
  return this.wallet.writeContract(call);
9629
10537
  case 6:
9630
- return _context75.abrupt("return", _context75.sent);
10538
+ return _context76.abrupt("return", _context76.sent);
9631
10539
  case 7:
9632
10540
  case "end":
9633
- return _context75.stop();
10541
+ return _context76.stop();
9634
10542
  }
9635
- }, _callee75, this);
10543
+ }, _callee76, this);
9636
10544
  }));
9637
10545
  function verifyRegisterDerivative(_x59) {
9638
10546
  return _verifyRegisterDerivative.apply(this, arguments);
@@ -9649,31 +10557,31 @@ var PiLicenseTemplateClient = /*#__PURE__*/function (_PiLicenseTemplateRea) {
9649
10557
  }, {
9650
10558
  key: "verifyRegisterDerivativeForAllParents",
9651
10559
  value: (function () {
9652
- var _verifyRegisterDerivativeForAllParents = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee76(request) {
9653
- var _yield$this$rpcClient32, call;
9654
- return _regeneratorRuntime().wrap(function _callee76$(_context76) {
9655
- while (1) switch (_context76.prev = _context76.next) {
10560
+ var _verifyRegisterDerivativeForAllParents = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee77(request) {
10561
+ var _yield$this$rpcClient33, call;
10562
+ return _regeneratorRuntime().wrap(function _callee77$(_context77) {
10563
+ while (1) switch (_context77.prev = _context77.next) {
9656
10564
  case 0:
9657
- _context76.next = 2;
10565
+ _context77.next = 2;
9658
10566
  return this.rpcClient.simulateContract({
9659
10567
  abi: piLicenseTemplateAbi,
9660
10568
  address: this.address,
9661
10569
  functionName: "verifyRegisterDerivativeForAllParents",
9662
10570
  account: this.wallet.account,
9663
10571
  args: [request.childIpId, request.parentIpIds, request.licenseTermsIds, request.childIpOwner]
9664
- });
9665
- case 2:
9666
- _yield$this$rpcClient32 = _context76.sent;
9667
- call = _yield$this$rpcClient32.request;
9668
- _context76.next = 6;
10572
+ });
10573
+ case 2:
10574
+ _yield$this$rpcClient33 = _context77.sent;
10575
+ call = _yield$this$rpcClient33.request;
10576
+ _context77.next = 6;
9669
10577
  return this.wallet.writeContract(call);
9670
10578
  case 6:
9671
- return _context76.abrupt("return", _context76.sent);
10579
+ return _context77.abrupt("return", _context77.sent);
9672
10580
  case 7:
9673
10581
  case "end":
9674
- return _context76.stop();
10582
+ return _context77.stop();
9675
10583
  }
9676
- }, _callee76, this);
10584
+ }, _callee77, this);
9677
10585
  }));
9678
10586
  function verifyRegisterDerivativeForAllParents(_x60) {
9679
10587
  return _verifyRegisterDerivativeForAllParents.apply(this, arguments);
@@ -9715,12 +10623,12 @@ var RoyaltyModuleClient = /*#__PURE__*/function () {
9715
10623
  return _createClass(RoyaltyModuleClient, [{
9716
10624
  key: "payRoyaltyOnBehalf",
9717
10625
  value: (function () {
9718
- var _payRoyaltyOnBehalf = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee77(request) {
9719
- var _yield$this$rpcClient33, call;
9720
- return _regeneratorRuntime().wrap(function _callee77$(_context77) {
9721
- while (1) switch (_context77.prev = _context77.next) {
10626
+ var _payRoyaltyOnBehalf = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee78(request) {
10627
+ var _yield$this$rpcClient34, call;
10628
+ return _regeneratorRuntime().wrap(function _callee78$(_context78) {
10629
+ while (1) switch (_context78.prev = _context78.next) {
9722
10630
  case 0:
9723
- _context77.next = 2;
10631
+ _context78.next = 2;
9724
10632
  return this.rpcClient.simulateContract({
9725
10633
  abi: royaltyModuleAbi,
9726
10634
  address: this.address,
@@ -9729,17 +10637,17 @@ var RoyaltyModuleClient = /*#__PURE__*/function () {
9729
10637
  args: [request.receiverIpId, request.payerIpId, request.token, request.amount]
9730
10638
  });
9731
10639
  case 2:
9732
- _yield$this$rpcClient33 = _context77.sent;
9733
- call = _yield$this$rpcClient33.request;
9734
- _context77.next = 6;
10640
+ _yield$this$rpcClient34 = _context78.sent;
10641
+ call = _yield$this$rpcClient34.request;
10642
+ _context78.next = 6;
9735
10643
  return this.wallet.writeContract(call);
9736
10644
  case 6:
9737
- return _context77.abrupt("return", _context77.sent);
10645
+ return _context78.abrupt("return", _context78.sent);
9738
10646
  case 7:
9739
10647
  case "end":
9740
- return _context77.stop();
10648
+ return _context78.stop();
9741
10649
  }
9742
- }, _callee77, this);
10650
+ }, _callee78, this);
9743
10651
  }));
9744
10652
  function payRoyaltyOnBehalf(_x61) {
9745
10653
  return _payRoyaltyOnBehalf.apply(this, arguments);
@@ -9796,11 +10704,11 @@ var RoyaltyPolicyLapReadOnlyClient = /*#__PURE__*/function () {
9796
10704
  return _createClass(RoyaltyPolicyLapReadOnlyClient, [{
9797
10705
  key: "getRoyaltyData",
9798
10706
  value: (function () {
9799
- var _getRoyaltyData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee78(request) {
9800
- return _regeneratorRuntime().wrap(function _callee78$(_context78) {
9801
- while (1) switch (_context78.prev = _context78.next) {
10707
+ var _getRoyaltyData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee79(request) {
10708
+ return _regeneratorRuntime().wrap(function _callee79$(_context79) {
10709
+ while (1) switch (_context79.prev = _context79.next) {
9802
10710
  case 0:
9803
- _context78.next = 2;
10711
+ _context79.next = 2;
9804
10712
  return this.rpcClient.readContract({
9805
10713
  abi: royaltyPolicyLapAbi,
9806
10714
  address: this.address,
@@ -9808,12 +10716,12 @@ var RoyaltyPolicyLapReadOnlyClient = /*#__PURE__*/function () {
9808
10716
  args: [request.ipId]
9809
10717
  });
9810
10718
  case 2:
9811
- return _context78.abrupt("return", _context78.sent);
10719
+ return _context79.abrupt("return", _context79.sent);
9812
10720
  case 3:
9813
10721
  case "end":
9814
- return _context78.stop();
10722
+ return _context79.stop();
9815
10723
  }
9816
- }, _callee78, this);
10724
+ }, _callee79, this);
9817
10725
  }));
9818
10726
  function getRoyaltyData(_x62) {
9819
10727
  return _getRoyaltyData.apply(this, arguments);
@@ -9845,12 +10753,12 @@ var RoyaltyPolicyLapClient = /*#__PURE__*/function (_RoyaltyPolicyLapRead) {
9845
10753
  return _createClass(RoyaltyPolicyLapClient, [{
9846
10754
  key: "onRoyaltyPayment",
9847
10755
  value: (function () {
9848
- var _onRoyaltyPayment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee79(request) {
9849
- var _yield$this$rpcClient34, call;
9850
- return _regeneratorRuntime().wrap(function _callee79$(_context79) {
9851
- while (1) switch (_context79.prev = _context79.next) {
10756
+ var _onRoyaltyPayment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee80(request) {
10757
+ var _yield$this$rpcClient35, call;
10758
+ return _regeneratorRuntime().wrap(function _callee80$(_context80) {
10759
+ while (1) switch (_context80.prev = _context80.next) {
9852
10760
  case 0:
9853
- _context79.next = 2;
10761
+ _context80.next = 2;
9854
10762
  return this.rpcClient.simulateContract({
9855
10763
  abi: royaltyPolicyLapAbi,
9856
10764
  address: this.address,
@@ -9859,17 +10767,17 @@ var RoyaltyPolicyLapClient = /*#__PURE__*/function (_RoyaltyPolicyLapRead) {
9859
10767
  args: [request.caller, request.ipId, request.token, request.amount]
9860
10768
  });
9861
10769
  case 2:
9862
- _yield$this$rpcClient34 = _context79.sent;
9863
- call = _yield$this$rpcClient34.request;
9864
- _context79.next = 6;
10770
+ _yield$this$rpcClient35 = _context80.sent;
10771
+ call = _yield$this$rpcClient35.request;
10772
+ _context80.next = 6;
9865
10773
  return this.wallet.writeContract(call);
9866
10774
  case 6:
9867
- return _context79.abrupt("return", _context79.sent);
10775
+ return _context80.abrupt("return", _context80.sent);
9868
10776
  case 7:
9869
10777
  case "end":
9870
- return _context79.stop();
10778
+ return _context80.stop();
9871
10779
  }
9872
- }, _callee79, this);
10780
+ }, _callee80, this);
9873
10781
  }));
9874
10782
  function onRoyaltyPayment(_x63) {
9875
10783
  return _onRoyaltyPayment.apply(this, arguments);
@@ -9887,6 +10795,7 @@ var IPAssetClient = /*#__PURE__*/function () {
9887
10795
  this.ipAssetRegistryClient = new IpAssetRegistryClient(rpcClient, wallet);
9888
10796
  this.licensingModuleClient = new LicensingModuleClient(this.rpcClient, wallet);
9889
10797
  this.licenseTemplateClient = new PiLicenseTemplateClient(this.rpcClient, wallet);
10798
+ this.licenseRegistryReadOnlyClient = new LicenseRegistryReadOnlyClient(this.rpcClient);
9890
10799
  }
9891
10800
 
9892
10801
  /**
@@ -9902,12 +10811,12 @@ var IPAssetClient = /*#__PURE__*/function () {
9902
10811
  key: "register",
9903
10812
  value: (function () {
9904
10813
  var _register = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(request) {
9905
- var tokenId, _request$txOptions, ipId, txHash, txReceipt, targetLogs;
10814
+ var _request$txOptions, tokenId, ipId, txHash, txReceipt, targetLogs;
9906
10815
  return _regeneratorRuntime().wrap(function _callee$(_context) {
9907
10816
  while (1) switch (_context.prev = _context.next) {
9908
10817
  case 0:
9909
- tokenId = parseToBigInt(request.tokenId);
9910
- _context.prev = 1;
10818
+ _context.prev = 0;
10819
+ tokenId = BigInt(request.tokenId);
9911
10820
  _context.next = 4;
9912
10821
  return this.isNFTRegistered(request.tokenContract, tokenId);
9913
10822
  case 4:
@@ -9951,13 +10860,13 @@ var IPAssetClient = /*#__PURE__*/function () {
9951
10860
  break;
9952
10861
  case 21:
9953
10862
  _context.prev = 21;
9954
- _context.t0 = _context["catch"](1);
10863
+ _context.t0 = _context["catch"](0);
9955
10864
  handleError(_context.t0, "Failed to register IP");
9956
10865
  case 24:
9957
10866
  case "end":
9958
10867
  return _context.stop();
9959
10868
  }
9960
- }, _callee, this, [[1, 21]]);
10869
+ }, _callee, this, [[0, 21]]);
9961
10870
  }));
9962
10871
  function register(_x) {
9963
10872
  return _register.apply(this, arguments);
@@ -9982,12 +10891,83 @@ var IPAssetClient = /*#__PURE__*/function () {
9982
10891
  key: "registerDerivative",
9983
10892
  value: (function () {
9984
10893
  var _registerDerivative = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(request) {
9985
- var _request$txOptions2, txHash;
10894
+ var _request$txOptions2, _iterator, _step, parentId, i, isAttachedLicenseTerms, txHash;
9986
10895
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
9987
10896
  while (1) switch (_context2.prev = _context2.next) {
9988
10897
  case 0:
9989
10898
  _context2.prev = 0;
9990
10899
  _context2.next = 3;
10900
+ return this.isIpIdRegistered(request.childIpId);
10901
+ case 3:
10902
+ if (_context2.sent) {
10903
+ _context2.next = 5;
10904
+ break;
10905
+ }
10906
+ throw new Error("IP asset must be registered before registering derivative");
10907
+ case 5:
10908
+ _iterator = _createForOfIteratorHelper(request.parentIpIds);
10909
+ _context2.prev = 6;
10910
+ _iterator.s();
10911
+ case 8:
10912
+ if ((_step = _iterator.n()).done) {
10913
+ _context2.next = 16;
10914
+ break;
10915
+ }
10916
+ parentId = _step.value;
10917
+ _context2.next = 12;
10918
+ return this.isIpIdRegistered(parentId);
10919
+ case 12:
10920
+ if (_context2.sent) {
10921
+ _context2.next = 14;
10922
+ break;
10923
+ }
10924
+ throw new Error("Parent IP asset must be registered before registering derivative");
10925
+ case 14:
10926
+ _context2.next = 8;
10927
+ break;
10928
+ case 16:
10929
+ _context2.next = 21;
10930
+ break;
10931
+ case 18:
10932
+ _context2.prev = 18;
10933
+ _context2.t0 = _context2["catch"](6);
10934
+ _iterator.e(_context2.t0);
10935
+ case 21:
10936
+ _context2.prev = 21;
10937
+ _iterator.f();
10938
+ return _context2.finish(21);
10939
+ case 24:
10940
+ if (!(request.parentIpIds.length !== request.licenseTermsIds.length)) {
10941
+ _context2.next = 26;
10942
+ break;
10943
+ }
10944
+ throw new Error("Parent IP IDs and License terms IDs must be provided in pairs");
10945
+ case 26:
10946
+ i = 0;
10947
+ case 27:
10948
+ if (!(i < request.parentIpIds.length)) {
10949
+ _context2.next = 36;
10950
+ break;
10951
+ }
10952
+ _context2.next = 30;
10953
+ return this.licenseRegistryReadOnlyClient.hasIpAttachedLicenseTerms({
10954
+ ipId: request.parentIpIds[i],
10955
+ licenseTemplate: request.licenseTemplate || this.licenseTemplateClient.address,
10956
+ licenseTermsId: BigInt(request.licenseTermsIds[i])
10957
+ });
10958
+ case 30:
10959
+ isAttachedLicenseTerms = _context2.sent;
10960
+ if (isAttachedLicenseTerms) {
10961
+ _context2.next = 33;
10962
+ break;
10963
+ }
10964
+ throw new Error("License terms must be attached to the parent ipId before registering derivative");
10965
+ case 33:
10966
+ i++;
10967
+ _context2.next = 27;
10968
+ break;
10969
+ case 36:
10970
+ _context2.next = 38;
9991
10971
  return this.licensingModuleClient.registerDerivative({
9992
10972
  childIpId: request.childIpId,
9993
10973
  parentIpIds: request.parentIpIds,
@@ -9997,36 +10977,36 @@ var IPAssetClient = /*#__PURE__*/function () {
9997
10977
  licenseTemplate: request.licenseTemplate || this.licenseTemplateClient.address,
9998
10978
  royaltyContext: zeroAddress
9999
10979
  });
10000
- case 3:
10980
+ case 38:
10001
10981
  txHash = _context2.sent;
10002
10982
  if (!((_request$txOptions2 = request.txOptions) !== null && _request$txOptions2 !== void 0 && _request$txOptions2.waitForTransaction)) {
10003
- _context2.next = 10;
10983
+ _context2.next = 45;
10004
10984
  break;
10005
10985
  }
10006
- _context2.next = 7;
10986
+ _context2.next = 42;
10007
10987
  return this.rpcClient.waitForTransactionReceipt({
10008
10988
  hash: txHash
10009
10989
  });
10010
- case 7:
10990
+ case 42:
10011
10991
  return _context2.abrupt("return", {
10012
10992
  txHash: txHash
10013
10993
  });
10014
- case 10:
10994
+ case 45:
10015
10995
  return _context2.abrupt("return", {
10016
10996
  txHash: txHash
10017
10997
  });
10018
- case 11:
10019
- _context2.next = 16;
10998
+ case 46:
10999
+ _context2.next = 51;
10020
11000
  break;
10021
- case 13:
10022
- _context2.prev = 13;
10023
- _context2.t0 = _context2["catch"](0);
10024
- handleError(_context2.t0, "Failed to register derivative");
10025
- case 16:
11001
+ case 48:
11002
+ _context2.prev = 48;
11003
+ _context2.t1 = _context2["catch"](0);
11004
+ handleError(_context2.t1, "Failed to register derivative");
11005
+ case 51:
10026
11006
  case "end":
10027
11007
  return _context2.stop();
10028
11008
  }
10029
- }, _callee2, this, [[0, 13]]);
11009
+ }, _callee2, this, [[0, 48], [6, 18, 21, 24]]);
10030
11010
  }));
10031
11011
  function registerDerivative(_x2) {
10032
11012
  return _registerDerivative.apply(this, arguments);
@@ -10055,6 +11035,15 @@ var IPAssetClient = /*#__PURE__*/function () {
10055
11035
  case 0:
10056
11036
  _context3.prev = 0;
10057
11037
  _context3.next = 3;
11038
+ return this.isIpIdRegistered(request.childIpId);
11039
+ case 3:
11040
+ if (_context3.sent) {
11041
+ _context3.next = 5;
11042
+ break;
11043
+ }
11044
+ throw new Error("IP asset must be registered before registering derivative with license tokens");
11045
+ case 5:
11046
+ _context3.next = 7;
10058
11047
  return this.licensingModuleClient.registerDerivativeWithLicenseTokens({
10059
11048
  childIpId: request.childIpId,
10060
11049
  licenseTokenIds: request.licenseTokenIds.map(function (id) {
@@ -10062,36 +11051,36 @@ var IPAssetClient = /*#__PURE__*/function () {
10062
11051
  }),
10063
11052
  royaltyContext: zeroAddress
10064
11053
  });
10065
- case 3:
11054
+ case 7:
10066
11055
  txHash = _context3.sent;
10067
11056
  if (!((_request$txOptions3 = request.txOptions) !== null && _request$txOptions3 !== void 0 && _request$txOptions3.waitForTransaction)) {
10068
- _context3.next = 10;
11057
+ _context3.next = 14;
10069
11058
  break;
10070
11059
  }
10071
- _context3.next = 7;
11060
+ _context3.next = 11;
10072
11061
  return this.rpcClient.waitForTransactionReceipt({
10073
11062
  hash: txHash
10074
11063
  });
10075
- case 7:
11064
+ case 11:
10076
11065
  return _context3.abrupt("return", {
10077
11066
  txHash: txHash
10078
11067
  });
10079
- case 10:
11068
+ case 14:
10080
11069
  return _context3.abrupt("return", {
10081
11070
  txHash: txHash
10082
11071
  });
10083
- case 11:
10084
- _context3.next = 16;
11072
+ case 15:
11073
+ _context3.next = 20;
10085
11074
  break;
10086
- case 13:
10087
- _context3.prev = 13;
11075
+ case 17:
11076
+ _context3.prev = 17;
10088
11077
  _context3.t0 = _context3["catch"](0);
10089
11078
  handleError(_context3.t0, "Failed to register derivative with license tokens");
10090
- case 16:
11079
+ case 20:
10091
11080
  case "end":
10092
11081
  return _context3.stop();
10093
11082
  }
10094
- }, _callee3, this, [[0, 13]]);
11083
+ }, _callee3, this, [[0, 17]]);
10095
11084
  }));
10096
11085
  function registerDerivativeWithLicenseTokens(_x3) {
10097
11086
  return _registerDerivativeWithLicenseTokens.apply(this, arguments);
@@ -10108,7 +11097,7 @@ var IPAssetClient = /*#__PURE__*/function () {
10108
11097
  case 0:
10109
11098
  _context4.next = 2;
10110
11099
  return this.ipAssetRegistryClient.ipId({
10111
- chainId: parseToBigInt(chain[this.chainId]),
11100
+ chainId: BigInt(chain[this.chainId]),
10112
11101
  tokenContract: tokenAddress,
10113
11102
  tokenId: tokenId
10114
11103
  });
@@ -10132,6 +11121,30 @@ var IPAssetClient = /*#__PURE__*/function () {
10132
11121
  }
10133
11122
  return isNFTRegistered;
10134
11123
  }()
11124
+ }, {
11125
+ key: "isIpIdRegistered",
11126
+ value: function () {
11127
+ var _isIpIdRegistered = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(ipId) {
11128
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
11129
+ while (1) switch (_context5.prev = _context5.next) {
11130
+ case 0:
11131
+ _context5.next = 2;
11132
+ return this.ipAssetRegistryClient.isRegistered({
11133
+ id: ipId
11134
+ });
11135
+ case 2:
11136
+ return _context5.abrupt("return", _context5.sent);
11137
+ case 3:
11138
+ case "end":
11139
+ return _context5.stop();
11140
+ }
11141
+ }, _callee5, this);
11142
+ }));
11143
+ function isIpIdRegistered(_x6) {
11144
+ return _isIpIdRegistered.apply(this, arguments);
11145
+ }
11146
+ return isIpIdRegistered;
11147
+ }()
10135
11148
  }]);
10136
11149
  }();
10137
11150
 
@@ -10241,49 +11254,25 @@ var LicenseClient = /*#__PURE__*/function () {
10241
11254
  this.licenseTemplateClient = new PiLicenseTemplateClient(this.rpcClient, this.wallet);
10242
11255
  this.licensingModuleClient = new LicensingModuleClient(this.rpcClient, this.wallet);
10243
11256
  this.royaltyPolicyLAPClient = new RoyaltyPolicyLapClient(this.rpcClient, this.wallet);
11257
+ this.licenseRegistryReadOnlyClient = new LicenseRegistryReadOnlyClient(this.rpcClient);
11258
+ this.ipAssetRegistryClient = new IpAssetRegistryClient(rpcClient, wallet);
10244
11259
  }
11260
+ /**
11261
+ * Convenient function to register a PIL non commercial social remix license to the registry
11262
+ * @param request The request object that contains all data needed to register a PIL non commercial social remix license.
11263
+ * @param request.txOptions [Optional] The transaction options.
11264
+ * @returns A Promise that resolves to an object containing the optional transaction hash and optional license terms Id.
11265
+ * @emits LicenseTermsRegistered (licenseTermsId, licenseTemplate, licenseTerms);
11266
+ */
10245
11267
  return _createClass(LicenseClient, [{
10246
- key: "getLicenseTermsId",
10247
- value: function () {
10248
- var _getLicenseTermsId = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(request) {
10249
- var licenseRes;
10250
- return _regeneratorRuntime().wrap(function _callee$(_context) {
10251
- while (1) switch (_context.prev = _context.next) {
10252
- case 0:
10253
- _context.next = 2;
10254
- return this.licenseTemplateClient.getLicenseTermsId({
10255
- terms: request
10256
- });
10257
- case 2:
10258
- licenseRes = _context.sent;
10259
- return _context.abrupt("return", Number(licenseRes.selectedLicenseTermsId));
10260
- case 4:
10261
- case "end":
10262
- return _context.stop();
10263
- }
10264
- }, _callee, this);
10265
- }));
10266
- function getLicenseTermsId(_x) {
10267
- return _getLicenseTermsId.apply(this, arguments);
10268
- }
10269
- return getLicenseTermsId;
10270
- }()
10271
- /**
10272
- * Convenient function to register a PIL non commercial social remix license to the registry
10273
- * @param request The request object that contains all data needed to register a PIL non commercial social remix license.
10274
- * @param request.txOptions [Optional] The transaction options.
10275
- * @returns A Promise that resolves to an object containing the optional transaction hash and optional license ID.
10276
- * @emits LicenseTermsRegistered (licenseTermsId, licenseTemplate, licenseTerms);
10277
- */
10278
- }, {
10279
11268
  key: "registerNonComSocialRemixingPIL",
10280
11269
  value: (function () {
10281
- var _registerNonComSocialRemixingPIL = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(request) {
11270
+ var _registerNonComSocialRemixingPIL = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(request) {
10282
11271
  var _request$txOptions, licenseTerms, licenseTermsId, txHash, txReceipt, targetLogs;
10283
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
10284
- while (1) switch (_context2.prev = _context2.next) {
11272
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
11273
+ while (1) switch (_context.prev = _context.next) {
10285
11274
  case 0:
10286
- _context2.prev = 0;
11275
+ _context.prev = 0;
10287
11276
  licenseTerms = {
10288
11277
  transferable: true,
10289
11278
  royaltyPolicy: zeroAddress,
@@ -10302,57 +11291,57 @@ var LicenseClient = /*#__PURE__*/function () {
10302
11291
  derivativeRevCelling: BigInt(0),
10303
11292
  currency: zeroAddress
10304
11293
  };
10305
- _context2.next = 4;
11294
+ _context.next = 4;
10306
11295
  return this.getLicenseTermsId(licenseTerms);
10307
11296
  case 4:
10308
- licenseTermsId = _context2.sent;
11297
+ licenseTermsId = _context.sent;
10309
11298
  if (!(licenseTermsId !== 0)) {
10310
- _context2.next = 7;
11299
+ _context.next = 7;
10311
11300
  break;
10312
11301
  }
10313
- return _context2.abrupt("return", {
11302
+ return _context.abrupt("return", {
10314
11303
  licenseTermsId: licenseTermsId.toString()
10315
11304
  });
10316
11305
  case 7:
10317
- _context2.next = 9;
11306
+ _context.next = 9;
10318
11307
  return this.licenseTemplateClient.registerLicenseTerms({
10319
11308
  terms: licenseTerms
10320
11309
  });
10321
11310
  case 9:
10322
- txHash = _context2.sent;
11311
+ txHash = _context.sent;
10323
11312
  if (!((_request$txOptions = request.txOptions) !== null && _request$txOptions !== void 0 && _request$txOptions.waitForTransaction)) {
10324
- _context2.next = 18;
11313
+ _context.next = 18;
10325
11314
  break;
10326
11315
  }
10327
- _context2.next = 13;
11316
+ _context.next = 13;
10328
11317
  return this.rpcClient.waitForTransactionReceipt({
10329
11318
  hash: txHash
10330
11319
  });
10331
11320
  case 13:
10332
- txReceipt = _context2.sent;
11321
+ txReceipt = _context.sent;
10333
11322
  targetLogs = this.licenseTemplateClient.parseTxLicenseTermsRegisteredEvent(txReceipt);
10334
- return _context2.abrupt("return", {
11323
+ return _context.abrupt("return", {
10335
11324
  txHash: txHash,
10336
11325
  licenseTermsId: targetLogs[0].licenseTermsId.toString()
10337
11326
  });
10338
11327
  case 18:
10339
- return _context2.abrupt("return", {
11328
+ return _context.abrupt("return", {
10340
11329
  txHash: txHash
10341
11330
  });
10342
11331
  case 19:
10343
- _context2.next = 24;
11332
+ _context.next = 24;
10344
11333
  break;
10345
11334
  case 21:
10346
- _context2.prev = 21;
10347
- _context2.t0 = _context2["catch"](0);
10348
- handleError(_context2.t0, "Failed to register non commercial social remixing PIL");
11335
+ _context.prev = 21;
11336
+ _context.t0 = _context["catch"](0);
11337
+ handleError(_context.t0, "Failed to register non commercial social remixing PIL");
10349
11338
  case 24:
10350
11339
  case "end":
10351
- return _context2.stop();
11340
+ return _context.stop();
10352
11341
  }
10353
- }, _callee2, this, [[0, 21]]);
11342
+ }, _callee, this, [[0, 21]]);
10354
11343
  }));
10355
- function registerNonComSocialRemixingPIL(_x2) {
11344
+ function registerNonComSocialRemixingPIL(_x) {
10356
11345
  return _registerNonComSocialRemixingPIL.apply(this, arguments);
10357
11346
  }
10358
11347
  return registerNonComSocialRemixingPIL;
@@ -10365,19 +11354,19 @@ var LicenseClient = /*#__PURE__*/function () {
10365
11354
  * the token must be registered in story protocol.
10366
11355
  * @param request.royaltyPolicy The address of the royalty policy contract which required to StoryProtocol in advance.
10367
11356
  * @param request.txOptions [Optional] The transaction options.
10368
- * @returns A Promise that resolves to an object containing the optional transaction hash and optional license ID.
11357
+ * @returns A Promise that resolves to an object containing the optional transaction hash and optional license terms Id.
10369
11358
  * @emits LicenseTermsRegistered (licenseTermsId, licenseTemplate, licenseTerms);
10370
11359
  */
10371
11360
  )
10372
11361
  }, {
10373
11362
  key: "registerCommercialUsePIL",
10374
11363
  value: (function () {
10375
- var _registerCommercialUsePIL = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(request) {
11364
+ var _registerCommercialUsePIL = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(request) {
10376
11365
  var _request$txOptions2, licenseTerms, licenseTermsId, txHash, txReceipt, targetLogs;
10377
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
10378
- while (1) switch (_context3.prev = _context3.next) {
11366
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
11367
+ while (1) switch (_context2.prev = _context2.next) {
10379
11368
  case 0:
10380
- _context3.prev = 0;
11369
+ _context2.prev = 0;
10381
11370
  licenseTerms = {
10382
11371
  transferable: true,
10383
11372
  royaltyPolicy: this.royaltyPolicyLAPClient.address,
@@ -10396,57 +11385,57 @@ var LicenseClient = /*#__PURE__*/function () {
10396
11385
  derivativeRevCelling: BigInt(0),
10397
11386
  currency: request.currency
10398
11387
  };
10399
- _context3.next = 4;
11388
+ _context2.next = 4;
10400
11389
  return this.getLicenseTermsId(licenseTerms);
10401
11390
  case 4:
10402
- licenseTermsId = _context3.sent;
11391
+ licenseTermsId = _context2.sent;
10403
11392
  if (!(licenseTermsId !== 0)) {
10404
- _context3.next = 7;
11393
+ _context2.next = 7;
10405
11394
  break;
10406
11395
  }
10407
- return _context3.abrupt("return", {
11396
+ return _context2.abrupt("return", {
10408
11397
  licenseTermsId: licenseTermsId.toString()
10409
11398
  });
10410
11399
  case 7:
10411
- _context3.next = 9;
11400
+ _context2.next = 9;
10412
11401
  return this.licenseTemplateClient.registerLicenseTerms({
10413
11402
  terms: licenseTerms
10414
11403
  });
10415
11404
  case 9:
10416
- txHash = _context3.sent;
11405
+ txHash = _context2.sent;
10417
11406
  if (!((_request$txOptions2 = request.txOptions) !== null && _request$txOptions2 !== void 0 && _request$txOptions2.waitForTransaction)) {
10418
- _context3.next = 18;
11407
+ _context2.next = 18;
10419
11408
  break;
10420
11409
  }
10421
- _context3.next = 13;
11410
+ _context2.next = 13;
10422
11411
  return this.rpcClient.waitForTransactionReceipt({
10423
11412
  hash: txHash
10424
11413
  });
10425
11414
  case 13:
10426
- txReceipt = _context3.sent;
11415
+ txReceipt = _context2.sent;
10427
11416
  targetLogs = this.licenseTemplateClient.parseTxLicenseTermsRegisteredEvent(txReceipt);
10428
- return _context3.abrupt("return", {
11417
+ return _context2.abrupt("return", {
10429
11418
  txHash: txHash,
10430
11419
  licenseTermsId: targetLogs[0].licenseTermsId.toString()
10431
11420
  });
10432
11421
  case 18:
10433
- return _context3.abrupt("return", {
11422
+ return _context2.abrupt("return", {
10434
11423
  txHash: txHash
10435
11424
  });
10436
11425
  case 19:
10437
- _context3.next = 24;
11426
+ _context2.next = 24;
10438
11427
  break;
10439
11428
  case 21:
10440
- _context3.prev = 21;
10441
- _context3.t0 = _context3["catch"](0);
10442
- handleError(_context3.t0, "Failed to register commercial use PIL");
11429
+ _context2.prev = 21;
11430
+ _context2.t0 = _context2["catch"](0);
11431
+ handleError(_context2.t0, "Failed to register commercial use PIL");
10443
11432
  case 24:
10444
11433
  case "end":
10445
- return _context3.stop();
11434
+ return _context2.stop();
10446
11435
  }
10447
- }, _callee3, this, [[0, 21]]);
11436
+ }, _callee2, this, [[0, 21]]);
10448
11437
  }));
10449
- function registerCommercialUsePIL(_x3) {
11438
+ function registerCommercialUsePIL(_x2) {
10450
11439
  return _registerCommercialUsePIL.apply(this, arguments);
10451
11440
  }
10452
11441
  return registerCommercialUsePIL;
@@ -10459,19 +11448,19 @@ var LicenseClient = /*#__PURE__*/function () {
10459
11448
  * @param request.currency The ERC20 token to be used to pay the minting fee. the token must be registered in story protocol.
10460
11449
  * @param request.royaltyPolicy The address of the royalty policy contract which required to StoryProtocol in advance.
10461
11450
  * @param request.txOptions [Optional] The transaction options.
10462
- * @returns A Promise that resolves to an object containing the optional transaction hash and optional license ID.
11451
+ * @returns A Promise that resolves to an object containing the optional transaction hash and optional license terms Id.
10463
11452
  * @emits LicenseTermsRegistered (licenseTermsId, licenseTemplate, licenseTerms);
10464
11453
  */
10465
11454
  )
10466
11455
  }, {
10467
11456
  key: "registerCommercialRemixPIL",
10468
11457
  value: (function () {
10469
- var _registerCommercialRemixPIL = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(request) {
11458
+ var _registerCommercialRemixPIL = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(request) {
10470
11459
  var _request$txOptions3, licenseTerms, licenseTermsId, txHash, txReceipt, targetLogs;
10471
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
10472
- while (1) switch (_context4.prev = _context4.next) {
11460
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
11461
+ while (1) switch (_context3.prev = _context3.next) {
10473
11462
  case 0:
10474
- _context4.prev = 0;
11463
+ _context3.prev = 0;
10475
11464
  licenseTerms = {
10476
11465
  transferable: true,
10477
11466
  royaltyPolicy: this.royaltyPolicyLAPClient.address,
@@ -10490,57 +11479,57 @@ var LicenseClient = /*#__PURE__*/function () {
10490
11479
  derivativeRevCelling: BigInt(0),
10491
11480
  currency: request.currency
10492
11481
  };
10493
- _context4.next = 4;
11482
+ _context3.next = 4;
10494
11483
  return this.getLicenseTermsId(licenseTerms);
10495
11484
  case 4:
10496
- licenseTermsId = _context4.sent;
11485
+ licenseTermsId = _context3.sent;
10497
11486
  if (!(licenseTermsId !== 0)) {
10498
- _context4.next = 7;
11487
+ _context3.next = 7;
10499
11488
  break;
10500
11489
  }
10501
- return _context4.abrupt("return", {
11490
+ return _context3.abrupt("return", {
10502
11491
  licenseTermsId: licenseTermsId.toString()
10503
11492
  });
10504
11493
  case 7:
10505
- _context4.next = 9;
11494
+ _context3.next = 9;
10506
11495
  return this.licenseTemplateClient.registerLicenseTerms({
10507
11496
  terms: licenseTerms
10508
11497
  });
10509
11498
  case 9:
10510
- txHash = _context4.sent;
11499
+ txHash = _context3.sent;
10511
11500
  if (!((_request$txOptions3 = request.txOptions) !== null && _request$txOptions3 !== void 0 && _request$txOptions3.waitForTransaction)) {
10512
- _context4.next = 18;
11501
+ _context3.next = 18;
10513
11502
  break;
10514
11503
  }
10515
- _context4.next = 13;
11504
+ _context3.next = 13;
10516
11505
  return this.rpcClient.waitForTransactionReceipt({
10517
11506
  hash: txHash
10518
11507
  });
10519
11508
  case 13:
10520
- txReceipt = _context4.sent;
11509
+ txReceipt = _context3.sent;
10521
11510
  targetLogs = this.licenseTemplateClient.parseTxLicenseTermsRegisteredEvent(txReceipt);
10522
- return _context4.abrupt("return", {
11511
+ return _context3.abrupt("return", {
10523
11512
  txHash: txHash,
10524
11513
  licenseTermsId: targetLogs[0].licenseTermsId.toString()
10525
11514
  });
10526
11515
  case 18:
10527
- return _context4.abrupt("return", {
11516
+ return _context3.abrupt("return", {
10528
11517
  txHash: txHash
10529
11518
  });
10530
11519
  case 19:
10531
- _context4.next = 24;
11520
+ _context3.next = 24;
10532
11521
  break;
10533
11522
  case 21:
10534
- _context4.prev = 21;
10535
- _context4.t0 = _context4["catch"](0);
10536
- handleError(_context4.t0, "Failed to register commercial remix PIL");
11523
+ _context3.prev = 21;
11524
+ _context3.t0 = _context3["catch"](0);
11525
+ handleError(_context3.t0, "Failed to register commercial remix PIL");
10537
11526
  case 24:
10538
11527
  case "end":
10539
- return _context4.stop();
11528
+ return _context3.stop();
10540
11529
  }
10541
- }, _callee4, this, [[0, 21]]);
11530
+ }, _callee3, this, [[0, 21]]);
10542
11531
  }));
10543
- function registerCommercialRemixPIL(_x4) {
11532
+ function registerCommercialRemixPIL(_x3) {
10544
11533
  return _registerCommercialRemixPIL.apply(this, arguments);
10545
11534
  }
10546
11535
  return registerCommercialRemixPIL;
@@ -10562,43 +11551,69 @@ var LicenseClient = /*#__PURE__*/function () {
10562
11551
  }, {
10563
11552
  key: "attachLicenseTerms",
10564
11553
  value: (function () {
10565
- var _attachLicenseTerms = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(request) {
11554
+ var _attachLicenseTerms = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(request) {
10566
11555
  var _request$txOptions4;
10567
- var txHash;
10568
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
10569
- while (1) switch (_context5.prev = _context5.next) {
11556
+ var isRegistered, isAttachedLicenseTerms, txHash;
11557
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
11558
+ while (1) switch (_context4.prev = _context4.next) {
10570
11559
  case 0:
10571
- _context5.next = 2;
11560
+ _context4.next = 2;
11561
+ return this.ipAssetRegistryClient.isRegistered({
11562
+ id: request.ipId
11563
+ });
11564
+ case 2:
11565
+ isRegistered = _context4.sent;
11566
+ if (isRegistered) {
11567
+ _context4.next = 5;
11568
+ break;
11569
+ }
11570
+ throw new Error("IP asset must be registered before attaching license terms");
11571
+ case 5:
11572
+ _context4.next = 7;
11573
+ return this.licenseRegistryReadOnlyClient.hasIpAttachedLicenseTerms({
11574
+ ipId: request.ipId,
11575
+ licenseTemplate: request.licenseTemplate || this.licenseTemplateClient.address,
11576
+ licenseTermsId: BigInt(request.licenseTermsId)
11577
+ });
11578
+ case 7:
11579
+ isAttachedLicenseTerms = _context4.sent;
11580
+ if (!isAttachedLicenseTerms) {
11581
+ _context4.next = 10;
11582
+ break;
11583
+ }
11584
+ throw new Error("License terms are already attached to the IP");
11585
+ case 10:
11586
+ _context4.next = 12;
10572
11587
  return this.licensingModuleClient.attachLicenseTerms({
10573
11588
  ipId: request.ipId,
10574
11589
  licenseTemplate: request.licenseTemplate || this.licenseTemplateClient.address,
10575
11590
  licenseTermsId: BigInt(request.licenseTermsId)
10576
11591
  });
10577
- case 2:
10578
- txHash = _context5.sent;
11592
+ case 12:
11593
+ txHash = _context4.sent;
10579
11594
  if (!((_request$txOptions4 = request.txOptions) !== null && _request$txOptions4 !== void 0 && _request$txOptions4.waitForTransaction)) {
10580
- _context5.next = 9;
11595
+ _context4.next = 19;
10581
11596
  break;
10582
11597
  }
10583
- _context5.next = 6;
11598
+ _context4.next = 16;
10584
11599
  return this.rpcClient.waitForTransactionReceipt({
10585
11600
  hash: txHash
10586
11601
  });
10587
- case 6:
10588
- return _context5.abrupt("return", {
11602
+ case 16:
11603
+ return _context4.abrupt("return", {
10589
11604
  txHash: txHash
10590
11605
  });
10591
- case 9:
10592
- return _context5.abrupt("return", {
11606
+ case 19:
11607
+ return _context4.abrupt("return", {
10593
11608
  txHash: txHash
10594
11609
  });
10595
- case 10:
11610
+ case 20:
10596
11611
  case "end":
10597
- return _context5.stop();
11612
+ return _context4.stop();
10598
11613
  }
10599
- }, _callee5, this);
11614
+ }, _callee4, this);
10600
11615
  }));
10601
- function attachLicenseTerms(_x5) {
11616
+ function attachLicenseTerms(_x4) {
10602
11617
  return _attachLicenseTerms.apply(this, arguments);
10603
11618
  }
10604
11619
  return attachLicenseTerms;
@@ -10629,13 +11644,27 @@ var LicenseClient = /*#__PURE__*/function () {
10629
11644
  }, {
10630
11645
  key: "mintLicenseTokens",
10631
11646
  value: (function () {
10632
- var _mintLicenseTokens = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(request) {
10633
- var _request$txOptions5, txHash, txReceipt, targetLogs;
10634
- return _regeneratorRuntime().wrap(function _callee6$(_context6) {
10635
- while (1) switch (_context6.prev = _context6.next) {
11647
+ var _mintLicenseTokens = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(request) {
11648
+ var _request$txOptions5, isAttachedLicenseTerms, txHash, txReceipt, targetLogs;
11649
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
11650
+ while (1) switch (_context5.prev = _context5.next) {
10636
11651
  case 0:
10637
- _context6.prev = 0;
10638
- _context6.next = 3;
11652
+ _context5.prev = 0;
11653
+ _context5.next = 3;
11654
+ return this.licenseRegistryReadOnlyClient.hasIpAttachedLicenseTerms({
11655
+ ipId: request.licensorIpId,
11656
+ licenseTemplate: request.licenseTemplate || this.licenseTemplateClient.address,
11657
+ licenseTermsId: BigInt(request.licenseTermsId)
11658
+ });
11659
+ case 3:
11660
+ isAttachedLicenseTerms = _context5.sent;
11661
+ if (isAttachedLicenseTerms) {
11662
+ _context5.next = 6;
11663
+ break;
11664
+ }
11665
+ throw new Error("License terms are not attached to the IP");
11666
+ case 6:
11667
+ _context5.next = 8;
10639
11668
  return this.licensingModuleClient.mintLicenseTokens({
10640
11669
  licensorIpId: request.licensorIpId,
10641
11670
  licenseTemplate: request.licenseTemplate || this.licenseTemplateClient.address,
@@ -10644,45 +11673,71 @@ var LicenseClient = /*#__PURE__*/function () {
10644
11673
  receiver: request.receiver || this.wallet.account.address,
10645
11674
  royaltyContext: zeroAddress
10646
11675
  });
10647
- case 3:
10648
- txHash = _context6.sent;
11676
+ case 8:
11677
+ txHash = _context5.sent;
10649
11678
  if (!((_request$txOptions5 = request.txOptions) !== null && _request$txOptions5 !== void 0 && _request$txOptions5.waitForTransaction)) {
10650
- _context6.next = 12;
11679
+ _context5.next = 17;
10651
11680
  break;
10652
11681
  }
10653
- _context6.next = 7;
11682
+ _context5.next = 12;
10654
11683
  return this.rpcClient.waitForTransactionReceipt({
10655
11684
  hash: txHash
10656
11685
  });
10657
- case 7:
10658
- txReceipt = _context6.sent;
11686
+ case 12:
11687
+ txReceipt = _context5.sent;
10659
11688
  targetLogs = this.licensingModuleClient.parseTxLicenseTokensMintedEvent(txReceipt);
10660
- return _context6.abrupt("return", {
11689
+ return _context5.abrupt("return", {
10661
11690
  txHash: txHash,
10662
11691
  licenseTokenId: targetLogs[0].startLicenseTokenId.toString()
10663
11692
  });
10664
- case 12:
10665
- return _context6.abrupt("return", {
11693
+ case 17:
11694
+ return _context5.abrupt("return", {
10666
11695
  txHash: txHash
10667
11696
  });
10668
- case 13:
10669
- _context6.next = 18;
10670
- break;
10671
- case 15:
10672
- _context6.prev = 15;
10673
- _context6.t0 = _context6["catch"](0);
10674
- handleError(_context6.t0, "Failed to mint license tokens");
10675
11697
  case 18:
11698
+ _context5.next = 23;
11699
+ break;
11700
+ case 20:
11701
+ _context5.prev = 20;
11702
+ _context5.t0 = _context5["catch"](0);
11703
+ handleError(_context5.t0, "Failed to mint license tokens");
11704
+ case 23:
10676
11705
  case "end":
10677
- return _context6.stop();
11706
+ return _context5.stop();
10678
11707
  }
10679
- }, _callee6, this, [[0, 15]]);
11708
+ }, _callee5, this, [[0, 20]]);
10680
11709
  }));
10681
- function mintLicenseTokens(_x6) {
11710
+ function mintLicenseTokens(_x5) {
10682
11711
  return _mintLicenseTokens.apply(this, arguments);
10683
11712
  }
10684
11713
  return mintLicenseTokens;
10685
11714
  }())
11715
+ }, {
11716
+ key: "getLicenseTermsId",
11717
+ value: function () {
11718
+ var _getLicenseTermsId = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(request) {
11719
+ var licenseRes;
11720
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
11721
+ while (1) switch (_context6.prev = _context6.next) {
11722
+ case 0:
11723
+ _context6.next = 2;
11724
+ return this.licenseTemplateClient.getLicenseTermsId({
11725
+ terms: request
11726
+ });
11727
+ case 2:
11728
+ licenseRes = _context6.sent;
11729
+ return _context6.abrupt("return", Number(licenseRes.selectedLicenseTermsId));
11730
+ case 4:
11731
+ case "end":
11732
+ return _context6.stop();
11733
+ }
11734
+ }, _callee6, this);
11735
+ }));
11736
+ function getLicenseTermsId(_x6) {
11737
+ return _getLicenseTermsId.apply(this, arguments);
11738
+ }
11739
+ return getLicenseTermsId;
11740
+ }()
10686
11741
  }]);
10687
11742
  }();
10688
11743
 
@@ -11069,84 +12124,69 @@ var RoyaltyClient = /*#__PURE__*/function () {
11069
12124
 
11070
12125
  /**
11071
12126
  * Allows ancestors to claim the royalty tokens and any accrued revenue tokens
11072
- * @param request - the licensing parameters for the Programmable IP License v1 (PIL) standard.
12127
+ * @param request - The request object that contains all data needed to collect royalty tokens.
11073
12128
  * @param request.ancestorIpId The ip id of the ancestor to whom the royalty tokens belong to.
12129
+ * @param request.royaltyVaultIpId The id of the royalty vault.
11074
12130
  * @param request.txOptions [Optional] The transaction options.
11075
- * @returns Tx hash for the transaction.
11076
- * @emits RoyaltyTokensCollected (ancestorIpId, ancestorsRoyalty)
12131
+ * @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.
12132
+ * @emits RoyaltyTokensCollected (ancestorIpId, royaltyTokensCollected)
11077
12133
  */
11078
12134
  return _createClass(RoyaltyClient, [{
11079
12135
  key: "collectRoyaltyTokens",
11080
12136
  value: (function () {
11081
12137
  var _collectRoyaltyTokens = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(request) {
11082
- var proxyAddress, txHash;
12138
+ var _request$txOptions, proxyAddress, ipRoyaltyVault, txHash, txReceipt, targetLogs;
11083
12139
  return _regeneratorRuntime().wrap(function _callee$(_context) {
11084
12140
  while (1) switch (_context.prev = _context.next) {
11085
12141
  case 0:
11086
12142
  _context.prev = 0;
11087
12143
  _context.next = 3;
11088
- return this.getProxyAddress(request.derivativeId);
12144
+ return this.getRoyaltyVaultProxyAddress(request.royaltyVaultIpId);
11089
12145
  case 3:
11090
12146
  proxyAddress = _context.sent;
11091
- if (proxyAddress) {
11092
- _context.next = 6;
11093
- break;
11094
- }
11095
- throw new Error("Proxy address not found");
11096
- case 6:
11097
- _context.next = 8;
11098
- return this.royaltyVaultImplClient.collectRoyaltyTokens({
12147
+ ipRoyaltyVault = new IpRoyaltyVaultImplClient(this.rpcClient, this.wallet, proxyAddress);
12148
+ _context.next = 7;
12149
+ return ipRoyaltyVault.collectRoyaltyTokens({
11099
12150
  ancestorIpId: request.ancestorIpId
11100
12151
  });
11101
- case 8:
12152
+ case 7:
11102
12153
  txHash = _context.sent;
12154
+ if (!((_request$txOptions = request.txOptions) !== null && _request$txOptions !== void 0 && _request$txOptions.waitForTransaction)) {
12155
+ _context.next = 16;
12156
+ break;
12157
+ }
12158
+ _context.next = 11;
12159
+ return this.rpcClient.waitForTransactionReceipt({
12160
+ hash: txHash
12161
+ });
12162
+ case 11:
12163
+ txReceipt = _context.sent;
12164
+ targetLogs = ipRoyaltyVault.parseTxRoyaltyTokensCollectedEvent(txReceipt);
12165
+ return _context.abrupt("return", {
12166
+ txHash: txHash,
12167
+ royaltyTokensCollected: targetLogs[0].royaltyTokensCollected.toString()
12168
+ });
12169
+ case 16:
11103
12170
  return _context.abrupt("return", {
11104
12171
  txHash: txHash
11105
12172
  });
11106
- case 12:
11107
- _context.prev = 12;
12173
+ case 17:
12174
+ _context.next = 22;
12175
+ break;
12176
+ case 19:
12177
+ _context.prev = 19;
11108
12178
  _context.t0 = _context["catch"](0);
11109
12179
  handleError(_context.t0, "Failed to collect royalty tokens");
11110
- case 15:
12180
+ case 22:
11111
12181
  case "end":
11112
12182
  return _context.stop();
11113
12183
  }
11114
- }, _callee, this, [[0, 12]]);
12184
+ }, _callee, this, [[0, 19]]);
11115
12185
  }));
11116
12186
  function collectRoyaltyTokens(_x) {
11117
12187
  return _collectRoyaltyTokens.apply(this, arguments);
11118
12188
  }
11119
12189
  return collectRoyaltyTokens;
11120
- }())
11121
- }, {
11122
- key: "getProxyAddress",
11123
- value: function () {
11124
- var _getProxyAddress = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(derivativeID) {
11125
- var data;
11126
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
11127
- while (1) switch (_context2.prev = _context2.next) {
11128
- case 0:
11129
- _context2.next = 2;
11130
- return this.royaltyPolicyLAPClient.getRoyaltyData({
11131
- ipId: derivativeID
11132
- });
11133
- case 2:
11134
- data = _context2.sent;
11135
- if (!(Array.isArray(data) && data[1])) {
11136
- _context2.next = 5;
11137
- break;
11138
- }
11139
- return _context2.abrupt("return", data[1]);
11140
- case 5:
11141
- case "end":
11142
- return _context2.stop();
11143
- }
11144
- }, _callee2, this);
11145
- }));
11146
- function getProxyAddress(_x2) {
11147
- return _getProxyAddress.apply(this, arguments);
11148
- }
11149
- return getProxyAddress;
11150
12190
  }()
11151
12191
  /**
11152
12192
  * Allows the function caller to pay royalties to the receiver IP asset on behalf of the payer IP asset.
@@ -11157,18 +12197,18 @@ var RoyaltyClient = /*#__PURE__*/function () {
11157
12197
  * @param request.amount The amount to pay.
11158
12198
  * @param request.txOptions [Optional] The transaction options.
11159
12199
  * @returns A Promise that resolves to an object containing the transaction hash.
11160
- * @emits RoyaltyPaid (receiverIpId, payerIpId, msg.sender, token, amount)
11161
12200
  */
12201
+ )
11162
12202
  }, {
11163
12203
  key: "payRoyaltyOnBehalf",
11164
12204
  value: (function () {
11165
- var _payRoyaltyOnBehalf = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(request) {
11166
- var _request$txOptions, txHash;
11167
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
11168
- while (1) switch (_context3.prev = _context3.next) {
12205
+ var _payRoyaltyOnBehalf = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(request) {
12206
+ var _request$txOptions2, txHash;
12207
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
12208
+ while (1) switch (_context2.prev = _context2.next) {
11169
12209
  case 0:
11170
- _context3.prev = 0;
11171
- _context3.next = 3;
12210
+ _context2.prev = 0;
12211
+ _context2.next = 3;
11172
12212
  return this.royaltyModuleClient.payRoyaltyOnBehalf({
11173
12213
  receiverIpId: request.receiverIpId,
11174
12214
  payerIpId: request.payerIpId,
@@ -11176,34 +12216,179 @@ var RoyaltyClient = /*#__PURE__*/function () {
11176
12216
  amount: request.amount
11177
12217
  });
11178
12218
  case 3:
11179
- txHash = _context3.sent;
11180
- if (!((_request$txOptions = request.txOptions) !== null && _request$txOptions !== void 0 && _request$txOptions.waitForTransaction)) {
11181
- _context3.next = 7;
12219
+ txHash = _context2.sent;
12220
+ if (!((_request$txOptions2 = request.txOptions) !== null && _request$txOptions2 !== void 0 && _request$txOptions2.waitForTransaction)) {
12221
+ _context2.next = 10;
11182
12222
  break;
11183
12223
  }
11184
- _context3.next = 7;
12224
+ _context2.next = 7;
11185
12225
  return this.rpcClient.waitForTransactionReceipt({
11186
12226
  hash: txHash
11187
12227
  });
11188
12228
  case 7:
11189
- return _context3.abrupt("return", {
12229
+ return _context2.abrupt("return", {
12230
+ txHash: txHash
12231
+ });
12232
+ case 10:
12233
+ return _context2.abrupt("return", {
11190
12234
  txHash: txHash
11191
12235
  });
12236
+ case 11:
12237
+ _context2.next = 16;
12238
+ break;
12239
+ case 13:
12240
+ _context2.prev = 13;
12241
+ _context2.t0 = _context2["catch"](0);
12242
+ handleError(_context2.t0, "Failed to pay royalty on behalf");
12243
+ case 16:
12244
+ case "end":
12245
+ return _context2.stop();
12246
+ }
12247
+ }, _callee2, this, [[0, 13]]);
12248
+ }));
12249
+ function payRoyaltyOnBehalf(_x2) {
12250
+ return _payRoyaltyOnBehalf.apply(this, arguments);
12251
+ }
12252
+ return payRoyaltyOnBehalf;
12253
+ }()
12254
+ /**
12255
+ * Calculates the amount of revenue token claimable by a token holder at certain snapshot.
12256
+ * @param request - The request object that contains all data needed to claim Revenue.
12257
+ * @param request.royaltyVaultIpId The id of the royalty vault.
12258
+ * @param request.account The address of the token holder.
12259
+ * @param request.snapshotId The snapshot id.
12260
+ * @param request.token The revenue token to claim.
12261
+ * @param request.txOptions [Optional] The transaction options.
12262
+ * @returns A Promise that contains the amount of revenue token claimable
12263
+ */
12264
+ )
12265
+ }, {
12266
+ key: "claimableRevenue",
12267
+ value: (function () {
12268
+ var _claimableRevenue = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(request) {
12269
+ var proxyAddress, ipRoyaltyVault;
12270
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
12271
+ while (1) switch (_context3.prev = _context3.next) {
12272
+ case 0:
12273
+ _context3.prev = 0;
12274
+ _context3.next = 3;
12275
+ return this.getRoyaltyVaultProxyAddress(request.royaltyVaultIpId);
12276
+ case 3:
12277
+ proxyAddress = _context3.sent;
12278
+ ipRoyaltyVault = new IpRoyaltyVaultImplClient(this.rpcClient, this.wallet, proxyAddress);
12279
+ _context3.next = 7;
12280
+ return ipRoyaltyVault.claimableRevenue({
12281
+ account: request.account,
12282
+ snapshotId: BigInt(request.snapshotId),
12283
+ token: request.token
12284
+ });
12285
+ case 7:
12286
+ return _context3.abrupt("return", _context3.sent);
11192
12287
  case 10:
11193
12288
  _context3.prev = 10;
11194
12289
  _context3.t0 = _context3["catch"](0);
11195
- handleError(_context3.t0, "Failed to pay royalty on behalf");
12290
+ handleError(_context3.t0, "Failed to calculate claimable revenue");
11196
12291
  case 13:
11197
12292
  case "end":
11198
12293
  return _context3.stop();
11199
12294
  }
11200
12295
  }, _callee3, this, [[0, 10]]);
11201
12296
  }));
11202
- function payRoyaltyOnBehalf(_x3) {
11203
- return _payRoyaltyOnBehalf.apply(this, arguments);
12297
+ function claimableRevenue(_x3) {
12298
+ return _claimableRevenue.apply(this, arguments);
11204
12299
  }
11205
- return payRoyaltyOnBehalf;
12300
+ return claimableRevenue;
12301
+ }()
12302
+ /**
12303
+ * Snapshots the claimable revenue and royalty token amounts.
12304
+ * @param request - The request object that contains all data needed to snapshot.
12305
+ * @param request.royaltyVaultIpId The id of the royalty vault.
12306
+ * @param request.txOptions [Optional] The transaction options.
12307
+ * @returns A Promise that resolves to an object containing the transaction hash and optional snapshotId if waitForTxn is set to true.
12308
+ * @emits SnapshotCompleted (snapshotId, snapshotTimestamp, unclaimedTokens).
12309
+ */
12310
+ )
12311
+ }, {
12312
+ key: "snapshot",
12313
+ value: (function () {
12314
+ var _snapshot = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(request) {
12315
+ var _request$txOptions3, proxyAddress, ipRoyaltyVault, txHash, txReceipt, targetLogs;
12316
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
12317
+ while (1) switch (_context4.prev = _context4.next) {
12318
+ case 0:
12319
+ _context4.prev = 0;
12320
+ _context4.next = 3;
12321
+ return this.getRoyaltyVaultProxyAddress(request.royaltyVaultIpId);
12322
+ case 3:
12323
+ proxyAddress = _context4.sent;
12324
+ ipRoyaltyVault = new IpRoyaltyVaultImplClient(this.rpcClient, this.wallet, proxyAddress);
12325
+ _context4.next = 7;
12326
+ return ipRoyaltyVault.snapshot();
12327
+ case 7:
12328
+ txHash = _context4.sent;
12329
+ if (!((_request$txOptions3 = request.txOptions) !== null && _request$txOptions3 !== void 0 && _request$txOptions3.waitForTransaction)) {
12330
+ _context4.next = 16;
12331
+ break;
12332
+ }
12333
+ _context4.next = 11;
12334
+ return this.rpcClient.waitForTransactionReceipt({
12335
+ hash: txHash
12336
+ });
12337
+ case 11:
12338
+ txReceipt = _context4.sent;
12339
+ targetLogs = ipRoyaltyVault.parseTxSnapshotCompletedEvent(txReceipt);
12340
+ return _context4.abrupt("return", {
12341
+ txHash: txHash,
12342
+ snapshotId: targetLogs[0].snapshotId
12343
+ });
12344
+ case 16:
12345
+ return _context4.abrupt("return", {
12346
+ txHash: txHash
12347
+ });
12348
+ case 17:
12349
+ _context4.next = 22;
12350
+ break;
12351
+ case 19:
12352
+ _context4.prev = 19;
12353
+ _context4.t0 = _context4["catch"](0);
12354
+ handleError(_context4.t0, "Failed to snapshot");
12355
+ case 22:
12356
+ case "end":
12357
+ return _context4.stop();
12358
+ }
12359
+ }, _callee4, this, [[0, 19]]);
12360
+ }));
12361
+ function snapshot(_x4) {
12362
+ return _snapshot.apply(this, arguments);
12363
+ }
12364
+ return snapshot;
11206
12365
  }())
12366
+ }, {
12367
+ key: "getRoyaltyVaultProxyAddress",
12368
+ value: function () {
12369
+ var _getRoyaltyVaultProxyAddress = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(royaltyVaultIpId) {
12370
+ var data;
12371
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
12372
+ while (1) switch (_context5.prev = _context5.next) {
12373
+ case 0:
12374
+ _context5.next = 2;
12375
+ return this.royaltyPolicyLAPClient.getRoyaltyData({
12376
+ ipId: royaltyVaultIpId
12377
+ });
12378
+ case 2:
12379
+ data = _context5.sent;
12380
+ return _context5.abrupt("return", data[1]);
12381
+ case 4:
12382
+ case "end":
12383
+ return _context5.stop();
12384
+ }
12385
+ }, _callee5, this);
12386
+ }));
12387
+ function getRoyaltyVaultProxyAddress(_x5) {
12388
+ return _getRoyaltyVaultProxyAddress.apply(this, arguments);
12389
+ }
12390
+ return getRoyaltyVaultProxyAddress;
12391
+ }()
11207
12392
  }]);
11208
12393
  }();
11209
12394