@story-protocol/core-sdk 0.0.1-beta-rc.4 → 0.0.1-beta-rc.5
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/declarations/src/client.d.ts +31 -7
- package/dist/declarations/src/client.d.ts.map +1 -1
- package/dist/declarations/src/index.d.ts +2 -3
- package/dist/declarations/src/index.d.ts.map +1 -1
- package/dist/declarations/src/resources/ipAccount.d.ts +752 -0
- package/dist/declarations/src/resources/ipAccount.d.ts.map +1 -0
- package/dist/declarations/src/resources/ipAsset.d.ts +1 -15
- package/dist/declarations/src/resources/ipAsset.d.ts.map +1 -1
- package/dist/declarations/src/resources/license.d.ts +1 -1
- package/dist/declarations/src/resources/permission.d.ts +2 -2
- package/dist/declarations/src/types/resources/ipAccount.d.ts +25 -0
- package/dist/declarations/src/types/resources/ipAccount.d.ts.map +1 -0
- package/dist/declarations/src/types/resources/ipAsset.d.ts +1 -1
- package/dist/declarations/src/types/resources/ipAsset.d.ts.map +1 -1
- package/dist/declarations/src/types/resources/permission.d.ts +2 -2
- package/dist/story-protocol-core-sdk.cjs.dev.js +184 -172
- package/dist/story-protocol-core-sdk.cjs.prod.js +184 -172
- package/dist/story-protocol-core-sdk.esm.js +185 -172
- package/package.json +1 -1
- package/dist/declarations/src/resources/tagging.d.ts +0 -718
- package/dist/declarations/src/resources/tagging.d.ts.map +0 -1
- package/dist/declarations/src/types/resources/tagging.d.ts +0 -23
- package/dist/declarations/src/types/resources/tagging.d.ts.map +0 -1
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ipAccount.d.ts","sourceRoot":"../../../../src/resources","sources":["ipAccount.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAc,MAAM,MAAM,CAAC;AAE9D,OAAO,EACL,uBAAuB,EACvB,wBAAwB,EACxB,8BAA8B,EAC9B,+BAA+B,EAChC,wCAAqC;AAKtC,qBAAa,eAAe;IAC1B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAe;IACtC,OAAO,CAAC,QAAQ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|
259
259
|
readonly name: "DisputeModule__NotWhitelistedArbitrationRelayer";
|
260
|
-
readonly type: "error";
|
261
|
-
* Registers derivative IPs into the protocol. Derivative IPs are IP assets that inherit policies from
|
262
|
-
* parent IPs by burning acquired license NFTs.
|
263
|
-
* @param request The request object that contains all data needed to register a root IP.
|
264
|
-
* @param request.licenseIds The policy that identifies the licensing terms of the IP.
|
265
|
-
* @param request.tokenContract The address of the NFT bound to the derivative IP.
|
266
|
-
* @param request.tokenId The token id of the NFT bound to the derivative IP.
|
267
|
-
* @param request.ipName [Optional] The name assigned to the new IP.
|
268
|
-
* @param request.contentHash [Optional] The content hash of the IP being registered.
|
269
|
-
* @param request.uri [Optional] An external URI to link to the IP.
|
270
|
-
* @param request.minRoyalty [Optional] The minimum royalty percentage that the IP owner will receive.
|
271
|
-
* @param request.txOptions [Optional] The transaction options.
|
272
|
-
* @returns A Promise that resolves to an object containing the transaction hash and optional IP ID if waitForTxn is set to true.
|
273
|
-
* @emits RootIPRegistered (msg.sender, ipId, policyId)
|
274
|
-
*/
|
260
|
+
readonly type: "error";
|
275
261
|
} | {
|
276
262
|
readonly inputs: readonly [];
|
277
263
|
readonly name: "DisputeModule__NotWhitelistedDisputeTag";
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ipAsset.d.ts","sourceRoot":"../../../../src/resources","sources":["ipAsset.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAc,MAAM,MAAM,CAAC;AAK9D,OAAO,EAAE,cAAc,EAAE,+BAA4B;AACrD,OAAO,EACL,2BAA2B,EAC3B,4BAA4B,EAC5B,qBAAqB,EACrB,sBAAsB,EACvB,sCAAmC;AAKpC,qBAAa,aAAa;IACxB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAe;IACtC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAe;IACzC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAiB;IACtC,qBAAqB;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAA4B;gBAE/C,SAAS,EAAE,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,WAAW,EAAE,cAAc;IAMtF;;;;;;;;;;;;;;OAcG;IACU,cAAc,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,sBAAsB,CAAC;IA+B5F;;;;;;;;;;;;;;OAcG;IACU,oBAAoB,CAC/B,OAAO,EAAE,2BAA2B,GACnC,OAAO,CAAC,4BAA4B,CAAC;CAwCzC"}
|
@@ -1676,7 +1676,7 @@ export declare class LicenseClient {
|
|
1676
1676
|
* @param request.licensorIpId_ The ID of the IP granting the license (ie. licensor)
|
1677
1677
|
* @param request.mintAmount Number of licenses to mint. License NFT is fungible for same policy and same licensors
|
1678
1678
|
* @param request.receiver Receiver address of the minted license NFT(s).
|
1679
|
-
* @
|
1679
|
+
* @returns licenseId The ID of the minted license NFT(s).
|
1680
1680
|
*/
|
1681
1681
|
mintLicense(request: MintLicenseRequest): Promise<MintLicenseResponse>;
|
1682
1682
|
linkIpToParent(request: LinkIpToParentRequest): Promise<LinkIpToParentResponse>;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { PublicClient, WalletClient } from "viem";
|
2
|
-
import {
|
2
|
+
import { SetPermissionsRequest, SetPermissionsResponse } from "../types/resources/permission.js";
|
3
3
|
export declare class PermissionClient {
|
4
4
|
private readonly wallet;
|
5
5
|
private readonly rpcClient;
|
@@ -1481,6 +1481,6 @@ export declare class PermissionClient {
|
|
1481
1481
|
* @returns A Promise that resolves to an object containing the transaction hash
|
1482
1482
|
* @emits PermissionSet (ipAccountOwner, ipAccount, signer, to, func, permission)
|
1483
1483
|
*/
|
1484
|
-
setPermission(request:
|
1484
|
+
setPermission(request: SetPermissionsRequest): Promise<SetPermissionsResponse>;
|
1485
1485
|
}
|
1486
1486
|
//# sourceMappingURL=permission.d.ts.map
|
@@ -0,0 +1,25 @@
|
|
1
|
+
import { TxOptions } from "../options.js";
|
2
|
+
export type IPAccountExecuteRequest = {
|
3
|
+
accountAddress: `0x${string}`;
|
4
|
+
to: `0x${string}`;
|
5
|
+
value: number;
|
6
|
+
data: `0x${string}`;
|
7
|
+
txOptions?: TxOptions;
|
8
|
+
};
|
9
|
+
export type IPAccountExecuteResponse = {
|
10
|
+
txHash: string;
|
11
|
+
};
|
12
|
+
export type IPAccountExecuteWithSigRequest = {
|
13
|
+
accountAddress: `0x${string}`;
|
14
|
+
to: `0x${string}`;
|
15
|
+
value: number;
|
16
|
+
data: `0x${string}`;
|
17
|
+
signer: `0x${string}`;
|
18
|
+
deadline: number;
|
19
|
+
signature: `0x${string}`;
|
20
|
+
txOptions?: TxOptions;
|
21
|
+
};
|
22
|
+
export type IPAccountExecuteWithSigResponse = {
|
23
|
+
txHash: string;
|
24
|
+
};
|
25
|
+
//# sourceMappingURL=ipAccount.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ipAccount.d.ts","sourceRoot":"../../../../../src/types/resources","sources":["ipAccount.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,sBAAmB;AAEvC,MAAM,MAAM,uBAAuB,GAAG;IACpC,cAAc,EAAE,KAAK,MAAM,EAAE,CAAC;IAC9B,EAAE,EAAE,KAAK,MAAM,EAAE,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,KAAK,MAAM,EAAE,CAAC;IACpB,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACrC,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,8BAA8B,GAAG;IAC3C,cAAc,EAAE,KAAK,MAAM,EAAE,CAAC;IAC9B,EAAE,EAAE,KAAK,MAAM,EAAE,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,KAAK,MAAM,EAAE,CAAC;IACpB,MAAM,EAAE,KAAK,MAAM,EAAE,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,KAAK,MAAM,EAAE,CAAC;IACzB,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,+BAA+B,GAAG;IAC5C,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ipAsset.d.ts","sourceRoot":"../../../../../src/types/resources","sources":["ipAsset.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,sBAAmB;AAEvC,MAAM,MAAM,qBAAqB,GAAG;IAClC,
|
1
|
+
{"version":3,"file":"ipAsset.d.ts","sourceRoot":"../../../../../src/types/resources","sources":["ipAsset.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,sBAAmB;AAEvC,MAAM,MAAM,qBAAqB,GAAG;IAClC,oBAAoB,EAAE,MAAM,CAAC;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,KAAK,MAAM,EAAE,CAAC;IAC5B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG;IACxC,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,KAAK,MAAM,EAAE,CAAC;IAC5B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,4BAA4B,GAAG;IACzC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC"}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { TxOptions } from "../options.js";
|
2
|
-
export type
|
2
|
+
export type SetPermissionsRequest = {
|
3
3
|
ipId: `0x${string}`;
|
4
4
|
signer: `0x${string}`;
|
5
5
|
to: `0x${string}`;
|
@@ -7,7 +7,7 @@ export type setPermissionsRequest = {
|
|
7
7
|
permission: number;
|
8
8
|
txOptions?: TxOptions;
|
9
9
|
};
|
10
|
-
export type
|
10
|
+
export type SetPermissionsResponse = {
|
11
11
|
txHash: string;
|
12
12
|
success?: boolean;
|
13
13
|
};
|
@@ -447,6 +447,9 @@ function handleError(error, msg) {
|
|
447
447
|
throw new Error("".concat(msg, ": Unknown error type"));
|
448
448
|
}
|
449
449
|
|
450
|
+
var AddressZero = "0x0000000000000000000000000000000000000000";
|
451
|
+
var HashZero = "0x0000000000000000000000000000000000000000000000000000000000000000";
|
452
|
+
|
450
453
|
function _arrayLikeToArray(arr, len) {
|
451
454
|
if (len == null || len > arr.length) len = arr.length;
|
452
455
|
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
@@ -1181,44 +1184,6 @@ var RegistrationModuleABI = [{
|
|
1181
1184
|
type: "function"
|
1182
1185
|
}];
|
1183
1186
|
|
1184
|
-
var TaggingModuleABI = [{
|
1185
|
-
inputs: [{
|
1186
|
-
internalType: "string",
|
1187
|
-
name: "tag",
|
1188
|
-
type: "string"
|
1189
|
-
}, {
|
1190
|
-
internalType: "address",
|
1191
|
-
name: "ipId",
|
1192
|
-
type: "address"
|
1193
|
-
}],
|
1194
|
-
name: "removeTag",
|
1195
|
-
outputs: [{
|
1196
|
-
internalType: "bool",
|
1197
|
-
name: "removed",
|
1198
|
-
type: "bool"
|
1199
|
-
}],
|
1200
|
-
stateMutability: "nonpayable",
|
1201
|
-
type: "function"
|
1202
|
-
}, {
|
1203
|
-
inputs: [{
|
1204
|
-
internalType: "string",
|
1205
|
-
name: "tag",
|
1206
|
-
type: "string"
|
1207
|
-
}, {
|
1208
|
-
internalType: "address",
|
1209
|
-
name: "ipId",
|
1210
|
-
type: "address"
|
1211
|
-
}],
|
1212
|
-
name: "setTag",
|
1213
|
-
outputs: [{
|
1214
|
-
internalType: "bool",
|
1215
|
-
name: "added",
|
1216
|
-
type: "bool"
|
1217
|
-
}],
|
1218
|
-
stateMutability: "nonpayable",
|
1219
|
-
type: "function"
|
1220
|
-
}];
|
1221
|
-
|
1222
1187
|
var ErrorsABI = [{
|
1223
1188
|
inputs: [{
|
1224
1189
|
internalType: "address",
|
@@ -1910,8 +1875,7 @@ var sepolia = {
|
|
1910
1875
|
PILPolicyFrameworkManager: "0x49cF5C5523011F8B4A0489969096Eb68C571C197",
|
1911
1876
|
RegistrationModule: "0x248c8CbF469ec7CB22Dc9914E569920b93d717a3",
|
1912
1877
|
RoyaltyModule: "0x512bbF310452cC96E0E9818B0870EcA557b86d4D",
|
1913
|
-
RoyaltyPolicyLAP: "0x8404061350BA0CA85c4E733B0be78c5519679003"
|
1914
|
-
TaggingModule: "0xED445f1DeE74Cf470Aab47F4b63734653C4C9537"
|
1878
|
+
RoyaltyPolicyLAP: "0x8404061350BA0CA85c4E733B0be78c5519679003"
|
1915
1879
|
};
|
1916
1880
|
|
1917
1881
|
var IPAccountABI = [].concat(_toConsumableArray(IPAccountImplABI), _toConsumableArray(ErrorsABI));
|
@@ -1939,10 +1903,6 @@ var RegistrationModuleConfig = {
|
|
1939
1903
|
abi: [].concat(_toConsumableArray(RegistrationModuleABI), _toConsumableArray(ErrorsABI)),
|
1940
1904
|
address: viem.getAddress(sepolia.RegistrationModule)
|
1941
1905
|
};
|
1942
|
-
var TaggingModuleConfig = {
|
1943
|
-
abi: [].concat(_toConsumableArray(TaggingModuleABI), _toConsumableArray(ErrorsABI)),
|
1944
|
-
address: viem.getAddress(sepolia.TaggingModule)
|
1945
|
-
};
|
1946
1906
|
var PILPolicyFrameworkManagerConfig = {
|
1947
1907
|
abi: [].concat(_toConsumableArray(PILPolicyFrameworkManagerABI), _toConsumableArray(ErrorsABI)),
|
1948
1908
|
address: viem.getAddress(sepolia.PILPolicyFrameworkManager)
|
@@ -2105,112 +2065,6 @@ function chainStringToViemChain(chainId) {
|
|
2105
2065
|
}
|
2106
2066
|
}
|
2107
2067
|
|
2108
|
-
var TaggingClient = /*#__PURE__*/function () {
|
2109
|
-
function TaggingClient(rpcClient, wallet) {
|
2110
|
-
_classCallCheck(this, TaggingClient);
|
2111
|
-
_defineProperty(this, "taggingModuleConfig", TaggingModuleConfig);
|
2112
|
-
this.rpcClient = rpcClient;
|
2113
|
-
this.wallet = wallet;
|
2114
|
-
}
|
2115
|
-
_createClass(TaggingClient, [{
|
2116
|
-
key: "setTag",
|
2117
|
-
value: function () {
|
2118
|
-
var _setTag = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(request) {
|
2119
|
-
var _request$txOptions, _yield$this$rpcClient, call, txHash;
|
2120
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
2121
|
-
while (1) switch (_context.prev = _context.next) {
|
2122
|
-
case 0:
|
2123
|
-
_context.prev = 0;
|
2124
|
-
_context.next = 3;
|
2125
|
-
return this.rpcClient.simulateContract(_objectSpread2(_objectSpread2({}, this.taggingModuleConfig), {}, {
|
2126
|
-
functionName: "setTag",
|
2127
|
-
args: [request.tag, request.ipId]
|
2128
|
-
}));
|
2129
|
-
case 3:
|
2130
|
-
_yield$this$rpcClient = _context.sent;
|
2131
|
-
call = _yield$this$rpcClient.request;
|
2132
|
-
_context.next = 7;
|
2133
|
-
return this.wallet.writeContract(call);
|
2134
|
-
case 7:
|
2135
|
-
txHash = _context.sent;
|
2136
|
-
if (!((_request$txOptions = request.txOptions) !== null && _request$txOptions !== void 0 && _request$txOptions.waitForTransaction)) {
|
2137
|
-
_context.next = 11;
|
2138
|
-
break;
|
2139
|
-
}
|
2140
|
-
_context.next = 11;
|
2141
|
-
return waitTx(this.rpcClient, txHash);
|
2142
|
-
case 11:
|
2143
|
-
return _context.abrupt("return", {
|
2144
|
-
txHash: txHash
|
2145
|
-
});
|
2146
|
-
case 14:
|
2147
|
-
_context.prev = 14;
|
2148
|
-
_context.t0 = _context["catch"](0);
|
2149
|
-
handleError(_context.t0, "Failed to set tag");
|
2150
|
-
case 17:
|
2151
|
-
case "end":
|
2152
|
-
return _context.stop();
|
2153
|
-
}
|
2154
|
-
}, _callee, this, [[0, 14]]);
|
2155
|
-
}));
|
2156
|
-
function setTag(_x) {
|
2157
|
-
return _setTag.apply(this, arguments);
|
2158
|
-
}
|
2159
|
-
return setTag;
|
2160
|
-
}()
|
2161
|
-
}, {
|
2162
|
-
key: "removeTag",
|
2163
|
-
value: function () {
|
2164
|
-
var _removeTag = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(request) {
|
2165
|
-
var _request$txOptions2, _yield$this$rpcClient2, call, txHash;
|
2166
|
-
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
2167
|
-
while (1) switch (_context2.prev = _context2.next) {
|
2168
|
-
case 0:
|
2169
|
-
_context2.prev = 0;
|
2170
|
-
_context2.next = 3;
|
2171
|
-
return this.rpcClient.simulateContract(_objectSpread2(_objectSpread2({}, this.taggingModuleConfig), {}, {
|
2172
|
-
functionName: "removeTag",
|
2173
|
-
args: [request.tag, request.ipId]
|
2174
|
-
}));
|
2175
|
-
case 3:
|
2176
|
-
_yield$this$rpcClient2 = _context2.sent;
|
2177
|
-
call = _yield$this$rpcClient2.request;
|
2178
|
-
_context2.next = 7;
|
2179
|
-
return this.wallet.writeContract(call);
|
2180
|
-
case 7:
|
2181
|
-
txHash = _context2.sent;
|
2182
|
-
if (!((_request$txOptions2 = request.txOptions) !== null && _request$txOptions2 !== void 0 && _request$txOptions2.waitForTransaction)) {
|
2183
|
-
_context2.next = 11;
|
2184
|
-
break;
|
2185
|
-
}
|
2186
|
-
_context2.next = 11;
|
2187
|
-
return waitTx(this.rpcClient, txHash);
|
2188
|
-
case 11:
|
2189
|
-
return _context2.abrupt("return", {
|
2190
|
-
txHash: txHash
|
2191
|
-
});
|
2192
|
-
case 14:
|
2193
|
-
_context2.prev = 14;
|
2194
|
-
_context2.t0 = _context2["catch"](0);
|
2195
|
-
handleError(_context2.t0, "Failed to remove tag");
|
2196
|
-
case 17:
|
2197
|
-
case "end":
|
2198
|
-
return _context2.stop();
|
2199
|
-
}
|
2200
|
-
}, _callee2, this, [[0, 14]]);
|
2201
|
-
}));
|
2202
|
-
function removeTag(_x2) {
|
2203
|
-
return _removeTag.apply(this, arguments);
|
2204
|
-
}
|
2205
|
-
return removeTag;
|
2206
|
-
}()
|
2207
|
-
}]);
|
2208
|
-
return TaggingClient;
|
2209
|
-
}();
|
2210
|
-
|
2211
|
-
var AddressZero = "0x0000000000000000000000000000000000000000";
|
2212
|
-
var HashZero = "0x0000000000000000000000000000000000000000000000000000000000000000";
|
2213
|
-
|
2214
2068
|
function computeRoyaltyContext(_x, _x2) {
|
2215
2069
|
return _computeRoyaltyContext.apply(this, arguments);
|
2216
2070
|
}
|
@@ -2329,7 +2183,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
2329
2183
|
_context.next = 3;
|
2330
2184
|
return this.rpcClient.simulateContract(_objectSpread2(_objectSpread2({}, this.registrationModuleConfig), {}, {
|
2331
2185
|
functionName: "registerRootIp",
|
2332
|
-
args: [parseToBigInt(request.policyId), viem.getAddress(request.tokenContractAddress),
|
2186
|
+
args: [parseToBigInt(request.policyId || "0"), viem.getAddress(request.tokenContractAddress),
|
2333
2187
|
// 0x Address
|
2334
2188
|
parseToBigInt(request.tokenId), request.ipName || "", request.contentHash || HashZero, request.uri || ""],
|
2335
2189
|
account: this.wallet.account
|
@@ -2592,7 +2446,7 @@ var LicenseClient = /*#__PURE__*/function () {
|
|
2592
2446
|
* @param request.licensorIpId_ The ID of the IP granting the license (ie. licensor)
|
2593
2447
|
* @param request.mintAmount Number of licenses to mint. License NFT is fungible for same policy and same licensors
|
2594
2448
|
* @param request.receiver Receiver address of the minted license NFT(s).
|
2595
|
-
* @
|
2449
|
+
* @returns licenseId The ID of the minted license NFT(s).
|
2596
2450
|
*/
|
2597
2451
|
_createClass(LicenseClient, [{
|
2598
2452
|
key: "mintLicense",
|
@@ -3132,6 +2986,137 @@ var DisputeClient = /*#__PURE__*/function () {
|
|
3132
2986
|
return DisputeClient;
|
3133
2987
|
}();
|
3134
2988
|
|
2989
|
+
var IPAccountClient = /*#__PURE__*/function () {
|
2990
|
+
function IPAccountClient(rpcClient, wallet) {
|
2991
|
+
_classCallCheck(this, IPAccountClient);
|
2992
|
+
_defineProperty(this, "ipAccountABI", IPAccountABI);
|
2993
|
+
this.wallet = wallet;
|
2994
|
+
this.rpcClient = rpcClient;
|
2995
|
+
}
|
2996
|
+
|
2997
|
+
/** Executes a transaction from the IP Account.
|
2998
|
+
* @param request The request object containing necessary data to execute IP Account a transaction.
|
2999
|
+
* @param request.to The recipient of the transaction.
|
3000
|
+
* @param request.value The amount of Ether to send.
|
3001
|
+
* @param request.data The data to send along with the transaction.
|
3002
|
+
* @returns Tx hash for the transaction.
|
3003
|
+
*/
|
3004
|
+
_createClass(IPAccountClient, [{
|
3005
|
+
key: "execute",
|
3006
|
+
value: function () {
|
3007
|
+
var _execute = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(request) {
|
3008
|
+
var _request$txOptions, IPAccountConfig, _yield$this$rpcClient, call, txHash;
|
3009
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
3010
|
+
while (1) switch (_context.prev = _context.next) {
|
3011
|
+
case 0:
|
3012
|
+
_context.prev = 0;
|
3013
|
+
IPAccountConfig = {
|
3014
|
+
abi: this.ipAccountABI,
|
3015
|
+
address: viem.getAddress(request.accountAddress)
|
3016
|
+
};
|
3017
|
+
_context.next = 4;
|
3018
|
+
return this.rpcClient.simulateContract(_objectSpread2(_objectSpread2({}, IPAccountConfig), {}, {
|
3019
|
+
functionName: "execute",
|
3020
|
+
args: [request.to, parseToBigInt(0), request.data],
|
3021
|
+
account: this.wallet.account
|
3022
|
+
}));
|
3023
|
+
case 4:
|
3024
|
+
_yield$this$rpcClient = _context.sent;
|
3025
|
+
call = _yield$this$rpcClient.request;
|
3026
|
+
_context.next = 8;
|
3027
|
+
return this.wallet.writeContract(call);
|
3028
|
+
case 8:
|
3029
|
+
txHash = _context.sent;
|
3030
|
+
if (!((_request$txOptions = request.txOptions) !== null && _request$txOptions !== void 0 && _request$txOptions.waitForTransaction)) {
|
3031
|
+
_context.next = 12;
|
3032
|
+
break;
|
3033
|
+
}
|
3034
|
+
_context.next = 12;
|
3035
|
+
return waitTx(this.rpcClient, txHash);
|
3036
|
+
case 12:
|
3037
|
+
return _context.abrupt("return", {
|
3038
|
+
txHash: txHash
|
3039
|
+
});
|
3040
|
+
case 15:
|
3041
|
+
_context.prev = 15;
|
3042
|
+
_context.t0 = _context["catch"](0);
|
3043
|
+
handleError(_context.t0, "Failed to execute the IP Account transaction");
|
3044
|
+
case 18:
|
3045
|
+
case "end":
|
3046
|
+
return _context.stop();
|
3047
|
+
}
|
3048
|
+
}, _callee, this, [[0, 15]]);
|
3049
|
+
}));
|
3050
|
+
function execute(_x) {
|
3051
|
+
return _execute.apply(this, arguments);
|
3052
|
+
}
|
3053
|
+
return execute;
|
3054
|
+
}()
|
3055
|
+
/** Executes a transaction from the IP Account.
|
3056
|
+
* @param request The request object containing necessary data to execute IP Account a transaction.
|
3057
|
+
* @param request.to The recipient of the transaction.
|
3058
|
+
* @param request.value The amount of Ether to send.
|
3059
|
+
* @param request.data The data to send along with the transaction.
|
3060
|
+
* @param request.signer The signer of the transaction.
|
3061
|
+
* @param request.deadline The deadline of the transaction signature.
|
3062
|
+
* @param request.signature The signature of the transaction, EIP-712 encoded.
|
3063
|
+
* @returns Tx hash for the transaction.
|
3064
|
+
*/
|
3065
|
+
}, {
|
3066
|
+
key: "executeWithSig",
|
3067
|
+
value: function () {
|
3068
|
+
var _executeWithSig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(request) {
|
3069
|
+
var _request$txOptions2, IPAccountConfig, _yield$this$rpcClient2, call, txHash;
|
3070
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
3071
|
+
while (1) switch (_context2.prev = _context2.next) {
|
3072
|
+
case 0:
|
3073
|
+
_context2.prev = 0;
|
3074
|
+
IPAccountConfig = {
|
3075
|
+
abi: this.ipAccountABI,
|
3076
|
+
address: viem.getAddress(request.accountAddress)
|
3077
|
+
};
|
3078
|
+
_context2.next = 4;
|
3079
|
+
return this.rpcClient.simulateContract(_objectSpread2(_objectSpread2({}, IPAccountConfig), {}, {
|
3080
|
+
functionName: "executeWithSig",
|
3081
|
+
args: [request.to, parseToBigInt(0), request.data, request.signer, parseToBigInt(request.deadline), request.signature],
|
3082
|
+
account: this.wallet.account
|
3083
|
+
}));
|
3084
|
+
case 4:
|
3085
|
+
_yield$this$rpcClient2 = _context2.sent;
|
3086
|
+
call = _yield$this$rpcClient2.request;
|
3087
|
+
_context2.next = 8;
|
3088
|
+
return this.wallet.writeContract(call);
|
3089
|
+
case 8:
|
3090
|
+
txHash = _context2.sent;
|
3091
|
+
if (!((_request$txOptions2 = request.txOptions) !== null && _request$txOptions2 !== void 0 && _request$txOptions2.waitForTransaction)) {
|
3092
|
+
_context2.next = 12;
|
3093
|
+
break;
|
3094
|
+
}
|
3095
|
+
_context2.next = 12;
|
3096
|
+
return waitTx(this.rpcClient, txHash);
|
3097
|
+
case 12:
|
3098
|
+
return _context2.abrupt("return", {
|
3099
|
+
txHash: txHash
|
3100
|
+
});
|
3101
|
+
case 15:
|
3102
|
+
_context2.prev = 15;
|
3103
|
+
_context2.t0 = _context2["catch"](0);
|
3104
|
+
handleError(_context2.t0, "Failed to execute with signature for the IP Account transaction");
|
3105
|
+
case 18:
|
3106
|
+
case "end":
|
3107
|
+
return _context2.stop();
|
3108
|
+
}
|
3109
|
+
}, _callee2, this, [[0, 15]]);
|
3110
|
+
}));
|
3111
|
+
function executeWithSig(_x2) {
|
3112
|
+
return _executeWithSig.apply(this, arguments);
|
3113
|
+
}
|
3114
|
+
return executeWithSig;
|
3115
|
+
}()
|
3116
|
+
}]);
|
3117
|
+
return IPAccountClient;
|
3118
|
+
}();
|
3119
|
+
|
3135
3120
|
var StoryAPIClient = /*#__PURE__*/function () {
|
3136
3121
|
function StoryAPIClient() {
|
3137
3122
|
_classCallCheck(this, StoryAPIClient);
|
@@ -3152,7 +3137,7 @@ var StoryAPIClient = /*#__PURE__*/function () {
|
|
3152
3137
|
while (1) switch (_context.prev = _context.next) {
|
3153
3138
|
case 0:
|
3154
3139
|
_context.next = 2;
|
3155
|
-
return this.httpClient.get("/api/v1/
|
3140
|
+
return this.httpClient.get("/api/v1/royalties/policies/".concat(ipId));
|
3156
3141
|
case 2:
|
3157
3142
|
royaltyPolicyResp = _context.sent;
|
3158
3143
|
return _context.abrupt("return", royaltyPolicyResp.data.data);
|
@@ -3231,12 +3216,12 @@ var StoryClient = /*#__PURE__*/function () {
|
|
3231
3216
|
*/
|
3232
3217
|
function StoryClient(config) {
|
3233
3218
|
_classCallCheck(this, StoryClient);
|
3234
|
-
_defineProperty(this, "
|
3219
|
+
_defineProperty(this, "_ipAsset", null);
|
3235
3220
|
_defineProperty(this, "_permission", null);
|
3236
3221
|
_defineProperty(this, "_license", null);
|
3237
3222
|
_defineProperty(this, "_policy", null);
|
3238
|
-
_defineProperty(this, "_tagging", null);
|
3239
3223
|
_defineProperty(this, "_dispute", null);
|
3224
|
+
_defineProperty(this, "_ipAccount", null);
|
3240
3225
|
this.config = config;
|
3241
3226
|
if (!this.config.transport) {
|
3242
3227
|
throw new Error("transport is null, please pass in a valid RPC Provider URL as the transport.");
|
@@ -3263,12 +3248,26 @@ var StoryClient = /*#__PURE__*/function () {
|
|
3263
3248
|
*/
|
3264
3249
|
_createClass(StoryClient, [{
|
3265
3250
|
key: "ipAsset",
|
3266
|
-
get:
|
3267
|
-
|
3268
|
-
|
3251
|
+
get:
|
3252
|
+
/**
|
3253
|
+
* Getter for the ip asset client. The client is lazily created when
|
3254
|
+
* this method is called.
|
3255
|
+
*
|
3256
|
+
* @returns the IPAssetClient instance
|
3257
|
+
*/
|
3258
|
+
function get() {
|
3259
|
+
if (this._ipAsset === null) {
|
3260
|
+
this._ipAsset = new IPAssetClient(this.rpcClient, this.wallet, this.storyClient);
|
3269
3261
|
}
|
3270
|
-
return this.
|
3262
|
+
return this._ipAsset;
|
3271
3263
|
}
|
3264
|
+
|
3265
|
+
/**
|
3266
|
+
* Getter for the permission client. The client is lazily created when
|
3267
|
+
* this method is called.
|
3268
|
+
*
|
3269
|
+
* @returns the PermissionClient instance
|
3270
|
+
*/
|
3272
3271
|
}, {
|
3273
3272
|
key: "permission",
|
3274
3273
|
get: function get() {
|
@@ -3277,6 +3276,13 @@ var StoryClient = /*#__PURE__*/function () {
|
|
3277
3276
|
}
|
3278
3277
|
return this._permission;
|
3279
3278
|
}
|
3279
|
+
|
3280
|
+
/**
|
3281
|
+
* Getter for the license client. The client is lazily created when
|
3282
|
+
* this method is called.
|
3283
|
+
*
|
3284
|
+
* @returns the LicenseClient instance
|
3285
|
+
*/
|
3280
3286
|
}, {
|
3281
3287
|
key: "license",
|
3282
3288
|
get: function get() {
|
@@ -3285,6 +3291,13 @@ var StoryClient = /*#__PURE__*/function () {
|
|
3285
3291
|
}
|
3286
3292
|
return this._license;
|
3287
3293
|
}
|
3294
|
+
|
3295
|
+
/**
|
3296
|
+
* Getter for the policy client. The client is lazily created when
|
3297
|
+
* this method is called.
|
3298
|
+
*
|
3299
|
+
* @returns the PolicyClient instance
|
3300
|
+
*/
|
3288
3301
|
}, {
|
3289
3302
|
key: "policy",
|
3290
3303
|
get: function get() {
|
@@ -3295,33 +3308,33 @@ var StoryClient = /*#__PURE__*/function () {
|
|
3295
3308
|
}
|
3296
3309
|
|
3297
3310
|
/**
|
3298
|
-
* Getter for the
|
3311
|
+
* Getter for the dispute client. The client is lazily created when
|
3299
3312
|
* this method is called.
|
3300
3313
|
*
|
3301
|
-
* @returns the
|
3314
|
+
* @returns the DisputeClient instance
|
3302
3315
|
*/
|
3303
3316
|
}, {
|
3304
|
-
key: "
|
3317
|
+
key: "dispute",
|
3305
3318
|
get: function get() {
|
3306
|
-
if (this.
|
3307
|
-
this.
|
3319
|
+
if (this._dispute === null) {
|
3320
|
+
this._dispute = new DisputeClient(this.rpcClient, this.wallet);
|
3308
3321
|
}
|
3309
|
-
return this.
|
3322
|
+
return this._dispute;
|
3310
3323
|
}
|
3311
3324
|
|
3312
3325
|
/**
|
3313
|
-
* Getter for the
|
3326
|
+
* Getter for the ip account client. The client is lazily created when
|
3314
3327
|
* this method is called.
|
3315
3328
|
*
|
3316
|
-
* @returns the
|
3329
|
+
* @returns the IPAccountClient instance
|
3317
3330
|
*/
|
3318
3331
|
}, {
|
3319
|
-
key: "
|
3332
|
+
key: "ipAccount",
|
3320
3333
|
get: function get() {
|
3321
|
-
if (this.
|
3322
|
-
this.
|
3334
|
+
if (this._ipAccount === null) {
|
3335
|
+
this._ipAccount = new IPAccountClient(this.rpcClient, this.wallet);
|
3323
3336
|
}
|
3324
|
-
return this.
|
3337
|
+
return this._ipAccount;
|
3325
3338
|
}
|
3326
3339
|
}], [{
|
3327
3340
|
key: "newClient",
|
@@ -3340,4 +3353,3 @@ exports.LicenseClient = LicenseClient;
|
|
3340
3353
|
exports.PermissionClient = PermissionClient;
|
3341
3354
|
exports.PolicyClient = PolicyClient;
|
3342
3355
|
exports.StoryClient = StoryClient;
|
3343
|
-
exports.TaggingClient = TaggingClient;
|