Skip to content

Feat/rf 1153 shapeshift snap#5

Open
RyukTheCoder wants to merge 801 commits intonextfrom
feat/rf-1153-shapeshift-snap
Open

Feat/rf 1153 shapeshift snap#5
RyukTheCoder wants to merge 801 commits intonextfrom
feat/rf-1153-shapeshift-snap

Conversation

@RyukTheCoder
Copy link
Copy Markdown
Owner

Summary

Please include a summary of the changes and the related issue. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes # (issue)

How did you test this change?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Test A
  • Test B

Checklist:

  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • Implemented a user interface (UI) change, referencing our Figma design to ensure pixel-perfect precision.

nikaaru and others added 30 commits September 20, 2023 09:15
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]

Affected packages: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected]
yeager-eren and others added 26 commits December 24, 2023 16:17
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]

Affected packages: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]

Affected packages: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected]
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 19, 2026

Important

Review skipped

Too many files!

This PR contains 299 files, which is 149 over the limit of 150.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: ed8a0c6c-e6cf-4264-bd8d-bc5f9c329e38

📥 Commits

Reviewing files that changed from the base of the PR and between d6622c2 and 795d29c.

⛔ Files ignored due to path filters (1)
  • signers/signer-evm/yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (299)
  • .eslintignore
  • .eslintrc.json
  • .github/ISSUE_TEMPLATE/bug_report.md
  • .github/ISSUE_TEMPLATE/feature_request.md
  • .github/PULL_REQUEST_TEMPLATE.md
  • .github/actions/prepare/action.yml
  • .github/workflows/checks.yaml
  • .github/workflows/crowdin.yml
  • .github/workflows/deploy.yml
  • .github/workflows/publish.yaml
  • .github/workflows/publish.yml
  • .gitignore
  • .husky/pre-commit
  • .prettierrc.json
  • .vscode/launch.json
  • .vscode/settings.json
  • CONTRIBUTING.md
  • LICENSE.md
  • examples/queue-manager-demo/CHANGELOG.md
  • examples/queue-manager-demo/package.json
  • examples/queue-manager-demo/public/index.html
  • examples/queue-manager-demo/readme.md
  • examples/queue-manager-demo/src/App.tsx
  • examples/queue-manager-demo/src/components/FlowRunner/index.tsx
  • examples/queue-manager-demo/src/components/FlowsList/index.tsx
  • examples/queue-manager-demo/src/components/History/index.tsx
  • examples/queue-manager-demo/src/components/Wallets/index.tsx
  • examples/queue-manager-demo/src/configs.ts
  • examples/queue-manager-demo/src/flows/rango/helpers.ts
  • examples/queue-manager-demo/src/flows/rango/mock.ts
  • examples/queue-manager-demo/src/flows/rango/types.ts
  • examples/queue-manager-demo/src/flows/single.ts
  • examples/queue-manager-demo/src/index.tsx
  • examples/queue-manager-demo/src/styles.css
  • examples/queue-manager-demo/src/wallet.js
  • examples/queue-manager-demo/tsconfig.json
  • examples/wallets-adapter-demo/CHANGELOG.md
  • examples/wallets-adapter-demo/package.json
  • examples/wallets-adapter-demo/public/index.html
  • examples/wallets-adapter-demo/readme.md
  • examples/wallets-adapter-demo/src/App.tsx
  • examples/wallets-adapter-demo/src/components/WalletsModal.tsx
  • examples/wallets-adapter-demo/src/constants.ts
  • examples/wallets-adapter-demo/src/index.tsx
  • examples/wallets-adapter-demo/tsconfig.json
  • examples/wallets-demo/CHANGELOG.md
  • examples/wallets-demo/package.json
  • examples/wallets-demo/public/index.html
  • examples/wallets-demo/readme.md
  • examples/wallets-demo/src/App.tsx
  • examples/wallets-demo/src/components/List/Item.tsx
  • examples/wallets-demo/src/components/List/List.tsx
  • examples/wallets-demo/src/components/List/index.ts
  • examples/wallets-demo/src/components/List/modal.tsx
  • examples/wallets-demo/src/components/List/styles.css
  • examples/wallets-demo/src/components/Swap.tsx
  • examples/wallets-demo/src/constants.ts
  • examples/wallets-demo/src/helper.ts
  • examples/wallets-demo/src/index.css
  • examples/wallets-demo/src/index.tsx
  • examples/wallets-demo/tsconfig.json
  • global-wallets-env.d.ts
  • lingui.config.ts
  • package.json
  • queue-manager/core/CHANGELOG.md
  • queue-manager/core/package.json
  • queue-manager/core/readme.md
  • queue-manager/core/src/index.ts
  • queue-manager/core/src/manager.ts
  • queue-manager/core/src/persistor.ts
  • queue-manager/core/tsconfig.json
  • queue-manager/demo/package.json
  • queue-manager/demo/readme.md
  • queue-manager/demo/src/flows/rango/mock.ts
  • queue-manager/demo/src/flows/swap/helpers.ts
  • queue-manager/demo/src/index.tsx
  • queue-manager/rango-preset/CHANGELOG.md
  • queue-manager/rango-preset/package.json
  • queue-manager/rango-preset/readme.md
  • queue-manager/rango-preset/src/actions/checkStatus.ts
  • queue-manager/rango-preset/src/actions/createTransaction.ts
  • queue-manager/rango-preset/src/actions/executeTransaction.ts
  • queue-manager/rango-preset/src/actions/scheduleNextStep.ts
  • queue-manager/rango-preset/src/actions/start.ts
  • queue-manager/rango-preset/src/constants.ts
  • queue-manager/rango-preset/src/helpers.ts
  • queue-manager/rango-preset/src/hooks.ts
  • queue-manager/rango-preset/src/index.ts
  • queue-manager/rango-preset/src/migration.ts
  • queue-manager/rango-preset/src/services/eventEmitter.ts
  • queue-manager/rango-preset/src/shared-errors.ts
  • queue-manager/rango-preset/src/shared-sentry.ts
  • queue-manager/rango-preset/src/shared.ts
  • queue-manager/rango-preset/src/types.ts
  • queue-manager/rango-preset/tsconfig.json
  • queue-manager/react/CHANGELOG.md
  • queue-manager/react/package.json
  • queue-manager/react/readme.md
  • queue-manager/react/src/index.ts
  • queue-manager/react/src/provider.tsx
  • queue-manager/react/tsconfig.json
  • queue-manager/readme.md
  • scripts/build/command.mjs
  • scripts/check-conventional-commits/command.mjs
  • scripts/common/changelog.mjs
  • scripts/common/constants.mjs
  • scripts/common/errors.mjs
  • scripts/common/features.mjs
  • scripts/common/git.mjs
  • scripts/common/github.mjs
  • scripts/common/graph/helpers.mjs
  • scripts/common/graph/index.mjs
  • scripts/common/npm.mjs
  • scripts/common/repository.mjs
  • scripts/common/typedefs.mjs
  • scripts/common/utils.mjs
  • scripts/common/version.mjs
  • scripts/deploy/command.mjs
  • scripts/deploy/config.mjs
  • scripts/deploy/utils.mjs
  • scripts/dev-ts-check/command.mjs
  • scripts/dev-ts-check/watch.mjs
  • scripts/dev-watch/subcommands/watch.mjs
  • scripts/post-release/command.mjs
  • scripts/post-release/tag.mjs
  • scripts/publish/build.mjs
  • scripts/publish/command.mjs
  • scripts/publish/config.mjs
  • scripts/publish/package.mjs
  • scripts/publish/publish.mjs
  • scripts/publish/state.mjs
  • scripts/publish/typedefs.mjs
  • scripts/publish/upgrade.mjs
  • scripts/publish/utils.mjs
  • scripts/release/command.mjs
  • scripts/upgrade-all/command.mjs
  • scripts/upgrade-all/utils.mjs
  • signers/signer-cosmos/CHANGELOG.md
  • signers/signer-cosmos/package.json
  • signers/signer-cosmos/readme.md
  • signers/signer-cosmos/src/helpers.ts
  • signers/signer-cosmos/src/index.ts
  • signers/signer-cosmos/src/signer.ts
  • signers/signer-cosmos/tsconfig.json
  • signers/signer-evm/CHANGELOG.md
  • signers/signer-evm/package.json
  • signers/signer-evm/readme.md
  • signers/signer-evm/src/helper.ts
  • signers/signer-evm/src/index.ts
  • signers/signer-evm/src/signer.ts
  • signers/signer-evm/src/types.ts
  • signers/signer-evm/tests/index.test.ts
  • signers/signer-evm/tests/mock.data.ts
  • signers/signer-evm/tsconfig.json
  • signers/signer-solana/CHANGELOG.md
  • signers/signer-solana/package.json
  • signers/signer-solana/readme.md
  • signers/signer-solana/src/helpers.ts
  • signers/signer-solana/src/index.ts
  • signers/signer-solana/src/signer.ts
  • signers/signer-solana/tsconfig.json
  • signers/signer-starknet/CHANGELOG.md
  • signers/signer-starknet/package.json
  • signers/signer-starknet/readme.md
  • signers/signer-starknet/src/signer.ts
  • signers/signer-starknet/tsconfig.json
  • signers/signer-terra/CHANGELOG.md
  • signers/signer-terra/package.json
  • signers/signer-terra/readme.md
  • signers/signer-terra/src/helpers.ts
  • signers/signer-terra/src/index.ts
  • signers/signer-terra/src/signer.ts
  • signers/signer-terra/tsconfig.json
  • signers/signer-ton/CHANGELOG.md
  • signers/signer-ton/package.json
  • signers/signer-ton/readme.md
  • signers/signer-ton/src/index.ts
  • signers/signer-ton/src/signer.ts
  • signers/signer-ton/tsconfig.json
  • signers/signer-tron/CHANGELOG.md
  • signers/signer-tron/package.json
  • signers/signer-tron/src/signer.ts
  • signers/signer-tron/tsconfig.json
  • test-utils/mock.evm.provider.ts
  • translations/en.po
  • translations/es.po
  • translations/fr.po
  • translations/ja.po
  • tsconfig.base.json
  • tsconfig.lib.json
  • vitest.config.ts
  • wallets/core/CHANGELOG.md
  • wallets/core/package.json
  • wallets/core/readme.md
  • wallets/core/src/helpers.ts
  • wallets/core/src/index.ts
  • wallets/core/src/persistor.ts
  • wallets/core/src/provider.tsx
  • wallets/core/src/types.ts
  • wallets/core/src/wallet.ts
  • wallets/core/tsconfig.json
  • wallets/demo/package.json
  • wallets/demo/src/App.tsx
  • wallets/demo/src/components/List/List.tsx
  • wallets/demo/src/components/List/index.ts
  • wallets/demo/src/index.tsx
  • wallets/provider-all/CHANGELOG.md
  • wallets/provider-all/package.json
  • wallets/provider-all/src/index.ts
  • wallets/provider-all/tsconfig.json
  • wallets/provider-argentx/CHANGELOG.md
  • wallets/provider-argentx/package.json
  • wallets/provider-argentx/src/helpers.ts
  • wallets/provider-argentx/src/index.ts
  • wallets/provider-argentx/src/signer.ts
  • wallets/provider-argentx/tsconfig.json
  • wallets/provider-binance-chain-wallet/package.json
  • wallets/provider-binance-chain-wallet/readme.md
  • wallets/provider-binance-chain-wallet/src/cosmos-signer.ts
  • wallets/provider-binance-chain-wallet/src/helpers.ts
  • wallets/provider-binance-chain-wallet/src/index.ts
  • wallets/provider-binance-chain-wallet/src/signer.ts
  • wallets/provider-binance-chain-wallet/src/types.ts
  • wallets/provider-binance-chain-wallet/tsconfig.json
  • wallets/provider-bitget/CHANGELOG.md
  • wallets/provider-bitget/package.json
  • wallets/provider-bitget/readme.md
  • wallets/provider-bitget/src/helpers.ts
  • wallets/provider-bitget/src/index.ts
  • wallets/provider-bitget/src/signer.ts
  • wallets/provider-bitget/tsconfig.json
  • wallets/provider-braavos/CHANGELOG.md
  • wallets/provider-braavos/package.json
  • wallets/provider-braavos/readme.md
  • wallets/provider-braavos/src/helpers.ts
  • wallets/provider-braavos/src/index.ts
  • wallets/provider-braavos/src/signer.ts
  • wallets/provider-braavos/tsconfig.json
  • wallets/provider-brave/CHANGELOG.md
  • wallets/provider-brave/package.json
  • wallets/provider-brave/src/helpers.ts
  • wallets/provider-brave/src/index.ts
  • wallets/provider-brave/src/signer.ts
  • wallets/provider-brave/tsconfig.json
  • wallets/provider-clover/CHANGELOG.md
  • wallets/provider-clover/package.json
  • wallets/provider-clover/src/helpers.ts
  • wallets/provider-clover/src/index.ts
  • wallets/provider-clover/src/signer.ts
  • wallets/provider-clover/tsconfig.json
  • wallets/provider-coin98/CHANGELOG.md
  • wallets/provider-coin98/package.json
  • wallets/provider-coin98/src/helpers.ts
  • wallets/provider-coin98/src/index.ts
  • wallets/provider-coin98/src/signer.ts
  • wallets/provider-coin98/src/solana-signer.ts
  • wallets/provider-coin98/tsconfig.json
  • wallets/provider-coinbase/CHANGELOG.md
  • wallets/provider-coinbase/package.json
  • wallets/provider-coinbase/src/helpers.ts
  • wallets/provider-coinbase/src/index.ts
  • wallets/provider-coinbase/src/signer.ts
  • wallets/provider-coinbase/tsconfig.json
  • wallets/provider-cosmostation/CHANGELOG.md
  • wallets/provider-cosmostation/package.json
  • wallets/provider-cosmostation/src/helpers.ts
  • wallets/provider-cosmostation/src/index.ts
  • wallets/provider-cosmostation/src/signer.ts
  • wallets/provider-cosmostation/tsconfig.json
  • wallets/provider-default/CHANGELOG.md
  • wallets/provider-default/package.json
  • wallets/provider-default/readme.md
  • wallets/provider-default/src/helpers.ts
  • wallets/provider-default/src/index.ts
  • wallets/provider-default/src/signer.ts
  • wallets/provider-default/tsconfig.json
  • wallets/provider-enkrypt/CHANGELOG.md
  • wallets/provider-enkrypt/package.json
  • wallets/provider-enkrypt/src/helpers.ts
  • wallets/provider-enkrypt/src/index.ts
  • wallets/provider-enkrypt/src/signer.ts
  • wallets/provider-enkrypt/tsconfig.json
  • wallets/provider-exodus/CHANGELOG.md
  • wallets/provider-exodus/package.json
  • wallets/provider-exodus/src/helpers.ts
  • wallets/provider-exodus/src/index.ts
  • wallets/provider-exodus/src/signer.ts
  • wallets/provider-exodus/tsconfig.json
  • wallets/provider-frontier/CHANGELOG.md
  • wallets/provider-frontier/package.json
  • wallets/provider-frontier/src/helpers.ts
  • wallets/provider-frontier/src/index.ts
  • wallets/provider-frontier/src/signer.ts
  • wallets/provider-frontier/tsconfig.json
  • wallets/provider-halo/CHANGELOG.md
  • wallets/provider-halo/package.json
  • wallets/provider-halo/readme.md
  • wallets/provider-halo/src/helpers.ts
  • wallets/provider-halo/src/index.ts

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/rf-1153-shapeshift-snap

Comment @coderabbitai help to get the list of available commands and usage tips.

@qodo-code-review
Copy link
Copy Markdown

Review Summary by Qodo

Implement ShapeShift Snap wallet provider and refactor transaction management system

✨ Enhancement 🧪 Tests 📦 Other

Grey Divider

Walkthroughs

Description
• Added ShapeShift Snap wallet provider support with eager connection capability
• Refactored transaction signing and event notification system in queue-manager with improved error
  handling and in-memory transaction tracking
• Reorganized imports across multiple modules to separate type imports using type keyword for
  better code organization
• Updated wallet type and network references from WalletType/Network to WalletTypes/Networks
  enums for consistency
• Enhanced blockchain metadata with new configurations (STARKNET, ZKSYNC, KCC, STRIDE, MARS, TERRA
  2.0, TELOS, BOBA variants, MAYA) and reorganized existing entries
• Refactored mock data for blockchains and tokens to support multi-blockchain configurations and
  reduce redundancy
• Removed deprecated wallet state management and WalletConnect provider compatibility functions from
  core helpers
• Added comprehensive mock blockchain metadata with 56 blockchain configurations for testing
• Created WalletModal component type definitions for improved type safety
• Changed syncInterval type from NodeJS.Timer to number for browser compatibility in
  queue-manager
• Improved code formatting and type safety across examples and helper modules
Diagram
flowchart LR
  A["ShapeShift Snap<br/>Provider"] -->|"eager connect"| B["Wallet<br/>Integration"]
  C["Transaction<br/>Signing"] -->|"refactored"| D["Event<br/>Notification"]
  E["Mock Data<br/>Blockchain/Token"] -->|"enhanced"| F["Multi-blockchain<br/>Support"]
  G["Wallet Types<br/>Enums"] -->|"updated"| H["Type Safety<br/>Improvements"]
  B --> I["Queue Manager<br/>Core"]
  D --> I
  F --> I
  H --> I
Loading

Grey Divider

File Changes

1. widget/embedded/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.mock.ts 🧪 Tests +3161/-0

Add comprehensive blockchain metadata mock data

• Added comprehensive mock data for blockchain metadata including 56 blockchain configurations
• Imported BlockchainMeta type from rango-sdk and TransactionType enum
• Created sampleDefaultBlockchainNames array with blockchain identifiers
• Created sampleBlockchains array with detailed blockchain metadata including EVM, Cosmos, and
 other chain types with network information, RPC endpoints, and explorer URLs

widget/embedded/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.mock.ts


2. wallets/core/src/helpers.ts Refactoring +3/-116

Remove unused wallet state and provider helper functions

• Removed unused wallet state management functions (state_reducer, connectedWallets,
 availableWallets, checkWalletProviders)
• Removed WalletConnect provider compatibility functions (isWalletDerivedFromWalletConnect,
 getComptaibleProvider)
• Removed utility functions (choose, isAsync) and default wallet state constant
• Simplified imports to only include necessary types (Network from @rango-dev/wallets-shared and
 Options from wallet module)
• Kept core helper functions formatAddressWithNetwork, readAccountAddress, and
 needsCheckInstallation

wallets/core/src/helpers.ts


3. widget/ui/src/components/TokenList/mockData.ts Miscellaneous +645/-1503

Refactor mock token data with multi-blockchain support

• Reduced mock token data from 1721 lines to 863 lines by replacing OPTIMISM-only tokens with
 multi-blockchain token entries
• Changed import statement to use type keyword for TokenWithAmount and added TypeScript error
 suppression comments
• Updated token objects to include new fields: isPopular, supportedSwappers, and restructured
 data for multiple blockchains (TRON, ETH, ARBITRUM, FANTOM, SOLANA, BTC, BSC, POLYGON, etc.)
• Removed redundant coinSource and coinSourceUrl null values, now only included when relevant

widget/ui/src/components/TokenList/mockData.ts


View more (107)
4. queue-manager/core/src/manager.ts ✨ Enhancement +292/-256

Reorganize imports and refactor manager class structure

• Reorganized imports to separate type imports from runtime imports using type keyword
• Added onDeleteQueue event handler to the Events interface
• Changed syncInterval type from NodeJS.Timer | null to number | null for browser
 compatibility
• Moved create() method earlier in the class and wrapped async calls with void keyword
• Added deleteQueue() method and improved documentation comments with better formatting
• Refactored sync() method with try-catch error handling and moved it after public methods
• Updated method implementations to use void for fire-and-forget async calls

queue-manager/core/src/manager.ts


5. wallets/provider-clover/src/index.ts ✨ Enhancement +31/-22

Update wallet provider with eager connect support

• Reorganized imports to separate type imports using type keyword from runtime imports
• Changed WalletType.CLOVER to WalletTypes.CLOVER and Network.* to Networks.* constants
• Added new canEagerConnect export function with implementation for EVM wallet eager connection
• Updated wallet info image URL from GitHub rango-types repository to rango-exchange assets
 repository
• Simplified boolean checks from !!variable to variable for cleaner code
• Reordered imports alphabetically and by type for better organization

wallets/provider-clover/src/index.ts


6. queue-manager/rango-preset/src/helpers.ts ✨ Enhancement +620/-894

Refactor transaction signing and event notification system

• Reorganized imports with type imports separated and sorted alphabetically
• Added new helper functions for transaction management: getCurrentStepTx, setCurrentStepTx,
 getCurrentStepTxType, isApprovalCurrentStepTx
• Refactored signTransaction function to consolidate transaction signing logic across multiple
 blockchain types
• Updated notification system to use new event-based structure with StepEventType and status enums
• Added in-memory transaction data tracking via inMemoryTransactionsData function
• Removed deprecated functions like splitWalletNetwork, getEvmProvider, and blockchain-specific
 type guards
• Enhanced error handling and added utility functions like getLastSuccessfulStep, getFailedStep,
 isApprovalTX

queue-manager/rango-preset/src/helpers.ts


7. examples/queue-manager-demo/src/flows/rango/helpers.ts ✨ Enhancement +251/-140

Update imports and improve type safety with enum references

• Reorganized imports with type imports separated and sorted alphabetically
• Updated wallet type references from WalletType to WalletTypes enum
• Updated network references from Network to Networks enum
• Improved code formatting with better line breaks and consistent spacing
• Enhanced type safety with explicit type annotations in function signatures

examples/queue-manager-demo/src/flows/rango/helpers.ts


8. widget/ui/src/components/BlockchainsList/mockData.ts ⚙️ Configuration changes +603/-108

Add new blockchains and reorganize blockchain metadata

• Reordered blockchain entries: moved COSMOS before TERRA_CLASSIC, added STARKNET and ZKSYNC
 entries
• Renamed TERRA to TERRA_CLASSIC with updated symbol references (Luna to Lunc, TERRA_EUT to
 TERRA_CLASSIC_EUT)
• Added new blockchain configurations for KCC, STRIDE, MARS, TERRA (2.0), TELOS,
 BOBA_BNB, BOBA_BEAM, BOBA_AVALANCHE
• Updated REST endpoint for SIF blockchain and logo URL for LUM_NETWORK
• Removed TRON blockchain entry and added MAYA blockchain configuration

widget/ui/src/components/BlockchainsList/mockData.ts


9. widget/embedded/src/components/WalletModal/WalletModal.types.ts ✨ Enhancement +11/-0

Create WalletModal component type definitions

• Created new TypeScript types file for WalletModal component
• Defined PropTypes interface with properties for modal state management and wallet information
• Defined ModalContentProps type as a subset of PropTypes for content component usage

widget/embedded/src/components/WalletModal/WalletModal.types.ts


10. .eslintignore Additional files +4/-0

...

.eslintignore


11. .eslintrc.json Additional files +142/-0

...

.eslintrc.json


12. .github/ISSUE_TEMPLATE/bug_report.md Additional files +38/-0

...

.github/ISSUE_TEMPLATE/bug_report.md


13. .github/ISSUE_TEMPLATE/feature_request.md Additional files +20/-0

...

.github/ISSUE_TEMPLATE/feature_request.md


14. .github/PULL_REQUEST_TEMPLATE.md Additional files +22/-0

...

.github/PULL_REQUEST_TEMPLATE.md


15. .github/actions/prepare/action.yml Additional files +40/-0

...

.github/actions/prepare/action.yml


16. .github/workflows/checks.yaml Additional files +21/-0

...

.github/workflows/checks.yaml


17. .github/workflows/crowdin.yml Additional files +62/-0

...

.github/workflows/crowdin.yml


18. .github/workflows/deploy.yml Additional files +29/-0

...

.github/workflows/deploy.yml


19. .github/workflows/publish.yaml Additional files +0/-47

...

.github/workflows/publish.yaml


20. .github/workflows/publish.yml Additional files +45/-0

...

.github/workflows/publish.yml


21. .husky/pre-commit Additional files +4/-0

...

.husky/pre-commit


22. .prettierrc.json Additional files +1/-3

...

.prettierrc.json


23. .vscode/launch.json Additional files +19/-0

...

.vscode/launch.json


24. .vscode/settings.json Additional files +11/-0

...

.vscode/settings.json


25. CONTRIBUTING.md Additional files +115/-10

...

CONTRIBUTING.md


26. LICENSE.md Additional files +202/-0

...

LICENSE.md


27. examples/queue-manager-demo/CHANGELOG.md Additional files +67/-0

...

examples/queue-manager-demo/CHANGELOG.md


28. examples/queue-manager-demo/package.json Additional files +28/-0

...

examples/queue-manager-demo/package.json


29. examples/queue-manager-demo/public/index.html Additional files +0/-0

...

examples/queue-manager-demo/public/index.html


30. examples/queue-manager-demo/readme.md Additional files +1/-0

...

examples/queue-manager-demo/readme.md


31. examples/queue-manager-demo/src/App.tsx Additional files +18/-6

...

examples/queue-manager-demo/src/App.tsx


32. examples/queue-manager-demo/src/components/FlowRunner/index.tsx Additional files +0/-0

...

examples/queue-manager-demo/src/components/FlowRunner/index.tsx


33. examples/queue-manager-demo/src/components/FlowsList/index.tsx Additional files +36/-39

...

examples/queue-manager-demo/src/components/FlowsList/index.tsx


34. examples/queue-manager-demo/src/components/History/index.tsx Additional files +0/-0

...

examples/queue-manager-demo/src/components/History/index.tsx


35. examples/queue-manager-demo/src/components/Wallets/index.tsx Additional files +6/-9

...

examples/queue-manager-demo/src/components/Wallets/index.tsx


36. examples/queue-manager-demo/src/configs.ts Additional files +1/-0

...

examples/queue-manager-demo/src/configs.ts


37. examples/queue-manager-demo/src/flows/rango/mock.ts Additional files +6325/-0

...

examples/queue-manager-demo/src/flows/rango/mock.ts


38. examples/queue-manager-demo/src/flows/rango/types.ts Additional files +125/-148

...

examples/queue-manager-demo/src/flows/rango/types.ts


39. examples/queue-manager-demo/src/flows/single.ts Additional files +0/-1

...

examples/queue-manager-demo/src/flows/single.ts


40. examples/queue-manager-demo/src/index.tsx Additional files +64/-0

...

examples/queue-manager-demo/src/index.tsx


41. examples/queue-manager-demo/src/styles.css Additional files +0/-0

...

examples/queue-manager-demo/src/styles.css


42. examples/queue-manager-demo/src/wallet.js Additional files +0/-0

...

examples/queue-manager-demo/src/wallet.js


43. examples/queue-manager-demo/tsconfig.json Additional files +13/-0

...

examples/queue-manager-demo/tsconfig.json


44. examples/wallets-adapter-demo/CHANGELOG.md Additional files +65/-0

...

examples/wallets-adapter-demo/CHANGELOG.md


45. examples/wallets-adapter-demo/package.json Additional files +6/-6

...

examples/wallets-adapter-demo/package.json


46. examples/wallets-adapter-demo/public/index.html Additional files +0/-0

...

examples/wallets-adapter-demo/public/index.html


47. examples/wallets-adapter-demo/readme.md Additional files +0/-0

...

examples/wallets-adapter-demo/readme.md


48. examples/wallets-adapter-demo/src/App.tsx Additional files +12/-5

...

examples/wallets-adapter-demo/src/App.tsx


49. examples/wallets-adapter-demo/src/components/WalletsModal.tsx Additional files +1/-1

...

examples/wallets-adapter-demo/src/components/WalletsModal.tsx


50. examples/wallets-adapter-demo/src/constants.ts Additional files +1/-0

...

examples/wallets-adapter-demo/src/constants.ts


51. examples/wallets-adapter-demo/src/index.tsx Additional files +1/-0

...

examples/wallets-adapter-demo/src/index.tsx


52. examples/wallets-adapter-demo/tsconfig.json Additional files +13/-0

...

examples/wallets-adapter-demo/tsconfig.json


53. examples/wallets-demo/CHANGELOG.md Additional files +74/-0

...

examples/wallets-demo/CHANGELOG.md


54. examples/wallets-demo/package.json Additional files +22/-0

...

examples/wallets-demo/package.json


55. examples/wallets-demo/public/index.html Additional files +0/-0

...

examples/wallets-demo/public/index.html


56. examples/wallets-demo/readme.md Additional files +0/-0

...

examples/wallets-demo/readme.md


57. examples/wallets-demo/src/App.tsx Additional files +70/-0

...

examples/wallets-demo/src/App.tsx


58. examples/wallets-demo/src/components/List/Item.tsx Additional files +113/-48

...

examples/wallets-demo/src/components/List/Item.tsx


59. examples/wallets-demo/src/components/List/List.tsx Additional files +48/-0

...

examples/wallets-demo/src/components/List/List.tsx


60. examples/wallets-demo/src/components/List/index.ts Additional files +1/-0

...

examples/wallets-demo/src/components/List/index.ts


61. examples/wallets-demo/src/components/List/modal.tsx Additional files +371/-0

...

examples/wallets-demo/src/components/List/modal.tsx


62. examples/wallets-demo/src/components/List/styles.css Additional files +0/-0

...

examples/wallets-demo/src/components/List/styles.css


63. examples/wallets-demo/src/components/Swap.tsx Additional files +81/-0

...

examples/wallets-demo/src/components/Swap.tsx


64. examples/wallets-demo/src/constants.ts Additional files +28/-0

...

examples/wallets-demo/src/constants.ts


65. examples/wallets-demo/src/helper.ts Additional files +30/-14

...

examples/wallets-demo/src/helper.ts


66. examples/wallets-demo/src/index.css Additional files +0/-0

...

examples/wallets-demo/src/index.css


67. examples/wallets-demo/src/index.tsx Additional files +9/-0

...

examples/wallets-demo/src/index.tsx


68. examples/wallets-demo/tsconfig.json Additional files +13/-0

...

examples/wallets-demo/tsconfig.json


69. global-wallets-env.d.ts Additional files +7/-1

...

global-wallets-env.d.ts


70. lingui.config.ts Additional files +14/-0

...

lingui.config.ts


71. package.json Additional files +61/-13

...

package.json


72. queue-manager/core/CHANGELOG.md Additional files +59/-0

...

queue-manager/core/CHANGELOG.md


73. queue-manager/core/package.json Additional files +12/-30

...

queue-manager/core/package.json


74. queue-manager/core/readme.md Additional files +1/-1

...

queue-manager/core/readme.md


75. queue-manager/core/src/index.ts Additional files +1/-0

...

queue-manager/core/src/index.ts


76. queue-manager/core/src/persistor.ts Additional files +26/-10

...

queue-manager/core/src/persistor.ts


77. queue-manager/core/tsconfig.json Additional files +4/-29

...

queue-manager/core/tsconfig.json


78. queue-manager/demo/package.json Additional files +0/-28

...

queue-manager/demo/package.json


79. queue-manager/demo/readme.md Additional files +0/-1

...

queue-manager/demo/readme.md


80. queue-manager/demo/src/flows/rango/mock.ts Additional files +0/-14289

...

queue-manager/demo/src/flows/rango/mock.ts


81. queue-manager/demo/src/flows/swap/helpers.ts Additional files +0/-5

...

queue-manager/demo/src/flows/swap/helpers.ts


82. queue-manager/demo/src/index.tsx Additional files +0/-44

...

queue-manager/demo/src/index.tsx


83. queue-manager/rango-preset/CHANGELOG.md Additional files +89/-0

...

queue-manager/rango-preset/CHANGELOG.md


84. queue-manager/rango-preset/package.json Additional files +14/-30

...

queue-manager/rango-preset/package.json


85. queue-manager/rango-preset/readme.md Additional files +2/-0

...

queue-manager/rango-preset/readme.md


86. queue-manager/rango-preset/src/actions/checkStatus.ts Additional files +307/-86

...

queue-manager/rango-preset/src/actions/checkStatus.ts


87. queue-manager/rango-preset/src/actions/createTransaction.ts Additional files +30/-54

...

queue-manager/rango-preset/src/actions/createTransaction.ts


88. queue-manager/rango-preset/src/actions/executeTransaction.ts Additional files +49/-38

...

queue-manager/rango-preset/src/actions/executeTransaction.ts


89. queue-manager/rango-preset/src/actions/scheduleNextStep.ts Additional files +43/-11

...

queue-manager/rango-preset/src/actions/scheduleNextStep.ts


90. queue-manager/rango-preset/src/actions/start.ts Additional files +7/-1

...

queue-manager/rango-preset/src/actions/start.ts


91. queue-manager/rango-preset/src/constants.ts Additional files +2/-0

...

queue-manager/rango-preset/src/constants.ts


92. queue-manager/rango-preset/src/hooks.ts Additional files +7/-3

...

queue-manager/rango-preset/src/hooks.ts


93. queue-manager/rango-preset/src/index.ts Additional files +36/-12

...

queue-manager/rango-preset/src/index.ts


94. queue-manager/rango-preset/src/migration.ts Additional files +11/-11

...

queue-manager/rango-preset/src/migration.ts


95. queue-manager/rango-preset/src/services/eventEmitter.ts Additional files +274/-0

...

queue-manager/rango-preset/src/services/eventEmitter.ts


96. queue-manager/rango-preset/src/shared-errors.ts Additional files +18/-13

...

queue-manager/rango-preset/src/shared-errors.ts


97. queue-manager/rango-preset/src/shared-sentry.ts Additional files +3/-2

...

queue-manager/rango-preset/src/shared-sentry.ts


98. queue-manager/rango-preset/src/shared.ts Additional files +132/-214

...

queue-manager/rango-preset/src/shared.ts


99. queue-manager/rango-preset/src/types.ts Additional files +217/-9

...

queue-manager/rango-preset/src/types.ts


100. queue-manager/rango-preset/tsconfig.json Additional files +4/-29

...

queue-manager/rango-preset/tsconfig.json


101. queue-manager/react/CHANGELOG.md Additional files +64/-0

...

queue-manager/react/CHANGELOG.md


102. queue-manager/react/package.json Additional files +12/-30

...

queue-manager/react/package.json


103. queue-manager/react/readme.md Additional files +1/-1

...

queue-manager/react/readme.md


104. queue-manager/react/src/index.ts Additional files +0/-0

...

queue-manager/react/src/index.ts


105. queue-manager/react/src/provider.tsx Additional files +22/-13

...

queue-manager/react/src/provider.tsx


106. queue-manager/react/tsconfig.json Additional files +3/-26

...

queue-manager/react/tsconfig.json


107. queue-manager/readme.md Additional files +76/-0

...

queue-manager/readme.md


108. scripts/build/command.mjs Additional files +46/-0

...

scripts/build/command.mjs


109. scripts/check-conventional-commits/command.mjs Additional files +34/-0

...

scripts/check-conventional-commits/command.mjs


110. Additional files not shown Additional files +0/-0

...

Additional files not shown


Grey Divider

Qodo Logo

@qodo-code-review
Copy link
Copy Markdown

qodo-code-review Bot commented Apr 19, 2026

Code Review by Qodo

🐞 Bugs (3) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider


Action required

1. EVM cleanup removes wrong handlers 🐞 Bug ☼ Reliability
Description
subscribeToEvm() registers accountsChanged/chainChanged handlers but the returned cleanup function
calls off() with swapped handler functions, so listeners are never removed and can be duplicated on
re-subscribe.
Code

wallets/shared/src/providers.ts[R59-62]

+  const cleanup = () => {
+    instance?.off('chainChanged', handleAccountsChanged);
+    instance?.off('accountsChanged', handleChainChanged);
+  };
Evidence
The cleanup function passes handleAccountsChanged to 'chainChanged' and handleChainChanged to
'accountsChanged', so neither listener is removed. Downstream providers call this cleanup on
unmount, meaning the bug can accumulate duplicate listeners over time.

wallets/shared/src/providers.ts[32-65]
wallets/provider-bitget/src/index.ts[66-107]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`subscribeToEvm` registers `accountsChanged` and `chainChanged` listeners, but its `cleanup` uses mismatched event/handler pairs, so listeners are not removed (and can duplicate on remount).

### Issue Context
This cleanup is used by multiple EVM wallet providers (they call `cleanup()` on unmount). Incorrect unsubscription leads to duplicated wallet state updates and memory leaks.

### Fix Focus Areas
- wallets/shared/src/providers.ts[32-65]

### Implementation notes
- Change cleanup to:
 - `instance?.off('accountsChanged', handleAccountsChanged)`
 - `instance?.off('chainChanged', handleChainChanged)`
- Consider supporting providers that implement `removeListener` instead of `off` (optional chaining + fallback).
- Add/adjust a small unit test to ensure cleanup removes the exact handlers that were registered.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Transfer signer Litecoin-only 🐞 Bug ≡ Correctness
Description
ShapeShiftSnap registers a TxType.TRANSFER signer whose implementation hardcodes Litecoin endpoints
and the 'ltc_signTransaction' snap method, and it returns an empty hash without broadcasting, so
transfers will fail or report success without a txid for non-LTC chains.
Code

wallets/provider-shapeshift-snap/src/signer/shapeShiftSnapBaseSigner.ts[R24-86]

+      const temp1 = await fetch(
+        `https://api.litecoin.shapeshift.com/api/v1/account/${address}/utxos`,
+        {
+          method: 'GET',
+        }
+      );
+      const temp1Json = await temp1.json();
+
+      const temp2 = await fetch(
+        `https://api.litecoin.shapeshift.com/api/v1/tx/${temp1Json?.[0]?.txid}`,
+        {
+          method: 'GET',
+        }
+      );
+      const temp2Json = await temp2.json();
+
+      const signresult = await walletInvokeSnap({
+        instance: this.provider,
+        params: {
+          snapId: DEFAULT_SNAP_ID,
+          request: {
+            method: 'ltc_signTransaction',
+            params: {
+              transaction: {
+                coin: 'Litecoin',
+                inputs: [
+                  {
+                    addressNList: temp1Json?.[0]?.path,
+                    scriptType: 'p2pkh',
+                    amount: temp1Json?.[0]?.value,
+                    vout: temp1Json?.[0]?.vout,
+                    txid: temp1Json?.[0]?.txid,
+                    hex: temp2Json?.hex,
+                  },
+                ],
+                outputs: [
+                  {
+                    addressType: 'spend',
+                    amount: tx.amount,
+                    address: tx.recipientAddress,
+                  },
+                  {
+                    addressType: 'change',
+                    amount: (
+                      temp1Json?.[0]?.value - parseInt(tx.amount)
+                    ).toString(),
+                    // eslint-disable-next-line @typescript-eslint/no-magic-numbers
+                    addressNList: [2147483692, 2147483650, 2147483648, 1, 0],
+                    scriptType: 'p2pkh',
+                    isChange: true,
+                  },
+                ],
+                opReturnData: tx.memo,
+              },
+            },
+          },
+        },
+      });
+
+      console.log(signresult);
+
+      return { hash: '' };
+    } catch (err) {
Evidence
The provider declares multiple supported chains (BTC/BCH/COSMOS/OSMOSIS/ETH/LTC/THOR), but the
registered TRANSFER signer always signs Litecoin transactions and returns { hash: '' } with no
broadcast step. This contradicts multi-chain support and breaks transaction sending/tracking.

wallets/provider-shapeshift-snap/src/helpers.ts[10-22]
wallets/provider-shapeshift-snap/src/signer.ts[8-19]
wallets/provider-shapeshift-snap/src/signer/shapeShiftSnapBaseSigner.ts[19-86]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`ShapeShiftSnapBaseSigner` is registered for `TxType.TRANSFER` but is Litecoin-specific (`ltc_signTransaction`, Litecoin API URLs) and returns an empty hash without broadcasting. This breaks transfers for the wallet's supported non-LTC chains and prevents callers from receiving a real transaction hash.

### Issue Context
The ShapeShift Snap provider advertises support for multiple chains, but `TxType.TRANSFER` currently only implements an LTC signing flow and doesn't publish the transaction.

### Fix Focus Areas
- wallets/provider-shapeshift-snap/src/signer.ts[8-19]
- wallets/provider-shapeshift-snap/src/signer/shapeShiftSnapBaseSigner.ts[19-96]
- wallets/provider-shapeshift-snap/src/helpers.ts[13-22]

### Implementation notes
- Either:
 1) Implement transfer signing+broadcast per supported UTXO chain (BTC/BCH/LTC/THOR/etc) and route based on the transaction/network, **or**
 2) Restrict registration so `TxType.TRANSFER` is only enabled for chains that are actually implemented, and throw a clear `OPERATION_UNSUPPORTED` error otherwise.
- Ensure `signAndSendTx` broadcasts the signed tx and returns a real txid/hash.
- Remove `console.log` statements (they may leak tx details and clutter logs).
- Add basic guards for missing/empty UTXO set instead of indexing `[0]` blindly.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Cosmos hash type mismatch 🐞 Bug ≡ Correctness
Description
ShapeShiftSnapCosmosSigner returns { hash: result } where result is the parsed JSON response
body from the broadcast endpoint, not a string tx hash, so downstream code expecting a string hash
will break.
Code

wallets/provider-shapeshift-snap/src/signer/shapeShiftSnapCosmosSigner.ts[R42-70]

+const broadcastCosmosTransaction = async (instance: any, signedTx: any) => {
+  const result = await fetch('https://api.cosmos.shapeshift.com/api/v1/send', {
+    method: 'POST',
+    body: JSON.stringify({
+      rawTx: signedTx.serialized,
+    }),
+  });
+
+  const resultJson = await result.json();
+  return resultJson;
+};
+
+class ShapeShiftSnapCosmosSigner implements GenericSigner<CosmosTransaction> {
+  private provider: any;
+
+  constructor(provider: any) {
+    this.provider = provider;
+  }
+
+  public async signMessage(): Promise<string> {
+    throw SignerError.UnimplementedError('signMessage');
+  }
+
+  async signAndSendTx(tx: CosmosTransaction): Promise<{ hash: string }> {
+    try {
+      const signedTx = await signCosmosTransaction(this.provider, tx);
+      const result = await broadcastCosmosTransaction(this.provider, signedTx);
+
+      return { hash: result };
Evidence
The broadcast function returns await result.json() (an object), and signAndSendTx returns that
object as the hash field. Other Cosmos signers in the repo return a real string hash (e.g.,
hex-encoded tx hash).

wallets/provider-shapeshift-snap/src/signer/shapeShiftSnapCosmosSigner.ts[42-71]
wallets/provider-walletconnect-2/src/signers/cosmos.ts[105-113]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`ShapeShiftSnapCosmosSigner.signAndSendTx` returns a JSON object as `hash` (the parsed broadcast response), but the function contract expects `hash` to be a string transaction hash.

### Issue Context
The broadcast helper returns `result.json()` and the signer forwards that directly as `{ hash: result }`.

### Fix Focus Areas
- wallets/provider-shapeshift-snap/src/signer/shapeShiftSnapCosmosSigner.ts[42-79]

### Implementation notes
- Parse the broadcast response and extract the actual tx hash field (e.g., `txhash`, `hash`, etc. depending on the API response).
- Return `{ hash: extractedHashString }`.
- Add `Content-Type: application/json` header for the POST.
- Handle non-2xx responses (`if (!result.ok) ...`) and throw a `SignerError(SEND_TX_ERROR, ...)` with useful context.
- Remove `console.log({ err })` or gate it behind a debug flag.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

Comment on lines +59 to +62
const cleanup = () => {
instance?.off('chainChanged', handleAccountsChanged);
instance?.off('accountsChanged', handleChainChanged);
};
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Action required

1. Evm cleanup removes wrong handlers 🐞 Bug ☼ Reliability

subscribeToEvm() registers accountsChanged/chainChanged handlers but the returned cleanup function
calls off() with swapped handler functions, so listeners are never removed and can be duplicated on
re-subscribe.
Agent Prompt
### Issue description
`subscribeToEvm` registers `accountsChanged` and `chainChanged` listeners, but its `cleanup` uses mismatched event/handler pairs, so listeners are not removed (and can duplicate on remount).

### Issue Context
This cleanup is used by multiple EVM wallet providers (they call `cleanup()` on unmount). Incorrect unsubscription leads to duplicated wallet state updates and memory leaks.

### Fix Focus Areas
- wallets/shared/src/providers.ts[32-65]

### Implementation notes
- Change cleanup to:
  - `instance?.off('accountsChanged', handleAccountsChanged)`
  - `instance?.off('chainChanged', handleChainChanged)`
- Consider supporting providers that implement `removeListener` instead of `off` (optional chaining + fallback).
- Add/adjust a small unit test to ensure cleanup removes the exact handlers that were registered.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +24 to +86
const temp1 = await fetch(
`https://api.litecoin.shapeshift.com/api/v1/account/${address}/utxos`,
{
method: 'GET',
}
);
const temp1Json = await temp1.json();

const temp2 = await fetch(
`https://api.litecoin.shapeshift.com/api/v1/tx/${temp1Json?.[0]?.txid}`,
{
method: 'GET',
}
);
const temp2Json = await temp2.json();

const signresult = await walletInvokeSnap({
instance: this.provider,
params: {
snapId: DEFAULT_SNAP_ID,
request: {
method: 'ltc_signTransaction',
params: {
transaction: {
coin: 'Litecoin',
inputs: [
{
addressNList: temp1Json?.[0]?.path,
scriptType: 'p2pkh',
amount: temp1Json?.[0]?.value,
vout: temp1Json?.[0]?.vout,
txid: temp1Json?.[0]?.txid,
hex: temp2Json?.hex,
},
],
outputs: [
{
addressType: 'spend',
amount: tx.amount,
address: tx.recipientAddress,
},
{
addressType: 'change',
amount: (
temp1Json?.[0]?.value - parseInt(tx.amount)
).toString(),
// eslint-disable-next-line @typescript-eslint/no-magic-numbers
addressNList: [2147483692, 2147483650, 2147483648, 1, 0],
scriptType: 'p2pkh',
isChange: true,
},
],
opReturnData: tx.memo,
},
},
},
},
});

console.log(signresult);

return { hash: '' };
} catch (err) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Action required

2. Transfer signer litecoin-only 🐞 Bug ≡ Correctness

ShapeShiftSnap registers a TxType.TRANSFER signer whose implementation hardcodes Litecoin endpoints
and the 'ltc_signTransaction' snap method, and it returns an empty hash without broadcasting, so
transfers will fail or report success without a txid for non-LTC chains.
Agent Prompt
### Issue description
`ShapeShiftSnapBaseSigner` is registered for `TxType.TRANSFER` but is Litecoin-specific (`ltc_signTransaction`, Litecoin API URLs) and returns an empty hash without broadcasting. This breaks transfers for the wallet's supported non-LTC chains and prevents callers from receiving a real transaction hash.

### Issue Context
The ShapeShift Snap provider advertises support for multiple chains, but `TxType.TRANSFER` currently only implements an LTC signing flow and doesn't publish the transaction.

### Fix Focus Areas
- wallets/provider-shapeshift-snap/src/signer.ts[8-19]
- wallets/provider-shapeshift-snap/src/signer/shapeShiftSnapBaseSigner.ts[19-96]
- wallets/provider-shapeshift-snap/src/helpers.ts[13-22]

### Implementation notes
- Either:
  1) Implement transfer signing+broadcast per supported UTXO chain (BTC/BCH/LTC/THOR/etc) and route based on the transaction/network, **or**
  2) Restrict registration so `TxType.TRANSFER` is only enabled for chains that are actually implemented, and throw a clear `OPERATION_UNSUPPORTED` error otherwise.
- Ensure `signAndSendTx` broadcasts the signed tx and returns a real txid/hash.
- Remove `console.log` statements (they may leak tx details and clutter logs).
- Add basic guards for missing/empty UTXO set instead of indexing `[0]` blindly.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +42 to +70
const broadcastCosmosTransaction = async (instance: any, signedTx: any) => {
const result = await fetch('https://api.cosmos.shapeshift.com/api/v1/send', {
method: 'POST',
body: JSON.stringify({
rawTx: signedTx.serialized,
}),
});

const resultJson = await result.json();
return resultJson;
};

class ShapeShiftSnapCosmosSigner implements GenericSigner<CosmosTransaction> {
private provider: any;

constructor(provider: any) {
this.provider = provider;
}

public async signMessage(): Promise<string> {
throw SignerError.UnimplementedError('signMessage');
}

async signAndSendTx(tx: CosmosTransaction): Promise<{ hash: string }> {
try {
const signedTx = await signCosmosTransaction(this.provider, tx);
const result = await broadcastCosmosTransaction(this.provider, signedTx);

return { hash: result };
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Action required

3. Cosmos hash type mismatch 🐞 Bug ≡ Correctness

ShapeShiftSnapCosmosSigner returns { hash: result } where result is the parsed JSON response
body from the broadcast endpoint, not a string tx hash, so downstream code expecting a string hash
will break.
Agent Prompt
### Issue description
`ShapeShiftSnapCosmosSigner.signAndSendTx` returns a JSON object as `hash` (the parsed broadcast response), but the function contract expects `hash` to be a string transaction hash.

### Issue Context
The broadcast helper returns `result.json()` and the signer forwards that directly as `{ hash: result }`.

### Fix Focus Areas
- wallets/provider-shapeshift-snap/src/signer/shapeShiftSnapCosmosSigner.ts[42-79]

### Implementation notes
- Parse the broadcast response and extract the actual tx hash field (e.g., `txhash`, `hash`, etc. depending on the API response).
- Return `{ hash: extractedHashString }`.
- Add `Content-Type: application/json` header for the POST.
- Handle non-2xx responses (`if (!result.ok) ...`) and throw a `SignerError(SEND_TX_ERROR, ...)` with useful context.
- Remove `console.log({ err })` or gate it behind a debug flag.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants