@rungate/llmrouter 0.1.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 +97 -0
- package/dist/scripts/proxy.d.ts +1 -0
- package/dist/scripts/proxy.js +3 -0
- package/dist/src/index.d.ts +6 -0
- package/dist/src/index.js +5 -0
- package/dist/src/openclaw/config.d.ts +1 -0
- package/dist/src/openclaw/config.js +38 -0
- package/dist/src/openclaw/plugin.d.ts +30 -0
- package/dist/src/openclaw/plugin.js +47 -0
- package/dist/src/openclaw/runtime.d.ts +8 -0
- package/dist/src/openclaw/runtime.js +86 -0
- package/dist/src/payment/network.d.ts +619 -0
- package/dist/src/payment/network.js +16 -0
- package/dist/src/payment/wallet.d.ts +7 -0
- package/dist/src/payment/wallet.js +96 -0
- package/dist/src/payment/x402.d.ts +4 -0
- package/dist/src/payment/x402.js +37 -0
- package/dist/src/proxy/openai.d.ts +12 -0
- package/dist/src/proxy/openai.js +33 -0
- package/dist/src/proxy/server.d.ts +11 -0
- package/dist/src/proxy/server.js +206 -0
- package/dist/src/router/classify.d.ts +3 -0
- package/dist/src/router/classify.js +81 -0
- package/dist/src/router/models.d.ts +4 -0
- package/dist/src/router/models.js +27 -0
- package/dist/src/router/normalize.d.ts +1 -0
- package/dist/src/router/normalize.js +63 -0
- package/dist/src/router/route.d.ts +2 -0
- package/dist/src/router/route.js +25 -0
- package/dist/src/types.d.ts +65 -0
- package/dist/src/types.js +1 -0
- package/openclaw.plugin.json +11 -0
- package/package.json +55 -0
|
@@ -0,0 +1,619 @@
|
|
|
1
|
+
export declare const DEFAULT_X402_NETWORK = "eip155:84532";
|
|
2
|
+
export declare function resolveConfiguredNetwork(network?: string): string;
|
|
3
|
+
export declare function resolveChain(network: string): {
|
|
4
|
+
blockExplorers: {
|
|
5
|
+
readonly default: {
|
|
6
|
+
readonly name: "Basescan";
|
|
7
|
+
readonly url: "https://basescan.org";
|
|
8
|
+
readonly apiUrl: "https://api.basescan.org/api";
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
blockTime: 2000;
|
|
12
|
+
contracts: {
|
|
13
|
+
readonly disputeGameFactory: {
|
|
14
|
+
readonly 1: {
|
|
15
|
+
readonly address: "0x43edB88C4B80fDD2AdFF2412A7BebF9dF42cB40e";
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
readonly l2OutputOracle: {
|
|
19
|
+
readonly 1: {
|
|
20
|
+
readonly address: "0x56315b90c40730925ec5485cf004d835058518A0";
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
readonly multicall3: {
|
|
24
|
+
readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
|
|
25
|
+
readonly blockCreated: 5022;
|
|
26
|
+
};
|
|
27
|
+
readonly portal: {
|
|
28
|
+
readonly 1: {
|
|
29
|
+
readonly address: "0x49048044D57e1C92A77f79988d21Fa8fAF74E97e";
|
|
30
|
+
readonly blockCreated: 17482143;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
readonly l1StandardBridge: {
|
|
34
|
+
readonly 1: {
|
|
35
|
+
readonly address: "0x3154Cf16ccdb4C6d922629664174b904d80F2C35";
|
|
36
|
+
readonly blockCreated: 17482143;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
readonly gasPriceOracle: {
|
|
40
|
+
readonly address: "0x420000000000000000000000000000000000000F";
|
|
41
|
+
};
|
|
42
|
+
readonly l1Block: {
|
|
43
|
+
readonly address: "0x4200000000000000000000000000000000000015";
|
|
44
|
+
};
|
|
45
|
+
readonly l2CrossDomainMessenger: {
|
|
46
|
+
readonly address: "0x4200000000000000000000000000000000000007";
|
|
47
|
+
};
|
|
48
|
+
readonly l2Erc721Bridge: {
|
|
49
|
+
readonly address: "0x4200000000000000000000000000000000000014";
|
|
50
|
+
};
|
|
51
|
+
readonly l2StandardBridge: {
|
|
52
|
+
readonly address: "0x4200000000000000000000000000000000000010";
|
|
53
|
+
};
|
|
54
|
+
readonly l2ToL1MessagePasser: {
|
|
55
|
+
readonly address: "0x4200000000000000000000000000000000000016";
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
ensTlds?: readonly string[] | undefined;
|
|
59
|
+
id: 8453;
|
|
60
|
+
name: "Base";
|
|
61
|
+
nativeCurrency: {
|
|
62
|
+
readonly name: "Ether";
|
|
63
|
+
readonly symbol: "ETH";
|
|
64
|
+
readonly decimals: 18;
|
|
65
|
+
};
|
|
66
|
+
experimental_preconfirmationTime?: number | undefined | undefined;
|
|
67
|
+
rpcUrls: {
|
|
68
|
+
readonly default: {
|
|
69
|
+
readonly http: readonly ["https://mainnet.base.org"];
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
sourceId: 1;
|
|
73
|
+
testnet?: boolean | undefined | undefined;
|
|
74
|
+
custom?: Record<string, unknown> | undefined;
|
|
75
|
+
fees?: import("viem").ChainFees<undefined> | undefined;
|
|
76
|
+
formatters: {
|
|
77
|
+
readonly block: {
|
|
78
|
+
exclude: [] | undefined;
|
|
79
|
+
format: (args: import("viem/chains").OpStackRpcBlock, action?: string | undefined) => {
|
|
80
|
+
baseFeePerGas: bigint | null;
|
|
81
|
+
blobGasUsed: bigint;
|
|
82
|
+
difficulty: bigint;
|
|
83
|
+
excessBlobGas: bigint;
|
|
84
|
+
extraData: import("viem").Hex;
|
|
85
|
+
gasLimit: bigint;
|
|
86
|
+
gasUsed: bigint;
|
|
87
|
+
hash: `0x${string}` | null;
|
|
88
|
+
logsBloom: `0x${string}` | null;
|
|
89
|
+
miner: import("abitype").Address;
|
|
90
|
+
mixHash: import("viem").Hash;
|
|
91
|
+
nonce: `0x${string}` | null;
|
|
92
|
+
number: bigint | null;
|
|
93
|
+
parentBeaconBlockRoot?: `0x${string}` | undefined;
|
|
94
|
+
parentHash: import("viem").Hash;
|
|
95
|
+
receiptsRoot: import("viem").Hex;
|
|
96
|
+
sealFields: import("viem").Hex[];
|
|
97
|
+
sha3Uncles: import("viem").Hash;
|
|
98
|
+
size: bigint;
|
|
99
|
+
stateRoot: import("viem").Hash;
|
|
100
|
+
timestamp: bigint;
|
|
101
|
+
totalDifficulty: bigint | null;
|
|
102
|
+
transactions: `0x${string}`[] | import("viem/chains").OpStackTransaction<boolean>[];
|
|
103
|
+
transactionsRoot: import("viem").Hash;
|
|
104
|
+
uncles: import("viem").Hash[];
|
|
105
|
+
withdrawals?: import("viem").Withdrawal[] | undefined | undefined;
|
|
106
|
+
withdrawalsRoot?: `0x${string}` | undefined;
|
|
107
|
+
} & {};
|
|
108
|
+
type: "block";
|
|
109
|
+
};
|
|
110
|
+
readonly transaction: {
|
|
111
|
+
exclude: [] | undefined;
|
|
112
|
+
format: (args: import("viem/chains").OpStackRpcTransaction, action?: string | undefined) => ({
|
|
113
|
+
blockHash: `0x${string}` | null;
|
|
114
|
+
blockNumber: bigint | null;
|
|
115
|
+
from: import("abitype").Address;
|
|
116
|
+
gas: bigint;
|
|
117
|
+
hash: import("viem").Hash;
|
|
118
|
+
input: import("viem").Hex;
|
|
119
|
+
nonce: number;
|
|
120
|
+
r: import("viem").Hex;
|
|
121
|
+
s: import("viem").Hex;
|
|
122
|
+
to: import("abitype").Address | null;
|
|
123
|
+
transactionIndex: number | null;
|
|
124
|
+
typeHex: import("viem").Hex | null;
|
|
125
|
+
v: bigint;
|
|
126
|
+
value: bigint;
|
|
127
|
+
yParity: number;
|
|
128
|
+
gasPrice?: undefined | undefined;
|
|
129
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
130
|
+
maxFeePerGas: bigint;
|
|
131
|
+
maxPriorityFeePerGas: bigint;
|
|
132
|
+
isSystemTx?: boolean;
|
|
133
|
+
mint?: bigint | undefined | undefined;
|
|
134
|
+
sourceHash: import("viem").Hex;
|
|
135
|
+
type: "deposit";
|
|
136
|
+
} | {
|
|
137
|
+
r: import("viem").Hex;
|
|
138
|
+
s: import("viem").Hex;
|
|
139
|
+
v: bigint;
|
|
140
|
+
value: bigint;
|
|
141
|
+
gas: bigint;
|
|
142
|
+
to: import("abitype").Address | null;
|
|
143
|
+
from: import("abitype").Address;
|
|
144
|
+
nonce: number;
|
|
145
|
+
blockHash: `0x${string}` | null;
|
|
146
|
+
blockNumber: bigint | null;
|
|
147
|
+
transactionIndex: number | null;
|
|
148
|
+
hash: import("viem").Hash;
|
|
149
|
+
input: import("viem").Hex;
|
|
150
|
+
typeHex: import("viem").Hex | null;
|
|
151
|
+
accessList?: undefined | undefined;
|
|
152
|
+
authorizationList?: undefined | undefined;
|
|
153
|
+
blobVersionedHashes?: undefined | undefined;
|
|
154
|
+
chainId?: number | undefined;
|
|
155
|
+
yParity?: undefined | undefined;
|
|
156
|
+
type: "legacy";
|
|
157
|
+
gasPrice: bigint;
|
|
158
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
159
|
+
maxFeePerGas?: undefined | undefined;
|
|
160
|
+
maxPriorityFeePerGas?: undefined | undefined;
|
|
161
|
+
isSystemTx?: undefined | undefined;
|
|
162
|
+
mint?: undefined | undefined;
|
|
163
|
+
sourceHash?: undefined | undefined;
|
|
164
|
+
} | {
|
|
165
|
+
blockHash: `0x${string}` | null;
|
|
166
|
+
blockNumber: bigint | null;
|
|
167
|
+
from: import("abitype").Address;
|
|
168
|
+
gas: bigint;
|
|
169
|
+
hash: import("viem").Hash;
|
|
170
|
+
input: import("viem").Hex;
|
|
171
|
+
nonce: number;
|
|
172
|
+
r: import("viem").Hex;
|
|
173
|
+
s: import("viem").Hex;
|
|
174
|
+
to: import("abitype").Address | null;
|
|
175
|
+
transactionIndex: number | null;
|
|
176
|
+
typeHex: import("viem").Hex | null;
|
|
177
|
+
v: bigint;
|
|
178
|
+
value: bigint;
|
|
179
|
+
yParity: number;
|
|
180
|
+
accessList: import("viem").AccessList;
|
|
181
|
+
authorizationList?: undefined | undefined;
|
|
182
|
+
blobVersionedHashes?: undefined | undefined;
|
|
183
|
+
chainId: number;
|
|
184
|
+
type: "eip2930";
|
|
185
|
+
gasPrice: bigint;
|
|
186
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
187
|
+
maxFeePerGas?: undefined | undefined;
|
|
188
|
+
maxPriorityFeePerGas?: undefined | undefined;
|
|
189
|
+
isSystemTx?: undefined | undefined;
|
|
190
|
+
mint?: undefined | undefined;
|
|
191
|
+
sourceHash?: undefined | undefined;
|
|
192
|
+
} | {
|
|
193
|
+
blockHash: `0x${string}` | null;
|
|
194
|
+
blockNumber: bigint | null;
|
|
195
|
+
from: import("abitype").Address;
|
|
196
|
+
gas: bigint;
|
|
197
|
+
hash: import("viem").Hash;
|
|
198
|
+
input: import("viem").Hex;
|
|
199
|
+
nonce: number;
|
|
200
|
+
r: import("viem").Hex;
|
|
201
|
+
s: import("viem").Hex;
|
|
202
|
+
to: import("abitype").Address | null;
|
|
203
|
+
transactionIndex: number | null;
|
|
204
|
+
typeHex: import("viem").Hex | null;
|
|
205
|
+
v: bigint;
|
|
206
|
+
value: bigint;
|
|
207
|
+
yParity: number;
|
|
208
|
+
accessList: import("viem").AccessList;
|
|
209
|
+
authorizationList?: undefined | undefined;
|
|
210
|
+
blobVersionedHashes?: undefined | undefined;
|
|
211
|
+
chainId: number;
|
|
212
|
+
type: "eip1559";
|
|
213
|
+
gasPrice?: undefined | undefined;
|
|
214
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
215
|
+
maxFeePerGas: bigint;
|
|
216
|
+
maxPriorityFeePerGas: bigint;
|
|
217
|
+
isSystemTx?: undefined | undefined;
|
|
218
|
+
mint?: undefined | undefined;
|
|
219
|
+
sourceHash?: undefined | undefined;
|
|
220
|
+
} | {
|
|
221
|
+
blockHash: `0x${string}` | null;
|
|
222
|
+
blockNumber: bigint | null;
|
|
223
|
+
from: import("abitype").Address;
|
|
224
|
+
gas: bigint;
|
|
225
|
+
hash: import("viem").Hash;
|
|
226
|
+
input: import("viem").Hex;
|
|
227
|
+
nonce: number;
|
|
228
|
+
r: import("viem").Hex;
|
|
229
|
+
s: import("viem").Hex;
|
|
230
|
+
to: import("abitype").Address | null;
|
|
231
|
+
transactionIndex: number | null;
|
|
232
|
+
typeHex: import("viem").Hex | null;
|
|
233
|
+
v: bigint;
|
|
234
|
+
value: bigint;
|
|
235
|
+
yParity: number;
|
|
236
|
+
accessList: import("viem").AccessList;
|
|
237
|
+
authorizationList?: undefined | undefined;
|
|
238
|
+
blobVersionedHashes: readonly import("viem").Hex[];
|
|
239
|
+
chainId: number;
|
|
240
|
+
type: "eip4844";
|
|
241
|
+
gasPrice?: undefined | undefined;
|
|
242
|
+
maxFeePerBlobGas: bigint;
|
|
243
|
+
maxFeePerGas: bigint;
|
|
244
|
+
maxPriorityFeePerGas: bigint;
|
|
245
|
+
isSystemTx?: undefined | undefined;
|
|
246
|
+
mint?: undefined | undefined;
|
|
247
|
+
sourceHash?: undefined | undefined;
|
|
248
|
+
} | {
|
|
249
|
+
blockHash: `0x${string}` | null;
|
|
250
|
+
blockNumber: bigint | null;
|
|
251
|
+
from: import("abitype").Address;
|
|
252
|
+
gas: bigint;
|
|
253
|
+
hash: import("viem").Hash;
|
|
254
|
+
input: import("viem").Hex;
|
|
255
|
+
nonce: number;
|
|
256
|
+
r: import("viem").Hex;
|
|
257
|
+
s: import("viem").Hex;
|
|
258
|
+
to: import("abitype").Address | null;
|
|
259
|
+
transactionIndex: number | null;
|
|
260
|
+
typeHex: import("viem").Hex | null;
|
|
261
|
+
v: bigint;
|
|
262
|
+
value: bigint;
|
|
263
|
+
yParity: number;
|
|
264
|
+
accessList: import("viem").AccessList;
|
|
265
|
+
authorizationList: import("viem").SignedAuthorizationList;
|
|
266
|
+
blobVersionedHashes?: undefined | undefined;
|
|
267
|
+
chainId: number;
|
|
268
|
+
type: "eip7702";
|
|
269
|
+
gasPrice?: undefined | undefined;
|
|
270
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
271
|
+
maxFeePerGas: bigint;
|
|
272
|
+
maxPriorityFeePerGas: bigint;
|
|
273
|
+
isSystemTx?: undefined | undefined;
|
|
274
|
+
mint?: undefined | undefined;
|
|
275
|
+
sourceHash?: undefined | undefined;
|
|
276
|
+
}) & {};
|
|
277
|
+
type: "transaction";
|
|
278
|
+
};
|
|
279
|
+
readonly transactionReceipt: {
|
|
280
|
+
exclude: [] | undefined;
|
|
281
|
+
format: (args: import("viem/chains").OpStackRpcTransactionReceipt, action?: string | undefined) => {
|
|
282
|
+
blobGasPrice?: bigint | undefined;
|
|
283
|
+
blobGasUsed?: bigint | undefined;
|
|
284
|
+
blockHash: import("viem").Hash;
|
|
285
|
+
blockNumber: bigint;
|
|
286
|
+
contractAddress: import("abitype").Address | null | undefined;
|
|
287
|
+
cumulativeGasUsed: bigint;
|
|
288
|
+
effectiveGasPrice: bigint;
|
|
289
|
+
from: import("abitype").Address;
|
|
290
|
+
gasUsed: bigint;
|
|
291
|
+
logs: import("viem").Log<bigint, number, false>[];
|
|
292
|
+
logsBloom: import("viem").Hex;
|
|
293
|
+
root?: `0x${string}` | undefined;
|
|
294
|
+
status: "success" | "reverted";
|
|
295
|
+
to: import("abitype").Address | null;
|
|
296
|
+
transactionHash: import("viem").Hash;
|
|
297
|
+
transactionIndex: number;
|
|
298
|
+
type: import("viem").TransactionType;
|
|
299
|
+
l1GasPrice: bigint | null;
|
|
300
|
+
l1GasUsed: bigint | null;
|
|
301
|
+
l1Fee: bigint | null;
|
|
302
|
+
l1FeeScalar: number | null;
|
|
303
|
+
} & {};
|
|
304
|
+
type: "transactionReceipt";
|
|
305
|
+
};
|
|
306
|
+
};
|
|
307
|
+
serializers: {
|
|
308
|
+
readonly transaction: typeof import("viem/chains").serializeTransactionOpStack;
|
|
309
|
+
};
|
|
310
|
+
} | {
|
|
311
|
+
blockExplorers: {
|
|
312
|
+
readonly default: {
|
|
313
|
+
readonly name: "Basescan";
|
|
314
|
+
readonly url: "https://sepolia.basescan.org";
|
|
315
|
+
readonly apiUrl: "https://api-sepolia.basescan.org/api";
|
|
316
|
+
};
|
|
317
|
+
};
|
|
318
|
+
blockTime: 2000;
|
|
319
|
+
contracts: {
|
|
320
|
+
readonly disputeGameFactory: {
|
|
321
|
+
readonly 11155111: {
|
|
322
|
+
readonly address: "0xd6E6dBf4F7EA0ac412fD8b65ED297e64BB7a06E1";
|
|
323
|
+
};
|
|
324
|
+
};
|
|
325
|
+
readonly l2OutputOracle: {
|
|
326
|
+
readonly 11155111: {
|
|
327
|
+
readonly address: "0x84457ca9D0163FbC4bbfe4Dfbb20ba46e48DF254";
|
|
328
|
+
};
|
|
329
|
+
};
|
|
330
|
+
readonly portal: {
|
|
331
|
+
readonly 11155111: {
|
|
332
|
+
readonly address: "0x49f53e41452c74589e85ca1677426ba426459e85";
|
|
333
|
+
readonly blockCreated: 4446677;
|
|
334
|
+
};
|
|
335
|
+
};
|
|
336
|
+
readonly l1StandardBridge: {
|
|
337
|
+
readonly 11155111: {
|
|
338
|
+
readonly address: "0xfd0Bf71F60660E2f608ed56e1659C450eB113120";
|
|
339
|
+
readonly blockCreated: 4446677;
|
|
340
|
+
};
|
|
341
|
+
};
|
|
342
|
+
readonly multicall3: {
|
|
343
|
+
readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
|
|
344
|
+
readonly blockCreated: 1059647;
|
|
345
|
+
};
|
|
346
|
+
readonly gasPriceOracle: {
|
|
347
|
+
readonly address: "0x420000000000000000000000000000000000000F";
|
|
348
|
+
};
|
|
349
|
+
readonly l1Block: {
|
|
350
|
+
readonly address: "0x4200000000000000000000000000000000000015";
|
|
351
|
+
};
|
|
352
|
+
readonly l2CrossDomainMessenger: {
|
|
353
|
+
readonly address: "0x4200000000000000000000000000000000000007";
|
|
354
|
+
};
|
|
355
|
+
readonly l2Erc721Bridge: {
|
|
356
|
+
readonly address: "0x4200000000000000000000000000000000000014";
|
|
357
|
+
};
|
|
358
|
+
readonly l2StandardBridge: {
|
|
359
|
+
readonly address: "0x4200000000000000000000000000000000000010";
|
|
360
|
+
};
|
|
361
|
+
readonly l2ToL1MessagePasser: {
|
|
362
|
+
readonly address: "0x4200000000000000000000000000000000000016";
|
|
363
|
+
};
|
|
364
|
+
};
|
|
365
|
+
ensTlds?: readonly string[] | undefined;
|
|
366
|
+
id: 84532;
|
|
367
|
+
name: "Base Sepolia";
|
|
368
|
+
nativeCurrency: {
|
|
369
|
+
readonly name: "Sepolia Ether";
|
|
370
|
+
readonly symbol: "ETH";
|
|
371
|
+
readonly decimals: 18;
|
|
372
|
+
};
|
|
373
|
+
experimental_preconfirmationTime?: number | undefined | undefined;
|
|
374
|
+
rpcUrls: {
|
|
375
|
+
readonly default: {
|
|
376
|
+
readonly http: readonly ["https://sepolia.base.org"];
|
|
377
|
+
};
|
|
378
|
+
};
|
|
379
|
+
sourceId: 11155111;
|
|
380
|
+
testnet: true;
|
|
381
|
+
custom?: Record<string, unknown> | undefined;
|
|
382
|
+
fees?: import("viem").ChainFees<undefined> | undefined;
|
|
383
|
+
formatters: {
|
|
384
|
+
readonly block: {
|
|
385
|
+
exclude: [] | undefined;
|
|
386
|
+
format: (args: import("viem/chains").OpStackRpcBlock, action?: string | undefined) => {
|
|
387
|
+
baseFeePerGas: bigint | null;
|
|
388
|
+
blobGasUsed: bigint;
|
|
389
|
+
difficulty: bigint;
|
|
390
|
+
excessBlobGas: bigint;
|
|
391
|
+
extraData: import("viem").Hex;
|
|
392
|
+
gasLimit: bigint;
|
|
393
|
+
gasUsed: bigint;
|
|
394
|
+
hash: `0x${string}` | null;
|
|
395
|
+
logsBloom: `0x${string}` | null;
|
|
396
|
+
miner: import("abitype").Address;
|
|
397
|
+
mixHash: import("viem").Hash;
|
|
398
|
+
nonce: `0x${string}` | null;
|
|
399
|
+
number: bigint | null;
|
|
400
|
+
parentBeaconBlockRoot?: `0x${string}` | undefined;
|
|
401
|
+
parentHash: import("viem").Hash;
|
|
402
|
+
receiptsRoot: import("viem").Hex;
|
|
403
|
+
sealFields: import("viem").Hex[];
|
|
404
|
+
sha3Uncles: import("viem").Hash;
|
|
405
|
+
size: bigint;
|
|
406
|
+
stateRoot: import("viem").Hash;
|
|
407
|
+
timestamp: bigint;
|
|
408
|
+
totalDifficulty: bigint | null;
|
|
409
|
+
transactions: `0x${string}`[] | import("viem/chains").OpStackTransaction<boolean>[];
|
|
410
|
+
transactionsRoot: import("viem").Hash;
|
|
411
|
+
uncles: import("viem").Hash[];
|
|
412
|
+
withdrawals?: import("viem").Withdrawal[] | undefined | undefined;
|
|
413
|
+
withdrawalsRoot?: `0x${string}` | undefined;
|
|
414
|
+
} & {};
|
|
415
|
+
type: "block";
|
|
416
|
+
};
|
|
417
|
+
readonly transaction: {
|
|
418
|
+
exclude: [] | undefined;
|
|
419
|
+
format: (args: import("viem/chains").OpStackRpcTransaction, action?: string | undefined) => ({
|
|
420
|
+
blockHash: `0x${string}` | null;
|
|
421
|
+
blockNumber: bigint | null;
|
|
422
|
+
from: import("abitype").Address;
|
|
423
|
+
gas: bigint;
|
|
424
|
+
hash: import("viem").Hash;
|
|
425
|
+
input: import("viem").Hex;
|
|
426
|
+
nonce: number;
|
|
427
|
+
r: import("viem").Hex;
|
|
428
|
+
s: import("viem").Hex;
|
|
429
|
+
to: import("abitype").Address | null;
|
|
430
|
+
transactionIndex: number | null;
|
|
431
|
+
typeHex: import("viem").Hex | null;
|
|
432
|
+
v: bigint;
|
|
433
|
+
value: bigint;
|
|
434
|
+
yParity: number;
|
|
435
|
+
gasPrice?: undefined | undefined;
|
|
436
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
437
|
+
maxFeePerGas: bigint;
|
|
438
|
+
maxPriorityFeePerGas: bigint;
|
|
439
|
+
isSystemTx?: boolean;
|
|
440
|
+
mint?: bigint | undefined | undefined;
|
|
441
|
+
sourceHash: import("viem").Hex;
|
|
442
|
+
type: "deposit";
|
|
443
|
+
} | {
|
|
444
|
+
r: import("viem").Hex;
|
|
445
|
+
s: import("viem").Hex;
|
|
446
|
+
v: bigint;
|
|
447
|
+
value: bigint;
|
|
448
|
+
gas: bigint;
|
|
449
|
+
to: import("abitype").Address | null;
|
|
450
|
+
from: import("abitype").Address;
|
|
451
|
+
nonce: number;
|
|
452
|
+
blockHash: `0x${string}` | null;
|
|
453
|
+
blockNumber: bigint | null;
|
|
454
|
+
transactionIndex: number | null;
|
|
455
|
+
hash: import("viem").Hash;
|
|
456
|
+
input: import("viem").Hex;
|
|
457
|
+
typeHex: import("viem").Hex | null;
|
|
458
|
+
accessList?: undefined | undefined;
|
|
459
|
+
authorizationList?: undefined | undefined;
|
|
460
|
+
blobVersionedHashes?: undefined | undefined;
|
|
461
|
+
chainId?: number | undefined;
|
|
462
|
+
yParity?: undefined | undefined;
|
|
463
|
+
type: "legacy";
|
|
464
|
+
gasPrice: bigint;
|
|
465
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
466
|
+
maxFeePerGas?: undefined | undefined;
|
|
467
|
+
maxPriorityFeePerGas?: undefined | undefined;
|
|
468
|
+
isSystemTx?: undefined | undefined;
|
|
469
|
+
mint?: undefined | undefined;
|
|
470
|
+
sourceHash?: undefined | undefined;
|
|
471
|
+
} | {
|
|
472
|
+
blockHash: `0x${string}` | null;
|
|
473
|
+
blockNumber: bigint | null;
|
|
474
|
+
from: import("abitype").Address;
|
|
475
|
+
gas: bigint;
|
|
476
|
+
hash: import("viem").Hash;
|
|
477
|
+
input: import("viem").Hex;
|
|
478
|
+
nonce: number;
|
|
479
|
+
r: import("viem").Hex;
|
|
480
|
+
s: import("viem").Hex;
|
|
481
|
+
to: import("abitype").Address | null;
|
|
482
|
+
transactionIndex: number | null;
|
|
483
|
+
typeHex: import("viem").Hex | null;
|
|
484
|
+
v: bigint;
|
|
485
|
+
value: bigint;
|
|
486
|
+
yParity: number;
|
|
487
|
+
accessList: import("viem").AccessList;
|
|
488
|
+
authorizationList?: undefined | undefined;
|
|
489
|
+
blobVersionedHashes?: undefined | undefined;
|
|
490
|
+
chainId: number;
|
|
491
|
+
type: "eip2930";
|
|
492
|
+
gasPrice: bigint;
|
|
493
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
494
|
+
maxFeePerGas?: undefined | undefined;
|
|
495
|
+
maxPriorityFeePerGas?: undefined | undefined;
|
|
496
|
+
isSystemTx?: undefined | undefined;
|
|
497
|
+
mint?: undefined | undefined;
|
|
498
|
+
sourceHash?: undefined | undefined;
|
|
499
|
+
} | {
|
|
500
|
+
blockHash: `0x${string}` | null;
|
|
501
|
+
blockNumber: bigint | null;
|
|
502
|
+
from: import("abitype").Address;
|
|
503
|
+
gas: bigint;
|
|
504
|
+
hash: import("viem").Hash;
|
|
505
|
+
input: import("viem").Hex;
|
|
506
|
+
nonce: number;
|
|
507
|
+
r: import("viem").Hex;
|
|
508
|
+
s: import("viem").Hex;
|
|
509
|
+
to: import("abitype").Address | null;
|
|
510
|
+
transactionIndex: number | null;
|
|
511
|
+
typeHex: import("viem").Hex | null;
|
|
512
|
+
v: bigint;
|
|
513
|
+
value: bigint;
|
|
514
|
+
yParity: number;
|
|
515
|
+
accessList: import("viem").AccessList;
|
|
516
|
+
authorizationList?: undefined | undefined;
|
|
517
|
+
blobVersionedHashes?: undefined | undefined;
|
|
518
|
+
chainId: number;
|
|
519
|
+
type: "eip1559";
|
|
520
|
+
gasPrice?: undefined | undefined;
|
|
521
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
522
|
+
maxFeePerGas: bigint;
|
|
523
|
+
maxPriorityFeePerGas: bigint;
|
|
524
|
+
isSystemTx?: undefined | undefined;
|
|
525
|
+
mint?: undefined | undefined;
|
|
526
|
+
sourceHash?: undefined | undefined;
|
|
527
|
+
} | {
|
|
528
|
+
blockHash: `0x${string}` | null;
|
|
529
|
+
blockNumber: bigint | null;
|
|
530
|
+
from: import("abitype").Address;
|
|
531
|
+
gas: bigint;
|
|
532
|
+
hash: import("viem").Hash;
|
|
533
|
+
input: import("viem").Hex;
|
|
534
|
+
nonce: number;
|
|
535
|
+
r: import("viem").Hex;
|
|
536
|
+
s: import("viem").Hex;
|
|
537
|
+
to: import("abitype").Address | null;
|
|
538
|
+
transactionIndex: number | null;
|
|
539
|
+
typeHex: import("viem").Hex | null;
|
|
540
|
+
v: bigint;
|
|
541
|
+
value: bigint;
|
|
542
|
+
yParity: number;
|
|
543
|
+
accessList: import("viem").AccessList;
|
|
544
|
+
authorizationList?: undefined | undefined;
|
|
545
|
+
blobVersionedHashes: readonly import("viem").Hex[];
|
|
546
|
+
chainId: number;
|
|
547
|
+
type: "eip4844";
|
|
548
|
+
gasPrice?: undefined | undefined;
|
|
549
|
+
maxFeePerBlobGas: bigint;
|
|
550
|
+
maxFeePerGas: bigint;
|
|
551
|
+
maxPriorityFeePerGas: bigint;
|
|
552
|
+
isSystemTx?: undefined | undefined;
|
|
553
|
+
mint?: undefined | undefined;
|
|
554
|
+
sourceHash?: undefined | undefined;
|
|
555
|
+
} | {
|
|
556
|
+
blockHash: `0x${string}` | null;
|
|
557
|
+
blockNumber: bigint | null;
|
|
558
|
+
from: import("abitype").Address;
|
|
559
|
+
gas: bigint;
|
|
560
|
+
hash: import("viem").Hash;
|
|
561
|
+
input: import("viem").Hex;
|
|
562
|
+
nonce: number;
|
|
563
|
+
r: import("viem").Hex;
|
|
564
|
+
s: import("viem").Hex;
|
|
565
|
+
to: import("abitype").Address | null;
|
|
566
|
+
transactionIndex: number | null;
|
|
567
|
+
typeHex: import("viem").Hex | null;
|
|
568
|
+
v: bigint;
|
|
569
|
+
value: bigint;
|
|
570
|
+
yParity: number;
|
|
571
|
+
accessList: import("viem").AccessList;
|
|
572
|
+
authorizationList: import("viem").SignedAuthorizationList;
|
|
573
|
+
blobVersionedHashes?: undefined | undefined;
|
|
574
|
+
chainId: number;
|
|
575
|
+
type: "eip7702";
|
|
576
|
+
gasPrice?: undefined | undefined;
|
|
577
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
578
|
+
maxFeePerGas: bigint;
|
|
579
|
+
maxPriorityFeePerGas: bigint;
|
|
580
|
+
isSystemTx?: undefined | undefined;
|
|
581
|
+
mint?: undefined | undefined;
|
|
582
|
+
sourceHash?: undefined | undefined;
|
|
583
|
+
}) & {};
|
|
584
|
+
type: "transaction";
|
|
585
|
+
};
|
|
586
|
+
readonly transactionReceipt: {
|
|
587
|
+
exclude: [] | undefined;
|
|
588
|
+
format: (args: import("viem/chains").OpStackRpcTransactionReceipt, action?: string | undefined) => {
|
|
589
|
+
blobGasPrice?: bigint | undefined;
|
|
590
|
+
blobGasUsed?: bigint | undefined;
|
|
591
|
+
blockHash: import("viem").Hash;
|
|
592
|
+
blockNumber: bigint;
|
|
593
|
+
contractAddress: import("abitype").Address | null | undefined;
|
|
594
|
+
cumulativeGasUsed: bigint;
|
|
595
|
+
effectiveGasPrice: bigint;
|
|
596
|
+
from: import("abitype").Address;
|
|
597
|
+
gasUsed: bigint;
|
|
598
|
+
logs: import("viem").Log<bigint, number, false>[];
|
|
599
|
+
logsBloom: import("viem").Hex;
|
|
600
|
+
root?: `0x${string}` | undefined;
|
|
601
|
+
status: "success" | "reverted";
|
|
602
|
+
to: import("abitype").Address | null;
|
|
603
|
+
transactionHash: import("viem").Hash;
|
|
604
|
+
transactionIndex: number;
|
|
605
|
+
type: import("viem").TransactionType;
|
|
606
|
+
l1GasPrice: bigint | null;
|
|
607
|
+
l1GasUsed: bigint | null;
|
|
608
|
+
l1Fee: bigint | null;
|
|
609
|
+
l1FeeScalar: number | null;
|
|
610
|
+
} & {};
|
|
611
|
+
type: "transactionReceipt";
|
|
612
|
+
};
|
|
613
|
+
};
|
|
614
|
+
serializers: {
|
|
615
|
+
readonly transaction: typeof import("viem/chains").serializeTransactionOpStack;
|
|
616
|
+
};
|
|
617
|
+
readonly network: "base-sepolia";
|
|
618
|
+
};
|
|
619
|
+
export declare function usdcAddressForNetwork(network: string): `0x${string}`;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { base, baseSepolia } from 'viem/chains';
|
|
2
|
+
export const DEFAULT_X402_NETWORK = 'eip155:84532';
|
|
3
|
+
export function resolveConfiguredNetwork(network) {
|
|
4
|
+
return network ?? DEFAULT_X402_NETWORK;
|
|
5
|
+
}
|
|
6
|
+
export function resolveChain(network) {
|
|
7
|
+
if (network === 'eip155:8453')
|
|
8
|
+
return base;
|
|
9
|
+
return baseSepolia;
|
|
10
|
+
}
|
|
11
|
+
export function usdcAddressForNetwork(network) {
|
|
12
|
+
if (network === 'eip155:8453') {
|
|
13
|
+
return '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913';
|
|
14
|
+
}
|
|
15
|
+
return '0x036CbD53842c5426634e7929541eC2318f3dCF7e';
|
|
16
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { WalletInfo } from '../types.js';
|
|
2
|
+
export declare function walletFilePath(): string;
|
|
3
|
+
export declare function resolveOrGenerateWalletKey(env?: NodeJS.ProcessEnv): {
|
|
4
|
+
key: `0x${string}`;
|
|
5
|
+
info: WalletInfo;
|
|
6
|
+
};
|
|
7
|
+
export declare function getWalletInfo(env?: NodeJS.ProcessEnv): Promise<WalletInfo>;
|