From 035f5f7b631449423c1928b5327e5b8299a7c2f4 Mon Sep 17 00:00:00 2001 From: Andrew Taran Date: Mon, 27 Jul 2026 16:13:49 +0200 Subject: [PATCH 1/4] chore: move tron files into packages --- .../tron-wallet-snap/.env.example | 0 .../tron-wallet-snap/CHANGELOG.md | 0 .../tron-wallet-snap/LICENSE | 0 .../tron-wallet-snap/README.md | 0 .../tron-wallet-snap/babel.config.js | 0 .../tron-wallet-snap/crowdin.yml | 0 .../tron-wallet-snap/images/icon.svg | 0 .../tron-wallet-snap/images/question-mark.svg | 0 .../tron-wallet-snap/jest.config.mjs | 0 .../jest.integration.config.mjs | 0 .../tron-wallet-snap/jest.setup.ts | 0 .../tron-wallet-snap/locales/de.json | 0 .../tron-wallet-snap/locales/el.json | 0 .../tron-wallet-snap/locales/en.json | 0 .../tron-wallet-snap/locales/es.json | 0 .../tron-wallet-snap/locales/fr.json | 0 .../tron-wallet-snap/locales/hi.json | 0 .../tron-wallet-snap/locales/id.json | 0 .../tron-wallet-snap/locales/ja.json | 0 .../tron-wallet-snap/locales/ko.json | 0 .../tron-wallet-snap/locales/pt.json | 0 .../tron-wallet-snap/locales/ru.json | 0 .../tron-wallet-snap/locales/tl.json | 0 .../tron-wallet-snap/locales/tr.json | 0 .../tron-wallet-snap/locales/vi.json | 0 .../tron-wallet-snap/locales/zh.json | 0 .../tron-wallet-snap/messages.json | 0 .../tron-wallet-snap/package.json | 2 +- .../scripts/build-preinstalled-snap.js | 0 .../scripts/populate-en-locale.js | 0 .../scripts/update-manifest-local.js | 0 .../tron-wallet-snap/snap.config.ts | 0 .../tron-wallet-snap/snap.manifest.json | 0 .../tron-wallet-snap/src/caching/ICache.ts | 0 .../src/caching/InMemoryCache.ts | 0 .../src/caching/StateCache.test.ts | 0 .../src/caching/StateCache.ts | 0 .../tron-wallet-snap/src/caching/types.ts | 0 .../src/caching/useCache.test.ts | 0 .../tron-wallet-snap/src/caching/useCache.ts | 0 .../src/caching/useCacheUntil.test.ts | 0 .../src/caching/useCacheUntil.ts | 0 .../clients/price-api/PriceApiClient.test.ts | 0 .../src/clients/price-api/PriceApiClient.ts | 0 .../clients/price-api/mocks/exchange-rates.ts | 0 .../price-api/mocks/historical-prices.ts | 0 .../clients/price-api/mocks/spot-prices.ts | 0 .../src/clients/price-api/structs.test.ts | 0 .../src/clients/price-api/types.ts | 0 .../SecurityAlertsApiClient.ts | 0 .../clients/security-alerts-api/structs.ts | 0 .../src/clients/security-alerts-api/types.ts | 0 .../clients/security-alerts-api/utils.test.ts | 0 .../src/clients/security-alerts-api/utils.ts | 0 .../src/clients/snap/SnapClient.test.ts | 0 .../src/clients/snap/SnapClient.ts | 0 .../clients/token-api/TokenApiClient.test.ts | 0 .../src/clients/token-api/TokenApiClient.ts | 0 .../src/clients/token-api/structs.ts | 0 .../src/clients/tron-http/TronHttpClient.ts | 0 .../src/clients/tron-http/index.ts | 0 .../src/clients/tron-http/structs.ts | 0 .../src/clients/tron-http/types.ts | 0 .../trongrid/TrongridApiClient.test.ts | 0 .../src/clients/trongrid/TrongridApiClient.ts | 0 .../src/clients/trongrid/errors.test.ts | 0 .../src/clients/trongrid/errors.ts | 0 .../src/clients/trongrid/structs.ts | 0 .../src/clients/trongrid/types.ts | 0 .../src/clients/tronweb/TronWebFactory.ts | 0 .../tron-wallet-snap/src/constants/index.ts | 0 .../tron-wallet-snap/src/context.ts | 0 .../tron-wallet-snap/src/entities/assets.ts | 0 .../src/entities/keyring-account.ts | 0 .../tron-wallet-snap/src/handlers/assets.ts | 0 .../clientRequest/clientRequest.test.ts | 0 .../handlers/clientRequest/clientRequest.ts | 0 .../src/handlers/clientRequest/types.ts | 0 .../src/handlers/clientRequest/validation.ts | 0 .../src/handlers/cronjob.test.tsx | 0 .../tron-wallet-snap/src/handlers/cronjob.tsx | 0 .../src/handlers/keyring-types.ts | 0 .../src/handlers/keyring.test.ts | 0 .../tron-wallet-snap/src/handlers/keyring.ts | 0 .../tron-wallet-snap/src/handlers/rpc/rpc.ts | 0 .../src/handlers/rpc/types.ts | 0 .../src/handlers/userInput.ts | 0 .../tron-wallet-snap/src/index.ts | 0 .../tron-wallet-snap/src/permissions.ts | 0 .../accounts/AccountsRepository.test.ts | 0 .../services/accounts/AccountsRepository.ts | 0 .../services/accounts/AccountsService.test.ts | 0 .../src/services/accounts/AccountsService.ts | 0 .../src/services/accounts/types.ts | 0 .../services/assets/AssetsRepository.test.ts | 0 .../src/services/assets/AssetsRepository.ts | 0 .../src/services/assets/AssetsService.test.ts | 0 .../src/services/assets/AssetsService.ts | 0 .../src/services/assets/types.ts | 0 .../src/services/config/ConfigProvider.ts | 0 .../src/services/config/index.ts | 0 .../confirmation/ConfirmationHandler.test.ts | 0 .../confirmation/ConfirmationHandler.ts | 0 .../send/FeeCalculatorService.test.ts | 0 .../src/services/send/FeeCalculatorService.ts | 0 .../src/services/send/SendService.test.ts | 0 .../src/services/send/SendService.ts | 0 ...nsactionExpirationRefresherService.test.ts | 0 .../src/services/send/errors.test.ts | 0 .../src/services/send/errors.ts | 0 .../src/services/send/types.ts | 0 .../services/staking/StakingService.test.ts | 0 .../src/services/staking/StakingService.ts | 0 .../src/services/state/IStateManager.ts | 0 .../src/services/state/InMemoryState.ts | 0 .../src/services/state/State.test.ts | 0 .../src/services/state/State.ts | 0 .../TransactionExpirationRefresherService.ts | 0 .../transaction-expiration-refresher/types.ts | 0 .../TransactionScanService.test.ts | 0 .../TransactionScanService.ts | 0 .../buildExpiredScanResult.ts | 0 .../src/services/transaction-scan/index.ts | 0 .../isTransactionDeadlinePassedError.test.ts | 0 .../isTransactionDeadlinePassedError.ts | 0 .../src/services/transaction-scan/types.ts | 0 .../transactions/TransactionsMapper.test.ts | 0 .../transactions/TransactionsMapper.ts | 0 .../TransactionsRepository.test.ts | 0 .../transactions/TransactionsRepository.ts | 0 .../transactions/TransactionsService.test.ts | 0 .../transactions/TransactionsService.ts | 0 .../swap-transaction.json | 0 .../failed-transaction.json | 0 .../native-transfer-without-timestamp.json | 0 .../account-transactions/native-transfer.json | 0 .../swap-transaction.json | 0 .../account-transactions/trc10-transfer.json | 0 .../account-transactions/trc20-transfer.json | 0 .../contract-info.json | 0 .../swap-contract-info.json | 0 .../transactions/trc20LogParser.test.ts | 0 .../services/transactions/trc20LogParser.ts | 0 .../transactions/utils/isSpam.test.ts | 0 .../src/services/transactions/utils/isSpam.ts | 0 .../src/services/wallet/README.md | 0 .../src/services/wallet/WalletService.test.ts | 0 .../src/services/wallet/WalletService.ts | 0 .../tron-wallet-snap/src/static/tron-logo.ts | 0 .../tron-wallet-snap/src/types/analytics.ts | 0 .../tron-wallet-snap/src/types/snap.ts | 0 .../confirmation/components/Asset/Asset.tsx | 0 .../EstimatedChanges/EstimatedChanges.tsx | 0 .../src/ui/confirmation/components/Fees.tsx | 0 .../TransactionAlert.test.tsx | 0 .../TransactionAlert/TransactionAlert.tsx | 0 .../TransactionAlert/getErrorMessage.test.ts | 0 .../TransactionAlert/getErrorMessage.ts | 0 .../utils/getIconUrlForKnownAsset.ts | 0 .../ConfirmSignMessage/ConfirmSignMessage.tsx | 0 .../views/ConfirmSignMessage/events.tsx | 0 .../views/ConfirmSignMessage/render.test.tsx | 0 .../views/ConfirmSignMessage/render.tsx | 0 .../ConfirmSignTransaction.test.tsx | 0 .../ConfirmSignTransaction.tsx | 0 .../views/ConfirmSignTransaction/events.tsx | 0 .../ConfirmSignTransaction/render.test.tsx | 0 .../views/ConfirmSignTransaction/render.tsx | 0 .../views/ConfirmSignTransaction/types.ts | 0 .../ConfirmTransactionRequest.test.tsx | 0 .../ConfirmTransactionRequest.tsx | 0 .../ConfirmTransactionRequest/events.tsx | 0 .../ConfirmTransactionRequest/render.test.tsx | 0 .../ConfirmTransactionRequest/render.tsx | 0 .../views/ConfirmTransactionRequest/types.ts | 0 .../src/utils/assertOrThrow.ts | 0 .../src/utils/buildUrl.test.ts | 0 .../tron-wallet-snap/src/utils/buildUrl.ts | 0 .../src/utils/conversion.test.ts | 0 .../tron-wallet-snap/src/utils/conversion.ts | 0 .../utils/deriveTronFromCoinTypeNode.test.ts | 0 .../src/utils/deriveTronFromCoinTypeNode.ts | 0 .../tron-wallet-snap/src/utils/errors.test.ts | 0 .../tron-wallet-snap/src/utils/errors.ts | 0 .../src/utils/executeOnChainActions.ts | 0 .../src/utils/formatAmount.test.ts | 0 .../src/utils/formatAmount.ts | 0 .../tron-wallet-snap/src/utils/formatFiat.ts | 0 .../src/utils/formatOrigin.test.ts | 0 .../src/utils/formatOrigin.ts | 0 .../src/utils/getExplorerUrl.test.ts | 0 .../src/utils/getExplorerUrl.ts | 0 .../src/utils/getLowestUnusedIndex.ts | 0 .../tron-wallet-snap/src/utils/hex.test.ts | 0 .../tron-wallet-snap/src/utils/hex.ts | 0 .../tron-wallet-snap/src/utils/i18n.ts | 0 .../utils/isFetchStatusLoadingOrFetching.ts | 0 .../tron-wallet-snap/src/utils/logger.ts | 0 .../tron-wallet-snap/src/utils/mockLogger.ts | 0 .../src/utils/safeMerge.test.ts | 0 .../tron-wallet-snap/src/utils/safeMerge.ts | 0 .../tron-wallet-snap/src/utils/sanitize.ts | 0 .../src/utils/sensitiveErrors.test.ts | 0 .../src/utils/sensitiveErrors.ts | 0 .../utils/serialization/deserialize.test.ts | 0 .../src/utils/serialization/deserialize.ts | 0 .../src/utils/serialization/serialize.test.ts | 0 .../src/utils/serialization/serialize.ts | 0 .../src/utils/serialization/types.ts | 0 .../tron-wallet-snap/src/utils/tokenToFiat.ts | 0 .../src/validation/keyring-structs.test.ts | 0 .../src/validation/structs.test.ts | 0 .../src/validation/structs.ts | 0 .../src/validation/transaction.test.ts | 0 .../src/validation/transaction.ts | 0 .../src/validation/validators.test.ts | 0 .../src/validation/validators.ts | 0 .../tron-wallet-snap/tsconfig.json | 0 yarn.lock | 456 ++++++++++++++++-- 219 files changed, 416 insertions(+), 42 deletions(-) rename {merged-packages => packages}/tron-wallet-snap/.env.example (100%) rename {merged-packages => packages}/tron-wallet-snap/CHANGELOG.md (100%) rename {merged-packages => packages}/tron-wallet-snap/LICENSE (100%) rename {merged-packages => packages}/tron-wallet-snap/README.md (100%) rename {merged-packages => packages}/tron-wallet-snap/babel.config.js (100%) rename {merged-packages => packages}/tron-wallet-snap/crowdin.yml (100%) rename {merged-packages => packages}/tron-wallet-snap/images/icon.svg (100%) rename {merged-packages => packages}/tron-wallet-snap/images/question-mark.svg (100%) rename {merged-packages => packages}/tron-wallet-snap/jest.config.mjs (100%) rename {merged-packages => packages}/tron-wallet-snap/jest.integration.config.mjs (100%) rename {merged-packages => packages}/tron-wallet-snap/jest.setup.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/locales/de.json (100%) rename {merged-packages => packages}/tron-wallet-snap/locales/el.json (100%) rename {merged-packages => packages}/tron-wallet-snap/locales/en.json (100%) rename {merged-packages => packages}/tron-wallet-snap/locales/es.json (100%) rename {merged-packages => packages}/tron-wallet-snap/locales/fr.json (100%) rename {merged-packages => packages}/tron-wallet-snap/locales/hi.json (100%) rename {merged-packages => packages}/tron-wallet-snap/locales/id.json (100%) rename {merged-packages => packages}/tron-wallet-snap/locales/ja.json (100%) rename {merged-packages => packages}/tron-wallet-snap/locales/ko.json (100%) rename {merged-packages => packages}/tron-wallet-snap/locales/pt.json (100%) rename {merged-packages => packages}/tron-wallet-snap/locales/ru.json (100%) rename {merged-packages => packages}/tron-wallet-snap/locales/tl.json (100%) rename {merged-packages => packages}/tron-wallet-snap/locales/tr.json (100%) rename {merged-packages => packages}/tron-wallet-snap/locales/vi.json (100%) rename {merged-packages => packages}/tron-wallet-snap/locales/zh.json (100%) rename {merged-packages => packages}/tron-wallet-snap/messages.json (100%) rename {merged-packages => packages}/tron-wallet-snap/package.json (100%) rename {merged-packages => packages}/tron-wallet-snap/scripts/build-preinstalled-snap.js (100%) rename {merged-packages => packages}/tron-wallet-snap/scripts/populate-en-locale.js (100%) rename {merged-packages => packages}/tron-wallet-snap/scripts/update-manifest-local.js (100%) rename {merged-packages => packages}/tron-wallet-snap/snap.config.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/snap.manifest.json (100%) rename {merged-packages => packages}/tron-wallet-snap/src/caching/ICache.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/caching/InMemoryCache.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/caching/StateCache.test.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/caching/StateCache.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/caching/types.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/caching/useCache.test.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/caching/useCache.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/caching/useCacheUntil.test.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/caching/useCacheUntil.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/clients/price-api/PriceApiClient.test.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/clients/price-api/PriceApiClient.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/clients/price-api/mocks/exchange-rates.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/clients/price-api/mocks/historical-prices.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/clients/price-api/mocks/spot-prices.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/clients/price-api/structs.test.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/clients/price-api/types.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/clients/security-alerts-api/SecurityAlertsApiClient.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/clients/security-alerts-api/structs.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/clients/security-alerts-api/types.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/clients/security-alerts-api/utils.test.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/clients/security-alerts-api/utils.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/clients/snap/SnapClient.test.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/clients/snap/SnapClient.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/clients/token-api/TokenApiClient.test.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/clients/token-api/TokenApiClient.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/clients/token-api/structs.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/clients/tron-http/TronHttpClient.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/clients/tron-http/index.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/clients/tron-http/structs.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/clients/tron-http/types.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/clients/trongrid/TrongridApiClient.test.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/clients/trongrid/TrongridApiClient.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/clients/trongrid/errors.test.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/clients/trongrid/errors.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/clients/trongrid/structs.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/clients/trongrid/types.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/clients/tronweb/TronWebFactory.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/constants/index.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/context.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/entities/assets.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/entities/keyring-account.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/handlers/assets.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/handlers/clientRequest/clientRequest.test.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/handlers/clientRequest/clientRequest.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/handlers/clientRequest/types.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/handlers/clientRequest/validation.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/handlers/cronjob.test.tsx (100%) rename {merged-packages => packages}/tron-wallet-snap/src/handlers/cronjob.tsx (100%) rename {merged-packages => packages}/tron-wallet-snap/src/handlers/keyring-types.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/handlers/keyring.test.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/handlers/keyring.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/handlers/rpc/rpc.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/handlers/rpc/types.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/handlers/userInput.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/index.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/permissions.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/services/accounts/AccountsRepository.test.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/services/accounts/AccountsRepository.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/services/accounts/AccountsService.test.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/services/accounts/AccountsService.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/services/accounts/types.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/services/assets/AssetsRepository.test.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/services/assets/AssetsRepository.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/services/assets/AssetsService.test.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/services/assets/AssetsService.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/services/assets/types.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/services/config/ConfigProvider.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/services/config/index.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/services/confirmation/ConfirmationHandler.test.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/services/confirmation/ConfirmationHandler.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/services/send/FeeCalculatorService.test.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/services/send/FeeCalculatorService.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/services/send/SendService.test.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/services/send/SendService.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/services/send/TransactionExpirationRefresherService.test.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/services/send/errors.test.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/services/send/errors.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/services/send/types.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/services/staking/StakingService.test.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/services/staking/StakingService.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/services/state/IStateManager.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/services/state/InMemoryState.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/services/state/State.test.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/services/state/State.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/services/transaction-expiration-refresher/TransactionExpirationRefresherService.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/services/transaction-expiration-refresher/types.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/services/transaction-scan/TransactionScanService.test.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/services/transaction-scan/TransactionScanService.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/services/transaction-scan/buildExpiredScanResult.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/services/transaction-scan/index.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/services/transaction-scan/isTransactionDeadlinePassedError.test.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/services/transaction-scan/isTransactionDeadlinePassedError.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/services/transaction-scan/types.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/services/transactions/TransactionsMapper.test.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/services/transactions/TransactionsMapper.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/services/transactions/TransactionsRepository.test.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/services/transactions/TransactionsRepository.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/services/transactions/TransactionsService.test.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/services/transactions/TransactionsService.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/services/transactions/mocks/tron-http/gettransactioninfobyid/swap-transaction.json (100%) rename {merged-packages => packages}/tron-wallet-snap/src/services/transactions/mocks/trongrid/account-transactions/failed-transaction.json (100%) rename {merged-packages => packages}/tron-wallet-snap/src/services/transactions/mocks/trongrid/account-transactions/native-transfer-without-timestamp.json (100%) rename {merged-packages => packages}/tron-wallet-snap/src/services/transactions/mocks/trongrid/account-transactions/native-transfer.json (100%) rename {merged-packages => packages}/tron-wallet-snap/src/services/transactions/mocks/trongrid/account-transactions/swap-transaction.json (100%) rename {merged-packages => packages}/tron-wallet-snap/src/services/transactions/mocks/trongrid/account-transactions/trc10-transfer.json (100%) rename {merged-packages => packages}/tron-wallet-snap/src/services/transactions/mocks/trongrid/account-transactions/trc20-transfer.json (100%) rename {merged-packages => packages}/tron-wallet-snap/src/services/transactions/mocks/trongrid/account-trc20-transactions/contract-info.json (100%) rename {merged-packages => packages}/tron-wallet-snap/src/services/transactions/mocks/trongrid/account-trc20-transactions/swap-contract-info.json (100%) rename {merged-packages => packages}/tron-wallet-snap/src/services/transactions/trc20LogParser.test.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/services/transactions/trc20LogParser.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/services/transactions/utils/isSpam.test.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/services/transactions/utils/isSpam.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/services/wallet/README.md (100%) rename {merged-packages => packages}/tron-wallet-snap/src/services/wallet/WalletService.test.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/services/wallet/WalletService.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/static/tron-logo.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/types/analytics.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/types/snap.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/ui/confirmation/components/Asset/Asset.tsx (100%) rename {merged-packages => packages}/tron-wallet-snap/src/ui/confirmation/components/EstimatedChanges/EstimatedChanges.tsx (100%) rename {merged-packages => packages}/tron-wallet-snap/src/ui/confirmation/components/Fees.tsx (100%) rename {merged-packages => packages}/tron-wallet-snap/src/ui/confirmation/components/TransactionAlert/TransactionAlert.test.tsx (100%) rename {merged-packages => packages}/tron-wallet-snap/src/ui/confirmation/components/TransactionAlert/TransactionAlert.tsx (100%) rename {merged-packages => packages}/tron-wallet-snap/src/ui/confirmation/components/TransactionAlert/getErrorMessage.test.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/ui/confirmation/components/TransactionAlert/getErrorMessage.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/ui/confirmation/utils/getIconUrlForKnownAsset.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignMessage/ConfirmSignMessage.tsx (100%) rename {merged-packages => packages}/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignMessage/events.tsx (100%) rename {merged-packages => packages}/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignMessage/render.test.tsx (100%) rename {merged-packages => packages}/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignMessage/render.tsx (100%) rename {merged-packages => packages}/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignTransaction/ConfirmSignTransaction.test.tsx (100%) rename {merged-packages => packages}/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignTransaction/ConfirmSignTransaction.tsx (100%) rename {merged-packages => packages}/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignTransaction/events.tsx (100%) rename {merged-packages => packages}/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignTransaction/render.test.tsx (100%) rename {merged-packages => packages}/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignTransaction/render.tsx (100%) rename {merged-packages => packages}/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignTransaction/types.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/ui/confirmation/views/ConfirmTransactionRequest/ConfirmTransactionRequest.test.tsx (100%) rename {merged-packages => packages}/tron-wallet-snap/src/ui/confirmation/views/ConfirmTransactionRequest/ConfirmTransactionRequest.tsx (100%) rename {merged-packages => packages}/tron-wallet-snap/src/ui/confirmation/views/ConfirmTransactionRequest/events.tsx (100%) rename {merged-packages => packages}/tron-wallet-snap/src/ui/confirmation/views/ConfirmTransactionRequest/render.test.tsx (100%) rename {merged-packages => packages}/tron-wallet-snap/src/ui/confirmation/views/ConfirmTransactionRequest/render.tsx (100%) rename {merged-packages => packages}/tron-wallet-snap/src/ui/confirmation/views/ConfirmTransactionRequest/types.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/utils/assertOrThrow.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/utils/buildUrl.test.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/utils/buildUrl.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/utils/conversion.test.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/utils/conversion.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/utils/deriveTronFromCoinTypeNode.test.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/utils/deriveTronFromCoinTypeNode.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/utils/errors.test.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/utils/errors.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/utils/executeOnChainActions.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/utils/formatAmount.test.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/utils/formatAmount.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/utils/formatFiat.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/utils/formatOrigin.test.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/utils/formatOrigin.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/utils/getExplorerUrl.test.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/utils/getExplorerUrl.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/utils/getLowestUnusedIndex.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/utils/hex.test.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/utils/hex.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/utils/i18n.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/utils/isFetchStatusLoadingOrFetching.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/utils/logger.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/utils/mockLogger.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/utils/safeMerge.test.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/utils/safeMerge.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/utils/sanitize.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/utils/sensitiveErrors.test.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/utils/sensitiveErrors.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/utils/serialization/deserialize.test.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/utils/serialization/deserialize.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/utils/serialization/serialize.test.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/utils/serialization/serialize.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/utils/serialization/types.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/utils/tokenToFiat.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/validation/keyring-structs.test.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/validation/structs.test.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/validation/structs.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/validation/transaction.test.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/validation/transaction.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/validation/validators.test.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/src/validation/validators.ts (100%) rename {merged-packages => packages}/tron-wallet-snap/tsconfig.json (100%) diff --git a/merged-packages/tron-wallet-snap/.env.example b/packages/tron-wallet-snap/.env.example similarity index 100% rename from merged-packages/tron-wallet-snap/.env.example rename to packages/tron-wallet-snap/.env.example diff --git a/merged-packages/tron-wallet-snap/CHANGELOG.md b/packages/tron-wallet-snap/CHANGELOG.md similarity index 100% rename from merged-packages/tron-wallet-snap/CHANGELOG.md rename to packages/tron-wallet-snap/CHANGELOG.md diff --git a/merged-packages/tron-wallet-snap/LICENSE b/packages/tron-wallet-snap/LICENSE similarity index 100% rename from merged-packages/tron-wallet-snap/LICENSE rename to packages/tron-wallet-snap/LICENSE diff --git a/merged-packages/tron-wallet-snap/README.md b/packages/tron-wallet-snap/README.md similarity index 100% rename from merged-packages/tron-wallet-snap/README.md rename to packages/tron-wallet-snap/README.md diff --git a/merged-packages/tron-wallet-snap/babel.config.js b/packages/tron-wallet-snap/babel.config.js similarity index 100% rename from merged-packages/tron-wallet-snap/babel.config.js rename to packages/tron-wallet-snap/babel.config.js diff --git a/merged-packages/tron-wallet-snap/crowdin.yml b/packages/tron-wallet-snap/crowdin.yml similarity index 100% rename from merged-packages/tron-wallet-snap/crowdin.yml rename to packages/tron-wallet-snap/crowdin.yml diff --git a/merged-packages/tron-wallet-snap/images/icon.svg b/packages/tron-wallet-snap/images/icon.svg similarity index 100% rename from merged-packages/tron-wallet-snap/images/icon.svg rename to packages/tron-wallet-snap/images/icon.svg diff --git a/merged-packages/tron-wallet-snap/images/question-mark.svg b/packages/tron-wallet-snap/images/question-mark.svg similarity index 100% rename from merged-packages/tron-wallet-snap/images/question-mark.svg rename to packages/tron-wallet-snap/images/question-mark.svg diff --git a/merged-packages/tron-wallet-snap/jest.config.mjs b/packages/tron-wallet-snap/jest.config.mjs similarity index 100% rename from merged-packages/tron-wallet-snap/jest.config.mjs rename to packages/tron-wallet-snap/jest.config.mjs diff --git a/merged-packages/tron-wallet-snap/jest.integration.config.mjs b/packages/tron-wallet-snap/jest.integration.config.mjs similarity index 100% rename from merged-packages/tron-wallet-snap/jest.integration.config.mjs rename to packages/tron-wallet-snap/jest.integration.config.mjs diff --git a/merged-packages/tron-wallet-snap/jest.setup.ts b/packages/tron-wallet-snap/jest.setup.ts similarity index 100% rename from merged-packages/tron-wallet-snap/jest.setup.ts rename to packages/tron-wallet-snap/jest.setup.ts diff --git a/merged-packages/tron-wallet-snap/locales/de.json b/packages/tron-wallet-snap/locales/de.json similarity index 100% rename from merged-packages/tron-wallet-snap/locales/de.json rename to packages/tron-wallet-snap/locales/de.json diff --git a/merged-packages/tron-wallet-snap/locales/el.json b/packages/tron-wallet-snap/locales/el.json similarity index 100% rename from merged-packages/tron-wallet-snap/locales/el.json rename to packages/tron-wallet-snap/locales/el.json diff --git a/merged-packages/tron-wallet-snap/locales/en.json b/packages/tron-wallet-snap/locales/en.json similarity index 100% rename from merged-packages/tron-wallet-snap/locales/en.json rename to packages/tron-wallet-snap/locales/en.json diff --git a/merged-packages/tron-wallet-snap/locales/es.json b/packages/tron-wallet-snap/locales/es.json similarity index 100% rename from merged-packages/tron-wallet-snap/locales/es.json rename to packages/tron-wallet-snap/locales/es.json diff --git a/merged-packages/tron-wallet-snap/locales/fr.json b/packages/tron-wallet-snap/locales/fr.json similarity index 100% rename from merged-packages/tron-wallet-snap/locales/fr.json rename to packages/tron-wallet-snap/locales/fr.json diff --git a/merged-packages/tron-wallet-snap/locales/hi.json b/packages/tron-wallet-snap/locales/hi.json similarity index 100% rename from merged-packages/tron-wallet-snap/locales/hi.json rename to packages/tron-wallet-snap/locales/hi.json diff --git a/merged-packages/tron-wallet-snap/locales/id.json b/packages/tron-wallet-snap/locales/id.json similarity index 100% rename from merged-packages/tron-wallet-snap/locales/id.json rename to packages/tron-wallet-snap/locales/id.json diff --git a/merged-packages/tron-wallet-snap/locales/ja.json b/packages/tron-wallet-snap/locales/ja.json similarity index 100% rename from merged-packages/tron-wallet-snap/locales/ja.json rename to packages/tron-wallet-snap/locales/ja.json diff --git a/merged-packages/tron-wallet-snap/locales/ko.json b/packages/tron-wallet-snap/locales/ko.json similarity index 100% rename from merged-packages/tron-wallet-snap/locales/ko.json rename to packages/tron-wallet-snap/locales/ko.json diff --git a/merged-packages/tron-wallet-snap/locales/pt.json b/packages/tron-wallet-snap/locales/pt.json similarity index 100% rename from merged-packages/tron-wallet-snap/locales/pt.json rename to packages/tron-wallet-snap/locales/pt.json diff --git a/merged-packages/tron-wallet-snap/locales/ru.json b/packages/tron-wallet-snap/locales/ru.json similarity index 100% rename from merged-packages/tron-wallet-snap/locales/ru.json rename to packages/tron-wallet-snap/locales/ru.json diff --git a/merged-packages/tron-wallet-snap/locales/tl.json b/packages/tron-wallet-snap/locales/tl.json similarity index 100% rename from merged-packages/tron-wallet-snap/locales/tl.json rename to packages/tron-wallet-snap/locales/tl.json diff --git a/merged-packages/tron-wallet-snap/locales/tr.json b/packages/tron-wallet-snap/locales/tr.json similarity index 100% rename from merged-packages/tron-wallet-snap/locales/tr.json rename to packages/tron-wallet-snap/locales/tr.json diff --git a/merged-packages/tron-wallet-snap/locales/vi.json b/packages/tron-wallet-snap/locales/vi.json similarity index 100% rename from merged-packages/tron-wallet-snap/locales/vi.json rename to packages/tron-wallet-snap/locales/vi.json diff --git a/merged-packages/tron-wallet-snap/locales/zh.json b/packages/tron-wallet-snap/locales/zh.json similarity index 100% rename from merged-packages/tron-wallet-snap/locales/zh.json rename to packages/tron-wallet-snap/locales/zh.json diff --git a/merged-packages/tron-wallet-snap/messages.json b/packages/tron-wallet-snap/messages.json similarity index 100% rename from merged-packages/tron-wallet-snap/messages.json rename to packages/tron-wallet-snap/messages.json diff --git a/merged-packages/tron-wallet-snap/package.json b/packages/tron-wallet-snap/package.json similarity index 100% rename from merged-packages/tron-wallet-snap/package.json rename to packages/tron-wallet-snap/package.json index 6ec9636f..60161ad6 100644 --- a/merged-packages/tron-wallet-snap/package.json +++ b/packages/tron-wallet-snap/package.json @@ -45,7 +45,6 @@ "@metamask/snaps-cli": "^8.3.0", "@metamask/snaps-jest": "^10.2.0", "@metamask/snaps-sdk": "^10.3.0", - "oxfmt": "^0.45.0", "@metamask/superstruct": "^3.2.1", "async-mutex": "^0.5.0", "bignumber.js": "^9.3.1", @@ -55,6 +54,7 @@ "jest": "30.0.3", "jest-it-up": "^2.0.2", "jest-transform-stub": "2.0.0", + "oxfmt": "^0.45.0", "tronweb": "patch:tronweb@npm%3A6.1.0#~/.yarn/patches/tronweb-npm-6.1.0-771b242b6a.patch" }, "publishConfig": { diff --git a/merged-packages/tron-wallet-snap/scripts/build-preinstalled-snap.js b/packages/tron-wallet-snap/scripts/build-preinstalled-snap.js similarity index 100% rename from merged-packages/tron-wallet-snap/scripts/build-preinstalled-snap.js rename to packages/tron-wallet-snap/scripts/build-preinstalled-snap.js diff --git a/merged-packages/tron-wallet-snap/scripts/populate-en-locale.js b/packages/tron-wallet-snap/scripts/populate-en-locale.js similarity index 100% rename from merged-packages/tron-wallet-snap/scripts/populate-en-locale.js rename to packages/tron-wallet-snap/scripts/populate-en-locale.js diff --git a/merged-packages/tron-wallet-snap/scripts/update-manifest-local.js b/packages/tron-wallet-snap/scripts/update-manifest-local.js similarity index 100% rename from merged-packages/tron-wallet-snap/scripts/update-manifest-local.js rename to packages/tron-wallet-snap/scripts/update-manifest-local.js diff --git a/merged-packages/tron-wallet-snap/snap.config.ts b/packages/tron-wallet-snap/snap.config.ts similarity index 100% rename from merged-packages/tron-wallet-snap/snap.config.ts rename to packages/tron-wallet-snap/snap.config.ts diff --git a/merged-packages/tron-wallet-snap/snap.manifest.json b/packages/tron-wallet-snap/snap.manifest.json similarity index 100% rename from merged-packages/tron-wallet-snap/snap.manifest.json rename to packages/tron-wallet-snap/snap.manifest.json diff --git a/merged-packages/tron-wallet-snap/src/caching/ICache.ts b/packages/tron-wallet-snap/src/caching/ICache.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/caching/ICache.ts rename to packages/tron-wallet-snap/src/caching/ICache.ts diff --git a/merged-packages/tron-wallet-snap/src/caching/InMemoryCache.ts b/packages/tron-wallet-snap/src/caching/InMemoryCache.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/caching/InMemoryCache.ts rename to packages/tron-wallet-snap/src/caching/InMemoryCache.ts diff --git a/merged-packages/tron-wallet-snap/src/caching/StateCache.test.ts b/packages/tron-wallet-snap/src/caching/StateCache.test.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/caching/StateCache.test.ts rename to packages/tron-wallet-snap/src/caching/StateCache.test.ts diff --git a/merged-packages/tron-wallet-snap/src/caching/StateCache.ts b/packages/tron-wallet-snap/src/caching/StateCache.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/caching/StateCache.ts rename to packages/tron-wallet-snap/src/caching/StateCache.ts diff --git a/merged-packages/tron-wallet-snap/src/caching/types.ts b/packages/tron-wallet-snap/src/caching/types.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/caching/types.ts rename to packages/tron-wallet-snap/src/caching/types.ts diff --git a/merged-packages/tron-wallet-snap/src/caching/useCache.test.ts b/packages/tron-wallet-snap/src/caching/useCache.test.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/caching/useCache.test.ts rename to packages/tron-wallet-snap/src/caching/useCache.test.ts diff --git a/merged-packages/tron-wallet-snap/src/caching/useCache.ts b/packages/tron-wallet-snap/src/caching/useCache.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/caching/useCache.ts rename to packages/tron-wallet-snap/src/caching/useCache.ts diff --git a/merged-packages/tron-wallet-snap/src/caching/useCacheUntil.test.ts b/packages/tron-wallet-snap/src/caching/useCacheUntil.test.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/caching/useCacheUntil.test.ts rename to packages/tron-wallet-snap/src/caching/useCacheUntil.test.ts diff --git a/merged-packages/tron-wallet-snap/src/caching/useCacheUntil.ts b/packages/tron-wallet-snap/src/caching/useCacheUntil.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/caching/useCacheUntil.ts rename to packages/tron-wallet-snap/src/caching/useCacheUntil.ts diff --git a/merged-packages/tron-wallet-snap/src/clients/price-api/PriceApiClient.test.ts b/packages/tron-wallet-snap/src/clients/price-api/PriceApiClient.test.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/clients/price-api/PriceApiClient.test.ts rename to packages/tron-wallet-snap/src/clients/price-api/PriceApiClient.test.ts diff --git a/merged-packages/tron-wallet-snap/src/clients/price-api/PriceApiClient.ts b/packages/tron-wallet-snap/src/clients/price-api/PriceApiClient.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/clients/price-api/PriceApiClient.ts rename to packages/tron-wallet-snap/src/clients/price-api/PriceApiClient.ts diff --git a/merged-packages/tron-wallet-snap/src/clients/price-api/mocks/exchange-rates.ts b/packages/tron-wallet-snap/src/clients/price-api/mocks/exchange-rates.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/clients/price-api/mocks/exchange-rates.ts rename to packages/tron-wallet-snap/src/clients/price-api/mocks/exchange-rates.ts diff --git a/merged-packages/tron-wallet-snap/src/clients/price-api/mocks/historical-prices.ts b/packages/tron-wallet-snap/src/clients/price-api/mocks/historical-prices.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/clients/price-api/mocks/historical-prices.ts rename to packages/tron-wallet-snap/src/clients/price-api/mocks/historical-prices.ts diff --git a/merged-packages/tron-wallet-snap/src/clients/price-api/mocks/spot-prices.ts b/packages/tron-wallet-snap/src/clients/price-api/mocks/spot-prices.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/clients/price-api/mocks/spot-prices.ts rename to packages/tron-wallet-snap/src/clients/price-api/mocks/spot-prices.ts diff --git a/merged-packages/tron-wallet-snap/src/clients/price-api/structs.test.ts b/packages/tron-wallet-snap/src/clients/price-api/structs.test.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/clients/price-api/structs.test.ts rename to packages/tron-wallet-snap/src/clients/price-api/structs.test.ts diff --git a/merged-packages/tron-wallet-snap/src/clients/price-api/types.ts b/packages/tron-wallet-snap/src/clients/price-api/types.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/clients/price-api/types.ts rename to packages/tron-wallet-snap/src/clients/price-api/types.ts diff --git a/merged-packages/tron-wallet-snap/src/clients/security-alerts-api/SecurityAlertsApiClient.ts b/packages/tron-wallet-snap/src/clients/security-alerts-api/SecurityAlertsApiClient.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/clients/security-alerts-api/SecurityAlertsApiClient.ts rename to packages/tron-wallet-snap/src/clients/security-alerts-api/SecurityAlertsApiClient.ts diff --git a/merged-packages/tron-wallet-snap/src/clients/security-alerts-api/structs.ts b/packages/tron-wallet-snap/src/clients/security-alerts-api/structs.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/clients/security-alerts-api/structs.ts rename to packages/tron-wallet-snap/src/clients/security-alerts-api/structs.ts diff --git a/merged-packages/tron-wallet-snap/src/clients/security-alerts-api/types.ts b/packages/tron-wallet-snap/src/clients/security-alerts-api/types.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/clients/security-alerts-api/types.ts rename to packages/tron-wallet-snap/src/clients/security-alerts-api/types.ts diff --git a/merged-packages/tron-wallet-snap/src/clients/security-alerts-api/utils.test.ts b/packages/tron-wallet-snap/src/clients/security-alerts-api/utils.test.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/clients/security-alerts-api/utils.test.ts rename to packages/tron-wallet-snap/src/clients/security-alerts-api/utils.test.ts diff --git a/merged-packages/tron-wallet-snap/src/clients/security-alerts-api/utils.ts b/packages/tron-wallet-snap/src/clients/security-alerts-api/utils.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/clients/security-alerts-api/utils.ts rename to packages/tron-wallet-snap/src/clients/security-alerts-api/utils.ts diff --git a/merged-packages/tron-wallet-snap/src/clients/snap/SnapClient.test.ts b/packages/tron-wallet-snap/src/clients/snap/SnapClient.test.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/clients/snap/SnapClient.test.ts rename to packages/tron-wallet-snap/src/clients/snap/SnapClient.test.ts diff --git a/merged-packages/tron-wallet-snap/src/clients/snap/SnapClient.ts b/packages/tron-wallet-snap/src/clients/snap/SnapClient.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/clients/snap/SnapClient.ts rename to packages/tron-wallet-snap/src/clients/snap/SnapClient.ts diff --git a/merged-packages/tron-wallet-snap/src/clients/token-api/TokenApiClient.test.ts b/packages/tron-wallet-snap/src/clients/token-api/TokenApiClient.test.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/clients/token-api/TokenApiClient.test.ts rename to packages/tron-wallet-snap/src/clients/token-api/TokenApiClient.test.ts diff --git a/merged-packages/tron-wallet-snap/src/clients/token-api/TokenApiClient.ts b/packages/tron-wallet-snap/src/clients/token-api/TokenApiClient.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/clients/token-api/TokenApiClient.ts rename to packages/tron-wallet-snap/src/clients/token-api/TokenApiClient.ts diff --git a/merged-packages/tron-wallet-snap/src/clients/token-api/structs.ts b/packages/tron-wallet-snap/src/clients/token-api/structs.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/clients/token-api/structs.ts rename to packages/tron-wallet-snap/src/clients/token-api/structs.ts diff --git a/merged-packages/tron-wallet-snap/src/clients/tron-http/TronHttpClient.ts b/packages/tron-wallet-snap/src/clients/tron-http/TronHttpClient.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/clients/tron-http/TronHttpClient.ts rename to packages/tron-wallet-snap/src/clients/tron-http/TronHttpClient.ts diff --git a/merged-packages/tron-wallet-snap/src/clients/tron-http/index.ts b/packages/tron-wallet-snap/src/clients/tron-http/index.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/clients/tron-http/index.ts rename to packages/tron-wallet-snap/src/clients/tron-http/index.ts diff --git a/merged-packages/tron-wallet-snap/src/clients/tron-http/structs.ts b/packages/tron-wallet-snap/src/clients/tron-http/structs.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/clients/tron-http/structs.ts rename to packages/tron-wallet-snap/src/clients/tron-http/structs.ts diff --git a/merged-packages/tron-wallet-snap/src/clients/tron-http/types.ts b/packages/tron-wallet-snap/src/clients/tron-http/types.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/clients/tron-http/types.ts rename to packages/tron-wallet-snap/src/clients/tron-http/types.ts diff --git a/merged-packages/tron-wallet-snap/src/clients/trongrid/TrongridApiClient.test.ts b/packages/tron-wallet-snap/src/clients/trongrid/TrongridApiClient.test.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/clients/trongrid/TrongridApiClient.test.ts rename to packages/tron-wallet-snap/src/clients/trongrid/TrongridApiClient.test.ts diff --git a/merged-packages/tron-wallet-snap/src/clients/trongrid/TrongridApiClient.ts b/packages/tron-wallet-snap/src/clients/trongrid/TrongridApiClient.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/clients/trongrid/TrongridApiClient.ts rename to packages/tron-wallet-snap/src/clients/trongrid/TrongridApiClient.ts diff --git a/merged-packages/tron-wallet-snap/src/clients/trongrid/errors.test.ts b/packages/tron-wallet-snap/src/clients/trongrid/errors.test.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/clients/trongrid/errors.test.ts rename to packages/tron-wallet-snap/src/clients/trongrid/errors.test.ts diff --git a/merged-packages/tron-wallet-snap/src/clients/trongrid/errors.ts b/packages/tron-wallet-snap/src/clients/trongrid/errors.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/clients/trongrid/errors.ts rename to packages/tron-wallet-snap/src/clients/trongrid/errors.ts diff --git a/merged-packages/tron-wallet-snap/src/clients/trongrid/structs.ts b/packages/tron-wallet-snap/src/clients/trongrid/structs.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/clients/trongrid/structs.ts rename to packages/tron-wallet-snap/src/clients/trongrid/structs.ts diff --git a/merged-packages/tron-wallet-snap/src/clients/trongrid/types.ts b/packages/tron-wallet-snap/src/clients/trongrid/types.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/clients/trongrid/types.ts rename to packages/tron-wallet-snap/src/clients/trongrid/types.ts diff --git a/merged-packages/tron-wallet-snap/src/clients/tronweb/TronWebFactory.ts b/packages/tron-wallet-snap/src/clients/tronweb/TronWebFactory.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/clients/tronweb/TronWebFactory.ts rename to packages/tron-wallet-snap/src/clients/tronweb/TronWebFactory.ts diff --git a/merged-packages/tron-wallet-snap/src/constants/index.ts b/packages/tron-wallet-snap/src/constants/index.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/constants/index.ts rename to packages/tron-wallet-snap/src/constants/index.ts diff --git a/merged-packages/tron-wallet-snap/src/context.ts b/packages/tron-wallet-snap/src/context.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/context.ts rename to packages/tron-wallet-snap/src/context.ts diff --git a/merged-packages/tron-wallet-snap/src/entities/assets.ts b/packages/tron-wallet-snap/src/entities/assets.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/entities/assets.ts rename to packages/tron-wallet-snap/src/entities/assets.ts diff --git a/merged-packages/tron-wallet-snap/src/entities/keyring-account.ts b/packages/tron-wallet-snap/src/entities/keyring-account.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/entities/keyring-account.ts rename to packages/tron-wallet-snap/src/entities/keyring-account.ts diff --git a/merged-packages/tron-wallet-snap/src/handlers/assets.ts b/packages/tron-wallet-snap/src/handlers/assets.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/handlers/assets.ts rename to packages/tron-wallet-snap/src/handlers/assets.ts diff --git a/merged-packages/tron-wallet-snap/src/handlers/clientRequest/clientRequest.test.ts b/packages/tron-wallet-snap/src/handlers/clientRequest/clientRequest.test.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/handlers/clientRequest/clientRequest.test.ts rename to packages/tron-wallet-snap/src/handlers/clientRequest/clientRequest.test.ts diff --git a/merged-packages/tron-wallet-snap/src/handlers/clientRequest/clientRequest.ts b/packages/tron-wallet-snap/src/handlers/clientRequest/clientRequest.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/handlers/clientRequest/clientRequest.ts rename to packages/tron-wallet-snap/src/handlers/clientRequest/clientRequest.ts diff --git a/merged-packages/tron-wallet-snap/src/handlers/clientRequest/types.ts b/packages/tron-wallet-snap/src/handlers/clientRequest/types.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/handlers/clientRequest/types.ts rename to packages/tron-wallet-snap/src/handlers/clientRequest/types.ts diff --git a/merged-packages/tron-wallet-snap/src/handlers/clientRequest/validation.ts b/packages/tron-wallet-snap/src/handlers/clientRequest/validation.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/handlers/clientRequest/validation.ts rename to packages/tron-wallet-snap/src/handlers/clientRequest/validation.ts diff --git a/merged-packages/tron-wallet-snap/src/handlers/cronjob.test.tsx b/packages/tron-wallet-snap/src/handlers/cronjob.test.tsx similarity index 100% rename from merged-packages/tron-wallet-snap/src/handlers/cronjob.test.tsx rename to packages/tron-wallet-snap/src/handlers/cronjob.test.tsx diff --git a/merged-packages/tron-wallet-snap/src/handlers/cronjob.tsx b/packages/tron-wallet-snap/src/handlers/cronjob.tsx similarity index 100% rename from merged-packages/tron-wallet-snap/src/handlers/cronjob.tsx rename to packages/tron-wallet-snap/src/handlers/cronjob.tsx diff --git a/merged-packages/tron-wallet-snap/src/handlers/keyring-types.ts b/packages/tron-wallet-snap/src/handlers/keyring-types.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/handlers/keyring-types.ts rename to packages/tron-wallet-snap/src/handlers/keyring-types.ts diff --git a/merged-packages/tron-wallet-snap/src/handlers/keyring.test.ts b/packages/tron-wallet-snap/src/handlers/keyring.test.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/handlers/keyring.test.ts rename to packages/tron-wallet-snap/src/handlers/keyring.test.ts diff --git a/merged-packages/tron-wallet-snap/src/handlers/keyring.ts b/packages/tron-wallet-snap/src/handlers/keyring.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/handlers/keyring.ts rename to packages/tron-wallet-snap/src/handlers/keyring.ts diff --git a/merged-packages/tron-wallet-snap/src/handlers/rpc/rpc.ts b/packages/tron-wallet-snap/src/handlers/rpc/rpc.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/handlers/rpc/rpc.ts rename to packages/tron-wallet-snap/src/handlers/rpc/rpc.ts diff --git a/merged-packages/tron-wallet-snap/src/handlers/rpc/types.ts b/packages/tron-wallet-snap/src/handlers/rpc/types.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/handlers/rpc/types.ts rename to packages/tron-wallet-snap/src/handlers/rpc/types.ts diff --git a/merged-packages/tron-wallet-snap/src/handlers/userInput.ts b/packages/tron-wallet-snap/src/handlers/userInput.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/handlers/userInput.ts rename to packages/tron-wallet-snap/src/handlers/userInput.ts diff --git a/merged-packages/tron-wallet-snap/src/index.ts b/packages/tron-wallet-snap/src/index.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/index.ts rename to packages/tron-wallet-snap/src/index.ts diff --git a/merged-packages/tron-wallet-snap/src/permissions.ts b/packages/tron-wallet-snap/src/permissions.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/permissions.ts rename to packages/tron-wallet-snap/src/permissions.ts diff --git a/merged-packages/tron-wallet-snap/src/services/accounts/AccountsRepository.test.ts b/packages/tron-wallet-snap/src/services/accounts/AccountsRepository.test.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/services/accounts/AccountsRepository.test.ts rename to packages/tron-wallet-snap/src/services/accounts/AccountsRepository.test.ts diff --git a/merged-packages/tron-wallet-snap/src/services/accounts/AccountsRepository.ts b/packages/tron-wallet-snap/src/services/accounts/AccountsRepository.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/services/accounts/AccountsRepository.ts rename to packages/tron-wallet-snap/src/services/accounts/AccountsRepository.ts diff --git a/merged-packages/tron-wallet-snap/src/services/accounts/AccountsService.test.ts b/packages/tron-wallet-snap/src/services/accounts/AccountsService.test.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/services/accounts/AccountsService.test.ts rename to packages/tron-wallet-snap/src/services/accounts/AccountsService.test.ts diff --git a/merged-packages/tron-wallet-snap/src/services/accounts/AccountsService.ts b/packages/tron-wallet-snap/src/services/accounts/AccountsService.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/services/accounts/AccountsService.ts rename to packages/tron-wallet-snap/src/services/accounts/AccountsService.ts diff --git a/merged-packages/tron-wallet-snap/src/services/accounts/types.ts b/packages/tron-wallet-snap/src/services/accounts/types.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/services/accounts/types.ts rename to packages/tron-wallet-snap/src/services/accounts/types.ts diff --git a/merged-packages/tron-wallet-snap/src/services/assets/AssetsRepository.test.ts b/packages/tron-wallet-snap/src/services/assets/AssetsRepository.test.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/services/assets/AssetsRepository.test.ts rename to packages/tron-wallet-snap/src/services/assets/AssetsRepository.test.ts diff --git a/merged-packages/tron-wallet-snap/src/services/assets/AssetsRepository.ts b/packages/tron-wallet-snap/src/services/assets/AssetsRepository.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/services/assets/AssetsRepository.ts rename to packages/tron-wallet-snap/src/services/assets/AssetsRepository.ts diff --git a/merged-packages/tron-wallet-snap/src/services/assets/AssetsService.test.ts b/packages/tron-wallet-snap/src/services/assets/AssetsService.test.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/services/assets/AssetsService.test.ts rename to packages/tron-wallet-snap/src/services/assets/AssetsService.test.ts diff --git a/merged-packages/tron-wallet-snap/src/services/assets/AssetsService.ts b/packages/tron-wallet-snap/src/services/assets/AssetsService.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/services/assets/AssetsService.ts rename to packages/tron-wallet-snap/src/services/assets/AssetsService.ts diff --git a/merged-packages/tron-wallet-snap/src/services/assets/types.ts b/packages/tron-wallet-snap/src/services/assets/types.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/services/assets/types.ts rename to packages/tron-wallet-snap/src/services/assets/types.ts diff --git a/merged-packages/tron-wallet-snap/src/services/config/ConfigProvider.ts b/packages/tron-wallet-snap/src/services/config/ConfigProvider.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/services/config/ConfigProvider.ts rename to packages/tron-wallet-snap/src/services/config/ConfigProvider.ts diff --git a/merged-packages/tron-wallet-snap/src/services/config/index.ts b/packages/tron-wallet-snap/src/services/config/index.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/services/config/index.ts rename to packages/tron-wallet-snap/src/services/config/index.ts diff --git a/merged-packages/tron-wallet-snap/src/services/confirmation/ConfirmationHandler.test.ts b/packages/tron-wallet-snap/src/services/confirmation/ConfirmationHandler.test.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/services/confirmation/ConfirmationHandler.test.ts rename to packages/tron-wallet-snap/src/services/confirmation/ConfirmationHandler.test.ts diff --git a/merged-packages/tron-wallet-snap/src/services/confirmation/ConfirmationHandler.ts b/packages/tron-wallet-snap/src/services/confirmation/ConfirmationHandler.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/services/confirmation/ConfirmationHandler.ts rename to packages/tron-wallet-snap/src/services/confirmation/ConfirmationHandler.ts diff --git a/merged-packages/tron-wallet-snap/src/services/send/FeeCalculatorService.test.ts b/packages/tron-wallet-snap/src/services/send/FeeCalculatorService.test.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/services/send/FeeCalculatorService.test.ts rename to packages/tron-wallet-snap/src/services/send/FeeCalculatorService.test.ts diff --git a/merged-packages/tron-wallet-snap/src/services/send/FeeCalculatorService.ts b/packages/tron-wallet-snap/src/services/send/FeeCalculatorService.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/services/send/FeeCalculatorService.ts rename to packages/tron-wallet-snap/src/services/send/FeeCalculatorService.ts diff --git a/merged-packages/tron-wallet-snap/src/services/send/SendService.test.ts b/packages/tron-wallet-snap/src/services/send/SendService.test.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/services/send/SendService.test.ts rename to packages/tron-wallet-snap/src/services/send/SendService.test.ts diff --git a/merged-packages/tron-wallet-snap/src/services/send/SendService.ts b/packages/tron-wallet-snap/src/services/send/SendService.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/services/send/SendService.ts rename to packages/tron-wallet-snap/src/services/send/SendService.ts diff --git a/merged-packages/tron-wallet-snap/src/services/send/TransactionExpirationRefresherService.test.ts b/packages/tron-wallet-snap/src/services/send/TransactionExpirationRefresherService.test.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/services/send/TransactionExpirationRefresherService.test.ts rename to packages/tron-wallet-snap/src/services/send/TransactionExpirationRefresherService.test.ts diff --git a/merged-packages/tron-wallet-snap/src/services/send/errors.test.ts b/packages/tron-wallet-snap/src/services/send/errors.test.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/services/send/errors.test.ts rename to packages/tron-wallet-snap/src/services/send/errors.test.ts diff --git a/merged-packages/tron-wallet-snap/src/services/send/errors.ts b/packages/tron-wallet-snap/src/services/send/errors.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/services/send/errors.ts rename to packages/tron-wallet-snap/src/services/send/errors.ts diff --git a/merged-packages/tron-wallet-snap/src/services/send/types.ts b/packages/tron-wallet-snap/src/services/send/types.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/services/send/types.ts rename to packages/tron-wallet-snap/src/services/send/types.ts diff --git a/merged-packages/tron-wallet-snap/src/services/staking/StakingService.test.ts b/packages/tron-wallet-snap/src/services/staking/StakingService.test.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/services/staking/StakingService.test.ts rename to packages/tron-wallet-snap/src/services/staking/StakingService.test.ts diff --git a/merged-packages/tron-wallet-snap/src/services/staking/StakingService.ts b/packages/tron-wallet-snap/src/services/staking/StakingService.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/services/staking/StakingService.ts rename to packages/tron-wallet-snap/src/services/staking/StakingService.ts diff --git a/merged-packages/tron-wallet-snap/src/services/state/IStateManager.ts b/packages/tron-wallet-snap/src/services/state/IStateManager.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/services/state/IStateManager.ts rename to packages/tron-wallet-snap/src/services/state/IStateManager.ts diff --git a/merged-packages/tron-wallet-snap/src/services/state/InMemoryState.ts b/packages/tron-wallet-snap/src/services/state/InMemoryState.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/services/state/InMemoryState.ts rename to packages/tron-wallet-snap/src/services/state/InMemoryState.ts diff --git a/merged-packages/tron-wallet-snap/src/services/state/State.test.ts b/packages/tron-wallet-snap/src/services/state/State.test.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/services/state/State.test.ts rename to packages/tron-wallet-snap/src/services/state/State.test.ts diff --git a/merged-packages/tron-wallet-snap/src/services/state/State.ts b/packages/tron-wallet-snap/src/services/state/State.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/services/state/State.ts rename to packages/tron-wallet-snap/src/services/state/State.ts diff --git a/merged-packages/tron-wallet-snap/src/services/transaction-expiration-refresher/TransactionExpirationRefresherService.ts b/packages/tron-wallet-snap/src/services/transaction-expiration-refresher/TransactionExpirationRefresherService.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/services/transaction-expiration-refresher/TransactionExpirationRefresherService.ts rename to packages/tron-wallet-snap/src/services/transaction-expiration-refresher/TransactionExpirationRefresherService.ts diff --git a/merged-packages/tron-wallet-snap/src/services/transaction-expiration-refresher/types.ts b/packages/tron-wallet-snap/src/services/transaction-expiration-refresher/types.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/services/transaction-expiration-refresher/types.ts rename to packages/tron-wallet-snap/src/services/transaction-expiration-refresher/types.ts diff --git a/merged-packages/tron-wallet-snap/src/services/transaction-scan/TransactionScanService.test.ts b/packages/tron-wallet-snap/src/services/transaction-scan/TransactionScanService.test.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/services/transaction-scan/TransactionScanService.test.ts rename to packages/tron-wallet-snap/src/services/transaction-scan/TransactionScanService.test.ts diff --git a/merged-packages/tron-wallet-snap/src/services/transaction-scan/TransactionScanService.ts b/packages/tron-wallet-snap/src/services/transaction-scan/TransactionScanService.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/services/transaction-scan/TransactionScanService.ts rename to packages/tron-wallet-snap/src/services/transaction-scan/TransactionScanService.ts diff --git a/merged-packages/tron-wallet-snap/src/services/transaction-scan/buildExpiredScanResult.ts b/packages/tron-wallet-snap/src/services/transaction-scan/buildExpiredScanResult.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/services/transaction-scan/buildExpiredScanResult.ts rename to packages/tron-wallet-snap/src/services/transaction-scan/buildExpiredScanResult.ts diff --git a/merged-packages/tron-wallet-snap/src/services/transaction-scan/index.ts b/packages/tron-wallet-snap/src/services/transaction-scan/index.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/services/transaction-scan/index.ts rename to packages/tron-wallet-snap/src/services/transaction-scan/index.ts diff --git a/merged-packages/tron-wallet-snap/src/services/transaction-scan/isTransactionDeadlinePassedError.test.ts b/packages/tron-wallet-snap/src/services/transaction-scan/isTransactionDeadlinePassedError.test.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/services/transaction-scan/isTransactionDeadlinePassedError.test.ts rename to packages/tron-wallet-snap/src/services/transaction-scan/isTransactionDeadlinePassedError.test.ts diff --git a/merged-packages/tron-wallet-snap/src/services/transaction-scan/isTransactionDeadlinePassedError.ts b/packages/tron-wallet-snap/src/services/transaction-scan/isTransactionDeadlinePassedError.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/services/transaction-scan/isTransactionDeadlinePassedError.ts rename to packages/tron-wallet-snap/src/services/transaction-scan/isTransactionDeadlinePassedError.ts diff --git a/merged-packages/tron-wallet-snap/src/services/transaction-scan/types.ts b/packages/tron-wallet-snap/src/services/transaction-scan/types.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/services/transaction-scan/types.ts rename to packages/tron-wallet-snap/src/services/transaction-scan/types.ts diff --git a/merged-packages/tron-wallet-snap/src/services/transactions/TransactionsMapper.test.ts b/packages/tron-wallet-snap/src/services/transactions/TransactionsMapper.test.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/services/transactions/TransactionsMapper.test.ts rename to packages/tron-wallet-snap/src/services/transactions/TransactionsMapper.test.ts diff --git a/merged-packages/tron-wallet-snap/src/services/transactions/TransactionsMapper.ts b/packages/tron-wallet-snap/src/services/transactions/TransactionsMapper.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/services/transactions/TransactionsMapper.ts rename to packages/tron-wallet-snap/src/services/transactions/TransactionsMapper.ts diff --git a/merged-packages/tron-wallet-snap/src/services/transactions/TransactionsRepository.test.ts b/packages/tron-wallet-snap/src/services/transactions/TransactionsRepository.test.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/services/transactions/TransactionsRepository.test.ts rename to packages/tron-wallet-snap/src/services/transactions/TransactionsRepository.test.ts diff --git a/merged-packages/tron-wallet-snap/src/services/transactions/TransactionsRepository.ts b/packages/tron-wallet-snap/src/services/transactions/TransactionsRepository.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/services/transactions/TransactionsRepository.ts rename to packages/tron-wallet-snap/src/services/transactions/TransactionsRepository.ts diff --git a/merged-packages/tron-wallet-snap/src/services/transactions/TransactionsService.test.ts b/packages/tron-wallet-snap/src/services/transactions/TransactionsService.test.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/services/transactions/TransactionsService.test.ts rename to packages/tron-wallet-snap/src/services/transactions/TransactionsService.test.ts diff --git a/merged-packages/tron-wallet-snap/src/services/transactions/TransactionsService.ts b/packages/tron-wallet-snap/src/services/transactions/TransactionsService.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/services/transactions/TransactionsService.ts rename to packages/tron-wallet-snap/src/services/transactions/TransactionsService.ts diff --git a/merged-packages/tron-wallet-snap/src/services/transactions/mocks/tron-http/gettransactioninfobyid/swap-transaction.json b/packages/tron-wallet-snap/src/services/transactions/mocks/tron-http/gettransactioninfobyid/swap-transaction.json similarity index 100% rename from merged-packages/tron-wallet-snap/src/services/transactions/mocks/tron-http/gettransactioninfobyid/swap-transaction.json rename to packages/tron-wallet-snap/src/services/transactions/mocks/tron-http/gettransactioninfobyid/swap-transaction.json diff --git a/merged-packages/tron-wallet-snap/src/services/transactions/mocks/trongrid/account-transactions/failed-transaction.json b/packages/tron-wallet-snap/src/services/transactions/mocks/trongrid/account-transactions/failed-transaction.json similarity index 100% rename from merged-packages/tron-wallet-snap/src/services/transactions/mocks/trongrid/account-transactions/failed-transaction.json rename to packages/tron-wallet-snap/src/services/transactions/mocks/trongrid/account-transactions/failed-transaction.json diff --git a/merged-packages/tron-wallet-snap/src/services/transactions/mocks/trongrid/account-transactions/native-transfer-without-timestamp.json b/packages/tron-wallet-snap/src/services/transactions/mocks/trongrid/account-transactions/native-transfer-without-timestamp.json similarity index 100% rename from merged-packages/tron-wallet-snap/src/services/transactions/mocks/trongrid/account-transactions/native-transfer-without-timestamp.json rename to packages/tron-wallet-snap/src/services/transactions/mocks/trongrid/account-transactions/native-transfer-without-timestamp.json diff --git a/merged-packages/tron-wallet-snap/src/services/transactions/mocks/trongrid/account-transactions/native-transfer.json b/packages/tron-wallet-snap/src/services/transactions/mocks/trongrid/account-transactions/native-transfer.json similarity index 100% rename from merged-packages/tron-wallet-snap/src/services/transactions/mocks/trongrid/account-transactions/native-transfer.json rename to packages/tron-wallet-snap/src/services/transactions/mocks/trongrid/account-transactions/native-transfer.json diff --git a/merged-packages/tron-wallet-snap/src/services/transactions/mocks/trongrid/account-transactions/swap-transaction.json b/packages/tron-wallet-snap/src/services/transactions/mocks/trongrid/account-transactions/swap-transaction.json similarity index 100% rename from merged-packages/tron-wallet-snap/src/services/transactions/mocks/trongrid/account-transactions/swap-transaction.json rename to packages/tron-wallet-snap/src/services/transactions/mocks/trongrid/account-transactions/swap-transaction.json diff --git a/merged-packages/tron-wallet-snap/src/services/transactions/mocks/trongrid/account-transactions/trc10-transfer.json b/packages/tron-wallet-snap/src/services/transactions/mocks/trongrid/account-transactions/trc10-transfer.json similarity index 100% rename from merged-packages/tron-wallet-snap/src/services/transactions/mocks/trongrid/account-transactions/trc10-transfer.json rename to packages/tron-wallet-snap/src/services/transactions/mocks/trongrid/account-transactions/trc10-transfer.json diff --git a/merged-packages/tron-wallet-snap/src/services/transactions/mocks/trongrid/account-transactions/trc20-transfer.json b/packages/tron-wallet-snap/src/services/transactions/mocks/trongrid/account-transactions/trc20-transfer.json similarity index 100% rename from merged-packages/tron-wallet-snap/src/services/transactions/mocks/trongrid/account-transactions/trc20-transfer.json rename to packages/tron-wallet-snap/src/services/transactions/mocks/trongrid/account-transactions/trc20-transfer.json diff --git a/merged-packages/tron-wallet-snap/src/services/transactions/mocks/trongrid/account-trc20-transactions/contract-info.json b/packages/tron-wallet-snap/src/services/transactions/mocks/trongrid/account-trc20-transactions/contract-info.json similarity index 100% rename from merged-packages/tron-wallet-snap/src/services/transactions/mocks/trongrid/account-trc20-transactions/contract-info.json rename to packages/tron-wallet-snap/src/services/transactions/mocks/trongrid/account-trc20-transactions/contract-info.json diff --git a/merged-packages/tron-wallet-snap/src/services/transactions/mocks/trongrid/account-trc20-transactions/swap-contract-info.json b/packages/tron-wallet-snap/src/services/transactions/mocks/trongrid/account-trc20-transactions/swap-contract-info.json similarity index 100% rename from merged-packages/tron-wallet-snap/src/services/transactions/mocks/trongrid/account-trc20-transactions/swap-contract-info.json rename to packages/tron-wallet-snap/src/services/transactions/mocks/trongrid/account-trc20-transactions/swap-contract-info.json diff --git a/merged-packages/tron-wallet-snap/src/services/transactions/trc20LogParser.test.ts b/packages/tron-wallet-snap/src/services/transactions/trc20LogParser.test.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/services/transactions/trc20LogParser.test.ts rename to packages/tron-wallet-snap/src/services/transactions/trc20LogParser.test.ts diff --git a/merged-packages/tron-wallet-snap/src/services/transactions/trc20LogParser.ts b/packages/tron-wallet-snap/src/services/transactions/trc20LogParser.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/services/transactions/trc20LogParser.ts rename to packages/tron-wallet-snap/src/services/transactions/trc20LogParser.ts diff --git a/merged-packages/tron-wallet-snap/src/services/transactions/utils/isSpam.test.ts b/packages/tron-wallet-snap/src/services/transactions/utils/isSpam.test.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/services/transactions/utils/isSpam.test.ts rename to packages/tron-wallet-snap/src/services/transactions/utils/isSpam.test.ts diff --git a/merged-packages/tron-wallet-snap/src/services/transactions/utils/isSpam.ts b/packages/tron-wallet-snap/src/services/transactions/utils/isSpam.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/services/transactions/utils/isSpam.ts rename to packages/tron-wallet-snap/src/services/transactions/utils/isSpam.ts diff --git a/merged-packages/tron-wallet-snap/src/services/wallet/README.md b/packages/tron-wallet-snap/src/services/wallet/README.md similarity index 100% rename from merged-packages/tron-wallet-snap/src/services/wallet/README.md rename to packages/tron-wallet-snap/src/services/wallet/README.md diff --git a/merged-packages/tron-wallet-snap/src/services/wallet/WalletService.test.ts b/packages/tron-wallet-snap/src/services/wallet/WalletService.test.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/services/wallet/WalletService.test.ts rename to packages/tron-wallet-snap/src/services/wallet/WalletService.test.ts diff --git a/merged-packages/tron-wallet-snap/src/services/wallet/WalletService.ts b/packages/tron-wallet-snap/src/services/wallet/WalletService.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/services/wallet/WalletService.ts rename to packages/tron-wallet-snap/src/services/wallet/WalletService.ts diff --git a/merged-packages/tron-wallet-snap/src/static/tron-logo.ts b/packages/tron-wallet-snap/src/static/tron-logo.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/static/tron-logo.ts rename to packages/tron-wallet-snap/src/static/tron-logo.ts diff --git a/merged-packages/tron-wallet-snap/src/types/analytics.ts b/packages/tron-wallet-snap/src/types/analytics.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/types/analytics.ts rename to packages/tron-wallet-snap/src/types/analytics.ts diff --git a/merged-packages/tron-wallet-snap/src/types/snap.ts b/packages/tron-wallet-snap/src/types/snap.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/types/snap.ts rename to packages/tron-wallet-snap/src/types/snap.ts diff --git a/merged-packages/tron-wallet-snap/src/ui/confirmation/components/Asset/Asset.tsx b/packages/tron-wallet-snap/src/ui/confirmation/components/Asset/Asset.tsx similarity index 100% rename from merged-packages/tron-wallet-snap/src/ui/confirmation/components/Asset/Asset.tsx rename to packages/tron-wallet-snap/src/ui/confirmation/components/Asset/Asset.tsx diff --git a/merged-packages/tron-wallet-snap/src/ui/confirmation/components/EstimatedChanges/EstimatedChanges.tsx b/packages/tron-wallet-snap/src/ui/confirmation/components/EstimatedChanges/EstimatedChanges.tsx similarity index 100% rename from merged-packages/tron-wallet-snap/src/ui/confirmation/components/EstimatedChanges/EstimatedChanges.tsx rename to packages/tron-wallet-snap/src/ui/confirmation/components/EstimatedChanges/EstimatedChanges.tsx diff --git a/merged-packages/tron-wallet-snap/src/ui/confirmation/components/Fees.tsx b/packages/tron-wallet-snap/src/ui/confirmation/components/Fees.tsx similarity index 100% rename from merged-packages/tron-wallet-snap/src/ui/confirmation/components/Fees.tsx rename to packages/tron-wallet-snap/src/ui/confirmation/components/Fees.tsx diff --git a/merged-packages/tron-wallet-snap/src/ui/confirmation/components/TransactionAlert/TransactionAlert.test.tsx b/packages/tron-wallet-snap/src/ui/confirmation/components/TransactionAlert/TransactionAlert.test.tsx similarity index 100% rename from merged-packages/tron-wallet-snap/src/ui/confirmation/components/TransactionAlert/TransactionAlert.test.tsx rename to packages/tron-wallet-snap/src/ui/confirmation/components/TransactionAlert/TransactionAlert.test.tsx diff --git a/merged-packages/tron-wallet-snap/src/ui/confirmation/components/TransactionAlert/TransactionAlert.tsx b/packages/tron-wallet-snap/src/ui/confirmation/components/TransactionAlert/TransactionAlert.tsx similarity index 100% rename from merged-packages/tron-wallet-snap/src/ui/confirmation/components/TransactionAlert/TransactionAlert.tsx rename to packages/tron-wallet-snap/src/ui/confirmation/components/TransactionAlert/TransactionAlert.tsx diff --git a/merged-packages/tron-wallet-snap/src/ui/confirmation/components/TransactionAlert/getErrorMessage.test.ts b/packages/tron-wallet-snap/src/ui/confirmation/components/TransactionAlert/getErrorMessage.test.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/ui/confirmation/components/TransactionAlert/getErrorMessage.test.ts rename to packages/tron-wallet-snap/src/ui/confirmation/components/TransactionAlert/getErrorMessage.test.ts diff --git a/merged-packages/tron-wallet-snap/src/ui/confirmation/components/TransactionAlert/getErrorMessage.ts b/packages/tron-wallet-snap/src/ui/confirmation/components/TransactionAlert/getErrorMessage.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/ui/confirmation/components/TransactionAlert/getErrorMessage.ts rename to packages/tron-wallet-snap/src/ui/confirmation/components/TransactionAlert/getErrorMessage.ts diff --git a/merged-packages/tron-wallet-snap/src/ui/confirmation/utils/getIconUrlForKnownAsset.ts b/packages/tron-wallet-snap/src/ui/confirmation/utils/getIconUrlForKnownAsset.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/ui/confirmation/utils/getIconUrlForKnownAsset.ts rename to packages/tron-wallet-snap/src/ui/confirmation/utils/getIconUrlForKnownAsset.ts diff --git a/merged-packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignMessage/ConfirmSignMessage.tsx b/packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignMessage/ConfirmSignMessage.tsx similarity index 100% rename from merged-packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignMessage/ConfirmSignMessage.tsx rename to packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignMessage/ConfirmSignMessage.tsx diff --git a/merged-packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignMessage/events.tsx b/packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignMessage/events.tsx similarity index 100% rename from merged-packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignMessage/events.tsx rename to packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignMessage/events.tsx diff --git a/merged-packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignMessage/render.test.tsx b/packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignMessage/render.test.tsx similarity index 100% rename from merged-packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignMessage/render.test.tsx rename to packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignMessage/render.test.tsx diff --git a/merged-packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignMessage/render.tsx b/packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignMessage/render.tsx similarity index 100% rename from merged-packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignMessage/render.tsx rename to packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignMessage/render.tsx diff --git a/merged-packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignTransaction/ConfirmSignTransaction.test.tsx b/packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignTransaction/ConfirmSignTransaction.test.tsx similarity index 100% rename from merged-packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignTransaction/ConfirmSignTransaction.test.tsx rename to packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignTransaction/ConfirmSignTransaction.test.tsx diff --git a/merged-packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignTransaction/ConfirmSignTransaction.tsx b/packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignTransaction/ConfirmSignTransaction.tsx similarity index 100% rename from merged-packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignTransaction/ConfirmSignTransaction.tsx rename to packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignTransaction/ConfirmSignTransaction.tsx diff --git a/merged-packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignTransaction/events.tsx b/packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignTransaction/events.tsx similarity index 100% rename from merged-packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignTransaction/events.tsx rename to packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignTransaction/events.tsx diff --git a/merged-packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignTransaction/render.test.tsx b/packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignTransaction/render.test.tsx similarity index 100% rename from merged-packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignTransaction/render.test.tsx rename to packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignTransaction/render.test.tsx diff --git a/merged-packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignTransaction/render.tsx b/packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignTransaction/render.tsx similarity index 100% rename from merged-packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignTransaction/render.tsx rename to packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignTransaction/render.tsx diff --git a/merged-packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignTransaction/types.ts b/packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignTransaction/types.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignTransaction/types.ts rename to packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignTransaction/types.ts diff --git a/merged-packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmTransactionRequest/ConfirmTransactionRequest.test.tsx b/packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmTransactionRequest/ConfirmTransactionRequest.test.tsx similarity index 100% rename from merged-packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmTransactionRequest/ConfirmTransactionRequest.test.tsx rename to packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmTransactionRequest/ConfirmTransactionRequest.test.tsx diff --git a/merged-packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmTransactionRequest/ConfirmTransactionRequest.tsx b/packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmTransactionRequest/ConfirmTransactionRequest.tsx similarity index 100% rename from merged-packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmTransactionRequest/ConfirmTransactionRequest.tsx rename to packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmTransactionRequest/ConfirmTransactionRequest.tsx diff --git a/merged-packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmTransactionRequest/events.tsx b/packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmTransactionRequest/events.tsx similarity index 100% rename from merged-packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmTransactionRequest/events.tsx rename to packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmTransactionRequest/events.tsx diff --git a/merged-packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmTransactionRequest/render.test.tsx b/packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmTransactionRequest/render.test.tsx similarity index 100% rename from merged-packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmTransactionRequest/render.test.tsx rename to packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmTransactionRequest/render.test.tsx diff --git a/merged-packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmTransactionRequest/render.tsx b/packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmTransactionRequest/render.tsx similarity index 100% rename from merged-packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmTransactionRequest/render.tsx rename to packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmTransactionRequest/render.tsx diff --git a/merged-packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmTransactionRequest/types.ts b/packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmTransactionRequest/types.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmTransactionRequest/types.ts rename to packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmTransactionRequest/types.ts diff --git a/merged-packages/tron-wallet-snap/src/utils/assertOrThrow.ts b/packages/tron-wallet-snap/src/utils/assertOrThrow.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/utils/assertOrThrow.ts rename to packages/tron-wallet-snap/src/utils/assertOrThrow.ts diff --git a/merged-packages/tron-wallet-snap/src/utils/buildUrl.test.ts b/packages/tron-wallet-snap/src/utils/buildUrl.test.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/utils/buildUrl.test.ts rename to packages/tron-wallet-snap/src/utils/buildUrl.test.ts diff --git a/merged-packages/tron-wallet-snap/src/utils/buildUrl.ts b/packages/tron-wallet-snap/src/utils/buildUrl.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/utils/buildUrl.ts rename to packages/tron-wallet-snap/src/utils/buildUrl.ts diff --git a/merged-packages/tron-wallet-snap/src/utils/conversion.test.ts b/packages/tron-wallet-snap/src/utils/conversion.test.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/utils/conversion.test.ts rename to packages/tron-wallet-snap/src/utils/conversion.test.ts diff --git a/merged-packages/tron-wallet-snap/src/utils/conversion.ts b/packages/tron-wallet-snap/src/utils/conversion.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/utils/conversion.ts rename to packages/tron-wallet-snap/src/utils/conversion.ts diff --git a/merged-packages/tron-wallet-snap/src/utils/deriveTronFromCoinTypeNode.test.ts b/packages/tron-wallet-snap/src/utils/deriveTronFromCoinTypeNode.test.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/utils/deriveTronFromCoinTypeNode.test.ts rename to packages/tron-wallet-snap/src/utils/deriveTronFromCoinTypeNode.test.ts diff --git a/merged-packages/tron-wallet-snap/src/utils/deriveTronFromCoinTypeNode.ts b/packages/tron-wallet-snap/src/utils/deriveTronFromCoinTypeNode.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/utils/deriveTronFromCoinTypeNode.ts rename to packages/tron-wallet-snap/src/utils/deriveTronFromCoinTypeNode.ts diff --git a/merged-packages/tron-wallet-snap/src/utils/errors.test.ts b/packages/tron-wallet-snap/src/utils/errors.test.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/utils/errors.test.ts rename to packages/tron-wallet-snap/src/utils/errors.test.ts diff --git a/merged-packages/tron-wallet-snap/src/utils/errors.ts b/packages/tron-wallet-snap/src/utils/errors.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/utils/errors.ts rename to packages/tron-wallet-snap/src/utils/errors.ts diff --git a/merged-packages/tron-wallet-snap/src/utils/executeOnChainActions.ts b/packages/tron-wallet-snap/src/utils/executeOnChainActions.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/utils/executeOnChainActions.ts rename to packages/tron-wallet-snap/src/utils/executeOnChainActions.ts diff --git a/merged-packages/tron-wallet-snap/src/utils/formatAmount.test.ts b/packages/tron-wallet-snap/src/utils/formatAmount.test.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/utils/formatAmount.test.ts rename to packages/tron-wallet-snap/src/utils/formatAmount.test.ts diff --git a/merged-packages/tron-wallet-snap/src/utils/formatAmount.ts b/packages/tron-wallet-snap/src/utils/formatAmount.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/utils/formatAmount.ts rename to packages/tron-wallet-snap/src/utils/formatAmount.ts diff --git a/merged-packages/tron-wallet-snap/src/utils/formatFiat.ts b/packages/tron-wallet-snap/src/utils/formatFiat.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/utils/formatFiat.ts rename to packages/tron-wallet-snap/src/utils/formatFiat.ts diff --git a/merged-packages/tron-wallet-snap/src/utils/formatOrigin.test.ts b/packages/tron-wallet-snap/src/utils/formatOrigin.test.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/utils/formatOrigin.test.ts rename to packages/tron-wallet-snap/src/utils/formatOrigin.test.ts diff --git a/merged-packages/tron-wallet-snap/src/utils/formatOrigin.ts b/packages/tron-wallet-snap/src/utils/formatOrigin.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/utils/formatOrigin.ts rename to packages/tron-wallet-snap/src/utils/formatOrigin.ts diff --git a/merged-packages/tron-wallet-snap/src/utils/getExplorerUrl.test.ts b/packages/tron-wallet-snap/src/utils/getExplorerUrl.test.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/utils/getExplorerUrl.test.ts rename to packages/tron-wallet-snap/src/utils/getExplorerUrl.test.ts diff --git a/merged-packages/tron-wallet-snap/src/utils/getExplorerUrl.ts b/packages/tron-wallet-snap/src/utils/getExplorerUrl.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/utils/getExplorerUrl.ts rename to packages/tron-wallet-snap/src/utils/getExplorerUrl.ts diff --git a/merged-packages/tron-wallet-snap/src/utils/getLowestUnusedIndex.ts b/packages/tron-wallet-snap/src/utils/getLowestUnusedIndex.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/utils/getLowestUnusedIndex.ts rename to packages/tron-wallet-snap/src/utils/getLowestUnusedIndex.ts diff --git a/merged-packages/tron-wallet-snap/src/utils/hex.test.ts b/packages/tron-wallet-snap/src/utils/hex.test.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/utils/hex.test.ts rename to packages/tron-wallet-snap/src/utils/hex.test.ts diff --git a/merged-packages/tron-wallet-snap/src/utils/hex.ts b/packages/tron-wallet-snap/src/utils/hex.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/utils/hex.ts rename to packages/tron-wallet-snap/src/utils/hex.ts diff --git a/merged-packages/tron-wallet-snap/src/utils/i18n.ts b/packages/tron-wallet-snap/src/utils/i18n.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/utils/i18n.ts rename to packages/tron-wallet-snap/src/utils/i18n.ts diff --git a/merged-packages/tron-wallet-snap/src/utils/isFetchStatusLoadingOrFetching.ts b/packages/tron-wallet-snap/src/utils/isFetchStatusLoadingOrFetching.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/utils/isFetchStatusLoadingOrFetching.ts rename to packages/tron-wallet-snap/src/utils/isFetchStatusLoadingOrFetching.ts diff --git a/merged-packages/tron-wallet-snap/src/utils/logger.ts b/packages/tron-wallet-snap/src/utils/logger.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/utils/logger.ts rename to packages/tron-wallet-snap/src/utils/logger.ts diff --git a/merged-packages/tron-wallet-snap/src/utils/mockLogger.ts b/packages/tron-wallet-snap/src/utils/mockLogger.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/utils/mockLogger.ts rename to packages/tron-wallet-snap/src/utils/mockLogger.ts diff --git a/merged-packages/tron-wallet-snap/src/utils/safeMerge.test.ts b/packages/tron-wallet-snap/src/utils/safeMerge.test.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/utils/safeMerge.test.ts rename to packages/tron-wallet-snap/src/utils/safeMerge.test.ts diff --git a/merged-packages/tron-wallet-snap/src/utils/safeMerge.ts b/packages/tron-wallet-snap/src/utils/safeMerge.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/utils/safeMerge.ts rename to packages/tron-wallet-snap/src/utils/safeMerge.ts diff --git a/merged-packages/tron-wallet-snap/src/utils/sanitize.ts b/packages/tron-wallet-snap/src/utils/sanitize.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/utils/sanitize.ts rename to packages/tron-wallet-snap/src/utils/sanitize.ts diff --git a/merged-packages/tron-wallet-snap/src/utils/sensitiveErrors.test.ts b/packages/tron-wallet-snap/src/utils/sensitiveErrors.test.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/utils/sensitiveErrors.test.ts rename to packages/tron-wallet-snap/src/utils/sensitiveErrors.test.ts diff --git a/merged-packages/tron-wallet-snap/src/utils/sensitiveErrors.ts b/packages/tron-wallet-snap/src/utils/sensitiveErrors.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/utils/sensitiveErrors.ts rename to packages/tron-wallet-snap/src/utils/sensitiveErrors.ts diff --git a/merged-packages/tron-wallet-snap/src/utils/serialization/deserialize.test.ts b/packages/tron-wallet-snap/src/utils/serialization/deserialize.test.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/utils/serialization/deserialize.test.ts rename to packages/tron-wallet-snap/src/utils/serialization/deserialize.test.ts diff --git a/merged-packages/tron-wallet-snap/src/utils/serialization/deserialize.ts b/packages/tron-wallet-snap/src/utils/serialization/deserialize.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/utils/serialization/deserialize.ts rename to packages/tron-wallet-snap/src/utils/serialization/deserialize.ts diff --git a/merged-packages/tron-wallet-snap/src/utils/serialization/serialize.test.ts b/packages/tron-wallet-snap/src/utils/serialization/serialize.test.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/utils/serialization/serialize.test.ts rename to packages/tron-wallet-snap/src/utils/serialization/serialize.test.ts diff --git a/merged-packages/tron-wallet-snap/src/utils/serialization/serialize.ts b/packages/tron-wallet-snap/src/utils/serialization/serialize.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/utils/serialization/serialize.ts rename to packages/tron-wallet-snap/src/utils/serialization/serialize.ts diff --git a/merged-packages/tron-wallet-snap/src/utils/serialization/types.ts b/packages/tron-wallet-snap/src/utils/serialization/types.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/utils/serialization/types.ts rename to packages/tron-wallet-snap/src/utils/serialization/types.ts diff --git a/merged-packages/tron-wallet-snap/src/utils/tokenToFiat.ts b/packages/tron-wallet-snap/src/utils/tokenToFiat.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/utils/tokenToFiat.ts rename to packages/tron-wallet-snap/src/utils/tokenToFiat.ts diff --git a/merged-packages/tron-wallet-snap/src/validation/keyring-structs.test.ts b/packages/tron-wallet-snap/src/validation/keyring-structs.test.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/validation/keyring-structs.test.ts rename to packages/tron-wallet-snap/src/validation/keyring-structs.test.ts diff --git a/merged-packages/tron-wallet-snap/src/validation/structs.test.ts b/packages/tron-wallet-snap/src/validation/structs.test.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/validation/structs.test.ts rename to packages/tron-wallet-snap/src/validation/structs.test.ts diff --git a/merged-packages/tron-wallet-snap/src/validation/structs.ts b/packages/tron-wallet-snap/src/validation/structs.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/validation/structs.ts rename to packages/tron-wallet-snap/src/validation/structs.ts diff --git a/merged-packages/tron-wallet-snap/src/validation/transaction.test.ts b/packages/tron-wallet-snap/src/validation/transaction.test.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/validation/transaction.test.ts rename to packages/tron-wallet-snap/src/validation/transaction.test.ts diff --git a/merged-packages/tron-wallet-snap/src/validation/transaction.ts b/packages/tron-wallet-snap/src/validation/transaction.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/validation/transaction.ts rename to packages/tron-wallet-snap/src/validation/transaction.ts diff --git a/merged-packages/tron-wallet-snap/src/validation/validators.test.ts b/packages/tron-wallet-snap/src/validation/validators.test.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/validation/validators.test.ts rename to packages/tron-wallet-snap/src/validation/validators.test.ts diff --git a/merged-packages/tron-wallet-snap/src/validation/validators.ts b/packages/tron-wallet-snap/src/validation/validators.ts similarity index 100% rename from merged-packages/tron-wallet-snap/src/validation/validators.ts rename to packages/tron-wallet-snap/src/validation/validators.ts diff --git a/merged-packages/tron-wallet-snap/tsconfig.json b/packages/tron-wallet-snap/tsconfig.json similarity index 100% rename from merged-packages/tron-wallet-snap/tsconfig.json rename to packages/tron-wallet-snap/tsconfig.json diff --git a/yarn.lock b/yarn.lock index cee87eb7..c69f514d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12,6 +12,13 @@ __metadata: languageName: node linkType: hard +"@adraffy/ens-normalize@npm:1.11.1": + version: 1.11.1 + resolution: "@adraffy/ens-normalize@npm:1.11.1" + checksum: 10/dd19274d9fcaf99bf08a62b64e54f4748de11b235767addbd3f7385ae1b7777bd704d17ff003ffaa3295a0b9d035929381cf3b38329c96260bff96aab8ad7b37 + languageName: node + linkType: hard + "@babel/code-frame@npm:^7.0.0, @babel/code-frame@npm:^7.12.13, @babel/code-frame@npm:^7.16.7, @babel/code-frame@npm:^7.27.1, @babel/code-frame@npm:^7.29.7": version: 7.29.7 resolution: "@babel/code-frame@npm:7.29.7" @@ -345,6 +352,15 @@ __metadata: languageName: node linkType: hard +"@babel/runtime@npm:7.26.10": + version: 7.26.10 + resolution: "@babel/runtime@npm:7.26.10" + dependencies: + regenerator-runtime: "npm:^0.14.0" + checksum: 10/9d7ff8e96abe3791047c1138789c742411e3ef19c4d7ca18ce916f83cec92c06ec5dc64401759f6dd1e377cf8a01bbd2c62e033eb7550f435cf6579768d0d4a5 + languageName: node + linkType: hard + "@babel/runtime@npm:^7.28.4, @babel/runtime@npm:^7.9.2": version: 7.29.7 resolution: "@babel/runtime@npm:7.29.7" @@ -1074,6 +1090,44 @@ __metadata: languageName: node linkType: hard +"@inquirer/confirm@npm:^0.0.14-alpha.0": + version: 0.0.14-alpha.0 + resolution: "@inquirer/confirm@npm:0.0.14-alpha.0" + dependencies: + "@inquirer/core": "npm:^0.0.15-alpha.0" + "@inquirer/input": "npm:^0.0.15-alpha.0" + chalk: "npm:^4.1.1" + checksum: 10/a661d37ab86162d0e9533a6d4726fe0d536c4036b3e416dd272a179685407c9ab52a53b72072b3a41bb89573b078352f4f836e4c8a66317c0fc49fc29a83bff9 + languageName: node + linkType: hard + +"@inquirer/core@npm:^0.0.15-alpha.0": + version: 0.0.15-alpha.0 + resolution: "@inquirer/core@npm:0.0.15-alpha.0" + dependencies: + ansi-escapes: "npm:^4.2.1" + chalk: "npm:^4.1.1" + cli-spinners: "npm:^2.6.0" + cli-width: "npm:^3.0.0" + lodash: "npm:^4.17.21" + mute-stream: "npm:^0.0.8" + run-async: "npm:^2.3.0" + string-width: "npm:^4.1.0" + strip-ansi: "npm:^6.0.0" + checksum: 10/04fe0ea3fcbf2f625a0db3ef75e5882a3cf867b77ad3ff84fb8e46d8d94566643c6fdfb2c30848c1d3d946f81cdf07122af1091bb6c443fd31e829bb246bac44 + languageName: node + linkType: hard + +"@inquirer/input@npm:^0.0.15-alpha.0": + version: 0.0.15-alpha.0 + resolution: "@inquirer/input@npm:0.0.15-alpha.0" + dependencies: + "@inquirer/core": "npm:^0.0.15-alpha.0" + chalk: "npm:^4.1.1" + checksum: 10/14345455de7f50aec9c496c3d842ca4d2c49ee8b5684cdfca5c1ddb5e60e5a6b7ff2178ac340666d19a583b01fc880ddc54f947da00a5e6d09ab49dad58f005a + languageName: node + linkType: hard + "@isaacs/cliui@npm:^8.0.2": version: 8.0.2 resolution: "@isaacs/cliui@npm:8.0.2" @@ -1680,6 +1734,21 @@ __metadata: languageName: node linkType: hard +"@metamask/auto-changelog@npm:^3.4.4": + version: 3.4.4 + resolution: "@metamask/auto-changelog@npm:3.4.4" + dependencies: + diff: "npm:^5.0.0" + execa: "npm:^5.1.1" + prettier: "npm:^2.8.8" + semver: "npm:^7.3.5" + yargs: "npm:^17.0.1" + bin: + auto-changelog: dist/cli.js + checksum: 10/70e98529a153ebeab10410dbc3f567014999f77ed82f2b52f1b36501b28a4e3614c809a90c89600a739d7710595bfecc30e2260410e6afac7539f8db65a48f2c + languageName: node + linkType: hard + "@metamask/auto-changelog@npm:^6.1.0, @metamask/auto-changelog@npm:^6.1.1": version: 6.1.1 resolution: "@metamask/auto-changelog@npm:6.1.1" @@ -2026,6 +2095,18 @@ __metadata: languageName: node linkType: hard +"@metamask/keyring-api@npm:^23.2.0": + version: 23.7.0 + resolution: "@metamask/keyring-api@npm:23.7.0" + dependencies: + "@metamask/keyring-utils": "npm:^4.0.0" + "@metamask/superstruct": "npm:^3.4.1" + "@metamask/utils": "npm:^11.11.0" + bitcoin-address-validation: "npm:^2.2.3" + checksum: 10/3c1aea064e017be0b99202a4e59b7ed9e1965aeb732b04ad5cb252dfa6b443487284f8b4253986ca325d8b45fd7977cef93f470f95f0342d377551d4b93738c3 + languageName: node + linkType: hard + "@metamask/keyring-snap-sdk@npm:^8.0.0": version: 8.0.0 resolution: "@metamask/keyring-snap-sdk@npm:8.0.0" @@ -2054,6 +2135,18 @@ __metadata: languageName: node linkType: hard +"@metamask/keyring-utils@npm:^4.0.0": + version: 4.0.0 + resolution: "@metamask/keyring-utils@npm:4.0.0" + dependencies: + "@ethereumjs/tx": "npm:^5.4.0" + "@metamask/superstruct": "npm:^3.4.1" + "@metamask/utils": "npm:^11.11.0" + bitcoin-address-validation: "npm:^2.2.3" + checksum: 10/a4299fafadd4a4f2f1a4475a7f4e6c4d268ccfa82e505cdd4cf4a1ff5cc6ca485edd7422650c498409db93d4fe32429db7bd02276ce6fee80aac5f6a64439578 + languageName: node + linkType: hard + "@metamask/messenger@npm:^1.0.0, @metamask/messenger@npm:^1.1.1, @metamask/messenger@npm:^1.2.0": version: 1.2.0 resolution: "@metamask/messenger@npm:1.2.0" @@ -2507,13 +2600,38 @@ __metadata: languageName: node linkType: hard -"@metamask/superstruct@npm:^3.1.0, @metamask/superstruct@npm:^3.2.1, @metamask/superstruct@npm:^3.3.0": +"@metamask/superstruct@npm:^3.1.0, @metamask/superstruct@npm:^3.2.1, @metamask/superstruct@npm:^3.3.0, @metamask/superstruct@npm:^3.4.1": version: 3.4.1 resolution: "@metamask/superstruct@npm:3.4.1" checksum: 10/d37b5662dc9bbe0d99e06eb951167fa745829ae3abfa103423e9d8c05e8712f1451376f8479d484722e1e1c1d881732da1efddccaca8868b530a786264b903b5 languageName: node linkType: hard +"@metamask/tron-wallet-snap@workspace:packages/tron-wallet-snap": + version: 0.0.0-use.local + resolution: "@metamask/tron-wallet-snap@workspace:packages/tron-wallet-snap" + dependencies: + "@metamask/auto-changelog": "npm:^3.4.4" + "@metamask/key-tree": "npm:^10.1.1" + "@metamask/keyring-api": "npm:^23.2.0" + "@metamask/keyring-snap-sdk": "npm:^8.0.0" + "@metamask/snaps-cli": "npm:^8.3.0" + "@metamask/snaps-jest": "npm:^10.2.0" + "@metamask/snaps-sdk": "npm:^10.3.0" + "@metamask/superstruct": "npm:^3.2.1" + async-mutex: "npm:^0.5.0" + bignumber.js: "npm:^9.3.1" + concurrently: "npm:^9.2.0" + dotenv: "npm:^17.0.0" + ethers: "npm:^6.15.0" + jest: "npm:30.0.3" + jest-it-up: "npm:^2.0.2" + jest-transform-stub: "npm:2.0.0" + oxfmt: "npm:^0.45.0" + tronweb: "patch:tronweb@npm%3A6.1.0#~/.yarn/patches/tronweb-npm-6.1.0-771b242b6a.patch" + languageName: unknown + linkType: soft + "@metamask/utils@npm:^11.0.1, @metamask/utils@npm:^11.1.0, @metamask/utils@npm:^11.10.0, @metamask/utils@npm:^11.11.0, @metamask/utils@npm:^11.4.0, @metamask/utils@npm:^11.4.2, @metamask/utils@npm:^11.8.1, @metamask/utils@npm:^11.9.0": version: 11.11.0 resolution: "@metamask/utils@npm:11.11.0" @@ -4282,7 +4400,14 @@ __metadata: languageName: node linkType: hard -"ansi-escapes@npm:^4.3.2": +"ansi-colors@npm:^4.1.0": + version: 4.1.3 + resolution: "ansi-colors@npm:4.1.3" + checksum: 10/43d6e2fc7b1c6e4dc373de708ee76311ec2e0433e7e8bd3194e7ff123ea6a747428fc61afdcf5969da5be3a5f0fd054602bec56fc0ebe249ce2fcde6e649e3c2 + languageName: node + linkType: hard + +"ansi-escapes@npm:^4.2.1, ansi-escapes@npm:^4.3.2": version: 4.3.2 resolution: "ansi-escapes@npm:4.3.2" dependencies: @@ -4450,6 +4575,13 @@ __metadata: languageName: node linkType: hard +"asynckit@npm:^0.4.0": + version: 0.4.0 + resolution: "asynckit@npm:0.4.0" + checksum: 10/3ce727cbc78f69d6a4722517a58ee926c8c21083633b1d3fdf66fd688f6c127a53a592141bd4866f9b63240a86e9d8e974b13919450bd17fa33c2d22c4558ad8 + languageName: node + linkType: hard + "available-typed-arrays@npm:^1.0.7": version: 1.0.7 resolution: "available-typed-arrays@npm:1.0.7" @@ -4459,6 +4591,17 @@ __metadata: languageName: node linkType: hard +"axios@npm:1.12.2": + version: 1.12.2 + resolution: "axios@npm:1.12.2" + dependencies: + follow-redirects: "npm:^1.15.6" + form-data: "npm:^4.0.4" + proxy-from-env: "npm:^1.1.0" + checksum: 10/886a79770594eaad76493fecf90344b567bd956240609b5dcd09bd0afe8d3e6f1ad6d3257a93a483b6192b409d4b673d9515a34619e3e3ed1b2c0ec2a83b20ba + languageName: node + linkType: hard + "b4a@npm:^1.6.4": version: 1.8.1 resolution: "b4a@npm:1.8.1" @@ -4712,7 +4855,14 @@ __metadata: languageName: node linkType: hard -"bignumber.js@npm:^9.1.2": +"bignumber.js@npm:9.1.2": + version: 9.1.2 + resolution: "bignumber.js@npm:9.1.2" + checksum: 10/d89b8800a987225d2c00dcbf8a69dc08e92aa0880157c851c287b307d31ceb2fc2acb0c62c3e3a3d42b6c5fcae9b004035f13eb4386e56d529d7edac18d5c9d8 + languageName: node + linkType: hard + +"bignumber.js@npm:^9.1.2, bignumber.js@npm:^9.3.1": version: 9.3.1 resolution: "bignumber.js@npm:9.3.1" checksum: 10/1be0372bf0d6d29d0a49b9e6a9cefbd54dad9918232ad21fcd4ec39030260773abf0c76af960c6b3b98d3115a3a71e61c6a111812d1395040a039cfa178e0245 @@ -5230,14 +5380,7 @@ __metadata: languageName: node linkType: hard -"chalk@npm:5.6.2": - version: 5.6.2 - resolution: "chalk@npm:5.6.2" - checksum: 10/1b2f48f6fba1370670d5610f9cd54c391d6ede28f4b7062dd38244ea5768777af72e5be6b74fb6c6d54cb84c4a2dff3f3afa9b7cb5948f7f022cfd3d087989e0 - languageName: node - linkType: hard - -"chalk@npm:^4.0.0, chalk@npm:^4.1.0, chalk@npm:^4.1.2": +"chalk@npm:4.1.2, chalk@npm:^4.0.0, chalk@npm:^4.1.0, chalk@npm:^4.1.1, chalk@npm:^4.1.2": version: 4.1.2 resolution: "chalk@npm:4.1.2" dependencies: @@ -5247,6 +5390,13 @@ __metadata: languageName: node linkType: hard +"chalk@npm:5.6.2": + version: 5.6.2 + resolution: "chalk@npm:5.6.2" + checksum: 10/1b2f48f6fba1370670d5610f9cd54c391d6ede28f4b7062dd38244ea5768777af72e5be6b74fb6c6d54cb84c4a2dff3f3afa9b7cb5948f7f022cfd3d087989e0 + languageName: node + linkType: hard + "char-regex@npm:^1.0.2": version: 1.0.2 resolution: "char-regex@npm:1.0.2" @@ -5332,13 +5482,20 @@ __metadata: languageName: node linkType: hard -"cli-spinners@npm:^2.5.0": +"cli-spinners@npm:^2.5.0, cli-spinners@npm:^2.6.0": version: 2.9.2 resolution: "cli-spinners@npm:2.9.2" checksum: 10/a0a863f442df35ed7294424f5491fa1756bd8d2e4ff0c8736531d886cec0ece4d85e8663b77a5afaf1d296e3cbbebff92e2e99f52bbea89b667cbe789b994794 languageName: node linkType: hard +"cli-width@npm:^3.0.0": + version: 3.0.0 + resolution: "cli-width@npm:3.0.0" + checksum: 10/8730848b04fb189666ab037a35888d191c8f05b630b1d770b0b0e4c920b47bb5cc14bddf6b8ffe5bfc66cee97c8211d4d18e756c1ffcc75d7dbe7e1186cd7826 + languageName: node + linkType: hard + "cliui@npm:^7.0.2": version: 7.0.4 resolution: "cliui@npm:7.0.4" @@ -5434,6 +5591,15 @@ __metadata: languageName: node linkType: hard +"combined-stream@npm:^1.0.8": + version: 1.0.8 + resolution: "combined-stream@npm:1.0.8" + dependencies: + delayed-stream: "npm:~1.0.0" + checksum: 10/2e969e637d05d09fa50b02d74c83a1186f6914aae89e6653b62595cc75a221464f884f55f231b8f4df7a49537fba60bdc0427acd2bf324c09a1dbb84837e36e4 + languageName: node + linkType: hard + "commander@npm:^2.20.0": version: 2.20.3 resolution: "commander@npm:2.20.3" @@ -5448,6 +5614,13 @@ __metadata: languageName: node linkType: hard +"commander@npm:^9.0.0": + version: 9.5.0 + resolution: "commander@npm:9.5.0" + checksum: 10/41c49b3d0f94a1fbeb0463c85b13f15aa15a9e0b4d5e10a49c0a1d58d4489b549d62262b052ae0aa6cfda53299bee487bfe337825df15e342114dde543f82906 + languageName: node + linkType: hard + "comment-json@npm:^4.5.1": version: 4.5.1 resolution: "comment-json@npm:4.5.1" @@ -5502,6 +5675,23 @@ __metadata: languageName: node linkType: hard +"concurrently@npm:^9.2.0": + version: 9.2.4 + resolution: "concurrently@npm:9.2.4" + dependencies: + chalk: "npm:4.1.2" + rxjs: "npm:7.8.2" + shell-quote: "npm:1.9.0" + supports-color: "npm:8.1.1" + tree-kill: "npm:1.2.2" + yargs: "npm:17.7.2" + bin: + conc: dist/bin/concurrently.js + concurrently: dist/bin/concurrently.js + checksum: 10/72354357bb96837bd4d6942682483157981e3599dc2055b402aa7036f2815c44f240a03724bacac71c3a1acc29ace23b4ca1e00e689c62512984ed2cdb263017 + languageName: node + linkType: hard + "console-browserify@npm:^1.2.0": version: 1.2.0 resolution: "console-browserify@npm:1.2.0" @@ -5829,6 +6019,13 @@ __metadata: languageName: node linkType: hard +"delayed-stream@npm:~1.0.0": + version: 1.0.0 + resolution: "delayed-stream@npm:1.0.0" + checksum: 10/46fe6e83e2cb1d85ba50bd52803c68be9bd953282fa7096f51fc29edd5d67ff84ff753c51966061e5ba7cb5e47ef6d36a91924eddb7f3f3483b1c560f77a0020 + languageName: node + linkType: hard + "depcheck@npm:^1.4.7": version: 1.4.7 resolution: "depcheck@npm:1.4.7" @@ -5962,7 +6159,7 @@ __metadata: languageName: node linkType: hard -"dotenv@npm:^17.2.1": +"dotenv@npm:^17.0.0, dotenv@npm:^17.2.1": version: 17.4.2 resolution: "dotenv@npm:17.4.2" checksum: 10/ca1b6f54d58e39914901e1518958e86083aca8deb5aa2e7f2a51acd53291d97852479b0ab26ed949b6a45a0e9adcc7b0d1c3c72375e8ea670f7005e341c6daba @@ -6166,6 +6363,18 @@ __metadata: languageName: node linkType: hard +"es-set-tostringtag@npm:^2.1.0": + version: 2.1.0 + resolution: "es-set-tostringtag@npm:2.1.0" + dependencies: + es-errors: "npm:^1.3.0" + get-intrinsic: "npm:^1.2.6" + has-tostringtag: "npm:^1.0.2" + hasown: "npm:^2.0.2" + checksum: 10/86814bf8afbcd8966653f731415888019d4bc4aca6b6c354132a7a75bb87566751e320369654a101d23a91c87a85c79b178bcf40332839bd347aff437c4fb65f + languageName: node + linkType: hard + "esbuild@npm:~0.25.0": version: 0.25.9 resolution: "esbuild@npm:0.25.9" @@ -6632,7 +6841,7 @@ __metadata: languageName: node linkType: hard -"ethereum-cryptography@npm:^2.0.0, ethereum-cryptography@npm:^2.2.1": +"ethereum-cryptography@npm:2.2.1, ethereum-cryptography@npm:^2.0.0, ethereum-cryptography@npm:^2.2.1": version: 2.2.1 resolution: "ethereum-cryptography@npm:2.2.1" dependencies: @@ -6644,9 +6853,9 @@ __metadata: languageName: node linkType: hard -"ethers@npm:^6.16.0": - version: 6.16.0 - resolution: "ethers@npm:6.16.0" +"ethers@npm:6.13.5": + version: 6.13.5 + resolution: "ethers@npm:6.13.5" dependencies: "@adraffy/ens-normalize": "npm:1.10.1" "@noble/curves": "npm:1.2.0" @@ -6655,7 +6864,22 @@ __metadata: aes-js: "npm:4.0.0-beta.5" tslib: "npm:2.7.0" ws: "npm:8.17.1" - checksum: 10/7e980f0a77963fbe14321a3b9746c3ca3cad44932e28bb3506406a66c4b4d9dc1e60ed68d9d784224e9f2582a53d6a0a2e55a7c9559659681f4ad1f70e00e325 + checksum: 10/ccba21a83679fb6a7c3eb9d187593501565d140064f2db28057a64d6707678bacf2adf4555882c4814688246da73173560df81fd3361fd2f227b5d3c75cb8685 + languageName: node + linkType: hard + +"ethers@npm:^6.15.0, ethers@npm:^6.16.0": + version: 6.17.0 + resolution: "ethers@npm:6.17.0" + dependencies: + "@adraffy/ens-normalize": "npm:1.11.1" + "@noble/curves": "npm:1.2.0" + "@noble/hashes": "npm:1.3.2" + "@types/node": "npm:22.7.5" + aes-js: "npm:4.0.0-beta.5" + tslib: "npm:2.7.0" + ws: "npm:8.21.0" + checksum: 10/bbc5ee1e81f5158bbb500308b8aac1bbe3879bffbb755fdeba01e85d7ed2128eda1b2754e9b7b6258b6337fe575d17a03677ccb3653669300235b5f2d1ced2a7 languageName: node linkType: hard @@ -6666,6 +6890,13 @@ __metadata: languageName: node linkType: hard +"eventemitter3@npm:5.0.1": + version: 5.0.1 + resolution: "eventemitter3@npm:5.0.1" + checksum: 10/ac6423ec31124629c84c7077eed1e6987f6d66c31cf43c6fcbf6c87791d56317ce808d9ead483652436df171b526fc7220eccdc9f3225df334e81582c3cf7dd5 + languageName: node + linkType: hard + "events-universal@npm:^1.0.0": version: 1.0.1 resolution: "events-universal@npm:1.0.1" @@ -7113,6 +7344,16 @@ __metadata: languageName: node linkType: hard +"follow-redirects@npm:^1.15.6": + version: 1.16.0 + resolution: "follow-redirects@npm:1.16.0" + peerDependenciesMeta: + debug: + optional: true + checksum: 10/3fbe3d80b3b544c22705d837aa5d4a0d07a740d913534a2620b0a004c610af4148e3b58723536dd099aaa1c9d3a155964bde9665d6e5cb331460809a1fc572fd + languageName: node + linkType: hard + "for-each@npm:^0.3.5": version: 0.3.5 resolution: "for-each@npm:0.3.5" @@ -7155,6 +7396,19 @@ __metadata: languageName: node linkType: hard +"form-data@npm:^4.0.4": + version: 4.0.6 + resolution: "form-data@npm:4.0.6" + dependencies: + asynckit: "npm:^0.4.0" + combined-stream: "npm:^1.0.8" + es-set-tostringtag: "npm:^2.1.0" + hasown: "npm:^2.0.4" + mime-types: "npm:^2.1.35" + checksum: 10/de6614c8537c92fa5fa3ee7e827758f98f5a9c033f348b7de81855ef36e5cb867e75d9f405d9483ab8d724a4a20d4e79926a299fa8dbba38f530eb659f0884e4 + languageName: node + linkType: hard + "forwarded@npm:0.2.0": version: 0.2.0 resolution: "forwarded@npm:0.2.0" @@ -7273,7 +7527,7 @@ __metadata: languageName: node linkType: hard -"get-intrinsic@npm:^1.2.4, get-intrinsic@npm:^1.2.5, get-intrinsic@npm:^1.3.0": +"get-intrinsic@npm:^1.2.4, get-intrinsic@npm:^1.2.5, get-intrinsic@npm:^1.2.6, get-intrinsic@npm:^1.3.0": version: 1.3.1 resolution: "get-intrinsic@npm:1.3.1" dependencies: @@ -7434,6 +7688,13 @@ __metadata: languageName: node linkType: hard +"google-protobuf@npm:3.21.4": + version: 3.21.4 + resolution: "google-protobuf@npm:3.21.4" + checksum: 10/0d87fe8ef221d105cbaa808f4024bd577638524d8e461469e3733f2e4933391ad4da86b7fcbd11e8781bee04eacf2e8ba19aaacd5f9deb336a220485841d980f + languageName: node + linkType: hard + "gopd@npm:^1.0.1, gopd@npm:^1.2.0": version: 1.2.0 resolution: "gopd@npm:1.2.0" @@ -7550,12 +7811,12 @@ __metadata: languageName: node linkType: hard -"hasown@npm:^2.0.2, hasown@npm:^2.0.3": - version: 2.0.3 - resolution: "hasown@npm:2.0.3" +"hasown@npm:^2.0.2, hasown@npm:^2.0.3, hasown@npm:^2.0.4": + version: 2.0.4 + resolution: "hasown@npm:2.0.4" dependencies: function-bind: "npm:^1.1.2" - checksum: 10/619526379cda755409d856cbf3c65b82ea342151719a0a550920cf7d6a7f58f7cf079e5a78f3acd162324fc784a3d3d6f6f61aff613b47a0163c16fbe09ea89f + checksum: 10/13823863ae48161068b4c51606a3128451c66f14545a5169d667fe9fca168dcd38c27570c7a299e32ef844b8da3d55def7fe88602f8970d4311fb543ee88001a languageName: node linkType: hard @@ -8401,6 +8662,19 @@ __metadata: languageName: node linkType: hard +"jest-it-up@npm:^2.0.2": + version: 2.2.0 + resolution: "jest-it-up@npm:2.2.0" + dependencies: + "@inquirer/confirm": "npm:^0.0.14-alpha.0" + ansi-colors: "npm:^4.1.0" + commander: "npm:^9.0.0" + bin: + jest-it-up: bin/jest-it-up + checksum: 10/f329561bff2b96f2ba7b4a0eb2c565782affb4b2f38e1b1c488b7cc3633be59f79932d4c26b25afeedc196c565e6c45094519051b7da7587a87c3f7ad8b780e2 + languageName: node + linkType: hard + "jest-leak-detector@npm:30.0.2": version: 30.0.2 resolution: "jest-leak-detector@npm:30.0.2" @@ -9340,6 +9614,15 @@ __metadata: languageName: node linkType: hard +"mime-types@npm:^2.1.35, mime-types@npm:~2.1.24, mime-types@npm:~2.1.34": + version: 2.1.35 + resolution: "mime-types@npm:2.1.35" + dependencies: + mime-db: "npm:1.52.0" + checksum: 10/89aa9651b67644035de2784a6e665fc685d79aba61857e02b9c8758da874a754aed4a9aced9265f5ed1171fd934331e5516b84a7f0218031b6fa0270eca1e51a + languageName: node + linkType: hard + "mime-types@npm:^3.0.0, mime-types@npm:^3.0.2": version: 3.0.2 resolution: "mime-types@npm:3.0.2" @@ -9349,15 +9632,6 @@ __metadata: languageName: node linkType: hard -"mime-types@npm:~2.1.24, mime-types@npm:~2.1.34": - version: 2.1.35 - resolution: "mime-types@npm:2.1.35" - dependencies: - mime-db: "npm:1.52.0" - checksum: 10/89aa9651b67644035de2784a6e665fc685d79aba61857e02b9c8758da874a754aed4a9aced9265f5ed1171fd934331e5516b84a7f0218031b6fa0270eca1e51a - languageName: node - linkType: hard - "mime@npm:1.6.0": version: 1.6.0 resolution: "mime@npm:1.6.0" @@ -9565,6 +9839,13 @@ __metadata: languageName: node linkType: hard +"mute-stream@npm:^0.0.8": + version: 0.0.8 + resolution: "mute-stream@npm:0.0.8" + checksum: 10/a2d2e79dde87e3424ffc8c334472c7f3d17b072137734ca46e6f221131f1b014201cc593b69a38062e974fb2394d3d1cb4349f80f012bbf8b8ac1b28033e515f + languageName: node + linkType: hard + "nan@npm:^2.14.0": version: 2.28.0 resolution: "nan@npm:2.28.0" @@ -10298,7 +10579,7 @@ __metadata: languageName: node linkType: hard -"prettier-2@npm:prettier@^2.8.8": +"prettier-2@npm:prettier@^2.8.8, prettier@npm:^2.8.8": version: 2.8.8 resolution: "prettier@npm:2.8.8" bin: @@ -10414,6 +10695,13 @@ __metadata: languageName: node linkType: hard +"proxy-from-env@npm:^1.1.0": + version: 1.1.0 + resolution: "proxy-from-env@npm:1.1.0" + checksum: 10/f0bb4a87cfd18f77bc2fba23ae49c3b378fb35143af16cc478171c623eebe181678f09439707ad80081d340d1593cd54a33a0113f3ccb3f4bc9451488780ee23 + languageName: node + linkType: hard + "public-encrypt@npm:^4.0.3": version: 4.0.3 resolution: "public-encrypt@npm:4.0.3" @@ -10642,6 +10930,13 @@ __metadata: languageName: node linkType: hard +"regenerator-runtime@npm:^0.14.0": + version: 0.14.1 + resolution: "regenerator-runtime@npm:0.14.1" + checksum: 10/5db3161abb311eef8c45bcf6565f4f378f785900ed3945acf740a9888c792f75b98ecb77f0775f3bf95502ff423529d23e94f41d80c8256e8fa05ed4b07cf471 + languageName: node + linkType: hard + "require-directory@npm:^2.1.1": version: 2.1.1 resolution: "require-directory@npm:2.1.1" @@ -10846,6 +11141,13 @@ __metadata: languageName: node linkType: hard +"run-async@npm:^2.3.0": + version: 2.4.1 + resolution: "run-async@npm:2.4.1" + checksum: 10/c79551224dafa26ecc281cb1efad3510c82c79116aaf681f8a931ce70fdf4ca880d58f97d3b930a38992c7aad7955a08e065b32ec194e1dd49d7790c874ece50 + languageName: node + linkType: hard + "run-parallel@npm:^1.1.9": version: 1.2.0 resolution: "run-parallel@npm:1.2.0" @@ -10955,6 +11257,15 @@ __metadata: languageName: node linkType: hard +"semver@npm:7.7.1": + version: 7.7.1 + resolution: "semver@npm:7.7.1" + bin: + semver: bin/semver.js + checksum: 10/4cfa1eb91ef3751e20fc52e47a935a0118d56d6f15a837ab814da0c150778ba2ca4f1a4d9068b33070ea4273629e615066664c2cfcd7c272caf7a8a0f6518b2c + languageName: node + linkType: hard + "semver@npm:^6.3.0, semver@npm:^6.3.1": version: 6.3.1 resolution: "semver@npm:6.3.1" @@ -11128,6 +11439,13 @@ __metadata: languageName: node linkType: hard +"shell-quote@npm:1.9.0": + version: 1.9.0 + resolution: "shell-quote@npm:1.9.0" + checksum: 10/c3bc91e74a469c4f96b6fd13b0c777fff16bcbda202692a4e5402d3d6b78fc6e02fe92fdf8dc0bddf992a9c6758e43207bfc5bdbefbf8a58190b1c885cbcc171 + languageName: node + linkType: hard + "side-channel-list@npm:^1.0.0": version: 1.0.1 resolution: "side-channel-list@npm:1.0.1" @@ -11546,21 +11864,21 @@ __metadata: languageName: node linkType: hard -"supports-color@npm:^7.1.0": - version: 7.2.0 - resolution: "supports-color@npm:7.2.0" +"supports-color@npm:8.1.1, supports-color@npm:^8.0.0, supports-color@npm:^8.1.1": + version: 8.1.1 + resolution: "supports-color@npm:8.1.1" dependencies: has-flag: "npm:^4.0.0" - checksum: 10/c8bb7afd564e3b26b50ca6ee47572c217526a1389fe018d00345856d4a9b08ffbd61fadaf283a87368d94c3dcdb8f5ffe2650a5a65863e21ad2730ca0f05210a + checksum: 10/157b534df88e39c5518c5e78c35580c1eca848d7dbaf31bbe06cdfc048e22c7ff1a9d046ae17b25691128f631a51d9ec373c1b740c12ae4f0de6e292037e4282 languageName: node linkType: hard -"supports-color@npm:^8.0.0, supports-color@npm:^8.1.1": - version: 8.1.1 - resolution: "supports-color@npm:8.1.1" +"supports-color@npm:^7.1.0": + version: 7.2.0 + resolution: "supports-color@npm:7.2.0" dependencies: has-flag: "npm:^4.0.0" - checksum: 10/157b534df88e39c5518c5e78c35580c1eca848d7dbaf31bbe06cdfc048e22c7ff1a9d046ae17b25691128f631a51d9ec373c1b740c12ae4f0de6e292037e4282 + checksum: 10/c8bb7afd564e3b26b50ca6ee47572c217526a1389fe018d00345856d4a9b08ffbd61fadaf283a87368d94c3dcdb8f5ffe2650a5a65863e21ad2730ca0f05210a languageName: node linkType: hard @@ -11800,6 +12118,40 @@ __metadata: languageName: node linkType: hard +"tronweb@npm:6.1.0": + version: 6.1.0 + resolution: "tronweb@npm:6.1.0" + dependencies: + "@babel/runtime": "npm:7.26.10" + axios: "npm:1.12.2" + bignumber.js: "npm:9.1.2" + ethereum-cryptography: "npm:2.2.1" + ethers: "npm:6.13.5" + eventemitter3: "npm:5.0.1" + google-protobuf: "npm:3.21.4" + semver: "npm:7.7.1" + validator: "npm:13.15.20" + checksum: 10/25743fd58d832f80fff3eee378eb29a3bfb039354ba8c6ebd6298d9de3ccd909e88a049cff7b629720f49dc38fd695b1eb8ff392526e576d10ecf956c2f174e4 + languageName: node + linkType: hard + +"tronweb@patch:tronweb@npm%3A6.1.0#~/.yarn/patches/tronweb-npm-6.1.0-771b242b6a.patch": + version: 6.1.0 + resolution: "tronweb@patch:tronweb@npm%3A6.1.0#~/.yarn/patches/tronweb-npm-6.1.0-771b242b6a.patch::version=6.1.0&hash=9e36cd" + dependencies: + "@babel/runtime": "npm:7.26.10" + axios: "npm:1.12.2" + bignumber.js: "npm:9.1.2" + ethereum-cryptography: "npm:2.2.1" + ethers: "npm:6.13.5" + eventemitter3: "npm:5.0.1" + google-protobuf: "npm:3.21.4" + semver: "npm:7.7.1" + validator: "npm:13.15.20" + checksum: 10/d24b69b7576d8cb569ac6bae94e8b491db678d199e005f2499c6cab0e2ed4405272d58e8032481d1b6aa384b0840733bd15e440e1ddc00bf3a0187b15d1f08f1 + languageName: node + linkType: hard + "ts-api-utils@npm:^2.4.0": version: 2.4.0 resolution: "ts-api-utils@npm:2.4.0" @@ -12262,6 +12614,13 @@ __metadata: languageName: node linkType: hard +"validator@npm:13.15.20": + version: 13.15.20 + resolution: "validator@npm:13.15.20" + checksum: 10/498f9b201dda7b09207bbc13606e6f90595987eab9e3a60fc5b8d8d96141c9351192aea56d392c78640e2462770eedccf545cf13b2ef43e87d73a755ba485c5d + languageName: node + linkType: hard + "varuint-bitcoin@npm:^1.0.1, varuint-bitcoin@npm:^1.1.2": version: 1.1.2 resolution: "varuint-bitcoin@npm:1.1.2" @@ -12593,6 +12952,21 @@ __metadata: languageName: node linkType: hard +"ws@npm:8.21.0": + version: 8.21.0 + resolution: "ws@npm:8.21.0" + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: ">=5.0.2" + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + checksum: 10/088411956432c8f876158409d5a285cb9ad1382f593391f51d3a599bd0a5b277f876609ebd00fc3596321c4a4c9064d6fffe1ebad960e8ea7fd9ae25324f35c2 + languageName: node + linkType: hard + "ws@npm:^7.3.1": version: 7.5.11 resolution: "ws@npm:7.5.11" From 3388de7faf894a9772ad3a5f213bb247a33382b6 Mon Sep 17 00:00:00 2001 From: Andrew Taran Date: Mon, 27 Jul 2026 16:25:15 +0200 Subject: [PATCH 2/4] chore: yarn constraints fixes --- packages/bitcoin-wallet-snap/package.json | 6 +- packages/sample-snap/package.json | 4 +- packages/tron-wallet-snap/package.json | 24 ++-- .../package-template/package.json | 4 +- yarn.lock | 107 +++++------------- 5 files changed, 52 insertions(+), 93 deletions(-) diff --git a/packages/bitcoin-wallet-snap/package.json b/packages/bitcoin-wallet-snap/package.json index 36ee9d29..fcab28c1 100644 --- a/packages/bitcoin-wallet-snap/package.json +++ b/packages/bitcoin-wallet-snap/package.json @@ -49,15 +49,15 @@ }, "devDependencies": { "@jest/globals": "^29.5.0", - "@metamask/auto-changelog": "^6.1.0", + "@metamask/auto-changelog": "^6.1.1", "@metamask/bitcoindevkit": "^0.1.13", "@metamask/key-tree": "^10.1.1", - "@metamask/keyring-api": "^22.0.0", + "@metamask/keyring-api": "^23.2.0", "@metamask/keyring-snap-sdk": "^8.0.0", "@metamask/slip44": "^4.2.0", "@metamask/snaps-cli": "^8.3.0", "@metamask/snaps-jest": "^10.2.0", - "@metamask/snaps-sdk": "^11.0.0", + "@metamask/snaps-sdk": "11.1.1", "@metamask/utils": "^11.9.0", "bip322-js": "^3.0.0", "concurrently": "^10.0.3", diff --git a/packages/sample-snap/package.json b/packages/sample-snap/package.json index 1f9a25cb..be750b59 100644 --- a/packages/sample-snap/package.json +++ b/packages/sample-snap/package.json @@ -41,10 +41,10 @@ }, "devDependencies": { "@jest/globals": "^29.5.0", - "@metamask/auto-changelog": "^6.1.0", + "@metamask/auto-changelog": "^6.1.1", "@metamask/snaps-cli": "^8.3.0", "@metamask/snaps-jest": "^10.2.0", - "@metamask/snaps-sdk": "^11.0.0", + "@metamask/snaps-sdk": "11.1.1", "@types/react": "18.2.4", "@types/react-dom": "18.2.4", "eslint": "^9.39.1", diff --git a/packages/tron-wallet-snap/package.json b/packages/tron-wallet-snap/package.json index 60161ad6..c988fac0 100644 --- a/packages/tron-wallet-snap/package.json +++ b/packages/tron-wallet-snap/package.json @@ -1,7 +1,7 @@ { "name": "@metamask/tron-wallet-snap", "version": "1.33.1", - "description": "A Tron wallet Snap.", + "description": "A Tron wallet Snap", "repository": { "type": "git", "url": "https://github.com/MetaMask/internal-snaps.git" @@ -34,22 +34,25 @@ "publish:preview": "yarn npm publish --tag preview", "serve": "mm-snap serve", "start": "node scripts/update-manifest-local.js && concurrently \"mm-snap watch\" \"yarn build:locale:watch\"", - "test": "jest && yarn jest-it-up", - "test:integration": "./integration-test/run-integration.sh" + "test": "NODE_OPTIONS=--experimental-vm-modules jest --reporters=jest-silent-reporter", + "test:integration": "./integration-test/run-integration.sh", + "test:clean": "NODE_OPTIONS=--experimental-vm-modules jest --clearCache", + "test:verbose": "NODE_OPTIONS=--experimental-vm-modules jest --verbose", + "test:watch": "NODE_OPTIONS=--experimental-vm-modules jest --watch" }, "devDependencies": { - "@metamask/auto-changelog": "^3.4.4", + "@metamask/auto-changelog": "^6.1.1", "@metamask/key-tree": "^10.1.1", "@metamask/keyring-api": "^23.2.0", "@metamask/keyring-snap-sdk": "^8.0.0", "@metamask/snaps-cli": "^8.3.0", "@metamask/snaps-jest": "^10.2.0", - "@metamask/snaps-sdk": "^10.3.0", + "@metamask/snaps-sdk": "11.1.1", "@metamask/superstruct": "^3.2.1", "async-mutex": "^0.5.0", "bignumber.js": "^9.3.1", - "concurrently": "^9.2.0", - "dotenv": "^17.0.0", + "concurrently": "^10.0.3", + "dotenv": "^17.2.1", "ethers": "^6.15.0", "jest": "30.0.3", "jest-it-up": "^2.0.2", @@ -60,5 +63,12 @@ "publishConfig": { "access": "public", "registry": "https://registry.npmjs.org/" + }, + "keywords": [ + "Ethereum", + "MetaMask" + ], + "engines": { + "node": ">=20" } } diff --git a/scripts/create-package/package-template/package.json b/scripts/create-package/package-template/package.json index bc198dbe..a3a721a3 100644 --- a/scripts/create-package/package-template/package.json +++ b/scripts/create-package/package-template/package.json @@ -51,7 +51,7 @@ "test:watch": "NODE_OPTIONS=--experimental-vm-modules jest --watch" }, "devDependencies": { - "@metamask/auto-changelog": "^6.1.0", + "@metamask/auto-changelog": "^6.1.1", "@ts-bridge/cli": "^0.6.4", "@types/jest": "^29.5.14", "deepmerge": "^4.2.2", @@ -65,4 +65,4 @@ "engines": { "node": "NODE_VERSIONS" } -} +} \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index c69f514d..39f6dbc6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1734,22 +1734,7 @@ __metadata: languageName: node linkType: hard -"@metamask/auto-changelog@npm:^3.4.4": - version: 3.4.4 - resolution: "@metamask/auto-changelog@npm:3.4.4" - dependencies: - diff: "npm:^5.0.0" - execa: "npm:^5.1.1" - prettier: "npm:^2.8.8" - semver: "npm:^7.3.5" - yargs: "npm:^17.0.1" - bin: - auto-changelog: dist/cli.js - checksum: 10/70e98529a153ebeab10410dbc3f567014999f77ed82f2b52f1b36501b28a4e3614c809a90c89600a739d7710595bfecc30e2260410e6afac7539f8db65a48f2c - languageName: node - linkType: hard - -"@metamask/auto-changelog@npm:^6.1.0, @metamask/auto-changelog@npm:^6.1.1": +"@metamask/auto-changelog@npm:^6.1.1": version: 6.1.1 resolution: "@metamask/auto-changelog@npm:6.1.1" dependencies: @@ -1788,15 +1773,15 @@ __metadata: resolution: "@metamask/bitcoin-wallet-snap@workspace:packages/bitcoin-wallet-snap" dependencies: "@jest/globals": "npm:^29.5.0" - "@metamask/auto-changelog": "npm:^6.1.0" + "@metamask/auto-changelog": "npm:^6.1.1" "@metamask/bitcoindevkit": "npm:^0.1.13" "@metamask/key-tree": "npm:^10.1.1" - "@metamask/keyring-api": "npm:^22.0.0" + "@metamask/keyring-api": "npm:^23.2.0" "@metamask/keyring-snap-sdk": "npm:^8.0.0" "@metamask/slip44": "npm:^4.2.0" "@metamask/snaps-cli": "npm:^8.3.0" "@metamask/snaps-jest": "npm:^10.2.0" - "@metamask/snaps-sdk": "npm:^11.0.0" + "@metamask/snaps-sdk": "npm:11.1.1" "@metamask/utils": "npm:^11.9.0" bip322-js: "npm:^3.0.0" concurrently: "npm:^10.0.3" @@ -2083,18 +2068,6 @@ __metadata: languageName: node linkType: hard -"@metamask/keyring-api@npm:^22.0.0": - version: 22.0.0 - resolution: "@metamask/keyring-api@npm:22.0.0" - dependencies: - "@metamask/keyring-utils": "npm:^3.2.0" - "@metamask/superstruct": "npm:^3.1.0" - "@metamask/utils": "npm:^11.1.0" - bitcoin-address-validation: "npm:^2.2.3" - checksum: 10/ff1e9537c7219fb906b61d6755de28890239ec44f634732bd8571801c662e8b801671e98961a1c5047e079cef314353297499a52f7091a2b5391325d575ec4f9 - languageName: node - linkType: hard - "@metamask/keyring-api@npm:^23.2.0": version: 23.7.0 resolution: "@metamask/keyring-api@npm:23.7.0" @@ -2283,10 +2256,10 @@ __metadata: resolution: "@metamask/sample-snap@workspace:packages/sample-snap" dependencies: "@jest/globals": "npm:^29.5.0" - "@metamask/auto-changelog": "npm:^6.1.0" + "@metamask/auto-changelog": "npm:^6.1.1" "@metamask/snaps-cli": "npm:^8.3.0" "@metamask/snaps-jest": "npm:^10.2.0" - "@metamask/snaps-sdk": "npm:^11.0.0" + "@metamask/snaps-sdk": "npm:11.1.1" "@types/react": "npm:18.2.4" "@types/react-dom": "npm:18.2.4" eslint: "npm:^9.39.1" @@ -2611,18 +2584,18 @@ __metadata: version: 0.0.0-use.local resolution: "@metamask/tron-wallet-snap@workspace:packages/tron-wallet-snap" dependencies: - "@metamask/auto-changelog": "npm:^3.4.4" + "@metamask/auto-changelog": "npm:^6.1.1" "@metamask/key-tree": "npm:^10.1.1" "@metamask/keyring-api": "npm:^23.2.0" "@metamask/keyring-snap-sdk": "npm:^8.0.0" "@metamask/snaps-cli": "npm:^8.3.0" "@metamask/snaps-jest": "npm:^10.2.0" - "@metamask/snaps-sdk": "npm:^10.3.0" + "@metamask/snaps-sdk": "npm:11.1.1" "@metamask/superstruct": "npm:^3.2.1" async-mutex: "npm:^0.5.0" bignumber.js: "npm:^9.3.1" - concurrently: "npm:^9.2.0" - dotenv: "npm:^17.0.0" + concurrently: "npm:^10.0.3" + dotenv: "npm:^17.2.1" ethers: "npm:^6.15.0" jest: "npm:30.0.3" jest-it-up: "npm:^2.0.2" @@ -5380,7 +5353,14 @@ __metadata: languageName: node linkType: hard -"chalk@npm:4.1.2, chalk@npm:^4.0.0, chalk@npm:^4.1.0, chalk@npm:^4.1.1, chalk@npm:^4.1.2": +"chalk@npm:5.6.2": + version: 5.6.2 + resolution: "chalk@npm:5.6.2" + checksum: 10/1b2f48f6fba1370670d5610f9cd54c391d6ede28f4b7062dd38244ea5768777af72e5be6b74fb6c6d54cb84c4a2dff3f3afa9b7cb5948f7f022cfd3d087989e0 + languageName: node + linkType: hard + +"chalk@npm:^4.0.0, chalk@npm:^4.1.0, chalk@npm:^4.1.1, chalk@npm:^4.1.2": version: 4.1.2 resolution: "chalk@npm:4.1.2" dependencies: @@ -5390,13 +5370,6 @@ __metadata: languageName: node linkType: hard -"chalk@npm:5.6.2": - version: 5.6.2 - resolution: "chalk@npm:5.6.2" - checksum: 10/1b2f48f6fba1370670d5610f9cd54c391d6ede28f4b7062dd38244ea5768777af72e5be6b74fb6c6d54cb84c4a2dff3f3afa9b7cb5948f7f022cfd3d087989e0 - languageName: node - linkType: hard - "char-regex@npm:^1.0.2": version: 1.0.2 resolution: "char-regex@npm:1.0.2" @@ -5675,23 +5648,6 @@ __metadata: languageName: node linkType: hard -"concurrently@npm:^9.2.0": - version: 9.2.4 - resolution: "concurrently@npm:9.2.4" - dependencies: - chalk: "npm:4.1.2" - rxjs: "npm:7.8.2" - shell-quote: "npm:1.9.0" - supports-color: "npm:8.1.1" - tree-kill: "npm:1.2.2" - yargs: "npm:17.7.2" - bin: - conc: dist/bin/concurrently.js - concurrently: dist/bin/concurrently.js - checksum: 10/72354357bb96837bd4d6942682483157981e3599dc2055b402aa7036f2815c44f240a03724bacac71c3a1acc29ace23b4ca1e00e689c62512984ed2cdb263017 - languageName: node - linkType: hard - "console-browserify@npm:^1.2.0": version: 1.2.0 resolution: "console-browserify@npm:1.2.0" @@ -6159,7 +6115,7 @@ __metadata: languageName: node linkType: hard -"dotenv@npm:^17.0.0, dotenv@npm:^17.2.1": +"dotenv@npm:^17.2.1": version: 17.4.2 resolution: "dotenv@npm:17.4.2" checksum: 10/ca1b6f54d58e39914901e1518958e86083aca8deb5aa2e7f2a51acd53291d97852479b0ab26ed949b6a45a0e9adcc7b0d1c3c72375e8ea670f7005e341c6daba @@ -10579,7 +10535,7 @@ __metadata: languageName: node linkType: hard -"prettier-2@npm:prettier@^2.8.8, prettier@npm:^2.8.8": +"prettier-2@npm:prettier@^2.8.8": version: 2.8.8 resolution: "prettier@npm:2.8.8" bin: @@ -11439,13 +11395,6 @@ __metadata: languageName: node linkType: hard -"shell-quote@npm:1.9.0": - version: 1.9.0 - resolution: "shell-quote@npm:1.9.0" - checksum: 10/c3bc91e74a469c4f96b6fd13b0c777fff16bcbda202692a4e5402d3d6b78fc6e02fe92fdf8dc0bddf992a9c6758e43207bfc5bdbefbf8a58190b1c885cbcc171 - languageName: node - linkType: hard - "side-channel-list@npm:^1.0.0": version: 1.0.1 resolution: "side-channel-list@npm:1.0.1" @@ -11864,21 +11813,21 @@ __metadata: languageName: node linkType: hard -"supports-color@npm:8.1.1, supports-color@npm:^8.0.0, supports-color@npm:^8.1.1": - version: 8.1.1 - resolution: "supports-color@npm:8.1.1" +"supports-color@npm:^7.1.0": + version: 7.2.0 + resolution: "supports-color@npm:7.2.0" dependencies: has-flag: "npm:^4.0.0" - checksum: 10/157b534df88e39c5518c5e78c35580c1eca848d7dbaf31bbe06cdfc048e22c7ff1a9d046ae17b25691128f631a51d9ec373c1b740c12ae4f0de6e292037e4282 + checksum: 10/c8bb7afd564e3b26b50ca6ee47572c217526a1389fe018d00345856d4a9b08ffbd61fadaf283a87368d94c3dcdb8f5ffe2650a5a65863e21ad2730ca0f05210a languageName: node linkType: hard -"supports-color@npm:^7.1.0": - version: 7.2.0 - resolution: "supports-color@npm:7.2.0" +"supports-color@npm:^8.0.0, supports-color@npm:^8.1.1": + version: 8.1.1 + resolution: "supports-color@npm:8.1.1" dependencies: has-flag: "npm:^4.0.0" - checksum: 10/c8bb7afd564e3b26b50ca6ee47572c217526a1389fe018d00345856d4a9b08ffbd61fadaf283a87368d94c3dcdb8f5ffe2650a5a65863e21ad2730ca0f05210a + checksum: 10/157b534df88e39c5518c5e78c35580c1eca848d7dbaf31bbe06cdfc048e22c7ff1a9d046ae17b25691128f631a51d9ec373c1b740c12ae4f0de6e292037e4282 languageName: node linkType: hard From 4df9f0730bf5dedd63289a34367ae33c36a30c0c Mon Sep 17 00:00:00 2001 From: Andrew Taran Date: Mon, 27 Jul 2026 16:56:30 +0200 Subject: [PATCH 3/4] chore: fix eslint errors, yarn constraints --- .github/CODEOWNERS | 1 + .gitignore | 4 + README.md | 1 + eslint-suppressions.json | 380 ++++++++++++++++++ .../bitcoin-wallet-snap/snap.manifest.json | 2 +- packages/tron-wallet-snap/jest.config.mjs | 6 +- packages/tron-wallet-snap/package.json | 30 +- .../scripts/build-preinstalled-snap.js | 1 + .../scripts/update-manifest-local.js | 26 +- packages/tron-wallet-snap/snap.manifest.json | 6 +- .../src/caching/InMemoryCache.ts | 4 +- .../src/caching/StateCache.test.ts | 4 +- .../src/caching/StateCache.ts | 4 +- .../src/caching/useCache.test.ts | 5 +- .../tron-wallet-snap/src/caching/useCache.ts | 2 +- .../src/caching/useCacheUntil.test.ts | 9 +- .../src/caching/useCacheUntil.ts | 2 +- .../clients/price-api/PriceApiClient.test.ts | 8 +- .../src/clients/price-api/PriceApiClient.ts | 18 +- .../SecurityAlertsApiClient.ts | 11 +- .../clients/security-alerts-api/structs.ts | 1 - .../clients/security-alerts-api/utils.test.ts | 3 +- .../src/clients/security-alerts-api/utils.ts | 1 - .../src/clients/snap/SnapClient.test.ts | 2 +- .../src/clients/snap/SnapClient.ts | 20 +- .../clients/token-api/TokenApiClient.test.ts | 2 +- .../src/clients/token-api/TokenApiClient.ts | 5 +- .../src/clients/tron-http/TronHttpClient.ts | 8 +- .../src/clients/tron-http/structs.ts | 1 - .../trongrid/TrongridApiClient.test.ts | 51 +-- .../src/clients/trongrid/TrongridApiClient.ts | 20 +- .../src/clients/trongrid/structs.ts | 2 - .../clientRequest/clientRequest.test.ts | 89 ++-- .../handlers/clientRequest/clientRequest.ts | 50 ++- .../src/handlers/clientRequest/validation.ts | 2 +- .../src/handlers/cronjob.test.tsx | 45 +-- .../tron-wallet-snap/src/handlers/cronjob.tsx | 12 +- .../src/handlers/keyring.test.ts | 12 +- .../tron-wallet-snap/src/handlers/keyring.ts | 42 +- .../src/handlers/userInput.ts | 3 +- .../accounts/AccountsRepository.test.ts | 2 +- .../services/accounts/AccountsService.test.ts | 4 +- .../src/services/accounts/AccountsService.ts | 13 +- .../services/assets/AssetsRepository.test.ts | 4 +- .../src/services/assets/AssetsRepository.ts | 3 +- .../src/services/assets/AssetsService.test.ts | 20 +- .../src/services/assets/AssetsService.ts | 35 +- .../src/services/assets/types.ts | 5 +- .../confirmation/ConfirmationHandler.test.ts | 16 +- .../confirmation/ConfirmationHandler.ts | 15 +- .../send/FeeCalculatorService.test.ts | 5 +- .../src/services/send/FeeCalculatorService.ts | 6 +- .../src/services/send/SendService.test.ts | 2 +- .../src/services/send/SendService.ts | 7 +- ...nsactionExpirationRefresherService.test.ts | 1 - .../services/staking/StakingService.test.ts | 11 +- .../src/services/state/InMemoryState.ts | 2 +- .../src/services/state/State.test.ts | 2 +- .../src/services/state/State.ts | 2 +- .../TransactionExpirationRefresherService.ts | 5 +- .../TransactionScanService.test.ts | 87 ++-- .../TransactionScanService.ts | 15 +- .../buildExpiredScanResult.ts | 3 +- .../TransactionsRepository.test.ts | 2 +- .../transactions/TransactionsService.test.ts | 6 +- .../transactions/TransactionsService.ts | 12 +- .../transactions/trc20LogParser.test.ts | 11 +- .../services/transactions/trc20LogParser.ts | 5 +- .../transactions/utils/isSpam.test.ts | 2 +- .../src/services/wallet/WalletService.test.ts | 27 +- .../src/services/wallet/WalletService.ts | 7 +- .../confirmation/components/Asset/Asset.tsx | 1 - .../EstimatedChanges/EstimatedChanges.tsx | 3 +- .../src/ui/confirmation/components/Fees.tsx | 13 +- .../TransactionAlert.test.tsx | 7 +- .../TransactionAlert/TransactionAlert.tsx | 7 +- .../TransactionAlert/getErrorMessage.test.ts | 2 +- .../ConfirmSignMessage/ConfirmSignMessage.tsx | 5 +- .../views/ConfirmSignMessage/render.test.tsx | 2 +- .../views/ConfirmSignMessage/render.tsx | 2 +- .../ConfirmSignTransaction.test.tsx | 17 +- .../ConfirmSignTransaction.tsx | 4 +- .../ConfirmSignTransaction/render.test.tsx | 17 +- .../views/ConfirmSignTransaction/render.tsx | 10 +- .../ConfirmTransactionRequest.test.tsx | 11 +- .../ConfirmTransactionRequest.tsx | 4 +- .../ConfirmTransactionRequest/render.test.tsx | 13 +- .../ConfirmTransactionRequest/render.tsx | 8 +- .../tron-wallet-snap/src/utils/buildUrl.ts | 2 +- .../utils/deriveTronFromCoinTypeNode.test.ts | 4 +- .../src/utils/deriveTronFromCoinTypeNode.ts | 7 +- packages/tron-wallet-snap/src/utils/errors.ts | 2 +- .../src/utils/getExplorerUrl.test.ts | 5 +- .../utils/serialization/deserialize.test.ts | 2 +- .../src/utils/serialization/serialize.test.ts | 1 - .../src/utils/serialization/serialize.ts | 1 - .../src/validation/keyring-structs.test.ts | 2 +- .../src/validation/transaction.test.ts | 1 - .../src/validation/transaction.ts | 2 +- .../package-template/package.json | 2 +- yarn.lock | 1 + 101 files changed, 847 insertions(+), 543 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 4311fff7..67ddf232 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -7,3 +7,4 @@ * @MetaMask/core-platform @MetaMask/networks packages/bitcoin-wallet-snap @MetaMask/networks +packages/tron-wallet-snap @MetaMask/networks diff --git a/.gitignore b/.gitignore index 2463095c..7cad5a8e 100644 --- a/.gitignore +++ b/.gitignore @@ -42,3 +42,7 @@ packages/*/*.tsbuildinfo # Docusaurus **/.docusaurus packages/wallet-framework-docs/site/build + +# Dotenv environment variables file +.env +.env.test diff --git a/README.md b/README.md index ca2aea75..21df5b4e 100644 --- a/README.md +++ b/README.md @@ -21,5 +21,6 @@ Each snap in this repository has its own README with installation and usage inst - [`@metamask/bitcoin-wallet-snap`](packages/bitcoin-wallet-snap) +- [`@metamask/tron-wallet-snap`](packages/tron-wallet-snap) diff --git a/eslint-suppressions.json b/eslint-suppressions.json index e2ef581c..3e958920 100644 --- a/eslint-suppressions.json +++ b/eslint-suppressions.json @@ -132,5 +132,385 @@ "@typescript-eslint/no-explicit-any": { "count": 5 } + }, + "packages/tron-wallet-snap/scripts/build-preinstalled-snap.js": { + "n/no-sync": { + "count": 2 + } + }, + "packages/tron-wallet-snap/scripts/populate-en-locale.js": { + "n/no-sync": { + "count": 1 + } + }, + "packages/tron-wallet-snap/scripts/update-manifest-local.js": { + "n/no-process-env": { + "count": 1 + }, + "n/no-sync": { + "count": 2 + } + }, + "packages/tron-wallet-snap/snap.config.ts": { + "import-x/no-nodejs-modules": { + "count": 1 + }, + "no-restricted-globals": { + "count": 20 + } + }, + "packages/tron-wallet-snap/src/caching/InMemoryCache.ts": { + "import-x/no-extraneous-dependencies": { + "count": 1 + } + }, + "packages/tron-wallet-snap/src/caching/StateCache.ts": { + "import-x/no-extraneous-dependencies": { + "count": 1 + }, + "no-restricted-syntax": { + "count": 1 + } + }, + "packages/tron-wallet-snap/src/caching/useCache.test.ts": { + "@typescript-eslint/explicit-function-return-type": { + "count": 4 + } + }, + "packages/tron-wallet-snap/src/caching/useCacheUntil.test.ts": { + "@typescript-eslint/explicit-function-return-type": { + "count": 2 + } + }, + "packages/tron-wallet-snap/src/clients/price-api/PriceApiClient.test.ts": { + "import-x/no-extraneous-dependencies": { + "count": 1 + }, + "n/no-extraneous-import": { + "count": 1 + } + }, + "packages/tron-wallet-snap/src/clients/price-api/PriceApiClient.ts": { + "import-x/no-extraneous-dependencies": { + "count": 2 + } + }, + "packages/tron-wallet-snap/src/clients/price-api/structs.test.ts": { + "import-x/no-extraneous-dependencies": { + "count": 1 + }, + "n/no-extraneous-import": { + "count": 1 + } + }, + "packages/tron-wallet-snap/src/clients/price-api/types.ts": { + "import-x/no-extraneous-dependencies": { + "count": 1 + } + }, + "packages/tron-wallet-snap/src/clients/security-alerts-api/utils.ts": { + "import-x/no-extraneous-dependencies": { + "count": 1 + }, + "no-restricted-syntax": { + "count": 5 + } + }, + "packages/tron-wallet-snap/src/clients/snap/SnapClient.test.ts": { + "@typescript-eslint/explicit-function-return-type": { + "count": 1 + }, + "@typescript-eslint/no-explicit-any": { + "count": 1 + } + }, + "packages/tron-wallet-snap/src/clients/token-api/TokenApiClient.ts": { + "import-x/no-extraneous-dependencies": { + "count": 1 + } + }, + "packages/tron-wallet-snap/src/clients/trongrid/TrongridApiClient.test.ts": { + "require-atomic-updates": { + "count": 1 + } + }, + "packages/tron-wallet-snap/src/clients/trongrid/errors.test.ts": { + "@typescript-eslint/explicit-function-return-type": { + "count": 1 + } + }, + "packages/tron-wallet-snap/src/handlers/clientRequest/clientRequest.test.ts": { + "@typescript-eslint/explicit-function-return-type": { + "count": 3 + }, + "@typescript-eslint/no-explicit-any": { + "count": 42 + } + }, + "packages/tron-wallet-snap/src/handlers/clientRequest/clientRequest.ts": { + "import-x/no-extraneous-dependencies": { + "count": 1 + } + }, + "packages/tron-wallet-snap/src/handlers/clientRequest/validation.ts": { + "import-x/no-extraneous-dependencies": { + "count": 1 + } + }, + "packages/tron-wallet-snap/src/handlers/cronjob.test.tsx": { + "@typescript-eslint/explicit-function-return-type": { + "count": 2 + }, + "@typescript-eslint/no-explicit-any": { + "count": 4 + } + }, + "packages/tron-wallet-snap/src/handlers/keyring.test.ts": { + "@typescript-eslint/no-explicit-any": { + "count": 10 + }, + "import-x/no-extraneous-dependencies": { + "count": 1 + } + }, + "packages/tron-wallet-snap/src/handlers/keyring.ts": { + "import-x/no-extraneous-dependencies": { + "count": 1 + } + }, + "packages/tron-wallet-snap/src/services/accounts/AccountsRepository.ts": { + "no-restricted-syntax": { + "count": 1 + } + }, + "packages/tron-wallet-snap/src/services/accounts/AccountsService.test.ts": { + "@typescript-eslint/explicit-function-return-type": { + "count": 1 + } + }, + "packages/tron-wallet-snap/src/services/accounts/AccountsService.ts": { + "import-x/no-extraneous-dependencies": { + "count": 1 + } + }, + "packages/tron-wallet-snap/src/services/assets/AssetsRepository.test.ts": { + "@typescript-eslint/explicit-function-return-type": { + "count": 2 + } + }, + "packages/tron-wallet-snap/src/services/assets/AssetsRepository.ts": { + "import-x/no-extraneous-dependencies": { + "count": 1 + } + }, + "packages/tron-wallet-snap/src/services/assets/AssetsService.test.ts": { + "@typescript-eslint/explicit-function-return-type": { + "count": 3 + }, + "@typescript-eslint/no-explicit-any": { + "count": 1 + } + }, + "packages/tron-wallet-snap/src/services/assets/AssetsService.ts": { + "import-x/no-extraneous-dependencies": { + "count": 2 + } + }, + "packages/tron-wallet-snap/src/services/config/ConfigProvider.ts": { + "import-x/no-extraneous-dependencies": { + "count": 1 + } + }, + "packages/tron-wallet-snap/src/services/send/FeeCalculatorService.test.ts": { + "@typescript-eslint/explicit-function-return-type": { + "count": 1 + }, + "@typescript-eslint/no-explicit-any": { + "count": 5 + } + }, + "packages/tron-wallet-snap/src/services/send/FeeCalculatorService.ts": { + "no-restricted-syntax": { + "count": 1 + } + }, + "packages/tron-wallet-snap/src/services/send/SendService.test.ts": { + "@typescript-eslint/explicit-function-return-type": { + "count": 3 + }, + "@typescript-eslint/no-explicit-any": { + "count": 15 + } + }, + "packages/tron-wallet-snap/src/services/send/SendService.ts": { + "import-x/no-extraneous-dependencies": { + "count": 1 + } + }, + "packages/tron-wallet-snap/src/services/send/TransactionExpirationRefresherService.test.ts": { + "@typescript-eslint/explicit-function-return-type": { + "count": 5 + } + }, + "packages/tron-wallet-snap/src/services/staking/StakingService.test.ts": { + "@typescript-eslint/no-explicit-any": { + "count": 7 + } + }, + "packages/tron-wallet-snap/src/services/staking/StakingService.ts": { + "import-x/no-extraneous-dependencies": { + "count": 1 + } + }, + "packages/tron-wallet-snap/src/services/state/InMemoryState.ts": { + "import-x/no-extraneous-dependencies": { + "count": 1 + } + }, + "packages/tron-wallet-snap/src/services/state/State.test.ts": { + "@typescript-eslint/explicit-function-return-type": { + "count": 1 + }, + "@typescript-eslint/no-explicit-any": { + "count": 1 + } + }, + "packages/tron-wallet-snap/src/services/state/State.ts": { + "import-x/no-extraneous-dependencies": { + "count": 1 + } + }, + "packages/tron-wallet-snap/src/services/transaction-expiration-refresher/TransactionExpirationRefresherService.ts": { + "import-x/no-extraneous-dependencies": { + "count": 1 + } + }, + "packages/tron-wallet-snap/src/services/transaction-scan/TransactionScanService.ts": { + "no-restricted-syntax": { + "count": 5 + } + }, + "packages/tron-wallet-snap/src/services/transactions/TransactionsMapper.test.ts": { + "@typescript-eslint/no-explicit-any": { + "count": 4 + } + }, + "packages/tron-wallet-snap/src/services/transactions/TransactionsRepository.ts": { + "import-x/no-extraneous-dependencies": { + "count": 1 + } + }, + "packages/tron-wallet-snap/src/services/transactions/TransactionsService.test.ts": { + "@typescript-eslint/no-explicit-any": { + "count": 1 + } + }, + "packages/tron-wallet-snap/src/services/transactions/TransactionsService.ts": { + "import-x/no-extraneous-dependencies": { + "count": 1 + } + }, + "packages/tron-wallet-snap/src/services/wallet/WalletService.test.ts": { + "@typescript-eslint/explicit-function-return-type": { + "count": 2 + }, + "@typescript-eslint/no-explicit-any": { + "count": 7 + }, + "import-x/no-extraneous-dependencies": { + "count": 1 + } + }, + "packages/tron-wallet-snap/src/services/wallet/WalletService.ts": { + "import-x/no-extraneous-dependencies": { + "count": 1 + } + }, + "packages/tron-wallet-snap/src/ui/confirmation/components/TransactionAlert/TransactionAlert.test.tsx": { + "@typescript-eslint/explicit-function-return-type": { + "count": 1 + }, + "@typescript-eslint/no-explicit-any": { + "count": 1 + } + }, + "packages/tron-wallet-snap/src/ui/confirmation/utils/getIconUrlForKnownAsset.ts": { + "no-restricted-syntax": { + "count": 1 + } + }, + "packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignMessage/render.test.tsx": { + "@typescript-eslint/no-explicit-any": { + "count": 3 + }, + "import-x/no-extraneous-dependencies": { + "count": 1 + } + }, + "packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignTransaction/ConfirmSignTransaction.test.tsx": { + "@typescript-eslint/no-explicit-any": { + "count": 6 + } + }, + "packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignTransaction/render.test.tsx": { + "@typescript-eslint/no-explicit-any": { + "count": 14 + }, + "import-x/no-extraneous-dependencies": { + "count": 1 + } + }, + "packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignTransaction/render.tsx": { + "import-x/no-extraneous-dependencies": { + "count": 1 + } + }, + "packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmTransactionRequest/ConfirmTransactionRequest.test.tsx": { + "@typescript-eslint/explicit-function-return-type": { + "count": 2 + } + }, + "packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmTransactionRequest/render.test.tsx": { + "@typescript-eslint/explicit-function-return-type": { + "count": 1 + }, + "@typescript-eslint/no-explicit-any": { + "count": 2 + } + }, + "packages/tron-wallet-snap/src/utils/deriveTronFromCoinTypeNode.test.ts": { + "import-x/no-extraneous-dependencies": { + "count": 1 + } + }, + "packages/tron-wallet-snap/src/utils/deriveTronFromCoinTypeNode.ts": { + "import-x/no-extraneous-dependencies": { + "count": 1 + } + }, + "packages/tron-wallet-snap/src/utils/getExplorerUrl.test.ts": { + "n/no-process-env": { + "count": 3 + } + }, + "packages/tron-wallet-snap/src/utils/serialization/serialize.ts": { + "import-x/no-extraneous-dependencies": { + "count": 1 + } + }, + "packages/tron-wallet-snap/src/validation/keyring-structs.test.ts": { + "import-x/no-extraneous-dependencies": { + "count": 1 + } + }, + "packages/tron-wallet-snap/src/validation/transaction.test.ts": { + "@typescript-eslint/no-explicit-any": { + "count": 1 + } + }, + "packages/tron-wallet-snap/src/validation/transaction.ts": { + "no-restricted-syntax": { + "count": 2 + } } } diff --git a/packages/bitcoin-wallet-snap/snap.manifest.json b/packages/bitcoin-wallet-snap/snap.manifest.json index c205c53d..16c2bd36 100644 --- a/packages/bitcoin-wallet-snap/snap.manifest.json +++ b/packages/bitcoin-wallet-snap/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/internal-snaps.git" }, "source": { - "shasum": "/dethkzXlpMwXncvw8la75osM09uRRleSemtosb149Y=", + "shasum": "1A2hYcFxk3aN2D5eOYP/QoMbsw0R9IUH7lZPAt3i7rU=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/tron-wallet-snap/jest.config.mjs b/packages/tron-wallet-snap/jest.config.mjs index 5f9481dd..299fdc07 100644 --- a/packages/tron-wallet-snap/jest.config.mjs +++ b/packages/tron-wallet-snap/jest.config.mjs @@ -24,9 +24,9 @@ const config = { // An object that configures minimum threshold enforcement for coverage results coverageThreshold: { global: { - branches: 70, + branches: 69.96, functions: 75.86, - lines: 82.65, + lines: 82.61, statements: 82.62, }, }, @@ -43,4 +43,4 @@ const config = { setupFilesAfterEnv: ['/jest.setup.ts'], }; -module.exports = config; +export default config; diff --git a/packages/tron-wallet-snap/package.json b/packages/tron-wallet-snap/package.json index c988fac0..6840f8a6 100644 --- a/packages/tron-wallet-snap/package.json +++ b/packages/tron-wallet-snap/package.json @@ -2,22 +2,30 @@ "name": "@metamask/tron-wallet-snap", "version": "1.33.1", "description": "A Tron wallet Snap", - "repository": { - "type": "git", - "url": "https://github.com/MetaMask/internal-snaps.git" - }, + "keywords": [ + "Ethereum", + "MetaMask" + ], "homepage": "https://github.com/MetaMask/internal-snaps/tree/main/packages/tron-wallet-snap#readme", "bugs": { "url": "https://github.com/MetaMask/internal-snaps/issues" }, "license": "MIT", - "main": "./dist/bundle.js", + "repository": { + "type": "git", + "url": "https://github.com/MetaMask/internal-snaps.git" + }, "files": [ "dist/", "images/", "snap.manifest.json", "locales/" ], + "main": "./dist/bundle.js", + "publishConfig": { + "access": "public", + "registry": "https://registry.npmjs.org/" + }, "scripts": { "allow-scripts": "yarn workspace root allow-scripts", "build": "mm-snap build && yarn build:locale && yarn build-preinstalled-snap", @@ -35,7 +43,6 @@ "serve": "mm-snap serve", "start": "node scripts/update-manifest-local.js && concurrently \"mm-snap watch\" \"yarn build:locale:watch\"", "test": "NODE_OPTIONS=--experimental-vm-modules jest --reporters=jest-silent-reporter", - "test:integration": "./integration-test/run-integration.sh", "test:clean": "NODE_OPTIONS=--experimental-vm-modules jest --clearCache", "test:verbose": "NODE_OPTIONS=--experimental-vm-modules jest --verbose", "test:watch": "NODE_OPTIONS=--experimental-vm-modules jest --watch" @@ -58,16 +65,9 @@ "jest-it-up": "^2.0.2", "jest-transform-stub": "2.0.0", "oxfmt": "^0.45.0", - "tronweb": "patch:tronweb@npm%3A6.1.0#~/.yarn/patches/tronweb-npm-6.1.0-771b242b6a.patch" + "tronweb": "patch:tronweb@npm%3A6.1.0#~/.yarn/patches/tronweb-npm-6.1.0-771b242b6a.patch", + "typescript": "~5.8.3" }, - "publishConfig": { - "access": "public", - "registry": "https://registry.npmjs.org/" - }, - "keywords": [ - "Ethereum", - "MetaMask" - ], "engines": { "node": ">=20" } diff --git a/packages/tron-wallet-snap/scripts/build-preinstalled-snap.js b/packages/tron-wallet-snap/scripts/build-preinstalled-snap.js index cb4517eb..d143a6e9 100644 --- a/packages/tron-wallet-snap/scripts/build-preinstalled-snap.js +++ b/packages/tron-wallet-snap/scripts/build-preinstalled-snap.js @@ -9,6 +9,7 @@ console.log('[preinstalled-snap] - attempt to build preinstalled snap'); /** * Read the contents of a file and return as a string. + * * @param {string} filePath - Path to file. * @returns {string} File as utf-8 string. */ diff --git a/packages/tron-wallet-snap/scripts/update-manifest-local.js b/packages/tron-wallet-snap/scripts/update-manifest-local.js index 0bb2fbbb..b9d41177 100644 --- a/packages/tron-wallet-snap/scripts/update-manifest-local.js +++ b/packages/tron-wallet-snap/scripts/update-manifest-local.js @@ -9,18 +9,26 @@ const manifest = JSON.parse(fs.readFileSync(manifestPath, 'utf8')); if (environment === 'local' || environment === 'test') { manifest.initialConnections['http://localhost:3000'] = {}; if (manifest.initialPermissions?.['endowment:keyring']?.allowedOrigins) { - if (!manifest.initialPermissions['endowment:keyring'].allowedOrigins.includes('http://localhost:3000')) { - manifest.initialPermissions['endowment:keyring'].allowedOrigins.push('http://localhost:3000'); + if ( + !manifest.initialPermissions['endowment:keyring'].allowedOrigins.includes( + 'http://localhost:3000', + ) + ) { + manifest.initialPermissions['endowment:keyring'].allowedOrigins.push( + 'http://localhost:3000', + ); } } // Add endowment:rpc permission for local/dev mode manifest.initialPermissions['endowment:rpc'] = { dapps: true, - snaps: false + snaps: false, }; - console.log('Added localhost entries and endowment:rpc to snap.manifest.json for local development'); + console.log( + 'Added localhost entries and endowment:rpc to snap.manifest.json for local development', + ); } else { // Production mode - remove local-only settings let changed = false; @@ -33,7 +41,8 @@ if (environment === 'local' || environment === 'test') { // Remove localhost from keyring allowedOrigins if (manifest.initialPermissions?.['endowment:keyring']?.allowedOrigins) { - const origins = manifest.initialPermissions['endowment:keyring'].allowedOrigins; + const origins = + manifest.initialPermissions['endowment:keyring'].allowedOrigins; const index = origins.indexOf('http://localhost:3000'); if (index > -1) { origins.splice(index, 1); @@ -48,9 +57,10 @@ if (environment === 'local' || environment === 'test') { } if (changed) { - console.log('Removed local-only settings from snap.manifest.json for production'); + console.log( + 'Removed local-only settings from snap.manifest.json for production', + ); } } -fs.writeFileSync(manifestPath, JSON.stringify(manifest, null, 2) + '\n'); - +fs.writeFileSync(manifestPath, `${JSON.stringify(manifest, null, 2)}\n`); diff --git a/packages/tron-wallet-snap/snap.manifest.json b/packages/tron-wallet-snap/snap.manifest.json index 82fe14c8..36e5f143 100644 --- a/packages/tron-wallet-snap/snap.manifest.json +++ b/packages/tron-wallet-snap/snap.manifest.json @@ -4,10 +4,10 @@ "proposedName": "Tron", "repository": { "type": "git", - "url": "https://github.com/MetaMask/snap-tron-wallet.git" + "url": "https://github.com/MetaMask/internal-snaps.git" }, "source": { - "shasum": "SoFlTE0hiN9rFDWlAiCCSyn1iSBvJwvlfi1vK/qrufo=", + "shasum": "JWrxUhJRaL9TG4mjDWY9ekDzcmH+JfiEXdeybddxAko=", "location": { "npm": { "filePath": "dist/bundle.js", @@ -50,6 +50,6 @@ "scopes": ["tron:728126428"] } }, - "platformVersion": "10.3.0", + "platformVersion": "11.1.1", "manifestVersion": "0.1" } diff --git a/packages/tron-wallet-snap/src/caching/InMemoryCache.ts b/packages/tron-wallet-snap/src/caching/InMemoryCache.ts index b490e16c..1549b639 100644 --- a/packages/tron-wallet-snap/src/caching/InMemoryCache.ts +++ b/packages/tron-wallet-snap/src/caching/InMemoryCache.ts @@ -1,9 +1,9 @@ import { assert } from '@metamask/utils'; -import type { ICache } from './ICache'; -import type { CacheEntry } from './types'; import type { ILogger } from '../utils/logger'; import type { Serializable } from '../utils/serialization/types'; +import type { ICache } from './ICache'; +import type { CacheEntry } from './types'; /** * A simple in-memory cache implementation supporting TTL (Time To Live) functionality. diff --git a/packages/tron-wallet-snap/src/caching/StateCache.test.ts b/packages/tron-wallet-snap/src/caching/StateCache.test.ts index a083d44a..7c4b3787 100644 --- a/packages/tron-wallet-snap/src/caching/StateCache.test.ts +++ b/packages/tron-wallet-snap/src/caching/StateCache.test.ts @@ -1,7 +1,7 @@ /* eslint-disable jest/prefer-strict-equal */ -/* eslint-disable @typescript-eslint/naming-convention */ -import { StateCache } from './StateCache'; + import { InMemoryState } from '../services/state/InMemoryState'; +import { StateCache } from './StateCache'; describe('StateCache', () => { describe('constructor', () => { diff --git a/packages/tron-wallet-snap/src/caching/StateCache.ts b/packages/tron-wallet-snap/src/caching/StateCache.ts index 0ede40bd..8f9ae759 100644 --- a/packages/tron-wallet-snap/src/caching/StateCache.ts +++ b/packages/tron-wallet-snap/src/caching/StateCache.ts @@ -1,10 +1,10 @@ import { assert } from '@metamask/utils'; -import type { ICache } from './ICache'; -import type { CacheEntry } from './types'; import type { IStateManager } from '../services/state/IStateManager'; import type { ILogger } from '../utils/logger'; import type { Serializable } from '../utils/serialization/types'; +import type { ICache } from './ICache'; +import type { CacheEntry } from './types'; /** * The whole cache store. diff --git a/packages/tron-wallet-snap/src/caching/useCache.test.ts b/packages/tron-wallet-snap/src/caching/useCache.test.ts index ae17158b..456f8a2b 100644 --- a/packages/tron-wallet-snap/src/caching/useCache.test.ts +++ b/packages/tron-wallet-snap/src/caching/useCache.test.ts @@ -1,6 +1,7 @@ -import type { ICache } from './ICache'; -import { useCache, type CacheOptions } from './useCache'; import type { Serializable } from '../utils/serialization/types'; +import type { ICache } from './ICache'; +import { useCache } from './useCache'; +import type { CacheOptions } from './useCache'; describe('useCache', () => { // Spy to check if the original function was executed or not diff --git a/packages/tron-wallet-snap/src/caching/useCache.ts b/packages/tron-wallet-snap/src/caching/useCache.ts index 3c413fce..4ada2c24 100644 --- a/packages/tron-wallet-snap/src/caching/useCache.ts +++ b/packages/tron-wallet-snap/src/caching/useCache.ts @@ -1,8 +1,8 @@ /* eslint-disable no-void */ -import type { ICache } from './ICache'; import logger from '../utils/logger'; import type { Serializable } from '../utils/serialization/types'; +import type { ICache } from './ICache'; /** * Options for configuring the caching behavior of a function. diff --git a/packages/tron-wallet-snap/src/caching/useCacheUntil.test.ts b/packages/tron-wallet-snap/src/caching/useCacheUntil.test.ts index 0bf9057d..d1c8e77e 100644 --- a/packages/tron-wallet-snap/src/caching/useCacheUntil.test.ts +++ b/packages/tron-wallet-snap/src/caching/useCacheUntil.test.ts @@ -1,10 +1,7 @@ -import type { ICache } from './ICache'; -import { - useCacheUntil, - type CacheUntilOptions, - type ResultWithExpiry, -} from './useCacheUntil'; import type { Serializable } from '../utils/serialization/types'; +import type { ICache } from './ICache'; +import { useCacheUntil } from './useCacheUntil'; +import type { CacheUntilOptions, ResultWithExpiry } from './useCacheUntil'; describe('useCacheUntil', () => { // Spy to check if the original function was executed or not diff --git a/packages/tron-wallet-snap/src/caching/useCacheUntil.ts b/packages/tron-wallet-snap/src/caching/useCacheUntil.ts index e9afb5d1..c531c2d3 100644 --- a/packages/tron-wallet-snap/src/caching/useCacheUntil.ts +++ b/packages/tron-wallet-snap/src/caching/useCacheUntil.ts @@ -1,6 +1,6 @@ -import type { ICache } from './ICache'; import logger from '../utils/logger'; import type { Serializable } from '../utils/serialization/types'; +import type { ICache } from './ICache'; /** * Result type for functions that provide their own expiry time. diff --git a/packages/tron-wallet-snap/src/clients/price-api/PriceApiClient.test.ts b/packages/tron-wallet-snap/src/clients/price-api/PriceApiClient.test.ts index 27f47786..0980e954 100644 --- a/packages/tron-wallet-snap/src/clients/price-api/PriceApiClient.test.ts +++ b/packages/tron-wallet-snap/src/clients/price-api/PriceApiClient.test.ts @@ -2,16 +2,16 @@ import type { CaipAssetType } from '@metamask/keyring-api'; import { cloneDeep } from 'lodash'; -import { MOCK_EXCHANGE_RATES } from './mocks/exchange-rates'; import type { ICache } from '../../caching/ICache'; import { InMemoryCache } from '../../caching/InMemoryCache'; import { KnownCaip19Id } from '../../constants'; -import { MOCK_HISTORICAL_PRICES } from './mocks/historical-prices'; -import { PriceApiClient } from './PriceApiClient'; -import type { SpotPrices, VsCurrencyParam } from './types'; import type { ConfigProvider } from '../../services/config'; import { mockLogger } from '../../utils/mockLogger'; import type { Serializable } from '../../utils/serialization/types'; +import { MOCK_EXCHANGE_RATES } from './mocks/exchange-rates'; +import { MOCK_HISTORICAL_PRICES } from './mocks/historical-prices'; +import { PriceApiClient } from './PriceApiClient'; +import type { SpotPrices, VsCurrencyParam } from './types'; describe('PriceApiClient', () => { let mockFetch: jest.Mock; diff --git a/packages/tron-wallet-snap/src/clients/price-api/PriceApiClient.ts b/packages/tron-wallet-snap/src/clients/price-api/PriceApiClient.ts index 631e2c0a..4f42f0b8 100644 --- a/packages/tron-wallet-snap/src/clients/price-api/PriceApiClient.ts +++ b/packages/tron-wallet-snap/src/clients/price-api/PriceApiClient.ts @@ -5,6 +5,15 @@ import { array, assert } from '@metamask/superstruct'; import { CaipAssetTypeStruct } from '@metamask/utils'; import { mapKeys } from 'lodash'; +import type { ICache } from '../../caching/ICache'; +import { useCache } from '../../caching/useCache'; +import { SPECIAL_ASSETS } from '../../constants'; +import type { ConfigProvider } from '../../services/config'; +import { buildUrl } from '../../utils/buildUrl'; +import type { ILogger } from '../../utils/logger'; +import logger from '../../utils/logger'; +import type { Serializable } from '../../utils/serialization/types'; +import { UrlStruct } from '../../validation/structs'; import type { FiatExchangeRatesResponse, GetHistoricalPricesParams, @@ -19,15 +28,6 @@ import { SpotPricesStruct, VsCurrencyParamStruct, } from './types'; -import type { ICache } from '../../caching/ICache'; -import { useCache } from '../../caching/useCache'; -import { SPECIAL_ASSETS } from '../../constants'; -import type { ConfigProvider } from '../../services/config'; -import { buildUrl } from '../../utils/buildUrl'; -import type { ILogger } from '../../utils/logger'; -import logger from '../../utils/logger'; -import type { Serializable } from '../../utils/serialization/types'; -import { UrlStruct } from '../../validation/structs'; export class PriceApiClient { readonly #fetch: typeof globalThis.fetch; diff --git a/packages/tron-wallet-snap/src/clients/security-alerts-api/SecurityAlertsApiClient.ts b/packages/tron-wallet-snap/src/clients/security-alerts-api/SecurityAlertsApiClient.ts index 485abede..c553367d 100644 --- a/packages/tron-wallet-snap/src/clients/security-alerts-api/SecurityAlertsApiClient.ts +++ b/packages/tron-wallet-snap/src/clients/security-alerts-api/SecurityAlertsApiClient.ts @@ -3,14 +3,13 @@ import { assert } from '@metamask/superstruct'; import { Types } from 'tronweb'; -import { - SecurityAlertResponseStruct, - type SecurityAlertSimulationValidationResponse, -} from './structs'; -import { extractScanParametersFromTransactionData } from './utils'; import type { ConfigProvider } from '../../services/config'; -import { createPrefixedLogger, type ILogger } from '../../utils/logger'; +import { createPrefixedLogger } from '../../utils/logger'; +import type { ILogger } from '../../utils/logger'; import { isTransactionWellFormed } from '../../validation/transaction'; +import { SecurityAlertResponseStruct } from './structs'; +import type { SecurityAlertSimulationValidationResponse } from './structs'; +import { extractScanParametersFromTransactionData } from './utils'; /** * Client for interacting with the Security Alerts API for security scanning. diff --git a/packages/tron-wallet-snap/src/clients/security-alerts-api/structs.ts b/packages/tron-wallet-snap/src/clients/security-alerts-api/structs.ts index b627dc85..64008275 100644 --- a/packages/tron-wallet-snap/src/clients/security-alerts-api/structs.ts +++ b/packages/tron-wallet-snap/src/clients/security-alerts-api/structs.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/naming-convention */ import type { Infer } from '@metamask/superstruct'; import { any, diff --git a/packages/tron-wallet-snap/src/clients/security-alerts-api/utils.test.ts b/packages/tron-wallet-snap/src/clients/security-alerts-api/utils.test.ts index 008da943..02d62dff 100644 --- a/packages/tron-wallet-snap/src/clients/security-alerts-api/utils.test.ts +++ b/packages/tron-wallet-snap/src/clients/security-alerts-api/utils.test.ts @@ -1,11 +1,10 @@ -/* eslint-disable @typescript-eslint/naming-convention */ import { Types } from 'tronweb'; -import { extractScanParametersFromTransactionData } from './utils'; import type { TransferAssetContractParameter, TransferContractParameter, } from '../trongrid/types'; +import { extractScanParametersFromTransactionData } from './utils'; describe('SecurityAlertsApiClient utils', () => { describe('extractScanParametersFromTransactionData', () => { diff --git a/packages/tron-wallet-snap/src/clients/security-alerts-api/utils.ts b/packages/tron-wallet-snap/src/clients/security-alerts-api/utils.ts index 99fef6bb..bf07e2f1 100644 --- a/packages/tron-wallet-snap/src/clients/security-alerts-api/utils.ts +++ b/packages/tron-wallet-snap/src/clients/security-alerts-api/utils.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/naming-convention */ import { add0x } from '@metamask/utils'; import { TronWeb, Types } from 'tronweb'; diff --git a/packages/tron-wallet-snap/src/clients/snap/SnapClient.test.ts b/packages/tron-wallet-snap/src/clients/snap/SnapClient.test.ts index 6ea53c86..68652818 100644 --- a/packages/tron-wallet-snap/src/clients/snap/SnapClient.test.ts +++ b/packages/tron-wallet-snap/src/clients/snap/SnapClient.test.ts @@ -1,5 +1,5 @@ -import { SnapClient } from './SnapClient'; import type { ILogger } from '../../utils/logger'; +import { SnapClient } from './SnapClient'; // Mock the global snap object const mockSnapRequest = jest.fn(); diff --git a/packages/tron-wallet-snap/src/clients/snap/SnapClient.ts b/packages/tron-wallet-snap/src/clients/snap/SnapClient.ts index 0788f767..f2af912e 100644 --- a/packages/tron-wallet-snap/src/clients/snap/SnapClient.ts +++ b/packages/tron-wallet-snap/src/clients/snap/SnapClient.ts @@ -1,19 +1,19 @@ -/* eslint-disable @typescript-eslint/naming-convention */ import type { JsonSLIP10Node } from '@metamask/key-tree'; import type { EntropySourceId } from '@metamask/keyring-api'; -import { - getJsonError, - type DialogResult, - type EntropySource, - type GetClientStatusResult, - type Json, - type ResolveInterfaceResult, - type UpdateInterfaceResult, +import { getJsonError } from '@metamask/snaps-sdk'; +import type { + DialogResult, + EntropySource, + GetClientStatusResult, + Json, + ResolveInterfaceResult, + UpdateInterfaceResult, } from '@metamask/snaps-sdk'; import { SecurityEventType, TransactionEventType } from '../../types/analytics'; import type { Preferences } from '../../types/snap'; -import { createPrefixedLogger, type ILogger } from '../../utils/logger'; +import { createPrefixedLogger } from '../../utils/logger'; +import type { ILogger } from '../../utils/logger'; import { sanitizeSensitiveError } from '../../utils/sensitiveErrors'; /** diff --git a/packages/tron-wallet-snap/src/clients/token-api/TokenApiClient.test.ts b/packages/tron-wallet-snap/src/clients/token-api/TokenApiClient.test.ts index fdc569bd..f68d0b8d 100644 --- a/packages/tron-wallet-snap/src/clients/token-api/TokenApiClient.test.ts +++ b/packages/tron-wallet-snap/src/clients/token-api/TokenApiClient.test.ts @@ -1,8 +1,8 @@ -import { TokenApiClient } from './TokenApiClient'; import { KnownCaip19Id, Network, Networks } from '../../constants'; import type { TokenCaipAssetType } from '../../services/assets/types'; import type { ConfigProvider } from '../../services/config'; import { mockLogger } from '../../utils/mockLogger'; +import { TokenApiClient } from './TokenApiClient'; const MOCK_METADATA_RESPONSE = [ { diff --git a/packages/tron-wallet-snap/src/clients/token-api/TokenApiClient.ts b/packages/tron-wallet-snap/src/clients/token-api/TokenApiClient.ts index 68a504a2..0d3c1c93 100644 --- a/packages/tron-wallet-snap/src/clients/token-api/TokenApiClient.ts +++ b/packages/tron-wallet-snap/src/clients/token-api/TokenApiClient.ts @@ -1,8 +1,8 @@ import type { FungibleAssetMetadata } from '@metamask/snaps-sdk'; -import { array, assert, type Infer } from '@metamask/superstruct'; +import { array, assert } from '@metamask/superstruct'; +import type { Infer } from '@metamask/superstruct'; import { CaipAssetTypeStruct, parseCaipAssetType } from '@metamask/utils'; -import { TokenMetadataResponseStruct } from './structs'; import { Network, SPECIAL_ASSETS } from '../../constants'; import type { TokenCaipAssetType } from '../../services/assets/types'; import { TokenCaipAssetTypeStruct } from '../../services/assets/types'; @@ -11,6 +11,7 @@ import { buildUrl } from '../../utils/buildUrl'; import type { ILogger } from '../../utils/logger'; import logger from '../../utils/logger'; import { UrlStruct } from '../../validation/structs'; +import { TokenMetadataResponseStruct } from './structs'; const DEFAULT_DECIMALS = 9; diff --git a/packages/tron-wallet-snap/src/clients/tron-http/TronHttpClient.ts b/packages/tron-wallet-snap/src/clients/tron-http/TronHttpClient.ts index 66d6d102..373adfe9 100644 --- a/packages/tron-wallet-snap/src/clients/tron-http/TronHttpClient.ts +++ b/packages/tron-wallet-snap/src/clients/tron-http/TronHttpClient.ts @@ -1,5 +1,9 @@ import { assert } from '@metamask/superstruct'; +import type { Network } from '../../constants'; +import type { ConfigProvider } from '../../services/config'; +import { buildUrl } from '../../utils/buildUrl'; +import { hexToString } from '../../utils/hex'; import { AccountResourcesStruct, ChainParametersResponseStruct, @@ -21,10 +25,6 @@ import type { TriggerConstantContractRequest, TriggerConstantContractResponse, } from './types'; -import type { Network } from '../../constants'; -import type { ConfigProvider } from '../../services/config'; -import { buildUrl } from '../../utils/buildUrl'; -import { hexToString } from '../../utils/hex'; /** * Client for Tron JSON-RPC HTTP endpoints (not the REST API) diff --git a/packages/tron-wallet-snap/src/clients/tron-http/structs.ts b/packages/tron-wallet-snap/src/clients/tron-http/structs.ts index aa13436e..f4549405 100644 --- a/packages/tron-wallet-snap/src/clients/tron-http/structs.ts +++ b/packages/tron-wallet-snap/src/clients/tron-http/structs.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/naming-convention */ import type { Infer } from '@metamask/superstruct'; import { array, diff --git a/packages/tron-wallet-snap/src/clients/trongrid/TrongridApiClient.test.ts b/packages/tron-wallet-snap/src/clients/trongrid/TrongridApiClient.test.ts index 560a90eb..0e4ac5d0 100644 --- a/packages/tron-wallet-snap/src/clients/trongrid/TrongridApiClient.test.ts +++ b/packages/tron-wallet-snap/src/clients/trongrid/TrongridApiClient.test.ts @@ -1,5 +1,3 @@ -import { TrongridApiClient } from './TrongridApiClient'; -import type { Trc20Balance, TransactionInfo } from './types'; import type { ICache } from '../../caching/ICache'; import { InMemoryCache } from '../../caching/InMemoryCache'; import { Network } from '../../constants'; @@ -9,6 +7,8 @@ import nativeTransferMock from '../../services/transactions/mocks/trongrid/accou import { mockLogger } from '../../utils/mockLogger'; import type { Serializable } from '../../utils/serialization/types'; import { TronHttpClient } from '../tron-http/TronHttpClient'; +import { TrongridApiClient } from './TrongridApiClient'; +import type { Trc20Balance, TransactionInfo } from './types'; type WithTrongridApiClientCallback = (payload: { client: TrongridApiClient; @@ -66,7 +66,6 @@ async function withTrongridApiClient( cache, }); - // eslint-disable-next-line no-restricted-globals const originalFetch = global.fetch; try { return await testFunction({ @@ -76,7 +75,6 @@ async function withTrongridApiClient( cache, }); } finally { - // eslint-disable-next-line no-restricted-globals global.fetch = originalFetch; } } @@ -94,14 +92,13 @@ describe('TrongridApiClient', () => { { TGPuQ7g7H8GsUEXhwvvJop4zCncurEh2ht: '88123456' }, ]; - // eslint-disable-next-line no-restricted-globals jest.spyOn(global, 'fetch').mockResolvedValueOnce( // eslint-disable-next-line no-restricted-globals new Response( JSON.stringify({ data: mockTrc20Balances, success: true, - // eslint-disable-next-line @typescript-eslint/naming-convention + meta: { at: 1770121997373, page_size: 4 }, }), { status: 200, headers: { 'Content-Type': 'application/json' } }, @@ -114,7 +111,7 @@ describe('TrongridApiClient', () => { ); expect(normalizeBalances(result)).toStrictEqual(mockTrc20Balances); - // eslint-disable-next-line no-restricted-globals + expect(global.fetch).toHaveBeenCalledWith( `https://api.trongrid.io/v1/accounts/${mockAddress}/trc20/balance`, expect.objectContaining({ @@ -128,14 +125,13 @@ describe('TrongridApiClient', () => { it('returns empty array when no TRC20 tokens are found', async () => { await withTrongridApiClient(async ({ client }) => { - // eslint-disable-next-line no-restricted-globals jest.spyOn(global, 'fetch').mockResolvedValueOnce( // eslint-disable-next-line no-restricted-globals new Response( JSON.stringify({ data: [], success: true, - // eslint-disable-next-line @typescript-eslint/naming-convention + meta: { at: 1770121997373, page_size: 0 }, }), { status: 200, headers: { 'Content-Type': 'application/json' } }, @@ -153,13 +149,12 @@ describe('TrongridApiClient', () => { it('returns empty array when data is undefined', async () => { await withTrongridApiClient(async ({ client }) => { - // eslint-disable-next-line no-restricted-globals jest.spyOn(global, 'fetch').mockResolvedValueOnce( // eslint-disable-next-line no-restricted-globals new Response( JSON.stringify({ success: true, - // eslint-disable-next-line @typescript-eslint/naming-convention + meta: { at: 1770121997373, page_size: 0 }, }), { status: 200, headers: { 'Content-Type': 'application/json' } }, @@ -199,7 +194,6 @@ describe('TrongridApiClient', () => { it('throws error when HTTP request fails', async () => { await withTrongridApiClient(async ({ client }) => { - // eslint-disable-next-line no-restricted-globals jest.spyOn(global, 'fetch').mockResolvedValueOnce( // eslint-disable-next-line no-restricted-globals new Response('', { status: 500 }), @@ -213,14 +207,13 @@ describe('TrongridApiClient', () => { it('throws error when API returns success: false', async () => { await withTrongridApiClient(async ({ client }) => { - // eslint-disable-next-line no-restricted-globals jest.spyOn(global, 'fetch').mockResolvedValueOnce( // eslint-disable-next-line no-restricted-globals new Response( JSON.stringify({ data: [], success: false, - // eslint-disable-next-line @typescript-eslint/naming-convention + meta: { at: 1770121997373, page_size: 0 }, }), { status: 200, headers: { 'Content-Type': 'application/json' } }, @@ -239,14 +232,13 @@ describe('TrongridApiClient', () => { { TTestToken123: '1000000' }, ]; - // eslint-disable-next-line no-restricted-globals jest.spyOn(global, 'fetch').mockResolvedValueOnce( // eslint-disable-next-line no-restricted-globals new Response( JSON.stringify({ data: mockTrc20Balances, success: true, - // eslint-disable-next-line @typescript-eslint/naming-convention + meta: { at: 1770121997373, page_size: 1 }, }), { status: 200, headers: { 'Content-Type': 'application/json' } }, @@ -259,7 +251,7 @@ describe('TrongridApiClient', () => { ); expect(normalizeBalances(result)).toStrictEqual(mockTrc20Balances); - // eslint-disable-next-line no-restricted-globals + expect(global.fetch).toHaveBeenCalledWith( expect.stringContaining('nile.trongrid.io'), expect.any(Object), @@ -274,14 +266,13 @@ describe('TrongridApiClient', () => { { TokenAddress2: '200' }, ]; - // eslint-disable-next-line no-restricted-globals jest.spyOn(global, 'fetch').mockResolvedValueOnce( // eslint-disable-next-line no-restricted-globals new Response( JSON.stringify({ data: validBalances, success: true, - // eslint-disable-next-line @typescript-eslint/naming-convention + meta: { at: 1770121997373, page_size: 2 }, }), { status: 200, headers: { 'Content-Type': 'application/json' } }, @@ -307,14 +298,13 @@ describe('TrongridApiClient', () => { it('fetches transactions without a limit query parameter by default', async () => { await withTrongridApiClient(async ({ client }) => { - // eslint-disable-next-line no-restricted-globals jest.spyOn(global, 'fetch').mockResolvedValueOnce( // eslint-disable-next-line no-restricted-globals new Response( JSON.stringify({ data: [mockTx], success: true, - // eslint-disable-next-line @typescript-eslint/naming-convention + meta: { at: 1770121997373, page_size: 1 }, }), { status: 200, headers: { 'Content-Type': 'application/json' } }, @@ -327,7 +317,7 @@ describe('TrongridApiClient', () => { ); expect(result).toHaveLength(1); - // eslint-disable-next-line no-restricted-globals + expect(global.fetch).toHaveBeenCalledWith( `https://api.trongrid.io/v1/accounts/${mockAddress}/transactions`, expect.any(Object), @@ -337,14 +327,13 @@ describe('TrongridApiClient', () => { it('appends limit to the query string when options.limit is set', async () => { await withTrongridApiClient(async ({ client }) => { - // eslint-disable-next-line no-restricted-globals jest.spyOn(global, 'fetch').mockResolvedValueOnce( // eslint-disable-next-line no-restricted-globals new Response( JSON.stringify({ data: [mockTx], success: true, - // eslint-disable-next-line @typescript-eslint/naming-convention + meta: { at: 1770121997373, page_size: 1 }, }), { status: 200, headers: { 'Content-Type': 'application/json' } }, @@ -355,7 +344,6 @@ describe('TrongridApiClient', () => { limit: 1, }); - // eslint-disable-next-line no-restricted-globals expect(global.fetch).toHaveBeenCalledWith( `https://api.trongrid.io/v1/accounts/${mockAddress}/transactions?limit=1`, expect.any(Object), @@ -369,7 +357,7 @@ describe('TrongridApiClient', () => { // where a legacy internal_transactions entry omitted data.call_value. const transactionWithSparseInternalTransaction = { ...mockTx, - // eslint-disable-next-line @typescript-eslint/naming-convention + internal_transactions: [ { data: { @@ -379,14 +367,13 @@ describe('TrongridApiClient', () => { ], }; - // eslint-disable-next-line no-restricted-globals jest.spyOn(global, 'fetch').mockResolvedValueOnce( // eslint-disable-next-line no-restricted-globals new Response( JSON.stringify({ data: [transactionWithSparseInternalTransaction], success: true, - // eslint-disable-next-line @typescript-eslint/naming-convention + meta: { at: 1770121997373, page_size: 1 }, }), { status: 200, headers: { 'Content-Type': 'application/json' } }, @@ -406,14 +393,14 @@ describe('TrongridApiClient', () => { await withTrongridApiClient(async ({ client }) => { // Example seen live on tx c4e8c4a45830e882e92062ede0ecd09702c51e4732385b9cf33590d470b08357, // where Trongrid omitted raw_data.timestamp entirely. - // eslint-disable-next-line no-restricted-globals + jest.spyOn(global, 'fetch').mockResolvedValueOnce( // eslint-disable-next-line no-restricted-globals new Response( JSON.stringify({ data: [nativeTransferWithoutTimestampMock], success: true, - // eslint-disable-next-line @typescript-eslint/naming-convention + meta: { at: 1770121997373, page_size: 1 }, }), { status: 200, headers: { 'Content-Type': 'application/json' } }, @@ -544,7 +531,7 @@ describe('TrongridApiClient', () => { await withTrongridApiClient(async ({ client }) => { // getChainParameters issues two fetches: chain parameters first, then // next-maintenance-time (the cache TTL). - // eslint-disable-next-line no-restricted-globals + jest.spyOn(global, 'fetch').mockResolvedValueOnce( // eslint-disable-next-line no-restricted-globals new Response(JSON.stringify({ chainParameter: chainParameters }), { @@ -552,7 +539,7 @@ describe('TrongridApiClient', () => { headers: { 'Content-Type': 'application/json' }, }), ); - // eslint-disable-next-line no-restricted-globals + jest.spyOn(global, 'fetch').mockResolvedValueOnce( // eslint-disable-next-line no-restricted-globals new Response( diff --git a/packages/tron-wallet-snap/src/clients/trongrid/TrongridApiClient.ts b/packages/tron-wallet-snap/src/clients/trongrid/TrongridApiClient.ts index 09fb0e2a..e2aca06b 100644 --- a/packages/tron-wallet-snap/src/clients/trongrid/TrongridApiClient.ts +++ b/packages/tron-wallet-snap/src/clients/trongrid/TrongridApiClient.ts @@ -1,5 +1,14 @@ import { assert } from '@metamask/superstruct'; +import type { ICache } from '../../caching/ICache'; +import { useCacheUntil } from '../../caching/useCacheUntil'; +import type { ResultWithExpiry } from '../../caching/useCacheUntil'; +import type { Network } from '../../constants'; +import type { ConfigProvider } from '../../services/config'; +import { buildUrl } from '../../utils/buildUrl'; +import type { Serializable } from '../../utils/serialization/types'; +import type { TronHttpClient } from '../tron-http/TronHttpClient'; +import type { ChainParameter } from '../tron-http/types'; import { createTrongridHttpError, TrongridAccountNotFoundError, @@ -18,17 +27,6 @@ import type { TronAccount, TrongridApiResponse, } from './types'; -import type { ICache } from '../../caching/ICache'; -import { - useCacheUntil, - type ResultWithExpiry, -} from '../../caching/useCacheUntil'; -import type { Network } from '../../constants'; -import type { ConfigProvider } from '../../services/config'; -import { buildUrl } from '../../utils/buildUrl'; -import type { Serializable } from '../../utils/serialization/types'; -import type { TronHttpClient } from '../tron-http/TronHttpClient'; -import type { ChainParameter } from '../tron-http/types'; /** * Function name used for the `useCacheUntil` cache key for `getChainParameters`. diff --git a/packages/tron-wallet-snap/src/clients/trongrid/structs.ts b/packages/tron-wallet-snap/src/clients/trongrid/structs.ts index 78c0875f..4822ad2b 100644 --- a/packages/tron-wallet-snap/src/clients/trongrid/structs.ts +++ b/packages/tron-wallet-snap/src/clients/trongrid/structs.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/naming-convention */ import type { Infer } from '@metamask/superstruct'; import { array, @@ -125,7 +124,6 @@ export const ContractInfoStruct = type({ }); export const InternalTransactionCallValueStruct = type({ - // eslint-disable-next-line id-length _: optional(number()), callValue: optional(min(number(), 0)), tokenId: optional(string()), diff --git a/packages/tron-wallet-snap/src/handlers/clientRequest/clientRequest.test.ts b/packages/tron-wallet-snap/src/handlers/clientRequest/clientRequest.test.ts index 4ad93126..5719c0e7 100644 --- a/packages/tron-wallet-snap/src/handlers/clientRequest/clientRequest.test.ts +++ b/packages/tron-wallet-snap/src/handlers/clientRequest/clientRequest.test.ts @@ -11,9 +11,6 @@ import type { FreezeBalanceV2Contract, } from 'tronweb/lib/esm/types'; -import { ClientRequestHandler } from './clientRequest'; -import { ClientRequestMethod, SendErrorCodes } from './types'; -import type { OnAmountInputRequestStruct } from './validation'; import type { SnapClient } from '../../clients/snap/SnapClient'; import type { TronWebFactory } from '../../clients/tronweb/TronWebFactory'; import { @@ -42,6 +39,9 @@ import type { TransactionsService } from '../../services/transactions/Transactio import { trxToSun } from '../../utils/conversion'; import { mockLogger } from '../../utils/mockLogger'; import { BackgroundEventMethod } from '../cronjob'; +import { ClientRequestHandler } from './clientRequest'; +import { ClientRequestMethod, SendErrorCodes } from './types'; +import type { OnAmountInputRequestStruct } from './validation'; const TEST_ACCOUNT_ID = '550e8400-e29b-41d4-a716-446655440000'; @@ -285,9 +285,8 @@ describe('ClientRequestHandler', () => { hashSegment?: string; }) => ({ blockID: `${'0'.repeat(16)}${hashSegment}${'f'.repeat(32)}`, - // eslint-disable-next-line @typescript-eslint/naming-convention + block_header: { - // eslint-disable-next-line @typescript-eslint/naming-convention raw_data: { number, timestamp, @@ -412,7 +411,6 @@ describe('ClientRequestHandler', () => { type: 'TriggerSmartContract', parameter: { value: { - // eslint-disable-next-line @typescript-eslint/naming-convention owner_address: TronWeb.address.toHex( 'TGJn1wnUYHJbvN88cynZbsAz2EMeZq73yx', ), @@ -427,9 +425,9 @@ describe('ClientRequestHandler', () => { const signedTransaction = { txID: 'test-tx-id', - // eslint-disable-next-line @typescript-eslint/naming-convention + raw_data: mockRawData, - // eslint-disable-next-line @typescript-eslint/naming-convention + raw_data_hex: 'test-hex', signature: ['test-signature'], }; @@ -451,9 +449,7 @@ describe('ClientRequestHandler', () => { expect(mockRawData).toHaveProperty('fee_limit', FEE_LIMIT); expect(mockTronWeb.utils.transaction.txJsonToPb).toHaveBeenCalledWith( expect.objectContaining({ - // eslint-disable-next-line @typescript-eslint/naming-convention raw_data: expect.objectContaining({ - // eslint-disable-next-line @typescript-eslint/naming-convention fee_limit: FEE_LIMIT, }), }), @@ -514,7 +510,6 @@ describe('ClientRequestHandler', () => { type: 'TriggerSmartContract', parameter: { value: { - // eslint-disable-next-line @typescript-eslint/naming-convention owner_address: TronWeb.address.toHex( 'TGJn1wnUYHJbvN88cynZbsAz2EMeZq73yx', ), @@ -522,9 +517,9 @@ describe('ClientRequestHandler', () => { }, }, ], - // eslint-disable-next-line @typescript-eslint/naming-convention + ref_block_bytes: '0000', - // eslint-disable-next-line @typescript-eslint/naming-convention + ref_block_hash: '0000000000000000', expiration: currentTimestamp - 1, timestamp: currentTimestamp - 60_000, @@ -617,7 +612,6 @@ describe('ClientRequestHandler', () => { type: 'TriggerSmartContract', parameter: { value: { - // eslint-disable-next-line @typescript-eslint/naming-convention owner_address: TronWeb.address.toHex( 'TGJn1wnUYHJbvN88cynZbsAz2EMeZq73yx', ), @@ -632,9 +626,9 @@ describe('ClientRequestHandler', () => { const freshTransaction = { visible: false, txID: 'fresh-tx-id', - // eslint-disable-next-line @typescript-eslint/naming-convention + raw_data: mockRawData, - // eslint-disable-next-line @typescript-eslint/naming-convention + raw_data_hex: 'fresh-raw-data-hex', }; mockTransactionExpirationRefresherService.ensureFreshMetadata.mockResolvedValue( @@ -658,7 +652,7 @@ describe('ClientRequestHandler', () => { scope, transaction: expect.objectContaining({ txID: expect.any(String), - // eslint-disable-next-line @typescript-eslint/naming-convention + raw_data: mockRawData, }), }), @@ -702,12 +696,10 @@ describe('ClientRequestHandler', () => { { type: 'TriggerSmartContract', parameter: { - // eslint-disable-next-line @typescript-eslint/naming-convention type_url: 'type.googleapis.com/protocol.TriggerSmartContract', value: { - // eslint-disable-next-line @typescript-eslint/naming-convention owner_address: '41045d01eb63374da930ee0da30d58516ac14ce04c79', - // eslint-disable-next-line @typescript-eslint/naming-convention + contract_address: '419946f55aa08cfe8363959ce9930ebd567e2c14f', data: 'a9059cbb000000000000000000000000a614f803b6fd780986a42c78ec9c7f77e6ded13c0000000000000000000000000000000000000000000000000000000000000000', }, @@ -719,17 +711,16 @@ describe('ClientRequestHandler', () => { // Mock transaction signing const signedTransaction = { txID: 'test-tx-id', - // eslint-disable-next-line @typescript-eslint/naming-convention + raw_data: { contract: [ { type: 'TriggerSmartContract', parameter: { value: { - // eslint-disable-next-line @typescript-eslint/naming-convention owner_address: '41045d01eb63374da930ee0da30d58516ac14ce04c79', - // eslint-disable-next-line @typescript-eslint/naming-convention + contract_address: '419946f55aa08cfe8363959ce9930ebd567e2c14f', data: 'a9059cbb', @@ -738,7 +729,7 @@ describe('ClientRequestHandler', () => { }, ], }, - // eslint-disable-next-line @typescript-eslint/naming-convention + raw_data_hex: 'test-hex', signature: ['test-signature'], }; @@ -799,9 +790,9 @@ describe('ClientRequestHandler', () => { scope, transaction: expect.objectContaining({ txID: expect.any(String), - // eslint-disable-next-line @typescript-eslint/naming-convention + raw_data: expect.any(Object), - // eslint-disable-next-line @typescript-eslint/naming-convention + raw_data_hex: expect.any(String), visible: false, }), @@ -845,12 +836,10 @@ describe('ClientRequestHandler', () => { { type: 'TransferContract', parameter: { - // eslint-disable-next-line @typescript-eslint/naming-convention type_url: 'type.googleapis.com/protocol.TransferContract', value: { - // eslint-disable-next-line @typescript-eslint/naming-convention owner_address: '41045d01eb63374da930ee0da30d58516ac14ce04c79', - // eslint-disable-next-line @typescript-eslint/naming-convention + to_address: '419946f55aa08cfe8363959ce9930ebd567e2c14f', amount: 1000000, }, @@ -861,17 +850,16 @@ describe('ClientRequestHandler', () => { const signedTransaction = { txID: 'test-tx-id-2', - // eslint-disable-next-line @typescript-eslint/naming-convention + raw_data: { contract: [ { type: 'TransferContract', parameter: { value: { - // eslint-disable-next-line @typescript-eslint/naming-convention owner_address: '41045d01eb63374da930ee0da30d58516ac14ce04c79', - // eslint-disable-next-line @typescript-eslint/naming-convention + to_address: '419946f55aa08cfe8363959ce9930ebd567e2c14f', amount: 1000000, }, @@ -879,7 +867,7 @@ describe('ClientRequestHandler', () => { }, ], }, - // eslint-disable-next-line @typescript-eslint/naming-convention + raw_data_hex: 'test-hex-2', signature: ['test-signature-2'], }; @@ -914,9 +902,9 @@ describe('ClientRequestHandler', () => { scope, transaction: expect.objectContaining({ txID: expect.any(String), - // eslint-disable-next-line @typescript-eslint/naming-convention + raw_data: expect.any(Object), - // eslint-disable-next-line @typescript-eslint/naming-convention + raw_data_hex: expect.any(String), }), availableEnergy: BigNumber('0'), @@ -958,12 +946,10 @@ describe('ClientRequestHandler', () => { { type: 'TriggerSmartContract', parameter: { - // eslint-disable-next-line @typescript-eslint/naming-convention type_url: 'type.googleapis.com/protocol.TriggerSmartContract', value: { - // eslint-disable-next-line @typescript-eslint/naming-convention owner_address: '41045d01eb63374da930ee0da30d58516ac14ce04c79', - // eslint-disable-next-line @typescript-eslint/naming-convention + contract_address: '419946f55aa08cfe8363959ce9930ebd567e2c14f', }, }, @@ -972,9 +958,9 @@ describe('ClientRequestHandler', () => { }); mockTronWeb.trx.sign.mockResolvedValue({ txID: 'test-tx-id-3', - // eslint-disable-next-line @typescript-eslint/naming-convention + raw_data: {}, - // eslint-disable-next-line @typescript-eslint/naming-convention + raw_data_hex: 'test-hex-3', signature: [], }); @@ -1106,7 +1092,6 @@ describe('ClientRequestHandler', () => { * @returns The base64 encoded string. */ const utf8ToBase64 = (utf8: string): string => { - // eslint-disable-next-line no-restricted-globals return Buffer.from(utf8, 'utf8').toString('base64'); }; @@ -1600,7 +1585,6 @@ describe('ClientRequestHandler - signAndSendTransaction', () => { type: 'TriggerSmartContract', parameter: { value: { - // eslint-disable-next-line @typescript-eslint/naming-convention owner_address: WRONG_OWNER_ADDRESS_HEX, }, }, @@ -1650,7 +1634,6 @@ describe('ClientRequestHandler - signAndSendTransaction', () => { type: 'TriggerSmartContract', parameter: { value: { - // eslint-disable-next-line @typescript-eslint/naming-convention owner_address: CORRECT_OWNER_ADDRESS_HEX, }, }, @@ -1718,32 +1701,30 @@ describe('ClientRequestHandler - onAmountInput', () => { const createMockTransferTransaction = (): Transaction => ({ visible: false, txID: 'mock-tx-id', - // eslint-disable-next-line @typescript-eslint/naming-convention + raw_data: { contract: [ { type: 'TransferContract' as Transaction['raw_data']['contract'][number]['type'], parameter: { - // eslint-disable-next-line @typescript-eslint/naming-convention type_url: 'type.googleapis.com/protocol.TransferContract', value: { - // eslint-disable-next-line @typescript-eslint/naming-convention owner_address: `41${'a'.repeat(40)}`, - // eslint-disable-next-line @typescript-eslint/naming-convention + to_address: `41${'b'.repeat(40)}`, amount: 1000000, }, }, }, ], - // eslint-disable-next-line @typescript-eslint/naming-convention + ref_block_bytes: '0000', - // eslint-disable-next-line @typescript-eslint/naming-convention + ref_block_hash: '0'.repeat(16), expiration: Date.now() + 60000, timestamp: Date.now(), }, - // eslint-disable-next-line @typescript-eslint/naming-convention + raw_data_hex: 'mock-hex', }); @@ -2097,11 +2078,11 @@ describe('ClientRequestHandler - computeStakeFee', () => { const builtTransaction = { txID: 'stake-tx-id', - // eslint-disable-next-line @typescript-eslint/naming-convention + raw_data: { contract: [], }, - // eslint-disable-next-line @typescript-eslint/naming-convention + raw_data_hex: 'stake-hex', } as unknown as Transaction; @@ -2400,9 +2381,9 @@ describe('ClientRequestHandler - confirmSend validation', () => { const mockTransaction = { txID: 'test-tx-id', - // eslint-disable-next-line @typescript-eslint/naming-convention + raw_data: {}, - // eslint-disable-next-line @typescript-eslint/naming-convention + raw_data_hex: 'test-hex', } as unknown as Transaction; mockSendService.buildTransaction.mockResolvedValue(mockTransaction); diff --git a/packages/tron-wallet-snap/src/handlers/clientRequest/clientRequest.ts b/packages/tron-wallet-snap/src/handlers/clientRequest/clientRequest.ts index 414e41cb..bca2223d 100644 --- a/packages/tron-wallet-snap/src/handlers/clientRequest/clientRequest.ts +++ b/packages/tron-wallet-snap/src/handlers/clientRequest/clientRequest.ts @@ -15,26 +15,6 @@ import { import { BigNumber } from 'bignumber.js'; import type { TronWeb, Types } from 'tronweb'; -import { ClientRequestMethod, SendErrorCodes } from './types'; -import { - ClaimTrxStakingRewardsRequestStruct, - ClaimUnstakedTrxRequestStruct, - ComputeFeeRequestStruct, - ComputeFeeResponseStruct, - ComputeStakeFeeRequestStruct, - OnAddressInputRequestStruct, - OnAmountInputRequestStruct, - OnConfirmSendRequestStruct, - OnConfirmStakeRequestStruct, - OnConfirmUnstakeRequestStruct, - OnStakeAmountInputRequestStruct, - OnUnstakeAmountInputRequestStruct, - parseProofOfOwnershipMessage, - parseRewardsMessage, - SignAndSendTransactionRequestStruct, - SignProofOfOwnershipRequestStruct, - SignRewardsMessageRequestStruct, -} from './validation'; import type { SnapClient } from '../../clients/snap/SnapClient'; import type { TronWebFactory } from '../../clients/tronweb/TronWebFactory'; import { @@ -67,6 +47,26 @@ import { assertTransactionStructure, } from '../../validation/transaction'; import { BackgroundEventMethod } from '../cronjob'; +import { ClientRequestMethod, SendErrorCodes } from './types'; +import { + ClaimTrxStakingRewardsRequestStruct, + ClaimUnstakedTrxRequestStruct, + ComputeFeeRequestStruct, + ComputeFeeResponseStruct, + ComputeStakeFeeRequestStruct, + OnAddressInputRequestStruct, + OnAmountInputRequestStruct, + OnConfirmSendRequestStruct, + OnConfirmStakeRequestStruct, + OnConfirmUnstakeRequestStruct, + OnStakeAmountInputRequestStruct, + OnUnstakeAmountInputRequestStruct, + parseProofOfOwnershipMessage, + parseRewardsMessage, + SignAndSendTransactionRequestStruct, + SignProofOfOwnershipRequestStruct, + SignRewardsMessageRequestStruct, +} from './validation'; type TransactionRawData = Types.Transaction['raw_data'] & { // eslint-disable-next-line @typescript-eslint/naming-convention @@ -265,9 +265,9 @@ export class ClientRequestHandler { */ visible: false, txID, - // eslint-disable-next-line @typescript-eslint/naming-convention + raw_data: rawData, - // eslint-disable-next-line @typescript-eslint/naming-convention + raw_data_hex: rawDataHex, }; @@ -436,7 +436,6 @@ export class ClientRequestHandler { * sent. */ const totalTrxToSpend = - // eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison assetId === nativeTokenId ? valueBN.plus(trxFee) : trxFee; if (totalTrxToSpend.isGreaterThan(nativeTokenBalance)) { @@ -664,9 +663,9 @@ export class ClientRequestHandler { const transaction = { visible: false, txID, - // eslint-disable-next-line @typescript-eslint/naming-convention + raw_data: rawData, - // eslint-disable-next-line @typescript-eslint/naming-convention + raw_data_hex: rawDataHex, }; @@ -1198,7 +1197,6 @@ export class ClientRequestHandler { rawData.fee_limit = feeLimit; // Re-serialize rawData to get the updated rawDataHex const transactionPb = tronWeb.utils.transaction.txJsonToPb({ - // eslint-disable-next-line @typescript-eslint/naming-convention raw_data: rawData, }); return tronWeb.utils.transaction.txPbToRawDataHex(transactionPb); diff --git a/packages/tron-wallet-snap/src/handlers/clientRequest/validation.ts b/packages/tron-wallet-snap/src/handlers/clientRequest/validation.ts index 3a15f1e0..87bae5c7 100644 --- a/packages/tron-wallet-snap/src/handlers/clientRequest/validation.ts +++ b/packages/tron-wallet-snap/src/handlers/clientRequest/validation.ts @@ -18,7 +18,6 @@ import { JsonRpcVersionStruct, } from '@metamask/utils'; -import { ClientRequestMethod, SendErrorCodes } from './types'; import { NativeCaipAssetTypeStruct } from '../../services/assets/types'; import { Base64Struct, @@ -27,6 +26,7 @@ import { TronAddressStruct, UuidStruct, } from '../../validation/structs'; +import { ClientRequestMethod, SendErrorCodes } from './types'; /** * signAndSendTransaction request/response validation. diff --git a/packages/tron-wallet-snap/src/handlers/cronjob.test.tsx b/packages/tron-wallet-snap/src/handlers/cronjob.test.tsx index 7fc2dbc4..f00cacc2 100644 --- a/packages/tron-wallet-snap/src/handlers/cronjob.test.tsx +++ b/packages/tron-wallet-snap/src/handlers/cronjob.test.tsx @@ -1,4 +1,3 @@ -import { BackgroundEventMethod, CronHandler } from './cronjob'; import type { PriceApiClient } from '../clients/price-api/PriceApiClient'; import type { SnapClient } from '../clients/snap/SnapClient'; import type { TronHttpClient } from '../clients/tron-http/TronHttpClient'; @@ -13,17 +12,14 @@ import type { State, UnencryptedStateValue } from '../services/state/State'; import { TransactionExpirationRefresherService } from '../services/transaction-expiration-refresher/TransactionExpirationRefresherService'; import type { JsonTransactionRawData } from '../services/transaction-expiration-refresher/types'; import type { TransactionScanService } from '../services/transaction-scan/TransactionScanService'; -import { - SimulationStatus, - type TransactionScanResult, -} from '../services/transaction-scan/types'; +import { SimulationStatus } from '../services/transaction-scan/types'; +import type { TransactionScanResult } from '../services/transaction-scan/types'; import { FetchStatus } from '../types/snap'; -import { - CONFIRM_SIGN_TRANSACTION_INTERFACE_NAME, - type ConfirmSignTransactionContext, -} from '../ui/confirmation/views/ConfirmSignTransaction/types'; +import { CONFIRM_SIGN_TRANSACTION_INTERFACE_NAME } from '../ui/confirmation/views/ConfirmSignTransaction/types'; +import type { ConfirmSignTransactionContext } from '../ui/confirmation/views/ConfirmSignTransaction/types'; import type { ConfirmTransactionRequestContext } from '../ui/confirmation/views/ConfirmTransactionRequest/types'; import type { ILogger } from '../utils/logger'; +import { BackgroundEventMethod, CronHandler } from './cronjob'; /** * Subset of SnapClient methods exercised by `refreshConfirmationSend`. @@ -83,9 +79,8 @@ const createBlock = ({ hashSegment?: string; }) => ({ blockID: `${'0'.repeat(16)}${hashSegment}${'f'.repeat(32)}`, - // eslint-disable-next-line @typescript-eslint/naming-convention + block_header: { - // eslint-disable-next-line @typescript-eslint/naming-convention raw_data: { number, timestamp, @@ -173,17 +168,17 @@ function buildMockInterfaceContext( { type: 'TransferContract', parameter: { - type_url: 'type.googleapis.com/protocol.TransferContract', // eslint-disable-line @typescript-eslint/naming-convention + type_url: 'type.googleapis.com/protocol.TransferContract', value: { - owner_address: '41a2155e688b2baebdfdacd073ba79f5b22946aacf', // eslint-disable-line @typescript-eslint/naming-convention - to_address: '4132f9c0c487f21716b7a8f12906b752889902655', // eslint-disable-line @typescript-eslint/naming-convention + owner_address: '41a2155e688b2baebdfdacd073ba79f5b22946aacf', + to_address: '4132f9c0c487f21716b7a8f12906b752889902655', amount: 1000000, }, }, }, ], - ref_block_bytes: '', // eslint-disable-line @typescript-eslint/naming-convention - ref_block_hash: '', // eslint-disable-line @typescript-eslint/naming-convention + ref_block_bytes: '', + ref_block_hash: '', expiration: 0, timestamp: 0, } as any, @@ -350,17 +345,17 @@ function buildMockTronWebFactory({ { type: 'TransferContract', parameter: { - type_url: 'type.googleapis.com/protocol.TransferContract', // eslint-disable-line @typescript-eslint/naming-convention + type_url: 'type.googleapis.com/protocol.TransferContract', value: { - owner_address: '41a2155e688b2baebdfdacd073ba79f5b22946aacf', // eslint-disable-line @typescript-eslint/naming-convention - to_address: '4132f9c0c487f21716b7a8f12906b752889902655', // eslint-disable-line @typescript-eslint/naming-convention + owner_address: '41a2155e688b2baebdfdacd073ba79f5b22946aacf', + to_address: '4132f9c0c487f21716b7a8f12906b752889902655', amount: 1000000, }, }, }, ], - ref_block_bytes: '0001', // eslint-disable-line @typescript-eslint/naming-convention - ref_block_hash: 'outdatedhash', // eslint-disable-line @typescript-eslint/naming-convention + ref_block_bytes: '0001', + ref_block_hash: 'outdatedhash', expiration: currentBlock.block_header.raw_data.timestamp - 1, timestamp: currentBlock.block_header.raw_data.timestamp - 60_000, }), @@ -577,8 +572,8 @@ describe('CronHandler', () => { expect(scannedRawData).not.toBe(interfaceContext.transactionRawData); expect(scannedRawData).toStrictEqual( expect.objectContaining({ - ref_block_bytes: getRefBlockBytes(200_000), // eslint-disable-line @typescript-eslint/naming-convention - ref_block_hash: '0011223344556677', // eslint-disable-line @typescript-eslint/naming-convention + ref_block_bytes: getRefBlockBytes(200_000), + ref_block_hash: '0011223344556677', expiration: blockTimestamp + 60_000, timestamp: blockTimestamp, }), @@ -734,8 +729,8 @@ describe('CronHandler', () => { // so its stale TAPOS/expiration values are preserved as-is. expect(scannedRawData).toStrictEqual( expect.objectContaining({ - ref_block_bytes: '0001', // eslint-disable-line @typescript-eslint/naming-convention - ref_block_hash: 'outdatedhash', // eslint-disable-line @typescript-eslint/naming-convention + ref_block_bytes: '0001', + ref_block_hash: 'outdatedhash', expiration: blockTimestamp - 1, timestamp: blockTimestamp - 60_000, }), diff --git a/packages/tron-wallet-snap/src/handlers/cronjob.tsx b/packages/tron-wallet-snap/src/handlers/cronjob.tsx index 9daecb64..05b5d5a2 100644 --- a/packages/tron-wallet-snap/src/handlers/cronjob.tsx +++ b/packages/tron-wallet-snap/src/handlers/cronjob.tsx @@ -17,15 +17,11 @@ import { EXPIRED_TRANSACTION_SCAN } from '../services/transaction-scan/buildExpi import type { TransactionScanService } from '../services/transaction-scan/TransactionScanService'; import { FetchStatus } from '../types/snap'; import { ConfirmSignTransaction } from '../ui/confirmation/views/ConfirmSignTransaction/ConfirmSignTransaction'; -import { - CONFIRM_SIGN_TRANSACTION_INTERFACE_NAME, - type ConfirmSignTransactionContext, -} from '../ui/confirmation/views/ConfirmSignTransaction/types'; +import { CONFIRM_SIGN_TRANSACTION_INTERFACE_NAME } from '../ui/confirmation/views/ConfirmSignTransaction/types'; +import type { ConfirmSignTransactionContext } from '../ui/confirmation/views/ConfirmSignTransaction/types'; import { ConfirmTransactionRequest } from '../ui/confirmation/views/ConfirmTransactionRequest/ConfirmTransactionRequest'; -import { - CONFIRM_TRANSACTION_INTERFACE_NAME, - type ConfirmTransactionRequestContext, -} from '../ui/confirmation/views/ConfirmTransactionRequest/types'; +import { CONFIRM_TRANSACTION_INTERFACE_NAME } from '../ui/confirmation/views/ConfirmTransactionRequest/types'; +import type { ConfirmTransactionRequestContext } from '../ui/confirmation/views/ConfirmTransactionRequest/types'; import type { ILogger } from '../utils/logger'; import { createPrefixedLogger } from '../utils/logger'; diff --git a/packages/tron-wallet-snap/src/handlers/keyring.test.ts b/packages/tron-wallet-snap/src/handlers/keyring.test.ts index 98d74a4c..b3c68105 100644 --- a/packages/tron-wallet-snap/src/handlers/keyring.test.ts +++ b/packages/tron-wallet-snap/src/handlers/keyring.test.ts @@ -1,7 +1,7 @@ -import { - AccountCreationType, - type CreateAccountOptions as KeyringBatchCreateAccountOptions, - type KeyringRequest, +import { AccountCreationType } from '@metamask/keyring-api'; +import type { + CreateAccountOptions as KeyringBatchCreateAccountOptions, + KeyringRequest, } from '@metamask/keyring-api'; import { InvalidParamsError, @@ -11,8 +11,6 @@ import { bytesToBase64, bytesToHex, stringToBytes } from '@metamask/utils'; import type { SnapClient } from '../clients/snap/SnapClient'; import { Network } from '../constants'; -import { KeyringHandler } from './keyring'; -import { TronMultichainMethod } from './keyring-types'; import type { TronKeyringAccount } from '../entities/keyring-account'; import type { AccountsService } from '../services/accounts/AccountsService'; import type { AssetsService } from '../services/assets/AssetsService'; @@ -20,6 +18,8 @@ import type { ConfirmationHandler } from '../services/confirmation/ConfirmationH import type { TransactionsService } from '../services/transactions/TransactionsService'; import type { WalletService } from '../services/wallet/WalletService'; import { mockLogger } from '../utils/mockLogger'; +import { KeyringHandler } from './keyring'; +import { TronMultichainMethod } from './keyring-types'; /** * Helper function to convert string to base64. diff --git a/packages/tron-wallet-snap/src/handlers/keyring.ts b/packages/tron-wallet-snap/src/handlers/keyring.ts index ed703d36..7864a0c6 100644 --- a/packages/tron-wallet-snap/src/handlers/keyring.ts +++ b/packages/tron-wallet-snap/src/handlers/keyring.ts @@ -2,17 +2,19 @@ import { KeyringEvent, ListAccountAssetsResponseStruct, - type Balance, - type CreateAccountOptions as KeyringBatchCreateAccountOptions, - type DiscoveredAccount, - type EntropySourceId, - type Keyring, - type KeyringAccount, - type KeyringRequest, - type KeyringResponse, - type Pagination, - type ResolvedAccountAddress, - type Transaction, +} from '@metamask/keyring-api'; +import type { + Balance, + CreateAccountOptions as KeyringBatchCreateAccountOptions, + DiscoveredAccount, + EntropySourceId, + Keyring, + KeyringAccount, + KeyringRequest, + KeyringResponse, + Pagination, + ResolvedAccountAddress, + Transaction, } from '@metamask/keyring-api'; import { emitSnapKeyringEvent, @@ -33,13 +35,10 @@ import type { import { sortBy } from 'lodash'; import type { SnapClient } from '../clients/snap/SnapClient'; -import { ESSENTIAL_ASSETS, type Network } from '../constants'; -import { BackgroundEventMethod } from './cronjob'; -import { TronMultichainMethod } from './keyring-types'; -import { - asStrictKeyringAccount, - type TronKeyringAccount, -} from '../entities/keyring-account'; +import { ESSENTIAL_ASSETS } from '../constants'; +import type { Network } from '../constants'; +import { asStrictKeyringAccount } from '../entities/keyring-account'; +import type { TronKeyringAccount } from '../entities/keyring-account'; import type { AccountsService } from '../services/accounts/AccountsService'; import type { CreateAccountOptions } from '../services/accounts/types'; import type { AssetsService } from '../services/assets/AssetsService'; @@ -47,7 +46,8 @@ import type { ConfirmationHandler } from '../services/confirmation/ConfirmationH import type { TransactionsService } from '../services/transactions/TransactionsService'; import type { WalletService } from '../services/wallet/WalletService'; import { sanitizeSensitiveError } from '../utils/errors'; -import { createPrefixedLogger, type ILogger } from '../utils/logger'; +import { createPrefixedLogger } from '../utils/logger'; +import type { ILogger } from '../utils/logger'; import { CreateAccountOptionsStruct, DeleteAccountStruct, @@ -59,14 +59,16 @@ import { ListAccountTransactionsStruct, SignTransactionRequestStruct, TronKeyringRequestStruct, - type TronWalletKeyringRequest, UuidStruct, } from '../validation/structs'; +import type { TronWalletKeyringRequest } from '../validation/structs'; import { validateOrigin, validateRequest, validateResponse, } from '../validation/validators'; +import { BackgroundEventMethod } from './cronjob'; +import { TronMultichainMethod } from './keyring-types'; export class KeyringHandler implements Keyring { readonly #logger: ILogger; diff --git a/packages/tron-wallet-snap/src/handlers/userInput.ts b/packages/tron-wallet-snap/src/handlers/userInput.ts index 9a71030e..4aadc48e 100644 --- a/packages/tron-wallet-snap/src/handlers/userInput.ts +++ b/packages/tron-wallet-snap/src/handlers/userInput.ts @@ -4,7 +4,8 @@ import type { SnapClient } from '../clients/snap/SnapClient'; import { createEventHandlers as createSignMessageEvents } from '../ui/confirmation/views/ConfirmSignMessage/events'; import { createEventHandlers as createSignTransactionEvents } from '../ui/confirmation/views/ConfirmSignTransaction/events'; import { createEventHandlers as createTransactionConfirmationEvents } from '../ui/confirmation/views/ConfirmTransactionRequest/events'; -import { createPrefixedLogger, type ILogger } from '../utils/logger'; +import { createPrefixedLogger } from '../utils/logger'; +import type { ILogger } from '../utils/logger'; export class UserInputHandler { readonly #logger: ILogger; diff --git a/packages/tron-wallet-snap/src/services/accounts/AccountsRepository.test.ts b/packages/tron-wallet-snap/src/services/accounts/AccountsRepository.test.ts index 56d1a231..a972dda7 100644 --- a/packages/tron-wallet-snap/src/services/accounts/AccountsRepository.test.ts +++ b/packages/tron-wallet-snap/src/services/accounts/AccountsRepository.test.ts @@ -1,9 +1,9 @@ import { TrxAccountType, TrxScope } from '@metamask/keyring-api'; -import { AccountsRepository } from './AccountsRepository'; import type { TronKeyringAccount } from '../../entities/keyring-account'; import { InMemoryState } from '../state/InMemoryState'; import type { UnencryptedStateValue } from '../state/State'; +import { AccountsRepository } from './AccountsRepository'; /** * Creates an empty in-memory state for repository tests. diff --git a/packages/tron-wallet-snap/src/services/accounts/AccountsService.test.ts b/packages/tron-wallet-snap/src/services/accounts/AccountsService.test.ts index 5ecc24f7..72fff9db 100644 --- a/packages/tron-wallet-snap/src/services/accounts/AccountsService.test.ts +++ b/packages/tron-wallet-snap/src/services/accounts/AccountsService.test.ts @@ -19,8 +19,6 @@ import { getSelectedAccounts, } from '@metamask/keyring-snap-sdk'; -import type { AccountsRepository } from './AccountsRepository'; -import { AccountsService } from './AccountsService'; import type { SnapClient } from '../../clients/snap/SnapClient'; import { Network } from '../../constants'; import type { NativeAsset } from '../../entities/assets'; @@ -31,6 +29,8 @@ import type { AssetsService } from '../assets/AssetsService'; import type { ConfigProvider } from '../config'; import type { Config } from '../config/ConfigProvider'; import type { TransactionsService } from '../transactions/TransactionsService'; +import type { AccountsRepository } from './AccountsRepository'; +import { AccountsService } from './AccountsService'; jest.mock('@metamask/keyring-snap-sdk', () => ({ emitSnapKeyringEvent: jest.fn(), diff --git a/packages/tron-wallet-snap/src/services/accounts/AccountsService.ts b/packages/tron-wallet-snap/src/services/accounts/AccountsService.ts index d5d82acf..25006633 100644 --- a/packages/tron-wallet-snap/src/services/accounts/AccountsService.ts +++ b/packages/tron-wallet-snap/src/services/accounts/AccountsService.ts @@ -21,21 +21,20 @@ import { hexToBytes } from '@metamask/utils'; import { computeAddress } from 'ethers'; import { TronWeb } from 'tronweb'; -import type { AccountsRepository } from './AccountsRepository'; -import type { CreateAccountOptions } from './types'; import type { SnapClient } from '../../clients/snap/SnapClient'; -import { - asStrictKeyringAccount, - type TronKeyringAccount, -} from '../../entities/keyring-account'; +import { asStrictKeyringAccount } from '../../entities/keyring-account'; +import type { TronKeyringAccount } from '../../entities/keyring-account'; import { createTronBip44AddressDeriver } from '../../utils/deriveTronFromCoinTypeNode'; import { sanitizeSensitiveError } from '../../utils/errors'; import { getLowestUnusedIndex } from '../../utils/getLowestUnusedIndex'; -import { createPrefixedLogger, type ILogger } from '../../utils/logger'; +import { createPrefixedLogger } from '../../utils/logger'; +import type { ILogger } from '../../utils/logger'; import { DerivationPathStruct } from '../../validation/structs'; import type { AssetsService } from '../assets/AssetsService'; import type { ConfigProvider } from '../config'; import type { TransactionsService } from '../transactions/TransactionsService'; +import type { AccountsRepository } from './AccountsRepository'; +import type { CreateAccountOptions } from './types'; /** * Elliptic curve for TRON (same as Ethereum) diff --git a/packages/tron-wallet-snap/src/services/assets/AssetsRepository.test.ts b/packages/tron-wallet-snap/src/services/assets/AssetsRepository.test.ts index 1ae41912..967e647f 100644 --- a/packages/tron-wallet-snap/src/services/assets/AssetsRepository.test.ts +++ b/packages/tron-wallet-snap/src/services/assets/AssetsRepository.test.ts @@ -1,5 +1,3 @@ -import { AssetsRepository } from './AssetsRepository'; -import type { NativeCaipAssetType, TokenCaipAssetType } from './types'; import { KnownCaip19Id, Network } from '../../constants'; import type { AssetEntity, @@ -8,6 +6,8 @@ import type { } from '../../entities/assets'; import type { IStateManager } from '../state/IStateManager'; import type { UnencryptedStateValue } from '../state/State'; +import { AssetsRepository } from './AssetsRepository'; +import type { NativeCaipAssetType, TokenCaipAssetType } from './types'; describe('AssetsRepository', () => { const createNativeAsset = ({ diff --git a/packages/tron-wallet-snap/src/services/assets/AssetsRepository.ts b/packages/tron-wallet-snap/src/services/assets/AssetsRepository.ts index e540b000..d4c480f2 100644 --- a/packages/tron-wallet-snap/src/services/assets/AssetsRepository.ts +++ b/packages/tron-wallet-snap/src/services/assets/AssetsRepository.ts @@ -24,7 +24,7 @@ export class AssetsRepository { assetType: string, ): Promise { const assets = await this.getByAccountId(keyringAccountId); - // eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison + return assets.find((asset) => asset.assetType === assetType) ?? null; } @@ -45,7 +45,6 @@ export class AssetsRepository { // We iterate through the assetTypes to preserve the order for (const assetType of assetTypes) { const asset = assets.find( - // eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison (currAsset) => currAsset.assetType === assetType, ); result.push(asset ?? null); diff --git a/packages/tron-wallet-snap/src/services/assets/AssetsService.test.ts b/packages/tron-wallet-snap/src/services/assets/AssetsService.test.ts index 4d6983c7..b41e8c7d 100644 --- a/packages/tron-wallet-snap/src/services/assets/AssetsService.test.ts +++ b/packages/tron-wallet-snap/src/services/assets/AssetsService.test.ts @@ -2,19 +2,19 @@ import type { KeyringAccount } from '@metamask/keyring-api'; import { KeyringEvent } from '@metamask/keyring-api'; import { emitSnapKeyringEvent } from '@metamask/keyring-snap-sdk'; -import type { AssetsRepository } from './AssetsRepository'; -import type { NativeCaipAssetType, TokenCaipAssetType } from './types'; import type { PriceApiClient } from '../../clients/price-api/PriceApiClient'; import type { SpotPrices } from '../../clients/price-api/types'; import type { SnapClient } from '../../clients/snap/SnapClient'; import type { TokenApiClient } from '../../clients/token-api/TokenApiClient'; import type { AccountResources, TronHttpClient } from '../../clients/tron-http'; import { TrongridAccountNotFoundError } from '../../clients/trongrid/errors'; -import { type TrongridApiClient } from '../../clients/trongrid/TrongridApiClient'; +import type { TrongridApiClient } from '../../clients/trongrid/TrongridApiClient'; import type { Trc20Balance, TronAccount } from '../../clients/trongrid/types'; import { KnownCaip19Id, Network } from '../../constants'; import type { AssetEntity } from '../../entities/assets'; import { mockLogger } from '../../utils/mockLogger'; +import type { AssetsRepository } from './AssetsRepository'; +import type { NativeCaipAssetType, TokenCaipAssetType } from './types'; /** * Subset of State methods. @@ -46,10 +46,9 @@ jest.mock('@metamask/keyring-snap-sdk', () => ({ emitSnapKeyringEvent: jest.fn(), })); -// eslint-disable-next-line no-restricted-globals (global as any).snap = {}; -// eslint-disable-next-line @typescript-eslint/no-require-imports, no-restricted-globals +// eslint-disable-next-line @typescript-eslint/no-require-imports const { AssetsService } = require('./AssetsService'); const mockAccount: KeyringAccount = { @@ -96,7 +95,7 @@ const createSpotPrices = ( * @param overrides - Partial TronAccount with required address. * @returns A complete TronAccount. */ -/* eslint-disable @typescript-eslint/naming-convention */ + const createMockTronAccount = ( overrides: Partial & { address: string }, ): TronAccount => ({ @@ -119,7 +118,6 @@ const createMockTronAccount = ( net_window_optimized: false, ...overrides, }); -/* eslint-enable @typescript-eslint/naming-convention */ // Convenience alias used by bandwidth/energy tests const minimalTronAccount = createMockTronAccount({ @@ -335,7 +333,6 @@ describe('AssetsService', () => { const expectedTrc20AssetType = `${String(Network.Mainnet)}/trc20:TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t`; const trc20Asset = assets.find( (asset: AssetEntity) => - // eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison asset.assetType === expectedTrc20AssetType, ); expect(trc20Asset).toBeDefined(); @@ -490,14 +487,12 @@ describe('AssetsService', () => { const usdtAssetType = `${String(Network.Mainnet)}/trc20:TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t`; const usdtAsset = assets.find( - // eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison (asset: AssetEntity) => asset.assetType === usdtAssetType, ); expect(usdtAsset).toBeDefined(); const spamAssetType = `${String(Network.Mainnet)}/trc20:TSpamToken123456789`; const spamAsset = assets.find( - // eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison (asset: AssetEntity) => asset.assetType === spamAssetType, ); expect(spamAsset).toBeUndefined(); @@ -556,7 +551,6 @@ describe('AssetsService', () => { expect(trxAsset?.rawAmount).toBe('0'); const trc20Asset = assets.find( - // eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison (asset: AssetEntity) => asset.assetType === trc20AssetId, ); expect(trc20Asset).toBeDefined(); @@ -827,7 +821,6 @@ describe('AssetsService', () => { }); }); - /* eslint-disable @typescript-eslint/naming-convention */ describe('TRX ready for withdrawal', () => { it('returns zero balance when account has no unfrozenV2 data', async () => { await withAssetsService( @@ -1001,9 +994,7 @@ describe('AssetsService', () => { ); }); }); - /* eslint-enable @typescript-eslint/naming-convention */ - /* eslint-disable @typescript-eslint/naming-convention */ describe('TRX in lock period', () => { it('returns zero balance when account has no unfrozenV2 data', async () => { await withAssetsService( @@ -1216,7 +1207,6 @@ describe('AssetsService', () => { ); }); }); - /* eslint-enable @typescript-eslint/naming-convention */ describe('energy', () => { it('returns 0 when account has no resources', async () => { diff --git a/packages/tron-wallet-snap/src/services/assets/AssetsService.ts b/packages/tron-wallet-snap/src/services/assets/AssetsService.ts index 9334f56a..4675a349 100644 --- a/packages/tron-wallet-snap/src/services/assets/AssetsService.ts +++ b/packages/tron-wallet-snap/src/services/assets/AssetsService.ts @@ -1,8 +1,8 @@ -import { - KeyringEvent, - type AccountAssetListUpdatedEvent, - type AccountBalancesUpdatedEvent, - type KeyringAccount, +import { KeyringEvent } from '@metamask/keyring-api'; +import type { + AccountAssetListUpdatedEvent, + AccountBalancesUpdatedEvent, + KeyringAccount, } from '@metamask/keyring-api'; import { emitSnapKeyringEvent } from '@metamask/keyring-snap-sdk'; import type { @@ -18,17 +18,6 @@ import { CaipAssetTypeStruct, parseCaipAssetType } from '@metamask/utils'; import { BigNumber } from 'bignumber.js'; import { pick } from 'lodash'; -import type { AssetsRepository } from './AssetsRepository'; -import type { - InLockPeriodCaipAssetType, - NativeCaipAssetType, - NftCaipAssetType, - ReadyForWithdrawalCaipAssetType, - ResourceCaipAssetType, - StakedCaipAssetType, - StakingRewardsCaipAssetType, - TokenCaipAssetType, -} from './types'; import type { PriceApiClient } from '../../clients/price-api/PriceApiClient'; import type { FiatTicker, @@ -68,8 +57,20 @@ import { import { configProvider } from '../../context'; import type { AssetEntity } from '../../entities/assets'; import { toUiAmount } from '../../utils/conversion'; -import { createPrefixedLogger, type ILogger } from '../../utils/logger'; +import { createPrefixedLogger } from '../../utils/logger'; +import type { ILogger } from '../../utils/logger'; import type { State, UnencryptedStateValue } from '../state/State'; +import type { AssetsRepository } from './AssetsRepository'; +import type { + InLockPeriodCaipAssetType, + NativeCaipAssetType, + NftCaipAssetType, + ReadyForWithdrawalCaipAssetType, + ResourceCaipAssetType, + StakedCaipAssetType, + StakingRewardsCaipAssetType, + TokenCaipAssetType, +} from './types'; /** * Normalized account data structure that provides a consistent shape for both diff --git a/packages/tron-wallet-snap/src/services/assets/types.ts b/packages/tron-wallet-snap/src/services/assets/types.ts index 0332b9dc..19791f83 100644 --- a/packages/tron-wallet-snap/src/services/assets/types.ts +++ b/packages/tron-wallet-snap/src/services/assets/types.ts @@ -1,7 +1,8 @@ -import { CaipAssetTypeStruct, type TrxScope } from '@metamask/keyring-api'; +import { CaipAssetTypeStruct } from '@metamask/keyring-api'; +import type { TrxScope } from '@metamask/keyring-api'; import { pattern } from '@metamask/superstruct'; -import { type Network } from '../../constants'; +import type { Network } from '../../constants'; export type NativeCaipAssetType = `${Network}/slip44:195`; export type StakedCaipAssetType = diff --git a/packages/tron-wallet-snap/src/services/confirmation/ConfirmationHandler.test.ts b/packages/tron-wallet-snap/src/services/confirmation/ConfirmationHandler.test.ts index 28f0171d..e7551f30 100644 --- a/packages/tron-wallet-snap/src/services/confirmation/ConfirmationHandler.test.ts +++ b/packages/tron-wallet-snap/src/services/confirmation/ConfirmationHandler.test.ts @@ -49,7 +49,7 @@ jest.mock('../../ui/confirmation/utils/getIconUrlForKnownAsset', () => ({ getIconUrlForKnownAsset: jest.fn(() => 'mock-icon-url'), })); -// eslint-disable-next-line @typescript-eslint/no-require-imports, no-restricted-globals +// eslint-disable-next-line @typescript-eslint/no-require-imports const { ConfirmationHandler } = require('./ConfirmationHandler'); const mockGetIconUrlForKnownAsset = jest.mocked(getIconUrlForKnownAsset); @@ -126,7 +126,7 @@ async function withConfirmationHandler( transactionBuilder: { withdrawExpireUnfreeze: jest .fn() - // eslint-disable-next-line @typescript-eslint/naming-convention + .mockResolvedValue({ raw_data: {} }), }, utils: { @@ -285,7 +285,7 @@ describe('ConfirmationHandler', () => { expect(mockFeeCalculatorService.computeFee).toHaveBeenCalledWith({ scope: Network.Mainnet, - // eslint-disable-next-line @typescript-eslint/naming-convention + transaction: { raw_data: {} }, availableEnergy: ZERO, availableBandwidth: ZERO, @@ -329,7 +329,7 @@ describe('ConfirmationHandler', () => { expect(mockFeeCalculatorService.computeFee).toHaveBeenCalledWith({ scope: Network.Mainnet, - // eslint-disable-next-line @typescript-eslint/naming-convention + transaction: { raw_data: {} }, availableEnergy: new BigNumber('3000'), availableBandwidth: new BigNumber('5000'), @@ -403,9 +403,9 @@ describe('ConfirmationHandler', () => { const mockTransactionRawData = { contract: [{ parameter: { value: {} }, type: 'TransferContract' }], - // eslint-disable-next-line @typescript-eslint/naming-convention + ref_block_bytes: 'abcd', - // eslint-disable-next-line @typescript-eslint/naming-convention + ref_block_hash: '12345678', expiration: 1700000000000, timestamp: 1699999000000, @@ -533,9 +533,9 @@ describe('ConfirmationHandler', () => { const rawData = { contract: [{ parameter: { value: {} }, type: 'TransferContract' }], - // eslint-disable-next-line @typescript-eslint/naming-convention + ref_block_bytes: 'abcd', - // eslint-disable-next-line @typescript-eslint/naming-convention + ref_block_hash: '12345678', expiration: 1_700_000_000_000, timestamp: 1_699_999_000_000, diff --git a/packages/tron-wallet-snap/src/services/confirmation/ConfirmationHandler.ts b/packages/tron-wallet-snap/src/services/confirmation/ConfirmationHandler.ts index c9879c8a..f90078d2 100644 --- a/packages/tron-wallet-snap/src/services/confirmation/ConfirmationHandler.ts +++ b/packages/tron-wallet-snap/src/services/confirmation/ConfirmationHandler.ts @@ -5,7 +5,8 @@ import type { Types } from 'tronweb'; import type { SnapClient } from '../../clients/snap/SnapClient'; import type { TronWebFactory } from '../../clients/tronweb/TronWebFactory'; -import { type Network, Networks, ZERO } from '../../constants'; +import { Networks, ZERO } from '../../constants'; +import type { Network } from '../../constants'; import type { AssetEntity } from '../../entities/assets'; import type { TronKeyringAccount } from '../../entities/keyring-account'; import { TronMultichainMethod } from '../../handlers/keyring-types'; @@ -15,19 +16,15 @@ import { getIconUrlForKnownAsset } from '../../ui/confirmation/utils/getIconUrlF import { render as renderConfirmSignMessage } from '../../ui/confirmation/views/ConfirmSignMessage/render'; import { ConfirmSignTransaction } from '../../ui/confirmation/views/ConfirmSignTransaction/ConfirmSignTransaction'; import { render as renderConfirmSignTransaction } from '../../ui/confirmation/views/ConfirmSignTransaction/render'; -import { - CONFIRM_SIGN_TRANSACTION_INTERFACE_NAME, - type ConfirmSignTransactionContext, -} from '../../ui/confirmation/views/ConfirmSignTransaction/types'; +import { CONFIRM_SIGN_TRANSACTION_INTERFACE_NAME } from '../../ui/confirmation/views/ConfirmSignTransaction/types'; +import type { ConfirmSignTransactionContext } from '../../ui/confirmation/views/ConfirmSignTransaction/types'; import { render as renderConfirmTransactionRequest } from '../../ui/confirmation/views/ConfirmTransactionRequest/render'; import { CONFIRM_TRANSACTION_INTERFACE_NAME } from '../../ui/confirmation/views/ConfirmTransactionRequest/types'; import { formatOrigin } from '../../utils/formatOrigin'; import type { ILogger } from '../../utils/logger'; import logger, { createPrefixedLogger } from '../../utils/logger'; -import { - SignTransactionRequestStruct, - type TronWalletKeyringRequest, -} from '../../validation/structs'; +import { SignTransactionRequestStruct } from '../../validation/structs'; +import type { TronWalletKeyringRequest } from '../../validation/structs'; import { assertTransactionStructure } from '../../validation/transaction'; import type { AssetsService } from '../assets/AssetsService'; import type { FeeCalculatorService } from '../send/FeeCalculatorService'; diff --git a/packages/tron-wallet-snap/src/services/send/FeeCalculatorService.test.ts b/packages/tron-wallet-snap/src/services/send/FeeCalculatorService.test.ts index 830d7a70..8d28c79b 100644 --- a/packages/tron-wallet-snap/src/services/send/FeeCalculatorService.test.ts +++ b/packages/tron-wallet-snap/src/services/send/FeeCalculatorService.test.ts @@ -1,9 +1,6 @@ -/* eslint-disable @typescript-eslint/naming-convention */ import { FeeType } from '@metamask/keyring-api'; import { BigNumber } from 'bignumber.js'; -import { FeeUnavailableError } from './errors'; -import { FeeCalculatorService } from './FeeCalculatorService'; import type { SnapClient } from '../../clients/snap/SnapClient'; import type { TriggerConstantContractResponse } from '../../clients/tron-http'; import type { TronHttpClient } from '../../clients/tron-http/TronHttpClient'; @@ -18,6 +15,8 @@ import { mockLogger } from '../../utils/mockLogger'; import nativeTransferMock from '../transactions/mocks/trongrid/account-transactions/native-transfer.json'; import trc10TransferMock from '../transactions/mocks/trongrid/account-transactions/trc10-transfer.json'; import trc20TransferMock from '../transactions/mocks/trongrid/account-transactions/trc20-transfer.json'; +import { FeeUnavailableError } from './errors'; +import { FeeCalculatorService } from './FeeCalculatorService'; // Helper to get transaction examples in the expected format const getTransactionExample = (type: 'native' | 'trc10' | 'trc20'): any => { diff --git a/packages/tron-wallet-snap/src/services/send/FeeCalculatorService.ts b/packages/tron-wallet-snap/src/services/send/FeeCalculatorService.ts index 4e089945..d324bf70 100644 --- a/packages/tron-wallet-snap/src/services/send/FeeCalculatorService.ts +++ b/packages/tron-wallet-snap/src/services/send/FeeCalculatorService.ts @@ -3,8 +3,6 @@ import { FeeType } from '@metamask/keyring-api'; import { BigNumber } from 'bignumber.js'; import type { Transaction } from 'tronweb/lib/esm/types'; -import { FeeUnavailableError } from './errors'; -import type { ComputeFeeResult } from './types'; import type { SnapClient } from '../../clients/snap/SnapClient'; import type { TronHttpClient } from '../../clients/tron-http/TronHttpClient'; import type { @@ -12,7 +10,7 @@ import type { ContractInfo, } from '../../clients/tron-http/types'; import { TrongridAccountNotFoundError } from '../../clients/trongrid/errors'; -import { type TrongridApiClient } from '../../clients/trongrid/TrongridApiClient'; +import type { TrongridApiClient } from '../../clients/trongrid/TrongridApiClient'; import type { Network } from '../../constants'; import { ACCOUNT_ACTIVATION_FEE_TRX, @@ -26,6 +24,8 @@ import { } from '../../constants'; import type { ILogger } from '../../utils/logger'; import { createPrefixedLogger } from '../../utils/logger'; +import { FeeUnavailableError } from './errors'; +import type { ComputeFeeResult } from './types'; /** * Bandwidth calculation constants. diff --git a/packages/tron-wallet-snap/src/services/send/SendService.test.ts b/packages/tron-wallet-snap/src/services/send/SendService.test.ts index aed6026a..1bd026a9 100644 --- a/packages/tron-wallet-snap/src/services/send/SendService.test.ts +++ b/packages/tron-wallet-snap/src/services/send/SendService.test.ts @@ -4,7 +4,6 @@ import { BigNumber } from 'bignumber.js'; import { TronWeb } from 'tronweb'; import type { Transaction, TransferContract } from 'tronweb/lib/esm/types'; -import { SendService } from './SendService'; import { FEE_LIMIT, Network, @@ -16,6 +15,7 @@ import { SendErrorCodes } from '../../handlers/clientRequest/types'; import { BackgroundEventMethod } from '../../handlers/cronjob'; import { mockLogger } from '../../utils/mockLogger'; import { TransactionExpirationRefresherService } from '../transaction-expiration-refresher/TransactionExpirationRefresherService'; +import { SendService } from './SendService'; describe('SendService', () => { type MockTransferContract = diff --git a/packages/tron-wallet-snap/src/services/send/SendService.ts b/packages/tron-wallet-snap/src/services/send/SendService.ts index 1a59dedf..3e988e4f 100644 --- a/packages/tron-wallet-snap/src/services/send/SendService.ts +++ b/packages/tron-wallet-snap/src/services/send/SendService.ts @@ -9,8 +9,6 @@ import type { TriggerSmartContract, } from 'tronweb/lib/esm/types'; -import type { FeeCalculatorService } from './FeeCalculatorService'; -import type { SendValidationResult } from './types'; import type { SnapClient } from '../../clients/snap/SnapClient'; import type { TronWebFactory } from '../../clients/tronweb/TronWebFactory'; import type { Network } from '../../constants'; @@ -19,11 +17,14 @@ import type { AssetEntity } from '../../entities/assets'; import { SendErrorCodes } from '../../handlers/clientRequest/types'; import { BackgroundEventMethod } from '../../handlers/cronjob'; import { toRawAmount, trxToSun } from '../../utils/conversion'; -import { createPrefixedLogger, type ILogger } from '../../utils/logger'; +import { createPrefixedLogger } from '../../utils/logger'; +import type { ILogger } from '../../utils/logger'; import { assertTransactionSignerConsistency } from '../../validation/transaction'; import type { AccountsService } from '../accounts/AccountsService'; import type { AssetsService } from '../assets/AssetsService'; import type { TransactionExpirationRefresherService } from '../transaction-expiration-refresher/TransactionExpirationRefresherService'; +import type { FeeCalculatorService } from './FeeCalculatorService'; +import type { SendValidationResult } from './types'; export class SendService { readonly #accountsService: AccountsService; diff --git a/packages/tron-wallet-snap/src/services/send/TransactionExpirationRefresherService.test.ts b/packages/tron-wallet-snap/src/services/send/TransactionExpirationRefresherService.test.ts index fa18fd83..e1bdf996 100644 --- a/packages/tron-wallet-snap/src/services/send/TransactionExpirationRefresherService.test.ts +++ b/packages/tron-wallet-snap/src/services/send/TransactionExpirationRefresherService.test.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/naming-convention */ import { Network } from '../../constants'; import { TransactionExpirationRefresherService, diff --git a/packages/tron-wallet-snap/src/services/staking/StakingService.test.ts b/packages/tron-wallet-snap/src/services/staking/StakingService.test.ts index 2b2b39be..985a8366 100644 --- a/packages/tron-wallet-snap/src/services/staking/StakingService.test.ts +++ b/packages/tron-wallet-snap/src/services/staking/StakingService.test.ts @@ -1,6 +1,5 @@ import { BigNumber } from 'bignumber.js'; -import { StakingService } from './StakingService'; import type { SnapClient } from '../../clients/snap/SnapClient'; import type { TronWebFactory } from '../../clients/tronweb/TronWebFactory'; import { @@ -13,6 +12,7 @@ import { BackgroundEventMethod } from '../../handlers/cronjob'; import { trxToSun } from '../../utils/conversion'; import { mockLogger } from '../../utils/mockLogger'; import type { AccountsService } from '../accounts/AccountsService'; +import { StakingService } from './StakingService'; describe('StakingService', () => { let stakingService: StakingService; @@ -36,12 +36,12 @@ describe('StakingService', () => { const mockKeypair = { privateKeyHex: '1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef', - // eslint-disable-next-line no-restricted-globals + privateKeyBytes: Buffer.from( '1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef', 'hex', ), - // eslint-disable-next-line no-restricted-globals + publicKeyBytes: Buffer.from( 'abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890', 'hex', @@ -51,16 +51,15 @@ describe('StakingService', () => { const mockTransaction = { txID: 'mock-transaction-id', - // eslint-disable-next-line @typescript-eslint/naming-convention + raw_data: { contract: [ { type: 'FreezeBalanceV2Contract', parameter: { value: { - // eslint-disable-next-line @typescript-eslint/naming-convention owner_address: 'TGJn1wnUYHJbvN88cynZbsAz2EMeZq73yx', - // eslint-disable-next-line @typescript-eslint/naming-convention + frozen_balance: 1000000, resource: 'BANDWIDTH', }, diff --git a/packages/tron-wallet-snap/src/services/state/InMemoryState.ts b/packages/tron-wallet-snap/src/services/state/InMemoryState.ts index 03bf2cca..3ddf9f65 100644 --- a/packages/tron-wallet-snap/src/services/state/InMemoryState.ts +++ b/packages/tron-wallet-snap/src/services/state/InMemoryState.ts @@ -1,7 +1,7 @@ import { get, set, unset } from 'lodash'; -import type { IStateManager } from './IStateManager'; import type { Serializable } from '../../utils/serialization/types'; +import type { IStateManager } from './IStateManager'; /** * A simple implementation of the `IStateManager` interface that relies on an in memory state that can be used for testing purposes. diff --git a/packages/tron-wallet-snap/src/services/state/State.test.ts b/packages/tron-wallet-snap/src/services/state/State.test.ts index 8f92ef07..8070f088 100644 --- a/packages/tron-wallet-snap/src/services/state/State.test.ts +++ b/packages/tron-wallet-snap/src/services/state/State.test.ts @@ -1,5 +1,5 @@ /* eslint-disable jest/prefer-strict-equal */ -/* eslint-disable @typescript-eslint/naming-convention */ + import { BigNumber } from 'bignumber.js'; import { State } from './State'; diff --git a/packages/tron-wallet-snap/src/services/state/State.ts b/packages/tron-wallet-snap/src/services/state/State.ts index ab6db175..ae71e992 100644 --- a/packages/tron-wallet-snap/src/services/state/State.ts +++ b/packages/tron-wallet-snap/src/services/state/State.ts @@ -3,7 +3,6 @@ import type { MutexInterface } from 'async-mutex'; import { Mutex } from 'async-mutex'; import { unset } from 'lodash'; -import type { IStateManager } from './IStateManager'; import type { SpotPrices } from '../../clients/price-api/types'; import type { AssetEntity } from '../../entities/assets'; import type { TronKeyringAccount } from '../../entities/keyring-account'; @@ -11,6 +10,7 @@ import { safeMerge } from '../../utils/safeMerge'; import { deserialize } from '../../utils/serialization/deserialize'; import { serialize } from '../../utils/serialization/serialize'; import type { Serializable } from '../../utils/serialization/types'; +import type { IStateManager } from './IStateManager'; export type AccountId = string; diff --git a/packages/tron-wallet-snap/src/services/transaction-expiration-refresher/TransactionExpirationRefresherService.ts b/packages/tron-wallet-snap/src/services/transaction-expiration-refresher/TransactionExpirationRefresherService.ts index a183923d..d2b0b695 100644 --- a/packages/tron-wallet-snap/src/services/transaction-expiration-refresher/TransactionExpirationRefresherService.ts +++ b/packages/tron-wallet-snap/src/services/transaction-expiration-refresher/TransactionExpirationRefresherService.ts @@ -1,8 +1,9 @@ -/* eslint-disable @typescript-eslint/naming-convention */ import { bytesToHex, hexToBytes, sha256 } from '@metamask/utils'; import type { TronWeb, Types } from 'tronweb'; import type { Block } from 'tronweb/lib/esm/types/APIResponse'; +import type { TronWebFactory } from '../../clients/tronweb/TronWebFactory'; +import type { Network } from '../../constants'; import type { HasFreshExpirationMetadataParams, HasFreshExpirationMetadataResult, @@ -10,8 +11,6 @@ import type { TransactionRawDataWithExpirationMetadata, TransactionWithMetadata, } from './types'; -import type { TronWebFactory } from '../../clients/tronweb/TronWebFactory'; -import type { Network } from '../../constants'; /** * TRON block time is 3 seconds, so refresh if expiration is within the diff --git a/packages/tron-wallet-snap/src/services/transaction-scan/TransactionScanService.test.ts b/packages/tron-wallet-snap/src/services/transaction-scan/TransactionScanService.test.ts index 1086dc0b..dae868e6 100644 --- a/packages/tron-wallet-snap/src/services/transaction-scan/TransactionScanService.test.ts +++ b/packages/tron-wallet-snap/src/services/transaction-scan/TransactionScanService.test.ts @@ -1,11 +1,11 @@ import { Types } from 'tronweb'; -import { TransactionScanService } from './TransactionScanService'; import type { SecurityAlertsApiClient } from '../../clients/security-alerts-api/SecurityAlertsApiClient'; import type { SecurityAlertSimulationValidationResponse } from '../../clients/security-alerts-api/structs'; import type { SnapClient } from '../../clients/snap/SnapClient'; import { Network } from '../../constants'; import { mockLogger } from '../../utils/mockLogger'; +import { TransactionScanService } from './TransactionScanService'; describe('TransactionScanService', () => { const createMockSecurityAlertsApiClient = ( @@ -27,21 +27,19 @@ describe('TransactionScanService', () => { { type: Types.ContractType.TransferContract, parameter: { - // eslint-disable-next-line @typescript-eslint/naming-convention type_url: 'type.googleapis.com/protocol.TransferContract', value: { - // eslint-disable-next-line @typescript-eslint/naming-convention owner_address: `41${'a'.repeat(40)}`, - // eslint-disable-next-line @typescript-eslint/naming-convention + to_address: `41${'b'.repeat(40)}`, amount: 990000, }, }, }, ], - // eslint-disable-next-line @typescript-eslint/naming-convention + ref_block_bytes: '0000', - // eslint-disable-next-line @typescript-eslint/naming-convention + ref_block_hash: '0'.repeat(16), expiration: Date.now() + 60000, timestamp: Date.now(), @@ -52,12 +50,10 @@ describe('TransactionScanService', () => { const mockApiResponse: SecurityAlertSimulationValidationResponse = { simulation: { status: 'Success', - // eslint-disable-next-line @typescript-eslint/naming-convention + account_summary: { - // eslint-disable-next-line @typescript-eslint/naming-convention assets_diffs: [ { - // eslint-disable-next-line @typescript-eslint/naming-convention asset_type: 'NATIVE', asset: { type: 'NATIVE', @@ -68,13 +64,12 @@ describe('TransactionScanService', () => { in: [], out: [ { - // eslint-disable-next-line @typescript-eslint/naming-convention usd_price: '0.31', summary: '', // Simulates the API returning an imprecise float-to-string value value: '0.98999999999999991', // The raw integer value in smallest unit (sun) is exact - // eslint-disable-next-line @typescript-eslint/naming-convention + raw_value: '990000', }, ], @@ -84,7 +79,7 @@ describe('TransactionScanService', () => { }, validation: { status: 'Success', - // eslint-disable-next-line @typescript-eslint/naming-convention + result_type: 'Benign', }, }; @@ -114,12 +109,10 @@ describe('TransactionScanService', () => { const mockApiResponse: SecurityAlertSimulationValidationResponse = { simulation: { status: 'Success', - // eslint-disable-next-line @typescript-eslint/naming-convention + account_summary: { - // eslint-disable-next-line @typescript-eslint/naming-convention assets_diffs: [ { - // eslint-disable-next-line @typescript-eslint/naming-convention asset_type: 'NATIVE', asset: { type: 'NATIVE', @@ -130,11 +123,10 @@ describe('TransactionScanService', () => { in: [], out: [ { - // eslint-disable-next-line @typescript-eslint/naming-convention usd_price: '0.31', summary: '', value: '0.99', - // eslint-disable-next-line @typescript-eslint/naming-convention + raw_value: '990000', }, ], @@ -144,7 +136,7 @@ describe('TransactionScanService', () => { }, validation: { status: 'Success', - // eslint-disable-next-line @typescript-eslint/naming-convention + result_type: 'Benign', }, }; @@ -175,12 +167,10 @@ describe('TransactionScanService', () => { const mockApiResponse: SecurityAlertSimulationValidationResponse = { simulation: { status: 'Success', - // eslint-disable-next-line @typescript-eslint/naming-convention + account_summary: { - // eslint-disable-next-line @typescript-eslint/naming-convention assets_diffs: [ { - // eslint-disable-next-line @typescript-eslint/naming-convention asset_type: 'NATIVE', asset: { type: 'NATIVE', @@ -191,11 +181,10 @@ describe('TransactionScanService', () => { in: [], out: [ { - // eslint-disable-next-line @typescript-eslint/naming-convention usd_price: '0.31', summary: '', value: '0.99', - // eslint-disable-next-line @typescript-eslint/naming-convention + raw_value: '', }, ], @@ -205,7 +194,7 @@ describe('TransactionScanService', () => { }, validation: { status: 'Success', - // eslint-disable-next-line @typescript-eslint/naming-convention + result_type: 'Benign', }, }; @@ -235,12 +224,10 @@ describe('TransactionScanService', () => { const mockApiResponse: SecurityAlertSimulationValidationResponse = { simulation: { status: 'Success', - // eslint-disable-next-line @typescript-eslint/naming-convention + account_summary: { - // eslint-disable-next-line @typescript-eslint/naming-convention assets_diffs: [ { - // eslint-disable-next-line @typescript-eslint/naming-convention asset_type: 'TRC10', asset: { type: 'TRC10', @@ -251,11 +238,10 @@ describe('TransactionScanService', () => { in: [], out: [ { - // eslint-disable-next-line @typescript-eslint/naming-convention usd_price: '0.001', summary: '', value: '1000', - // eslint-disable-next-line @typescript-eslint/naming-convention + raw_value: '1000', }, ], @@ -265,7 +251,7 @@ describe('TransactionScanService', () => { }, validation: { status: 'Success', - // eslint-disable-next-line @typescript-eslint/naming-convention + result_type: 'Benign', }, }; @@ -296,12 +282,10 @@ describe('TransactionScanService', () => { const mockApiResponse: SecurityAlertSimulationValidationResponse = { simulation: { status: 'Success', - // eslint-disable-next-line @typescript-eslint/naming-convention + account_summary: { - // eslint-disable-next-line @typescript-eslint/naming-convention assets_diffs: [ { - // eslint-disable-next-line @typescript-eslint/naming-convention asset_type: 'ERC20', asset: { type: 'ERC20', @@ -311,11 +295,10 @@ describe('TransactionScanService', () => { }, in: [ { - // eslint-disable-next-line @typescript-eslint/naming-convention usd_price: '0.31', summary: '', value: '1.49999999999999999', - // eslint-disable-next-line @typescript-eslint/naming-convention + raw_value: '1500000000000000000', }, ], @@ -326,7 +309,7 @@ describe('TransactionScanService', () => { }, validation: { status: 'Success', - // eslint-disable-next-line @typescript-eslint/naming-convention + result_type: 'Benign', }, }; @@ -358,12 +341,10 @@ describe('TransactionScanService', () => { const mockApiResponse: SecurityAlertSimulationValidationResponse = { simulation: { status: 'Success', - // eslint-disable-next-line @typescript-eslint/naming-convention + account_summary: { - // eslint-disable-next-line @typescript-eslint/naming-convention assets_diffs: [ { - // eslint-disable-next-line @typescript-eslint/naming-convention asset_type: 'NATIVE', asset: { type: 'NATIVE', @@ -374,34 +355,32 @@ describe('TransactionScanService', () => { in: [], out: [ { - // eslint-disable-next-line @typescript-eslint/naming-convention usd_price: '0.315', summary: 'Sending 1 TRX', value: '1.0', - // eslint-disable-next-line @typescript-eslint/naming-convention + raw_value: '0xf4240', }, ], }, { - // eslint-disable-next-line @typescript-eslint/naming-convention asset_type: 'ERC721', asset: { type: 'ERC721', symbol: 'SUN-V3-POS', name: 'Sunswap V3 Positions NFT-V1', - // eslint-disable-next-line @typescript-eslint/naming-convention + logo_url: 'https://cdn.blockaid.io/nft/0x72DB65b2e023E4783D46023e7135c692E527F6CB/tron/sec/example', }, in: [ { summary: 'Receiving Sunswap V3 Positions NFT-V1 #1495', - // eslint-disable-next-line @typescript-eslint/naming-convention + token_id: '0x5d7', - // eslint-disable-next-line @typescript-eslint/naming-convention + arbitrary_collection_token: false, - // eslint-disable-next-line @typescript-eslint/naming-convention + logo_url: 'https://cdn.blockaid.io/nft/0x72DB65b2e023E4783D46023e7135c692E527F6CB/1495/tron/sec/example', }, @@ -413,7 +392,7 @@ describe('TransactionScanService', () => { }, validation: { status: 'Success', - // eslint-disable-next-line @typescript-eslint/naming-convention + result_type: 'Benign', }, }; @@ -466,12 +445,10 @@ describe('TransactionScanService', () => { const mockApiResponse: SecurityAlertSimulationValidationResponse = { simulation: { status: 'Success', - // eslint-disable-next-line @typescript-eslint/naming-convention + account_summary: { - // eslint-disable-next-line @typescript-eslint/naming-convention assets_diffs: [ { - // eslint-disable-next-line @typescript-eslint/naming-convention asset_type: 'ERC1155', asset: { type: 'ERC1155', @@ -482,12 +459,12 @@ describe('TransactionScanService', () => { out: [ { summary: 'Sending 5 Game Item', - // eslint-disable-next-line @typescript-eslint/naming-convention + token_id: '0x1', value: '5', - // eslint-disable-next-line @typescript-eslint/naming-convention + arbitrary_collection_token: false, - // eslint-disable-next-line @typescript-eslint/naming-convention + usd_price: '10.00', }, ], @@ -497,7 +474,7 @@ describe('TransactionScanService', () => { }, validation: { status: 'Success', - // eslint-disable-next-line @typescript-eslint/naming-convention + result_type: 'Benign', }, }; @@ -538,7 +515,7 @@ describe('TransactionScanService', () => { const mockSecurityAlertsApiClient = createMockSecurityAlertsApiClient({ simulation: { status: 'Success' }, - // eslint-disable-next-line @typescript-eslint/naming-convention + validation: { status: 'Success', result_type: 'Benign' }, }); mockSecurityAlertsApiClient.scanTransaction.mockRejectedValueOnce(error); diff --git a/packages/tron-wallet-snap/src/services/transaction-scan/TransactionScanService.ts b/packages/tron-wallet-snap/src/services/transaction-scan/TransactionScanService.ts index 9487a178..7e873294 100644 --- a/packages/tron-wallet-snap/src/services/transaction-scan/TransactionScanService.ts +++ b/packages/tron-wallet-snap/src/services/transaction-scan/TransactionScanService.ts @@ -1,14 +1,6 @@ -/* eslint-disable @typescript-eslint/naming-convention */ import { BigNumber } from 'bignumber.js'; import type { Types } from 'tronweb'; -import type { - TransactionScanAssetChange, - TransactionScanError, - TransactionScanResult, - TransactionScanValidation, -} from './types'; -import { ScanStatus, SecurityAlertResponse, SimulationStatus } from './types'; import { SecurityAlertsApiClient } from '../../clients/security-alerts-api/SecurityAlertsApiClient'; import type { AssetChange, @@ -20,6 +12,13 @@ import type { Network } from '../../constants'; import type { TronKeyringAccount } from '../../entities/keyring-account'; import type { ILogger } from '../../utils/logger'; import { isTransactionWellFormed } from '../../validation/transaction'; +import type { + TransactionScanAssetChange, + TransactionScanError, + TransactionScanResult, + TransactionScanValidation, +} from './types'; +import { ScanStatus, SecurityAlertResponse, SimulationStatus } from './types'; const METAMASK_ORIGIN = 'metamask'; const METAMASK_ORIGIN_URL = 'https://metamask.io'; diff --git a/packages/tron-wallet-snap/src/services/transaction-scan/buildExpiredScanResult.ts b/packages/tron-wallet-snap/src/services/transaction-scan/buildExpiredScanResult.ts index 70bd1d4c..64aa4d6b 100644 --- a/packages/tron-wallet-snap/src/services/transaction-scan/buildExpiredScanResult.ts +++ b/packages/tron-wallet-snap/src/services/transaction-scan/buildExpiredScanResult.ts @@ -1,5 +1,6 @@ import { TRANSACTION_TAPOS_EXPIRED } from './isTransactionDeadlinePassedError'; -import { SimulationStatus, type TransactionScanResult } from './types'; +import { SimulationStatus } from './types'; +import type { TransactionScanResult } from './types'; /** * A scan result that surfaces a locally-detected transaction expiry (Tron TAPOS diff --git a/packages/tron-wallet-snap/src/services/transactions/TransactionsRepository.test.ts b/packages/tron-wallet-snap/src/services/transactions/TransactionsRepository.test.ts index 62f5094c..33e0d3e0 100644 --- a/packages/tron-wallet-snap/src/services/transactions/TransactionsRepository.test.ts +++ b/packages/tron-wallet-snap/src/services/transactions/TransactionsRepository.test.ts @@ -1,9 +1,9 @@ import type { Transaction } from '@metamask/keyring-api'; import { TransactionStatus, TransactionType } from '@metamask/keyring-api'; -import { TransactionsRepository } from './TransactionsRepository'; import { KnownCaip19Id, Network } from '../../constants'; import type { State, UnencryptedStateValue } from '../state/State'; +import { TransactionsRepository } from './TransactionsRepository'; describe('TransactionsRepository', () => { let transactionsRepository: TransactionsRepository; diff --git a/packages/tron-wallet-snap/src/services/transactions/TransactionsService.test.ts b/packages/tron-wallet-snap/src/services/transactions/TransactionsService.test.ts index d61a913a..a459cae3 100644 --- a/packages/tron-wallet-snap/src/services/transactions/TransactionsService.test.ts +++ b/packages/tron-wallet-snap/src/services/transactions/TransactionsService.test.ts @@ -2,9 +2,6 @@ import type { Transaction } from '@metamask/keyring-api'; import { TransactionStatus, TransactionType } from '@metamask/keyring-api'; -import { TransactionMapper } from './TransactionsMapper'; -import type { TransactionsRepository } from './TransactionsRepository'; -import { TransactionsService } from './TransactionsService'; import type { PriceApiClient } from '../../clients/price-api/PriceApiClient'; import type { SnapClient } from '../../clients/snap/SnapClient'; import type { TronHttpClient } from '../../clients/tron-http/TronHttpClient'; @@ -20,6 +17,9 @@ import nativeTransferMock from './mocks/trongrid/account-transactions/native-tra import trc10TransferMock from './mocks/trongrid/account-transactions/trc10-transfer.json'; import trc20TransferMock from './mocks/trongrid/account-transactions/trc20-transfer.json'; import contractInfoMock from './mocks/trongrid/account-trc20-transactions/contract-info.json'; +import { TransactionMapper } from './TransactionsMapper'; +import type { TransactionsRepository } from './TransactionsRepository'; +import { TransactionsService } from './TransactionsService'; // Import simplified mock data (each file now contains only one transaction) diff --git a/packages/tron-wallet-snap/src/services/transactions/TransactionsService.ts b/packages/tron-wallet-snap/src/services/transactions/TransactionsService.ts index dd8506fe..09f87833 100644 --- a/packages/tron-wallet-snap/src/services/transactions/TransactionsService.ts +++ b/packages/tron-wallet-snap/src/services/transactions/TransactionsService.ts @@ -3,9 +3,6 @@ import { KeyringEvent, TransactionType } from '@metamask/keyring-api'; import { emitSnapKeyringEvent } from '@metamask/keyring-snap-sdk'; import { groupBy } from 'lodash'; -import { TransactionMapper } from './TransactionsMapper'; -import type { TransactionsRepository } from './TransactionsRepository'; -import { isSpam } from './utils/isSpam'; import type { PriceApiClient } from '../../clients/price-api/PriceApiClient'; import type { SpotPrices } from '../../clients/price-api/types'; import type { SnapClient } from '../../clients/snap/SnapClient'; @@ -21,6 +18,9 @@ import type { Network } from '../../constants'; import type { TronKeyringAccount } from '../../entities/keyring-account'; import type { ILogger } from '../../utils/logger'; import { createPrefixedLogger } from '../../utils/logger'; +import { TransactionMapper } from './TransactionsMapper'; +import type { TransactionsRepository } from './TransactionsRepository'; +import { isSpam } from './utils/isSpam'; export class TransactionsService { readonly #logger: ILogger; @@ -102,7 +102,7 @@ export class TransactionsService { // Merge internal_transactions from fullTxInfo into the existing tx return { ...tx, - // eslint-disable-next-line @typescript-eslint/naming-convention + internal_transactions: fullTxInfo.internal_transactions ?? [], }; } @@ -421,7 +421,9 @@ export class TransactionsService { ): Promise { const tokenAssetTypes = new Set(); for (const tx of transactions) { - if (tx.type !== TransactionType.Receive) continue; + if (tx.type !== TransactionType.Receive) { + continue; + } for (const movement of tx.to) { if ( movement.address === account.address && diff --git a/packages/tron-wallet-snap/src/services/transactions/trc20LogParser.test.ts b/packages/tron-wallet-snap/src/services/transactions/trc20LogParser.test.ts index 37ed2c5c..e6a2bc0e 100644 --- a/packages/tron-wallet-snap/src/services/transactions/trc20LogParser.test.ts +++ b/packages/tron-wallet-snap/src/services/transactions/trc20LogParser.test.ts @@ -1,14 +1,14 @@ import type { FungibleAssetMetadata } from '@metamask/snaps-sdk'; +import { Network } from '../../constants'; +import type { TokenCaipAssetType } from '../assets/types'; import { buildContractTransactionInfos, getReconstructedTransferAssetTypes, parseTransferLogs, TRC20_TRANSFER_EVENT_SIGNATURE, - type ParsedTransferLog, } from './trc20LogParser'; -import { Network } from '../../constants'; -import type { TokenCaipAssetType } from '../assets/types'; +import type { ParsedTransferLog } from './trc20LogParser'; type EventLog = { address: string; topics: string[]; data: string }; @@ -236,16 +236,15 @@ describe('buildContractTransactionInfos', () => { expect(result).toStrictEqual([ { - // eslint-disable-next-line @typescript-eslint/naming-convention transaction_id: TX_ID, - // eslint-disable-next-line @typescript-eslint/naming-convention + token_info: { symbol: 'USDT', address: USDT_CONTRACT_BASE58, decimals: 6, name: 'Tether USD', }, - // eslint-disable-next-line @typescript-eslint/naming-convention + block_timestamp: BLOCK_TIMESTAMP, from: SENDER_BASE58, to: RECIPIENT_BASE58, diff --git a/packages/tron-wallet-snap/src/services/transactions/trc20LogParser.ts b/packages/tron-wallet-snap/src/services/transactions/trc20LogParser.ts index 2e02781a..f99115d5 100644 --- a/packages/tron-wallet-snap/src/services/transactions/trc20LogParser.ts +++ b/packages/tron-wallet-snap/src/services/transactions/trc20LogParser.ts @@ -221,16 +221,15 @@ export function buildContractTransactionInfos( const unit = metadata?.units?.[0]; return { - // eslint-disable-next-line @typescript-eslint/naming-convention transaction_id: transfer.transactionId, - // eslint-disable-next-line @typescript-eslint/naming-convention + token_info: { symbol: metadata?.symbol ?? UNKNOWN_TOKEN_SYMBOL, address: transfer.contractAddress, decimals: unit?.decimals ?? DEFAULT_TOKEN_DECIMALS, name: metadata?.name ?? UNKNOWN_TOKEN_SYMBOL, }, - // eslint-disable-next-line @typescript-eslint/naming-convention + block_timestamp: transfer.blockTimestamp, from: transfer.from, to: transfer.to, diff --git a/packages/tron-wallet-snap/src/services/transactions/utils/isSpam.test.ts b/packages/tron-wallet-snap/src/services/transactions/utils/isSpam.test.ts index 037a669f..c12fd8e3 100644 --- a/packages/tron-wallet-snap/src/services/transactions/utils/isSpam.test.ts +++ b/packages/tron-wallet-snap/src/services/transactions/utils/isSpam.test.ts @@ -5,10 +5,10 @@ import { TrxAccountType, } from '@metamask/keyring-api'; -import { isSpam } from './isSpam'; import type { SpotPrices } from '../../../clients/price-api/types'; import { Network, Networks } from '../../../constants'; import type { TronKeyringAccount } from '../../../entities/keyring-account'; +import { isSpam } from './isSpam'; describe('isSpam', () => { const account: TronKeyringAccount = { diff --git a/packages/tron-wallet-snap/src/services/wallet/WalletService.test.ts b/packages/tron-wallet-snap/src/services/wallet/WalletService.test.ts index 2000d8c7..02ce29c1 100644 --- a/packages/tron-wallet-snap/src/services/wallet/WalletService.test.ts +++ b/packages/tron-wallet-snap/src/services/wallet/WalletService.test.ts @@ -2,7 +2,6 @@ import { SnapError } from '@metamask/snaps-sdk'; import { bytesToBase64, bytesToHex, stringToBytes } from '@metamask/utils'; import { TronWeb } from 'tronweb'; -import { WalletService } from './WalletService'; import type { TronWebFactory } from '../../clients/tronweb/TronWebFactory'; import { Network } from '../../constants'; import type { TronKeyringAccount } from '../../entities/keyring-account'; @@ -12,6 +11,7 @@ import { } from '../../handlers/keyring-types'; import { mockLogger } from '../../utils/mockLogger'; import type { AccountsService } from '../accounts/AccountsService'; +import { WalletService } from './WalletService'; const MOCK_BLOCK_TIMESTAMP = 1_700_000_000_000; @@ -35,9 +35,8 @@ function createBlock({ }) { return { blockID: `${'0'.repeat(16)}${hashSegment}${'f'.repeat(32)}`, - // eslint-disable-next-line @typescript-eslint/naming-convention + block_header: { - // eslint-disable-next-line @typescript-eslint/naming-convention raw_data: { number, timestamp, @@ -119,19 +118,18 @@ describe('WalletService', () => { { type: 'TransferContract', parameter: { - type_url: 'type.googleapis.com/protocol.TransferContract', // eslint-disable-line @typescript-eslint/naming-convention + type_url: 'type.googleapis.com/protocol.TransferContract', value: { - // eslint-disable-next-line @typescript-eslint/naming-convention owner_address: TronWeb.address.toHex(TEST_ADDRESS), - // eslint-disable-next-line @typescript-eslint/naming-convention + to_address: '41123456', amount: 1000000, }, }, }, ], - ref_block_bytes: getRefBlockBytes(200_000), // eslint-disable-line @typescript-eslint/naming-convention - ref_block_hash: '1122334455667788', // eslint-disable-line @typescript-eslint/naming-convention + ref_block_bytes: getRefBlockBytes(200_000), + ref_block_hash: '1122334455667788', expiration: MOCK_BLOCK_TIMESTAMP + 45_000, timestamp: MOCK_BLOCK_TIMESTAMP, }), @@ -359,17 +357,17 @@ describe('WalletService', () => { { type: 'TransferContract', parameter: { - type_url: 'type.googleapis.com/protocol.TransferContract', // eslint-disable-line @typescript-eslint/naming-convention + type_url: 'type.googleapis.com/protocol.TransferContract', value: { - owner_address: TronWeb.address.toHex(TEST_ADDRESS), // eslint-disable-line @typescript-eslint/naming-convention - to_address: '41123456', // eslint-disable-line @typescript-eslint/naming-convention + owner_address: TronWeb.address.toHex(TEST_ADDRESS), + to_address: '41123456', amount: 1000000, }, }, }, ], - ref_block_bytes: '0001', // eslint-disable-line @typescript-eslint/naming-convention - ref_block_hash: 'outdatedhash', // eslint-disable-line @typescript-eslint/naming-convention + ref_block_bytes: '0001', + ref_block_hash: 'outdatedhash', // A stale expiration must NOT be refreshed: the dApp broadcasts using // its original TxID, so the snap signs exactly what it received. expiration: MOCK_BLOCK_TIMESTAMP - 1, @@ -485,9 +483,8 @@ describe('WalletService', () => { type: 'TransferContract', parameter: { value: { - // eslint-disable-next-line @typescript-eslint/naming-convention owner_address: ALT_OWNER_HEX, - // eslint-disable-next-line @typescript-eslint/naming-convention + to_address: '41123456', amount: 1000000, }, diff --git a/packages/tron-wallet-snap/src/services/wallet/WalletService.ts b/packages/tron-wallet-snap/src/services/wallet/WalletService.ts index 78842ca1..168a10ba 100644 --- a/packages/tron-wallet-snap/src/services/wallet/WalletService.ts +++ b/packages/tron-wallet-snap/src/services/wallet/WalletService.ts @@ -10,7 +10,8 @@ import { TronMultichainErrors, TronMultichainMethod, } from '../../handlers/keyring-types'; -import { createPrefixedLogger, type ILogger } from '../../utils/logger'; +import { createPrefixedLogger } from '../../utils/logger'; +import type { ILogger } from '../../utils/logger'; import { ResolveAccountAddressRequestStruct, ResolveAccountAddressResponseStruct, @@ -230,9 +231,9 @@ export class WalletService { const transaction = { visible: false, txID, - // eslint-disable-next-line @typescript-eslint/naming-convention + raw_data: rawData, - // eslint-disable-next-line @typescript-eslint/naming-convention + raw_data_hex: rawDataHex, }; diff --git a/packages/tron-wallet-snap/src/ui/confirmation/components/Asset/Asset.tsx b/packages/tron-wallet-snap/src/ui/confirmation/components/Asset/Asset.tsx index de2db79b..bbb84dc0 100644 --- a/packages/tron-wallet-snap/src/ui/confirmation/components/Asset/Asset.tsx +++ b/packages/tron-wallet-snap/src/ui/confirmation/components/Asset/Asset.tsx @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-unsafe-enum-comparison */ import type { CaipAssetType, ComponentOrElement } from '@metamask/snaps-sdk'; import { Box, diff --git a/packages/tron-wallet-snap/src/ui/confirmation/components/EstimatedChanges/EstimatedChanges.tsx b/packages/tron-wallet-snap/src/ui/confirmation/components/EstimatedChanges/EstimatedChanges.tsx index d409b44c..524de89a 100644 --- a/packages/tron-wallet-snap/src/ui/confirmation/components/EstimatedChanges/EstimatedChanges.tsx +++ b/packages/tron-wallet-snap/src/ui/confirmation/components/EstimatedChanges/EstimatedChanges.tsx @@ -10,7 +10,8 @@ import { } from '@metamask/snaps-sdk/jsx'; import type { TransactionScanEstimatedChanges } from '../../../../services/transaction-scan/types'; -import { FetchStatus, type Preferences } from '../../../../types/snap'; +import { FetchStatus } from '../../../../types/snap'; +import type { Preferences } from '../../../../types/snap'; import { formatAmount } from '../../../../utils/formatAmount'; import { i18n } from '../../../../utils/i18n'; import { isFetchStatusLoadingOrFetching } from '../../../../utils/isFetchStatusLoadingOrFetching'; diff --git a/packages/tron-wallet-snap/src/ui/confirmation/components/Fees.tsx b/packages/tron-wallet-snap/src/ui/confirmation/components/Fees.tsx index 421500d3..027a116a 100644 --- a/packages/tron-wallet-snap/src/ui/confirmation/components/Fees.tsx +++ b/packages/tron-wallet-snap/src/ui/confirmation/components/Fees.tsx @@ -1,12 +1,13 @@ import type { ComponentOrElement } from '@metamask/snaps-sdk'; import { Box, Text as SnapText } from '@metamask/snaps-sdk/jsx'; -import { Asset } from './Asset/Asset'; import type { SpotPrices } from '../../../clients/price-api/types'; import type { ComputeFeeResult } from '../../../services/send/types'; -import { FetchStatus, type Preferences } from '../../../types/snap'; +import { FetchStatus } from '../../../types/snap'; +import type { Preferences } from '../../../types/snap'; import { i18n } from '../../../utils/i18n'; import { isFetchStatusLoadingOrFetching } from '../../../utils/isFetchStatusLoadingOrFetching'; +import { Asset } from './Asset/Asset'; type FeesProps = { fees: ComputeFeeResult; @@ -32,8 +33,12 @@ export const Fees = ({ const isTrxA = feeA.asset.unit === 'TRX'; const isTrxB = feeB.asset.unit === 'TRX'; - if (isTrxA && !isTrxB) return -1; - if (!isTrxA && isTrxB) return 1; + if (isTrxA && !isTrxB) { + return -1; + } + if (!isTrxA && isTrxB) { + return 1; + } return 0; }); diff --git a/packages/tron-wallet-snap/src/ui/confirmation/components/TransactionAlert/TransactionAlert.test.tsx b/packages/tron-wallet-snap/src/ui/confirmation/components/TransactionAlert/TransactionAlert.test.tsx index 6c2a4e5d..4be51c1a 100644 --- a/packages/tron-wallet-snap/src/ui/confirmation/components/TransactionAlert/TransactionAlert.test.tsx +++ b/packages/tron-wallet-snap/src/ui/confirmation/components/TransactionAlert/TransactionAlert.test.tsx @@ -1,10 +1,11 @@ -import { TransactionAlert } from './TransactionAlert'; -import type { TransactionAlertProps } from './TransactionAlert'; import type { TransactionScanError, TransactionScanValidation, } from '../../../../services/transaction-scan/types'; -import { FetchStatus, type Preferences } from '../../../../types/snap'; +import { FetchStatus } from '../../../../types/snap'; +import type { Preferences } from '../../../../types/snap'; +import { TransactionAlert } from './TransactionAlert'; +import type { TransactionAlertProps } from './TransactionAlert'; // Mock the getErrorMessage function jest.mock('./getErrorMessage', () => ({ diff --git a/packages/tron-wallet-snap/src/ui/confirmation/components/TransactionAlert/TransactionAlert.tsx b/packages/tron-wallet-snap/src/ui/confirmation/components/TransactionAlert/TransactionAlert.tsx index 0b4440c1..c3bf0e69 100644 --- a/packages/tron-wallet-snap/src/ui/confirmation/components/TransactionAlert/TransactionAlert.tsx +++ b/packages/tron-wallet-snap/src/ui/confirmation/components/TransactionAlert/TransactionAlert.tsx @@ -6,17 +6,18 @@ import { Link, Skeleton, Text as SnapText, - type BannerProps, } from '@metamask/snaps-sdk/jsx'; +import type { BannerProps } from '@metamask/snaps-sdk/jsx'; -import { getErrorMessage } from './getErrorMessage'; import type { TransactionScanError, TransactionScanValidation, } from '../../../../services/transaction-scan/types'; -import { FetchStatus, type Preferences } from '../../../../types/snap'; +import { FetchStatus } from '../../../../types/snap'; +import type { Preferences } from '../../../../types/snap'; import { i18n } from '../../../../utils/i18n'; import { isFetchStatusLoadingOrFetching } from '../../../../utils/isFetchStatusLoadingOrFetching'; +import { getErrorMessage } from './getErrorMessage'; export type TransactionAlertProps = { preferences: Preferences; diff --git a/packages/tron-wallet-snap/src/ui/confirmation/components/TransactionAlert/getErrorMessage.test.ts b/packages/tron-wallet-snap/src/ui/confirmation/components/TransactionAlert/getErrorMessage.test.ts index 63f233d6..44fe5ed0 100644 --- a/packages/tron-wallet-snap/src/ui/confirmation/components/TransactionAlert/getErrorMessage.test.ts +++ b/packages/tron-wallet-snap/src/ui/confirmation/components/TransactionAlert/getErrorMessage.test.ts @@ -1,7 +1,7 @@ -import { getErrorMessage } from './getErrorMessage'; import { TRANSACTION_TAPOS_EXPIRED } from '../../../../services/transaction-scan/isTransactionDeadlinePassedError'; import type { TransactionScanError } from '../../../../services/transaction-scan/types'; import type { Preferences } from '../../../../types/snap'; +import { getErrorMessage } from './getErrorMessage'; describe('getErrorMessage', () => { const mockPreferences: Preferences = { diff --git a/packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignMessage/ConfirmSignMessage.tsx b/packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignMessage/ConfirmSignMessage.tsx index d023b053..a3dd0dcf 100644 --- a/packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignMessage/ConfirmSignMessage.tsx +++ b/packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignMessage/ConfirmSignMessage.tsx @@ -13,12 +13,13 @@ import { Tooltip, } from '@metamask/snaps-sdk/jsx'; -import { ConfirmSignMessageFormNames } from './events'; -import { Networks, type Network } from '../../../../constants'; +import { Networks } from '../../../../constants'; +import type { Network } from '../../../../constants'; import type { TronKeyringAccount } from '../../../../entities/keyring-account'; import { TRX_IMAGE_SVG } from '../../../../static/tron-logo'; import type { Locale } from '../../../../utils/i18n'; import { i18n } from '../../../../utils/i18n'; +import { ConfirmSignMessageFormNames } from './events'; export type ConfirmSignMessageProps = { message: string; diff --git a/packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignMessage/render.test.tsx b/packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignMessage/render.test.tsx index b603a6ae..ae7f5826 100644 --- a/packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignMessage/render.test.tsx +++ b/packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignMessage/render.test.tsx @@ -1,12 +1,12 @@ import type { KeyringRequest } from '@metamask/keyring-api'; import { bytesToBase64, stringToBytes } from '@metamask/utils'; -import { render } from './render'; import type { SnapClient } from '../../../../clients/snap/SnapClient'; import { Network } from '../../../../constants'; import type { TronKeyringAccount } from '../../../../entities/keyring-account'; import { TronMultichainMethod } from '../../../../handlers/keyring-types'; import type { Preferences } from '../../../../types/snap'; +import { render } from './render'; /** * Helper function to convert string to base64. diff --git a/packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignMessage/render.tsx b/packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignMessage/render.tsx index d9d252c4..62bcc979 100644 --- a/packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignMessage/render.tsx +++ b/packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignMessage/render.tsx @@ -2,7 +2,6 @@ import type { KeyringRequest } from '@metamask/keyring-api'; import type { DialogResult } from '@metamask/snaps-sdk'; import { assert } from '@metamask/superstruct'; -import { ConfirmSignMessage } from './ConfirmSignMessage'; import type { Network } from '../../../../constants'; import snapContext from '../../../../context'; import type { TronKeyringAccount } from '../../../../entities/keyring-account'; @@ -10,6 +9,7 @@ import { TRX_IMAGE_SVG } from '../../../../static/tron-logo'; import { formatOrigin } from '../../../../utils/formatOrigin'; import { FALLBACK_LANGUAGE } from '../../../../utils/i18n'; import { SignMessageRequestStruct } from '../../../../validation/structs'; +import { ConfirmSignMessage } from './ConfirmSignMessage'; /** * Renders the confirmation dialog for a sign message request. diff --git a/packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignTransaction/ConfirmSignTransaction.test.tsx b/packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignTransaction/ConfirmSignTransaction.test.tsx index 8b0501a6..158199ba 100644 --- a/packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignTransaction/ConfirmSignTransaction.test.tsx +++ b/packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignTransaction/ConfirmSignTransaction.test.tsx @@ -1,16 +1,17 @@ -import { ConfirmSignTransaction } from './ConfirmSignTransaction'; -import { ConfirmSignTransactionFormNames } from './events'; -import type { ConfirmSignTransactionContext } from './types'; import { Network } from '../../../../constants'; import type { TronKeyringAccount } from '../../../../entities/keyring-account'; import { TronMultichainMethod } from '../../../../handlers/keyring-types'; import { TRANSACTION_TAPOS_EXPIRED } from '../../../../services/transaction-scan/isTransactionDeadlinePassedError'; -import { - SimulationStatus, - type TransactionScanError, - type TransactionScanResult, +import { SimulationStatus } from '../../../../services/transaction-scan/types'; +import type { + TransactionScanError, + TransactionScanResult, } from '../../../../services/transaction-scan/types'; -import { FetchStatus, type Preferences } from '../../../../types/snap'; +import { FetchStatus } from '../../../../types/snap'; +import type { Preferences } from '../../../../types/snap'; +import { ConfirmSignTransaction } from './ConfirmSignTransaction'; +import { ConfirmSignTransactionFormNames } from './events'; +import type { ConfirmSignTransactionContext } from './types'; /** * Recursively searches a rendered JSX tree for an element with a given name. diff --git a/packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignTransaction/ConfirmSignTransaction.tsx b/packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignTransaction/ConfirmSignTransaction.tsx index 11e47bd6..cdd6a415 100644 --- a/packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignTransaction/ConfirmSignTransaction.tsx +++ b/packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignTransaction/ConfirmSignTransaction.tsx @@ -14,8 +14,6 @@ import { Tooltip, } from '@metamask/snaps-sdk/jsx'; -import { ConfirmSignTransactionFormNames } from './events'; -import type { ConfirmSignTransactionContext } from './types'; import { Networks } from '../../../../constants'; import { SimulationStatus } from '../../../../services/transaction-scan/types'; import { TRX_IMAGE_SVG } from '../../../../static/tron-logo'; @@ -25,6 +23,8 @@ import { i18n } from '../../../../utils/i18n'; import { EstimatedChanges } from '../../components/EstimatedChanges/EstimatedChanges'; import { Fees } from '../../components/Fees'; import { TransactionAlert } from '../../components/TransactionAlert/TransactionAlert'; +import { ConfirmSignTransactionFormNames } from './events'; +import type { ConfirmSignTransactionContext } from './types'; export const ConfirmSignTransaction = ({ context, diff --git a/packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignTransaction/render.test.tsx b/packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignTransaction/render.test.tsx index ee148b5b..2a11d7db 100644 --- a/packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignTransaction/render.test.tsx +++ b/packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignTransaction/render.test.tsx @@ -1,7 +1,6 @@ import type { FeeType, KeyringRequest } from '@metamask/keyring-api'; import { bytesToBase64, bytesToHex, stringToBytes } from '@metamask/utils'; -import { render } from './render'; import type { SnapClient } from '../../../../clients/snap/SnapClient'; import { Network } from '../../../../constants'; import type { SnapExecutionContext } from '../../../../context'; @@ -19,11 +18,13 @@ import type { TransactionScanService, } from '../../../../services/transaction-scan'; import { SimulationStatus } from '../../../../services/transaction-scan'; -import { FetchStatus, type Preferences } from '../../../../types/snap'; +import { FetchStatus } from '../../../../types/snap'; +import type { Preferences } from '../../../../types/snap'; +import { render } from './render'; // Mock the context module jest.mock('../../../../context', () => ({ - __esModule: true, // eslint-disable-line @typescript-eslint/naming-convention + __esModule: true, default: { snapClient: null, transactionScanService: null, @@ -269,11 +270,10 @@ describe('ConfirmSignTransaction render', () => { type: 'TriggerSmartContract', parameter: { value: { - // eslint-disable-next-line @typescript-eslint/naming-convention owner_address: '41A2155E688B2BAEBDFDACD073BA79F5B22946AACF', - // eslint-disable-next-line @typescript-eslint/naming-convention + to_address: '4132F9C0C487F21716B7A8F12906B752889902655', - // eslint-disable-next-line @typescript-eslint/naming-convention + call_value: 100000, }, }, @@ -734,11 +734,10 @@ describe('ConfirmSignTransaction render', () => { type: 'TriggerSmartContract', parameter: { value: { - // eslint-disable-next-line @typescript-eslint/naming-convention owner_address: '41A2155E688B2BAEBDFDACD073BA79F5B22946AACF', - // eslint-disable-next-line @typescript-eslint/naming-convention + contract_address: '4132F9C0C487F21716B7A8F12906B752889902655', - // eslint-disable-next-line @typescript-eslint/naming-convention + call_value: 100000, }, }, diff --git a/packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignTransaction/render.tsx b/packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignTransaction/render.tsx index 08d672fe..8340ce50 100644 --- a/packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignTransaction/render.tsx +++ b/packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmSignTransaction/render.tsx @@ -5,9 +5,6 @@ import { bytesToHex, hexToBytes, sha256 } from '@metamask/utils'; import { BigNumber } from 'bignumber.js'; import type { Transaction } from 'tronweb/lib/esm/types'; -import { ConfirmSignTransaction } from './ConfirmSignTransaction'; -import { CONFIRM_SIGN_TRANSACTION_INTERFACE_NAME } from './types'; -import type { ConfirmSignTransactionContext } from './types'; import { Network, Networks, ZERO } from '../../../../constants'; import snapContext from '../../../../context'; import type { TronKeyringAccount } from '../../../../entities/keyring-account'; @@ -21,6 +18,9 @@ import logger from '../../../../utils/logger'; import { SignTransactionRequestStruct } from '../../../../validation/structs'; import { getTransactionTrxValue } from '../../../../validation/transaction'; import { getIconUrlForKnownAsset } from '../../utils/getIconUrlForKnownAsset'; +import { ConfirmSignTransaction } from './ConfirmSignTransaction'; +import { CONFIRM_SIGN_TRANSACTION_INTERFACE_NAME } from './types'; +import type { ConfirmSignTransactionContext } from './types'; export const DEFAULT_CONTEXT: ConfirmSignTransactionContext = { scope: Network.Mainnet, @@ -124,9 +124,9 @@ export async function render( const transactionObj: Transaction = { visible: true, txID, - // eslint-disable-next-line @typescript-eslint/naming-convention + raw_data: rawData, - // eslint-disable-next-line @typescript-eslint/naming-convention + raw_data_hex: transaction.rawDataHex, }; diff --git a/packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmTransactionRequest/ConfirmTransactionRequest.test.tsx b/packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmTransactionRequest/ConfirmTransactionRequest.test.tsx index bf1d44d8..159f6fc3 100644 --- a/packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmTransactionRequest/ConfirmTransactionRequest.test.tsx +++ b/packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmTransactionRequest/ConfirmTransactionRequest.test.tsx @@ -1,11 +1,10 @@ +import { Network } from '../../../../constants'; +import { SimulationStatus } from '../../../../services/transaction-scan/types'; +import type { TransactionScanResult } from '../../../../services/transaction-scan/types'; +import { FetchStatus } from '../../../../types/snap'; +import type { Preferences } from '../../../../types/snap'; import { ConfirmTransactionRequest } from './ConfirmTransactionRequest'; import type { ConfirmTransactionRequestContext } from './types'; -import { Network } from '../../../../constants'; -import { - SimulationStatus, - type TransactionScanResult, -} from '../../../../services/transaction-scan/types'; -import { FetchStatus, type Preferences } from '../../../../types/snap'; // Mock i18n jest.mock('../../../../utils/i18n', () => ({ diff --git a/packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmTransactionRequest/ConfirmTransactionRequest.tsx b/packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmTransactionRequest/ConfirmTransactionRequest.tsx index 2d1915e4..33dd8af5 100644 --- a/packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmTransactionRequest/ConfirmTransactionRequest.tsx +++ b/packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmTransactionRequest/ConfirmTransactionRequest.tsx @@ -14,8 +14,6 @@ import { Tooltip, } from '@metamask/snaps-sdk/jsx'; -import { ConfirmSignAndSendTransactionFormNames } from './events'; -import { type ConfirmTransactionRequestContext } from './types'; import { Networks } from '../../../../constants'; import { SimulationStatus } from '../../../../services/transaction-scan/types'; import { TRX_IMAGE_SVG } from '../../../../static/tron-logo'; @@ -25,6 +23,8 @@ import { i18n } from '../../../../utils/i18n'; import { EstimatedChanges } from '../../components/EstimatedChanges/EstimatedChanges'; import { Fees } from '../../components/Fees'; import { TransactionAlert } from '../../components/TransactionAlert/TransactionAlert'; +import { ConfirmSignAndSendTransactionFormNames } from './events'; +import type { ConfirmTransactionRequestContext } from './types'; export const ConfirmTransactionRequest = ({ context: { diff --git a/packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmTransactionRequest/render.test.tsx b/packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmTransactionRequest/render.test.tsx index 56d9321b..ad441bab 100644 --- a/packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmTransactionRequest/render.test.tsx +++ b/packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmTransactionRequest/render.test.tsx @@ -1,6 +1,5 @@ import { Types } from 'tronweb'; -import { render } from './render'; import { buildTransactionRawData, extractScanParametersFromTransactionData, @@ -14,15 +13,15 @@ import type { UnencryptedStateValue, } from '../../../../services/state/State'; import type { TransactionScanService } from '../../../../services/transaction-scan/TransactionScanService'; -import { - SimulationStatus, - type TransactionScanResult, -} from '../../../../services/transaction-scan/types'; -import { FetchStatus, type Preferences } from '../../../../types/snap'; +import { SimulationStatus } from '../../../../services/transaction-scan/types'; +import type { TransactionScanResult } from '../../../../services/transaction-scan/types'; +import { FetchStatus } from '../../../../types/snap'; +import type { Preferences } from '../../../../types/snap'; +import { render } from './render'; // Mock the context module jest.mock('../../../../context', () => ({ - __esModule: true, // eslint-disable-line @typescript-eslint/naming-convention + __esModule: true, default: { transactionScanService: null, }, diff --git a/packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmTransactionRequest/render.tsx b/packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmTransactionRequest/render.tsx index 5ae92e68..7e6bbf86 100644 --- a/packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmTransactionRequest/render.tsx +++ b/packages/tron-wallet-snap/src/ui/confirmation/views/ConfirmTransactionRequest/render.tsx @@ -1,11 +1,6 @@ import type { DialogResult, Json } from '@metamask/snaps-sdk'; import type { Types } from 'tronweb'; -import { ConfirmTransactionRequest } from './ConfirmTransactionRequest'; -import { - CONFIRM_TRANSACTION_INTERFACE_NAME, - type ConfirmTransactionRequestContext, -} from './types'; import type { SnapClient } from '../../../../clients/snap/SnapClient'; import { Network } from '../../../../constants'; import snapContext from '../../../../context'; @@ -20,6 +15,9 @@ import type { import { TRX_IMAGE_SVG } from '../../../../static/tron-logo'; import { FetchStatus } from '../../../../types/snap'; import { getIconUrlForKnownAsset } from '../../utils/getIconUrlForKnownAsset'; +import { ConfirmTransactionRequest } from './ConfirmTransactionRequest'; +import { CONFIRM_TRANSACTION_INTERFACE_NAME } from './types'; +import type { ConfirmTransactionRequestContext } from './types'; export const DEFAULT_CONFIRMATION_CONTEXT: ConfirmTransactionRequestContext = { scope: Network.Mainnet, diff --git a/packages/tron-wallet-snap/src/utils/buildUrl.ts b/packages/tron-wallet-snap/src/utils/buildUrl.ts index a05480fe..ec1dd5fc 100644 --- a/packages/tron-wallet-snap/src/utils/buildUrl.ts +++ b/packages/tron-wallet-snap/src/utils/buildUrl.ts @@ -1,7 +1,7 @@ import { assert } from '@metamask/superstruct'; -import { sanitizeControlCharacters, sanitizeUri } from './sanitize'; import { UrlStruct } from '../validation/structs'; +import { sanitizeControlCharacters, sanitizeUri } from './sanitize'; export type BuildUrlParams = { baseUrl: string; diff --git a/packages/tron-wallet-snap/src/utils/deriveTronFromCoinTypeNode.test.ts b/packages/tron-wallet-snap/src/utils/deriveTronFromCoinTypeNode.test.ts index 1a32601b..ee389779 100644 --- a/packages/tron-wallet-snap/src/utils/deriveTronFromCoinTypeNode.test.ts +++ b/packages/tron-wallet-snap/src/utils/deriveTronFromCoinTypeNode.test.ts @@ -3,8 +3,8 @@ import { BIP44Node, BIP44PurposeNodeToken, mnemonicPhraseToBytes, - type JsonBIP44Node, } from '@metamask/key-tree'; +import type { JsonBIP44Node } from '@metamask/key-tree'; import { hexToBytes } from '@metamask/utils'; import { computeAddress } from 'ethers'; import { TronWeb } from 'tronweb'; @@ -63,7 +63,7 @@ describe('createTronBip44AddressDeriver', () => { const fullNode = await coinTypeNode.deriveBIP44AddressKey({ account: 0, change: 0, - // eslint-disable-next-line @typescript-eslint/naming-convention + address_index: addressIndex, }); diff --git a/packages/tron-wallet-snap/src/utils/deriveTronFromCoinTypeNode.ts b/packages/tron-wallet-snap/src/utils/deriveTronFromCoinTypeNode.ts index 74613ee1..76456336 100644 --- a/packages/tron-wallet-snap/src/utils/deriveTronFromCoinTypeNode.ts +++ b/packages/tron-wallet-snap/src/utils/deriveTronFromCoinTypeNode.ts @@ -1,8 +1,5 @@ -import { - BIP44Node, - type JsonBIP44Node, - type UnhardenedBIP32Node, -} from '@metamask/key-tree'; +import { BIP44Node } from '@metamask/key-tree'; +import type { JsonBIP44Node, UnhardenedBIP32Node } from '@metamask/key-tree'; import { hexToBytes } from '@metamask/utils'; import { computeAddress } from 'ethers'; import { TronWeb } from 'tronweb'; diff --git a/packages/tron-wallet-snap/src/utils/errors.ts b/packages/tron-wallet-snap/src/utils/errors.ts index 3b24303c..f9a03150 100644 --- a/packages/tron-wallet-snap/src/utils/errors.ts +++ b/packages/tron-wallet-snap/src/utils/errors.ts @@ -1,8 +1,8 @@ import { SnapError, UserRejectedRequestError } from '@metamask/snaps-sdk'; +import { SnapClient } from '../clients/snap/SnapClient'; import logger from './logger'; import { isSnapRpcError } from './sensitiveErrors'; -import { SnapClient } from '../clients/snap/SnapClient'; const snapClient = new SnapClient({ logger }); diff --git a/packages/tron-wallet-snap/src/utils/getExplorerUrl.test.ts b/packages/tron-wallet-snap/src/utils/getExplorerUrl.test.ts index 633a4a33..14150a85 100644 --- a/packages/tron-wallet-snap/src/utils/getExplorerUrl.test.ts +++ b/packages/tron-wallet-snap/src/utils/getExplorerUrl.test.ts @@ -4,11 +4,10 @@ import { getExplorerUrl } from './getExplorerUrl'; describe('getExplorerUrl', () => { // Set up environment variables for testing beforeAll(() => { - // eslint-disable-next-line no-restricted-globals process.env.EXPLORER_MAINNET_BASE_URL = 'https://tronscan.org'; - // eslint-disable-next-line no-restricted-globals + process.env.EXPLORER_NILE_BASE_URL = 'https://nile.tronscan.org'; - // eslint-disable-next-line no-restricted-globals + process.env.EXPLORER_SHASTA_BASE_URL = 'https://shasta.tronscan.org'; }); diff --git a/packages/tron-wallet-snap/src/utils/serialization/deserialize.test.ts b/packages/tron-wallet-snap/src/utils/serialization/deserialize.test.ts index 578d822c..b8093c7b 100644 --- a/packages/tron-wallet-snap/src/utils/serialization/deserialize.test.ts +++ b/packages/tron-wallet-snap/src/utils/serialization/deserialize.test.ts @@ -1,5 +1,5 @@ /* eslint-disable jest/prefer-strict-equal */ -/* eslint-disable @typescript-eslint/naming-convention */ + import { BigNumber } from 'bignumber.js'; import { deserialize } from './deserialize'; diff --git a/packages/tron-wallet-snap/src/utils/serialization/serialize.test.ts b/packages/tron-wallet-snap/src/utils/serialization/serialize.test.ts index ab07039a..28d9adba 100644 --- a/packages/tron-wallet-snap/src/utils/serialization/serialize.test.ts +++ b/packages/tron-wallet-snap/src/utils/serialization/serialize.test.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/naming-convention */ import { BigNumber } from 'bignumber.js'; import { serialize } from './serialize'; diff --git a/packages/tron-wallet-snap/src/utils/serialization/serialize.ts b/packages/tron-wallet-snap/src/utils/serialization/serialize.ts index c205ebee..43b10613 100644 --- a/packages/tron-wallet-snap/src/utils/serialization/serialize.ts +++ b/packages/tron-wallet-snap/src/utils/serialization/serialize.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/naming-convention */ import type { Json } from '@metamask/snaps-sdk'; import { BigNumber } from 'bignumber.js'; import { cloneDeepWith } from 'lodash'; diff --git a/packages/tron-wallet-snap/src/validation/keyring-structs.test.ts b/packages/tron-wallet-snap/src/validation/keyring-structs.test.ts index 7be3c772..25bdf178 100644 --- a/packages/tron-wallet-snap/src/validation/keyring-structs.test.ts +++ b/packages/tron-wallet-snap/src/validation/keyring-structs.test.ts @@ -2,12 +2,12 @@ import { assert, StructError } from '@metamask/superstruct'; import { bytesToBase64, bytesToHex, stringToBytes } from '@metamask/utils'; import { Network } from '../constants'; +import { TronMultichainMethod } from '../handlers/keyring-types'; import { SignMessageRequestStruct, SignTransactionRequestStruct, TronKeyringRequestStruct, } from './structs'; -import { TronMultichainMethod } from '../handlers/keyring-types'; // Helper function to convert string to base64 const toBase64 = (str: string): string => bytesToBase64(stringToBytes(str)); diff --git a/packages/tron-wallet-snap/src/validation/transaction.test.ts b/packages/tron-wallet-snap/src/validation/transaction.test.ts index c6c8534a..69a8f045 100644 --- a/packages/tron-wallet-snap/src/validation/transaction.test.ts +++ b/packages/tron-wallet-snap/src/validation/transaction.test.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/naming-convention */ import { InvalidParamsError } from '@metamask/snaps-sdk'; import { is } from '@metamask/superstruct'; import { Types } from 'tronweb'; diff --git a/packages/tron-wallet-snap/src/validation/transaction.ts b/packages/tron-wallet-snap/src/validation/transaction.ts index 87c7d145..f0c5eeba 100644 --- a/packages/tron-wallet-snap/src/validation/transaction.ts +++ b/packages/tron-wallet-snap/src/validation/transaction.ts @@ -22,7 +22,7 @@ export const TransactionRawDataStruct = define( (value) => { const rawData = value as Types.Transaction['raw_data']; - if (!rawData?.contract || rawData.contract.length !== 1) { + if (rawData?.contract?.length !== 1) { return 'must contain exactly one contract'; } diff --git a/scripts/create-package/package-template/package.json b/scripts/create-package/package-template/package.json index a3a721a3..ed82a0f3 100644 --- a/scripts/create-package/package-template/package.json +++ b/scripts/create-package/package-template/package.json @@ -65,4 +65,4 @@ "engines": { "node": "NODE_VERSIONS" } -} \ No newline at end of file +} diff --git a/yarn.lock b/yarn.lock index 39f6dbc6..9df56b7e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2602,6 +2602,7 @@ __metadata: jest-transform-stub: "npm:2.0.0" oxfmt: "npm:^0.45.0" tronweb: "patch:tronweb@npm%3A6.1.0#~/.yarn/patches/tronweb-npm-6.1.0-771b242b6a.patch" + typescript: "npm:~5.8.3" languageName: unknown linkType: soft From 281d64e86319583b3d4687cc8788e4ad2fd99b59 Mon Sep 17 00:00:00 2001 From: Andrew Taran Date: Wed, 29 Jul 2026 12:11:31 +0200 Subject: [PATCH 4/4] chore: update resolution for @metamask/snaps-sdk@11.2.0 --- package.json | 2 +- packages/bitcoin-wallet-snap/snap.manifest.json | 4 ++-- packages/tron-wallet-snap/snap.manifest.json | 4 ++-- yarn.lock | 11 ++++++----- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index fb4039a2..be71172f 100644 --- a/package.json +++ b/package.json @@ -87,7 +87,7 @@ "yargs": "^17.7.2" }, "resolutions": { - "@metamask/snaps-sdk": "11.1.1", + "@metamask/snaps-sdk": "11.2.0", "elliptic@6.5.4": "^6.5.7", "fast-xml-parser@^4.3.4": "^4.4.1", "hash-base@npm:^3.0.0": "3.1.0", diff --git a/packages/bitcoin-wallet-snap/snap.manifest.json b/packages/bitcoin-wallet-snap/snap.manifest.json index 16c2bd36..3d81b372 100644 --- a/packages/bitcoin-wallet-snap/snap.manifest.json +++ b/packages/bitcoin-wallet-snap/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/internal-snaps.git" }, "source": { - "shasum": "1A2hYcFxk3aN2D5eOYP/QoMbsw0R9IUH7lZPAt3i7rU=", + "shasum": "hqW3Vzx9j/RwIxE8Jru0RBzz4sR0D9CicTmWWOwKB1Y=", "location": { "npm": { "filePath": "dist/bundle.js", @@ -92,6 +92,6 @@ ] } }, - "platformVersion": "11.1.1", + "platformVersion": "11.2.0", "manifestVersion": "0.1" } diff --git a/packages/tron-wallet-snap/snap.manifest.json b/packages/tron-wallet-snap/snap.manifest.json index 36e5f143..f92f4471 100644 --- a/packages/tron-wallet-snap/snap.manifest.json +++ b/packages/tron-wallet-snap/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/internal-snaps.git" }, "source": { - "shasum": "JWrxUhJRaL9TG4mjDWY9ekDzcmH+JfiEXdeybddxAko=", + "shasum": "UObpwCGWof6C+7xwsB2Z0rPs36HRvPEEOOL1ZJ5ZOeA=", "location": { "npm": { "filePath": "dist/bundle.js", @@ -50,6 +50,6 @@ "scopes": ["tron:728126428"] } }, - "platformVersion": "11.1.1", + "platformVersion": "11.2.0", "manifestVersion": "0.1" } diff --git a/yarn.lock b/yarn.lock index 9df56b7e..24cb0a7a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2474,17 +2474,18 @@ __metadata: languageName: node linkType: hard -"@metamask/snaps-sdk@npm:11.1.1": - version: 11.1.1 - resolution: "@metamask/snaps-sdk@npm:11.1.1" +"@metamask/snaps-sdk@npm:11.2.0": + version: 11.2.0 + resolution: "@metamask/snaps-sdk@npm:11.2.0" dependencies: "@metamask/key-tree": "npm:^10.1.1" + "@metamask/messenger": "npm:^2.0.0" "@metamask/providers": "npm:^22.1.1" "@metamask/rpc-errors": "npm:^7.0.3" - "@metamask/superstruct": "npm:^3.2.1" + "@metamask/superstruct": "npm:^3.3.0" "@metamask/utils": "npm:^11.11.0" luxon: "npm:^3.5.0" - checksum: 10/8419625775b83045d98c4ed920002ad884471e2303f6650104c97457c238f095ff35030663ddf111ebb6ce8f4cd915f57b7b9a5597d00288093701dbb79e787c + checksum: 10/ce5bb2c6427283b14121996e4d32c4aa95a6a9372419bb0d77998f697f61c76c45aa165d5f949d40797a9dbfe65d8d5c9bb9deaad2a2d5c7ad33d5e6329f7473 languageName: node linkType: hard