From 9f4cab527b364ca05a9cc8c0482d2d88b1f52c26 Mon Sep 17 00:00:00 2001 From: Peter Smith Date: Mon, 10 Feb 2025 16:16:46 +0000 Subject: [PATCH 1/2] chore: removed redundant evm-connector --- packages/connectors/package.json | 1 - .../connectors/src/evm-connector/index.ts | 1 - packages/connectors/tsup.config.js | 2 - packages/evm-connector/CHANGELOG.md | 227 ------ packages/evm-connector/README.md | 27 - packages/evm-connector/package.json | 47 -- .../evm-connector/src/EvmWalletConnector.ts | 296 -------- packages/evm-connector/src/constants.ts | 11 - .../index.ts | 224 ------ packages/evm-connector/src/index.ts | 1 - .../src/test/chain_config/chain_config.json | 271 ------- .../src/test/chain_config/metadata.json | 8 - .../src/test/chain_config/state_config.json | 188 ----- .../state_transition_bytecode.wasm | 0 .../src/test/evmWalletConnector.test.ts | 686 ------------------ .../evm-connector/src/test/mockProvider.ts | 174 ----- .../index.ts | 224 ------ .../src/test/mockedPredicate/index.ts | 14 - packages/evm-connector/src/types.ts | 31 - packages/evm-connector/tsconfig.json | 19 - packages/evm-connector/tsup.config.js | 8 - packages/evm-connector/vite.config.ts | 22 - pnpm-lock.yaml | 208 ++---- 23 files changed, 64 insertions(+), 2626 deletions(-) delete mode 100644 packages/connectors/src/evm-connector/index.ts delete mode 100644 packages/evm-connector/CHANGELOG.md delete mode 100644 packages/evm-connector/README.md delete mode 100644 packages/evm-connector/package.json delete mode 100644 packages/evm-connector/src/EvmWalletConnector.ts delete mode 100644 packages/evm-connector/src/constants.ts delete mode 100644 packages/evm-connector/src/generated/predicates/0xfdac03fc617c264fa6f325fd6f4d2a5470bf44cfbd33bc11efb3bf8b7ee2e938/index.ts delete mode 100644 packages/evm-connector/src/index.ts delete mode 100644 packages/evm-connector/src/test/chain_config/chain_config.json delete mode 100644 packages/evm-connector/src/test/chain_config/metadata.json delete mode 100644 packages/evm-connector/src/test/chain_config/state_config.json delete mode 100644 packages/evm-connector/src/test/chain_config/state_transition_bytecode.wasm delete mode 100644 packages/evm-connector/src/test/evmWalletConnector.test.ts delete mode 100644 packages/evm-connector/src/test/mockProvider.ts delete mode 100644 packages/evm-connector/src/test/mockedPredicate/0xfdac03fc617c264fa6f325fd6f4d2a5470bf44cfbd33bc11efb3bf8b7ee2e938/index.ts delete mode 100644 packages/evm-connector/src/test/mockedPredicate/index.ts delete mode 100644 packages/evm-connector/src/types.ts delete mode 100644 packages/evm-connector/tsconfig.json delete mode 100644 packages/evm-connector/tsup.config.js delete mode 100644 packages/evm-connector/vite.config.ts diff --git a/packages/connectors/package.json b/packages/connectors/package.json index 58aa0fbca..01f15b6c3 100644 --- a/packages/connectors/package.json +++ b/packages/connectors/package.json @@ -36,7 +36,6 @@ "devDependencies": { "@fuel-connectors/bako-safe": "workspace:*", "@fuel-connectors/burner-wallet-connector": "workspace:*", - "@fuel-connectors/evm-connector": "workspace:*", "@fuel-connectors/fuel-development-wallet": "workspace:*", "@fuel-connectors/fuel-wallet": "workspace:*", "@fuel-connectors/fuelet-wallet": "workspace:*", diff --git a/packages/connectors/src/evm-connector/index.ts b/packages/connectors/src/evm-connector/index.ts deleted file mode 100644 index 4e16f47eb..000000000 --- a/packages/connectors/src/evm-connector/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from '@fuel-connectors/evm-connector'; diff --git a/packages/connectors/tsup.config.js b/packages/connectors/tsup.config.js index 47f5a1459..35b9e92f6 100644 --- a/packages/connectors/tsup.config.js +++ b/packages/connectors/tsup.config.js @@ -10,7 +10,6 @@ export default defineConfig((options) => ({ '@fuel-connectors/fuel-wallet', '@fuel-connectors/fuelet-wallet', '@fuel-connectors/burner-wallet-connector', - '@fuel-connectors/evm-connector', '@fuel-connectors/walletconnect-connector', '@fuel-connectors/bako-safe', '@fuel-connectors/solana-connector', @@ -22,7 +21,6 @@ export default defineConfig((options) => ({ '@fuel-connectors/fuel-wallet', '@fuel-connectors/fuelet-wallet', '@fuel-connectors/burner-wallet-connector', - '@fuel-connectors/evm-connector', '@fuel-connectors/walletconnect-connector', '@fuel-connectors/bako-safe', '@fuel-connectors/solana-connector', diff --git a/packages/evm-connector/CHANGELOG.md b/packages/evm-connector/CHANGELOG.md deleted file mode 100644 index 7da1dac0f..000000000 --- a/packages/evm-connector/CHANGELOG.md +++ /dev/null @@ -1,227 +0,0 @@ -# @fuel-connectors/evm-connector - -## 0.38.1 - -## 0.38.0 - -## 0.37.0 - -### Minor Changes - -- [#450](https://github.com/FuelLabs/fuel-connectors/pull/450) [`dd2c3e0`](https://github.com/FuelLabs/fuel-connectors/commit/dd2c3e0a12c90f220a442aef6b1098e82e0b78c1) Thanks [@helciofranco](https://github.com/helciofranco)! - Set mainnet as default chain if no chain ID is specified. - -## 0.36.1 - -## 0.36.0 - -## 0.35.1 - -### Patch Changes - -- [#389](https://github.com/FuelLabs/fuel-connectors/pull/389) [`d6e12c9`](https://github.com/FuelLabs/fuel-connectors/commit/d6e12c9e13c67a6c00065cf8960a02d798830cdb) Thanks [@Torres-ssf](https://github.com/Torres-ssf)! - Upgrading `fuels` to `0.96.1` - -## 0.35.0 - -### Minor Changes - -- [#387](https://github.com/FuelLabs/fuel-connectors/pull/387) [`5c3d337`](https://github.com/FuelLabs/fuel-connectors/commit/5c3d3375db00b31792a05010a026ed2b74df21db) Thanks [@arboleya](https://github.com/arboleya)! - Upgrading `fuels` to `0.96.0` - -## 0.34.2 - -## 0.34.1 - -## 0.34.0 - -### Minor Changes - -- [#381](https://github.com/FuelLabs/fuel-connectors/pull/381) [`cdac8d4`](https://github.com/FuelLabs/fuel-connectors/commit/cdac8d441bab8e6c7a4c86d60e02c772bdb2e856) Thanks [@luizstacio](https://github.com/luizstacio)! - feat!: change address return to use toString instead of b256 - -## 0.33.0 - -### Patch Changes - -- [#374](https://github.com/FuelLabs/fuel-connectors/pull/374) [`58d0388`](https://github.com/FuelLabs/fuel-connectors/commit/58d0388d78e455b5dc420cfca6fdf0c77db47456) Thanks [@luizstacio](https://github.com/luizstacio)! - feat: add sign message with custom curves for predicates - -## 0.32.0 - -### Minor Changes - -- [#370](https://github.com/FuelLabs/fuel-connectors/pull/370) [`9a20224`](https://github.com/FuelLabs/fuel-connectors/commit/9a202245ceb8653435e963a98fc3453afd81f52b) Thanks [@petertonysmith94](https://github.com/petertonysmith94)! - Updated Fuel SDK to 0.95.0 - -## 0.31.6 - -## 0.31.5 - -## 0.31.4 - -## 0.31.3 - -## 0.31.2 - -## 0.31.1 - -### Patch Changes - -- [#345](https://github.com/FuelLabs/fuel-connectors/pull/345) [`fa88dca`](https://github.com/FuelLabs/fuel-connectors/commit/fa88dcabb862c9f407904765a0e6089a0f124b98) Thanks [@LuizAsFight](https://github.com/LuizAsFight)! - chore: update ts-sdk - -## 0.31.0 - -### Minor Changes - -- [#343](https://github.com/FuelLabs/fuel-connectors/pull/343) [`4303a90`](https://github.com/FuelLabs/fuel-connectors/commit/4303a90c73fcdd86d3f8df8c96307c40984dd4f9) Thanks [@LuizAsFight](https://github.com/LuizAsFight)! - Add support for predicates deployed with blob-style - -## 0.30.1 - -## 0.30.0 - -## 0.29.6 - -## 0.29.5 - -## 0.29.4 - -## 0.29.3 - -### Patch Changes - -- [#312](https://github.com/FuelLabs/fuel-connectors/pull/312) [`681785b`](https://github.com/FuelLabs/fuel-connectors/commit/681785bdd135ba9a205130bbbc381d32919cf7e3) Thanks [@arthurgeron](https://github.com/arthurgeron)! - Upgrade Fuel SDK to 0.94.8 - -## 0.29.2 - -## 0.29.1 - -## 0.29.0 - -### Minor Changes - -- [#296](https://github.com/FuelLabs/fuel-connectors/pull/296) [`3c29c36`](https://github.com/FuelLabs/fuel-connectors/commit/3c29c368ced7dd17a7768b048c576ec1c6392472) Thanks [@LeoCourbassier](https://github.com/LeoCourbassier)! - Allows predicated connectors to receive a providerUrl to configure their providers - -## 0.28.1 - -## 0.28.0 - -### Minor Changes - -- [#235](https://github.com/FuelLabs/fuel-connectors/pull/235) [`01c65cc`](https://github.com/FuelLabs/fuel-connectors/commit/01c65cc6d75dd677f6fbe5fdb6975af36465a967) Thanks [@helciofranco](https://github.com/helciofranco)! - Add a shared internal package for `EVM predicates` to be used across `Wallet Connect` and `EVM Connector`. - -- [#252](https://github.com/FuelLabs/fuel-connectors/pull/252) [`eea98c9`](https://github.com/FuelLabs/fuel-connectors/commit/eea98c991ed9aca318f65743f2734d5aa32e2e0e) Thanks [@helciofranco](https://github.com/helciofranco)! - Update SDK to `0.94.6` version. https://github.com/FuelLabs/fuels-ts/releases/tag/v0.94.6 - -- [#224](https://github.com/FuelLabs/fuel-connectors/pull/224) [`1f6ee86`](https://github.com/FuelLabs/fuel-connectors/commit/1f6ee8679994528ae36faec51535a183d582a58b) Thanks [@helciofranco](https://github.com/helciofranco)! - Bump pnpm version to v9.5.0 - -## 0.27.1 - -### Patch Changes - -- [#242](https://github.com/FuelLabs/fuel-connectors/pull/242) [`9b6b7d3`](https://github.com/FuelLabs/fuel-connectors/commit/9b6b7d3d271aa68fab01c6d236095cc2537b100e) Thanks [@helciofranco](https://github.com/helciofranco)! - Introduce custom `encodeTxId` methods for different predicate versions in Solana due to difference in implementation regarding limitation of 32 bytes on sway method use to sign the old predicates - -## 0.27.0 - -### Minor Changes - -- [#223](https://github.com/FuelLabs/fuel-connectors/pull/223) [`1d90228`](https://github.com/FuelLabs/fuel-connectors/commit/1d90228e5425ab4dc8018f72e09797ef385f2ab6) Thanks [@helciofranco](https://github.com/helciofranco)! - Remove automatic balance transfer between predicates - -- [#231](https://github.com/FuelLabs/fuel-connectors/pull/231) [`083bf92`](https://github.com/FuelLabs/fuel-connectors/commit/083bf92b594c7d1eee9e7225f909e1e140aef809) Thanks [@helciofranco](https://github.com/helciofranco)! - Update to `fuel-core@0.35.0`, `forc@0.63.3` and `fuels@0.94.4` - -## 0.26.0 - -## 0.25.0 - -### Minor Changes - -- [#148](https://github.com/FuelLabs/fuel-connectors/pull/148) [`6c313df`](https://github.com/FuelLabs/fuel-connectors/commit/6c313dfcac480a345acbf4d1b7a70168ef07f8d5) Thanks [@LeoCourbassier](https://github.com/LeoCourbassier)! - Added a new package with helper classes/functions for predicated connectors since they share a fair ammount of core logic. - -## 0.24.0 - -### Minor Changes - -- [#167](https://github.com/FuelLabs/fuel-connectors/pull/167) [`ed5fb44`](https://github.com/FuelLabs/fuel-connectors/commit/ed5fb440b1b0739fbeb616156864d9ba6da3ac07) Thanks [@LeoCourbassier](https://github.com/LeoCourbassier)! - - Bumped packages version from `0.9.0` to `0.23.0` following react package's version - - - Updated react-next example to use `defaultConnectors` from @fuels/connectors package - -- [#145](https://github.com/FuelLabs/fuel-connectors/pull/145) [`533abbf`](https://github.com/FuelLabs/fuel-connectors/commit/533abbfd163ad377faf2239d768a15821f6f5611) Thanks [@rodrigobranas](https://github.com/rodrigobranas)! - Breaking Change: now methods that return address, like "getAccount", will return a b256 address instead of a bech32. - -### Patch Changes - -- [#173](https://github.com/FuelLabs/fuel-connectors/pull/173) [`f0739c4`](https://github.com/FuelLabs/fuel-connectors/commit/f0739c44b11c1a2e1662120c5ed2480e671c5571) Thanks [@LuizAsFight](https://github.com/LuizAsFight)! - update fuels to 0.93.0 - -## 0.9.1 - -## 0.9.0 - -### Minor Changes - -- [#158](https://github.com/FuelLabs/fuel-connectors/pull/158) [`23afa71`](https://github.com/FuelLabs/fuel-connectors/commit/23afa71b01b799aa320ad56abbb8c2c896a5a156) Thanks [@LuizAsFight](https://github.com/LuizAsFight)! - feat: update to fuels 0.92.0 - -## 0.8.1 - -## 0.8.0 - -### Minor Changes - -- [#139](https://github.com/FuelLabs/fuel-connectors/pull/139) [`a6af7f3`](https://github.com/FuelLabs/fuel-connectors/commit/a6af7f3417dddb571f54d80feb231e4ee088d3ec) Thanks [@helciofranco](https://github.com/helciofranco)! - Import `FuelConnectorEventType` constant from `fuels` instead of relying on the hard-coded value. - -## 0.7.0 - -### Patch Changes - -- [#112](https://github.com/FuelLabs/fuel-connectors/pull/112) [`a87a9a4`](https://github.com/FuelLabs/fuel-connectors/commit/a87a9a4f33b96dc796f66ff80c279a232653d8ac) Thanks [@Torres-ssf](https://github.com/Torres-ssf)! - fix: wrong signature index at `EVMWalletConnector` - -## 0.6.0 - -### Minor Changes - -- [#69](https://github.com/FuelLabs/fuel-connectors/pull/69) [`31ee2a5`](https://github.com/FuelLabs/fuel-connectors/commit/31ee2a551100bf9c3113d6397d95ac1b5646f4b3) Thanks [@pedropereiradev](https://github.com/pedropereiradev)! - Predicate versioning for predicate based connectors implemented - -## 0.5.1 - -## 0.5.0 - -### Minor Changes - -- [#85](https://github.com/FuelLabs/fuel-connectors/pull/85) [`450ce37`](https://github.com/FuelLabs/fuel-connectors/commit/450ce37769592e611eaddd6af38b0030dc57cdb3) Thanks [@luizstacio](https://github.com/luizstacio)! - Update default network to testnet - -- [#85](https://github.com/FuelLabs/fuel-connectors/pull/85) [`450ce37`](https://github.com/FuelLabs/fuel-connectors/commit/450ce37769592e611eaddd6af38b0030dc57cdb3) Thanks [@luizstacio](https://github.com/luizstacio)! - Update to fuels 0.88.1 - -## 0.4.0 - -## 0.3.0 - -### Minor Changes - -- [#68](https://github.com/FuelLabs/fuel-connectors/pull/68) [`98c6b5d`](https://github.com/FuelLabs/fuel-connectors/commit/98c6b5d366128d763d601896a7b3b7d594ea6886) Thanks [@arthurgeron](https://github.com/arthurgeron)! - Upgrade fuels and fuel-ts dependencies to 0.83 - -## 0.2.2 - -### Patch Changes - -- [#46](https://github.com/FuelLabs/fuel-connectors/pull/46) [`df6ef2c`](https://github.com/FuelLabs/fuel-connectors/commit/df6ef2cefda1669f6e0ded378d093d72ab9dd1cc) Thanks [@luizstacio](https://github.com/luizstacio)! - fix: zero witnessIndex for predicate inputs - -## 0.2.1 - -## 0.2.0 - -### Minor Changes - -- [#28](https://github.com/FuelLabs/fuel-connectors/pull/28) [`50cbc26`](https://github.com/FuelLabs/fuel-connectors/commit/50cbc266df3b4d4c74643302960ff5d58d00a91c) Thanks [@pedropereiradev](https://github.com/pedropereiradev)! - feat: Add EVM Connector - -- [#28](https://github.com/FuelLabs/fuel-connectors/pull/28) [`50cbc26`](https://github.com/FuelLabs/fuel-connectors/commit/50cbc266df3b4d4c74643302960ff5d58d00a91c) Thanks [@pedropereiradev](https://github.com/pedropereiradev)! - refactor evm connector - -### Patch Changes - -- [#32](https://github.com/FuelLabs/fuel-connectors/pull/32) [`a7d59c5`](https://github.com/FuelLabs/fuel-connectors/commit/a7d59c5f5cc99297bd2499f7346af4e90be08c5e) Thanks [@pedropereiradev](https://github.com/pedropereiradev)! - fix fuel provider to async - -- [#31](https://github.com/FuelLabs/fuel-connectors/pull/31) [`42d1054`](https://github.com/FuelLabs/fuel-connectors/commit/42d105443759ff6665dd4dbdaf3d5178b2138176) Thanks [@fuel-service-user](https://github.com/fuel-service-user)! - ci: update to tag latest - -## 0.2.0 - -### Minor Changes - -- [#28](https://github.com/FuelLabs/fuel-connectors/pull/28) [`50cbc26`](https://github.com/FuelLabs/fuel-connectors/commit/50cbc266df3b4d4c74643302960ff5d58d00a91c) Thanks [@pedropereiradev](https://github.com/pedropereiradev)! - feat: Add EVM Connector - -- [#28](https://github.com/FuelLabs/fuel-connectors/pull/28) [`50cbc26`](https://github.com/FuelLabs/fuel-connectors/commit/50cbc266df3b4d4c74643302960ff5d58d00a91c) Thanks [@pedropereiradev](https://github.com/pedropereiradev)! - refactor evm connector - -### Patch Changes - -- [#32](https://github.com/FuelLabs/fuel-connectors/pull/32) [`a7d59c5`](https://github.com/FuelLabs/fuel-connectors/commit/a7d59c5f5cc99297bd2499f7346af4e90be08c5e) Thanks [@pedropereiradev](https://github.com/pedropereiradev)! - fix fuel provider to async - -- [#31](https://github.com/FuelLabs/fuel-connectors/pull/31) [`42d1054`](https://github.com/FuelLabs/fuel-connectors/commit/42d105443759ff6665dd4dbdaf3d5178b2138176) Thanks [@fuel-service-user](https://github.com/fuel-service-user)! - ci: update to tag latest diff --git a/packages/evm-connector/README.md b/packages/evm-connector/README.md deleted file mode 100644 index 7412f99b5..000000000 --- a/packages/evm-connector/README.md +++ /dev/null @@ -1,27 +0,0 @@ -## 📗 Description - -To enable the use of a MetaMask wallet on Fuel we use [Predicates](https://docs.fuel.network/docs/intro/glossary/#predicate) on Fuel Network, that allow transactions to be validated using a script. - -Below we share a model that explains how our EVM Connector works. - -```mermaid -sequenceDiagram - participant A as Dapp - participant B as EVM Wallet Connector - participant C as MetaMask (EVM Wallet) - - note over A,C: List Accounts - A->>B: fuel.accounts() - B->>C: ethProvider.request({ "method": "eth_accounts" }) - C-->>B: ["0xa202E75a467726Ad49F76e8914c42433c1Ad821F"] - B->>B: Create a predicate for each ETH account address - B-->>A: ['fuel1s6cswzjfunkarjh9rlr7fdug4r04le2zec9agtudj3gkjwarlwnsw8859m'] - - note over A,C: Send Transaction - A->>B: fuel.sendTransaction("
", { }) - B->>B: Hash transaction Id - B->>C: ethProvider.request({ "method": "personal_sign" }) - C-->>B: "0xa202....222" - B->>B: Send transaction using predicate validation to Fuel Nework - B-->>A: "0x111....222" -``` \ No newline at end of file diff --git a/packages/evm-connector/package.json b/packages/evm-connector/package.json deleted file mode 100644 index 38841ef5d..000000000 --- a/packages/evm-connector/package.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "name": "@fuel-connectors/evm-connector", - "version": "0.38.1", - "private": true, - "type": "module", - "files": ["dist"], - "main": "./dist/wallet-connector-evm.umd.cjs", - "module": "./dist/wallet-connector-evm.js", - "exports": { - ".": { - "import": "./dist/wallet-connector-evm.js", - "require": "./dist/wallet-connector-evm.umd.cjs" - } - }, - "types": "./dist/index.d.ts", - "scripts": { - "build": "tsup --dts-only", - "build:watch": "tsup --watch --dts-only", - "ts:check": "tsc --noEmit", - "test": "vitest" - }, - "peerDependencies": { - "fuels": ">=0.96.1" - }, - "dependencies": { - "@ethereumjs/util": "9.0.3", - "@ethersproject/bytes": "5.7.0", - "memoizee": "0.4.15" - }, - "devDependencies": { - "@fuel-connectors/common": "workspace:*", - "@fuel-connectors/evm-predicates": "workspace:*", - "@types/memoizee": "0.4.11", - "fuels": "0.96.1", - "jsdom": "24.0.0", - "ts-loader": "9.5.1", - "ts-node": "10.9.2", - "tsup": "8.0.2", - "tsx": "4.9.3", - "typescript": "5.4.5", - "viem": "2.20.1", - "vite": "5.2.11", - "vite-plugin-dts": "3.9.1", - "vite-tsconfig-paths": "4.3.2", - "vitest": "2.0.2" - } -} diff --git a/packages/evm-connector/src/EvmWalletConnector.ts b/packages/evm-connector/src/EvmWalletConnector.ts deleted file mode 100644 index 0d07a3c89..000000000 --- a/packages/evm-connector/src/EvmWalletConnector.ts +++ /dev/null @@ -1,296 +0,0 @@ -import { hexToBytes } from '@ethereumjs/util'; -// External libraries -import { hexlify, splitSignature } from '@ethersproject/bytes'; - -import { - CHAIN_IDS, - type ConnectorMetadata, - FuelConnectorEventType, - FuelConnectorEventTypes, - Provider, - type TransactionRequestLike, -} from 'fuels'; - -import { - EthereumWalletAdapter, - type Maybe, - type MaybeAsync, - PredicateConnector, - type PredicateVersion, - type PredicateWalletAdapter, - type ProviderDictionary, - getMockedSignatureIndex, - getOrThrow, - getProviderUrl, -} from '@fuel-connectors/common'; -import { - type EvmPredicateRoot, - PREDICATE_VERSIONS, - txIdEncoders, -} from '@fuel-connectors/evm-predicates'; -import { METAMASK_ICON, WINDOW } from './constants'; -import { - type EIP1193Provider, - type EVMWalletConnectorConfig, - EVMWalletConnectorEvents, -} from './types'; - -export class EVMWalletConnector extends PredicateConnector { - name = 'Metamask'; - metadata: ConnectorMetadata = { - image: METAMASK_ICON, - install: { - action: 'Install', - description: 'Install Metamask Wallet to connect to Fuel', - link: 'https://metamask.io/download/', - }, - }; - ethProvider: EIP1193Provider | null = null; - fuelProvider: Provider | null = null; - events = { - ...FuelConnectorEventTypes, - ...EVMWalletConnectorEvents, - }; - - private setupLock = false; - private _currentAccount: string | null = null; - private config: EVMWalletConnectorConfig = {}; - private _ethereumEvents = 0; - - constructor(config: EVMWalletConnectorConfig = {}) { - super(); - - this.customPredicate = config.predicateConfig || null; - - this.configProviders(config); - this.setUpEvents(); - } - - private async getLazyEthereum() { - if (this.config.ethProvider) { - return this.config.ethProvider; - } - if (WINDOW?.ethereum) { - return WINDOW.ethereum; - } - - return null; - } - - private setUpEvents() { - this._ethereumEvents = Number( - setInterval(() => { - if (WINDOW?.ethereum) { - clearInterval(this._ethereumEvents); - WINDOW.dispatchEvent( - new CustomEvent(FuelConnectorEventType, { detail: this }), - ); - } - }, 500), - ); - } - - private async setup() { - if (this.setupLock) return; - this.setupLock = true; - - await this.setupCurrentAccount(); - await this.setupEventBridge(); - } - - private async setupEventBridge() { - const { ethProvider } = await this.getProviders(); - - ethProvider?.on(this.events.ACCOUNTS_CHANGED, async (accounts) => { - this.emit('accounts', await this.accounts()); - if (this._currentAccount !== accounts[0]) { - await this.setupCurrentAccount(); - await this.setupPredicate(); - } - }); - - ethProvider?.on(this.events.CONNECT, async (_arg) => { - await this.setupPredicate(); - this.emit('connection', await this.isConnected()); - }); - - ethProvider?.on(this.events.DISCONNECT, async (_arg) => { - this.emit('connection', await this.isConnected()); - }); - } - - private async setupCurrentAccount() { - const [currentAccount = null] = await this.accounts(); - await this.setupPredicate(); - this._currentAccount = currentAccount; - this.emit('currentAccount', currentAccount); - } - - protected getWalletAdapter(): PredicateWalletAdapter { - return new EthereumWalletAdapter(); - } - - protected getPredicateVersions(): Record { - return PREDICATE_VERSIONS; - } - - protected requireConnection(): MaybeAsync {} - - protected async configProviders(config: EVMWalletConnectorConfig = {}) { - const network = getProviderUrl(config.chainId ?? CHAIN_IDS.fuel.mainnet); - this.config = Object.assign(config, { - fuelProvider: config.fuelProvider || Provider.create(network), - ethProvider: config.ethProvider || WINDOW?.ethereum, - }); - } - - protected async walletAccounts(): Promise> { - const { ethProvider } = await this.getProviders(); - - const accounts = await ethProvider?.request({ - method: 'eth_accounts', - }); - - return accounts as Array; - } - - protected async getAccountAddress(): Promise> { - return (await this.walletAccounts())[0]; - } - - protected async getProviders(): Promise { - if (!this.fuelProvider || !this.ethProvider) { - this.ethProvider = getOrThrow( - await this.getLazyEthereum(), - 'Ethereum provider not found', - ); - - this.fuelProvider = getOrThrow( - await this.config.fuelProvider, - 'Fuel provider not found', - ); - } - - return { - fuelProvider: this.fuelProvider, - ethProvider: this.ethProvider, - }; - } - - public async ping(): Promise { - await Promise.all([ - this.getProviders(), - this.setup(), - this.setupPredicate(), - ]); - - return true; - } - - public async connect(): Promise { - if (!(await this.isConnected())) { - const { ethProvider } = await this.getProviders(); - - await ethProvider?.request({ - method: 'wallet_requestPermissions', - params: [ - { - eth_accounts: {}, - }, - ], - }); - - await this.setupPredicate(); - this.emit(this.events.connection, true); - - return true; - } - - return this.connected; - } - - public async disconnect(): Promise { - if (await this.isConnected()) { - const { ethProvider } = await this.getProviders(); - - await ethProvider?.request({ - method: 'wallet_revokePermissions', - params: [ - { - eth_accounts: {}, - }, - ], - }); - - this.emit(this.events.connection, false); - this.emit(this.events.accounts, []); - this.emit(this.events.currentAccount, null); - } - - return false; - } - - public async sendTransaction( - address: string, - transaction: TransactionRequestLike, - ): Promise { - const { ethProvider, fuelProvider } = await this.getProviders(); - const { request, transactionId, account, transactionRequest } = - await this.prepareTransaction(address, transaction); - - const txId = this.encodeTxId(transactionId); - const signature = (await ethProvider?.request({ - method: 'personal_sign', - params: [txId, account], - })) as string; - - const predicateSignatureIndex = getMockedSignatureIndex( - transactionRequest.witnesses, - ); - - // Transform the signature into compact form for Sway to understand - const compactSignature = splitSignature(hexToBytes(signature)).compact; - transactionRequest.witnesses[predicateSignatureIndex] = compactSignature; - - const transactionWithPredicateEstimated = - await fuelProvider.estimatePredicates(request); - - const response = await fuelProvider.operations.submit({ - encodedTransaction: hexlify( - transactionWithPredicateEstimated.toTransactionBytes(), - ), - }); - - return response.submit.id; - } - - async signMessageCustomCurve(message: string) { - const { ethProvider } = await this.getProviders(); - if (!ethProvider) throw new Error('Eth provider not found'); - const accountAddress = await this.getAccountAddress(); - if (!accountAddress) throw new Error('No connected accounts'); - const signature = await ethProvider.request({ - method: 'personal_sign', - params: [accountAddress, message], - }); - return { - curve: 'secp256k1', - signature: signature as string, - }; - } - - private isValidPredicateAddress( - address: string, - ): address is EvmPredicateRoot { - return address in txIdEncoders; - } - - private encodeTxId(txId: string): string { - if (!this.isValidPredicateAddress(this.predicateAddress)) { - return txId; - } - - const encoder = txIdEncoders[this.predicateAddress]; - return encoder.encodeTxId(txId); - } -} diff --git a/packages/evm-connector/src/constants.ts b/packages/evm-connector/src/constants.ts deleted file mode 100644 index da60a96d1..000000000 --- a/packages/evm-connector/src/constants.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { EIP1193Provider } from './types'; - -declare global { - interface Window { - ethereum: EIP1193Provider | null; - } -} -const HAS_WINDOW = typeof window !== 'undefined'; -export const WINDOW = HAS_WINDOW ? window : null; -export const METAMASK_ICON = - 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbDpzcGFjZT0icHJlc2VydmUiIGlkPSJMYXllcl8xIiB4PSIwIiB5PSIwIiB2ZXJzaW9uPSIxLjEiIHZpZXdCb3g9IjAgMCAzMTguNiAzMTguNiI+CiAgPHN0eWxlPgogICAgLnN0MSwuc3Q2e2ZpbGw6I2U0NzYxYjtzdHJva2U6I2U0NzYxYjtzdHJva2UtbGluZWNhcDpyb3VuZDtzdHJva2UtbGluZWpvaW46cm91bmR9LnN0NntmaWxsOiNmNjg1MWI7c3Ryb2tlOiNmNjg1MWJ9CiAgPC9zdHlsZT4KICA8cGF0aCBmaWxsPSIjZTI3NjFiIiBzdHJva2U9IiNlMjc2MWIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgZD0ibTI3NC4xIDM1LjUtOTkuNSA3My45TDE5MyA2NS44eiIvPgogIDxwYXRoIGQ9Im00NC40IDM1LjUgOTguNyA3NC42LTE3LjUtNDQuM3ptMTkzLjkgMTcxLjMtMjYuNSA0MC42IDU2LjcgMTUuNiAxNi4zLTU1LjN6bS0yMDQuNC45TDUwLjEgMjYzbDU2LjctMTUuNi0yNi41LTQwLjZ6IiBjbGFzcz0ic3QxIi8+CiAgPHBhdGggZD0ibTEwMy42IDEzOC4yLTE1LjggMjMuOSA1Ni4zIDIuNS0yLTYwLjV6bTExMS4zIDAtMzktMzQuOC0xLjMgNjEuMiA1Ni4yLTIuNXpNMTA2LjggMjQ3LjRsMzMuOC0xNi41LTI5LjItMjIuOHptNzEuMS0xNi41IDMzLjkgMTYuNS00LjctMzkuM3oiIGNsYXNzPSJzdDEiLz4KICA8cGF0aCBmaWxsPSIjZDdjMWIzIiBzdHJva2U9IiNkN2MxYjMiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgZD0ibTIxMS44IDI0Ny40LTMzLjktMTYuNSAyLjcgMjIuMS0uMyA5LjN6bS0xMDUgMCAzMS41IDE0LjktLjItOS4zIDIuNS0yMi4xeiIvPgogIDxwYXRoIGZpbGw9IiMyMzM0NDciIHN0cm9rZT0iIzIzMzQ0NyIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBkPSJtMTM4LjggMTkzLjUtMjguMi04LjMgMTkuOS05LjF6bTQwLjkgMCA4LjMtMTcuNCAyMCA5LjF6Ii8+CiAgPHBhdGggZmlsbD0iI2NkNjExNiIgc3Ryb2tlPSIjY2Q2MTE2IiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGQ9Im0xMDYuOCAyNDcuNCA0LjgtNDAuNi0zMS4zLjl6TTIwNyAyMDYuOGw0LjggNDAuNiAyNi41LTM5Ljd6bTIzLjgtNDQuNy01Ni4yIDIuNSA1LjIgMjguOSA4LjMtMTcuNCAyMCA5LjF6bS0xMjAuMiAyMy4xIDIwLTkuMSA4LjIgMTcuNCA1LjMtMjguOS01Ni4zLTIuNXoiLz4KICA8cGF0aCBmaWxsPSIjZTQ3NTFmIiBzdHJva2U9IiNlNDc1MWYiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgZD0ibTg3LjggMTYyLjEgMjMuNiA0Ni0uOC0yMi45em0xMjAuMyAyMy4xLTEgMjIuOSAyMy43LTQ2em0tNjQtMjAuNi01LjMgMjguOSA2LjYgMzQuMSAxLjUtNDQuOXptMzAuNSAwLTIuNyAxOCAxLjIgNDUgNi43LTM0LjF6Ii8+CiAgPHBhdGggZD0ibTE3OS44IDE5My41LTYuNyAzNC4xIDQuOCAzLjMgMjkuMi0yMi44IDEtMjIuOXptLTY5LjItOC4zLjggMjIuOSAyOS4yIDIyLjggNC44LTMuMy02LjYtMzQuMXoiIGNsYXNzPSJzdDYiLz4KICA8cGF0aCBmaWxsPSIjYzBhZDllIiBzdHJva2U9IiNjMGFkOWUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgZD0ibTE4MC4zIDI2Mi4zLjMtOS4zLTIuNS0yLjJoLTM3LjdsLTIuMyAyLjIuMiA5LjMtMzEuNS0xNC45IDExIDkgMjIuMyAxNS41aDM4LjNsMjIuNC0xNS41IDExLTl6Ii8+CiAgPHBhdGggZmlsbD0iIzE2MTYxNiIgc3Ryb2tlPSIjMTYxNjE2IiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGQ9Im0xNzcuOSAyMzAuOS00LjgtMy4zaC0yNy43bC00LjggMy4zLTIuNSAyMi4xIDIuMy0yLjJoMzcuN2wyLjUgMi4yeiIvPgogIDxwYXRoIGZpbGw9IiM3NjNkMTYiIHN0cm9rZT0iIzc2M2QxNiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBkPSJtMjc4LjMgMTE0LjIgOC41LTQwLjgtMTIuNy0zNy45LTk2LjIgNzEuNCAzNyAzMS4zIDUyLjMgMTUuMyAxMS42LTEzLjUtNS0zLjYgOC03LjMtNi4yLTQuOCA4LTYuMXpNMzEuOCA3My40bDguNSA0MC44LTUuNCA0IDggNi4xLTYuMSA0LjggOCA3LjMtNSAzLjYgMTEuNSAxMy41IDUyLjMtMTUuMyAzNy0zMS4zLTk2LjItNzEuNHoiLz4KICA8cGF0aCBkPSJtMjY3LjIgMTUzLjUtNTIuMy0xNS4zIDE1LjkgMjMuOS0yMy43IDQ2IDMxLjItLjRoNDYuNXptLTE2My42LTE1LjMtNTIuMyAxNS4zLTE3LjQgNTQuMmg0Ni40bDMxLjEuNC0yMy42LTQ2em03MSAyNi40IDMuMy01Ny43IDE1LjItNDEuMWgtNjcuNWwxNSA0MS4xIDMuNSA1Ny43IDEuMiAxOC4yLjEgNDQuOGgyNy43bC4yLTQ0Ljh6IiBjbGFzcz0ic3Q2Ii8+Cjwvc3ZnPg=='; diff --git a/packages/evm-connector/src/generated/predicates/0xfdac03fc617c264fa6f325fd6f4d2a5470bf44cfbd33bc11efb3bf8b7ee2e938/index.ts b/packages/evm-connector/src/generated/predicates/0xfdac03fc617c264fa6f325fd6f4d2a5470bf44cfbd33bc11efb3bf8b7ee2e938/index.ts deleted file mode 100644 index 7cda5c2de..000000000 --- a/packages/evm-connector/src/generated/predicates/0xfdac03fc617c264fa6f325fd6f4d2a5470bf44cfbd33bc11efb3bf8b7ee2e938/index.ts +++ /dev/null @@ -1,224 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ - -import type { BytesLike, JsonAbi } from 'fuels'; - -export const generationDate = 1725479113004; -// biome-ignore lint: Autogenerated file -export const abi: JsonAbi = { - programType: 'predicate', - specVersion: '1', - encodingVersion: '1', - concreteTypes: [ - { - type: 'b256', - concreteTypeId: - '7c5ee1cecf5f8eacd1284feb5f0bf2bdea533a51e2f0c9aabe9236d335989f3b', - }, - { - type: 'bool', - concreteTypeId: - 'b760f44fa5965c2474a3b471467a22c43185152129295af588b022ae50b50903', - }, - { - type: 'u64', - concreteTypeId: - '1506e6f44c1d6291cdf46395a8e573276a4fa79e8ace3fc891e092ef32d1b0a0', - }, - ], - metadataTypes: [], - functions: [ - { - inputs: [ - { - name: 'witness_index', - concreteTypeId: - '1506e6f44c1d6291cdf46395a8e573276a4fa79e8ace3fc891e092ef32d1b0a0', - }, - ], - name: 'main', - output: - 'b760f44fa5965c2474a3b471467a22c43185152129295af588b022ae50b50903', - attributes: null, - }, - ], - loggedTypes: [], - messagesTypes: [], - configurables: [ - { - name: 'SIGNER', - concreteTypeId: - '7c5ee1cecf5f8eacd1284feb5f0bf2bdea533a51e2f0c9aabe9236d335989f3b', - offset: 3136, - }, - ], -}; -export const bin: BytesLike = new Uint8Array([ - 26, 240, 48, 0, 116, 0, 0, 2, 0, 0, 0, 0, 0, 0, 12, 64, 93, 255, 192, 1, 16, - 255, 255, 0, 145, 0, 0, 32, 80, 235, 240, 0, 80, 228, 0, 32, 80, 224, 64, 0, - 32, 248, 51, 0, 88, 251, 224, 2, 80, 251, 224, 4, 116, 0, 0, 20, 26, 236, 80, - 0, 113, 64, 0, 3, 97, 69, 2, 0, 19, 73, 16, 0, 118, 72, 0, 6, 114, 72, 0, 2, - 19, 69, 20, 128, 118, 68, 0, 1, 54, 0, 0, 0, 97, 65, 2, 74, 116, 0, 0, 1, 97, - 65, 2, 12, 93, 65, 0, 0, 26, 233, 0, 0, 32, 248, 51, 0, 88, 251, 224, 2, 80, - 251, 224, 4, 116, 0, 0, 26, 26, 67, 208, 0, 36, 64, 0, 0, 149, 0, 0, 15, 150, - 8, 0, 0, 26, 236, 80, 0, 145, 0, 0, 96, 26, 67, 160, 0, 26, 75, 128, 0, 26, - 79, 224, 0, 114, 68, 0, 32, 40, 237, 4, 64, 80, 67, 176, 64, 114, 68, 0, 32, - 40, 67, 180, 64, 80, 71, 176, 32, 114, 64, 0, 32, 40, 71, 180, 0, 80, 67, 176, - 32, 114, 68, 0, 32, 40, 73, 4, 64, 26, 244, 0, 0, 146, 0, 0, 96, 26, 249, 48, - 0, 152, 8, 0, 0, 151, 0, 0, 15, 74, 248, 0, 0, 149, 0, 1, 255, 150, 8, 0, 0, - 26, 236, 80, 0, 145, 0, 10, 56, 26, 67, 160, 0, 26, 87, 224, 0, 97, 68, 0, 1, - 19, 73, 16, 0, 118, 72, 0, 5, 19, 69, 16, 64, 118, 68, 0, 1, 54, 0, 0, 0, 26, - 68, 16, 0, 116, 0, 0, 1, 26, 68, 0, 0, 19, 73, 16, 0, 118, 72, 0, 6, 19, 69, - 16, 64, 118, 68, 0, 2, 93, 67, 240, 12, 54, 64, 0, 0, 97, 68, 1, 5, 116, 0, 0, - 1, 97, 68, 0, 7, 21, 73, 4, 64, 118, 72, 0, 1, 19, 73, 4, 64, 118, 72, 0, 20, - 80, 71, 178, 248, 95, 236, 16, 95, 97, 65, 4, 1, 80, 75, 181, 80, 26, 233, 0, - 0, 26, 229, 32, 0, 32, 248, 51, 0, 88, 251, 224, 2, 80, 251, 224, 4, 116, 0, - 1, 8, 26, 67, 208, 0, 114, 72, 0, 64, 40, 237, 4, 128, 80, 65, 16, 8, 114, 72, - 0, 64, 40, 67, 180, 128, 80, 75, 182, 240, 114, 64, 0, 72, 40, 73, 20, 0, 116, - 0, 0, 5, 80, 67, 177, 0, 95, 236, 0, 32, 80, 75, 182, 240, 114, 68, 0, 72, 40, - 73, 4, 64, 80, 67, 181, 8, 114, 68, 0, 72, 40, 65, 36, 64, 93, 67, 176, 222, - 19, 65, 0, 64, 118, 64, 0, 1, 54, 0, 0, 0, 93, 67, 240, 13, 16, 65, 0, 192, - 93, 71, 240, 14, 16, 69, 16, 192, 93, 95, 240, 15, 16, 93, 112, 192, 80, 75, - 181, 8, 80, 73, 32, 8, 80, 79, 184, 104, 114, 80, 0, 64, 40, 77, 37, 0, 80, - 79, 185, 248, 114, 80, 0, 64, 40, 77, 37, 0, 80, 91, 185, 248, 26, 72, 0, 0, - 80, 79, 176, 64, 114, 80, 0, 32, 40, 77, 37, 0, 80, 75, 177, 208, 114, 80, 0, - 32, 40, 73, 53, 0, 80, 77, 32, 32, 114, 80, 0, 32, 40, 77, 5, 0, 80, 65, 32, - 64, 114, 76, 0, 32, 40, 65, 20, 192, 80, 67, 184, 8, 114, 68, 0, 96, 40, 65, - 36, 64, 80, 99, 184, 8, 80, 67, 183, 232, 114, 68, 0, 32, 40, 65, 116, 64, 80, - 67, 183, 232, 114, 68, 0, 60, 16, 69, 132, 64, 80, 75, 184, 8, 80, 73, 32, 32, - 114, 76, 0, 32, 114, 80, 0, 60, 40, 69, 132, 192, 65, 65, 37, 0, 80, 67, 183, - 232, 80, 71, 177, 144, 114, 72, 0, 32, 27, 72, 4, 128, 16, 73, 20, 128, 114, - 76, 0, 32, 40, 73, 116, 192, 114, 72, 0, 32, 27, 72, 20, 128, 16, 73, 20, 128, - 114, 76, 0, 32, 40, 73, 116, 192, 80, 75, 178, 120, 114, 76, 0, 64, 40, 73, - 20, 192, 80, 71, 185, 144, 114, 76, 0, 64, 40, 69, 36, 192, 80, 71, 185, 144, - 80, 75, 180, 48, 114, 76, 0, 32, 40, 73, 4, 192, 62, 69, 100, 128, 26, 64, - 128, 0, 19, 65, 0, 64, 118, 64, 0, 10, 80, 67, 179, 128, 95, 236, 0, 112, 80, - 71, 185, 144, 80, 73, 0, 8, 114, 76, 0, 64, 40, 73, 20, 192, 80, 75, 183, 56, - 114, 68, 0, 72, 40, 73, 4, 64, 116, 0, 0, 6, 80, 67, 177, 72, 95, 236, 16, 41, - 95, 236, 0, 49, 80, 75, 183, 56, 114, 68, 0, 72, 40, 73, 4, 64, 80, 67, 185, - 40, 114, 68, 0, 72, 40, 65, 36, 64, 80, 67, 180, 80, 114, 68, 0, 72, 40, 65, - 36, 64, 93, 67, 176, 231, 19, 65, 0, 64, 118, 64, 0, 96, 80, 67, 185, 40, 80, - 71, 180, 152, 114, 72, 0, 72, 40, 69, 4, 128, 93, 67, 177, 37, 19, 65, 0, 0, - 118, 64, 0, 1, 54, 0, 0, 0, 80, 67, 180, 152, 80, 65, 0, 8, 80, 71, 184, 168, - 114, 72, 0, 64, 40, 69, 4, 128, 80, 71, 182, 112, 114, 72, 0, 64, 40, 69, 4, - 128, 80, 75, 181, 176, 26, 233, 16, 0, 26, 229, 32, 0, 32, 248, 51, 0, 88, - 251, 224, 2, 80, 251, 224, 4, 116, 0, 2, 22, 26, 71, 208, 0, 80, 75, 176, 96, - 114, 76, 0, 64, 40, 73, 20, 192, 80, 71, 178, 184, 114, 76, 0, 64, 40, 69, 36, - 192, 80, 71, 182, 176, 114, 72, 0, 64, 40, 69, 4, 128, 80, 67, 181, 240, 26, - 233, 16, 0, 26, 229, 0, 0, 32, 248, 51, 0, 88, 251, 224, 2, 80, 251, 224, 4, - 116, 0, 2, 5, 26, 67, 208, 0, 80, 71, 176, 160, 114, 72, 0, 64, 40, 69, 4, - 128, 80, 67, 179, 64, 114, 72, 0, 64, 40, 65, 20, 128, 80, 67, 179, 200, 80, - 71, 176, 96, 114, 72, 0, 32, 27, 72, 4, 128, 16, 73, 20, 128, 114, 68, 0, 32, - 40, 65, 36, 64, 80, 69, 0, 32, 80, 75, 176, 160, 114, 76, 0, 32, 27, 76, 20, - 192, 16, 77, 36, 192, 114, 72, 0, 32, 40, 69, 52, 128, 80, 71, 182, 48, 114, - 72, 0, 64, 40, 69, 4, 128, 80, 67, 181, 144, 26, 233, 16, 0, 26, 229, 0, 0, - 32, 248, 51, 0, 88, 251, 224, 2, 80, 251, 224, 4, 116, 0, 0, 93, 26, 67, 208, - 0, 80, 71, 176, 224, 114, 72, 0, 32, 40, 69, 4, 128, 80, 67, 185, 112, 114, - 72, 0, 32, 40, 65, 20, 128, 80, 67, 180, 8, 95, 236, 0, 129, 80, 75, 185, 8, - 114, 76, 0, 32, 40, 73, 20, 192, 80, 71, 185, 8, 112, 68, 0, 12, 80, 71, 185, - 8, 80, 75, 178, 48, 114, 76, 0, 32, 40, 73, 20, 192, 80, 69, 0, 8, 114, 76, 0, - 32, 40, 69, 36, 192, 80, 75, 183, 128, 114, 68, 0, 40, 40, 73, 4, 64, 116, 0, - 0, 10, 80, 67, 180, 80, 80, 65, 0, 64, 80, 71, 178, 80, 95, 236, 16, 74, 80, - 73, 16, 32, 114, 76, 0, 8, 40, 73, 4, 192, 80, 75, 183, 128, 114, 64, 0, 40, - 40, 73, 20, 0, 80, 67, 185, 208, 114, 68, 0, 40, 40, 65, 36, 64, 93, 67, 176, - 240, 19, 65, 0, 0, 26, 68, 16, 0, 118, 64, 0, 1, 26, 68, 0, 0, 118, 68, 0, 1, - 116, 0, 0, 23, 80, 64, 64, 0, 80, 71, 185, 208, 80, 75, 180, 224, 114, 76, 0, - 40, 40, 73, 20, 192, 93, 71, 177, 58, 19, 69, 16, 0, 118, 68, 0, 1, 54, 0, 0, - 0, 80, 71, 180, 224, 80, 69, 16, 8, 80, 75, 184, 232, 114, 76, 0, 32, 40, 73, - 20, 192, 80, 71, 184, 232, 80, 75, 183, 168, 114, 76, 0, 32, 40, 73, 4, 192, - 80, 67, 183, 200, 114, 76, 0, 32, 40, 65, 20, 192, 161, 65, 36, 32, 118, 64, - 0, 2, 26, 244, 0, 0, 116, 0, 0, 1, 26, 244, 16, 0, 146, 0, 10, 56, 26, 249, - 80, 0, 152, 8, 0, 0, 151, 0, 1, 255, 74, 248, 0, 0, 149, 0, 0, 15, 150, 8, 0, - 0, 26, 236, 80, 0, 145, 0, 0, 64, 26, 67, 160, 0, 26, 71, 144, 0, 26, 75, 224, - 0, 114, 76, 0, 64, 40, 237, 4, 192, 114, 64, 0, 64, 40, 71, 180, 0, 26, 245, - 16, 0, 146, 0, 0, 64, 26, 249, 32, 0, 152, 8, 0, 0, 151, 0, 0, 15, 74, 248, 0, - 0, 149, 0, 0, 127, 150, 8, 0, 0, 26, 236, 80, 0, 145, 0, 0, 200, 26, 67, 160, - 0, 26, 71, 144, 0, 26, 75, 224, 0, 93, 79, 240, 16, 16, 77, 48, 192, 26, 80, - 0, 0, 38, 80, 0, 0, 26, 80, 112, 0, 95, 237, 64, 18, 95, 236, 0, 19, 95, 236, - 0, 20, 80, 83, 176, 144, 80, 87, 176, 32, 114, 88, 0, 64, 40, 85, 5, 128, 26, - 233, 80, 0, 26, 229, 64, 0, 32, 248, 51, 0, 88, 251, 224, 2, 80, 251, 224, 4, - 116, 0, 0, 34, 80, 67, 176, 144, 80, 83, 176, 168, 114, 84, 0, 32, 40, 81, 53, - 64, 80, 79, 176, 168, 80, 83, 176, 120, 114, 84, 0, 24, 40, 81, 5, 64, 26, - 233, 64, 0, 32, 248, 51, 0, 88, 251, 224, 2, 80, 251, 224, 4, 116, 0, 1, 79, - 26, 83, 208, 0, 80, 87, 176, 96, 114, 88, 0, 24, 40, 85, 5, 128, 26, 233, 80, - 0, 32, 248, 51, 0, 88, 251, 224, 2, 80, 251, 224, 4, 116, 0, 0, 222, 26, 67, - 208, 0, 65, 77, 68, 0, 114, 64, 0, 32, 40, 237, 52, 0, 114, 64, 0, 32, 40, 71, - 180, 0, 26, 245, 16, 0, 146, 0, 0, 200, 26, 249, 32, 0, 152, 8, 0, 0, 151, 0, - 0, 127, 74, 248, 0, 0, 149, 0, 0, 31, 150, 8, 0, 0, 26, 236, 80, 0, 145, 0, 0, - 64, 26, 67, 160, 0, 26, 71, 144, 0, 26, 75, 224, 0, 114, 76, 0, 32, 40, 237, - 4, 192, 26, 235, 176, 0, 26, 229, 16, 0, 32, 248, 51, 0, 88, 251, 224, 2, 80, - 251, 224, 4, 116, 0, 0, 16, 80, 65, 0, 32, 80, 79, 176, 32, 114, 80, 0, 32, - 40, 77, 5, 0, 26, 233, 48, 0, 26, 229, 16, 0, 32, 248, 51, 0, 88, 251, 224, 2, - 80, 251, 224, 4, 116, 0, 0, 6, 26, 244, 0, 0, 146, 0, 0, 64, 26, 249, 32, 0, - 152, 8, 0, 0, 151, 0, 0, 31, 74, 248, 0, 0, 149, 0, 3, 255, 150, 8, 0, 0, 26, - 236, 80, 0, 145, 0, 1, 88, 26, 67, 160, 0, 26, 91, 144, 0, 26, 87, 224, 0, - 114, 68, 0, 32, 38, 68, 0, 0, 26, 68, 112, 0, 80, 75, 176, 72, 114, 76, 0, 32, - 40, 73, 4, 192, 93, 65, 32, 0, 93, 77, 32, 1, 93, 81, 32, 2, 93, 73, 32, 3, - 95, 69, 0, 0, 95, 69, 48, 1, 95, 69, 64, 2, 95, 69, 32, 3, 80, 67, 176, 104, - 26, 233, 16, 0, 114, 68, 0, 32, 26, 229, 16, 0, 26, 225, 0, 0, 32, 248, 51, 0, - 88, 251, 224, 2, 80, 251, 224, 4, 116, 0, 0, 171, 26, 67, 208, 0, 80, 71, 176, - 16, 114, 72, 0, 16, 40, 69, 4, 128, 114, 72, 0, 16, 40, 237, 4, 128, 80, 67, - 177, 0, 114, 72, 0, 16, 40, 67, 180, 128, 80, 75, 176, 136, 26, 233, 0, 0, 26, - 229, 32, 0, 32, 248, 51, 0, 88, 251, 224, 2, 80, 251, 224, 4, 116, 0, 0, 187, - 26, 67, 208, 0, 93, 73, 0, 0, 93, 65, 0, 1, 80, 79, 177, 32, 114, 80, 0, 16, - 40, 77, 21, 0, 26, 233, 48, 0, 32, 248, 51, 0, 88, 251, 224, 2, 80, 251, 224, - 4, 116, 0, 0, 210, 26, 71, 208, 0, 80, 95, 176, 48, 95, 237, 32, 6, 95, 237, - 0, 7, 95, 237, 16, 8, 80, 67, 176, 168, 114, 68, 0, 24, 40, 65, 116, 64, 26, - 233, 0, 0, 32, 248, 51, 0, 88, 251, 224, 2, 80, 251, 224, 4, 116, 0, 0, 109, - 26, 99, 208, 0, 19, 65, 128, 0, 118, 64, 0, 100, 93, 65, 96, 2, 19, 65, 0, 0, - 118, 64, 0, 95, 93, 65, 96, 2, 16, 101, 6, 0, 93, 65, 96, 2, 80, 71, 176, 192, - 114, 72, 0, 16, 40, 69, 100, 128, 26, 233, 16, 0, 32, 248, 51, 0, 88, 251, - 224, 2, 80, 251, 224, 4, 116, 0, 0, 103, 26, 71, 208, 0, 22, 69, 22, 64, 118, - 68, 0, 1, 116, 0, 0, 58, 80, 71, 176, 224, 114, 72, 0, 16, 40, 69, 100, 128, - 26, 233, 16, 0, 32, 248, 51, 0, 88, 251, 224, 2, 80, 251, 224, 4, 116, 0, 0, - 123, 26, 71, 208, 0, 80, 75, 176, 208, 114, 76, 0, 16, 40, 73, 100, 192, 26, - 233, 32, 0, 32, 248, 51, 0, 88, 251, 224, 2, 80, 251, 224, 4, 116, 0, 0, 82, - 26, 75, 208, 0, 21, 77, 148, 128, 26, 81, 16, 0, 118, 76, 0, 1, 116, 0, 0, 6, - 38, 100, 0, 0, 26, 80, 112, 0, 21, 77, 32, 0, 118, 76, 0, 1, 116, 0, 0, 1, 40, - 81, 20, 128, 80, 71, 176, 120, 26, 233, 64, 0, 26, 229, 144, 0, 26, 225, 16, - 0, 32, 248, 51, 0, 88, 251, 224, 2, 80, 251, 224, 4, 116, 0, 0, 74, 26, 71, - 208, 0, 80, 75, 176, 32, 114, 76, 0, 16, 40, 73, 20, 192, 80, 71, 177, 72, - 114, 76, 0, 16, 40, 69, 36, 192, 80, 71, 177, 16, 114, 76, 0, 16, 40, 69, 36, - 192, 80, 75, 176, 152, 26, 233, 16, 0, 26, 229, 32, 0, 32, 248, 51, 0, 88, - 251, 224, 2, 80, 251, 224, 4, 116, 0, 0, 89, 26, 71, 208, 0, 93, 73, 16, 0, - 93, 69, 16, 1, 95, 89, 32, 0, 95, 89, 16, 1, 80, 71, 176, 240, 114, 72, 0, 16, - 40, 69, 100, 128, 26, 233, 16, 0, 32, 248, 51, 0, 88, 251, 224, 2, 80, 251, - 224, 4, 116, 0, 0, 65, 26, 71, 208, 0, 16, 65, 20, 0, 80, 71, 177, 48, 114, - 72, 0, 24, 40, 69, 116, 128, 26, 233, 16, 0, 32, 248, 51, 0, 88, 251, 224, 2, - 80, 251, 224, 4, 116, 0, 0, 116, 26, 71, 208, 0, 40, 65, 22, 0, 95, 89, 144, - 2, 116, 0, 0, 2, 114, 64, 0, 24, 40, 89, 116, 0, 26, 244, 0, 0, 146, 0, 1, 88, - 26, 249, 80, 0, 152, 8, 0, 0, 151, 0, 3, 255, 74, 248, 0, 0, 149, 0, 0, 3, - 150, 8, 0, 0, 26, 236, 80, 0, 26, 67, 160, 0, 26, 71, 224, 0, 93, 65, 0, 2, - 26, 245, 0, 0, 26, 249, 16, 0, 152, 8, 0, 0, 151, 0, 0, 3, 74, 248, 0, 0, 149, - 0, 0, 3, 150, 8, 0, 0, 26, 236, 80, 0, 26, 67, 160, 0, 26, 71, 224, 0, 93, 65, - 0, 1, 26, 245, 0, 0, 26, 249, 16, 0, 152, 8, 0, 0, 151, 0, 0, 3, 74, 248, 0, - 0, 149, 0, 0, 31, 150, 8, 0, 0, 26, 236, 80, 0, 145, 0, 0, 32, 26, 67, 160, 0, - 26, 71, 144, 0, 26, 75, 128, 0, 26, 79, 224, 0, 80, 83, 176, 16, 95, 237, 0, - 2, 95, 237, 16, 3, 114, 64, 0, 16, 40, 237, 68, 0, 114, 64, 0, 16, 40, 75, - 180, 0, 26, 245, 32, 0, 146, 0, 0, 32, 26, 249, 48, 0, 152, 8, 0, 0, 151, 0, - 0, 31, 74, 248, 0, 0, 149, 0, 0, 3, 150, 8, 0, 0, 26, 236, 80, 0, 26, 67, 160, - 0, 26, 71, 224, 0, 93, 65, 0, 0, 26, 245, 0, 0, 26, 249, 16, 0, 152, 8, 0, 0, - 151, 0, 0, 3, 74, 248, 0, 0, 149, 0, 0, 63, 150, 8, 0, 0, 26, 236, 80, 0, 145, - 0, 0, 32, 26, 67, 160, 0, 26, 71, 144, 0, 26, 75, 224, 0, 80, 79, 176, 16, - 114, 80, 0, 16, 40, 77, 5, 0, 26, 233, 48, 0, 32, 248, 51, 0, 88, 251, 224, 2, - 80, 251, 224, 4, 116, 0, 0, 19, 26, 79, 208, 0, 38, 76, 0, 0, 26, 80, 112, 0, - 21, 85, 48, 0, 118, 84, 0, 1, 116, 0, 0, 5, 114, 84, 0, 16, 40, 237, 5, 64, - 26, 67, 176, 0, 93, 65, 0, 0, 40, 81, 4, 192, 95, 69, 64, 0, 95, 69, 48, 1, - 26, 245, 16, 0, 146, 0, 0, 32, 26, 249, 32, 0, 152, 8, 0, 0, 151, 0, 0, 63, - 74, 248, 0, 0, 149, 0, 0, 7, 150, 8, 0, 0, 26, 236, 80, 0, 145, 0, 0, 16, 26, - 67, 160, 0, 26, 71, 224, 0, 114, 72, 0, 16, 40, 237, 4, 128, 26, 67, 176, 0, - 93, 65, 0, 1, 26, 245, 0, 0, 146, 0, 0, 16, 26, 249, 16, 0, 152, 8, 0, 0, 151, - 0, 0, 7, 74, 248, 0, 0, 149, 0, 0, 7, 150, 8, 0, 0, 26, 236, 80, 0, 145, 0, 0, - 16, 26, 67, 160, 0, 26, 71, 224, 0, 114, 72, 0, 16, 40, 237, 4, 128, 26, 235, - 176, 0, 32, 248, 51, 0, 88, 251, 224, 2, 80, 251, 224, 4, 117, 0, 0, 72, 26, - 67, 208, 0, 26, 245, 0, 0, 146, 0, 0, 16, 26, 249, 16, 0, 152, 8, 0, 0, 151, - 0, 0, 7, 74, 248, 0, 0, 149, 0, 0, 15, 150, 8, 0, 0, 26, 236, 80, 0, 26, 67, - 160, 0, 26, 71, 144, 0, 26, 75, 224, 0, 114, 76, 0, 64, 40, 69, 4, 192, 26, - 245, 16, 0, 26, 249, 32, 0, 152, 8, 0, 0, 151, 0, 0, 15, 74, 248, 0, 0, 71, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 25, 69, 116, 104, 101, 114, 101, 117, 109, 32, 83, - 105, 103, 110, 101, 100, 32, 77, 101, 115, 115, 97, 103, 101, 58, 10, 51, 50, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 204, 204, 204, 204, 204, 204, 0, 2, 0, 0, 0, 0, - 0, 0, 10, 132, 0, 0, 0, 0, 0, 0, 10, 156, 0, 0, 0, 0, 0, 0, 10, 148, 0, 0, 0, - 0, 0, 0, 6, 124, -]); diff --git a/packages/evm-connector/src/index.ts b/packages/evm-connector/src/index.ts deleted file mode 100644 index 747cf72a2..000000000 --- a/packages/evm-connector/src/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './EvmWalletConnector'; diff --git a/packages/evm-connector/src/test/chain_config/chain_config.json b/packages/evm-connector/src/test/chain_config/chain_config.json deleted file mode 100644 index bc46b3afc..000000000 --- a/packages/evm-connector/src/test/chain_config/chain_config.json +++ /dev/null @@ -1,271 +0,0 @@ -{ - "chain_name": "Upgradable Testnet", - "consensus_parameters": { - "V1": { - "tx_params": { - "V1": { - "max_inputs": 255, - "max_outputs": 255, - "max_witnesses": 255, - "max_gas_per_tx": 30000000, - "max_size": 112640, - "max_bytecode_subsections": 256 - } - }, - "predicate_params": { - "V1": { - "max_predicate_length": 102400, - "max_predicate_data_length": 102400, - "max_message_data_length": 102400, - "max_gas_per_predicate": 30000000 - } - }, - "script_params": { - "V1": { - "max_script_length": 102400, - "max_script_data_length": 102400 - } - }, - "contract_params": { - "V1": { - "contract_max_size": 102400, - "max_storage_slots": 1760 - } - }, - "fee_params": { - "V1": { - "gas_price_factor": 92, - "gas_per_byte": 63 - } - }, - "chain_id": 0, - "gas_costs": { - "V1": { - "add": 2, - "addi": 2, - "aloc": 1, - "and": 2, - "andi": 2, - "bal": 366, - "bhei": 2, - "bhsh": 2, - "burn": 33949, - "cb": 2, - "cfei": 2, - "cfsi": 2, - "div": 2, - "divi": 2, - "eck1": 3347, - "ecr1": 46165, - "ed19": 4210, - "eq": 2, - "exp": 2, - "expi": 2, - "flag": 1, - "gm": 2, - "gt": 2, - "gtf": 16, - "ji": 2, - "jmp": 2, - "jne": 2, - "jnei": 2, - "jnzi": 2, - "jmpf": 2, - "jmpb": 2, - "jnzf": 2, - "jnzb": 2, - "jnef": 2, - "jneb": 2, - "lb": 2, - "log": 754, - "lt": 2, - "lw": 2, - "mint": 35718, - "mlog": 2, - "mod": 2, - "modi": 2, - "move": 2, - "movi": 2, - "mroo": 5, - "mul": 2, - "muli": 2, - "mldv": 4, - "noop": 1, - "not": 2, - "or": 2, - "ori": 2, - "poph": 3, - "popl": 3, - "pshh": 4, - "pshl": 4, - "ret_contract": 733, - "rvrt_contract": 722, - "sb": 2, - "sll": 2, - "slli": 2, - "srl": 2, - "srli": 2, - "srw": 253, - "sub": 2, - "subi": 2, - "sw": 2, - "sww": 29053, - "time": 79, - "tr": 46242, - "tro": 33251, - "wdcm": 3, - "wqcm": 3, - "wdop": 3, - "wqop": 3, - "wdml": 3, - "wqml": 4, - "wddv": 5, - "wqdv": 7, - "wdmd": 11, - "wqmd": 18, - "wdam": 9, - "wqam": 12, - "wdmm": 11, - "wqmm": 11, - "xor": 2, - "xori": 2, - "call": { - "LightOperation": { - "base": 21687, - "units_per_gas": 4 - } - }, - "ccp": { - "LightOperation": { - "base": 59, - "units_per_gas": 20 - } - }, - "croo": { - "LightOperation": { - "base": 1, - "units_per_gas": 1 - } - }, - "csiz": { - "LightOperation": { - "base": 59, - "units_per_gas": 195 - } - }, - "k256": { - "LightOperation": { - "base": 282, - "units_per_gas": 3 - } - }, - "ldc": { - "LightOperation": { - "base": 45, - "units_per_gas": 65 - } - }, - "logd": { - "LightOperation": { - "base": 1134, - "units_per_gas": 2 - } - }, - "mcl": { - "LightOperation": { - "base": 3, - "units_per_gas": 523 - } - }, - "mcli": { - "LightOperation": { - "base": 3, - "units_per_gas": 526 - } - }, - "mcp": { - "LightOperation": { - "base": 3, - "units_per_gas": 448 - } - }, - "mcpi": { - "LightOperation": { - "base": 7, - "units_per_gas": 585 - } - }, - "meq": { - "LightOperation": { - "base": 11, - "units_per_gas": 1097 - } - }, - "retd_contract": { - "LightOperation": { - "base": 1086, - "units_per_gas": 2 - } - }, - "s256": { - "LightOperation": { - "base": 45, - "units_per_gas": 3 - } - }, - "scwq": { - "HeavyOperation": { - "base": 30375, - "gas_per_unit": 28628 - } - }, - "smo": { - "LightOperation": { - "base": 64196, - "units_per_gas": 1 - } - }, - "srwq": { - "HeavyOperation": { - "base": 262, - "gas_per_unit": 249 - } - }, - "swwq": { - "HeavyOperation": { - "base": 28484, - "gas_per_unit": 26613 - } - }, - "contract_root": { - "LightOperation": { - "base": 45, - "units_per_gas": 1 - } - }, - "state_root": { - "HeavyOperation": { - "base": 350, - "gas_per_unit": 176 - } - }, - "new_storage_per_byte": 63, - "vm_initialization": { - "LightOperation": { - "base": 1645, - "units_per_gas": 14 - } - } - } - }, - "base_asset_id": "0000000000000000000000000000000000000000000000000000000000000000", - "block_gas_limit": 30000000, - "privileged_address": "0000000000000000000000000000000000000000000000000000000000000000" - } - }, - "consensus": { - "PoA": { - "signing_key": "0xc8e615a4089466174459ef19cfd257d2e17adfabff3b8f219dbb5fb4eca87c50" - } - } -} diff --git a/packages/evm-connector/src/test/chain_config/metadata.json b/packages/evm-connector/src/test/chain_config/metadata.json deleted file mode 100644 index 9d12c38b6..000000000 --- a/packages/evm-connector/src/test/chain_config/metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "chain_config": "chain_config.json", - "table_encoding": { - "Json": { - "filepath": "state_config.json" - } - } -} diff --git a/packages/evm-connector/src/test/chain_config/state_config.json b/packages/evm-connector/src/test/chain_config/state_config.json deleted file mode 100644 index 37baa8a9c..000000000 --- a/packages/evm-connector/src/test/chain_config/state_config.json +++ /dev/null @@ -1,188 +0,0 @@ -{ - "coins": [ - { - "owner": "0x94ffcc53b892684acefaebc8a3d4a595e528a8cf664eeb3ef36f1020b0809d0d", - "amount": 1000000000000, - "asset_id": "0x0000000000000000000000000000000000000000000000000000000000000000", - "tx_id": "0x0000000000000000000000000000000000000000000000000000000000000001", - "output_index": 0, - "tx_pointer_block_height": 0, - "tx_pointer_tx_idx": 0 - }, - { - "owner": "0x6e8ec14985922d2b5daf0a9ae68ca63d849e72f09fbc8ab2ddbb88b779a083a0", - "amount": 1000000000000, - "asset_id": "0x0000000000000000000000000000000000000000000000000000000000000000", - "tx_id": "0x0000000000000000000000000000000000000000000000000000000000000002", - "output_index": 0, - "tx_pointer_block_height": 0, - "tx_pointer_tx_idx": 0 - }, - { - "owner": "0x09c0b2d1a486c439a87bcba6b46a7a1a23f3897cc83a94521a96da5c23bc58db", - "amount": 1000000000000, - "asset_id": "0x0000000000000000000000000000000000000000000000000000000000000000", - "tx_id": "0x0000000000000000000000000000000000000000000000000000000000000003", - "output_index": 0, - "tx_pointer_block_height": 0, - "tx_pointer_tx_idx": 0 - }, - { - "owner": "0x09c0b2d1a486c439a87bcba6b46a7a1a23f3897cc83a94521a96da5c23bc58db", - "amount": 1000000000000, - "asset_id": "0x0101010101010101010101010101010101010101010101010101010101010101", - "tx_id": "0x0000000000000000000000000000000000000000000000000000000000000004", - "output_index": 0, - "tx_pointer_block_height": 0, - "tx_pointer_tx_idx": 0 - }, - { - "owner": "0x09c0b2d1a486c439a87bcba6b46a7a1a23f3897cc83a94521a96da5c23bc58db", - "amount": 1000000000000, - "asset_id": "0x0202020202020202020202020202020202020202020202020202020202020202", - "tx_id": "0x0000000000000000000000000000000000000000000000000000000000000005", - "output_index": 0, - "tx_pointer_block_height": 0, - "tx_pointer_tx_idx": 0 - }, - { - "owner": "0x5d99ee966b42cd8fc7bdd1364b389153a9e78b42b7d4a691470674e817888d4e", - "amount": 1000000000000, - "asset_id": "0x0000000000000000000000000000000000000000000000000000000000000000", - "tx_id": "0x0000000000000000000000000000000000000000000000000000000000000006", - "output_index": 0, - "tx_pointer_block_height": 0, - "tx_pointer_tx_idx": 0 - }, - { - "owner": "0x5d99ee966b42cd8fc7bdd1364b389153a9e78b42b7d4a691470674e817888d4e", - "amount": 1000000000000, - "asset_id": "0x0101010101010101010101010101010101010101010101010101010101010101", - "tx_id": "0x0000000000000000000000000000000000000000000000000000000000000007", - "output_index": 0, - "tx_pointer_block_height": 0, - "tx_pointer_tx_idx": 0 - }, - { - "owner": "0x5d99ee966b42cd8fc7bdd1364b389153a9e78b42b7d4a691470674e817888d4e", - "amount": 1000000000000, - "asset_id": "0x0202020202020202020202020202020202020202020202020202020202020202", - "tx_id": "0x0000000000000000000000000000000000000000000000000000000000000008", - "output_index": 0, - "tx_pointer_block_height": 0, - "tx_pointer_tx_idx": 0 - }, - { - "owner": "0xbdaad6a89e073e177895b3e5a9ccd15806749eda134a6438dae32fc5b6601f3f", - "amount": 1000000000000, - "asset_id": "0x0000000000000000000000000000000000000000000000000000000000000000", - "tx_id": "0x0000000000000000000000000000000000000000000000000000000000000009", - "output_index": 0, - "tx_pointer_block_height": 0, - "tx_pointer_tx_idx": 0 - }, - { - "owner": "0xbdaad6a89e073e177895b3e5a9ccd15806749eda134a6438dae32fc5b6601f3f", - "amount": 1000000000000, - "asset_id": "0x0101010101010101010101010101010101010101010101010101010101010101", - "tx_id": "0x000000000000000000000000000000000000000000000000000000000000000a", - "output_index": 0, - "tx_pointer_block_height": 0, - "tx_pointer_tx_idx": 0 - }, - { - "owner": "0xbdaad6a89e073e177895b3e5a9ccd15806749eda134a6438dae32fc5b6601f3f", - "amount": 1000000000000, - "asset_id": "0x0202020202020202020202020202020202020202020202020202020202020202", - "tx_id": "0x000000000000000000000000000000000000000000000000000000000000000b", - "output_index": 0, - "tx_pointer_block_height": 0, - "tx_pointer_tx_idx": 0 - }, - { - "owner": "0x95a7aa6cc32743f8706c40ef49a7423b47da763bb4bbc055b1f07254dc729036", - "amount": 1000000000000, - "asset_id": "0x0000000000000000000000000000000000000000000000000000000000000000", - "tx_id": "0x000000000000000000000000000000000000000000000000000000000000000c", - "output_index": 0, - "tx_pointer_block_height": 0, - "tx_pointer_tx_idx": 0 - }, - { - "owner": "0x95a7aa6cc32743f8706c40ef49a7423b47da763bb4bbc055b1f07254dc729036", - "amount": 1000000000000, - "asset_id": "0x0101010101010101010101010101010101010101010101010101010101010101", - "tx_id": "0x000000000000000000000000000000000000000000000000000000000000000d", - "output_index": 0, - "tx_pointer_block_height": 0, - "tx_pointer_tx_idx": 0 - }, - { - "owner": "0x95a7aa6cc32743f8706c40ef49a7423b47da763bb4bbc055b1f07254dc729036", - "amount": 1000000000000, - "asset_id": "0x0202020202020202020202020202020202020202020202020202020202020202", - "tx_id": "0x000000000000000000000000000000000000000000000000000000000000000e", - "output_index": 0, - "tx_pointer_block_height": 0, - "tx_pointer_tx_idx": 0 - }, - { - "owner": "0xcee104acd38b940c8f1c62c6d7ea00a0ad2241d6dee0509a4bf27297508870d3", - "amount": 1000000000000, - "asset_id": "0x0000000000000000000000000000000000000000000000000000000000000000", - "tx_id": "0x000000000000000000000000000000000000000000000000000000000000000f", - "output_index": 0, - "tx_pointer_block_height": 0, - "tx_pointer_tx_idx": 0 - }, - { - "owner": "0xcee104acd38b940c8f1c62c6d7ea00a0ad2241d6dee0509a4bf27297508870d3", - "amount": 1000000000000, - "asset_id": "0x0101010101010101010101010101010101010101010101010101010101010101", - "tx_id": "0x0000000000000000000000000000000000000000000000000000000000000010", - "output_index": 0, - "tx_pointer_block_height": 0, - "tx_pointer_tx_idx": 0 - }, - { - "owner": "0xcee104acd38b940c8f1c62c6d7ea00a0ad2241d6dee0509a4bf27297508870d3", - "amount": 1000000000000, - "asset_id": "0x0202020202020202020202020202020202020202020202020202020202020202", - "tx_id": "0x0000000000000000000000000000000000000000000000000000000000000011", - "output_index": 0, - "tx_pointer_block_height": 0, - "tx_pointer_tx_idx": 0 - }, - { - "owner": "0x7e3626e306588eba79cafab73f0709e55ab8f4bdfe8c8b75034a430fc56ece89", - "amount": 1000000000000, - "asset_id": "0x0000000000000000000000000000000000000000000000000000000000000000", - "tx_id": "0x0000000000000000000000000000000000000000000000000000000000000012", - "output_index": 0, - "tx_pointer_block_height": 0, - "tx_pointer_tx_idx": 0 - }, - { - "owner": "0x7e3626e306588eba79cafab73f0709e55ab8f4bdfe8c8b75034a430fc56ece89", - "amount": 1000000000000, - "asset_id": "0x0101010101010101010101010101010101010101010101010101010101010101", - "tx_id": "0x0000000000000000000000000000000000000000000000000000000000000013", - "output_index": 0, - "tx_pointer_block_height": 0, - "tx_pointer_tx_idx": 0 - }, - { - "owner": "0x7e3626e306588eba79cafab73f0709e55ab8f4bdfe8c8b75034a430fc56ece89", - "amount": 1000000000000, - "asset_id": "0x0202020202020202020202020202020202020202020202020202020202020202", - "tx_id": "0x0000000000000000000000000000000000000000000000000000000000000014", - "output_index": 0, - "tx_pointer_block_height": 0, - "tx_pointer_tx_idx": 0 - } - ], - "messages": [], - "contracts": [], - "block_height": 0, - "da_block_height": 0 -} diff --git a/packages/evm-connector/src/test/chain_config/state_transition_bytecode.wasm b/packages/evm-connector/src/test/chain_config/state_transition_bytecode.wasm deleted file mode 100644 index e69de29bb..000000000 diff --git a/packages/evm-connector/src/test/evmWalletConnector.test.ts b/packages/evm-connector/src/test/evmWalletConnector.test.ts deleted file mode 100644 index f70e81540..000000000 --- a/packages/evm-connector/src/test/evmWalletConnector.test.ts +++ /dev/null @@ -1,686 +0,0 @@ -import path from 'node:path'; -import { - EthereumWalletAdapter, - type PredicateConfig, - PredicateFactory, -} from '@fuel-connectors/common'; -import { - Address, - type Asset, - type Predicate as FuelPredicate, - InputType, - type Provider, - ScriptTransactionRequest, - Wallet, - WalletUnlocked, - arrayify, - bn, - hexlify, -} from 'fuels'; -import { launchTestNode } from 'fuels/test-utils'; -import { - afterAll, - afterEach, - beforeAll, - beforeEach, - describe, - expect, - test, -} from 'vitest'; -import { EVMWalletConnector } from '../EvmWalletConnector'; -import { MockProvider } from './mockProvider'; -import { PREDICATE_VERSIONS } from './mockedPredicate'; - -const MAX_FEE = bn(10_000); - -async function createTransaction( - predicate: FuelPredicate, - address: string, -) { - const ALT_ASSET_ID = - '0x0101010101010101010101010101010101010101010101010101010101010101'; - - try { - const tx = new ScriptTransactionRequest({ - gasLimit: bn(10_000), - maxFee: MAX_FEE, - }); - - const provider = predicate.provider; - - const coins = await predicate.getResourcesToSpend([ - { - assetId: provider.getBaseAssetId(), - amount: bn.parseUnits('0.001'), - }, - { - assetId: ALT_ASSET_ID, - amount: bn.parseUnits('0.001'), - }, - ]); - - tx.addResources(coins); - - tx.inputs?.forEach((input) => { - if ( - input.type === InputType.Coin && - hexlify(input.owner) === predicate.address.toString() - ) { - input.predicate = arrayify(predicate.bytes); - } - }); - - tx.addCoinOutput( - Address.fromString(address), - bn.parseUnits('0.0001'), - provider.getBaseAssetId(), - ); - - tx.addCoinOutput( - Address.fromString(address), - bn.parseUnits('0.0001'), - ALT_ASSET_ID, - ); - - return tx; - } catch (e) { - throw new Error( - //@ts-ignore - e?.response?.errors[0].message ?? e, - ); - } -} - -describe('EVM Wallet Connector', () => { - const predicate = Object.values(PREDICATE_VERSIONS)[0] - ?.predicate as PredicateConfig; - const predicateFactory = new PredicateFactory( - new EthereumWalletAdapter(), - predicate, - '', - ); - // Providers used to interact with wallets - let ethProvider: MockProvider; - let fuelProvider: Provider; - let baseAssetId: string; - let stopProvider: () => void; - - const snapshotPath = path.join(__dirname, 'chain_config'); - - beforeAll(async () => { - //Launch test node - process.env.GENESIS_SECRET = - '0x6e48a022f9d4ae187bca4e2645abd62198ae294ee484766edbdaadf78160dc68'; - const { cleanup, provider } = await launchTestNode({ - nodeOptions: { - args: ['--snapshot', snapshotPath], - loggingEnabled: false, - // use fixed port to don't conflict with other packages, - port: '10001', - }, - }); - - fuelProvider = provider; - baseAssetId = fuelProvider.getBaseAssetId(); - - stopProvider = cleanup; - }); - - afterAll(() => { - stopProvider?.(); - }); - - beforeEach(async () => { - // Create the Ethereum provider - ethProvider = new MockProvider(); - }); - - afterEach(() => { - ethProvider.removeAllListeners(); - }); - - describe('connect()', () => { - test('connects to ethers signer', async () => { - const connector = new EVMWalletConnector({ - ethProvider, - fuelProvider, - }); - - const connected = await connector.connect(); - - expect(connected).to.be.true; - }); - }); - - describe('isConnected()', () => { - test('false when not connected', async () => { - const connector = new EVMWalletConnector({ - ethProvider, - fuelProvider, - }); - - const connected = await connector.isConnected(); - - expect(connected).to.be.false; - }); - - test('true when connected', async () => { - const connector = new EVMWalletConnector({ - ethProvider, - fuelProvider, - }); - - await connector.connect(); - const connected = await connector.isConnected(); - - expect(connected).to.be.true; - }); - }); - - describe('disconnect()', () => { - test('disconnects from ethers signer', async () => { - const connector = new EVMWalletConnector({ - ethProvider, - fuelProvider, - }); - - await connector.connect(); - - const connected = await connector.disconnect(); - - expect(connected).to.be.false; - }); - }); - - describe('accounts()', () => { - test('returns the predicate accounts associated with the wallet', async () => { - const accounts = ethProvider.getAccounts(); - - const connector = new EVMWalletConnector({ - ethProvider, - fuelProvider, - predicateConfig: predicate, - }); - await connector.connect(); - - const connectorAccounts = await connector.accounts(); - - const predicateAccounts = - predicateFactory.getPredicateAddresses(accounts); - - expect(connectorAccounts[0]).to.be.equal(predicateAccounts[0]); - expect(connectorAccounts[1]).to.be.equal(predicateAccounts[1]); - }); - }); - - describe('currentAccount()', () => { - test('returns the predicate account associated with the current signer account', async () => { - const accounts = ethProvider.getAccounts(); - const predicateAddress = predicateFactory.getPredicateAddress( - accounts[0] as string, - ); - - const evmConnector = new EVMWalletConnector({ - ethProvider, - fuelProvider, - predicateConfig: predicate, - }); - - await evmConnector.connect(); - - const account = await evmConnector.currentAccount(); - - expect(account).to.be.equal(predicateAddress); - }); - - test('throws error when not connected', async () => { - const connector = new EVMWalletConnector({ - ethProvider, - fuelProvider, - }); - - await expect(() => connector.currentAccount()).rejects.toThrowError( - 'No connected accounts', - ); - }); - }); - - describe('signMessage()', () => { - test('throws error', async () => { - const connector = new EVMWalletConnector({ - ethProvider, - fuelProvider, - }); - - await expect(() => - connector.signMessage('address', 'message'), - ).rejects.toThrowError('A predicate account cannot sign messages'); - }); - }); - - describe('sendTransaction()', () => { - const ALT_ASSET_ID = - '0x0101010101010101010101010101010101010101010101010101010101010101'; - - test('transfer when the current signer is passed in', async () => { - const accounts = ethProvider.getAccounts(); - const ethAccount1 = accounts[0] as string; - const accountAddress = predicateFactory.getPredicateAddress(ethAccount1); - const fundingWallet = new WalletUnlocked('0x01', fuelProvider); - - const createdPredicate = predicateFactory.build( - ethAccount1, - fuelProvider, - [0], - ); - - // Transfer base asset coins to predicate - await fundingWallet - .transfer(createdPredicate.address, 1_000_000, baseAssetId, { - gasLimit: 10000, - maxFee: MAX_FEE, - }) - .then((resp) => resp.wait()); - // Transfer alt asset coins to predicate - await fundingWallet - .transfer(createdPredicate.address, 1_000_000, ALT_ASSET_ID, { - gasLimit: 10000, - maxFee: MAX_FEE, - }) - .then((resp) => resp.wait()); - - // Create a recipient Wallet - const recipientWallet = Wallet.generate({ provider: fuelProvider }); - const recipientBalanceInitial = - await recipientWallet.getBalance(ALT_ASSET_ID); - - // Create transfer from predicate to recipient - const transactionRequest = await createTransaction( - createdPredicate, - recipientWallet.address.toString(), - ); - - const connector = new EVMWalletConnector({ - ethProvider, - fuelProvider, - predicateConfig: predicate, - }); - - // Check predicate balances - const predicateETHBalanceInitial = await createdPredicate.getBalance(); - const predicateAltBalanceInitial = - await createdPredicate.getBalance(ALT_ASSET_ID); - - // Check predicate has the balance required - expect(predicateETHBalanceInitial.gte(1000000)); - expect(predicateAltBalanceInitial.gte(1000000)); - - // Connect ETH account - await connector.connect(); - - // TODO: The user accounts mapping must be populated in order to check if the account is valid - // Temporary hack here? - await connector.accounts(); - - await connector.sendTransaction(accountAddress, transactionRequest); - - await new Promise((resolve) => setTimeout(resolve, 100)); - - // Check balances are correct - const predicateAltBalanceFinal = - await createdPredicate.getBalance(ALT_ASSET_ID); - const recipientBalanceFinal = - await recipientWallet.getBalance(ALT_ASSET_ID); - - expect(predicateAltBalanceFinal.toString()).eq( - predicateAltBalanceInitial.sub(bn.parseUnits('0.0001')).toString(), - ); - expect(recipientBalanceFinal.toString()).eq( - recipientBalanceInitial.add(bn.parseUnits('0.0001')).toString(), - ); - }); - - test('transfer when a different valid signer is passed in', async () => { - const accounts = ethProvider.getAccounts(); - const ethAccount1 = accounts[1] as string; - - const accountAddress = predicateFactory.getPredicateAddress(ethAccount1); - const fundingWallet = new WalletUnlocked('0x01', fuelProvider); - - const createdPredicate = predicateFactory.build( - ethAccount1, - fuelProvider, - [0], - ); - - // Transfer base asset coins to predicate - await fundingWallet - .transfer(createdPredicate.address, 1_000_000, baseAssetId, { - gasLimit: 10000, - maxFee: MAX_FEE, - }) - .then((resp) => resp.wait()); - // Transfer alt asset coins to predicate - await fundingWallet - .transfer(createdPredicate.address, 1_000_000, ALT_ASSET_ID, { - gasLimit: 10000, - maxFee: MAX_FEE, - }) - .then((resp) => resp.wait()); - - // Create a recipient Wallet - const recipientWallet = Wallet.generate({ provider: fuelProvider }); - const recipientBalanceInitial = - await recipientWallet.getBalance(ALT_ASSET_ID); - - // Create transfer from predicate to recipient - const transactionRequest = await createTransaction( - createdPredicate, - recipientWallet.address.toString(), - ); - - const connector = new EVMWalletConnector({ - ethProvider, - fuelProvider, - predicateConfig: predicate, - }); - - // Check predicate balances - const predicateETHBalanceInitial = await createdPredicate.getBalance(); - const predicateAltBalanceInitial = - await createdPredicate.getBalance(ALT_ASSET_ID); - - // Check predicate has the balance required - expect(predicateETHBalanceInitial.gte(1000000)); - expect(predicateAltBalanceInitial.gte(1000000)); - - // Connect ETH account - await connector.connect(); - - // TODO: The user accounts mapping must be populated in order to check if the account is valid - // Temporary hack here? - await connector.accounts(); - - await connector.sendTransaction(accountAddress, transactionRequest); - - await new Promise((resolve) => setTimeout(resolve, 100)); - - // Check balances are correct - const predicateAltBalanceFinal = - await createdPredicate.getBalance(ALT_ASSET_ID); - const recipientBalanceFinal = - await recipientWallet.getBalance(ALT_ASSET_ID); - - expect(predicateAltBalanceFinal.toString()).eq( - predicateAltBalanceInitial.sub(bn.parseUnits('0.0001')).toString(), - ); - expect(recipientBalanceFinal.toString()).eq( - recipientBalanceInitial.add(bn.parseUnits('0.0001')).toString(), - ); - }); - - test('errors when an invalid signer is passed in', async () => { - const connector = new EVMWalletConnector({ - ethProvider, - fuelProvider, - }); - - const accounts = ethProvider.getAccounts(); - const ethAccount1 = accounts[0] as string; - const ethAccount2 = accounts[1] as string; - - const predicateAccount2 = - predicateFactory.getPredicateAddress(ethAccount2); - - const createdPredicate = predicateFactory.build( - ethAccount1, - fuelProvider, - [0], - ); - - const fundingWallet = new WalletUnlocked('0x01', fuelProvider); - - // Transfer base asset coins to predicate - await fundingWallet - .transfer(createdPredicate.address, 1_000_000, baseAssetId, { - gasLimit: 10000, - maxFee: MAX_FEE, - }) - .then((resp) => resp.wait()); - // Transfer alt asset coins to predicate - await fundingWallet - .transfer(createdPredicate.address, 1_000_000, ALT_ASSET_ID, { - gasLimit: 10000, - maxFee: MAX_FEE, - }) - .then((resp) => resp.wait()); - - const transactionRequest = await createTransaction( - createdPredicate, - fundingWallet.address.toString(), - ); - - // Check predicate balances - const predicateETHBalanceInitial = await createdPredicate.getBalance(); - const predicateAltBalanceInitial = - await createdPredicate.getBalance(ALT_ASSET_ID); - - // Check predicate has the balance required - expect(predicateETHBalanceInitial.gte(1000000)); - expect(predicateAltBalanceInitial.gte(1000000)); - - // Connect ETH account - await connector.connect(); - - // TODO: The user accounts mapping must be populated in order to check if the account is valid - // Temporary hack here? - await connector.accounts(); - - await expect(() => - connector.sendTransaction( - predicateAccount2.replaceAll('h', 'X'), - transactionRequest, - ), - ).rejects.toThrowError(); - }); - }); - - describe('setupPredicate()', () => { - test('Should instantiate a predicate with given config', async () => { - const evmConnector = new EVMWalletConnector({ - ethProvider, - fuelProvider, - predicateConfig: predicate, - }); - - await evmConnector.connect(); - - // @ts-expect-error setupPredicate is protected - const predicateAccount = await evmConnector.setupPredicate(); - expect(predicateAccount).toBeDefined(); - // @ts-expect-error predicateAccount is protected - expect(evmConnector.predicateAccount).toBe(predicateAccount); - }); - - test('Should instantiate a predicate with balance', async () => { - const ALT_ASSET_ID = - '0x0101010101010101010101010101010101010101010101010101010101010101'; - const accounts = ethProvider.getAccounts(); - const ethAccount1 = accounts[0] as string; - - let connector = new EVMWalletConnector({ - ethProvider, - fuelProvider, - predicateConfig: predicate, - }); - - const createdPredicate = predicateFactory.build( - ethAccount1, - fuelProvider, - ); - - const fundingWallet = new WalletUnlocked('0x01', fuelProvider); - - // Transfer base asset coins to predicate - await fundingWallet - .transfer(createdPredicate.address, 1_000_000, baseAssetId, { - gasLimit: 10000, - maxFee: MAX_FEE, - }) - .then((resp) => resp.wait()); - // Transfer alt asset coins to predicate - await fundingWallet - .transfer(createdPredicate.address, 1_000_000, ALT_ASSET_ID, { - gasLimit: 10000, - maxFee: MAX_FEE, - }) - .then((resp) => resp.wait()); - - // Check predicate balances - const predicateETHBalanceInitial = await createdPredicate.getBalance(); - const predicateAltBalanceInitial = - await createdPredicate.getBalance(ALT_ASSET_ID); - - // Check predicate has the balance required - expect(predicateETHBalanceInitial.gte(1000000)); - expect(predicateAltBalanceInitial.gte(1000000)); - - connector = new EVMWalletConnector({ - ethProvider, - fuelProvider, - }); - - await connector.connect(); - }); - }); - - describe('assets()', () => { - test('returns an empty array', async () => { - const connector = new EVMWalletConnector({ - ethProvider, - fuelProvider, - }); - - expect(await connector.assets()).to.deep.equal([]); - }); - }); - - describe('addAsset()', () => { - test('throws error', async () => { - const asset: Asset = { - name: '', - symbol: '', - icon: '', - networks: [], - }; - - const connector = new EVMWalletConnector({ - ethProvider, - fuelProvider, - }); - - await expect(() => connector.addAsset(asset)).rejects.toThrowError( - 'Method not implemented.', - ); - }); - }); - - describe('addAssets()', () => { - test('throws error', async () => { - const connector = new EVMWalletConnector({ - ethProvider, - fuelProvider, - }); - - await expect(() => connector.addAssets([])).rejects.toThrowError( - 'Method not implemented.', - ); - }); - }); - - describe('addAbi()', () => { - test('throws error', async () => { - const connector = new EVMWalletConnector({ - ethProvider, - fuelProvider, - }); - - await expect(() => connector.addAbi({})).rejects.toThrowError( - 'Method not implemented.', - ); - }); - }); - - describe('getAbi()', () => { - test('throws error', async () => { - const connector = new EVMWalletConnector({ - ethProvider, - fuelProvider, - }); - - await expect(() => connector.getAbi('contractId')).rejects.toThrowError( - 'Cannot get contractId ABI for a predicate', - ); - }); - }); - - describe('hasAbi()', () => { - test('throws error', async () => { - const connector = new EVMWalletConnector({ - ethProvider, - fuelProvider, - }); - - await expect(() => connector.hasAbi('contractId')).rejects.toThrowError( - 'A predicate account cannot have an ABI', - ); - }); - }); - - describe('network()', () => { - test('returns the fuel network info', async () => { - const connector = new EVMWalletConnector({ - ethProvider, - fuelProvider, - }); - - const network = await connector.currentNetwork(); - - expect(network.chainId.toString()).to.be.equal( - fuelProvider.getChainId().toString(), - ); - expect(network.url).to.be.equal(fuelProvider.url); - }); - }); - - describe('networks()', () => { - test('returns an array of fuel network info', async () => { - const connector = new EVMWalletConnector({ - ethProvider, - fuelProvider, - }); - - const networks = await connector.networks(); - const network = networks.pop(); - - const networkChainId = network?.chainId.toString(); - const expectedChainId = fuelProvider.getChainId().toString(); - expect(networkChainId).to.be.equal(expectedChainId); - - expect(network?.url).to.be.equal(fuelProvider.url); - }); - }); - - describe('addNetwork()', () => { - test('throws error', async () => { - const connector = new EVMWalletConnector({ - ethProvider, - fuelProvider, - }); - - await expect(() => connector.addNetwork('')).rejects.toThrowError( - 'Method not implemented.', - ); - }); - }); -}); diff --git a/packages/evm-connector/src/test/mockProvider.ts b/packages/evm-connector/src/test/mockProvider.ts deleted file mode 100644 index e9100928f..000000000 --- a/packages/evm-connector/src/test/mockProvider.ts +++ /dev/null @@ -1,174 +0,0 @@ -import EventEmitter from 'node:events'; -import { - bytesToHex, - ecsign, - hashPersonalMessage, - hexToBytes, - privateToAddress, - toRpcSig, -} from '@ethereumjs/util'; -import { randomBytes } from 'fuels'; - -interface IMockProvider { - request(args: { - method: 'eth_accounts'; - params: string[]; - }): Promise; - request(args: { - method: 'eth_requestAccounts'; - params: string[]; - }): Promise; - request(args: { - method: 'wallet_requestPermissions'; - params: string[]; - }): Promise; - - request(args: { - method: 'wallet_revokePermissions'; - params: string[]; - }): Promise; - - request(args: { method: 'net_version' }): Promise; - request(args: { method: 'eth_chainId'; params: string[] }): Promise; - - request(args: { method: 'personal_sign'; params: string[] }): Promise; - request(args: { method: 'eth_decrypt'; params: string[] }): Promise; - - // biome-ignore lint/suspicious/noExplicitAny: This request pattern will match against unknown request types and error. - request(args: { method: string; params?: any[] }): Promise; -} - -export class MockProvider extends EventEmitter implements IMockProvider { - private accounts: { address: string; privateKey: Uint8Array }[] = []; - private connected = false; - - public debug = false; - - public isMetaMask = true; - public manualConfirmEnable = false; - - private acceptEnable?: (value: unknown) => void; - - private rejectEnable?: (value: unknown) => void; - - constructor(numAccounts = 3) { - super(); - for (let i = 0; i < numAccounts; i += 1) { - const privateKey = randomBytes(32); - const address = bytesToHex(privateToAddress(privateKey)); - this.accounts.push({ address, privateKey: privateKey }); - } - } - - get selectedAddress(): string { - if (this.accounts && this.accounts.length > 0) { - const selectedAddress = this.accounts[0]?.address; - if (selectedAddress) { - return selectedAddress; - } - } - throw new Error('Address not defined'); - } - - get networkVersion(): number { - return 1; - } - - get chainId(): string { - return `0x${(1).toString(16)}`; - } - - answerEnable(acceptance: boolean) { - if (acceptance) this.acceptEnable?.('Accepted'); - else this.rejectEnable?.('User rejected'); - } - - getAccounts(): string[] { - return this.accounts.map(({ address }) => address); - } - - // biome-ignore lint/suspicious/noExplicitAny: This pattern matches the EIP 1193 interface. - async request({ method, params }: any): Promise { - switch (method) { - case 'eth_requestAccounts': - if (this.manualConfirmEnable) { - return new Promise((resolve, reject) => { - this.acceptEnable = resolve; - this.rejectEnable = reject; - }).then(() => this.accounts.map(({ address }) => address)); - } - this.connected = true; - return this.accounts.map(({ address }) => address); - - case 'wallet_requestPermissions': - if (this.manualConfirmEnable) { - return new Promise((resolve, reject) => { - this.acceptEnable = resolve; - this.rejectEnable = reject; - }).then(() => this.accounts.map(({ address }) => address)); - } - this.connected = true; - return this.accounts.map(({ address }) => address); - - case 'eth_accounts': - return this.connected ? this.getAccounts() : []; - - case 'wallet_revokePermissions': - return null; - - case 'net_version': - return this.networkVersion; - - case 'eth_chainId': - return this.chainId; - - case 'personal_sign': { - const [message, address] = params; - const account = this.accounts.find((a) => a.address === address); - if (!account) throw new Error('Account not found'); - - const hash = hashPersonalMessage(hexToBytes(message)); - const signed = ecsign(hash, account.privateKey); - const signedStr = toRpcSig(signed.v, signed.r, signed.s); - - return signedStr; - } - - case 'eth_sendTransaction': { - throw new Error('This service can not send transactions.'); - } - - default: - throw new Error( - `The method ${method} is not implemented by the mock provider.`, - ); - } - } - - // biome-ignore lint/suspicious/noExplicitAny: This pattern matches the EIP 1193 interface. - sendAsync(props: { method: string }, cb: any) { - switch (props.method) { - case 'eth_accounts': - cb(null, { result: [this.getAccounts()] }); - break; - - case 'net_version': - cb(null, { result: this.networkVersion }); - break; - - default: - throw new Error(`Method '${props.method}' is not supported yet.`); - } - } - - // biome-ignore lint/suspicious/noExplicitAny: This pattern matches the NodeJS.EventEmitter interface. - on(props: string, listener: (...args: any[]) => void) { - super.on(props, listener); - return this; - } - - removeAllListeners() { - super.removeAllListeners(); - return this; - } -} diff --git a/packages/evm-connector/src/test/mockedPredicate/0xfdac03fc617c264fa6f325fd6f4d2a5470bf44cfbd33bc11efb3bf8b7ee2e938/index.ts b/packages/evm-connector/src/test/mockedPredicate/0xfdac03fc617c264fa6f325fd6f4d2a5470bf44cfbd33bc11efb3bf8b7ee2e938/index.ts deleted file mode 100644 index 7cda5c2de..000000000 --- a/packages/evm-connector/src/test/mockedPredicate/0xfdac03fc617c264fa6f325fd6f4d2a5470bf44cfbd33bc11efb3bf8b7ee2e938/index.ts +++ /dev/null @@ -1,224 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ - -import type { BytesLike, JsonAbi } from 'fuels'; - -export const generationDate = 1725479113004; -// biome-ignore lint: Autogenerated file -export const abi: JsonAbi = { - programType: 'predicate', - specVersion: '1', - encodingVersion: '1', - concreteTypes: [ - { - type: 'b256', - concreteTypeId: - '7c5ee1cecf5f8eacd1284feb5f0bf2bdea533a51e2f0c9aabe9236d335989f3b', - }, - { - type: 'bool', - concreteTypeId: - 'b760f44fa5965c2474a3b471467a22c43185152129295af588b022ae50b50903', - }, - { - type: 'u64', - concreteTypeId: - '1506e6f44c1d6291cdf46395a8e573276a4fa79e8ace3fc891e092ef32d1b0a0', - }, - ], - metadataTypes: [], - functions: [ - { - inputs: [ - { - name: 'witness_index', - concreteTypeId: - '1506e6f44c1d6291cdf46395a8e573276a4fa79e8ace3fc891e092ef32d1b0a0', - }, - ], - name: 'main', - output: - 'b760f44fa5965c2474a3b471467a22c43185152129295af588b022ae50b50903', - attributes: null, - }, - ], - loggedTypes: [], - messagesTypes: [], - configurables: [ - { - name: 'SIGNER', - concreteTypeId: - '7c5ee1cecf5f8eacd1284feb5f0bf2bdea533a51e2f0c9aabe9236d335989f3b', - offset: 3136, - }, - ], -}; -export const bin: BytesLike = new Uint8Array([ - 26, 240, 48, 0, 116, 0, 0, 2, 0, 0, 0, 0, 0, 0, 12, 64, 93, 255, 192, 1, 16, - 255, 255, 0, 145, 0, 0, 32, 80, 235, 240, 0, 80, 228, 0, 32, 80, 224, 64, 0, - 32, 248, 51, 0, 88, 251, 224, 2, 80, 251, 224, 4, 116, 0, 0, 20, 26, 236, 80, - 0, 113, 64, 0, 3, 97, 69, 2, 0, 19, 73, 16, 0, 118, 72, 0, 6, 114, 72, 0, 2, - 19, 69, 20, 128, 118, 68, 0, 1, 54, 0, 0, 0, 97, 65, 2, 74, 116, 0, 0, 1, 97, - 65, 2, 12, 93, 65, 0, 0, 26, 233, 0, 0, 32, 248, 51, 0, 88, 251, 224, 2, 80, - 251, 224, 4, 116, 0, 0, 26, 26, 67, 208, 0, 36, 64, 0, 0, 149, 0, 0, 15, 150, - 8, 0, 0, 26, 236, 80, 0, 145, 0, 0, 96, 26, 67, 160, 0, 26, 75, 128, 0, 26, - 79, 224, 0, 114, 68, 0, 32, 40, 237, 4, 64, 80, 67, 176, 64, 114, 68, 0, 32, - 40, 67, 180, 64, 80, 71, 176, 32, 114, 64, 0, 32, 40, 71, 180, 0, 80, 67, 176, - 32, 114, 68, 0, 32, 40, 73, 4, 64, 26, 244, 0, 0, 146, 0, 0, 96, 26, 249, 48, - 0, 152, 8, 0, 0, 151, 0, 0, 15, 74, 248, 0, 0, 149, 0, 1, 255, 150, 8, 0, 0, - 26, 236, 80, 0, 145, 0, 10, 56, 26, 67, 160, 0, 26, 87, 224, 0, 97, 68, 0, 1, - 19, 73, 16, 0, 118, 72, 0, 5, 19, 69, 16, 64, 118, 68, 0, 1, 54, 0, 0, 0, 26, - 68, 16, 0, 116, 0, 0, 1, 26, 68, 0, 0, 19, 73, 16, 0, 118, 72, 0, 6, 19, 69, - 16, 64, 118, 68, 0, 2, 93, 67, 240, 12, 54, 64, 0, 0, 97, 68, 1, 5, 116, 0, 0, - 1, 97, 68, 0, 7, 21, 73, 4, 64, 118, 72, 0, 1, 19, 73, 4, 64, 118, 72, 0, 20, - 80, 71, 178, 248, 95, 236, 16, 95, 97, 65, 4, 1, 80, 75, 181, 80, 26, 233, 0, - 0, 26, 229, 32, 0, 32, 248, 51, 0, 88, 251, 224, 2, 80, 251, 224, 4, 116, 0, - 1, 8, 26, 67, 208, 0, 114, 72, 0, 64, 40, 237, 4, 128, 80, 65, 16, 8, 114, 72, - 0, 64, 40, 67, 180, 128, 80, 75, 182, 240, 114, 64, 0, 72, 40, 73, 20, 0, 116, - 0, 0, 5, 80, 67, 177, 0, 95, 236, 0, 32, 80, 75, 182, 240, 114, 68, 0, 72, 40, - 73, 4, 64, 80, 67, 181, 8, 114, 68, 0, 72, 40, 65, 36, 64, 93, 67, 176, 222, - 19, 65, 0, 64, 118, 64, 0, 1, 54, 0, 0, 0, 93, 67, 240, 13, 16, 65, 0, 192, - 93, 71, 240, 14, 16, 69, 16, 192, 93, 95, 240, 15, 16, 93, 112, 192, 80, 75, - 181, 8, 80, 73, 32, 8, 80, 79, 184, 104, 114, 80, 0, 64, 40, 77, 37, 0, 80, - 79, 185, 248, 114, 80, 0, 64, 40, 77, 37, 0, 80, 91, 185, 248, 26, 72, 0, 0, - 80, 79, 176, 64, 114, 80, 0, 32, 40, 77, 37, 0, 80, 75, 177, 208, 114, 80, 0, - 32, 40, 73, 53, 0, 80, 77, 32, 32, 114, 80, 0, 32, 40, 77, 5, 0, 80, 65, 32, - 64, 114, 76, 0, 32, 40, 65, 20, 192, 80, 67, 184, 8, 114, 68, 0, 96, 40, 65, - 36, 64, 80, 99, 184, 8, 80, 67, 183, 232, 114, 68, 0, 32, 40, 65, 116, 64, 80, - 67, 183, 232, 114, 68, 0, 60, 16, 69, 132, 64, 80, 75, 184, 8, 80, 73, 32, 32, - 114, 76, 0, 32, 114, 80, 0, 60, 40, 69, 132, 192, 65, 65, 37, 0, 80, 67, 183, - 232, 80, 71, 177, 144, 114, 72, 0, 32, 27, 72, 4, 128, 16, 73, 20, 128, 114, - 76, 0, 32, 40, 73, 116, 192, 114, 72, 0, 32, 27, 72, 20, 128, 16, 73, 20, 128, - 114, 76, 0, 32, 40, 73, 116, 192, 80, 75, 178, 120, 114, 76, 0, 64, 40, 73, - 20, 192, 80, 71, 185, 144, 114, 76, 0, 64, 40, 69, 36, 192, 80, 71, 185, 144, - 80, 75, 180, 48, 114, 76, 0, 32, 40, 73, 4, 192, 62, 69, 100, 128, 26, 64, - 128, 0, 19, 65, 0, 64, 118, 64, 0, 10, 80, 67, 179, 128, 95, 236, 0, 112, 80, - 71, 185, 144, 80, 73, 0, 8, 114, 76, 0, 64, 40, 73, 20, 192, 80, 75, 183, 56, - 114, 68, 0, 72, 40, 73, 4, 64, 116, 0, 0, 6, 80, 67, 177, 72, 95, 236, 16, 41, - 95, 236, 0, 49, 80, 75, 183, 56, 114, 68, 0, 72, 40, 73, 4, 64, 80, 67, 185, - 40, 114, 68, 0, 72, 40, 65, 36, 64, 80, 67, 180, 80, 114, 68, 0, 72, 40, 65, - 36, 64, 93, 67, 176, 231, 19, 65, 0, 64, 118, 64, 0, 96, 80, 67, 185, 40, 80, - 71, 180, 152, 114, 72, 0, 72, 40, 69, 4, 128, 93, 67, 177, 37, 19, 65, 0, 0, - 118, 64, 0, 1, 54, 0, 0, 0, 80, 67, 180, 152, 80, 65, 0, 8, 80, 71, 184, 168, - 114, 72, 0, 64, 40, 69, 4, 128, 80, 71, 182, 112, 114, 72, 0, 64, 40, 69, 4, - 128, 80, 75, 181, 176, 26, 233, 16, 0, 26, 229, 32, 0, 32, 248, 51, 0, 88, - 251, 224, 2, 80, 251, 224, 4, 116, 0, 2, 22, 26, 71, 208, 0, 80, 75, 176, 96, - 114, 76, 0, 64, 40, 73, 20, 192, 80, 71, 178, 184, 114, 76, 0, 64, 40, 69, 36, - 192, 80, 71, 182, 176, 114, 72, 0, 64, 40, 69, 4, 128, 80, 67, 181, 240, 26, - 233, 16, 0, 26, 229, 0, 0, 32, 248, 51, 0, 88, 251, 224, 2, 80, 251, 224, 4, - 116, 0, 2, 5, 26, 67, 208, 0, 80, 71, 176, 160, 114, 72, 0, 64, 40, 69, 4, - 128, 80, 67, 179, 64, 114, 72, 0, 64, 40, 65, 20, 128, 80, 67, 179, 200, 80, - 71, 176, 96, 114, 72, 0, 32, 27, 72, 4, 128, 16, 73, 20, 128, 114, 68, 0, 32, - 40, 65, 36, 64, 80, 69, 0, 32, 80, 75, 176, 160, 114, 76, 0, 32, 27, 76, 20, - 192, 16, 77, 36, 192, 114, 72, 0, 32, 40, 69, 52, 128, 80, 71, 182, 48, 114, - 72, 0, 64, 40, 69, 4, 128, 80, 67, 181, 144, 26, 233, 16, 0, 26, 229, 0, 0, - 32, 248, 51, 0, 88, 251, 224, 2, 80, 251, 224, 4, 116, 0, 0, 93, 26, 67, 208, - 0, 80, 71, 176, 224, 114, 72, 0, 32, 40, 69, 4, 128, 80, 67, 185, 112, 114, - 72, 0, 32, 40, 65, 20, 128, 80, 67, 180, 8, 95, 236, 0, 129, 80, 75, 185, 8, - 114, 76, 0, 32, 40, 73, 20, 192, 80, 71, 185, 8, 112, 68, 0, 12, 80, 71, 185, - 8, 80, 75, 178, 48, 114, 76, 0, 32, 40, 73, 20, 192, 80, 69, 0, 8, 114, 76, 0, - 32, 40, 69, 36, 192, 80, 75, 183, 128, 114, 68, 0, 40, 40, 73, 4, 64, 116, 0, - 0, 10, 80, 67, 180, 80, 80, 65, 0, 64, 80, 71, 178, 80, 95, 236, 16, 74, 80, - 73, 16, 32, 114, 76, 0, 8, 40, 73, 4, 192, 80, 75, 183, 128, 114, 64, 0, 40, - 40, 73, 20, 0, 80, 67, 185, 208, 114, 68, 0, 40, 40, 65, 36, 64, 93, 67, 176, - 240, 19, 65, 0, 0, 26, 68, 16, 0, 118, 64, 0, 1, 26, 68, 0, 0, 118, 68, 0, 1, - 116, 0, 0, 23, 80, 64, 64, 0, 80, 71, 185, 208, 80, 75, 180, 224, 114, 76, 0, - 40, 40, 73, 20, 192, 93, 71, 177, 58, 19, 69, 16, 0, 118, 68, 0, 1, 54, 0, 0, - 0, 80, 71, 180, 224, 80, 69, 16, 8, 80, 75, 184, 232, 114, 76, 0, 32, 40, 73, - 20, 192, 80, 71, 184, 232, 80, 75, 183, 168, 114, 76, 0, 32, 40, 73, 4, 192, - 80, 67, 183, 200, 114, 76, 0, 32, 40, 65, 20, 192, 161, 65, 36, 32, 118, 64, - 0, 2, 26, 244, 0, 0, 116, 0, 0, 1, 26, 244, 16, 0, 146, 0, 10, 56, 26, 249, - 80, 0, 152, 8, 0, 0, 151, 0, 1, 255, 74, 248, 0, 0, 149, 0, 0, 15, 150, 8, 0, - 0, 26, 236, 80, 0, 145, 0, 0, 64, 26, 67, 160, 0, 26, 71, 144, 0, 26, 75, 224, - 0, 114, 76, 0, 64, 40, 237, 4, 192, 114, 64, 0, 64, 40, 71, 180, 0, 26, 245, - 16, 0, 146, 0, 0, 64, 26, 249, 32, 0, 152, 8, 0, 0, 151, 0, 0, 15, 74, 248, 0, - 0, 149, 0, 0, 127, 150, 8, 0, 0, 26, 236, 80, 0, 145, 0, 0, 200, 26, 67, 160, - 0, 26, 71, 144, 0, 26, 75, 224, 0, 93, 79, 240, 16, 16, 77, 48, 192, 26, 80, - 0, 0, 38, 80, 0, 0, 26, 80, 112, 0, 95, 237, 64, 18, 95, 236, 0, 19, 95, 236, - 0, 20, 80, 83, 176, 144, 80, 87, 176, 32, 114, 88, 0, 64, 40, 85, 5, 128, 26, - 233, 80, 0, 26, 229, 64, 0, 32, 248, 51, 0, 88, 251, 224, 2, 80, 251, 224, 4, - 116, 0, 0, 34, 80, 67, 176, 144, 80, 83, 176, 168, 114, 84, 0, 32, 40, 81, 53, - 64, 80, 79, 176, 168, 80, 83, 176, 120, 114, 84, 0, 24, 40, 81, 5, 64, 26, - 233, 64, 0, 32, 248, 51, 0, 88, 251, 224, 2, 80, 251, 224, 4, 116, 0, 1, 79, - 26, 83, 208, 0, 80, 87, 176, 96, 114, 88, 0, 24, 40, 85, 5, 128, 26, 233, 80, - 0, 32, 248, 51, 0, 88, 251, 224, 2, 80, 251, 224, 4, 116, 0, 0, 222, 26, 67, - 208, 0, 65, 77, 68, 0, 114, 64, 0, 32, 40, 237, 52, 0, 114, 64, 0, 32, 40, 71, - 180, 0, 26, 245, 16, 0, 146, 0, 0, 200, 26, 249, 32, 0, 152, 8, 0, 0, 151, 0, - 0, 127, 74, 248, 0, 0, 149, 0, 0, 31, 150, 8, 0, 0, 26, 236, 80, 0, 145, 0, 0, - 64, 26, 67, 160, 0, 26, 71, 144, 0, 26, 75, 224, 0, 114, 76, 0, 32, 40, 237, - 4, 192, 26, 235, 176, 0, 26, 229, 16, 0, 32, 248, 51, 0, 88, 251, 224, 2, 80, - 251, 224, 4, 116, 0, 0, 16, 80, 65, 0, 32, 80, 79, 176, 32, 114, 80, 0, 32, - 40, 77, 5, 0, 26, 233, 48, 0, 26, 229, 16, 0, 32, 248, 51, 0, 88, 251, 224, 2, - 80, 251, 224, 4, 116, 0, 0, 6, 26, 244, 0, 0, 146, 0, 0, 64, 26, 249, 32, 0, - 152, 8, 0, 0, 151, 0, 0, 31, 74, 248, 0, 0, 149, 0, 3, 255, 150, 8, 0, 0, 26, - 236, 80, 0, 145, 0, 1, 88, 26, 67, 160, 0, 26, 91, 144, 0, 26, 87, 224, 0, - 114, 68, 0, 32, 38, 68, 0, 0, 26, 68, 112, 0, 80, 75, 176, 72, 114, 76, 0, 32, - 40, 73, 4, 192, 93, 65, 32, 0, 93, 77, 32, 1, 93, 81, 32, 2, 93, 73, 32, 3, - 95, 69, 0, 0, 95, 69, 48, 1, 95, 69, 64, 2, 95, 69, 32, 3, 80, 67, 176, 104, - 26, 233, 16, 0, 114, 68, 0, 32, 26, 229, 16, 0, 26, 225, 0, 0, 32, 248, 51, 0, - 88, 251, 224, 2, 80, 251, 224, 4, 116, 0, 0, 171, 26, 67, 208, 0, 80, 71, 176, - 16, 114, 72, 0, 16, 40, 69, 4, 128, 114, 72, 0, 16, 40, 237, 4, 128, 80, 67, - 177, 0, 114, 72, 0, 16, 40, 67, 180, 128, 80, 75, 176, 136, 26, 233, 0, 0, 26, - 229, 32, 0, 32, 248, 51, 0, 88, 251, 224, 2, 80, 251, 224, 4, 116, 0, 0, 187, - 26, 67, 208, 0, 93, 73, 0, 0, 93, 65, 0, 1, 80, 79, 177, 32, 114, 80, 0, 16, - 40, 77, 21, 0, 26, 233, 48, 0, 32, 248, 51, 0, 88, 251, 224, 2, 80, 251, 224, - 4, 116, 0, 0, 210, 26, 71, 208, 0, 80, 95, 176, 48, 95, 237, 32, 6, 95, 237, - 0, 7, 95, 237, 16, 8, 80, 67, 176, 168, 114, 68, 0, 24, 40, 65, 116, 64, 26, - 233, 0, 0, 32, 248, 51, 0, 88, 251, 224, 2, 80, 251, 224, 4, 116, 0, 0, 109, - 26, 99, 208, 0, 19, 65, 128, 0, 118, 64, 0, 100, 93, 65, 96, 2, 19, 65, 0, 0, - 118, 64, 0, 95, 93, 65, 96, 2, 16, 101, 6, 0, 93, 65, 96, 2, 80, 71, 176, 192, - 114, 72, 0, 16, 40, 69, 100, 128, 26, 233, 16, 0, 32, 248, 51, 0, 88, 251, - 224, 2, 80, 251, 224, 4, 116, 0, 0, 103, 26, 71, 208, 0, 22, 69, 22, 64, 118, - 68, 0, 1, 116, 0, 0, 58, 80, 71, 176, 224, 114, 72, 0, 16, 40, 69, 100, 128, - 26, 233, 16, 0, 32, 248, 51, 0, 88, 251, 224, 2, 80, 251, 224, 4, 116, 0, 0, - 123, 26, 71, 208, 0, 80, 75, 176, 208, 114, 76, 0, 16, 40, 73, 100, 192, 26, - 233, 32, 0, 32, 248, 51, 0, 88, 251, 224, 2, 80, 251, 224, 4, 116, 0, 0, 82, - 26, 75, 208, 0, 21, 77, 148, 128, 26, 81, 16, 0, 118, 76, 0, 1, 116, 0, 0, 6, - 38, 100, 0, 0, 26, 80, 112, 0, 21, 77, 32, 0, 118, 76, 0, 1, 116, 0, 0, 1, 40, - 81, 20, 128, 80, 71, 176, 120, 26, 233, 64, 0, 26, 229, 144, 0, 26, 225, 16, - 0, 32, 248, 51, 0, 88, 251, 224, 2, 80, 251, 224, 4, 116, 0, 0, 74, 26, 71, - 208, 0, 80, 75, 176, 32, 114, 76, 0, 16, 40, 73, 20, 192, 80, 71, 177, 72, - 114, 76, 0, 16, 40, 69, 36, 192, 80, 71, 177, 16, 114, 76, 0, 16, 40, 69, 36, - 192, 80, 75, 176, 152, 26, 233, 16, 0, 26, 229, 32, 0, 32, 248, 51, 0, 88, - 251, 224, 2, 80, 251, 224, 4, 116, 0, 0, 89, 26, 71, 208, 0, 93, 73, 16, 0, - 93, 69, 16, 1, 95, 89, 32, 0, 95, 89, 16, 1, 80, 71, 176, 240, 114, 72, 0, 16, - 40, 69, 100, 128, 26, 233, 16, 0, 32, 248, 51, 0, 88, 251, 224, 2, 80, 251, - 224, 4, 116, 0, 0, 65, 26, 71, 208, 0, 16, 65, 20, 0, 80, 71, 177, 48, 114, - 72, 0, 24, 40, 69, 116, 128, 26, 233, 16, 0, 32, 248, 51, 0, 88, 251, 224, 2, - 80, 251, 224, 4, 116, 0, 0, 116, 26, 71, 208, 0, 40, 65, 22, 0, 95, 89, 144, - 2, 116, 0, 0, 2, 114, 64, 0, 24, 40, 89, 116, 0, 26, 244, 0, 0, 146, 0, 1, 88, - 26, 249, 80, 0, 152, 8, 0, 0, 151, 0, 3, 255, 74, 248, 0, 0, 149, 0, 0, 3, - 150, 8, 0, 0, 26, 236, 80, 0, 26, 67, 160, 0, 26, 71, 224, 0, 93, 65, 0, 2, - 26, 245, 0, 0, 26, 249, 16, 0, 152, 8, 0, 0, 151, 0, 0, 3, 74, 248, 0, 0, 149, - 0, 0, 3, 150, 8, 0, 0, 26, 236, 80, 0, 26, 67, 160, 0, 26, 71, 224, 0, 93, 65, - 0, 1, 26, 245, 0, 0, 26, 249, 16, 0, 152, 8, 0, 0, 151, 0, 0, 3, 74, 248, 0, - 0, 149, 0, 0, 31, 150, 8, 0, 0, 26, 236, 80, 0, 145, 0, 0, 32, 26, 67, 160, 0, - 26, 71, 144, 0, 26, 75, 128, 0, 26, 79, 224, 0, 80, 83, 176, 16, 95, 237, 0, - 2, 95, 237, 16, 3, 114, 64, 0, 16, 40, 237, 68, 0, 114, 64, 0, 16, 40, 75, - 180, 0, 26, 245, 32, 0, 146, 0, 0, 32, 26, 249, 48, 0, 152, 8, 0, 0, 151, 0, - 0, 31, 74, 248, 0, 0, 149, 0, 0, 3, 150, 8, 0, 0, 26, 236, 80, 0, 26, 67, 160, - 0, 26, 71, 224, 0, 93, 65, 0, 0, 26, 245, 0, 0, 26, 249, 16, 0, 152, 8, 0, 0, - 151, 0, 0, 3, 74, 248, 0, 0, 149, 0, 0, 63, 150, 8, 0, 0, 26, 236, 80, 0, 145, - 0, 0, 32, 26, 67, 160, 0, 26, 71, 144, 0, 26, 75, 224, 0, 80, 79, 176, 16, - 114, 80, 0, 16, 40, 77, 5, 0, 26, 233, 48, 0, 32, 248, 51, 0, 88, 251, 224, 2, - 80, 251, 224, 4, 116, 0, 0, 19, 26, 79, 208, 0, 38, 76, 0, 0, 26, 80, 112, 0, - 21, 85, 48, 0, 118, 84, 0, 1, 116, 0, 0, 5, 114, 84, 0, 16, 40, 237, 5, 64, - 26, 67, 176, 0, 93, 65, 0, 0, 40, 81, 4, 192, 95, 69, 64, 0, 95, 69, 48, 1, - 26, 245, 16, 0, 146, 0, 0, 32, 26, 249, 32, 0, 152, 8, 0, 0, 151, 0, 0, 63, - 74, 248, 0, 0, 149, 0, 0, 7, 150, 8, 0, 0, 26, 236, 80, 0, 145, 0, 0, 16, 26, - 67, 160, 0, 26, 71, 224, 0, 114, 72, 0, 16, 40, 237, 4, 128, 26, 67, 176, 0, - 93, 65, 0, 1, 26, 245, 0, 0, 146, 0, 0, 16, 26, 249, 16, 0, 152, 8, 0, 0, 151, - 0, 0, 7, 74, 248, 0, 0, 149, 0, 0, 7, 150, 8, 0, 0, 26, 236, 80, 0, 145, 0, 0, - 16, 26, 67, 160, 0, 26, 71, 224, 0, 114, 72, 0, 16, 40, 237, 4, 128, 26, 235, - 176, 0, 32, 248, 51, 0, 88, 251, 224, 2, 80, 251, 224, 4, 117, 0, 0, 72, 26, - 67, 208, 0, 26, 245, 0, 0, 146, 0, 0, 16, 26, 249, 16, 0, 152, 8, 0, 0, 151, - 0, 0, 7, 74, 248, 0, 0, 149, 0, 0, 15, 150, 8, 0, 0, 26, 236, 80, 0, 26, 67, - 160, 0, 26, 71, 144, 0, 26, 75, 224, 0, 114, 76, 0, 64, 40, 69, 4, 192, 26, - 245, 16, 0, 26, 249, 32, 0, 152, 8, 0, 0, 151, 0, 0, 15, 74, 248, 0, 0, 71, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 25, 69, 116, 104, 101, 114, 101, 117, 109, 32, 83, - 105, 103, 110, 101, 100, 32, 77, 101, 115, 115, 97, 103, 101, 58, 10, 51, 50, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 204, 204, 204, 204, 204, 204, 0, 2, 0, 0, 0, 0, - 0, 0, 10, 132, 0, 0, 0, 0, 0, 0, 10, 156, 0, 0, 0, 0, 0, 0, 10, 148, 0, 0, 0, - 0, 0, 0, 6, 124, -]); diff --git a/packages/evm-connector/src/test/mockedPredicate/index.ts b/packages/evm-connector/src/test/mockedPredicate/index.ts deleted file mode 100644 index f068766ce..000000000 --- a/packages/evm-connector/src/test/mockedPredicate/index.ts +++ /dev/null @@ -1,14 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ - -import { - abi as abi1725479113004, - bin as bin1725479113004, - generationDate as generationDate1725479113004, -} from './0xfdac03fc617c264fa6f325fd6f4d2a5470bf44cfbd33bc11efb3bf8b7ee2e938'; - -export const PREDICATE_VERSIONS = { - '0xfdac03fc617c264fa6f325fd6f4d2a5470bf44cfbd33bc11efb3bf8b7ee2e938': { - predicate: { abi: abi1725479113004, bin: bin1725479113004 }, - generatedAt: generationDate1725479113004, - }, -}; diff --git a/packages/evm-connector/src/types.ts b/packages/evm-connector/src/types.ts deleted file mode 100644 index 5058f8b9d..000000000 --- a/packages/evm-connector/src/types.ts +++ /dev/null @@ -1,31 +0,0 @@ -import type EventEmitter from 'node:events'; -import type { PredicateConfig } from '@fuel-connectors/common'; -import type { Provider } from 'fuels'; - -export type EVMWalletConnectorConfig = { - fuelProvider?: Provider | Promise; - ethProvider?: EIP1193Provider; - predicateConfig?: PredicateConfig; - chainId?: number; -}; - -export enum EVMWalletConnectorEvents { - //accounts - ACCOUNTS_CHANGED = 'accountsChanged', - - //connections - CONNECT = 'connect', - DISCONNECT = 'disconnect', -} - -export interface EIP1193Provider extends EventEmitter { - request(args: { - method: string; - params?: unknown[]; - }): Promise; -} - -export interface SignatureData { - message: string; - signature: string; -} diff --git a/packages/evm-connector/tsconfig.json b/packages/evm-connector/tsconfig.json deleted file mode 100644 index 2cde06265..000000000 --- a/packages/evm-connector/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compilerOptions": { - "target": "ES2022", - "lib": ["DOM", "ES2022"], - "module": "es2022", - "moduleResolution": "Node", - "strict": true, - "noUncheckedIndexedAccess": true, - "declaration": true, - "resolveJsonModule": true, - "skipLibCheck": true, - "outDir": "./dist", - "paths": { - "@fuel-connectors/*": ["../*/src"] - } - }, - "exclude": ["./dist/**/*"] -} diff --git a/packages/evm-connector/tsup.config.js b/packages/evm-connector/tsup.config.js deleted file mode 100644 index c93e0c328..000000000 --- a/packages/evm-connector/tsup.config.js +++ /dev/null @@ -1,8 +0,0 @@ -import baseConfig from '@fuels/tsup-config'; -import { defineConfig } from 'tsup'; - -export default defineConfig((options) => ({ - ...baseConfig(options, { withReact: false }), - external: ['fuels'], - entry: ['src/index.ts'], -})); diff --git a/packages/evm-connector/vite.config.ts b/packages/evm-connector/vite.config.ts deleted file mode 100644 index 4493096fd..000000000 --- a/packages/evm-connector/vite.config.ts +++ /dev/null @@ -1,22 +0,0 @@ -// vite.config.js -import { resolve } from 'node:path'; -import { defineConfig } from 'vite'; -import dts from 'vite-plugin-dts'; - -import path from 'node:path'; -import { fileURLToPath } from 'node:url'; - -export default defineConfig({ - plugins: [ - dts({ - include: [resolve(__dirname, 'src/')], - }), - ], - define: { - __dirname: JSON.stringify(path.dirname(__filename)), - __filename: JSON.stringify(fileURLToPath(import.meta.url)), - }, - test: { - environment: 'jsdom', - }, -}); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f6cc761e5..68e022a48 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -86,7 +86,7 @@ importers: version: 2.1.1 connectkit: specifier: 1.8.2 - version: 1.8.2(@babel/core@7.25.7)(@tanstack/react-query@5.35.1(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react-is@18.3.1)(react@18.3.1)(viem@2.20.1(bufferutil@4.0.8)(typescript@5.4.5)(utf-8-validate@5.0.10)(zod@3.22.4))(wagmi@2.12.7(@tanstack/query-core@5.35.1)(@tanstack/react-query@5.35.1(react@18.3.1))(@types/react@18.3.1)(bufferutil@4.0.8)(react-dom@18.3.1(react@18.3.1))(react-native@0.75.0(@babel/core@7.25.7)(@babel/preset-env@7.25.3(@babel/core@7.25.7))(@types/react@18.3.1)(bufferutil@4.0.8)(react@18.3.1)(typescript@5.4.5)(utf-8-validate@5.0.10))(react@18.3.1)(rollup@4.28.0)(typescript@5.4.5)(utf-8-validate@5.0.10)(viem@2.20.1(bufferutil@4.0.8)(typescript@5.4.5)(utf-8-validate@5.0.10)(zod@3.22.4))(zod@3.22.4)) + version: 1.8.2(@babel/core@7.25.7)(@tanstack/react-query@5.35.1(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react-is@18.3.1)(react@18.3.1)(viem@2.20.1(bufferutil@4.0.8)(typescript@5.4.5)(utf-8-validate@5.0.10)(zod@3.22.4))(wagmi@2.12.7(@tanstack/query-core@5.35.1)(@tanstack/react-query@5.35.1(react@18.3.1))(@types/react@18.3.1)(bufferutil@4.0.8)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.4.5)(utf-8-validate@5.0.10)(viem@2.20.1(bufferutil@4.0.8)(typescript@5.4.5)(utf-8-validate@5.0.10)(zod@3.22.4))(zod@3.22.4)) fuels: specifier: 0.96.1 version: 0.96.1 @@ -229,7 +229,7 @@ importers: version: 5.35.1(react@18.3.1) connectkit: specifier: 1.8.2 - version: 1.8.2(@babel/core@7.25.7)(@tanstack/react-query@5.35.1(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react-is@18.3.1)(react@18.3.1)(viem@2.20.1(bufferutil@4.0.8)(typescript@5.4.5)(utf-8-validate@5.0.10)(zod@3.22.4))(wagmi@2.12.7(@tanstack/query-core@5.35.1)(@tanstack/react-query@5.35.1(react@18.3.1))(@types/react@18.3.1)(bufferutil@4.0.8)(react-dom@18.3.1(react@18.3.1))(react-native@0.75.0(@babel/core@7.25.7)(@babel/preset-env@7.25.3(@babel/core@7.25.7))(@types/react@18.3.1)(bufferutil@4.0.8)(react@18.3.1)(typescript@5.4.5)(utf-8-validate@5.0.10))(react@18.3.1)(rollup@4.28.0)(typescript@5.4.5)(utf-8-validate@5.0.10)(viem@2.20.1(bufferutil@4.0.8)(typescript@5.4.5)(utf-8-validate@5.0.10)(zod@3.22.4))(zod@3.22.4)) + version: 1.8.2(@babel/core@7.25.7)(@tanstack/react-query@5.35.1(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react-is@18.3.1)(react@18.3.1)(viem@2.20.1(bufferutil@4.0.8)(typescript@5.4.5)(utf-8-validate@5.0.10)(zod@3.22.4))(wagmi@2.12.7(@tanstack/query-core@5.35.1)(@tanstack/react-query@5.35.1(react@18.3.1))(@types/react@18.3.1)(bufferutil@4.0.8)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.4.5)(utf-8-validate@5.0.10)(viem@2.20.1(bufferutil@4.0.8)(typescript@5.4.5)(utf-8-validate@5.0.10)(zod@3.22.4))(zod@3.22.4)) fuels: specifier: 0.96.1 version: 0.96.1 @@ -390,9 +390,6 @@ importers: '@fuel-connectors/burner-wallet-connector': specifier: workspace:* version: link:../burner-wallet-connector - '@fuel-connectors/evm-connector': - specifier: workspace:* - version: link:../evm-connector '@fuel-connectors/fuel-development-wallet': specifier: workspace:* version: link:../fuel-development-wallet @@ -470,64 +467,6 @@ importers: specifier: ^3.4.37 version: 3.4.37(typescript@5.4.5) - packages/evm-connector: - dependencies: - '@ethereumjs/util': - specifier: 9.0.3 - version: 9.0.3 - '@ethersproject/bytes': - specifier: 5.7.0 - version: 5.7.0 - memoizee: - specifier: 0.4.15 - version: 0.4.15 - devDependencies: - '@fuel-connectors/common': - specifier: workspace:* - version: link:../common - '@fuel-connectors/evm-predicates': - specifier: workspace:* - version: link:../evm-predicates - '@types/memoizee': - specifier: 0.4.11 - version: 0.4.11 - fuels: - specifier: 0.96.1 - version: 0.96.1 - jsdom: - specifier: 24.0.0 - version: 24.0.0(bufferutil@4.0.8)(utf-8-validate@5.0.10) - ts-loader: - specifier: 9.5.1 - version: 9.5.1(typescript@5.4.5)(webpack@5.93.0) - ts-node: - specifier: 10.9.2 - version: 10.9.2(@types/node@22.7.5)(typescript@5.4.5) - tsup: - specifier: 8.0.2 - version: 8.0.2(@microsoft/api-extractor@7.43.0(@types/node@22.7.5))(postcss@8.4.41)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5))(typescript@5.4.5) - tsx: - specifier: 4.9.3 - version: 4.9.3 - typescript: - specifier: 5.4.5 - version: 5.4.5 - viem: - specifier: 2.20.1 - version: 2.20.1(bufferutil@4.0.8)(typescript@5.4.5)(utf-8-validate@5.0.10)(zod@3.22.4) - vite: - specifier: 5.2.11 - version: 5.2.11(@types/node@22.7.5)(terser@5.34.1) - vite-plugin-dts: - specifier: 3.9.1 - version: 3.9.1(@types/node@22.7.5)(rollup@4.28.0)(typescript@5.4.5)(vite@5.2.11(@types/node@22.7.5)(terser@5.34.1)) - vite-tsconfig-paths: - specifier: 4.3.2 - version: 4.3.2(typescript@5.4.5)(vite@5.2.11(@types/node@22.7.5)(terser@5.34.1)) - vitest: - specifier: 2.0.2 - version: 2.0.2(@types/node@22.7.5)(jsdom@24.0.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(terser@5.34.1) - packages/evm-predicates: devDependencies: '@fuel-connectors/common': @@ -6890,9 +6829,6 @@ packages: resolution: {integrity: sha512-KVbFv2TQtbzCoxAnfD6JcHZTYCzyliEaaeM/gH8qQdkKr5s0OP9scEgvdcngyk7AVdY6YVW/TJHd+lQ/Df3Daw==} engines: {node: '>=0.10.0'} - globrex@0.1.2: - resolution: {integrity: sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==} - gopd@1.0.1: resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==} @@ -9988,16 +9924,6 @@ packages: '@swc/wasm': optional: true - tsconfck@3.1.1: - resolution: {integrity: sha512-00eoI6WY57SvZEVjm13stEVE90VkEdJAFGgpFLTsZbJyW/LwFQ7uQxJHWpZ2hzSWgCPKc9AnBnNP+0X7o3hAmQ==} - engines: {node: ^18 || >=20} - hasBin: true - peerDependencies: - typescript: ^5.0.0 - peerDependenciesMeta: - typescript: - optional: true - tslib@1.14.1: resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} @@ -10480,14 +10406,6 @@ packages: vite: optional: true - vite-tsconfig-paths@4.3.2: - resolution: {integrity: sha512-0Vd/a6po6Q+86rPlntHye7F31zA2URZMbH8M3saAZ/xR9QoGN/L21bxEGfXdWmFdNkqPpRdxFT7nmNe12e9/uA==} - peerDependencies: - vite: '*' - peerDependenciesMeta: - vite: - optional: true - vite@5.2.11: resolution: {integrity: sha512-HndV31LWW05i1BLPMUCE1B9E9GFbOu1MbenhS58FuK6owSO5qHm7GiCotrNY1YE5rMeQSFBGmT5ZaLEjFizgiQ==} engines: {node: ^18.0.0 || >=20.0.0} @@ -11123,10 +11041,10 @@ snapshots: '@babel/helpers': 7.25.7 '@babel/parser': 7.25.7 '@babel/template': 7.25.7 - '@babel/traverse': 7.25.7(supports-color@5.5.0) + '@babel/traverse': 7.25.7 '@babel/types': 7.25.7 convert-source-map: 2.0.0 - debug: 4.3.7(supports-color@5.5.0) + debug: 4.3.7(supports-color@8.1.1) gensync: 1.0.0-beta.2 json5: 2.2.3 semver: 6.3.1 @@ -11146,7 +11064,7 @@ snapshots: '@babel/helper-builder-binary-assignment-operator-visitor@7.25.7': dependencies: - '@babel/traverse': 7.25.7(supports-color@5.5.0) + '@babel/traverse': 7.25.7 '@babel/types': 7.25.7 transitivePeerDependencies: - supports-color @@ -11167,7 +11085,7 @@ snapshots: '@babel/helper-optimise-call-expression': 7.25.7 '@babel/helper-replace-supers': 7.25.7(@babel/core@7.25.7) '@babel/helper-skip-transparent-expression-wrappers': 7.25.7 - '@babel/traverse': 7.25.7(supports-color@5.5.0) + '@babel/traverse': 7.25.7 semver: 6.3.1 transitivePeerDependencies: - supports-color @@ -11184,7 +11102,7 @@ snapshots: '@babel/core': 7.25.7 '@babel/helper-compilation-targets': 7.25.7 '@babel/helper-plugin-utils': 7.25.7 - debug: 4.3.7(supports-color@5.5.0) + debug: 4.3.7(supports-color@8.1.1) lodash.debounce: 4.0.8 resolve: 1.22.8 transitivePeerDependencies: @@ -11192,7 +11110,14 @@ snapshots: '@babel/helper-member-expression-to-functions@7.25.7': dependencies: - '@babel/traverse': 7.25.7(supports-color@5.5.0) + '@babel/traverse': 7.25.7 + '@babel/types': 7.25.7 + transitivePeerDependencies: + - supports-color + + '@babel/helper-module-imports@7.25.7': + dependencies: + '@babel/traverse': 7.25.7 '@babel/types': 7.25.7 transitivePeerDependencies: - supports-color @@ -11207,10 +11132,10 @@ snapshots: '@babel/helper-module-transforms@7.25.7(@babel/core@7.25.7)': dependencies: '@babel/core': 7.25.7 - '@babel/helper-module-imports': 7.25.7(supports-color@5.5.0) + '@babel/helper-module-imports': 7.25.7 '@babel/helper-simple-access': 7.25.7 '@babel/helper-validator-identifier': 7.25.7 - '@babel/traverse': 7.25.7(supports-color@5.5.0) + '@babel/traverse': 7.25.7 transitivePeerDependencies: - supports-color @@ -11225,7 +11150,7 @@ snapshots: '@babel/core': 7.25.7 '@babel/helper-annotate-as-pure': 7.25.7 '@babel/helper-wrap-function': 7.25.7 - '@babel/traverse': 7.25.7(supports-color@5.5.0) + '@babel/traverse': 7.25.7 transitivePeerDependencies: - supports-color @@ -11234,20 +11159,20 @@ snapshots: '@babel/core': 7.25.7 '@babel/helper-member-expression-to-functions': 7.25.7 '@babel/helper-optimise-call-expression': 7.25.7 - '@babel/traverse': 7.25.7(supports-color@5.5.0) + '@babel/traverse': 7.25.7 transitivePeerDependencies: - supports-color '@babel/helper-simple-access@7.25.7': dependencies: - '@babel/traverse': 7.25.7(supports-color@5.5.0) + '@babel/traverse': 7.25.7 '@babel/types': 7.25.7 transitivePeerDependencies: - supports-color '@babel/helper-skip-transparent-expression-wrappers@7.25.7': dependencies: - '@babel/traverse': 7.25.7(supports-color@5.5.0) + '@babel/traverse': 7.25.7 '@babel/types': 7.25.7 transitivePeerDependencies: - supports-color @@ -11265,7 +11190,7 @@ snapshots: '@babel/helper-wrap-function@7.25.7': dependencies: '@babel/template': 7.25.7 - '@babel/traverse': 7.25.7(supports-color@5.5.0) + '@babel/traverse': 7.25.7 '@babel/types': 7.25.7 transitivePeerDependencies: - supports-color @@ -11294,7 +11219,7 @@ snapshots: dependencies: '@babel/core': 7.25.7 '@babel/helper-plugin-utils': 7.25.7 - '@babel/traverse': 7.25.7(supports-color@5.5.0) + '@babel/traverse': 7.25.7 transitivePeerDependencies: - supports-color @@ -11321,7 +11246,7 @@ snapshots: dependencies: '@babel/core': 7.25.7 '@babel/helper-plugin-utils': 7.25.7 - '@babel/traverse': 7.25.7(supports-color@5.5.0) + '@babel/traverse': 7.25.7 transitivePeerDependencies: - supports-color @@ -11480,14 +11405,14 @@ snapshots: '@babel/helper-plugin-utils': 7.25.7 '@babel/helper-remap-async-to-generator': 7.25.7(@babel/core@7.25.7) '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@7.25.7) - '@babel/traverse': 7.25.7(supports-color@5.5.0) + '@babel/traverse': 7.25.7 transitivePeerDependencies: - supports-color '@babel/plugin-transform-async-to-generator@7.25.7(@babel/core@7.25.7)': dependencies: '@babel/core': 7.25.7 - '@babel/helper-module-imports': 7.25.7(supports-color@5.5.0) + '@babel/helper-module-imports': 7.25.7 '@babel/helper-plugin-utils': 7.25.7 '@babel/helper-remap-async-to-generator': 7.25.7(@babel/core@7.25.7) transitivePeerDependencies: @@ -11527,7 +11452,7 @@ snapshots: '@babel/helper-compilation-targets': 7.25.7 '@babel/helper-plugin-utils': 7.25.7 '@babel/helper-replace-supers': 7.25.7(@babel/core@7.25.7) - '@babel/traverse': 7.25.7(supports-color@5.5.0) + '@babel/traverse': 7.25.7 globals: 11.12.0 transitivePeerDependencies: - supports-color @@ -11599,7 +11524,7 @@ snapshots: '@babel/core': 7.25.7 '@babel/helper-compilation-targets': 7.25.7 '@babel/helper-plugin-utils': 7.25.7 - '@babel/traverse': 7.25.7(supports-color@5.5.0) + '@babel/traverse': 7.25.7 transitivePeerDependencies: - supports-color @@ -11648,7 +11573,7 @@ snapshots: '@babel/helper-module-transforms': 7.25.7(@babel/core@7.25.7) '@babel/helper-plugin-utils': 7.25.7 '@babel/helper-validator-identifier': 7.25.7 - '@babel/traverse': 7.25.7(supports-color@5.5.0) + '@babel/traverse': 7.25.7 transitivePeerDependencies: - supports-color @@ -11761,7 +11686,7 @@ snapshots: dependencies: '@babel/core': 7.25.7 '@babel/helper-annotate-as-pure': 7.25.7 - '@babel/helper-module-imports': 7.25.7(supports-color@5.5.0) + '@babel/helper-module-imports': 7.25.7 '@babel/helper-plugin-utils': 7.25.7 '@babel/plugin-syntax-jsx': 7.25.7(@babel/core@7.25.7) '@babel/types': 7.25.7 @@ -11782,7 +11707,7 @@ snapshots: '@babel/plugin-transform-runtime@7.25.7(@babel/core@7.25.7)': dependencies: '@babel/core': 7.25.7 - '@babel/helper-module-imports': 7.25.7(supports-color@5.5.0) + '@babel/helper-module-imports': 7.25.7 '@babel/helper-plugin-utils': 7.25.7 babel-plugin-polyfill-corejs2: 0.4.11(@babel/core@7.25.7) babel-plugin-polyfill-corejs3: 0.10.6(@babel/core@7.25.7) @@ -11995,6 +11920,18 @@ snapshots: '@babel/parser': 7.25.7 '@babel/types': 7.25.7 + '@babel/traverse@7.25.7': + dependencies: + '@babel/code-frame': 7.25.7 + '@babel/generator': 7.25.7 + '@babel/parser': 7.25.7 + '@babel/template': 7.25.7 + '@babel/types': 7.25.7 + debug: 4.3.7(supports-color@8.1.1) + globals: 11.12.0 + transitivePeerDependencies: + - supports-color + '@babel/traverse@7.25.7(supports-color@5.5.0)': dependencies: '@babel/code-frame': 7.25.7 @@ -12261,7 +12198,7 @@ snapshots: chalk: 4.1.2 cypress: 12.17.3 dayjs: 1.11.13 - debug: 4.3.7(supports-color@5.5.0) + debug: 4.3.7(supports-color@8.1.1) execa: 4.1.0 globby: 11.1.0 istanbul-lib-coverage: 3.2.2 @@ -12319,7 +12256,7 @@ snapshots: '@babel/preset-env': 7.25.3(@babel/core@7.25.7) babel-loader: 9.2.1(@babel/core@7.25.7)(webpack@5.93.0) bluebird: 3.7.1 - debug: 4.3.7(supports-color@5.5.0) + debug: 4.3.7(supports-color@8.1.1) lodash: 4.17.21 webpack: 5.93.0 transitivePeerDependencies: @@ -13532,7 +13469,7 @@ snapshots: bufferutil: 4.0.8 cross-fetch: 4.0.0 date-fns: 2.30.0 - debug: 4.3.7(supports-color@5.5.0) + debug: 4.3.7(supports-color@8.1.1) eciesjs: 0.3.19 eventemitter2: 6.4.9 readable-stream: 3.6.2 @@ -13560,7 +13497,7 @@ snapshots: '@types/dom-screen-wake-lock': 1.0.3 bowser: 2.11.0 cross-fetch: 4.0.0 - debug: 4.3.7(supports-color@5.5.0) + debug: 4.3.7(supports-color@8.1.1) eciesjs: 0.3.19 eth-rpc-errors: 4.0.3 eventemitter2: 6.4.9 @@ -13592,7 +13529,7 @@ snapshots: dependencies: '@ethereumjs/tx': 4.2.0 '@types/debug': 4.1.12 - debug: 4.3.7(supports-color@5.5.0) + debug: 4.3.7(supports-color@8.1.1) semver: 7.6.3 superstruct: 1.0.4 transitivePeerDependencies: @@ -13605,7 +13542,7 @@ snapshots: '@noble/hashes': 1.5.0 '@scure/base': 1.1.9 '@types/debug': 4.1.12 - debug: 4.3.7(supports-color@5.5.0) + debug: 4.3.7(supports-color@8.1.1) pony-cause: 2.1.11 semver: 7.6.3 uuid: 9.0.1 @@ -13619,7 +13556,7 @@ snapshots: '@noble/hashes': 1.5.0 '@scure/base': 1.1.9 '@types/debug': 4.1.12 - debug: 4.3.7(supports-color@5.5.0) + debug: 4.3.7(supports-color@8.1.1) pony-cause: 2.1.11 semver: 7.6.3 uuid: 9.0.1 @@ -13893,7 +13830,7 @@ snapshots: commander: 11.1.0 cypress: 12.17.3 cypress-wait-until: 2.0.1 - debug: 4.3.7(supports-color@5.5.0) + debug: 4.3.7(supports-color@8.1.1) dotenv: 16.4.5 dotenv-parse-variables: 2.0.0 download: 8.0.0 @@ -16905,7 +16842,7 @@ snapshots: agent-base@7.1.1: dependencies: - debug: 4.3.7(supports-color@5.5.0) + debug: 4.3.7(supports-color@8.1.1) transitivePeerDependencies: - supports-color @@ -17761,7 +17698,7 @@ snapshots: transitivePeerDependencies: - supports-color - connectkit@1.8.2(@babel/core@7.25.7)(@tanstack/react-query@5.35.1(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react-is@18.3.1)(react@18.3.1)(viem@2.20.1(bufferutil@4.0.8)(typescript@5.4.5)(utf-8-validate@5.0.10)(zod@3.22.4))(wagmi@2.12.7(@tanstack/query-core@5.35.1)(@tanstack/react-query@5.35.1(react@18.3.1))(@types/react@18.3.1)(bufferutil@4.0.8)(react-dom@18.3.1(react@18.3.1))(react-native@0.75.0(@babel/core@7.25.7)(@babel/preset-env@7.25.3(@babel/core@7.25.7))(@types/react@18.3.1)(bufferutil@4.0.8)(react@18.3.1)(typescript@5.4.5)(utf-8-validate@5.0.10))(react@18.3.1)(rollup@4.28.0)(typescript@5.4.5)(utf-8-validate@5.0.10)(viem@2.20.1(bufferutil@4.0.8)(typescript@5.4.5)(utf-8-validate@5.0.10)(zod@3.22.4))(zod@3.22.4)): + connectkit@1.8.2(@babel/core@7.25.7)(@tanstack/react-query@5.35.1(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react-is@18.3.1)(react@18.3.1)(viem@2.20.1(bufferutil@4.0.8)(typescript@5.4.5)(utf-8-validate@5.0.10)(zod@3.22.4))(wagmi@2.12.7(@tanstack/query-core@5.35.1)(@tanstack/react-query@5.35.1(react@18.3.1))(@types/react@18.3.1)(bufferutil@4.0.8)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.4.5)(utf-8-validate@5.0.10)(viem@2.20.1(bufferutil@4.0.8)(typescript@5.4.5)(utf-8-validate@5.0.10)(zod@3.22.4))(zod@3.22.4)): dependencies: '@tanstack/react-query': 5.35.1(react@18.3.1) buffer: 6.0.3 @@ -18209,7 +18146,7 @@ snapshots: dotenv-parse-variables@2.0.0: dependencies: - debug: 4.3.7(supports-color@5.5.0) + debug: 4.3.7(supports-color@8.1.1) is-string-and-not-blank: 0.0.2 transitivePeerDependencies: - supports-color @@ -19074,7 +19011,7 @@ snapshots: follow-redirects@1.15.9(debug@4.3.7): optionalDependencies: - debug: 4.3.7(supports-color@5.5.0) + debug: 4.3.7(supports-color@8.1.1) for-each@0.3.3: dependencies: @@ -19369,8 +19306,6 @@ snapshots: pify: 2.3.0 pinkie-promise: 2.0.1 - globrex@0.1.2: {} - gopd@1.0.1: dependencies: get-intrinsic: 1.2.4 @@ -19608,7 +19543,7 @@ snapshots: http-proxy-agent@7.0.2: dependencies: agent-base: 7.1.1 - debug: 4.3.7(supports-color@5.5.0) + debug: 4.3.7(supports-color@8.1.1) transitivePeerDependencies: - supports-color @@ -19643,7 +19578,7 @@ snapshots: https-proxy-agent@7.0.5: dependencies: agent-base: 7.1.1 - debug: 4.3.7(supports-color@5.5.0) + debug: 4.3.7(supports-color@8.1.1) transitivePeerDependencies: - supports-color @@ -19994,7 +19929,7 @@ snapshots: istanbul-lib-source-maps@4.0.1: dependencies: - debug: 4.3.7(supports-color@5.5.0) + debug: 4.3.7(supports-color@8.1.1) istanbul-lib-coverage: 3.2.2 source-map: 0.6.1 transitivePeerDependencies: @@ -20713,7 +20648,7 @@ snapshots: metro-source-map@0.80.12: dependencies: - '@babel/traverse': 7.25.7(supports-color@5.5.0) + '@babel/traverse': 7.25.7 '@babel/types': 7.25.7 flow-enums-runtime: 0.0.6 invariant: 2.2.4 @@ -20742,7 +20677,7 @@ snapshots: '@babel/core': 7.25.7 '@babel/generator': 7.25.7 '@babel/template': 7.25.7 - '@babel/traverse': 7.25.7(supports-color@5.5.0) + '@babel/traverse': 7.25.7 flow-enums-runtime: 0.0.6 nullthrows: 1.1.1 transitivePeerDependencies: @@ -20775,7 +20710,7 @@ snapshots: '@babel/generator': 7.25.7 '@babel/parser': 7.25.7 '@babel/template': 7.25.7 - '@babel/traverse': 7.25.7(supports-color@5.5.0) + '@babel/traverse': 7.25.7 '@babel/types': 7.25.7 accepts: 1.3.8 chalk: 4.1.2 @@ -22398,7 +22333,7 @@ snapshots: spdy-transport@3.0.0: dependencies: - debug: 4.3.7(supports-color@5.5.0) + debug: 4.3.7(supports-color@8.1.1) detect-node: 2.1.0 hpack.js: 2.1.6 obuf: 1.1.2 @@ -22409,7 +22344,7 @@ snapshots: spdy@4.0.2: dependencies: - debug: 4.3.7(supports-color@5.5.0) + debug: 4.3.7(supports-color@8.1.1) handle-thing: 2.0.1 http-deceiver: 1.2.7 select-hose: 2.0.0 @@ -22907,10 +22842,6 @@ snapshots: v8-compile-cache-lib: 3.0.1 yn: 3.1.1 - tsconfck@3.1.1(typescript@5.4.5): - optionalDependencies: - typescript: 5.4.5 - tslib@1.14.1: {} tslib@2.6.3: {} @@ -22922,7 +22853,7 @@ snapshots: bundle-require: 4.2.1(esbuild@0.19.12) cac: 6.7.14 chokidar: 3.6.0 - debug: 4.3.7(supports-color@5.5.0) + debug: 4.3.7(supports-color@8.1.1) esbuild: 0.19.12 execa: 5.1.1 globby: 11.1.0 @@ -23484,17 +23415,6 @@ snapshots: - rollup - supports-color - vite-tsconfig-paths@4.3.2(typescript@5.4.5)(vite@5.2.11(@types/node@22.7.5)(terser@5.34.1)): - dependencies: - debug: 4.3.6(supports-color@5.5.0) - globrex: 0.1.2 - tsconfck: 3.1.1(typescript@5.4.5) - optionalDependencies: - vite: 5.2.11(@types/node@22.7.5)(terser@5.34.1) - transitivePeerDependencies: - - supports-color - - typescript - vite@5.2.11(@types/node@20.12.11)(terser@5.34.1): dependencies: esbuild: 0.20.2 From b4e359e0988c0726d2ccb2db69ab8a9f8cd40bfd Mon Sep 17 00:00:00 2001 From: Peter Smith Date: Mon, 10 Feb 2025 16:53:53 +0000 Subject: [PATCH 2/2] changeset --- .changeset/loud-baboons-rhyme.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/loud-baboons-rhyme.md diff --git a/.changeset/loud-baboons-rhyme.md b/.changeset/loud-baboons-rhyme.md new file mode 100644 index 000000000..017778a47 --- /dev/null +++ b/.changeset/loud-baboons-rhyme.md @@ -0,0 +1,5 @@ +--- +"@fuels/connectors": patch +--- + +chore: removed redundant `evm-connector`