Skip to content

Commit 6f660f9

Browse files
authored
Merge pull request #427 from storyprotocol/bonnie/dev2
1. Add new methods for nftClient 2. Bind link with v1.3.1 3. Make allowDuplicates optional
2 parents 739b46e + 8b93d23 commit 6f660f9

File tree

23 files changed

+510
-148
lines changed

23 files changed

+510
-148
lines changed

packages/core-sdk/src/abi/generated.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15199,7 +15199,7 @@ export const wrappedIpAbi = [
1519915199
inputs: [],
1520015200
name: "name",
1520115201
outputs: [{ name: "", internalType: "string", type: "string" }],
15202-
stateMutability: "view",
15202+
stateMutability: "pure",
1520315203
},
1520415204
{
1520515205
type: "function",
@@ -15228,7 +15228,7 @@ export const wrappedIpAbi = [
1522815228
inputs: [],
1522915229
name: "symbol",
1523015230
outputs: [{ name: "", internalType: "string", type: "string" }],
15231-
stateMutability: "view",
15231+
stateMutability: "pure",
1523215232
},
1523315233
{
1523415234
type: "function",

packages/core-sdk/src/resources/dispute.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export class DisputeClient {
4343
* Raises a dispute on a given ipId.
4444
*
4545
* Submits a {@link DisputeRaised} event.
46-
* @see {@link https://github.com/storyprotocol/protocol-core-v1/blob/main/contracts/interfaces/modules/dispute/IDisputeModule.sol | IDisputeModule.sol}
46+
* @see {@link https://github.com/storyprotocol/protocol-core-v1/blob/v1.3.1/contracts/interfaces/modules/dispute/IDisputeModule.sol#L64 | IDisputeModule.sol}
4747
* for a list of on-chain events emitted when a dispute is raised.
4848
*/
4949
public async raiseDispute(request: RaiseDisputeRequest): Promise<RaiseDisputeResponse> {
@@ -187,7 +187,7 @@ export class DisputeClient {
187187
* Tags a derivative if a parent has been tagged with an infringement tag
188188
* or a group ip if a group member has been tagged with an infringement tag.
189189
*
190-
* @see {@link https://github.com/storyprotocol/protocol-core-v1/blob/main/contracts/interfaces/modules/dispute/IDisputeModule.sol | IDisputeModule.sol}
190+
* @see {@link https://github.com/storyprotocol/protocol-core-v1/blob/v1.3.1/contracts/interfaces/modules/dispute/IDisputeModule.sol#L93 | IDisputeModule.sol}
191191
* for a list of on-chain events emitted when a derivative is tagged on an infringement.
192192
*/
193193
public async tagIfRelatedIpInfringed(

packages/core-sdk/src/resources/group.ts

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ import { getFunctionSignature } from "../utils/getFunctionSignature";
4444
import { validateLicenseConfig } from "../utils/validateLicenseConfig";
4545
import { getIpMetadataForWorkflow } from "../utils/getIpMetadataForWorkflow";
4646
import { getRevenueShare } from "../utils/licenseTermsHelper";
47+
import { RevShareType } from "../types/common";
4748

4849
export class GroupClient {
4950
public groupingWorkflowsClient: GroupingWorkflowsClient;
@@ -108,7 +109,7 @@ export class GroupClient {
108109
}
109110
}
110111
/** Mint an NFT from a SPGNFT collection, register it with metadata as an IP, attach license terms to the registered IP, and add it to a group IP.
111-
* @see {@link https://github.com/storyprotocol/protocol-core-v1/blob/main/contracts/interfaces/registries/IIPAssetRegistry.sol | IIPAssetRegistry}
112+
* @see {@link https://github.com/storyprotocol/protocol-core-v1/blob/v1.3.1/contracts/interfaces/registries/IIPAssetRegistry.sol#L17 | IIPAssetRegistry}
112113
* for a list of on-chain events emitted when an IP is minted and registered, license terms are attached to an IP, and it is added to a group.
113114
*/
114115
public async mintAndRegisterIpAndAttachLicenseAndAddToGroup(
@@ -144,10 +145,13 @@ export class GroupClient {
144145
});
145146
const object: GroupingWorkflowsMintAndRegisterIpAndAttachLicenseAndAddToGroupRequest = {
146147
...request,
148+
allowDuplicates: request.allowDuplicates || true,
147149
spgNftContract: getAddress(spgNftContract, "request.spgNftContract"),
148150
recipient:
149151
(recipient && getAddress(recipient, "request.recipient")) || this.wallet.account!.address,
150-
maxAllowedRewardShare: BigInt(getRevenueShare(request.maxAllowedRewardShare)),
152+
maxAllowedRewardShare: BigInt(
153+
getRevenueShare(request.maxAllowedRewardShare, RevShareType.MAX_ALLOWED_REWARD_SHARE),
154+
),
151155
licensesData: this.getLicenseData(request.licenseData),
152156
ipMetadata: getIpMetadataForWorkflow(request.ipMetadata),
153157
sigAddToGroup: {
@@ -182,7 +186,7 @@ export class GroupClient {
182186
}
183187

184188
/** Register an NFT as IP with metadata, attach license terms to the registered IP, and add it to a group IP.
185-
* @see {@link https://github.com/storyprotocol/protocol-core-v1/blob/main/contracts/interfaces/registries/IIPAssetRegistry.sol | IIPAssetRegistry}
189+
* @see {@link https://github.com/storyprotocol/protocol-core-v1/blob/v1.3.1/contracts/interfaces/registries/IIPAssetRegistry.sol#L17 | IIPAssetRegistry}
186190
* for a list of on-chain events emitted when an IP is registered, license terms are attached to an IP, and it is added to a group.
187191
*/
188192
public async registerIpAndAttachLicenseAndAddToGroup(
@@ -257,7 +261,9 @@ export class GroupClient {
257261
licensesData: this.getLicenseData(request.licenseData),
258262
ipMetadata: getIpMetadataForWorkflow(request.ipMetadata),
259263
tokenId: BigInt(request.tokenId),
260-
maxAllowedRewardShare: BigInt(getRevenueShare(request.maxAllowedRewardShare)),
264+
maxAllowedRewardShare: BigInt(
265+
getRevenueShare(request.maxAllowedRewardShare, RevShareType.MAX_ALLOWED_REWARD_SHARE),
266+
),
261267
sigAddToGroup: {
262268
signer: getAddress(this.wallet.account!.address, "wallet.account.address"),
263269
deadline: calculatedDeadline,
@@ -292,7 +298,7 @@ export class GroupClient {
292298
}
293299
}
294300
/** Register a group IP with a group reward pool and attach license terms to the group IP.
295-
* @see {@link https://github.com/storyprotocol/protocol-core-v1/blob/main/contracts/interfaces/modules/grouping/IGroupingModule.sol | IGroupingModule}
301+
* @see {@link https://github.com/storyprotocol/protocol-core-v1/blob/v1.3.1/contracts/interfaces/modules/grouping/IGroupingModule.sol#L14 | IGroupingModule}
296302
* for a list of on-chain events emitted when a group IP is registered, license terms are attached to a group IP .
297303
*/
298304
public async registerGroupAndAttachLicense(
@@ -324,7 +330,7 @@ export class GroupClient {
324330
}
325331
}
326332
/** Register a group IP with a group reward pool, attach license terms to the group IP, and add individual IPs to the group IP.
327-
* @see {@link https://github.com/storyprotocol/protocol-core-v1/blob/main/contracts/interfaces/modules/grouping/IGroupingModule.sol | IGroupingModule}
333+
* @see {@link https://github.com/storyprotocol/protocol-core-v1/blob/v1.3.1/contracts/interfaces/modules/grouping/IGroupingModule.sol#L14 | IGroupingModule}
328334
* for a list of on-chain events emitted when a group IP is registered, license terms are attached to a group IP, and individual IPs are added to a group.
329335
*/
330336
public async registerGroupAndAttachLicenseAndAddIps(

0 commit comments

Comments
 (0)