@story-protocol/core-sdk 0.0.1-beta-rc.10 → 0.0.1-beta-rc.11
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.
- package/dist/declarations/src/types/config.d.ts +2 -2
- package/dist/declarations/src/types/config.d.ts.map +1 -1
- package/dist/story-protocol-core-sdk.cjs.d.ts +1 -1
- package/dist/story-protocol-core-sdk.cjs.dev.js +51 -53
- package/dist/story-protocol-core-sdk.cjs.prod.js +51 -53
- package/dist/story-protocol-core-sdk.esm.js +51 -53
- package/package.json +2 -2
- package/dist/story-protocol-core-sdk.cjs.d.ts.map +0 -1
@@ -1,4 +1,4 @@
|
|
1
|
-
import { Account, Transport } from "viem";
|
1
|
+
import { Account, Transport, Address } from "viem";
|
2
2
|
/**
|
3
3
|
* Supported chains. For convenience, both name or chain ID are supported.
|
4
4
|
*
|
@@ -11,7 +11,7 @@ export type SupportedChainIds = "11155111" | "sepolia" | "1" | "mainnet" | "8000
|
|
11
11
|
* @public
|
12
12
|
*/
|
13
13
|
export interface StoryConfig {
|
14
|
-
readonly account: Account;
|
14
|
+
readonly account: Account | Address;
|
15
15
|
readonly chainId?: SupportedChainIds;
|
16
16
|
readonly transport: Transport;
|
17
17
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"../../../../src/types","sources":["config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"../../../../src/types","sources":["config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAEnD;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GACzB,UAAU,GACV,SAAS,GACT,GAAG,GACH,SAAS,GACT,OAAO,GACP,QAAQ,GACR,eAAe,CAAC;AAEpB;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC;IACpC,QAAQ,CAAC,OAAO,CAAC,EAAE,iBAAiB,CAAC;IACrC,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;CAC/B"}
|
@@ -1,2 +1,2 @@
|
|
1
1
|
export * from "./declarations/src/index";
|
2
|
-
//# sourceMappingURL=
|
2
|
+
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RvcnktcHJvdG9jb2wtY29yZS1zZGsuY2pzLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuL2RlY2xhcmF0aW9ucy9zcmMvaW5kZXguZC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSJ9
|
@@ -30,24 +30,24 @@ function _interopNamespace(e) {
|
|
30
30
|
var dotenv__namespace = /*#__PURE__*/_interopNamespace(dotenv);
|
31
31
|
var axios__default = /*#__PURE__*/_interopDefault(axios);
|
32
32
|
|
33
|
-
function
|
34
|
-
if (
|
35
|
-
var
|
36
|
-
if (
|
37
|
-
var
|
38
|
-
if (
|
33
|
+
function toPrimitive(t, r) {
|
34
|
+
if ("object" != typeof t || !t) return t;
|
35
|
+
var e = t[Symbol.toPrimitive];
|
36
|
+
if (void 0 !== e) {
|
37
|
+
var i = e.call(t, r || "default");
|
38
|
+
if ("object" != typeof i) return i;
|
39
39
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
40
40
|
}
|
41
|
-
return (
|
41
|
+
return ("string" === r ? String : Number)(t);
|
42
42
|
}
|
43
43
|
|
44
|
-
function
|
45
|
-
var
|
46
|
-
return
|
44
|
+
function toPropertyKey(t) {
|
45
|
+
var i = toPrimitive(t, "string");
|
46
|
+
return "symbol" == typeof i ? i : i + "";
|
47
47
|
}
|
48
48
|
|
49
49
|
function _defineProperty(obj, key, value) {
|
50
|
-
key =
|
50
|
+
key = toPropertyKey(key);
|
51
51
|
if (key in obj) {
|
52
52
|
Object.defineProperty(obj, key, {
|
53
53
|
value: value,
|
@@ -95,7 +95,7 @@ function _defineProperties(target, props) {
|
|
95
95
|
descriptor.enumerable = descriptor.enumerable || false;
|
96
96
|
descriptor.configurable = true;
|
97
97
|
if ("value" in descriptor) descriptor.writable = true;
|
98
|
-
Object.defineProperty(target,
|
98
|
+
Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);
|
99
99
|
}
|
100
100
|
}
|
101
101
|
function _createClass(Constructor, protoProps, staticProps) {
|
@@ -215,7 +215,7 @@ function _regeneratorRuntime() {
|
|
215
215
|
function makeInvokeMethod(e, r, n) {
|
216
216
|
var o = h;
|
217
217
|
return function (i, a) {
|
218
|
-
if (o === f) throw
|
218
|
+
if (o === f) throw Error("Generator is already running");
|
219
219
|
if (o === s) {
|
220
220
|
if ("throw" === i) throw a;
|
221
221
|
return {
|
@@ -357,7 +357,7 @@ function _regeneratorRuntime() {
|
|
357
357
|
} else if (c) {
|
358
358
|
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
359
359
|
} else {
|
360
|
-
if (!u) throw
|
360
|
+
if (!u) throw Error("try statement without catch or finally");
|
361
361
|
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
362
362
|
}
|
363
363
|
}
|
@@ -397,7 +397,7 @@ function _regeneratorRuntime() {
|
|
397
397
|
return o;
|
398
398
|
}
|
399
399
|
}
|
400
|
-
throw
|
400
|
+
throw Error("illegal catch attempt");
|
401
401
|
},
|
402
402
|
delegateYield: function (e, r, n) {
|
403
403
|
return this.delegate = {
|
@@ -2251,9 +2251,9 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
2251
2251
|
* @returns A Promise that resolves to an object containing the transaction hash and optional IP ID if waitForTxn is set to true.
|
2252
2252
|
* @emits RootIPRegistered (msg.sender, ipId, policyId)
|
2253
2253
|
*/
|
2254
|
-
_createClass(IPAssetClient, [{
|
2254
|
+
return _createClass(IPAssetClient, [{
|
2255
2255
|
key: "registerRootIp",
|
2256
|
-
value: function () {
|
2256
|
+
value: (function () {
|
2257
2257
|
var _registerRootIp = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(request) {
|
2258
2258
|
var _request$txOptions, ipId, _yield$this$rpcClient, call, txHash, targetLogs;
|
2259
2259
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
@@ -2337,9 +2337,10 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
2337
2337
|
* @returns A Promise that resolves to an object containing the transaction hash and optional IP ID if waitForTxn is set to true.
|
2338
2338
|
* @emits RootIPRegistered (msg.sender, ipId, policyId)
|
2339
2339
|
*/
|
2340
|
+
)
|
2340
2341
|
}, {
|
2341
2342
|
key: "registerDerivativeIp",
|
2342
|
-
value: function () {
|
2343
|
+
value: (function () {
|
2343
2344
|
var _registerDerivativeIp = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(request) {
|
2344
2345
|
var _request$txOptions2, ipId, licenseIds, royaltyContext, _yield$this$rpcClient2, call, txHash, targetLogs;
|
2345
2346
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
@@ -2424,9 +2425,10 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
2424
2425
|
* @param tokenId The token ID of the NFT.
|
2425
2426
|
* @returns A Promise that resolves to the IP ID if the NFT is already registered, otherwise it resolves to 0x.
|
2426
2427
|
*/
|
2428
|
+
)
|
2427
2429
|
}, {
|
2428
2430
|
key: "isNFTRegistered",
|
2429
|
-
value: function () {
|
2431
|
+
value: (function () {
|
2430
2432
|
var _isNFTRegistered = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(chainId, tokenAddress, tokenId) {
|
2431
2433
|
var ipId, isRegistered;
|
2432
2434
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
@@ -2457,9 +2459,8 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
2457
2459
|
return _isNFTRegistered.apply(this, arguments);
|
2458
2460
|
}
|
2459
2461
|
return isNFTRegistered;
|
2460
|
-
}()
|
2462
|
+
}())
|
2461
2463
|
}]);
|
2462
|
-
return IPAssetClient;
|
2463
2464
|
}();
|
2464
2465
|
|
2465
2466
|
var PermissionClient = /*#__PURE__*/function () {
|
@@ -2490,9 +2491,9 @@ var PermissionClient = /*#__PURE__*/function () {
|
|
2490
2491
|
* @returns A Promise that resolves to an object containing the transaction hash
|
2491
2492
|
* @emits PermissionSet (ipAccountOwner, ipAccount, signer, to, func, permission)
|
2492
2493
|
*/
|
2493
|
-
_createClass(PermissionClient, [{
|
2494
|
+
return _createClass(PermissionClient, [{
|
2494
2495
|
key: "setPermission",
|
2495
|
-
value: function () {
|
2496
|
+
value: (function () {
|
2496
2497
|
var _setPermission = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(request) {
|
2497
2498
|
var _request$txOptions, IPAccountConfig, _yield$this$rpcClient, call, txHash;
|
2498
2499
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
@@ -2520,7 +2521,6 @@ var PermissionClient = /*#__PURE__*/function () {
|
|
2520
2521
|
request.permission // uint8
|
2521
2522
|
]
|
2522
2523
|
})],
|
2523
|
-
|
2524
2524
|
account: this.wallet.account
|
2525
2525
|
}));
|
2526
2526
|
case 4:
|
@@ -2564,9 +2564,8 @@ var PermissionClient = /*#__PURE__*/function () {
|
|
2564
2564
|
return _setPermission.apply(this, arguments);
|
2565
2565
|
}
|
2566
2566
|
return setPermission;
|
2567
|
-
}()
|
2567
|
+
}())
|
2568
2568
|
}]);
|
2569
|
-
return PermissionClient;
|
2570
2569
|
}();
|
2571
2570
|
|
2572
2571
|
var LicenseClient = /*#__PURE__*/function () {
|
@@ -2592,9 +2591,9 @@ var LicenseClient = /*#__PURE__*/function () {
|
|
2592
2591
|
* @param request.receiver Receiver address of the minted license NFT(s).
|
2593
2592
|
* @returns licenseId The ID of the minted license NFT(s).
|
2594
2593
|
*/
|
2595
|
-
_createClass(LicenseClient, [{
|
2594
|
+
return _createClass(LicenseClient, [{
|
2596
2595
|
key: "mintLicense",
|
2597
|
-
value: function () {
|
2596
|
+
value: (function () {
|
2598
2597
|
var _mintLicense = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(request) {
|
2599
2598
|
var _request$txOptions, royaltyContext, royaltyPolicy, _royaltyContext$targe, _royaltyContext$targe2, targetRoyaltyAmount, _yield$this$rpcClient, call, txHash, targetLogs;
|
2600
2599
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
@@ -2669,7 +2668,7 @@ var LicenseClient = /*#__PURE__*/function () {
|
|
2669
2668
|
return _mintLicense.apply(this, arguments);
|
2670
2669
|
}
|
2671
2670
|
return mintLicense;
|
2672
|
-
}()
|
2671
|
+
}())
|
2673
2672
|
}, {
|
2674
2673
|
key: "linkIpToParent",
|
2675
2674
|
value: function () {
|
@@ -2744,7 +2743,6 @@ var LicenseClient = /*#__PURE__*/function () {
|
|
2744
2743
|
return linkIpToParent;
|
2745
2744
|
}()
|
2746
2745
|
}]);
|
2747
|
-
return LicenseClient;
|
2748
2746
|
}();
|
2749
2747
|
|
2750
2748
|
var PolicyClient = /*#__PURE__*/function () {
|
@@ -2777,9 +2775,9 @@ var PolicyClient = /*#__PURE__*/function () {
|
|
2777
2775
|
* @param request.royaltyPolicy Address of a royalty policy contract (e.g. RoyaltyPolicyLS) that will handle royalty payments
|
2778
2776
|
* @returns the transaction hash and the policy ID if the txOptions.waitForTransaction is set to true
|
2779
2777
|
*/
|
2780
|
-
_createClass(PolicyClient, [{
|
2778
|
+
return _createClass(PolicyClient, [{
|
2781
2779
|
key: "registerPILPolicy",
|
2782
|
-
value: function () {
|
2780
|
+
value: (function () {
|
2783
2781
|
var _registerPILPolicy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(request) {
|
2784
2782
|
var _request$txOptions, frameworkData, policyId, _yield$this$rpcClient, call, txHash, targetLogs;
|
2785
2783
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
@@ -2895,9 +2893,10 @@ var PolicyClient = /*#__PURE__*/function () {
|
|
2895
2893
|
* @param request.contentRestrictions List of content restrictions where the license is valid. Empty if no restrictions.
|
2896
2894
|
* @returns the transaction hash and the policy ID if the txOptions.waitForTransaction is set to true
|
2897
2895
|
*/
|
2896
|
+
)
|
2898
2897
|
}, {
|
2899
2898
|
key: "registerPILSocialRemixPolicy",
|
2900
|
-
value: function () {
|
2899
|
+
value: (function () {
|
2901
2900
|
var _registerPILSocialRemixPolicy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(request) {
|
2902
2901
|
var _request$txOptions2, frameworkData, policyId, _yield$this$rpcClient2, call, txHash, targetLog;
|
2903
2902
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
@@ -3016,9 +3015,10 @@ var PolicyClient = /*#__PURE__*/function () {
|
|
3016
3015
|
* @param request.contentRestrictions List of content restrictions where the license is valid. Empty if no restrictions.
|
3017
3016
|
* @returns the transaction hash and the policy ID if the txOptions.waitForTransaction is set to true
|
3018
3017
|
*/
|
3018
|
+
)
|
3019
3019
|
}, {
|
3020
3020
|
key: "registerPILCommercialUsePolicy",
|
3021
|
-
value: function () {
|
3021
|
+
value: (function () {
|
3022
3022
|
var _registerPILCommercialUsePolicy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(request) {
|
3023
3023
|
var _request$txOptions3, frameworkData, policyId, _yield$this$rpcClient3, call, txHash, targetLogs;
|
3024
3024
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
@@ -3124,7 +3124,7 @@ var PolicyClient = /*#__PURE__*/function () {
|
|
3124
3124
|
return _registerPILCommercialUsePolicy.apply(this, arguments);
|
3125
3125
|
}
|
3126
3126
|
return registerPILCommercialUsePolicy;
|
3127
|
-
}()
|
3127
|
+
}())
|
3128
3128
|
}, {
|
3129
3129
|
key: "getPolicyId",
|
3130
3130
|
value: function () {
|
@@ -3178,7 +3178,7 @@ var PolicyClient = /*#__PURE__*/function () {
|
|
3178
3178
|
*/
|
3179
3179
|
}, {
|
3180
3180
|
key: "addPolicyToIp",
|
3181
|
-
value: function () {
|
3181
|
+
value: (function () {
|
3182
3182
|
var _addPolicyToIp = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(request) {
|
3183
3183
|
var _request$txOptions4, IPAccountConfig, _yield$this$rpcClient4, call, txHash, targetLogs;
|
3184
3184
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
@@ -3241,9 +3241,8 @@ var PolicyClient = /*#__PURE__*/function () {
|
|
3241
3241
|
return _addPolicyToIp.apply(this, arguments);
|
3242
3242
|
}
|
3243
3243
|
return addPolicyToIp;
|
3244
|
-
}()
|
3244
|
+
}())
|
3245
3245
|
}]);
|
3246
|
-
return PolicyClient;
|
3247
3246
|
}();
|
3248
3247
|
|
3249
3248
|
var DisputeClient = /*#__PURE__*/function () {
|
@@ -3270,9 +3269,9 @@ var DisputeClient = /*#__PURE__*/function () {
|
|
3270
3269
|
* @calls raiseDispute(address _targetIpId, string memory _linkToDisputeEvidence, bytes32 _targetTag, bytes calldata _data) external nonReentrant returns (uint256) {
|
3271
3270
|
* @emits DisputeRaised (disputeId_, targetIpId, msg.sender, arbitrationPolicy, linkToDisputeEvidence, targetTag, calldata);
|
3272
3271
|
*/
|
3273
|
-
_createClass(DisputeClient, [{
|
3272
|
+
return _createClass(DisputeClient, [{
|
3274
3273
|
key: "raiseDispute",
|
3275
|
-
value: function () {
|
3274
|
+
value: (function () {
|
3276
3275
|
var _raiseDispute = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(request) {
|
3277
3276
|
var _request$txOptions, _yield$this$rpcClient, call, txHash, targetLogs;
|
3278
3277
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
@@ -3339,9 +3338,10 @@ var DisputeClient = /*#__PURE__*/function () {
|
|
3339
3338
|
* @calls cancelDispute(uint256 _disputeId, bytes calldata _data) external nonReentrant {
|
3340
3339
|
* @emits DisputeCancelled (_disputeId, _data);
|
3341
3340
|
*/
|
3341
|
+
)
|
3342
3342
|
}, {
|
3343
3343
|
key: "cancelDispute",
|
3344
|
-
value: function () {
|
3344
|
+
value: (function () {
|
3345
3345
|
var _cancelDispute = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(request) {
|
3346
3346
|
var _request$txOptions2, _yield$this$rpcClient2, call, txHash;
|
3347
3347
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
@@ -3395,9 +3395,10 @@ var DisputeClient = /*#__PURE__*/function () {
|
|
3395
3395
|
* @throws NotDisputeInitiator, if the transaction executor is not the one that initiated the dispute
|
3396
3396
|
* @emits DisputeResolved (_disputeId)
|
3397
3397
|
*/
|
3398
|
+
)
|
3398
3399
|
}, {
|
3399
3400
|
key: "resolveDispute",
|
3400
|
-
value: function () {
|
3401
|
+
value: (function () {
|
3401
3402
|
var _resolveDispute = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(request) {
|
3402
3403
|
var _request$txOptions3, _yield$this$rpcClient3, call, txHash;
|
3403
3404
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
@@ -3441,9 +3442,8 @@ var DisputeClient = /*#__PURE__*/function () {
|
|
3441
3442
|
return _resolveDispute.apply(this, arguments);
|
3442
3443
|
}
|
3443
3444
|
return resolveDispute;
|
3444
|
-
}()
|
3445
|
+
}())
|
3445
3446
|
}]);
|
3446
|
-
return DisputeClient;
|
3447
3447
|
}();
|
3448
3448
|
|
3449
3449
|
var IPAccountClient = /*#__PURE__*/function () {
|
@@ -3461,9 +3461,9 @@ var IPAccountClient = /*#__PURE__*/function () {
|
|
3461
3461
|
* @param request.data The data to send along with the transaction.
|
3462
3462
|
* @returns Tx hash for the transaction.
|
3463
3463
|
*/
|
3464
|
-
_createClass(IPAccountClient, [{
|
3464
|
+
return _createClass(IPAccountClient, [{
|
3465
3465
|
key: "execute",
|
3466
|
-
value: function () {
|
3466
|
+
value: (function () {
|
3467
3467
|
var _execute = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(request) {
|
3468
3468
|
var _request$txOptions, IPAccountConfig, _yield$this$rpcClient, call, txHash;
|
3469
3469
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
@@ -3522,9 +3522,10 @@ var IPAccountClient = /*#__PURE__*/function () {
|
|
3522
3522
|
* @param request.signature The signature of the transaction, EIP-712 encoded.
|
3523
3523
|
* @returns Tx hash for the transaction.
|
3524
3524
|
*/
|
3525
|
+
)
|
3525
3526
|
}, {
|
3526
3527
|
key: "executeWithSig",
|
3527
|
-
value: function () {
|
3528
|
+
value: (function () {
|
3528
3529
|
var _executeWithSig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(request) {
|
3529
3530
|
var _request$txOptions2, IPAccountConfig, _yield$this$rpcClient2, call, txHash;
|
3530
3531
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
@@ -3572,9 +3573,8 @@ var IPAccountClient = /*#__PURE__*/function () {
|
|
3572
3573
|
return _executeWithSig.apply(this, arguments);
|
3573
3574
|
}
|
3574
3575
|
return executeWithSig;
|
3575
|
-
}()
|
3576
|
+
}())
|
3576
3577
|
}]);
|
3577
|
-
return IPAccountClient;
|
3578
3578
|
}();
|
3579
3579
|
|
3580
3580
|
var StoryAPIClient = /*#__PURE__*/function () {
|
@@ -3588,7 +3588,7 @@ var StoryAPIClient = /*#__PURE__*/function () {
|
|
3588
3588
|
}
|
3589
3589
|
});
|
3590
3590
|
}
|
3591
|
-
_createClass(StoryAPIClient, [{
|
3591
|
+
return _createClass(StoryAPIClient, [{
|
3592
3592
|
key: "getRoyaltyPolicy",
|
3593
3593
|
value: function () {
|
3594
3594
|
var _getRoyaltyPolicy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(ipId) {
|
@@ -3661,7 +3661,6 @@ var StoryAPIClient = /*#__PURE__*/function () {
|
|
3661
3661
|
return getPolicy;
|
3662
3662
|
}()
|
3663
3663
|
}]);
|
3664
|
-
return StoryAPIClient;
|
3665
3664
|
}();
|
3666
3665
|
|
3667
3666
|
if (typeof process !== "undefined") {
|
@@ -3706,7 +3705,7 @@ var StoryClient = /*#__PURE__*/function () {
|
|
3706
3705
|
*
|
3707
3706
|
* @param config - the configuration for a new SDK client
|
3708
3707
|
*/
|
3709
|
-
_createClass(StoryClient, [{
|
3708
|
+
return _createClass(StoryClient, [{
|
3710
3709
|
key: "ipAsset",
|
3711
3710
|
get:
|
3712
3711
|
/**
|
@@ -3802,7 +3801,6 @@ var StoryClient = /*#__PURE__*/function () {
|
|
3802
3801
|
return new StoryClient(config);
|
3803
3802
|
}
|
3804
3803
|
}]);
|
3805
|
-
return StoryClient;
|
3806
3804
|
}();
|
3807
3805
|
|
3808
3806
|
exports.AddressZero = AddressZero;
|
@@ -30,24 +30,24 @@ function _interopNamespace(e) {
|
|
30
30
|
var dotenv__namespace = /*#__PURE__*/_interopNamespace(dotenv);
|
31
31
|
var axios__default = /*#__PURE__*/_interopDefault(axios);
|
32
32
|
|
33
|
-
function
|
34
|
-
if (
|
35
|
-
var
|
36
|
-
if (
|
37
|
-
var
|
38
|
-
if (
|
33
|
+
function toPrimitive(t, r) {
|
34
|
+
if ("object" != typeof t || !t) return t;
|
35
|
+
var e = t[Symbol.toPrimitive];
|
36
|
+
if (void 0 !== e) {
|
37
|
+
var i = e.call(t, r || "default");
|
38
|
+
if ("object" != typeof i) return i;
|
39
39
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
40
40
|
}
|
41
|
-
return (
|
41
|
+
return ("string" === r ? String : Number)(t);
|
42
42
|
}
|
43
43
|
|
44
|
-
function
|
45
|
-
var
|
46
|
-
return
|
44
|
+
function toPropertyKey(t) {
|
45
|
+
var i = toPrimitive(t, "string");
|
46
|
+
return "symbol" == typeof i ? i : i + "";
|
47
47
|
}
|
48
48
|
|
49
49
|
function _defineProperty(obj, key, value) {
|
50
|
-
key =
|
50
|
+
key = toPropertyKey(key);
|
51
51
|
if (key in obj) {
|
52
52
|
Object.defineProperty(obj, key, {
|
53
53
|
value: value,
|
@@ -95,7 +95,7 @@ function _defineProperties(target, props) {
|
|
95
95
|
descriptor.enumerable = descriptor.enumerable || false;
|
96
96
|
descriptor.configurable = true;
|
97
97
|
if ("value" in descriptor) descriptor.writable = true;
|
98
|
-
Object.defineProperty(target,
|
98
|
+
Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);
|
99
99
|
}
|
100
100
|
}
|
101
101
|
function _createClass(Constructor, protoProps, staticProps) {
|
@@ -215,7 +215,7 @@ function _regeneratorRuntime() {
|
|
215
215
|
function makeInvokeMethod(e, r, n) {
|
216
216
|
var o = h;
|
217
217
|
return function (i, a) {
|
218
|
-
if (o === f) throw
|
218
|
+
if (o === f) throw Error("Generator is already running");
|
219
219
|
if (o === s) {
|
220
220
|
if ("throw" === i) throw a;
|
221
221
|
return {
|
@@ -357,7 +357,7 @@ function _regeneratorRuntime() {
|
|
357
357
|
} else if (c) {
|
358
358
|
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
359
359
|
} else {
|
360
|
-
if (!u) throw
|
360
|
+
if (!u) throw Error("try statement without catch or finally");
|
361
361
|
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
362
362
|
}
|
363
363
|
}
|
@@ -397,7 +397,7 @@ function _regeneratorRuntime() {
|
|
397
397
|
return o;
|
398
398
|
}
|
399
399
|
}
|
400
|
-
throw
|
400
|
+
throw Error("illegal catch attempt");
|
401
401
|
},
|
402
402
|
delegateYield: function (e, r, n) {
|
403
403
|
return this.delegate = {
|
@@ -2251,9 +2251,9 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
2251
2251
|
* @returns A Promise that resolves to an object containing the transaction hash and optional IP ID if waitForTxn is set to true.
|
2252
2252
|
* @emits RootIPRegistered (msg.sender, ipId, policyId)
|
2253
2253
|
*/
|
2254
|
-
_createClass(IPAssetClient, [{
|
2254
|
+
return _createClass(IPAssetClient, [{
|
2255
2255
|
key: "registerRootIp",
|
2256
|
-
value: function () {
|
2256
|
+
value: (function () {
|
2257
2257
|
var _registerRootIp = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(request) {
|
2258
2258
|
var _request$txOptions, ipId, _yield$this$rpcClient, call, txHash, targetLogs;
|
2259
2259
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
@@ -2337,9 +2337,10 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
2337
2337
|
* @returns A Promise that resolves to an object containing the transaction hash and optional IP ID if waitForTxn is set to true.
|
2338
2338
|
* @emits RootIPRegistered (msg.sender, ipId, policyId)
|
2339
2339
|
*/
|
2340
|
+
)
|
2340
2341
|
}, {
|
2341
2342
|
key: "registerDerivativeIp",
|
2342
|
-
value: function () {
|
2343
|
+
value: (function () {
|
2343
2344
|
var _registerDerivativeIp = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(request) {
|
2344
2345
|
var _request$txOptions2, ipId, licenseIds, royaltyContext, _yield$this$rpcClient2, call, txHash, targetLogs;
|
2345
2346
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
@@ -2424,9 +2425,10 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
2424
2425
|
* @param tokenId The token ID of the NFT.
|
2425
2426
|
* @returns A Promise that resolves to the IP ID if the NFT is already registered, otherwise it resolves to 0x.
|
2426
2427
|
*/
|
2428
|
+
)
|
2427
2429
|
}, {
|
2428
2430
|
key: "isNFTRegistered",
|
2429
|
-
value: function () {
|
2431
|
+
value: (function () {
|
2430
2432
|
var _isNFTRegistered = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(chainId, tokenAddress, tokenId) {
|
2431
2433
|
var ipId, isRegistered;
|
2432
2434
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
@@ -2457,9 +2459,8 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
2457
2459
|
return _isNFTRegistered.apply(this, arguments);
|
2458
2460
|
}
|
2459
2461
|
return isNFTRegistered;
|
2460
|
-
}()
|
2462
|
+
}())
|
2461
2463
|
}]);
|
2462
|
-
return IPAssetClient;
|
2463
2464
|
}();
|
2464
2465
|
|
2465
2466
|
var PermissionClient = /*#__PURE__*/function () {
|
@@ -2490,9 +2491,9 @@ var PermissionClient = /*#__PURE__*/function () {
|
|
2490
2491
|
* @returns A Promise that resolves to an object containing the transaction hash
|
2491
2492
|
* @emits PermissionSet (ipAccountOwner, ipAccount, signer, to, func, permission)
|
2492
2493
|
*/
|
2493
|
-
_createClass(PermissionClient, [{
|
2494
|
+
return _createClass(PermissionClient, [{
|
2494
2495
|
key: "setPermission",
|
2495
|
-
value: function () {
|
2496
|
+
value: (function () {
|
2496
2497
|
var _setPermission = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(request) {
|
2497
2498
|
var _request$txOptions, IPAccountConfig, _yield$this$rpcClient, call, txHash;
|
2498
2499
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
@@ -2520,7 +2521,6 @@ var PermissionClient = /*#__PURE__*/function () {
|
|
2520
2521
|
request.permission // uint8
|
2521
2522
|
]
|
2522
2523
|
})],
|
2523
|
-
|
2524
2524
|
account: this.wallet.account
|
2525
2525
|
}));
|
2526
2526
|
case 4:
|
@@ -2564,9 +2564,8 @@ var PermissionClient = /*#__PURE__*/function () {
|
|
2564
2564
|
return _setPermission.apply(this, arguments);
|
2565
2565
|
}
|
2566
2566
|
return setPermission;
|
2567
|
-
}()
|
2567
|
+
}())
|
2568
2568
|
}]);
|
2569
|
-
return PermissionClient;
|
2570
2569
|
}();
|
2571
2570
|
|
2572
2571
|
var LicenseClient = /*#__PURE__*/function () {
|
@@ -2592,9 +2591,9 @@ var LicenseClient = /*#__PURE__*/function () {
|
|
2592
2591
|
* @param request.receiver Receiver address of the minted license NFT(s).
|
2593
2592
|
* @returns licenseId The ID of the minted license NFT(s).
|
2594
2593
|
*/
|
2595
|
-
_createClass(LicenseClient, [{
|
2594
|
+
return _createClass(LicenseClient, [{
|
2596
2595
|
key: "mintLicense",
|
2597
|
-
value: function () {
|
2596
|
+
value: (function () {
|
2598
2597
|
var _mintLicense = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(request) {
|
2599
2598
|
var _request$txOptions, royaltyContext, royaltyPolicy, _royaltyContext$targe, _royaltyContext$targe2, targetRoyaltyAmount, _yield$this$rpcClient, call, txHash, targetLogs;
|
2600
2599
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
@@ -2669,7 +2668,7 @@ var LicenseClient = /*#__PURE__*/function () {
|
|
2669
2668
|
return _mintLicense.apply(this, arguments);
|
2670
2669
|
}
|
2671
2670
|
return mintLicense;
|
2672
|
-
}()
|
2671
|
+
}())
|
2673
2672
|
}, {
|
2674
2673
|
key: "linkIpToParent",
|
2675
2674
|
value: function () {
|
@@ -2744,7 +2743,6 @@ var LicenseClient = /*#__PURE__*/function () {
|
|
2744
2743
|
return linkIpToParent;
|
2745
2744
|
}()
|
2746
2745
|
}]);
|
2747
|
-
return LicenseClient;
|
2748
2746
|
}();
|
2749
2747
|
|
2750
2748
|
var PolicyClient = /*#__PURE__*/function () {
|
@@ -2777,9 +2775,9 @@ var PolicyClient = /*#__PURE__*/function () {
|
|
2777
2775
|
* @param request.royaltyPolicy Address of a royalty policy contract (e.g. RoyaltyPolicyLS) that will handle royalty payments
|
2778
2776
|
* @returns the transaction hash and the policy ID if the txOptions.waitForTransaction is set to true
|
2779
2777
|
*/
|
2780
|
-
_createClass(PolicyClient, [{
|
2778
|
+
return _createClass(PolicyClient, [{
|
2781
2779
|
key: "registerPILPolicy",
|
2782
|
-
value: function () {
|
2780
|
+
value: (function () {
|
2783
2781
|
var _registerPILPolicy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(request) {
|
2784
2782
|
var _request$txOptions, frameworkData, policyId, _yield$this$rpcClient, call, txHash, targetLogs;
|
2785
2783
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
@@ -2895,9 +2893,10 @@ var PolicyClient = /*#__PURE__*/function () {
|
|
2895
2893
|
* @param request.contentRestrictions List of content restrictions where the license is valid. Empty if no restrictions.
|
2896
2894
|
* @returns the transaction hash and the policy ID if the txOptions.waitForTransaction is set to true
|
2897
2895
|
*/
|
2896
|
+
)
|
2898
2897
|
}, {
|
2899
2898
|
key: "registerPILSocialRemixPolicy",
|
2900
|
-
value: function () {
|
2899
|
+
value: (function () {
|
2901
2900
|
var _registerPILSocialRemixPolicy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(request) {
|
2902
2901
|
var _request$txOptions2, frameworkData, policyId, _yield$this$rpcClient2, call, txHash, targetLog;
|
2903
2902
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
@@ -3016,9 +3015,10 @@ var PolicyClient = /*#__PURE__*/function () {
|
|
3016
3015
|
* @param request.contentRestrictions List of content restrictions where the license is valid. Empty if no restrictions.
|
3017
3016
|
* @returns the transaction hash and the policy ID if the txOptions.waitForTransaction is set to true
|
3018
3017
|
*/
|
3018
|
+
)
|
3019
3019
|
}, {
|
3020
3020
|
key: "registerPILCommercialUsePolicy",
|
3021
|
-
value: function () {
|
3021
|
+
value: (function () {
|
3022
3022
|
var _registerPILCommercialUsePolicy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(request) {
|
3023
3023
|
var _request$txOptions3, frameworkData, policyId, _yield$this$rpcClient3, call, txHash, targetLogs;
|
3024
3024
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
@@ -3124,7 +3124,7 @@ var PolicyClient = /*#__PURE__*/function () {
|
|
3124
3124
|
return _registerPILCommercialUsePolicy.apply(this, arguments);
|
3125
3125
|
}
|
3126
3126
|
return registerPILCommercialUsePolicy;
|
3127
|
-
}()
|
3127
|
+
}())
|
3128
3128
|
}, {
|
3129
3129
|
key: "getPolicyId",
|
3130
3130
|
value: function () {
|
@@ -3178,7 +3178,7 @@ var PolicyClient = /*#__PURE__*/function () {
|
|
3178
3178
|
*/
|
3179
3179
|
}, {
|
3180
3180
|
key: "addPolicyToIp",
|
3181
|
-
value: function () {
|
3181
|
+
value: (function () {
|
3182
3182
|
var _addPolicyToIp = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(request) {
|
3183
3183
|
var _request$txOptions4, IPAccountConfig, _yield$this$rpcClient4, call, txHash, targetLogs;
|
3184
3184
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
@@ -3241,9 +3241,8 @@ var PolicyClient = /*#__PURE__*/function () {
|
|
3241
3241
|
return _addPolicyToIp.apply(this, arguments);
|
3242
3242
|
}
|
3243
3243
|
return addPolicyToIp;
|
3244
|
-
}()
|
3244
|
+
}())
|
3245
3245
|
}]);
|
3246
|
-
return PolicyClient;
|
3247
3246
|
}();
|
3248
3247
|
|
3249
3248
|
var DisputeClient = /*#__PURE__*/function () {
|
@@ -3270,9 +3269,9 @@ var DisputeClient = /*#__PURE__*/function () {
|
|
3270
3269
|
* @calls raiseDispute(address _targetIpId, string memory _linkToDisputeEvidence, bytes32 _targetTag, bytes calldata _data) external nonReentrant returns (uint256) {
|
3271
3270
|
* @emits DisputeRaised (disputeId_, targetIpId, msg.sender, arbitrationPolicy, linkToDisputeEvidence, targetTag, calldata);
|
3272
3271
|
*/
|
3273
|
-
_createClass(DisputeClient, [{
|
3272
|
+
return _createClass(DisputeClient, [{
|
3274
3273
|
key: "raiseDispute",
|
3275
|
-
value: function () {
|
3274
|
+
value: (function () {
|
3276
3275
|
var _raiseDispute = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(request) {
|
3277
3276
|
var _request$txOptions, _yield$this$rpcClient, call, txHash, targetLogs;
|
3278
3277
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
@@ -3339,9 +3338,10 @@ var DisputeClient = /*#__PURE__*/function () {
|
|
3339
3338
|
* @calls cancelDispute(uint256 _disputeId, bytes calldata _data) external nonReentrant {
|
3340
3339
|
* @emits DisputeCancelled (_disputeId, _data);
|
3341
3340
|
*/
|
3341
|
+
)
|
3342
3342
|
}, {
|
3343
3343
|
key: "cancelDispute",
|
3344
|
-
value: function () {
|
3344
|
+
value: (function () {
|
3345
3345
|
var _cancelDispute = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(request) {
|
3346
3346
|
var _request$txOptions2, _yield$this$rpcClient2, call, txHash;
|
3347
3347
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
@@ -3395,9 +3395,10 @@ var DisputeClient = /*#__PURE__*/function () {
|
|
3395
3395
|
* @throws NotDisputeInitiator, if the transaction executor is not the one that initiated the dispute
|
3396
3396
|
* @emits DisputeResolved (_disputeId)
|
3397
3397
|
*/
|
3398
|
+
)
|
3398
3399
|
}, {
|
3399
3400
|
key: "resolveDispute",
|
3400
|
-
value: function () {
|
3401
|
+
value: (function () {
|
3401
3402
|
var _resolveDispute = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(request) {
|
3402
3403
|
var _request$txOptions3, _yield$this$rpcClient3, call, txHash;
|
3403
3404
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
@@ -3441,9 +3442,8 @@ var DisputeClient = /*#__PURE__*/function () {
|
|
3441
3442
|
return _resolveDispute.apply(this, arguments);
|
3442
3443
|
}
|
3443
3444
|
return resolveDispute;
|
3444
|
-
}()
|
3445
|
+
}())
|
3445
3446
|
}]);
|
3446
|
-
return DisputeClient;
|
3447
3447
|
}();
|
3448
3448
|
|
3449
3449
|
var IPAccountClient = /*#__PURE__*/function () {
|
@@ -3461,9 +3461,9 @@ var IPAccountClient = /*#__PURE__*/function () {
|
|
3461
3461
|
* @param request.data The data to send along with the transaction.
|
3462
3462
|
* @returns Tx hash for the transaction.
|
3463
3463
|
*/
|
3464
|
-
_createClass(IPAccountClient, [{
|
3464
|
+
return _createClass(IPAccountClient, [{
|
3465
3465
|
key: "execute",
|
3466
|
-
value: function () {
|
3466
|
+
value: (function () {
|
3467
3467
|
var _execute = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(request) {
|
3468
3468
|
var _request$txOptions, IPAccountConfig, _yield$this$rpcClient, call, txHash;
|
3469
3469
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
@@ -3522,9 +3522,10 @@ var IPAccountClient = /*#__PURE__*/function () {
|
|
3522
3522
|
* @param request.signature The signature of the transaction, EIP-712 encoded.
|
3523
3523
|
* @returns Tx hash for the transaction.
|
3524
3524
|
*/
|
3525
|
+
)
|
3525
3526
|
}, {
|
3526
3527
|
key: "executeWithSig",
|
3527
|
-
value: function () {
|
3528
|
+
value: (function () {
|
3528
3529
|
var _executeWithSig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(request) {
|
3529
3530
|
var _request$txOptions2, IPAccountConfig, _yield$this$rpcClient2, call, txHash;
|
3530
3531
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
@@ -3572,9 +3573,8 @@ var IPAccountClient = /*#__PURE__*/function () {
|
|
3572
3573
|
return _executeWithSig.apply(this, arguments);
|
3573
3574
|
}
|
3574
3575
|
return executeWithSig;
|
3575
|
-
}()
|
3576
|
+
}())
|
3576
3577
|
}]);
|
3577
|
-
return IPAccountClient;
|
3578
3578
|
}();
|
3579
3579
|
|
3580
3580
|
var StoryAPIClient = /*#__PURE__*/function () {
|
@@ -3588,7 +3588,7 @@ var StoryAPIClient = /*#__PURE__*/function () {
|
|
3588
3588
|
}
|
3589
3589
|
});
|
3590
3590
|
}
|
3591
|
-
_createClass(StoryAPIClient, [{
|
3591
|
+
return _createClass(StoryAPIClient, [{
|
3592
3592
|
key: "getRoyaltyPolicy",
|
3593
3593
|
value: function () {
|
3594
3594
|
var _getRoyaltyPolicy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(ipId) {
|
@@ -3661,7 +3661,6 @@ var StoryAPIClient = /*#__PURE__*/function () {
|
|
3661
3661
|
return getPolicy;
|
3662
3662
|
}()
|
3663
3663
|
}]);
|
3664
|
-
return StoryAPIClient;
|
3665
3664
|
}();
|
3666
3665
|
|
3667
3666
|
if (typeof process !== "undefined") {
|
@@ -3706,7 +3705,7 @@ var StoryClient = /*#__PURE__*/function () {
|
|
3706
3705
|
*
|
3707
3706
|
* @param config - the configuration for a new SDK client
|
3708
3707
|
*/
|
3709
|
-
_createClass(StoryClient, [{
|
3708
|
+
return _createClass(StoryClient, [{
|
3710
3709
|
key: "ipAsset",
|
3711
3710
|
get:
|
3712
3711
|
/**
|
@@ -3802,7 +3801,6 @@ var StoryClient = /*#__PURE__*/function () {
|
|
3802
3801
|
return new StoryClient(config);
|
3803
3802
|
}
|
3804
3803
|
}]);
|
3805
|
-
return StoryClient;
|
3806
3804
|
}();
|
3807
3805
|
|
3808
3806
|
exports.AddressZero = AddressZero;
|
@@ -3,24 +3,24 @@ import * as dotenv from 'dotenv';
|
|
3
3
|
import { polygonMumbai, sepolia as sepolia$1, mainnet } from 'viem/chains';
|
4
4
|
import axios from 'axios';
|
5
5
|
|
6
|
-
function
|
7
|
-
if (
|
8
|
-
var
|
9
|
-
if (
|
10
|
-
var
|
11
|
-
if (
|
6
|
+
function toPrimitive(t, r) {
|
7
|
+
if ("object" != typeof t || !t) return t;
|
8
|
+
var e = t[Symbol.toPrimitive];
|
9
|
+
if (void 0 !== e) {
|
10
|
+
var i = e.call(t, r || "default");
|
11
|
+
if ("object" != typeof i) return i;
|
12
12
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
13
13
|
}
|
14
|
-
return (
|
14
|
+
return ("string" === r ? String : Number)(t);
|
15
15
|
}
|
16
16
|
|
17
|
-
function
|
18
|
-
var
|
19
|
-
return
|
17
|
+
function toPropertyKey(t) {
|
18
|
+
var i = toPrimitive(t, "string");
|
19
|
+
return "symbol" == typeof i ? i : i + "";
|
20
20
|
}
|
21
21
|
|
22
22
|
function _defineProperty(obj, key, value) {
|
23
|
-
key =
|
23
|
+
key = toPropertyKey(key);
|
24
24
|
if (key in obj) {
|
25
25
|
Object.defineProperty(obj, key, {
|
26
26
|
value: value,
|
@@ -68,7 +68,7 @@ function _defineProperties(target, props) {
|
|
68
68
|
descriptor.enumerable = descriptor.enumerable || false;
|
69
69
|
descriptor.configurable = true;
|
70
70
|
if ("value" in descriptor) descriptor.writable = true;
|
71
|
-
Object.defineProperty(target,
|
71
|
+
Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);
|
72
72
|
}
|
73
73
|
}
|
74
74
|
function _createClass(Constructor, protoProps, staticProps) {
|
@@ -188,7 +188,7 @@ function _regeneratorRuntime() {
|
|
188
188
|
function makeInvokeMethod(e, r, n) {
|
189
189
|
var o = h;
|
190
190
|
return function (i, a) {
|
191
|
-
if (o === f) throw
|
191
|
+
if (o === f) throw Error("Generator is already running");
|
192
192
|
if (o === s) {
|
193
193
|
if ("throw" === i) throw a;
|
194
194
|
return {
|
@@ -330,7 +330,7 @@ function _regeneratorRuntime() {
|
|
330
330
|
} else if (c) {
|
331
331
|
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
332
332
|
} else {
|
333
|
-
if (!u) throw
|
333
|
+
if (!u) throw Error("try statement without catch or finally");
|
334
334
|
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
335
335
|
}
|
336
336
|
}
|
@@ -370,7 +370,7 @@ function _regeneratorRuntime() {
|
|
370
370
|
return o;
|
371
371
|
}
|
372
372
|
}
|
373
|
-
throw
|
373
|
+
throw Error("illegal catch attempt");
|
374
374
|
},
|
375
375
|
delegateYield: function (e, r, n) {
|
376
376
|
return this.delegate = {
|
@@ -2224,9 +2224,9 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
2224
2224
|
* @returns A Promise that resolves to an object containing the transaction hash and optional IP ID if waitForTxn is set to true.
|
2225
2225
|
* @emits RootIPRegistered (msg.sender, ipId, policyId)
|
2226
2226
|
*/
|
2227
|
-
_createClass(IPAssetClient, [{
|
2227
|
+
return _createClass(IPAssetClient, [{
|
2228
2228
|
key: "registerRootIp",
|
2229
|
-
value: function () {
|
2229
|
+
value: (function () {
|
2230
2230
|
var _registerRootIp = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(request) {
|
2231
2231
|
var _request$txOptions, ipId, _yield$this$rpcClient, call, txHash, targetLogs;
|
2232
2232
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
@@ -2310,9 +2310,10 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
2310
2310
|
* @returns A Promise that resolves to an object containing the transaction hash and optional IP ID if waitForTxn is set to true.
|
2311
2311
|
* @emits RootIPRegistered (msg.sender, ipId, policyId)
|
2312
2312
|
*/
|
2313
|
+
)
|
2313
2314
|
}, {
|
2314
2315
|
key: "registerDerivativeIp",
|
2315
|
-
value: function () {
|
2316
|
+
value: (function () {
|
2316
2317
|
var _registerDerivativeIp = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(request) {
|
2317
2318
|
var _request$txOptions2, ipId, licenseIds, royaltyContext, _yield$this$rpcClient2, call, txHash, targetLogs;
|
2318
2319
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
@@ -2397,9 +2398,10 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
2397
2398
|
* @param tokenId The token ID of the NFT.
|
2398
2399
|
* @returns A Promise that resolves to the IP ID if the NFT is already registered, otherwise it resolves to 0x.
|
2399
2400
|
*/
|
2401
|
+
)
|
2400
2402
|
}, {
|
2401
2403
|
key: "isNFTRegistered",
|
2402
|
-
value: function () {
|
2404
|
+
value: (function () {
|
2403
2405
|
var _isNFTRegistered = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(chainId, tokenAddress, tokenId) {
|
2404
2406
|
var ipId, isRegistered;
|
2405
2407
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
@@ -2430,9 +2432,8 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
2430
2432
|
return _isNFTRegistered.apply(this, arguments);
|
2431
2433
|
}
|
2432
2434
|
return isNFTRegistered;
|
2433
|
-
}()
|
2435
|
+
}())
|
2434
2436
|
}]);
|
2435
|
-
return IPAssetClient;
|
2436
2437
|
}();
|
2437
2438
|
|
2438
2439
|
var PermissionClient = /*#__PURE__*/function () {
|
@@ -2463,9 +2464,9 @@ var PermissionClient = /*#__PURE__*/function () {
|
|
2463
2464
|
* @returns A Promise that resolves to an object containing the transaction hash
|
2464
2465
|
* @emits PermissionSet (ipAccountOwner, ipAccount, signer, to, func, permission)
|
2465
2466
|
*/
|
2466
|
-
_createClass(PermissionClient, [{
|
2467
|
+
return _createClass(PermissionClient, [{
|
2467
2468
|
key: "setPermission",
|
2468
|
-
value: function () {
|
2469
|
+
value: (function () {
|
2469
2470
|
var _setPermission = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(request) {
|
2470
2471
|
var _request$txOptions, IPAccountConfig, _yield$this$rpcClient, call, txHash;
|
2471
2472
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
@@ -2493,7 +2494,6 @@ var PermissionClient = /*#__PURE__*/function () {
|
|
2493
2494
|
request.permission // uint8
|
2494
2495
|
]
|
2495
2496
|
})],
|
2496
|
-
|
2497
2497
|
account: this.wallet.account
|
2498
2498
|
}));
|
2499
2499
|
case 4:
|
@@ -2537,9 +2537,8 @@ var PermissionClient = /*#__PURE__*/function () {
|
|
2537
2537
|
return _setPermission.apply(this, arguments);
|
2538
2538
|
}
|
2539
2539
|
return setPermission;
|
2540
|
-
}()
|
2540
|
+
}())
|
2541
2541
|
}]);
|
2542
|
-
return PermissionClient;
|
2543
2542
|
}();
|
2544
2543
|
|
2545
2544
|
var LicenseClient = /*#__PURE__*/function () {
|
@@ -2565,9 +2564,9 @@ var LicenseClient = /*#__PURE__*/function () {
|
|
2565
2564
|
* @param request.receiver Receiver address of the minted license NFT(s).
|
2566
2565
|
* @returns licenseId The ID of the minted license NFT(s).
|
2567
2566
|
*/
|
2568
|
-
_createClass(LicenseClient, [{
|
2567
|
+
return _createClass(LicenseClient, [{
|
2569
2568
|
key: "mintLicense",
|
2570
|
-
value: function () {
|
2569
|
+
value: (function () {
|
2571
2570
|
var _mintLicense = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(request) {
|
2572
2571
|
var _request$txOptions, royaltyContext, royaltyPolicy, _royaltyContext$targe, _royaltyContext$targe2, targetRoyaltyAmount, _yield$this$rpcClient, call, txHash, targetLogs;
|
2573
2572
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
@@ -2642,7 +2641,7 @@ var LicenseClient = /*#__PURE__*/function () {
|
|
2642
2641
|
return _mintLicense.apply(this, arguments);
|
2643
2642
|
}
|
2644
2643
|
return mintLicense;
|
2645
|
-
}()
|
2644
|
+
}())
|
2646
2645
|
}, {
|
2647
2646
|
key: "linkIpToParent",
|
2648
2647
|
value: function () {
|
@@ -2717,7 +2716,6 @@ var LicenseClient = /*#__PURE__*/function () {
|
|
2717
2716
|
return linkIpToParent;
|
2718
2717
|
}()
|
2719
2718
|
}]);
|
2720
|
-
return LicenseClient;
|
2721
2719
|
}();
|
2722
2720
|
|
2723
2721
|
var PolicyClient = /*#__PURE__*/function () {
|
@@ -2750,9 +2748,9 @@ var PolicyClient = /*#__PURE__*/function () {
|
|
2750
2748
|
* @param request.royaltyPolicy Address of a royalty policy contract (e.g. RoyaltyPolicyLS) that will handle royalty payments
|
2751
2749
|
* @returns the transaction hash and the policy ID if the txOptions.waitForTransaction is set to true
|
2752
2750
|
*/
|
2753
|
-
_createClass(PolicyClient, [{
|
2751
|
+
return _createClass(PolicyClient, [{
|
2754
2752
|
key: "registerPILPolicy",
|
2755
|
-
value: function () {
|
2753
|
+
value: (function () {
|
2756
2754
|
var _registerPILPolicy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(request) {
|
2757
2755
|
var _request$txOptions, frameworkData, policyId, _yield$this$rpcClient, call, txHash, targetLogs;
|
2758
2756
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
@@ -2868,9 +2866,10 @@ var PolicyClient = /*#__PURE__*/function () {
|
|
2868
2866
|
* @param request.contentRestrictions List of content restrictions where the license is valid. Empty if no restrictions.
|
2869
2867
|
* @returns the transaction hash and the policy ID if the txOptions.waitForTransaction is set to true
|
2870
2868
|
*/
|
2869
|
+
)
|
2871
2870
|
}, {
|
2872
2871
|
key: "registerPILSocialRemixPolicy",
|
2873
|
-
value: function () {
|
2872
|
+
value: (function () {
|
2874
2873
|
var _registerPILSocialRemixPolicy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(request) {
|
2875
2874
|
var _request$txOptions2, frameworkData, policyId, _yield$this$rpcClient2, call, txHash, targetLog;
|
2876
2875
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
@@ -2989,9 +2988,10 @@ var PolicyClient = /*#__PURE__*/function () {
|
|
2989
2988
|
* @param request.contentRestrictions List of content restrictions where the license is valid. Empty if no restrictions.
|
2990
2989
|
* @returns the transaction hash and the policy ID if the txOptions.waitForTransaction is set to true
|
2991
2990
|
*/
|
2991
|
+
)
|
2992
2992
|
}, {
|
2993
2993
|
key: "registerPILCommercialUsePolicy",
|
2994
|
-
value: function () {
|
2994
|
+
value: (function () {
|
2995
2995
|
var _registerPILCommercialUsePolicy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(request) {
|
2996
2996
|
var _request$txOptions3, frameworkData, policyId, _yield$this$rpcClient3, call, txHash, targetLogs;
|
2997
2997
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
@@ -3097,7 +3097,7 @@ var PolicyClient = /*#__PURE__*/function () {
|
|
3097
3097
|
return _registerPILCommercialUsePolicy.apply(this, arguments);
|
3098
3098
|
}
|
3099
3099
|
return registerPILCommercialUsePolicy;
|
3100
|
-
}()
|
3100
|
+
}())
|
3101
3101
|
}, {
|
3102
3102
|
key: "getPolicyId",
|
3103
3103
|
value: function () {
|
@@ -3151,7 +3151,7 @@ var PolicyClient = /*#__PURE__*/function () {
|
|
3151
3151
|
*/
|
3152
3152
|
}, {
|
3153
3153
|
key: "addPolicyToIp",
|
3154
|
-
value: function () {
|
3154
|
+
value: (function () {
|
3155
3155
|
var _addPolicyToIp = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(request) {
|
3156
3156
|
var _request$txOptions4, IPAccountConfig, _yield$this$rpcClient4, call, txHash, targetLogs;
|
3157
3157
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
@@ -3214,9 +3214,8 @@ var PolicyClient = /*#__PURE__*/function () {
|
|
3214
3214
|
return _addPolicyToIp.apply(this, arguments);
|
3215
3215
|
}
|
3216
3216
|
return addPolicyToIp;
|
3217
|
-
}()
|
3217
|
+
}())
|
3218
3218
|
}]);
|
3219
|
-
return PolicyClient;
|
3220
3219
|
}();
|
3221
3220
|
|
3222
3221
|
var DisputeClient = /*#__PURE__*/function () {
|
@@ -3243,9 +3242,9 @@ var DisputeClient = /*#__PURE__*/function () {
|
|
3243
3242
|
* @calls raiseDispute(address _targetIpId, string memory _linkToDisputeEvidence, bytes32 _targetTag, bytes calldata _data) external nonReentrant returns (uint256) {
|
3244
3243
|
* @emits DisputeRaised (disputeId_, targetIpId, msg.sender, arbitrationPolicy, linkToDisputeEvidence, targetTag, calldata);
|
3245
3244
|
*/
|
3246
|
-
_createClass(DisputeClient, [{
|
3245
|
+
return _createClass(DisputeClient, [{
|
3247
3246
|
key: "raiseDispute",
|
3248
|
-
value: function () {
|
3247
|
+
value: (function () {
|
3249
3248
|
var _raiseDispute = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(request) {
|
3250
3249
|
var _request$txOptions, _yield$this$rpcClient, call, txHash, targetLogs;
|
3251
3250
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
@@ -3312,9 +3311,10 @@ var DisputeClient = /*#__PURE__*/function () {
|
|
3312
3311
|
* @calls cancelDispute(uint256 _disputeId, bytes calldata _data) external nonReentrant {
|
3313
3312
|
* @emits DisputeCancelled (_disputeId, _data);
|
3314
3313
|
*/
|
3314
|
+
)
|
3315
3315
|
}, {
|
3316
3316
|
key: "cancelDispute",
|
3317
|
-
value: function () {
|
3317
|
+
value: (function () {
|
3318
3318
|
var _cancelDispute = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(request) {
|
3319
3319
|
var _request$txOptions2, _yield$this$rpcClient2, call, txHash;
|
3320
3320
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
@@ -3368,9 +3368,10 @@ var DisputeClient = /*#__PURE__*/function () {
|
|
3368
3368
|
* @throws NotDisputeInitiator, if the transaction executor is not the one that initiated the dispute
|
3369
3369
|
* @emits DisputeResolved (_disputeId)
|
3370
3370
|
*/
|
3371
|
+
)
|
3371
3372
|
}, {
|
3372
3373
|
key: "resolveDispute",
|
3373
|
-
value: function () {
|
3374
|
+
value: (function () {
|
3374
3375
|
var _resolveDispute = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(request) {
|
3375
3376
|
var _request$txOptions3, _yield$this$rpcClient3, call, txHash;
|
3376
3377
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
@@ -3414,9 +3415,8 @@ var DisputeClient = /*#__PURE__*/function () {
|
|
3414
3415
|
return _resolveDispute.apply(this, arguments);
|
3415
3416
|
}
|
3416
3417
|
return resolveDispute;
|
3417
|
-
}()
|
3418
|
+
}())
|
3418
3419
|
}]);
|
3419
|
-
return DisputeClient;
|
3420
3420
|
}();
|
3421
3421
|
|
3422
3422
|
var IPAccountClient = /*#__PURE__*/function () {
|
@@ -3434,9 +3434,9 @@ var IPAccountClient = /*#__PURE__*/function () {
|
|
3434
3434
|
* @param request.data The data to send along with the transaction.
|
3435
3435
|
* @returns Tx hash for the transaction.
|
3436
3436
|
*/
|
3437
|
-
_createClass(IPAccountClient, [{
|
3437
|
+
return _createClass(IPAccountClient, [{
|
3438
3438
|
key: "execute",
|
3439
|
-
value: function () {
|
3439
|
+
value: (function () {
|
3440
3440
|
var _execute = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(request) {
|
3441
3441
|
var _request$txOptions, IPAccountConfig, _yield$this$rpcClient, call, txHash;
|
3442
3442
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
@@ -3495,9 +3495,10 @@ var IPAccountClient = /*#__PURE__*/function () {
|
|
3495
3495
|
* @param request.signature The signature of the transaction, EIP-712 encoded.
|
3496
3496
|
* @returns Tx hash for the transaction.
|
3497
3497
|
*/
|
3498
|
+
)
|
3498
3499
|
}, {
|
3499
3500
|
key: "executeWithSig",
|
3500
|
-
value: function () {
|
3501
|
+
value: (function () {
|
3501
3502
|
var _executeWithSig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(request) {
|
3502
3503
|
var _request$txOptions2, IPAccountConfig, _yield$this$rpcClient2, call, txHash;
|
3503
3504
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
@@ -3545,9 +3546,8 @@ var IPAccountClient = /*#__PURE__*/function () {
|
|
3545
3546
|
return _executeWithSig.apply(this, arguments);
|
3546
3547
|
}
|
3547
3548
|
return executeWithSig;
|
3548
|
-
}()
|
3549
|
+
}())
|
3549
3550
|
}]);
|
3550
|
-
return IPAccountClient;
|
3551
3551
|
}();
|
3552
3552
|
|
3553
3553
|
var StoryAPIClient = /*#__PURE__*/function () {
|
@@ -3561,7 +3561,7 @@ var StoryAPIClient = /*#__PURE__*/function () {
|
|
3561
3561
|
}
|
3562
3562
|
});
|
3563
3563
|
}
|
3564
|
-
_createClass(StoryAPIClient, [{
|
3564
|
+
return _createClass(StoryAPIClient, [{
|
3565
3565
|
key: "getRoyaltyPolicy",
|
3566
3566
|
value: function () {
|
3567
3567
|
var _getRoyaltyPolicy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(ipId) {
|
@@ -3634,7 +3634,6 @@ var StoryAPIClient = /*#__PURE__*/function () {
|
|
3634
3634
|
return getPolicy;
|
3635
3635
|
}()
|
3636
3636
|
}]);
|
3637
|
-
return StoryAPIClient;
|
3638
3637
|
}();
|
3639
3638
|
|
3640
3639
|
if (typeof process !== "undefined") {
|
@@ -3679,7 +3678,7 @@ var StoryClient = /*#__PURE__*/function () {
|
|
3679
3678
|
*
|
3680
3679
|
* @param config - the configuration for a new SDK client
|
3681
3680
|
*/
|
3682
|
-
_createClass(StoryClient, [{
|
3681
|
+
return _createClass(StoryClient, [{
|
3683
3682
|
key: "ipAsset",
|
3684
3683
|
get:
|
3685
3684
|
/**
|
@@ -3775,7 +3774,6 @@ var StoryClient = /*#__PURE__*/function () {
|
|
3775
3774
|
return new StoryClient(config);
|
3776
3775
|
}
|
3777
3776
|
}]);
|
3778
|
-
return StoryClient;
|
3779
3777
|
}();
|
3780
3778
|
|
3781
3779
|
export { AddressZero, DisputeClient, HashZero, IPAssetClient, LicenseClient, PermissionClient, PolicyClient, StoryClient };
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@story-protocol/core-sdk",
|
3
|
-
"version": "0.0.1-beta-rc.
|
3
|
+
"version": "0.0.1-beta-rc.11",
|
4
4
|
"description": "Story Protocol Core SDK",
|
5
5
|
"main": "dist/story-protocol-core-sdk.cjs.js",
|
6
6
|
"module": "dist/story-protocol-core-sdk.esm.js",
|
@@ -32,7 +32,7 @@
|
|
32
32
|
"abitype": "^0.10.2",
|
33
33
|
"axios": "^1.5.1",
|
34
34
|
"dotenv": "^16.3.1",
|
35
|
-
"viem": "^2.
|
35
|
+
"viem": "^2.8.12"
|
36
36
|
},
|
37
37
|
"devDependencies": {
|
38
38
|
"@babel/core": "^7.23.0",
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"story-protocol-core-sdk.cjs.d.ts","sourceRoot":"","sources":["./declarations/src/index.d.ts"],"names":[],"mappings":"AAAA"}
|