@story-protocol/core-sdk 1.0.0-rc.18 → 1.0.0-rc.19
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/declarations/src/abi/generated.d.ts +120 -88
- package/dist/declarations/src/abi/generated.d.ts.map +1 -1
- package/dist/declarations/src/resources/ipAsset.d.ts +25 -22
- package/dist/declarations/src/resources/ipAsset.d.ts.map +1 -1
- package/dist/declarations/src/types/resources/ipAsset.d.ts +3 -2
- package/dist/declarations/src/types/resources/ipAsset.d.ts.map +1 -1
- package/dist/story-protocol-core-sdk.cjs.dev.js +195 -212
- package/dist/story-protocol-core-sdk.cjs.prod.js +195 -212
- package/dist/story-protocol-core-sdk.esm.js +195 -212
- package/package.json +1 -1
@@ -488,14 +488,14 @@ var iliad = defineChain({
|
|
488
488
|
},
|
489
489
|
rpcUrls: {
|
490
490
|
"default": {
|
491
|
-
http: ["https://
|
491
|
+
http: ["https://testnet.storyrpc.io"],
|
492
492
|
webSocket: ["wss://story-network.rpc.caldera.xyz/ws"]
|
493
493
|
}
|
494
494
|
},
|
495
495
|
blockExplorers: {
|
496
496
|
"default": {
|
497
497
|
name: "Explorer",
|
498
|
-
url: "https://
|
498
|
+
url: "https://testnet.storyscan.xyz"
|
499
499
|
}
|
500
500
|
},
|
501
501
|
contracts: {
|
@@ -9552,22 +9552,22 @@ var spgAbi = [{
|
|
9552
9552
|
name: "recipient",
|
9553
9553
|
internalType: "address",
|
9554
9554
|
type: "address"
|
9555
|
-
}, {
|
9556
|
-
name: "nftMetadata",
|
9557
|
-
internalType: "string",
|
9558
|
-
type: "string"
|
9559
9555
|
}, {
|
9560
9556
|
name: "ipMetadata",
|
9561
9557
|
internalType: "struct IStoryProtocolGateway.IPMetadata",
|
9562
9558
|
type: "tuple",
|
9563
9559
|
components: [{
|
9564
|
-
name: "
|
9560
|
+
name: "ipMetadataURI",
|
9565
9561
|
internalType: "string",
|
9566
9562
|
type: "string"
|
9567
9563
|
}, {
|
9568
|
-
name: "
|
9564
|
+
name: "ipMetadataHash",
|
9569
9565
|
internalType: "bytes32",
|
9570
9566
|
type: "bytes32"
|
9567
|
+
}, {
|
9568
|
+
name: "nftMetadataURI",
|
9569
|
+
internalType: "string",
|
9570
|
+
type: "string"
|
9571
9571
|
}, {
|
9572
9572
|
name: "nftMetadataHash",
|
9573
9573
|
internalType: "bytes32",
|
@@ -9595,22 +9595,22 @@ var spgAbi = [{
|
|
9595
9595
|
name: "recipient",
|
9596
9596
|
internalType: "address",
|
9597
9597
|
type: "address"
|
9598
|
-
}, {
|
9599
|
-
name: "nftMetadata",
|
9600
|
-
internalType: "string",
|
9601
|
-
type: "string"
|
9602
9598
|
}, {
|
9603
9599
|
name: "ipMetadata",
|
9604
9600
|
internalType: "struct IStoryProtocolGateway.IPMetadata",
|
9605
9601
|
type: "tuple",
|
9606
9602
|
components: [{
|
9607
|
-
name: "
|
9603
|
+
name: "ipMetadataURI",
|
9608
9604
|
internalType: "string",
|
9609
9605
|
type: "string"
|
9610
9606
|
}, {
|
9611
|
-
name: "
|
9607
|
+
name: "ipMetadataHash",
|
9612
9608
|
internalType: "bytes32",
|
9613
9609
|
type: "bytes32"
|
9610
|
+
}, {
|
9611
|
+
name: "nftMetadataURI",
|
9612
|
+
internalType: "string",
|
9613
|
+
type: "string"
|
9614
9614
|
}, {
|
9615
9615
|
name: "nftMetadataHash",
|
9616
9616
|
internalType: "bytes32",
|
@@ -9732,22 +9732,22 @@ var spgAbi = [{
|
|
9732
9732
|
internalType: "bytes",
|
9733
9733
|
type: "bytes"
|
9734
9734
|
}]
|
9735
|
-
}, {
|
9736
|
-
name: "nftMetadata",
|
9737
|
-
internalType: "string",
|
9738
|
-
type: "string"
|
9739
9735
|
}, {
|
9740
9736
|
name: "ipMetadata",
|
9741
9737
|
internalType: "struct IStoryProtocolGateway.IPMetadata",
|
9742
9738
|
type: "tuple",
|
9743
9739
|
components: [{
|
9744
|
-
name: "
|
9740
|
+
name: "ipMetadataURI",
|
9745
9741
|
internalType: "string",
|
9746
9742
|
type: "string"
|
9747
9743
|
}, {
|
9748
|
-
name: "
|
9744
|
+
name: "ipMetadataHash",
|
9749
9745
|
internalType: "bytes32",
|
9750
9746
|
type: "bytes32"
|
9747
|
+
}, {
|
9748
|
+
name: "nftMetadataURI",
|
9749
|
+
internalType: "string",
|
9750
|
+
type: "string"
|
9751
9751
|
}, {
|
9752
9752
|
name: "nftMetadataHash",
|
9753
9753
|
internalType: "bytes32",
|
@@ -9783,22 +9783,22 @@ var spgAbi = [{
|
|
9783
9783
|
name: "royaltyContext",
|
9784
9784
|
internalType: "bytes",
|
9785
9785
|
type: "bytes"
|
9786
|
-
}, {
|
9787
|
-
name: "nftMetadata",
|
9788
|
-
internalType: "string",
|
9789
|
-
type: "string"
|
9790
9786
|
}, {
|
9791
9787
|
name: "ipMetadata",
|
9792
9788
|
internalType: "struct IStoryProtocolGateway.IPMetadata",
|
9793
9789
|
type: "tuple",
|
9794
9790
|
components: [{
|
9795
|
-
name: "
|
9791
|
+
name: "ipMetadataURI",
|
9796
9792
|
internalType: "string",
|
9797
9793
|
type: "string"
|
9798
9794
|
}, {
|
9799
|
-
name: "
|
9795
|
+
name: "ipMetadataHash",
|
9800
9796
|
internalType: "bytes32",
|
9801
9797
|
type: "bytes32"
|
9798
|
+
}, {
|
9799
|
+
name: "nftMetadataURI",
|
9800
|
+
internalType: "string",
|
9801
|
+
type: "string"
|
9802
9802
|
}, {
|
9803
9803
|
name: "nftMetadataHash",
|
9804
9804
|
internalType: "bytes32",
|
@@ -9871,13 +9871,17 @@ var spgAbi = [{
|
|
9871
9871
|
internalType: "struct IStoryProtocolGateway.IPMetadata",
|
9872
9872
|
type: "tuple",
|
9873
9873
|
components: [{
|
9874
|
-
name: "
|
9874
|
+
name: "ipMetadataURI",
|
9875
9875
|
internalType: "string",
|
9876
9876
|
type: "string"
|
9877
9877
|
}, {
|
9878
|
-
name: "
|
9878
|
+
name: "ipMetadataHash",
|
9879
9879
|
internalType: "bytes32",
|
9880
9880
|
type: "bytes32"
|
9881
|
+
}, {
|
9882
|
+
name: "nftMetadataURI",
|
9883
|
+
internalType: "string",
|
9884
|
+
type: "string"
|
9881
9885
|
}, {
|
9882
9886
|
name: "nftMetadataHash",
|
9883
9887
|
internalType: "bytes32",
|
@@ -9923,13 +9927,17 @@ var spgAbi = [{
|
|
9923
9927
|
internalType: "struct IStoryProtocolGateway.IPMetadata",
|
9924
9928
|
type: "tuple",
|
9925
9929
|
components: [{
|
9926
|
-
name: "
|
9930
|
+
name: "ipMetadataURI",
|
9927
9931
|
internalType: "string",
|
9928
9932
|
type: "string"
|
9929
9933
|
}, {
|
9930
|
-
name: "
|
9934
|
+
name: "ipMetadataHash",
|
9931
9935
|
internalType: "bytes32",
|
9932
9936
|
type: "bytes32"
|
9937
|
+
}, {
|
9938
|
+
name: "nftMetadataURI",
|
9939
|
+
internalType: "string",
|
9940
|
+
type: "string"
|
9933
9941
|
}, {
|
9934
9942
|
name: "nftMetadataHash",
|
9935
9943
|
internalType: "bytes32",
|
@@ -10090,13 +10098,17 @@ var spgAbi = [{
|
|
10090
10098
|
internalType: "struct IStoryProtocolGateway.IPMetadata",
|
10091
10099
|
type: "tuple",
|
10092
10100
|
components: [{
|
10093
|
-
name: "
|
10101
|
+
name: "ipMetadataURI",
|
10094
10102
|
internalType: "string",
|
10095
10103
|
type: "string"
|
10096
10104
|
}, {
|
10097
|
-
name: "
|
10105
|
+
name: "ipMetadataHash",
|
10098
10106
|
internalType: "bytes32",
|
10099
10107
|
type: "bytes32"
|
10108
|
+
}, {
|
10109
|
+
name: "nftMetadataURI",
|
10110
|
+
internalType: "string",
|
10111
|
+
type: "string"
|
10100
10112
|
}, {
|
10101
10113
|
name: "nftMetadataHash",
|
10102
10114
|
internalType: "bytes32",
|
@@ -10167,13 +10179,17 @@ var spgAbi = [{
|
|
10167
10179
|
internalType: "struct IStoryProtocolGateway.IPMetadata",
|
10168
10180
|
type: "tuple",
|
10169
10181
|
components: [{
|
10170
|
-
name: "
|
10182
|
+
name: "ipMetadataURI",
|
10171
10183
|
internalType: "string",
|
10172
10184
|
type: "string"
|
10173
10185
|
}, {
|
10174
|
-
name: "
|
10186
|
+
name: "ipMetadataHash",
|
10175
10187
|
internalType: "bytes32",
|
10176
10188
|
type: "bytes32"
|
10189
|
+
}, {
|
10190
|
+
name: "nftMetadataURI",
|
10191
|
+
internalType: "string",
|
10192
|
+
type: "string"
|
10177
10193
|
}, {
|
10178
10194
|
name: "nftMetadataHash",
|
10179
10195
|
internalType: "bytes32",
|
@@ -17503,7 +17519,6 @@ var RoyaltyPolicyLapClient = /*#__PURE__*/function (_RoyaltyPolicyLapRead) {
|
|
17503
17519
|
*
|
17504
17520
|
* @param nftContract address
|
17505
17521
|
* @param recipient address
|
17506
|
-
* @param nftMetadata string
|
17507
17522
|
* @param ipMetadata tuple
|
17508
17523
|
*/
|
17509
17524
|
|
@@ -17512,7 +17527,6 @@ var RoyaltyPolicyLapClient = /*#__PURE__*/function (_RoyaltyPolicyLapRead) {
|
|
17512
17527
|
*
|
17513
17528
|
* @param nftContract address
|
17514
17529
|
* @param recipient address
|
17515
|
-
* @param nftMetadata string
|
17516
17530
|
* @param ipMetadata tuple
|
17517
17531
|
* @param terms tuple
|
17518
17532
|
*/
|
@@ -17522,7 +17536,6 @@ var RoyaltyPolicyLapClient = /*#__PURE__*/function (_RoyaltyPolicyLapRead) {
|
|
17522
17536
|
*
|
17523
17537
|
* @param nftContract address
|
17524
17538
|
* @param derivData tuple
|
17525
|
-
* @param nftMetadata string
|
17526
17539
|
* @param ipMetadata tuple
|
17527
17540
|
* @param recipient address
|
17528
17541
|
*/
|
@@ -17533,7 +17546,6 @@ var RoyaltyPolicyLapClient = /*#__PURE__*/function (_RoyaltyPolicyLapRead) {
|
|
17533
17546
|
* @param nftContract address
|
17534
17547
|
* @param licenseTokenIds uint256[]
|
17535
17548
|
* @param royaltyContext bytes
|
17536
|
-
* @param nftMetadata string
|
17537
17549
|
* @param ipMetadata tuple
|
17538
17550
|
* @param recipient address
|
17539
17551
|
*/
|
@@ -17746,7 +17758,7 @@ var SpgClient = /*#__PURE__*/function (_SpgEventClient) {
|
|
17746
17758
|
address: this.address,
|
17747
17759
|
functionName: "mintAndRegisterIp",
|
17748
17760
|
account: this.wallet.account,
|
17749
|
-
args: [request.nftContract, request.recipient, request.
|
17761
|
+
args: [request.nftContract, request.recipient, request.ipMetadata]
|
17750
17762
|
});
|
17751
17763
|
case 2:
|
17752
17764
|
_yield$this$rpcClient46 = _context112.sent;
|
@@ -17781,7 +17793,7 @@ var SpgClient = /*#__PURE__*/function (_SpgEventClient) {
|
|
17781
17793
|
data: encodeFunctionData({
|
17782
17794
|
abi: spgAbi,
|
17783
17795
|
functionName: "mintAndRegisterIp",
|
17784
|
-
args: [request.nftContract, request.recipient, request.
|
17796
|
+
args: [request.nftContract, request.recipient, request.ipMetadata]
|
17785
17797
|
})
|
17786
17798
|
};
|
17787
17799
|
}
|
@@ -17806,7 +17818,7 @@ var SpgClient = /*#__PURE__*/function (_SpgEventClient) {
|
|
17806
17818
|
address: this.address,
|
17807
17819
|
functionName: "mintAndRegisterIpAndAttachPILTerms",
|
17808
17820
|
account: this.wallet.account,
|
17809
|
-
args: [request.nftContract, request.recipient, request.
|
17821
|
+
args: [request.nftContract, request.recipient, request.ipMetadata, request.terms]
|
17810
17822
|
});
|
17811
17823
|
case 2:
|
17812
17824
|
_yield$this$rpcClient47 = _context113.sent;
|
@@ -17841,7 +17853,7 @@ var SpgClient = /*#__PURE__*/function (_SpgEventClient) {
|
|
17841
17853
|
data: encodeFunctionData({
|
17842
17854
|
abi: spgAbi,
|
17843
17855
|
functionName: "mintAndRegisterIpAndAttachPILTerms",
|
17844
|
-
args: [request.nftContract, request.recipient, request.
|
17856
|
+
args: [request.nftContract, request.recipient, request.ipMetadata, request.terms]
|
17845
17857
|
})
|
17846
17858
|
};
|
17847
17859
|
}
|
@@ -17866,7 +17878,7 @@ var SpgClient = /*#__PURE__*/function (_SpgEventClient) {
|
|
17866
17878
|
address: this.address,
|
17867
17879
|
functionName: "mintAndRegisterIpAndMakeDerivative",
|
17868
17880
|
account: this.wallet.account,
|
17869
|
-
args: [request.nftContract, request.derivData, request.
|
17881
|
+
args: [request.nftContract, request.derivData, request.ipMetadata, request.recipient]
|
17870
17882
|
});
|
17871
17883
|
case 2:
|
17872
17884
|
_yield$this$rpcClient48 = _context114.sent;
|
@@ -17901,7 +17913,7 @@ var SpgClient = /*#__PURE__*/function (_SpgEventClient) {
|
|
17901
17913
|
data: encodeFunctionData({
|
17902
17914
|
abi: spgAbi,
|
17903
17915
|
functionName: "mintAndRegisterIpAndMakeDerivative",
|
17904
|
-
args: [request.nftContract, request.derivData, request.
|
17916
|
+
args: [request.nftContract, request.derivData, request.ipMetadata, request.recipient]
|
17905
17917
|
})
|
17906
17918
|
};
|
17907
17919
|
}
|
@@ -17926,7 +17938,7 @@ var SpgClient = /*#__PURE__*/function (_SpgEventClient) {
|
|
17926
17938
|
address: this.address,
|
17927
17939
|
functionName: "mintAndRegisterIpAndMakeDerivativeWithLicenseTokens",
|
17928
17940
|
account: this.wallet.account,
|
17929
|
-
args: [request.nftContract, request.licenseTokenIds, request.royaltyContext, request.
|
17941
|
+
args: [request.nftContract, request.licenseTokenIds, request.royaltyContext, request.ipMetadata, request.recipient]
|
17930
17942
|
});
|
17931
17943
|
case 2:
|
17932
17944
|
_yield$this$rpcClient49 = _context115.sent;
|
@@ -17961,7 +17973,7 @@ var SpgClient = /*#__PURE__*/function (_SpgEventClient) {
|
|
17961
17973
|
data: encodeFunctionData({
|
17962
17974
|
abi: spgAbi,
|
17963
17975
|
functionName: "mintAndRegisterIpAndMakeDerivativeWithLicenseTokens",
|
17964
|
-
args: [request.nftContract, request.licenseTokenIds, request.royaltyContext, request.
|
17976
|
+
args: [request.nftContract, request.licenseTokenIds, request.royaltyContext, request.ipMetadata, request.recipient]
|
17965
17977
|
})
|
17966
17978
|
};
|
17967
17979
|
}
|
@@ -18476,10 +18488,11 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
18476
18488
|
* @param request - The request object that contains all data needed to register IP.
|
18477
18489
|
* @param request.nftContract The address of the NFT.
|
18478
18490
|
* @param request.tokenId The token identifier of the NFT.
|
18479
|
-
* @param request.ipMetadata - [Optional] The
|
18480
|
-
* @param request.ipMetadata.
|
18481
|
-
* @param request.ipMetadata.
|
18482
|
-
* @param request.ipMetadata.
|
18491
|
+
* @param request.ipMetadata - [Optional] The desired metadata for the newly minted NFT and newly registered IP.
|
18492
|
+
* @param request.ipMetadata.ipMetadataURI [Optional] The URI of the metadata for the IP.
|
18493
|
+
* @param request.ipMetadata.ipMetadataHash [Optional] The hash of the metadata for the IP.
|
18494
|
+
* @param request.ipMetadata.nftMetadataURI [Optional] The URI of the metadata for the NFT.
|
18495
|
+
* @param request.ipMetadata.nftMetadataHash [Optional] The hash of the metadata for the IP NFT.
|
18483
18496
|
* @param request.deadline [Optional] The deadline for the signature in milliseconds, default is 1000ms.
|
18484
18497
|
* @param request.txOptions [Optional] The transaction options.
|
18485
18498
|
* @returns A Promise that resolves to an object containing the transaction hash and optional IP ID if waitForTxn is set to true.
|
@@ -18489,7 +18502,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
18489
18502
|
key: "register",
|
18490
18503
|
value: (function () {
|
18491
18504
|
var _register = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(request) {
|
18492
|
-
var _request$txOptions, tokenId, ipIdAddress, isRegistered, object, _request$txOptions2, txHash, calculatedDeadline, signature, txReceipt, targetLogs;
|
18505
|
+
var _request$ipMetadata, _request$ipMetadata2, _request$ipMetadata3, _request$ipMetadata4, _request$txOptions, tokenId, ipIdAddress, isRegistered, object, _request$txOptions2, txHash, calculatedDeadline, signature, txReceipt, targetLogs;
|
18493
18506
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
18494
18507
|
while (1) switch (_context.prev = _context.next) {
|
18495
18508
|
case 0:
|
@@ -18515,9 +18528,10 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
18515
18528
|
tokenId: tokenId,
|
18516
18529
|
nftContract: getAddress$1(request.nftContract, "request.nftContract"),
|
18517
18530
|
ipMetadata: {
|
18518
|
-
|
18519
|
-
|
18520
|
-
|
18531
|
+
ipMetadataURI: ((_request$ipMetadata = request.ipMetadata) === null || _request$ipMetadata === void 0 ? void 0 : _request$ipMetadata.ipMetadataURI) || "",
|
18532
|
+
ipMetadataHash: ((_request$ipMetadata2 = request.ipMetadata) === null || _request$ipMetadata2 === void 0 ? void 0 : _request$ipMetadata2.ipMetadataHash) || zeroHash,
|
18533
|
+
nftMetadataURI: ((_request$ipMetadata3 = request.ipMetadata) === null || _request$ipMetadata3 === void 0 ? void 0 : _request$ipMetadata3.nftMetadataURI) || "",
|
18534
|
+
nftMetadataHash: ((_request$ipMetadata4 = request.ipMetadata) === null || _request$ipMetadata4 === void 0 ? void 0 : _request$ipMetadata4.nftMetadataHash) || zeroHash
|
18521
18535
|
},
|
18522
18536
|
sigMetadata: {
|
18523
18537
|
signer: zeroAddress,
|
@@ -18525,25 +18539,18 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
18525
18539
|
signature: zeroHash
|
18526
18540
|
}
|
18527
18541
|
};
|
18528
|
-
if (request.ipMetadata && (request.ipMetadata.metadataHash !== zeroHash || request.ipMetadata.metadataURI !== "" || request.ipMetadata.nftMetadataHash !== zeroHash)) {
|
18529
|
-
object.ipMetadata = {
|
18530
|
-
metadataURI: request.ipMetadata.metadataURI || object.ipMetadata.metadataURI,
|
18531
|
-
metadataHash: request.ipMetadata.metadataHash || object.ipMetadata.metadataHash,
|
18532
|
-
nftMetadataHash: request.ipMetadata.nftMetadataHash || object.ipMetadata.nftMetadataHash
|
18533
|
-
};
|
18534
|
-
}
|
18535
18542
|
if (!((_request$txOptions = request.txOptions) !== null && _request$txOptions !== void 0 && _request$txOptions.encodedTxDataOnly)) {
|
18536
|
-
_context.next =
|
18543
|
+
_context.next = 19;
|
18537
18544
|
break;
|
18538
18545
|
}
|
18539
18546
|
if (!request.ipMetadata) {
|
18540
|
-
_context.next =
|
18547
|
+
_context.next = 16;
|
18541
18548
|
break;
|
18542
18549
|
}
|
18543
18550
|
return _context.abrupt("return", {
|
18544
18551
|
encodedTxData: this.spgClient.registerIpEncode(object)
|
18545
18552
|
});
|
18546
|
-
case
|
18553
|
+
case 16:
|
18547
18554
|
return _context.abrupt("return", {
|
18548
18555
|
encodedTxData: this.ipAssetRegistryClient.registerEncode({
|
18549
18556
|
tokenContract: object.nftContract,
|
@@ -18551,16 +18558,16 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
18551
18558
|
chainid: chain[this.chainId]
|
18552
18559
|
})
|
18553
18560
|
});
|
18554
|
-
case
|
18555
|
-
_context.next =
|
18561
|
+
case 17:
|
18562
|
+
_context.next = 42;
|
18556
18563
|
break;
|
18557
|
-
case
|
18564
|
+
case 19:
|
18558
18565
|
if (!request.ipMetadata) {
|
18559
|
-
_context.next =
|
18566
|
+
_context.next = 30;
|
18560
18567
|
break;
|
18561
18568
|
}
|
18562
18569
|
calculatedDeadline = getDeadline(request.deadline);
|
18563
|
-
_context.next =
|
18570
|
+
_context.next = 23;
|
18564
18571
|
return getPermissionSignature({
|
18565
18572
|
ipId: ipIdAddress,
|
18566
18573
|
deadline: calculatedDeadline,
|
@@ -18577,60 +18584,60 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
18577
18584
|
func: "function setAll(address,string,bytes32,bytes32)"
|
18578
18585
|
}]
|
18579
18586
|
});
|
18580
|
-
case
|
18587
|
+
case 23:
|
18581
18588
|
signature = _context.sent;
|
18582
18589
|
object.sigMetadata = {
|
18583
18590
|
signer: getAddress$1(this.wallet.account.address, "wallet.account.address"),
|
18584
18591
|
deadline: calculatedDeadline,
|
18585
18592
|
signature: signature
|
18586
18593
|
};
|
18587
|
-
_context.next =
|
18594
|
+
_context.next = 27;
|
18588
18595
|
return this.spgClient.registerIp(object);
|
18589
|
-
case
|
18596
|
+
case 27:
|
18590
18597
|
txHash = _context.sent;
|
18591
|
-
_context.next = 34;
|
18592
|
-
break;
|
18593
|
-
case 31:
|
18594
18598
|
_context.next = 33;
|
18599
|
+
break;
|
18600
|
+
case 30:
|
18601
|
+
_context.next = 32;
|
18595
18602
|
return this.ipAssetRegistryClient.register({
|
18596
18603
|
tokenContract: object.nftContract,
|
18597
18604
|
tokenId: object.tokenId,
|
18598
18605
|
chainid: chain[this.chainId]
|
18599
18606
|
});
|
18600
|
-
case
|
18607
|
+
case 32:
|
18601
18608
|
txHash = _context.sent;
|
18602
|
-
case
|
18609
|
+
case 33:
|
18603
18610
|
if (!((_request$txOptions2 = request.txOptions) !== null && _request$txOptions2 !== void 0 && _request$txOptions2.waitForTransaction)) {
|
18604
|
-
_context.next =
|
18611
|
+
_context.next = 41;
|
18605
18612
|
break;
|
18606
18613
|
}
|
18607
|
-
_context.next =
|
18614
|
+
_context.next = 36;
|
18608
18615
|
return this.rpcClient.waitForTransactionReceipt({
|
18609
18616
|
hash: txHash
|
18610
18617
|
});
|
18611
|
-
case
|
18618
|
+
case 36:
|
18612
18619
|
txReceipt = _context.sent;
|
18613
18620
|
targetLogs = this.ipAssetRegistryClient.parseTxIpRegisteredEvent(txReceipt);
|
18614
18621
|
return _context.abrupt("return", {
|
18615
18622
|
txHash: txHash,
|
18616
18623
|
ipId: targetLogs[0].ipId
|
18617
18624
|
});
|
18618
|
-
case
|
18625
|
+
case 41:
|
18619
18626
|
return _context.abrupt("return", {
|
18620
18627
|
txHash: txHash
|
18621
18628
|
});
|
18622
|
-
case
|
18623
|
-
_context.next =
|
18629
|
+
case 42:
|
18630
|
+
_context.next = 47;
|
18624
18631
|
break;
|
18625
|
-
case
|
18626
|
-
_context.prev =
|
18632
|
+
case 44:
|
18633
|
+
_context.prev = 44;
|
18627
18634
|
_context.t0 = _context["catch"](0);
|
18628
18635
|
handleError(_context.t0, "Failed to register IP");
|
18629
|
-
case
|
18636
|
+
case 47:
|
18630
18637
|
case "end":
|
18631
18638
|
return _context.stop();
|
18632
18639
|
}
|
18633
|
-
}, _callee, this, [[0,
|
18640
|
+
}, _callee, this, [[0, 44]]);
|
18634
18641
|
}));
|
18635
18642
|
function register(_x) {
|
18636
18643
|
return _register.apply(this, arguments);
|
@@ -18913,11 +18920,11 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
18913
18920
|
* @param request - The request object that contains all data needed to mint and register ip.
|
18914
18921
|
* @param request.nftContract The address of the NFT collection.
|
18915
18922
|
* @param request.pilType The type of the PIL.
|
18916
|
-
* @param request.ipMetadata - [Optional] The
|
18917
|
-
* @param request.ipMetadata.
|
18918
|
-
* @param request.ipMetadata.
|
18919
|
-
* @param request.ipMetadata.
|
18920
|
-
* @param request.
|
18923
|
+
* @param request.ipMetadata - [Optional] The desired metadata for the newly minted NFT and newly registered IP.
|
18924
|
+
* @param request.ipMetadata.ipMetadataURI [Optional] The URI of the metadata for the IP.
|
18925
|
+
* @param request.ipMetadata.ipMetadataHash [Optional] The hash of the metadata for the IP.
|
18926
|
+
* @param request.ipMetadata.nftMetadataURI [Optional] The URI of the metadata for the NFT.
|
18927
|
+
* @param request.ipMetadata.nftMetadataHash [Optional] The hash of the metadata for the IP NFT.
|
18921
18928
|
* @param request.recipient [Optional] The address of the recipient of the minted NFT.
|
18922
18929
|
* @param request.mintingFee [Optional] The fee to be paid when minting a license.
|
18923
18930
|
* @param request.commercialRevShare [Optional] Percentage of revenue that must be shared with the licensor.
|
@@ -18932,7 +18939,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
18932
18939
|
key: "mintAndRegisterIpAssetWithPilTerms",
|
18933
18940
|
value: (function () {
|
18934
18941
|
var _mintAndRegisterIpAssetWithPilTerms = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(request) {
|
18935
|
-
var _request$txOptions7, licenseTerm, object, _request$txOptions8, txHash, txReceipt, iPRegisteredLog, licenseTermsId;
|
18942
|
+
var _request$ipMetadata5, _request$ipMetadata6, _request$ipMetadata7, _request$ipMetadata8, _request$txOptions7, licenseTerm, object, _request$txOptions8, txHash, txReceipt, iPRegisteredLog, licenseTermsId;
|
18936
18943
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
18937
18944
|
while (1) switch (_context4.prev = _context4.next) {
|
18938
18945
|
case 0:
|
@@ -18954,40 +18961,33 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
18954
18961
|
recipient: request.recipient && getAddress$1(request.recipient, "request.recipient") || this.wallet.account.address,
|
18955
18962
|
terms: licenseTerm,
|
18956
18963
|
ipMetadata: {
|
18957
|
-
|
18958
|
-
|
18959
|
-
|
18960
|
-
|
18961
|
-
|
18964
|
+
ipMetadataURI: ((_request$ipMetadata5 = request.ipMetadata) === null || _request$ipMetadata5 === void 0 ? void 0 : _request$ipMetadata5.ipMetadataURI) || "",
|
18965
|
+
ipMetadataHash: ((_request$ipMetadata6 = request.ipMetadata) === null || _request$ipMetadata6 === void 0 ? void 0 : _request$ipMetadata6.ipMetadataHash) || zeroHash,
|
18966
|
+
nftMetadataURI: ((_request$ipMetadata7 = request.ipMetadata) === null || _request$ipMetadata7 === void 0 ? void 0 : _request$ipMetadata7.nftMetadataURI) || "",
|
18967
|
+
nftMetadataHash: ((_request$ipMetadata8 = request.ipMetadata) === null || _request$ipMetadata8 === void 0 ? void 0 : _request$ipMetadata8.nftMetadataHash) || zeroHash
|
18968
|
+
}
|
18962
18969
|
};
|
18963
|
-
if (request.ipMetadata && (request.ipMetadata.metadataHash !== zeroHash || request.ipMetadata.metadataURI !== "" || request.ipMetadata.nftMetadataHash !== zeroHash)) {
|
18964
|
-
object.ipMetadata = {
|
18965
|
-
metadataURI: request.ipMetadata.metadataURI || object.ipMetadata.metadataURI,
|
18966
|
-
metadataHash: request.ipMetadata.metadataHash || object.ipMetadata.metadataHash,
|
18967
|
-
nftMetadataHash: request.ipMetadata.nftMetadataHash || object.ipMetadata.nftMetadataHash
|
18968
|
-
};
|
18969
|
-
}
|
18970
18970
|
if (!((_request$txOptions7 = request.txOptions) !== null && _request$txOptions7 !== void 0 && _request$txOptions7.encodedTxDataOnly)) {
|
18971
|
-
_context4.next =
|
18971
|
+
_context4.next = 9;
|
18972
18972
|
break;
|
18973
18973
|
}
|
18974
18974
|
return _context4.abrupt("return", {
|
18975
18975
|
encodedTxData: this.spgClient.mintAndRegisterIpAndAttachPilTermsEncode(object)
|
18976
18976
|
});
|
18977
|
-
case
|
18978
|
-
_context4.next =
|
18977
|
+
case 9:
|
18978
|
+
_context4.next = 11;
|
18979
18979
|
return this.spgClient.mintAndRegisterIpAndAttachPilTerms(object);
|
18980
|
-
case
|
18980
|
+
case 11:
|
18981
18981
|
txHash = _context4.sent;
|
18982
18982
|
if (!((_request$txOptions8 = request.txOptions) !== null && _request$txOptions8 !== void 0 && _request$txOptions8.waitForTransaction)) {
|
18983
|
-
_context4.next =
|
18983
|
+
_context4.next = 19;
|
18984
18984
|
break;
|
18985
18985
|
}
|
18986
|
-
_context4.next =
|
18986
|
+
_context4.next = 15;
|
18987
18987
|
return this.rpcClient.waitForTransactionReceipt({
|
18988
18988
|
hash: txHash
|
18989
18989
|
});
|
18990
|
-
case
|
18990
|
+
case 15:
|
18991
18991
|
txReceipt = _context4.sent;
|
18992
18992
|
iPRegisteredLog = this.ipAssetRegistryClient.parseTxIpRegisteredEvent(txReceipt)[0];
|
18993
18993
|
licenseTermsId = this.licensingModuleClient.parseTxLicenseTermsAttachedEvent(txReceipt)[0].licenseTermsId;
|
@@ -18997,22 +18997,22 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
18997
18997
|
licenseTermsId: licenseTermsId,
|
18998
18998
|
tokenId: iPRegisteredLog.tokenId
|
18999
18999
|
});
|
19000
|
-
case
|
19000
|
+
case 19:
|
19001
19001
|
return _context4.abrupt("return", {
|
19002
19002
|
txHash: txHash
|
19003
19003
|
});
|
19004
|
-
case
|
19005
|
-
_context4.next =
|
19004
|
+
case 20:
|
19005
|
+
_context4.next = 25;
|
19006
19006
|
break;
|
19007
|
-
case
|
19008
|
-
_context4.prev =
|
19007
|
+
case 22:
|
19008
|
+
_context4.prev = 22;
|
19009
19009
|
_context4.t0 = _context4["catch"](0);
|
19010
19010
|
handleError(_context4.t0, "Failed to mint and register IP and attach PIL terms");
|
19011
|
-
case
|
19011
|
+
case 25:
|
19012
19012
|
case "end":
|
19013
19013
|
return _context4.stop();
|
19014
19014
|
}
|
19015
|
-
}, _callee4, this, [[0,
|
19015
|
+
}, _callee4, this, [[0, 22]]);
|
19016
19016
|
}));
|
19017
19017
|
function mintAndRegisterIpAssetWithPilTerms(_x4) {
|
19018
19018
|
return _mintAndRegisterIpAssetWithPilTerms.apply(this, arguments);
|
@@ -19025,10 +19025,11 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
19025
19025
|
* @param request.nftContract The address of the NFT collection.
|
19026
19026
|
* @param request.tokenId The ID of the NFT.
|
19027
19027
|
* @param request.pilType The type of the PIL.
|
19028
|
-
* @param request.ipMetadata - [Optional] The desired
|
19029
|
-
* @param request.ipMetadata.
|
19030
|
-
* @param request.ipMetadata.
|
19031
|
-
* @param request.ipMetadata.
|
19028
|
+
* @param request.ipMetadata - [Optional] The desired metadata for the newly minted NFT and newly registered IP.
|
19029
|
+
* @param request.ipMetadata.ipMetadataURI [Optional] The URI of the metadata for the IP.
|
19030
|
+
* @param request.ipMetadata.ipMetadataHash [Optional] The hash of the metadata for the IP.
|
19031
|
+
* @param request.ipMetadata.nftMetadataURI [Optional] The URI of the metadata for the NFT.
|
19032
|
+
* @param request.ipMetadata.nftMetadataHash [Optional] The hash of the metadata for the IP NFT.
|
19032
19033
|
* @param request.deadline [Optional] The deadline for the signature in milliseconds, default is 1000ms.
|
19033
19034
|
* @param request.mintingFee [Optional] The fee to be paid when minting a license.
|
19034
19035
|
* @param request.commercialRevShare [Optional] Percentage of revenue that must be shared with the licensor.
|
@@ -19042,7 +19043,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
19042
19043
|
key: "registerIpAndAttachPilTerms",
|
19043
19044
|
value: (function () {
|
19044
19045
|
var _registerIpAndAttachPilTerms = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(request) {
|
19045
|
-
var _request$txOptions9, ipIdAddress, isRegistered, licenseTerm, calculatedDeadline, sigAttachSignature, object, sigMetadataSignature, _request$txOptions10, txHash, txReceipt, log;
|
19046
|
+
var _request$ipMetadata9, _request$ipMetadata10, _request$ipMetadata11, _request$ipMetadata12, _request$txOptions9, ipIdAddress, isRegistered, licenseTerm, calculatedDeadline, sigAttachSignature, object, sigMetadataSignature, _request$txOptions10, txHash, txReceipt, log;
|
19046
19047
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
19047
19048
|
while (1) switch (_context5.prev = _context5.next) {
|
19048
19049
|
case 0:
|
@@ -19103,9 +19104,10 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
19103
19104
|
tokenId: request.tokenId,
|
19104
19105
|
terms: licenseTerm,
|
19105
19106
|
ipMetadata: {
|
19106
|
-
|
19107
|
-
|
19108
|
-
|
19107
|
+
ipMetadataURI: ((_request$ipMetadata9 = request.ipMetadata) === null || _request$ipMetadata9 === void 0 ? void 0 : _request$ipMetadata9.ipMetadataURI) || "",
|
19108
|
+
ipMetadataHash: ((_request$ipMetadata10 = request.ipMetadata) === null || _request$ipMetadata10 === void 0 ? void 0 : _request$ipMetadata10.ipMetadataHash) || zeroHash,
|
19109
|
+
nftMetadataURI: ((_request$ipMetadata11 = request.ipMetadata) === null || _request$ipMetadata11 === void 0 ? void 0 : _request$ipMetadata11.nftMetadataURI) || "",
|
19110
|
+
nftMetadataHash: ((_request$ipMetadata12 = request.ipMetadata) === null || _request$ipMetadata12 === void 0 ? void 0 : _request$ipMetadata12.nftMetadataHash) || zeroHash
|
19109
19111
|
},
|
19110
19112
|
sigMetadata: {
|
19111
19113
|
signer: zeroAddress,
|
@@ -19118,14 +19120,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
19118
19120
|
signature: sigAttachSignature
|
19119
19121
|
}
|
19120
19122
|
};
|
19121
|
-
|
19122
|
-
object.ipMetadata = {
|
19123
|
-
metadataURI: request.ipMetadata.metadataURI || object.ipMetadata.metadataURI,
|
19124
|
-
metadataHash: request.ipMetadata.metadataHash || object.ipMetadata.metadataHash,
|
19125
|
-
nftMetadataHash: request.ipMetadata.nftMetadataHash || object.ipMetadata.nftMetadataHash
|
19126
|
-
};
|
19127
|
-
}
|
19128
|
-
_context5.next = 21;
|
19123
|
+
_context5.next = 20;
|
19129
19124
|
return getPermissionSignature({
|
19130
19125
|
ipId: ipIdAddress,
|
19131
19126
|
deadline: calculatedDeadline,
|
@@ -19142,7 +19137,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
19142
19137
|
func: "function setAll(address,string,bytes32,bytes32)"
|
19143
19138
|
}]
|
19144
19139
|
});
|
19145
|
-
case
|
19140
|
+
case 20:
|
19146
19141
|
sigMetadataSignature = _context5.sent;
|
19147
19142
|
object.sigMetadata = {
|
19148
19143
|
signer: getAddress$1(this.wallet.account.address, "wallet.account.address"),
|
@@ -19150,26 +19145,26 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
19150
19145
|
signature: sigMetadataSignature
|
19151
19146
|
};
|
19152
19147
|
if (!((_request$txOptions9 = request.txOptions) !== null && _request$txOptions9 !== void 0 && _request$txOptions9.encodedTxDataOnly)) {
|
19153
|
-
_context5.next =
|
19148
|
+
_context5.next = 26;
|
19154
19149
|
break;
|
19155
19150
|
}
|
19156
19151
|
return _context5.abrupt("return", {
|
19157
19152
|
encodedTxData: this.spgClient.registerIpAndAttachPilTermsEncode(object)
|
19158
19153
|
});
|
19159
|
-
case
|
19160
|
-
_context5.next =
|
19154
|
+
case 26:
|
19155
|
+
_context5.next = 28;
|
19161
19156
|
return this.spgClient.registerIpAndAttachPilTerms(object);
|
19162
|
-
case
|
19157
|
+
case 28:
|
19163
19158
|
txHash = _context5.sent;
|
19164
19159
|
if (!((_request$txOptions10 = request.txOptions) !== null && _request$txOptions10 !== void 0 && _request$txOptions10.waitForTransaction)) {
|
19165
|
-
_context5.next =
|
19160
|
+
_context5.next = 35;
|
19166
19161
|
break;
|
19167
19162
|
}
|
19168
|
-
_context5.next =
|
19163
|
+
_context5.next = 32;
|
19169
19164
|
return this.rpcClient.waitForTransactionReceipt({
|
19170
19165
|
hash: txHash
|
19171
19166
|
});
|
19172
|
-
case
|
19167
|
+
case 32:
|
19173
19168
|
txReceipt = _context5.sent;
|
19174
19169
|
log = this.licensingModuleClient.parseTxLicenseTermsAttachedEvent(txReceipt)[0];
|
19175
19170
|
return _context5.abrupt("return", {
|
@@ -19177,22 +19172,22 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
19177
19172
|
licenseTermsId: log.licenseTermsId,
|
19178
19173
|
ipId: log.ipId
|
19179
19174
|
});
|
19180
|
-
case
|
19175
|
+
case 35:
|
19181
19176
|
return _context5.abrupt("return", {
|
19182
19177
|
txHash: txHash
|
19183
19178
|
});
|
19184
|
-
case
|
19185
|
-
_context5.next =
|
19179
|
+
case 36:
|
19180
|
+
_context5.next = 41;
|
19186
19181
|
break;
|
19187
|
-
case
|
19188
|
-
_context5.prev =
|
19182
|
+
case 38:
|
19183
|
+
_context5.prev = 38;
|
19189
19184
|
_context5.t0 = _context5["catch"](0);
|
19190
19185
|
handleError(_context5.t0, "Failed to register IP and attach PIL terms");
|
19191
|
-
case
|
19186
|
+
case 41:
|
19192
19187
|
case "end":
|
19193
19188
|
return _context5.stop();
|
19194
19189
|
}
|
19195
|
-
}, _callee5, this, [[0,
|
19190
|
+
}, _callee5, this, [[0, 38]]);
|
19196
19191
|
}));
|
19197
19192
|
function registerIpAndAttachPilTerms(_x5) {
|
19198
19193
|
return _registerIpAndAttachPilTerms.apply(this, arguments);
|
@@ -19208,10 +19203,11 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
19208
19203
|
* @param request.derivData.parentIpIds The IDs of the parent IPs to link the registered derivative IP.
|
19209
19204
|
* @param request.derivData.licenseTemplate [Optional] The address of the license template to be used for the linking.
|
19210
19205
|
* @param request.derivData.licenseTermsIds The IDs of the license terms to be used for the linking.
|
19211
|
-
* @param request.ipMetadata - [Optional] The desired
|
19212
|
-
* @param request.ipMetadata.
|
19213
|
-
* @param request.ipMetadata.
|
19214
|
-
* @param request.ipMetadata.
|
19206
|
+
* @param request.ipMetadata - [Optional] The desired metadata for the newly minted NFT and newly registered IP.
|
19207
|
+
* @param request.ipMetadata.ipMetadataURI [Optional] The URI of the metadata for the IP.
|
19208
|
+
* @param request.ipMetadata.ipMetadataHash [Optional] The hash of the metadata for the IP.
|
19209
|
+
* @param request.ipMetadata.nftMetadataURI [Optional] The URI of the metadata for the NFT.
|
19210
|
+
* @param request.ipMetadata.nftMetadataHash [Optional] The hash of the metadata for the IP NFT.
|
19215
19211
|
* @param request.deadline [Optional] The deadline for the signature in milliseconds,default is 1000ms.
|
19216
19212
|
* @param request.txOptions [Optional] The transaction options.
|
19217
19213
|
* @returns A Promise that resolves to an object containing the transaction hash and optional IP ID if waitForTxn is set to true.
|
@@ -19222,7 +19218,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
19222
19218
|
key: "registerDerivativeIp",
|
19223
19219
|
value: (function () {
|
19224
19220
|
var _registerDerivativeIp = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(request) {
|
19225
|
-
var _request$txOptions11, tokenId, ipIdAddress, isRegistered, i, isAttachedLicenseTerms, calculatedDeadline, sigRegisterSignature, object, sigMetadataSignature, _request$txOptions12, txHash, receipt, log;
|
19221
|
+
var _request$ipMetadata13, _request$ipMetadata14, _request$ipMetadata15, _request$ipMetadata16, _request$txOptions11, tokenId, ipIdAddress, isRegistered, i, isAttachedLicenseTerms, calculatedDeadline, sigRegisterSignature, object, sigMetadataSignature, _request$txOptions12, txHash, receipt, log;
|
19226
19222
|
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
19227
19223
|
while (1) switch (_context6.prev = _context6.next) {
|
19228
19224
|
case 0:
|
@@ -19315,9 +19311,10 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
19315
19311
|
signature: sigRegisterSignature
|
19316
19312
|
},
|
19317
19313
|
ipMetadata: {
|
19318
|
-
|
19319
|
-
|
19320
|
-
|
19314
|
+
ipMetadataURI: ((_request$ipMetadata13 = request.ipMetadata) === null || _request$ipMetadata13 === void 0 ? void 0 : _request$ipMetadata13.ipMetadataURI) || "",
|
19315
|
+
ipMetadataHash: ((_request$ipMetadata14 = request.ipMetadata) === null || _request$ipMetadata14 === void 0 ? void 0 : _request$ipMetadata14.ipMetadataHash) || zeroHash,
|
19316
|
+
nftMetadataURI: ((_request$ipMetadata15 = request.ipMetadata) === null || _request$ipMetadata15 === void 0 ? void 0 : _request$ipMetadata15.nftMetadataURI) || "",
|
19317
|
+
nftMetadataHash: ((_request$ipMetadata16 = request.ipMetadata) === null || _request$ipMetadata16 === void 0 ? void 0 : _request$ipMetadata16.nftMetadataHash) || zeroHash
|
19321
19318
|
},
|
19322
19319
|
sigMetadata: {
|
19323
19320
|
signer: zeroAddress,
|
@@ -19325,14 +19322,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
19325
19322
|
signature: zeroHash
|
19326
19323
|
}
|
19327
19324
|
};
|
19328
|
-
|
19329
|
-
object.ipMetadata = {
|
19330
|
-
metadataURI: request.ipMetadata.metadataURI || object.ipMetadata.metadataURI,
|
19331
|
-
metadataHash: request.ipMetadata.metadataHash || object.ipMetadata.metadataHash,
|
19332
|
-
nftMetadataHash: request.ipMetadata.nftMetadataHash || object.ipMetadata.nftMetadataHash
|
19333
|
-
};
|
19334
|
-
}
|
19335
|
-
_context6.next = 30;
|
19325
|
+
_context6.next = 29;
|
19336
19326
|
return getPermissionSignature({
|
19337
19327
|
ipId: ipIdAddress,
|
19338
19328
|
deadline: calculatedDeadline,
|
@@ -19349,7 +19339,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
19349
19339
|
func: "function setAll(address,string,bytes32,bytes32)"
|
19350
19340
|
}]
|
19351
19341
|
});
|
19352
|
-
case
|
19342
|
+
case 29:
|
19353
19343
|
sigMetadataSignature = _context6.sent;
|
19354
19344
|
object.sigMetadata = {
|
19355
19345
|
signer: getAddress$1(this.wallet.account.address, "wallet.account.address"),
|
@@ -19357,48 +19347,48 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
19357
19347
|
signature: sigMetadataSignature
|
19358
19348
|
};
|
19359
19349
|
if (!((_request$txOptions11 = request.txOptions) !== null && _request$txOptions11 !== void 0 && _request$txOptions11.encodedTxDataOnly)) {
|
19360
|
-
_context6.next =
|
19350
|
+
_context6.next = 35;
|
19361
19351
|
break;
|
19362
19352
|
}
|
19363
19353
|
return _context6.abrupt("return", {
|
19364
19354
|
encodedTxData: this.spgClient.registerIpAndMakeDerivativeEncode(object)
|
19365
19355
|
});
|
19366
|
-
case
|
19367
|
-
_context6.next =
|
19356
|
+
case 35:
|
19357
|
+
_context6.next = 37;
|
19368
19358
|
return this.spgClient.registerIpAndMakeDerivative(object);
|
19369
|
-
case
|
19359
|
+
case 37:
|
19370
19360
|
txHash = _context6.sent;
|
19371
19361
|
if (!((_request$txOptions12 = request.txOptions) !== null && _request$txOptions12 !== void 0 && _request$txOptions12.waitForTransaction)) {
|
19372
|
-
_context6.next =
|
19362
|
+
_context6.next = 44;
|
19373
19363
|
break;
|
19374
19364
|
}
|
19375
|
-
_context6.next =
|
19365
|
+
_context6.next = 41;
|
19376
19366
|
return this.rpcClient.waitForTransactionReceipt({
|
19377
19367
|
hash: txHash
|
19378
19368
|
});
|
19379
|
-
case
|
19369
|
+
case 41:
|
19380
19370
|
receipt = _context6.sent;
|
19381
19371
|
log = this.ipAssetRegistryClient.parseTxIpRegisteredEvent(receipt)[0];
|
19382
19372
|
return _context6.abrupt("return", {
|
19383
19373
|
txHash: txHash,
|
19384
19374
|
ipId: log.ipId
|
19385
19375
|
});
|
19386
|
-
case
|
19376
|
+
case 44:
|
19387
19377
|
return _context6.abrupt("return", {
|
19388
19378
|
txHash: txHash
|
19389
19379
|
});
|
19390
|
-
case
|
19391
|
-
_context6.next =
|
19380
|
+
case 45:
|
19381
|
+
_context6.next = 50;
|
19392
19382
|
break;
|
19393
|
-
case
|
19394
|
-
_context6.prev =
|
19383
|
+
case 47:
|
19384
|
+
_context6.prev = 47;
|
19395
19385
|
_context6.t0 = _context6["catch"](0);
|
19396
19386
|
handleError(_context6.t0, "Failed to register derivative IP");
|
19397
|
-
case
|
19387
|
+
case 50:
|
19398
19388
|
case "end":
|
19399
19389
|
return _context6.stop();
|
19400
19390
|
}
|
19401
|
-
}, _callee6, this, [[0,
|
19391
|
+
}, _callee6, this, [[0, 47]]);
|
19402
19392
|
}));
|
19403
19393
|
function registerDerivativeIp(_x6) {
|
19404
19394
|
return _registerDerivativeIp.apply(this, arguments);
|
@@ -19413,11 +19403,11 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
19413
19403
|
* @param request.derivData.parentIpIds The IDs of the parent IPs to link the registered derivative IP.
|
19414
19404
|
* @param request.derivData.licenseTermsIds The IDs of the license terms to be used for the linking.
|
19415
19405
|
* @param request.derivData.licenseTemplate [Optional] The address of the license template to be used for the linking.
|
19416
|
-
* @param request.ipMetadata - [Optional] The desired
|
19417
|
-
* @param request.ipMetadata.
|
19418
|
-
* @param request.ipMetadata.
|
19419
|
-
* @param request.ipMetadata.
|
19420
|
-
* @param request.recipient [Optional] The address of the recipient of the minted NFT.
|
19406
|
+
* @param request.ipMetadata - [Optional] The desired metadata for the newly minted NFT and newly registered IP.
|
19407
|
+
* @param request.ipMetadata.ipMetadataURI [Optional] The URI of the metadata for the IP.
|
19408
|
+
* @param request.ipMetadata.ipMetadataHash [Optional] The hash of the metadata for the IP.
|
19409
|
+
* @param request.ipMetadata.nftMetadataURI [Optional] The URI of the metadata for the NFT.
|
19410
|
+
* @param request.ipMetadata.nftMetadataHash [Optional] The hash of the metadata for the IP NFT.* @param request.recipient [Optional] The address of the recipient of the minted NFT.
|
19421
19411
|
* @param request.txOptions [Optional] The transaction options.
|
19422
19412
|
* @returns A Promise that resolves to an object containing the transaction hash and optional IP ID if waitForTxn is set to true.
|
19423
19413
|
* @emits IPRegistered (ipId, chainId, tokenContract, tokenId, name, uri, registrationDate)
|
@@ -19427,7 +19417,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
19427
19417
|
key: "mintAndRegisterIpAndMakeDerivative",
|
19428
19418
|
value: (function () {
|
19429
19419
|
var _mintAndRegisterIpAndMakeDerivative = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(request) {
|
19430
|
-
var _request$txOptions13, i, isAttachedLicenseTerms, object, _request$txOptions14, txHash, receipt, log;
|
19420
|
+
var _request$ipMetadata17, _request$ipMetadata18, _request$ipMetadata19, _request$ipMetadata20, _request$txOptions13, i, isAttachedLicenseTerms, object, _request$txOptions14, txHash, receipt, log;
|
19431
19421
|
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
19432
19422
|
while (1) switch (_context7.prev = _context7.next) {
|
19433
19423
|
case 0:
|
@@ -19470,64 +19460,57 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
19470
19460
|
return BigInt(id);
|
19471
19461
|
})
|
19472
19462
|
}),
|
19473
|
-
nftMetadata: request.nftMetadata || "",
|
19474
19463
|
ipMetadata: {
|
19475
|
-
|
19476
|
-
|
19477
|
-
|
19464
|
+
ipMetadataURI: ((_request$ipMetadata17 = request.ipMetadata) === null || _request$ipMetadata17 === void 0 ? void 0 : _request$ipMetadata17.ipMetadataURI) || "",
|
19465
|
+
ipMetadataHash: ((_request$ipMetadata18 = request.ipMetadata) === null || _request$ipMetadata18 === void 0 ? void 0 : _request$ipMetadata18.ipMetadataHash) || zeroHash,
|
19466
|
+
nftMetadataURI: ((_request$ipMetadata19 = request.ipMetadata) === null || _request$ipMetadata19 === void 0 ? void 0 : _request$ipMetadata19.nftMetadataURI) || "",
|
19467
|
+
nftMetadataHash: ((_request$ipMetadata20 = request.ipMetadata) === null || _request$ipMetadata20 === void 0 ? void 0 : _request$ipMetadata20.nftMetadataHash) || zeroHash
|
19478
19468
|
},
|
19479
19469
|
recipient: request.recipient && getAddress$1(request.recipient, "request.recipient") || this.wallet.account.address
|
19480
19470
|
});
|
19481
|
-
if (request.ipMetadata && (request.ipMetadata.metadataHash !== zeroHash || request.ipMetadata.metadataURI !== "" || request.ipMetadata.nftMetadataHash !== zeroHash)) {
|
19482
|
-
object.ipMetadata = {
|
19483
|
-
metadataURI: request.ipMetadata.metadataURI || object.ipMetadata.metadataURI,
|
19484
|
-
metadataHash: request.ipMetadata.metadataHash || object.ipMetadata.metadataHash,
|
19485
|
-
nftMetadataHash: request.ipMetadata.nftMetadataHash || object.ipMetadata.nftMetadataHash
|
19486
|
-
};
|
19487
|
-
}
|
19488
19471
|
if (!((_request$txOptions13 = request.txOptions) !== null && _request$txOptions13 !== void 0 && _request$txOptions13.encodedTxDataOnly)) {
|
19489
|
-
_context7.next =
|
19472
|
+
_context7.next = 18;
|
19490
19473
|
break;
|
19491
19474
|
}
|
19492
19475
|
return _context7.abrupt("return", {
|
19493
19476
|
encodedTxData: this.spgClient.mintAndRegisterIpAndMakeDerivativeEncode(object)
|
19494
19477
|
});
|
19495
|
-
case
|
19496
|
-
_context7.next =
|
19478
|
+
case 18:
|
19479
|
+
_context7.next = 20;
|
19497
19480
|
return this.spgClient.mintAndRegisterIpAndMakeDerivative(object);
|
19498
|
-
case
|
19481
|
+
case 20:
|
19499
19482
|
txHash = _context7.sent;
|
19500
19483
|
if (!((_request$txOptions14 = request.txOptions) !== null && _request$txOptions14 !== void 0 && _request$txOptions14.waitForTransaction)) {
|
19501
|
-
_context7.next =
|
19484
|
+
_context7.next = 27;
|
19502
19485
|
break;
|
19503
19486
|
}
|
19504
|
-
_context7.next =
|
19487
|
+
_context7.next = 24;
|
19505
19488
|
return this.rpcClient.waitForTransactionReceipt({
|
19506
19489
|
hash: txHash
|
19507
19490
|
});
|
19508
|
-
case
|
19491
|
+
case 24:
|
19509
19492
|
receipt = _context7.sent;
|
19510
19493
|
log = this.ipAssetRegistryClient.parseTxIpRegisteredEvent(receipt)[0];
|
19511
19494
|
return _context7.abrupt("return", {
|
19512
19495
|
txHash: txHash,
|
19513
19496
|
childIpId: log.ipId
|
19514
19497
|
});
|
19515
|
-
case
|
19498
|
+
case 27:
|
19516
19499
|
return _context7.abrupt("return", {
|
19517
19500
|
txHash: txHash
|
19518
19501
|
});
|
19519
|
-
case
|
19520
|
-
_context7.next =
|
19502
|
+
case 28:
|
19503
|
+
_context7.next = 33;
|
19521
19504
|
break;
|
19522
|
-
case
|
19523
|
-
_context7.prev =
|
19505
|
+
case 30:
|
19506
|
+
_context7.prev = 30;
|
19524
19507
|
_context7.t0 = _context7["catch"](0);
|
19525
19508
|
handleError(_context7.t0, "Failed to mint and register IP and make derivative");
|
19526
|
-
case
|
19509
|
+
case 33:
|
19527
19510
|
case "end":
|
19528
19511
|
return _context7.stop();
|
19529
19512
|
}
|
19530
|
-
}, _callee7, this, [[0,
|
19513
|
+
}, _callee7, this, [[0, 30]]);
|
19531
19514
|
}));
|
19532
19515
|
function mintAndRegisterIpAndMakeDerivative(_x7) {
|
19533
19516
|
return _mintAndRegisterIpAndMakeDerivative.apply(this, arguments);
|