SDK v1.3 MIGRATION GUIDE
This is a migration guide to help you go from v1.2 -> v1.3 of the SDK.
Welcome to the v1.2 -> v1.3 SDK migration guide. Below, you can find the changes you must take to integrate with the v1.3 SDK.
Need 1-on-1 help?
Contact @jacobmtucker on Telegram.
client.ipAsset
registerDerivative
registerDerivative
This function now has 3 extra parameters:
maxMintingFee
: The maximum minting fee that the caller is willing to pay. If set to 0, then there is no no limit.- Recommended for simplicity:
0
- Recommended for simplicity:
maxRevenueShare
: The maximum revenue share percentage agreed upon between a child and parent when a child is registering as derivative. Must be between 0 and 100.- Recommended for simplicity:
100
- Recommended for simplicity:
maxRts
: The maximum number of royalty tokens that can be distributed to the external royalty policies. Must be between 0 and 100,000,000.- Recommended for simplicity:
100_000_000
- Recommended for simplicity:
Example:
const response = await client.ipAsset.registerDerivative({
childIpId: "0x1daAE3197Bc469Cb97B917aa460a12dD95c6627c",
parentIpIds: ["0xd142822Dc1674154EaF4DDF38bbF7EF8f0D8ECe4"],
licenseTermsIds: ["1"],
maxMintingFee: BigInt(0), // disabled
maxRts: 100_000_000, // default
maxRevenueShare: 100, // default
});
registerDerivativeWithLicenseTokens
registerDerivativeWithLicenseTokens
The function now has 1 extra parameter:
maxRts
: The maximum number of royalty tokens that can be distributed to the external royalty policies. Must be between 0 and 100,000,000.- Recommended for simplicity:
100_000_000
- Recommended for simplicity:
Example:
const response = await client.ipAsset.registerDerivativeWithLicenseTokens({
childIpId: "0xd142822Dc1674154EaF4DDF38bbF7EF8f0D8ECe4",
licenseTokenIds: ["1"],
maxRts: 100_000_000, // default
});
mintAndRegisterIpAssetWithPilTerms
mintAndRegisterIpAssetWithPilTerms
The function now has 1 extra parameter:
allowDuplicates
: Set to true to allow minting an NFT with a duplicatenftMetadataHash
.- Recommended for simplicity:
true
- Recommended for simplicity:
The function has also modified request.terms
to be request.licenseTermsData
, which now also takes a licenseConfig
as described here.
⚠️ This function will now fail if you do not provide any license terms. For that, just use mintAndRegisterIp
instead.
Example:
const licenseTerms: LicenseTerms = {
transferable: true,
royaltyPolicy: "0x1daAE3197Bc469Cb97B917aa460a12dD95c6627c",
defaultMintingFee: BigInt(1),
expiration: BigInt(0),
commercialUse: true,
commercialAttribution: false,
commercializerChecker: zeroAddress,
commercializerCheckerData: zeroAddress,
commercialRevShare: 0,
commercialRevCeiling: BigInt(0),
derivativesAllowed: true,
derivativesAttribution: true,
derivativesApproval: false,
derivativesReciprocal: true,
derivativeRevCeiling: BigInt(0),
currency: "0x1514000000000000000000000000000000000000", // $WIP
uri: "",
};
const licensingConfig: LicensingConfig = {
isSet: false,
mintingFee: BigInt(0),
licensingHook: zeroAddress,
hookData: zeroHash,
commercialRevShare: 0,
disabled: false,
expectMinimumGroupRewardShare: 0,
expectGroupRewardPool: zeroAddress,
};
const response = await client.ipAsset.mintAndRegisterIpAssetWithPilTerms({
spgNftContract: "0x",
licenseTermsData: [
{
terms: licenseTerms,
licensingConfig,
},
],
allowDuplicates: true,
ipMetadata: {
ipMetadataURI: "https://",
ipMetadataHash: toHex("metadata", { size: 32 }),
nftMetadataURI: "https://",
nftMetadataHash: toHex("nftMetadata", { size: 32 }),
},
});
registerIpAndAttachPilTerms
registerIpAndAttachPilTerms
The function has modified request.terms
to be request.licenseTermsData
, which now also takes a licenseConfig
as described here.
⚠️ This function will now fail if you do not provide any license terms. For that, just use register
instead.
Example:
const licenseTerms: LicenseTerms = {
transferable: true,
royaltyPolicy: "0x1daAE3197Bc469Cb97B917aa460a12dD95c6627c",
defaultMintingFee: BigInt(1),
expiration: BigInt(0),
commercialUse: true,
commercialAttribution: false,
commercializerChecker: zeroAddress,
commercializerCheckerData: zeroAddress,
commercialRevShare: 0,
commercialRevCeiling: BigInt(0),
derivativesAllowed: true,
derivativesAttribution: true,
derivativesApproval: false,
derivativesReciprocal: true,
derivativeRevCeiling: BigInt(0),
currency: "0x1514000000000000000000000000000000000000", // $WIP
uri: "",
};
const licensingConfig: LicensingConfig = {
isSet: false,
mintingFee: BigInt(0),
licensingHook: zeroAddress,
hookData: zeroHash,
commercialRevShare: 0,
disabled: false,
expectMinimumGroupRewardShare: 0,
expectGroupRewardPool: zeroAddress,
};
const response = await client.ipAsset.registerIpAndAttachPilTerms({
nftContract: "0x",
tokenId: "3",
ipMetadata: {
ipMetadataURI: "https://",
ipMetadataHash: toHex("metadata", { size: 32 }),
nftMetadataURI: "https://",
nftMetadataHash: toHex("nftMetadata", { size: 32 }),
},
licenseTermsData: [
{
terms: licenseTerms,
licensingConfig,
},
],
});
registerDerivativeIp
registerDerivativeIp
This function now has 3 extra parameters under derivative data:
maxMintingFee
: The maximum minting fee that the caller is willing to pay. If set to 0, then there is no no limit.- Recommended for simplicity:
0
- Recommended for simplicity:
maxRevenueShare
: The maximum revenue share percentage agreed upon between a child and parent when a child is registering as derivative. Must be between 0 and 100.- Recommended for simplicity:
100
- Recommended for simplicity:
maxRts
: The maximum number of royalty tokens that can be distributed to the external royalty policies. Must be between 0 and 100,000,000.- Recommended for simplicity:
100_000_000
- Recommended for simplicity:
Example:
const derivData: DerivativeData = {
parentIpIds: ["0xd142822Dc1674154EaF4DDF38bbF7EF8f0D8ECe4"],
licenseTermsIds: ["1"],
maxMintingFee: BitInt(0), // disabled
maxRts: 100_000_000, // default
maxRevenueShare: 100, // default
};
const response = await client.ipAsset.registerDerivativeIp({
nftContract: "0x",
tokenId: "3",
derivData,
ipMetadata: {
ipMetadataURI: "https://",
ipMetadataHash: toHex("metadata", { size: 32 }),
nftMetadataURI: "https://",
nftMetadataHash: toHex("nftMetadata", { size: 32 }),
},
})
mintAndRegisterIpAndMakeDerivative
mintAndRegisterIpAndMakeDerivative
The function now has 1 extra parameter:
allowDuplicates
: Set to true to allow minting an NFT with a duplicatenftMetadataHash
.- Recommended for simplicity:
true
- Recommended for simplicity:
This function also has 3 extra parameters under derivative data:
maxMintingFee
: The maximum minting fee that the caller is willing to pay. If set to 0, then there is no no limit.- Recommended for simplicity:
0
- Recommended for simplicity:
maxRevenueShare
: The maximum revenue share percentage agreed upon between a child and parent when a child is registering as derivative. Must be between 0 and 100.- Recommended for simplicity:
100
- Recommended for simplicity:
maxRts
: The maximum number of royalty tokens that can be distributed to the external royalty policies. Must be between 0 and 100,000,000.- Recommended for simplicity:
100_000_000
- Recommended for simplicity:
Example:
const derivData: DerivativeData = {
parentIpIds: ["0xd142822Dc1674154EaF4DDF38bbF7EF8f0D8ECe4"],
licenseTermsIds: ["1"],
maxMintingFee: BitInt(0), // disabled
maxRts: 100_000_000, // default
maxRevenueShare: 100, // default
};
const response = await client.ipAsset.mintAndRegisterIpAndMakeDerivative({
spgNftContract: "0x",
derivData,
allowDuplicates: true,
ipMetadata: {
ipMetadataURI: "https://",
ipMetadataHash: toHex("metadata", { size: 32 }),
nftMetadataURI: "https://",
nftMetadataHash: toHex("nftMetadata", { size: 32 }),
},
})
mintAndRegisterIp
mintAndRegisterIp
The function now has 1 extra parameter:
allowDuplicates
: Set to true to allow minting an NFT with a duplicatenftMetadataHash
.- Recommended for simplicity:
true
- Recommended for simplicity:
Example:
const response = await client.ipAsset.mintAndRegisterIp({
spgNftContract: "0x",
ipMetadata: {
ipMetadataURI: "https://",
ipMetadataHash: toHex("metadata", { size: 32 }),
nftMetadataURI: "https://",
nftMetadataHash: toHex("nftMetadata", { size: 32 }),
},
allowDuplicates: false,
})
registerPilTermsAndAttach
registerPilTermsAndAttach
The function has modified request.terms
to be request.licenseTermsData
, which now also takes a licenseConfig
as described here.
⚠️ This function will now fail if you do not provide any license terms. There is no reason you would be providing empty terms anyway.
Example:
const licenseTerms: LicenseTerms = {
transferable: true,
royaltyPolicy: "0x1daAE3197Bc469Cb97B917aa460a12dD95c6627c",
defaultMintingFee: BigInt(1),
expiration: BigInt(0),
commercialUse: true,
commercialAttribution: false,
commercializerChecker: zeroAddress,
commercializerCheckerData: zeroAddress,
commercialRevShare: 0,
commercialRevCeiling: BigInt(0),
derivativesAllowed: true,
derivativesAttribution: true,
derivativesApproval: false,
derivativesReciprocal: true,
derivativeRevCeiling: BigInt(0),
currency: "0x1514000000000000000000000000000000000000", // $WIP
uri: "",
};
const licensingConfig: LicensingConfig = {
isSet: false,
mintingFee: BigInt(0),
licensingHook: zeroAddress,
hookData: zeroHash,
commercialRevShare: 0,
disabled: false,
expectMinimumGroupRewardShare: 0,
expectGroupRewardPool: zeroAddress,
};
const response = await client.ipAsset.registerPilTermsAndAttach({
ipId: "0x",
licenseTermsData: [
{
terms: licenseTerms,
licensingConfig,
},
],
})
mintAndRegisterIpAndMakeDerivativeWithLicenseTokens
mintAndRegisterIpAndMakeDerivativeWithLicenseTokens
The function now has 2 extra parameters:
allowDuplicates
: Set to true to allow minting an NFT with a duplicatenftMetadataHash
.- Recommended for simplicity:
true
- Recommended for simplicity:
maxRts
: The maximum number of royalty tokens that can be distributed to the external royalty policies. Must be between 0 and 100,000,000.- Recommended for simplicity:
100_000_000
- Recommended for simplicity:
Example:
const response = await client.ipAsset.mintAndRegisterIpAndMakeDerivativeWithLicenseTokens({
spgNftContract: "0x",
licenseTokenIds: ["12"],
ipMetadata: {
ipMetadataURI: "",
ipMetadataHash: toHex(0, { size: 32 }),
nftMetadataHash: toHex("nftMetadata", { size: 32 }),
nftMetadataURI: "",
},
recipient: "0x73fcb515cee99e4991465ef586cfe2b072ebb512",
maxRts: 100_000_000,
allowDuplicates: true,
})
registerIpAndMakeDerivativeWithLicenseTokens
registerIpAndMakeDerivativeWithLicenseTokens
The function now has 1 extra parameter:
maxRts
: The maximum number of royalty tokens that can be distributed to the external royalty policies. Must be between 0 and 100,000,000.- Recommended for simplicity:
100_000_000
- Recommended for simplicity:
Example:
const response = await client.ipAsset.registerIpAndMakeDerivativeWithLicenseTokens({
nftContract: "0x",
maxRts: 100_000_000,
tokenId: "3",
licenseTokenIds: ["12"],
ipMetadata: {
ipMetadataURI: "",
ipMetadataHash: toHex(0, { size: 32 }),
nftMetadataHash: toHex("nftMetadata", { size: 32 }),
nftMetadataURI: "",
},
})
client.license
client.license
mintLicenseTokens
mintLicenseTokens
The function now has 2 extra parameters:
maxMintingFee
: The maximum minting fee that the caller is willing to pay. If set to 0, then there is no no limit.- Recommended for simplicity:
0
- Recommended for simplicity:
maxRevenueShare
: The maximum revenue share percentage agreed upon between a child and parent when a child is registering as derivative. Must be between 0 and 100.- Recommended for simplicity:
100_000_000
- Recommended for simplicity:
Example:
const response = await client.license.mintLicenseTokens({
licensorIpId: "0x",
licenseTermsId: "1",
maxMintingFee: BigInt(0),
maxRevenueShare: 100,
})
client.royalty
All of the following functions have been combined into claimAllRevenue
:
claimRevenue
snapshot
transferToVaultAndSnapshotAndClaimByTokenBatch
transferToVaultAndSnapshotAndClaimBySnapshotBatch
snapshotAndClaimByTokenBatch
snapshotAndClaimBySnapshotBatch
To learn how to use claimAllRevenue
in the SDK, see this page.
client.dispute
raiseDispute
raiseDispute
The function now has 2 extra parameters:
bond
: The bond size.liveness
: The liveness time.
The following parameters have been removed:
data
Example:
const response = await client.dispute.raiseDispute({
targetIpId: "0x1daAE3197Bc469Cb97B917aa460a12dD95c6627c",
cid: "QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR",
targetTag: "tag",
bond: 0,
liveness: 2592000,
})
Updated 6 days ago