@story-protocol/core-sdk 1.0.0-rc.2 → 1.0.0-rc.20
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 +19643 -7849
- 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 +16 -8
- package/dist/declarations/src/index.d.ts.map +1 -1
- package/dist/declarations/src/resources/dispute.d.ts +3 -2
- package/dist/declarations/src/resources/dispute.d.ts.map +1 -1
- package/dist/declarations/src/resources/ipAccount.d.ts +11 -3
- package/dist/declarations/src/resources/ipAccount.d.ts.map +1 -1
- package/dist/declarations/src/resources/ipAsset.d.ts +193 -20
- package/dist/declarations/src/resources/ipAsset.d.ts.map +1 -1
- package/dist/declarations/src/resources/license.d.ts +46 -48
- 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 +52 -13
- 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 +1 -0
- package/dist/declarations/src/types/options.d.ts.map +1 -1
- package/dist/declarations/src/types/resources/dispute.d.ts +13 -28
- package/dist/declarations/src/types/resources/dispute.d.ts.map +1 -1
- package/dist/declarations/src/types/resources/ipAccount.d.ts +16 -11
- package/dist/declarations/src/types/resources/ipAccount.d.ts.map +1 -1
- package/dist/declarations/src/types/resources/ipAsset.d.ts +136 -14
- package/dist/declarations/src/types/resources/ipAsset.d.ts.map +1 -1
- package/dist/declarations/src/types/resources/license.d.ts +41 -26
- 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 +41 -23
- package/dist/declarations/src/types/resources/royalty.d.ts.map +1 -1
- 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 +17740 -7053
- package/dist/story-protocol-core-sdk.cjs.prod.js +17740 -7053
- package/dist/story-protocol-core-sdk.esm.js +17642 -6958
- package/package.json +5 -5
- package/dist/declarations/src/clients/storyAPI.d.ts +0 -9
- package/dist/declarations/src/clients/storyAPI.d.ts.map +0 -1
@@ -1,20 +1,112 @@
|
|
1
|
-
import { PublicClient } from "viem";
|
1
|
+
import { PublicClient, Address } 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, LicensingModuleClient, PiLicenseTemplateClient, SimpleWalletClient } from "../abi/generated.js";
|
3
|
+
import { CreateIpAssetWithPilTermsRequest, CreateIpAssetWithPilTermsResponse, IpAttribute, IpCreator, IpCreatorSocial, IpMedia, IpMetadata, IpRelationship, IPRobotTerms, MintAndRegisterIpAndMakeDerivativeRequest, RegisterDerivativeRequest, RegisterDerivativeResponse, RegisterDerivativeWithLicenseTokensRequest, RegisterDerivativeWithLicenseTokensResponse, RegisterIpAndAttachPilTermsRequest, RegisterIpAndAttachPilTermsResponse, RegisterIpAndMakeDerivativeRequest, RegisterIpAndMakeDerivativeResponse, RegisterIpResponse, RegisterRequest, StoryProtocolApp } 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
|
-
private readonly rpcClient;
|
7
|
-
private readonly chainId;
|
8
|
-
ipAssetRegistryClient: IpAssetRegistryClient;
|
9
6
|
licensingModuleClient: LicensingModuleClient;
|
7
|
+
ipAssetRegistryClient: IpAssetRegistryClient;
|
10
8
|
licenseTemplateClient: PiLicenseTemplateClient;
|
9
|
+
licenseRegistryReadOnlyClient: LicenseRegistryReadOnlyClient;
|
10
|
+
licenseTokenReadOnlyClient: LicenseTokenReadOnlyClient;
|
11
|
+
royaltyPolicyLAPClient: RoyaltyPolicyLapClient;
|
12
|
+
accessControllerClient: AccessControllerClient;
|
13
|
+
coreMetadataModuleClient: CoreMetadataModuleClient;
|
14
|
+
spgClient: SpgClient;
|
15
|
+
private readonly rpcClient;
|
16
|
+
private readonly wallet;
|
17
|
+
private readonly chainId;
|
11
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({ name, address, description, image, socialMedia, contributionPercent, role, }: {
|
34
|
+
name: string;
|
35
|
+
address: Address;
|
36
|
+
contributionPercent: number;
|
37
|
+
description?: string;
|
38
|
+
image?: string;
|
39
|
+
socialMedia?: IpCreatorSocial[];
|
40
|
+
role?: string;
|
41
|
+
}): IpCreator;
|
42
|
+
/**
|
43
|
+
* Create a new `IpMetadata` object with the specified details.
|
44
|
+
* @param params - The parameters required to create the `IpMetadata` object.
|
45
|
+
* @param params.title [Optional] The title of the IP.
|
46
|
+
* @param params.description [Optional] A description of the IP.
|
47
|
+
* @param params.ipType [Optional] The type of the IP asset (e.g., "character", "chapter").
|
48
|
+
* @param params.relationships [Optional] An array of relationships between this IP and its parent IPs.
|
49
|
+
* @param params.relationships[].ipId The ID of the parent IP.
|
50
|
+
* @param params.relationships[].type The type of relationship (e.g., "APPEARS_IN").
|
51
|
+
* @param params.createdAt [Optional] The creation date and time of the IP in ISO 8601 format.
|
52
|
+
* @param params.watermarkImg [Optional] The URL or path to an image used as a watermark for the IP.
|
53
|
+
* @param params.creators [Optional] An array of creators associated with the IP.
|
54
|
+
* @param params.creators[].name The name of the creator.
|
55
|
+
* @param params.creators[].address The address of the creator.
|
56
|
+
* @param params.creators[].description [Optional] A description of the creator.
|
57
|
+
* @param params.creators[].image [Optional] The URL or path to an image representing the creator.
|
58
|
+
* @param params.creators[].socialMedia [Optional] An array of social media profiles for the creator.
|
59
|
+
* @param params.creators[].socialMedia[].platform The social media platform name.
|
60
|
+
* @param params.creators[].socialMedia[].url The URL to the creator's profile.
|
61
|
+
* @param params.creators[].role [Optional] The role of the creator in relation to the IP.
|
62
|
+
* @param params.creators[].contributionPercent The percentage of contribution by the creator.
|
63
|
+
* @param params.media [Optional] An array of media related to the IP.
|
64
|
+
* @param params.media[].name The name of the media.
|
65
|
+
* @param params.media[].url The URL to the media.
|
66
|
+
* @param params.media[].mimeType The MIME type of the media.
|
67
|
+
* @param params.attributes [Optional] An array of key-value pairs providing additional metadata.
|
68
|
+
* @param params.attributes[].key The key for the attribute.
|
69
|
+
* @param params.attributes[].value The value for the attribute, can be a string or number.
|
70
|
+
* @param params.app [Optional] Information about the application associated with the IP.
|
71
|
+
* @param params.app.id The ID of the application.
|
72
|
+
* @param params.app.name The name of the application.
|
73
|
+
* @param params.app.website The website URL of the application.
|
74
|
+
* @param params.tags [Optional] An array of tags associated with the IP.
|
75
|
+
* @param params.robotTerms [Optional] Robot terms for the IP, specifying access rules.
|
76
|
+
* @param params.robotTerms.userAgent The user agent for which the rules apply.
|
77
|
+
* @param params.robotTerms.allow The rules allowing access.
|
78
|
+
* @param params.additionalProperties [Optional] Any additional key-value pairs to include in the metadata.
|
79
|
+
* @returns An `IpMetadata` object containing the provided details and any additional properties.
|
80
|
+
*/
|
81
|
+
generateIpMetadata({ title, description, ipType, relationships, createdAt, watermarkImg, creators, media, attributes, app, tags, robotTerms, ...additionalProperties }: {
|
82
|
+
title?: string;
|
83
|
+
description?: string;
|
84
|
+
ipType?: string;
|
85
|
+
relationships?: IpRelationship[];
|
86
|
+
createdAt?: string;
|
87
|
+
watermarkImg?: string;
|
88
|
+
creators?: IpCreator[];
|
89
|
+
media?: IpMedia[];
|
90
|
+
attributes?: IpAttribute[];
|
91
|
+
app?: StoryProtocolApp;
|
92
|
+
tags?: string[];
|
93
|
+
robotTerms?: IPRobotTerms;
|
94
|
+
additionalProperties?: {
|
95
|
+
[key: string]: unknown;
|
96
|
+
};
|
97
|
+
}): IpMetadata;
|
12
98
|
/**
|
13
99
|
* Registers an NFT as IP, creating a corresponding IP record.
|
14
|
-
* @param request The request object that contains all data needed to register IP.
|
15
|
-
*
|
16
|
-
*
|
17
|
-
*
|
100
|
+
* @param request - The request object that contains all data needed to register IP.
|
101
|
+
* @param request.nftContract The address of the NFT.
|
102
|
+
* @param request.tokenId The token identifier of the NFT.
|
103
|
+
* @param request.ipMetadata - [Optional] The desired metadata for the newly minted NFT and newly registered IP.
|
104
|
+
* @param request.ipMetadata.ipMetadataURI [Optional] The URI of the metadata for the IP.
|
105
|
+
* @param request.ipMetadata.ipMetadataHash [Optional] The hash of the metadata for the IP.
|
106
|
+
* @param request.ipMetadata.nftMetadataURI [Optional] The URI of the metadata for the NFT.
|
107
|
+
* @param request.ipMetadata.nftMetadataHash [Optional] The hash of the metadata for the IP NFT.
|
108
|
+
* @param request.deadline [Optional] The deadline for the signature in milliseconds, default is 1000ms.
|
109
|
+
* @param request.txOptions [Optional] The transaction options.
|
18
110
|
* @returns A Promise that resolves to an object containing the transaction hash and optional IP ID if waitForTxn is set to true.
|
19
111
|
* @emits IPRegistered (ipId, chainId, tokenContract, tokenId, resolverAddr, metadataProviderAddress, metadata)
|
20
112
|
*/
|
@@ -25,11 +117,11 @@ export declare class IPAssetClient {
|
|
25
117
|
* The license terms must be attached to the parent IP before calling this function.
|
26
118
|
* All IPs attached default license terms by default.
|
27
119
|
* The derivative IP owner must be the caller or an authorized operator.
|
28
|
-
* @param request The request object that contains all data needed to register derivative IP.
|
29
|
-
*
|
30
|
-
*
|
31
|
-
*
|
32
|
-
*
|
120
|
+
* @param request - The request object that contains all data needed to register derivative IP.
|
121
|
+
* @param request.childIpId The derivative IP ID.
|
122
|
+
* @param request.parentIpIds The parent IP IDs.
|
123
|
+
* @param request.licenseTermsIds The IDs of the license terms that the parent IP supports.
|
124
|
+
* @param request.txOptions [Optional] The transaction options.
|
33
125
|
* @returns A Promise that resolves to an object containing the transaction hash.
|
34
126
|
*/
|
35
127
|
registerDerivative(request: RegisterDerivativeRequest): Promise<RegisterDerivativeResponse>;
|
@@ -38,13 +130,94 @@ export declare class IPAssetClient {
|
|
38
130
|
* the derivative IP is registered with license tokens minted from the parent IP's license terms.
|
39
131
|
* the license terms of the parent IPs issued with license tokens are attached to the derivative IP.
|
40
132
|
* the caller must be the derivative IP owner or an authorized operator.
|
41
|
-
* @param request The request object that contains all data needed to register derivative license tokens.
|
42
|
-
*
|
43
|
-
*
|
44
|
-
*
|
133
|
+
* @param request - The request object that contains all data needed to register derivative license tokens.
|
134
|
+
* @param request.childIpId The derivative IP ID.
|
135
|
+
* @param request.licenseTokenIds The IDs of the license tokens.
|
136
|
+
* @param request.txOptions [Optional] The transaction options.
|
45
137
|
* @returns A Promise that resolves to an object containing the transaction hash.
|
46
138
|
*/
|
47
139
|
registerDerivativeWithLicenseTokens(request: RegisterDerivativeWithLicenseTokensRequest): Promise<RegisterDerivativeWithLicenseTokensResponse>;
|
48
|
-
|
140
|
+
/**
|
141
|
+
* Mint an NFT from a collection and register it as an IP.
|
142
|
+
* @param request - The request object that contains all data needed to mint and register ip.
|
143
|
+
* @param request.nftContract The address of the NFT collection.
|
144
|
+
* @param request.pilType The type of the PIL.
|
145
|
+
* @param request.ipMetadata - [Optional] The desired metadata for the newly minted NFT and newly registered IP.
|
146
|
+
* @param request.ipMetadata.ipMetadataURI [Optional] The URI of the metadata for the IP.
|
147
|
+
* @param request.ipMetadata.ipMetadataHash [Optional] The hash of the metadata for the IP.
|
148
|
+
* @param request.ipMetadata.nftMetadataURI [Optional] The URI of the metadata for the NFT.
|
149
|
+
* @param request.ipMetadata.nftMetadataHash [Optional] The hash of the metadata for the IP NFT.
|
150
|
+
* @param request.recipient [Optional] The address of the recipient of the minted NFT.
|
151
|
+
* @param request.mintingFee [Optional] The fee to be paid when minting a license.
|
152
|
+
* @param request.commercialRevShare [Optional] Percentage of revenue that must be shared with the licensor.
|
153
|
+
* @param request.currency [Optional] The ERC20 token to be used to pay the minting fee. the token must be registered in story protocol.
|
154
|
+
* @param request.txOptions [Optional] The transaction options.
|
155
|
+
* @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.
|
156
|
+
* @emits IPRegistered (ipId, chainId, tokenContract, tokenId, name, uri, registrationDate)
|
157
|
+
* @emits LicenseTermsAttached (caller, ipId, licenseTemplate, licenseTermsId)
|
158
|
+
*/
|
159
|
+
mintAndRegisterIpAssetWithPilTerms(request: CreateIpAssetWithPilTermsRequest): Promise<CreateIpAssetWithPilTermsResponse>;
|
160
|
+
/**
|
161
|
+
* Register a given NFT as an IP and attach Programmable IP License Terms.R.
|
162
|
+
* @param request - The request object that contains all data needed to mint and register ip.
|
163
|
+
* @param request.nftContract The address of the NFT collection.
|
164
|
+
* @param request.tokenId The ID of the NFT.
|
165
|
+
* @param request.pilType The type of the PIL.
|
166
|
+
* @param request.ipMetadata - [Optional] The desired metadata for the newly minted NFT and newly registered IP.
|
167
|
+
* @param request.ipMetadata.ipMetadataURI [Optional] The URI of the metadata for the IP.
|
168
|
+
* @param request.ipMetadata.ipMetadataHash [Optional] The hash of the metadata for the IP.
|
169
|
+
* @param request.ipMetadata.nftMetadataURI [Optional] The URI of the metadata for the NFT.
|
170
|
+
* @param request.ipMetadata.nftMetadataHash [Optional] The hash of the metadata for the IP NFT.
|
171
|
+
* @param request.deadline [Optional] The deadline for the signature in milliseconds, default is 1000ms.
|
172
|
+
* @param request.mintingFee [Optional] The fee to be paid when minting a license.
|
173
|
+
* @param request.commercialRevShare [Optional] Percentage of revenue that must be shared with the licensor.
|
174
|
+
* @param request.currency [Optional] The ERC20 token to be used to pay the minting fee. the token must be registered in story protocol.
|
175
|
+
* @param request.txOptions [Optional] The transaction options.
|
176
|
+
* @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.
|
177
|
+
* @emits LicenseTermsAttached (caller, ipId, licenseTemplate, licenseTermsId)
|
178
|
+
*/
|
179
|
+
registerIpAndAttachPilTerms(request: RegisterIpAndAttachPilTermsRequest): Promise<RegisterIpAndAttachPilTermsResponse>;
|
180
|
+
/**
|
181
|
+
* Register the given NFT as a derivative IP with metadata without using license tokens.
|
182
|
+
* @param request - The request object that contains all data needed to register derivative IP.
|
183
|
+
* @param request.nftContract The address of the NFT collection.
|
184
|
+
* @param request.tokenId The ID of the NFT.
|
185
|
+
* @param request.derivData The derivative data to be used for registerDerivative.
|
186
|
+
* @param request.derivData.parentIpIds The IDs of the parent IPs to link the registered derivative IP.
|
187
|
+
* @param request.derivData.licenseTemplate [Optional] The address of the license template to be used for the linking.
|
188
|
+
* @param request.derivData.licenseTermsIds The IDs of the license terms to be used for the linking.
|
189
|
+
* @param request.ipMetadata - [Optional] The desired metadata for the newly minted NFT and newly registered IP.
|
190
|
+
* @param request.ipMetadata.ipMetadataURI [Optional] The URI of the metadata for the IP.
|
191
|
+
* @param request.ipMetadata.ipMetadataHash [Optional] The hash of the metadata for the IP.
|
192
|
+
* @param request.ipMetadata.nftMetadataURI [Optional] The URI of the metadata for the NFT.
|
193
|
+
* @param request.ipMetadata.nftMetadataHash [Optional] The hash of the metadata for the IP NFT.
|
194
|
+
* @param request.deadline [Optional] The deadline for the signature in milliseconds,default is 1000ms.
|
195
|
+
* @param request.txOptions [Optional] The transaction options.
|
196
|
+
* @returns A Promise that resolves to an object containing the transaction hash and optional IP ID if waitForTxn is set to true.
|
197
|
+
* @emits IPRegistered (ipId, chainId, tokenContract, tokenId, name, uri, registrationDate)
|
198
|
+
*/
|
199
|
+
registerDerivativeIp(request: RegisterIpAndMakeDerivativeRequest): Promise<RegisterIpAndMakeDerivativeResponse>;
|
200
|
+
/**
|
201
|
+
* Mint an NFT from a collection and register it as a derivative IP without license tokens.
|
202
|
+
* @param request - The request object that contains all data needed to mint and register ip and make derivative.
|
203
|
+
* @param request.nftContract The address of the NFT collection.
|
204
|
+
* @param request.derivData The derivative data to be used for registerDerivative.
|
205
|
+
* @param request.derivData.parentIpIds The IDs of the parent IPs to link the registered derivative IP.
|
206
|
+
* @param request.derivData.licenseTermsIds The IDs of the license terms to be used for the linking.
|
207
|
+
* @param request.derivData.licenseTemplate [Optional] The address of the license template to be used for the linking.
|
208
|
+
* @param request.ipMetadata - [Optional] The desired metadata for the newly minted NFT and newly registered IP.
|
209
|
+
* @param request.ipMetadata.ipMetadataURI [Optional] The URI of the metadata for the IP.
|
210
|
+
* @param request.ipMetadata.ipMetadataHash [Optional] The hash of the metadata for the IP.
|
211
|
+
* @param request.ipMetadata.nftMetadataURI [Optional] The URI of the metadata for the NFT.
|
212
|
+
* @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.
|
213
|
+
* @param request.txOptions [Optional] The transaction options.
|
214
|
+
* @returns A Promise that resolves to an object containing the transaction hash and optional IP ID if waitForTxn is set to true.
|
215
|
+
* @emits IPRegistered (ipId, chainId, tokenContract, tokenId, name, uri, registrationDate)
|
216
|
+
*/
|
217
|
+
mintAndRegisterIpAndMakeDerivative(request: MintAndRegisterIpAndMakeDerivativeRequest): Promise<RegisterDerivativeResponse>;
|
218
|
+
private getIpIdAddress;
|
219
|
+
private isRegistered;
|
220
|
+
private getSigSignatureState;
|
221
|
+
private getLicenseTermsId;
|
49
222
|
}
|
50
223
|
//# 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":"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"}
|
@@ -1,65 +1,56 @@
|
|
1
1
|
import { PublicClient } from "viem";
|
2
|
-
import {
|
3
|
-
import {
|
4
|
-
import { RegisterLicenseTermsRequest, RegisterLicenseTermsResponse as RegisterPILResponse, RegisterCommercialUsePILRequest, RegisterCommercialRemixPILRequest, AttachLicenseTermsRequest, MintLicenseTokensRequest, MintLicenseTokensResponse } from "../types/resources/license.js";
|
2
|
+
import { IpAssetRegistryClient, LicenseRegistryEventClient, LicenseRegistryReadOnlyClient, LicensingModuleClient, PiLicenseTemplateClient, PiLicenseTemplateGetLicenseTermsResponse, PiLicenseTemplateReadOnlyClient, RoyaltyPolicyLapClient, SimpleWalletClient } from "../abi/generated.js";
|
3
|
+
import { RegisterNonComSocialRemixingPILRequest, RegisterPILResponse, RegisterCommercialUsePILRequest, RegisterCommercialRemixPILRequest, AttachLicenseTermsRequest, MintLicenseTokensRequest, MintLicenseTokensResponse, AttachLicenseTermsResponse, LicenseTermsId } from "../types/resources/license.js";
|
5
4
|
export declare class LicenseClient {
|
6
|
-
private readonly wallet;
|
7
|
-
private readonly rpcClient;
|
8
|
-
private readonly storyClient;
|
9
5
|
licenseRegistryClient: LicenseRegistryEventClient;
|
10
6
|
licensingModuleClient: LicensingModuleClient;
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
7
|
+
ipAssetRegistryClient: IpAssetRegistryClient;
|
8
|
+
piLicenseTemplateReadOnlyClient: PiLicenseTemplateReadOnlyClient;
|
9
|
+
licenseTemplateClient: PiLicenseTemplateClient;
|
10
|
+
royaltyPolicyLAPClient: RoyaltyPolicyLapClient;
|
11
|
+
licenseRegistryReadOnlyClient: LicenseRegistryReadOnlyClient;
|
12
|
+
private readonly rpcClient;
|
13
|
+
private readonly wallet;
|
14
|
+
constructor(rpcClient: PublicClient, wallet: SimpleWalletClient);
|
15
15
|
/**
|
16
16
|
* Convenient function to register a PIL non commercial social remix license to the registry
|
17
|
-
* @param request The request object that contains all data needed to register a PIL non commercial social remix license.
|
18
|
-
*
|
19
|
-
* @returns A Promise that resolves to an object containing the optional transaction hash and optional license
|
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] The transaction options.
|
19
|
+
* @returns A Promise that resolves to an object containing the optional transaction hash and optional license terms Id.
|
20
20
|
* @emits LicenseTermsRegistered (licenseTermsId, licenseTemplate, licenseTerms);
|
21
21
|
*/
|
22
|
-
registerNonComSocialRemixingPIL(request
|
22
|
+
registerNonComSocialRemixingPIL(request?: RegisterNonComSocialRemixingPILRequest): Promise<RegisterPILResponse>;
|
23
23
|
/**
|
24
24
|
* 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
|
-
*
|
27
|
-
*
|
28
|
-
*
|
29
|
-
*
|
30
|
-
* @param request.txOptions [Optional] The transaction options.
|
31
|
-
* @returns A Promise that resolves to an object containing the optional transaction hash and optional license ID.
|
25
|
+
* @param request - The request object that contains all data needed to register a PIL commercial use license.
|
26
|
+
* @param request.mintingFee The fee to be paid when minting a license.
|
27
|
+
* @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.txOptions [Optional] The transaction options.
|
29
|
+
* @returns A Promise that resolves to an object containing the optional transaction hash and optional license terms Id.
|
32
30
|
* @emits LicenseTermsRegistered (licenseTermsId, licenseTemplate, licenseTerms);
|
33
31
|
*/
|
34
32
|
registerCommercialUsePIL(request: RegisterCommercialUsePILRequest): Promise<RegisterPILResponse>;
|
35
33
|
/**
|
36
34
|
* Convenient function to register a PIL commercial Remix license to the registry.
|
37
|
-
* @param request The request object that contains all data needed to register license.
|
38
|
-
*
|
39
|
-
*
|
40
|
-
*
|
41
|
-
*
|
42
|
-
*
|
43
|
-
* @returns A Promise that resolves to an object containing the optional transaction hash and optional license ID.
|
35
|
+
* @param request - The request object that contains all data needed to register license.
|
36
|
+
* @param request.mintingFee The fee to be paid when minting a license.
|
37
|
+
* @param request.commercialRevShare Percentage of revenue that must be shared with the licensor.
|
38
|
+
* @param request.currency The ERC20 token to be used to pay the minting fee. the token must be registered in story protocol.
|
39
|
+
* @param request.txOptions [Optional] The transaction options.
|
40
|
+
* @returns A Promise that resolves to an object containing the optional transaction hash and optional license terms Id.
|
44
41
|
* @emits LicenseTermsRegistered (licenseTermsId, licenseTemplate, licenseTerms);
|
45
42
|
*/
|
46
43
|
registerCommercialRemixPIL(request: RegisterCommercialRemixPILRequest): Promise<RegisterPILResponse>;
|
47
44
|
/**
|
48
45
|
* Attaches license terms to an IP.
|
49
|
-
* @param request The request object that contains all data needed to attach license terms.
|
50
|
-
@param request.ipId The IP
|
51
|
-
@param request.
|
52
|
-
@param request.
|
53
|
-
@param request.
|
54
|
-
@param request.ipId The address of the IP to which the license terms are attached.
|
55
|
-
@param request.licenseTemplate The address of the license template.
|
56
|
-
@param request.licenseTermsId The ID of the license terms.
|
57
|
-
* @param request.txOptions [Optional] The transaction options.
|
46
|
+
* @param request - The request object that contains all data needed to attach license terms.
|
47
|
+
* @param request.ipId The address of the IP to which the license terms are attached.
|
48
|
+
* @param request.licenseTemplate The address of the license template.
|
49
|
+
* @param request.licenseTermsId The ID of the license terms.
|
50
|
+
* @param request.txOptions [Optional] The transaction options.
|
58
51
|
* @returns A Promise that resolves to an object containing the transaction hash.
|
59
52
|
*/
|
60
|
-
attachLicenseTerms(request: AttachLicenseTermsRequest): Promise<
|
61
|
-
txHash: `0x${string}`;
|
62
|
-
}>;
|
53
|
+
attachLicenseTerms(request: AttachLicenseTermsRequest): Promise<AttachLicenseTermsResponse>;
|
63
54
|
/**
|
64
55
|
* Mints license tokens for the license terms attached to an IP.
|
65
56
|
* The license tokens are minted to the receiver.
|
@@ -72,16 +63,23 @@ export declare class LicenseClient {
|
|
72
63
|
* The minting fee is paid in the minting fee token specified in the license terms or configured by the IP owner.
|
73
64
|
* IP owners can configure the minting fee of their IPs or
|
74
65
|
* configure the minting fee module to determine the minting fee.
|
75
|
-
* @param request The request object that contains all data needed to mint license tokens.
|
76
|
-
*
|
77
|
-
*
|
78
|
-
*
|
79
|
-
*
|
80
|
-
*
|
81
|
-
*
|
82
|
-
* @returns A Promise that resolves to an object containing the transaction hash and optional license token
|
66
|
+
* @param request - The request object that contains all data needed to mint license tokens.
|
67
|
+
* @param request.licensorIpId The licensor IP ID.
|
68
|
+
* @param request.licenseTemplate The address of the license template.
|
69
|
+
* @param request.licenseTermsId The ID of the license terms within the license template.
|
70
|
+
* @param request.amount The amount of license tokens to mint.
|
71
|
+
* @param request.receiver The address of the receiver.
|
72
|
+
* @param request.txOptions [Optional] The transaction options.
|
73
|
+
* @returns A Promise that resolves to an object containing the transaction hash and optional license token IDs if waitForTxn is set to true.
|
83
74
|
* @emits LicenseTokensMinted (msg.sender, licensorIpId, licenseTemplate, licenseTermsId, amount, receiver, startLicenseTokenId);
|
84
75
|
*/
|
85
76
|
mintLicenseTokens(request: MintLicenseTokensRequest): Promise<MintLicenseTokensResponse>;
|
77
|
+
/**
|
78
|
+
* Gets license terms of the given ID.
|
79
|
+
* @param selectedLicenseTermsId The ID of the license terms.
|
80
|
+
* @returns A Promise that resolves to an object containing the PILTerms associate with the given ID.
|
81
|
+
*/
|
82
|
+
getLicenseTerms(selectedLicenseTermsId: LicenseTermsId): Promise<PiLicenseTemplateGetLicenseTermsResponse>;
|
83
|
+
private getLicenseTermsId;
|
86
84
|
}
|
87
85
|
//# 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,
|
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,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,EACf,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,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;;;;;;OAMG;IACU,+BAA+B,CAC1C,OAAO,CAAC,EAAE,sCAAsC,GAC/C,OAAO,CAAC,mBAAmB,CAAC;IA8B/B;;;;;;;;OAQG;IACU,wBAAwB,CACnC,OAAO,EAAE,+BAA+B,GACvC,OAAO,CAAC,mBAAmB,CAAC;IAkC/B;;;;;;;;;OASG;IACU,0BAA0B,CACrC,OAAO,EAAE,iCAAiC,GACzC,OAAO,CAAC,mBAAmB,CAAC;IAoC/B;;;;;;;;OAQG;IACU,kBAAkB,CAC7B,OAAO,EAAE,yBAAyB,GACjC,OAAO,CAAC,0BAA0B,CAAC;IAgDtC;;;;;;;;;;;;;;;;;;;;;OAqBG;IACU,iBAAiB,CAC5B,OAAO,EAAE,wBAAwB,GAChC,OAAO,CAAC,yBAAyB,CAAC;IA8DrC;;;;OAIG;IACU,eAAe,CAC1B,sBAAsB,EAAE,cAAc,GACrC,OAAO,CAAC,wCAAwC,CAAC;YAUtC,iBAAiB;CAIhC"}
|
@@ -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 options.
|
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;CAsCxC"}
|
@@ -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] The transaction options.
|
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] The transaction options.
|
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] The transaction options.
|
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] The transaction options.
|
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] The transaction options.
|
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;IA2B3F;;;;;;;;;;;;OAYG;IACU,4BAA4B,CACvC,OAAO,EAAE,mCAAmC,GAC3C,OAAO,CAAC,sBAAsB,CAAC;IA2DlC;;;;;;;;;OASG;IACU,iBAAiB,CAC5B,OAAO,EAAE,wBAAwB,GAChC,OAAO,CAAC,sBAAsB,CAAC;IAuBlC;;;;;;;;;;;;;OAaG;IACU,mBAAmB,CAC9B,OAAO,EAAE,0BAA0B,GAClC,OAAO,CAAC,sBAAsB,CAAC;IA8BlC;;;;;;;;;;;;;OAaG;IACU,8BAA8B,CACzC,OAAO,EAAE,qCAAqC,GAC7C,OAAO,CAAC,sBAAsB,CAAC;YAuDpB,iBAAiB;CAQhC"}
|
@@ -1,23 +1,25 @@
|
|
1
|
-
import { PublicClient } from "viem";
|
2
|
-
import { CollectRoyaltyTokensRequest, CollectRoyaltyTokensResponse, PayRoyaltyOnBehalfRequest, PayRoyaltyOnBehalfResponse } from "../types/resources/royalty.js";
|
3
|
-
import {
|
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
|
+
import { IpAssetRegistryClient, RoyaltyModuleClient, RoyaltyPolicyLapClient, SimpleWalletClient } from "../abi/generated.js";
|
4
|
+
import { IPAccountClient } from "./ipAccount.js";
|
4
5
|
export declare class RoyaltyClient {
|
5
|
-
|
6
|
-
private readonly rpcClient;
|
7
|
-
royaltyVaultImplClient: IpRoyaltyVaultImplClient;
|
8
|
-
royaltyPolicyLAPClient: RoyaltyPolicyLapClient;
|
6
|
+
royaltyPolicyLapClient: RoyaltyPolicyLapClient;
|
9
7
|
royaltyModuleClient: RoyaltyModuleClient;
|
8
|
+
ipAssetRegistryClient: IpAssetRegistryClient;
|
9
|
+
ipAccountClient: IPAccountClient;
|
10
|
+
private readonly rpcClient;
|
11
|
+
private readonly wallet;
|
10
12
|
constructor(rpcClient: PublicClient, wallet: SimpleWalletClient);
|
11
13
|
/**
|
12
14
|
* Allows ancestors to claim the royalty tokens and any accrued revenue tokens
|
13
|
-
* @param request -
|
14
|
-
* @param request.
|
15
|
+
* @param request - The request object that contains all data needed to collect royalty tokens.
|
16
|
+
* @param request.parentIpId The ip id of the ancestor to whom the royalty tokens belong to.
|
17
|
+
* @param request.royaltyVaultIpId The id of the royalty vault.
|
15
18
|
* @param request.txOptions [Optional] The transaction options.
|
16
|
-
* @returns
|
17
|
-
* @emits RoyaltyTokensCollected (ancestorIpId,
|
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
|
+
* @emits RoyaltyTokensCollected (ancestorIpId, royaltyTokensCollected)
|
18
21
|
*/
|
19
22
|
collectRoyaltyTokens(request: CollectRoyaltyTokensRequest): Promise<CollectRoyaltyTokensResponse>;
|
20
|
-
private getProxyAddress;
|
21
23
|
/**
|
22
24
|
* Allows the function caller to pay royalties to the receiver IP asset on behalf of the payer IP asset.
|
23
25
|
* @param request - The request object that contains all data needed to pay royalty on behalf.
|
@@ -27,8 +29,45 @@ export declare class RoyaltyClient {
|
|
27
29
|
* @param request.amount The amount to pay.
|
28
30
|
* @param request.txOptions [Optional] The transaction options.
|
29
31
|
* @returns A Promise that resolves to an object containing the transaction hash.
|
30
|
-
* @emits RoyaltyPaid (receiverIpId, payerIpId, msg.sender, token, amount)
|
31
32
|
*/
|
32
33
|
payRoyaltyOnBehalf(request: PayRoyaltyOnBehalfRequest): Promise<PayRoyaltyOnBehalfResponse>;
|
34
|
+
/**
|
35
|
+
* Calculates the amount of revenue token claimable by a token holder at certain snapshot.
|
36
|
+
* @param request - The request object that contains all data needed to claim Revenue.
|
37
|
+
* @param request.royaltyVaultIpId The id of the royalty vault.
|
38
|
+
* @param request.account The address of the token holder.
|
39
|
+
* @param request.snapshotId The snapshot id.
|
40
|
+
* @param request.token The revenue token to claim.
|
41
|
+
* @param request.txOptions [Optional] The transaction options.
|
42
|
+
* @returns A Promise that contains the amount of revenue token claimable
|
43
|
+
*/
|
44
|
+
claimableRevenue(request: ClaimableRevenueRequest): Promise<ClaimableRevenueResponse>;
|
45
|
+
/**
|
46
|
+
* Allows token holders to claim by a list of snapshot ids based on the token balance at certain snapshot
|
47
|
+
* @param request - The request object that contains all data needed to claim revenue.
|
48
|
+
* @param request.snapshotIds The list of snapshot ids.
|
49
|
+
* @param request.royaltyVaultIpId The id of the royalty vault.
|
50
|
+
* @param request.token The revenue token to claim.
|
51
|
+
* @param request.account [Optional] The ipId to send.
|
52
|
+
* @param request.txOptions [Optional] The transaction options.
|
53
|
+
* @returns A Promise that resolves to an object containing the transaction hash and optional claimableToken if waitForTxn is set to true.
|
54
|
+
* @emits RevenueTokenClaimed (claimer, token, amount).
|
55
|
+
*/
|
56
|
+
claimRevenue(request: ClaimRevenueRequest): Promise<ClaimRevenueResponse>;
|
57
|
+
/**
|
58
|
+
* Snapshots the claimable revenue and royalty token amounts.
|
59
|
+
* @param request - The request object that contains all data needed to snapshot.
|
60
|
+
* @param request.royaltyVaultIpId The id of the royalty vault.
|
61
|
+
* @param request.txOptions [Optional] The transaction options.
|
62
|
+
* @returns A Promise that resolves to an object containing the transaction hash and optional snapshotId if waitForTxn is set to true.
|
63
|
+
* @emits SnapshotCompleted (snapshotId, snapshotTimestamp, unclaimedTokens).
|
64
|
+
*/
|
65
|
+
snapshot(request: SnapshotRequest): Promise<SnapshotResponse>;
|
66
|
+
/**
|
67
|
+
* Get the royalty vault proxy address of given royaltyVaultIpId.
|
68
|
+
* @param royaltyVaultIpId the id of the royalty vault.
|
69
|
+
* @returns A Promise that resolves to an object containing the royalty vault address.
|
70
|
+
*/
|
71
|
+
getRoyaltyVaultAddress(royaltyVaultIpId: Hex): Promise<Address>;
|
33
72
|
}
|
34
73
|
//# sourceMappingURL=royalty.d.ts.map
|