diff --git a/packages/core-sdk/package.json b/packages/core-sdk/package.json index b6a8f143..7fe5aa74 100644 --- a/packages/core-sdk/package.json +++ b/packages/core-sdk/package.json @@ -1,6 +1,6 @@ { "name": "@story-protocol/core-sdk", - "version": "1.0.0-rc.21", + "version": "1.0.0-rc.22", "description": "Story Protocol Core SDK", "main": "dist/story-protocol-core-sdk.cjs.js", "module": "dist/story-protocol-core-sdk.esm.js", diff --git a/packages/core-sdk/src/index.ts b/packages/core-sdk/src/index.ts index c759f5ac..cc07c082 100644 --- a/packages/core-sdk/src/index.ts +++ b/packages/core-sdk/src/index.ts @@ -25,8 +25,16 @@ export type { RegisterIpAndAttachPilTermsRequest, RegisterIpAndAttachPilTermsResponse, MintAndRegisterIpAndMakeDerivativeRequest, + GenerateCreatorMetadataParam, IpCreator, + GenerateIpMetadataParam, IpMetadata, + IpRelationship, + IpAttribute, + IpCreatorSocial, + IpMedia, + IPRobotTerms, + StoryProtocolApp, } from "./types/resources/ipAsset"; export type { diff --git a/packages/core-sdk/src/resources/dispute.ts b/packages/core-sdk/src/resources/dispute.ts index 8eddf5d2..fe2b1786 100644 --- a/packages/core-sdk/src/resources/dispute.ts +++ b/packages/core-sdk/src/resources/dispute.ts @@ -29,7 +29,7 @@ export class DisputeClient { * @param request.linkToDisputeEvidence - The link to the dispute evidence. * @param request.targetTag - The target tag of the dispute. * @param request.calldata - Optional calldata to initialize the policy. - * @param request.txOptions - Optional transaction options. + * @param request.txOptions - [Optional] transaction. This extends `WaitForTransactionReceiptParameters` from the Viem library, excluding the `hash` property. * @returns A Promise that resolves to a RaiseDisputeResponse containing the transaction hash. * @throws `NotRegisteredIpId` if targetIpId is not registered in the IPA Registry. * @throws `NotWhitelistedDisputeTag` if targetTag is not whitelisted. @@ -52,7 +52,10 @@ export class DisputeClient { const txHash = await this.disputeModuleClient.raiseDispute(req); if (request.txOptions?.waitForTransaction) { - const txReceipt = await this.rpcClient.waitForTransactionReceipt({ hash: txHash }); + const txReceipt = await this.rpcClient.waitForTransactionReceipt({ + ...request.txOptions, + hash: txHash, + }); const targetLogs = this.disputeModuleClient.parseTxDisputeRaisedEvent(txReceipt); return { txHash: txHash, @@ -71,6 +74,7 @@ export class DisputeClient { * @param request - The request object containing details to cancel the dispute. * @param request.disputeId The ID of the dispute to be cancelled. * @param request.calldata Optional additional data used in the cancellation process. + * @param request.txOptions - [Optional] transaction. This extends `WaitForTransactionReceiptParameters` from the Viem library, excluding the `hash` property. * @returns A Promise that resolves to a CancelDisputeResponse containing the transaction hash. * @throws NotInDisputeState, if the currentTag of the Dispute is not being disputed * @throws NotDisputeInitiator, if the transaction executor is not the one that initiated the dispute @@ -90,7 +94,10 @@ export class DisputeClient { const txHash = await this.disputeModuleClient.cancelDispute(req); if (request.txOptions?.waitForTransaction) { - await this.rpcClient.waitForTransactionReceipt({ hash: txHash }); + await this.rpcClient.waitForTransactionReceipt({ + ...request.txOptions, + hash: txHash, + }); } return { txHash: txHash }; @@ -105,6 +112,7 @@ export class DisputeClient { * @param request - The request object containing details to resolve the dispute. * @param request.disputeId The ID of the dispute to be resolved. * @param request.data The data to resolve the dispute. + * @param request.txOptions - [Optional] transaction. This extends `WaitForTransactionReceiptParameters` from the Viem library, excluding the `hash` property. * @returns A Promise that resolves to a ResolveDisputeResponse. * @throws NotAbleToResolve, if currentTag is still in dispute (i.e still needs a judgement to be set) * @throws NotDisputeInitiator, if the transaction executor is not the one that initiated the dispute @@ -122,7 +130,10 @@ export class DisputeClient { } else { const txHash = await this.disputeModuleClient.resolveDispute(req); if (request.txOptions?.waitForTransaction) { - await this.rpcClient.waitForTransactionReceipt({ hash: txHash }); + await this.rpcClient.waitForTransactionReceipt({ + ...request.txOptions, + hash: txHash, + }); } return { txHash: txHash }; diff --git a/packages/core-sdk/src/resources/ipAccount.ts b/packages/core-sdk/src/resources/ipAccount.ts index 2d6344bb..189a4c3c 100644 --- a/packages/core-sdk/src/resources/ipAccount.ts +++ b/packages/core-sdk/src/resources/ipAccount.ts @@ -27,6 +27,7 @@ export class IPAccountClient { * @param request.value The amount of Ether to send. * @param request.accountAddress The ipId to send. * @param request.data The data to send along with the transaction. + * @param request.txOptions - [Optional] transaction. This extends `WaitForTransactionReceiptParameters` from the Viem library, excluding the `hash` property. * @returns Tx hash for the transaction. */ public async execute(request: IPAccountExecuteRequest): Promise { @@ -49,7 +50,10 @@ export class IPAccountClient { const txHash = await ipAccountClient.execute({ ...req, operation: 0 }); if (request.txOptions?.waitForTransaction) { - await this.rpcClient.waitForTransactionReceipt({ hash: txHash }); + await this.rpcClient.waitForTransactionReceipt({ + ...request.txOptions, + hash: txHash, + }); } return { txHash: txHash }; } @@ -67,6 +71,7 @@ export class IPAccountClient { * @param request.signer The signer of the transaction. * @param request.deadline The deadline of the transaction signature. * @param request.signature The signature of the transaction, EIP-712 encoded. + * @param request.txOptions - [Optional] transaction. This extends `WaitForTransactionReceiptParameters` from the Viem library, excluding the `hash` property. * @returns Tx hash for the transaction. */ public async executeWithSig( @@ -94,7 +99,10 @@ export class IPAccountClient { const txHash = await ipAccountClient.executeWithSig(req); if (request.txOptions?.waitForTransaction) { - await this.rpcClient.waitForTransactionReceipt({ hash: txHash }); + await this.rpcClient.waitForTransactionReceipt({ + ...request.txOptions, + hash: txHash, + }); } return { txHash: txHash }; } diff --git a/packages/core-sdk/src/resources/ipAsset.ts b/packages/core-sdk/src/resources/ipAsset.ts index cb2ceae4..1a561161 100644 --- a/packages/core-sdk/src/resources/ipAsset.ts +++ b/packages/core-sdk/src/resources/ipAsset.ts @@ -19,13 +19,10 @@ import { handleError } from "../utils/errors"; import { CreateIpAssetWithPilTermsRequest, CreateIpAssetWithPilTermsResponse, - IpAttribute, + GenerateCreatorMetadataParam, + GenerateIpMetadataParam, IpCreator, - IpCreatorSocial, - IpMedia, IpMetadata, - IpRelationship, - IPRobotTerms, MintAndRegisterIpAndMakeDerivativeRequest, RegisterDerivativeRequest, RegisterDerivativeResponse, @@ -37,7 +34,6 @@ import { RegisterIpAndMakeDerivativeResponse, RegisterIpResponse, RegisterRequest, - StoryProtocolApp, } from "../types/resources/ipAsset"; import { AccessControllerClient, @@ -101,27 +97,20 @@ export class IPAssetClient { * @param params.socialMedia [Optional] An array of social media profiles associated with the creator. * @param params.socialMedia[].platform The name of the social media platform. * @param params.socialMedia[].url The URL to the creator's profile on the platform. - * @param params.contributionPercent The percentage of contribution by the creator, must add up to 100. - * @param params.role [Optional] The role of the creator in relation to the IP. + * @param params.contributionPercent The percentage of contribution by the creator, must add up to 100. + * @param params.role [Optional] The role of the creator in relation to the IP. * @returns An `IpCreator` object containing the provided details. */ - public generateCreatorMetadata({ - name, - address, - description = "", - image = "", - socialMedia = [], - contributionPercent, - role = "", - }: { - name: string; - address: Address; - contributionPercent: number; - description?: string; - image?: string; - socialMedia?: IpCreatorSocial[]; - role?: string; - }): IpCreator { + public generateCreatorMetadata(param: GenerateCreatorMetadataParam): IpCreator { + const { + name, + address, + description = "", + image = "", + socialMedia = [], + contributionPercent, + role = "", + } = param; return { name, address, @@ -150,8 +139,8 @@ export class IPAssetClient { * @param params.creators[].description [Optional] A description of the creator. * @param params.creators[].image [Optional] The URL or path to an image representing the creator. * @param params.creators[].socialMedia [Optional] An array of social media profiles for the creator. - * @param params.creators[].socialMedia[].platform The social media platform name. - * @param params.creators[].socialMedia[].url The URL to the creator's profile. + * @param params.creators[].socialMedia[].platform The social media platform name. + * @param params.creators[].socialMedia[].url The URL to the creator's profile. * @param params.creators[].role [Optional] The role of the creator in relation to the IP. * @param params.creators[].contributionPercent The percentage of contribution by the creator. * @param params.media [Optional] An array of media related to the IP. @@ -172,35 +161,22 @@ export class IPAssetClient { * @param params.additionalProperties [Optional] Any additional key-value pairs to include in the metadata. * @returns An `IpMetadata` object containing the provided details and any additional properties. */ - public generateIpMetadata({ - title = "", - description = "", - ipType = "", - relationships = [], - createdAt = "", - watermarkImg = "", - creators = [], - media = [], - attributes = [], - app, - tags = [], - robotTerms, - ...additionalProperties - }: { - title?: string; - description?: string; - ipType?: string; - relationships?: IpRelationship[]; - createdAt?: string; - watermarkImg?: string; - creators?: IpCreator[]; - media?: IpMedia[]; - attributes?: IpAttribute[]; - app?: StoryProtocolApp; - tags?: string[]; - robotTerms?: IPRobotTerms; - additionalProperties?: { [key: string]: unknown }; - }): IpMetadata { + public generateIpMetadata(param: GenerateIpMetadataParam): IpMetadata { + const { + title = "", + description = "", + ipType = "", + relationships = [], + createdAt = "", + watermarkImg = "", + creators = [], + media = [], + attributes = [], + app, + tags = [], + robotTerms, + ...additionalProperties + } = param; return { title, description, @@ -229,7 +205,7 @@ export class IPAssetClient { * @param request.ipMetadata.nftMetadataURI [Optional] The URI of the metadata for the NFT. * @param request.ipMetadata.nftMetadataHash [Optional] The hash of the metadata for the IP NFT. * @param request.deadline [Optional] The deadline for the signature in milliseconds, default is 1000ms. - * @param request.txOptions [Optional] The transaction options. + * @param request.txOptions - [Optional] transaction. This extends `WaitForTransactionReceiptParameters` from the Viem library, excluding the `hash` property. * @returns A Promise that resolves to an object containing the transaction hash and optional IP ID if waitForTxn is set to true. * @emits IPRegistered (ipId, chainId, tokenContract, tokenId, resolverAddr, metadataProviderAddress, metadata) */ @@ -302,7 +278,10 @@ export class IPAssetClient { }); } if (request.txOptions?.waitForTransaction) { - const txReceipt = await this.rpcClient.waitForTransactionReceipt({ hash: txHash }); + const txReceipt = await this.rpcClient.waitForTransactionReceipt({ + ...request.txOptions, + hash: txHash, + }); const targetLogs = this.ipAssetRegistryClient.parseTxIpRegisteredEvent(txReceipt); return { txHash: txHash, ipId: targetLogs[0].ipId }; } else { @@ -324,7 +303,7 @@ export class IPAssetClient { * @param request.childIpId The derivative IP ID. * @param request.parentIpIds The parent IP IDs. * @param request.licenseTermsIds The IDs of the license terms that the parent IP supports. - * @param request.txOptions [Optional] The transaction options. + * @param request.txOptions - [Optional] transaction. This extends `WaitForTransactionReceiptParameters` from the Viem library, excluding the `hash` property. * @returns A Promise that resolves to an object containing the transaction hash. */ public async registerDerivative( @@ -375,7 +354,10 @@ export class IPAssetClient { } else { const txHash = await this.licensingModuleClient.registerDerivative(req); if (request.txOptions?.waitForTransaction) { - await this.rpcClient.waitForTransactionReceipt({ hash: txHash }); + await this.rpcClient.waitForTransactionReceipt({ + ...request.txOptions, + hash: txHash, + }); return { txHash }; } else { return { txHash }; @@ -394,7 +376,7 @@ export class IPAssetClient { * @param request - The request object that contains all data needed to register derivative license tokens. * @param request.childIpId The derivative IP ID. * @param request.licenseTokenIds The IDs of the license tokens. - * @param request.txOptions [Optional] The transaction options. + * @param request.txOptions - [Optional] transaction. This extends `WaitForTransactionReceiptParameters` from the Viem library, excluding the `hash` property. * @returns A Promise that resolves to an object containing the transaction hash. */ public async registerDerivativeWithLicenseTokens( @@ -426,7 +408,10 @@ export class IPAssetClient { } else { const txHash = await this.licensingModuleClient.registerDerivativeWithLicenseTokens(req); if (request.txOptions?.waitForTransaction) { - await this.rpcClient.waitForTransactionReceipt({ hash: txHash }); + await this.rpcClient.waitForTransactionReceipt({ + ...request.txOptions, + hash: txHash, + }); return { txHash: txHash }; } else { return { txHash: txHash }; @@ -451,7 +436,7 @@ export class IPAssetClient { * @param request.mintingFee [Optional] The fee to be paid when minting a license. * @param request.commercialRevShare [Optional] Percentage of revenue that must be shared with the licensor. * @param request.currency [Optional] The ERC20 token to be used to pay the minting fee. the token must be registered in story protocol. - * @param request.txOptions [Optional] The transaction options. + * @param request.txOptions - [Optional] transaction. This extends `WaitForTransactionReceiptParameters` from the Viem library, excluding the `hash` property. * @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. * @emits IPRegistered (ipId, chainId, tokenContract, tokenId, name, uri, registrationDate) * @emits LicenseTermsAttached (caller, ipId, licenseTemplate, licenseTermsId) @@ -488,7 +473,10 @@ export class IPAssetClient { } else { const txHash = await this.spgClient.mintAndRegisterIpAndAttachPilTerms(object); if (request.txOptions?.waitForTransaction) { - const txReceipt = await this.rpcClient.waitForTransactionReceipt({ hash: txHash }); + const txReceipt = await this.rpcClient.waitForTransactionReceipt({ + ...request.txOptions, + hash: txHash, + }); const iPRegisteredLog = this.ipAssetRegistryClient.parseTxIpRegisteredEvent(txReceipt)[0]; const licenseTermsId = await this.getLicenseTermsId(txReceipt); return { @@ -519,7 +507,7 @@ export class IPAssetClient { * @param request.mintingFee [Optional] The fee to be paid when minting a license. * @param request.commercialRevShare [Optional] Percentage of revenue that must be shared with the licensor. * @param request.currency [Optional] The ERC20 token to be used to pay the minting fee. the token must be registered in story protocol. - * @param request.txOptions [Optional] The transaction options. + * @param request.txOptions - [Optional] transaction. This extends `WaitForTransactionReceiptParameters` from the Viem library, excluding the `hash` property. * @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. * @emits LicenseTermsAttached (caller, ipId, licenseTemplate, licenseTermsId) */ @@ -613,7 +601,10 @@ export class IPAssetClient { } else { const txHash = await this.spgClient.registerIpAndAttachPilTerms(object); if (request.txOptions?.waitForTransaction) { - const txReceipt = await this.rpcClient.waitForTransactionReceipt({ hash: txHash }); + const txReceipt = await this.rpcClient.waitForTransactionReceipt({ + ...request.txOptions, + hash: txHash, + }); const ipRegisterEvent = this.ipAssetRegistryClient.parseTxIpRegisteredEvent(txReceipt); const licenseTermsId = await this.getLicenseTermsId(txReceipt); return { txHash, licenseTermsId: licenseTermsId, ipId: ipRegisterEvent[0].ipId }; @@ -639,7 +630,7 @@ export class IPAssetClient { * @param request.ipMetadata.nftMetadataURI [Optional] The URI of the metadata for the NFT. * @param request.ipMetadata.nftMetadataHash [Optional] The hash of the metadata for the IP NFT. * @param request.deadline [Optional] The deadline for the signature in milliseconds,default is 1000ms. - * @param request.txOptions [Optional] The transaction options. + * @param request.txOptions - [Optional] transaction. This extends `WaitForTransactionReceiptParameters` from the Viem library, excluding the `hash` property. * @returns A Promise that resolves to an object containing the transaction hash and optional IP ID if waitForTxn is set to true. * @emits IPRegistered (ipId, chainId, tokenContract, tokenId, name, uri, registrationDate) */ @@ -756,7 +747,10 @@ export class IPAssetClient { } else { const txHash = await this.spgClient.registerIpAndMakeDerivative(object); if (request.txOptions?.waitForTransaction) { - const receipt = await this.rpcClient.waitForTransactionReceipt({ hash: txHash }); + const receipt = await this.rpcClient.waitForTransactionReceipt({ + ...request.txOptions, + hash: txHash, + }); const log = this.ipAssetRegistryClient.parseTxIpRegisteredEvent(receipt)[0]; return { txHash, ipId: log.ipId }; } @@ -779,8 +773,9 @@ export class IPAssetClient { * @param request.ipMetadata.ipMetadataURI [Optional] The URI of the metadata for the IP. * @param request.ipMetadata.ipMetadataHash [Optional] The hash of the metadata for the IP. * @param request.ipMetadata.nftMetadataURI [Optional] The URI of the metadata for the NFT. - * @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. - * @param request.txOptions [Optional] The transaction options. + * @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. + * @param request.txOptions - [Optional] transaction. This extends `WaitForTransactionReceiptParameters` from the Viem library, excluding the `hash` property. * @returns A Promise that resolves to an object containing the transaction hash and optional IP ID if waitForTxn is set to true. * @emits IPRegistered (ipId, chainId, tokenContract, tokenId, name, uri, registrationDate) */ @@ -833,7 +828,10 @@ export class IPAssetClient { } else { const txHash = await this.spgClient.mintAndRegisterIpAndMakeDerivative(object); if (request.txOptions?.waitForTransaction) { - const receipt = await this.rpcClient.waitForTransactionReceipt({ hash: txHash }); + const receipt = await this.rpcClient.waitForTransactionReceipt({ + ...request.txOptions, + hash: txHash, + }); const log = this.ipAssetRegistryClient.parseTxIpRegisteredEvent(receipt)[0]; return { txHash, childIpId: log.ipId }; } @@ -889,6 +887,7 @@ export class IPAssetClient { ); return sigAttachState; } + private async getLicenseTermsId(txReceipt: TransactionReceipt): Promise { const licensingModuleLicenseTermsAttachedEvent = this.licensingModuleClient.parseTxLicenseTermsAttachedEvent(txReceipt); diff --git a/packages/core-sdk/src/resources/license.ts b/packages/core-sdk/src/resources/license.ts index 0e42ae97..f32b6bab 100644 --- a/packages/core-sdk/src/resources/license.ts +++ b/packages/core-sdk/src/resources/license.ts @@ -55,7 +55,7 @@ export class LicenseClient { /** * Convenient function to register a PIL non commercial social remix license to the registry * @param request - [Optional] The request object that contains all data needed to register a PIL non commercial social remix license. - * @param request.txOptions [Optional] The transaction options. + * @param request.txOptions - [Optional] transaction. This extends `WaitForTransactionReceiptParameters` from the Viem library, excluding the `hash` property. * @returns A Promise that resolves to an object containing the optional transaction hash and optional license terms Id. * @emits LicenseTermsRegistered (licenseTermsId, licenseTemplate, licenseTerms); */ @@ -79,7 +79,10 @@ export class LicenseClient { terms: licenseTerms, }); if (request?.txOptions?.waitForTransaction) { - const txReceipt = await this.rpcClient.waitForTransactionReceipt({ hash: txHash }); + const txReceipt = await this.rpcClient.waitForTransactionReceipt({ + ...request.txOptions, + hash: txHash, + }); const targetLogs = this.licenseTemplateClient.parseTxLicenseTermsRegisteredEvent(txReceipt); return { txHash: txHash, licenseTermsId: targetLogs[0].licenseTermsId }; @@ -96,7 +99,7 @@ export class LicenseClient { * @param request - The request object that contains all data needed to register a PIL commercial use license. * @param request.mintingFee The fee to be paid when minting a license. * @param request.currency The ERC20 token to be used to pay the minting fee and the token must be registered in story protocol. - * @param request.txOptions [Optional] The transaction options. + * @param request.txOptions - [Optional] transaction. This extends `WaitForTransactionReceiptParameters` from the Viem library, excluding the `hash` property. * @returns A Promise that resolves to an object containing the optional transaction hash and optional license terms Id. * @emits LicenseTermsRegistered (licenseTermsId, licenseTemplate, licenseTerms); */ @@ -124,7 +127,10 @@ export class LicenseClient { terms: licenseTerms, }); if (request.txOptions?.waitForTransaction) { - const txReceipt = await this.rpcClient.waitForTransactionReceipt({ hash: txHash }); + const txReceipt = await this.rpcClient.waitForTransactionReceipt({ + ...request.txOptions, + hash: txHash, + }); const targetLogs = this.licenseTemplateClient.parseTxLicenseTermsRegisteredEvent(txReceipt); return { txHash: txHash, licenseTermsId: targetLogs[0].licenseTermsId }; @@ -142,7 +148,7 @@ export class LicenseClient { * @param request.mintingFee The fee to be paid when minting a license. * @param request.commercialRevShare Percentage of revenue that must be shared with the licensor. * @param request.currency The ERC20 token to be used to pay the minting fee. the token must be registered in story protocol. - * @param request.txOptions [Optional] The transaction options. + * @param request.txOptions - [Optional] transaction. This extends `WaitForTransactionReceiptParameters` from the Viem library, excluding the `hash` property. * @returns A Promise that resolves to an object containing the optional transaction hash and optional license terms Id. * @emits LicenseTermsRegistered (licenseTermsId, licenseTemplate, licenseTerms); */ @@ -171,7 +177,10 @@ export class LicenseClient { terms: licenseTerms, }); if (request.txOptions?.waitForTransaction) { - const txReceipt = await this.rpcClient.waitForTransactionReceipt({ hash: txHash }); + const txReceipt = await this.rpcClient.waitForTransactionReceipt({ + ...request.txOptions, + hash: txHash, + }); const targetLogs = this.licenseTemplateClient.parseTxLicenseTermsRegisteredEvent(txReceipt); return { txHash: txHash, licenseTermsId: targetLogs[0].licenseTermsId }; @@ -190,7 +199,7 @@ export class LicenseClient { * @param request.ipId The address of the IP to which the license terms are attached. * @param request.licenseTemplate The address of the license template. * @param request.licenseTermsId The ID of the license terms. - * @param request.txOptions [Optional] The transaction options. + * @param request.txOptions - [Optional] transaction. This extends `WaitForTransactionReceiptParameters` from the Viem library, excluding the `hash` property. * @returns A Promise that resolves to an object containing the transaction hash. */ public async attachLicenseTerms( @@ -232,7 +241,10 @@ export class LicenseClient { } else { const txHash = await this.licensingModuleClient.attachLicenseTerms(req); if (request.txOptions?.waitForTransaction) { - await this.rpcClient.waitForTransactionReceipt({ hash: txHash }); + await this.rpcClient.waitForTransactionReceipt({ + ...request.txOptions, + hash: txHash, + }); return { txHash: txHash, success: true }; } else { return { txHash: txHash }; @@ -261,7 +273,7 @@ export class LicenseClient { * @param request.licenseTermsId The ID of the license terms within the license template. * @param request.amount The amount of license tokens to mint. * @param request.receiver The address of the receiver. - * @param request.txOptions [Optional] The transaction options. + * @param request.txOptions - [Optional] transaction. This extends `WaitForTransactionReceiptParameters` from the Viem library, excluding the `hash` property. * @returns A Promise that resolves to an object containing the transaction hash and optional license token IDs if waitForTxn is set to true. * @emits LicenseTokensMinted (msg.sender, licensorIpId, licenseTemplate, licenseTermsId, amount, receiver, startLicenseTokenId); */ @@ -312,7 +324,10 @@ export class LicenseClient { } else { const txHash = await this.licensingModuleClient.mintLicenseTokens(req); if (request.txOptions?.waitForTransaction) { - const txReceipt = await this.rpcClient.waitForTransactionReceipt({ hash: txHash }); + const txReceipt = await this.rpcClient.waitForTransactionReceipt({ + ...request.txOptions, + hash: txHash, + }); const targetLogs = this.licensingModuleClient.parseTxLicenseTokensMintedEvent(txReceipt); const startLicenseTokenId = targetLogs[0].startLicenseTokenId; const licenseTokenIds = []; diff --git a/packages/core-sdk/src/resources/nftClient.ts b/packages/core-sdk/src/resources/nftClient.ts index d7d468f3..0d18a813 100644 --- a/packages/core-sdk/src/resources/nftClient.ts +++ b/packages/core-sdk/src/resources/nftClient.ts @@ -28,7 +28,7 @@ export class NftClient { * @param request.mintFee - The cost to mint a token. * @param request.mintFeeToken - The token to mint. * @param request.owner - The owner of the collection. - * @param request.txOptions - Optional transaction options. + * @param request.txOptions - [Optional] transaction. This extends `WaitForTransactionReceiptParameters` from the Viem library, excluding the `hash` property. * @returns A Promise that resolves to a CreateNFTCollectionResponse containing the transaction hash and collection address. * @emits CollectionCreated (nftContract); */ @@ -59,7 +59,10 @@ export class NftClient { } else { const txHash = await this.spgClient.createCollection(req); if (request.txOptions?.waitForTransaction) { - const txReceipt = await this.rpcClient.waitForTransactionReceipt({ hash: txHash }); + const txReceipt = await this.rpcClient.waitForTransactionReceipt({ + ...request.txOptions, + hash: txHash, + }); const targetLogs = this.spgClient.parseTxCollectionCreatedEvent(txReceipt); return { txHash: txHash, diff --git a/packages/core-sdk/src/resources/permission.ts b/packages/core-sdk/src/resources/permission.ts index 16f75ec1..c79b61d4 100644 --- a/packages/core-sdk/src/resources/permission.ts +++ b/packages/core-sdk/src/resources/permission.ts @@ -58,7 +58,7 @@ export class PermissionClient { * @param request.to The address that can be called by the `signer` (currently only modules can be `to`). * @param request.permission The new permission level. * @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. - * @param request.txOptions [Optional] The transaction options. + * @param request.txOptions - [Optional] transaction. This extends `WaitForTransactionReceiptParameters` from the Viem library, excluding the `hash` property. * @returns A Promise that resolves to an object containing the transaction hash. * @emits PermissionSet (ipAccountOwner, ipAccount, signer, to, func, permission) */ @@ -79,7 +79,10 @@ export class PermissionClient { } else { const txHash = await this.accessControllerClient.setPermission(req); if (request.txOptions?.waitForTransaction) { - await this.rpcClient.waitForTransactionReceipt({ hash: txHash }); + await this.rpcClient.waitForTransactionReceipt({ + ...request.txOptions, + hash: txHash, + }); return { txHash: txHash, success: true }; } else { return { txHash: txHash }; @@ -98,7 +101,7 @@ export class PermissionClient { * @param request.permission The new permission level. * @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. * @param request.deadline [Optional] The deadline for the signature in milliseconds, default is 1000ms. - * @param request.txOptions [Optional] The transaction options. + * @param request.txOptions - [Optional] transaction. This extends `WaitForTransactionReceiptParameters` from the Viem library, excluding the `hash` property. * @returns A Promise that resolves to an object containing the transaction hash. * @emits PermissionSet (ipAccountOwner, ipAccount, signer, to, func, permission) */ @@ -151,9 +154,11 @@ export class PermissionClient { return { encodedTxData: ipAccountClient.executeWithSigEncode(req) }; } else { const txHash = await ipAccountClient.executeWithSig(req); - - if (txOptions?.waitForTransaction) { - await this.rpcClient.waitForTransactionReceipt({ hash: txHash }); + if (request.txOptions?.waitForTransaction) { + await this.rpcClient.waitForTransactionReceipt({ + ...txOptions, + hash: txHash, + }); return { txHash: txHash, success: true }; } else { return { txHash: txHash }; @@ -169,7 +174,7 @@ export class PermissionClient { * @param request.ipId The IP ID that grants the permission for `signer` * @param request.signer The address of the signer receiving the permissions. * @param request.permission The new permission. - * @param request.txOptions [Optional] The transaction options. + * @param request.txOptions - [Optional] transaction. This extends `WaitForTransactionReceiptParameters` from the Viem library, excluding the `hash` property. * @returns A Promise that resolves to an object containing the transaction hash * @emits PermissionSet (ipAccountOwner, ipAccount, signer, to, func, permission) */ @@ -188,7 +193,10 @@ export class PermissionClient { } else { const txHash = await this.accessControllerClient.setAllPermissions(req); if (request.txOptions?.waitForTransaction) { - await this.rpcClient.waitForTransactionReceipt({ hash: txHash }); + await this.rpcClient.waitForTransactionReceipt({ + ...request.txOptions, + hash: txHash, + }); return { txHash: txHash, success: true }; } else { return { txHash: txHash }; @@ -208,7 +216,7 @@ export class PermissionClient { * @param request.permissions[].permission The new permission level. * @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. * @param request.deadline [Optional] The deadline for the signature in milliseconds, default is 1000ms. - * @param request.txOptions [Optional] The transaction options. + * @param request.txOptions - [Optional] transaction. This extends `WaitForTransactionReceiptParameters` from the Viem library, excluding the `hash` property. * @returns A Promise that resolves to an object containing the transaction hash * @emits PermissionSet (ipAccountOwner, ipAccount, signer, to, func, permission) */ @@ -233,8 +241,11 @@ export class PermissionClient { return { encodedTxData: this.accessControllerClient.setBatchPermissionsEncode(req) }; } else { const txHash = await this.accessControllerClient.setBatchPermissions(req); - if (txOptions?.waitForTransaction) { - await this.rpcClient.waitForTransactionReceipt({ hash: txHash }); + if (request.txOptions?.waitForTransaction) { + await this.rpcClient.waitForTransactionReceipt({ + ...txOptions, + hash: txHash, + }); return { txHash: txHash, success: true }; } else { return { txHash: txHash }; @@ -254,7 +265,7 @@ export class PermissionClient { * @param request.permissions[].to The address that can be called by the `signer` (currently only modules can be `to`). * @param request.permissions[].permission The new permission level. * @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. - * @param request.txOptions [Optional] The transaction options. + * @param request.txOptions - [Optional] transaction. This extends `WaitForTransactionReceiptParameters` from the Viem library, excluding the `hash` property. * @returns A Promise that resolves to an object containing the transaction hash. * @emits PermissionSet (ipAccountOwner, ipAccount, signer, to, func, permission) */ @@ -303,8 +314,11 @@ export class PermissionClient { return { encodedTxData: ipAccountClient.executeWithSigEncode(req) }; } else { const txHash = await ipAccountClient.executeWithSig(req); - if (txOptions?.waitForTransaction) { - await this.rpcClient.waitForTransactionReceipt({ hash: txHash }); + if (request.txOptions?.waitForTransaction) { + await this.rpcClient.waitForTransactionReceipt({ + ...txOptions, + hash: txHash, + }); return { txHash: txHash, success: true }; } else { return { txHash: txHash }; diff --git a/packages/core-sdk/src/resources/royalty.ts b/packages/core-sdk/src/resources/royalty.ts index 475a85f4..abe7a736 100644 --- a/packages/core-sdk/src/resources/royalty.ts +++ b/packages/core-sdk/src/resources/royalty.ts @@ -46,7 +46,7 @@ export class RoyaltyClient { * @param request - The request object that contains all data needed to collect royalty tokens. * @param request.parentIpId The ip id of the ancestor to whom the royalty tokens belong to. * @param request.royaltyVaultIpId The id of the royalty vault. - * @param request.txOptions [Optional] The transaction options. + * @param request.txOptions - [Optional] transaction. This extends `WaitForTransactionReceiptParameters` from the Viem library, excluding the `hash` property. * @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. * @emits RoyaltyTokensCollected (ancestorIpId, royaltyTokensCollected) */ @@ -76,7 +76,10 @@ export class RoyaltyClient { } else { const txHash = await ipRoyaltyVault.collectRoyaltyTokens(req); if (request.txOptions?.waitForTransaction) { - const txReceipt = await this.rpcClient.waitForTransactionReceipt({ hash: txHash }); + const txReceipt = await this.rpcClient.waitForTransactionReceipt({ + ...request.txOptions, + hash: txHash, + }); const targetLogs = ipRoyaltyVault.parseTxRoyaltyTokensCollectedEvent(txReceipt); return { txHash: txHash, @@ -98,7 +101,7 @@ export class RoyaltyClient { * @param request.payerIpId The ID of the IP asset that pays the royalties. * @param request.token The token to use to pay the royalties. * @param request.amount The amount to pay. - * @param request.txOptions [Optional] The transaction options. + * @param request.txOptions - [Optional] transaction. This extends `WaitForTransactionReceiptParameters` from the Viem library, excluding the `hash` property. * @returns A Promise that resolves to an object containing the transaction hash. */ public async payRoyaltyOnBehalf( @@ -128,7 +131,10 @@ export class RoyaltyClient { } else { const txHash = await this.royaltyModuleClient.payRoyaltyOnBehalf(req); if (request.txOptions?.waitForTransaction) { - await this.rpcClient.waitForTransactionReceipt({ hash: txHash }); + await this.rpcClient.waitForTransactionReceipt({ + ...request.txOptions, + hash: txHash, + }); return { txHash }; } else { return { txHash }; @@ -146,7 +152,6 @@ export class RoyaltyClient { * @param request.account The address of the token holder. * @param request.snapshotId The snapshot id. * @param request.token The revenue token to claim. - * @param request.txOptions [Optional] The transaction options. * @returns A Promise that contains the amount of revenue token claimable */ public async claimableRevenue( @@ -178,7 +183,7 @@ export class RoyaltyClient { * @param request.royaltyVaultIpId The id of the royalty vault. * @param request.token The revenue token to claim. * @param request.account [Optional] The ipId to send. - * @param request.txOptions [Optional] The transaction options. + * @param request.txOptions - [Optional] transaction. This extends `WaitForTransactionReceiptParameters` from the Viem library, excluding the `hash` property. * @returns A Promise that resolves to an object containing the transaction hash and optional claimableToken if waitForTxn is set to true. * @emits RevenueTokenClaimed (claimer, token, amount). */ @@ -223,6 +228,7 @@ export class RoyaltyClient { } if (request.txOptions?.waitForTransaction) { const txReceipt = await this.rpcClient.waitForTransactionReceipt({ + ...request.txOptions, hash: txHash, }); const targetLogs = ipRoyaltyVault.parseTxRevenueTokenClaimedEvent(txReceipt); @@ -238,7 +244,7 @@ export class RoyaltyClient { * Snapshots the claimable revenue and royalty token amounts. * @param request - The request object that contains all data needed to snapshot. * @param request.royaltyVaultIpId The id of the royalty vault. - * @param request.txOptions [Optional] The transaction options. + * @param request.txOptions - [Optional] transaction. This extends `WaitForTransactionReceiptParameters` from the Viem library, excluding the `hash` property. * @returns A Promise that resolves to an object containing the transaction hash and optional snapshotId if waitForTxn is set to true. * @emits SnapshotCompleted (snapshotId, snapshotTimestamp, unclaimedTokens). */ @@ -257,7 +263,10 @@ export class RoyaltyClient { } else { const txHash = await ipRoyaltyVault.snapshot(); if (request.txOptions?.waitForTransaction) { - const txReceipt = await this.rpcClient.waitForTransactionReceipt({ hash: txHash }); + const txReceipt = await this.rpcClient.waitForTransactionReceipt({ + ...request.txOptions, + hash: txHash, + }); const targetLogs = ipRoyaltyVault.parseTxSnapshotCompletedEvent(txReceipt); return { txHash, snapshotId: targetLogs[0].snapshotId }; } else { diff --git a/packages/core-sdk/src/types/options.ts b/packages/core-sdk/src/types/options.ts index 0ad22103..083a8d16 100644 --- a/packages/core-sdk/src/types/options.ts +++ b/packages/core-sdk/src/types/options.ts @@ -1,4 +1,6 @@ -export type TxOptions = { +import { WaitForTransactionReceiptParameters } from "viem"; + +export interface TxOptions extends Omit { // Whether or not to wait for the transaction so you // can receive a transaction receipt in return (which // contains data about the transaction and return values). @@ -7,14 +9,7 @@ export type TxOptions = { // not submit and execute, it will only encode the abi and // function data and return. encodedTxDataOnly?: boolean; - // The price (in wei) to pay per gas. - gasPrice?: bigint; - // Total fee per gas (in wei). - maxFeePerGas?: bigint; - // The number of confirmations (blocks that have passed) - // to wait before resolving. - numBlockConfirmations?: number; -}; +} export type WithTxOptions = T & { txOptions?: TxOptions; diff --git a/packages/core-sdk/src/types/resources/ipAsset.ts b/packages/core-sdk/src/types/resources/ipAsset.ts index 6b54f695..9acc7352 100644 --- a/packages/core-sdk/src/types/resources/ipAsset.ts +++ b/packages/core-sdk/src/types/resources/ipAsset.ts @@ -150,11 +150,35 @@ export type StoryProtocolApp = { action?: string; }; +export type GenerateCreatorMetadataParam = { + name: string; + address: Address; + contributionPercent: number; + description?: string; + image?: string; + socialMedia?: IpCreatorSocial[]; + role?: string; +}; export type IPRobotTerms = { userAgent: string; allow: string; }; +export type GenerateIpMetadataParam = { + title?: string; + description?: string; + ipType?: string; + relationships?: IpRelationship[]; + createdAt?: string; + watermarkImg?: string; + creators?: IpCreator[]; + media?: IpMedia[]; + attributes?: IpAttribute[]; + app?: StoryProtocolApp; + tags?: string[]; + robotTerms?: IPRobotTerms; + additionalProperties?: { [key: string]: unknown }; +}; export type IpMetadata = { title?: string; description?: string; diff --git a/packages/core-sdk/test/integration/ipAccount.test.ts b/packages/core-sdk/test/integration/ipAccount.test.ts index cc6377f8..dc0a758e 100644 --- a/packages/core-sdk/test/integration/ipAccount.test.ts +++ b/packages/core-sdk/test/integration/ipAccount.test.ts @@ -2,7 +2,7 @@ import chai from "chai"; import chaiAsPromised from "chai-as-promised"; import { AccessPermission, StoryClient } from "../../src"; import { mockERC721, getStoryClient, getTokenId, iliadChainId } from "./utils/util"; -import { Hex, encodeFunctionData, getAddress, toFunctionSelector, parseUnits } from "viem"; +import { Hex, encodeFunctionData, getAddress, toFunctionSelector } from "viem"; import { accessControllerAbi, accessControllerAddress, @@ -26,7 +26,6 @@ describe("Ip Account functions", () => { tokenId: tokenId!, txOptions: { waitForTransaction: true, - maxFeePerGas: parseUnits("100", 9), }, }); ipId = registerResult.ipId!; @@ -51,7 +50,6 @@ describe("Ip Account functions", () => { ipId: ipId, txOptions: { waitForTransaction: true, - maxFeePerGas: parseUnits("100", 9), }, }); expect(response.txHash).to.be.a("string").and.not.empty; diff --git a/packages/core-sdk/test/integration/ipAsset.test.ts b/packages/core-sdk/test/integration/ipAsset.test.ts index 72f6756f..f20d4aba 100644 --- a/packages/core-sdk/test/integration/ipAsset.test.ts +++ b/packages/core-sdk/test/integration/ipAsset.test.ts @@ -1,6 +1,6 @@ import chai from "chai"; import { StoryClient, PIL_TYPE } from "../../src"; -import { Hex, toHex, parseUnits } from "viem"; +import { Hex, toHex } from "viem"; import chaiAsPromised from "chai-as-promised"; import { mockERC721, getStoryClient, getTokenId, mintBySpg, iliadChainId } from "./utils/util"; import { MockERC20 } from "./utils/mockERC20"; @@ -23,7 +23,6 @@ describe("IP Asset Functions ", () => { const res = await client.license.registerNonComSocialRemixingPIL({ txOptions: { waitForTransaction: true, - maxFeePerGas: parseUnits("100", 9), }, }); noCommercialLicenseTermsId = res.licenseTermsId!; @@ -37,7 +36,6 @@ describe("IP Asset Functions ", () => { tokenId: tokenId!, txOptions: { waitForTransaction: waitForTransaction, - maxFeePerGas: parseUnits("100", 9), }, }), ).to.not.be.rejected; @@ -55,7 +53,6 @@ describe("IP Asset Functions ", () => { tokenId: tokenId!, txOptions: { waitForTransaction: true, - maxFeePerGas: parseUnits("100", 9), }, }) ).ipId!; @@ -64,7 +61,6 @@ describe("IP Asset Functions ", () => { licenseTermsId: noCommercialLicenseTermsId, txOptions: { waitForTransaction: true, - maxFeePerGas: parseUnits("100", 9), }, }); const response = await client.ipAsset.registerDerivative({ @@ -73,7 +69,6 @@ describe("IP Asset Functions ", () => { licenseTermsIds: [noCommercialLicenseTermsId], txOptions: { waitForTransaction: true, - maxFeePerGas: parseUnits("100", 9), }, }); expect(response.txHash).to.be.a("string").and.not.empty; @@ -87,7 +82,6 @@ describe("IP Asset Functions ", () => { tokenId: tokenId!, txOptions: { waitForTransaction: true, - maxFeePerGas: parseUnits("100", 9), }, }) ).ipId!; @@ -96,7 +90,6 @@ describe("IP Asset Functions ", () => { licensorIpId: parentIpId, txOptions: { waitForTransaction: true, - maxFeePerGas: parseUnits("100", 9), }, }); const response = await client.ipAsset.registerDerivativeWithLicenseTokens({ @@ -104,7 +97,6 @@ describe("IP Asset Functions ", () => { licenseTokenIds: [mintLicenseTokensResult.licenseTokenIds![0]], txOptions: { waitForTransaction: true, - maxFeePerGas: parseUnits("100", 9), }, }); expect(response.txHash).to.be.a("string").not.empty; @@ -123,7 +115,6 @@ describe("IP Asset Functions ", () => { maxSupply: 100, txOptions: { waitForTransaction: true, - maxFeePerGas: parseUnits("100", 9), }, }); expect(txData.nftContract).to.be.a("string").and.not.empty; @@ -138,7 +129,6 @@ describe("IP Asset Functions ", () => { currency: MockERC20.address, txOptions: { waitForTransaction: true, - maxFeePerGas: parseUnits("100", 9), }, }); parentIpId = result.ipId!; @@ -156,7 +146,7 @@ describe("IP Asset Functions ", () => { nftMetadataHash: toHex("test-nft-metadata-hash", { size: 32 }), nftMetadataURI: "test-nft-uri", }, - txOptions: { waitForTransaction: true, maxFeePerGas: parseUnits("100", 9) }, + txOptions: { waitForTransaction: true }, }); expect(result.txHash).to.be.a("string").and.not.empty; }); @@ -174,7 +164,6 @@ describe("IP Asset Functions ", () => { }, txOptions: { waitForTransaction: true, - maxFeePerGas: parseUnits("100", 9), }, }); expect(result.txHash).to.be.a("string").and.not.empty; @@ -194,7 +183,6 @@ describe("IP Asset Functions ", () => { }, txOptions: { waitForTransaction: true, - maxFeePerGas: parseUnits("100", 9), }, }); expect(result.txHash).to.be.a("string").and.not.empty; @@ -208,7 +196,6 @@ describe("IP Asset Functions ", () => { currency: MockERC20.address, txOptions: { waitForTransaction: true, - maxFeePerGas: parseUnits("100", 9), }, }); expect(result.txHash).to.be.a("string").and.not.empty; @@ -230,7 +217,6 @@ describe("IP Asset Functions ", () => { deadline: 1000n, txOptions: { waitForTransaction: true, - maxFeePerGas: parseUnits("100", 9), }, }); expect(response.ipId).to.be.a("string").and.not.empty; @@ -247,7 +233,6 @@ describe("IP Asset Functions ", () => { deadline: 1000n, txOptions: { waitForTransaction: true, - maxFeePerGas: parseUnits("100", 9), }, }); expect(result.txHash).to.be.a("string").and.not.empty; @@ -266,7 +251,6 @@ describe("IP Asset Functions ", () => { currency: MockERC20.address, txOptions: { waitForTransaction: true, - maxFeePerGas: parseUnits("100", 9), }, }); expect(result.txHash).to.be.a("string").and.not.empty; @@ -283,7 +267,6 @@ describe("IP Asset Functions ", () => { }, txOptions: { waitForTransaction: true, - maxFeePerGas: parseUnits("100", 9), }, }); expect(result.txHash).to.be.a("string").and.not.empty; diff --git a/packages/core-sdk/test/integration/royalty.test.ts b/packages/core-sdk/test/integration/royalty.test.ts index 3f1f0943..0101fae6 100644 --- a/packages/core-sdk/test/integration/royalty.test.ts +++ b/packages/core-sdk/test/integration/royalty.test.ts @@ -1,6 +1,6 @@ import chai from "chai"; import { StoryClient } from "../../src"; -import { Hex, encodeFunctionData, parseUnits } from "viem"; +import { Hex, encodeFunctionData } from "viem"; import chaiAsPromised from "chai-as-promised"; import { mockERC721, getTokenId, getStoryClient, iliadChainId } from "./utils/util"; import { MockERC20 } from "./utils/mockERC20"; @@ -25,7 +25,6 @@ describe("Test royalty Functions", () => { tokenId: tokenId!, txOptions: { waitForTransaction: true, - maxFeePerGas: parseUnits("100", 9), }, }); return response.ipId! as Hex; @@ -37,7 +36,6 @@ describe("Test royalty Functions", () => { commercialRevShare: 100, txOptions: { waitForTransaction: true, - maxFeePerGas: parseUnits("100", 9), }, }); return response.licenseTermsId!; @@ -49,7 +47,6 @@ describe("Test royalty Functions", () => { licenseTermsId: licenseTermsId, txOptions: { waitForTransaction: true, - maxFeePerGas: parseUnits("100", 9), }, }); }; @@ -69,7 +66,6 @@ describe("Test royalty Functions", () => { licenseTermsIds: [licenseTermsId], txOptions: { waitForTransaction: true, - maxFeePerGas: parseUnits("100", 9), }, }); }); @@ -80,7 +76,6 @@ describe("Test royalty Functions", () => { royaltyVaultIpId: ipId2, txOptions: { waitForTransaction: true, - maxFeePerGas: parseUnits("100", 9), }, }); expect(response.txHash).to.be.a("string").not.empty; @@ -95,7 +90,6 @@ describe("Test royalty Functions", () => { amount: "10", txOptions: { waitForTransaction: true, - maxFeePerGas: parseUnits("100", 9), }, }); expect(response.txHash).to.be.a("string").not.empty; @@ -106,7 +100,6 @@ describe("Test royalty Functions", () => { royaltyVaultIpId: ipId1, txOptions: { waitForTransaction: true, - maxFeePerGas: parseUnits("100", 9), }, }); expect(response.txHash).to.be.a("string").not.empty; @@ -131,7 +124,6 @@ describe("Test royalty Functions", () => { token: MockERC20.address, txOptions: { waitForTransaction: true, - maxFeePerGas: parseUnits("100", 9), }, }); expect(response.claimableToken).to.be.a("bigint"); @@ -146,7 +138,6 @@ describe("Test royalty Functions", () => { ipId: ipId1, txOptions: { waitForTransaction: true, - maxFeePerGas: parseUnits("100", 9), }, data: encodeFunctionData({ abi: [ @@ -187,12 +178,11 @@ describe("Test royalty Functions", () => { amount: "10", txOptions: { waitForTransaction: true, - maxFeePerGas: parseUnits("100", 9), }, }); const snapshotId = await client.royalty.snapshot({ royaltyVaultIpId: ipId1, - txOptions: { waitForTransaction: true, maxFeePerGas: parseUnits("100", 9) }, + txOptions: { waitForTransaction: true }, }); const response = await client.royalty.claimRevenue({ @@ -201,7 +191,6 @@ describe("Test royalty Functions", () => { token: MockERC20.address, txOptions: { waitForTransaction: true, - maxFeePerGas: parseUnits("100", 9), }, }); expect(response.claimableToken).to.be.a("bigint"); diff --git a/packages/core-sdk/test/unit/resources/ipAccount.test.ts b/packages/core-sdk/test/unit/resources/ipAccount.test.ts index caa21cd6..a74ffc50 100644 --- a/packages/core-sdk/test/unit/resources/ipAccount.test.ts +++ b/packages/core-sdk/test/unit/resources/ipAccount.test.ts @@ -33,7 +33,6 @@ describe("Test IPAccountClient", () => { data: "0x11111111111111111111111111111", txOptions: { waitForTransaction: true, - maxFeePerGas: parseUnits("100", 9), }, }; try { diff --git a/packages/core-sdk/test/unit/resources/ipAsset.test.ts b/packages/core-sdk/test/unit/resources/ipAsset.test.ts index d52c125c..d893adf7 100644 --- a/packages/core-sdk/test/unit/resources/ipAsset.test.ts +++ b/packages/core-sdk/test/unit/resources/ipAsset.test.ts @@ -214,7 +214,6 @@ describe("Test IpAssetClient", () => { }, txOptions: { waitForTransaction: waitForTransaction, - maxFeePerGas: parseUnits("100", 9), }, }); } catch (err) {