@gitmyabi/fxcacheroottunnel 1.0.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 +108 -0
- package/contracts/FxCacheRootTunnel_json.d.ts +534 -0
- package/contracts/FxCacheRootTunnel_json.js +581 -0
- package/contracts/FxCacheRootTunnel_json.ts +708 -0
- package/contracts/index.d.ts +2 -0
- package/contracts/index.js +7 -0
- package/contracts/index.ts +3 -0
- package/index.d.ts +1 -0
- package/index.js +19 -0
- package/package.json +43 -0
package/README.md
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# @gitmyabi/fxcacheroottunnel
|
|
2
|
+
|
|
3
|
+
Auto-generated TypeScript type bindings for **FxCacheRootTunnel**
|
|
4
|
+
|
|
5
|
+
- **Build ID**: `etherscan-fxcacheroottunnel-309111b4-1789238455579`
|
|
6
|
+
- **Build Number**: 1
|
|
7
|
+
- **Commit**: `d4752a1`
|
|
8
|
+
- **Branch**: `etherscan`
|
|
9
|
+
- **Target**: `ethers-v6`
|
|
10
|
+
- **Contracts**: 1
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm install @gitmyabi/fxcacheroottunnel@1.0.0
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Usage
|
|
19
|
+
|
|
20
|
+
### Class-based API (TypeChain-like)
|
|
21
|
+
|
|
22
|
+
```typescript
|
|
23
|
+
import { createPublicClient, createWalletClient, http } from 'viem';
|
|
24
|
+
import { mainnet } from 'viem/chains';
|
|
25
|
+
import { YourContract } from '@gitmyabi/fxcacheroottunnel';
|
|
26
|
+
|
|
27
|
+
const publicClient = createPublicClient({ chain: mainnet, transport: http() });
|
|
28
|
+
const walletClient = createWalletClient({ chain: mainnet, transport: http() });
|
|
29
|
+
|
|
30
|
+
// Create contract instance
|
|
31
|
+
const contract = new YourContract('0x...', { publicClient, walletClient });
|
|
32
|
+
|
|
33
|
+
// Read functions - call directly like TypeChain!
|
|
34
|
+
const result = await contract.yourMethod(param1, param2);
|
|
35
|
+
|
|
36
|
+
// Write functions - also call directly!
|
|
37
|
+
const hash = await contract.transfer('0x...', 1000n);
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### With viem directly
|
|
41
|
+
|
|
42
|
+
```typescript
|
|
43
|
+
import { createPublicClient, http } from 'viem';
|
|
44
|
+
import { mainnet } from 'viem/chains';
|
|
45
|
+
import { YourContractAbi } from '@gitmyabi/fxcacheroottunnel';
|
|
46
|
+
|
|
47
|
+
const client = createPublicClient({
|
|
48
|
+
chain: mainnet,
|
|
49
|
+
transport: http(),
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
// Fully typed contract read
|
|
53
|
+
const result = await client.readContract({
|
|
54
|
+
address: '0x...',
|
|
55
|
+
abi: YourContractAbi,
|
|
56
|
+
functionName: 'yourMethod',
|
|
57
|
+
args: [param1, param2],
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
// Fully typed contract write
|
|
61
|
+
const hash = await client.writeContract({
|
|
62
|
+
address: '0x...',
|
|
63
|
+
abi: YourContractAbi,
|
|
64
|
+
functionName: 'yourMethod',
|
|
65
|
+
args: [param1, param2],
|
|
66
|
+
});
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### With wagmi
|
|
70
|
+
|
|
71
|
+
```typescript
|
|
72
|
+
import { useReadContract, useWriteContract } from 'wagmi';
|
|
73
|
+
import { YourContractAbi } from '@gitmyabi/fxcacheroottunnel';
|
|
74
|
+
|
|
75
|
+
function MyComponent() {
|
|
76
|
+
const { data } = useReadContract({
|
|
77
|
+
address: '0x...',
|
|
78
|
+
abi: YourContractAbi,
|
|
79
|
+
functionName: 'yourMethod',
|
|
80
|
+
args: [param1, param2],
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
const { writeContract } = useWriteContract();
|
|
84
|
+
|
|
85
|
+
const handleWrite = () => {
|
|
86
|
+
writeContract({
|
|
87
|
+
address: '0x...',
|
|
88
|
+
abi: YourContractAbi,
|
|
89
|
+
functionName: 'yourMethod',
|
|
90
|
+
args: [param1, param2],
|
|
91
|
+
});
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
return <button onClick={handleWrite}>Call Contract</button>;
|
|
95
|
+
}
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Type Safety
|
|
99
|
+
|
|
100
|
+
This package provides full TypeScript type safety for all contract methods, events, and parameters using viem's type system. All ABIs are exported as `const` assertions for maximum type inference.
|
|
101
|
+
|
|
102
|
+
## Generated Contracts
|
|
103
|
+
|
|
104
|
+
This package includes type bindings for 1 contract(s) generated from ABI artifacts.
|
|
105
|
+
|
|
106
|
+
## License
|
|
107
|
+
|
|
108
|
+
MIT
|
|
@@ -0,0 +1,534 @@
|
|
|
1
|
+
import type { Address, PublicClient, WalletClient } from 'viem';
|
|
2
|
+
/**
|
|
3
|
+
* FxCacheRootTunnel_json ABI
|
|
4
|
+
*
|
|
5
|
+
* This ABI is typed using viem's type system for full type safety.
|
|
6
|
+
*/
|
|
7
|
+
export declare const FxCacheRootTunnel_jsonAbi: readonly [{
|
|
8
|
+
readonly inputs: readonly [{
|
|
9
|
+
readonly internalType: "address";
|
|
10
|
+
readonly name: "_checkpointManager";
|
|
11
|
+
readonly type: "address";
|
|
12
|
+
}, {
|
|
13
|
+
readonly internalType: "address";
|
|
14
|
+
readonly name: "_fxRoot";
|
|
15
|
+
readonly type: "address";
|
|
16
|
+
}];
|
|
17
|
+
readonly stateMutability: "nonpayable";
|
|
18
|
+
readonly type: "constructor";
|
|
19
|
+
}, {
|
|
20
|
+
readonly anonymous: false;
|
|
21
|
+
readonly inputs: readonly [{
|
|
22
|
+
readonly indexed: true;
|
|
23
|
+
readonly internalType: "address";
|
|
24
|
+
readonly name: "rootToken";
|
|
25
|
+
readonly type: "address";
|
|
26
|
+
}, {
|
|
27
|
+
readonly indexed: true;
|
|
28
|
+
readonly internalType: "address";
|
|
29
|
+
readonly name: "depositor";
|
|
30
|
+
readonly type: "address";
|
|
31
|
+
}, {
|
|
32
|
+
readonly indexed: true;
|
|
33
|
+
readonly internalType: "address";
|
|
34
|
+
readonly name: "userAddress";
|
|
35
|
+
readonly type: "address";
|
|
36
|
+
}, {
|
|
37
|
+
readonly indexed: false;
|
|
38
|
+
readonly internalType: "uint256";
|
|
39
|
+
readonly name: "amount";
|
|
40
|
+
readonly type: "uint256";
|
|
41
|
+
}];
|
|
42
|
+
readonly name: "FxDepositERC20";
|
|
43
|
+
readonly type: "event";
|
|
44
|
+
}, {
|
|
45
|
+
readonly anonymous: false;
|
|
46
|
+
readonly inputs: readonly [{
|
|
47
|
+
readonly indexed: true;
|
|
48
|
+
readonly internalType: "address";
|
|
49
|
+
readonly name: "rootToken";
|
|
50
|
+
readonly type: "address";
|
|
51
|
+
}, {
|
|
52
|
+
readonly indexed: true;
|
|
53
|
+
readonly internalType: "address";
|
|
54
|
+
readonly name: "childToken";
|
|
55
|
+
readonly type: "address";
|
|
56
|
+
}, {
|
|
57
|
+
readonly indexed: true;
|
|
58
|
+
readonly internalType: "address";
|
|
59
|
+
readonly name: "userAddress";
|
|
60
|
+
readonly type: "address";
|
|
61
|
+
}, {
|
|
62
|
+
readonly indexed: false;
|
|
63
|
+
readonly internalType: "uint256";
|
|
64
|
+
readonly name: "amount";
|
|
65
|
+
readonly type: "uint256";
|
|
66
|
+
}];
|
|
67
|
+
readonly name: "FxWithdrawERC20";
|
|
68
|
+
readonly type: "event";
|
|
69
|
+
}, {
|
|
70
|
+
readonly anonymous: false;
|
|
71
|
+
readonly inputs: readonly [{
|
|
72
|
+
readonly indexed: true;
|
|
73
|
+
readonly internalType: "address";
|
|
74
|
+
readonly name: "rootToken";
|
|
75
|
+
readonly type: "address";
|
|
76
|
+
}, {
|
|
77
|
+
readonly indexed: true;
|
|
78
|
+
readonly internalType: "address";
|
|
79
|
+
readonly name: "childToken";
|
|
80
|
+
readonly type: "address";
|
|
81
|
+
}];
|
|
82
|
+
readonly name: "TokenMappedERC20";
|
|
83
|
+
readonly type: "event";
|
|
84
|
+
}, {
|
|
85
|
+
readonly inputs: readonly [];
|
|
86
|
+
readonly name: "DEPOSIT";
|
|
87
|
+
readonly outputs: readonly [{
|
|
88
|
+
readonly internalType: "bytes32";
|
|
89
|
+
readonly name: "";
|
|
90
|
+
readonly type: "bytes32";
|
|
91
|
+
}];
|
|
92
|
+
readonly stateMutability: "view";
|
|
93
|
+
readonly type: "function";
|
|
94
|
+
}, {
|
|
95
|
+
readonly inputs: readonly [];
|
|
96
|
+
readonly name: "MAP_TOKEN";
|
|
97
|
+
readonly outputs: readonly [{
|
|
98
|
+
readonly internalType: "bytes32";
|
|
99
|
+
readonly name: "";
|
|
100
|
+
readonly type: "bytes32";
|
|
101
|
+
}];
|
|
102
|
+
readonly stateMutability: "view";
|
|
103
|
+
readonly type: "function";
|
|
104
|
+
}, {
|
|
105
|
+
readonly inputs: readonly [];
|
|
106
|
+
readonly name: "SEND_MESSAGE_EVENT_SIG";
|
|
107
|
+
readonly outputs: readonly [{
|
|
108
|
+
readonly internalType: "bytes32";
|
|
109
|
+
readonly name: "";
|
|
110
|
+
readonly type: "bytes32";
|
|
111
|
+
}];
|
|
112
|
+
readonly stateMutability: "view";
|
|
113
|
+
readonly type: "function";
|
|
114
|
+
}, {
|
|
115
|
+
readonly inputs: readonly [];
|
|
116
|
+
readonly name: "checkpointManager";
|
|
117
|
+
readonly outputs: readonly [{
|
|
118
|
+
readonly internalType: "contract ICheckpointManager";
|
|
119
|
+
readonly name: "";
|
|
120
|
+
readonly type: "address";
|
|
121
|
+
}];
|
|
122
|
+
readonly stateMutability: "view";
|
|
123
|
+
readonly type: "function";
|
|
124
|
+
}, {
|
|
125
|
+
readonly inputs: readonly [{
|
|
126
|
+
readonly internalType: "address";
|
|
127
|
+
readonly name: "rootToken";
|
|
128
|
+
readonly type: "address";
|
|
129
|
+
}, {
|
|
130
|
+
readonly internalType: "address";
|
|
131
|
+
readonly name: "childToken";
|
|
132
|
+
readonly type: "address";
|
|
133
|
+
}, {
|
|
134
|
+
readonly internalType: "address";
|
|
135
|
+
readonly name: "user";
|
|
136
|
+
readonly type: "address";
|
|
137
|
+
}, {
|
|
138
|
+
readonly internalType: "uint256";
|
|
139
|
+
readonly name: "amount";
|
|
140
|
+
readonly type: "uint256";
|
|
141
|
+
}, {
|
|
142
|
+
readonly internalType: "bytes";
|
|
143
|
+
readonly name: "data";
|
|
144
|
+
readonly type: "bytes";
|
|
145
|
+
}];
|
|
146
|
+
readonly name: "deposit";
|
|
147
|
+
readonly outputs: readonly [];
|
|
148
|
+
readonly stateMutability: "nonpayable";
|
|
149
|
+
readonly type: "function";
|
|
150
|
+
}, {
|
|
151
|
+
readonly inputs: readonly [];
|
|
152
|
+
readonly name: "fxChildTunnel";
|
|
153
|
+
readonly outputs: readonly [{
|
|
154
|
+
readonly internalType: "address";
|
|
155
|
+
readonly name: "";
|
|
156
|
+
readonly type: "address";
|
|
157
|
+
}];
|
|
158
|
+
readonly stateMutability: "view";
|
|
159
|
+
readonly type: "function";
|
|
160
|
+
}, {
|
|
161
|
+
readonly inputs: readonly [];
|
|
162
|
+
readonly name: "fxRoot";
|
|
163
|
+
readonly outputs: readonly [{
|
|
164
|
+
readonly internalType: "contract IFxStateSender";
|
|
165
|
+
readonly name: "";
|
|
166
|
+
readonly type: "address";
|
|
167
|
+
}];
|
|
168
|
+
readonly stateMutability: "view";
|
|
169
|
+
readonly type: "function";
|
|
170
|
+
}, {
|
|
171
|
+
readonly inputs: readonly [{
|
|
172
|
+
readonly internalType: "address";
|
|
173
|
+
readonly name: "rootToken";
|
|
174
|
+
readonly type: "address";
|
|
175
|
+
}, {
|
|
176
|
+
readonly internalType: "address";
|
|
177
|
+
readonly name: "_childToken";
|
|
178
|
+
readonly type: "address";
|
|
179
|
+
}];
|
|
180
|
+
readonly name: "mapToken";
|
|
181
|
+
readonly outputs: readonly [];
|
|
182
|
+
readonly stateMutability: "nonpayable";
|
|
183
|
+
readonly type: "function";
|
|
184
|
+
}, {
|
|
185
|
+
readonly inputs: readonly [{
|
|
186
|
+
readonly internalType: "bytes32";
|
|
187
|
+
readonly name: "";
|
|
188
|
+
readonly type: "bytes32";
|
|
189
|
+
}];
|
|
190
|
+
readonly name: "processedExits";
|
|
191
|
+
readonly outputs: readonly [{
|
|
192
|
+
readonly internalType: "bool";
|
|
193
|
+
readonly name: "";
|
|
194
|
+
readonly type: "bool";
|
|
195
|
+
}];
|
|
196
|
+
readonly stateMutability: "view";
|
|
197
|
+
readonly type: "function";
|
|
198
|
+
}, {
|
|
199
|
+
readonly inputs: readonly [{
|
|
200
|
+
readonly internalType: "bytes";
|
|
201
|
+
readonly name: "inputData";
|
|
202
|
+
readonly type: "bytes";
|
|
203
|
+
}];
|
|
204
|
+
readonly name: "receiveMessage";
|
|
205
|
+
readonly outputs: readonly [];
|
|
206
|
+
readonly stateMutability: "nonpayable";
|
|
207
|
+
readonly type: "function";
|
|
208
|
+
}, {
|
|
209
|
+
readonly inputs: readonly [{
|
|
210
|
+
readonly internalType: "address";
|
|
211
|
+
readonly name: "";
|
|
212
|
+
readonly type: "address";
|
|
213
|
+
}];
|
|
214
|
+
readonly name: "rootToChildTokens";
|
|
215
|
+
readonly outputs: readonly [{
|
|
216
|
+
readonly internalType: "address";
|
|
217
|
+
readonly name: "";
|
|
218
|
+
readonly type: "address";
|
|
219
|
+
}];
|
|
220
|
+
readonly stateMutability: "view";
|
|
221
|
+
readonly type: "function";
|
|
222
|
+
}, {
|
|
223
|
+
readonly inputs: readonly [{
|
|
224
|
+
readonly internalType: "address";
|
|
225
|
+
readonly name: "_fxChildTunnel";
|
|
226
|
+
readonly type: "address";
|
|
227
|
+
}];
|
|
228
|
+
readonly name: "setFxChildTunnel";
|
|
229
|
+
readonly outputs: readonly [];
|
|
230
|
+
readonly stateMutability: "nonpayable";
|
|
231
|
+
readonly type: "function";
|
|
232
|
+
}];
|
|
233
|
+
/**
|
|
234
|
+
* Type-safe ABI for FxCacheRootTunnel_json
|
|
235
|
+
*/
|
|
236
|
+
export type FxCacheRootTunnel_jsonAbi = typeof FxCacheRootTunnel_jsonAbi;
|
|
237
|
+
/**
|
|
238
|
+
* Contract instance type for FxCacheRootTunnel_json
|
|
239
|
+
*/
|
|
240
|
+
export type FxCacheRootTunnel_jsonContract = any;
|
|
241
|
+
/**
|
|
242
|
+
* FxCacheRootTunnel_json Contract Class
|
|
243
|
+
*
|
|
244
|
+
* Provides a class-based API similar to TypeChain for interacting with the contract.
|
|
245
|
+
*
|
|
246
|
+
* @example
|
|
247
|
+
* ```typescript
|
|
248
|
+
* import { createPublicClient, createWalletClient, http } from 'viem';
|
|
249
|
+
* import { mainnet } from 'viem/chains';
|
|
250
|
+
* import { FxCacheRootTunnel_json } from 'FxCacheRootTunnel_json';
|
|
251
|
+
*
|
|
252
|
+
* const publicClient = createPublicClient({ chain: mainnet, transport: http() });
|
|
253
|
+
* const walletClient = createWalletClient({ chain: mainnet, transport: http() });
|
|
254
|
+
*
|
|
255
|
+
* const contract = new FxCacheRootTunnel_json('0x...', { publicClient, walletClient });
|
|
256
|
+
*
|
|
257
|
+
* // Read functions
|
|
258
|
+
* const result = await contract.balanceOf('0x...');
|
|
259
|
+
*
|
|
260
|
+
* // Write functions
|
|
261
|
+
* const hash = await contract.transfer('0x...', 1000n);
|
|
262
|
+
*
|
|
263
|
+
* // Simulate transactions (dry-run)
|
|
264
|
+
* const simulation = await contract.simulate.transfer('0x...', 1000n);
|
|
265
|
+
* console.log('Gas estimate:', simulation.request.gas);
|
|
266
|
+
*
|
|
267
|
+
* // Watch events
|
|
268
|
+
* const unwatch = contract.watch.Transfer((event) => {
|
|
269
|
+
* console.log('Transfer event:', event);
|
|
270
|
+
* });
|
|
271
|
+
* ```
|
|
272
|
+
*/
|
|
273
|
+
export declare class FxCacheRootTunnel_json {
|
|
274
|
+
private contract;
|
|
275
|
+
private contractAddress;
|
|
276
|
+
private publicClient;
|
|
277
|
+
constructor(address: Address, clients: {
|
|
278
|
+
publicClient: PublicClient;
|
|
279
|
+
walletClient?: WalletClient;
|
|
280
|
+
});
|
|
281
|
+
/**
|
|
282
|
+
* Get the contract address
|
|
283
|
+
*/
|
|
284
|
+
get address(): Address;
|
|
285
|
+
/**
|
|
286
|
+
* Get the underlying viem contract instance
|
|
287
|
+
*/
|
|
288
|
+
getContract(): FxCacheRootTunnel_jsonContract;
|
|
289
|
+
/**
|
|
290
|
+
* DEPOSIT
|
|
291
|
+
* view
|
|
292
|
+
*/
|
|
293
|
+
DEPOSIT(): Promise<`0x${string}`>;
|
|
294
|
+
/**
|
|
295
|
+
* MAP_TOKEN
|
|
296
|
+
* view
|
|
297
|
+
*/
|
|
298
|
+
MAP_TOKEN(): Promise<`0x${string}`>;
|
|
299
|
+
/**
|
|
300
|
+
* SEND_MESSAGE_EVENT_SIG
|
|
301
|
+
* view
|
|
302
|
+
*/
|
|
303
|
+
SEND_MESSAGE_EVENT_SIG(): Promise<`0x${string}`>;
|
|
304
|
+
/**
|
|
305
|
+
* checkpointManager
|
|
306
|
+
* view
|
|
307
|
+
*/
|
|
308
|
+
checkpointManager(): Promise<`0x${string}`>;
|
|
309
|
+
/**
|
|
310
|
+
* fxChildTunnel
|
|
311
|
+
* view
|
|
312
|
+
*/
|
|
313
|
+
fxChildTunnel(): Promise<`0x${string}`>;
|
|
314
|
+
/**
|
|
315
|
+
* fxRoot
|
|
316
|
+
* view
|
|
317
|
+
*/
|
|
318
|
+
fxRoot(): Promise<`0x${string}`>;
|
|
319
|
+
/**
|
|
320
|
+
* processedExits
|
|
321
|
+
* view
|
|
322
|
+
*/
|
|
323
|
+
processedExits(arg0: `0x${string}`): Promise<boolean>;
|
|
324
|
+
/**
|
|
325
|
+
* rootToChildTokens
|
|
326
|
+
* view
|
|
327
|
+
*/
|
|
328
|
+
rootToChildTokens(arg0: `0x${string}`): Promise<`0x${string}`>;
|
|
329
|
+
/**
|
|
330
|
+
* deposit
|
|
331
|
+
* nonpayable
|
|
332
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
333
|
+
*/
|
|
334
|
+
deposit(rootToken: `0x${string}`, childToken: `0x${string}`, user: `0x${string}`, amount: bigint, data: `0x${string}`, options?: {
|
|
335
|
+
accessList?: import('viem').AccessList;
|
|
336
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
337
|
+
chain?: import('viem').Chain | null;
|
|
338
|
+
dataSuffix?: `0x${string}`;
|
|
339
|
+
gas?: bigint;
|
|
340
|
+
gasPrice?: bigint;
|
|
341
|
+
maxFeePerGas?: bigint;
|
|
342
|
+
maxPriorityFeePerGas?: bigint;
|
|
343
|
+
nonce?: number;
|
|
344
|
+
value?: bigint;
|
|
345
|
+
}): Promise<`0x${string}`>;
|
|
346
|
+
/**
|
|
347
|
+
* mapToken
|
|
348
|
+
* nonpayable
|
|
349
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
350
|
+
*/
|
|
351
|
+
mapToken(rootToken: `0x${string}`, _childToken: `0x${string}`, options?: {
|
|
352
|
+
accessList?: import('viem').AccessList;
|
|
353
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
354
|
+
chain?: import('viem').Chain | null;
|
|
355
|
+
dataSuffix?: `0x${string}`;
|
|
356
|
+
gas?: bigint;
|
|
357
|
+
gasPrice?: bigint;
|
|
358
|
+
maxFeePerGas?: bigint;
|
|
359
|
+
maxPriorityFeePerGas?: bigint;
|
|
360
|
+
nonce?: number;
|
|
361
|
+
value?: bigint;
|
|
362
|
+
}): Promise<`0x${string}`>;
|
|
363
|
+
/**
|
|
364
|
+
* receiveMessage
|
|
365
|
+
* nonpayable
|
|
366
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
367
|
+
*/
|
|
368
|
+
receiveMessage(inputData: `0x${string}`, options?: {
|
|
369
|
+
accessList?: import('viem').AccessList;
|
|
370
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
371
|
+
chain?: import('viem').Chain | null;
|
|
372
|
+
dataSuffix?: `0x${string}`;
|
|
373
|
+
gas?: bigint;
|
|
374
|
+
gasPrice?: bigint;
|
|
375
|
+
maxFeePerGas?: bigint;
|
|
376
|
+
maxPriorityFeePerGas?: bigint;
|
|
377
|
+
nonce?: number;
|
|
378
|
+
value?: bigint;
|
|
379
|
+
}): Promise<`0x${string}`>;
|
|
380
|
+
/**
|
|
381
|
+
* setFxChildTunnel
|
|
382
|
+
* nonpayable
|
|
383
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
384
|
+
*/
|
|
385
|
+
setFxChildTunnel(_fxChildTunnel: `0x${string}`, options?: {
|
|
386
|
+
accessList?: import('viem').AccessList;
|
|
387
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
388
|
+
chain?: import('viem').Chain | null;
|
|
389
|
+
dataSuffix?: `0x${string}`;
|
|
390
|
+
gas?: bigint;
|
|
391
|
+
gasPrice?: bigint;
|
|
392
|
+
maxFeePerGas?: bigint;
|
|
393
|
+
maxPriorityFeePerGas?: bigint;
|
|
394
|
+
nonce?: number;
|
|
395
|
+
value?: bigint;
|
|
396
|
+
}): Promise<`0x${string}`>;
|
|
397
|
+
/**
|
|
398
|
+
* Simulate contract write operations (dry-run without sending transaction)
|
|
399
|
+
*
|
|
400
|
+
* @example
|
|
401
|
+
* const result = await contract.simulate.transfer('0x...', 1000n);
|
|
402
|
+
* console.log('Gas estimate:', result.request.gas);
|
|
403
|
+
* console.log('Would succeed:', result.result);
|
|
404
|
+
*/
|
|
405
|
+
get simulate(): {
|
|
406
|
+
/**
|
|
407
|
+
* Simulate deposit
|
|
408
|
+
* Returns gas estimate and result without sending transaction
|
|
409
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
410
|
+
*/
|
|
411
|
+
deposit(rootToken: `0x${string}`, childToken: `0x${string}`, user: `0x${string}`, amount: bigint, data: `0x${string}`, options?: {
|
|
412
|
+
accessList?: import("viem").AccessList;
|
|
413
|
+
authorizationList?: import("viem").AuthorizationList;
|
|
414
|
+
chain?: import("viem").Chain | null;
|
|
415
|
+
dataSuffix?: `0x${string}`;
|
|
416
|
+
gas?: bigint;
|
|
417
|
+
gasPrice?: bigint;
|
|
418
|
+
maxFeePerGas?: bigint;
|
|
419
|
+
maxPriorityFeePerGas?: bigint;
|
|
420
|
+
nonce?: number;
|
|
421
|
+
value?: bigint;
|
|
422
|
+
}): Promise<void>;
|
|
423
|
+
/**
|
|
424
|
+
* Simulate mapToken
|
|
425
|
+
* Returns gas estimate and result without sending transaction
|
|
426
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
427
|
+
*/
|
|
428
|
+
mapToken(rootToken: `0x${string}`, _childToken: `0x${string}`, options?: {
|
|
429
|
+
accessList?: import("viem").AccessList;
|
|
430
|
+
authorizationList?: import("viem").AuthorizationList;
|
|
431
|
+
chain?: import("viem").Chain | null;
|
|
432
|
+
dataSuffix?: `0x${string}`;
|
|
433
|
+
gas?: bigint;
|
|
434
|
+
gasPrice?: bigint;
|
|
435
|
+
maxFeePerGas?: bigint;
|
|
436
|
+
maxPriorityFeePerGas?: bigint;
|
|
437
|
+
nonce?: number;
|
|
438
|
+
value?: bigint;
|
|
439
|
+
}): Promise<void>;
|
|
440
|
+
/**
|
|
441
|
+
* Simulate receiveMessage
|
|
442
|
+
* Returns gas estimate and result without sending transaction
|
|
443
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
444
|
+
*/
|
|
445
|
+
receiveMessage(inputData: `0x${string}`, options?: {
|
|
446
|
+
accessList?: import("viem").AccessList;
|
|
447
|
+
authorizationList?: import("viem").AuthorizationList;
|
|
448
|
+
chain?: import("viem").Chain | null;
|
|
449
|
+
dataSuffix?: `0x${string}`;
|
|
450
|
+
gas?: bigint;
|
|
451
|
+
gasPrice?: bigint;
|
|
452
|
+
maxFeePerGas?: bigint;
|
|
453
|
+
maxPriorityFeePerGas?: bigint;
|
|
454
|
+
nonce?: number;
|
|
455
|
+
value?: bigint;
|
|
456
|
+
}): Promise<void>;
|
|
457
|
+
/**
|
|
458
|
+
* Simulate setFxChildTunnel
|
|
459
|
+
* Returns gas estimate and result without sending transaction
|
|
460
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
461
|
+
*/
|
|
462
|
+
setFxChildTunnel(_fxChildTunnel: `0x${string}`, options?: {
|
|
463
|
+
accessList?: import("viem").AccessList;
|
|
464
|
+
authorizationList?: import("viem").AuthorizationList;
|
|
465
|
+
chain?: import("viem").Chain | null;
|
|
466
|
+
dataSuffix?: `0x${string}`;
|
|
467
|
+
gas?: bigint;
|
|
468
|
+
gasPrice?: bigint;
|
|
469
|
+
maxFeePerGas?: bigint;
|
|
470
|
+
maxPriorityFeePerGas?: bigint;
|
|
471
|
+
nonce?: number;
|
|
472
|
+
value?: bigint;
|
|
473
|
+
}): Promise<void>;
|
|
474
|
+
};
|
|
475
|
+
/**
|
|
476
|
+
* Watch contract events
|
|
477
|
+
*
|
|
478
|
+
* @example
|
|
479
|
+
* // Watch all Transfer events
|
|
480
|
+
* const unwatch = contract.watch.Transfer((event) => {
|
|
481
|
+
* console.log('Transfer:', event);
|
|
482
|
+
* });
|
|
483
|
+
*
|
|
484
|
+
* // Stop watching
|
|
485
|
+
* unwatch();
|
|
486
|
+
*/
|
|
487
|
+
get watch(): {
|
|
488
|
+
/**
|
|
489
|
+
* Watch FxDepositERC20 events
|
|
490
|
+
* @param callback Function to call when event is emitted
|
|
491
|
+
* @param filter Optional filter for indexed parameters
|
|
492
|
+
* @returns Unwatch function to stop listening
|
|
493
|
+
*/
|
|
494
|
+
FxDepositERC20: (callback: (event: {
|
|
495
|
+
rootToken: `0x${string}`;
|
|
496
|
+
depositor: `0x${string}`;
|
|
497
|
+
userAddress: `0x${string}`;
|
|
498
|
+
amount: bigint;
|
|
499
|
+
}) => void, filter?: {
|
|
500
|
+
rootToken: `0x${string}`;
|
|
501
|
+
depositor: `0x${string}`;
|
|
502
|
+
userAddress: `0x${string}`;
|
|
503
|
+
}) => () => void;
|
|
504
|
+
/**
|
|
505
|
+
* Watch FxWithdrawERC20 events
|
|
506
|
+
* @param callback Function to call when event is emitted
|
|
507
|
+
* @param filter Optional filter for indexed parameters
|
|
508
|
+
* @returns Unwatch function to stop listening
|
|
509
|
+
*/
|
|
510
|
+
FxWithdrawERC20: (callback: (event: {
|
|
511
|
+
rootToken: `0x${string}`;
|
|
512
|
+
childToken: `0x${string}`;
|
|
513
|
+
userAddress: `0x${string}`;
|
|
514
|
+
amount: bigint;
|
|
515
|
+
}) => void, filter?: {
|
|
516
|
+
rootToken: `0x${string}`;
|
|
517
|
+
childToken: `0x${string}`;
|
|
518
|
+
userAddress: `0x${string}`;
|
|
519
|
+
}) => () => void;
|
|
520
|
+
/**
|
|
521
|
+
* Watch TokenMappedERC20 events
|
|
522
|
+
* @param callback Function to call when event is emitted
|
|
523
|
+
* @param filter Optional filter for indexed parameters
|
|
524
|
+
* @returns Unwatch function to stop listening
|
|
525
|
+
*/
|
|
526
|
+
TokenMappedERC20: (callback: (event: {
|
|
527
|
+
rootToken: `0x${string}`;
|
|
528
|
+
childToken: `0x${string}`;
|
|
529
|
+
}) => void, filter?: {
|
|
530
|
+
rootToken: `0x${string}`;
|
|
531
|
+
childToken: `0x${string}`;
|
|
532
|
+
}) => () => void;
|
|
533
|
+
};
|
|
534
|
+
}
|