@story-protocol/core-sdk 1.0.0-rc.5 → 1.1.0-stable
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +8 -9
- package/dist/declarations/src/abi/generated.d.ts +18329 -10708
- package/dist/declarations/src/abi/generated.d.ts.map +1 -1
- package/dist/declarations/src/client.d.ts +9 -1
- package/dist/declarations/src/client.d.ts.map +1 -1
- package/dist/declarations/src/constants/common.d.ts +2 -1
- package/dist/declarations/src/constants/common.d.ts.map +1 -1
- package/dist/declarations/src/index.d.ts +17 -8
- package/dist/declarations/src/index.d.ts.map +1 -1
- package/dist/declarations/src/resources/dispute.d.ts +5 -3
- package/dist/declarations/src/resources/dispute.d.ts.map +1 -1
- package/dist/declarations/src/resources/ipAccount.d.ts +19 -4
- package/dist/declarations/src/resources/ipAccount.d.ts.map +1 -1
- package/dist/declarations/src/resources/ipAsset.d.ts +154 -7
- package/dist/declarations/src/resources/ipAsset.d.ts.map +1 -1
- package/dist/declarations/src/resources/license.d.ts +50 -20
- package/dist/declarations/src/resources/license.d.ts.map +1 -1
- package/dist/declarations/src/resources/nftClient.d.ts +24 -0
- package/dist/declarations/src/resources/nftClient.d.ts.map +1 -0
- package/dist/declarations/src/resources/permission.d.ts +71 -9
- package/dist/declarations/src/resources/permission.d.ts.map +1 -1
- package/dist/declarations/src/resources/royalty.d.ts +15 -10
- package/dist/declarations/src/resources/royalty.d.ts.map +1 -1
- package/dist/declarations/src/types/common.d.ts +12 -1
- package/dist/declarations/src/types/common.d.ts.map +1 -1
- package/dist/declarations/src/types/config.d.ts +2 -2
- package/dist/declarations/src/types/config.d.ts.map +1 -1
- package/dist/declarations/src/types/options.d.ts +4 -5
- package/dist/declarations/src/types/options.d.ts.map +1 -1
- package/dist/declarations/src/types/resources/dispute.d.ts +13 -30
- package/dist/declarations/src/types/resources/dispute.d.ts.map +1 -1
- package/dist/declarations/src/types/resources/ipAccount.d.ts +21 -11
- package/dist/declarations/src/types/resources/ipAccount.d.ts.map +1 -1
- package/dist/declarations/src/types/resources/ipAsset.d.ts +160 -14
- package/dist/declarations/src/types/resources/ipAsset.d.ts.map +1 -1
- package/dist/declarations/src/types/resources/license.d.ts +50 -25
- package/dist/declarations/src/types/resources/license.d.ts.map +1 -1
- package/dist/declarations/src/types/resources/nftClient.d.ts +18 -0
- package/dist/declarations/src/types/resources/nftClient.d.ts.map +1 -0
- package/dist/declarations/src/types/resources/permission.d.ts +34 -5
- package/dist/declarations/src/types/resources/permission.d.ts.map +1 -1
- package/dist/declarations/src/types/resources/royalty.d.ts +34 -30
- package/dist/declarations/src/types/resources/royalty.d.ts.map +1 -1
- package/dist/declarations/src/utils/chain.d.ts +34 -0
- package/dist/declarations/src/utils/chain.d.ts.map +1 -0
- package/dist/declarations/src/utils/sign.d.ts +16 -0
- package/dist/declarations/src/utils/sign.d.ts.map +1 -0
- package/dist/story-protocol-core-sdk.cjs.dev.js +15258 -8106
- package/dist/story-protocol-core-sdk.cjs.prod.js +15258 -8106
- package/dist/story-protocol-core-sdk.esm.js +15970 -8822
- package/package.json +2 -2
@@ -1,22 +1,88 @@
|
|
1
1
|
import { PublicClient } from "viem";
|
2
2
|
import { SupportedChainIds } from "../types/config.js";
|
3
|
-
import { RegisterDerivativeRequest, RegisterDerivativeResponse, RegisterDerivativeWithLicenseTokensRequest, RegisterDerivativeWithLicenseTokensResponse, RegisterIpResponse, RegisterRequest } from "../types/resources/ipAsset.js";
|
4
|
-
import { IpAssetRegistryClient, LicenseRegistryReadOnlyClient, LicenseTokenReadOnlyClient, LicensingModuleClient, PiLicenseTemplateClient, SimpleWalletClient } from "../abi/generated.js";
|
3
|
+
import { CreateIpAssetWithPilTermsRequest, CreateIpAssetWithPilTermsResponse, GenerateCreatorMetadataParam, GenerateIpMetadataParam, IpCreator, IpMetadata, MintAndRegisterIpAndMakeDerivativeRequest, RegisterDerivativeRequest, RegisterDerivativeResponse, RegisterDerivativeWithLicenseTokensRequest, RegisterDerivativeWithLicenseTokensResponse, RegisterIpAndAttachPilTermsRequest, RegisterIpAndAttachPilTermsResponse, RegisterIpAndMakeDerivativeRequest, RegisterIpAndMakeDerivativeResponse, RegisterIpResponse, RegisterRequest } from "../types/resources/ipAsset.js";
|
4
|
+
import { AccessControllerClient, CoreMetadataModuleClient, IpAssetRegistryClient, LicenseRegistryReadOnlyClient, LicenseTokenReadOnlyClient, LicensingModuleClient, PiLicenseTemplateClient, RoyaltyPolicyLapClient, SimpleWalletClient, SpgClient } from "../abi/generated.js";
|
5
5
|
export declare class IPAssetClient {
|
6
6
|
licensingModuleClient: LicensingModuleClient;
|
7
7
|
ipAssetRegistryClient: IpAssetRegistryClient;
|
8
8
|
licenseTemplateClient: PiLicenseTemplateClient;
|
9
9
|
licenseRegistryReadOnlyClient: LicenseRegistryReadOnlyClient;
|
10
10
|
licenseTokenReadOnlyClient: LicenseTokenReadOnlyClient;
|
11
|
+
royaltyPolicyLAPClient: RoyaltyPolicyLapClient;
|
12
|
+
accessControllerClient: AccessControllerClient;
|
13
|
+
coreMetadataModuleClient: CoreMetadataModuleClient;
|
14
|
+
spgClient: SpgClient;
|
11
15
|
private readonly rpcClient;
|
16
|
+
private readonly wallet;
|
12
17
|
private readonly chainId;
|
13
18
|
constructor(rpcClient: PublicClient, wallet: SimpleWalletClient, chainId: SupportedChainIds);
|
19
|
+
/**
|
20
|
+
* Create a new `IpCreator` object with the specified details.
|
21
|
+
* @param params - The parameters required to create the `IpCreator` object.
|
22
|
+
* @param params.name The name of the creator.
|
23
|
+
* @param params.address The wallet address of the creator.
|
24
|
+
* @param params.description [Optional] A description of the creator.
|
25
|
+
* @param params.image [Optional] The URL or path to an image representing the creator.
|
26
|
+
* @param params.socialMedia [Optional] An array of social media profiles associated with the creator.
|
27
|
+
* @param params.socialMedia[].platform The name of the social media platform.
|
28
|
+
* @param params.socialMedia[].url The URL to the creator's profile on the platform.
|
29
|
+
* @param params.contributionPercent The percentage of contribution by the creator, must add up to 100.
|
30
|
+
* @param params.role [Optional] The role of the creator in relation to the IP.
|
31
|
+
* @returns An `IpCreator` object containing the provided details.
|
32
|
+
*/
|
33
|
+
generateCreatorMetadata(param: GenerateCreatorMetadataParam): IpCreator;
|
34
|
+
/**
|
35
|
+
* Create a new `IpMetadata` object with the specified details.
|
36
|
+
* @param params - The parameters required to create the `IpMetadata` object.
|
37
|
+
* @param params.title [Optional] The title of the IP.
|
38
|
+
* @param params.description [Optional] A description of the IP.
|
39
|
+
* @param params.ipType [Optional] The type of the IP asset (e.g., "character", "chapter").
|
40
|
+
* @param params.relationships [Optional] An array of relationships between this IP and its parent IPs.
|
41
|
+
* @param params.relationships[].ipId The ID of the parent IP.
|
42
|
+
* @param params.relationships[].type The type of relationship (e.g., "APPEARS_IN").
|
43
|
+
* @param params.createdAt [Optional] The creation date and time of the IP in ISO 8601 format.
|
44
|
+
* @param params.watermarkImg [Optional] The URL or path to an image used as a watermark for the IP.
|
45
|
+
* @param params.creators [Optional] An array of creators associated with the IP.
|
46
|
+
* @param params.creators[].name The name of the creator.
|
47
|
+
* @param params.creators[].address The address of the creator.
|
48
|
+
* @param params.creators[].description [Optional] A description of the creator.
|
49
|
+
* @param params.creators[].image [Optional] The URL or path to an image representing the creator.
|
50
|
+
* @param params.creators[].socialMedia [Optional] An array of social media profiles for the creator.
|
51
|
+
* @param params.creators[].socialMedia[].platform The social media platform name.
|
52
|
+
* @param params.creators[].socialMedia[].url The URL to the creator's profile.
|
53
|
+
* @param params.creators[].role [Optional] The role of the creator in relation to the IP.
|
54
|
+
* @param params.creators[].contributionPercent The percentage of contribution by the creator.
|
55
|
+
* @param params.media [Optional] An array of media related to the IP.
|
56
|
+
* @param params.media[].name The name of the media.
|
57
|
+
* @param params.media[].url The URL to the media.
|
58
|
+
* @param params.media[].mimeType The MIME type of the media.
|
59
|
+
* @param params.attributes [Optional] An array of key-value pairs providing additional metadata.
|
60
|
+
* @param params.attributes[].key The key for the attribute.
|
61
|
+
* @param params.attributes[].value The value for the attribute, can be a string or number.
|
62
|
+
* @param params.app [Optional] Information about the application associated with the IP.
|
63
|
+
* @param params.app.id The ID of the application.
|
64
|
+
* @param params.app.name The name of the application.
|
65
|
+
* @param params.app.website The website URL of the application.
|
66
|
+
* @param params.tags [Optional] An array of tags associated with the IP.
|
67
|
+
* @param params.robotTerms [Optional] Robot terms for the IP, specifying access rules.
|
68
|
+
* @param params.robotTerms.userAgent The user agent for which the rules apply.
|
69
|
+
* @param params.robotTerms.allow The rules allowing access.
|
70
|
+
* @param params.additionalProperties [Optional] Any additional key-value pairs to include in the metadata.
|
71
|
+
* @returns An `IpMetadata` object containing the provided details and any additional properties.
|
72
|
+
*/
|
73
|
+
generateIpMetadata(param: GenerateIpMetadataParam): IpMetadata;
|
14
74
|
/**
|
15
75
|
* Registers an NFT as IP, creating a corresponding IP record.
|
16
76
|
* @param request - The request object that contains all data needed to register IP.
|
17
|
-
* @param request.
|
77
|
+
* @param request.nftContract The address of the NFT.
|
18
78
|
* @param request.tokenId The token identifier of the NFT.
|
19
|
-
* @param request.
|
79
|
+
* @param request.ipMetadata - [Optional] The desired metadata for the newly minted NFT and newly registered IP.
|
80
|
+
* @param request.ipMetadata.ipMetadataURI [Optional] The URI of the metadata for the IP.
|
81
|
+
* @param request.ipMetadata.ipMetadataHash [Optional] The hash of the metadata for the IP.
|
82
|
+
* @param request.ipMetadata.nftMetadataURI [Optional] The URI of the metadata for the NFT.
|
83
|
+
* @param request.ipMetadata.nftMetadataHash [Optional] The hash of the metadata for the IP NFT.
|
84
|
+
* @param request.deadline [Optional] The deadline for the signature in milliseconds, default is 1000ms.
|
85
|
+
* @param request.txOptions - [Optional] transaction. This extends `WaitForTransactionReceiptParameters` from the Viem library, excluding the `hash` property.
|
20
86
|
* @returns A Promise that resolves to an object containing the transaction hash and optional IP ID if waitForTxn is set to true.
|
21
87
|
* @emits IPRegistered (ipId, chainId, tokenContract, tokenId, resolverAddr, metadataProviderAddress, metadata)
|
22
88
|
*/
|
@@ -31,7 +97,7 @@ export declare class IPAssetClient {
|
|
31
97
|
* @param request.childIpId The derivative IP ID.
|
32
98
|
* @param request.parentIpIds The parent IP IDs.
|
33
99
|
* @param request.licenseTermsIds The IDs of the license terms that the parent IP supports.
|
34
|
-
* @param request.txOptions [Optional]
|
100
|
+
* @param request.txOptions - [Optional] transaction. This extends `WaitForTransactionReceiptParameters` from the Viem library, excluding the `hash` property.
|
35
101
|
* @returns A Promise that resolves to an object containing the transaction hash.
|
36
102
|
*/
|
37
103
|
registerDerivative(request: RegisterDerivativeRequest): Promise<RegisterDerivativeResponse>;
|
@@ -43,11 +109,92 @@ export declare class IPAssetClient {
|
|
43
109
|
* @param request - The request object that contains all data needed to register derivative license tokens.
|
44
110
|
* @param request.childIpId The derivative IP ID.
|
45
111
|
* @param request.licenseTokenIds The IDs of the license tokens.
|
46
|
-
* @param request.txOptions [Optional]
|
112
|
+
* @param request.txOptions - [Optional] transaction. This extends `WaitForTransactionReceiptParameters` from the Viem library, excluding the `hash` property.
|
47
113
|
* @returns A Promise that resolves to an object containing the transaction hash.
|
48
114
|
*/
|
49
115
|
registerDerivativeWithLicenseTokens(request: RegisterDerivativeWithLicenseTokensRequest): Promise<RegisterDerivativeWithLicenseTokensResponse>;
|
50
|
-
|
116
|
+
/**
|
117
|
+
* Mint an NFT from a collection and register it as an IP.
|
118
|
+
* @param request - The request object that contains all data needed to mint and register ip.
|
119
|
+
* @param request.nftContract The address of the NFT collection.
|
120
|
+
* @param request.pilType The type of the PIL.
|
121
|
+
* @param request.ipMetadata - [Optional] The desired metadata for the newly minted NFT and newly registered IP.
|
122
|
+
* @param request.ipMetadata.ipMetadataURI [Optional] The URI of the metadata for the IP.
|
123
|
+
* @param request.ipMetadata.ipMetadataHash [Optional] The hash of the metadata for the IP.
|
124
|
+
* @param request.ipMetadata.nftMetadataURI [Optional] The URI of the metadata for the NFT.
|
125
|
+
* @param request.ipMetadata.nftMetadataHash [Optional] The hash of the metadata for the IP NFT.
|
126
|
+
* @param request.recipient [Optional] The address of the recipient of the minted NFT.
|
127
|
+
* @param request.mintingFee [Optional] The fee to be paid when minting a license.
|
128
|
+
* @param request.commercialRevShare [Optional] Percentage of revenue that must be shared with the licensor.
|
129
|
+
* @param request.currency [Optional] The ERC20 token to be used to pay the minting fee. the token must be registered in story protocol.
|
130
|
+
* @param request.txOptions - [Optional] transaction. This extends `WaitForTransactionReceiptParameters` from the Viem library, excluding the `hash` property.
|
131
|
+
* @returns A Promise that resolves to an object containing the transaction hash and optional IP ID, Token ID, License Terms Id if waitForTxn is set to true.
|
132
|
+
* @emits IPRegistered (ipId, chainId, tokenContract, tokenId, name, uri, registrationDate)
|
133
|
+
* @emits LicenseTermsAttached (caller, ipId, licenseTemplate, licenseTermsId)
|
134
|
+
*/
|
135
|
+
mintAndRegisterIpAssetWithPilTerms(request: CreateIpAssetWithPilTermsRequest): Promise<CreateIpAssetWithPilTermsResponse>;
|
136
|
+
/**
|
137
|
+
* Register a given NFT as an IP and attach Programmable IP License Terms.R.
|
138
|
+
* @param request - The request object that contains all data needed to mint and register ip.
|
139
|
+
* @param request.nftContract The address of the NFT collection.
|
140
|
+
* @param request.tokenId The ID of the NFT.
|
141
|
+
* @param request.pilType The type of the PIL.
|
142
|
+
* @param request.ipMetadata - [Optional] The desired metadata for the newly minted NFT and newly registered IP.
|
143
|
+
* @param request.ipMetadata.ipMetadataURI [Optional] The URI of the metadata for the IP.
|
144
|
+
* @param request.ipMetadata.ipMetadataHash [Optional] The hash of the metadata for the IP.
|
145
|
+
* @param request.ipMetadata.nftMetadataURI [Optional] The URI of the metadata for the NFT.
|
146
|
+
* @param request.ipMetadata.nftMetadataHash [Optional] The hash of the metadata for the IP NFT.
|
147
|
+
* @param request.deadline [Optional] The deadline for the signature in milliseconds, default is 1000ms.
|
148
|
+
* @param request.mintingFee [Optional] The fee to be paid when minting a license.
|
149
|
+
* @param request.commercialRevShare [Optional] Percentage of revenue that must be shared with the licensor.
|
150
|
+
* @param request.currency [Optional] The ERC20 token to be used to pay the minting fee. the token must be registered in story protocol.
|
151
|
+
* @param request.txOptions - [Optional] transaction. This extends `WaitForTransactionReceiptParameters` from the Viem library, excluding the `hash` property.
|
152
|
+
* @returns A Promise that resolves to an object containing the transaction hash and optional IP ID, License Terms Id if waitForTxn is set to true.
|
153
|
+
* @emits LicenseTermsAttached (caller, ipId, licenseTemplate, licenseTermsId)
|
154
|
+
*/
|
155
|
+
registerIpAndAttachPilTerms(request: RegisterIpAndAttachPilTermsRequest): Promise<RegisterIpAndAttachPilTermsResponse>;
|
156
|
+
/**
|
157
|
+
* Register the given NFT as a derivative IP with metadata without using license tokens.
|
158
|
+
* @param request - The request object that contains all data needed to register derivative IP.
|
159
|
+
* @param request.nftContract The address of the NFT collection.
|
160
|
+
* @param request.tokenId The ID of the NFT.
|
161
|
+
* @param request.derivData The derivative data to be used for registerDerivative.
|
162
|
+
* @param request.derivData.parentIpIds The IDs of the parent IPs to link the registered derivative IP.
|
163
|
+
* @param request.derivData.licenseTemplate [Optional] The address of the license template to be used for the linking.
|
164
|
+
* @param request.derivData.licenseTermsIds The IDs of the license terms to be used for the linking.
|
165
|
+
* @param request.ipMetadata - [Optional] The desired metadata for the newly minted NFT and newly registered IP.
|
166
|
+
* @param request.ipMetadata.ipMetadataURI [Optional] The URI of the metadata for the IP.
|
167
|
+
* @param request.ipMetadata.ipMetadataHash [Optional] The hash of the metadata for the IP.
|
168
|
+
* @param request.ipMetadata.nftMetadataURI [Optional] The URI of the metadata for the NFT.
|
169
|
+
* @param request.ipMetadata.nftMetadataHash [Optional] The hash of the metadata for the IP NFT.
|
170
|
+
* @param request.deadline [Optional] The deadline for the signature in milliseconds,default is 1000ms.
|
171
|
+
* @param request.txOptions - [Optional] transaction. This extends `WaitForTransactionReceiptParameters` from the Viem library, excluding the `hash` property.
|
172
|
+
* @returns A Promise that resolves to an object containing the transaction hash and optional IP ID if waitForTxn is set to true.
|
173
|
+
* @emits IPRegistered (ipId, chainId, tokenContract, tokenId, name, uri, registrationDate)
|
174
|
+
*/
|
175
|
+
registerDerivativeIp(request: RegisterIpAndMakeDerivativeRequest): Promise<RegisterIpAndMakeDerivativeResponse>;
|
176
|
+
/**
|
177
|
+
* Mint an NFT from a collection and register it as a derivative IP without license tokens.
|
178
|
+
* @param request - The request object that contains all data needed to mint and register ip and make derivative.
|
179
|
+
* @param request.nftContract The address of the NFT collection.
|
180
|
+
* @param request.derivData The derivative data to be used for registerDerivative.
|
181
|
+
* @param request.derivData.parentIpIds The IDs of the parent IPs to link the registered derivative IP.
|
182
|
+
* @param request.derivData.licenseTermsIds The IDs of the license terms to be used for the linking.
|
183
|
+
* @param request.derivData.licenseTemplate [Optional] The address of the license template to be used for the linking.
|
184
|
+
* @param request.ipMetadata - [Optional] The desired metadata for the newly minted NFT and newly registered IP.
|
185
|
+
* @param request.ipMetadata.ipMetadataURI [Optional] The URI of the metadata for the IP.
|
186
|
+
* @param request.ipMetadata.ipMetadataHash [Optional] The hash of the metadata for the IP.
|
187
|
+
* @param request.ipMetadata.nftMetadataURI [Optional] The URI of the metadata for the NFT.
|
188
|
+
* @param request.ipMetadata.nftMetadataHash [Optional] The hash of the metadata for the IP NFT.*
|
189
|
+
* @param request.recipient [Optional] The address of the recipient of the minted NFT.
|
190
|
+
* @param request.txOptions - [Optional] transaction. This extends `WaitForTransactionReceiptParameters` from the Viem library, excluding the `hash` property.
|
191
|
+
* @returns A Promise that resolves to an object containing the transaction hash and optional IP ID if waitForTxn is set to true.
|
192
|
+
* @emits IPRegistered (ipId, chainId, tokenContract, tokenId, name, uri, registrationDate)
|
193
|
+
*/
|
194
|
+
mintAndRegisterIpAndMakeDerivative(request: MintAndRegisterIpAndMakeDerivativeRequest): Promise<RegisterDerivativeResponse>;
|
195
|
+
private getIpIdAddress;
|
51
196
|
private isRegistered;
|
197
|
+
private getSigSignatureState;
|
198
|
+
private getLicenseTermsId;
|
52
199
|
}
|
53
200
|
//# sourceMappingURL=ipAsset.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ipAsset.d.ts","sourceRoot":"../../../../src/resources","sources":["ipAsset.ts"],"names":[],"mappings":"AAAA,OAAO,
|
1
|
+
{"version":3,"file":"ipAsset.d.ts","sourceRoot":"../../../../src/resources","sources":["ipAsset.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,YAAY,EAWb,MAAM,MAAM,CAAC;AAGd,OAAO,EAAE,iBAAiB,EAAE,2BAAwB;AAEpD,OAAO,EACL,gCAAgC,EAChC,iCAAiC,EACjC,4BAA4B,EAC5B,uBAAuB,EACvB,SAAS,EACT,UAAU,EACV,yCAAyC,EACzC,yBAAyB,EACzB,0BAA0B,EAC1B,0CAA0C,EAC1C,2CAA2C,EAC3C,kCAAkC,EAClC,mCAAmC,EACnC,kCAAkC,EAClC,mCAAmC,EACnC,kBAAkB,EAClB,eAAe,EAChB,sCAAmC;AACpC,OAAO,EACL,sBAAsB,EACtB,wBAAwB,EACxB,qBAAqB,EACrB,6BAA6B,EAC7B,0BAA0B,EAC1B,qBAAqB,EACrB,uBAAuB,EACvB,sBAAsB,EACtB,kBAAkB,EAClB,SAAS,EAQV,4BAAyB;AAK1B,qBAAa,aAAa;IACjB,qBAAqB,EAAE,qBAAqB,CAAC;IAC7C,qBAAqB,EAAE,qBAAqB,CAAC;IAC7C,qBAAqB,EAAE,uBAAuB,CAAC;IAC/C,6BAA6B,EAAE,6BAA6B,CAAC;IAC7D,0BAA0B,EAAE,0BAA0B,CAAC;IACvD,sBAAsB,EAAE,sBAAsB,CAAC;IAC/C,sBAAsB,EAAE,sBAAsB,CAAC;IAC/C,wBAAwB,EAAE,wBAAwB,CAAC;IACnD,SAAS,EAAE,SAAS,CAAC;IAC5B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAe;IACzC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAqB;IAC5C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAoB;gBAEhC,SAAS,EAAE,YAAY,EAAE,MAAM,EAAE,kBAAkB,EAAE,OAAO,EAAE,iBAAiB;IAe3F;;;;;;;;;;;;;OAaG;IACI,uBAAuB,CAAC,KAAK,EAAE,4BAA4B,GAAG,SAAS;IAqB9E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAsCG;IACI,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,GAAG,UAAU;IAiCrE;;;;;;;;;;;;;;OAcG;IACU,QAAQ,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAoF5E;;;;;;;;;;;;OAYG;IACU,kBAAkB,CAC7B,OAAO,EAAE,yBAAyB,GACjC,OAAO,CAAC,0BAA0B,CAAC;IA4DtC;;;;;;;;;;OAUG;IACU,mCAAmC,CAC9C,OAAO,EAAE,0CAA0C,GAClD,OAAO,CAAC,2CAA2C,CAAC;IAyCvD;;;;;;;;;;;;;;;;;;OAkBG;IACU,kCAAkC,CAC7C,OAAO,EAAE,gCAAgC,GACxC,OAAO,CAAC,iCAAiC,CAAC;IAiD7C;;;;;;;;;;;;;;;;;;OAkBG;IACU,2BAA2B,CACtC,OAAO,EAAE,kCAAkC,GAC1C,OAAO,CAAC,mCAAmC,CAAC;IAsG/C;;;;;;;;;;;;;;;;;;OAkBG;IACU,oBAAoB,CAC/B,OAAO,EAAE,kCAAkC,GAC1C,OAAO,CAAC,mCAAmC,CAAC;IA6H/C;;;;;;;;;;;;;;;;;OAiBG;IACU,kCAAkC,CAC7C,OAAO,EAAE,yCAAyC,GACjD,OAAO,CAAC,0BAA0B,CAAC;YA4DxB,cAAc;YAYd,YAAY;IAI1B,OAAO,CAAC,oBAAoB;YA+Bd,iBAAiB;CAYhC"}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { PublicClient } from "viem";
|
2
|
-
import { IpAssetRegistryClient, LicenseRegistryEventClient, LicenseRegistryReadOnlyClient, LicensingModuleClient, PiLicenseTemplateClient, PiLicenseTemplateReadOnlyClient, RoyaltyPolicyLapClient, SimpleWalletClient } from "../abi/generated.js";
|
3
|
-
import { RegisterNonComSocialRemixingPILRequest, RegisterPILResponse, RegisterCommercialUsePILRequest, RegisterCommercialRemixPILRequest, AttachLicenseTermsRequest, MintLicenseTokensRequest, MintLicenseTokensResponse } from "../types/resources/license.js";
|
2
|
+
import { IpAssetRegistryClient, LicenseRegistryEventClient, LicenseRegistryReadOnlyClient, LicensingModuleClient, PiLicenseTemplateClient, PiLicenseTemplateGetLicenseTermsResponse, PiLicenseTemplateReadOnlyClient, RoyaltyModuleReadOnlyClient, RoyaltyPolicyLapClient, SimpleWalletClient } from "../abi/generated.js";
|
3
|
+
import { RegisterNonComSocialRemixingPILRequest, RegisterPILResponse, RegisterCommercialUsePILRequest, RegisterCommercialRemixPILRequest, AttachLicenseTermsRequest, MintLicenseTokensRequest, MintLicenseTokensResponse, AttachLicenseTermsResponse, LicenseTermsId, RegisterPILTermsRequest } from "../types/resources/license.js";
|
4
4
|
export declare class LicenseClient {
|
5
5
|
licenseRegistryClient: LicenseRegistryEventClient;
|
6
6
|
licensingModuleClient: LicensingModuleClient;
|
@@ -8,53 +8,75 @@ export declare class LicenseClient {
|
|
8
8
|
piLicenseTemplateReadOnlyClient: PiLicenseTemplateReadOnlyClient;
|
9
9
|
licenseTemplateClient: PiLicenseTemplateClient;
|
10
10
|
royaltyPolicyLAPClient: RoyaltyPolicyLapClient;
|
11
|
+
royaltyModuleReadOnlyClient: RoyaltyModuleReadOnlyClient;
|
11
12
|
licenseRegistryReadOnlyClient: LicenseRegistryReadOnlyClient;
|
12
13
|
private readonly rpcClient;
|
13
14
|
private readonly wallet;
|
14
15
|
constructor(rpcClient: PublicClient, wallet: SimpleWalletClient);
|
16
|
+
/**
|
17
|
+
* Registers new license terms and return the ID of the newly registered license terms.
|
18
|
+
* @param request - The request object that contains all data needed to register a license term.
|
19
|
+
* @param request.transferable Indicates whether the license is transferable or not.
|
20
|
+
* @param request.royaltyPolicy The address of the royalty policy contract which required to StoryProtocol in advance.
|
21
|
+
* @param request.mintingFee The fee to be paid when minting a license.
|
22
|
+
* @param request.expiration The expiration period of the license.
|
23
|
+
* @param request.commercialUse Indicates whether the work can be used commercially or not.
|
24
|
+
* @param request.commercialAttribution Whether attribution is required when reproducing the work commercially or not.
|
25
|
+
* @param request.commercializerChecker Commercializers that are allowed to commercially exploit the work. If zero address, then no restrictions is enforced.
|
26
|
+
* @param request.commercializerCheckerData The data to be passed to the commercializer checker contract.
|
27
|
+
* @param request.commercialRevShare Percentage of revenue that must be shared with the licensor.
|
28
|
+
* @param request.commercialRevCeiling The maximum revenue that can be generated from the commercial use of the work.
|
29
|
+
* @param request.derivativesAllowed Indicates whether the licensee can create derivatives of his work or not.
|
30
|
+
* @param request.derivativesAttribution Indicates whether attribution is required for derivatives of the work or not.
|
31
|
+
* @param request.derivativesApproval Indicates whether the licensor must approve derivatives of the work before they can be linked to the licensor IP ID or not.
|
32
|
+
* @param request.derivativesReciprocal Indicates whether the licensee must license derivatives of the work under the same terms or not.
|
33
|
+
* @param request.derivativeRevCeiling The maximum revenue that can be generated from the derivative use of the work.
|
34
|
+
* @param request.currency The ERC20 token to be used to pay the minting fee. the token must be registered in story protocol.
|
35
|
+
* @param request.uri The URI of the license terms, which can be used to fetch the offchain license terms.
|
36
|
+
* @param request.txOptions - [Optional] transaction. This extends `WaitForTransactionReceiptParameters` from the Viem library, excluding the `hash` property.
|
37
|
+
* @returns A Promise that resolves to an object containing the optional transaction hash, optional transaction encodedTxData and optional license terms Id.
|
38
|
+
* @emits LicenseTermsRegistered (licenseTermsId, licenseTemplate, licenseTerms);
|
39
|
+
*/
|
40
|
+
registerPILTerms(request: RegisterPILTermsRequest): Promise<RegisterPILResponse>;
|
15
41
|
/**
|
16
42
|
* Convenient function to register a PIL non commercial social remix license to the registry
|
17
|
-
* @param request [Optional] The request object that contains all data needed to register a PIL non commercial social remix license.
|
18
|
-
* @param request.txOptions [Optional]
|
43
|
+
* @param request - [Optional] The request object that contains all data needed to register a PIL non commercial social remix license.
|
44
|
+
* @param request.txOptions - [Optional] transaction. This extends `WaitForTransactionReceiptParameters` from the Viem library, excluding the `hash` property.
|
19
45
|
* @returns A Promise that resolves to an object containing the optional transaction hash and optional license terms Id.
|
20
46
|
* @emits LicenseTermsRegistered (licenseTermsId, licenseTemplate, licenseTerms);
|
21
47
|
*/
|
22
48
|
registerNonComSocialRemixingPIL(request?: RegisterNonComSocialRemixingPILRequest): Promise<RegisterPILResponse>;
|
23
49
|
/**
|
24
50
|
* Convenient function to register a PIL commercial use license to the registry.
|
25
|
-
* @param request The request object that contains all data needed to register a PIL commercial use license.
|
26
|
-
* @param request.
|
51
|
+
* @param request - The request object that contains all data needed to register a PIL commercial use license.
|
52
|
+
* @param request.defaultMintingFee The fee to be paid when minting a license.
|
27
53
|
* @param request.currency The ERC20 token to be used to pay the minting fee and the token must be registered in story protocol.
|
28
|
-
* @param request.
|
29
|
-
* @param request.txOptions [Optional] The transaction options.
|
54
|
+
* @param request.txOptions - [Optional] transaction. This extends `WaitForTransactionReceiptParameters` from the Viem library, excluding the `hash` property.
|
30
55
|
* @returns A Promise that resolves to an object containing the optional transaction hash and optional license terms Id.
|
31
56
|
* @emits LicenseTermsRegistered (licenseTermsId, licenseTemplate, licenseTerms);
|
32
57
|
*/
|
33
58
|
registerCommercialUsePIL(request: RegisterCommercialUsePILRequest): Promise<RegisterPILResponse>;
|
34
59
|
/**
|
35
60
|
* Convenient function to register a PIL commercial Remix license to the registry.
|
36
|
-
* @param request The request object that contains all data needed to register license.
|
37
|
-
* @param request.
|
61
|
+
* @param request - The request object that contains all data needed to register license.
|
62
|
+
* @param request.defaultMintingFee The fee to be paid when minting a license.
|
38
63
|
* @param request.commercialRevShare Percentage of revenue that must be shared with the licensor.
|
39
64
|
* @param request.currency The ERC20 token to be used to pay the minting fee. the token must be registered in story protocol.
|
40
|
-
* @param request.
|
41
|
-
* @param request.txOptions [Optional] The transaction options.
|
65
|
+
* @param request.txOptions - [Optional] transaction. This extends `WaitForTransactionReceiptParameters` from the Viem library, excluding the `hash` property.
|
42
66
|
* @returns A Promise that resolves to an object containing the optional transaction hash and optional license terms Id.
|
43
67
|
* @emits LicenseTermsRegistered (licenseTermsId, licenseTemplate, licenseTerms);
|
44
68
|
*/
|
45
69
|
registerCommercialRemixPIL(request: RegisterCommercialRemixPILRequest): Promise<RegisterPILResponse>;
|
46
70
|
/**
|
47
71
|
* Attaches license terms to an IP.
|
48
|
-
* @param request The request object that contains all data needed to attach license terms.
|
72
|
+
* @param request - The request object that contains all data needed to attach license terms.
|
49
73
|
* @param request.ipId The address of the IP to which the license terms are attached.
|
50
74
|
* @param request.licenseTemplate The address of the license template.
|
51
75
|
* @param request.licenseTermsId The ID of the license terms.
|
52
|
-
* @param request.txOptions [Optional]
|
76
|
+
* @param request.txOptions - [Optional] transaction. This extends `WaitForTransactionReceiptParameters` from the Viem library, excluding the `hash` property.
|
53
77
|
* @returns A Promise that resolves to an object containing the transaction hash.
|
54
78
|
*/
|
55
|
-
attachLicenseTerms(request: AttachLicenseTermsRequest): Promise<
|
56
|
-
txHash: `0x${string}`;
|
57
|
-
}>;
|
79
|
+
attachLicenseTerms(request: AttachLicenseTermsRequest): Promise<AttachLicenseTermsResponse>;
|
58
80
|
/**
|
59
81
|
* Mints license tokens for the license terms attached to an IP.
|
60
82
|
* The license tokens are minted to the receiver.
|
@@ -67,17 +89,25 @@ export declare class LicenseClient {
|
|
67
89
|
* The minting fee is paid in the minting fee token specified in the license terms or configured by the IP owner.
|
68
90
|
* IP owners can configure the minting fee of their IPs or
|
69
91
|
* configure the minting fee module to determine the minting fee.
|
70
|
-
* @param request The request object that contains all data needed to mint license tokens.
|
92
|
+
* @param request - The request object that contains all data needed to mint license tokens.
|
71
93
|
* @param request.licensorIpId The licensor IP ID.
|
72
94
|
* @param request.licenseTemplate The address of the license template.
|
73
95
|
* @param request.licenseTermsId The ID of the license terms within the license template.
|
74
96
|
* @param request.amount The amount of license tokens to mint.
|
75
97
|
* @param request.receiver The address of the receiver.
|
76
|
-
* @param request.txOptions [Optional]
|
77
|
-
* @returns A Promise that resolves to an object containing the transaction hash and optional license token
|
98
|
+
* @param request.txOptions - [Optional] transaction. This extends `WaitForTransactionReceiptParameters` from the Viem library, excluding the `hash` property.
|
99
|
+
* @returns A Promise that resolves to an object containing the transaction hash and optional license token IDs if waitForTxn is set to true.
|
78
100
|
* @emits LicenseTokensMinted (msg.sender, licensorIpId, licenseTemplate, licenseTermsId, amount, receiver, startLicenseTokenId);
|
79
101
|
*/
|
80
102
|
mintLicenseTokens(request: MintLicenseTokensRequest): Promise<MintLicenseTokensResponse>;
|
103
|
+
/**
|
104
|
+
* Gets license terms of the given ID.
|
105
|
+
* @param selectedLicenseTermsId The ID of the license terms.
|
106
|
+
* @returns A Promise that resolves to an object containing the PILTerms associate with the given ID.
|
107
|
+
*/
|
108
|
+
getLicenseTerms(selectedLicenseTermsId: LicenseTermsId): Promise<PiLicenseTemplateGetLicenseTermsResponse>;
|
81
109
|
private getLicenseTermsId;
|
110
|
+
private verifyCommercialUse;
|
111
|
+
private verifyDerivatives;
|
82
112
|
}
|
83
113
|
//# sourceMappingURL=license.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"license.d.ts","sourceRoot":"../../../../src/resources","sources":["license.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAe,MAAM,MAAM,CAAC;AAEjD,OAAO,EACL,qBAAqB,EACrB,0BAA0B,EAC1B,6BAA6B,EAC7B,qBAAqB,EACrB,uBAAuB,EACvB,+BAA+B,EAC/B,sBAAsB,EACtB,kBAAkB,EACnB,4BAAyB;AAC1B,OAAO,EAEL,sCAAsC,EACtC,mBAAmB,EACnB,+BAA+B,EAC/B,iCAAiC,EACjC,yBAAyB,EAEzB,wBAAwB,EACxB,yBAAyB,EAC1B,sCAAmC;
|
1
|
+
{"version":3,"file":"license.d.ts","sourceRoot":"../../../../src/resources","sources":["license.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAe,MAAM,MAAM,CAAC;AAEjD,OAAO,EACL,qBAAqB,EACrB,0BAA0B,EAC1B,6BAA6B,EAC7B,qBAAqB,EACrB,uBAAuB,EACvB,wCAAwC,EACxC,+BAA+B,EAC/B,2BAA2B,EAC3B,sBAAsB,EACtB,kBAAkB,EACnB,4BAAyB;AAC1B,OAAO,EAEL,sCAAsC,EACtC,mBAAmB,EACnB,+BAA+B,EAC/B,iCAAiC,EACjC,yBAAyB,EAEzB,wBAAwB,EACxB,yBAAyB,EAEzB,0BAA0B,EAC1B,cAAc,EACd,uBAAuB,EACxB,sCAAmC;AAKpC,qBAAa,aAAa;IACjB,qBAAqB,EAAE,0BAA0B,CAAC;IAClD,qBAAqB,EAAE,qBAAqB,CAAC;IAC7C,qBAAqB,EAAE,qBAAqB,CAAC;IAC7C,+BAA+B,EAAE,+BAA+B,CAAC;IACjE,qBAAqB,EAAE,uBAAuB,CAAC;IAC/C,sBAAsB,EAAE,sBAAsB,CAAC;IAC/C,2BAA2B,EAAE,2BAA2B,CAAC;IACzD,6BAA6B,EAAE,6BAA6B,CAAC;IACpE,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAe;IACzC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAqB;gBAEhC,SAAS,EAAE,YAAY,EAAE,MAAM,EAAE,kBAAkB;IAY/D;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACU,gBAAgB,CAAC,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAkE7F;;;;;;OAMG;IACU,+BAA+B,CAC1C,OAAO,CAAC,EAAE,sCAAsC,GAC/C,OAAO,CAAC,mBAAmB,CAAC;IAiC/B;;;;;;;;OAQG;IACU,wBAAwB,CACnC,OAAO,EAAE,+BAA+B,GACvC,OAAO,CAAC,mBAAmB,CAAC;IAqC/B;;;;;;;;;OASG;IACU,0BAA0B,CACrC,OAAO,EAAE,iCAAiC,GACzC,OAAO,CAAC,mBAAmB,CAAC;IAuC/B;;;;;;;;OAQG;IACU,kBAAkB,CAC7B,OAAO,EAAE,yBAAyB,GACjC,OAAO,CAAC,0BAA0B,CAAC;IAmDtC;;;;;;;;;;;;;;;;;;;;;OAqBG;IACU,iBAAiB,CAC5B,OAAO,EAAE,wBAAwB,GAChC,OAAO,CAAC,yBAAyB,CAAC;IAiErC;;;;OAIG;IACU,eAAe,CAC1B,sBAAsB,EAAE,cAAc,GACrC,OAAO,CAAC,wCAAwC,CAAC;YAUtC,iBAAiB;IAI/B,OAAO,CAAC,mBAAmB;IA6B3B,OAAO,CAAC,iBAAiB;CAgB1B"}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import { PublicClient } from "viem";
|
2
|
+
import { SimpleWalletClient, SpgClient } from "../abi/generated.js";
|
3
|
+
import { CreateNFTCollectionRequest, CreateNFTCollectionResponse } from "../types/resources/nftClient.js";
|
4
|
+
export declare class NftClient {
|
5
|
+
spgClient: SpgClient;
|
6
|
+
private readonly rpcClient;
|
7
|
+
private readonly wallet;
|
8
|
+
constructor(rpcClient: PublicClient, wallet: SimpleWalletClient);
|
9
|
+
/**
|
10
|
+
* Creates a new SPG NFT Collection.
|
11
|
+
* @param request - The request object containing necessary data to create a SPG NFT Collection.
|
12
|
+
* @param request.name - The name of the collection.
|
13
|
+
* @param request.symbol - The symbol of the collection.
|
14
|
+
* @param request.maxSupply - The maximum supply of the collection.
|
15
|
+
* @param request.mintFee - The cost to mint a token.
|
16
|
+
* @param request.mintFeeToken - The token to mint.
|
17
|
+
* @param request.owner - The owner of the collection.
|
18
|
+
* @param request.txOptions - [Optional] transaction. This extends `WaitForTransactionReceiptParameters` from the Viem library, excluding the `hash` property.
|
19
|
+
* @returns A Promise that resolves to a CreateNFTCollectionResponse containing the transaction hash and collection address.
|
20
|
+
* @emits CollectionCreated (nftContract);
|
21
|
+
*/
|
22
|
+
createNFTCollection(request: CreateNFTCollectionRequest): Promise<CreateNFTCollectionResponse>;
|
23
|
+
}
|
24
|
+
//# sourceMappingURL=nftClient.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"nftClient.d.ts","sourceRoot":"../../../../src/resources","sources":["nftClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAqC,MAAM,MAAM,CAAC;AAEvE,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,4BAAyB;AACjE,OAAO,EACL,0BAA0B,EAC1B,2BAA2B,EAC5B,wCAAqC;AAItC,qBAAa,SAAS;IACb,SAAS,EAAE,SAAS,CAAC;IAC5B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAe;IACzC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAqB;gBAEhC,SAAS,EAAE,YAAY,EAAE,MAAM,EAAE,kBAAkB;IAM/D;;;;;;;;;;;;OAYG;IACU,mBAAmB,CAC9B,OAAO,EAAE,0BAA0B,GAClC,OAAO,CAAC,2BAA2B,CAAC;CAyCxC"}
|
@@ -1,11 +1,16 @@
|
|
1
1
|
import { PublicClient } from "viem";
|
2
|
-
import { SetPermissionsRequest, SetPermissionsResponse } from "../types/resources/permission.js";
|
3
|
-
import { SimpleWalletClient } from "../abi/generated.js";
|
2
|
+
import { CreateBatchPermissionSignatureRequest, CreateSetPermissionSignatureRequest, SetAllPermissionsRequest, SetBatchPermissionsRequest, SetPermissionsRequest, SetPermissionsResponse } from "../types/resources/permission.js";
|
3
|
+
import { AccessControllerClient, CoreMetadataModuleClient, IpAssetRegistryClient, SimpleWalletClient, SpgClient } from "../abi/generated.js";
|
4
|
+
import { SupportedChainIds } from "../types/config.js";
|
4
5
|
export declare class PermissionClient {
|
6
|
+
accessControllerClient: AccessControllerClient;
|
7
|
+
ipAssetRegistryClient: IpAssetRegistryClient;
|
8
|
+
spgClient: SpgClient;
|
9
|
+
coreMetadataModuleClient: CoreMetadataModuleClient;
|
5
10
|
private readonly wallet;
|
6
11
|
private readonly rpcClient;
|
7
|
-
private
|
8
|
-
constructor(rpcClient: PublicClient, wallet: SimpleWalletClient);
|
12
|
+
private readonly chainId;
|
13
|
+
constructor(rpcClient: PublicClient, wallet: SimpleWalletClient, chainId: SupportedChainIds);
|
9
14
|
/**
|
10
15
|
* Sets the permission for a specific function call
|
11
16
|
* Each policy is represented as a mapping from an IP account address to a signer address to a recipient
|
@@ -16,15 +21,72 @@ export declare class PermissionClient {
|
|
16
21
|
* address(0) => wildcard
|
17
22
|
* bytes4(0) => wildcard
|
18
23
|
* Specific permission overrides wildcard permission.
|
19
|
-
* @param request The request object containing necessary data to set
|
20
|
-
* @param request.
|
24
|
+
* @param request - The request object containing necessary data to set `permission`.
|
25
|
+
* @param request.ipId The IP ID that grants the permission for `signer`.
|
26
|
+
* @param request.signer The address that can call `to` on behalf of the `ipAccount`.
|
27
|
+
* @param request.to The address that can be called by the `signer` (currently only modules can be `to`).
|
28
|
+
* @param request.permission The new permission level.
|
29
|
+
* @param request.func [Optional] The function selector string of `to` that can be called by the `signer` on behalf of the `ipAccount`. Be default, it allows all functions.
|
30
|
+
* @param request.txOptions - [Optional] transaction. This extends `WaitForTransactionReceiptParameters` from the Viem library, excluding the `hash` property.
|
31
|
+
* @returns A Promise that resolves to an object containing the transaction hash.
|
32
|
+
* @emits PermissionSet (ipAccountOwner, ipAccount, signer, to, func, permission)
|
33
|
+
*/
|
34
|
+
setPermission(request: SetPermissionsRequest): Promise<SetPermissionsResponse>;
|
35
|
+
/**
|
36
|
+
* Specific permission overrides wildcard permission with signature.
|
37
|
+
* @param request - The request object containing necessary data to set permissions.
|
38
|
+
* @param request.ipId The IP ID that grants the permission for `signer`
|
21
39
|
* @param request.signer The address that can call `to` on behalf of the `ipAccount`
|
22
40
|
* @param request.to The address that can be called by the `signer` (currently only modules can be `to`)
|
23
|
-
* @param request.
|
24
|
-
* @param request.
|
41
|
+
* @param request.permission The new permission level.
|
42
|
+
* @param request.func [Optional] The function selector string of `to` that can be called by the `signer` on behalf of the `ipAccount`. Be default, it allows all functions.
|
43
|
+
* @param request.deadline [Optional] The deadline for the signature in milliseconds, default is 1000ms.
|
44
|
+
* @param request.txOptions - [Optional] transaction. This extends `WaitForTransactionReceiptParameters` from the Viem library, excluding the `hash` property.
|
45
|
+
* @returns A Promise that resolves to an object containing the transaction hash.
|
46
|
+
* @emits PermissionSet (ipAccountOwner, ipAccount, signer, to, func, permission)
|
47
|
+
*/
|
48
|
+
createSetPermissionSignature(request: CreateSetPermissionSignatureRequest): Promise<SetPermissionsResponse>;
|
49
|
+
/**
|
50
|
+
* Sets permission to a signer for all functions across all modules.
|
51
|
+
* @param request - The request object containing necessary data to set all permissions.
|
52
|
+
* @param request.ipId The IP ID that grants the permission for `signer`
|
53
|
+
* @param request.signer The address of the signer receiving the permissions.
|
54
|
+
* @param request.permission The new permission.
|
55
|
+
* @param request.txOptions - [Optional] transaction. This extends `WaitForTransactionReceiptParameters` from the Viem library, excluding the `hash` property.
|
25
56
|
* @returns A Promise that resolves to an object containing the transaction hash
|
26
57
|
* @emits PermissionSet (ipAccountOwner, ipAccount, signer, to, func, permission)
|
27
58
|
*/
|
28
|
-
|
59
|
+
setAllPermissions(request: SetAllPermissionsRequest): Promise<SetPermissionsResponse>;
|
60
|
+
/**
|
61
|
+
* Sets a batch of permissions in a single transaction.
|
62
|
+
* @param request - The request object containing necessary data to set all permissions.
|
63
|
+
* @param {Array} request.permissions - An array of `Permission` structure, each representing the permission to be set.
|
64
|
+
* @param request.permissions[].ipId The IP ID that grants the permission for `signer`.
|
65
|
+
* @param request.permissions[].signer The address that can call `to` on behalf of the `ipAccount`.
|
66
|
+
* @param request.permissions[].to The address that can be called by the `signer` (currently only modules can be `to`).
|
67
|
+
* @param request.permissions[].permission The new permission level.
|
68
|
+
* @param request.permissions[].func [Optional] The function selector string of `to` that can be called by the `signer` on behalf of the `ipAccount`. Be default, it allows all functions.
|
69
|
+
* @param request.deadline [Optional] The deadline for the signature in milliseconds, default is 1000ms.
|
70
|
+
* @param request.txOptions - [Optional] transaction. This extends `WaitForTransactionReceiptParameters` from the Viem library, excluding the `hash` property.
|
71
|
+
* @returns A Promise that resolves to an object containing the transaction hash
|
72
|
+
* @emits PermissionSet (ipAccountOwner, ipAccount, signer, to, func, permission)
|
73
|
+
*/
|
74
|
+
setBatchPermissions(request: SetBatchPermissionsRequest): Promise<SetPermissionsResponse>;
|
75
|
+
/**
|
76
|
+
* Sets a batch of permissions in a single transaction with signature.
|
77
|
+
* @param request - The request object containing necessary data to set permissions.
|
78
|
+
* @param request.ipId The IP ID that grants the permission for `signer`
|
79
|
+
* @param {Array} request.permissions - An array of `Permission` structure, each representing the permission to be set.
|
80
|
+
* @param request.permissions[].ipId The IP ID that grants the permission for `signer`.
|
81
|
+
* @param request.permissions[].signer The address that can call `to` on behalf of the `ipAccount`.
|
82
|
+
* @param request.permissions[].to The address that can be called by the `signer` (currently only modules can be `to`).
|
83
|
+
* @param request.permissions[].permission The new permission level.
|
84
|
+
* @param request.permissions[].func [Optional] The function selector string of `to` that can be called by the `signer` on behalf of the `ipAccount`. Be default, it allows all functions.
|
85
|
+
* @param request.txOptions - [Optional] transaction. This extends `WaitForTransactionReceiptParameters` from the Viem library, excluding the `hash` property.
|
86
|
+
* @returns A Promise that resolves to an object containing the transaction hash.
|
87
|
+
* @emits PermissionSet (ipAccountOwner, ipAccount, signer, to, func, permission)
|
88
|
+
*/
|
89
|
+
createBatchPermissionSignature(request: CreateBatchPermissionSignatureRequest): Promise<SetPermissionsResponse>;
|
90
|
+
private checkIsRegistered;
|
29
91
|
}
|
30
92
|
//# sourceMappingURL=permission.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"permission.d.ts","sourceRoot":"../../../../src/resources","sources":["permission.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,
|
1
|
+
{"version":3,"file":"permission.d.ts","sourceRoot":"../../../../src/resources","sources":["permission.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAiE,MAAM,MAAM,CAAC;AAGnG,OAAO,EACL,qCAAqC,EACrC,mCAAmC,EACnC,wBAAwB,EACxB,0BAA0B,EAC1B,qBAAqB,EACrB,sBAAsB,EACvB,yCAAsC;AACvC,OAAO,EAEL,sBAAsB,EACtB,wBAAwB,EAExB,qBAAqB,EACrB,kBAAkB,EAClB,SAAS,EACV,4BAAyB;AAE1B,OAAO,EAAE,iBAAiB,EAAE,2BAAwB;AAIpD,qBAAa,gBAAgB;IACpB,sBAAsB,EAAE,sBAAsB,CAAC;IAC/C,qBAAqB,EAAE,qBAAqB,CAAC;IAC7C,SAAS,EAAE,SAAS,CAAC;IACrB,wBAAwB,EAAE,wBAAwB,CAAC;IAC1D,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAqB;IAC5C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAe;IACzC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAoB;gBAEhC,SAAS,EAAE,YAAY,EAAE,MAAM,EAAE,kBAAkB,EAAE,OAAO,EAAE,iBAAiB;IAU3F;;;;;;;;;;;;;;;;;;;OAmBG;IACU,aAAa,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,sBAAsB,CAAC;IA8B3F;;;;;;;;;;;;OAYG;IACU,4BAA4B,CACvC,OAAO,EAAE,mCAAmC,GAC3C,OAAO,CAAC,sBAAsB,CAAC;IA6DlC;;;;;;;;;OASG;IACU,iBAAiB,CAC5B,OAAO,EAAE,wBAAwB,GAChC,OAAO,CAAC,sBAAsB,CAAC;IA0BlC;;;;;;;;;;;;;OAaG;IACU,mBAAmB,CAC9B,OAAO,EAAE,0BAA0B,GAClC,OAAO,CAAC,sBAAsB,CAAC;IAiClC;;;;;;;;;;;;;OAaG;IACU,8BAA8B,CACzC,OAAO,EAAE,qCAAqC,GAC7C,OAAO,CAAC,sBAAsB,CAAC;YA0DpB,iBAAiB;CAQhC"}
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { PublicClient } from "viem";
|
2
|
-
import { ClaimableRevenueRequest, ClaimableRevenueResponse, CollectRoyaltyTokensRequest, CollectRoyaltyTokensResponse, PayRoyaltyOnBehalfRequest, PayRoyaltyOnBehalfResponse, SnapshotRequest, SnapshotResponse,
|
1
|
+
import { Address, Hex, PublicClient } from "viem";
|
2
|
+
import { ClaimableRevenueRequest, ClaimableRevenueResponse, CollectRoyaltyTokensRequest, CollectRoyaltyTokensResponse, PayRoyaltyOnBehalfRequest, PayRoyaltyOnBehalfResponse, SnapshotRequest, SnapshotResponse, ClaimRevenueRequest, ClaimRevenueResponse } from "../types/resources/royalty.js";
|
3
3
|
import { IpAssetRegistryClient, RoyaltyModuleClient, RoyaltyPolicyLapClient, SimpleWalletClient } from "../abi/generated.js";
|
4
4
|
import { IPAccountClient } from "./ipAccount.js";
|
5
5
|
export declare class RoyaltyClient {
|
@@ -12,10 +12,10 @@ export declare class RoyaltyClient {
|
|
12
12
|
constructor(rpcClient: PublicClient, wallet: SimpleWalletClient);
|
13
13
|
/**
|
14
14
|
* Allows ancestors to claim the royalty tokens and any accrued revenue tokens
|
15
|
-
* @param request -
|
15
|
+
* @param request - The request object that contains all data needed to collect royalty tokens.
|
16
16
|
* @param request.parentIpId The ip id of the ancestor to whom the royalty tokens belong to.
|
17
17
|
* @param request.royaltyVaultIpId The id of the royalty vault.
|
18
|
-
* @param request.txOptions [Optional]
|
18
|
+
* @param request.txOptions - [Optional] transaction. This extends `WaitForTransactionReceiptParameters` from the Viem library, excluding the `hash` property.
|
19
19
|
* @returns A Promise that resolves to an object containing the transaction hash and optional the amount of royalty tokens collected if waitForTxn is set to true.
|
20
20
|
* @emits RoyaltyTokensCollected (ancestorIpId, royaltyTokensCollected)
|
21
21
|
*/
|
@@ -27,7 +27,7 @@ export declare class RoyaltyClient {
|
|
27
27
|
* @param request.payerIpId The ID of the IP asset that pays the royalties.
|
28
28
|
* @param request.token The token to use to pay the royalties.
|
29
29
|
* @param request.amount The amount to pay.
|
30
|
-
* @param request.txOptions [Optional]
|
30
|
+
* @param request.txOptions - [Optional] transaction. This extends `WaitForTransactionReceiptParameters` from the Viem library, excluding the `hash` property.
|
31
31
|
* @returns A Promise that resolves to an object containing the transaction hash.
|
32
32
|
*/
|
33
33
|
payRoyaltyOnBehalf(request: PayRoyaltyOnBehalfRequest): Promise<PayRoyaltyOnBehalfResponse>;
|
@@ -38,7 +38,6 @@ export declare class RoyaltyClient {
|
|
38
38
|
* @param request.account The address of the token holder.
|
39
39
|
* @param request.snapshotId The snapshot id.
|
40
40
|
* @param request.token The revenue token to claim.
|
41
|
-
* @param request.txOptions [Optional] The transaction options.
|
42
41
|
* @returns A Promise that contains the amount of revenue token claimable
|
43
42
|
*/
|
44
43
|
claimableRevenue(request: ClaimableRevenueRequest): Promise<ClaimableRevenueResponse>;
|
@@ -48,20 +47,26 @@ export declare class RoyaltyClient {
|
|
48
47
|
* @param request.snapshotIds The list of snapshot ids.
|
49
48
|
* @param request.royaltyVaultIpId The id of the royalty vault.
|
50
49
|
* @param request.token The revenue token to claim.
|
51
|
-
* @param request.
|
50
|
+
* @param request.account [Optional] The ipId to send.
|
51
|
+
* @param request.txOptions - [Optional] transaction. This extends `WaitForTransactionReceiptParameters` from the Viem library, excluding the `hash` property.
|
52
52
|
* @returns A Promise that resolves to an object containing the transaction hash and optional claimableToken if waitForTxn is set to true.
|
53
53
|
* @emits RevenueTokenClaimed (claimer, token, amount).
|
54
54
|
*/
|
55
|
-
claimRevenue(request:
|
55
|
+
claimRevenue(request: ClaimRevenueRequest): Promise<ClaimRevenueResponse>;
|
56
56
|
/**
|
57
57
|
* Snapshots the claimable revenue and royalty token amounts.
|
58
58
|
* @param request - The request object that contains all data needed to snapshot.
|
59
59
|
* @param request.royaltyVaultIpId The id of the royalty vault.
|
60
|
-
* @param request.txOptions [Optional]
|
60
|
+
* @param request.txOptions - [Optional] transaction. This extends `WaitForTransactionReceiptParameters` from the Viem library, excluding the `hash` property.
|
61
61
|
* @returns A Promise that resolves to an object containing the transaction hash and optional snapshotId if waitForTxn is set to true.
|
62
62
|
* @emits SnapshotCompleted (snapshotId, snapshotTimestamp, unclaimedTokens).
|
63
63
|
*/
|
64
64
|
snapshot(request: SnapshotRequest): Promise<SnapshotResponse>;
|
65
|
-
|
65
|
+
/**
|
66
|
+
* Get the royalty vault proxy address of given royaltyVaultIpId.
|
67
|
+
* @param royaltyVaultIpId the id of the royalty vault.
|
68
|
+
* @returns A Promise that resolves to an object containing the royalty vault address.
|
69
|
+
*/
|
70
|
+
getRoyaltyVaultAddress(royaltyVaultIpId: Hex): Promise<Address>;
|
66
71
|
}
|
67
72
|
//# sourceMappingURL=royalty.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"royalty.d.ts","sourceRoot":"../../../../src/resources","sources":["royalty.ts"],"names":[],"mappings":"AAAA,OAAO,
|
1
|
+
{"version":3,"file":"royalty.d.ts","sourceRoot":"../../../../src/resources","sources":["royalty.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,YAAY,EAAmC,MAAM,MAAM,CAAC;AAGnF,OAAO,EACL,uBAAuB,EACvB,wBAAwB,EACxB,2BAA2B,EAC3B,4BAA4B,EAC5B,yBAAyB,EACzB,0BAA0B,EAC1B,eAAe,EACf,gBAAgB,EAChB,mBAAmB,EACnB,oBAAoB,EACrB,sCAAmC;AACpC,OAAO,EACL,qBAAqB,EAErB,mBAAmB,EACnB,sBAAsB,EACtB,kBAAkB,EAEnB,4BAAyB;AAC1B,OAAO,EAAE,eAAe,EAAE,uBAAoB;AAG9C,qBAAa,aAAa;IACjB,sBAAsB,EAAE,sBAAsB,CAAC;IAC/C,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,qBAAqB,EAAE,qBAAqB,CAAC;IAC7C,eAAe,EAAE,eAAe,CAAC;IACxC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAe;IACzC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAqB;gBAEhC,SAAS,EAAE,YAAY,EAAE,MAAM,EAAE,kBAAkB;IAS/D;;;;;;;;OAQG;IACU,oBAAoB,CAC/B,OAAO,EAAE,2BAA2B,GACnC,OAAO,CAAC,4BAA4B,CAAC;IA0CxC;;;;;;;;;OASG;IACU,kBAAkB,CAC7B,OAAO,EAAE,yBAAyB,GACjC,OAAO,CAAC,0BAA0B,CAAC;IA0CtC;;;;;;;;OAQG;IACU,gBAAgB,CAC3B,OAAO,EAAE,uBAAuB,GAC/B,OAAO,CAAC,wBAAwB,CAAC;IAoBpC;;;;;;;;;;OAUG;IACU,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAqDtF;;;;;;;OAOG;IACU,QAAQ,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,gBAAgB,CAAC;IA8B1E;;;;OAIG;IACU,sBAAsB,CAAC,gBAAgB,EAAE,GAAG,GAAG,OAAO,CAAC,OAAO,CAAC;CAe7E"}
|
@@ -1,6 +1,17 @@
|
|
1
|
-
|
1
|
+
import { Address, Hex, WalletClient } from "viem";
|
2
|
+
import { SetPermissionsRequest } from "./resources/permission.js";
|
2
3
|
export type TypedData = {
|
3
4
|
interface: string;
|
4
5
|
data: unknown[];
|
5
6
|
};
|
7
|
+
export type PermissionSignatureRequest = {
|
8
|
+
ipId: Address;
|
9
|
+
state: Hex;
|
10
|
+
deadline: string | number | bigint;
|
11
|
+
wallet: WalletClient;
|
12
|
+
chainId: string | number | bigint;
|
13
|
+
permissions: Omit<SetPermissionsRequest, "txOptions">[];
|
14
|
+
permissionFunc?: "setPermission" | "setBatchPermissions";
|
15
|
+
};
|
16
|
+
export type PermissionSignatureResponse = Hex;
|
6
17
|
//# sourceMappingURL=common.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"../../../../src/types","sources":["common.ts"],"names":[],"mappings":"AAAA,
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"../../../../src/types","sources":["common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AAElD,OAAO,EAAE,qBAAqB,EAAE,kCAA+B;AAE/D,MAAM,MAAM,SAAS,GAAG;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,OAAO,EAAE,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IACvC,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,GAAG,CAAC;IACX,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;IACnC,MAAM,EAAE,YAAY,CAAC;IACrB,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;IAClC,WAAW,EAAE,IAAI,CAAC,qBAAqB,EAAE,WAAW,CAAC,EAAE,CAAC;IACxD,cAAc,CAAC,EAAE,eAAe,GAAG,qBAAqB,CAAC;CAC1D,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG,GAAG,CAAC"}
|
@@ -5,7 +5,7 @@ import { SimpleWalletClient } from "../abi/generated.js";
|
|
5
5
|
*
|
6
6
|
* @public
|
7
7
|
*/
|
8
|
-
export type SupportedChainIds = "
|
8
|
+
export type SupportedChainIds = "1513" | "iliad";
|
9
9
|
/**
|
10
10
|
* Configuration for the SDK Client.
|
11
11
|
*
|
@@ -22,8 +22,8 @@ export type UseWalletStoryConfig = {
|
|
22
22
|
readonly wallet: SimpleWalletClient;
|
23
23
|
};
|
24
24
|
export type StoryConfig = {
|
25
|
-
readonly chainId?: SupportedChainIds;
|
26
25
|
readonly transport: Transport;
|
26
|
+
readonly chainId?: SupportedChainIds;
|
27
27
|
readonly wallet?: SimpleWalletClient;
|
28
28
|
readonly account?: Account | Address;
|
29
29
|
};
|