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

chore: v50 chain upgrade #480

Merged
merged 52 commits into from
Jul 31, 2024
Merged

chore: v50 chain upgrade #480

merged 52 commits into from
Jul 31, 2024

Conversation

bangjelkoski
Copy link
Collaborator

@bangjelkoski bangjelkoski commented Jun 17, 2024

Summary by CodeRabbit

  • New Features

    • Updated dependency versions across multiple packages to enhance compatibility and stability.
    • Introduced new message types: MsgPrivilegedExecuteContract and MsgMultiSend for expanded messaging capabilities.
  • Enhancements

    • Improved transaction visibility with added logging in the transaction handling process for better debugging.
    • Streamlined message processing in MsgExec, enhancing data handling clarity.
  • Maintenance

    • Modified network handling logic to shift from the Goerli test network to the Sepolia test network for Ethereum interactions.

Copy link

socket-security bot commented Jun 17, 2024

👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.
View full report↗︎

Copy link

coderabbitai bot commented Jun 17, 2024

Walkthrough

This update signifies a transition from beta to development versions across several packages, aiming to enhance stability and compatibility within the SDK. Key dependency updates improve functionality and error handling, demonstrating a commitment to ongoing development. Additionally, adjustments in workflows and logging mechanisms bolster transaction visibility and network handling, reinforcing the project's robustness.

Changes

File Path Change Summary
packages/sdk-ts/package.json
packages/wallet-ts/package.json
packages/exceptions/package.json
packages/networks/package.json
packages/ts-types/package.json
packages/utils/package.json
Version changes to "1.14.12-dev.20" or "1.14.13-dev.3" with dependency updates reflecting a shift towards development versions.
packages/test-utils/package.json Version updated from "1.14.14-beta.0" to "1.14.14-dev.0".
packages/wallet-ts/src/broadcaster/MsgBroadcaster.ts
packages/wallet-ts/src/strategies/wallet-strategy/strategies/Ledger/Base.ts
packages/wallet-ts/src/strategies/wallet-strategy/strategies/Trezor/index.ts
Refactoring and logic updates to enhance network handling and transaction visibility while maintaining core functionality.

Poem

In a meadow of code where the bunnies play,
Versions are hopping, in a joyful ballet.
From beta's soft glow to dev's bright embrace,
Each leap brings us closer, a whimsical race.
With every update, new blooms we’ll find,
Progress is magic, so hop on, be kind! 🐇✨


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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 6d60083 and 2987797.

Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
Files selected for processing (3)
  • packages/sdk-ts/package.json (1 hunks)
  • packages/sdk-ts/src/client/chain/grpc/ChainGrpcIbcApi.ts (4 hunks)
  • packages/sdk-ts/src/core/modules/tx/types/tx-rest-client.ts (1 hunks)
Files skipped from review due to trivial changes (1)
  • packages/sdk-ts/package.json
Additional comments not posted (5)
packages/sdk-ts/src/core/modules/tx/types/tx-rest-client.ts (2)

3-3: Updated import to CometCryptoV1Keys aligns with the new cryptographic key structure.


8-8: Updated public_key type in RestSignerInfo to use CometCryptoV1Keys.PublicKey. This change ensures compatibility with the new cryptographic standards.

packages/sdk-ts/src/client/chain/grpc/ChainGrpcIbcApi.ts (3)

5-5: Correct update to import IbcApplicationsTransferV2Query to reflect the new API version.


17-17: Updated client instantiation to use QueryV2ClientImpl aligns with the new API version.

Also applies to: 22-22


29-29: Method implementations and exception handling updated to use the new IbcApplicationsTransferV2Query types and classes.

Also applies to: 35-36, 39-39, 41-41, 59-59, 69-70, 73-73, 75-75

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 2987797 and 49616ff.

Files selected for processing (2)
  • packages/sdk-ts/package.json (2 hunks)
  • packages/wallet-ts/package.json (2 hunks)
Files skipped from review due to trivial changes (1)
  • packages/wallet-ts/package.json
Files skipped from review as they are similar to previous changes (1)
  • packages/sdk-ts/package.json

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 49616ff and 5d0b9d1.

Files selected for processing (1)
  • .github/workflows/canary.yml (2 hunks)
Additional comments not posted (2)
.github/workflows/canary.yml (2)

34-34: Addition of lerna clean --yes is approved. Monitor the impact on build times to ensure it does not negatively affect the development workflow.

Verification successful

The addition of lerna clean --yes does not significantly impact the build times based on the current data. Successful builds remain within a reasonable time frame.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Monitor build times before and after adding `lerna clean --yes`.

# Test: Compare build times from previous builds to current. Expect: Minor or no significant increase.
gh run list --workflow canary.yml --limit 5

Length of output: 595


19-22: Update to NodeJS 18 is approved. Ensure all dependencies are compatible with the new NodeJS version.

Verification successful

The review comment regarding the update to NodeJS 18 in the .github/workflows/canary.yml file has been verified. The following points were checked:

  • No explicit NodeJS version incompatibilities were found in the package.json files.

  • The engines field was not present, indicating no explicit NodeJS version restrictions.

  • Dependencies listed in package.json files do not have known issues with NodeJS 18.

  • CI/CD pipeline configurations were checked, and NodeJS 18 was specified in relevant workflows without any incompatible versions.

  • .github/workflows/canary.yml

  • .github/workflows/dev.yaml

However, note that .github/workflows/stable.yaml still specifies NodeJS 16.18.1. You may want to update it for consistency.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Check package.json for incompatible dependencies with Node 18.

# Test: Search for dependencies not supporting Node 18. Expect: No matches.
rg '"node":' packages/*/package.json | grep -v '>=18'

Length of output: 248



Script:

#!/bin/bash
# Description: Check package.json for the engines field to ensure Node 18 compatibility.

# Test: Search for engines field specifying a Node version range. Expect: No incompatible versions.
rg '"engines":' packages/*/package.json

Length of output: 234



Script:

#!/bin/bash
# Description: List all dependencies from package.json files to verify compatibility with Node 18.

# Test: Extract dependencies and their versions. Expect: No known issues with Node 18.
rg '"dependencies":' -A 20 packages/*/package.json

Length of output: 6091



Script:

#!/bin/bash
# Description: Check CI/CD pipeline configuration for NodeJS version dependencies.

# Test: Search for NodeJS version specifications in CI/CD configurations. Expect: No incompatible versions.
rg 'node-version:' .github/workflows/

Length of output: 225

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 and nitpick comments (2)
packages/sdk-ts/src/core/modules/exchange/msgs/MsgInstantSpotMarketLaunch.ts (1)

Line range hint 42-42: Consider renaming the class to avoid redeclaration issues as indicated by static analysis.

- export default class MsgInstantSpotMarketLaunch extends MsgBase<
+ export default class MsgInstantSpotMarketLaunchV2 extends MsgBase<
jest.config.js (1)

Line range hint 7-7: Optimize the use of spread syntax in reduce functions to improve performance.

- return { ...result, [key]: compilerOptions.paths[key] }
+ result[key] = compilerOptions.paths[key]; return result;

Also applies to: 17-17

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 5d0b9d1 and d5848ad.

Files selected for processing (4)
  • jest.config.js (1 hunks)
  • packages/sdk-ts/src/client/chain/grpc/ChainGrpcIbcApi.spec.ts (3 hunks)
  • packages/sdk-ts/src/core/modules/exchange/msgs/MsgInstantSpotMarketLaunch.spec.ts (2 hunks)
  • packages/sdk-ts/src/core/modules/exchange/msgs/MsgInstantSpotMarketLaunch.ts (2 hunks)
Additional context used
Biome
packages/sdk-ts/src/core/modules/exchange/msgs/MsgInstantSpotMarketLaunch.ts

[error] 42-42: Shouldn't redeclare 'MsgInstantSpotMarketLaunch'. Consider to delete it or rename it. (lint/suspicious/noRedeclare)

'MsgInstantSpotMarketLaunch' is defined here:

jest.config.js

[error] 7-7: Avoid the use of spread (...) syntax on accumulators. (lint/performance/noAccumulatingSpread)

Spread syntax should be avoided on accumulators (like those in .reduce) because it causes a time complexity of O(n^2).
Consider methods such as .splice or .push instead.


[error] 17-17: Avoid the use of spread (...) syntax on accumulators. (lint/performance/noAccumulatingSpread)

Spread syntax should be avoided on accumulators (like those in .reduce) because it causes a time complexity of O(n^2).
Consider methods such as .splice or .push instead.

Additional comments not posted (8)
packages/sdk-ts/src/client/chain/grpc/ChainGrpcIbcApi.spec.ts (3)

5-5: The import change correctly reflects the updated API version from V1 to V2.


39-39: The change in the expect statement for the fetchDenomTrace test correctly aligns with the updated V2 API types.


20-20: The updated expect statement correctly uses the V2 API types. Ensure the response structure aligns with these new types.

Verification successful

The fetchDenomsTrace method implementation shows that it returns response.denoms, which aligns with the IbcApplicationsTransferV2Query.QueryDenomsResponse type. This confirms that the response structure matches the expected V2 API types.

  • fetchDenomsTrace method returns response.denoms, which is part of the V2 API response structure.
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the response structure matches the expected V2 API types.

# Test: Check for proper implementation in the corresponding API method.
rg --type typescript --files-with-matches 'fetchDenomsTrace' packages/sdk-ts/src/client/chain/grpc/ChainGrpcIbcApi.ts

Length of output: 152



Script:

#!/bin/bash
# Description: Verify the response structure matches the expected V2 API types.

# Test: Check for proper implementation in the corresponding API method.
rg --type ts --files-with-matches 'fetchDenomsTrace' packages/sdk-ts/src/client/chain/grpc/ChainGrpcIbcApi.ts

Length of output: 166



Script:

#!/bin/bash
# Description: Extract the implementation of the `fetchDenomsTrace` method to verify response structure.

# Extract the implementation of `fetchDenomsTrace` method.
ast-grep --lang typescript --pattern 'fetchDenomsTrace($_) { $$$ }' packages/sdk-ts/src/client/chain/grpc/ChainGrpcIbcApi.ts

Length of output: 577



Script:

#!/bin/bash
# Description: Extract the implementation of the `fetchDenomsTrace` method to verify response structure.

# Corrected pattern to extract the implementation of `fetchDenomsTrace` method.
ast-grep --lang typescript --pattern 'function fetchDenomsTrace($_) { $$$ }' packages/sdk-ts/src/client/chain/grpc/ChainGrpcIbcApi.ts

Length of output: 135



Script:

#!/bin/bash
# Description: Search for the `fetchDenomsTrace` method definition to verify response structure.

# Search for the `fetchDenomsTrace` method definition.
rg 'fetchDenomsTrace' packages/sdk-ts/src/client/chain/grpc/ChainGrpcIbcApi.ts -A 20

Length of output: 792

packages/sdk-ts/src/core/modules/exchange/msgs/MsgInstantSpotMarketLaunch.spec.ts (2)

15-15: The addition of the minNotional field in the test parameters correctly reflects the new field added to the MsgInstantSpotMarketLaunch class. Ensure that all relevant tests are updated to include this new field.


70-70: The addition of the minNotional field in the Eip712 types is consistent with the changes in the main class. This ensures the Eip712 representation remains accurate.

packages/sdk-ts/src/core/modules/exchange/msgs/MsgInstantSpotMarketLaunch.ts (2)

14-14: The addition of the minNotional field in the Params interface correctly reflects the new requirement for the spot market launch message.


32-32: The update in the createMessage function to include the minNotional field ensures that it is correctly set in the message. This change is necessary for the new business requirements.

jest.config.js (1)

154-154: The addition of /deprecated/ to testPathIgnorePatterns is a good practice to exclude deprecated tests from being run, which helps in maintaining clean test outputs.

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 d5848ad and e61b69b.

Files selected for processing (3)
  • .github/workflows/canary.yml (2 hunks)
  • packages/sdk-ts/package.json (2 hunks)
  • packages/wallet-ts/package.json (2 hunks)
Files skipped from review as they are similar to previous changes (3)
  • .github/workflows/canary.yml
  • packages/sdk-ts/package.json
  • packages/wallet-ts/package.json

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: 2

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between e61b69b and d401495.

Files selected for processing (3)
  • packages/sdk-ts/src/core/modules/authz/msgs/MsgExec.ts (2 hunks)
  • packages/sdk-ts/src/core/modules/gov/msgs/MsgSubmitTextProposal.ts (1 hunks)
  • packages/wallet-ts/src/broadcaster/MsgBroadcaster.ts (4 hunks)
Files not reviewed due to errors (1)
  • packages/wallet-ts/src/broadcaster/MsgBroadcaster.ts (no review received)
Additional context used
Biome
packages/sdk-ts/src/core/modules/authz/msgs/MsgExec.ts

[error] 25-25: Shouldn't redeclare 'MsgExec'. Consider to delete it or rename it. (lint/suspicious/noRedeclare)

'MsgExec' is defined here:

packages/sdk-ts/src/core/modules/gov/msgs/MsgSubmitTextProposal.ts

[error] 34-34: Shouldn't redeclare 'MsgSubmitTextProposal'. Consider to delete it or rename it. (lint/suspicious/noRedeclare)

'MsgSubmitTextProposal' is defined here:

Additional comments not posted (2)
packages/sdk-ts/src/core/modules/authz/msgs/MsgExec.ts (1)

79-101: Review the new toAmino() method implementation.

The new implementation of toAmino() method simplifies the previous logic but it's crucial to ensure that this new logic correctly adheres to the required functionality and that all dependent code has been updated to accommodate this change.

packages/sdk-ts/src/core/modules/gov/msgs/MsgSubmitTextProposal.ts (1)

78-88: Review changes to message structure in toAmino() method.

The restructuring of the message object in the toAmino() method to prioritize content before initialDeposit and moving proposer to the end needs to be verified to ensure that it aligns with the expected data format and does not break any existing functionality.

@@ -1,4 +1,4 @@
import snakecaseKeys from 'snakecase-keys'
// import snakecaseKeys from 'snakecase-keys'
Copy link

Choose a reason for hiding this comment

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

Consider removing or utilizing the commented import.

The import snakecaseKeys from 'snakecase-keys' is commented out, which could indicate that it is no longer needed. If it's not being used anywhere in the file, consider removing it to clean up the code.

Comment on lines 67 to 78
// public toAmino() {
// const proto = this.toProto()
// const message = {
// ...snakecaseKeys(proto),
// msgs: proto.msgs,
// }
//
// return {
// type: 'cosmos-sdk/MsgExec',
// value: message as unknown as MsgExec.Object,
// }
// }
Copy link

Choose a reason for hiding this comment

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

Removed code block needs assessment.

The commented out toAmino() method seems to have been replaced with a new implementation starting from line 79. If the old implementation is no longer needed, consider removing it entirely to reduce clutter and potential confusion in the codebase.

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 d401495 and f0ea762.

Files selected for processing (2)
  • packages/sdk-ts/package.json (2 hunks)
  • packages/wallet-ts/package.json (2 hunks)
Files skipped from review as they are similar to previous changes (2)
  • packages/sdk-ts/package.json
  • packages/wallet-ts/package.json

@ThomasRalee ThomasRalee force-pushed the chore/chain-v50-canary branch from f0ea762 to b370102 Compare June 26, 2024 13:57
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: 21

Outside diff range and nitpick comments (24)
packages/sdk-ts/src/core/modules/exchange/msgs/MsgReclaimLockedFunds.ts (1)

Line range hint 18-18: Redeclaration of MsgReclaimLockedFunds.

The static analysis tool flagged a redeclaration issue. This might be a false positive if the namespace and class are being used distinctly. If not, consider renaming or refactoring to resolve the namespace clash.

- export declare namespace MsgReclaimLockedFunds {
+ export declare namespace ReclaimLockedFundsNamespace {
packages/sdk-ts/src/core/modules/insurance/msgs/MsgRequestRedemption.ts (1)

Line range hint 24-24: Redeclaration of MsgRequestRedemption.

The static analysis tool flagged a redeclaration issue. This might be a false positive if the namespace and class are being used distinctly. If not, consider renaming or refactoring to resolve the namespace clash.

- export declare namespace MsgRequestRedemption {
+ export declare namespace RequestRedemptionNamespace {
packages/sdk-ts/src/core/modules/exchange/msgs/MsgCancelSpotOrder.ts (1)

Line range hint 20-20: Redeclaration of MsgCancelSpotOrder.

The static analysis tool flagged a redeclaration issue. This might be a false positive if the namespace and class are being used distinctly. If not, consider renaming or refactoring to resolve the namespace clash.

- export declare namespace MsgCancelSpotOrder {
+ export declare namespace CancelSpotOrderNamespace {
packages/sdk-ts/src/core/modules/bank/msgs/MsgSend.ts (1)

Line range hint 29-29: Redeclaration of MsgSend.

The static analysis tool flagged a redeclaration issue. This might be a false positive if the namespace and class are being used distinctly. If not, consider renaming or refactoring to resolve the namespace clash.

- export declare namespace MsgSend {
+ export declare namespace SendNamespace {
packages/sdk-ts/src/core/modules/wasm/msgs/MsgInstantiateContract.ts (2)

Line range hint 15-15: Replace the use of Object type with a more specific type.

Using Object as a type is too broad and can lead to issues. Define a more specific interface or type for params.msg.

-    msg: Object
+    msg: { [key: string]: any } // Adjust according to actual expected structure

[!TIP]
Codebase Verification

Address potential redeclaration issue.

The script found multiple instances of MsgInstantiateContract, including both a namespace and a class declaration within the same file (MsgInstantiateContract.ts). This could lead to a redeclaration issue. Please verify and consider refactoring to avoid any conflicts.

  • packages/sdk-ts/src/core/modules/wasm/msgs/MsgInstantiateContract.ts
Analysis chain

Line range hint 28-28: Address potential redeclaration issue.

The static analysis tool flagged a redeclaration of MsgInstantiateContract. If this is a false positive due to namespace usage or similar patterns, it can be ignored. Otherwise, consider renaming or refactoring to address the issue.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the context of the redeclaration issue.

# Test: Search for all declarations of `MsgInstantiateContract` to understand the context.
rg --type typescript $'MsgInstantiateContract'

Length of output: 80



Script:

#!/bin/bash
# Description: Verify the context of the redeclaration issue.

# Test: Search for all declarations of `MsgInstantiateContract` to understand the context.
rg --type ts $'MsgInstantiateContract'

Length of output: 2417

packages/sdk-ts/src/core/modules/authz/msgs/MsgExec.ts (1)

[!TIP]
Codebase Verification

Address potential redeclaration issue.

The static analysis tool's flagging of a potential redeclaration of MsgExec is valid. There are multiple occurrences of MsgExec in the codebase, particularly in the following files:

  • packages/sdk-ts/src/core/modules/msgs.ts:
    • Line: import MsgExec from './wasm/msgs/MsgPrivilegedExecuteContract'
    • Line: import MsgAuthzExec from './authz/msgs/MsgExec'
  • packages/sdk-ts/src/core/modules/authz/msgs/MsgExec.ts:
    • Line: export default class MsgExec extends MsgBase<

These multiple imports and declarations can lead to confusion and potential issues with redeclaration. Consider renaming or refactoring the imports and class names to ensure clarity and avoid conflicts.

Analysis chain

Line range hint 25-25: Address potential redeclaration issue.

The static analysis tool flagged a redeclaration of MsgExec. If this is a false positive due to namespace usage or similar patterns, it can be ignored. Otherwise, consider renaming or refactoring to address the issue.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the context of the redeclaration issue.

# Test: Search for all declarations of `MsgExec` to understand the context.
rg --type typescript $'MsgExec'

Length of output: 65



Script:

#!/bin/bash
# Description: Verify the context of the redeclaration issue.

# Test: Search for all declarations of `MsgExec` in TypeScript files to understand the context.
rg 'MsgExec' --glob '*.ts'

Length of output: 11707

packages/sdk-ts/src/core/modules/exchange/msgs/MsgCancelBinaryOptionsOrder.ts (1)

Line range hint 39-50: Ensure consistency in handling orderMask.

The comment at line 48 indicates a future change needed when the chain handles orderMask properly. It's good to add a FIXME tag to ensure this doesn't get overlooked.

- // TODO: Send order.orderMask instead when chain handles order mask properly.
+ // FIXME: Update orderMask handling once the chain supports it.
packages/sdk-ts/src/core/modules/exchange/msgs/MsgIncreasePositionMargin.ts (1)

[!TIP]
Codebase Verification

Address potential redeclaration issue.

The script results indicate that both a namespace and a class named MsgIncreasePositionMargin are declared in the same file. This could lead to a redeclaration issue if not intended.

  • File: packages/sdk-ts/src/core/modules/exchange/msgs/MsgIncreasePositionMargin.ts
  • Lines:
    • export declare namespace MsgIncreasePositionMargin {
    • export default class MsgIncreasePositionMargin extends MsgBase<

Please review these declarations to ensure they are intended and do not cause any redeclaration issues.

Analysis chain

Line range hint 35-35: Address potential redeclaration issue.

The static analysis tool has flagged a possible redeclaration of MsgIncreasePositionMargin. This could be a false positive if it's due to TypeScript's declaration merging feature, but it should be verified.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Check for redeclarations of MsgIncreasePositionMargin.

# Test: Search for multiple declarations. Expect: Only one declaration.
rg --type typescript $'export declare namespace MsgIncreasePositionMargin' --count

Length of output: 118



Script:

#!/bin/bash
# Description: Check for redeclarations of MsgIncreasePositionMargin.

# Test: Search for multiple declarations. Expect: Only one declaration.
rg 'export (class|namespace) MsgIncreasePositionMargin' --count

Length of output: 65



Script:

#!/bin/bash
# Description: Check for any declarations of MsgIncreasePositionMargin.

# Test: Search for multiple declarations. Expect: Only one declaration.
rg 'class MsgIncreasePositionMargin|namespace MsgIncreasePositionMargin'

Length of output: 343

packages/sdk-ts/src/core/modules/exchange/msgs/MsgLiquidatePosition.ts (1)

Line range hint 34-34: Redeclaration issue reported by static analysis.

Consider renaming the class if it's intentionally redeclared or remove the duplicate declaration.

packages/sdk-ts/src/core/modules/exchange/msgs/MsgInstantSpotMarketLaunch.ts (1)

Line range hint 42-42: Redeclaration issue reported by static analysis.

Consider renaming the class if it's intentionally redeclared or remove the duplicate declaration.

packages/sdk-ts/src/core/modules/ibc/msgs/MsgTransferCosmjs.ts (1)

Line range hint 34-34: Redeclaration issue reported by static analysis.

Consider renaming the class if it's intentionally redeclared or remove the duplicate declaration.

packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateSpotLimitOrder.ts (1)

Line range hint 55-55: Redeclaration issue reported by static analysis.

Consider renaming the class if it's intentionally redeclared or remove the duplicate declaration.

packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateSpotMarketOrder.ts (1)

Line range hint 57-57: Redeclaration issue reported by static analysis.

Consider renaming the class if it's intentionally redeclared or remove the duplicate declaration.

packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateBinaryOptionsMarketOrder.ts (1)

Line range hint 64-64: Consider renaming or removing duplicate declaration.

The class MsgCreateBinaryOptionsMarketOrder is flagged as redeclared. Ensure that there are no duplicate declarations in the codebase which could lead to ambiguity in usage.

packages/sdk-ts/src/core/modules/wasm/msgs/MsgExecuteContractCompat.ts (2)

Line range hint 68-68: Consider renaming or removing duplicate declaration.

The class MsgExecuteContractCompat is flagged as redeclared. Verify if this is due to erroneous code generation or a genuine need for a new definition.


Line range hint 123-123: Optimize performance by avoiding the delete operator.

Using delete can lead to performance issues due to deoptimization. Consider setting the property to undefined instead.

- delete message.funds_list
+ message.funds_list = undefined
packages/sdk-ts/src/core/modules/staking/msgs/MsgCreateValidator.ts (1)

Line range hint 50-50: Consider renaming or removing duplicate declaration.

The class MsgCreateValidator is flagged as redeclared. This might cause confusion and errors in the codebase.

packages/sdk-ts/src/core/modules/exchange/msgs/MsgInstantBinaryOptionsMarketLaunch.ts (1)

Line range hint 62-62: Consider renaming or removing duplicate declaration.

The class MsgInstantBinaryOptionsMarketLaunch is flagged as redeclared. Ensure uniqueness in class names to prevent potential conflicts.

packages/sdk-ts/src/core/modules/feegrant/msgs/MsgGrantAllowance.ts (1)

Line range hint 36-36: Consider renaming or removing duplicate declaration.

The class MsgGrantAllowance is flagged as redeclared. Review and ensure that there is no unintentional code duplication.

packages/sdk-ts/src/core/modules/gov/msgs/MsgSubmitProposalSpotMarketLaunch.ts (1)

Line range hint 80-116: Potential Issue: Inconsistent fee rate assignment.

The takerFeeRate is mistakenly set to makerFeeRate. This could be a copy-paste error and should be corrected unless intentional.

- takerFeeRate: amountToCosmosSdkDecAmount(params.market.makerFeeRate).toFixed(),
+ takerFeeRate: amountToCosmosSdkDecAmount(params.market.takerFeeRate).toFixed(),
packages/sdk-ts/src/core/modules/gov/msgs/MsgSubmitProposalPerpetualMarketLaunch.ts (1)

Line range hint 91-130: Potential Issue: Inconsistent fee rate assignment.

The takerFeeRate is mistakenly set to makerFeeRate. This could be a copy-paste error and should be corrected unless intentional.

- takerFeeRate: amountToCosmosSdkDecAmount(params.market.makerFeeRate).toFixed(),
+ takerFeeRate: amountToCosmosSdkDecAmount(params.market.takerFeeRate).toFixed(),
packages/sdk-ts/src/core/modules/gov/msgs/MsgSubmitProposalExpiryFuturesMarketLaunch.ts (1)

Line range hint 149-182: Code Improvement: Enhance data structure consistency.

The structure for the amino message could be improved for better consistency and readability. Consider using a more structured approach to creating these nested objects.

- const messageWithProposalType = snakecaseKeys({
-   content: {
-     type: 'exchange/ExpiryFuturesMarketLaunchProposal',
-     value: this.getContent(),
-   },
-   initialDeposit: [{
-     denom: params.deposit.denom,
-     amount: params.deposit.amount,
-   }],
-   proposer: params.proposer,
- });
+ const messageWithProposalType = snakecaseKeys({
+   content: {
+     type: 'exchange/ExpiryFuturesMarketLaunchProposal',
+     value: this.getContent(),
+   },
+   initialDeposit: [params.deposit],
+   proposer: params.proposer,
+ });
jest.config.js (1)

Line range hint 7-7: Optimize the use of spread syntax in accumulators.

The use of spread syntax in the reduce function accumulators is flagged by the static analysis tool due to its O(n^2) performance impact. Consider using methods like .push or direct assignment to enhance performance.

-      return { ...result, [key]: compilerOptions.paths[key] }
+      result[key] = compilerOptions.paths[key];
+      return result;

Also applies to: 17-17

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between f0ea762 and 7784ca7.

Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
Files selected for processing (70)
  • .github/workflows/canary.yml (2 hunks)
  • jest.config.js (1 hunks)
  • packages/sdk-ts/package.json (2 hunks)
  • packages/sdk-ts/src/client/chain/grpc/ChainGrpcIbcApi.spec.ts (3 hunks)
  • packages/sdk-ts/src/client/chain/grpc/ChainGrpcIbcApi.ts (4 hunks)
  • packages/sdk-ts/src/core/modules/auction/msgs/MsgBid.ts (2 hunks)
  • packages/sdk-ts/src/core/modules/authz/msgs/MsgExec.ts (3 hunks)
  • packages/sdk-ts/src/core/modules/authz/msgs/MsgGrant.ts (3 hunks)
  • packages/sdk-ts/src/core/modules/authz/msgs/MsgRevoke.ts (1 hunks)
  • packages/sdk-ts/src/core/modules/bank/msgs/MsgMultiSend.ts (3 hunks)
  • packages/sdk-ts/src/core/modules/bank/msgs/MsgSend.ts (1 hunks)
  • packages/sdk-ts/src/core/modules/distribution/msgs/MsgWithdrawDelegatorReward.ts (1 hunks)
  • packages/sdk-ts/src/core/modules/distribution/msgs/MsgWithdrawValidatorCommission.ts (1 hunks)
  • packages/sdk-ts/src/core/modules/exchange/msgs/MsgAdminUpdateBinaryOptionsMarket.ts (1 hunks)
  • packages/sdk-ts/src/core/modules/exchange/msgs/MsgBatchCancelBinaryOptionsOrders.ts (1 hunks)
  • packages/sdk-ts/src/core/modules/exchange/msgs/MsgBatchCancelDerivativeOrders.ts (1 hunks)
  • packages/sdk-ts/src/core/modules/exchange/msgs/MsgBatchCancelSpotOrders.ts (1 hunks)
  • packages/sdk-ts/src/core/modules/exchange/msgs/MsgBatchUpdateOrders.ts (9 hunks)
  • packages/sdk-ts/src/core/modules/exchange/msgs/MsgCancelBinaryOptionsOrder.ts (2 hunks)
  • packages/sdk-ts/src/core/modules/exchange/msgs/MsgCancelDerivativeOrder.ts (1 hunks)
  • packages/sdk-ts/src/core/modules/exchange/msgs/MsgCancelSpotOrder.ts (1 hunks)
  • packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateBinaryOptionsLimitOrder.ts (2 hunks)
  • packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateBinaryOptionsMarketOrder.ts (2 hunks)
  • packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateDerivativeLimitOrder.ts (2 hunks)
  • packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateDerivativeMarketOrder.ts (1 hunks)
  • packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateSpotLimitOrder.ts (1 hunks)
  • packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateSpotMarketOrder.ts (1 hunks)
  • packages/sdk-ts/src/core/modules/exchange/msgs/MsgDeposit.ts (1 hunks)
  • packages/sdk-ts/src/core/modules/exchange/msgs/MsgExternalTransfer.ts (1 hunks)
  • packages/sdk-ts/src/core/modules/exchange/msgs/MsgIncreasePositionMargin.ts (1 hunks)
  • packages/sdk-ts/src/core/modules/exchange/msgs/MsgInstantBinaryOptionsMarketLaunch.ts (3 hunks)
  • packages/sdk-ts/src/core/modules/exchange/msgs/MsgInstantSpotMarketLaunch.spec.ts (2 hunks)
  • packages/sdk-ts/src/core/modules/exchange/msgs/MsgInstantSpotMarketLaunch.ts (2 hunks)
  • packages/sdk-ts/src/core/modules/exchange/msgs/MsgLiquidatePosition.ts (2 hunks)
  • packages/sdk-ts/src/core/modules/exchange/msgs/MsgReclaimLockedFunds.ts (1 hunks)
  • packages/sdk-ts/src/core/modules/exchange/msgs/MsgRewardsOptOut.ts (1 hunks)
  • packages/sdk-ts/src/core/modules/exchange/msgs/MsgWithdraw.ts (1 hunks)
  • packages/sdk-ts/src/core/modules/feegrant/msgs/MsgGrantAllowance.ts (5 hunks)
  • packages/sdk-ts/src/core/modules/feegrant/msgs/MsgRevokeAllowance.ts (1 hunks)
  • packages/sdk-ts/src/core/modules/gov/msgs/MsgDeposit.ts (1 hunks)
  • packages/sdk-ts/src/core/modules/gov/msgs/MsgSubmitProposalExpiryFuturesMarketLaunch.ts (4 hunks)
  • packages/sdk-ts/src/core/modules/gov/msgs/MsgSubmitProposalPerpetualMarketLaunch.ts (5 hunks)
  • packages/sdk-ts/src/core/modules/gov/msgs/MsgSubmitProposalSpotMarketLaunch.ts (5 hunks)
  • packages/sdk-ts/src/core/modules/gov/msgs/MsgSubmitProposalSpotMarketParamUpdate.ts (6 hunks)
  • packages/sdk-ts/src/core/modules/gov/msgs/MsgSubmitTextProposal.ts (4 hunks)
  • packages/sdk-ts/src/core/modules/gov/msgs/MsgVote.ts (1 hunks)
  • packages/sdk-ts/src/core/modules/ibc/msgs/MsgTransfer.ts (2 hunks)
  • packages/sdk-ts/src/core/modules/ibc/msgs/MsgTransferCosmjs.ts (2 hunks)
  • packages/sdk-ts/src/core/modules/insurance/msgs/MsgCreateInsuranceFund.ts (1 hunks)
  • packages/sdk-ts/src/core/modules/insurance/msgs/MsgRequestRedemption.ts (1 hunks)
  • packages/sdk-ts/src/core/modules/insurance/msgs/MsgUnderwrite.ts (1 hunks)
  • packages/sdk-ts/src/core/modules/peggy/msgs/MsgSendToEth.ts (2 hunks)
  • packages/sdk-ts/src/core/modules/staking/msgs/MsgBeginRedelegate.ts (1 hunks)
  • packages/sdk-ts/src/core/modules/staking/msgs/MsgCancelUnbondingDelegation.ts (1 hunks)
  • packages/sdk-ts/src/core/modules/staking/msgs/MsgCreateValidator.ts (3 hunks)
  • packages/sdk-ts/src/core/modules/staking/msgs/MsgDelegate.ts (1 hunks)
  • packages/sdk-ts/src/core/modules/staking/msgs/MsgEditValidator.ts (2 hunks)
  • packages/sdk-ts/src/core/modules/staking/msgs/MsgUndelegate.ts (1 hunks)
  • packages/sdk-ts/src/core/modules/tokenfactory/msgs/MsgBurn.ts (2 hunks)
  • packages/sdk-ts/src/core/modules/tokenfactory/msgs/MsgChangeAdmin.ts (1 hunks)
  • packages/sdk-ts/src/core/modules/tokenfactory/msgs/MsgCreateDenom.ts (1 hunks)
  • packages/sdk-ts/src/core/modules/tokenfactory/msgs/MsgMint.ts (2 hunks)
  • packages/sdk-ts/src/core/modules/tokenfactory/msgs/MsgSetDenomMetadata.ts (2 hunks)
  • packages/sdk-ts/src/core/modules/tx/types/tx-rest-client.ts (1 hunks)
  • packages/sdk-ts/src/core/modules/wasm/msgs/MsgExecuteContract.ts (2 hunks)
  • packages/sdk-ts/src/core/modules/wasm/msgs/MsgExecuteContractCompat.ts (1 hunks)
  • packages/sdk-ts/src/core/modules/wasm/msgs/MsgInstantiateContract.ts (1 hunks)
  • packages/sdk-ts/src/core/modules/wasm/msgs/MsgMigrateContract.ts (1 hunks)
  • packages/wallet-ts/package.json (2 hunks)
  • packages/wallet-ts/src/broadcaster/MsgBroadcaster.ts (4 hunks)
Files not reviewed due to errors (9)
  • packages/sdk-ts/src/core/modules/tokenfactory/msgs/MsgChangeAdmin.ts (no review received)
  • packages/sdk-ts/src/core/modules/exchange/msgs/MsgDeposit.ts (no review received)
  • packages/sdk-ts/src/core/modules/staking/msgs/MsgDelegate.ts (no review received)
  • packages/sdk-ts/src/core/modules/wasm/msgs/MsgMigrateContract.ts (no review received)
  • packages/sdk-ts/src/core/modules/ibc/msgs/MsgTransfer.ts (no review received)
  • packages/sdk-ts/src/core/modules/exchange/msgs/MsgBatchCancelSpotOrders.ts (no review received)
  • packages/sdk-ts/src/core/modules/exchange/msgs/MsgBatchCancelDerivativeOrders.ts (no review received)
  • packages/sdk-ts/src/core/modules/exchange/msgs/MsgBatchCancelBinaryOptionsOrders.ts (no review received)
  • packages/sdk-ts/src/core/modules/staking/msgs/MsgEditValidator.ts (no review received)
Files skipped from review due to trivial changes (2)
  • packages/sdk-ts/package.json
  • packages/wallet-ts/package.json
Additional context used
Biome
packages/sdk-ts/src/core/modules/gov/msgs/MsgVote.ts

[error] 19-19: Shouldn't redeclare 'MsgVote'. Consider to delete it or rename it. (lint/suspicious/noRedeclare)

'MsgVote' is defined here:

packages/sdk-ts/src/core/modules/exchange/msgs/MsgRewardsOptOut.ts

[error] 16-16: Shouldn't redeclare 'MsgRewardsOptOut'. Consider to delete it or rename it. (lint/suspicious/noRedeclare)

'MsgRewardsOptOut' is defined here:

packages/sdk-ts/src/core/modules/authz/msgs/MsgRevoke.ts

[error] 18-18: Shouldn't redeclare 'MsgRevoke'. Consider to delete it or rename it. (lint/suspicious/noRedeclare)

'MsgRevoke' is defined here:

packages/sdk-ts/src/core/modules/tokenfactory/msgs/MsgChangeAdmin.ts

[error] 18-18: Shouldn't redeclare 'MsgChangeAdmin'. Consider to delete it or rename it. (lint/suspicious/noRedeclare)

'MsgChangeAdmin' is defined here:

packages/sdk-ts/src/core/modules/feegrant/msgs/MsgRevokeAllowance.ts

[error] 17-17: Shouldn't redeclare 'MsgRevokeAllowance'. Consider to delete it or rename it. (lint/suspicious/noRedeclare)

'MsgRevokeAllowance' is defined here:

packages/sdk-ts/src/core/modules/gov/msgs/MsgDeposit.ts

[error] 24-24: Shouldn't redeclare 'MsgDeposit'. Consider to delete it or rename it. (lint/suspicious/noRedeclare)

'MsgDeposit' is defined here:

packages/sdk-ts/src/core/modules/tokenfactory/msgs/MsgBurn.ts

[error] 23-23: Shouldn't redeclare 'MsgBurn'. Consider to delete it or rename it. (lint/suspicious/noRedeclare)

'MsgBurn' is defined here:

packages/sdk-ts/src/core/modules/tokenfactory/msgs/MsgMint.ts

[error] 23-23: Shouldn't redeclare 'MsgMint'. Consider to delete it or rename it. (lint/suspicious/noRedeclare)

'MsgMint' is defined here:

packages/sdk-ts/src/core/modules/distribution/msgs/MsgWithdrawValidatorCommission.ts

[error] 16-16: Shouldn't redeclare 'MsgWithdrawValidatorCommission'. Consider to delete it or rename it. (lint/suspicious/noRedeclare)

'MsgWithdrawValidatorCommission' is defined here:

packages/sdk-ts/src/core/modules/tokenfactory/msgs/MsgCreateDenom.ts

[error] 19-19: Shouldn't redeclare 'MsgCreateDenom'. Consider to delete it or rename it. (lint/suspicious/noRedeclare)

'MsgCreateDenom' is defined here:

packages/sdk-ts/src/core/modules/auction/msgs/MsgBid.ts

[error] 24-24: Shouldn't redeclare 'MsgBid'. Consider to delete it or rename it. (lint/suspicious/noRedeclare)

'MsgBid' is defined here:

packages/sdk-ts/src/core/modules/exchange/msgs/MsgDeposit.ts

[error] 24-24: Shouldn't redeclare 'MsgDeposit'. Consider to delete it or rename it. (lint/suspicious/noRedeclare)

'MsgDeposit' is defined here:

packages/sdk-ts/src/core/modules/staking/msgs/MsgDelegate.ts

[error] 24-24: Shouldn't redeclare 'MsgDelegate'. Consider to delete it or rename it. (lint/suspicious/noRedeclare)

'MsgDelegate' is defined here:

packages/sdk-ts/src/core/modules/insurance/msgs/MsgUnderwrite.ts

[error] 24-24: Shouldn't redeclare 'MsgUnderwrite'. Consider to delete it or rename it. (lint/suspicious/noRedeclare)

'MsgUnderwrite' is defined here:

packages/sdk-ts/src/core/modules/exchange/msgs/MsgWithdraw.ts

[error] 24-24: Shouldn't redeclare 'MsgWithdraw'. Consider to delete it or rename it. (lint/suspicious/noRedeclare)

'MsgWithdraw' is defined here:

packages/sdk-ts/src/core/modules/distribution/msgs/MsgWithdrawDelegatorReward.ts

[error] 17-17: Shouldn't redeclare 'MsgWithdrawDelegatorReward'. Consider to delete it or rename it. (lint/suspicious/noRedeclare)

'MsgWithdrawDelegatorReward' is defined here:

packages/sdk-ts/src/core/modules/staking/msgs/MsgUndelegate.ts

[error] 24-24: Shouldn't redeclare 'MsgUndelegate'. Consider to delete it or rename it. (lint/suspicious/noRedeclare)

'MsgUndelegate' is defined here:

packages/sdk-ts/src/core/modules/wasm/msgs/MsgMigrateContract.ts

[error] 24-24: Shouldn't redeclare 'MsgMigrateContract'. Consider to delete it or rename it. (lint/suspicious/noRedeclare)

'MsgMigrateContract' is defined here:

packages/sdk-ts/src/core/modules/exchange/msgs/MsgReclaimLockedFunds.ts

[error] 18-18: Shouldn't redeclare 'MsgReclaimLockedFunds'. Consider to delete it or rename it. (lint/suspicious/noRedeclare)

'MsgReclaimLockedFunds' is defined here:

packages/sdk-ts/src/core/modules/insurance/msgs/MsgRequestRedemption.ts

[error] 24-24: Shouldn't redeclare 'MsgRequestRedemption'. Consider to delete it or rename it. (lint/suspicious/noRedeclare)

'MsgRequestRedemption' is defined here:

packages/sdk-ts/src/core/modules/exchange/msgs/MsgCancelSpotOrder.ts

[error] 20-20: Shouldn't redeclare 'MsgCancelSpotOrder'. Consider to delete it or rename it. (lint/suspicious/noRedeclare)

'MsgCancelSpotOrder' is defined here:

packages/sdk-ts/src/core/modules/bank/msgs/MsgSend.ts

[error] 29-29: Shouldn't redeclare 'MsgSend'. Consider to delete it or rename it. (lint/suspicious/noRedeclare)

'MsgSend' is defined here:

packages/sdk-ts/src/core/modules/exchange/msgs/MsgExternalTransfer.ts

[error] 25-25: Shouldn't redeclare 'MsgExternalTransfer'. Consider to delete it or rename it. (lint/suspicious/noRedeclare)

'MsgExternalTransfer' is defined here:

packages/sdk-ts/src/core/modules/staking/msgs/MsgBeginRedelegate.ts

[error] 25-25: Shouldn't redeclare 'MsgBeginRedelegate'. Consider to delete it or rename it. (lint/suspicious/noRedeclare)

'MsgBeginRedelegate' is defined here:

packages/sdk-ts/src/core/modules/wasm/msgs/MsgInstantiateContract.ts

[error] 28-28: Shouldn't redeclare 'MsgInstantiateContract'. Consider to delete it or rename it. (lint/suspicious/noRedeclare)

'MsgInstantiateContract' is defined here:


[error] 15-15: Don't use 'Object' as a type. (lint/complexity/noBannedTypes)

Prefer explicitly define the object shape. This type means "any non-nullable value", which is slightly better than 'unknown', but it's still a broad type.

packages/sdk-ts/src/core/modules/authz/msgs/MsgExec.ts

[error] 25-25: Shouldn't redeclare 'MsgExec'. Consider to delete it or rename it. (lint/suspicious/noRedeclare)

'MsgExec' is defined here:

packages/sdk-ts/src/core/modules/staking/msgs/MsgCancelUnbondingDelegation.ts

[error] 25-25: Shouldn't redeclare 'MsgCancelUnbondingDelegation'. Consider to delete it or rename it. (lint/suspicious/noRedeclare)

'MsgCancelUnbondingDelegation' is defined here:

packages/sdk-ts/src/core/modules/exchange/msgs/MsgCancelBinaryOptionsOrder.ts

[error] 24-24: Shouldn't redeclare 'MsgCancelBinaryOptionsOrder'. Consider to delete it or rename it. (lint/suspicious/noRedeclare)

'MsgCancelBinaryOptionsOrder' is defined here:

packages/sdk-ts/src/core/modules/exchange/msgs/MsgCancelDerivativeOrder.ts

[error] 21-21: Shouldn't redeclare 'MsgCancelDerivativeOrder'. Consider to delete it or rename it. (lint/suspicious/noRedeclare)

'MsgCancelDerivativeOrder' is defined here:

packages/sdk-ts/src/core/modules/peggy/msgs/MsgSendToEth.ts

[error] 32-32: Shouldn't redeclare 'MsgSendToEth'. Consider to delete it or rename it. (lint/suspicious/noRedeclare)

'MsgSendToEth' is defined here:

packages/sdk-ts/src/core/modules/exchange/msgs/MsgAdminUpdateBinaryOptionsMarket.ts

[error] 23-23: Shouldn't redeclare 'MsgAdminUpdateBinaryOptionsMarket'. Consider to delete it or rename it. (lint/suspicious/noRedeclare)

'MsgAdminUpdateBinaryOptionsMarket' is defined here:

packages/sdk-ts/src/core/modules/bank/msgs/MsgMultiSend.ts

[error] 27-27: Shouldn't redeclare 'MsgMultiSend'. Consider to delete it or rename it. (lint/suspicious/noRedeclare)

'MsgMultiSend' is defined here:

packages/sdk-ts/src/core/modules/exchange/msgs/MsgIncreasePositionMargin.ts

[error] 35-35: Shouldn't redeclare 'MsgIncreasePositionMargin'. Consider to delete it or rename it. (lint/suspicious/noRedeclare)

'MsgIncreasePositionMargin' is defined here:

packages/sdk-ts/src/core/modules/insurance/msgs/MsgCreateInsuranceFund.ts

[error] 32-32: Shouldn't redeclare 'MsgCreateInsuranceFund'. Consider to delete it or rename it. (lint/suspicious/noRedeclare)

'MsgCreateInsuranceFund' is defined here:

packages/sdk-ts/src/core/modules/tokenfactory/msgs/MsgSetDenomMetadata.ts

[error] 20-20: Shouldn't redeclare 'MsgSetDenomMetadata'. Consider to delete it or rename it. (lint/suspicious/noRedeclare)

'MsgSetDenomMetadata' is defined here:

packages/sdk-ts/src/core/modules/ibc/msgs/MsgTransfer.ts

[error] 33-33: Shouldn't redeclare 'MsgTransfer'. Consider to delete it or rename it. (lint/suspicious/noRedeclare)

'MsgTransfer' is defined here:

packages/sdk-ts/src/core/modules/exchange/msgs/MsgBatchCancelSpotOrders.ts

[error] 26-26: Shouldn't redeclare 'MsgBatchCancelSpotOrders'. Consider to delete it or rename it. (lint/suspicious/noRedeclare)

'MsgBatchCancelSpotOrders' is defined here:

packages/sdk-ts/src/core/modules/exchange/msgs/MsgBatchCancelDerivativeOrders.ts

[error] 26-26: Shouldn't redeclare 'MsgBatchCancelDerivativeOrders'. Consider to delete it or rename it. (lint/suspicious/noRedeclare)

'MsgBatchCancelDerivativeOrders' is defined here:

packages/sdk-ts/src/core/modules/exchange/msgs/MsgBatchCancelBinaryOptionsOrders.ts

[error] 27-27: Shouldn't redeclare 'MsgBatchCancelBinaryOptionsOrders'. Consider to delete it or rename it. (lint/suspicious/noRedeclare)

'MsgBatchCancelBinaryOptionsOrders' is defined here:

packages/sdk-ts/src/core/modules/staking/msgs/MsgEditValidator.ts

[error] 28-28: Shouldn't redeclare 'MsgEditValidator'. Consider to delete it or rename it. (lint/suspicious/noRedeclare)

'MsgEditValidator' is defined here:

packages/sdk-ts/src/core/modules/exchange/msgs/MsgLiquidatePosition.ts

[error] 34-34: Shouldn't redeclare 'MsgLiquidatePosition'. Consider to delete it or rename it. (lint/suspicious/noRedeclare)

'MsgLiquidatePosition' is defined here:

packages/sdk-ts/src/core/modules/exchange/msgs/MsgInstantSpotMarketLaunch.ts

[error] 42-42: Shouldn't redeclare 'MsgInstantSpotMarketLaunch'. Consider to delete it or rename it. (lint/suspicious/noRedeclare)

'MsgInstantSpotMarketLaunch' is defined here:

packages/sdk-ts/src/core/modules/ibc/msgs/MsgTransferCosmjs.ts

[error] 34-34: Shouldn't redeclare 'MsgTransferCosmjs'. Consider to delete it or rename it. (lint/suspicious/noRedeclare)

'MsgTransferCosmjs' is defined here:

packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateSpotLimitOrder.ts

[error] 55-55: Shouldn't redeclare 'MsgCreateSpotLimitOrder'. Consider to delete it or rename it. (lint/suspicious/noRedeclare)

'MsgCreateSpotLimitOrder' is defined here:

packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateSpotMarketOrder.ts

[error] 57-57: Shouldn't redeclare 'MsgCreateSpotMarketOrder'. Consider to delete it or rename it. (lint/suspicious/noRedeclare)

'MsgCreateSpotMarketOrder' is defined here:

packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateDerivativeLimitOrder.ts

[error] 59-59: Shouldn't redeclare 'MsgCreateDerivativeLimitOrder'. Consider to delete it or rename it. (lint/suspicious/noRedeclare)

'MsgCreateDerivativeLimitOrder' is defined here:

packages/sdk-ts/src/core/modules/gov/msgs/MsgSubmitTextProposal.ts

[error] 34-34: Shouldn't redeclare 'MsgSubmitTextProposal'. Consider to delete it or rename it. (lint/suspicious/noRedeclare)

'MsgSubmitTextProposal' is defined here:

packages/sdk-ts/src/core/modules/wasm/msgs/MsgExecuteContract.ts

[error] 50-50: Shouldn't redeclare 'MsgExecuteContract'. Consider to delete it or rename it. (lint/suspicious/noRedeclare)

'MsgExecuteContract' is defined here:

packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateDerivativeMarketOrder.ts

[error] 61-61: Shouldn't redeclare 'MsgCreateDerivativeMarketOrder'. Consider to delete it or rename it. (lint/suspicious/noRedeclare)

'MsgCreateDerivativeMarketOrder' is defined here:

packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateBinaryOptionsLimitOrder.ts

[error] 63-63: Shouldn't redeclare 'MsgCreateBinaryOptionsLimitOrder'. Consider to delete it or rename it. (lint/suspicious/noRedeclare)

'MsgCreateBinaryOptionsLimitOrder' is defined here:

packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateBinaryOptionsMarketOrder.ts

[error] 64-64: Shouldn't redeclare 'MsgCreateBinaryOptionsMarketOrder'. Consider to delete it or rename it. (lint/suspicious/noRedeclare)

'MsgCreateBinaryOptionsMarketOrder' is defined here:

packages/sdk-ts/src/core/modules/wasm/msgs/MsgExecuteContractCompat.ts

[error] 123-123: Avoid the delete operator which can impact performance. (lint/performance/noDelete)

Unsafe fix: Use an undefined assignment instead.


[error] 68-68: Shouldn't redeclare 'MsgExecuteContractCompat'. Consider to delete it or rename it. (lint/suspicious/noRedeclare)

'MsgExecuteContractCompat' is defined here:

packages/sdk-ts/src/core/modules/staking/msgs/MsgCreateValidator.ts

[error] 94-94: rate is assigned to itself. (lint/correctness/noSelfAssign)

This is where is assigned.


[error] 95-95: maxRate is assigned to itself. (lint/correctness/noSelfAssign)

This is where is assigned.


[error] 96-96: maxChangeRate is assigned to itself. (lint/correctness/noSelfAssign)

This is where is assigned.


[error] 50-50: Shouldn't redeclare 'MsgCreateValidator'. Consider to delete it or rename it. (lint/suspicious/noRedeclare)

'MsgCreateValidator' is defined here:

packages/sdk-ts/src/core/modules/exchange/msgs/MsgInstantBinaryOptionsMarketLaunch.ts

[error] 62-62: Shouldn't redeclare 'MsgInstantBinaryOptionsMarketLaunch'. Consider to delete it or rename it. (lint/suspicious/noRedeclare)

'MsgInstantBinaryOptionsMarketLaunch' is defined here:

packages/sdk-ts/src/core/modules/feegrant/msgs/MsgGrantAllowance.ts

[error] 36-36: Shouldn't redeclare 'MsgGrantAllowance'. Consider to delete it or rename it. (lint/suspicious/noRedeclare)

'MsgGrantAllowance' is defined here:

packages/sdk-ts/src/core/modules/gov/msgs/MsgSubmitProposalSpotMarketLaunch.ts

[error] 65-65: Shouldn't redeclare 'MsgSubmitProposalSpotMarketLaunch'. Consider to delete it or rename it. (lint/suspicious/noRedeclare)

'MsgSubmitProposalSpotMarketLaunch' is defined here:

packages/sdk-ts/src/core/modules/gov/msgs/MsgSubmitProposalSpotMarketParamUpdate.ts

[error] 68-68: Shouldn't redeclare 'MsgSubmitProposalSpotMarketParamUpdate'. Consider to delete it or rename it. (lint/suspicious/noRedeclare)

'MsgSubmitProposalSpotMarketParamUpdate' is defined here:

packages/sdk-ts/src/core/modules/authz/msgs/MsgGrant.ts

[error] 39-39: Shouldn't redeclare 'MsgGrant'. Consider to delete it or rename it. (lint/suspicious/noRedeclare)

'MsgGrant' is defined here:

packages/sdk-ts/src/core/modules/gov/msgs/MsgSubmitProposalPerpetualMarketLaunch.ts

[error] 76-76: Shouldn't redeclare 'MsgSubmitProposalPerpetualMarketLaunch'. Consider to delete it or rename it. (lint/suspicious/noRedeclare)

'MsgSubmitProposalPerpetualMarketLaunch' is defined here:

packages/sdk-ts/src/core/modules/gov/msgs/MsgSubmitProposalExpiryFuturesMarketLaunch.ts

[error] 78-78: Shouldn't redeclare 'MsgSubmitProposalExpiryFuturesMarketLaunch'. Consider to delete it or rename it. (lint/suspicious/noRedeclare)

'MsgSubmitProposalExpiryFuturesMarketLaunch' is defined here:

jest.config.js

[error] 7-7: Avoid the use of spread (...) syntax on accumulators. (lint/performance/noAccumulatingSpread)

Spread syntax should be avoided on accumulators (like those in .reduce) because it causes a time complexity of O(n^2).
Consider methods such as .splice or .push instead.


[error] 17-17: Avoid the use of spread (...) syntax on accumulators. (lint/performance/noAccumulatingSpread)

Spread syntax should be avoided on accumulators (like those in .reduce) because it causes a time complexity of O(n^2).
Consider methods such as .splice or .push instead.

packages/sdk-ts/src/core/modules/exchange/msgs/MsgBatchUpdateOrders.ts

[error] 71-71: Shouldn't redeclare 'MsgBatchUpdateOrders'. Consider to delete it or rename it. (lint/suspicious/noRedeclare)

'MsgBatchUpdateOrders' is defined here:

Additional comments not posted (84)
packages/sdk-ts/src/core/modules/gov/msgs/MsgVote.ts (2)

28-32: Review Metadata Handling in MsgVote

The change to use proposalId as metadata seems incorrect or unintended. This could lead to data integrity issues if metadata is expected to carry specific data unrelated to proposalId.

- message.metadata = params.proposalId.toString()
+ message.metadata = params.metadata

Likely invalid or redundant comment.


Line range hint 19-19: Address Redeclaration Issue

The static analysis tool flagged that MsgVote is redeclared. This needs to be verified and corrected if true, as it could lead to unexpected behavior or compilation errors.

packages/sdk-ts/src/core/modules/exchange/msgs/MsgRewardsOptOut.ts (2)

28-28: Correct Implementation of Sender Assignment

The implementation correctly assigns the sender from parameters to the message. This is straightforward and appears correct given the context.


Line range hint 16-16: Address Redeclaration Issue

The static analysis tool flagged that MsgRewardsOptOut is redeclared. This needs to be verified and corrected if true, as it could lead to unexpected behavior or compilation errors.

packages/sdk-ts/src/core/modules/authz/msgs/MsgRevoke.ts (2)

31-31: Correct Implementation of Field Assignments

The implementation correctly assigns the grantee and msgTypeUrl from parameters to the message. This is straightforward and appears correct given the context.


Line range hint 18-18: Address Redeclaration Issue

The static analysis tool flagged that MsgRevoke is redeclared. This needs to be verified and corrected if true, as it could lead to unexpected behavior or compilation errors.

.github/workflows/canary.yml (3)

12-12: Verify the necessity of broad permissions.

Setting workflow permissions to write-all can pose a security risk if not strictly necessary. Please confirm that all jobs in this workflow require such broad permissions.


23-23: NodeJS version update approved.

Updating to NodeJS version 18.17.0 is a standard practice to ensure the use of recent features and security patches.


35-35: Addition of cleaning step in build process approved.

Incorporating lerna clean --yes ensures that the build starts in a clean state, which is a good practice to avoid issues with stale or conflicting dependencies.

packages/sdk-ts/src/core/modules/feegrant/msgs/MsgRevokeAllowance.ts (1)

29-31: Simplification in toProto method approved.

Direct assignment from params enhances clarity and maintainability of the code. Ensure that granter and grantee are always properly defined in params to avoid runtime errors.

The static analysis error regarding redeclaration seems to be a false positive in this context.

packages/sdk-ts/src/core/modules/gov/msgs/MsgDeposit.ts (1)

36-43: Enhancements in toProto method approved.

Proper construction of the Coin object and direct assignment from params improve clarity and correctness. Ensure all fields in params are validated before this method is called to prevent runtime errors.

The static analysis error regarding redeclaration seems to be a false positive in this context.

packages/sdk-ts/src/core/modules/tokenfactory/msgs/MsgBurn.ts (1)

3-6: Necessary imports and enhancements in toProto method approved.

The new imports are essential for the functionality, and the changes in toProto enhance clarity and correctness by properly constructing the Coin object.

The static analysis error regarding redeclaration seems to be a false positive in this context.

Also applies to: 31-39

packages/sdk-ts/src/core/modules/tokenfactory/msgs/MsgMint.ts (1)

3-6: Necessary imports and enhancements in toProto method approved.

The new imports are essential for the functionality, and the changes in toProto enhance clarity and correctness by properly constructing the Coin object.

The static analysis error regarding redeclaration seems to be a false positive in this context.

Also applies to: 31-39

packages/sdk-ts/src/core/modules/distribution/msgs/MsgWithdrawValidatorCommission.ts (2)

31-31: Clarify the purpose of the empty line.

There is an empty line at 31 which doesn't seem necessary. If it's unintentional, consider removing it to improve code cleanliness.


Line range hint 16-16: Verify the redeclaration warning.

The static analysis tool flagged a potential redeclaration issue with MsgWithdrawValidatorCommission. Please ensure that this class is not declared elsewhere in the codebase to avoid conflicts.

Verification successful

No redeclaration issue found.

The MsgWithdrawValidatorCommission class is declared and exported correctly without any redeclaration conflicts.

  • packages/sdk-ts/src/core/modules/distribution/msgs/MsgWithdrawValidatorCommission.ts: Class declaration and export.
  • packages/sdk-ts/src/core/modules/distribution/index.ts: Additional export.
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Search for redeclarations of MsgWithdrawValidatorCommission.
ast-grep --lang typescript --pattern $'class MsgWithdrawValidatorCommission { $$$ }'

Length of output: 85



Script:

#!/bin/bash
# Description: Search for any instances of the MsgWithdrawValidatorCommission class and related export statements.
# Search for class declarations
ast-grep --lang typescript --pattern 'class MsgWithdrawValidatorCommission { $$$ }'

# Search for export statements
rg 'export .* MsgWithdrawValidatorCommission' --type ts

Length of output: 565

packages/sdk-ts/src/core/modules/tokenfactory/msgs/MsgCreateDenom.ts (2)

31-31: Clarify the purpose of the empty line.

There is an empty line at 31 which doesn't seem necessary. If it's unintentional, consider removing it to improve code cleanliness.


Line range hint 19-19: Verify the redeclaration warning.

The static analysis tool flagged a potential redeclaration issue with MsgCreateDenom. Please ensure that this class is not declared elsewhere in the codebase to avoid conflicts.

Verification successful

No redeclaration issue found with MsgCreateDenom.

The class MsgCreateDenom is not redeclared elsewhere in the codebase, ensuring no conflicts.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Search for redeclarations of MsgCreateDenom.
ast-grep --lang typescript --pattern $'class MsgCreateDenom { $$$ }'

Length of output: 69



Script:

#!/bin/bash
# Description: Search for any potential redeclarations or variations of MsgCreateDenom.
# This includes looking for class declarations, type aliases, and interface declarations.
ast-grep --lang typescript --pattern $'class MsgCreateDenom { $$$ }'
ast-grep --lang typescript --pattern $'type MsgCreateDenom = $$$'
ast-grep --lang typescript --pattern $'interface MsgCreateDenom { $$$ }'

Length of output: 210

packages/sdk-ts/src/core/modules/auction/msgs/MsgBid.ts (2)

14-14: Review the structure and logic of toProto method.

The toProto method constructs a message object for bidding. Ensure that all fields are correctly assigned and that the toString conversion for round is intentional and handled correctly in all use cases.

Also applies to: 33-33, 35-35, 38-38, 41-41


Line range hint 24-24: Verify the redeclaration warning.

The static analysis tool flagged a potential redeclaration issue with MsgBid. Please ensure that this class is not declared elsewhere in the codebase to avoid conflicts.

Verification successful

No redeclaration issues found.

The MsgBid class is not redeclared elsewhere in the codebase. The instances found are references or imports of the MsgBid class from MsgBid.ts.

  • packages/sdk-ts/src/core/modules/auction/msgs/MsgBid.ts: Original declaration.
  • Other files: References and imports.
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Search for redeclarations of MsgBid.
ast-grep --lang typescript --pattern $'class MsgBid { $$$ }'

Length of output: 61



Script:

#!/bin/bash
# Description: Search for any declarations of MsgBid in TypeScript files.
rg --type ts 'MsgBid'

Length of output: 2603

packages/sdk-ts/src/core/modules/tx/types/tx-rest-client.ts (2)

3-3: Updated import for CometCryptoV1Keys.

This change aligns with the PR's goal of updating cryptographic key references to the newer CometCryptoV1Keys.


8-8: Updated type for public_key in RestSignerInfo.

This change is consistent with the updated import and ensures that the type definitions are aligned with the new cryptographic standards.

packages/sdk-ts/src/core/modules/insurance/msgs/MsgUnderwrite.ts (1)

36-36: Refactored toProto method in MsgUnderwrite.

The changes in the toProto method enhance clarity by explicitly setting properties on the message object. This should improve maintainability and traceability of the data flow within the method.

Also applies to: 38-38, 41-41, 43-43, 44-44

packages/sdk-ts/src/core/modules/exchange/msgs/MsgWithdraw.ts (1)

36-36: Refactored toProto method in MsgWithdraw.

The changes in the toProto method enhance clarity by explicitly setting properties on the message object. This should improve maintainability and traceability of the data flow within the method.

Also applies to: 38-38, 41-41

packages/sdk-ts/src/core/modules/distribution/msgs/MsgWithdrawDelegatorReward.ts (1)

32-32: Refactored toProto method in MsgWithdrawDelegatorReward.

The changes in the toProto method enhance clarity by explicitly setting properties on the message object. This should improve maintainability and traceability of the data flow within the method.

packages/sdk-ts/src/core/modules/staking/msgs/MsgUndelegate.ts (1)

36-36: Refactored toProto method in MsgUndelegate.

The changes in the toProto method enhance clarity by explicitly setting properties on the message object. This should improve maintainability and traceability of the data flow within the method.

Also applies to: 41-41, 44-44

packages/sdk-ts/src/core/modules/exchange/msgs/MsgReclaimLockedFunds.ts (1)

30-30: Logic in toProto method seems appropriate.

The handling of sender, lockedAccountPubKey, and signature in the toProto method appears correct. It's crucial to ensure that the types and serialization are handled correctly, especially for fields like lockedAccountPubKey which involves base64 encoding.

packages/sdk-ts/src/core/modules/insurance/msgs/MsgRequestRedemption.ts (1)

36-44: Updated handling of amount in toProto method.

The creation and assignment of amountCoin in the toProto method are correctly implemented, ensuring that the amount object matches the expected structure. This change is crucial for correct serialization and type safety.

packages/sdk-ts/src/core/modules/exchange/msgs/MsgCancelSpotOrder.ts (1)

32-32: Logic in toProto method seems appropriate.

The handling of optional fields orderHash and cid in the toProto method appears correct. It's crucial to ensure that these fields are handled correctly to prevent errors during serialization.

packages/sdk-ts/src/core/modules/bank/msgs/MsgSend.ts (1)

42-44: Updated handling of amount in toProto method.

The creation and assignment of amountToSend in the toProto method are correctly implemented, ensuring that the amount object matches the expected structure. This change is crucial for correct serialization and type safety.

packages/sdk-ts/src/core/modules/exchange/msgs/MsgExternalTransfer.ts (2)

42-42: Ensure proper initialization of message object.

The creation of message using InjectiveExchangeV1Beta1Tx.MsgExternalTransfer.create() is followed by setting several properties. Ensure that all necessary properties are initialized correctly and no required fields are missing.

Verification successful

Initialization of message object is correct.

The message object created using InjectiveExchangeV1Beta1Tx.MsgExternalTransfer.create() is properly initialized with all necessary properties.

  • sender
  • sourceSubaccountId
  • destinationSubaccountId
  • amount

No required fields are missing.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify all necessary properties are initialized in `message`.

# Test: Search for the usage of `MsgExternalTransfer` and check for required fields initialization.
rg --type typescript $'MsgExternalTransfer.create'

Length of output: 84



Script:

#!/bin/bash
# Description: Verify all necessary properties are initialized in `message`.

# Test: Search for the usage of `MsgExternalTransfer.create` and check for required fields initialization.
rg --type ts 'MsgExternalTransfer.create'

Length of output: 187



Script:

#!/bin/bash
# Description: Extract the relevant code section from MsgExternalTransfer.ts to inspect the initialization of the message object.

# Display 10 lines before and after the occurrence of `MsgExternalTransfer.create()`
rg --type ts --context 10 'MsgExternalTransfer.create' packages/sdk-ts/src/core/modules/exchange/msgs/MsgExternalTransfer.ts

Length of output: 704


Line range hint 25-25: Address potential redeclaration issue.

The static analysis tool flagged a redeclaration of MsgExternalTransfer. If this is a false positive due to namespace usage or similar patterns, it can be ignored. Otherwise, consider renaming or refactoring to address the issue.

packages/sdk-ts/src/core/modules/staking/msgs/MsgBeginRedelegate.ts (1)

Line range hint 25-25: Address potential redeclaration issue.

The static analysis tool flagged a redeclaration of MsgBeginRedelegate. If this is a false positive due to namespace usage or similar patterns, it can be ignored. Otherwise, consider renaming or refactoring to address the issue.

packages/sdk-ts/src/core/modules/authz/msgs/MsgExec.ts (1)

1-1: Consider removing or utilizing the commented import.

The import snakecaseKeys from 'snakecase-keys' is commented out, which could indicate that it is no longer needed. If it's not being used anywhere in the file, consider removing it to clean up the code.

packages/sdk-ts/src/core/modules/staking/msgs/MsgCancelUnbondingDelegation.ts (1)

Line range hint 25-25: Address potential redeclaration issue.

The static analysis tool flagged a redeclaration of MsgCancelUnbondingDelegation. If this is a false positive due to namespace usage or similar patterns, it can be ignored. Otherwise, consider renaming or refactoring to address the issue.

Verification successful

No redeclaration issue found.

The search results indicate multiple occurrences of MsgCancelUnbondingDelegation, but all are either class definitions, imports, or references within different contexts. There is no evidence of redeclaration.

  • packages/sdk-ts/src/core/modules/staking/msgs/MsgCancelUnbondingDelegation.ts: Contains the class definition and usage.
  • Other files: Import or reference the class without redeclaration.
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the context of the redeclaration issue.

# Test: Search for all declarations of `MsgCancelUnbondingDelegation` to understand the context.
rg --type typescript $'MsgCancelUnbondingDelegation'

Length of output: 86



Script:

#!/bin/bash
# Description: Verify the context of the redeclaration issue.

# Test: Search for all declarations of `MsgCancelUnbondingDelegation` to understand the context.
rg 'MsgCancelUnbondingDelegation'

Length of output: 3737

packages/sdk-ts/src/core/modules/exchange/msgs/MsgCancelBinaryOptionsOrder.ts (1)

Line range hint 24-24: Static analysis issue regarding redeclaration is a false positive.

The namespace declaration is not a redeclaration of the class but a TypeScript feature for adding static types. This is likely a misunderstanding by the static analysis tool.

packages/sdk-ts/src/core/modules/exchange/msgs/MsgCancelDerivativeOrder.ts (1)

Line range hint 21-21: Static analysis issue regarding redeclaration is a false positive.

The namespace declaration is not a redeclaration of the class but a TypeScript feature for adding static types. This is likely a misunderstanding by the static analysis tool.

packages/sdk-ts/src/core/modules/peggy/msgs/MsgSendToEth.ts (2)

Line range hint 32-32: Static analysis issue regarding redeclaration is a false positive.

The namespace declaration is not a redeclaration of the class but a TypeScript feature for adding static types. This is likely a misunderstanding by the static analysis tool.


Line range hint 44-62: Review the handling of coinAmount and bridgeFee.

The logic for setting coinAmount and bridgeFee seems correct. However, it's important to ensure that params.bridgeFee is always provided, or the defaults are acceptable in all cases.

Verification successful

Verification Successful: Handling of bridgeFee

The logic for setting coinAmount and bridgeFee in MsgSendToEth.ts ensures that bridgeFee is always provided or defaults are used. The implementation correctly handles cases where params.bridgeFee may be undefined.

  • The toProto method sets bridgeFee using params.bridgeFee if available, otherwise it uses default values (DEFAULT_BRIDGE_FEE_DENOM and DEFAULT_BRIDGE_FEE_AMOUNT).

This confirms that the handling of bridgeFee is robust and correctly implemented.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Verify all calls to MsgSendToEth ensure bridgeFee is provided or defaults are acceptable.

# Search for MsgSendToEth usage. Expect: Proper handling of bridgeFee.
rg --type typescript $'new MsgSendToEth'

Length of output: 76



Script:

#!/bin/bash
# Verify all calls to MsgSendToEth ensure bridgeFee is provided or defaults are acceptable.

# Search for MsgSendToEth usage. Expect: Proper handling of bridgeFee.
rg --type ts 'new MsgSendToEth'

Length of output: 129



Script:

#!/bin/bash
# Verify the definition and initialization of `params` to ensure `bridgeFee` is provided or defaults are acceptable.

# Search for `params` definition and initialization in the relevant file.
rg 'params' packages/sdk-ts/src/core/modules/peggy/msgs/MsgSendToEth.ts

Length of output: 510



Script:

#!/bin/bash
# Extract the full implementation of the `fromJSON` method and the class definition to verify the handling of `params`.

# Search for the class definition and the `fromJSON` method implementation.
ast-grep --lang typescript --pattern $'class $_ {
  $$$
  static fromJSON($_): $_ {
    $$$
  }
  $$$
}' packages/sdk-ts/src/core/modules/peggy/msgs/MsgSendToEth.ts

Length of output: 165



Script:

#!/bin/bash
# Extract the full implementation of the `fromJSON` method and the class definition to verify the handling of `params`.

# Search for the `fromJSON` method implementation.
rg 'static fromJSON' packages/sdk-ts/src/core/modules/peggy/msgs/MsgSendToEth.ts

# Search for the class definition.
rg 'class ' packages/sdk-ts/src/core/modules/peggy/msgs/MsgSendToEth.ts

Length of output: 270



Script:

#!/bin/bash
# Extract the full content of the file to verify the handling of `params`.

cat packages/sdk-ts/src/core/modules/peggy/msgs/MsgSendToEth.ts

Length of output: 2455

packages/sdk-ts/src/core/modules/exchange/msgs/MsgAdminUpdateBinaryOptionsMarket.ts (2)

Line range hint 23-23: Static analysis issue regarding redeclaration is a false positive.

The namespace declaration is not a redeclaration of the class but a TypeScript feature for adding static types. This is likely a misunderstanding by the static analysis tool.


38-43: Review the assignment of market update parameters.

The logic for setting market update parameters appears correct. Ensure that all fields are correctly validated before being passed to this function to prevent any potential issues.

packages/sdk-ts/src/core/modules/bank/msgs/MsgMultiSend.ts (2)

Line range hint 27-27: Static analysis issue regarding redeclaration is a false positive.

The namespace declaration is not a redeclaration of the class but a TypeScript feature for adding static types. This is likely a misunderstanding by the static analysis tool.


Line range hint 46-71: Review the handling of coins in multi-send.

The logic for setting coins in inputs and outputs seems correct. It's important to ensure that all coin amounts are properly validated to prevent issues like overflow or underflow.

packages/sdk-ts/src/core/modules/exchange/msgs/MsgIncreasePositionMargin.ts (1)

24-25: Ensure consistency in message construction.

The explicit setting of marketId and amount should be verified against the expected message structure in the backend or corresponding service definition.

Verification successful

Ensure consistency in message construction.

The explicit setting of marketId and amount in the MsgIncreasePositionMargin class is consistent with the expected message structure.

  • The createMessage function correctly sets marketId and amount from the params object.
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the message structure against the service definition.
ast-grep --lang typescript --pattern $'class MsgIncreasePositionMargin {
  $$$
  createMessage($_) {
    $$$
    marketId = $_
    amount = $_
    $$$
  }
  $$$
}'

Length of output: 164



Script:

#!/bin/bash
# Locate the MsgIncreasePositionMargin class and extract its methods
ast-grep --lang typescript --pattern 'class MsgIncreasePositionMargin {
  $$$
}' --json | jq '.captures[].node.text' > class_methods.txt

# Extract the createMessage method from the MsgIncreasePositionMargin class
ast-grep --lang typescript --pattern 'class MsgIncreasePositionMargin {
  $$$
  createMessage($_) {
    $$$
  }
  $$$
}' --json | jq '.captures[].node.text' > create_message_method.txt

# Print the content of the files for review
cat class_methods.txt
cat create_message_method.txt

Length of output: 469



Script:

#!/bin/bash
# Locate the MsgIncreasePositionMargin class and its methods
ast-grep --lang typescript --pattern 'class MsgIncreasePositionMargin {
  $$$
}'

# Extract the createMessage method from the MsgIncreasePositionMargin class
ast-grep --lang typescript --pattern 'class MsgIncreasePositionMargin {
  $$$
  createMessage($_) {
    $$$
  }
  $$$
}'

Length of output: 205



Script:

#!/bin/bash
# Search for the MsgIncreasePositionMargin class definition and print its content
rg 'class MsgIncreasePositionMargin' -A 20

Length of output: 2214



Script:

#!/bin/bash
# Search for the createMessage function definition and print its content
rg 'function createMessage' -A 20

Length of output: 35



Script:

#!/bin/bash
# Search for any function or method named createMessage across the codebase and print its content
rg 'createMessage' -A 20

Length of output: 17928

packages/sdk-ts/src/core/modules/insurance/msgs/MsgCreateInsuranceFund.ts (2)

Line range hint 32-32: Address potential redeclaration issue.

The static analysis tool has flagged a possible redeclaration of MsgCreateInsuranceFund. This could be a false positive if it's due to TypeScript's declaration merging feature, but it should be verified.

Verification successful

No redeclaration issue found.

The static analysis tool's concern about a potential redeclaration of MsgCreateInsuranceFund appears to be a false positive. Only one declaration of MsgCreateInsuranceFund was detected in the codebase.

  • export declare namespace MsgCreateInsuranceFund: Found 1 instance.
  • export default class MsgCreateInsuranceFund: Found 1 instance.
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Check for redeclarations of MsgCreateInsuranceFund.

# Test: Search for multiple declarations. Expect: Only one declaration.
rg --type typescript $'export declare namespace MsgCreateInsuranceFund' --count

Length of output: 115



Script:

#!/bin/bash
# Description: Check for redeclarations of MsgCreateInsuranceFund.

# Test: Search for multiple declarations. Expect: Only one declaration.
rg 'export declare namespace MsgCreateInsuranceFund' --glob '*.ts' --count

# Additionally, check for class declarations of MsgCreateInsuranceFund
rg 'export default class MsgCreateInsuranceFund' --glob '*.ts' --count

Length of output: 301


45-59: Ensure consistency in message construction.

The creation and setting of the Coin object should be verified against the expected message structure in the backend or corresponding service definition.

Verification successful

Ensure consistency in message construction.

The creation and setting of the Coin object in MsgCreateInsuranceFund is consistent with the expected message structure and usage seen across multiple files.

  • MsgCreateInsuranceFund.ts correctly follows the pattern of creating a Coin object and setting its denom and amount properties.
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the message structure against the service definition.
ast-grep --lang typescript --pattern $'class MsgCreateInsuranceFund {
  $$$
  toProto() {
    $$$
    coin.denom = $_
    coin.amount = $_
    $$$
  }
  $$$
}'

Length of output: 160



Script:

#!/bin/bash
# Description: Search for the MsgCreateInsuranceFund class and inspect its methods, particularly focusing on the creation and assignment of the Coin object.
ast-grep --lang typescript --pattern $'class MsgCreateInsuranceFund {
  $$$
}' --json > class_structure.json

# Extract methods within the MsgCreateInsuranceFund class
jq '.[] | select(.kind == "method_definition") | .text' class_structure.json

# Search for the usage of the Coin object within the MsgCreateInsuranceFund class
rg 'Coin.create\(\)|coin.denom|coin.amount' -A 5

Length of output: 45464

packages/sdk-ts/src/core/modules/tokenfactory/msgs/MsgSetDenomMetadata.ts (2)

Line range hint 20-20: Address potential redeclaration issue.

The static analysis tool has flagged a possible redeclaration of MsgSetDenomMetadata. This could be a false positive if it's due to TypeScript's declaration merging feature, but it should be verified.

Verification successful

No redeclaration issue found for MsgSetDenomMetadata.

The search results show multiple references to MsgSetDenomMetadata, but there is no indication of multiple declarations or definitions that would cause a redeclaration issue.

  • File: packages/sdk-ts/src/core/modules/tokenfactory/msgs/MsgSetDenomMetadata.ts

    • Contains the primary declaration and definition of MsgSetDenomMetadata.
  • Other files: Reference MsgSetDenomMetadata without redeclaring it.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Check for redeclarations of MsgSetDenomMetadata.

# Test: Search for multiple declarations. Expect: Only one declaration.
rg --type typescript $'export declare namespace MsgSetDenomMetadata' --count

Length of output: 112



Script:

#!/bin/bash
# Description: Check for redeclarations of MsgSetDenomMetadata.

# Test: Search for multiple declarations or definitions of MsgSetDenomMetadata. Expect: Only one declaration/definition.
rg 'MsgSetDenomMetadata' --type ts

Length of output: 2994


3-6: Ensure consistency in metadata setting.

The detailed setting of metadata properties should be verified against the expected metadata structure in the backend or corresponding service definition.

Also applies to: 31-53

Verification successful

Consistency in metadata setting verified.

The toProto method in the MsgSetDenomMetadata class sets the metadata properties in a detailed and consistent manner, aligning with the expected structure.

  • description
  • denomUnits
  • base
  • display
  • name
  • symbol
  • uri
  • uriHash
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the metadata structure against the service definition.
ast-grep --lang typescript --pattern $'class MsgSetDenomMetadata {
  $$$
  toProto() {
    $$$
    metadata.description = $_
    metadata.denomUnits = $_
    $$$
  }
  $$$
}'

Length of output: 175



Script:

#!/bin/bash
# Search for the MsgSetDenomMetadata class definition
ast-grep --lang typescript --pattern 'class MsgSetDenomMetadata { $$$ }'

# Search for the toProto method within the MsgSetDenomMetadata class
ast-grep --lang typescript --pattern $'class MsgSetDenomMetadata {
  $$$
  toProto() {
    $$$
  }
  $$$
}'

Length of output: 183



Script:

#!/bin/bash
# Search for the MsgSetDenomMetadata class definition across the entire codebase
rg 'class MsgSetDenomMetadata' --type ts

# Search for the toProto method definition within the MsgSetDenomMetadata class across the entire codebase
rg 'toProto()' --type ts

Length of output: 36302



Script:

#!/bin/bash
# Extract the toProto method implementation from MsgSetDenomMetadata class
ast-grep --lang typescript --pattern $'class MsgSetDenomMetadata {
  $$$
  toProto() {
    $$$
  }
  $$$
}' packages/sdk-ts/src/core/modules/tokenfactory/msgs/MsgSetDenomMetadata.ts

Length of output: 182



Script:

#!/bin/bash
# Search for the toProto method definition in MsgSetDenomMetadata class and extract surrounding lines
rg -A 20 -B 5 'toProto()' packages/sdk-ts/src/core/modules/tokenfactory/msgs/MsgSetDenomMetadata.ts

Length of output: 1864

packages/sdk-ts/src/client/chain/grpc/ChainGrpcIbcApi.ts (1)

Line range hint 5-22: Enhance error handling and request/response creation.

The creation of request and response types, along with the enhanced error handling, should be verified for alignment with best practices and expected API behavior.

Also applies to: 29-41, 59-75

Verification successful

Enhance error handling and request/response creation.

The fetchDenomTrace method in the ChainGrpcIbcApi class includes well-structured error handling and request creation, consistent with best practices.

  • The method creates a request using IbcApplicationsTransferV2Query.QueryDenomRequest.create().
  • It sets the hash property on the request.
  • A try-catch block is used to handle errors, throwing a GrpcUnaryRequestException with detailed context when an error occurs.
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the API behavior and error handling against the service definition.
ast-grep --lang typescript --pattern $'class ChainGrpcIbcApi {
  $$$
  fetchDenomTrace($_) {
    $$$
    request.hash = $_
    $$$
    catch($_) {
      $$$
    }
    $$$
  }
  $$$
}'

Length of output: 184



Script:

#!/bin/bash
# List all methods in the ChainGrpcIbcApi class and inspect their error handling
ast-grep --lang typescript --pattern $'class ChainGrpcIbcApi {
  $$$
  $_() {
    $$$
  }
  $$$
}'

Length of output: 99



Script:

#!/bin/bash
# Locate the ChainGrpcIbcApi class and list its contents to understand its structure
ast-grep --lang typescript --pattern $'class ChainGrpcIbcApi {
  $$$
}' --json

Length of output: 82



Script:

#!/bin/bash
# Search for the ChainGrpcIbcApi class and its methods using ripgrep
rg 'class ChainGrpcIbcApi' -A 20

Length of output: 1761



Script:

#!/bin/bash
# Extract the full implementation of the fetchDenomTrace method in ChainGrpcIbcApi class
ast-grep --lang typescript --pattern $'class ChainGrpcIbcApi {
  $$$
  async fetchDenomTrace($_) {
    $$$
  }
  $$$
}' --json

Length of output: 130



Script:

#!/bin/bash
# Search for the complete implementation of the fetchDenomTrace method in ChainGrpcIbcApi class
rg 'async fetchDenomTrace' -A 20

Length of output: 1868

packages/sdk-ts/src/core/modules/exchange/msgs/MsgInstantSpotMarketLaunch.spec.ts (1)

15-15: Enhance test coverage with additional parameters.

The inclusion of additional parameters like minNotional in the test setup should be verified for alignment with the expected behavior of the MsgInstantSpotMarketLaunch message class.

Also applies to: 70-70

Verification successful

Enhance test coverage with additional parameters.

The inclusion of additional parameters like minNotional in the test setup is verified and aligns with the expected behavior of the MsgInstantSpotMarketLaunch message class.

  • packages/sdk-ts/src/core/modules/exchange/msgs/MsgInstantSpotMarketLaunch.ts
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the test setup against the message class definition.
ast-grep --lang typescript --pattern $'class MsgInstantSpotMarketLaunch {
  $$$
  toProto() {
    $$$
    minNotional = $_
    $$$
  }
  $$$
}'

Length of output: 144



Script:

#!/bin/bash
# Searching for the definition of the MsgInstantSpotMarketLaunch class and its constructor
ast-grep --lang typescript --pattern $'class MsgInstantSpotMarketLaunch {
  constructor($_) {
    $$$
  }
  $$$
}'

# Searching for the usage of the minNotional parameter within the MsgInstantSpotMarketLaunch class
ast-grep --lang typescript --pattern $'class MsgInstantSpotMarketLaunch {
  $$$
  minNotional: $_
  $$$
}'

Length of output: 223



Script:

#!/bin/bash
# Searching for the definition of the MsgInstantSpotMarketLaunch class
ast-grep --lang typescript --pattern $'class MsgInstantSpotMarketLaunch {
  $$$
}'

# Searching for any usage of the minNotional parameter in TypeScript files
rg --type ts 'minNotional'

Length of output: 957

packages/sdk-ts/src/core/modules/exchange/msgs/MsgLiquidatePosition.ts (3)

46-46: Ensure sender and market ID assignment is correct.


53-53: Check orderInfo initialization for completeness.


67-68: Verify correct assignment of order type and trigger price.

packages/sdk-ts/src/core/modules/exchange/msgs/MsgInstantSpotMarketLaunch.ts (1)

14-14: Ensure market parameters are correctly assigned.

Also applies to: 29-32

packages/sdk-ts/src/core/modules/ibc/msgs/MsgTransferCosmjs.ts (1)

53-58: Ensure correct assignment of message fields.

packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateSpotLimitOrder.ts (1)

27-27: Ensure order information and message fields are correctly initialized.

Also applies to: 33-45

packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateSpotMarketOrder.ts (1)

27-27: Ensure order information and message fields are correctly initialized.

Also applies to: 33-45

packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateDerivativeLimitOrder.ts (5)

28-28: Clarify the purpose of the OrderInfo.create() method.

It's unclear what the OrderInfo.create() method does as there is no documentation or explicit return type. Consider adding a comment or improving the method's documentation to clarify its purpose and return type.


40-40: Ensure DerivativeOrder.create() is correctly utilized.

Similar to the previous comment, the usage of DerivativeOrder.create() should be clarified with either comments or documentation to ensure it's clear what the method is supposed to do and what it returns.


49-49: Review the creation of MsgCreateDerivativeLimitOrder.

The use of MsgCreateDerivativeLimitOrder.create() should be accompanied by comments or documentation explaining the parameters it expects and the structure of the object it returns.


Line range hint 59-59: Address the redeclaration issue flagged by static analysis.

The class MsgCreateDerivativeLimitOrder appears to be redeclared. This could be a false positive from the linter, but it's worth verifying if there are any scope or import issues that could lead to genuine redeclaration conflicts.


43-43: Check the assignment of orderType.

Make sure that the orderType assigned to derivativeOrder is valid and correctly handles all expected types. This is crucial for maintaining the integrity of order handling.

Verification successful

Assignment of orderType is valid and handles all expected types.

The orderType assigned to derivativeOrder is of type InjectiveExchangeV1Beta1Exchange.OrderType, which includes a comprehensive range of values such as BUY, SELL, STOP_BUY, STOP_SELL, TAKE_BUY, TAKE_SELL, BUY_PO, SELL_PO, BUY_ATOMIC, and SELL_ATOMIC. This ensures the integrity of order handling.

  • MsgCreateDerivativeLimitOrder.ts
  • MsgCreateDerivativeMarketOrder.ts
  • MsgCreateBinaryOptionsLimitOrder.ts
  • MsgCreateBinaryOptionsMarketOrder.ts
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify all possible values for orderType are handled correctly.
ast-grep --lang typescript --pattern $'derivativeOrder.orderType = $_'

Length of output: 607



Script:

#!/bin/bash
# Description: Find the type definition for 'params' in the relevant files.
ast-grep --lang typescript --pattern $'const params: $_ =' ./packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateDerivativeLimitOrder.ts
ast-grep --lang typescript --pattern $'const params: $_ =' ./packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateDerivativeMarketOrder.ts
ast-grep --lang typescript --pattern $'const params: $_ =' ./packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateBinaryOptionsLimitOrder.ts
ast-grep --lang typescript --pattern $'const params: $_ =' ./packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateBinaryOptionsMarketOrder.ts

Length of output: 1955



Script:

#!/bin/bash
# Description: Find the function definitions that include 'params' in the relevant files.
ast-grep --lang typescript --pattern $'function $_($param: $_) {' ./packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateDerivativeLimitOrder.ts
ast-grep --lang typescript --pattern $'function $_($param: $_) {' ./packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateDerivativeMarketOrder.ts
ast-grep --lang typescript --pattern $'function $_($param: $_) {' ./packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateBinaryOptionsLimitOrder.ts
ast-grep --lang typescript --pattern $'function $_($param: $_) {' ./packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateBinaryOptionsMarketOrder.ts

Length of output: 603



Script:

#!/bin/bash
# Description: Search for the term 'params' in the relevant files to gather more context.
rg 'params' ./packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateDerivativeLimitOrder.ts
rg 'params' ./packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateDerivativeMarketOrder.ts
rg 'params' ./packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateBinaryOptionsLimitOrder.ts
rg 'params' ./packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateBinaryOptionsMarketOrder.ts

Length of output: 3599



Script:

#!/bin/bash
# Description: Search for the definitions of the Params types to verify possible values for orderType.
rg 'export interface Params' ./packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateDerivativeLimitOrder.ts
rg 'export interface Params' ./packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateDerivativeMarketOrder.ts
rg 'export interface Params' ./packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateBinaryOptionsLimitOrder.ts
rg 'export interface Params' ./packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateBinaryOptionsMarketOrder.ts

Length of output: 571



Script:

#!/bin/bash
# Description: Extract the full definitions of the Params interfaces to verify the possible values for orderType.
rg -A 10 'export interface Params' ./packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateDerivativeLimitOrder.ts
rg -A 10 'export interface Params' ./packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateDerivativeMarketOrder.ts
rg -A 10 'export interface Params' ./packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateBinaryOptionsLimitOrder.ts
rg -A 10 'export interface Params' ./packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateBinaryOptionsMarketOrder.ts

Length of output: 1631



Script:

#!/bin/bash
# Description: Search for the definition of InjectiveExchangeV1Beta1Exchange.OrderType to verify the possible values for orderType.
rg 'OrderType' ./packages/sdk-ts/src/core/modules/exchange/msgs

Length of output: 1432



Script:

#!/bin/bash
# Description: Search for the definition of InjectiveExchangeV1Beta1Exchange.OrderType in the broader codebase.
rg 'OrderType' ./packages/sdk-ts/src/core

Length of output: 4472

packages/sdk-ts/src/core/modules/gov/msgs/MsgSubmitTextProposal.ts (4)

55-55: Review the instantiation of GoogleProtobufAny.Any.

The usage of GoogleProtobufAny.Any.create() should be documented or commented to clarify its purpose and the structure of the object it returns.


47-47: Validate the creation of CosmosBaseV1Beta1Coin.Coin.

Ensure that the CosmosBaseV1Beta1Coin.Coin.create() method is correctly used to instantiate coin objects. This is crucial for ensuring the integrity of financial transactions in proposals.


Line range hint 34-34: Resolve potential redeclaration issue.

The class MsgSubmitTextProposal might be redeclared, as indicated by the static analysis tool. This needs to be checked and resolved to prevent any potential conflicts or issues.

Verification successful

No redeclaration issue found.

The class MsgSubmitTextProposal is declared only once in the codebase, specifically in the file packages/sdk-ts/src/core/modules/gov/msgs/MsgSubmitTextProposal.ts. There are no potential redeclaration conflicts.

  • packages/sdk-ts/src/core/modules/gov/msgs/MsgSubmitTextProposal.ts
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Search for potential redeclarations of MsgSubmitTextProposal.
rg 'class MsgSubmitTextProposal' --type typescript

Length of output: 87



Script:

#!/bin/bash
# Description: Search for potential redeclarations of MsgSubmitTextProposal in TypeScript files.
rg 'class MsgSubmitTextProposal'

Length of output: 161


60-60: Ensure correct creation of MsgSubmitProposal.

The MsgSubmitProposal.create() method is used here. It's important to ensure that this method is correctly implemented and that all parameters are properly handled.

packages/sdk-ts/src/core/modules/wasm/msgs/MsgExecuteContract.ts (3)

Line range hint 50-50: Address the redeclaration issue flagged by static analysis.

The class MsgExecuteContract appears to be redeclared. This could be a false positive from the linter, but it's worth verifying if there are any scope or import issues that could lead to genuine redeclaration conflicts.


67-67: Verify JSON encoding and UTF-8 conversion.

Ensure that the conversion of the msg object to a JSON string and then to UTF-8 is correctly performed. This is critical for the integrity of data passed to smart contracts.


78-78: Check the creation of coin objects.

The CosmosBaseV1Beta1Coin.Coin.create() method is used here to instantiate coin objects. It's important to ensure that this method is correctly implemented and handles all parameters properly.

packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateDerivativeMarketOrder.ts (5)

28-28: Clarify the purpose of OrderInfo.create().

As with the limit order file, it's important to clarify what the OrderInfo.create() method does. Adding documentation or comments would help improve understanding and maintainability.


40-40: Ensure correct usage of DerivativeOrder.create().

The method DerivativeOrder.create() should be clearly documented to ensure its correct use and to clarify the object it returns.


49-49: Review the creation of MsgCreateDerivativeMarketOrder.

The use of MsgCreateDerivativeMarketOrder.create() should be accompanied by comments or documentation explaining the parameters it expects and the structure of the object it returns.


Line range hint 61-61: Resolve potential redeclaration issue.

The class MsgCreateDerivativeMarketOrder might be redeclared, as indicated by the static analysis tool. This needs to be checked and resolved to prevent any potential conflicts or issues.

Verification successful

No redeclaration issue found.

The class MsgCreateDerivativeMarketOrder is declared only once in the codebase, specifically in the file packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateDerivativeMarketOrder.ts. There are no conflicts or redeclaration problems.

  • packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateDerivativeMarketOrder.ts: export default class MsgCreateDerivativeMarketOrder extends MsgBase<
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Search for potential redeclarations of MsgCreateDerivativeMarketOrder.
rg 'class MsgCreateDerivativeMarketOrder' --type typescript

Length of output: 96



Script:

#!/bin/bash
# Description: Search for potential redeclarations of MsgCreateDerivativeMarketOrder in TypeScript files.
rg 'class MsgCreateDerivativeMarketOrder' --glob '**/*.ts'

Length of output: 210


43-43: Check assignment of orderType for market orders.

It's crucial to verify that the orderType assigned to derivativeOrder is valid and handles all expected types correctly, especially in the context of market orders.

Verification successful

Check assignment of orderType for market orders.

The orderType assigned to derivativeOrder is of type InjectiveExchangeV1Beta1Exchange.OrderType. This ensures that the orderType is valid and handles all expected types correctly within the context of market orders.

  • MsgCreateDerivativeMarketOrder.Params defines orderType as InjectiveExchangeV1Beta1Exchange.OrderType.
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify all possible values for orderType in market orders are handled correctly.
ast-grep --lang typescript --pattern $'derivativeOrder.orderType = $_'

Length of output: 607



Script:

#!/bin/bash
# Description: Find the definitions and types of `params.orderType` in the relevant files.
ast-grep --lang typescript --pattern $'const params: $_ = $_' --paths "packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateBinaryOptionsMarketOrder.ts"
ast-grep --lang typescript --pattern $'const params: $_ = $_' --paths "packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateBinaryOptionsLimitOrder.ts"
ast-grep --lang typescript --pattern $'const params: $_ = $_' --paths "packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateDerivativeLimitOrder.ts"
ast-grep --lang typescript --pattern $'const params: $_ = $_' --paths "packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateDerivativeMarketOrder.ts"

Length of output: 1399



Script:

#!/bin/bash
# Description: Find the definitions and types of `params.orderType` in the relevant files.
ast-grep --lang typescript --pattern $'const params: $_ = $_' packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateBinaryOptionsMarketOrder.ts
ast-grep --lang typescript --pattern $'const params: $_ = $_' packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateBinaryOptionsLimitOrder.ts
ast-grep --lang typescript --pattern $'const params: $_ = $_' packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateDerivativeLimitOrder.ts
ast-grep --lang typescript --pattern $'const params: $_ = $_' packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateDerivativeMarketOrder.ts

Length of output: 579



Script:

#!/bin/bash
# Description: Search for the term `params` in the relevant files to gather more information about its definition and type.
rg 'params' packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateBinaryOptionsMarketOrder.ts
rg 'params' packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateBinaryOptionsLimitOrder.ts
rg 'params' packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateDerivativeLimitOrder.ts
rg 'params' packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateDerivativeMarketOrder.ts

Length of output: 3591



Script:

#!/bin/bash
# Description: Search for the definition of `MsgCreateDerivativeMarketOrder.Params` to understand its structure and possible values for `orderType`.
rg 'type Params' packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateDerivativeMarketOrder.ts
rg 'type Params' packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateBinaryOptionsMarketOrder.ts
rg 'type Params' packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateBinaryOptionsLimitOrder.ts
rg 'type Params' packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateDerivativeLimitOrder.ts

Length of output: 403



Script:

#!/bin/bash
# Description: Search for import statements in the relevant files to find where `Params` is imported from.
rg 'import' packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateBinaryOptionsMarketOrder.ts
rg 'import' packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateBinaryOptionsLimitOrder.ts
rg 'import' packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateDerivativeLimitOrder.ts
rg 'import' packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateDerivativeMarketOrder.ts

Length of output: 1103



Script:

#!/bin/bash
# Description: Search for the definition of the `Params` type in the `exchange/msgs` directory to locate its source.
rg 'type Params' packages/sdk-ts/src/core/modules/exchange/msgs/

Length of output: 66



Script:

#!/bin/bash
# Description: Search for the definition of the `Params` type across the entire `packages/sdk-ts` directory to locate its source.
rg 'type Params' packages/sdk-ts/

Length of output: 35



Script:

#!/bin/bash
# Description: Search for the definition of `interface Params` and other possible naming conventions in the `packages/sdk-ts` directory to locate its source.
rg 'interface Params' packages/sdk-ts/
rg 'Params' packages/sdk-ts/

Length of output: 123425



Script:

#!/bin/bash
# Description: Display the content of `MsgCreateDerivativeMarketOrder.ts` to verify the `Params` type definition and its `orderType` field.
cat packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateDerivativeMarketOrder.ts

Length of output: 3706

packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateBinaryOptionsLimitOrder.ts (5)

29-29: Clarify the purpose of OrderInfo.create().

It's important to clarify what the OrderInfo.create() method does, especially in the context of binary options. Adding documentation or comments would help improve understanding and maintainability.


41-41: Ensure correct usage of DerivativeOrder.create().

The method DerivativeOrder.create() should be clearly documented to ensure its correct use and to clarify the object it returns, particularly in the context of binary options.


51-51: Review the creation of MsgCreateBinaryOptionsLimitOrder.

The use of MsgCreateBinaryOptionsLimitOrder.create() should be accompanied by comments or documentation explaining the parameters it expects and the structure of the object it returns.


Line range hint 63-63: Resolve potential redeclaration issue.

The class MsgCreateBinaryOptionsLimitOrder might be redeclared, as indicated by the static analysis tool. This needs to be checked and resolved to prevent any potential conflicts or issues.

Verification successful

No redeclaration issue found.

The class MsgCreateBinaryOptionsLimitOrder is declared only once in the codebase, specifically in the file packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateBinaryOptionsLimitOrder.ts. There are no conflicts or redeclarations.

  • packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateBinaryOptionsLimitOrder.ts
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Search for potential redeclarations of MsgCreateBinaryOptionsLimitOrder.
rg 'class MsgCreateBinaryOptionsLimitOrder' --type typescript

Length of output: 98



Script:

#!/bin/bash
# Description: Search for potential redeclarations of MsgCreateBinaryOptionsLimitOrder.
rg 'class MsgCreateBinaryOptionsLimitOrder' --type ts

Length of output: 209


44-44: Check assignment of orderType for binary options.

It's crucial to verify that the orderType assigned to derivativeOrder is valid and handles all expected types correctly, especially in the context of binary options.

packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateBinaryOptionsMarketOrder.ts (1)

Line range hint 31-52: Review of createMarketOrder function logic.

The function constructs a market order object using parameters passed to it. The use of default values and conditional checks is appropriate. However, ensure that all fields, especially optional ones like triggerPrice, are handled correctly in all use cases.

packages/sdk-ts/src/core/modules/exchange/msgs/MsgInstantBinaryOptionsMarketLaunch.ts (1)

Line range hint 26-52: Review of createMessage function logic.

The function handles the creation of a message for market launch effectively, ensuring all parameters are properly converted and included. The handling of minNotional is particularly noteworthy for ensuring it meets the required format.

Also applies to: 91-93

packages/sdk-ts/src/core/modules/feegrant/msgs/MsgGrantAllowance.ts (1)

4-8: Review of allowance creation and serialization logic.

The logic to create and serialize the fee allowance is comprehensive and well-structured, handling various types of inputs and conditions effectively.

Also applies to: 49-104, 135-138

packages/sdk-ts/src/core/modules/gov/msgs/MsgSubmitProposalSpotMarketParamUpdate.ts (1)

Line range hint 83-119: Verify: Ensure consistency in fee rate assignments.

Ensure that the fee rates and other numerical values are being converted and rounded as expected. This is crucial for financial calculations to avoid subtle bugs.

Verification successful

Verification successful: Fee rate assignments are consistent.

The fee rates and other numerical values are being converted and rounded consistently using the amountToCosmosSdkDecAmount function across various modules. This ensures the accuracy of financial calculations.

  • Consistent usage of amountToCosmosSdkDecAmount for converting and rounding fee rates observed in multiple files:
    • MsgCreateDerivativeMarketOrder.ts
    • MsgCreateSpotMarketOrder.ts
    • MsgInstantBinaryOptionsMarketLaunch.ts
    • MsgSubmitProposalExpiryFuturesMarketLaunch.ts
    • MsgSubmitProposalSpotMarketParamUpdate.ts
    • And others
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Check for consistent fee rate assignments across different modules.
grep -r 'feeRate' packages/

Length of output: 27



Script:

#!/bin/bash
# Refined search for specific patterns related to fee rate conversion and rounding
# Searching for `amountToCosmosSdkDecAmount` function usage across the codebase
rg 'amountToCosmosSdkDecAmount' packages/

# Additionally, searching for the specific fee rate fields to ensure they are handled consistently
rg 'relayerFeeShareRate|makerFeeRate|takerFeeRate|minQuantityTickSize' packages/

Length of output: 24135

packages/sdk-ts/src/core/modules/authz/msgs/MsgGrant.ts (1)

64-66: Security Concern: Validate input parameters to prevent injection attacks.

Ensure that grantee and granter are properly validated or sanitized before use, especially since they are user-supplied and used directly in message construction.
[SECURITY]

+ if (!validateAddress(params.granter)) throw new Error('Invalid granter address');
+ if (!validateAddress(params.grantee)) throw new Error('Invalid grantee address');
packages/sdk-ts/src/core/modules/exchange/msgs/MsgBatchUpdateOrders.ts (1)

Line range hint 71-71: Check for potential redeclaration of MsgBatchUpdateOrders.

The static analysis tool flags a possible redeclaration issue. Ensure that the class MsgBatchUpdateOrders is not declared multiple times or inappropriately shadowed in this scope.

@@ -297,13 +297,33 @@ export class MsgBroadcaster {
JSON.stringify(eip712TypedData),
tx.ethereumAddress,
)

console.log(JSON.stringify(eip712TypedData))
Copy link

Choose a reason for hiding this comment

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

Consider removing console logs before merging to production.

Debugging statements like console.log are generally not recommended for production environments as they can lead to performance issues and unwanted output in production logs.

-    console.log(JSON.stringify(eip712TypedData))
-    console.log({
-      eip712TypedData,
-      signature,
-      txPayload: {
-        message: msgs,
-        memo: tx.memo,
-        signMode: SIGN_EIP712_V2,
-        fee: stdFee,
-        pubKey: pubKeyOrSignatureDerivedPubKey,
-        sequence: baseAccount.sequence,
-        timeoutHeight: timeoutHeight.toNumber(),
-        accountNumber: baseAccount.accountNumber,
-        chainId,
-      },
-    })
-    console.log("signature:", hexToBuff(signature))

Also applies to: 347-347, 434-434, 479-479

@@ -17,7 +17,7 @@ describe('ChainGrpcIbcApi', () => {

expect(response).toBeDefined()
expect(response).toEqual(
expect.objectContaining<IbcApplicationsTransferV1Transfer.DenomTrace[]>(
expect.objectContaining<IbcApplicationsTransferV2Token.Denom[]>(
Copy link

Choose a reason for hiding this comment

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

Ensure Correct Type Assertion in Test

The type assertion using IbcApplicationsTransferV2Token.Denom[] should directly check the elements of the response array rather than the response itself to ensure that each item meets the expected structure.

- expect.objectContaining<IbcApplicationsTransferV2Token.Denom[]>(
-   response,
- ),
+ response.forEach(item => expect(item).toEqual(expect.objectContaining<IbcApplicationsTransferV2Token.Denom>()))
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
expect.objectContaining<IbcApplicationsTransferV2Token.Denom[]>(
response.forEach(item => expect(item).toEqual(expect.objectContaining<IbcApplicationsTransferV2Token.Denom>()))

).toString('hex')
const response = await chainGrpcIbcApi.fetchDenomTrace(ibcHash)

expect(response).toBeDefined()
expect(response).toEqual(
expect.objectContaining<IbcApplicationsTransferV1Transfer.DenomTrace>(
expect.objectContaining<IbcApplicationsTransferV2Token.Denom>(
Copy link

Choose a reason for hiding this comment

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

Refine Test Assertion for Specificity

Similar to the previous comment, ensure the individual item in the response matches the expected type IbcApplicationsTransferV2Token.Denom.

- expect.objectContaining<IbcApplicationsTransferV2Token.Denom>(
-   response,
- ),
+ expect(response).toEqual(expect.objectContaining<IbcApplicationsTransferV2Token.Denom>())
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
expect.objectContaining<IbcApplicationsTransferV2Token.Denom>(
expect(response).toEqual(expect.objectContaining<IbcApplicationsTransferV2Token.Denom>())

Comment on lines +35 to +46

message.sender = params.injectiveAddress
message.marketId = params.marketId

message.subaccountId = params.subaccountId

if (params.orderHash) {
message.orderHash = params.orderHash
}

// TODO: Send order.orderMask instead when chain handles order mask properly.
message.orderMask = InjectiveExchangeV1Beta1Exchange.OrderMask.ANY

Copy link

Choose a reason for hiding this comment

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

Ensure consistency in handling orderMask.

Similar to the previous file, consider adding a FIXME tag to ensure the future update regarding orderMask handling is not forgotten.

- // TODO: Send order.orderMask instead when chain handles order mask properly.
+ // FIXME: Update orderMask handling once the chain supports it.
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
message.sender = params.injectiveAddress
message.marketId = params.marketId
message.subaccountId = params.subaccountId
if (params.orderHash) {
message.orderHash = params.orderHash
}
// TODO: Send order.orderMask instead when chain handles order mask properly.
message.orderMask = InjectiveExchangeV1Beta1Exchange.OrderMask.ANY
message.sender = params.injectiveAddress
message.marketId = params.marketId
message.subaccountId = params.subaccountId
if (params.orderHash) {
message.orderHash = params.orderHash
}
// FIXME: Update orderMask handling once the chain supports it.
message.orderMask = InjectiveExchangeV1Beta1Exchange.OrderMask.ANY

Comment on lines +94 to +96
commissionRate.rate = commissionRate.rate
commissionRate.maxRate = commissionRate.maxRate
commissionRate.maxChangeRate = commissionRate.maxChangeRate
Copy link

Choose a reason for hiding this comment

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

Correct self-assignments in the MsgCreateValidator class.

The self-assignments for rate, maxRate, and maxChangeRate are likely errors and should be corrected to assign the actual intended values.

- commissionRate.rate = commissionRate.rate
- commissionRate.maxRate = commissionRate.maxRate
- commissionRate.maxChangeRate = commissionRate.maxChangeRate
+ commissionRate.rate = params.commission.rate
+ commissionRate.maxRate = params.commission.maxRate
+ commissionRate.maxChangeRate = params.commission.maxChangeRate
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
commissionRate.rate = commissionRate.rate
commissionRate.maxRate = commissionRate.maxRate
commissionRate.maxChangeRate = commissionRate.maxChangeRate
commissionRate.rate = params.commission.rate
commissionRate.maxRate = params.commission.maxRate
commissionRate.maxChangeRate = params.commission.maxChangeRate
Tools
Biome

[error] 94-94: rate is assigned to itself. (lint/correctness/noSelfAssign)

This is where is assigned.


[error] 95-95: maxRate is assigned to itself. (lint/correctness/noSelfAssign)

This is where is assigned.


[error] 96-96: maxChangeRate is assigned to itself. (lint/correctness/noSelfAssign)

This is where is assigned.

Comment on lines 172 to 182
content: {
'@type': '/injective.exchange.v1beta1.PerpetualMarketLaunchProposal',
...this.getContent(),
},
initialDeposit: [
{
denom: params.deposit.denom,
amount: params.deposit.amount,
},
],
content: {
'@type': '/injective.exchange.v1beta1.PerpetualMarketLaunchProposal',
...this.getContent(),
},
proposer: params.proposer,
Copy link

Choose a reason for hiding this comment

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

Best Practice: Use structured logging for better traceability.

The method toWeb3() uses logging for debugging. It's recommended to use structured logging to improve traceability and debugging capabilities.

+ import { Logger } from 'some-logging-library';
- console.log(params);
+ Logger.debug('MsgSubmitProposalPerpetualMarketLaunch parameters', { params });

Committable suggestion was skipped due to low confidence.

Comment on lines 148 to 158
content: {
type: 'exchange/PerpetualMarketLaunchProposal',
value: this.getContent(),
},
initialDeposit: [
{
denom: params.deposit.denom,
amount: params.deposit.amount,
},
],
content: {
type_url: 'exchange/PerpetualMarketLaunchProposal',
value: this.getContent(),
},
proposer: params.proposer,
Copy link

Choose a reason for hiding this comment

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

Code Improvement: Enhance data structure consistency.

The structure for the amino message could be improved for better consistency and readability. Consider using a more structured approach to creating these nested objects.

- const messageWithProposalType = snakecaseKeys({
-   content: {
-     type: 'exchange/PerpetualMarketLaunchProposal',
-     value: this.getContent(),
-   },
-   initialDeposit: [{
-     denom: params.deposit.denom,
-     amount: params.deposit.amount,
-   }],
-   proposer: params.proposer,
- });
+ const messageWithProposalType = snakecaseKeys({
+   content: {
+     type: 'exchange/PerpetualMarketLaunchProposal',
+     value: this.getContent(),
+   },
+   initialDeposit: [params.deposit],
+   proposer: params.proposer,
+ });
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
content: {
type: 'exchange/PerpetualMarketLaunchProposal',
value: this.getContent(),
},
initialDeposit: [
{
denom: params.deposit.denom,
amount: params.deposit.amount,
},
],
content: {
type_url: 'exchange/PerpetualMarketLaunchProposal',
value: this.getContent(),
},
proposer: params.proposer,
content: {
type: 'exchange/PerpetualMarketLaunchProposal',
value: this.getContent(),
},
initialDeposit: [params.deposit],
proposer: params.proposer,

Comment on lines +56 to +64
content.quoteDenom = params.market.quoteDenom
content.oracleBase = params.market.oracleBase
content.oracleQuote = params.market.oracleQuote
content.oracleScaleFactor = params.market.oracleScaleFactor
content.oracleType = params.market.oracleType
content.initialMarginRatio = params.market.initialMarginRatio
content.maintenanceMarginRatio = params.market.maintenanceMarginRatio
content.makerFeeRate = params.market.makerFeeRate
content.takerFeeRate = params.market.takerFeeRate
Copy link

Choose a reason for hiding this comment

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

Refactor suggestion: Use direct assignment for content creation.

Instead of calling create() and then assigning properties, you can streamline this by using fromPartial({ ...params }) directly if it aligns with the expected object structure. This reduces redundancy and improves readability.

- const content = InjectiveExchangeV1Beta1Proposal.PerpetualMarketLaunchProposal.create()
- content.title = params.market.title
- content.description = params.market.description
- content.ticker = params.market.ticker
- content.quoteDenom = params.market.quoteDenom
- content.oracleBase = params.market.oracleBase
- content.oracleQuote = params.market.oracleQuote
- content.oracleScaleFactor = params.market.oracleScaleFactor
- content.oracleType = params.market.oracleType
- content.initialMarginRatio = params.market.initialMarginRatio
- content.maintenanceMarginRatio = params.market.maintenanceMarginRatio
- content.makerFeeRate = params.market.makerFeeRate
- content.takerFeeRate = params.market.takerFeeRate
- content.minPriceTickSize = params.market.minPriceTickSize
- content.minQuantityTickSize = params.market.minQuantityTickSize
+ const content = InjectiveExchangeV1Beta1Proposal.PerpetualMarketLaunchProposal.fromPartial({
+   ...params.market
+ });
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
content.quoteDenom = params.market.quoteDenom
content.oracleBase = params.market.oracleBase
content.oracleQuote = params.market.oracleQuote
content.oracleScaleFactor = params.market.oracleScaleFactor
content.oracleType = params.market.oracleType
content.initialMarginRatio = params.market.initialMarginRatio
content.maintenanceMarginRatio = params.market.maintenanceMarginRatio
content.makerFeeRate = params.market.makerFeeRate
content.takerFeeRate = params.market.takerFeeRate
const content = InjectiveExchangeV1Beta1Proposal.PerpetualMarketLaunchProposal.fromPartial({
...params.market
});

Comment on lines +17 to +30

content.title = params.market.title
content.description = params.market.description
content.quoteDenom = params.market.quoteDenom
content.ticker = params.market.ticker
content.initialMarginRatio = params.market.initialMarginRatio
content.maintenanceMarginRatio = params.market.maintenanceMarginRatio
content.makerFeeRate = params.market.makerFeeRate
content.takerFeeRate = params.market.takerFeeRate
content.quoteDenom = params.market.quoteDenom
content.oracleBase = params.market.oracleBase
content.oracleQuote = params.market.oracleQuote
content.oracleScaleFactor = params.market.oracleScaleFactor
content.oracleType = params.market.oracleType
content.expiry = params.market.expiry.toString()
content.initialMarginRatio = params.market.initialMarginRatio
content.maintenanceMarginRatio = params.market.maintenanceMarginRatio
content.makerFeeRate = params.market.makerFeeRate
content.takerFeeRate = params.market.takerFeeRate
Copy link

Choose a reason for hiding this comment

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

Refactor suggestion: Use direct assignment for content creation.

Instead of calling create() and then assigning properties, you can streamline this by using fromPartial({ ...params }) directly if it aligns with the expected object structure. This reduces redundancy and improves readability.

- const content = InjectiveExchangeV1Beta1Proposal.ExpiryFuturesMarketLaunchProposal.create()
- content.title = params.market.title
- content.description = params.market.description
- content.ticker = params.market.ticker
- content.quoteDenom = params.market.quoteDenom
- content.oracleBase = params.market.oracleBase
- content.oracleQuote = params.market.oracleQuote
- content.oracleScaleFactor = params.market.oracleScaleFactor
- content.oracleType = params.market.oracleType
- content.expiry = params.market.expiry.toString()
- content.initialMarginRatio = params.market.initialMarginRatio
- content.maintenanceMarginRatio = params.market.maintenanceMarginRatio
- content.makerFeeRate = params.market.makerFeeRate
- content.takerFeeRate = params.market.takerFeeRate
- content.minPriceTickSize = params.market.minPriceTickSize
- content.minQuantityTickSize = params.market.minQuantityTickSize
+ const content = InjectiveExchangeV1Beta1Proposal.ExpiryFuturesMarketLaunchProposal.fromPartial({
+   ...params.market,
+   expiry: params.market.expiry.toString()  // Ensure conversion to string is necessary
+ });
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
content.title = params.market.title
content.description = params.market.description
content.quoteDenom = params.market.quoteDenom
content.ticker = params.market.ticker
content.initialMarginRatio = params.market.initialMarginRatio
content.maintenanceMarginRatio = params.market.maintenanceMarginRatio
content.makerFeeRate = params.market.makerFeeRate
content.takerFeeRate = params.market.takerFeeRate
content.quoteDenom = params.market.quoteDenom
content.oracleBase = params.market.oracleBase
content.oracleQuote = params.market.oracleQuote
content.oracleScaleFactor = params.market.oracleScaleFactor
content.oracleType = params.market.oracleType
content.expiry = params.market.expiry.toString()
content.initialMarginRatio = params.market.initialMarginRatio
content.maintenanceMarginRatio = params.market.maintenanceMarginRatio
content.makerFeeRate = params.market.makerFeeRate
content.takerFeeRate = params.market.takerFeeRate
const content = InjectiveExchangeV1Beta1Proposal.ExpiryFuturesMarketLaunchProposal.fromPartial({
...params.market,
expiry: params.market.expiry.toString() // Ensure conversion to string is necessary
});

Comment on lines +119 to +128

contentAny.typeUrl =
'/injective.exchange.v1beta1.ExpiryFuturesMarketLaunchProposal'
contentAny.value =
InjectiveExchangeV1Beta1Proposal.ExpiryFuturesMarketLaunchProposal.encode(
content,
).finish()
contentAny.typeUrl =
'/injective.exchange.v1beta1.ExpiryFuturesMarketLaunchProposal'

const message = CosmosGovV1Beta1Tx.MsgSubmitProposal.create()

Copy link

Choose a reason for hiding this comment

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

Potential Issue: Inconsistent fee rate assignment.

The takerFeeRate is mistakenly set to makerFeeRate. This could be a copy-paste error and should be corrected unless intentional.

- takerFeeRate: amountToCosmosSdkDecAmount(params.market.makerFeeRate).toFixed(),
+ takerFeeRate: amountToCosmosSdkDecAmount(params.market.takerFeeRate).toFixed(),

Committable suggestion was skipped due to low confidence.

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: 2

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 7784ca7 and 05d8156.

Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
Files selected for processing (4)
  • packages/sdk-ts/package.json (2 hunks)
  • packages/sdk-ts/src/core/modules/exchange/msgs/MsgInstantSpotMarketLaunch.ts (3 hunks)
  • packages/sdk-ts/src/core/modules/gov/msgs/MsgSubmitProposalPerpetualMarketLaunch.ts (6 hunks)
  • packages/sdk-ts/src/core/modules/gov/msgs/MsgSubmitProposalSpotMarketLaunch.ts (6 hunks)
Files skipped from review due to trivial changes (1)
  • packages/sdk-ts/package.json
Additional comments not posted (7)
packages/sdk-ts/src/core/modules/exchange/msgs/MsgInstantSpotMarketLaunch.ts (1)

14-18: LGTM! New fields added to Params interface.

The new fields minNotional, makerFeeRate, and takerFeeRate have been correctly added to the market object in the Params interface.

packages/sdk-ts/src/core/modules/gov/msgs/MsgSubmitProposalSpotMarketLaunch.ts (3)

23-23: LGTM! New field added to Params interface.

The new field minNotional has been correctly added to the market object in the Params interface.


57-57: LGTM! New field assigned in createSpotMarketLaunchContent function.

The new field minNotional has been correctly assigned in the createSpotMarketLaunchContent function.


102-104: LGTM! New field converted in toProto method.

The new field minNotional has been correctly converted to a Cosmos SDK decimal amount in the toProto method.

packages/sdk-ts/src/core/modules/gov/msgs/MsgSubmitProposalPerpetualMarketLaunch.ts (3)

29-29: LGTM! New field added to Params interface.

The new field minNotional has been correctly added to the market object in the Params interface.


68-68: LGTM! New field assigned in createPerpetualMarketLaunch function.

The new field minNotional has been correctly assigned in the createPerpetualMarketLaunch function.


116-118: LGTM! New field converted in toProto method.

The new field minNotional has been correctly converted to a Cosmos SDK decimal amount in the toProto method.

Comment on lines 34 to 36
message.minNotional = params.market.minNotional
message.makerFeeRate = params.market.makerFeeRate
message.takerFeeRate = params.market.makerFeeRate
Copy link

Choose a reason for hiding this comment

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

Potential issue: takerFeeRate assigned the value of makerFeeRate.

The takerFeeRate field is assigned the value of makerFeeRate. This might be a mistake and should be verified.

-  message.takerFeeRate = params.market.makerFeeRate
+  message.takerFeeRate = params.market.takerFeeRate
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
message.minNotional = params.market.minNotional
message.makerFeeRate = params.market.makerFeeRate
message.takerFeeRate = params.market.makerFeeRate
message.minNotional = params.market.minNotional
message.makerFeeRate = params.market.makerFeeRate
message.takerFeeRate = params.market.takerFeeRate

Comment on lines 69 to 77
minNotional: amountToCosmosSdkDecAmount(
initialParams.market.minNotional,
).toFixed(),
makerFeeRate: amountToCosmosSdkDecAmount(
initialParams.market.makerFeeRate,
).toFixed(),
takerFeeRate: amountToCosmosSdkDecAmount(
initialParams.market.makerFeeRate,
).toFixed(),
Copy link

Choose a reason for hiding this comment

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

Potential issue: takerFeeRate assigned the value of makerFeeRate.

The takerFeeRate field is assigned the value of makerFeeRate. This might be a mistake and should be verified.

-  takerFeeRate: amountToCosmosSdkDecAmount(
-    initialParams.market.makerFeeRate,
-  ).toFixed(),
+  takerFeeRate: amountToCosmosSdkDecAmount(
+    initialParams.market.takerFeeRate,
+  ).toFixed(),
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
minNotional: amountToCosmosSdkDecAmount(
initialParams.market.minNotional,
).toFixed(),
makerFeeRate: amountToCosmosSdkDecAmount(
initialParams.market.makerFeeRate,
).toFixed(),
takerFeeRate: amountToCosmosSdkDecAmount(
initialParams.market.makerFeeRate,
).toFixed(),
minNotional: amountToCosmosSdkDecAmount(
initialParams.market.minNotional,
).toFixed(),
makerFeeRate: amountToCosmosSdkDecAmount(
initialParams.market.makerFeeRate,
).toFixed(),
takerFeeRate: amountToCosmosSdkDecAmount(
initialParams.market.takerFeeRate,
).toFixed(),

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 05d8156 and 8d075dd.

Files selected for processing (2)
  • packages/sdk-ts/package.json (2 hunks)
  • packages/wallet-ts/package.json (2 hunks)
Files skipped from review due to trivial changes (1)
  • packages/wallet-ts/package.json
Additional comments not posted (2)
packages/sdk-ts/package.json (2)

4-4: Verify the reasoning behind the version downgrade.

The version number was downgraded from 1.14.13-beta.4 to 1.14.12-dev.4. Ensure that this change aligns with the project’s versioning strategy and there are no issues caused by this downgrade.


40-40: Verify compatibility of updated dependencies.

Ensure that the updates to dependencies, such as @injectivelabs/core-proto-ts, @injectivelabs/dmm-proto-ts, and others, do not introduce breaking changes and are compatible with the rest of the codebase.

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 8d075dd and d1f31e5.

Files selected for processing (1)
  • packages/sdk-ts/src/core/modules/exchange/msgs/MsgInstantSpotMarketLaunch.ts (3 hunks)
Files skipped from review as they are similar to previous changes (1)
  • packages/sdk-ts/src/core/modules/exchange/msgs/MsgInstantSpotMarketLaunch.ts

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 d1f31e5 and d4e0cfc.

Files selected for processing (2)
  • packages/sdk-ts/package.json (2 hunks)
  • packages/wallet-ts/package.json (2 hunks)
Files skipped from review as they are similar to previous changes (2)
  • packages/sdk-ts/package.json
  • packages/wallet-ts/package.json

shane-moore and others added 2 commits July 24, 2024 13:42
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 4d71d68 and 29758d1.

Files selected for processing (2)
  • packages/ts-types/src/cosmos.ts (1 hunks)
  • packages/wallet-ts/src/utils/wallets/cosmos/endpoints.ts (1 hunks)
Files skipped from review as they are similar to previous changes (2)
  • packages/ts-types/src/cosmos.ts
  • packages/wallet-ts/src/utils/wallets/cosmos/endpoints.ts

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 29758d1 and bf19b4c.

Files selected for processing (6)
  • packages/exceptions/package.json (2 hunks)
  • packages/networks/package.json (2 hunks)
  • packages/sdk-ts/package.json (2 hunks)
  • packages/ts-types/package.json (1 hunks)
  • packages/utils/package.json (2 hunks)
  • packages/wallet-ts/package.json (2 hunks)
Files skipped from review as they are similar to previous changes (6)
  • packages/exceptions/package.json
  • packages/networks/package.json
  • packages/sdk-ts/package.json
  • packages/ts-types/package.json
  • packages/utils/package.json
  • packages/wallet-ts/package.json

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 bf19b4c and 0561ad8.

Files selected for processing (1)
  • packages/sdk-ts/src/core/modules/ibc/msgs/MsgTransferCosmjs.ts (3 hunks)
Additional comments not posted (2)
packages/sdk-ts/src/core/modules/ibc/msgs/MsgTransferCosmjs.ts (2)

52-57: LGTM! Improved readability.

The reordering of property assignments enhances the readability of the toProto method.


81-101: LGTM! Simplified message construction.

The changes simplify the message construction and improve maintainability of the toAmino method.

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 0561ad8 and d953bea.

Files selected for processing (2)
  • packages/sdk-ts/package.json (2 hunks)
  • packages/wallet-ts/package.json (2 hunks)
Files skipped from review as they are similar to previous changes (2)
  • packages/sdk-ts/package.json
  • packages/wallet-ts/package.json

ThomasRalee and others added 3 commits July 25, 2024 14:13
…pgrade-branch

Chore/merge dev to chain upgrade branch
 - @injectivelabs/[email protected]
 - @injectivelabs/[email protected]
 - @injectivelabs/[email protected]
 - @injectivelabs/[email protected]
 - @injectivelabs/[email protected]
 - @injectivelabs/[email protected]
 - @injectivelabs/[email protected]
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: 5

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between d953bea and 0ee449f.

Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
Files selected for processing (14)
  • .gitbook/core-modules/token-factory.md (3 hunks)
  • .gitbook/core-modules/tokenfactory.md (1 hunks)
  • packages/sdk-ts/src/client/indexer/transformers/IndexerGrpcDerivativeTransformer.ts (2 hunks)
  • packages/sdk-ts/src/core/modules/exchange/msgs/MsgBatchUpdateOrders.ts (1 hunks)
  • packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateBinaryOptionsLimitOrder.ts (2 hunks)
  • packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateBinaryOptionsMarketOrder.ts (2 hunks)
  • packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateDerivativeLimitOrder.ts (2 hunks)
  • packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateDerivativeMarketOrder.ts (1 hunks)
  • packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateSpotLimitOrder.ts (1 hunks)
  • packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateSpotMarketOrder.ts (1 hunks)
  • packages/sdk-ts/src/core/modules/exchange/msgs/MsgIncreasePositionMargin.ts (1 hunks)
  • packages/sdk-ts/src/core/modules/exchange/msgs/MsgInstantBinaryOptionsMarketLaunch.ts (3 hunks)
  • packages/sdk-ts/src/core/modules/exchange/msgs/MsgInstantSpotMarketLaunch.ts (3 hunks)
  • packages/wallet-ts/src/broadcaster/MsgBroadcaster.ts (4 hunks)
Files skipped from review due to trivial changes (8)
  • .gitbook/core-modules/token-factory.md
  • packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateBinaryOptionsLimitOrder.ts
  • packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateBinaryOptionsMarketOrder.ts
  • packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateDerivativeLimitOrder.ts
  • packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateDerivativeMarketOrder.ts
  • packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateSpotLimitOrder.ts
  • packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateSpotMarketOrder.ts
  • packages/sdk-ts/src/core/modules/exchange/msgs/MsgIncreasePositionMargin.ts
Files skipped from review as they are similar to previous changes (2)
  • packages/sdk-ts/src/client/indexer/transformers/IndexerGrpcDerivativeTransformer.ts
  • packages/sdk-ts/src/core/modules/exchange/msgs/MsgInstantSpotMarketLaunch.ts
Additional comments not posted (5)
packages/sdk-ts/src/core/modules/exchange/msgs/MsgInstantBinaryOptionsMarketLaunch.ts (2)

52-52: LGTM! The new field minNotional is added correctly.

The minNotional field is properly included in the message object.


91-93: LGTM! The new field minNotional is added correctly.

The minNotional field is properly included in the toProto method.

.gitbook/core-modules/tokenfactory.md (1)

150-151: LGTM! The new field decimals is added correctly.

The decimals field is properly included in the MsgSetDenomMetadata object.

packages/sdk-ts/src/core/modules/exchange/msgs/MsgBatchUpdateOrders.ts (2)

338-363: LGTM! The new functionality for handling binary options orders is added correctly.

The function correctly includes the logic for handling binary options orders.


365-373: LGTM! The new functionality for handling binary options orders is added correctly.

The function correctly includes the logic for handling binary options orders.

Comment on lines 442 to 444

console.log(JSON.stringify(eip712TypedData))

Copy link

Choose a reason for hiding this comment

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

Remove console log statement.

Logging sensitive data such as eip712TypedData can lead to security issues. Additionally, console logs should be removed from production code to avoid performance issues and cluttered logs.

-    console.log(JSON.stringify(eip712TypedData))
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
console.log(JSON.stringify(eip712TypedData))

Comment on lines 452 to 467
console.log({
eip712TypedData,
signature,
txPayload: {
message: msgs,
memo: tx.memo,
signMode: SIGN_EIP712_V2,
fee: stdFee,
pubKey: pubKeyOrSignatureDerivedPubKey,
sequence: baseAccount.sequence,
timeoutHeight: timeoutHeight.toNumber(),
accountNumber: baseAccount.accountNumber,
chainId,
},
})

Copy link

Choose a reason for hiding this comment

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

Remove console log statement.

Logging sensitive data such as the transaction payload can lead to security issues. Additionally, console logs should be removed from production code to avoid performance issues and cluttered logs.

-    console.log({
-      eip712TypedData,
-      signature,
-      txPayload: {
-        message: msgs,
-        memo: tx.memo,
-        signMode: SIGN_EIP712_V2,
-        fee: stdFee,
-        pubKey: pubKeyOrSignatureDerivedPubKey,
-        sequence: baseAccount.sequence,
-        timeoutHeight: timeoutHeight.toNumber(),
-        accountNumber: baseAccount.accountNumber,
-        chainId,
-      },
-    })
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
console.log({
eip712TypedData,
signature,
txPayload: {
message: msgs,
memo: tx.memo,
signMode: SIGN_EIP712_V2,
fee: stdFee,
pubKey: pubKeyOrSignatureDerivedPubKey,
sequence: baseAccount.sequence,
timeoutHeight: timeoutHeight.toNumber(),
accountNumber: baseAccount.accountNumber,
chainId,
},
})

Comment on lines 356 to 357
console.log("signature:", hexToBuff(signature))

Copy link

Choose a reason for hiding this comment

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

Remove console log statement.

Logging sensitive data such as the signature can lead to security issues. Additionally, console logs should be removed from production code to avoid performance issues and cluttered logs.

-    console.log("signature:", hexToBuff(signature))
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
console.log("signature:", hexToBuff(signature))

Comment on lines 309 to 311

console.log(JSON.stringify(eip712TypedData))

Copy link

Choose a reason for hiding this comment

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

Remove console log statement.

Logging sensitive data such as eip712TypedData can lead to security issues. Additionally, console logs should be removed from production code to avoid performance issues and cluttered logs.

-    console.log(JSON.stringify(eip712TypedData))
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
console.log(JSON.stringify(eip712TypedData))

Comment on lines 319 to 334
console.log({
eip712TypedData,
signature,
txPayload: {
message: msgs,
memo: tx.memo,
signMode: SIGN_EIP712_V2,
fee: stdFee,
pubKey: pubKeyOrSignatureDerivedPubKey,
sequence: baseAccount.sequence,
timeoutHeight: timeoutHeight.toNumber(),
accountNumber: baseAccount.accountNumber,
chainId,
},
})

Copy link

Choose a reason for hiding this comment

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

Remove console log statement.

Logging sensitive data such as the transaction payload can lead to security issues. Additionally, console logs should be removed from production code to avoid performance issues and cluttered logs.

-    console.log({
-      eip712TypedData,
-      signature,
-      txPayload: {
-        message: msgs,
-        memo: tx.memo,
-        signMode: SIGN_EIP712_V2,
-        fee: stdFee,
-        pubKey: pubKeyOrSignatureDerivedPubKey,
-        sequence: baseAccount.sequence,
-        timeoutHeight: timeoutHeight.toNumber(),
-        accountNumber: baseAccount.accountNumber,
-        chainId,
-      },
-    })
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
console.log({
eip712TypedData,
signature,
txPayload: {
message: msgs,
memo: tx.memo,
signMode: SIGN_EIP712_V2,
fee: stdFee,
pubKey: pubKeyOrSignatureDerivedPubKey,
sequence: baseAccount.sequence,
timeoutHeight: timeoutHeight.toNumber(),
accountNumber: baseAccount.accountNumber,
chainId,
},
})

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 0ee449f and 80546db.

Files selected for processing (7)
  • packages/exceptions/package.json (2 hunks)
  • packages/networks/package.json (2 hunks)
  • packages/sdk-ts/package.json (2 hunks)
  • packages/test-utils/package.json (1 hunks)
  • packages/ts-types/package.json (1 hunks)
  • packages/utils/package.json (2 hunks)
  • packages/wallet-ts/package.json (2 hunks)
Files skipped from review due to trivial changes (1)
  • packages/test-utils/package.json
Files skipped from review as they are similar to previous changes (6)
  • packages/exceptions/package.json
  • packages/networks/package.json
  • packages/sdk-ts/package.json
  • packages/ts-types/package.json
  • packages/utils/package.json
  • packages/wallet-ts/package.json

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 80546db and 8bd91a8.

Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
Files selected for processing (3)
  • packages/sdk-ts/package.json (2 hunks)
  • packages/sdk-ts/src/core/modules/ibc/msgs/MsgTransfer.ts (1 hunks)
  • packages/wallet-ts/package.json (2 hunks)
Files skipped from review due to trivial changes (1)
  • packages/sdk-ts/src/core/modules/ibc/msgs/MsgTransfer.ts
Files skipped from review as they are similar to previous changes (2)
  • packages/sdk-ts/package.json
  • packages/wallet-ts/package.json

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 8bd91a8 and 253737c.

Files selected for processing (1)
  • packages/sdk-ts/src/client/chain/grpc/ChainGrpcDistributionApi.ts (1 hunks)
Additional comments not posted (1)
packages/sdk-ts/src/client/chain/grpc/ChainGrpcDistributionApi.ts (1)

118-121: Enhanced error handling logic.

The additional error handling for the phrase "no delegation for (address, validator) tuple" improves robustness.

However, ensure that the error messages are consistent and correctly handled across the codebase.

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 253737c and 7966105.

Files selected for processing (2)
  • packages/sdk-ts/package.json (2 hunks)
  • packages/wallet-ts/package.json (2 hunks)
Additional comments not posted (14)
packages/sdk-ts/package.json (8)

4-4: Version change: Package version updated.

The package version has been updated from 1.14.14-beta.5 to 1.14.12-dev.20. This indicates a shift from a beta to a development version, which might imply ongoing development and potential instability.

Ensure that this version change aligns with the overall release strategy and that all dependent packages are compatible with this version.


40-40: Dependency Version Change: @injectivelabs/core-proto-ts.

The version for @injectivelabs/core-proto-ts has been updated from "^0.0.21" to "0.0.28". This change removes the caret (^), which means future minor updates will not be automatically included. This could impact future compatibility.

Consider whether pinning to a specific version is necessary or if maintaining flexibility with the caret would be more beneficial.


42-42: Dependency Version Change: @injectivelabs/exceptions.

The version for @injectivelabs/exceptions has been updated from "^1.14.14-beta.2" to "^1.14.13-dev.3". This change reflects a shift from a beta to a development version, which might imply ongoing development and potential instability.

Ensure that this version change aligns with the overall release strategy and that all dependent packages are compatible with this version.


46-46: Dependency Version Change: @injectivelabs/indexer-proto-ts.

The version for @injectivelabs/indexer-proto-ts has been updated from "1.11.42" to "1.11.44". This is a minor version update, which typically includes backward-compatible bug fixes and improvements.

Ensure that this update does not introduce any breaking changes.


48-48: Dependency Version Change: @injectivelabs/networks.

The version for @injectivelabs/networks has been updated from "^1.14.14-beta.2" to "^1.14.13-dev.3". This change reflects a shift from a beta to a development version, which might imply ongoing development and potential instability.

Ensure that this version change aligns with the overall release strategy and that all dependent packages are compatible with this version.


49-49: Dependency Version Change: @injectivelabs/test-utils.

The version for @injectivelabs/test-utils has been updated from "^1.14.14-beta.0" to "^1.14.13-beta.0". This is a minor version downgrade, which might imply adjustments for compatibility or stability.

Ensure that this version change aligns with the overall release strategy and that all dependent packages are compatible with this version.


50-50: Dependency Version Change: @injectivelabs/ts-types.

The version for @injectivelabs/ts-types has been updated from "^1.14.14-beta.2" to "^1.14.13-dev.3". This change reflects a shift from a beta to a development version, which might imply ongoing development and potential instability.

Ensure that this version change aligns with the overall release strategy and that all dependent packages are compatible with this version.


51-51: Dependency Version Change: @injectivelabs/utils.

The version for @injectivelabs/utils has been updated from "^1.14.14-beta.2" to "^1.14.13-dev.3". This change reflects a shift from a beta to a development version, which might imply ongoing development and potential instability.

Ensure that this version change aligns with the overall release strategy and that all dependent packages are compatible with this version.

packages/wallet-ts/package.json (6)

4-4: Version change: Package version updated.

The package version has been updated from 1.14.14-beta.7 to 1.14.12-dev.20. This indicates a shift from a beta to a development version, which might imply ongoing development and potential instability.

Ensure that this version change aligns with the overall release strategy and that all dependent packages are compatible with this version.


43-43: Dependency Version Change: @injectivelabs/exceptions.

The version for @injectivelabs/exceptions has been updated from "^1.14.14-beta.2" to "^1.14.12-beta.0". This change reflects a minor version downgrade, which might imply adjustments for compatibility or stability.

Ensure that this version change aligns with the overall release strategy and that all dependent packages are compatible with this version.


44-44: Dependency Version Change: @injectivelabs/networks.

The version for @injectivelabs/networks has been updated from "^1.14.14-beta.2" to "^1.14.12-beta.0". This change reflects a minor version downgrade, which might imply adjustments for compatibility or stability.

Ensure that this version change aligns with the overall release strategy and that all dependent packages are compatible with this version.


45-45: Dependency Version Change: @injectivelabs/sdk-ts.

The version for @injectivelabs/sdk-ts has been updated from "^1.14.14-beta.5" to "^1.14.12-dev.20". This change reflects a shift from a beta to a development version, which might imply ongoing development and potential instability.

Ensure that this version change aligns with the overall release strategy and that all dependent packages are compatible with this version.


46-46: Dependency Version Change: @injectivelabs/ts-types.

The version for @injectivelabs/ts-types has been updated from "^1.14.14-beta.2" to "^1.14.12-beta.0". This change reflects a minor version downgrade, which might imply adjustments for compatibility or stability.

Ensure that this version change aligns with the overall release strategy and that all dependent packages are compatible with this version.


47-47: Dependency Version Change: @injectivelabs/utils.

The version for @injectivelabs/utils has been updated from "^1.14.14-beta.2" to "^1.14.12-beta.0". This change reflects a minor version downgrade, which might imply adjustments for compatibility or stability.

Ensure that this version change aligns with the overall release strategy and that all dependent packages are compatible with this version.

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 7966105 and 00711b2.

Files selected for processing (4)
  • packages/wallet-ts/package.json (2 hunks)
  • packages/wallet-ts/src/broadcaster/MsgBroadcaster.ts (2 hunks)
  • packages/wallet-ts/src/strategies/wallet-strategy/strategies/Ledger/Base.ts (2 hunks)
  • packages/wallet-ts/src/strategies/wallet-strategy/strategies/Trezor/index.ts (3 hunks)
Files skipped from review due to trivial changes (1)
  • packages/wallet-ts/src/broadcaster/MsgBroadcaster.ts
Files skipped from review as they are similar to previous changes (1)
  • packages/wallet-ts/package.json
Additional comments not posted (3)
packages/wallet-ts/src/strategies/wallet-strategy/strategies/Ledger/Base.ts (1)

410-412: LGTM! Verify the function usage in the codebase.

The network selection logic has been updated from AlchemyNetwork.ETH_GOERLI to AlchemyNetwork.ETH_SEPOLIA. Ensure that all references to the getAlchemy method are consistent with this change.

packages/wallet-ts/src/strategies/wallet-strategy/strategies/Trezor/index.ts (2)

64-67: LGTM!

The reformatting of the class declaration improves readability without altering the underlying functionality.


436-438: LGTM! Verify the function usage in the codebase.

The network selection logic has been updated from AlchemyNetwork.ETH_GOERLI to AlchemyNetwork.ETH_SEPOLIA. Ensure that all references to the getAlchemy method are consistent with this change.

Verification successful

The network selection logic has been successfully updated.

The getAlchemy function implementations across various files have been updated to use AlchemyNetwork.ETH_SEPOLIA instead of AlchemyNetwork.ETH_GOERLI. The changes are consistent in the following files:

  • packages/wallet-ts/src/strategies/wallet-strategy/strategies/Trezor/index.ts
  • packages/wallet-ts/src/strategies/wallet-strategy/strategies/Ledger/Base.ts
  • deprecated/sdk-ui-ts/src/services/web3/Web3Composer.ts
  • deprecated/sdk-ui-ts/src/services/web3/Web3Client.ts

These updates ensure that the application interacts with the Ethereum Sepolia test network as intended.

Scripts executed

The following scripts were executed for the analysis:

Script:

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

# Test: Search for the function usage. Expect: Only occurrences of the new network selection logic.
rg --type python -A 5 $'getAlchemy'

Length of output: 65


Script:

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

# Test: Search for the function usage. Expect: Only occurrences of the new network selection logic.
rg --type ts -A 5 $'getAlchemy'

Length of output: 8510


Script:

#!/bin/bash
# Description: Extract more context around the `getAlchemy` function implementations and usages to verify the network selection logic.

# Search for the `getAlchemy` function implementation and its usages in TypeScript files.
rg --type ts -A 10 -B 10 'getAlchemy'

Length of output: 27040


Script:

#!/bin/bash
# Description: Extract the full implementations of the `getAlchemy` function to verify the network selection logic.

# Search for the `getAlchemy` function implementation in TypeScript files.
rg --type ts -A 20 -B 5 'async getAlchemy()'

Length of output: 8560

Copy link

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/[email protected] None 0 6.8 kB feross

View full report↗︎

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 00711b2 and b88ecb0.

Files selected for processing (4)
  • .github/workflows/canary.yml (3 hunks)
  • packages/sdk-ts/package.json (1 hunks)
  • packages/sdk-ts/src/core/modules/authz/msgs/MsgExec.ts (3 hunks)
  • packages/ts-types/src/enums.ts (1 hunks)
Files skipped from review due to trivial changes (1)
  • packages/sdk-ts/package.json
Additional comments not posted (8)
.github/workflows/canary.yml (4)

12-12: Verify the necessity of permissions: write-all.

Granting write-all permissions can have security implications. Ensure that this level of access is required and justified for the workflow.


20-23: Node.js version update approved.

Updating Node.js to version 18 is a good practice to leverage new features and improvements.


35-35: Lerna clean command approved.

Adding lerna clean --yes helps ensure a clean build environment by removing previous build artifacts.


49-50: Pre-release identifier update approved.

Changing the pre-release identifier to alpha aligns with the new versioning strategy.

packages/sdk-ts/src/core/modules/authz/msgs/MsgExec.ts (2)

46-48: Mapping to GoogleProtobufAny.Any format approved.

The change is part of the existing functionality and looks good.


68-78: toAmino method update approved with a minor refactor suggestion.

The updated toAmino method improves robustness by ensuring msgs is always treated as an array. Consider refactoring for clarity and efficiency.

-    const msgs = Array.isArray(params.msgs) ? params.msgs : [params.msgs]
-    return {
-      type: 'cosmos-sdk/MsgExec',
-      value: {
-        grantee: params.grantee,
-        msgs: msgs.map((msg) => {
-          return msg.toEip712()
-        }),
-      },
-    }
+    return {
+      type: 'cosmos-sdk/MsgExec',
+      value: {
+        grantee: params.grantee,
+        msgs: (Array.isArray(params.msgs) ? params.msgs : [params.msgs]).map(msg => msg.toEip712()),
+      },
+    }

[approved, refactor_suggestion]

packages/ts-types/src/enums.ts (2)

100-100: Addition of MsgPrivilegedExecuteContract approved.

The new message type enhances the functionality of the messaging system.


101-101: Addition of MsgMultiSend approved.

The new message type enhances the functionality of the messaging system.

@ThomasRalee ThomasRalee merged commit ee7ddeb into dev Jul 31, 2024
4 of 5 checks passed
@ThomasRalee ThomasRalee deleted the chore/chain-v50-canary branch July 31, 2024 11:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet