Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add onlyEncodeTransactions support #223

Merged
merged 6 commits into from
Aug 1, 2024

Conversation

LuttyYang
Copy link
Contributor

@LuttyYang LuttyYang commented Jul 23, 2024

Summary by CodeRabbit

  • New Features

    • Introduced new methods for encoding transaction data for various smart contract functions, enhancing off-chain transaction preparation.
    • Added optional properties across multiple response types to include encoded transaction data and make transaction hashes optional.
  • Bug Fixes

    • Improved transaction handling in dispute and permission management by introducing clearer request structures and error handling.
  • Documentation

    • Updated type definitions to enhance clarity and flexibility in transaction responses, including optional fields for transaction hashes and encoded data.
  • Tests

    • Added comprehensive test cases for the ipAssetClient functionality to ensure accurate handling of encoded transaction data during IP asset registration.

Copy link

coderabbitai bot commented Jul 23, 2024

Walkthrough

This update enhances the SDK with new encoding methods for smart contract interactions, improving transaction management and developer flexibility. The ability to encode transaction data without immediate execution facilitates off-chain processing. Additionally, optional properties in response types increase adaptability for scenarios with missing transaction details. Overall, these improvements significantly enhance usability and functionality for developers working with smart contracts.

Changes

Files Change Summary
.../abi/generated.ts Added multiple encoding methods for contract function calls, enhancing transaction preparation flexibility without direct execution.
.../types/resources/*.ts Updated various response types to include optional properties and new encoded transaction fields, improving flexibility in handling transaction responses.
.../index.ts Introduced the EncodedTxData type, enhancing type safety in encoding operations.
.../sdk.ts Added generateContractDataFunction to facilitate encoding contract function calls, improving SDK functionality.
.../test/unit/resources/ipAsset.test.ts Introduced new test cases for ipAssetClient functionality, verifying encoded transaction data for IP asset registrations and derivatives.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant SDK
    participant SmartContract

    User->>SDK: Request to encode transaction
    SDK->>SmartContract: Prepare function data
    SmartContract-->>SDK: Return encoded transaction
    SDK-->>User: Provide encoded transaction
Loading

🐇 In a world of code, so bright and new,
I hop with joy, my heart is true.
Encoding transactions, what a delight,
Off-chain adventures, we'll take flight!
With every hop and every line,
The SDK shines, oh how divine! 🌟


Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Outside diff range, codebase verification and nitpick comments (2)
packages/core-sdk/src/resources/dispute.ts (1)

88-94: Ensure test coverage for cancelDisputeEncode.

While waitForTransactionReceipt has adequate test coverage, there are no tests found for cancelDisputeEncode. Please add tests to verify the correct handling of cancelDisputeEncode.

  • Add unit tests for cancelDisputeEncode in the appropriate test files.
Analysis chain

Ensure proper handling of cancelDisputeEncode and waitForTransactionReceipt.

The introduction of onlyEncodeTransactions and waitForTransaction options is well-implemented. Make sure that cancelDisputeEncode and waitForTransactionReceipt are correctly handled and tested.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of `cancelDisputeEncode` and `waitForTransactionReceipt`.

# Test: Search for the function usage. Expect: Correct handling of `cancelDisputeEncode` and `waitForTransactionReceipt`.
rg --type js -A 5 $'cancelDisputeEncode'
rg --type js -A 5 $'waitForTransactionReceipt'

Length of output: 85


Script:

#!/bin/bash
# Description: Verify the implementation and usage of `cancelDisputeEncode` and `waitForTransactionReceipt`.

# Search for the implementation of `cancelDisputeEncode` in TypeScript files
rg --type ts 'cancelDisputeEncode'

# Search for the implementation of `waitForTransactionReceipt` in TypeScript files
rg --type ts 'waitForTransactionReceipt'

# Search for the usage of `cancelDisputeEncode` in TypeScript files
rg --type ts 'cancelDisputeEncode('

# Search for the usage of `waitForTransactionReceipt` in TypeScript files
rg --type ts 'waitForTransactionReceipt('

Length of output: 5266


Script:

#!/bin/bash
# Description: Verify the implementation and usage of `cancelDisputeEncode` and `waitForTransactionReceipt`.

# Search for the implementation of `cancelDisputeEncode` in TypeScript files
rg --type ts 'cancelDisputeEncode'

# Search for the implementation of `waitForTransactionReceipt` in TypeScript files
rg --type ts 'waitForTransactionReceipt'

# Search for the usage of `cancelDisputeEncode` in TypeScript files
rg --type ts 'cancelDisputeEncode\('

# Search for the usage of `waitForTransactionReceipt` in TypeScript files
rg --type ts 'waitForTransactionReceipt\('

Length of output: 9054


Script:

#!/bin/bash
# Description: Verify the test coverage for `cancelDisputeEncode` and `waitForTransactionReceipt`.

# Search for tests related to `cancelDisputeEncode`
rg --type ts 'cancelDisputeEncode' --glob '**/*.test.ts'

# Search for tests related to `waitForTransactionReceipt`
rg --type ts 'waitForTransactionReceipt' --glob '**/*.test.ts'

Length of output: 948

packages/core-sdk/src/resources/ipAsset.ts (1)

152-168: Ensure proper error handling and logging.

While the changes are correct, consider adding logging for the transaction hash and other relevant information to aid in debugging and monitoring.

+ console.log(`Transaction hash: ${txHash}`);
Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 1097d88 and 4c7888e.

Files selected for processing (17)
  • packages/core-sdk/src/abi/generated.ts (69 hunks)
  • packages/core-sdk/src/resources/dispute.ts (3 hunks)
  • packages/core-sdk/src/resources/ipAccount.ts (2 hunks)
  • packages/core-sdk/src/resources/ipAsset.ts (6 hunks)
  • packages/core-sdk/src/resources/license.ts (6 hunks)
  • packages/core-sdk/src/resources/nftClient.ts (2 hunks)
  • packages/core-sdk/src/resources/permission.ts (5 hunks)
  • packages/core-sdk/src/resources/royalty.ts (4 hunks)
  • packages/core-sdk/src/types/options.ts (1 hunks)
  • packages/core-sdk/src/types/resources/dispute.ts (3 hunks)
  • packages/core-sdk/src/types/resources/ipAccount.ts (2 hunks)
  • packages/core-sdk/src/types/resources/ipAsset.ts (6 hunks)
  • packages/core-sdk/src/types/resources/license.ts (3 hunks)
  • packages/core-sdk/src/types/resources/nftClient.ts (1 hunks)
  • packages/core-sdk/src/types/resources/permission.ts (1 hunks)
  • packages/core-sdk/src/types/resources/royalty.ts (3 hunks)
  • packages/wagmi-generator/sdk.ts (2 hunks)
Additional comments not posted (81)
packages/core-sdk/src/types/resources/nftClient.ts (1)

15-19: Changes look good.

The changes to the CreateNFTCollectionResponse type are syntactically correct and align with the intended functionality of making txHash optional and adding encodedTx as an optional property.

packages/core-sdk/src/types/resources/ipAccount.ts (2)

14-15: Changes look good.

The changes to the IPAccountExecuteResponse type are syntactically correct and align with the intended functionality of making txHash optional and adding encodedTx as an optional property.


30-31: Changes look good.

The changes to the IPAccountExecuteWithSigResponse type are syntactically correct and align with the intended functionality of making txHash optional and adding encodedTx as an optional property.

packages/core-sdk/src/types/options.ts (1)

9-9: Changes look good.

The addition of the onlyEncodeTransactions optional property to the TxOptions type is syntactically correct and aligns with the intended functionality.

packages/core-sdk/src/types/resources/dispute.ts (3)

27-28: LGTM! But verify the usage of CancelDisputeResponse.

The changes to make txHash optional and add encodedTx are approved.

However, ensure that all usages of CancelDisputeResponse handle the optional properties correctly.


38-39: LGTM! But verify the usage of ResolveDisputeResponse.

The changes to make txHash optional and add encodedTx are approved.

However, ensure that all usages of ResolveDisputeResponse handle the optional properties correctly.

Verification successful

LGTM! The optional properties in ResolveDisputeResponse are handled correctly.

The usage of ResolveDisputeResponse in the codebase ensures that the optional properties txHash and encodedTx are managed appropriately. The conditional handling in dispute.ts and the return statements in useDispute.ts confirm that the changes are correctly integrated.

  • packages/react-sdk/src/resources/useDispute.ts
  • packages/core-sdk/src/resources/dispute.ts
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all usages of `ResolveDisputeResponse` handle the optional properties correctly.

# Test: Search for the type usage. Expect: Proper handling of optional properties.
rg --type typescript -A 5 $'ResolveDisputeResponse'

Length of output: 85


Script:

#!/bin/bash
# Description: Verify all usages of `ResolveDisputeResponse` handle the optional properties correctly.

# Test: Search for the type usage. Expect: Proper handling of optional properties.
rg --type ts -A 5 $'ResolveDisputeResponse'

Length of output: 4224


Script:

#!/bin/bash
# Description: Extract relevant code sections to verify the handling of optional properties in ResolveDisputeResponse.

# Extract code sections from useDispute.ts
rg --type ts -A 10 -B 5 'ResolveDisputeResponse' packages/react-sdk/src/resources/useDispute.ts

# Extract code sections from dispute.ts
rg --type ts -A 10 -B 5 'ResolveDisputeResponse' packages/core-sdk/src/resources/dispute.ts

Length of output: 3430


15-16: LGTM! But verify the usage of RaiseDisputeResponse.

The changes to make txHash optional and add encodedTx are approved.

However, ensure that all usages of RaiseDisputeResponse handle the optional properties correctly.

Verification successful

LGTM! The optional properties txHash and encodedTx in RaiseDisputeResponse are handled correctly.

The tests in dispute.test.ts verify the handling of these properties, and the direct return in useDispute.ts ensures flexibility for the caller to handle the response appropriately.

  • packages/core-sdk/test/unit/resources/dispute.test.ts
  • packages/react-sdk/src/resources/useDispute.ts
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all usages of `RaiseDisputeResponse` handle the optional properties correctly.

# Test: Search for the type usage. Expect: Proper handling of optional properties.
rg --type typescript -A 5 $'RaiseDisputeResponse'

Length of output: 83


Script:

#!/bin/bash
# Description: Verify all usages of `RaiseDisputeResponse` handle the optional properties correctly.

# Test: Search for the type usage. Expect: Proper handling of optional properties.
rg 'RaiseDisputeResponse' -t ts -A 5

Length of output: 6221


Script:

#!/bin/bash
# Extract relevant code snippets around the usage of `RaiseDisputeResponse` to verify handling of optional properties

# Extract code around usage in useDispute.ts
rg 'RaiseDisputeResponse' -A 10 packages/react-sdk/src/resources/useDispute.ts

# Extract code around usage in dispute.ts
rg 'RaiseDisputeResponse' -A 10 packages/core-sdk/src/resources/dispute.ts

Length of output: 3173


Script:

#!/bin/bash
# Search for further usage of the response from `raiseDispute` in `useDispute.ts` to verify handling of optional properties

# Extract code around usage of the response from `raiseDispute`
rg 'raiseDispute' -A 10 packages/react-sdk/src/resources/useDispute.ts

Length of output: 2099


Script:

#!/bin/bash
# Search for calls to `raiseDispute` in the codebase to verify handling of optional properties

# Extract code around calls to `raiseDispute`
rg 'raiseDispute' -t ts -A 10

Length of output: 18334

packages/core-sdk/src/types/resources/permission.ts (1)

15-16: LGTM! But verify the usage of SetPermissionsResponse.

The changes to make txHash optional and add encodedTx are approved.

However, ensure that all usages of SetPermissionsResponse handle the optional properties correctly.

Verification successful

LGTM! But verify the usage of SetPermissionsResponse.

The changes to make txHash optional and add encodedTx are approved.

However, ensure that all usages of SetPermissionsResponse handle the optional properties correctly. The verification confirms that the optional properties txHash and encodedTx are handled correctly in the identified methods.

  • packages/core-sdk/src/resources/permission.ts: Proper handling of txHash and encodedTx.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all usages of `SetPermissionsResponse` handle the optional properties correctly.

# Test: Search for the type usage. Expect: Proper handling of optional properties.
rg --type typescript -A 5 $'SetPermissionsResponse'

Length of output: 85


Script:

#!/bin/bash
# Description: Verify all usages of `SetPermissionsResponse` handle the optional properties correctly.

# Test: Search for the type usage. Expect: Proper handling of optional properties.
rg -A 5 'SetPermissionsResponse'

Length of output: 7673


Script:

#!/bin/bash
# Description: Verify handling of optional properties `txHash` and `encodedTx` in `SetPermissionsResponse`.

# Test: Search for `txHash` usage in the identified files.
rg 'txHash' packages/core-sdk/src/resources/permission.ts packages/react-sdk/src/resources/usePermission.ts

# Test: Search for `encodedTx` usage in the identified files.
rg 'encodedTx' packages/core-sdk/src/resources/permission.ts packages/react-sdk/src/resources/usePermission.ts

Length of output: 2974

packages/core-sdk/src/types/resources/royalty.ts (4)

31-32: LGTM! But verify the usage of CollectRoyaltyTokensResponse.

The changes to make txHash optional and add encodedTx are approved.

However, ensure that all usages of CollectRoyaltyTokensResponse handle the optional properties correctly.


86-87: LGTM! But verify the usage of SnapshotResponse.

The changes to make txHash optional and add encodedTx are approved.

However, ensure that all usages of SnapshotResponse handle the optional properties correctly.

Verification successful

Verified: The optional properties txHash and encodedTx in SnapshotResponse are handled correctly in the codebase.

  • In packages/react-sdk/src/resources/useRoyalty.ts, the snapshot function returns the response directly from client.royalty.snapshot(request), ensuring proper handling.
  • In packages/core-sdk/src/resources/royalty.ts, the snapshot method of the RoyaltyClient class includes logic to conditionally handle encodedTx and txHash based on request.txOptions.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all usages of `SnapshotResponse` handle the optional properties correctly.

# Test: Search for the type usage. Expect: Proper handling of optional properties.
rg --type typescript -A 5 $'SnapshotResponse'

Length of output: 79


Script:

#!/bin/bash
# Description: Verify all usages of `SnapshotResponse` handle the optional properties correctly.

# Test: Search for the type usage. Expect: Proper handling of optional properties.
rg 'SnapshotResponse' -t ts -A 5

Length of output: 3105


Script:

#!/bin/bash
# Description: Extract and review the context around the usage of `SnapshotResponse` in the identified files.

# Test: Search for the type usage and extract context. Expect: Proper handling of optional properties.
rg 'SnapshotResponse' -t ts -A 15 -B 5

Length of output: 10141


62-63: LGTM! But verify the usage of PayRoyaltyOnBehalfResponse.

The changes to make txHash optional and add encodedTx are approved.

However, ensure that all usages of PayRoyaltyOnBehalfResponse handle the optional properties correctly.

Verification successful

LGTM! The optional properties txHash and encodedTx are handled correctly in the codebase.

  • The optional properties are conditionally assigned based on the presence of txOptions in packages/core-sdk/src/resources/royalty.ts.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all usages of `PayRoyaltyOnBehalfResponse` handle the optional properties correctly.

# Test: Search for the type usage. Expect: Proper handling of optional properties.
rg --type typescript -A 5 $'PayRoyaltyOnBehalfResponse'

Length of output: 89


Script:

#!/bin/bash
# Description: Verify all usages of `PayRoyaltyOnBehalfResponse` handle the optional properties correctly.

# Test: Search for the type usage. Expect: Proper handling of optional properties.
rg --type-add 'ts:*.ts' -t ts -A 5 $'PayRoyaltyOnBehalfResponse'

Length of output: 3144


Script:

#!/bin/bash
# Description: Verify handling of optional properties in `PayRoyaltyOnBehalfResponse`.

# Extract more context around the usages in `useRoyalty.ts` and `royalty.ts`.
rg --type-add 'ts:*.ts' -t ts -A 10 -B 10 $'PayRoyaltyOnBehalfResponse' packages/react-sdk/src/resources/useRoyalty.ts packages/core-sdk/src/resources/royalty.ts

Length of output: 6816


Script:

#!/bin/bash
# Description: Verify handling of optional properties `txHash` and `encodedTx`.

# Search for references to `txHash` and `encodedTx` in the relevant files.
rg --type-add 'ts:*.ts' -t ts -A 5 -B 5 $'txHash' packages/react-sdk/src/resources/useRoyalty.ts packages/core-sdk/src/resources/royalty.ts
rg --type-add 'ts:*.ts' -t ts -A 5 -B 5 $'encodedTx' packages/react-sdk/src/resources/useRoyalty.ts packages/core-sdk/src/resources/royalty.ts

Length of output: 12510


80-81: LGTM! But verify the usage of ClaimRevenueResponse.

The changes to make txHash optional and add encodedTx are approved.

However, ensure that all usages of ClaimRevenueResponse handle the optional properties correctly.

packages/core-sdk/src/types/resources/license.ts (3)

43-43: LGTM! Addition of encodedTx enhances flexibility.

The addition of the optional encodedTx property in RegisterPILResponse aligns with the goal of improving flexibility for off-chain transaction handling.


67-68: LGTM! Enhancements improve response flexibility.

Making txHash optional and adding the optional encodedTx property in AttachLicenseTermsResponse enhances the flexibility of the response type.


84-84: LGTM! Addition of encodedTx standardizes responses.

The addition of the optional encodedTx property in MintLicenseTokensResponse standardizes the response format across different licensing operations.

packages/core-sdk/src/types/resources/ipAsset.ts (6)

16-16: LGTM! Addition of encodedTx enhances flexibility.

The addition of the optional encodedTx property in RegisterIpResponse aligns with the goal of improving flexibility for off-chain transaction handling.


34-35: LGTM! Enhancements improve response flexibility.

Making txHash optional and adding the optional encodedTx property in RegisterDerivativeWithLicenseTokensResponse enhances the flexibility of the response type.


48-48: LGTM! Addition of encodedTx enhances flexibility.

The addition of the optional encodedTx property in RegisterDerivativeResponse aligns with the goal of improving flexibility for off-chain transaction handling.


63-64: LGTM! Enhancements improve response flexibility.

Making txHash optional and adding the optional encodedTx property in CreateIpAssetWithPilTermsResponse enhances the flexibility of the response type.


83-84: LGTM! Enhancements improve response flexibility.

Making txHash optional and adding the optional encodedTx property in RegisterIpAndMakeDerivativeResponse enhances the flexibility of the response type.


100-101: LGTM! Enhancements improve response flexibility.

Making txHash optional and adding the optional encodedTx property in RegisterIpAndAttachPilTermsResponse enhances the flexibility of the response type.

packages/core-sdk/src/resources/nftClient.ts (3)

Line range hint 46-55:
LGTM! Construction of req object is clear and concise.

The construction of the req object encapsulates the request parameters effectively and includes default values where necessary.


57-59: LGTM! Conditional check for onlyEncodeTransactions is implemented correctly.

The conditional check for request.txOptions?.onlyEncodeTransactions ensures that the method returns an encoded transaction if this option is enabled.


60-70: LGTM! Handling of transaction hash and waiting for transaction receipt is well-implemented.

The method correctly handles the transaction hash and waits for the transaction receipt if request.txOptions?.waitForTransaction is true. The logic for parsing the logs and returning the transaction hash and NFT contract address is clear and concise.

packages/core-sdk/src/resources/ipAccount.ts (4)

43-47: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to execute match the new logic and handle the txOptions correctly.


85-93: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to executeWithSig match the new logic and handle the txOptions correctly.

Verification successful

Let's perform a more comprehensive search to verify all usages of the executeWithSig function in the codebase.


Let's perform a more comprehensive search to verify all usages of the executeWithSig function in the codebase by searching across all file types.


Function usage verified successfully.

The function executeWithSig is used correctly across the codebase, including in integration and unit tests, as well as in resource files. The new logic and handling of txOptions are consistent throughout the codebase.

  • packages/react-sdk/src/resources/useIpAccount.ts
  • packages/core-sdk/src/resources/permission.ts
  • packages/core-sdk/src/resources/ipAccount.ts
  • packages/core-sdk/test/integration/ipAccount.test.ts
  • packages/core-sdk/test/unit/resources/permission.test.ts
  • packages/core-sdk/test/unit/resources/ipAccount.test.ts
  • packages/core-sdk/src/abi/generated.ts
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `executeWithSig` match the new logic.

# Test: Search for the function usage. Expect: Only occurrences of the new logic.
rg --type js -A 5 $'executeWithSig'

Length of output: 34


Script:

#!/bin/bash
# Description: Verify all function calls to `executeWithSig` match the new logic.

# Search for the function definition and its usages in the codebase
ast-grep --lang typescript --pattern 'executeWithSig($_$)' 

Length of output: 60


Script:

#!/bin/bash
# Description: Verify all function calls to `executeWithSig` match the new logic.

# Search for the function definition and its usages in the codebase across all file types
rg 'executeWithSig'

Length of output: 4577


94-101: Ensure proper handling of executeWithSigEncode and waitForTransactionReceipt.

The introduction of onlyEncodeTransactions and waitForTransaction options is well-implemented. Make sure that executeWithSigEncode and waitForTransactionReceipt are correctly handled and tested.


49-56: Ensure proper handling of executeEncode and waitForTransactionReceipt.

The introduction of onlyEncodeTransactions and waitForTransaction options is well-implemented. Make sure that executeEncode and waitForTransactionReceipt are correctly handled and tested.

packages/core-sdk/src/resources/dispute.ts (5)

115-119: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to resolveDispute match the new logic and handle the txOptions correctly.


49-61: Ensure proper handling of raiseDisputeEncode and waitForTransactionReceipt.

The introduction of onlyEncodeTransactions and waitForTransaction options is well-implemented. Make sure that raiseDisputeEncode and waitForTransactionReceipt are correctly handled and tested.

Verification successful

Proper handling of raiseDisputeEncode and waitForTransactionReceipt confirmed.

The functions raiseDisputeEncode and waitForTransactionReceipt are correctly defined and used across multiple files. Their presence in test files indicates they are being tested.

  • Definition of raiseDisputeEncode: packages/core-sdk/src/abi/generated.ts
  • Usages of waitForTransactionReceipt: packages/core-sdk/src/resources/dispute.ts, packages/core-sdk/src/resources/ipAsset.ts, packages/core-sdk/src/resources/royalty.ts, packages/core-sdk/src/resources/license.ts, and others.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of `raiseDisputeEncode` and `waitForTransactionReceipt`.

# Test: Search for the function usage. Expect: Correct handling of `raiseDisputeEncode` and `waitForTransactionReceipt`.
rg --type js -A 5 $'raiseDisputeEncode'
rg --type js -A 5 $'waitForTransactionReceipt'

Length of output: 84


Script:

#!/bin/bash
# Description: Verify the usage and definition of `raiseDisputeEncode` and `waitForTransactionReceipt`.

# Search for the definition and usage of `raiseDisputeEncode` across all file types, including more context lines.
rg -A 10 'raiseDisputeEncode'

# Search for the definition and usage of `waitForTransactionReceipt` across all file types, including more context lines.
rg -A 10 'waitForTransactionReceipt'

Length of output: 31368


42-47: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to raiseDispute match the new logic and handle the txOptions correctly.


83-87: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to cancelDispute match the new logic and handle the txOptions correctly.


120-126: Ensure proper handling of resolveDisputeEncode and waitForTransactionReceipt.

The introduction of onlyEncodeTransactions and waitForTransaction options is well-implemented. Make sure that resolveDisputeEncode and waitForTransactionReceipt are correctly handled and tested.

Verification successful

The handling of resolveDisputeEncode and waitForTransactionReceipt is correct.

The functions resolveDisputeEncode and waitForTransactionReceipt are properly implemented and used in the codebase.

  • resolveDisputeEncode correctly encodes transaction data using the provided ABI and function name.
  • waitForTransactionReceipt is used to handle the transaction receipt and extract relevant logs.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of `resolveDisputeEncode` and `waitForTransactionReceipt`.

# Test: Search for the function usage. Expect: Correct handling of `resolveDisputeEncode` and `waitForTransactionReceipt`.
rg --type js -A 5 $'resolveDisputeEncode'
rg --type js -A 5 $'waitForTransactionReceipt'

Length of output: 86


Script:

#!/bin/bash
# Search for the definitions of `resolveDisputeEncode` and `waitForTransactionReceipt`.
rg 'resolveDisputeEncode' --type js -A 5
rg 'waitForTransactionReceipt' --type js -A 5

# Search for any usages of `resolveDisputeEncode` and `waitForTransactionReceipt` in the codebase.
rg 'resolveDisputeEncode' --type js
rg 'waitForTransactionReceipt' --type js

Length of output: 163


Script:

#!/bin/bash
# Search for the definitions of `resolveDisputeEncode` and `waitForTransactionReceipt` using ast-grep for more accurate results.
ast-grep --lang typescript --pattern 'function resolveDisputeEncode($_) { $$$ }'
ast-grep --lang typescript --pattern 'function waitForTransactionReceipt($_) { $$$ }'

# Search for any usages of `resolveDisputeEncode` and `waitForTransactionReceipt` in the codebase using rg with broader parameters.
rg 'resolveDisputeEncode'
rg 'waitForTransactionReceipt'

Length of output: 5145


Script:

#!/bin/bash
# Extract the implementation of `resolveDisputeEncode` from `generated.ts`.
rg 'resolveDisputeEncode' -A 10 packages/core-sdk/src/abi/generated.ts

# Extract the relevant sections of `dispute.ts` to review the usage of `waitForTransactionReceipt`.
rg 'waitForTransactionReceipt' -A 10 packages/core-sdk/src/resources/dispute.ts

Length of output: 1352

packages/core-sdk/src/resources/royalty.ts (4)

120-135: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to payRoyaltyOnBehalf match the new logic and handle the txOptions correctly.


71-87: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to collectRoyaltyTokens match the new logic and handle the txOptions correctly.

Verification successful

LGTM! But verify the function usage in the codebase.

The code changes are approved.

The function collectRoyaltyTokens is used across the codebase, and the new logic involving txOptions is correctly integrated and tested.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `collectRoyaltyTokens` match the new logic.

# Test: Search for the function usage. Expect: Only occurrences of the new logic.
rg --type js -A 5 $'collectRoyaltyTokens'

Length of output: 40


Script:

#!/bin/bash
# Description: Verify all function calls to `collectRoyaltyTokens` match the new logic.

# Test: Search for the function usage. Expect: Only occurrences of the new logic.
ast-grep --lang typescript --pattern 'collectRoyaltyTokens($_$)'

Length of output: 66


Script:

#!/bin/bash
# Description: Verify all function calls to `collectRoyaltyTokens` match the new logic.

# Test: Search for the function usage. Expect: Only occurrences of the new logic.
rg 'collectRoyaltyTokens' -A 5

Length of output: 16703


202-222: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to claimRevenue match the new logic and handle the txOptions correctly.


255-265: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to snapshot match the new logic and handle the txOptions correctly.

Verification successful

Let's re-verify the function usage by using ast-grep to search for calls to the snapshot function.


Let's search for the snapshot function definition and its export status to ensure it is being used correctly.


Let's expand our search to include method definitions within classes or objects.


Let's search for all instances of the term snapshot in the codebase to gather more context.


LGTM! But verify the function usage in the codebase.

The code changes are approved.

The snapshot function is defined and used correctly across the codebase, including in various test files that handle different txOptions.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `snapshot` match the new logic.

# Test: Search for the function usage. Expect: Only occurrences of the new logic.
rg --type js -A 5 $'snapshot'

Length of output: 28


Script:

#!/bin/bash
# Description: Verify all function calls to `snapshot` match the new logic.

# Test: Search for the function usage. Expect: Only occurrences of the new logic.
ast-grep --lang typescript --pattern '$_.$snapshot($_)'

Length of output: 57


Script:

#!/bin/bash
# Description: Verify the definition and export status of the `snapshot` function.

# Search for the `snapshot` function definition.
ast-grep --lang typescript --pattern 'function snapshot($_) { $$$ }'

# Search for the export status of the `snapshot` function.
ast-grep --lang typescript --pattern 'export function snapshot($_) { $$$ }'

Length of output: 148


Script:

#!/bin/bash
# Description: Verify the definition of the `snapshot` method within classes or objects.

# Search for the `snapshot` method definition within classes.
ast-grep --lang typescript --pattern 'class $_ { $$$ snapshot($_) { $$$ } $$$ }'

# Search for the `snapshot` method definition within objects.
ast-grep --lang typescript --pattern '$_ = { $$$ snapshot($_) { $$$ } $$$ }'

Length of output: 161


Script:

#!/bin/bash
# Description: Search for all instances of the term `snapshot` in the codebase to gather more context.

# Search for all instances of the term `snapshot`.
rg --type js --type ts -A 5 'snapshot'

Length of output: 44020

packages/core-sdk/src/resources/permission.ts (4)

141-159: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to createSetPermissionSignature match the new structure.


180-194: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to setAllPermissions match the new structure.

Verification successful

All function calls to setAllPermissions match the new structure.

The code changes are consistent and no further issues were found.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `setAllPermissions` match the new structure.

# Test: Search for the function usage. Expect: Only occurrences of the new structure.
rg --type js -A 5 $'setAllPermissions'

Length of output: 37


Script:

#!/bin/bash
# Description: Verify all function calls to `accessControllerClient.setAllPermissions` match the new structure.

# Test: Search for the function usage in both JavaScript and TypeScript files.
rg --type-add 'ts' --type-add 'tsx' -tjs -tts -ttsx -A 5 'accessControllerClient.setAllPermissions'

Length of output: 155


Script:

#!/bin/bash
# Description: Verify all function calls to `accessControllerClient.setAllPermissions` match the new structure.

# Test: Search for the function usage in both JavaScript and TypeScript files.
rg --type-add 'ts:*.ts' --type-add 'tsx:*.tsx' -tjs -tts -ttsx -A 5 'accessControllerClient.setAllPermissions'

Length of output: 897


222-240: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to setBatchPermissions match the new structure.

Verification successful

LGTM! But verify the function usage in the codebase.

The code changes are approved.

All function calls to setBatchPermissions match the new structure.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `setBatchPermissions` match the new structure.

# Test: Search for the function usage. Expect: Only occurrences of the new structure.
rg --type js -A 5 $'setBatchPermissions'

Length of output: 39


Script:

#!/bin/bash
# Description: Verify all function calls to `setBatchPermissions` match the new structure.

# Test: Search for the function usage in both JavaScript and TypeScript files.
rg --type-add 'ts:*.ts' --type-add 'tsx:*.tsx' --type-add 'js:*.js' -tjs -tts -ttsx -A 5 $'setBatchPermissions'

Length of output: 13374


68-86: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to setPermission match the new structure.

packages/core-sdk/src/resources/license.ts (5)

113-128: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to registerCommercialUsePIL match the new structure.

Verification successful

LGTM! All usages of registerCommercialUsePIL match the new structure.

The code changes are approved.

  • Verified function usage in:
    • packages/core-sdk/test/integration/license.test.ts
    • packages/core-sdk/test/unit/resources/license.test.ts
    • packages/react-sdk/test/integration/useRoyalty.test.ts
    • packages/react-sdk/src/resources/useLicense.ts
    • packages/react-sdk/test/integration/useLicense.test.ts
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `registerCommercialUsePIL` match the new structure.

# Test: Search for the function usage. Expect: Only occurrences of the new structure.
rg --type js -A 5 $'registerCommercialUsePIL'

Length of output: 44


Script:

#!/bin/bash
# Description: Verify all function calls to `registerCommercialUsePIL` match the new structure.

# Test: Search for the function usage across all file types.
rg -A 5 'registerCommercialUsePIL'

Length of output: 9979


Line range hint 293-318:
LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to mintLicenseTokens match the new structure.


70-85: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to registerNonComSocialRemixingPIL match the new structure.


218-232: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to attachLicenseTerms match the new structure.


158-173: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to registerCommercialRemixPIL match the new structure.

Verification successful

Let's first locate the definition of the registerCommercialRemixPIL function and then search for its usage.


The function registerCommercialRemixPIL is being used in multiple places, particularly in test files. Let's inspect these usages to ensure they match the new structure.


The function usage of registerCommercialRemixPIL matches the new structure.

The function registerCommercialRemixPIL is used in various test and source files, and the usages align with the new structure introduced in the code snippet. The function handles transaction options and error cases appropriately.

  • packages/core-sdk/test/unit/resources/license.test.ts
  • packages/core-sdk/test/integration/license.test.ts
  • packages/core-sdk/test/integration/royalty.test.ts
  • packages/react-sdk/test/integration/useLicense.test.ts
  • packages/react-sdk/src/resources/useLicense.ts
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `registerCommercialRemixPIL` match the new structure.

# Test: Search for the function usage. Expect: Only occurrences of the new structure.
rg --type js -A 5 $'registerCommercialRemixPIL'

Length of output: 46


Script:

#!/bin/bash
# Locate the definition of the `registerCommercialRemixPIL` function
ast-grep --lang typescript --pattern 'function registerCommercialRemixPIL($_) { $$$ }'

# Once located, search for its usage across the codebase
rg 'registerCommercialRemixPIL'

Length of output: 2956


Script:

#!/bin/bash
# Locate the definition of `registerCommercialRemixPIL` within classes or objects
ast-grep --lang typescript --pattern 'class $_ { $$$ registerCommercialRemixPIL($_) { $$$ } $$$ }'

# Verify the usage in the identified files to ensure they match the new structure
rg --type ts -A 5 'registerCommercialRemixPIL' packages/core-sdk/test/unit/resources/license.test.ts
rg --type ts -A 5 'registerCommercialRemixPIL' packages/core-sdk/test/integration/license.test.ts
rg --type ts -A 5 'registerCommercialRemixPIL' packages/core-sdk/test/integration/royalty.test.ts
rg --type ts -A 5 'registerCommercialRemixPIL' packages/react-sdk/test/integration/useLicense.test.ts
rg --type ts -A 5 'registerCommercialRemixPIL' packages/react-sdk/src/resources/useLicense.ts

Length of output: 4695

packages/wagmi-generator/sdk.ts (2)

242-277: LGTM! The new function is well-structured and documented.

The code changes are approved.


454-457: LGTM! The integration of the new function enhances the SDK's functionality.

The code changes are approved.

packages/core-sdk/src/resources/ipAsset.ts (6)

139-150: Add support for encoding transactions without executing them.

The changes correctly add support for encoding transactions without executing them by checking request.txOptions?.onlyEncodeTransactions. The logic is clear and maintains the original functionality.


224-240: Add support for encoding transactions without executing them.

The changes correctly add support for encoding transactions without executing them by checking request.txOptions?.onlyEncodeTransactions. The logic is clear and maintains the original functionality.


275-291: Add support for encoding transactions without executing them.

The changes correctly add support for encoding transactions without executing them by checking request.txOptions?.onlyEncodeTransactions. The logic is clear and maintains the original functionality.


354-371: Add support for encoding transactions without executing them.

The changes correctly add support for encoding transactions without executing them by checking request.txOptions?.onlyEncodeTransactions. The logic is clear and maintains the original functionality.


485-494: Add support for encoding transactions without executing them.

The changes correctly add support for encoding transactions without executing them by checking request.txOptions?.onlyEncodeTransactions. The logic is clear and maintains the original functionality.


631-640: Add support for encoding transactions without executing them.

The changes correctly add support for encoding transactions without executing them by checking request.txOptions?.onlyEncodeTransactions. The logic is clear and maintains the original functionality.

packages/core-sdk/src/abi/generated.ts (27)

15-15: Import statement looks good.

The import for encodeFunctionData is correct and necessary for the new encoding methods.


7578-7590: Method implementation looks good.

The setAllPermissionsEncode method correctly encodes the parameters for the setAllPermissions function.


7611-7623: Method implementation looks good.

The setBatchPermissionsEncode method correctly encodes the parameters for the setBatchPermissions function.


7643-7656: Method implementation looks good.

The setPermissionEncode method correctly encodes the parameters for the setPermission function.


8023-8035: Method implementation looks good.

The freezeMetadataEncode method correctly encodes the parameters for the freezeMetadata function.


8054-8066: Method implementation looks good.

The setAllEncode method correctly encodes the parameters for the setAll function.


8087-8099: Method implementation looks good.

The setMetadataUriEncode method correctly encodes the parameters for the setMetadataURI function.


8119-8132: Method implementation looks good.

The updateNftTokenUriEncode method correctly encodes the parameters for the updateNftTokenURI function.


8381-8393: Method implementation looks good.

The cancelDisputeEncode method correctly encodes the parameters for the cancelDispute function.


8414-8426: Method implementation looks good.

The raiseDisputeEncode method correctly encodes the parameters for the raiseDispute function.


8446-8459: Method implementation looks good.

The resolveDisputeEncode method correctly encodes the parameters for the resolveDispute function.


8553-8565: Method implementation looks good.

The executeEncode method correctly encodes the parameters for the execute function.


8592-8612: Method implementation looks good.

The executeWithSigEncode method correctly encodes the parameters for the executeWithSig function.


8857-8870: Method implementation looks good.

The registerEncode method correctly encodes the parameters for the register function.


9166-9180: Method implementation looks good.

The claimRevenueBySnapshotBatchEncode method correctly encodes the parameters for the claimRevenueBySnapshotBatch function.


9201-9215: Method implementation looks good.

The claimRevenueByTokenBatchEncode method correctly encodes the parameters for the claimRevenueByTokenBatch function.


9236-9248: Method implementation looks good.

The collectRoyaltyTokensEncode method correctly encodes the parameters for the collectRoyaltyTokens function.


9265-9277: Method implementation looks good.

The snapshotEncode method correctly encodes the parameters for the snapshot function.


10480-10492: Method implementation looks good.

The attachLicenseTermsToIpEncode method correctly encodes the parameters for the attachLicenseTermsToIp function.


10513-10525: Method implementation looks good.

The initializeEncode method correctly encodes the parameters for the initialize function.


10551-10568: Method implementation looks good.

The registerDerivativeIpEncode method correctly encodes the parameters for the registerDerivativeIp function.


10589-10603: Method implementation looks good.

The registerLicenseTemplateEncode method correctly encodes the parameters for the registerLicenseTemplate function.


10624-10636: Method implementation looks good.

The setAuthorityEncode method correctly encodes the parameters for the setAuthority function.


10657-10669: Method implementation looks good.

The setDefaultLicenseTermsEncode method correctly encodes the parameters for the setDefaultLicenseTerms function.


10690-10702: Method implementation looks good.

The setExpireTimeEncode method correctly encodes the parameters for the setExpireTime function.


10724-10737: Method implementation looks good.

The setLicensingConfigForIpEncode method correctly encodes the parameters for the setLicensingConfigForIp function.


10763-10782: Method implementation looks good.

The setLicensingConfigForLicenseEncode method correctly encodes the parameters for the setLicensingConfigForLicense function.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 4c7888e and 9db92e5.

Files selected for processing (9)
  • packages/core-sdk/src/abi/generated.ts (71 hunks)
  • packages/core-sdk/src/types/resources/dispute.ts (4 hunks)
  • packages/core-sdk/src/types/resources/ipAccount.ts (3 hunks)
  • packages/core-sdk/src/types/resources/ipAsset.ts (7 hunks)
  • packages/core-sdk/src/types/resources/license.ts (4 hunks)
  • packages/core-sdk/src/types/resources/nftClient.ts (2 hunks)
  • packages/core-sdk/src/types/resources/permission.ts (2 hunks)
  • packages/core-sdk/src/types/resources/royalty.ts (4 hunks)
  • packages/wagmi-generator/sdk.ts (3 hunks)
Additional comments not posted (56)
packages/core-sdk/src/types/resources/nftClient.ts (1)

16-20: LGTM! Ensure the new properties are utilized correctly.

The changes to make txHash optional and add encodedTx of type MethodEncode are approved.

However, ensure that the new properties are utilized correctly throughout the codebase.

packages/core-sdk/src/types/resources/ipAccount.ts (2)

31-32: LGTM! Ensure the new properties are utilized correctly.

The changes to make txHash optional and add encodedTx of type MethodEncode are approved.

However, ensure that the new properties are utilized correctly throughout the codebase.

Verification successful

The new properties txHash and encodedTx are utilized correctly.

The changes to make txHash optional and add encodedTx of type MethodEncode are consistent and correctly implemented in the codebase.

  • txHash is used and returned correctly in packages/core-sdk/src/resources/ipAccount.ts.
  • encodedTx is used and returned correctly in packages/core-sdk/src/resources/ipAccount.ts.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of the new properties in IPAccountExecuteWithSigResponse.

# Test: Search for the usage of IPAccountExecuteWithSigResponse. Expect: Correct usage of the new properties.
rg --type typescript -A 5 $'IPAccountExecuteWithSigResponse'

Length of output: 94


Script:

#!/bin/bash
# Description: Verify the usage of the new properties in IPAccountExecuteWithSigResponse.

# Test: Search for the usage of IPAccountExecuteWithSigResponse. Expect: Correct usage of the new properties.
rg --type ts -A 5 'IPAccountExecuteWithSigResponse'

Length of output: 3105


Script:

#!/bin/bash
# Description: Verify the usage of the new properties `txHash` and `encodedTx` in relevant files.

# Test: Search for the usage of `txHash` and `encodedTx`. Expect: Correct usage of the new properties.
rg --type ts 'txHash' packages/react-sdk/src/index.ts packages/core-sdk/src/types/resources/ipAccount.ts packages/core-sdk/src/index.ts packages/core-sdk/src/resources/ipAccount.ts packages/react-sdk/src/resources/useIpAccount.ts
rg --type ts 'encodedTx' packages/react-sdk/src/index.ts packages/core-sdk/src/types/resources/ipAccount.ts packages/core-sdk/src/index.ts packages/core-sdk/src/resources/ipAccount.ts packages/react-sdk/src/resources/useIpAccount.ts

Length of output: 1606


15-16: LGTM! Ensure the new properties are utilized correctly.

The changes to make txHash optional and add encodedTx of type MethodEncode are approved.

However, ensure that the new properties are utilized correctly throughout the codebase.

Verification successful

The new properties txHash and encodedTx are utilized correctly in the codebase.

  • txHash is appropriately awaited and returned in packages/core-sdk/src/resources/ipAccount.ts.
  • encodedTx is correctly returned in packages/core-sdk/src/resources/ipAccount.ts.

No issues were found with the usage of these properties.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of the new properties in IPAccountExecuteResponse.

# Test: Search for the usage of IPAccountExecuteResponse. Expect: Correct usage of the new properties.
rg --type typescript -A 5 $'IPAccountExecuteResponse'

Length of output: 87


Script:

#!/bin/bash
# Description: Verify the usage of the new properties in IPAccountExecuteResponse.

# Test: Search for the usage of IPAccountExecuteResponse. Expect: Correct usage of the new properties.
rg --glob '*.ts' -A 5 'IPAccountExecuteResponse'

Length of output: 3271


Script:

#!/bin/bash
# Description: Verify the usage of the new properties in IPAccountExecuteResponse.

# Test: Search for the usage of the properties `txHash` and `encodedTx` in the relevant files.
rg --glob '*.ts' -A 5 'txHash' packages/core-sdk/src/resources/ipAccount.ts packages/react-sdk/src/resources/useIpAccount.ts
rg --glob '*.ts' -A 5 'encodedTx' packages/core-sdk/src/resources/ipAccount.ts packages/react-sdk/src/resources/useIpAccount.ts

Length of output: 3064

packages/core-sdk/src/types/resources/dispute.ts (3)

28-29: LGTM! Ensure the new properties are utilized correctly.

The changes to make txHash optional and add encodedTx of type MethodEncode are approved.

However, ensure that the new properties are utilized correctly throughout the codebase.


16-17: LGTM! Ensure the new properties are utilized correctly.

The changes to make txHash optional and add encodedTx of type MethodEncode are approved.

However, ensure that the new properties are utilized correctly throughout the codebase.

Verification successful

LGTM! Ensure the new properties are utilized correctly.

The changes to make txHash optional and add encodedTx of type MethodEncode are approved.

  • The properties txHash and encodedTx are widely referenced across the codebase, indicating their correct integration.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of the new properties in RaiseDisputeResponse.

# Test: Search for the usage of RaiseDisputeResponse. Expect: Correct usage of the new properties.
rg --type typescript -A 5 $'RaiseDisputeResponse'

Length of output: 83


Script:

#!/bin/bash
# Description: Verify the usage of the new properties in RaiseDisputeResponse.

# Test: Search for the usage of RaiseDisputeResponse. Expect: Correct usage of the new properties.
rg -A 5 'RaiseDisputeResponse'

Length of output: 6221


Script:

#!/bin/bash
# Description: Verify the usage of the new properties `txHash` and `encodedTx` in RaiseDisputeResponse.

# Test: Search for the usage of `txHash` and `encodedTx`. Expect: Correct usage of the new properties.
rg 'txHash' -A 5
rg 'encodedTx' -A 5

Length of output: 182511


39-40: LGTM! Ensure the new properties are utilized correctly.

The changes to make txHash optional and add encodedTx of type MethodEncode are approved.

However, ensure that the new properties are utilized correctly throughout the codebase.

packages/core-sdk/src/types/resources/permission.ts (2)

16-16: Change approved: txHash property made optional.

This change allows for flexibility in scenarios where the transaction hash may not be available.


17-17: Change approved: encodedTx property added.

This addition enhances the functionality by providing encoded transaction data, which can be useful for off-chain handling.

packages/core-sdk/src/types/resources/royalty.ts (8)

32-32: Change approved: txHash property made optional.

This change allows for flexibility in scenarios where the transaction hash may not be available.


33-33: Change approved: encodedTx property added.

This addition enhances the functionality by providing encoded transaction data, which can be useful for off-chain handling.


63-63: Change approved: txHash property made optional.

This change allows for flexibility in scenarios where the transaction hash may not be available.


64-64: Change approved: encodedTx property added.

This addition enhances the functionality by providing encoded transaction data, which can be useful for off-chain handling.


81-81: Change approved: txHash property made optional.

This change allows for flexibility in scenarios where the transaction hash may not be available.


82-82: Change approved: encodedTx property added.

This addition enhances the functionality by providing encoded transaction data, which can be useful for off-chain handling.


87-87: Change approved: txHash property made optional.

This change allows for flexibility in scenarios where the transaction hash may not be available.


88-88: Change approved: encodedTx property added.

This addition enhances the functionality by providing encoded transaction data, which can be useful for off-chain handling.

packages/core-sdk/src/types/resources/license.ts (4)

44-44: Change approved: encodedTx property added.

This addition enhances the functionality by providing encoded transaction data, which can be useful for off-chain handling.


68-68: Change approved: txHash property made optional.

This change allows for flexibility in scenarios where the transaction hash may not be available.


69-69: Change approved: encodedTx property added.

This addition enhances the functionality by providing encoded transaction data, which can be useful for off-chain handling.


85-85: Change approved: encodedTx property added.

This addition enhances the functionality by providing encoded transaction data, which can be useful for off-chain handling.

packages/core-sdk/src/types/resources/ipAsset.ts (6)

17-18: LGTM!

The addition of the encodedTx property enhances the flexibility of the response type.


35-36: LGTM!

The addition of the encodedTx property and making txHash optional enhances the flexibility of the response type.


49-50: LGTM!

The addition of the encodedTx property enhances the flexibility of the response type.


64-65: LGTM!

The addition of the encodedTx property and making txHash optional enhances the flexibility of the response type.


84-85: LGTM!

The addition of the encodedTx property and making txHash optional enhances the flexibility of the response type.


101-102: LGTM!

The addition of the encodedTx property and making txHash optional enhances the flexibility of the response type.

packages/wagmi-generator/sdk.ts (3)

479-480: LGTM!

The addition of the MethodEncode type enhances the clarity and type safety of the encoding methods.


242-280: LGTM!

The generateContractDataFunction function is well-structured and enhances the SDK's capability to handle encoding for contract function calls.


457-460: LGTM!

The changes to the generateContract function integrate the new encoding functionality effectively.

packages/core-sdk/src/abi/generated.ts (27)

7413-7413: LGTM!

The type MethodEncode is well-defined, ensuring type safety and consistency.


7580-7595: LGTM!

The method setAllPermissionsEncode correctly encodes the parameters for the setAllPermissions function.


7616-7633: LGTM!

The method setBatchPermissionsEncode correctly encodes the parameters for the setBatchPermissions function.


7653-7669: LGTM!

The method setPermissionEncode correctly encodes the parameters for the setPermission function.


8036-8051: LGTM!

The method freezeMetadataEncode correctly encodes the parameters for the freezeMetadata function.


8070-8085: LGTM!

The method setAllEncode correctly encodes the parameters for the setAll function.


8106-8121: LGTM!

The method setMetadataUriEncode correctly encodes the parameters for the setMetadataURI function.


8142-8159: LGTM!

The method updateNftTokenUriEncode correctly encodes the parameters for the updateNftTokenURI function.


8408-8423: LGTM!

The method cancelDisputeEncode correctly encodes the parameters for the cancelDispute function.


8444-8459: LGTM!

The method raiseDisputeEncode correctly encodes the parameters for the raiseDispute function.


8480-8495: LGTM!

The method resolveDisputeEncode correctly encodes the parameters for the resolveDispute function.


8589-8604: LGTM!

The method executeEncode correctly encodes the parameters for the execute function.


8632-8654: LGTM!

The method executeWithSigEncode correctly encodes the parameters for the executeWithSig function.


8899-8915: LGTM!

The method registerEncode correctly encodes the parameters for the register function.


9211-9228: LGTM!

The method claimRevenueBySnapshotBatchEncode correctly encodes the parameters for the claimRevenueBySnapshotBatch function.


9249-9266: LGTM!

The method claimRevenueByTokenBatchEncode correctly encodes the parameters for the claimRevenueByTokenBatch function.


9287-9304: LGTM!

The method collectRoyaltyTokensEncode correctly encodes the parameters for the collectRoyaltyTokens function.


9322-9336: LGTM!

The method snapshotEncode correctly encodes the parameters for the snapshot function.


10539-10556: LGTM!

The method attachLicenseTermsToIpEncode correctly encodes the parameters for the attachLicenseTermsToIp function.


10577-10592: LGTM!

The method initializeEncode correctly encodes the parameters for the initialize function.


10618-10640: LGTM!

The method registerDerivativeIpEncode correctly encodes the parameters for the registerDerivativeIp function.


10661-10678: LGTM!

The method registerLicenseTemplateEncode correctly encodes the parameters for the registerLicenseTemplate function.


10699-10714: LGTM!

The method setAuthorityEncode correctly encodes the parameters for the setAuthority function.


10735-10752: LGTM!

The method setDefaultLicenseTermsEncode correctly encodes the parameters for the setDefaultLicenseTerms function.


10773-10788: LGTM!

The method setExpireTimeEncode correctly encodes the parameters for the setExpireTime function.


10809-10826: LGTM!

The method setLicensingConfigForIpEncode correctly encodes the parameters for the setLicensingConfigForIp function.


10852-10874: LGTM!

The method setLicensingConfigForLicenseEncode correctly encodes the parameters for the `setLicensingConfigForLicense

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Outside diff range, codebase verification and nitpick comments (1)
packages/core-sdk/src/resources/dispute.ts (1)

115-129: Issue Found: Handling of encodedTxDataOnly Option

The encodedTxDataOnly option introduced in the resolveDispute function in dispute.ts is not handled in other parts of the codebase where resolveDispute is called. This could lead to potential issues if the encodedTxDataOnly option is used but not properly handled.

  • Files to Review:
    • packages/react-sdk/src/resources/useDispute.ts
    • packages/core-sdk/src/abi/generated.ts

Please ensure that all calls to resolveDispute handle the encodedTxDataOnly option correctly.

Analysis chain

LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to resolveDispute match the new structure and handle the encodedTxDataOnly option correctly.


Let's correct the file type and re-run the search to verify the function usage in the codebase.


Let's correct the file type to ts and re-run the search to verify the function usage in the codebase.


Let's extract and review the relevant code snippets from the identified files to ensure they handle the encodedTxDataOnly option correctly.


Let's extract the full implementation of the resolveDispute function from useDispute.ts and generated.ts to verify the handling of the encodedTxDataOnly option.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `resolveDispute` match the new structure.

# Test: Search for the function usage. Expect: Only occurrences of the new structure.
rg --type python -A 5 $'resolveDispute'

Length of output: 69


Script:

#!/bin/bash
# Description: Verify all function calls to `resolveDispute` match the new structure.

# Test: Search for the function usage. Expect: Only occurrences of the new structure.
rg --type typescript -A 5 'resolveDispute'

Length of output: 77


Script:

#!/bin/bash
# Description: Verify all function calls to `resolveDispute` match the new structure.

# Test: Search for the function usage. Expect: Only occurrences of the new structure.
rg --type ts -A 5 'resolveDispute'

Length of output: 9488


Script:

#!/bin/bash
# Extract relevant code snippets to verify handling of `encodedTxDataOnly` option.

# Extract snippets from `dispute.test.ts`
rg --type ts -A 10 -B 5 'resolveDispute' packages/core-sdk/test/unit/resources/dispute.test.ts

# Extract snippets from `useDispute.ts`
rg --type ts -A 10 -B 5 'resolveDispute' packages/react-sdk/src/resources/useDispute.ts

# Extract snippets from `generated.ts`
rg --type ts -A 10 -B 5 'resolveDispute' packages/core-sdk/src/abi/generated.ts

Length of output: 5269


Script:

#!/bin/bash
# Extract the full implementation of the `resolveDispute` function to verify handling of `encodedTxDataOnly` option.

# Extract full implementation from `useDispute.ts`
rg --type ts -A 50 'resolveDispute' packages/react-sdk/src/resources/useDispute.ts

# Extract full implementation from `generated.ts`
rg --type ts -A 50 'resolveDispute' packages/core-sdk/src/abi/generated.ts

Length of output: 7442

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 9db92e5 and b159782.

Files selected for processing (16)
  • packages/core-sdk/src/index.ts (1 hunks)
  • packages/core-sdk/src/resources/dispute.ts (3 hunks)
  • packages/core-sdk/src/resources/ipAccount.ts (2 hunks)
  • packages/core-sdk/src/resources/ipAsset.ts (6 hunks)
  • packages/core-sdk/src/resources/license.ts (6 hunks)
  • packages/core-sdk/src/resources/nftClient.ts (2 hunks)
  • packages/core-sdk/src/resources/permission.ts (5 hunks)
  • packages/core-sdk/src/resources/royalty.ts (4 hunks)
  • packages/core-sdk/src/types/options.ts (1 hunks)
  • packages/core-sdk/src/types/resources/dispute.ts (4 hunks)
  • packages/core-sdk/src/types/resources/ipAccount.ts (3 hunks)
  • packages/core-sdk/src/types/resources/ipAsset.ts (7 hunks)
  • packages/core-sdk/src/types/resources/license.ts (4 hunks)
  • packages/core-sdk/src/types/resources/nftClient.ts (2 hunks)
  • packages/core-sdk/src/types/resources/permission.ts (2 hunks)
  • packages/core-sdk/src/types/resources/royalty.ts (4 hunks)
Files skipped from review as they are similar to previous changes (7)
  • packages/core-sdk/src/types/resources/dispute.ts
  • packages/core-sdk/src/types/resources/ipAccount.ts
  • packages/core-sdk/src/types/resources/ipAsset.ts
  • packages/core-sdk/src/types/resources/license.ts
  • packages/core-sdk/src/types/resources/nftClient.ts
  • packages/core-sdk/src/types/resources/permission.ts
  • packages/core-sdk/src/types/resources/royalty.ts
Additional comments not posted (27)
packages/core-sdk/src/types/options.ts (1)

6-9: Consider renaming encodedTxDataOnly to encodedTxDataOnly.

The existing comment suggests renaming this property for clarity. The current name is already appropriate and descriptive, but if there's a consensus on the suggested name, it can be updated.

packages/core-sdk/src/index.ts (1)

88-88: LGTM!

The new export MethodEncode enhances the module's type definitions without affecting existing functionality.

packages/core-sdk/src/resources/nftClient.ts (3)

Line range hint 46-55:
Good practice: Consolidate parameters into a request object.

The introduction of the req object enhances code readability and maintainability by grouping related properties together.


57-59: Enhancement: Add support for encodedTxDataOnly option.

The new conditional branch allows for more flexible handling of transaction options, enabling the caller to choose between receiving encoded transaction data or executing the transaction directly.


60-70: Maintain existing functionality while adding new features.

The original logic for awaiting a transaction receipt and parsing logs is preserved within the new conditional structure, ensuring backward compatibility.

packages/core-sdk/src/resources/ipAccount.ts (2)

43-57: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to execute match the new structure and handle the encodedTxDataOnly option correctly.

Verification successful

LGTM! The function usage matches the new structure and handles the encodedTxDataOnly option correctly.

The code changes are verified and correctly implemented:

  • packages/core-sdk/src/resources/ipAccount.ts
  • packages/core-sdk/test/integration/royalty.test.ts
  • packages/react-sdk/test/integration/useRoyalty.test.ts
  • packages/core-sdk/test/integration/ipAccount.test.ts
  • packages/react-sdk/test/integration/useIpAccount.test.ts
  • packages/core-sdk/src/resources/permission.ts
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `execute` match the new structure.

# Test: Search for the function usage. Expect: Only occurrences of the new structure.
rg --type python -A 5 $'execute'

Length of output: 62


Script:

#!/bin/bash
# Description: Verify all function calls to `execute` match the new structure.

# Test: Search for the function usage. Expect: Only occurrences of the new structure.
rg --type ts -A 5 $'execute'

Length of output: 34006


Script:

#!/bin/bash
# Description: Extract detailed context around the `execute` function calls to verify the handling of the `encodedTxDataOnly` option.

# Test: Search for the function usage and include more context lines. Expect: Proper handling of the `encodedTxDataOnly` option.
rg --type ts -A 10 -B 10 $'execute'

Length of output: 69419


85-102: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to executeWithSig match the new structure and handle the encodedTxDataOnly option correctly.

packages/core-sdk/src/resources/dispute.ts (2)

42-62: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to raiseDispute match the new structure and handle the encodedTxDataOnly option correctly.


83-97: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to cancelDispute match the new structure and handle the encodedTxDataOnly option correctly.

Verification successful

Function cancelDispute usage verification:

The search results indicate that the cancelDispute function is used across various files, including integration tests, unit tests, and resource files. The instances reviewed show that the new structure and the encodedTxDataOnly option are correctly handled.

  • Integration Tests:

    • packages/react-sdk/test/integration/useDispute.test.ts
    • packages/core-sdk/test/integration/dispute.test.ts
  • Unit Tests:

    • packages/core-sdk/test/unit/resources/dispute.test.ts
  • Resource Files:

    • packages/react-sdk/src/resources/useDispute.ts
    • packages/core-sdk/src/resources/dispute.ts

All instances follow the new structure and handle the encodedTxDataOnly option appropriately.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `cancelDispute` match the new structure.

# Test: Search for the function usage. Expect: Only occurrences of the new structure.
rg --type python -A 5 $'cancelDispute'

Length of output: 68


Script:

#!/bin/bash
# Description: Verify all function calls to `cancelDispute` match the new structure.

# Test: Search for the function usage in TypeScript files. Expect: Only occurrences of the new structure.
rg --type typescript -A 5 $'cancelDispute'

Length of output: 76


Script:

#!/bin/bash
# Description: Verify all function calls to `cancelDispute` match the new structure.

# Test: Search for the function usage in TypeScript and JavaScript files. Expect: Only occurrences of the new structure.
rg --type ts -A 5 $'cancelDispute'
rg --type js -A 5 $'cancelDispute'

Length of output: 11463

packages/core-sdk/src/resources/royalty.ts (4)

120-135: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to payRoyaltyOnBehalf match the new structure and handle the encodedTxDataOnly option correctly.


202-222: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to claimRevenue match the new structure and handle the encodedTxDataOnly option correctly.


71-87: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to collectRoyaltyTokens match the new structure and handle the encodedTxDataOnly option correctly.

Verification successful

Let's correct the file type and re-run the search to verify the function usage in the codebase.


Let's correct the file type to ts and re-run the search to verify the function usage in the codebase.


Function usage verified and matches the new structure.

The function collectRoyaltyTokens is used correctly in the codebase, with the new structure and options being accounted for. The presence of tests further supports the correctness of the implementation.

  • packages/react-sdk/test/integration/useRoyalty.test.ts
  • packages/core-sdk/test/unit/resources/royalty.test.ts
  • packages/react-sdk/src/resources/useRoyalty.ts
  • packages/core-sdk/src/abi/generated.ts
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `collectRoyaltyTokens` match the new structure.

# Test: Search for the function usage. Expect: Only occurrences of the new structure.
rg --type python -A 5 $'collectRoyaltyTokens'

Length of output: 75


Script:

#!/bin/bash
# Description: Verify all function calls to `collectRoyaltyTokens` match the new structure.

# Test: Search for the function usage. Expect: Only occurrences of the new structure.
rg --type typescript -A 5 $'collectRoyaltyTokens'

Length of output: 83


Script:

#!/bin/bash
# Description: Verify all function calls to `collectRoyaltyTokens` match the new structure.

# Test: Search for the function usage. Expect: Only occurrences of the new structure.
rg --type ts -A 5 $'collectRoyaltyTokens'

Length of output: 16866


255-265: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to snapshot match the new structure and handle the encodedTxDataOnly option correctly.

packages/core-sdk/src/resources/permission.ts (5)

141-159: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to createSetPermissionSignature match the new request object structure.

Verification successful

Verification successful!

All instances of the createSetPermissionSignature function calls in the codebase match the new request object structure.

  • Found in test files and implementation files, all using the new format.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `createSetPermissionSignature` match the new request object structure.

# Test: Search for the function usage. Expect: Only occurrences of the new request object structure.
rg --type python -A 5 $'createSetPermissionSignature'

Length of output: 83


Script:

#!/bin/bash
# Description: Verify all function calls to `createSetPermissionSignature` match the new request object structure.

# Test: Search for the function usage. Expect: Only occurrences of the new request object structure.
rg --type ts -A 5 'createSetPermissionSignature'

Length of output: 12215


293-310: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to createBatchPermissionSignature match the new request object structure.

Verification successful

The previous script failed due to an incorrect file type specification. Let's correct this and search for the function usage within TypeScript files.


Verified: All function calls to createBatchPermissionSignature match the new request object structure.

The code changes are consistently applied across the codebase.

  • packages/core-sdk/test/integration/permission.test.ts
  • packages/react-sdk/test/integration/usePermission.test.ts
  • packages/core-sdk/test/unit/resources/permission.test.ts
  • packages/react-sdk/src/resources/usePermission.ts
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `createBatchPermissionSignature` match the new request object structure.

# Test: Search for the function usage. Expect: Only occurrences of the new request object structure.
rg --type python -A 5 $'createBatchPermissionSignature'

Length of output: 85


Script:

#!/bin/bash
# Description: Verify all function calls to `createBatchPermissionSignature` match the new request object structure.

# Test: Search for the function usage. Expect: Only occurrences of the new request object structure.
rg --type ts -A 5 $'createBatchPermissionSignature'

Length of output: 7466


180-194: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to setAllPermissions match the new request object structure.

Verification successful

Function usage verified successfully.

All instances of the setAllPermissions function call match the new request object structure.

  • packages/core-sdk/test/integration/permission.test.ts
  • packages/react-sdk/test/integration/usePermission.test.ts
  • packages/core-sdk/test/unit/resources/permission.test.ts
  • packages/core-sdk/src/resources/permission.ts
  • packages/core-sdk/src/abi/generated.ts
  • packages/react-sdk/src/resources/usePermission.ts
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `setAllPermissions` match the new request object structure.

# Test: Search for the function usage. Expect: Only occurrences of the new request object structure.
rg --type python -A 5 $'setAllPermissions'

Length of output: 72


Script:

#!/bin/bash
# Description: Verify all function calls to `setAllPermissions` match the new request object structure.

# Test: Search for the function usage. Expect: Only occurrences of the new request object structure.
rg --type typescript -A 5 $'setAllPermissions'

Length of output: 80


Script:

#!/bin/bash
# Description: Verify all function calls to `setAllPermissions` match the new request object structure.

# Test: Search for the function usage. Expect: Only occurrences of the new request object structure.
rg --type ts -A 5 $'setAllPermissions'

Length of output: 12448


68-86: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to setPermission match the new request object structure.

Verification successful

The function calls to setPermission have been updated to match the new request object structure.

The search results indicate that the new request object structure is being used in the following files:

  • packages/react-sdk/test/integration/useIpAccount.test.ts
  • packages/react-sdk/test/integration/usePermission.test.ts
  • packages/react-sdk/src/resources/usePermission.ts
  • packages/core-sdk/test/integration/permission.test.ts
  • packages/core-sdk/test/unit/resources/permission.test.ts
  • packages/core-sdk/src/resources/permission.ts

These updates confirm that the changes have been correctly applied across the codebase.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `setPermission` match the new request object structure.

# Test: Search for the function usage. Expect: Only occurrences of the new request object structure.
rg --type python -A 5 $'setPermission'

Length of output: 68


Script:

#!/bin/bash
# Description: Verify all function calls to `setPermission` match the new request object structure.

# Test: Search for the function usage. Expect: Only occurrences of the new request object structure.
rg --type typescript -A 5 'setPermission'

Length of output: 76


Script:

#!/bin/bash
# Description: Verify all function calls to `setPermission` match the new request object structure.

# Test: Search for the function usage. Expect: Only occurrences of the new request object structure.
rg --type ts -A 5 'setPermission'

Length of output: 16518


222-240: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to setBatchPermissions match the new request object structure.

Verification successful

Let's re-run the verification script with the correct file type.


Let's re-run the verification script with the correct file type for TypeScript files.


LGTM! The function calls to setBatchPermissions match the new request object structure.

The code changes are approved.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `setBatchPermissions` match the new request object structure.

# Test: Search for the function usage. Expect: Only occurrences of the new request object structure.
rg --type python -A 5 $'setBatchPermissions'

Length of output: 74


Script:

#!/bin/bash
# Description: Verify all function calls to `setBatchPermissions` match the new request object structure.

# Test: Search for the function usage in TypeScript files. Expect: Only occurrences of the new request object structure.
rg --type typescript -A 5 'setBatchPermissions'

Length of output: 82


Script:

#!/bin/bash
# Description: Verify all function calls to `setBatchPermissions` match the new request object structure.

# Test: Search for the function usage in TypeScript files. Expect: Only occurrences of the new request object structure.
rg --type ts -A 5 'setBatchPermissions'

Length of output: 13458

packages/core-sdk/src/resources/license.ts (5)

Line range hint 299-324:
LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to mintLicenseTokens match the new request object structure.

Verification successful

Function usage verified

The function calls to mintLicenseTokens match the new request object structure across the codebase.

  • Instances found in test files and implementation files show consistent usage with the new structure.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `mintLicenseTokens` match the new request object structure.

# Test: Search for the function usage. Expect: Only occurrences of the new request object structure.
rg --type python -A 5 $'mintLicenseTokens'

Length of output: 72


Script:

#!/bin/bash
# Description: Verify all function calls to `mintLicenseTokens` match the new request object structure.

# Test: Search for the function usage. Expect: Only occurrences of the new request object structure.
rg --type typescript -A 5 'mintLicenseTokens'

Length of output: 80


Script:

#!/bin/bash
# Description: Verify all function calls to `mintLicenseTokens` match the new request object structure.

# Test: Search for the function usage. Expect: Only occurrences of the new request object structure.
rg --type ts -A 5 'mintLicenseTokens'

Length of output: 21774


115-132: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to registerCommercialUsePIL match the new request object structure.

Verification successful

Function calls to registerCommercialUsePIL match the new request object structure.

The code changes are verified and approved.

  • Instances found in packages/react-sdk/test/integration/useLicense.test.ts
  • Instances found in packages/react-sdk/test/integration/useRoyalty.test.ts
  • Instances found in packages/core-sdk/test/integration/license.test.ts
  • Instances found in packages/core-sdk/test/unit/resources/license.test.ts
  • Instances found in packages/react-sdk/src/resources/useLicense.ts
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `registerCommercialUsePIL` match the new request object structure.

# Test: Search for the function usage. Expect: Only occurrences of the new request object structure.
rg --type python -A 5 $'registerCommercialUsePIL'

Length of output: 79


Script:

#!/bin/bash
# Description: Verify all function calls to `registerCommercialUsePIL` match the new request object structure.

# Test: Search for the function usage. Expect: Only occurrences of the new request object structure.
rg --type typescript -A 5 'registerCommercialUsePIL'

Length of output: 87


Script:

#!/bin/bash
# Description: Verify all function calls to `registerCommercialUsePIL` match the new request object structure.

# Test: Search for the function usage. Expect: Only occurrences of the new request object structure.
rg -A 5 'registerCommercialUsePIL'

Length of output: 9979


162-179: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to registerCommercialRemixPIL match the new request object structure.

Verification successful

Verified: All function calls to registerCommercialRemixPIL match the new request object structure.

  • Instances in packages/react-sdk/src/resources/useLicense.ts and various test files confirm the correct usage of the txOptions field.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `registerCommercialRemixPIL` match the new request object structure.

# Test: Search for the function usage. Expect: Only occurrences of the new request object structure.
rg --type python -A 5 $'registerCommercialRemixPIL'

Length of output: 81


Script:

#!/bin/bash
# Description: Verify all function calls to `registerCommercialRemixPIL` match the new request object structure.

# Test: Search for the function usage. Expect: Only occurrences of the new request object structure.
rg --type typescript -A 5 'registerCommercialRemixPIL'

Length of output: 89


Script:

#!/bin/bash
# Description: Verify all function calls to `registerCommercialRemixPIL` match the new request object structure.

# Test: Search for the function usage. Expect: Only occurrences of the new request object structure.
rg --glob '*.ts' -A 5 'registerCommercialRemixPIL'

Length of output: 10046


224-238: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to attachLicenseTerms match the new request object structure.


70-87: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to registerNonComSocialRemixingPIL match the new request object structure.

Verification successful

Verified: All function calls to registerNonComSocialRemixingPIL match the new request object structure.

  • packages/react-sdk/test/integration/useLicense.test.ts
  • packages/react-sdk/test/integration/useIpAsset.test.ts
  • packages/core-sdk/test/unit/resources/license.test.ts
  • packages/core-sdk/test/integration/license.test.ts
  • packages/react-sdk/src/resources/useLicense.ts
  • packages/core-sdk/test/integration/ipAsset.test.ts
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `registerNonComSocialRemixingPIL` match the new request object structure.

# Test: Search for the function usage. Expect: Only occurrences of the new request object structure.
rg --type python -A 5 $'registerNonComSocialRemixingPIL'

Length of output: 86


Script:

#!/bin/bash
# Description: Verify all function calls to `registerNonComSocialRemixingPIL` match the new request object structure.

# Test: Search for the function usage. Expect: Only occurrences of the new request object structure.
rg --type typescript -A 5 $'registerNonComSocialRemixingPIL'

Length of output: 94


Script:

#!/bin/bash
# Description: Verify all function calls to `registerNonComSocialRemixingPIL` match the new request object structure.

# Test: Search for the function usage. Expect: Only occurrences of the new request object structure.
ast-grep --lang typescript --pattern 'registerNonComSocialRemixingPIL($_$)'

Length of output: 77


Script:

#!/bin/bash
# Description: Verify all function calls to `registerNonComSocialRemixingPIL` match the new request object structure.

# Test: Search for the function usage. Expect: Only occurrences of the new request object structure.
rg 'registerNonComSocialRemixingPIL' -A 5

Length of output: 12005

packages/core-sdk/src/resources/ipAsset.ts (4)

354-371: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to mintAndRegisterIpAssetWithPilTerms match the new request object structure.


224-240: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to registerDerivative match the new request object structure.


275-291: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to registerDerivativeWithLicenseTokens match the new request object structure.

Verification successful

Verification successful! All occurrences of registerDerivativeWithLicenseTokens match the new request object structure.

  • packages/core-sdk/test/unit/resources/ipAsset.test.ts
  • packages/core-sdk/test/integration/ipAsset.test.ts
  • packages/react-sdk/test/integration/useIpAsset.test.ts
  • packages/react-sdk/src/resources/useIpAsset.ts
  • packages/core-sdk/src/resources/ipAsset.ts
  • packages/core-sdk/src/abi/generated.ts
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `registerDerivativeWithLicenseTokens` match the new request object structure.

# Test: Search for the function usage. Expect: Only occurrences of the new request object structure.
rg --type python -A 5 $'registerDerivativeWithLicenseTokens'

Length of output: 90


Script:

#!/bin/bash
# Description: Verify all function calls to `registerDerivativeWithLicenseTokens` match the new request object structure.

# Test: Search for the function usage. Expect: Only occurrences of the new request object structure.
rg --type typescript -A 5 $'registerDerivativeWithLicenseTokens'

Length of output: 98


Script:

#!/bin/bash
# Description: Verify all function calls to `registerDerivativeWithLicenseTokens` match the new request object structure.

# Test: Search for the function usage. Expect: Only occurrences of the new request object structure.
rg --type ts -A 5 $'registerDerivativeWithLicenseTokens'

Length of output: 15288


139-168: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to register match the new request object structure.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between b159782 and 307e331.

Files selected for processing (11)
  • package.json (1 hunks)
  • packages/core-sdk/src/abi/generated.ts (71 hunks)
  • packages/core-sdk/src/index.ts (1 hunks)
  • packages/core-sdk/src/types/resources/dispute.ts (4 hunks)
  • packages/core-sdk/src/types/resources/ipAccount.ts (3 hunks)
  • packages/core-sdk/src/types/resources/ipAsset.ts (7 hunks)
  • packages/core-sdk/src/types/resources/license.ts (4 hunks)
  • packages/core-sdk/src/types/resources/nftClient.ts (2 hunks)
  • packages/core-sdk/src/types/resources/permission.ts (2 hunks)
  • packages/core-sdk/src/types/resources/royalty.ts (4 hunks)
  • packages/wagmi-generator/sdk.ts (3 hunks)
Files skipped from review due to trivial changes (2)
  • package.json
  • packages/core-sdk/src/index.ts
Files skipped from review as they are similar to previous changes (7)
  • packages/core-sdk/src/types/resources/dispute.ts
  • packages/core-sdk/src/types/resources/ipAccount.ts
  • packages/core-sdk/src/types/resources/ipAsset.ts
  • packages/core-sdk/src/types/resources/license.ts
  • packages/core-sdk/src/types/resources/nftClient.ts
  • packages/core-sdk/src/types/resources/permission.ts
  • packages/core-sdk/src/types/resources/royalty.ts
Additional comments not posted (31)
packages/wagmi-generator/sdk.ts (4)

458-460: Ensure proper integration of generateContractDataFunction.

The integration of generateContractDataFunction within generateContract appears correct. Ensure that this function is invoked correctly for each contract function.

Verification successful

Proper integration of generateContractDataFunction confirmed.

The generateContractDataFunction is correctly invoked within the generateContract function, and its results are appropriately utilized.

  • Location: packages/wagmi-generator/sdk.ts lines 458-460
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the integration of `generateContractDataFunction` within `generateContract`.

# Test: Search for the invocation of `generateContractDataFunction`. Expect: Correct integration.
rg --type python -A 5 $'generateContractDataFunction'

Length of output: 83


Script:

#!/bin/bash
# Description: Verify the integration of `generateContractDataFunction` within `generateContract`.

# Test: Search for the invocation of `generateContractDataFunction`. Expect: Correct integration.
rg --type typescript -A 5 'generateContractDataFunction'

Length of output: 91


Script:

#!/bin/bash
# Description: Verify the integration of `generateContractDataFunction` within `generateContract`.

# Test: Search for the invocation of `generateContractDataFunction`. Expect: Correct integration.
rg --type ts -A 5 'generateContractDataFunction'

Length of output: 1055


242-245: Ensure consistent naming conventions.

The variable indexFuncName is constructed based on the presence of an index property in func. Ensure that this is consistently applied across the codebase.

Verification successful

Consistent naming conventions verified.

The variable indexFuncName is consistently used across the codebase, adhering to the intended naming conventions.

  • packages/wagmi-generator/sdk.ts: Consistent usage of indexFuncName confirmed.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the consistent usage of `indexFuncName` across the codebase.

# Test: Search for the usage of `indexFuncName`. Expect: Consistent application.
rg --type python -A 5 $'indexFuncName'

Length of output: 68


Script:

#!/bin/bash
# Description: Verify the consistent usage of `indexFuncName` across the codebase.

# Test: Search for the usage of `indexFuncName`. Expect: Consistent application.
rg --type typescript -A 5 'indexFuncName'

Length of output: 76


Script:

#!/bin/bash
# Description: Verify the consistent usage of `indexFuncName` across the codebase.

# Test: Search for the usage of `indexFuncName`. Expect: Consistent application.
rg --type ts -A 5 'indexFuncName'

Length of output: 2997


479-479: Ensure type safety for EncodedTxData.

The type EncodedTxData is well-defined. Ensure that it is used consistently across the codebase.

Verification successful

The type EncodedTxData is used consistently across the codebase.

The type EncodedTxData is well-defined and its usage is consistent throughout the codebase.

  • packages/wagmi-generator/sdk.ts
  • packages/core-sdk/src/index.ts
  • packages/core-sdk/src/types/resources/permission.ts
  • packages/core-sdk/src/types/resources/royalty.ts
  • packages/core-sdk/src/types/resources/ipAsset.ts
  • packages/core-sdk/src/types/resources/license.ts
  • packages/core-sdk/src/types/resources/dispute.ts
  • packages/core-sdk/src/types/resources/nftClient.ts
  • packages/core-sdk/src/types/resources/ipAccount.ts
  • packages/core-sdk/src/abi/generated.ts
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of `EncodedTxData` in the codebase.

# Test: Search for the usage of `EncodedTxData`. Expect: Consistent application.
rg --type python -A 5 $'EncodedTxData'

Length of output: 68


Script:

#!/bin/bash
# Description: Verify the usage of `EncodedTxData` in the codebase.

# Test: Search for the usage of `EncodedTxData`. Expect: Consistent application.
rg --type ts -A 5 $'EncodedTxData'

Length of output: 54565


255-255: Import encodeFunctionData from viem.

Ensure that the encodeFunctionData import from viem is necessary and used correctly.

Verification successful

Import encodeFunctionData from viem is necessary and used correctly.

The encodeFunctionData function is used in multiple files across the codebase, including the file under review (packages/wagmi-generator/sdk.ts). The import is justified and correctly implemented.

  • packages/wagmi-generator/sdk.ts
  • packages/react-sdk/test/integration/useRoyalty.test.ts
  • packages/react-sdk/test/integration/useIpAccount.test.ts
  • packages/core-sdk/test/integration/royalty.test.ts
  • packages/core-sdk/src/resources/permission.ts
  • packages/core-sdk/src/resources/royalty.ts
  • packages/core-sdk/src/utils/sign.ts
  • packages/core-sdk/test/integration/ipAccount.test.ts
  • packages/core-sdk/src/abi/generated.ts
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of `encodeFunctionData` in the codebase.

# Test: Search for the usage of `encodeFunctionData`. Expect: Correct usage.
rg --type python -A 5 $'encodeFunctionData'

Length of output: 73


Script:

#!/bin/bash
# Description: Verify the usage of `encodeFunctionData` in the codebase.

# Test: Search for the usage of `encodeFunctionData`. Expect: Correct usage.
rg --type js -A 5 'encodeFunctionData'

Length of output: 38


Script:

#!/bin/bash
# Description: Verify the usage of `encodeFunctionData` in the codebase.

# Test: Search for the usage of `encodeFunctionData` across all file types. Expect: Correct usage or no usage.
rg -A 5 'encodeFunctionData'

Length of output: 37624

packages/core-sdk/src/abi/generated.ts (27)

1-3: Imports look good.

The imports from the viem library are necessary for the subsequent code.


11-15: Imports look good.

The imports from the viem library are necessary for the subsequent code.


7413-7414: Type definition looks good.

The EncodedTxData type is clearly defined and aligns with the purpose of encoding transaction data.


7580-7595: Method implementation looks good.

The setAllPermissionsEncode method correctly encodes the parameters for the setAllPermissions function of the AccessController contract.


7616-7633: Method implementation looks good.

The setBatchPermissionsEncode method correctly encodes the parameters for the setBatchPermissions function of the AccessController contract.


7653-7669: Method implementation looks good.

The setPermissionEncode method correctly encodes the parameters for the setPermission function of the AccessController contract.


8036-8051: Method implementation looks good.

The freezeMetadataEncode method correctly encodes the parameters for the freezeMetadata function of the CoreMetadataModule contract.


8070-8085: Method implementation looks good.

The setAllEncode method correctly encodes the parameters for the setAll function of the CoreMetadataModule contract.


8106-8121: Method implementation looks good.

The setMetadataUriEncode method correctly encodes the parameters for the setMetadataURI function of the CoreMetadataModule contract.


8142-8159: Method implementation looks good.

The updateNftTokenUriEncode method correctly encodes the parameters for the updateNftTokenURI function of the CoreMetadataModule contract.


8408-8423: Method implementation looks good.

The cancelDisputeEncode method correctly encodes the parameters for the cancelDispute function of the DisputeModule contract.


8444-8459: Method implementation looks good.

The raiseDisputeEncode method correctly encodes the parameters for the raiseDispute function of the DisputeModule contract.


8480-8495: Method implementation looks good.

The resolveDisputeEncode method correctly encodes the parameters for the resolveDispute function of the DisputeModule contract.


8589-8604: Method implementation looks good.

The executeEncode method correctly encodes the parameters for the execute function of the IpAccountImpl contract.


8631-8654: Method implementation looks good.

The executeWithSigEncode method correctly encodes the parameters for the executeWithSig function of the IpAccountImpl contract.


8899-8915: Method implementation looks good.

The registerEncode method correctly encodes the parameters for the register function of the IpAssetRegistry contract.


9211-9228: Method implementation looks good.

The claimRevenueBySnapshotBatchEncode method correctly encodes the parameters for the claimRevenueBySnapshotBatch function of the IpRoyaltyVaultImpl contract.


9249-9266: Method implementation looks good.

The claimRevenueByTokenBatchEncode method correctly encodes the parameters for the claimRevenueByTokenBatch function of the IpRoyaltyVaultImpl contract.


9287-9304: Method implementation looks good.

The collectRoyaltyTokensEncode method correctly encodes the parameters for the collectRoyaltyTokens function of the IpRoyaltyVaultImpl contract.


9322-9336: Method implementation looks good.

The snapshotEncode method correctly encodes the parameters for the snapshot function of the IpRoyaltyVaultImpl contract.


10539-10556: Method implementation looks good.

The attachLicenseTermsToIpEncode method correctly encodes the parameters for the attachLicenseTermsToIp function of the LicenseRegistry contract.


10577-10592: Method implementation looks good.

The initializeEncode method correctly encodes the parameters for the initialize function of the LicenseRegistry contract.


10618-10640: Method implementation looks good.

The registerDerivativeIpEncode method correctly encodes the parameters for the registerDerivativeIp function of the LicenseRegistry contract.


10661-10678: Method implementation looks good.

The registerLicenseTemplateEncode method correctly encodes the parameters for the registerLicenseTemplate function of the LicenseRegistry contract.


10699-10714: Method implementation looks good.

The setAuthorityEncode method correctly encodes the parameters for the setAuthority function of the LicenseRegistry contract.


10735-10752: Method implementation looks good.

The setDefaultLicenseTermsEncode method correctly encodes the parameters for the setDefaultLicenseTerms function of the LicenseRegistry contract.


10773-10788: Method implementation looks good.

The setExpireTimeEncode method correctly encodes the parameters for the setExpireTime function of the LicenseRegistry contract.

Comment on lines +257 to +277
funcLine.push(``)
funcLine.push(`/**`)
funcLine.push(` * method ${func.name} for contract ${contractName} with only encode`)
funcLine.push(` *`)
funcLine.push(` * @param request ${inName}`)
funcLine.push(` * @return EncodedTxData`)
funcLine.push(`*/`)
funcLine.push(` public ${camelCase(indexFuncName)}Encode(${inParams}): EncodedTxData {`)
funcLine.push(` return {`)
funcLine.push(` to: this.address,`)
funcLine.push(` data:encodeFunctionData({`)
funcLine.push(` abi: ${abiName},`)
funcLine.push(` functionName: "${func.name}",`)
if (inType.valid) {
funcLine.push(` args: [`)
funcLine.push(inType.args)
funcLine.push(` ],`)
}
funcLine.push(` }),`)
funcLine.push(` };`)
funcLine.push(` }`)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add error handling for encoding function data.

Consider adding error handling for the encodeFunctionData method to ensure robustness.

+  try {
      return {
        to: this.address,
        data: encodeFunctionData({
          abi: ${abiName},
          functionName: "${func.name}",
          args: [
            ${inType.args}
          ],
        }),
      };
+  } catch (error) {
+    console.error("Error encoding function data:", error);
+    throw new Error("Failed to encode function data");
+  }
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
funcLine.push(``)
funcLine.push(`/**`)
funcLine.push(` * method ${func.name} for contract ${contractName} with only encode`)
funcLine.push(` *`)
funcLine.push(` * @param request ${inName}`)
funcLine.push(` * @return EncodedTxData`)
funcLine.push(`*/`)
funcLine.push(` public ${camelCase(indexFuncName)}Encode(${inParams}): EncodedTxData {`)
funcLine.push(` return {`)
funcLine.push(` to: this.address,`)
funcLine.push(` data:encodeFunctionData({`)
funcLine.push(` abi: ${abiName},`)
funcLine.push(` functionName: "${func.name}",`)
if (inType.valid) {
funcLine.push(` args: [`)
funcLine.push(inType.args)
funcLine.push(` ],`)
}
funcLine.push(` }),`)
funcLine.push(` };`)
funcLine.push(` }`)
funcLine.push(``)
funcLine.push(`/**`)
funcLine.push(` * method ${func.name} for contract ${contractName} with only encode`)
funcLine.push(` *`)
funcLine.push(` * @param request ${inName}`)
funcLine.push(` * @return EncodedTxData`)
funcLine.push(`*/`)
funcLine.push(` public ${camelCase(indexFuncName)}Encode(${inParams}): EncodedTxData {`)
funcLine.push(` try {`)
funcLine.push(` return {`)
funcLine.push(` to: this.address,`)
funcLine.push(` data: encodeFunctionData({`)
funcLine.push(` abi: ${abiName},`)
funcLine.push(` functionName: "${func.name}",`)
if (inType.valid) {
funcLine.push(` args: [`)
funcLine.push(inType.args)
funcLine.push(` ],`)
}
funcLine.push(` }),`)
funcLine.push(` };`)
funcLine.push(` } catch (error) {`)
funcLine.push(` console.error("Error encoding function data:", error);`)
funcLine.push(` throw new Error("Failed to encode function data");`)
funcLine.push(` }`)
funcLine.push(` }`)

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 307e331 and 6c516c2.

Files selected for processing (1)
  • packages/core-sdk/test/unit/resources/ipAsset.test.ts (7 hunks)
Additional context used
Gitleaks
packages/core-sdk/test/unit/resources/ipAsset.test.ts

206-206: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


824-824: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)

Additional comments not posted (6)
packages/core-sdk/test/unit/resources/ipAsset.test.ts (6)

194-227: Test case for register method with encodedTxDataOnly looks good!

The test case correctly verifies that the register method returns encoded transaction data when encodedTxDataOnly is true. The use of sinon to stub dependencies and the assertions are appropriate.

Tools
Gitleaks

206-206: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


386-411: Test case for registerDerivative method with encodedTxDataOnly looks good!

The test case correctly verifies that the registerDerivative method returns encoded transaction data when encodedTxDataOnly is true. The use of sinon to stub dependencies and the assertions are appropriate.


503-526: Test case for registerDerivativeWithLicenseTokens method with encodedTxDataOnly looks good!

The test case correctly verifies that the registerDerivativeWithLicenseTokens method returns encoded transaction data when encodedTxDataOnly is true. The use of sinon to stub dependencies and the assertions are appropriate.


613-630: Test case for createIpAssetWithPilTerms method with encodedTxDataOnly looks good!

The test case correctly verifies that the createIpAssetWithPilTerms method returns encoded transaction data when encodedTxDataOnly is true. The use of sinon to stub dependencies and the assertions are appropriate.


809-850: Test case for registerDerivativeIp method with encodedTxDataOnly looks good!

The test case correctly verifies that the registerDerivativeIp method returns encoded transaction data when encodedTxDataOnly is true. The use of sinon to stub dependencies and the assertions are appropriate.

Tools
Gitleaks

824-824: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


964-993: Test case for registerIpAndAttachPilTerms method with encodedTxDataOnly looks good!

The test case correctly verifies that the registerIpAndAttachPilTerms method returns encoded transaction data when encodedTxDataOnly is true. The use of sinon to stub dependencies and the assertions are appropriate.

@bpolania
Copy link
Collaborator

bpolania commented Aug 1, 2024

Hello @jhd2best @LuttyYang

  • As mentioned before the right flow is to request a PR from the [dev](https://github.com/storyprotocol/sdk/tree/dev) branch and the it will be merged to main

  • This package.json file that was updated is the wrong one, this is the top level file. The file that needs to be updated is the core-sdk file, you can find it here

Note that the current version is 1.0.0-rc.15 so it will need to be updated to 1.0.0-rc.16, you can use as a reference the current version of the npm package here

@edisonz0718 edisonz0718 changed the base branch from main to dev August 1, 2024 20:03
@bpolania
Copy link
Collaborator

bpolania commented Aug 1, 2024

I approved it, but please keep in mind my previous comments for the next PR

@bpolania bpolania merged commit e92297f into storyprotocol:dev Aug 1, 2024
10 of 11 checks passed
@bpolania bpolania mentioned this pull request Aug 1, 2024
edisonz0718 added a commit that referenced this pull request Aug 1, 2024
* add onlyEncodeTransactions support (#223)

* add onlyEncodeTransactions support

* opti

* opti

* opti

* add ipasset unit test case

---------

Co-authored-by: Ze <[email protected]>
Co-authored-by: haodi <[email protected]>

* package.json Versions Update (#226)

* Top-level version updated from `0.0.4` to `0.0.3`
* core-sdk version updated to `1.0.0-rc.16`

---------

Co-authored-by: LuttyYang <[email protected]>
Co-authored-by: Ze <[email protected]>
Co-authored-by: haodi <[email protected]>
bonnie57 pushed a commit that referenced this pull request Aug 20, 2024
* add onlyEncodeTransactions support

* opti

* opti

* opti

* add ipasset unit test case

---------

Co-authored-by: Ze <[email protected]>
Co-authored-by: haodi <[email protected]>
bonnie57 pushed a commit that referenced this pull request Aug 20, 2024
* add onlyEncodeTransactions support

* opti

* opti

* opti

* add ipasset unit test case

---------

Co-authored-by: Ze <[email protected]>
Co-authored-by: haodi <[email protected]>
bonnie57 pushed a commit that referenced this pull request Aug 20, 2024
* add onlyEncodeTransactions support

* opti

* opti

* opti

* add ipasset unit test case

---------

Co-authored-by: Ze <[email protected]>
Co-authored-by: haodi <[email protected]>
bonnie57 pushed a commit that referenced this pull request Aug 20, 2024
* add onlyEncodeTransactions support

* opti

* opti

* opti

* add ipasset unit test case

---------

Co-authored-by: Ze <[email protected]>
Co-authored-by: haodi <[email protected]>
bonnie57 pushed a commit that referenced this pull request Aug 20, 2024
* add onlyEncodeTransactions support

* opti

* opti

* opti

* add ipasset unit test case

---------

Co-authored-by: Ze <[email protected]>
Co-authored-by: haodi <[email protected]>
bonnie57 added a commit that referenced this pull request Aug 20, 2024
* add onlyEncodeTransactions support (#223)

* add onlyEncodeTransactions support

* opti

* opti

* opti

* add ipasset unit test case

---------

Co-authored-by: Ze <[email protected]>
Co-authored-by: haodi <[email protected]>

* package.json Versions Update (#226)

* Top-level version updated from `0.0.4` to `0.0.3`
* core-sdk version updated to `1.0.0-rc.16`

* Implement partner testnet (#228)

* opti block explorer error (#230)

* Remove no commercial license and tests

* SSS

* Modify state from signature with setPermission

* Update wagmi/cli version

* Generate contract method via partner testnet

* Update implementation via partner testnet

* Update unit tests

* Remove sepolia chain and suport story testnet

* Reset removing no commercial license

* Update signature method

* Update env variables

* Update signature in spg

* Skip react-sdk test

* bump up sdk to 1.0.0-rc.17

* Approve the relate contract to permit transfer token

* Update license approve method

* Update signature in spg

* Add approve method when call spg method

* Remove API_KEY from wagmi-generate

* Rename chain name

* Bump up sdk to 1.0.0-rc.17

---------

Co-authored-by: LuttyYang <[email protected]>

* add onlyEncodeTransactions support (#223)

* add onlyEncodeTransactions support

* opti

* opti

* opti

* add ipasset unit test case

---------

Co-authored-by: Ze <[email protected]>
Co-authored-by: haodi <[email protected]>

* package.json Versions Update (#226)

* Top-level version updated from `0.0.4` to `0.0.3`
* core-sdk version updated to `1.0.0-rc.16`

* Remove no commercial license and tests

* SSS

* Modify state from signature with setPermission

* Update wagmi/cli version

* Generate contract method via partner testnet

* Update implementation via partner testnet

* Update unit tests

* Remove sepolia chain and suport story testnet

* Reset removing no commercial license

* Update signature method

* Update env variables

* Update signature in spg

* Skip react-sdk test

* bump up sdk to 1.0.0-rc.17

* Approve the relate contract to permit transfer token

* Update license approve method

* Update signature in spg

* Add approve method when call spg method

* Remove API_KEY from wagmi-generate

* Rename chain name

* Bump up sdk to 1.0.0-rc.17

---------

Co-authored-by: LuttyYang <[email protected]>
Co-authored-by: haodi <[email protected]>
Co-authored-by: Boris Polania <[email protected]>
Co-authored-by: Bonnie57 <[email protected]>
Co-authored-by: Bonnie <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants