@openzeppelin/ui-builder-adapter-evm 1.5.0 → 1.6.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/dist/index.d.cts CHANGED
@@ -1,8 +1,230 @@
1
- import { TransactionReceipt } from 'viem';
2
- import React from 'react';
3
- import { TypedEvmNetworkConfig, WriteContractParameters, EvmContractDefinitionProviderKey } from '@openzeppelin/ui-builder-adapter-evm-core';
4
- export { AppInfo, EvmContractArtifacts, EvmRelayerTransactionOptions, RainbowKitConnectButtonProps, RainbowKitCustomizations, RainbowKitKitConfig, RainbowKitProviderProps, TypedEvmNetworkConfig, WriteContractParameters, abiComparisonService, extractRainbowKitCustomizations, isEvmContractArtifacts, isRainbowKitCustomizations } from '@openzeppelin/ui-builder-adapter-evm-core';
5
- import { WalletConnectionStatus, ContractAdapter, UiKitConfiguration, NetworkServiceForm, ContractSchema, ProxyInfo, FieldType, FunctionParameter, FormFieldType, ExecutionConfig, TxStatus, TransactionStatusUpdate, RelayerDetails, RelayerDetailsRich, ExecutionMethodDetail, ContractFunction, Connector, NativeConfigLoader, EcosystemReactUiProviderProps, EcosystemSpecificReactHooks, EcosystemWalletComponents, AvailableUiKit, UserRpcProviderConfig, UserExplorerConfig, TypeMappingInfo, AdapterConfig } from '@openzeppelin/ui-types';
1
+ import { EvmNetworkConfig, WalletConnectionStatus, ContractAdapter, UiKitConfiguration, NetworkServiceForm, ContractSchema, ProxyInfo, FieldType, FunctionParameter, FormFieldType, ExecutionConfig, TxStatus, TransactionStatusUpdate, RelayerDetails, RelayerDetailsRich, ExecutionMethodDetail, ContractFunction, Connector, NativeConfigLoader, EcosystemReactUiProviderProps, EcosystemSpecificReactHooks, EcosystemWalletComponents, AvailableUiKit, UserRpcProviderConfig, UserExplorerConfig, AccessControlService, TypeMappingInfo, EcosystemExport } from '@openzeppelin/ui-types';
2
+ export { ecosystemMetadata } from './metadata.cjs';
3
+ import { Chain, Abi, TransactionReceipt } from 'viem';
4
+ import React__default from 'react';
5
+ import { Speed } from '@openzeppelin/relayer-sdk';
6
+ import { RainbowKitProvider, ConnectButton } from '@rainbow-me/rainbowkit';
7
+
8
+ /**
9
+ * Defines the structure for parameters required to execute a contract write operation via viem.
10
+ */
11
+ interface WriteContractParameters {
12
+ address: `0x${string}`;
13
+ abi: Abi;
14
+ functionName: string;
15
+ args: unknown[];
16
+ value?: bigint;
17
+ }
18
+ /**
19
+ * EVM-specific network configuration with strict `ecosystem: 'evm'` constraint
20
+ * and strongly-typed viem `Chain` (narrowed from `unknown` in `EvmNetworkConfig`).
21
+ *
22
+ * Use this type in EVM-only contexts where you want strict ecosystem typing.
23
+ * For function signatures that should accept configs from multiple adapters
24
+ * (EVM, Polkadot, etc.), use `EvmCompatibleNetworkConfig` instead.
25
+ */
26
+ interface TypedEvmNetworkConfig extends EvmNetworkConfig {
27
+ viemChain?: Chain;
28
+ }
29
+
30
+ /**
31
+ * EVM Contract Definition Provider keys and ordering
32
+ * Avoid magic strings by using typed constants and a union type.
33
+ */
34
+ declare const EvmProviderKeys: {
35
+ readonly Etherscan: "etherscan";
36
+ readonly Sourcify: "sourcify";
37
+ };
38
+ type EvmContractDefinitionProviderKey = (typeof EvmProviderKeys)[keyof typeof EvmProviderKeys];
39
+
40
+ /**
41
+ * EVM-specific contract artifacts interface
42
+ * Defines the structure of data needed to load EVM contracts
43
+ */
44
+
45
+ interface EvmContractArtifacts {
46
+ /** The deployed contract address (required) */
47
+ contractAddress: string;
48
+ /** Optional manual ABI JSON string (for unverified contracts) */
49
+ contractDefinition?: string;
50
+ /** Optional proxy detection configuration */
51
+ __proxyDetectionOptions?: {
52
+ /** Skip automatic proxy detection */
53
+ skipProxyDetection?: boolean;
54
+ };
55
+ /** Optional forced provider for this load attempt (session-scoped override) */
56
+ __forcedProvider?: EvmContractDefinitionProviderKey;
57
+ }
58
+ /**
59
+ * Type guard to check if an object matches EvmContractArtifacts structure
60
+ */
61
+ declare function isEvmContractArtifacts(obj: unknown): obj is EvmContractArtifacts;
62
+
63
+ /**
64
+ * EVM-specific ABI types for comparison and validation
65
+ * Uses viem's Abi type as the foundation for type safety
66
+ */
67
+
68
+ /**
69
+ * Result of comparing two ABIs
70
+ */
71
+ interface AbiComparisonResult {
72
+ /** Whether the ABIs are identical after normalization */
73
+ identical: boolean;
74
+ /** List of differences found between the ABIs */
75
+ differences: AbiDifference[];
76
+ /** Overall severity of the changes */
77
+ severity: 'none' | 'minor' | 'major' | 'breaking';
78
+ /** Human-readable summary of the comparison */
79
+ summary: string;
80
+ }
81
+ /**
82
+ * Represents a single difference between two ABIs
83
+ */
84
+ interface AbiDifference {
85
+ /** Type of change */
86
+ type: 'added' | 'removed' | 'modified';
87
+ /** Which section of the ABI was affected */
88
+ section: 'function' | 'event' | 'constructor' | 'error' | 'fallback' | 'receive';
89
+ /** Name of the affected item (or type if no name) */
90
+ name: string;
91
+ /** Detailed description of the change */
92
+ details: string;
93
+ /** Impact level of this change */
94
+ impact: 'low' | 'medium' | 'high';
95
+ /** Signature before the change (for removed/modified) */
96
+ oldSignature?: string;
97
+ /** Signature after the change (for added/modified) */
98
+ newSignature?: string;
99
+ }
100
+ /**
101
+ * Result of validating an ABI structure
102
+ */
103
+ interface AbiValidationResult {
104
+ /** Whether the ABI is structurally valid */
105
+ valid: boolean;
106
+ /** List of validation errors found */
107
+ errors: string[];
108
+ /** List of validation warnings */
109
+ warnings: string[];
110
+ /** Normalized ABI if validation passed */
111
+ normalizedAbi?: Abi;
112
+ }
113
+
114
+ /**
115
+ * ABI comparison service for EVM contracts
116
+ * Provides detailed analysis of differences between ABIs
117
+ */
118
+
119
+ /**
120
+ * Service for comparing and validating EVM ABIs
121
+ */
122
+ declare class AbiComparisonService {
123
+ /**
124
+ * Compares two ABIs and returns detailed difference analysis
125
+ */
126
+ compareAbis(abi1: string, abi2: string): AbiComparisonResult;
127
+ /**
128
+ * Validates ABI structure and format
129
+ */
130
+ validateAbi(abiString: string): AbiValidationResult;
131
+ /**
132
+ * Creates deterministic hash of ABI for quick comparison
133
+ */
134
+ hashAbi(abiString: string): string;
135
+ /**
136
+ * Normalizes ABI for consistent comparison
137
+ */
138
+ private normalizeAbi;
139
+ /**
140
+ * Finds detailed differences between two normalized ABIs
141
+ */
142
+ private findDifferences;
143
+ private createAbiMap;
144
+ private generateItemKey;
145
+ private generateSignature;
146
+ private itemsEqual;
147
+ private calculateImpact;
148
+ private calculateSeverity;
149
+ private generateSummary;
150
+ }
151
+ declare const abiComparisonService: AbiComparisonService;
152
+
153
+ /**
154
+ * Relayer Execution Strategy
155
+ *
156
+ * Implements transaction execution through the OpenZeppelin Relayer service.
157
+ * This strategy sends transactions to a relayer for gas sponsorship and broadcasting.
158
+ */
159
+
160
+ /**
161
+ * EVM-specific transaction options for the OpenZeppelin Relayer.
162
+ * These options map directly to the EvmTransactionRequest parameters in the SDK.
163
+ */
164
+ interface EvmRelayerTransactionOptions {
165
+ speed?: Speed;
166
+ gasLimit?: number;
167
+ gasPrice?: number;
168
+ maxFeePerGas?: number;
169
+ maxPriorityFeePerGas?: number;
170
+ validUntil?: string;
171
+ }
172
+
173
+ /**
174
+ * Custom RainbowKit configuration types for enhanced UI control
175
+ */
176
+ /**
177
+ * Re-export RainbowKit's native types for ConnectButton props
178
+ * This ensures we use the exact same types that RainbowKit expects,
179
+ * reducing maintenance burden and letting RainbowKit handle type validation
180
+ */
181
+
182
+ /**
183
+ * Extract the `AppInfo` type from the RainbowKitProvider's props.
184
+ * This is the canonical way to get the type for the `appInfo` object.
185
+ */
186
+ type AppInfo = React.ComponentProps<typeof RainbowKitProvider>['appInfo'];
187
+ /**
188
+ * Extract the props type from RainbowKit's ConnectButton component
189
+ * This gives us the exact same types that RainbowKit uses internally
190
+ */
191
+ type RainbowKitConnectButtonProps$1 = React.ComponentProps<typeof ConnectButton>;
192
+ /**
193
+ * Represents the props expected by the RainbowKitProvider component.
194
+ * It uses a nested `appInfo` object.
195
+ */
196
+ interface RainbowKitProviderProps {
197
+ appInfo?: AppInfo;
198
+ [key: string]: unknown;
199
+ }
200
+ /**
201
+ * Represents the shape of the `kitConfig` object we use internally when the
202
+ * selected kit is RainbowKit. It has a flat structure for `appName` and `learnMoreUrl`
203
+ * for easier handling in our builder app, and can also contain pre-existing providerProps.
204
+ */
205
+ type RainbowKitKitConfig = Partial<AppInfo> & {
206
+ providerProps?: RainbowKitProviderProps;
207
+ [key: string]: unknown;
208
+ };
209
+ /**
210
+ * Custom UI configuration that uses RainbowKit's native types
211
+ * This extends our configuration system while leveraging RainbowKit's own type definitions
212
+ */
213
+ interface RainbowKitCustomizations {
214
+ /**
215
+ * Configuration for the RainbowKit ConnectButton component
216
+ * Uses RainbowKit's native prop types for type safety and compatibility
217
+ */
218
+ connectButton?: Partial<RainbowKitConnectButtonProps$1>;
219
+ }
220
+ /**
221
+ * Type guard to check if an object contains RainbowKit customizations
222
+ */
223
+ declare function isRainbowKitCustomizations(obj: unknown): obj is RainbowKitCustomizations;
224
+ /**
225
+ * Utility to extract RainbowKit customizations from a kit config
226
+ */
227
+ declare function extractRainbowKitCustomizations(kitConfig: Record<string, unknown> | undefined): RainbowKitCustomizations | undefined;
6
228
 
7
229
  /**
8
230
  * EVM-specific wallet connection status extending the base interface.
@@ -25,6 +247,12 @@ interface EvmWalletConnectionStatus extends WalletConnectionStatus {
25
247
  declare class EvmAdapter implements ContractAdapter {
26
248
  readonly networkConfig: TypedEvmNetworkConfig;
27
249
  readonly initialAppServiceKitName: UiKitConfiguration['kitName'];
250
+ /**
251
+ * Lazily initialized access control service (NFR-004).
252
+ * Created on the first call to `getAccessControlService()` to avoid
253
+ * unnecessary initialization overhead when access control is not used.
254
+ */
255
+ private accessControlService;
28
256
  constructor(networkConfig: TypedEvmNetworkConfig);
29
257
  /**
30
258
  * @inheritdoc
@@ -100,7 +328,7 @@ declare class EvmAdapter implements ContractAdapter {
100
328
  * Returns a React component for configuring EVM-specific relayer transaction options.
101
329
  * @returns The EVM relayer options component
102
330
  */
103
- getRelayerOptionsComponent(): React.ComponentType<{
331
+ getRelayerOptionsComponent(): React__default.ComponentType<{
104
332
  options: Record<string, unknown>;
105
333
  onChange: (options: Record<string, unknown>) => void;
106
334
  }> | undefined;
@@ -196,7 +424,7 @@ declare class EvmAdapter implements ContractAdapter {
196
424
  /**
197
425
  * @inheritdoc
198
426
  */
199
- getEcosystemReactUiContextProvider(): React.ComponentType<EcosystemReactUiProviderProps> | undefined;
427
+ getEcosystemReactUiContextProvider(): React__default.ComponentType<EcosystemReactUiProviderProps> | undefined;
200
428
  /**
201
429
  * @inheritdoc
202
430
  */
@@ -275,6 +503,18 @@ declare class EvmAdapter implements ContractAdapter {
275
503
  * @inheritdoc
276
504
  */
277
505
  hashContractDefinition(definition: string): string;
506
+ /**
507
+ * @inheritdoc
508
+ *
509
+ * Returns a lazily initialized `EvmAccessControlService` instance.
510
+ * The service is created on first call with an `executeTransaction` callback
511
+ * that wraps `signAndBroadcast`, decoupling the access control module from
512
+ * wallet/signing infrastructure.
513
+ *
514
+ * @returns The AccessControlService for this adapter's network
515
+ * @see research.md §R9 — Service Lifecycle and Transaction Execution
516
+ */
517
+ getAccessControlService(): AccessControlService;
278
518
  /**
279
519
  * @inheritdoc
280
520
  */
@@ -305,18 +545,6 @@ declare const zksyncSepoliaTestnet: TypedEvmNetworkConfig;
305
545
  declare const scrollSepolia: TypedEvmNetworkConfig;
306
546
  declare const lineaSepolia: TypedEvmNetworkConfig;
307
547
 
308
- declare const evmMainnetNetworks: TypedEvmNetworkConfig[];
309
- declare const evmTestnetNetworks: TypedEvmNetworkConfig[];
310
- declare const evmNetworks: TypedEvmNetworkConfig[];
311
-
312
- /**
313
- * Configuration for the EVM adapter
314
- *
315
- * This file defines the dependencies required by the EVM adapter
316
- * when generating exported projects. It follows the AdapterConfig
317
- * interface to provide a structured approach to dependency management.
318
- */
319
-
320
- declare const evmAdapterConfig: AdapterConfig;
548
+ declare const ecosystemDefinition: EcosystemExport;
321
549
 
322
- export { EvmAdapter, arbitrumMainnet, arbitrumSepolia, avalancheFuji, avalancheMainnet, baseMainnet, baseSepolia, bscMainnet, bscTestnet, ethereumMainnet, ethereumSepolia, evmAdapterConfig, evmMainnetNetworks, evmNetworks, evmTestnetNetworks, lineaMainnet, lineaSepolia, optimismMainnet, optimismSepolia, polygonAmoy, polygonMainnet, polygonZkEvmCardona, polygonZkEvmMainnet, scrollMainnet, scrollSepolia, zkSyncEraMainnet, zksyncSepoliaTestnet };
550
+ export { type AppInfo, EvmAdapter, type EvmContractArtifacts, type EvmRelayerTransactionOptions, type RainbowKitConnectButtonProps$1 as RainbowKitConnectButtonProps, type RainbowKitCustomizations, type RainbowKitKitConfig, type RainbowKitProviderProps, type TypedEvmNetworkConfig, type WriteContractParameters, abiComparisonService, arbitrumMainnet, arbitrumSepolia, avalancheFuji, avalancheMainnet, baseMainnet, baseSepolia, bscMainnet, bscTestnet, ecosystemDefinition, ethereumMainnet, ethereumSepolia, extractRainbowKitCustomizations, isEvmContractArtifacts, isRainbowKitCustomizations, lineaMainnet, lineaSepolia, optimismMainnet, optimismSepolia, polygonAmoy, polygonMainnet, polygonZkEvmCardona, polygonZkEvmMainnet, scrollMainnet, scrollSepolia, zkSyncEraMainnet, zksyncSepoliaTestnet };
package/dist/index.d.ts CHANGED
@@ -1,8 +1,230 @@
1
- import { TransactionReceipt } from 'viem';
2
- import React from 'react';
3
- import { TypedEvmNetworkConfig, WriteContractParameters, EvmContractDefinitionProviderKey } from '@openzeppelin/ui-builder-adapter-evm-core';
4
- export { AppInfo, EvmContractArtifacts, EvmRelayerTransactionOptions, RainbowKitConnectButtonProps, RainbowKitCustomizations, RainbowKitKitConfig, RainbowKitProviderProps, TypedEvmNetworkConfig, WriteContractParameters, abiComparisonService, extractRainbowKitCustomizations, isEvmContractArtifacts, isRainbowKitCustomizations } from '@openzeppelin/ui-builder-adapter-evm-core';
5
- import { WalletConnectionStatus, ContractAdapter, UiKitConfiguration, NetworkServiceForm, ContractSchema, ProxyInfo, FieldType, FunctionParameter, FormFieldType, ExecutionConfig, TxStatus, TransactionStatusUpdate, RelayerDetails, RelayerDetailsRich, ExecutionMethodDetail, ContractFunction, Connector, NativeConfigLoader, EcosystemReactUiProviderProps, EcosystemSpecificReactHooks, EcosystemWalletComponents, AvailableUiKit, UserRpcProviderConfig, UserExplorerConfig, TypeMappingInfo, AdapterConfig } from '@openzeppelin/ui-types';
1
+ import { EvmNetworkConfig, WalletConnectionStatus, ContractAdapter, UiKitConfiguration, NetworkServiceForm, ContractSchema, ProxyInfo, FieldType, FunctionParameter, FormFieldType, ExecutionConfig, TxStatus, TransactionStatusUpdate, RelayerDetails, RelayerDetailsRich, ExecutionMethodDetail, ContractFunction, Connector, NativeConfigLoader, EcosystemReactUiProviderProps, EcosystemSpecificReactHooks, EcosystemWalletComponents, AvailableUiKit, UserRpcProviderConfig, UserExplorerConfig, AccessControlService, TypeMappingInfo, EcosystemExport } from '@openzeppelin/ui-types';
2
+ export { ecosystemMetadata } from './metadata.js';
3
+ import { Chain, Abi, TransactionReceipt } from 'viem';
4
+ import React__default from 'react';
5
+ import { Speed } from '@openzeppelin/relayer-sdk';
6
+ import { RainbowKitProvider, ConnectButton } from '@rainbow-me/rainbowkit';
7
+
8
+ /**
9
+ * Defines the structure for parameters required to execute a contract write operation via viem.
10
+ */
11
+ interface WriteContractParameters {
12
+ address: `0x${string}`;
13
+ abi: Abi;
14
+ functionName: string;
15
+ args: unknown[];
16
+ value?: bigint;
17
+ }
18
+ /**
19
+ * EVM-specific network configuration with strict `ecosystem: 'evm'` constraint
20
+ * and strongly-typed viem `Chain` (narrowed from `unknown` in `EvmNetworkConfig`).
21
+ *
22
+ * Use this type in EVM-only contexts where you want strict ecosystem typing.
23
+ * For function signatures that should accept configs from multiple adapters
24
+ * (EVM, Polkadot, etc.), use `EvmCompatibleNetworkConfig` instead.
25
+ */
26
+ interface TypedEvmNetworkConfig extends EvmNetworkConfig {
27
+ viemChain?: Chain;
28
+ }
29
+
30
+ /**
31
+ * EVM Contract Definition Provider keys and ordering
32
+ * Avoid magic strings by using typed constants and a union type.
33
+ */
34
+ declare const EvmProviderKeys: {
35
+ readonly Etherscan: "etherscan";
36
+ readonly Sourcify: "sourcify";
37
+ };
38
+ type EvmContractDefinitionProviderKey = (typeof EvmProviderKeys)[keyof typeof EvmProviderKeys];
39
+
40
+ /**
41
+ * EVM-specific contract artifacts interface
42
+ * Defines the structure of data needed to load EVM contracts
43
+ */
44
+
45
+ interface EvmContractArtifacts {
46
+ /** The deployed contract address (required) */
47
+ contractAddress: string;
48
+ /** Optional manual ABI JSON string (for unverified contracts) */
49
+ contractDefinition?: string;
50
+ /** Optional proxy detection configuration */
51
+ __proxyDetectionOptions?: {
52
+ /** Skip automatic proxy detection */
53
+ skipProxyDetection?: boolean;
54
+ };
55
+ /** Optional forced provider for this load attempt (session-scoped override) */
56
+ __forcedProvider?: EvmContractDefinitionProviderKey;
57
+ }
58
+ /**
59
+ * Type guard to check if an object matches EvmContractArtifacts structure
60
+ */
61
+ declare function isEvmContractArtifacts(obj: unknown): obj is EvmContractArtifacts;
62
+
63
+ /**
64
+ * EVM-specific ABI types for comparison and validation
65
+ * Uses viem's Abi type as the foundation for type safety
66
+ */
67
+
68
+ /**
69
+ * Result of comparing two ABIs
70
+ */
71
+ interface AbiComparisonResult {
72
+ /** Whether the ABIs are identical after normalization */
73
+ identical: boolean;
74
+ /** List of differences found between the ABIs */
75
+ differences: AbiDifference[];
76
+ /** Overall severity of the changes */
77
+ severity: 'none' | 'minor' | 'major' | 'breaking';
78
+ /** Human-readable summary of the comparison */
79
+ summary: string;
80
+ }
81
+ /**
82
+ * Represents a single difference between two ABIs
83
+ */
84
+ interface AbiDifference {
85
+ /** Type of change */
86
+ type: 'added' | 'removed' | 'modified';
87
+ /** Which section of the ABI was affected */
88
+ section: 'function' | 'event' | 'constructor' | 'error' | 'fallback' | 'receive';
89
+ /** Name of the affected item (or type if no name) */
90
+ name: string;
91
+ /** Detailed description of the change */
92
+ details: string;
93
+ /** Impact level of this change */
94
+ impact: 'low' | 'medium' | 'high';
95
+ /** Signature before the change (for removed/modified) */
96
+ oldSignature?: string;
97
+ /** Signature after the change (for added/modified) */
98
+ newSignature?: string;
99
+ }
100
+ /**
101
+ * Result of validating an ABI structure
102
+ */
103
+ interface AbiValidationResult {
104
+ /** Whether the ABI is structurally valid */
105
+ valid: boolean;
106
+ /** List of validation errors found */
107
+ errors: string[];
108
+ /** List of validation warnings */
109
+ warnings: string[];
110
+ /** Normalized ABI if validation passed */
111
+ normalizedAbi?: Abi;
112
+ }
113
+
114
+ /**
115
+ * ABI comparison service for EVM contracts
116
+ * Provides detailed analysis of differences between ABIs
117
+ */
118
+
119
+ /**
120
+ * Service for comparing and validating EVM ABIs
121
+ */
122
+ declare class AbiComparisonService {
123
+ /**
124
+ * Compares two ABIs and returns detailed difference analysis
125
+ */
126
+ compareAbis(abi1: string, abi2: string): AbiComparisonResult;
127
+ /**
128
+ * Validates ABI structure and format
129
+ */
130
+ validateAbi(abiString: string): AbiValidationResult;
131
+ /**
132
+ * Creates deterministic hash of ABI for quick comparison
133
+ */
134
+ hashAbi(abiString: string): string;
135
+ /**
136
+ * Normalizes ABI for consistent comparison
137
+ */
138
+ private normalizeAbi;
139
+ /**
140
+ * Finds detailed differences between two normalized ABIs
141
+ */
142
+ private findDifferences;
143
+ private createAbiMap;
144
+ private generateItemKey;
145
+ private generateSignature;
146
+ private itemsEqual;
147
+ private calculateImpact;
148
+ private calculateSeverity;
149
+ private generateSummary;
150
+ }
151
+ declare const abiComparisonService: AbiComparisonService;
152
+
153
+ /**
154
+ * Relayer Execution Strategy
155
+ *
156
+ * Implements transaction execution through the OpenZeppelin Relayer service.
157
+ * This strategy sends transactions to a relayer for gas sponsorship and broadcasting.
158
+ */
159
+
160
+ /**
161
+ * EVM-specific transaction options for the OpenZeppelin Relayer.
162
+ * These options map directly to the EvmTransactionRequest parameters in the SDK.
163
+ */
164
+ interface EvmRelayerTransactionOptions {
165
+ speed?: Speed;
166
+ gasLimit?: number;
167
+ gasPrice?: number;
168
+ maxFeePerGas?: number;
169
+ maxPriorityFeePerGas?: number;
170
+ validUntil?: string;
171
+ }
172
+
173
+ /**
174
+ * Custom RainbowKit configuration types for enhanced UI control
175
+ */
176
+ /**
177
+ * Re-export RainbowKit's native types for ConnectButton props
178
+ * This ensures we use the exact same types that RainbowKit expects,
179
+ * reducing maintenance burden and letting RainbowKit handle type validation
180
+ */
181
+
182
+ /**
183
+ * Extract the `AppInfo` type from the RainbowKitProvider's props.
184
+ * This is the canonical way to get the type for the `appInfo` object.
185
+ */
186
+ type AppInfo = React.ComponentProps<typeof RainbowKitProvider>['appInfo'];
187
+ /**
188
+ * Extract the props type from RainbowKit's ConnectButton component
189
+ * This gives us the exact same types that RainbowKit uses internally
190
+ */
191
+ type RainbowKitConnectButtonProps$1 = React.ComponentProps<typeof ConnectButton>;
192
+ /**
193
+ * Represents the props expected by the RainbowKitProvider component.
194
+ * It uses a nested `appInfo` object.
195
+ */
196
+ interface RainbowKitProviderProps {
197
+ appInfo?: AppInfo;
198
+ [key: string]: unknown;
199
+ }
200
+ /**
201
+ * Represents the shape of the `kitConfig` object we use internally when the
202
+ * selected kit is RainbowKit. It has a flat structure for `appName` and `learnMoreUrl`
203
+ * for easier handling in our builder app, and can also contain pre-existing providerProps.
204
+ */
205
+ type RainbowKitKitConfig = Partial<AppInfo> & {
206
+ providerProps?: RainbowKitProviderProps;
207
+ [key: string]: unknown;
208
+ };
209
+ /**
210
+ * Custom UI configuration that uses RainbowKit's native types
211
+ * This extends our configuration system while leveraging RainbowKit's own type definitions
212
+ */
213
+ interface RainbowKitCustomizations {
214
+ /**
215
+ * Configuration for the RainbowKit ConnectButton component
216
+ * Uses RainbowKit's native prop types for type safety and compatibility
217
+ */
218
+ connectButton?: Partial<RainbowKitConnectButtonProps$1>;
219
+ }
220
+ /**
221
+ * Type guard to check if an object contains RainbowKit customizations
222
+ */
223
+ declare function isRainbowKitCustomizations(obj: unknown): obj is RainbowKitCustomizations;
224
+ /**
225
+ * Utility to extract RainbowKit customizations from a kit config
226
+ */
227
+ declare function extractRainbowKitCustomizations(kitConfig: Record<string, unknown> | undefined): RainbowKitCustomizations | undefined;
6
228
 
7
229
  /**
8
230
  * EVM-specific wallet connection status extending the base interface.
@@ -25,6 +247,12 @@ interface EvmWalletConnectionStatus extends WalletConnectionStatus {
25
247
  declare class EvmAdapter implements ContractAdapter {
26
248
  readonly networkConfig: TypedEvmNetworkConfig;
27
249
  readonly initialAppServiceKitName: UiKitConfiguration['kitName'];
250
+ /**
251
+ * Lazily initialized access control service (NFR-004).
252
+ * Created on the first call to `getAccessControlService()` to avoid
253
+ * unnecessary initialization overhead when access control is not used.
254
+ */
255
+ private accessControlService;
28
256
  constructor(networkConfig: TypedEvmNetworkConfig);
29
257
  /**
30
258
  * @inheritdoc
@@ -100,7 +328,7 @@ declare class EvmAdapter implements ContractAdapter {
100
328
  * Returns a React component for configuring EVM-specific relayer transaction options.
101
329
  * @returns The EVM relayer options component
102
330
  */
103
- getRelayerOptionsComponent(): React.ComponentType<{
331
+ getRelayerOptionsComponent(): React__default.ComponentType<{
104
332
  options: Record<string, unknown>;
105
333
  onChange: (options: Record<string, unknown>) => void;
106
334
  }> | undefined;
@@ -196,7 +424,7 @@ declare class EvmAdapter implements ContractAdapter {
196
424
  /**
197
425
  * @inheritdoc
198
426
  */
199
- getEcosystemReactUiContextProvider(): React.ComponentType<EcosystemReactUiProviderProps> | undefined;
427
+ getEcosystemReactUiContextProvider(): React__default.ComponentType<EcosystemReactUiProviderProps> | undefined;
200
428
  /**
201
429
  * @inheritdoc
202
430
  */
@@ -275,6 +503,18 @@ declare class EvmAdapter implements ContractAdapter {
275
503
  * @inheritdoc
276
504
  */
277
505
  hashContractDefinition(definition: string): string;
506
+ /**
507
+ * @inheritdoc
508
+ *
509
+ * Returns a lazily initialized `EvmAccessControlService` instance.
510
+ * The service is created on first call with an `executeTransaction` callback
511
+ * that wraps `signAndBroadcast`, decoupling the access control module from
512
+ * wallet/signing infrastructure.
513
+ *
514
+ * @returns The AccessControlService for this adapter's network
515
+ * @see research.md §R9 — Service Lifecycle and Transaction Execution
516
+ */
517
+ getAccessControlService(): AccessControlService;
278
518
  /**
279
519
  * @inheritdoc
280
520
  */
@@ -305,18 +545,6 @@ declare const zksyncSepoliaTestnet: TypedEvmNetworkConfig;
305
545
  declare const scrollSepolia: TypedEvmNetworkConfig;
306
546
  declare const lineaSepolia: TypedEvmNetworkConfig;
307
547
 
308
- declare const evmMainnetNetworks: TypedEvmNetworkConfig[];
309
- declare const evmTestnetNetworks: TypedEvmNetworkConfig[];
310
- declare const evmNetworks: TypedEvmNetworkConfig[];
311
-
312
- /**
313
- * Configuration for the EVM adapter
314
- *
315
- * This file defines the dependencies required by the EVM adapter
316
- * when generating exported projects. It follows the AdapterConfig
317
- * interface to provide a structured approach to dependency management.
318
- */
319
-
320
- declare const evmAdapterConfig: AdapterConfig;
548
+ declare const ecosystemDefinition: EcosystemExport;
321
549
 
322
- export { EvmAdapter, arbitrumMainnet, arbitrumSepolia, avalancheFuji, avalancheMainnet, baseMainnet, baseSepolia, bscMainnet, bscTestnet, ethereumMainnet, ethereumSepolia, evmAdapterConfig, evmMainnetNetworks, evmNetworks, evmTestnetNetworks, lineaMainnet, lineaSepolia, optimismMainnet, optimismSepolia, polygonAmoy, polygonMainnet, polygonZkEvmCardona, polygonZkEvmMainnet, scrollMainnet, scrollSepolia, zkSyncEraMainnet, zksyncSepoliaTestnet };
550
+ export { type AppInfo, EvmAdapter, type EvmContractArtifacts, type EvmRelayerTransactionOptions, type RainbowKitConnectButtonProps$1 as RainbowKitConnectButtonProps, type RainbowKitCustomizations, type RainbowKitKitConfig, type RainbowKitProviderProps, type TypedEvmNetworkConfig, type WriteContractParameters, abiComparisonService, arbitrumMainnet, arbitrumSepolia, avalancheFuji, avalancheMainnet, baseMainnet, baseSepolia, bscMainnet, bscTestnet, ecosystemDefinition, ethereumMainnet, ethereumSepolia, extractRainbowKitCustomizations, isEvmContractArtifacts, isRainbowKitCustomizations, lineaMainnet, lineaSepolia, optimismMainnet, optimismSepolia, polygonAmoy, polygonMainnet, polygonZkEvmCardona, polygonZkEvmMainnet, scrollMainnet, scrollSepolia, zkSyncEraMainnet, zksyncSepoliaTestnet };