@openzeppelin/ui-builder-adapter-evm 1.2.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -18
- package/dist/index.cjs +4651 -4448
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -226
- package/dist/index.d.ts +12 -226
- package/dist/index.js +4737 -4535
- package/dist/index.js.map +1 -1
- package/package.json +7 -6
- package/src/__tests__/adapter-parsing.test.ts +4 -3
- package/src/__tests__/getDefaultServiceConfig.test.ts +185 -0
- package/src/__tests__/mocks/mock-network-configs.ts +1 -1
- package/src/__tests__/provenanceLinks.test.ts +6 -4
- package/src/__tests__/providerSelection.test.ts +5 -4
- package/src/__tests__/timeouts.test.ts +5 -3
- package/src/__tests__/wallet-connect.test.ts +2 -2
- package/src/adapter.ts +61 -107
- package/src/configuration/execution.ts +1 -52
- package/src/configuration/index.ts +2 -3
- package/src/configuration/network-services.ts +47 -60
- package/src/index.ts +22 -13
- package/src/networks/index.ts +2 -1
- package/src/networks/mainnet.ts +1 -1
- package/src/networks/testnet.ts +1 -1
- package/src/query/adapter-query.ts +72 -0
- package/src/query/index.ts +2 -2
- package/src/transaction/components/useEvmRelayerOptions.ts +5 -3
- package/src/transaction/index.ts +1 -5
- package/src/types/artifacts.ts +5 -30
- package/src/types/providers.ts +7 -18
- package/src/wallet/components/EvmWalletUiRoot.tsx +1 -1
- package/src/wallet/evmUiKitManager.ts +26 -129
- package/src/wallet/hooks/index.ts +0 -1
- package/src/wallet/implementation/wagmi-implementation.ts +45 -577
- package/src/wallet/index.ts +2 -3
- package/src/wallet/rainbowkit/__tests__/export-service.test.ts +1 -2
- package/src/wallet/rainbowkit/componentFactory.ts +10 -8
- package/src/wallet/rainbowkit/components.tsx +16 -133
- package/src/wallet/rainbowkit/index.ts +27 -5
- package/src/wallet/utils/__tests__/uiKitService.test.ts +5 -1
- package/src/wallet/utils/connection.ts +8 -52
- package/src/wallet/utils/index.ts +0 -2
- package/src/wallet/utils/uiKitService.ts +7 -3
- package/src/wallet/utils/walletImplementationManager.ts +5 -4
- package/src/wallet/utils.ts +1 -65
- package/src/abi/__tests__/etherscan-v2.test.ts +0 -117
- package/src/abi/__tests__/transformer.test.ts +0 -342
- package/src/abi/comparison.ts +0 -389
- package/src/abi/etherscan-v2.ts +0 -243
- package/src/abi/etherscan.ts +0 -158
- package/src/abi/index.ts +0 -7
- package/src/abi/loader.ts +0 -415
- package/src/abi/sourcify.ts +0 -75
- package/src/abi/transformer.ts +0 -163
- package/src/abi/types.ts +0 -101
- package/src/configuration/__tests__/explorer.test.ts +0 -174
- package/src/configuration/__tests__/rpc.test.ts +0 -176
- package/src/configuration/explorer.ts +0 -243
- package/src/configuration/rpc.ts +0 -257
- package/src/mapping/__tests__/field-generator.test.ts +0 -137
- package/src/mapping/__tests__/type-mapper.test.ts +0 -139
- package/src/mapping/constants.ts +0 -57
- package/src/mapping/field-generator.ts +0 -115
- package/src/mapping/index.ts +0 -4
- package/src/mapping/type-mapper.ts +0 -80
- package/src/proxy/detection.ts +0 -465
- package/src/query/handler.ts +0 -227
- package/src/query/view-checker.ts +0 -10
- package/src/transaction/eoa.ts +0 -98
- package/src/transaction/execution-strategy.ts +0 -33
- package/src/transaction/formatter.ts +0 -101
- package/src/transaction/relayer.ts +0 -380
- package/src/transaction/sender.ts +0 -185
- package/src/transform/index.ts +0 -3
- package/src/transform/input-parser.ts +0 -177
- package/src/transform/output-formatter.ts +0 -64
- package/src/types/__tests__/artifacts.test.ts +0 -105
- package/src/types.ts +0 -92
- package/src/utils/__tests__/artifacts.test.ts +0 -81
- package/src/utils/artifacts.ts +0 -30
- package/src/utils/formatting.ts +0 -25
- package/src/utils/gas.ts +0 -17
- package/src/utils/index.ts +0 -6
- package/src/utils/json.ts +0 -19
- package/src/utils/validation.ts +0 -10
- package/src/validation/eoa.ts +0 -33
- package/src/validation/index.ts +0 -2
- package/src/validation/relayer.ts +0 -13
- package/src/wallet/__tests__/utils.test.ts +0 -149
- package/src/wallet/components/account/AccountDisplay.tsx +0 -52
- package/src/wallet/components/connect/ConnectButton.tsx +0 -125
- package/src/wallet/components/connect/ConnectorDialog.tsx +0 -140
- package/src/wallet/components/index.ts +0 -4
- package/src/wallet/components/network/NetworkSwitcher.tsx +0 -90
- package/src/wallet/context/index.ts +0 -1
- package/src/wallet/context/wagmi-context.tsx +0 -7
- package/src/wallet/hooks/useIsWagmiProviderInitialized.ts +0 -11
- package/src/wallet/rainbowkit/config-generator.ts +0 -56
- package/src/wallet/rainbowkit/config-service.ts +0 -169
- package/src/wallet/rainbowkit/export-service.ts +0 -18
- package/src/wallet/rainbowkit/rainbowkitAssetManager.ts +0 -74
- package/src/wallet/rainbowkit/types.ts +0 -74
- package/src/wallet/rainbowkit/utils.ts +0 -96
- package/src/wallet/services/configResolutionService.ts +0 -65
- package/src/wallet/utils/SafeWagmiComponent.tsx +0 -72
- package/src/wallet/utils/filterWalletComponents.ts +0 -89
package/README.md
CHANGED
|
@@ -52,23 +52,16 @@ This adapter generally follows the standard module structure outlined in the mai
|
|
|
52
52
|
```text
|
|
53
53
|
adapter-evm/
|
|
54
54
|
├── src/
|
|
55
|
-
│ ├──
|
|
56
|
-
│ ├──
|
|
57
|
-
│ ├──
|
|
58
|
-
│ ├──
|
|
59
|
-
│
|
|
60
|
-
│ ├── transaction/ # Transaction execution system
|
|
61
|
-
│ │ ├── components/ # React components for configuration
|
|
62
|
-
│ │ ├── strategies/ # Execution strategy implementations
|
|
63
|
-
│ ├── validation/ # Validation utilities
|
|
55
|
+
│ ├── configuration/ # Adapter-specific configuration wrappers
|
|
56
|
+
│ ├── networks/ # EVM network configurations (mainnet, testnet)
|
|
57
|
+
│ ├── query/ # View function query wrappers
|
|
58
|
+
│ ├── transaction/ # Transaction UI components
|
|
59
|
+
│ │ └── components/ # React components (EvmRelayerOptions)
|
|
64
60
|
│ ├── wallet/ # Wallet integration (see wallet/README.md)
|
|
65
|
-
│ │ ├──
|
|
66
|
-
│ │ ├──
|
|
67
|
-
│ │ ├──
|
|
68
|
-
│ │
|
|
69
|
-
│ │ ├── types/ # Wallet-specific types
|
|
70
|
-
│ │ ├── utils/ # Wallet utilities
|
|
71
|
-
│ │ ├── README.md # Detailed wallet documentation
|
|
61
|
+
│ │ ├── hooks/ # Wagmi hook facades
|
|
62
|
+
│ │ ├── implementation/ # Wagmi wallet implementation
|
|
63
|
+
│ │ ├── rainbowkit/ # RainbowKit component factories
|
|
64
|
+
│ │ └── utils/ # Wallet utilities
|
|
72
65
|
│ ├── adapter.ts # Main EvmAdapter class implementation
|
|
73
66
|
│ └── index.ts # Public package exports
|
|
74
67
|
├── package.json
|
|
@@ -78,6 +71,26 @@ adapter-evm/
|
|
|
78
71
|
└── README.md
|
|
79
72
|
```
|
|
80
73
|
|
|
74
|
+
## Relationship with adapter-evm-core
|
|
75
|
+
|
|
76
|
+
Core EVM functionality has been extracted to `@openzeppelin/ui-builder-adapter-evm-core`. This adapter imports and delegates to core modules for:
|
|
77
|
+
|
|
78
|
+
- **ABI loading**: `loadEvmContract`, `loadAbiFromEtherscan`, `loadAbiFromSourcify`
|
|
79
|
+
- **Type mapping**: `mapEvmParamTypeToFieldType`, `generateEvmDefaultField`
|
|
80
|
+
- **Transaction execution**: `EoaExecutionStrategy`, `RelayerExecutionStrategy`
|
|
81
|
+
- **Query handling**: `queryEvmViewFunction`, `isEvmViewFunction`
|
|
82
|
+
- **Input/output transformation**: `parseEvmInput`, `formatEvmFunctionResult`
|
|
83
|
+
- **Wallet infrastructure**: `WagmiWalletImplementation`, UI kit management
|
|
84
|
+
|
|
85
|
+
The core package is bundled internally (not a runtime dependency) via `tsup` with `noExternal: ['@openzeppelin/ui-builder-adapter-evm-core']`.
|
|
86
|
+
|
|
87
|
+
**What remains in this adapter:**
|
|
88
|
+
|
|
89
|
+
- Ethereum/EVM network configurations (mainnet, Sepolia, Polygon, etc.)
|
|
90
|
+
- Adapter-specific wrapper functions
|
|
91
|
+
- React UI components for transaction options
|
|
92
|
+
- RainbowKit integration and configuration
|
|
93
|
+
|
|
81
94
|
---
|
|
82
95
|
|
|
83
96
|
## Usage (Adapter Instantiation)
|
|
@@ -130,5 +143,7 @@ The `src/wallet/implementation/wagmi-implementation.ts` file configures Wagmi wi
|
|
|
130
143
|
Network configurations for various EVM chains (mainnets and testnets) are exported from `src/networks/index.ts` within this package (e.g., `ethereumMainnet`, `polygonMainnet`, `ethereumSepolia`, `polygonAmoy`). Each `EvmNetworkConfig` includes:
|
|
131
144
|
|
|
132
145
|
- `id`: A unique string identifier for the network (e.g., "ethereum-mainnet").
|
|
133
|
-
- `primaryExplorerApiIdentifier`: A string key (e.g., "etherscan-
|
|
134
|
-
-
|
|
146
|
+
- `primaryExplorerApiIdentifier`: A string key (e.g., "etherscan-v2", "routescan") used to resolve explorer API keys.
|
|
147
|
+
- Default `rpcUrl`, Chain ID, `apiUrl` for explorers, `explorerUrl`, and native currency information.
|
|
148
|
+
|
|
149
|
+
For details on how explorer API keys and RPC URLs are resolved, see the [adapter-evm-core Configuration Module](../adapter-evm-core/README.md#configuration-module).
|