@piprail/sdk 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/CHANGELOG.md +160 -0
- package/ERRORS.md +182 -0
- package/LICENSE +21 -0
- package/README.md +497 -0
- package/STANDARDS.md +123 -0
- package/dist/chunk-3TQJJ4SQ.js +157 -0
- package/dist/chunk-CQREG5LE.cjs +8 -0
- package/dist/chunk-FURB5RP7.js +8 -0
- package/dist/chunk-WQWNPAYQ.cjs +157 -0
- package/dist/index.cjs +1681 -0
- package/dist/index.d.cts +4578 -0
- package/dist/index.d.ts +4578 -0
- package/dist/index.js +1681 -0
- package/dist/near-4P5XNMMB.cjs +346 -0
- package/dist/near-RVXGF7TW.js +346 -0
- package/dist/solana-7PZG3CDO.js +342 -0
- package/dist/solana-F7H4YDW5.cjs +342 -0
- package/dist/stellar-BPPQTLNI.cjs +389 -0
- package/dist/stellar-PAZ352JL.js +389 -0
- package/dist/sui-6N4ZPAGD.js +304 -0
- package/dist/sui-XV4YYSGV.cjs +304 -0
- package/dist/ton-E5RLUPD2.cjs +366 -0
- package/dist/ton-EFZKQAAK.js +366 -0
- package/dist/tron-243DT6PF.js +372 -0
- package/dist/tron-3UDH7KGF.cjs +372 -0
- package/dist/xrpl-6NRFT5CA.cjs +449 -0
- package/dist/xrpl-7GWXDAVZ.js +449 -0
- package/package.json +143 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,4578 @@
|
|
|
1
|
+
import * as viem_zksync from 'viem/zksync';
|
|
2
|
+
import * as abitype from 'abitype';
|
|
3
|
+
import * as viem_chains from 'viem/chains';
|
|
4
|
+
import * as viem from 'viem';
|
|
5
|
+
import { Chain, Account, Hex } from 'viem';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* The on-the-wire payment protocol. Self-contained — it runs entirely
|
|
9
|
+
* between the agent and your server, with nothing hosted in between.
|
|
10
|
+
*
|
|
11
|
+
* Lowercase headers, no `X-` prefix:
|
|
12
|
+
* - payment-required (server → client, base64 JSON challenge)
|
|
13
|
+
* - payment-signature (client → server, base64 JSON proof)
|
|
14
|
+
* - payment-response (server → client, base64 JSON receipt on 200)
|
|
15
|
+
*
|
|
16
|
+
* Scheme is `onchain-proof`: the agent pays on-chain and hands back a proof
|
|
17
|
+
* reference (an EVM tx hash, a Solana signature, …); the server verifies
|
|
18
|
+
* that transaction itself, locally, against its own RPC. No third party.
|
|
19
|
+
*
|
|
20
|
+
* This file is CHAIN-AGNOSTIC. Identifiers are plain strings in CAIP-2 /
|
|
21
|
+
* base-unit form so any family (EVM, Solana, …) round-trips through the same
|
|
22
|
+
* envelopes. Each PaymentDriver interprets them for its own chain.
|
|
23
|
+
*
|
|
24
|
+
* Wire format targets x402 v2 — github.com/coinbase/x402, specs/x402-specification-v2.md
|
|
25
|
+
* (v2.0, 2025-12-9) + specs/transports-v2/http.md. The ENVELOPE is v2-conformant
|
|
26
|
+
* (PaymentPayload carries `accepted`; SettlementResponse has `success` + `transaction`).
|
|
27
|
+
* The SETTLEMENT SCHEME is our own `onchain-proof` (client pays on-chain first, proves
|
|
28
|
+
* with a tx ref, server verifies locally) — permitted by spec §6 (a scheme owns its
|
|
29
|
+
* `payload`) + §7 (self-hosted verification), but it does NOT interoperate with the
|
|
30
|
+
* built-in `exact` scheme (which is signature + facilitator-broadcast). Deliberate.
|
|
31
|
+
*/
|
|
32
|
+
/** A CAIP-2 network id, e.g. `eip155:8453` or `solana:5eykt4Us…`. */
|
|
33
|
+
type Caip2 = `${string}:${string}`;
|
|
34
|
+
/** An asset id — chain-specific: an EVM `0x…` address, a Solana base58 mint, a
|
|
35
|
+
* TON jetton master, a Stellar `CODE:ISSUER`, or `'native'`. */
|
|
36
|
+
type AssetId = string;
|
|
37
|
+
/** An account id — chain-specific: an EVM `0x…` address, a Solana base58 pubkey,
|
|
38
|
+
* a TON address, or a Stellar `G…` account. */
|
|
39
|
+
type AddressId = string;
|
|
40
|
+
interface X402ResourceObject {
|
|
41
|
+
url: string;
|
|
42
|
+
description?: string;
|
|
43
|
+
}
|
|
44
|
+
interface X402AcceptEntry {
|
|
45
|
+
scheme: 'onchain-proof';
|
|
46
|
+
network: Caip2;
|
|
47
|
+
/** Amount in the token's base units (already scaled by decimals). */
|
|
48
|
+
amount: string;
|
|
49
|
+
/** ERC-20 address / SPL mint, or 'native' for the chain's native coin. */
|
|
50
|
+
asset: AssetId;
|
|
51
|
+
payTo: AddressId;
|
|
52
|
+
/** Payment is only accepted if mined within this many seconds of now. */
|
|
53
|
+
maxTimeoutSeconds: number;
|
|
54
|
+
extra: {
|
|
55
|
+
/** Single-use id echoed back in the proof. */
|
|
56
|
+
nonce: string;
|
|
57
|
+
/** Token decimals, so the client can render the amount. */
|
|
58
|
+
decimals: number;
|
|
59
|
+
/** Confirmations the client should wait before retrying. */
|
|
60
|
+
minConfirmations: number;
|
|
61
|
+
/** Human-readable amount, e.g. "0.05". */
|
|
62
|
+
amountFormatted: string;
|
|
63
|
+
symbol?: string;
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
interface X402Challenge {
|
|
67
|
+
x402Version: 2;
|
|
68
|
+
error: string | null;
|
|
69
|
+
resource: X402ResourceObject;
|
|
70
|
+
accepts: X402AcceptEntry[];
|
|
71
|
+
}
|
|
72
|
+
interface X402PaymentSignature {
|
|
73
|
+
x402Version: 2;
|
|
74
|
+
/**
|
|
75
|
+
* x402 v2 PaymentPayload: the full PaymentRequirements entry the client chose
|
|
76
|
+
* (carries `scheme` + `network`), echoed back from the challenge's `accepts[]`.
|
|
77
|
+
*/
|
|
78
|
+
accepted: X402AcceptEntry;
|
|
79
|
+
/**
|
|
80
|
+
* Scheme-defined payload. For `onchain-proof`: the challenge nonce + the proof
|
|
81
|
+
* ref (`txHash` — a chain-specific id: an EVM tx hash, a Solana signature, a
|
|
82
|
+
* TON locator, or a Stellar tx hash).
|
|
83
|
+
*/
|
|
84
|
+
payload: {
|
|
85
|
+
nonce: string;
|
|
86
|
+
txHash: string;
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
interface X402Receipt {
|
|
90
|
+
scheme: 'onchain-proof';
|
|
91
|
+
/**
|
|
92
|
+
* x402 v2 SettlementResponse: settlement succeeded. Always `true` here — a
|
|
93
|
+
* failed verification returns a 402, never a receipt.
|
|
94
|
+
*/
|
|
95
|
+
success: true;
|
|
96
|
+
network: Caip2;
|
|
97
|
+
/**
|
|
98
|
+
* x402 v2 SettlementResponse: the on-chain transaction id of the SETTLED
|
|
99
|
+
* payment — a chain-specific id (an EVM/Tron/Stellar/XRPL/NEAR tx hash, a
|
|
100
|
+
* Solana signature, or a Sui digest). This is the verified tx itself, NOT the
|
|
101
|
+
* submit-time proof ref in `payload.txHash` (which can be a composite locator
|
|
102
|
+
* on TON/NEAR). (Was `txHash` before v2 envelope conformance.)
|
|
103
|
+
*/
|
|
104
|
+
transaction: string;
|
|
105
|
+
asset: AssetId;
|
|
106
|
+
amount: string;
|
|
107
|
+
payer: AddressId;
|
|
108
|
+
payTo: AddressId;
|
|
109
|
+
verifiedAt: string;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Why a verification failed — a closed, chain-agnostic vocabulary. Every code a
|
|
113
|
+
* driver returns is in this union; a client/agent branches on it rather than
|
|
114
|
+
* parsing prose. Surfaced to the agent in the 402 body's `error` field with a
|
|
115
|
+
* human-readable `detail`. Some codes are family-specific (annotated below):
|
|
116
|
+
* e.g. account-watch chains (TON, Stellar) can't distinguish "wrong recipient"
|
|
117
|
+
* from "no payment", so both collapse to `transfer_not_found`.
|
|
118
|
+
*
|
|
119
|
+
* `transient` = the proof may simply not have propagated to the server's RPC
|
|
120
|
+
* node yet; `definitive` = retrying won't change it. These labels are
|
|
121
|
+
* informational for consumers — the built-in client retries EVERY code up to
|
|
122
|
+
* `maxPaymentRetries` (a short backoff absorbs RPC lag); it does not branch on
|
|
123
|
+
* the code.
|
|
124
|
+
*/
|
|
125
|
+
type VerifyErrorCode = 'tx_not_found' | 'insufficient_confirmations' | 'tx_reverted' | 'no_meta' | 'wrong_recipient' | 'amount_too_low' | 'transfer_not_found' | 'payment_expired' | 'tx_already_used';
|
|
126
|
+
/** The shape every driver's `verify()` returns. Shared by drivers + protocol. */
|
|
127
|
+
type VerifyResult = {
|
|
128
|
+
ok: true;
|
|
129
|
+
receipt: X402Receipt;
|
|
130
|
+
} | {
|
|
131
|
+
ok: false;
|
|
132
|
+
error: VerifyErrorCode;
|
|
133
|
+
detail: string;
|
|
134
|
+
};
|
|
135
|
+
declare function buildChallengeHeader(challenge: X402Challenge): string;
|
|
136
|
+
declare function buildReceiptHeader(receipt: X402Receipt): string;
|
|
137
|
+
declare function buildSignatureHeader(signature: X402PaymentSignature): string;
|
|
138
|
+
/**
|
|
139
|
+
* Parse the PAYMENT-REQUIRED challenge from a 402 response. Prefers the
|
|
140
|
+
* `payment-required` header, falls back to the JSON body.
|
|
141
|
+
*/
|
|
142
|
+
declare function parseChallenge(response: Response): Promise<X402Challenge | null>;
|
|
143
|
+
/** Parse the PAYMENT-RESPONSE receipt header on a 200 settlement. */
|
|
144
|
+
declare function parseReceipt(response: Response): X402Receipt | null;
|
|
145
|
+
/** Parse a PAYMENT-SIGNATURE header value (server side). */
|
|
146
|
+
declare function parseSignatureHeader(value: string): X402PaymentSignature | null;
|
|
147
|
+
/**
|
|
148
|
+
* Pick the first accepts[] entry on the `onchain-proof` scheme whose network
|
|
149
|
+
* satisfies `matches` (any chain family). Returns null if none match.
|
|
150
|
+
*/
|
|
151
|
+
declare function pickAccept(challenge: X402Challenge, matches: (network: string) => boolean): X402AcceptEntry | null;
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* ── EVM SECTION: chains ──
|
|
155
|
+
* Chains are a parameter, and the popular ones are built in.
|
|
156
|
+
*
|
|
157
|
+
* The easy path — name a built-in chain:
|
|
158
|
+
* requirePayment({ chain: 'base', amount: '0.05', payTo }) // USDC on Base
|
|
159
|
+
*
|
|
160
|
+
* The exotic path — ANY EVM chain we don't ship, by viem `Chain` or a bare
|
|
161
|
+
* `{ id, rpcUrl }`, plus the token you want paid in:
|
|
162
|
+
* requirePayment({ chain: someViemChain, token: { address, decimals }, … })
|
|
163
|
+
* requirePayment({ chain: { id: 1313161554, rpcUrl: 'https://mainnet.aurora.dev' },
|
|
164
|
+
* token: { address: '0x…', decimals: 6 }, … })
|
|
165
|
+
*
|
|
166
|
+
* If viem can reach the RPC, PipRail works on it — there is no allowlist.
|
|
167
|
+
*/
|
|
168
|
+
interface TokenInfo {
|
|
169
|
+
address: `0x${string}`;
|
|
170
|
+
decimals: number;
|
|
171
|
+
symbol: string;
|
|
172
|
+
}
|
|
173
|
+
interface ChainPreset {
|
|
174
|
+
/** The underlying viem chain (id, name, native coin, default RPCs). */
|
|
175
|
+
chain: Chain;
|
|
176
|
+
/**
|
|
177
|
+
* Override the default RPC used when the caller passes no `rpcUrl`. Set only
|
|
178
|
+
* where viem's bundled default is unreliable. Public RPCs are rate-limited —
|
|
179
|
+
* production callers should always pass their own `rpcUrl`.
|
|
180
|
+
*/
|
|
181
|
+
defaultRpc?: string;
|
|
182
|
+
/** Well-known tokens on this chain, keyed by UPPERCASE symbol. */
|
|
183
|
+
tokens: Record<string, TokenInfo>;
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Built-in EVM mainnets, each with canonical USDC (decimals included)
|
|
187
|
+
* pre-filled so a developer never pastes a token address. Add a chain = one
|
|
188
|
+
* entry here.
|
|
189
|
+
*/
|
|
190
|
+
declare const CHAINS: {
|
|
191
|
+
ethereum: {
|
|
192
|
+
chain: {
|
|
193
|
+
blockExplorers: {
|
|
194
|
+
readonly default: {
|
|
195
|
+
readonly name: "Etherscan";
|
|
196
|
+
readonly url: "https://etherscan.io";
|
|
197
|
+
readonly apiUrl: "https://api.etherscan.io/api";
|
|
198
|
+
};
|
|
199
|
+
};
|
|
200
|
+
blockTime: 12000;
|
|
201
|
+
contracts: {
|
|
202
|
+
readonly ensUniversalResolver: {
|
|
203
|
+
readonly address: "0xeeeeeeee14d718c2b47d9923deab1335e144eeee";
|
|
204
|
+
readonly blockCreated: 23085558;
|
|
205
|
+
};
|
|
206
|
+
readonly multicall3: {
|
|
207
|
+
readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
|
|
208
|
+
readonly blockCreated: 14353601;
|
|
209
|
+
};
|
|
210
|
+
};
|
|
211
|
+
ensTlds?: readonly string[] | undefined;
|
|
212
|
+
id: 1;
|
|
213
|
+
name: "Ethereum";
|
|
214
|
+
nativeCurrency: {
|
|
215
|
+
readonly name: "Ether";
|
|
216
|
+
readonly symbol: "ETH";
|
|
217
|
+
readonly decimals: 18;
|
|
218
|
+
};
|
|
219
|
+
experimental_preconfirmationTime?: number | undefined | undefined;
|
|
220
|
+
rpcUrls: {
|
|
221
|
+
readonly default: {
|
|
222
|
+
readonly http: readonly ["https://eth.merkle.io"];
|
|
223
|
+
};
|
|
224
|
+
};
|
|
225
|
+
sourceId?: number | undefined | undefined;
|
|
226
|
+
testnet?: boolean | undefined | undefined;
|
|
227
|
+
custom?: Record<string, unknown> | undefined;
|
|
228
|
+
extendSchema?: Record<string, unknown> | undefined;
|
|
229
|
+
fees?: viem.ChainFees<undefined> | undefined;
|
|
230
|
+
formatters?: undefined;
|
|
231
|
+
prepareTransactionRequest?: ((args: viem.PrepareTransactionRequestParameters, options: {
|
|
232
|
+
client: viem.Client;
|
|
233
|
+
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
234
|
+
}) => Promise<viem.PrepareTransactionRequestParameters>) | [fn: ((args: viem.PrepareTransactionRequestParameters, options: {
|
|
235
|
+
client: viem.Client;
|
|
236
|
+
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
237
|
+
}) => Promise<viem.PrepareTransactionRequestParameters>) | undefined, options: {
|
|
238
|
+
runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
|
|
239
|
+
}] | undefined;
|
|
240
|
+
serializers?: viem.ChainSerializers<undefined, viem.TransactionSerializable> | undefined;
|
|
241
|
+
verifyHash?: ((client: viem.Client, parameters: viem.VerifyHashActionParameters) => Promise<viem.VerifyHashActionReturnType>) | undefined;
|
|
242
|
+
};
|
|
243
|
+
defaultRpc: string;
|
|
244
|
+
tokens: {
|
|
245
|
+
USDC: {
|
|
246
|
+
address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48";
|
|
247
|
+
decimals: number;
|
|
248
|
+
symbol: string;
|
|
249
|
+
};
|
|
250
|
+
USDT: {
|
|
251
|
+
address: "0xdAC17F958D2ee523a2206206994597C13D831ec7";
|
|
252
|
+
decimals: number;
|
|
253
|
+
symbol: string;
|
|
254
|
+
};
|
|
255
|
+
};
|
|
256
|
+
};
|
|
257
|
+
base: {
|
|
258
|
+
chain: {
|
|
259
|
+
blockExplorers: {
|
|
260
|
+
readonly default: {
|
|
261
|
+
readonly name: "Basescan";
|
|
262
|
+
readonly url: "https://basescan.org";
|
|
263
|
+
readonly apiUrl: "https://api.basescan.org/api";
|
|
264
|
+
};
|
|
265
|
+
};
|
|
266
|
+
blockTime: 2000;
|
|
267
|
+
contracts: {
|
|
268
|
+
readonly disputeGameFactory: {
|
|
269
|
+
readonly 1: {
|
|
270
|
+
readonly address: "0x43edB88C4B80fDD2AdFF2412A7BebF9dF42cB40e";
|
|
271
|
+
};
|
|
272
|
+
};
|
|
273
|
+
readonly l2OutputOracle: {
|
|
274
|
+
readonly 1: {
|
|
275
|
+
readonly address: "0x56315b90c40730925ec5485cf004d835058518A0";
|
|
276
|
+
};
|
|
277
|
+
};
|
|
278
|
+
readonly multicall3: {
|
|
279
|
+
readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
|
|
280
|
+
readonly blockCreated: 5022;
|
|
281
|
+
};
|
|
282
|
+
readonly portal: {
|
|
283
|
+
readonly 1: {
|
|
284
|
+
readonly address: "0x49048044D57e1C92A77f79988d21Fa8fAF74E97e";
|
|
285
|
+
readonly blockCreated: 17482143;
|
|
286
|
+
};
|
|
287
|
+
};
|
|
288
|
+
readonly l1StandardBridge: {
|
|
289
|
+
readonly 1: {
|
|
290
|
+
readonly address: "0x3154Cf16ccdb4C6d922629664174b904d80F2C35";
|
|
291
|
+
readonly blockCreated: 17482143;
|
|
292
|
+
};
|
|
293
|
+
};
|
|
294
|
+
readonly gasPriceOracle: {
|
|
295
|
+
readonly address: "0x420000000000000000000000000000000000000F";
|
|
296
|
+
};
|
|
297
|
+
readonly l1Block: {
|
|
298
|
+
readonly address: "0x4200000000000000000000000000000000000015";
|
|
299
|
+
};
|
|
300
|
+
readonly l2CrossDomainMessenger: {
|
|
301
|
+
readonly address: "0x4200000000000000000000000000000000000007";
|
|
302
|
+
};
|
|
303
|
+
readonly l2Erc721Bridge: {
|
|
304
|
+
readonly address: "0x4200000000000000000000000000000000000014";
|
|
305
|
+
};
|
|
306
|
+
readonly l2StandardBridge: {
|
|
307
|
+
readonly address: "0x4200000000000000000000000000000000000010";
|
|
308
|
+
};
|
|
309
|
+
readonly l2ToL1MessagePasser: {
|
|
310
|
+
readonly address: "0x4200000000000000000000000000000000000016";
|
|
311
|
+
};
|
|
312
|
+
};
|
|
313
|
+
ensTlds?: readonly string[] | undefined;
|
|
314
|
+
id: 8453;
|
|
315
|
+
name: "Base";
|
|
316
|
+
nativeCurrency: {
|
|
317
|
+
readonly name: "Ether";
|
|
318
|
+
readonly symbol: "ETH";
|
|
319
|
+
readonly decimals: 18;
|
|
320
|
+
};
|
|
321
|
+
experimental_preconfirmationTime?: number | undefined | undefined;
|
|
322
|
+
rpcUrls: {
|
|
323
|
+
readonly default: {
|
|
324
|
+
readonly http: readonly ["https://mainnet.base.org"];
|
|
325
|
+
};
|
|
326
|
+
};
|
|
327
|
+
sourceId: 1;
|
|
328
|
+
testnet?: boolean | undefined | undefined;
|
|
329
|
+
custom?: Record<string, unknown> | undefined;
|
|
330
|
+
extendSchema?: Record<string, unknown> | undefined;
|
|
331
|
+
fees?: viem.ChainFees<undefined> | undefined;
|
|
332
|
+
formatters: {
|
|
333
|
+
readonly block: {
|
|
334
|
+
exclude: [] | undefined;
|
|
335
|
+
format: (args: viem_chains.OpStackRpcBlock, action?: string | undefined) => {
|
|
336
|
+
baseFeePerGas: bigint | null;
|
|
337
|
+
blobGasUsed: bigint;
|
|
338
|
+
difficulty: bigint;
|
|
339
|
+
excessBlobGas: bigint;
|
|
340
|
+
extraData: viem.Hex;
|
|
341
|
+
gasLimit: bigint;
|
|
342
|
+
gasUsed: bigint;
|
|
343
|
+
hash: `0x${string}` | null;
|
|
344
|
+
logsBloom: `0x${string}` | null;
|
|
345
|
+
miner: abitype.Address;
|
|
346
|
+
mixHash: viem.Hash;
|
|
347
|
+
nonce: `0x${string}` | null;
|
|
348
|
+
number: bigint | null;
|
|
349
|
+
parentBeaconBlockRoot?: `0x${string}` | undefined;
|
|
350
|
+
parentHash: viem.Hash;
|
|
351
|
+
receiptsRoot: viem.Hex;
|
|
352
|
+
sealFields: viem.Hex[];
|
|
353
|
+
sha3Uncles: viem.Hash;
|
|
354
|
+
size: bigint;
|
|
355
|
+
stateRoot: viem.Hash;
|
|
356
|
+
timestamp: bigint;
|
|
357
|
+
totalDifficulty: bigint | null;
|
|
358
|
+
transactions: `0x${string}`[] | viem_chains.OpStackTransaction<boolean>[];
|
|
359
|
+
transactionsRoot: viem.Hash;
|
|
360
|
+
uncles: viem.Hash[];
|
|
361
|
+
withdrawals?: viem.Withdrawal[] | undefined | undefined;
|
|
362
|
+
withdrawalsRoot?: `0x${string}` | undefined;
|
|
363
|
+
} & {};
|
|
364
|
+
type: "block";
|
|
365
|
+
};
|
|
366
|
+
readonly transaction: {
|
|
367
|
+
exclude: [] | undefined;
|
|
368
|
+
format: (args: viem_chains.OpStackRpcTransaction, action?: string | undefined) => ({
|
|
369
|
+
blockHash: `0x${string}` | null;
|
|
370
|
+
blockNumber: bigint | null;
|
|
371
|
+
blockTimestamp?: bigint | undefined;
|
|
372
|
+
from: abitype.Address;
|
|
373
|
+
gas: bigint;
|
|
374
|
+
hash: viem.Hash;
|
|
375
|
+
input: viem.Hex;
|
|
376
|
+
nonce: number;
|
|
377
|
+
r: viem.Hex;
|
|
378
|
+
s: viem.Hex;
|
|
379
|
+
to: abitype.Address | null;
|
|
380
|
+
transactionIndex: number | null;
|
|
381
|
+
typeHex: viem.Hex | null;
|
|
382
|
+
v: bigint;
|
|
383
|
+
value: bigint;
|
|
384
|
+
yParity: number;
|
|
385
|
+
gasPrice?: undefined | undefined;
|
|
386
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
387
|
+
maxFeePerGas: bigint;
|
|
388
|
+
maxPriorityFeePerGas: bigint;
|
|
389
|
+
isSystemTx?: boolean;
|
|
390
|
+
mint?: bigint | undefined | undefined;
|
|
391
|
+
sourceHash: viem.Hex;
|
|
392
|
+
type: "deposit";
|
|
393
|
+
} | {
|
|
394
|
+
r: viem.Hex;
|
|
395
|
+
s: viem.Hex;
|
|
396
|
+
v: bigint;
|
|
397
|
+
to: abitype.Address | null;
|
|
398
|
+
from: abitype.Address;
|
|
399
|
+
gas: bigint;
|
|
400
|
+
nonce: number;
|
|
401
|
+
value: bigint;
|
|
402
|
+
blockHash: `0x${string}` | null;
|
|
403
|
+
blockNumber: bigint | null;
|
|
404
|
+
blockTimestamp?: bigint | undefined;
|
|
405
|
+
hash: viem.Hash;
|
|
406
|
+
input: viem.Hex;
|
|
407
|
+
transactionIndex: number | null;
|
|
408
|
+
typeHex: viem.Hex | null;
|
|
409
|
+
accessList?: undefined | undefined;
|
|
410
|
+
authorizationList?: undefined | undefined;
|
|
411
|
+
blobVersionedHashes?: undefined | undefined;
|
|
412
|
+
chainId?: number | undefined;
|
|
413
|
+
yParity?: undefined | undefined;
|
|
414
|
+
type: "legacy";
|
|
415
|
+
gasPrice: bigint;
|
|
416
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
417
|
+
maxFeePerGas?: undefined | undefined;
|
|
418
|
+
maxPriorityFeePerGas?: undefined | undefined;
|
|
419
|
+
isSystemTx?: undefined | undefined;
|
|
420
|
+
mint?: undefined | undefined;
|
|
421
|
+
sourceHash?: undefined | undefined;
|
|
422
|
+
} | {
|
|
423
|
+
blockHash: `0x${string}` | null;
|
|
424
|
+
blockNumber: bigint | null;
|
|
425
|
+
blockTimestamp?: bigint | undefined;
|
|
426
|
+
from: abitype.Address;
|
|
427
|
+
gas: bigint;
|
|
428
|
+
hash: viem.Hash;
|
|
429
|
+
input: viem.Hex;
|
|
430
|
+
nonce: number;
|
|
431
|
+
r: viem.Hex;
|
|
432
|
+
s: viem.Hex;
|
|
433
|
+
to: abitype.Address | null;
|
|
434
|
+
transactionIndex: number | null;
|
|
435
|
+
typeHex: viem.Hex | null;
|
|
436
|
+
v: bigint;
|
|
437
|
+
value: bigint;
|
|
438
|
+
yParity: number;
|
|
439
|
+
accessList: viem.AccessList;
|
|
440
|
+
authorizationList?: undefined | undefined;
|
|
441
|
+
blobVersionedHashes?: undefined | undefined;
|
|
442
|
+
chainId: number;
|
|
443
|
+
type: "eip2930";
|
|
444
|
+
gasPrice: bigint;
|
|
445
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
446
|
+
maxFeePerGas?: undefined | undefined;
|
|
447
|
+
maxPriorityFeePerGas?: undefined | undefined;
|
|
448
|
+
isSystemTx?: undefined | undefined;
|
|
449
|
+
mint?: undefined | undefined;
|
|
450
|
+
sourceHash?: undefined | undefined;
|
|
451
|
+
} | {
|
|
452
|
+
blockHash: `0x${string}` | null;
|
|
453
|
+
blockNumber: bigint | null;
|
|
454
|
+
blockTimestamp?: bigint | undefined;
|
|
455
|
+
from: abitype.Address;
|
|
456
|
+
gas: bigint;
|
|
457
|
+
hash: viem.Hash;
|
|
458
|
+
input: viem.Hex;
|
|
459
|
+
nonce: number;
|
|
460
|
+
r: viem.Hex;
|
|
461
|
+
s: viem.Hex;
|
|
462
|
+
to: abitype.Address | null;
|
|
463
|
+
transactionIndex: number | null;
|
|
464
|
+
typeHex: viem.Hex | null;
|
|
465
|
+
v: bigint;
|
|
466
|
+
value: bigint;
|
|
467
|
+
yParity: number;
|
|
468
|
+
accessList: viem.AccessList;
|
|
469
|
+
authorizationList?: undefined | undefined;
|
|
470
|
+
blobVersionedHashes?: undefined | undefined;
|
|
471
|
+
chainId: number;
|
|
472
|
+
type: "eip1559";
|
|
473
|
+
gasPrice?: undefined | undefined;
|
|
474
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
475
|
+
maxFeePerGas: bigint;
|
|
476
|
+
maxPriorityFeePerGas: bigint;
|
|
477
|
+
isSystemTx?: undefined | undefined;
|
|
478
|
+
mint?: undefined | undefined;
|
|
479
|
+
sourceHash?: undefined | undefined;
|
|
480
|
+
} | {
|
|
481
|
+
blockHash: `0x${string}` | null;
|
|
482
|
+
blockNumber: bigint | null;
|
|
483
|
+
blockTimestamp?: bigint | undefined;
|
|
484
|
+
from: abitype.Address;
|
|
485
|
+
gas: bigint;
|
|
486
|
+
hash: viem.Hash;
|
|
487
|
+
input: viem.Hex;
|
|
488
|
+
nonce: number;
|
|
489
|
+
r: viem.Hex;
|
|
490
|
+
s: viem.Hex;
|
|
491
|
+
to: abitype.Address | null;
|
|
492
|
+
transactionIndex: number | null;
|
|
493
|
+
typeHex: viem.Hex | null;
|
|
494
|
+
v: bigint;
|
|
495
|
+
value: bigint;
|
|
496
|
+
yParity: number;
|
|
497
|
+
accessList: viem.AccessList;
|
|
498
|
+
authorizationList?: undefined | undefined;
|
|
499
|
+
blobVersionedHashes: readonly viem.Hex[];
|
|
500
|
+
chainId: number;
|
|
501
|
+
type: "eip4844";
|
|
502
|
+
gasPrice?: undefined | undefined;
|
|
503
|
+
maxFeePerBlobGas: bigint;
|
|
504
|
+
maxFeePerGas: bigint;
|
|
505
|
+
maxPriorityFeePerGas: bigint;
|
|
506
|
+
isSystemTx?: undefined | undefined;
|
|
507
|
+
mint?: undefined | undefined;
|
|
508
|
+
sourceHash?: undefined | undefined;
|
|
509
|
+
} | {
|
|
510
|
+
blockHash: `0x${string}` | null;
|
|
511
|
+
blockNumber: bigint | null;
|
|
512
|
+
blockTimestamp?: bigint | undefined;
|
|
513
|
+
from: abitype.Address;
|
|
514
|
+
gas: bigint;
|
|
515
|
+
hash: viem.Hash;
|
|
516
|
+
input: viem.Hex;
|
|
517
|
+
nonce: number;
|
|
518
|
+
r: viem.Hex;
|
|
519
|
+
s: viem.Hex;
|
|
520
|
+
to: abitype.Address | null;
|
|
521
|
+
transactionIndex: number | null;
|
|
522
|
+
typeHex: viem.Hex | null;
|
|
523
|
+
v: bigint;
|
|
524
|
+
value: bigint;
|
|
525
|
+
yParity: number;
|
|
526
|
+
accessList: viem.AccessList;
|
|
527
|
+
authorizationList: viem.SignedAuthorizationList;
|
|
528
|
+
blobVersionedHashes?: undefined | undefined;
|
|
529
|
+
chainId: number;
|
|
530
|
+
type: "eip7702";
|
|
531
|
+
gasPrice?: undefined | undefined;
|
|
532
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
533
|
+
maxFeePerGas: bigint;
|
|
534
|
+
maxPriorityFeePerGas: bigint;
|
|
535
|
+
isSystemTx?: undefined | undefined;
|
|
536
|
+
mint?: undefined | undefined;
|
|
537
|
+
sourceHash?: undefined | undefined;
|
|
538
|
+
}) & {};
|
|
539
|
+
type: "transaction";
|
|
540
|
+
};
|
|
541
|
+
readonly transactionReceipt: {
|
|
542
|
+
exclude: [] | undefined;
|
|
543
|
+
format: (args: viem_chains.OpStackRpcTransactionReceipt, action?: string | undefined) => {
|
|
544
|
+
blobGasPrice?: bigint | undefined;
|
|
545
|
+
blobGasUsed?: bigint | undefined;
|
|
546
|
+
blockHash: viem.Hash;
|
|
547
|
+
blockNumber: bigint;
|
|
548
|
+
blockTimestamp?: bigint | undefined;
|
|
549
|
+
contractAddress: abitype.Address | null | undefined;
|
|
550
|
+
cumulativeGasUsed: bigint;
|
|
551
|
+
effectiveGasPrice: bigint;
|
|
552
|
+
from: abitype.Address;
|
|
553
|
+
gasUsed: bigint;
|
|
554
|
+
logs: viem.Log<bigint, number, false>[];
|
|
555
|
+
logsBloom: viem.Hex;
|
|
556
|
+
root?: `0x${string}` | undefined;
|
|
557
|
+
status: "success" | "reverted";
|
|
558
|
+
to: abitype.Address | null;
|
|
559
|
+
transactionHash: viem.Hash;
|
|
560
|
+
transactionIndex: number;
|
|
561
|
+
type: viem.TransactionType;
|
|
562
|
+
l1GasPrice: bigint | null;
|
|
563
|
+
l1GasUsed: bigint | null;
|
|
564
|
+
l1Fee: bigint | null;
|
|
565
|
+
l1FeeScalar: number | null;
|
|
566
|
+
} & {};
|
|
567
|
+
type: "transactionReceipt";
|
|
568
|
+
};
|
|
569
|
+
};
|
|
570
|
+
prepareTransactionRequest?: ((args: viem.PrepareTransactionRequestParameters, options: {
|
|
571
|
+
client: viem.Client;
|
|
572
|
+
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
573
|
+
}) => Promise<viem.PrepareTransactionRequestParameters>) | [fn: ((args: viem.PrepareTransactionRequestParameters, options: {
|
|
574
|
+
client: viem.Client;
|
|
575
|
+
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
576
|
+
}) => Promise<viem.PrepareTransactionRequestParameters>) | undefined, options: {
|
|
577
|
+
runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
|
|
578
|
+
}] | undefined;
|
|
579
|
+
serializers: {
|
|
580
|
+
readonly transaction: typeof viem_chains.serializeTransactionOpStack;
|
|
581
|
+
};
|
|
582
|
+
verifyHash?: ((client: viem.Client, parameters: viem.VerifyHashActionParameters) => Promise<viem.VerifyHashActionReturnType>) | undefined;
|
|
583
|
+
};
|
|
584
|
+
tokens: {
|
|
585
|
+
USDC: {
|
|
586
|
+
address: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913";
|
|
587
|
+
decimals: number;
|
|
588
|
+
symbol: string;
|
|
589
|
+
};
|
|
590
|
+
};
|
|
591
|
+
};
|
|
592
|
+
arbitrum: {
|
|
593
|
+
chain: {
|
|
594
|
+
blockExplorers: {
|
|
595
|
+
readonly default: {
|
|
596
|
+
readonly name: "Arbiscan";
|
|
597
|
+
readonly url: "https://arbiscan.io";
|
|
598
|
+
readonly apiUrl: "https://api.arbiscan.io/api";
|
|
599
|
+
};
|
|
600
|
+
};
|
|
601
|
+
blockTime: 250;
|
|
602
|
+
contracts: {
|
|
603
|
+
readonly multicall3: {
|
|
604
|
+
readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
|
|
605
|
+
readonly blockCreated: 7654707;
|
|
606
|
+
};
|
|
607
|
+
};
|
|
608
|
+
ensTlds?: readonly string[] | undefined;
|
|
609
|
+
id: 42161;
|
|
610
|
+
name: "Arbitrum One";
|
|
611
|
+
nativeCurrency: {
|
|
612
|
+
readonly name: "Ether";
|
|
613
|
+
readonly symbol: "ETH";
|
|
614
|
+
readonly decimals: 18;
|
|
615
|
+
};
|
|
616
|
+
experimental_preconfirmationTime?: number | undefined | undefined;
|
|
617
|
+
rpcUrls: {
|
|
618
|
+
readonly default: {
|
|
619
|
+
readonly http: readonly ["https://arb1.arbitrum.io/rpc"];
|
|
620
|
+
};
|
|
621
|
+
};
|
|
622
|
+
sourceId?: number | undefined | undefined;
|
|
623
|
+
testnet?: boolean | undefined | undefined;
|
|
624
|
+
custom?: Record<string, unknown> | undefined;
|
|
625
|
+
extendSchema?: Record<string, unknown> | undefined;
|
|
626
|
+
fees?: viem.ChainFees<undefined> | undefined;
|
|
627
|
+
formatters?: undefined;
|
|
628
|
+
prepareTransactionRequest?: ((args: viem.PrepareTransactionRequestParameters, options: {
|
|
629
|
+
client: viem.Client;
|
|
630
|
+
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
631
|
+
}) => Promise<viem.PrepareTransactionRequestParameters>) | [fn: ((args: viem.PrepareTransactionRequestParameters, options: {
|
|
632
|
+
client: viem.Client;
|
|
633
|
+
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
634
|
+
}) => Promise<viem.PrepareTransactionRequestParameters>) | undefined, options: {
|
|
635
|
+
runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
|
|
636
|
+
}] | undefined;
|
|
637
|
+
serializers?: viem.ChainSerializers<undefined, viem.TransactionSerializable> | undefined;
|
|
638
|
+
verifyHash?: ((client: viem.Client, parameters: viem.VerifyHashActionParameters) => Promise<viem.VerifyHashActionReturnType>) | undefined;
|
|
639
|
+
};
|
|
640
|
+
tokens: {
|
|
641
|
+
USDC: {
|
|
642
|
+
address: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831";
|
|
643
|
+
decimals: number;
|
|
644
|
+
symbol: string;
|
|
645
|
+
};
|
|
646
|
+
USDT: {
|
|
647
|
+
address: "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9";
|
|
648
|
+
decimals: number;
|
|
649
|
+
symbol: string;
|
|
650
|
+
};
|
|
651
|
+
};
|
|
652
|
+
};
|
|
653
|
+
optimism: {
|
|
654
|
+
chain: {
|
|
655
|
+
blockExplorers: {
|
|
656
|
+
readonly default: {
|
|
657
|
+
readonly name: "Optimism Explorer";
|
|
658
|
+
readonly url: "https://optimistic.etherscan.io";
|
|
659
|
+
readonly apiUrl: "https://api-optimistic.etherscan.io/api";
|
|
660
|
+
};
|
|
661
|
+
};
|
|
662
|
+
blockTime: 2000;
|
|
663
|
+
contracts: {
|
|
664
|
+
readonly disputeGameFactory: {
|
|
665
|
+
readonly 1: {
|
|
666
|
+
readonly address: "0xe5965Ab5962eDc7477C8520243A95517CD252fA9";
|
|
667
|
+
};
|
|
668
|
+
};
|
|
669
|
+
readonly l2OutputOracle: {
|
|
670
|
+
readonly 1: {
|
|
671
|
+
readonly address: "0xdfe97868233d1aa22e815a266982f2cf17685a27";
|
|
672
|
+
};
|
|
673
|
+
};
|
|
674
|
+
readonly multicall3: {
|
|
675
|
+
readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
|
|
676
|
+
readonly blockCreated: 4286263;
|
|
677
|
+
};
|
|
678
|
+
readonly portal: {
|
|
679
|
+
readonly 1: {
|
|
680
|
+
readonly address: "0xbEb5Fc579115071764c7423A4f12eDde41f106Ed";
|
|
681
|
+
};
|
|
682
|
+
};
|
|
683
|
+
readonly l1StandardBridge: {
|
|
684
|
+
readonly 1: {
|
|
685
|
+
readonly address: "0x99C9fc46f92E8a1c0deC1b1747d010903E884bE1";
|
|
686
|
+
};
|
|
687
|
+
};
|
|
688
|
+
readonly gasPriceOracle: {
|
|
689
|
+
readonly address: "0x420000000000000000000000000000000000000F";
|
|
690
|
+
};
|
|
691
|
+
readonly l1Block: {
|
|
692
|
+
readonly address: "0x4200000000000000000000000000000000000015";
|
|
693
|
+
};
|
|
694
|
+
readonly l2CrossDomainMessenger: {
|
|
695
|
+
readonly address: "0x4200000000000000000000000000000000000007";
|
|
696
|
+
};
|
|
697
|
+
readonly l2Erc721Bridge: {
|
|
698
|
+
readonly address: "0x4200000000000000000000000000000000000014";
|
|
699
|
+
};
|
|
700
|
+
readonly l2StandardBridge: {
|
|
701
|
+
readonly address: "0x4200000000000000000000000000000000000010";
|
|
702
|
+
};
|
|
703
|
+
readonly l2ToL1MessagePasser: {
|
|
704
|
+
readonly address: "0x4200000000000000000000000000000000000016";
|
|
705
|
+
};
|
|
706
|
+
};
|
|
707
|
+
ensTlds?: readonly string[] | undefined;
|
|
708
|
+
id: 10;
|
|
709
|
+
name: "OP Mainnet";
|
|
710
|
+
nativeCurrency: {
|
|
711
|
+
readonly name: "Ether";
|
|
712
|
+
readonly symbol: "ETH";
|
|
713
|
+
readonly decimals: 18;
|
|
714
|
+
};
|
|
715
|
+
experimental_preconfirmationTime?: number | undefined | undefined;
|
|
716
|
+
rpcUrls: {
|
|
717
|
+
readonly default: {
|
|
718
|
+
readonly http: readonly ["https://mainnet.optimism.io"];
|
|
719
|
+
};
|
|
720
|
+
};
|
|
721
|
+
sourceId: 1;
|
|
722
|
+
testnet?: boolean | undefined | undefined;
|
|
723
|
+
custom?: Record<string, unknown> | undefined;
|
|
724
|
+
extendSchema?: Record<string, unknown> | undefined;
|
|
725
|
+
fees?: viem.ChainFees<undefined> | undefined;
|
|
726
|
+
formatters: {
|
|
727
|
+
readonly block: {
|
|
728
|
+
exclude: [] | undefined;
|
|
729
|
+
format: (args: viem_chains.OpStackRpcBlock, action?: string | undefined) => {
|
|
730
|
+
baseFeePerGas: bigint | null;
|
|
731
|
+
blobGasUsed: bigint;
|
|
732
|
+
difficulty: bigint;
|
|
733
|
+
excessBlobGas: bigint;
|
|
734
|
+
extraData: viem.Hex;
|
|
735
|
+
gasLimit: bigint;
|
|
736
|
+
gasUsed: bigint;
|
|
737
|
+
hash: `0x${string}` | null;
|
|
738
|
+
logsBloom: `0x${string}` | null;
|
|
739
|
+
miner: abitype.Address;
|
|
740
|
+
mixHash: viem.Hash;
|
|
741
|
+
nonce: `0x${string}` | null;
|
|
742
|
+
number: bigint | null;
|
|
743
|
+
parentBeaconBlockRoot?: `0x${string}` | undefined;
|
|
744
|
+
parentHash: viem.Hash;
|
|
745
|
+
receiptsRoot: viem.Hex;
|
|
746
|
+
sealFields: viem.Hex[];
|
|
747
|
+
sha3Uncles: viem.Hash;
|
|
748
|
+
size: bigint;
|
|
749
|
+
stateRoot: viem.Hash;
|
|
750
|
+
timestamp: bigint;
|
|
751
|
+
totalDifficulty: bigint | null;
|
|
752
|
+
transactions: `0x${string}`[] | viem_chains.OpStackTransaction<boolean>[];
|
|
753
|
+
transactionsRoot: viem.Hash;
|
|
754
|
+
uncles: viem.Hash[];
|
|
755
|
+
withdrawals?: viem.Withdrawal[] | undefined | undefined;
|
|
756
|
+
withdrawalsRoot?: `0x${string}` | undefined;
|
|
757
|
+
} & {};
|
|
758
|
+
type: "block";
|
|
759
|
+
};
|
|
760
|
+
readonly transaction: {
|
|
761
|
+
exclude: [] | undefined;
|
|
762
|
+
format: (args: viem_chains.OpStackRpcTransaction, action?: string | undefined) => ({
|
|
763
|
+
blockHash: `0x${string}` | null;
|
|
764
|
+
blockNumber: bigint | null;
|
|
765
|
+
blockTimestamp?: bigint | undefined;
|
|
766
|
+
from: abitype.Address;
|
|
767
|
+
gas: bigint;
|
|
768
|
+
hash: viem.Hash;
|
|
769
|
+
input: viem.Hex;
|
|
770
|
+
nonce: number;
|
|
771
|
+
r: viem.Hex;
|
|
772
|
+
s: viem.Hex;
|
|
773
|
+
to: abitype.Address | null;
|
|
774
|
+
transactionIndex: number | null;
|
|
775
|
+
typeHex: viem.Hex | null;
|
|
776
|
+
v: bigint;
|
|
777
|
+
value: bigint;
|
|
778
|
+
yParity: number;
|
|
779
|
+
gasPrice?: undefined | undefined;
|
|
780
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
781
|
+
maxFeePerGas: bigint;
|
|
782
|
+
maxPriorityFeePerGas: bigint;
|
|
783
|
+
isSystemTx?: boolean;
|
|
784
|
+
mint?: bigint | undefined | undefined;
|
|
785
|
+
sourceHash: viem.Hex;
|
|
786
|
+
type: "deposit";
|
|
787
|
+
} | {
|
|
788
|
+
r: viem.Hex;
|
|
789
|
+
s: viem.Hex;
|
|
790
|
+
v: bigint;
|
|
791
|
+
to: abitype.Address | null;
|
|
792
|
+
from: abitype.Address;
|
|
793
|
+
gas: bigint;
|
|
794
|
+
nonce: number;
|
|
795
|
+
value: bigint;
|
|
796
|
+
blockHash: `0x${string}` | null;
|
|
797
|
+
blockNumber: bigint | null;
|
|
798
|
+
blockTimestamp?: bigint | undefined;
|
|
799
|
+
hash: viem.Hash;
|
|
800
|
+
input: viem.Hex;
|
|
801
|
+
transactionIndex: number | null;
|
|
802
|
+
typeHex: viem.Hex | null;
|
|
803
|
+
accessList?: undefined | undefined;
|
|
804
|
+
authorizationList?: undefined | undefined;
|
|
805
|
+
blobVersionedHashes?: undefined | undefined;
|
|
806
|
+
chainId?: number | undefined;
|
|
807
|
+
yParity?: undefined | undefined;
|
|
808
|
+
type: "legacy";
|
|
809
|
+
gasPrice: bigint;
|
|
810
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
811
|
+
maxFeePerGas?: undefined | undefined;
|
|
812
|
+
maxPriorityFeePerGas?: undefined | undefined;
|
|
813
|
+
isSystemTx?: undefined | undefined;
|
|
814
|
+
mint?: undefined | undefined;
|
|
815
|
+
sourceHash? /** Display name. Defaults to `EVM <id>`. */: undefined | undefined;
|
|
816
|
+
} | {
|
|
817
|
+
blockHash: `0x${string}` | null;
|
|
818
|
+
blockNumber: bigint | null;
|
|
819
|
+
blockTimestamp?: bigint | undefined;
|
|
820
|
+
from: abitype.Address;
|
|
821
|
+
gas: bigint;
|
|
822
|
+
hash: viem.Hash;
|
|
823
|
+
input: viem.Hex;
|
|
824
|
+
nonce: number;
|
|
825
|
+
r: viem.Hex;
|
|
826
|
+
s: viem.Hex;
|
|
827
|
+
to: abitype.Address | null;
|
|
828
|
+
transactionIndex: number | null;
|
|
829
|
+
typeHex: viem.Hex | null;
|
|
830
|
+
v: bigint;
|
|
831
|
+
value: bigint;
|
|
832
|
+
yParity: number;
|
|
833
|
+
accessList: viem.AccessList;
|
|
834
|
+
authorizationList?: undefined | undefined;
|
|
835
|
+
blobVersionedHashes?: undefined | undefined;
|
|
836
|
+
chainId: number;
|
|
837
|
+
type: "eip2930";
|
|
838
|
+
gasPrice: bigint;
|
|
839
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
840
|
+
maxFeePerGas?: undefined | undefined;
|
|
841
|
+
maxPriorityFeePerGas?: undefined | undefined;
|
|
842
|
+
isSystemTx?: undefined | undefined;
|
|
843
|
+
mint?: undefined | undefined;
|
|
844
|
+
sourceHash?: undefined | undefined;
|
|
845
|
+
} | {
|
|
846
|
+
blockHash: `0x${string}` | null;
|
|
847
|
+
blockNumber: bigint | null;
|
|
848
|
+
blockTimestamp?: bigint | undefined;
|
|
849
|
+
from: abitype.Address;
|
|
850
|
+
gas: bigint;
|
|
851
|
+
hash: viem.Hash;
|
|
852
|
+
input: viem.Hex;
|
|
853
|
+
nonce: number;
|
|
854
|
+
r: viem.Hex;
|
|
855
|
+
s: viem.Hex;
|
|
856
|
+
to: abitype.Address | null;
|
|
857
|
+
transactionIndex: number | null;
|
|
858
|
+
typeHex: viem.Hex | null;
|
|
859
|
+
v: bigint;
|
|
860
|
+
value: bigint;
|
|
861
|
+
yParity: number;
|
|
862
|
+
accessList: viem.AccessList;
|
|
863
|
+
authorizationList?: undefined | undefined;
|
|
864
|
+
blobVersionedHashes?: undefined | undefined;
|
|
865
|
+
chainId: number;
|
|
866
|
+
type: "eip1559";
|
|
867
|
+
gasPrice?: undefined | undefined;
|
|
868
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
869
|
+
maxFeePerGas: bigint;
|
|
870
|
+
maxPriorityFeePerGas: bigint;
|
|
871
|
+
isSystemTx?: undefined | undefined;
|
|
872
|
+
mint?: undefined | undefined;
|
|
873
|
+
sourceHash?: undefined | undefined;
|
|
874
|
+
} | {
|
|
875
|
+
blockHash: `0x${string}` | null;
|
|
876
|
+
blockNumber: bigint | null;
|
|
877
|
+
blockTimestamp?: bigint | undefined;
|
|
878
|
+
from: abitype.Address;
|
|
879
|
+
gas: bigint;
|
|
880
|
+
hash: viem.Hash;
|
|
881
|
+
input: viem.Hex;
|
|
882
|
+
nonce: number;
|
|
883
|
+
r: viem.Hex;
|
|
884
|
+
s: viem.Hex;
|
|
885
|
+
to: abitype.Address | null;
|
|
886
|
+
transactionIndex: number | null;
|
|
887
|
+
typeHex: viem.Hex | null;
|
|
888
|
+
v: bigint;
|
|
889
|
+
value: bigint;
|
|
890
|
+
yParity: number;
|
|
891
|
+
accessList: viem.AccessList;
|
|
892
|
+
authorizationList?: undefined | undefined;
|
|
893
|
+
blobVersionedHashes: readonly viem.Hex[];
|
|
894
|
+
chainId: number;
|
|
895
|
+
type: "eip4844";
|
|
896
|
+
gasPrice?: undefined | undefined;
|
|
897
|
+
maxFeePerBlobGas: bigint;
|
|
898
|
+
maxFeePerGas: bigint;
|
|
899
|
+
maxPriorityFeePerGas: bigint;
|
|
900
|
+
isSystemTx?: undefined | undefined;
|
|
901
|
+
mint?: undefined | undefined;
|
|
902
|
+
sourceHash?: undefined | undefined;
|
|
903
|
+
} | {
|
|
904
|
+
blockHash: `0x${string}` | null;
|
|
905
|
+
blockNumber: bigint | null;
|
|
906
|
+
blockTimestamp?: bigint | undefined;
|
|
907
|
+
from: abitype.Address;
|
|
908
|
+
gas: bigint;
|
|
909
|
+
hash: viem.Hash;
|
|
910
|
+
input: viem.Hex;
|
|
911
|
+
nonce: number;
|
|
912
|
+
r: viem.Hex;
|
|
913
|
+
s: viem.Hex;
|
|
914
|
+
to: abitype.Address | null;
|
|
915
|
+
transactionIndex: number | null;
|
|
916
|
+
typeHex: viem.Hex | null;
|
|
917
|
+
v: bigint;
|
|
918
|
+
value: bigint;
|
|
919
|
+
yParity: number;
|
|
920
|
+
accessList: viem.AccessList;
|
|
921
|
+
authorizationList: viem.SignedAuthorizationList;
|
|
922
|
+
blobVersionedHashes?: undefined | undefined;
|
|
923
|
+
chainId: number;
|
|
924
|
+
type: "eip7702";
|
|
925
|
+
gasPrice?: undefined | undefined;
|
|
926
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
927
|
+
maxFeePerGas: bigint;
|
|
928
|
+
maxPriorityFeePerGas: bigint;
|
|
929
|
+
isSystemTx?: undefined | undefined;
|
|
930
|
+
mint?: undefined | undefined;
|
|
931
|
+
sourceHash?: undefined | undefined;
|
|
932
|
+
}) & {};
|
|
933
|
+
type: "transaction";
|
|
934
|
+
};
|
|
935
|
+
readonly transactionReceipt: {
|
|
936
|
+
exclude: [] | undefined;
|
|
937
|
+
format: (args: viem_chains.OpStackRpcTransactionReceipt, action?: string | undefined) => {
|
|
938
|
+
blobGasPrice?: bigint | undefined;
|
|
939
|
+
blobGasUsed?: bigint | undefined;
|
|
940
|
+
blockHash: viem.Hash;
|
|
941
|
+
blockNumber: bigint;
|
|
942
|
+
blockTimestamp?: bigint | undefined;
|
|
943
|
+
contractAddress: abitype.Address | null | undefined;
|
|
944
|
+
cumulativeGasUsed: bigint;
|
|
945
|
+
effectiveGasPrice: bigint;
|
|
946
|
+
from: abitype.Address;
|
|
947
|
+
gasUsed: bigint;
|
|
948
|
+
logs: viem.Log<bigint, number, false>[];
|
|
949
|
+
logsBloom: viem.Hex;
|
|
950
|
+
root?: `0x${string}` | undefined;
|
|
951
|
+
status: "success" | "reverted";
|
|
952
|
+
to: abitype.Address | null;
|
|
953
|
+
transactionHash: viem.Hash;
|
|
954
|
+
transactionIndex: number;
|
|
955
|
+
type: viem.TransactionType;
|
|
956
|
+
l1GasPrice: bigint | null;
|
|
957
|
+
l1GasUsed: bigint | null;
|
|
958
|
+
l1Fee: bigint | null;
|
|
959
|
+
l1FeeScalar: number | null;
|
|
960
|
+
} & {};
|
|
961
|
+
type: "transactionReceipt";
|
|
962
|
+
};
|
|
963
|
+
};
|
|
964
|
+
prepareTransactionRequest?: ((args: viem.PrepareTransactionRequestParameters, options: {
|
|
965
|
+
client: viem.Client;
|
|
966
|
+
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
967
|
+
}) => Promise<viem.PrepareTransactionRequestParameters>) | [fn: ((args: viem.PrepareTransactionRequestParameters, options: {
|
|
968
|
+
client: viem.Client;
|
|
969
|
+
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
970
|
+
}) => Promise<viem.PrepareTransactionRequestParameters>) | undefined, options: {
|
|
971
|
+
runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
|
|
972
|
+
}] | undefined;
|
|
973
|
+
serializers: {
|
|
974
|
+
readonly transaction: typeof viem_chains.serializeTransactionOpStack;
|
|
975
|
+
};
|
|
976
|
+
verifyHash?: ((client: viem.Client, parameters: viem.VerifyHashActionParameters) => Promise<viem.VerifyHashActionReturnType>) | undefined;
|
|
977
|
+
};
|
|
978
|
+
tokens: {
|
|
979
|
+
USDC: {
|
|
980
|
+
address: "0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85";
|
|
981
|
+
decimals: number;
|
|
982
|
+
symbol: string;
|
|
983
|
+
};
|
|
984
|
+
USDT: {
|
|
985
|
+
address: "0x94b008aA00579c1307B0EF2c499aD98a8ce58e58";
|
|
986
|
+
decimals: number;
|
|
987
|
+
symbol: string;
|
|
988
|
+
};
|
|
989
|
+
};
|
|
990
|
+
};
|
|
991
|
+
polygon: {
|
|
992
|
+
chain: {
|
|
993
|
+
blockExplorers: {
|
|
994
|
+
readonly default: {
|
|
995
|
+
readonly name: "PolygonScan";
|
|
996
|
+
readonly url: "https://polygonscan.com";
|
|
997
|
+
readonly apiUrl: "https://api.etherscan.io/v2/api";
|
|
998
|
+
};
|
|
999
|
+
};
|
|
1000
|
+
blockTime: 2000;
|
|
1001
|
+
contracts: {
|
|
1002
|
+
readonly multicall3: {
|
|
1003
|
+
readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
|
|
1004
|
+
readonly blockCreated: 25770160;
|
|
1005
|
+
};
|
|
1006
|
+
};
|
|
1007
|
+
ensTlds?: readonly string[] | undefined;
|
|
1008
|
+
id: 137;
|
|
1009
|
+
name: "Polygon";
|
|
1010
|
+
nativeCurrency: {
|
|
1011
|
+
readonly name: "POL";
|
|
1012
|
+
readonly symbol: "POL";
|
|
1013
|
+
readonly decimals: 18;
|
|
1014
|
+
};
|
|
1015
|
+
experimental_preconfirmationTime?: number | undefined | undefined;
|
|
1016
|
+
rpcUrls: {
|
|
1017
|
+
readonly default: {
|
|
1018
|
+
readonly http: readonly ["https://polygon.drpc.org"];
|
|
1019
|
+
};
|
|
1020
|
+
};
|
|
1021
|
+
sourceId?: number | undefined | undefined;
|
|
1022
|
+
testnet?: boolean | undefined | undefined;
|
|
1023
|
+
custom?: Record<string, unknown> | undefined;
|
|
1024
|
+
extendSchema?: Record<string, unknown> | undefined;
|
|
1025
|
+
fees?: viem.ChainFees<undefined> | undefined;
|
|
1026
|
+
formatters?: undefined;
|
|
1027
|
+
prepareTransactionRequest?: ((args: viem.PrepareTransactionRequestParameters, options: {
|
|
1028
|
+
client: viem.Client;
|
|
1029
|
+
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
1030
|
+
}) => Promise<viem.PrepareTransactionRequestParameters>) | [fn: ((args: viem.PrepareTransactionRequestParameters, options: {
|
|
1031
|
+
client: viem.Client;
|
|
1032
|
+
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
1033
|
+
}) => Promise<viem.PrepareTransactionRequestParameters>) | undefined, options: {
|
|
1034
|
+
runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
|
|
1035
|
+
}] | undefined;
|
|
1036
|
+
serializers?: viem.ChainSerializers<undefined, viem.TransactionSerializable> | undefined;
|
|
1037
|
+
verifyHash?: ((client: viem.Client, parameters: viem.VerifyHashActionParameters) => Promise<viem.VerifyHashActionReturnType>) | undefined;
|
|
1038
|
+
};
|
|
1039
|
+
tokens: {
|
|
1040
|
+
USDC: {
|
|
1041
|
+
address: "0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359";
|
|
1042
|
+
decimals: number;
|
|
1043
|
+
symbol: string;
|
|
1044
|
+
};
|
|
1045
|
+
USDT: {
|
|
1046
|
+
address: "0xc2132D05D31c914a87C6611C10748AEb04B58e8F";
|
|
1047
|
+
decimals: number;
|
|
1048
|
+
symbol: string;
|
|
1049
|
+
};
|
|
1050
|
+
};
|
|
1051
|
+
};
|
|
1052
|
+
bnb: {
|
|
1053
|
+
chain: {
|
|
1054
|
+
blockExplorers: {
|
|
1055
|
+
readonly default: {
|
|
1056
|
+
readonly name: "BscScan";
|
|
1057
|
+
readonly url: "https://bscscan.com";
|
|
1058
|
+
readonly apiUrl: "https://api.bscscan.com/api";
|
|
1059
|
+
};
|
|
1060
|
+
};
|
|
1061
|
+
blockTime: 750;
|
|
1062
|
+
contracts: {
|
|
1063
|
+
readonly multicall3: {
|
|
1064
|
+
readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
|
|
1065
|
+
readonly blockCreated: 15921452;
|
|
1066
|
+
};
|
|
1067
|
+
};
|
|
1068
|
+
ensTlds?: readonly string[] | undefined;
|
|
1069
|
+
id: 56;
|
|
1070
|
+
name: "BNB Smart Chain";
|
|
1071
|
+
nativeCurrency: {
|
|
1072
|
+
readonly decimals: 18;
|
|
1073
|
+
readonly name: "BNB";
|
|
1074
|
+
readonly symbol: "BNB";
|
|
1075
|
+
};
|
|
1076
|
+
experimental_preconfirmationTime?: number | undefined | undefined;
|
|
1077
|
+
rpcUrls: {
|
|
1078
|
+
readonly default: {
|
|
1079
|
+
readonly http: readonly ["https://56.rpc.thirdweb.com"];
|
|
1080
|
+
};
|
|
1081
|
+
};
|
|
1082
|
+
sourceId?: number | undefined | undefined;
|
|
1083
|
+
testnet?: boolean | undefined | undefined;
|
|
1084
|
+
custom?: Record<string, unknown> | undefined;
|
|
1085
|
+
extendSchema?: Record<string, unknown> | undefined;
|
|
1086
|
+
fees?: viem.ChainFees<undefined> | undefined;
|
|
1087
|
+
formatters?: undefined;
|
|
1088
|
+
prepareTransactionRequest?: ((args: viem.PrepareTransactionRequestParameters, options: {
|
|
1089
|
+
client: viem.Client;
|
|
1090
|
+
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
1091
|
+
}) => Promise<viem.PrepareTransactionRequestParameters>) | [fn: ((args: viem.PrepareTransactionRequestParameters, options: {
|
|
1092
|
+
client: viem.Client;
|
|
1093
|
+
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
1094
|
+
}) => Promise<viem.PrepareTransactionRequestParameters>) | undefined, options: {
|
|
1095
|
+
runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
|
|
1096
|
+
}] | undefined;
|
|
1097
|
+
serializers?: viem.ChainSerializers<undefined, viem.TransactionSerializable> | undefined;
|
|
1098
|
+
verifyHash?: ((client: viem.Client, parameters: viem.VerifyHashActionParameters) => Promise<viem.VerifyHashActionReturnType>) | undefined;
|
|
1099
|
+
};
|
|
1100
|
+
tokens: {
|
|
1101
|
+
USDC: {
|
|
1102
|
+
address: "0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d";
|
|
1103
|
+
decimals: number;
|
|
1104
|
+
symbol: string;
|
|
1105
|
+
};
|
|
1106
|
+
USDT: {
|
|
1107
|
+
address: "0x55d398326f99059fF775485246999027B3197955";
|
|
1108
|
+
decimals: number;
|
|
1109
|
+
symbol: string;
|
|
1110
|
+
};
|
|
1111
|
+
};
|
|
1112
|
+
};
|
|
1113
|
+
avalanche: {
|
|
1114
|
+
chain: {
|
|
1115
|
+
blockExplorers: {
|
|
1116
|
+
readonly default: {
|
|
1117
|
+
readonly name: "SnowTrace";
|
|
1118
|
+
readonly url: "https://snowtrace.io";
|
|
1119
|
+
readonly apiUrl: "https://api.snowtrace.io";
|
|
1120
|
+
};
|
|
1121
|
+
};
|
|
1122
|
+
blockTime: 1700;
|
|
1123
|
+
contracts: {
|
|
1124
|
+
readonly multicall3: {
|
|
1125
|
+
readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
|
|
1126
|
+
readonly blockCreated: 11907934;
|
|
1127
|
+
};
|
|
1128
|
+
};
|
|
1129
|
+
ensTlds?: readonly string[] | undefined;
|
|
1130
|
+
id: 43114;
|
|
1131
|
+
name: "Avalanche";
|
|
1132
|
+
nativeCurrency: {
|
|
1133
|
+
readonly decimals: 18;
|
|
1134
|
+
readonly name: "Avalanche";
|
|
1135
|
+
readonly symbol: "AVAX";
|
|
1136
|
+
};
|
|
1137
|
+
experimental_preconfirmationTime?: number | undefined | undefined;
|
|
1138
|
+
rpcUrls: {
|
|
1139
|
+
readonly default: {
|
|
1140
|
+
readonly http: readonly ["https://api.avax.network/ext/bc/C/rpc"];
|
|
1141
|
+
};
|
|
1142
|
+
};
|
|
1143
|
+
sourceId?: number | undefined | undefined;
|
|
1144
|
+
testnet?: boolean | undefined | undefined;
|
|
1145
|
+
custom?: Record<string, unknown> | undefined;
|
|
1146
|
+
extendSchema?: Record<string, unknown> | undefined;
|
|
1147
|
+
fees?: viem.ChainFees<undefined> | undefined;
|
|
1148
|
+
formatters?: undefined;
|
|
1149
|
+
prepareTransactionRequest?: ((args: viem.PrepareTransactionRequestParameters, options: {
|
|
1150
|
+
client: viem.Client;
|
|
1151
|
+
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
1152
|
+
}) => Promise<viem.PrepareTransactionRequestParameters>) | [fn: ((args: viem.PrepareTransactionRequestParameters, options: {
|
|
1153
|
+
client: viem.Client;
|
|
1154
|
+
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
1155
|
+
}) => Promise<viem.PrepareTransactionRequestParameters>) | undefined, options: {
|
|
1156
|
+
runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
|
|
1157
|
+
}] | undefined;
|
|
1158
|
+
serializers?: viem.ChainSerializers<undefined, viem.TransactionSerializable> | undefined;
|
|
1159
|
+
verifyHash?: ((client: viem.Client, parameters: viem.VerifyHashActionParameters) => Promise<viem.VerifyHashActionReturnType>) | undefined;
|
|
1160
|
+
};
|
|
1161
|
+
tokens: {
|
|
1162
|
+
USDC: {
|
|
1163
|
+
address: "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E";
|
|
1164
|
+
decimals: number;
|
|
1165
|
+
symbol: string;
|
|
1166
|
+
};
|
|
1167
|
+
USDT: {
|
|
1168
|
+
address: "0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7";
|
|
1169
|
+
decimals: number;
|
|
1170
|
+
symbol: string;
|
|
1171
|
+
};
|
|
1172
|
+
};
|
|
1173
|
+
};
|
|
1174
|
+
mantle: {
|
|
1175
|
+
chain: {
|
|
1176
|
+
blockExplorers: {
|
|
1177
|
+
readonly default: {
|
|
1178
|
+
readonly name: "Mantle Explorer";
|
|
1179
|
+
readonly url: "https://mantlescan.xyz/";
|
|
1180
|
+
readonly apiUrl: "https://api.mantlescan.xyz/api";
|
|
1181
|
+
};
|
|
1182
|
+
};
|
|
1183
|
+
blockTime?: number | undefined | undefined;
|
|
1184
|
+
contracts: {
|
|
1185
|
+
readonly multicall3: {
|
|
1186
|
+
readonly address: "0xcA11bde05977b3631167028862bE2a173976CA11";
|
|
1187
|
+
readonly blockCreated: 304717;
|
|
1188
|
+
};
|
|
1189
|
+
};
|
|
1190
|
+
ensTlds?: readonly string[] | undefined;
|
|
1191
|
+
id: 5000;
|
|
1192
|
+
name: "Mantle";
|
|
1193
|
+
nativeCurrency: {
|
|
1194
|
+
readonly decimals: 18;
|
|
1195
|
+
readonly name: "MNT";
|
|
1196
|
+
readonly symbol: "MNT";
|
|
1197
|
+
};
|
|
1198
|
+
experimental_preconfirmationTime?: number | undefined | undefined;
|
|
1199
|
+
rpcUrls: {
|
|
1200
|
+
readonly default: {
|
|
1201
|
+
readonly http: readonly ["https://rpc.mantle.xyz"];
|
|
1202
|
+
};
|
|
1203
|
+
};
|
|
1204
|
+
sourceId?: number | undefined | undefined;
|
|
1205
|
+
testnet?: boolean | undefined | undefined;
|
|
1206
|
+
custom?: Record<string, unknown> | undefined;
|
|
1207
|
+
extendSchema?: Record<string, unknown> | undefined;
|
|
1208
|
+
fees?: viem.ChainFees<undefined> | undefined;
|
|
1209
|
+
formatters?: undefined;
|
|
1210
|
+
prepareTransactionRequest?: ((args: viem.PrepareTransactionRequestParameters, options: {
|
|
1211
|
+
client: viem.Client;
|
|
1212
|
+
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
1213
|
+
}) => Promise<viem.PrepareTransactionRequestParameters>) | [fn: ((args: viem.PrepareTransactionRequestParameters, options: {
|
|
1214
|
+
client: viem.Client;
|
|
1215
|
+
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
1216
|
+
}) => Promise<viem.PrepareTransactionRequestParameters>) | undefined, options: {
|
|
1217
|
+
runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
|
|
1218
|
+
}] | undefined;
|
|
1219
|
+
serializers?: viem.ChainSerializers<undefined, viem.TransactionSerializable> | undefined;
|
|
1220
|
+
verifyHash?: ((client: viem.Client, parameters: viem.VerifyHashActionParameters) => Promise<viem.VerifyHashActionReturnType>) | undefined;
|
|
1221
|
+
};
|
|
1222
|
+
tokens: {
|
|
1223
|
+
USDC: {
|
|
1224
|
+
address: "0x09Bc4E0D864854c6aFB6eB9A9cdF58aC190D0dF9";
|
|
1225
|
+
decimals: number;
|
|
1226
|
+
symbol: string;
|
|
1227
|
+
};
|
|
1228
|
+
USDT: {
|
|
1229
|
+
address: "0x201EBa5CC46D216Ce6DC03F6a759e8E766e956aE";
|
|
1230
|
+
decimals: number;
|
|
1231
|
+
symbol: string;
|
|
1232
|
+
};
|
|
1233
|
+
};
|
|
1234
|
+
};
|
|
1235
|
+
sonic: {
|
|
1236
|
+
chain: {
|
|
1237
|
+
blockExplorers: {
|
|
1238
|
+
readonly default: {
|
|
1239
|
+
readonly name: "Sonic Explorer";
|
|
1240
|
+
readonly url: "https://sonicscan.org";
|
|
1241
|
+
};
|
|
1242
|
+
};
|
|
1243
|
+
blockTime: 630;
|
|
1244
|
+
contracts: {
|
|
1245
|
+
readonly multicall3: {
|
|
1246
|
+
readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
|
|
1247
|
+
readonly blockCreated: 60;
|
|
1248
|
+
};
|
|
1249
|
+
};
|
|
1250
|
+
ensTlds?: readonly string[] | undefined;
|
|
1251
|
+
id: 146;
|
|
1252
|
+
name: "Sonic";
|
|
1253
|
+
nativeCurrency: {
|
|
1254
|
+
readonly decimals: 18;
|
|
1255
|
+
readonly name: "Sonic";
|
|
1256
|
+
readonly symbol: "S";
|
|
1257
|
+
};
|
|
1258
|
+
experimental_preconfirmationTime?: number | undefined | undefined;
|
|
1259
|
+
rpcUrls: {
|
|
1260
|
+
readonly default: {
|
|
1261
|
+
readonly http: readonly ["https://rpc.soniclabs.com"];
|
|
1262
|
+
};
|
|
1263
|
+
};
|
|
1264
|
+
sourceId?: number | undefined | undefined;
|
|
1265
|
+
testnet: false;
|
|
1266
|
+
custom?: Record<string, unknown> | undefined;
|
|
1267
|
+
extendSchema?: Record<string, unknown> | undefined;
|
|
1268
|
+
fees?: viem.ChainFees<undefined> | undefined;
|
|
1269
|
+
formatters?: undefined;
|
|
1270
|
+
prepareTransactionRequest?: ((args: viem.PrepareTransactionRequestParameters, options: {
|
|
1271
|
+
client: viem.Client;
|
|
1272
|
+
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
1273
|
+
}) => Promise<viem.PrepareTransactionRequestParameters>) | [fn: ((args: viem.PrepareTransactionRequestParameters, options: {
|
|
1274
|
+
client: viem.Client;
|
|
1275
|
+
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
1276
|
+
}) => Promise<viem.PrepareTransactionRequestParameters>) | undefined, options: {
|
|
1277
|
+
runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
|
|
1278
|
+
}] | undefined;
|
|
1279
|
+
serializers?: viem.ChainSerializers<undefined, viem.TransactionSerializable> | undefined;
|
|
1280
|
+
verifyHash?: ((client: viem.Client, parameters: viem.VerifyHashActionParameters) => Promise<viem.VerifyHashActionReturnType>) | undefined;
|
|
1281
|
+
};
|
|
1282
|
+
tokens: {
|
|
1283
|
+
USDC: {
|
|
1284
|
+
address: "0x29219dd400f2Bf60E5a23d13Be72B486D4038894";
|
|
1285
|
+
decimals: number;
|
|
1286
|
+
symbol: string;
|
|
1287
|
+
};
|
|
1288
|
+
USDT: {
|
|
1289
|
+
address: "0x6047828dc181963ba44974801FF68e538dA5eaF9";
|
|
1290
|
+
decimals: number;
|
|
1291
|
+
symbol: string;
|
|
1292
|
+
};
|
|
1293
|
+
};
|
|
1294
|
+
};
|
|
1295
|
+
linea: {
|
|
1296
|
+
chain: {
|
|
1297
|
+
blockExplorers: {
|
|
1298
|
+
readonly default: {
|
|
1299
|
+
readonly name: "Etherscan";
|
|
1300
|
+
readonly url: "https://lineascan.build";
|
|
1301
|
+
readonly apiUrl: "https://api.lineascan.build/api";
|
|
1302
|
+
};
|
|
1303
|
+
};
|
|
1304
|
+
blockTime: 2000;
|
|
1305
|
+
contracts: {
|
|
1306
|
+
readonly multicall3: {
|
|
1307
|
+
readonly address: "0xcA11bde05977b3631167028862bE2a173976CA11";
|
|
1308
|
+
readonly blockCreated: 42;
|
|
1309
|
+
};
|
|
1310
|
+
readonly ensRegistry: {
|
|
1311
|
+
readonly address: "0x50130b669B28C339991d8676FA73CF122a121267";
|
|
1312
|
+
readonly blockCreated: 6682888;
|
|
1313
|
+
};
|
|
1314
|
+
readonly ensUniversalResolver: {
|
|
1315
|
+
readonly address: "0x4D41762915F83c76EcaF6776d9b08076aA32b492";
|
|
1316
|
+
readonly blockCreated: 22222151;
|
|
1317
|
+
};
|
|
1318
|
+
};
|
|
1319
|
+
ensTlds: readonly [".linea.eth"];
|
|
1320
|
+
id: 59144;
|
|
1321
|
+
name: "Linea Mainnet";
|
|
1322
|
+
nativeCurrency: {
|
|
1323
|
+
readonly name: "Linea Ether";
|
|
1324
|
+
readonly symbol: "ETH";
|
|
1325
|
+
readonly decimals: 18;
|
|
1326
|
+
};
|
|
1327
|
+
experimental_preconfirmationTime?: number | undefined | undefined;
|
|
1328
|
+
rpcUrls: {
|
|
1329
|
+
readonly default: {
|
|
1330
|
+
readonly http: readonly ["https://rpc.linea.build"];
|
|
1331
|
+
readonly webSocket: readonly ["wss://rpc.linea.build"];
|
|
1332
|
+
};
|
|
1333
|
+
};
|
|
1334
|
+
sourceId?: number | undefined | undefined;
|
|
1335
|
+
testnet: false;
|
|
1336
|
+
custom?: Record<string, unknown> | undefined;
|
|
1337
|
+
extendSchema?: Record<string, unknown> | undefined;
|
|
1338
|
+
fees: {
|
|
1339
|
+
readonly estimateFeesPerGas: ({ client, multiply, request, type, }: Parameters<viem.ChainEstimateFeesPerGasFn>[0]) => ReturnType<viem.ChainEstimateFeesPerGasFn>;
|
|
1340
|
+
readonly maxPriorityFeePerGas: ({ block, client, request }: viem.ChainFeesFnParameters<viem.ChainFormatters | undefined>) => Promise<bigint | null>;
|
|
1341
|
+
};
|
|
1342
|
+
formatters?: undefined;
|
|
1343
|
+
prepareTransactionRequest?: ((args: viem.PrepareTransactionRequestParameters, options: {
|
|
1344
|
+
client: viem.Client;
|
|
1345
|
+
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
1346
|
+
}) => Promise<viem.PrepareTransactionRequestParameters>) | [fn: ((args: viem.PrepareTransactionRequestParameters, options: {
|
|
1347
|
+
client: viem.Client;
|
|
1348
|
+
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
1349
|
+
}) => Promise<viem.PrepareTransactionRequestParameters>) | undefined, options: {
|
|
1350
|
+
runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
|
|
1351
|
+
}] | undefined;
|
|
1352
|
+
serializers?: viem.ChainSerializers<undefined, viem.TransactionSerializable> | undefined;
|
|
1353
|
+
verifyHash?: ((client: viem.Client, parameters: viem.VerifyHashActionParameters) => Promise<viem.VerifyHashActionReturnType>) | undefined;
|
|
1354
|
+
};
|
|
1355
|
+
tokens: {
|
|
1356
|
+
USDC: {
|
|
1357
|
+
address: "0x176211869cA2b568f2A7D4EE941E073a821EE1ff";
|
|
1358
|
+
decimals: number;
|
|
1359
|
+
symbol: string;
|
|
1360
|
+
};
|
|
1361
|
+
USDT: {
|
|
1362
|
+
address: "0xA219439258ca9da29E9Cc4cE5596924745e12B93";
|
|
1363
|
+
decimals: number;
|
|
1364
|
+
symbol: string;
|
|
1365
|
+
};
|
|
1366
|
+
};
|
|
1367
|
+
};
|
|
1368
|
+
scroll: {
|
|
1369
|
+
chain: {
|
|
1370
|
+
blockExplorers: {
|
|
1371
|
+
readonly default: {
|
|
1372
|
+
readonly name: "Scrollscan";
|
|
1373
|
+
readonly url: "https://scrollscan.com";
|
|
1374
|
+
readonly apiUrl: "https://api.scrollscan.com/api";
|
|
1375
|
+
};
|
|
1376
|
+
};
|
|
1377
|
+
blockTime: 3000;
|
|
1378
|
+
contracts: {
|
|
1379
|
+
readonly multicall3: {
|
|
1380
|
+
readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
|
|
1381
|
+
readonly blockCreated: 14;
|
|
1382
|
+
};
|
|
1383
|
+
};
|
|
1384
|
+
ensTlds?: readonly string[] | undefined;
|
|
1385
|
+
id: 534352;
|
|
1386
|
+
name: "Scroll";
|
|
1387
|
+
nativeCurrency: {
|
|
1388
|
+
readonly name: "Ether";
|
|
1389
|
+
readonly symbol: "ETH";
|
|
1390
|
+
readonly decimals: 18;
|
|
1391
|
+
};
|
|
1392
|
+
experimental_preconfirmationTime?: number | undefined | undefined;
|
|
1393
|
+
rpcUrls: {
|
|
1394
|
+
readonly default: {
|
|
1395
|
+
readonly http: readonly ["https://rpc.scroll.io"];
|
|
1396
|
+
readonly webSocket: readonly ["wss://wss-rpc.scroll.io/ws"];
|
|
1397
|
+
};
|
|
1398
|
+
};
|
|
1399
|
+
sourceId?: number | undefined | undefined;
|
|
1400
|
+
testnet: false;
|
|
1401
|
+
custom?: Record<string, unknown> | undefined;
|
|
1402
|
+
extendSchema?: Record<string, unknown> | undefined;
|
|
1403
|
+
fees?: viem.ChainFees<undefined> | undefined;
|
|
1404
|
+
formatters?: undefined;
|
|
1405
|
+
prepareTransactionRequest?: ((args: viem.PrepareTransactionRequestParameters, options: {
|
|
1406
|
+
client: viem.Client;
|
|
1407
|
+
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
1408
|
+
}) => Promise<viem.PrepareTransactionRequestParameters>) | [fn: ((args: viem.PrepareTransactionRequestParameters, options: {
|
|
1409
|
+
client: viem.Client;
|
|
1410
|
+
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
1411
|
+
}) => Promise<viem.PrepareTransactionRequestParameters>) | undefined, options: {
|
|
1412
|
+
runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
|
|
1413
|
+
}] | undefined;
|
|
1414
|
+
serializers?: viem.ChainSerializers<undefined, viem.TransactionSerializable> | undefined;
|
|
1415
|
+
verifyHash?: ((client: viem.Client, parameters: viem.VerifyHashActionParameters) => Promise<viem.VerifyHashActionReturnType>) | undefined;
|
|
1416
|
+
};
|
|
1417
|
+
tokens: {
|
|
1418
|
+
USDC: {
|
|
1419
|
+
address: "0x06eFdBFf2a14a7c8E15944D1F4A48F9F95F663A4";
|
|
1420
|
+
decimals: number;
|
|
1421
|
+
symbol: string;
|
|
1422
|
+
};
|
|
1423
|
+
USDT: {
|
|
1424
|
+
address: "0xf55BEC9cafDbE8730f096Aa55dad6D22d44099Df";
|
|
1425
|
+
decimals: number;
|
|
1426
|
+
symbol: string;
|
|
1427
|
+
};
|
|
1428
|
+
};
|
|
1429
|
+
};
|
|
1430
|
+
celo: {
|
|
1431
|
+
chain: {
|
|
1432
|
+
blockExplorers: {
|
|
1433
|
+
readonly default: {
|
|
1434
|
+
readonly name: "Celo Explorer";
|
|
1435
|
+
readonly url: "https://celoscan.io";
|
|
1436
|
+
readonly apiUrl: "https://api.celoscan.io/api";
|
|
1437
|
+
};
|
|
1438
|
+
};
|
|
1439
|
+
blockTime: 1000;
|
|
1440
|
+
contracts: {
|
|
1441
|
+
readonly multicall3: {
|
|
1442
|
+
readonly address: "0xcA11bde05977b3631167028862bE2a173976CA11";
|
|
1443
|
+
readonly blockCreated: 13112599;
|
|
1444
|
+
};
|
|
1445
|
+
};
|
|
1446
|
+
ensTlds?: readonly string[] | undefined;
|
|
1447
|
+
id: 42220;
|
|
1448
|
+
name: "Celo";
|
|
1449
|
+
nativeCurrency: {
|
|
1450
|
+
readonly decimals: 18;
|
|
1451
|
+
readonly name: "CELO";
|
|
1452
|
+
readonly symbol: "CELO";
|
|
1453
|
+
};
|
|
1454
|
+
experimental_preconfirmationTime?: number | undefined | undefined;
|
|
1455
|
+
rpcUrls: {
|
|
1456
|
+
readonly default: {
|
|
1457
|
+
readonly http: readonly ["https://forno.celo.org"];
|
|
1458
|
+
};
|
|
1459
|
+
};
|
|
1460
|
+
sourceId?: number | undefined | undefined;
|
|
1461
|
+
testnet: false;
|
|
1462
|
+
custom?: Record<string, unknown> | undefined;
|
|
1463
|
+
extendSchema?: Record<string, unknown> | undefined;
|
|
1464
|
+
fees: viem.ChainFees<{
|
|
1465
|
+
readonly block: {
|
|
1466
|
+
exclude: [] | undefined;
|
|
1467
|
+
format: (args: viem_chains.CeloRpcBlock, action?: string | undefined) => {
|
|
1468
|
+
baseFeePerGas: bigint | null;
|
|
1469
|
+
blobGasUsed: bigint;
|
|
1470
|
+
difficulty: bigint;
|
|
1471
|
+
excessBlobGas: bigint;
|
|
1472
|
+
extraData: viem.Hex;
|
|
1473
|
+
gasLimit: bigint;
|
|
1474
|
+
gasUsed: bigint;
|
|
1475
|
+
hash: `0x${string}` | null;
|
|
1476
|
+
logsBloom: `0x${string}` | null;
|
|
1477
|
+
miner: abitype.Address;
|
|
1478
|
+
mixHash: viem.Hash;
|
|
1479
|
+
nonce: `0x${string}` | null;
|
|
1480
|
+
number: bigint | null;
|
|
1481
|
+
parentBeaconBlockRoot?: `0x${string}` | undefined;
|
|
1482
|
+
parentHash: viem.Hash;
|
|
1483
|
+
receiptsRoot: viem.Hex;
|
|
1484
|
+
sealFields: viem.Hex[];
|
|
1485
|
+
sha3Uncles: viem.Hash;
|
|
1486
|
+
size: bigint;
|
|
1487
|
+
stateRoot: viem.Hash;
|
|
1488
|
+
timestamp: bigint;
|
|
1489
|
+
totalDifficulty: bigint | null;
|
|
1490
|
+
transactions: `0x${string}`[] | viem_chains.CeloTransaction<boolean>[];
|
|
1491
|
+
transactionsRoot: viem.Hash;
|
|
1492
|
+
uncles: viem.Hash[];
|
|
1493
|
+
withdrawals?: viem.Withdrawal[] | undefined | undefined;
|
|
1494
|
+
withdrawalsRoot?: `0x${string}` | undefined;
|
|
1495
|
+
} & {};
|
|
1496
|
+
type: "block";
|
|
1497
|
+
};
|
|
1498
|
+
readonly transaction: {
|
|
1499
|
+
exclude: [] | undefined;
|
|
1500
|
+
format: (args: viem_chains.CeloRpcTransaction, action?: string | undefined) => ({
|
|
1501
|
+
r: viem.Hex;
|
|
1502
|
+
s: viem.Hex;
|
|
1503
|
+
v: bigint;
|
|
1504
|
+
to: abitype.Address | null;
|
|
1505
|
+
from: abitype.Address;
|
|
1506
|
+
gas: bigint;
|
|
1507
|
+
nonce: number;
|
|
1508
|
+
value: bigint;
|
|
1509
|
+
blockHash: `0x${string}` | null;
|
|
1510
|
+
blockNumber: bigint | null;
|
|
1511
|
+
blockTimestamp?: bigint | undefined;
|
|
1512
|
+
hash: viem.Hash;
|
|
1513
|
+
input: viem.Hex;
|
|
1514
|
+
transactionIndex: number | null;
|
|
1515
|
+
typeHex: viem.Hex | null;
|
|
1516
|
+
accessList?: undefined | undefined;
|
|
1517
|
+
authorizationList?: undefined | undefined;
|
|
1518
|
+
blobVersionedHashes?: undefined | undefined;
|
|
1519
|
+
chainId?: number | undefined;
|
|
1520
|
+
yParity?: undefined | undefined;
|
|
1521
|
+
type: "legacy";
|
|
1522
|
+
gasPrice: bigint;
|
|
1523
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
1524
|
+
maxFeePerGas?: undefined | undefined;
|
|
1525
|
+
maxPriorityFeePerGas?: undefined | undefined;
|
|
1526
|
+
feeCurrency: abitype.Address | null;
|
|
1527
|
+
mint?: undefined;
|
|
1528
|
+
isSystemTx?: undefined;
|
|
1529
|
+
sourceHash?: undefined;
|
|
1530
|
+
gatewayFee?: undefined;
|
|
1531
|
+
gatewayFeeRecipient?: undefined;
|
|
1532
|
+
} | {
|
|
1533
|
+
blockHash: `0x${string}` | null;
|
|
1534
|
+
blockNumber: bigint | null;
|
|
1535
|
+
blockTimestamp?: bigint | undefined;
|
|
1536
|
+
from: abitype.Address;
|
|
1537
|
+
gas: bigint;
|
|
1538
|
+
hash: viem.Hash;
|
|
1539
|
+
input: viem.Hex;
|
|
1540
|
+
nonce: number;
|
|
1541
|
+
r: viem.Hex;
|
|
1542
|
+
s: viem.Hex;
|
|
1543
|
+
to: abitype.Address | null;
|
|
1544
|
+
transactionIndex: number | null;
|
|
1545
|
+
typeHex: viem.Hex | null;
|
|
1546
|
+
v: bigint;
|
|
1547
|
+
value: bigint;
|
|
1548
|
+
yParity: number;
|
|
1549
|
+
accessList: viem.AccessList;
|
|
1550
|
+
authorizationList?: undefined | undefined;
|
|
1551
|
+
blobVersionedHashes?: undefined | undefined;
|
|
1552
|
+
chainId: number;
|
|
1553
|
+
type: "eip2930";
|
|
1554
|
+
gasPrice: bigint;
|
|
1555
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
1556
|
+
maxFeePerGas?: undefined | undefined;
|
|
1557
|
+
maxPriorityFeePerGas?: undefined | undefined;
|
|
1558
|
+
feeCurrency: abitype.Address | null;
|
|
1559
|
+
mint?: undefined;
|
|
1560
|
+
isSystemTx?: undefined;
|
|
1561
|
+
sourceHash?: undefined;
|
|
1562
|
+
gatewayFee?: undefined;
|
|
1563
|
+
gatewayFeeRecipient?: undefined;
|
|
1564
|
+
} | {
|
|
1565
|
+
blockHash: `0x${string}` | null;
|
|
1566
|
+
blockNumber: bigint | null;
|
|
1567
|
+
blockTimestamp?: bigint | undefined;
|
|
1568
|
+
from: abitype.Address;
|
|
1569
|
+
gas: bigint;
|
|
1570
|
+
hash: viem.Hash;
|
|
1571
|
+
input: viem.Hex;
|
|
1572
|
+
nonce: number;
|
|
1573
|
+
r: viem.Hex;
|
|
1574
|
+
s: viem.Hex;
|
|
1575
|
+
to: abitype.Address | null;
|
|
1576
|
+
transactionIndex: number | null;
|
|
1577
|
+
typeHex: viem.Hex | null;
|
|
1578
|
+
v: bigint;
|
|
1579
|
+
value: bigint;
|
|
1580
|
+
yParity: number;
|
|
1581
|
+
accessList: viem.AccessList;
|
|
1582
|
+
authorizationList?: undefined | undefined;
|
|
1583
|
+
blobVersionedHashes?: undefined | undefined;
|
|
1584
|
+
chainId: number;
|
|
1585
|
+
type: "eip1559";
|
|
1586
|
+
gasPrice?: undefined | undefined;
|
|
1587
|
+
maxFeePerBlobGas
|
|
1588
|
+
/** Native coin metadata. Defaults to 18-decimal ETH. */
|
|
1589
|
+
? /** Native coin metadata. Defaults to 18-decimal ETH. */: undefined | undefined;
|
|
1590
|
+
maxFeePerGas: bigint;
|
|
1591
|
+
maxPriorityFeePerGas: bigint;
|
|
1592
|
+
feeCurrency: abitype.Address | null;
|
|
1593
|
+
mint?: undefined;
|
|
1594
|
+
isSystemTx?: undefined;
|
|
1595
|
+
sourceHash?: undefined;
|
|
1596
|
+
gatewayFee?: undefined;
|
|
1597
|
+
gatewayFeeRecipient?: undefined;
|
|
1598
|
+
} | {
|
|
1599
|
+
blockHash: `0x${string}` | null;
|
|
1600
|
+
blockNumber: bigint | null;
|
|
1601
|
+
blockTimestamp?: bigint | undefined;
|
|
1602
|
+
from: abitype.Address;
|
|
1603
|
+
gas: bigint;
|
|
1604
|
+
hash: viem.Hash;
|
|
1605
|
+
input: viem.Hex;
|
|
1606
|
+
nonce: number;
|
|
1607
|
+
r: viem.Hex;
|
|
1608
|
+
s: viem.Hex;
|
|
1609
|
+
to: abitype.Address | null;
|
|
1610
|
+
transactionIndex: number | null;
|
|
1611
|
+
typeHex: viem.Hex | null;
|
|
1612
|
+
v: bigint;
|
|
1613
|
+
value: bigint;
|
|
1614
|
+
yParity: number;
|
|
1615
|
+
accessList: viem.AccessList;
|
|
1616
|
+
authorizationList?: undefined | undefined;
|
|
1617
|
+
blobVersionedHashes: readonly viem.Hex[];
|
|
1618
|
+
chainId: number;
|
|
1619
|
+
type: "eip4844";
|
|
1620
|
+
gasPrice?: undefined | undefined;
|
|
1621
|
+
maxFeePerBlobGas: bigint;
|
|
1622
|
+
maxFeePerGas: bigint;
|
|
1623
|
+
maxPriorityFeePerGas: bigint;
|
|
1624
|
+
feeCurrency: abitype.Address | null;
|
|
1625
|
+
mint?: undefined;
|
|
1626
|
+
isSystemTx?: undefined;
|
|
1627
|
+
sourceHash?: undefined;
|
|
1628
|
+
gatewayFee?: undefined;
|
|
1629
|
+
gatewayFeeRecipient?: undefined;
|
|
1630
|
+
} | {
|
|
1631
|
+
blockHash: `0x${string}` | null;
|
|
1632
|
+
blockNumber: bigint | null;
|
|
1633
|
+
blockTimestamp?: bigint | undefined;
|
|
1634
|
+
from: abitype.Address;
|
|
1635
|
+
gas: bigint;
|
|
1636
|
+
hash: viem.Hash;
|
|
1637
|
+
input: viem.Hex;
|
|
1638
|
+
nonce: number;
|
|
1639
|
+
r: viem.Hex;
|
|
1640
|
+
s: viem.Hex;
|
|
1641
|
+
to: abitype.Address | null;
|
|
1642
|
+
transactionIndex: number | null;
|
|
1643
|
+
typeHex: viem.Hex | null;
|
|
1644
|
+
v: bigint;
|
|
1645
|
+
value: bigint;
|
|
1646
|
+
yParity: number;
|
|
1647
|
+
accessList: viem.AccessList;
|
|
1648
|
+
authorizationList: viem.SignedAuthorizationList;
|
|
1649
|
+
blobVersionedHashes?: undefined | undefined;
|
|
1650
|
+
chainId: number;
|
|
1651
|
+
type: "eip7702";
|
|
1652
|
+
gasPrice?: undefined | undefined;
|
|
1653
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
1654
|
+
maxFeePerGas: bigint;
|
|
1655
|
+
maxPriorityFeePerGas: bigint;
|
|
1656
|
+
feeCurrency: abitype.Address | null;
|
|
1657
|
+
mint?: undefined;
|
|
1658
|
+
isSystemTx?: undefined;
|
|
1659
|
+
sourceHash?: undefined;
|
|
1660
|
+
gatewayFee?: undefined;
|
|
1661
|
+
gatewayFeeRecipient?: undefined;
|
|
1662
|
+
} | {
|
|
1663
|
+
blockHash: `0x${string}` | null;
|
|
1664
|
+
blockNumber: bigint | null;
|
|
1665
|
+
blockTimestamp?: bigint | undefined;
|
|
1666
|
+
from: abitype.Address;
|
|
1667
|
+
gas: bigint;
|
|
1668
|
+
hash: viem.Hash;
|
|
1669
|
+
input: viem.Hex;
|
|
1670
|
+
nonce: number;
|
|
1671
|
+
r: viem.Hex;
|
|
1672
|
+
s: viem.Hex;
|
|
1673
|
+
to: abitype.Address | null;
|
|
1674
|
+
transactionIndex: number | null;
|
|
1675
|
+
typeHex: viem.Hex | null;
|
|
1676
|
+
v: bigint;
|
|
1677
|
+
value: bigint;
|
|
1678
|
+
yParity: number;
|
|
1679
|
+
gasPrice?: undefined | undefined;
|
|
1680
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
1681
|
+
maxFeePerGas: bigint;
|
|
1682
|
+
maxPriorityFeePerGas: bigint;
|
|
1683
|
+
accessList: viem.AccessList;
|
|
1684
|
+
chainId: number;
|
|
1685
|
+
feeCurrency: abitype.Address | null;
|
|
1686
|
+
gatewayFee: bigint | null;
|
|
1687
|
+
gatewayFeeRecipient: abitype.Address | null;
|
|
1688
|
+
type: "cip42";
|
|
1689
|
+
blobVersionedHashes?: undefined;
|
|
1690
|
+
authorizationList?: undefined;
|
|
1691
|
+
mint?: undefined;
|
|
1692
|
+
isSystemTx?: undefined;
|
|
1693
|
+
sourceHash?: undefined;
|
|
1694
|
+
} | {
|
|
1695
|
+
blockHash: `0x${string}` | null;
|
|
1696
|
+
blockNumber: bigint | null;
|
|
1697
|
+
blockTimestamp?: bigint | undefined;
|
|
1698
|
+
from: abitype.Address;
|
|
1699
|
+
gas: bigint;
|
|
1700
|
+
hash: viem.Hash;
|
|
1701
|
+
input: viem.Hex;
|
|
1702
|
+
nonce: number;
|
|
1703
|
+
r: viem.Hex;
|
|
1704
|
+
s: viem.Hex;
|
|
1705
|
+
to: abitype.Address | null;
|
|
1706
|
+
transactionIndex: number | null;
|
|
1707
|
+
typeHex: viem.Hex | null;
|
|
1708
|
+
v: bigint;
|
|
1709
|
+
value: bigint;
|
|
1710
|
+
yParity: number;
|
|
1711
|
+
gasPrice?: undefined | undefined;
|
|
1712
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
1713
|
+
maxFeePerGas: bigint;
|
|
1714
|
+
maxPriorityFeePerGas: bigint;
|
|
1715
|
+
accessList: viem.AccessList;
|
|
1716
|
+
chainId: number;
|
|
1717
|
+
feeCurrency: abitype.Address | null;
|
|
1718
|
+
type: "cip64";
|
|
1719
|
+
blobVersionedHashes?: undefined;
|
|
1720
|
+
authorizationList?: undefined;
|
|
1721
|
+
mint?: undefined;
|
|
1722
|
+
isSystemTx?: undefined;
|
|
1723
|
+
sourceHash?: undefined;
|
|
1724
|
+
gatewayFee?: undefined;
|
|
1725
|
+
gatewayFeeRecipient?: undefined;
|
|
1726
|
+
} | {
|
|
1727
|
+
blockHash: `0x${string}` | null;
|
|
1728
|
+
blockNumber: bigint | null;
|
|
1729
|
+
blockTimestamp?: bigint | undefined;
|
|
1730
|
+
from: abitype.Address;
|
|
1731
|
+
gas: bigint;
|
|
1732
|
+
hash: viem.Hash;
|
|
1733
|
+
input: viem.Hex;
|
|
1734
|
+
nonce: number;
|
|
1735
|
+
r: viem.Hex;
|
|
1736
|
+
s: viem.Hex;
|
|
1737
|
+
to: abitype.Address | null;
|
|
1738
|
+
transactionIndex: number | null;
|
|
1739
|
+
typeHex: viem.Hex | null;
|
|
1740
|
+
v: bigint;
|
|
1741
|
+
value: bigint;
|
|
1742
|
+
yParity: number;
|
|
1743
|
+
gasPrice?: undefined | undefined;
|
|
1744
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
1745
|
+
maxFeePerGas: bigint;
|
|
1746
|
+
maxPriorityFeePerGas: bigint;
|
|
1747
|
+
isSystemTx?: boolean;
|
|
1748
|
+
mint?: bigint | undefined | undefined;
|
|
1749
|
+
sourceHash: viem.Hex;
|
|
1750
|
+
type: "deposit";
|
|
1751
|
+
blobVersionedHashes?: undefined;
|
|
1752
|
+
accessList?: undefined;
|
|
1753
|
+
authorizationList?: undefined;
|
|
1754
|
+
chainId?: undefined;
|
|
1755
|
+
feeCurrency?: undefined;
|
|
1756
|
+
gatewayFee?: undefined;
|
|
1757
|
+
gatewayFeeRecipient?: undefined;
|
|
1758
|
+
}) & {};
|
|
1759
|
+
type: "transaction";
|
|
1760
|
+
};
|
|
1761
|
+
readonly transactionRequest: {
|
|
1762
|
+
exclude: [] | undefined;
|
|
1763
|
+
format: (args: viem_chains.CeloTransactionRequest, action?: string | undefined) => ({
|
|
1764
|
+
data?: `0x${string}` | undefined;
|
|
1765
|
+
from?: `0x${string}` | undefined;
|
|
1766
|
+
gas?: `0x${string}` | undefined;
|
|
1767
|
+
nonce?: `0x${string}` | undefined;
|
|
1768
|
+
to?: `0x${string}` | null | undefined;
|
|
1769
|
+
type?: "0x0" | undefined;
|
|
1770
|
+
value?: `0x${string}` | undefined;
|
|
1771
|
+
gasPrice?: `0x${string}` | undefined;
|
|
1772
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
1773
|
+
maxFeePerGas?: undefined | undefined;
|
|
1774
|
+
maxPriorityFeePerGas?: undefined | undefined;
|
|
1775
|
+
blobs?: undefined;
|
|
1776
|
+
blobVersionedHashes?: undefined;
|
|
1777
|
+
kzg?: undefined;
|
|
1778
|
+
accessList?: undefined;
|
|
1779
|
+
sidecars?: undefined;
|
|
1780
|
+
authorizationList?: undefined;
|
|
1781
|
+
feeCurrency?: `0x${string}` | undefined;
|
|
1782
|
+
} | {
|
|
1783
|
+
data?: `0x${string}` | undefined;
|
|
1784
|
+
from?: `0x${string}` | undefined;
|
|
1785
|
+
gas?: `0x${string}` | undefined;
|
|
1786
|
+
nonce?: `0x${string}` | undefined;
|
|
1787
|
+
to?: `0x${string}` | null | undefined;
|
|
1788
|
+
type?: "0x1" | undefined;
|
|
1789
|
+
value?: `0x${string}` | undefined;
|
|
1790
|
+
gasPrice?: `0x${string}` | undefined;
|
|
1791
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
1792
|
+
maxFeePerGas?: undefined | undefined;
|
|
1793
|
+
maxPriorityFeePerGas?: undefined | undefined;
|
|
1794
|
+
accessList?: viem.AccessList | undefined;
|
|
1795
|
+
blobs?: undefined;
|
|
1796
|
+
blobVersionedHashes?: undefined;
|
|
1797
|
+
kzg?: undefined;
|
|
1798
|
+
sidecars?: undefined;
|
|
1799
|
+
authorizationList?: undefined;
|
|
1800
|
+
feeCurrency?: `0x${string}` | undefined;
|
|
1801
|
+
} | {
|
|
1802
|
+
data?: `0x${string}` | undefined;
|
|
1803
|
+
from?: `0x${string}` | undefined;
|
|
1804
|
+
gas?: `0x${string}` | undefined;
|
|
1805
|
+
nonce?: `0x${string}` | undefined;
|
|
1806
|
+
to?: `0x${string}` | null | undefined;
|
|
1807
|
+
type?: "0x2" | undefined;
|
|
1808
|
+
value?: `0x${string}` | undefined;
|
|
1809
|
+
gasPrice?: undefined | undefined;
|
|
1810
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
1811
|
+
maxFeePerGas?: `0x${string}` | undefined;
|
|
1812
|
+
maxPriorityFeePerGas?: `0x${string}` | undefined;
|
|
1813
|
+
accessList?: viem.AccessList | undefined;
|
|
1814
|
+
blobs?: undefined;
|
|
1815
|
+
blobVersionedHashes?: undefined;
|
|
1816
|
+
kzg?: undefined;
|
|
1817
|
+
sidecars?: undefined;
|
|
1818
|
+
authorizationList?: undefined;
|
|
1819
|
+
feeCurrency?: `0x${string}` | undefined;
|
|
1820
|
+
} | {
|
|
1821
|
+
type?: "0x3" | undefined;
|
|
1822
|
+
data?: `0x${string}` | undefined;
|
|
1823
|
+
from?: `0x${string}` | undefined;
|
|
1824
|
+
gas?: `0x${string}` | undefined;
|
|
1825
|
+
nonce?: `0x${string}` | undefined;
|
|
1826
|
+
value?: `0x${string}` | undefined;
|
|
1827
|
+
to: `0x${string}` | null;
|
|
1828
|
+
gasPrice?: undefined | undefined;
|
|
1829
|
+
maxFeePerBlobGas?: `0x${string}` | undefined;
|
|
1830
|
+
maxFeePerGas?: `0x${string}` | undefined;
|
|
1831
|
+
maxPriorityFeePerGas?: `0x${string}` | undefined;
|
|
1832
|
+
accessList?: viem.AccessList | undefined;
|
|
1833
|
+
sidecars?: readonly viem.BlobSidecar<`0x${string}`>[] | undefined;
|
|
1834
|
+
blobs?: readonly `0x${string}`[] | readonly viem.ByteArray[] | undefined;
|
|
1835
|
+
blobVersionedHashes: readonly viem.Hex[];
|
|
1836
|
+
kzg?: undefined;
|
|
1837
|
+
authorizationList?: undefined;
|
|
1838
|
+
feeCurrency?: `0x${string}` | undefined;
|
|
1839
|
+
} | {
|
|
1840
|
+
type?: "0x3" | undefined;
|
|
1841
|
+
data?: `0x${string}` | undefined;
|
|
1842
|
+
from?: `0x${string}` | undefined;
|
|
1843
|
+
gas?: `0x${string}` | undefined;
|
|
1844
|
+
nonce?: `0x${string}` | undefined;
|
|
1845
|
+
value?: `0x${string}` | undefined;
|
|
1846
|
+
to: `0x${string}` | null;
|
|
1847
|
+
gasPrice?: undefined | undefined;
|
|
1848
|
+
maxFeePerBlobGas?: `0x${string}` | undefined;
|
|
1849
|
+
maxFeePerGas?: `0x${string}` | undefined;
|
|
1850
|
+
maxPriorityFeePerGas?: `0x${string}` | undefined;
|
|
1851
|
+
accessList?: viem.AccessList | undefined;
|
|
1852
|
+
sidecars?: readonly viem.BlobSidecar<`0x${string}`>[] | undefined;
|
|
1853
|
+
blobs: readonly viem.Hex[] | readonly viem.ByteArray[];
|
|
1854
|
+
blobVersionedHashes?: readonly `0x${string}`[] | undefined;
|
|
1855
|
+
kzg?: viem.Kzg | undefined;
|
|
1856
|
+
authorizationList?: undefined;
|
|
1857
|
+
feeCurrency?: `0x${string}` | undefined;
|
|
1858
|
+
} | {
|
|
1859
|
+
type?: "0x4" | undefined;
|
|
1860
|
+
gasPrice?: undefined | undefined;
|
|
1861
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
1862
|
+
maxFeePerGas?: `0x${string}` | undefined;
|
|
1863
|
+
maxPriorityFeePerGas?: `0x${string}` | undefined;
|
|
1864
|
+
to?: `0x${string}` | null | undefined;
|
|
1865
|
+
data?: `0x${string}` | undefined;
|
|
1866
|
+
from?: `0x${string}` | undefined;
|
|
1867
|
+
gas?: `0x${string}` | undefined;
|
|
1868
|
+
nonce?: `0x${string}` | undefined;
|
|
1869
|
+
value?: `0x${string}` | undefined;
|
|
1870
|
+
accessList?: viem.AccessList | undefined;
|
|
1871
|
+
authorizationList?: viem.RpcAuthorizationList | undefined;
|
|
1872
|
+
blobs?: undefined;
|
|
1873
|
+
blobVersionedHashes?: undefined;
|
|
1874
|
+
kzg?: undefined;
|
|
1875
|
+
sidecars?: undefined;
|
|
1876
|
+
feeCurrency?: `0x${string}` | undefined;
|
|
1877
|
+
} | {
|
|
1878
|
+
data?: `0x${string}` | undefined;
|
|
1879
|
+
from?: `0x${string}` | undefined;
|
|
1880
|
+
gas?: `0x${string}` | undefined;
|
|
1881
|
+
nonce?: `0x${string}` | undefined;
|
|
1882
|
+
to?: `0x${string}` | null | undefined;
|
|
1883
|
+
type?: "0x7b" | undefined;
|
|
1884
|
+
value?: `0x${string}` | undefined;
|
|
1885
|
+
accessList?: viem.AccessList | undefined;
|
|
1886
|
+
feeCurrency?: `0x${string}` | undefined;
|
|
1887
|
+
gasPrice?: undefined | undefined;
|
|
1888
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
1889
|
+
maxFeePerGas?: `0x${string}` | undefined;
|
|
1890
|
+
maxPriorityFeePerGas?: `0x${string}` | undefined;
|
|
1891
|
+
blobs?: undefined;
|
|
1892
|
+
blobVersionedHashes?: undefined;
|
|
1893
|
+
kzg?: undefined;
|
|
1894
|
+
sidecars?: undefined;
|
|
1895
|
+
authorizationList?: undefined;
|
|
1896
|
+
}) & {};
|
|
1897
|
+
type: "transactionRequest";
|
|
1898
|
+
};
|
|
1899
|
+
}>;
|
|
1900
|
+
formatters: {
|
|
1901
|
+
readonly block: {
|
|
1902
|
+
exclude: [] | undefined;
|
|
1903
|
+
format: (args: viem_chains.CeloRpcBlock, action?: string | undefined) => {
|
|
1904
|
+
baseFeePerGas: bigint | null;
|
|
1905
|
+
blobGasUsed: bigint;
|
|
1906
|
+
difficulty: bigint;
|
|
1907
|
+
excessBlobGas: bigint;
|
|
1908
|
+
extraData: viem.Hex;
|
|
1909
|
+
gasLimit: bigint;
|
|
1910
|
+
gasUsed: bigint;
|
|
1911
|
+
hash: `0x${string}` | null;
|
|
1912
|
+
logsBloom: `0x${string}` | null;
|
|
1913
|
+
miner: abitype.Address;
|
|
1914
|
+
mixHash: viem.Hash;
|
|
1915
|
+
nonce: `0x${string}` | null;
|
|
1916
|
+
number: bigint | null;
|
|
1917
|
+
parentBeaconBlockRoot?: `0x${string}` | undefined;
|
|
1918
|
+
parentHash: viem.Hash;
|
|
1919
|
+
receiptsRoot: viem.Hex;
|
|
1920
|
+
sealFields: viem.Hex[];
|
|
1921
|
+
sha3Uncles: viem.Hash;
|
|
1922
|
+
size: bigint;
|
|
1923
|
+
stateRoot: viem.Hash;
|
|
1924
|
+
timestamp: bigint;
|
|
1925
|
+
totalDifficulty: bigint | null;
|
|
1926
|
+
transactions: `0x${string}`[] | viem_chains.CeloTransaction<boolean>[];
|
|
1927
|
+
transactionsRoot: viem.Hash;
|
|
1928
|
+
uncles: viem.Hash[];
|
|
1929
|
+
withdrawals?: viem.Withdrawal[] | undefined | undefined;
|
|
1930
|
+
withdrawalsRoot?: `0x${string}` | undefined;
|
|
1931
|
+
} & {};
|
|
1932
|
+
type: "block";
|
|
1933
|
+
};
|
|
1934
|
+
readonly transaction: {
|
|
1935
|
+
exclude: [] | undefined;
|
|
1936
|
+
format: (args: viem_chains.CeloRpcTransaction, action?: string | undefined) => ({
|
|
1937
|
+
r: viem.Hex;
|
|
1938
|
+
s: viem.Hex;
|
|
1939
|
+
v: bigint;
|
|
1940
|
+
to: abitype.Address | null;
|
|
1941
|
+
from: abitype.Address;
|
|
1942
|
+
gas: bigint;
|
|
1943
|
+
nonce: number;
|
|
1944
|
+
value: bigint;
|
|
1945
|
+
blockHash: `0x${string}` | null;
|
|
1946
|
+
blockNumber: bigint | null;
|
|
1947
|
+
blockTimestamp?: bigint | undefined;
|
|
1948
|
+
hash: viem.Hash;
|
|
1949
|
+
input: viem.Hex;
|
|
1950
|
+
transactionIndex: number | null;
|
|
1951
|
+
typeHex: viem.Hex | null;
|
|
1952
|
+
accessList?: undefined | undefined;
|
|
1953
|
+
authorizationList?: undefined | undefined;
|
|
1954
|
+
blobVersionedHashes?: undefined | undefined;
|
|
1955
|
+
chainId?: number | undefined;
|
|
1956
|
+
yParity?: undefined | undefined;
|
|
1957
|
+
type: "legacy";
|
|
1958
|
+
gasPrice: bigint;
|
|
1959
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
1960
|
+
maxFeePerGas?: undefined | undefined;
|
|
1961
|
+
maxPriorityFeePerGas?: undefined | undefined;
|
|
1962
|
+
feeCurrency: abitype.Address | null;
|
|
1963
|
+
mint?: undefined;
|
|
1964
|
+
isSystemTx?: undefined;
|
|
1965
|
+
sourceHash?: undefined;
|
|
1966
|
+
gatewayFee?: undefined;
|
|
1967
|
+
gatewayFeeRecipient?: undefined;
|
|
1968
|
+
} | {
|
|
1969
|
+
blockHash: `0x${string}` | null;
|
|
1970
|
+
blockNumber: bigint | null;
|
|
1971
|
+
blockTimestamp?: bigint | undefined;
|
|
1972
|
+
from: abitype.Address;
|
|
1973
|
+
gas: bigint;
|
|
1974
|
+
hash: viem.Hash;
|
|
1975
|
+
input: viem.Hex;
|
|
1976
|
+
nonce: number;
|
|
1977
|
+
r: viem.Hex;
|
|
1978
|
+
s: viem.Hex;
|
|
1979
|
+
to: abitype.Address | null;
|
|
1980
|
+
transactionIndex: number | null;
|
|
1981
|
+
typeHex: viem.Hex | null;
|
|
1982
|
+
v: bigint;
|
|
1983
|
+
value: bigint;
|
|
1984
|
+
yParity: number;
|
|
1985
|
+
accessList: viem.AccessList;
|
|
1986
|
+
authorizationList?: undefined | undefined;
|
|
1987
|
+
blobVersionedHashes?: undefined | undefined;
|
|
1988
|
+
chainId: number;
|
|
1989
|
+
type: "eip2930";
|
|
1990
|
+
gasPrice: bigint;
|
|
1991
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
1992
|
+
maxFeePerGas?: undefined | undefined;
|
|
1993
|
+
maxPriorityFeePerGas?: undefined | undefined;
|
|
1994
|
+
feeCurrency: abitype.Address | null;
|
|
1995
|
+
mint?: undefined;
|
|
1996
|
+
isSystemTx?: undefined;
|
|
1997
|
+
sourceHash?: undefined;
|
|
1998
|
+
gatewayFee?: undefined;
|
|
1999
|
+
gatewayFeeRecipient?: undefined;
|
|
2000
|
+
} | {
|
|
2001
|
+
blockHash: `0x${string}` | null;
|
|
2002
|
+
blockNumber: bigint | null;
|
|
2003
|
+
blockTimestamp?: bigint | undefined;
|
|
2004
|
+
from: abitype.Address;
|
|
2005
|
+
gas: bigint;
|
|
2006
|
+
hash: viem.Hash;
|
|
2007
|
+
input: viem.Hex;
|
|
2008
|
+
nonce: number;
|
|
2009
|
+
r: viem.Hex;
|
|
2010
|
+
s: viem.Hex;
|
|
2011
|
+
to: abitype.Address | null;
|
|
2012
|
+
transactionIndex: number | null;
|
|
2013
|
+
typeHex: viem.Hex | null;
|
|
2014
|
+
v: bigint;
|
|
2015
|
+
value: bigint;
|
|
2016
|
+
yParity: number;
|
|
2017
|
+
accessList: viem.AccessList;
|
|
2018
|
+
authorizationList?: undefined | undefined;
|
|
2019
|
+
blobVersionedHashes?: undefined | undefined;
|
|
2020
|
+
chainId: number;
|
|
2021
|
+
type: "eip1559";
|
|
2022
|
+
gasPrice?: undefined | undefined;
|
|
2023
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
2024
|
+
maxFeePerGas: bigint;
|
|
2025
|
+
maxPriorityFeePerGas: bigint;
|
|
2026
|
+
feeCurrency: abitype.Address | null;
|
|
2027
|
+
mint?: undefined;
|
|
2028
|
+
isSystemTx?: undefined;
|
|
2029
|
+
sourceHash?: undefined;
|
|
2030
|
+
gatewayFee?: undefined;
|
|
2031
|
+
gatewayFeeRecipient?: undefined;
|
|
2032
|
+
} | {
|
|
2033
|
+
blockHash: `0x${string}` | null;
|
|
2034
|
+
blockNumber: bigint | null;
|
|
2035
|
+
blockTimestamp?: bigint | undefined;
|
|
2036
|
+
from: abitype.Address;
|
|
2037
|
+
gas: bigint;
|
|
2038
|
+
hash: viem.Hash;
|
|
2039
|
+
input: viem.Hex;
|
|
2040
|
+
nonce: number;
|
|
2041
|
+
r: viem.Hex;
|
|
2042
|
+
s: viem.Hex;
|
|
2043
|
+
to: abitype.Address | null;
|
|
2044
|
+
transactionIndex: number | null;
|
|
2045
|
+
typeHex: viem.Hex | null;
|
|
2046
|
+
v: bigint;
|
|
2047
|
+
value: bigint;
|
|
2048
|
+
yParity: number;
|
|
2049
|
+
accessList: viem.AccessList;
|
|
2050
|
+
authorizationList?: undefined | undefined;
|
|
2051
|
+
blobVersionedHashes: readonly viem.Hex[];
|
|
2052
|
+
chainId: number;
|
|
2053
|
+
type: "eip4844";
|
|
2054
|
+
gasPrice?: undefined | undefined;
|
|
2055
|
+
maxFeePerBlobGas: bigint;
|
|
2056
|
+
maxFeePerGas: bigint;
|
|
2057
|
+
maxPriorityFeePerGas: bigint;
|
|
2058
|
+
feeCurrency: abitype.Address | null;
|
|
2059
|
+
mint?: undefined;
|
|
2060
|
+
isSystemTx?: undefined;
|
|
2061
|
+
sourceHash?: undefined;
|
|
2062
|
+
gatewayFee?: undefined;
|
|
2063
|
+
gatewayFeeRecipient?: undefined;
|
|
2064
|
+
} | {
|
|
2065
|
+
blockHash: `0x${string}` | null;
|
|
2066
|
+
blockNumber: bigint | null;
|
|
2067
|
+
blockTimestamp?: bigint | undefined;
|
|
2068
|
+
from: abitype.Address;
|
|
2069
|
+
gas: bigint;
|
|
2070
|
+
hash: viem.Hash;
|
|
2071
|
+
input: viem.Hex;
|
|
2072
|
+
nonce: number;
|
|
2073
|
+
r: viem.Hex;
|
|
2074
|
+
s: viem.Hex;
|
|
2075
|
+
to: abitype.Address | null;
|
|
2076
|
+
transactionIndex: number | null;
|
|
2077
|
+
typeHex: viem.Hex | null;
|
|
2078
|
+
v: bigint;
|
|
2079
|
+
value: bigint;
|
|
2080
|
+
yParity: number;
|
|
2081
|
+
accessList: viem.AccessList;
|
|
2082
|
+
authorizationList: viem.SignedAuthorizationList;
|
|
2083
|
+
blobVersionedHashes?: undefined | undefined;
|
|
2084
|
+
chainId: number;
|
|
2085
|
+
type: "eip7702";
|
|
2086
|
+
gasPrice?: undefined | undefined;
|
|
2087
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
2088
|
+
maxFeePerGas: bigint;
|
|
2089
|
+
maxPriorityFeePerGas: bigint;
|
|
2090
|
+
feeCurrency: abitype.Address | null;
|
|
2091
|
+
mint?: undefined;
|
|
2092
|
+
isSystemTx?: undefined;
|
|
2093
|
+
sourceHash?: undefined;
|
|
2094
|
+
gatewayFee?: undefined;
|
|
2095
|
+
gatewayFeeRecipient?: undefined;
|
|
2096
|
+
} | {
|
|
2097
|
+
blockHash: `0x${string}` | null;
|
|
2098
|
+
blockNumber: bigint | null;
|
|
2099
|
+
blockTimestamp?: bigint | undefined;
|
|
2100
|
+
from: abitype.Address;
|
|
2101
|
+
gas: bigint;
|
|
2102
|
+
hash: viem.Hash;
|
|
2103
|
+
input: viem.Hex;
|
|
2104
|
+
nonce: number;
|
|
2105
|
+
r: viem.Hex;
|
|
2106
|
+
s: viem.Hex;
|
|
2107
|
+
to: abitype.Address | null;
|
|
2108
|
+
transactionIndex: number | null;
|
|
2109
|
+
typeHex: viem.Hex | null;
|
|
2110
|
+
v: bigint;
|
|
2111
|
+
value: bigint;
|
|
2112
|
+
yParity: number;
|
|
2113
|
+
gasPrice?: undefined | undefined;
|
|
2114
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
2115
|
+
maxFeePerGas: bigint;
|
|
2116
|
+
maxPriorityFeePerGas: bigint;
|
|
2117
|
+
accessList: viem.AccessList;
|
|
2118
|
+
chainId: number;
|
|
2119
|
+
feeCurrency: abitype.Address | null;
|
|
2120
|
+
gatewayFee: bigint | null;
|
|
2121
|
+
gatewayFeeRecipient: abitype.Address | null;
|
|
2122
|
+
type: "cip42";
|
|
2123
|
+
blobVersionedHashes?: undefined;
|
|
2124
|
+
authorizationList?: undefined;
|
|
2125
|
+
mint?: undefined;
|
|
2126
|
+
isSystemTx?: undefined;
|
|
2127
|
+
sourceHash?: undefined;
|
|
2128
|
+
} | {
|
|
2129
|
+
blockHash: `0x${string}` | null;
|
|
2130
|
+
blockNumber: bigint | null;
|
|
2131
|
+
blockTimestamp?: bigint | undefined;
|
|
2132
|
+
from: abitype.Address;
|
|
2133
|
+
gas: bigint;
|
|
2134
|
+
hash: viem.Hash;
|
|
2135
|
+
input: viem.Hex;
|
|
2136
|
+
nonce: number;
|
|
2137
|
+
r: viem.Hex;
|
|
2138
|
+
s: viem.Hex;
|
|
2139
|
+
to: abitype.Address | null;
|
|
2140
|
+
transactionIndex: number | null;
|
|
2141
|
+
typeHex: viem.Hex | null;
|
|
2142
|
+
v: bigint;
|
|
2143
|
+
value: bigint;
|
|
2144
|
+
yParity: number;
|
|
2145
|
+
gasPrice?: undefined | undefined;
|
|
2146
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
2147
|
+
maxFeePerGas: bigint;
|
|
2148
|
+
maxPriorityFeePerGas: bigint;
|
|
2149
|
+
accessList: viem.AccessList;
|
|
2150
|
+
chainId: number;
|
|
2151
|
+
feeCurrency: abitype.Address | null;
|
|
2152
|
+
type: "cip64";
|
|
2153
|
+
blobVersionedHashes?: undefined;
|
|
2154
|
+
authorizationList?: undefined;
|
|
2155
|
+
mint?: undefined;
|
|
2156
|
+
isSystemTx?: undefined;
|
|
2157
|
+
sourceHash?: undefined;
|
|
2158
|
+
gatewayFee?: undefined;
|
|
2159
|
+
gatewayFeeRecipient?: undefined;
|
|
2160
|
+
} | {
|
|
2161
|
+
blockHash: `0x${string}` | null;
|
|
2162
|
+
blockNumber: bigint | null;
|
|
2163
|
+
blockTimestamp?: bigint | undefined;
|
|
2164
|
+
from: abitype.Address;
|
|
2165
|
+
gas: bigint;
|
|
2166
|
+
hash: viem.Hash;
|
|
2167
|
+
input: viem.Hex;
|
|
2168
|
+
nonce: number;
|
|
2169
|
+
r: viem.Hex;
|
|
2170
|
+
s: viem.Hex;
|
|
2171
|
+
to: abitype.Address | null;
|
|
2172
|
+
transactionIndex: number | null;
|
|
2173
|
+
typeHex: viem.Hex | null;
|
|
2174
|
+
v: bigint;
|
|
2175
|
+
value: bigint;
|
|
2176
|
+
yParity: number;
|
|
2177
|
+
gasPrice?: undefined | undefined;
|
|
2178
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
2179
|
+
maxFeePerGas: bigint;
|
|
2180
|
+
maxPriorityFeePerGas: bigint;
|
|
2181
|
+
isSystemTx?: boolean;
|
|
2182
|
+
mint?: bigint | undefined | undefined;
|
|
2183
|
+
sourceHash: viem.Hex;
|
|
2184
|
+
type: "deposit";
|
|
2185
|
+
blobVersionedHashes?: undefined;
|
|
2186
|
+
accessList?: undefined;
|
|
2187
|
+
authorizationList?: undefined;
|
|
2188
|
+
chainId?: undefined;
|
|
2189
|
+
feeCurrency?: undefined;
|
|
2190
|
+
gatewayFee?: undefined;
|
|
2191
|
+
gatewayFeeRecipient?: undefined;
|
|
2192
|
+
}) & {};
|
|
2193
|
+
type: "transaction";
|
|
2194
|
+
};
|
|
2195
|
+
readonly transactionRequest: {
|
|
2196
|
+
exclude: [] | undefined;
|
|
2197
|
+
format: (args: viem_chains.CeloTransactionRequest, action?: string | undefined) => ({
|
|
2198
|
+
data?: `0x${string}` | undefined;
|
|
2199
|
+
from?: `0x${string}` | undefined;
|
|
2200
|
+
gas?: `0x${string}` | undefined;
|
|
2201
|
+
nonce?: `0x${string}` | undefined;
|
|
2202
|
+
to?: `0x${string}` | null | undefined;
|
|
2203
|
+
type?: "0x0" | undefined;
|
|
2204
|
+
value?: `0x${string}` | undefined;
|
|
2205
|
+
gasPrice?: `0x${string}` | undefined;
|
|
2206
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
2207
|
+
maxFeePerGas?: undefined | undefined;
|
|
2208
|
+
maxPriorityFeePerGas?: undefined | undefined;
|
|
2209
|
+
blobs?: undefined;
|
|
2210
|
+
blobVersionedHashes?: undefined;
|
|
2211
|
+
kzg?: undefined;
|
|
2212
|
+
accessList?: undefined;
|
|
2213
|
+
sidecars?: undefined;
|
|
2214
|
+
authorizationList?: undefined;
|
|
2215
|
+
feeCurrency?: `0x${string}` | undefined;
|
|
2216
|
+
} | {
|
|
2217
|
+
data?: `0x${string}` | undefined;
|
|
2218
|
+
from?: `0x${string}` | undefined;
|
|
2219
|
+
gas?: `0x${string}` | undefined;
|
|
2220
|
+
nonce?: `0x${string}` | undefined;
|
|
2221
|
+
to?: `0x${string}` | null | undefined;
|
|
2222
|
+
type?: "0x1" | undefined;
|
|
2223
|
+
value?: `0x${string}` | undefined;
|
|
2224
|
+
gasPrice?: `0x${string}` | undefined;
|
|
2225
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
2226
|
+
maxFeePerGas?: undefined | undefined;
|
|
2227
|
+
maxPriorityFeePerGas?: undefined | undefined;
|
|
2228
|
+
accessList?: viem.AccessList | undefined;
|
|
2229
|
+
blobs?: undefined;
|
|
2230
|
+
blobVersionedHashes?: undefined;
|
|
2231
|
+
kzg?: undefined;
|
|
2232
|
+
sidecars?: undefined;
|
|
2233
|
+
authorizationList?: undefined;
|
|
2234
|
+
feeCurrency?: `0x${string}` | undefined;
|
|
2235
|
+
} | {
|
|
2236
|
+
data?: `0x${string}` | undefined;
|
|
2237
|
+
from?: `0x${string}` | undefined;
|
|
2238
|
+
gas?: `0x${string}` | undefined;
|
|
2239
|
+
nonce?: `0x${string}` | undefined;
|
|
2240
|
+
to?: `0x${string}` | null | undefined;
|
|
2241
|
+
type?: "0x2" | undefined;
|
|
2242
|
+
value?: `0x${string}` | undefined;
|
|
2243
|
+
gasPrice?: undefined | undefined;
|
|
2244
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
2245
|
+
maxFeePerGas?: `0x${string}` | undefined;
|
|
2246
|
+
maxPriorityFeePerGas?: `0x${string}` | undefined;
|
|
2247
|
+
accessList?: viem.AccessList | undefined;
|
|
2248
|
+
blobs?: undefined;
|
|
2249
|
+
blobVersionedHashes?: undefined;
|
|
2250
|
+
kzg?: undefined;
|
|
2251
|
+
sidecars?: undefined;
|
|
2252
|
+
authorizationList?: undefined;
|
|
2253
|
+
feeCurrency?: `0x${string}` | undefined;
|
|
2254
|
+
} | {
|
|
2255
|
+
type?: "0x3" | undefined;
|
|
2256
|
+
data?: `0x${string}` | undefined;
|
|
2257
|
+
from?: `0x${string}` | undefined;
|
|
2258
|
+
gas?: `0x${string}` | undefined;
|
|
2259
|
+
nonce?: `0x${string}` | undefined;
|
|
2260
|
+
value?: `0x${string}` | undefined;
|
|
2261
|
+
to: `0x${string}` | null;
|
|
2262
|
+
gasPrice?: undefined | undefined;
|
|
2263
|
+
maxFeePerBlobGas?: `0x${string}` | undefined;
|
|
2264
|
+
maxFeePerGas?: `0x${string}` | undefined;
|
|
2265
|
+
maxPriorityFeePerGas?: `0x${string}` | undefined;
|
|
2266
|
+
accessList?: viem.AccessList | undefined;
|
|
2267
|
+
sidecars?: readonly viem.BlobSidecar<`0x${string}`>[] | undefined;
|
|
2268
|
+
blobs?: readonly `0x${string}`[] | readonly viem.ByteArray[] | undefined;
|
|
2269
|
+
blobVersionedHashes: readonly viem.Hex[];
|
|
2270
|
+
kzg?: undefined;
|
|
2271
|
+
authorizationList?: undefined;
|
|
2272
|
+
feeCurrency?: `0x${string}` | undefined;
|
|
2273
|
+
} | {
|
|
2274
|
+
type?: "0x3" | undefined;
|
|
2275
|
+
data?: `0x${string}` | undefined;
|
|
2276
|
+
from?: `0x${string}` | undefined;
|
|
2277
|
+
gas?: `0x${string}` | undefined;
|
|
2278
|
+
nonce?: `0x${string}` | undefined;
|
|
2279
|
+
value?: `0x${string}` | undefined;
|
|
2280
|
+
to: `0x${string}` | null;
|
|
2281
|
+
gasPrice?: undefined | undefined;
|
|
2282
|
+
maxFeePerBlobGas?: `0x${string}` | undefined;
|
|
2283
|
+
maxFeePerGas?: `0x${string}` | undefined;
|
|
2284
|
+
maxPriorityFeePerGas?: `0x${string}` | undefined;
|
|
2285
|
+
accessList?: viem.AccessList | undefined;
|
|
2286
|
+
sidecars?: readonly viem.BlobSidecar<`0x${string}`>[] | undefined;
|
|
2287
|
+
blobs: readonly viem.Hex[] | readonly viem.ByteArray[];
|
|
2288
|
+
blobVersionedHashes?: readonly `0x${string}`[] | undefined;
|
|
2289
|
+
kzg?: viem.Kzg | undefined;
|
|
2290
|
+
authorizationList?: undefined;
|
|
2291
|
+
feeCurrency?: `0x${string}` | undefined;
|
|
2292
|
+
} | {
|
|
2293
|
+
type?: "0x4" | undefined;
|
|
2294
|
+
gasPrice?: undefined | undefined;
|
|
2295
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
2296
|
+
maxFeePerGas?: `0x${string}` | undefined;
|
|
2297
|
+
maxPriorityFeePerGas?: `0x${string}` | undefined;
|
|
2298
|
+
to?: `0x${string}` | null | undefined;
|
|
2299
|
+
data?: `0x${string}` | undefined;
|
|
2300
|
+
from?: `0x${string}` | undefined;
|
|
2301
|
+
gas?: `0x${string}` | undefined;
|
|
2302
|
+
nonce?: `0x${string}` | undefined;
|
|
2303
|
+
value?: `0x${string}` | undefined;
|
|
2304
|
+
accessList?: viem.AccessList | undefined;
|
|
2305
|
+
authorizationList?: viem.RpcAuthorizationList | undefined;
|
|
2306
|
+
blobs?: undefined;
|
|
2307
|
+
blobVersionedHashes?: undefined;
|
|
2308
|
+
kzg?: undefined;
|
|
2309
|
+
sidecars?: undefined;
|
|
2310
|
+
feeCurrency?: `0x${string}` | undefined;
|
|
2311
|
+
} | {
|
|
2312
|
+
data?: `0x${string}` | undefined;
|
|
2313
|
+
from?: `0x${string}` | undefined;
|
|
2314
|
+
gas?: `0x${string}` | undefined;
|
|
2315
|
+
nonce?: `0x${string}` | undefined;
|
|
2316
|
+
to?: `0x${string}` | null | undefined;
|
|
2317
|
+
type?: "0x7b" | undefined;
|
|
2318
|
+
value?: `0x${string}` | undefined;
|
|
2319
|
+
accessList?: viem.AccessList | undefined;
|
|
2320
|
+
feeCurrency?: `0x${string}` | undefined;
|
|
2321
|
+
gasPrice?: undefined | undefined;
|
|
2322
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
2323
|
+
maxFeePerGas?: `0x${string}` | undefined;
|
|
2324
|
+
maxPriorityFeePerGas?: `0x${string}` | undefined;
|
|
2325
|
+
blobs?: undefined;
|
|
2326
|
+
blobVersionedHashes?: undefined;
|
|
2327
|
+
kzg?: undefined;
|
|
2328
|
+
sidecars?: undefined;
|
|
2329
|
+
authorizationList?: undefined;
|
|
2330
|
+
}) & {};
|
|
2331
|
+
type: "transactionRequest";
|
|
2332
|
+
};
|
|
2333
|
+
};
|
|
2334
|
+
prepareTransactionRequest?: ((args: viem.PrepareTransactionRequestParameters, options: {
|
|
2335
|
+
client: viem.Client;
|
|
2336
|
+
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
2337
|
+
}) => Promise<viem.PrepareTransactionRequestParameters>) | [fn: ((args: viem.PrepareTransactionRequestParameters, options: {
|
|
2338
|
+
client: viem.Client;
|
|
2339
|
+
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
2340
|
+
}) => Promise<viem.PrepareTransactionRequestParameters>) | undefined, options: {
|
|
2341
|
+
runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
|
|
2342
|
+
}] | undefined;
|
|
2343
|
+
serializers: {
|
|
2344
|
+
readonly transaction: typeof viem_chains.serializeTransactionCelo;
|
|
2345
|
+
};
|
|
2346
|
+
verifyHash?: ((client: viem.Client, parameters: viem.VerifyHashActionParameters) => Promise<viem.VerifyHashActionReturnType>) | undefined;
|
|
2347
|
+
};
|
|
2348
|
+
tokens: {
|
|
2349
|
+
USDC: {
|
|
2350
|
+
address: "0xcebA9300f2b948710d2653dD7B07f33A8B32118C";
|
|
2351
|
+
decimals: number;
|
|
2352
|
+
symbol: string;
|
|
2353
|
+
};
|
|
2354
|
+
USDT: {
|
|
2355
|
+
address: "0x48065fbBE25f71C9282ddf5e1cD6D6A887483D5e";
|
|
2356
|
+
decimals: number;
|
|
2357
|
+
symbol: string;
|
|
2358
|
+
};
|
|
2359
|
+
};
|
|
2360
|
+
};
|
|
2361
|
+
zksync: {
|
|
2362
|
+
chain: {
|
|
2363
|
+
blockExplorers: {
|
|
2364
|
+
readonly default: {
|
|
2365
|
+
readonly name: "ZKsync Explorer";
|
|
2366
|
+
readonly url: "https://explorer.zksync.io/";
|
|
2367
|
+
readonly apiUrl: "https://block-explorer-api.mainnet.zksync.io/api";
|
|
2368
|
+
};
|
|
2369
|
+
};
|
|
2370
|
+
blockTime: 200;
|
|
2371
|
+
contracts: {
|
|
2372
|
+
readonly multicall3: {
|
|
2373
|
+
readonly address: "0xF9cda624FBC7e059355ce98a31693d299FACd963";
|
|
2374
|
+
readonly blockCreated: 3908235;
|
|
2375
|
+
};
|
|
2376
|
+
readonly erc6492Verifier: {
|
|
2377
|
+
readonly address: "0xfB688330379976DA81eB64Fe4BF50d7401763B9C";
|
|
2378
|
+
readonly blockCreated: 45659388;
|
|
2379
|
+
};
|
|
2380
|
+
};
|
|
2381
|
+
ensTlds?: readonly string[] | undefined;
|
|
2382
|
+
id: 324;
|
|
2383
|
+
name: "ZKsync Era";
|
|
2384
|
+
nativeCurrency: {
|
|
2385
|
+
readonly decimals: 18;
|
|
2386
|
+
readonly name: "Ether";
|
|
2387
|
+
readonly symbol: "ETH";
|
|
2388
|
+
};
|
|
2389
|
+
experimental_preconfirmationTime?: number | undefined | undefined;
|
|
2390
|
+
rpcUrls: {
|
|
2391
|
+
readonly default: {
|
|
2392
|
+
readonly http: readonly ["https://mainnet.era.zksync.io"];
|
|
2393
|
+
readonly webSocket: readonly ["wss://mainnet.era.zksync.io/ws"];
|
|
2394
|
+
};
|
|
2395
|
+
};
|
|
2396
|
+
sourceId?: number | undefined | undefined;
|
|
2397
|
+
testnet?: boolean | undefined | undefined;
|
|
2398
|
+
custom: {
|
|
2399
|
+
readonly getEip712Domain: viem_zksync.EIP712DomainFn<viem_zksync.ZkSyncTransactionSerializable, viem_zksync.ZkSyncEIP712TransactionSignable>;
|
|
2400
|
+
};
|
|
2401
|
+
extendSchema?: Record<string, unknown> | undefined;
|
|
2402
|
+
fees?: viem.ChainFees<undefined> | undefined;
|
|
2403
|
+
formatters: {
|
|
2404
|
+
readonly block: {
|
|
2405
|
+
exclude: [] | undefined;
|
|
2406
|
+
format: (args: viem_zksync.ZkSyncRpcBlock, action?: string | undefined) => {
|
|
2407
|
+
baseFeePerGas: bigint | null;
|
|
2408
|
+
blobGasUsed: bigint;
|
|
2409
|
+
difficulty: bigint;
|
|
2410
|
+
excessBlobGas: bigint;
|
|
2411
|
+
extraData: viem.Hex;
|
|
2412
|
+
gasLimit: bigint;
|
|
2413
|
+
gasUsed: bigint;
|
|
2414
|
+
hash: `0x${string}` | null;
|
|
2415
|
+
logsBloom: `0x${string}` | null;
|
|
2416
|
+
miner: abitype.Address;
|
|
2417
|
+
mixHash: viem.Hash;
|
|
2418
|
+
nonce: `0x${string}` | null;
|
|
2419
|
+
number: bigint | null;
|
|
2420
|
+
parentBeaconBlockRoot?: `0x${string}` | undefined;
|
|
2421
|
+
parentHash: viem.Hash;
|
|
2422
|
+
receiptsRoot: viem.Hex;
|
|
2423
|
+
sealFields: viem.Hex[];
|
|
2424
|
+
sha3Uncles: viem.Hash;
|
|
2425
|
+
size: bigint;
|
|
2426
|
+
stateRoot: viem.Hash;
|
|
2427
|
+
timestamp: bigint;
|
|
2428
|
+
totalDifficulty: bigint | null;
|
|
2429
|
+
transactions: `0x${string}`[] | viem_zksync.ZkSyncTransaction<boolean>[];
|
|
2430
|
+
transactionsRoot: viem.Hash;
|
|
2431
|
+
uncles: viem.Hash[];
|
|
2432
|
+
withdrawals?: viem.Withdrawal[] | undefined | undefined;
|
|
2433
|
+
withdrawalsRoot?: `0x${string}` | undefined;
|
|
2434
|
+
l1BatchNumber: bigint | null;
|
|
2435
|
+
l1BatchTimestamp: bigint | null;
|
|
2436
|
+
} & {};
|
|
2437
|
+
type: "block";
|
|
2438
|
+
};
|
|
2439
|
+
readonly transaction: {
|
|
2440
|
+
exclude: [] | undefined;
|
|
2441
|
+
format: (args: viem_zksync.ZkSyncRpcTransaction, action?: string | undefined) => ({
|
|
2442
|
+
r: viem.Hex;
|
|
2443
|
+
s: viem.Hex;
|
|
2444
|
+
v: bigint;
|
|
2445
|
+
to: abitype.Address | null;
|
|
2446
|
+
from: abitype.Address;
|
|
2447
|
+
gas: bigint;
|
|
2448
|
+
nonce: number;
|
|
2449
|
+
value: bigint;
|
|
2450
|
+
blockHash: `0x${string}` | null;
|
|
2451
|
+
blockNumber: bigint | null;
|
|
2452
|
+
blockTimestamp?: bigint | undefined;
|
|
2453
|
+
hash: viem.Hash;
|
|
2454
|
+
input: viem.Hex;
|
|
2455
|
+
transactionIndex: number | null;
|
|
2456
|
+
typeHex: viem.Hex | null;
|
|
2457
|
+
accessList?: undefined | undefined;
|
|
2458
|
+
authorizationList?: undefined | undefined;
|
|
2459
|
+
blobVersionedHashes?: undefined | undefined;
|
|
2460
|
+
chainId?: number | undefined;
|
|
2461
|
+
yParity?: undefined | undefined;
|
|
2462
|
+
type: "legacy";
|
|
2463
|
+
gasPrice: bigint;
|
|
2464
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
2465
|
+
maxFeePerGas?: undefined | undefined;
|
|
2466
|
+
maxPriorityFeePerGas?: undefined | undefined;
|
|
2467
|
+
l1BatchNumber: bigint | null;
|
|
2468
|
+
l1BatchTxIndex: bigint | null;
|
|
2469
|
+
} | {
|
|
2470
|
+
blockHash: `0x${string}` | null;
|
|
2471
|
+
blockNumber: bigint | null;
|
|
2472
|
+
blockTimestamp?: bigint | undefined;
|
|
2473
|
+
from: abitype.Address;
|
|
2474
|
+
gas: bigint;
|
|
2475
|
+
hash: viem.Hash;
|
|
2476
|
+
input: viem.Hex;
|
|
2477
|
+
nonce: number;
|
|
2478
|
+
r: viem.Hex;
|
|
2479
|
+
s: viem.Hex;
|
|
2480
|
+
to: abitype.Address | null;
|
|
2481
|
+
transactionIndex: number | null;
|
|
2482
|
+
typeHex: viem.Hex | null;
|
|
2483
|
+
v: bigint;
|
|
2484
|
+
value: bigint;
|
|
2485
|
+
yParity: number;
|
|
2486
|
+
accessList: viem.AccessList;
|
|
2487
|
+
authorizationList?: undefined | undefined;
|
|
2488
|
+
blobVersionedHashes?: undefined | undefined;
|
|
2489
|
+
chainId: number;
|
|
2490
|
+
type: "eip2930";
|
|
2491
|
+
gasPrice: bigint;
|
|
2492
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
2493
|
+
maxFeePerGas?: undefined | undefined;
|
|
2494
|
+
maxPriorityFeePerGas?: undefined | undefined;
|
|
2495
|
+
l1BatchNumber: bigint | null;
|
|
2496
|
+
l1BatchTxIndex: bigint | null;
|
|
2497
|
+
} | {
|
|
2498
|
+
blockHash: `0x${string}` | null;
|
|
2499
|
+
blockNumber: bigint | null;
|
|
2500
|
+
blockTimestamp?: bigint | undefined;
|
|
2501
|
+
from: abitype.Address;
|
|
2502
|
+
gas: bigint;
|
|
2503
|
+
hash: viem.Hash;
|
|
2504
|
+
input: viem.Hex;
|
|
2505
|
+
nonce: number;
|
|
2506
|
+
r: viem.Hex;
|
|
2507
|
+
s: viem.Hex;
|
|
2508
|
+
to: abitype.Address | null;
|
|
2509
|
+
transactionIndex: number | null;
|
|
2510
|
+
typeHex: viem.Hex | null;
|
|
2511
|
+
v: bigint;
|
|
2512
|
+
value: bigint;
|
|
2513
|
+
yParity: number;
|
|
2514
|
+
accessList: viem.AccessList;
|
|
2515
|
+
authorizationList?: undefined | undefined;
|
|
2516
|
+
blobVersionedHashes?: undefined | undefined;
|
|
2517
|
+
chainId: number;
|
|
2518
|
+
type: "eip1559";
|
|
2519
|
+
gasPrice?: undefined | undefined;
|
|
2520
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
2521
|
+
maxFeePerGas: bigint;
|
|
2522
|
+
maxPriorityFeePerGas: bigint;
|
|
2523
|
+
l1BatchNumber: bigint | null;
|
|
2524
|
+
l1BatchTxIndex: bigint | null;
|
|
2525
|
+
} | {
|
|
2526
|
+
blockHash: `0x${string}` | null;
|
|
2527
|
+
blockNumber: bigint | null;
|
|
2528
|
+
blockTimestamp?: bigint | undefined;
|
|
2529
|
+
from: abitype.Address;
|
|
2530
|
+
gas: bigint;
|
|
2531
|
+
hash: viem.Hash;
|
|
2532
|
+
input: viem.Hex;
|
|
2533
|
+
nonce: number;
|
|
2534
|
+
r: viem.Hex;
|
|
2535
|
+
s: viem.Hex;
|
|
2536
|
+
to: abitype.Address | null;
|
|
2537
|
+
transactionIndex: number | null;
|
|
2538
|
+
typeHex: viem.Hex | null;
|
|
2539
|
+
v: bigint;
|
|
2540
|
+
value: bigint;
|
|
2541
|
+
yParity: number;
|
|
2542
|
+
accessList: viem.AccessList;
|
|
2543
|
+
authorizationList?: undefined | undefined;
|
|
2544
|
+
blobVersionedHashes: readonly viem.Hex[];
|
|
2545
|
+
chainId: number;
|
|
2546
|
+
type: "eip4844";
|
|
2547
|
+
gasPrice?: undefined | undefined;
|
|
2548
|
+
maxFeePerBlobGas: bigint;
|
|
2549
|
+
maxFeePerGas: bigint;
|
|
2550
|
+
maxPriorityFeePerGas: bigint;
|
|
2551
|
+
l1BatchNumber: bigint | null;
|
|
2552
|
+
l1BatchTxIndex: bigint | null;
|
|
2553
|
+
} | {
|
|
2554
|
+
blockHash: `0x${string}` | null;
|
|
2555
|
+
blockNumber: bigint | null;
|
|
2556
|
+
blockTimestamp?: bigint | undefined;
|
|
2557
|
+
from: abitype.Address;
|
|
2558
|
+
gas: bigint;
|
|
2559
|
+
hash: viem.Hash;
|
|
2560
|
+
input: viem.Hex;
|
|
2561
|
+
nonce: number;
|
|
2562
|
+
r: viem.Hex;
|
|
2563
|
+
s: viem.Hex;
|
|
2564
|
+
to: abitype.Address | null;
|
|
2565
|
+
transactionIndex: number | null;
|
|
2566
|
+
typeHex: viem.Hex | null;
|
|
2567
|
+
v: bigint;
|
|
2568
|
+
value: bigint;
|
|
2569
|
+
yParity: number;
|
|
2570
|
+
accessList: viem.AccessList;
|
|
2571
|
+
authorizationList: viem.SignedAuthorizationList;
|
|
2572
|
+
blobVersionedHashes?: undefined | undefined;
|
|
2573
|
+
chainId: number;
|
|
2574
|
+
type: "eip7702";
|
|
2575
|
+
gasPrice?: undefined | undefined;
|
|
2576
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
2577
|
+
maxFeePerGas: bigint;
|
|
2578
|
+
maxPriorityFeePerGas: bigint;
|
|
2579
|
+
l1BatchNumber: bigint | null;
|
|
2580
|
+
l1BatchTxIndex: bigint | null;
|
|
2581
|
+
} | {
|
|
2582
|
+
blockHash: `0x${string}` | null;
|
|
2583
|
+
blockNumber: bigint | null;
|
|
2584
|
+
blockTimestamp?: bigint | undefined;
|
|
2585
|
+
from: abitype.Address;
|
|
2586
|
+
gas: bigint;
|
|
2587
|
+
hash: viem.Hash;
|
|
2588
|
+
input: viem.Hex;
|
|
2589
|
+
nonce: number;
|
|
2590
|
+
r: viem.Hex;
|
|
2591
|
+
s: viem.Hex;
|
|
2592
|
+
to: abitype.Address | null;
|
|
2593
|
+
transactionIndex: number | null;
|
|
2594
|
+
typeHex: viem.Hex | null;
|
|
2595
|
+
v: bigint;
|
|
2596
|
+
value: bigint;
|
|
2597
|
+
yParity: number;
|
|
2598
|
+
l1BatchNumber: bigint | null;
|
|
2599
|
+
l1BatchTxIndex: bigint | null;
|
|
2600
|
+
gasPrice?: undefined | undefined;
|
|
2601
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
2602
|
+
maxFeePerGas: bigint;
|
|
2603
|
+
maxPriorityFeePerGas: bigint;
|
|
2604
|
+
type: "priority";
|
|
2605
|
+
} | {
|
|
2606
|
+
blockHash: `0x${string}` | null;
|
|
2607
|
+
blockNumber: bigint | null;
|
|
2608
|
+
blockTimestamp?: bigint | undefined;
|
|
2609
|
+
from: abitype.Address;
|
|
2610
|
+
gas: bigint;
|
|
2611
|
+
hash: viem.Hash;
|
|
2612
|
+
input: viem.Hex;
|
|
2613
|
+
nonce: number;
|
|
2614
|
+
r: viem.Hex;
|
|
2615
|
+
s: viem.Hex;
|
|
2616
|
+
to: abitype.Address | null;
|
|
2617
|
+
transactionIndex: number | null;
|
|
2618
|
+
typeHex: viem.Hex | null;
|
|
2619
|
+
v: bigint;
|
|
2620
|
+
value: bigint;
|
|
2621
|
+
yParity: number;
|
|
2622
|
+
l1BatchNumber: bigint | null;
|
|
2623
|
+
l1BatchTxIndex: bigint | null;
|
|
2624
|
+
gasPrice?: undefined | undefined;
|
|
2625
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
2626
|
+
maxFeePerGas: bigint;
|
|
2627
|
+
maxPriorityFeePerGas: bigint;
|
|
2628
|
+
type: "eip712" | "priority";
|
|
2629
|
+
}) & {};
|
|
2630
|
+
type: "transaction";
|
|
2631
|
+
};
|
|
2632
|
+
readonly transactionReceipt: {
|
|
2633
|
+
exclude: [] | undefined;
|
|
2634
|
+
format: (args: viem_zksync.ZkSyncRpcTransactionReceipt, action?: string | undefined) => {
|
|
2635
|
+
type: viem_zksync.ZkSyncTransactionType;
|
|
2636
|
+
contractAddress: abitype.Address | null | undefined;
|
|
2637
|
+
to: abitype.Address | null;
|
|
2638
|
+
from: abitype.Address;
|
|
2639
|
+
blockHash: viem.Hash;
|
|
2640
|
+
blockNumber: bigint;
|
|
2641
|
+
blockTimestamp?: bigint | undefined;
|
|
2642
|
+
transactionIndex: number;
|
|
2643
|
+
status: "success" | "reverted";
|
|
2644
|
+
transactionHash: viem.Hash;
|
|
2645
|
+
logsBloom: viem.Hex;
|
|
2646
|
+
blobGasUsed?: bigint | undefined;
|
|
2647
|
+
gasUsed: bigint;
|
|
2648
|
+
blobGasPrice?: bigint | undefined;
|
|
2649
|
+
cumulativeGasUsed: bigint;
|
|
2650
|
+
effectiveGasPrice: bigint;
|
|
2651
|
+
root?: `0x${string}` | undefined;
|
|
2652
|
+
l1BatchNumber: bigint | null;
|
|
2653
|
+
l1BatchTxIndex: bigint | null;
|
|
2654
|
+
logs: viem_zksync.ZkSyncLog[];
|
|
2655
|
+
l2ToL1Logs: viem_zksync.ZkSyncL2ToL1Log[];
|
|
2656
|
+
} & {};
|
|
2657
|
+
type: "transactionReceipt";
|
|
2658
|
+
};
|
|
2659
|
+
readonly transactionRequest: {
|
|
2660
|
+
exclude: ("paymaster" | "gasPerPubdata" | "factoryDeps" | "paymasterInput" | "customSignature")[] | undefined;
|
|
2661
|
+
format: (args: viem_zksync.ZkSyncTransactionRequest, action?: string | undefined) => ({
|
|
2662
|
+
data?: `0x${string}` | undefined;
|
|
2663
|
+
from?: `0x${string}` | undefined;
|
|
2664
|
+
gas?: `0x${string}` | undefined;
|
|
2665
|
+
nonce?: `0x${string}` | undefined;
|
|
2666
|
+
to?: `0x${string}` | null | undefined;
|
|
2667
|
+
type?: "0x0" | undefined;
|
|
2668
|
+
value?: `0x${string}` | undefined;
|
|
2669
|
+
gasPrice?: `0x${string}` | undefined;
|
|
2670
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
2671
|
+
maxFeePerGas?: undefined | undefined;
|
|
2672
|
+
maxPriorityFeePerGas?: undefined | undefined;
|
|
2673
|
+
blobs?: undefined;
|
|
2674
|
+
blobVersionedHashes?: undefined;
|
|
2675
|
+
kzg?: undefined;
|
|
2676
|
+
accessList?: undefined;
|
|
2677
|
+
sidecars?: undefined;
|
|
2678
|
+
authorizationList?: undefined;
|
|
2679
|
+
eip712Meta?: undefined | undefined;
|
|
2680
|
+
} | {
|
|
2681
|
+
data?: `0x${string}` | undefined;
|
|
2682
|
+
from?: `0x${string}` | undefined;
|
|
2683
|
+
gas?: `0x${string}` | undefined;
|
|
2684
|
+
nonce?: `0x${string}` | undefined;
|
|
2685
|
+
to?: `0x${string}` | null | undefined;
|
|
2686
|
+
type?: "0x1" | undefined;
|
|
2687
|
+
value?: `0x${string}` | undefined;
|
|
2688
|
+
gasPrice?: `0x${string}` | undefined;
|
|
2689
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
2690
|
+
maxFeePerGas?: undefined | undefined;
|
|
2691
|
+
maxPriorityFeePerGas?: undefined | undefined;
|
|
2692
|
+
accessList?: viem.AccessList | undefined;
|
|
2693
|
+
blobs?: undefined;
|
|
2694
|
+
blobVersionedHashes?: undefined;
|
|
2695
|
+
kzg?: undefined;
|
|
2696
|
+
sidecars?: undefined;
|
|
2697
|
+
authorizationList?: undefined;
|
|
2698
|
+
eip712Meta?: undefined | undefined;
|
|
2699
|
+
} | {
|
|
2700
|
+
data?: `0x${string}` | undefined;
|
|
2701
|
+
from?: `0x${string}` | undefined;
|
|
2702
|
+
gas?: `0x${string}` | undefined;
|
|
2703
|
+
nonce?: `0x${string}` | undefined;
|
|
2704
|
+
to?: `0x${string}` | null | undefined;
|
|
2705
|
+
type?: "0x2" | undefined;
|
|
2706
|
+
value?: `0x${string}` | undefined;
|
|
2707
|
+
gasPrice?: undefined | undefined;
|
|
2708
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
2709
|
+
maxFeePerGas?: `0x${string}` | undefined;
|
|
2710
|
+
maxPriorityFeePerGas?: `0x${string}` | undefined;
|
|
2711
|
+
accessList?: viem.AccessList | undefined;
|
|
2712
|
+
blobs?: undefined;
|
|
2713
|
+
blobVersionedHashes?: undefined;
|
|
2714
|
+
kzg?: undefined;
|
|
2715
|
+
sidecars?: undefined;
|
|
2716
|
+
authorizationList?: undefined;
|
|
2717
|
+
eip712Meta?: undefined | undefined;
|
|
2718
|
+
} | {
|
|
2719
|
+
type?: "0x3" | undefined;
|
|
2720
|
+
data?: `0x${string}` | undefined;
|
|
2721
|
+
from?: `0x${string}` | undefined;
|
|
2722
|
+
gas?: `0x${string}` | undefined;
|
|
2723
|
+
nonce?: `0x${string}` | undefined;
|
|
2724
|
+
value?: `0x${string}` | undefined;
|
|
2725
|
+
to: `0x${string}` | null;
|
|
2726
|
+
gasPrice?: undefined | undefined;
|
|
2727
|
+
maxFeePerBlobGas?: `0x${string}` | undefined;
|
|
2728
|
+
maxFeePerGas?: `0x${string}` | undefined;
|
|
2729
|
+
maxPriorityFeePerGas?: `0x${string}` | undefined;
|
|
2730
|
+
accessList?: viem.AccessList | undefined;
|
|
2731
|
+
sidecars?: readonly viem.BlobSidecar<`0x${string}`>[] | undefined;
|
|
2732
|
+
blobs?: readonly `0x${string}`[] | readonly viem.ByteArray[] | undefined;
|
|
2733
|
+
blobVersionedHashes: readonly viem.Hex[];
|
|
2734
|
+
kzg?: undefined;
|
|
2735
|
+
authorizationList?: undefined;
|
|
2736
|
+
eip712Meta?: undefined | undefined;
|
|
2737
|
+
} | {
|
|
2738
|
+
type?: "0x3" | undefined;
|
|
2739
|
+
data?: `0x${string}` | undefined;
|
|
2740
|
+
from?: `0x${string}` | undefined;
|
|
2741
|
+
gas?: `0x${string}` | undefined;
|
|
2742
|
+
nonce?: `0x${string}` | undefined;
|
|
2743
|
+
value?: `0x${string}` | undefined;
|
|
2744
|
+
to: `0x${string}` | null;
|
|
2745
|
+
gasPrice?: undefined | undefined;
|
|
2746
|
+
maxFeePerBlobGas?: `0x${string}` | undefined;
|
|
2747
|
+
maxFeePerGas?: `0x${string}` | undefined;
|
|
2748
|
+
maxPriorityFeePerGas?: `0x${string}` | undefined;
|
|
2749
|
+
accessList?: viem.AccessList | undefined;
|
|
2750
|
+
sidecars?: readonly viem.BlobSidecar<`0x${string}`>[] | undefined;
|
|
2751
|
+
blobs: readonly viem.Hex[] | readonly viem.ByteArray[];
|
|
2752
|
+
blobVersionedHashes?: readonly `0x${string}`[] | undefined;
|
|
2753
|
+
kzg?: viem.Kzg | undefined;
|
|
2754
|
+
authorizationList?: undefined;
|
|
2755
|
+
eip712Meta?: undefined | undefined;
|
|
2756
|
+
} | {
|
|
2757
|
+
type?: "0x4" | undefined;
|
|
2758
|
+
gasPrice?: undefined | undefined;
|
|
2759
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
2760
|
+
maxFeePerGas?: `0x${string}` | undefined;
|
|
2761
|
+
maxPriorityFeePerGas?: `0x${string}` | undefined;
|
|
2762
|
+
to?: `0x${string}` | null | undefined;
|
|
2763
|
+
data?: `0x${string}` | undefined;
|
|
2764
|
+
from?: `0x${string}` | undefined;
|
|
2765
|
+
gas?: `0x${string}` | undefined;
|
|
2766
|
+
nonce?: `0x${string}` | undefined;
|
|
2767
|
+
value?: `0x${string}` | undefined;
|
|
2768
|
+
accessList?: viem.AccessList | undefined;
|
|
2769
|
+
authorizationList?: viem.RpcAuthorizationList | undefined;
|
|
2770
|
+
blobs?: undefined;
|
|
2771
|
+
blobVersionedHashes?: undefined;
|
|
2772
|
+
kzg?: undefined;
|
|
2773
|
+
sidecars?: undefined;
|
|
2774
|
+
eip712Meta?: undefined | undefined;
|
|
2775
|
+
} | {
|
|
2776
|
+
data?: `0x${string}` | undefined;
|
|
2777
|
+
from?: `0x${string}` | undefined;
|
|
2778
|
+
gas?: `0x${string}` | undefined;
|
|
2779
|
+
nonce?: `0x${string}` | undefined;
|
|
2780
|
+
to?: `0x${string}` | null | undefined;
|
|
2781
|
+
type: "0xff" | "0x71";
|
|
2782
|
+
value?: `0x${string}` | undefined;
|
|
2783
|
+
gasPrice?: undefined | undefined;
|
|
2784
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
2785
|
+
maxFeePerGas?: `0x${string}` | undefined;
|
|
2786
|
+
maxPriorityFeePerGas?: `0x${string}` | undefined;
|
|
2787
|
+
eip712Meta: viem_zksync.ZkSyncEip712Meta;
|
|
2788
|
+
}) & {
|
|
2789
|
+
paymaster: never;
|
|
2790
|
+
gasPerPubdata: never;
|
|
2791
|
+
factoryDeps: never;
|
|
2792
|
+
paymasterInput: never;
|
|
2793
|
+
customSignature: never;
|
|
2794
|
+
};
|
|
2795
|
+
type: "transactionRequest";
|
|
2796
|
+
};
|
|
2797
|
+
};
|
|
2798
|
+
prepareTransactionRequest?: ((args: viem.PrepareTransactionRequestParameters, options: {
|
|
2799
|
+
client: viem.Client;
|
|
2800
|
+
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
2801
|
+
}) => Promise<viem.PrepareTransactionRequestParameters>) | [fn: ((args: viem.PrepareTransactionRequestParameters, options: {
|
|
2802
|
+
client: viem.Client;
|
|
2803
|
+
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
2804
|
+
}) => Promise<viem.PrepareTransactionRequestParameters>) | undefined, options: {
|
|
2805
|
+
runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
|
|
2806
|
+
}] | undefined;
|
|
2807
|
+
serializers: {
|
|
2808
|
+
readonly transaction: typeof viem_zksync.serializeTransaction;
|
|
2809
|
+
};
|
|
2810
|
+
verifyHash?: ((client: viem.Client, parameters: viem.VerifyHashActionParameters) => Promise<viem.VerifyHashActionReturnType>) | undefined;
|
|
2811
|
+
readonly network: "zksync-era";
|
|
2812
|
+
};
|
|
2813
|
+
tokens: {
|
|
2814
|
+
USDC: {
|
|
2815
|
+
address: "0x1d17CBcF0D6D143135aE902365D2E5e2A16538D4";
|
|
2816
|
+
decimals: number;
|
|
2817
|
+
symbol: string;
|
|
2818
|
+
};
|
|
2819
|
+
USDT: {
|
|
2820
|
+
address: "0x493257fD37EDB34451f62EDf8D2a0C418852bA4C";
|
|
2821
|
+
decimals: number;
|
|
2822
|
+
symbol: string;
|
|
2823
|
+
};
|
|
2824
|
+
};
|
|
2825
|
+
};
|
|
2826
|
+
unichain: {
|
|
2827
|
+
chain: {
|
|
2828
|
+
blockExplorers: {
|
|
2829
|
+
readonly default: {
|
|
2830
|
+
readonly name: "Uniscan";
|
|
2831
|
+
readonly url: "https://uniscan.xyz";
|
|
2832
|
+
readonly apiUrl: "https://api.uniscan.xyz/api";
|
|
2833
|
+
};
|
|
2834
|
+
};
|
|
2835
|
+
blockTime: 1000;
|
|
2836
|
+
contracts: {
|
|
2837
|
+
readonly multicall3: {
|
|
2838
|
+
readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
|
|
2839
|
+
readonly blockCreated: 0;
|
|
2840
|
+
};
|
|
2841
|
+
readonly disputeGameFactory: {
|
|
2842
|
+
readonly 1: {
|
|
2843
|
+
readonly address: "0x2F12d621a16e2d3285929C9996f478508951dFe4";
|
|
2844
|
+
};
|
|
2845
|
+
};
|
|
2846
|
+
readonly portal: {
|
|
2847
|
+
readonly 1: {
|
|
2848
|
+
readonly address: "0x0bd48f6B86a26D3a217d0Fa6FfE2B491B956A7a2";
|
|
2849
|
+
};
|
|
2850
|
+
};
|
|
2851
|
+
readonly l1StandardBridge: {
|
|
2852
|
+
readonly 1: {
|
|
2853
|
+
readonly address: "0x81014F44b0a345033bB2b3B21C7a1A308B35fEeA";
|
|
2854
|
+
};
|
|
2855
|
+
};
|
|
2856
|
+
readonly gasPriceOracle: {
|
|
2857
|
+
readonly address: "0x420000000000000000000000000000000000000F";
|
|
2858
|
+
};
|
|
2859
|
+
readonly l1Block: {
|
|
2860
|
+
readonly address: "0x4200000000000000000000000000000000000015";
|
|
2861
|
+
};
|
|
2862
|
+
readonly l2CrossDomainMessenger: {
|
|
2863
|
+
readonly address: "0x4200000000000000000000000000000000000007";
|
|
2864
|
+
};
|
|
2865
|
+
readonly l2Erc721Bridge: {
|
|
2866
|
+
readonly address: "0x4200000000000000000000000000000000000014";
|
|
2867
|
+
};
|
|
2868
|
+
readonly l2StandardBridge: {
|
|
2869
|
+
readonly address: "0x4200000000000000000000000000000000000010";
|
|
2870
|
+
};
|
|
2871
|
+
readonly l2ToL1MessagePasser: {
|
|
2872
|
+
readonly address: "0x4200000000000000000000000000000000000016";
|
|
2873
|
+
};
|
|
2874
|
+
};
|
|
2875
|
+
ensTlds?: readonly string[] | undefined;
|
|
2876
|
+
id: 130;
|
|
2877
|
+
name: "Unichain";
|
|
2878
|
+
nativeCurrency: {
|
|
2879
|
+
readonly name: "Ether";
|
|
2880
|
+
readonly symbol: "ETH";
|
|
2881
|
+
readonly decimals: 18;
|
|
2882
|
+
};
|
|
2883
|
+
experimental_preconfirmationTime?: number | undefined | undefined;
|
|
2884
|
+
rpcUrls: {
|
|
2885
|
+
readonly default: {
|
|
2886
|
+
readonly http: readonly ["https://mainnet.unichain.org/"];
|
|
2887
|
+
};
|
|
2888
|
+
};
|
|
2889
|
+
sourceId: 1;
|
|
2890
|
+
testnet?: boolean | undefined | undefined;
|
|
2891
|
+
custom?: Record<string, unknown> | undefined;
|
|
2892
|
+
extendSchema?: Record<string, unknown> | undefined;
|
|
2893
|
+
fees?: viem.ChainFees<undefined> | undefined;
|
|
2894
|
+
formatters: {
|
|
2895
|
+
readonly block: {
|
|
2896
|
+
exclude: [] | undefined;
|
|
2897
|
+
format: (args: viem_chains.OpStackRpcBlock, action?: string | undefined) => {
|
|
2898
|
+
baseFeePerGas: bigint | null;
|
|
2899
|
+
blobGasUsed: bigint;
|
|
2900
|
+
difficulty: bigint;
|
|
2901
|
+
excessBlobGas: bigint;
|
|
2902
|
+
extraData: viem.Hex;
|
|
2903
|
+
gasLimit: bigint;
|
|
2904
|
+
gasUsed: bigint;
|
|
2905
|
+
hash: `0x${string}` | null;
|
|
2906
|
+
logsBloom: `0x${string}` | null;
|
|
2907
|
+
miner: abitype.Address;
|
|
2908
|
+
mixHash: viem.Hash;
|
|
2909
|
+
nonce: `0x${string}` | null;
|
|
2910
|
+
number: bigint | null;
|
|
2911
|
+
parentBeaconBlockRoot?: `0x${string}` | undefined;
|
|
2912
|
+
parentHash: viem.Hash;
|
|
2913
|
+
receiptsRoot: viem.Hex;
|
|
2914
|
+
sealFields: viem.Hex[];
|
|
2915
|
+
sha3Uncles: viem.Hash;
|
|
2916
|
+
size: bigint;
|
|
2917
|
+
stateRoot: viem.Hash;
|
|
2918
|
+
timestamp: bigint;
|
|
2919
|
+
totalDifficulty: bigint | null;
|
|
2920
|
+
transactions: `0x${string}`[] | viem_chains.OpStackTransaction<boolean>[];
|
|
2921
|
+
transactionsRoot: viem.Hash;
|
|
2922
|
+
uncles: viem.Hash[];
|
|
2923
|
+
withdrawals?: viem.Withdrawal[] | undefined | undefined;
|
|
2924
|
+
withdrawalsRoot?: `0x${string}` | undefined;
|
|
2925
|
+
} & {};
|
|
2926
|
+
type: "block";
|
|
2927
|
+
};
|
|
2928
|
+
readonly transaction: {
|
|
2929
|
+
exclude: [] | undefined;
|
|
2930
|
+
format: (args: viem_chains.OpStackRpcTransaction, action?: string | undefined) => ({
|
|
2931
|
+
blockHash: `0x${string}` | null;
|
|
2932
|
+
blockNumber: bigint | null;
|
|
2933
|
+
blockTimestamp?: bigint | undefined;
|
|
2934
|
+
from: abitype.Address;
|
|
2935
|
+
gas: bigint;
|
|
2936
|
+
hash: viem.Hash;
|
|
2937
|
+
input: viem.Hex;
|
|
2938
|
+
nonce: number;
|
|
2939
|
+
r: viem.Hex;
|
|
2940
|
+
s: viem.Hex;
|
|
2941
|
+
to: abitype.Address | null;
|
|
2942
|
+
transactionIndex: number | null;
|
|
2943
|
+
typeHex: viem.Hex | null;
|
|
2944
|
+
v: bigint;
|
|
2945
|
+
value: bigint;
|
|
2946
|
+
yParity: number;
|
|
2947
|
+
gasPrice?: undefined | undefined;
|
|
2948
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
2949
|
+
maxFeePerGas: bigint;
|
|
2950
|
+
maxPriorityFeePerGas: bigint;
|
|
2951
|
+
isSystemTx?: boolean;
|
|
2952
|
+
mint?: bigint | undefined | undefined;
|
|
2953
|
+
sourceHash: viem.Hex;
|
|
2954
|
+
type: "deposit";
|
|
2955
|
+
} | {
|
|
2956
|
+
r: viem.Hex;
|
|
2957
|
+
s: viem.Hex;
|
|
2958
|
+
v: bigint;
|
|
2959
|
+
to: abitype.Address | null;
|
|
2960
|
+
from: abitype.Address;
|
|
2961
|
+
gas: bigint;
|
|
2962
|
+
nonce: number;
|
|
2963
|
+
value: bigint;
|
|
2964
|
+
blockHash: `0x${string}` | null;
|
|
2965
|
+
blockNumber: bigint | null;
|
|
2966
|
+
blockTimestamp?: bigint | undefined;
|
|
2967
|
+
hash: viem.Hash;
|
|
2968
|
+
input: viem.Hex;
|
|
2969
|
+
transactionIndex: number | null;
|
|
2970
|
+
typeHex: viem.Hex | null;
|
|
2971
|
+
accessList?: undefined | undefined;
|
|
2972
|
+
authorizationList?: undefined | undefined;
|
|
2973
|
+
blobVersionedHashes?: undefined | undefined;
|
|
2974
|
+
chainId?: number | undefined;
|
|
2975
|
+
yParity?: undefined | undefined;
|
|
2976
|
+
type: "legacy";
|
|
2977
|
+
gasPrice: bigint;
|
|
2978
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
2979
|
+
maxFeePerGas?: undefined | undefined;
|
|
2980
|
+
maxPriorityFeePerGas?: undefined | undefined;
|
|
2981
|
+
isSystemTx?: undefined | undefined;
|
|
2982
|
+
mint?: undefined | undefined;
|
|
2983
|
+
sourceHash?: undefined | undefined;
|
|
2984
|
+
} | {
|
|
2985
|
+
blockHash: `0x${string}` | null;
|
|
2986
|
+
blockNumber: bigint | null;
|
|
2987
|
+
blockTimestamp?: bigint | undefined;
|
|
2988
|
+
from: abitype.Address;
|
|
2989
|
+
gas: bigint;
|
|
2990
|
+
hash: viem.Hash;
|
|
2991
|
+
input: viem.Hex;
|
|
2992
|
+
nonce: number;
|
|
2993
|
+
r: viem.Hex;
|
|
2994
|
+
s: viem.Hex;
|
|
2995
|
+
to: abitype.Address | null;
|
|
2996
|
+
transactionIndex: number | null;
|
|
2997
|
+
typeHex: viem.Hex | null;
|
|
2998
|
+
v: bigint;
|
|
2999
|
+
value: bigint;
|
|
3000
|
+
yParity: number;
|
|
3001
|
+
accessList: viem.AccessList;
|
|
3002
|
+
authorizationList?: undefined | undefined;
|
|
3003
|
+
blobVersionedHashes?: undefined | undefined;
|
|
3004
|
+
chainId: number;
|
|
3005
|
+
type: "eip2930";
|
|
3006
|
+
gasPrice: bigint;
|
|
3007
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
3008
|
+
maxFeePerGas?: undefined | undefined;
|
|
3009
|
+
maxPriorityFeePerGas?: undefined | undefined;
|
|
3010
|
+
isSystemTx?: undefined | undefined;
|
|
3011
|
+
mint?: undefined | undefined;
|
|
3012
|
+
sourceHash?: undefined | undefined;
|
|
3013
|
+
} | {
|
|
3014
|
+
blockHash: `0x${string}` | null;
|
|
3015
|
+
blockNumber: bigint | null;
|
|
3016
|
+
blockTimestamp?: bigint | undefined;
|
|
3017
|
+
from: abitype.Address;
|
|
3018
|
+
gas: bigint;
|
|
3019
|
+
hash: viem.Hash;
|
|
3020
|
+
input: viem.Hex;
|
|
3021
|
+
nonce: number;
|
|
3022
|
+
r: viem.Hex;
|
|
3023
|
+
s: viem.Hex;
|
|
3024
|
+
to: abitype.Address | null;
|
|
3025
|
+
transactionIndex: number | null;
|
|
3026
|
+
typeHex: viem.Hex | null;
|
|
3027
|
+
v: bigint;
|
|
3028
|
+
value: bigint;
|
|
3029
|
+
yParity: number;
|
|
3030
|
+
accessList: viem.AccessList;
|
|
3031
|
+
authorizationList?: undefined | undefined;
|
|
3032
|
+
blobVersionedHashes?: undefined | undefined;
|
|
3033
|
+
chainId: number;
|
|
3034
|
+
type: "eip1559";
|
|
3035
|
+
gasPrice?: undefined | undefined;
|
|
3036
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
3037
|
+
maxFeePerGas: bigint;
|
|
3038
|
+
maxPriorityFeePerGas: bigint;
|
|
3039
|
+
isSystemTx?: undefined | undefined;
|
|
3040
|
+
mint?: undefined | undefined;
|
|
3041
|
+
sourceHash?: undefined | undefined;
|
|
3042
|
+
} | {
|
|
3043
|
+
blockHash: `0x${string}` | null;
|
|
3044
|
+
blockNumber: bigint | null;
|
|
3045
|
+
blockTimestamp?: bigint | undefined;
|
|
3046
|
+
from: abitype.Address;
|
|
3047
|
+
gas: bigint;
|
|
3048
|
+
hash: viem.Hash;
|
|
3049
|
+
input: viem.Hex;
|
|
3050
|
+
nonce: number;
|
|
3051
|
+
r: viem.Hex;
|
|
3052
|
+
s: viem.Hex;
|
|
3053
|
+
to: abitype.Address | null;
|
|
3054
|
+
transactionIndex: number | null;
|
|
3055
|
+
typeHex: viem.Hex | null;
|
|
3056
|
+
v: bigint;
|
|
3057
|
+
value: bigint;
|
|
3058
|
+
yParity: number;
|
|
3059
|
+
accessList: viem.AccessList;
|
|
3060
|
+
authorizationList?: undefined | undefined;
|
|
3061
|
+
blobVersionedHashes: readonly viem.Hex[];
|
|
3062
|
+
chainId: number;
|
|
3063
|
+
type: "eip4844";
|
|
3064
|
+
gasPrice?: undefined | undefined;
|
|
3065
|
+
maxFeePerBlobGas: bigint;
|
|
3066
|
+
maxFeePerGas: bigint;
|
|
3067
|
+
maxPriorityFeePerGas: bigint;
|
|
3068
|
+
isSystemTx?: undefined | undefined;
|
|
3069
|
+
mint?: undefined | undefined;
|
|
3070
|
+
sourceHash?: undefined | undefined;
|
|
3071
|
+
} | {
|
|
3072
|
+
blockHash: `0x${string}` | null;
|
|
3073
|
+
blockNumber: bigint | null;
|
|
3074
|
+
blockTimestamp?: bigint | undefined;
|
|
3075
|
+
from: abitype.Address;
|
|
3076
|
+
gas: bigint;
|
|
3077
|
+
hash: viem.Hash;
|
|
3078
|
+
input: viem.Hex;
|
|
3079
|
+
nonce: number;
|
|
3080
|
+
r: viem.Hex;
|
|
3081
|
+
s: viem.Hex;
|
|
3082
|
+
to: abitype.Address | null;
|
|
3083
|
+
transactionIndex: number | null;
|
|
3084
|
+
typeHex: viem.Hex | null;
|
|
3085
|
+
v: bigint;
|
|
3086
|
+
value: bigint;
|
|
3087
|
+
yParity: number;
|
|
3088
|
+
accessList: viem.AccessList;
|
|
3089
|
+
authorizationList: viem.SignedAuthorizationList;
|
|
3090
|
+
blobVersionedHashes?: undefined | undefined;
|
|
3091
|
+
chainId: number;
|
|
3092
|
+
type: "eip7702";
|
|
3093
|
+
gasPrice?: undefined | undefined;
|
|
3094
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
3095
|
+
maxFeePerGas: bigint;
|
|
3096
|
+
maxPriorityFeePerGas: bigint;
|
|
3097
|
+
isSystemTx?: undefined | undefined;
|
|
3098
|
+
mint?: undefined | undefined;
|
|
3099
|
+
sourceHash?: undefined | undefined;
|
|
3100
|
+
}) & {};
|
|
3101
|
+
type: "transaction";
|
|
3102
|
+
};
|
|
3103
|
+
readonly transactionReceipt: {
|
|
3104
|
+
exclude: [] | undefined;
|
|
3105
|
+
format: (args: viem_chains.OpStackRpcTransactionReceipt, action?: string | undefined) => {
|
|
3106
|
+
blobGasPrice?: bigint | undefined;
|
|
3107
|
+
blobGasUsed?: bigint | undefined;
|
|
3108
|
+
blockHash: viem.Hash;
|
|
3109
|
+
blockNumber: bigint;
|
|
3110
|
+
blockTimestamp?: bigint | undefined;
|
|
3111
|
+
contractAddress: abitype.Address | null | undefined;
|
|
3112
|
+
cumulativeGasUsed: bigint;
|
|
3113
|
+
effectiveGasPrice: bigint;
|
|
3114
|
+
from: abitype.Address;
|
|
3115
|
+
gasUsed: bigint;
|
|
3116
|
+
logs: viem.Log<bigint, number, false>[];
|
|
3117
|
+
logsBloom: viem.Hex;
|
|
3118
|
+
root?: `0x${string}` | undefined;
|
|
3119
|
+
status: "success" | "reverted";
|
|
3120
|
+
to: abitype.Address | null;
|
|
3121
|
+
transactionHash: viem.Hash;
|
|
3122
|
+
transactionIndex: number;
|
|
3123
|
+
type: viem.TransactionType;
|
|
3124
|
+
l1GasPrice: bigint | null;
|
|
3125
|
+
l1GasUsed: bigint | null;
|
|
3126
|
+
l1Fee: bigint | null;
|
|
3127
|
+
l1FeeScalar: number | null;
|
|
3128
|
+
} & {};
|
|
3129
|
+
type: "transactionReceipt";
|
|
3130
|
+
};
|
|
3131
|
+
};
|
|
3132
|
+
prepareTransactionRequest?: ((args: viem.PrepareTransactionRequestParameters, options: {
|
|
3133
|
+
client: viem.Client;
|
|
3134
|
+
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
3135
|
+
}) => Promise<viem.PrepareTransactionRequestParameters>) | [fn: ((args: viem.PrepareTransactionRequestParameters, options: {
|
|
3136
|
+
client: viem.Client;
|
|
3137
|
+
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
3138
|
+
}) => Promise<viem.PrepareTransactionRequestParameters>) | undefined, options: {
|
|
3139
|
+
runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
|
|
3140
|
+
}] | undefined;
|
|
3141
|
+
serializers: {
|
|
3142
|
+
readonly transaction: typeof viem_chains.serializeTransactionOpStack;
|
|
3143
|
+
};
|
|
3144
|
+
verifyHash?: ((client: viem.Client, parameters: viem.VerifyHashActionParameters) => Promise<viem.VerifyHashActionReturnType>) | undefined;
|
|
3145
|
+
};
|
|
3146
|
+
tokens: {
|
|
3147
|
+
USDC: {
|
|
3148
|
+
address: "0x078D782b760474a361dDA0AF3839290b0EF57AD6";
|
|
3149
|
+
decimals: number;
|
|
3150
|
+
symbol: string;
|
|
3151
|
+
};
|
|
3152
|
+
USDT: {
|
|
3153
|
+
address: "0x9151434b16b9763660705744891fA906F660EcC5";
|
|
3154
|
+
decimals: number;
|
|
3155
|
+
symbol: string;
|
|
3156
|
+
};
|
|
3157
|
+
};
|
|
3158
|
+
};
|
|
3159
|
+
worldchain: {
|
|
3160
|
+
chain: {
|
|
3161
|
+
blockExplorers: {
|
|
3162
|
+
readonly default: {
|
|
3163
|
+
readonly name: "Worldscan";
|
|
3164
|
+
readonly url: "https://worldscan.org";
|
|
3165
|
+
readonly apiUrl: "https://api.worldscan.org/api";
|
|
3166
|
+
};
|
|
3167
|
+
readonly blockscout: {
|
|
3168
|
+
readonly name: "Blockscout";
|
|
3169
|
+
readonly url: "https://worldchain-mainnet.explorer.alchemy.com";
|
|
3170
|
+
readonly apiUrl: "https://worldchain-mainnet.explorer.alchemy.com/api";
|
|
3171
|
+
};
|
|
3172
|
+
};
|
|
3173
|
+
blockTime: 2000;
|
|
3174
|
+
contracts: {
|
|
3175
|
+
readonly multicall3: {
|
|
3176
|
+
readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
|
|
3177
|
+
readonly blockCreated: 0;
|
|
3178
|
+
};
|
|
3179
|
+
readonly disputeGameFactory: {
|
|
3180
|
+
readonly 1: {
|
|
3181
|
+
readonly address: "0x069c4c579671f8c120b1327a73217D01Ea2EC5ea";
|
|
3182
|
+
};
|
|
3183
|
+
};
|
|
3184
|
+
readonly l2OutputOracle: {
|
|
3185
|
+
readonly 1: {
|
|
3186
|
+
readonly address: "0x19A6d1E9034596196295CF148509796978343c5D";
|
|
3187
|
+
};
|
|
3188
|
+
};
|
|
3189
|
+
readonly portal: {
|
|
3190
|
+
readonly 1: {
|
|
3191
|
+
readonly address: "0xd5ec14a83B7d95BE1E2Ac12523e2dEE12Cbeea6C";
|
|
3192
|
+
};
|
|
3193
|
+
};
|
|
3194
|
+
readonly l1StandardBridge: {
|
|
3195
|
+
readonly 1: {
|
|
3196
|
+
readonly address: "0x470458C91978D2d929704489Ad730DC3E3001113";
|
|
3197
|
+
};
|
|
3198
|
+
};
|
|
3199
|
+
readonly gasPriceOracle: {
|
|
3200
|
+
readonly address: "0x420000000000000000000000000000000000000F";
|
|
3201
|
+
};
|
|
3202
|
+
readonly l1Block: {
|
|
3203
|
+
readonly address: "0x4200000000000000000000000000000000000015";
|
|
3204
|
+
};
|
|
3205
|
+
readonly l2CrossDomainMessenger: {
|
|
3206
|
+
readonly address: "0x4200000000000000000000000000000000000007";
|
|
3207
|
+
};
|
|
3208
|
+
readonly l2Erc721Bridge: {
|
|
3209
|
+
readonly address: "0x4200000000000000000000000000000000000014";
|
|
3210
|
+
};
|
|
3211
|
+
readonly l2StandardBridge: {
|
|
3212
|
+
readonly address: "0x4200000000000000000000000000000000000010";
|
|
3213
|
+
};
|
|
3214
|
+
readonly l2ToL1MessagePasser: {
|
|
3215
|
+
readonly address: "0x4200000000000000000000000000000000000016";
|
|
3216
|
+
};
|
|
3217
|
+
};
|
|
3218
|
+
ensTlds?: readonly string[] | undefined;
|
|
3219
|
+
id: 480;
|
|
3220
|
+
name: "World Chain";
|
|
3221
|
+
nativeCurrency: {
|
|
3222
|
+
readonly name: "Ether";
|
|
3223
|
+
readonly symbol: "ETH";
|
|
3224
|
+
readonly decimals: 18;
|
|
3225
|
+
};
|
|
3226
|
+
experimental_preconfirmationTime?: number | undefined | undefined;
|
|
3227
|
+
rpcUrls: {
|
|
3228
|
+
readonly default: {
|
|
3229
|
+
readonly http: readonly ["https://worldchain-mainnet.g.alchemy.com/public"];
|
|
3230
|
+
};
|
|
3231
|
+
};
|
|
3232
|
+
sourceId: 1;
|
|
3233
|
+
testnet: false;
|
|
3234
|
+
custom?: Record<string, unknown> | undefined;
|
|
3235
|
+
extendSchema?: Record<string, unknown> | undefined;
|
|
3236
|
+
fees?: viem.ChainFees<undefined> | undefined;
|
|
3237
|
+
formatters: {
|
|
3238
|
+
readonly block: {
|
|
3239
|
+
exclude: [] | undefined;
|
|
3240
|
+
format: (args: viem_chains.OpStackRpcBlock, action?: string | undefined) => {
|
|
3241
|
+
baseFeePerGas: bigint | null;
|
|
3242
|
+
blobGasUsed: bigint;
|
|
3243
|
+
difficulty: bigint;
|
|
3244
|
+
excessBlobGas: bigint;
|
|
3245
|
+
extraData: viem.Hex;
|
|
3246
|
+
gasLimit: bigint;
|
|
3247
|
+
gasUsed: bigint;
|
|
3248
|
+
hash: `0x${string}` | null;
|
|
3249
|
+
logsBloom: `0x${string}` | null;
|
|
3250
|
+
miner: abitype.Address;
|
|
3251
|
+
mixHash: viem.Hash;
|
|
3252
|
+
nonce: `0x${string}` | null;
|
|
3253
|
+
number: bigint | null;
|
|
3254
|
+
parentBeaconBlockRoot?: `0x${string}` | undefined;
|
|
3255
|
+
parentHash: viem.Hash;
|
|
3256
|
+
receiptsRoot: viem.Hex;
|
|
3257
|
+
sealFields: viem.Hex[];
|
|
3258
|
+
sha3Uncles: viem.Hash;
|
|
3259
|
+
size: bigint;
|
|
3260
|
+
stateRoot: viem.Hash;
|
|
3261
|
+
timestamp: bigint;
|
|
3262
|
+
totalDifficulty: bigint | null;
|
|
3263
|
+
transactions: `0x${string}`[] | viem_chains.OpStackTransaction<boolean>[];
|
|
3264
|
+
transactionsRoot: viem.Hash;
|
|
3265
|
+
uncles: viem.Hash[];
|
|
3266
|
+
withdrawals?: viem.Withdrawal[] | undefined | undefined;
|
|
3267
|
+
withdrawalsRoot?: `0x${string}` | undefined;
|
|
3268
|
+
} & {};
|
|
3269
|
+
type: "block";
|
|
3270
|
+
};
|
|
3271
|
+
readonly transaction: {
|
|
3272
|
+
exclude: [] | undefined;
|
|
3273
|
+
format: (args: viem_chains.OpStackRpcTransaction, action?: string | undefined) => ({
|
|
3274
|
+
blockHash: `0x${string}` | null;
|
|
3275
|
+
blockNumber: bigint | null;
|
|
3276
|
+
blockTimestamp?: bigint | undefined;
|
|
3277
|
+
from: abitype.Address;
|
|
3278
|
+
gas: bigint;
|
|
3279
|
+
hash: viem.Hash;
|
|
3280
|
+
input: viem.Hex;
|
|
3281
|
+
nonce: number;
|
|
3282
|
+
r: viem.Hex;
|
|
3283
|
+
s: viem.Hex;
|
|
3284
|
+
to: abitype.Address | null;
|
|
3285
|
+
transactionIndex: number | null;
|
|
3286
|
+
typeHex: viem.Hex | null;
|
|
3287
|
+
v: bigint;
|
|
3288
|
+
value: bigint;
|
|
3289
|
+
yParity: number;
|
|
3290
|
+
gasPrice?: undefined | undefined;
|
|
3291
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
3292
|
+
maxFeePerGas: bigint;
|
|
3293
|
+
maxPriorityFeePerGas: bigint;
|
|
3294
|
+
isSystemTx?: boolean;
|
|
3295
|
+
mint?: bigint | undefined | undefined;
|
|
3296
|
+
sourceHash: viem.Hex;
|
|
3297
|
+
type: "deposit";
|
|
3298
|
+
} | {
|
|
3299
|
+
r: viem.Hex;
|
|
3300
|
+
s: viem.Hex;
|
|
3301
|
+
v: bigint;
|
|
3302
|
+
to: abitype.Address | null;
|
|
3303
|
+
from: abitype.Address;
|
|
3304
|
+
gas: bigint;
|
|
3305
|
+
nonce: number;
|
|
3306
|
+
value: bigint;
|
|
3307
|
+
blockHash: `0x${string}` | null;
|
|
3308
|
+
blockNumber: bigint | null;
|
|
3309
|
+
blockTimestamp?: bigint | undefined;
|
|
3310
|
+
hash: viem.Hash;
|
|
3311
|
+
input: viem.Hex;
|
|
3312
|
+
transactionIndex: number | null;
|
|
3313
|
+
typeHex: viem.Hex | null;
|
|
3314
|
+
accessList?: undefined | undefined;
|
|
3315
|
+
authorizationList?: undefined | undefined;
|
|
3316
|
+
blobVersionedHashes?: undefined | undefined;
|
|
3317
|
+
chainId?: number | undefined;
|
|
3318
|
+
yParity?: undefined | undefined;
|
|
3319
|
+
type: "legacy";
|
|
3320
|
+
gasPrice: bigint;
|
|
3321
|
+
maxFeePerBlobGas
|
|
3322
|
+
/** JSON-RPC endpoint. */
|
|
3323
|
+
? /** JSON-RPC endpoint. */: undefined | undefined;
|
|
3324
|
+
maxFeePerGas? /** Display name. Defaults to `EVM <id>`. */: undefined | undefined;
|
|
3325
|
+
maxPriorityFeePerGas?: undefined | undefined;
|
|
3326
|
+
isSystemTx?: undefined | undefined;
|
|
3327
|
+
mint?: undefined | undefined;
|
|
3328
|
+
sourceHash?: undefined | undefined;
|
|
3329
|
+
} | {
|
|
3330
|
+
blockHash: `0x${string}` | null;
|
|
3331
|
+
blockNumber: bigint | null;
|
|
3332
|
+
blockTimestamp?: bigint | undefined;
|
|
3333
|
+
from: abitype.Address;
|
|
3334
|
+
gas: bigint;
|
|
3335
|
+
hash: viem.Hash;
|
|
3336
|
+
input: viem.Hex;
|
|
3337
|
+
nonce: number;
|
|
3338
|
+
r: viem.Hex;
|
|
3339
|
+
s: viem.Hex;
|
|
3340
|
+
to: abitype.Address | null;
|
|
3341
|
+
transactionIndex: number | null;
|
|
3342
|
+
typeHex: viem.Hex | null;
|
|
3343
|
+
v: bigint;
|
|
3344
|
+
value: bigint;
|
|
3345
|
+
yParity: number;
|
|
3346
|
+
accessList: viem.AccessList;
|
|
3347
|
+
authorizationList?: undefined | undefined;
|
|
3348
|
+
blobVersionedHashes?: undefined | undefined;
|
|
3349
|
+
chainId: number;
|
|
3350
|
+
type: "eip2930";
|
|
3351
|
+
gasPrice: bigint;
|
|
3352
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
3353
|
+
maxFeePerGas?: undefined | undefined;
|
|
3354
|
+
maxPriorityFeePerGas?: undefined | undefined;
|
|
3355
|
+
isSystemTx?: undefined | undefined;
|
|
3356
|
+
mint?: undefined | undefined;
|
|
3357
|
+
sourceHash?: undefined | undefined;
|
|
3358
|
+
} | {
|
|
3359
|
+
blockHash: `0x${string}` | null;
|
|
3360
|
+
blockNumber: bigint | null;
|
|
3361
|
+
blockTimestamp?: bigint | undefined;
|
|
3362
|
+
from: abitype.Address;
|
|
3363
|
+
gas: bigint;
|
|
3364
|
+
hash: viem.Hash;
|
|
3365
|
+
input: viem.Hex;
|
|
3366
|
+
nonce: number;
|
|
3367
|
+
r: viem.Hex;
|
|
3368
|
+
s: viem.Hex;
|
|
3369
|
+
to: abitype.Address | null;
|
|
3370
|
+
transactionIndex: number | null;
|
|
3371
|
+
typeHex: viem.Hex | null;
|
|
3372
|
+
v: bigint;
|
|
3373
|
+
value: bigint;
|
|
3374
|
+
yParity: number;
|
|
3375
|
+
accessList: viem.AccessList;
|
|
3376
|
+
authorizationList?: undefined | undefined;
|
|
3377
|
+
blobVersionedHashes?: undefined | undefined;
|
|
3378
|
+
chainId: number;
|
|
3379
|
+
type: "eip1559";
|
|
3380
|
+
gasPrice?: undefined | undefined;
|
|
3381
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
3382
|
+
maxFeePerGas: bigint;
|
|
3383
|
+
maxPriorityFeePerGas: bigint;
|
|
3384
|
+
isSystemTx?: undefined | undefined;
|
|
3385
|
+
mint?: undefined | undefined;
|
|
3386
|
+
sourceHash?: undefined | undefined;
|
|
3387
|
+
} | {
|
|
3388
|
+
blockHash: `0x${string}` | null;
|
|
3389
|
+
blockNumber: bigint | null;
|
|
3390
|
+
blockTimestamp?: bigint | undefined;
|
|
3391
|
+
from: abitype.Address;
|
|
3392
|
+
gas: bigint;
|
|
3393
|
+
hash: viem.Hash;
|
|
3394
|
+
input: viem.Hex;
|
|
3395
|
+
nonce: number;
|
|
3396
|
+
r: viem.Hex;
|
|
3397
|
+
s: viem.Hex;
|
|
3398
|
+
to: abitype.Address | null;
|
|
3399
|
+
transactionIndex: number | null;
|
|
3400
|
+
typeHex: viem.Hex | null;
|
|
3401
|
+
v: bigint;
|
|
3402
|
+
value: bigint;
|
|
3403
|
+
yParity: number;
|
|
3404
|
+
accessList: viem.AccessList;
|
|
3405
|
+
authorizationList?: undefined | undefined;
|
|
3406
|
+
blobVersionedHashes: readonly viem.Hex[];
|
|
3407
|
+
chainId: number;
|
|
3408
|
+
type: "eip4844";
|
|
3409
|
+
gasPrice?: undefined | undefined;
|
|
3410
|
+
maxFeePerBlobGas: bigint;
|
|
3411
|
+
maxFeePerGas: bigint;
|
|
3412
|
+
maxPriorityFeePerGas: bigint;
|
|
3413
|
+
isSystemTx?: undefined | undefined;
|
|
3414
|
+
mint?: undefined | undefined;
|
|
3415
|
+
sourceHash?: undefined | undefined;
|
|
3416
|
+
} | {
|
|
3417
|
+
blockHash: `0x${string}` | null;
|
|
3418
|
+
blockNumber: bigint | null;
|
|
3419
|
+
blockTimestamp?: bigint | undefined;
|
|
3420
|
+
from: abitype.Address;
|
|
3421
|
+
gas: bigint;
|
|
3422
|
+
hash: viem.Hash;
|
|
3423
|
+
input: viem.Hex;
|
|
3424
|
+
nonce: number;
|
|
3425
|
+
r: viem.Hex;
|
|
3426
|
+
s: viem.Hex;
|
|
3427
|
+
to: abitype.Address | null;
|
|
3428
|
+
transactionIndex: number | null;
|
|
3429
|
+
typeHex: viem.Hex | null;
|
|
3430
|
+
v: bigint;
|
|
3431
|
+
value: bigint;
|
|
3432
|
+
yParity: number;
|
|
3433
|
+
accessList: viem.AccessList;
|
|
3434
|
+
authorizationList: viem.SignedAuthorizationList;
|
|
3435
|
+
blobVersionedHashes?: undefined | undefined;
|
|
3436
|
+
chainId: number;
|
|
3437
|
+
type: "eip7702";
|
|
3438
|
+
gasPrice?: undefined | undefined;
|
|
3439
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
3440
|
+
maxFeePerGas: bigint;
|
|
3441
|
+
maxPriorityFeePerGas: bigint;
|
|
3442
|
+
isSystemTx?: undefined | undefined;
|
|
3443
|
+
mint?: undefined | undefined;
|
|
3444
|
+
sourceHash?: undefined | undefined;
|
|
3445
|
+
}) & {};
|
|
3446
|
+
type: "transaction";
|
|
3447
|
+
};
|
|
3448
|
+
readonly transactionReceipt: {
|
|
3449
|
+
exclude: [] | undefined;
|
|
3450
|
+
format: (args: viem_chains.OpStackRpcTransactionReceipt, action?: string | undefined) => {
|
|
3451
|
+
blobGasPrice?: bigint | undefined;
|
|
3452
|
+
blobGasUsed?: bigint | undefined;
|
|
3453
|
+
blockHash: viem.Hash;
|
|
3454
|
+
blockNumber: bigint;
|
|
3455
|
+
blockTimestamp?: bigint | undefined;
|
|
3456
|
+
contractAddress: abitype.Address | null | undefined;
|
|
3457
|
+
cumulativeGasUsed: bigint;
|
|
3458
|
+
effectiveGasPrice: bigint;
|
|
3459
|
+
from: abitype.Address;
|
|
3460
|
+
gasUsed: bigint;
|
|
3461
|
+
logs: viem.Log<bigint, number, false>[];
|
|
3462
|
+
logsBloom: viem.Hex;
|
|
3463
|
+
root?: `0x${string}` | undefined;
|
|
3464
|
+
status: "success" | "reverted";
|
|
3465
|
+
to: abitype.Address | null;
|
|
3466
|
+
transactionHash: viem.Hash;
|
|
3467
|
+
transactionIndex: number;
|
|
3468
|
+
type: viem.TransactionType;
|
|
3469
|
+
l1GasPrice: bigint | null;
|
|
3470
|
+
l1GasUsed: bigint | null;
|
|
3471
|
+
l1Fee: bigint | null;
|
|
3472
|
+
l1FeeScalar: number | null;
|
|
3473
|
+
} & {};
|
|
3474
|
+
type: "transactionReceipt";
|
|
3475
|
+
};
|
|
3476
|
+
};
|
|
3477
|
+
prepareTransactionRequest?: ((args: viem.PrepareTransactionRequestParameters, options: {
|
|
3478
|
+
client: viem.Client;
|
|
3479
|
+
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
3480
|
+
}) => Promise<viem.PrepareTransactionRequestParameters>) | [fn: ((args: viem.PrepareTransactionRequestParameters, options: {
|
|
3481
|
+
client: viem.Client;
|
|
3482
|
+
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
3483
|
+
}) => Promise<viem.PrepareTransactionRequestParameters>) | undefined, options: {
|
|
3484
|
+
runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
|
|
3485
|
+
}] | undefined;
|
|
3486
|
+
serializers: {
|
|
3487
|
+
readonly transaction: typeof viem_chains.serializeTransactionOpStack;
|
|
3488
|
+
};
|
|
3489
|
+
verifyHash?: ((client: viem.Client, parameters: viem.VerifyHashActionParameters) => Promise<viem.VerifyHashActionReturnType>) | undefined;
|
|
3490
|
+
readonly network: "worldchain";
|
|
3491
|
+
};
|
|
3492
|
+
tokens: {
|
|
3493
|
+
USDC: {
|
|
3494
|
+
address: "0x79A02482A880bCE3F13e09Da970dC34db4CD24d1";
|
|
3495
|
+
decimals: number;
|
|
3496
|
+
symbol: string;
|
|
3497
|
+
};
|
|
3498
|
+
};
|
|
3499
|
+
};
|
|
3500
|
+
sei: {
|
|
3501
|
+
chain: {
|
|
3502
|
+
blockExplorers: {
|
|
3503
|
+
readonly default: {
|
|
3504
|
+
readonly name: "Seiscan";
|
|
3505
|
+
readonly url: "https://seiscan.io";
|
|
3506
|
+
readonly apiUrl: "https://api.etherscan.io/v2/api";
|
|
3507
|
+
};
|
|
3508
|
+
};
|
|
3509
|
+
blockTime?: number | undefined | undefined;
|
|
3510
|
+
contracts: {
|
|
3511
|
+
readonly multicall3: {
|
|
3512
|
+
readonly address: "0xcA11bde05977b3631167028862bE2a173976CA11";
|
|
3513
|
+
};
|
|
3514
|
+
};
|
|
3515
|
+
ensTlds?: readonly string[] | undefined;
|
|
3516
|
+
id: 1329;
|
|
3517
|
+
name: "Sei Network";
|
|
3518
|
+
nativeCurrency: {
|
|
3519
|
+
readonly name: "Sei";
|
|
3520
|
+
readonly symbol: "SEI";
|
|
3521
|
+
readonly decimals: 18;
|
|
3522
|
+
};
|
|
3523
|
+
experimental_preconfirmationTime?: number | undefined | undefined;
|
|
3524
|
+
rpcUrls: {
|
|
3525
|
+
readonly default: {
|
|
3526
|
+
readonly http: readonly ["https://evm-rpc.sei-apis.com/"];
|
|
3527
|
+
readonly webSocket: readonly ["wss://evm-ws.sei-apis.com/"];
|
|
3528
|
+
};
|
|
3529
|
+
};
|
|
3530
|
+
sourceId?: number | undefined | undefined;
|
|
3531
|
+
testnet?: boolean | undefined | undefined;
|
|
3532
|
+
custom?: Record<string, unknown> | undefined;
|
|
3533
|
+
extendSchema?: Record<string, unknown> | undefined;
|
|
3534
|
+
fees?: viem.ChainFees<undefined> | undefined;
|
|
3535
|
+
formatters?: undefined;
|
|
3536
|
+
prepareTransactionRequest?: ((args: viem.PrepareTransactionRequestParameters, options: {
|
|
3537
|
+
client: viem.Client;
|
|
3538
|
+
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
3539
|
+
}) => Promise<viem.PrepareTransactionRequestParameters>) | [fn: ((args: viem.PrepareTransactionRequestParameters, options: {
|
|
3540
|
+
client: viem.Client;
|
|
3541
|
+
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
3542
|
+
}) => Promise<viem.PrepareTransactionRequestParameters>) | undefined, options: {
|
|
3543
|
+
runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
|
|
3544
|
+
}] | undefined;
|
|
3545
|
+
serializers?: viem.ChainSerializers<undefined, viem.TransactionSerializable> | undefined;
|
|
3546
|
+
verifyHash?: ((client: viem.Client, parameters: viem.VerifyHashActionParameters) => Promise<viem.VerifyHashActionReturnType>) | undefined;
|
|
3547
|
+
};
|
|
3548
|
+
tokens: {
|
|
3549
|
+
USDC: {
|
|
3550
|
+
address: "0xe15fC38F6D8c56aF07bbCBe3BAf5708A2Bf42392";
|
|
3551
|
+
decimals: number;
|
|
3552
|
+
symbol: string;
|
|
3553
|
+
};
|
|
3554
|
+
};
|
|
3555
|
+
};
|
|
3556
|
+
injective: {
|
|
3557
|
+
chain: {
|
|
3558
|
+
blockExplorers: {
|
|
3559
|
+
readonly default: {
|
|
3560
|
+
readonly name: "Injective Explorer";
|
|
3561
|
+
readonly url: "https://blockscout.injective.network";
|
|
3562
|
+
readonly apiUrl: "https://blockscout.injective.network/api";
|
|
3563
|
+
};
|
|
3564
|
+
};
|
|
3565
|
+
blockTime?: number | undefined | undefined;
|
|
3566
|
+
contracts?: {
|
|
3567
|
+
[x: string]: viem.ChainContract | {
|
|
3568
|
+
[sourceId: number]: viem.ChainContract | undefined;
|
|
3569
|
+
} | undefined;
|
|
3570
|
+
ensRegistry?: viem.ChainContract | undefined;
|
|
3571
|
+
ensUniversalResolver?: viem.ChainContract | undefined;
|
|
3572
|
+
multicall3?: viem.ChainContract | undefined;
|
|
3573
|
+
erc6492Verifier?: viem.ChainContract | undefined;
|
|
3574
|
+
} | undefined;
|
|
3575
|
+
ensTlds?: readonly string[] | undefined;
|
|
3576
|
+
id: 1776;
|
|
3577
|
+
name: "Injective";
|
|
3578
|
+
nativeCurrency: {
|
|
3579
|
+
readonly decimals: 18;
|
|
3580
|
+
readonly name: "Injective";
|
|
3581
|
+
readonly symbol: "INJ";
|
|
3582
|
+
};
|
|
3583
|
+
experimental_preconfirmationTime?: number | undefined | undefined;
|
|
3584
|
+
rpcUrls: {
|
|
3585
|
+
readonly default: {
|
|
3586
|
+
readonly http: readonly ["https://sentry.evm-rpc.injective.network"];
|
|
3587
|
+
readonly webSocket: readonly ["wss://sentry.evm-ws.injective.network"];
|
|
3588
|
+
};
|
|
3589
|
+
};
|
|
3590
|
+
sourceId?: number | undefined | undefined;
|
|
3591
|
+
testnet: false;
|
|
3592
|
+
custom?: Record<string, unknown> | undefined;
|
|
3593
|
+
extendSchema?: Record<string, unknown> | undefined;
|
|
3594
|
+
fees?: viem.ChainFees<undefined> | undefined;
|
|
3595
|
+
formatters?: undefined;
|
|
3596
|
+
prepareTransactionRequest?: ((args: viem.PrepareTransactionRequestParameters, options: {
|
|
3597
|
+
client: viem.Client;
|
|
3598
|
+
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
3599
|
+
}) => Promise<viem.PrepareTransactionRequestParameters>) | [fn: ((args: viem.PrepareTransactionRequestParameters, options: {
|
|
3600
|
+
client: viem.Client;
|
|
3601
|
+
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
3602
|
+
}) => Promise<viem.PrepareTransactionRequestParameters>) | undefined, options: {
|
|
3603
|
+
runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
|
|
3604
|
+
}] | undefined;
|
|
3605
|
+
serializers?: viem.ChainSerializers<undefined, viem.TransactionSerializable> | undefined;
|
|
3606
|
+
verifyHash?: ((client: viem.Client, parameters: viem.VerifyHashActionParameters) => Promise<viem.VerifyHashActionReturnType>) | undefined;
|
|
3607
|
+
};
|
|
3608
|
+
tokens: {
|
|
3609
|
+
USDC: {
|
|
3610
|
+
address: "0xa00C59fF5a080D2b954d0c75e46E22a0c371235a";
|
|
3611
|
+
decimals: number;
|
|
3612
|
+
symbol: string;
|
|
3613
|
+
};
|
|
3614
|
+
USDT: {
|
|
3615
|
+
address: "0x88f7F2b685F9692caf8c478f5BADF09eE9B1Cc13";
|
|
3616
|
+
decimals: number;
|
|
3617
|
+
symbol: string;
|
|
3618
|
+
};
|
|
3619
|
+
};
|
|
3620
|
+
};
|
|
3621
|
+
};
|
|
3622
|
+
/** A built-in EVM chain name. */
|
|
3623
|
+
type ChainName = keyof typeof CHAINS;
|
|
3624
|
+
type ChainInput = ChainName | Chain | {
|
|
3625
|
+
/** EVM chain id, e.g. 5000 for Mantle. */
|
|
3626
|
+
id: number;
|
|
3627
|
+
/** JSON-RPC endpoint. */
|
|
3628
|
+
rpcUrl: string;
|
|
3629
|
+
/** Display name. Defaults to `EVM <id>`. */
|
|
3630
|
+
name?: string;
|
|
3631
|
+
/** Native coin metadata. Defaults to 18-decimal ETH. */
|
|
3632
|
+
nativeCurrency?: {
|
|
3633
|
+
name: string;
|
|
3634
|
+
symbol: string;
|
|
3635
|
+
decimals: number;
|
|
3636
|
+
};
|
|
3637
|
+
};
|
|
3638
|
+
interface ResolvedChain {
|
|
3639
|
+
chain: Chain;
|
|
3640
|
+
chainId: number;
|
|
3641
|
+
rpcUrl: string;
|
|
3642
|
+
/** Known tokens on this chain (empty for unknown custom chains). */
|
|
3643
|
+
tokens: Record<string, TokenInfo>;
|
|
3644
|
+
}
|
|
3645
|
+
/**
|
|
3646
|
+
* Normalise a `ChainInput` (+ optional rpc override) into the
|
|
3647
|
+
* `{ chain, chainId, rpcUrl, tokens }` the wallet and verifier need.
|
|
3648
|
+
*/
|
|
3649
|
+
declare function resolveChain(input: ChainInput, rpcUrlOverride?: string): ResolvedChain;
|
|
3650
|
+
|
|
3651
|
+
/**
|
|
3652
|
+
* The PaymentDriver contract. Every chain-family section (EVM, Solana, …)
|
|
3653
|
+
* implements this and nothing else; the protocol layer (server/client/x402)
|
|
3654
|
+
* depends on THIS file only — zero `viem`, zero `@solana/web3.js`.
|
|
3655
|
+
*
|
|
3656
|
+
* Convention used throughout the driver layer:
|
|
3657
|
+
* `chain` = the developer-supplied selector ('base', { id, rpcUrl }, …)
|
|
3658
|
+
* `network` = the resolved CAIP-2 id it maps to ('eip155:8453', 'solana:…')
|
|
3659
|
+
*
|
|
3660
|
+
* Identifiers cross this boundary as plain strings (CAIP-2 networks, base-unit
|
|
3661
|
+
* amounts, `0x…`/base58 addresses). `_native` on a WalletHandle is the single
|
|
3662
|
+
* intentional `unknown`: each driver stashes its own wallet object there.
|
|
3663
|
+
*/
|
|
3664
|
+
|
|
3665
|
+
/** The chain families the SDK knows about. */
|
|
3666
|
+
type ChainFamily = 'evm' | 'solana' | 'ton' | 'stellar' | 'xrpl' | 'tron' | 'sui' | 'near';
|
|
3667
|
+
/** What chain to use: an EVM name/Chain/{id,rpcUrl}, or a non-EVM family name. */
|
|
3668
|
+
type ChainSelector = ChainInput | 'solana' | 'ton' | 'stellar' | 'xrpl' | 'tron' | 'sui' | 'near';
|
|
3669
|
+
/** An EVM ERC-20 token, by contract address. */
|
|
3670
|
+
interface EvmToken {
|
|
3671
|
+
address: `0x${string}`;
|
|
3672
|
+
decimals: number;
|
|
3673
|
+
symbol?: string;
|
|
3674
|
+
}
|
|
3675
|
+
/** A Solana SPL token, by mint. */
|
|
3676
|
+
interface SolanaToken {
|
|
3677
|
+
mint: string;
|
|
3678
|
+
decimals: number;
|
|
3679
|
+
symbol?: string;
|
|
3680
|
+
}
|
|
3681
|
+
/** A TON jetton, by master address. */
|
|
3682
|
+
interface TonToken {
|
|
3683
|
+
master: string;
|
|
3684
|
+
decimals: number;
|
|
3685
|
+
symbol?: string;
|
|
3686
|
+
}
|
|
3687
|
+
/** A Stellar classic asset, by issuer + code. */
|
|
3688
|
+
interface StellarToken {
|
|
3689
|
+
issuer: string;
|
|
3690
|
+
code: string;
|
|
3691
|
+
decimals: number;
|
|
3692
|
+
symbol?: string;
|
|
3693
|
+
}
|
|
3694
|
+
/** An XRP Ledger issued currency, by issuer + 160-bit currency code (hex). */
|
|
3695
|
+
interface XrplToken {
|
|
3696
|
+
issuer: string;
|
|
3697
|
+
/** The currency: a 3-char ASCII code, or the 40-char 160-bit hex for 4+ chars. */
|
|
3698
|
+
currencyHex: string;
|
|
3699
|
+
decimals: number;
|
|
3700
|
+
symbol?: string;
|
|
3701
|
+
}
|
|
3702
|
+
/** A Tron TRC-20 token, by contract address (Base58 T…). */
|
|
3703
|
+
interface TronToken {
|
|
3704
|
+
address: string;
|
|
3705
|
+
decimals: number;
|
|
3706
|
+
symbol?: string;
|
|
3707
|
+
}
|
|
3708
|
+
/** A Sui coin, by its fully-qualified coin type (`package::module::TYPE`). */
|
|
3709
|
+
interface SuiToken {
|
|
3710
|
+
coinType: string;
|
|
3711
|
+
decimals: number;
|
|
3712
|
+
symbol?: string;
|
|
3713
|
+
}
|
|
3714
|
+
/** A NEAR NEP-141 token, by its contract account id. */
|
|
3715
|
+
interface NearToken {
|
|
3716
|
+
contractId: string;
|
|
3717
|
+
decimals: number;
|
|
3718
|
+
symbol?: string;
|
|
3719
|
+
}
|
|
3720
|
+
/**
|
|
3721
|
+
* What to be paid in. Each driver validates the forms it accepts:
|
|
3722
|
+
* - 'native' the chain's native coin (ETH, BNB, SOL, TON, XLM, XRP)
|
|
3723
|
+
* - 'USDC' (string) a symbol resolved against the chosen chain
|
|
3724
|
+
* - EvmToken any ERC-20 (EVM chains)
|
|
3725
|
+
* - SolanaToken any SPL token (Solana)
|
|
3726
|
+
* - TonToken any jetton (TON)
|
|
3727
|
+
* - StellarToken any classic asset (Stellar)
|
|
3728
|
+
* - XrplToken any issued currency (XRPL)
|
|
3729
|
+
* - TronToken any TRC-20 (Tron)
|
|
3730
|
+
* - SuiToken any coin (Sui)
|
|
3731
|
+
* - NearToken any NEP-141 (NEAR)
|
|
3732
|
+
*/
|
|
3733
|
+
type TokenInput = 'native' | (string & {}) | EvmToken | SolanaToken | TonToken | StellarToken | XrplToken | TronToken | SuiToken | NearToken;
|
|
3734
|
+
/** What a driver resolves a TokenInput into. `asset`: 0x | base58 mint | 'native'. */
|
|
3735
|
+
interface ResolvedToken {
|
|
3736
|
+
asset: string;
|
|
3737
|
+
decimals: number;
|
|
3738
|
+
symbol?: string;
|
|
3739
|
+
}
|
|
3740
|
+
/**
|
|
3741
|
+
* A best-effort estimate of the on-chain NETWORK FEE (gas) a payment will cost
|
|
3742
|
+
* the payer — denominated in the chain's NATIVE coin, which is distinct from the
|
|
3743
|
+
* payment token (you pay in USDC but burn ETH / SOL / TRX / … for gas). Lets an
|
|
3744
|
+
* agent learn the gas cost BEFORE it pays, so it can keep enough native coin on
|
|
3745
|
+
* hand. Built uniformly by the shared `nativeCost()` helper, so every family's
|
|
3746
|
+
* shape is identical. Converting to fiat needs the caller's own price source —
|
|
3747
|
+
* PipRail stays backendless and never calls an oracle.
|
|
3748
|
+
*/
|
|
3749
|
+
interface CostEstimate {
|
|
3750
|
+
/** The native fee coin's ticker — ETH, BNB, SOL, TON, XLM, XRP, TRX, … */
|
|
3751
|
+
feeSymbol: string;
|
|
3752
|
+
/** The native coin's decimals (18 EVM, 9 Solana/TON, 7 Stellar, 6 XRPL/Tron). */
|
|
3753
|
+
feeDecimals: number;
|
|
3754
|
+
/** Estimated fee in the native coin's base units (a non-negative integer string). */
|
|
3755
|
+
fee: string;
|
|
3756
|
+
/** Human-readable fee, e.g. '0.000021'. */
|
|
3757
|
+
feeFormatted: string;
|
|
3758
|
+
/** 'estimated' = derived from a live RPC read; 'heuristic' = a typical-cost constant. */
|
|
3759
|
+
basis: 'estimated' | 'heuristic';
|
|
3760
|
+
/** Short human note on what's included (e.g. 'gas ~21000 @ 12 gwei'). */
|
|
3761
|
+
detail?: string;
|
|
3762
|
+
}
|
|
3763
|
+
/** Opaque per-driver wallet handle — `_native` holds the driver's own object. */
|
|
3764
|
+
interface WalletHandle {
|
|
3765
|
+
readonly _native: unknown;
|
|
3766
|
+
}
|
|
3767
|
+
interface ConfirmInfo {
|
|
3768
|
+
/** Block number (EVM) or slot (Solana) as a string — numeric-agnostic. */
|
|
3769
|
+
height: string;
|
|
3770
|
+
}
|
|
3771
|
+
/**
|
|
3772
|
+
* A driver bound to one concrete network — what the gate and client hold. Each
|
|
3773
|
+
* method's error behaviour is fixed by the SDK error standard (see ERRORS.md §5):
|
|
3774
|
+
* `resolveToken`/`assertValidPayTo`/`bindWallet` throw `WrongFamilyError` /
|
|
3775
|
+
* `UnknownTokenError`; `send` maps affordability to `InsufficientFundsError`;
|
|
3776
|
+
* `verify` RETURNS a `VerifyResult` (and never throws for an RPC hiccup —
|
|
3777
|
+
* transient reads become `tx_not_found`); `confirm` throws `ConfirmationTimeoutError`.
|
|
3778
|
+
*/
|
|
3779
|
+
interface ResolvedNetwork {
|
|
3780
|
+
readonly family: ChainFamily;
|
|
3781
|
+
/** The resolved CAIP-2 id: 'eip155:8453' | 'solana:<genesis>' | … */
|
|
3782
|
+
readonly network: Caip2;
|
|
3783
|
+
/** Does this bound network handle the given CAIP-2 network string? */
|
|
3784
|
+
supports(network: string): boolean;
|
|
3785
|
+
/** Turn a TokenInput into { asset, decimals, symbol } for this network. */
|
|
3786
|
+
resolveToken(token: TokenInput): ResolvedToken;
|
|
3787
|
+
/**
|
|
3788
|
+
* Trusted metadata for a resolved on-chain `asset` id on THIS network — the
|
|
3789
|
+
* SDK's OWN decimals/symbol for a built-in token or the native coin, or `null`
|
|
3790
|
+
* if the SDK doesn't recognise the asset (a custom token it can't safely
|
|
3791
|
+
* price). Pure/synchronous — a built-in-map + native lookup, never an RPC call.
|
|
3792
|
+
*
|
|
3793
|
+
* The client uses it to enforce a spend budget against the token's TRUE
|
|
3794
|
+
* decimals (so a server can't understate a price by lying about
|
|
3795
|
+
* `extra.decimals`) and to flag when a challenge's stated symbol disagrees
|
|
3796
|
+
* with the real one. The inverse of `resolveToken` for known assets.
|
|
3797
|
+
*/
|
|
3798
|
+
describeAsset(asset: string): {
|
|
3799
|
+
symbol?: string;
|
|
3800
|
+
decimals: number;
|
|
3801
|
+
} | null;
|
|
3802
|
+
/** Throw if `payTo` isn't a valid address for this family. */
|
|
3803
|
+
assertValidPayTo(payTo: string): void;
|
|
3804
|
+
/** Validate + wrap the user's wallet config for this family. */
|
|
3805
|
+
bindWallet(wallet: unknown): WalletHandle;
|
|
3806
|
+
/** Broadcast payment for `accept`; return the proof ref (tx hash / signature). */
|
|
3807
|
+
send(wallet: WalletHandle, accept: X402AcceptEntry): Promise<string>;
|
|
3808
|
+
/** Wait until `ref` reaches minConfirmations (or finality). */
|
|
3809
|
+
confirm(ref: string, minConfirmations: number): Promise<ConfirmInfo>;
|
|
3810
|
+
/**
|
|
3811
|
+
* Best-effort estimate of the network fee (gas) to settle `accept`, in the
|
|
3812
|
+
* chain's NATIVE coin (see {@link CostEstimate}). Async (may read RPC) but
|
|
3813
|
+
* never throws for a transient RPC issue — it falls back to a 'heuristic'
|
|
3814
|
+
* constant. `opts.from` (the payer's address) sharpens chains whose fee
|
|
3815
|
+
* depends on the sender (notably Tron energy); omit it for a typical estimate.
|
|
3816
|
+
* Payer-side + informational — the gate never calls this.
|
|
3817
|
+
*/
|
|
3818
|
+
estimateCost(accept: X402AcceptEntry, opts?: {
|
|
3819
|
+
from?: string;
|
|
3820
|
+
}): Promise<CostEstimate>;
|
|
3821
|
+
/** Verify `ref` satisfies `accept`, RPC-only, in-process. */
|
|
3822
|
+
verify(ref: string, accept: X402AcceptEntry): Promise<VerifyResult>;
|
|
3823
|
+
}
|
|
3824
|
+
interface ResolveOptions {
|
|
3825
|
+
/** The developer-supplied `chain` selector. */
|
|
3826
|
+
chain: unknown;
|
|
3827
|
+
rpcUrl?: string;
|
|
3828
|
+
}
|
|
3829
|
+
/** A stateless family driver. The registry calls resolve() to bind a network. */
|
|
3830
|
+
interface PaymentDriver {
|
|
3831
|
+
readonly family: ChainFamily;
|
|
3832
|
+
/** Recognise + bind the chain input, or return null to let another try. */
|
|
3833
|
+
resolve(opts: ResolveOptions): ResolvedNetwork | null;
|
|
3834
|
+
}
|
|
3835
|
+
|
|
3836
|
+
interface PaymentPolicy {
|
|
3837
|
+
/** Per-payment ceiling, human-readable (e.g. '0.10'). Compared using the
|
|
3838
|
+
* token's TRUE decimals, so a server can't understate the price. */
|
|
3839
|
+
maxAmount?: string;
|
|
3840
|
+
/** Lifetime ceiling for this client, PER DISTINCT ASSET (network+asset).
|
|
3841
|
+
* Summing across different tokens is unit-meaningless without a price
|
|
3842
|
+
* oracle (which the SDK deliberately doesn't add), so each token gets its
|
|
3843
|
+
* own running cap. Pair with `tokens: ['USDC']` for a single-currency budget. */
|
|
3844
|
+
maxTotal?: string;
|
|
3845
|
+
/** Allowlist of chains the agent may pay on. A 402 on any other chain is
|
|
3846
|
+
* declined. Strings match the configured selector; objects match by id. */
|
|
3847
|
+
chains?: ChainSelector[];
|
|
3848
|
+
/** Allowlist of token symbols (matched against the TRUE symbol). An asset the
|
|
3849
|
+
* SDK can't recognise never satisfies this list. */
|
|
3850
|
+
tokens?: string[];
|
|
3851
|
+
/** Allowlist of hosts. Exact (`api.example.com`) or wildcard (`*.example.com`). */
|
|
3852
|
+
hosts?: string[];
|
|
3853
|
+
/** Pay an asset the SDK can't price (custom/unknown token)? Default false —
|
|
3854
|
+
* declined, because its true decimals can't be verified. When true, the
|
|
3855
|
+
* server-stated decimals are trusted (the explicit, opt-in risk). */
|
|
3856
|
+
allowUnknownTokens?: boolean;
|
|
3857
|
+
}
|
|
3858
|
+
/** What the policy reasons over — built by the client from the chosen accept. */
|
|
3859
|
+
interface PaymentIntent {
|
|
3860
|
+
/** Host of the gated URL (for the `hosts` allowlist). */
|
|
3861
|
+
host: string;
|
|
3862
|
+
/** The selector the client is configured with (for the `chains` allowlist). */
|
|
3863
|
+
chain: ChainSelector;
|
|
3864
|
+
network: Caip2;
|
|
3865
|
+
asset: string;
|
|
3866
|
+
/** Server-stated base units — what actually transfers on-chain. */
|
|
3867
|
+
amountBase: bigint;
|
|
3868
|
+
/** TRUE decimals if the asset is recognised, else the server-stated value. */
|
|
3869
|
+
decimals: number;
|
|
3870
|
+
/** TRUE symbol if recognised, else the server-stated value (may be undefined). */
|
|
3871
|
+
symbol?: string;
|
|
3872
|
+
/** Did the driver's `describeAsset` recognise this asset? */
|
|
3873
|
+
recognized: boolean;
|
|
3874
|
+
}
|
|
3875
|
+
interface PolicyDecision {
|
|
3876
|
+
allowed: boolean;
|
|
3877
|
+
/** Why it was refused (only when `allowed === false`). */
|
|
3878
|
+
reason?: string;
|
|
3879
|
+
}
|
|
3880
|
+
/**
|
|
3881
|
+
* Evaluate a payment against the policy. `spentForAssetBase` is the running
|
|
3882
|
+
* total already spent on THIS (network, asset) — supplied by the client's
|
|
3883
|
+
* ledger — and powers the per-asset `maxTotal` cap.
|
|
3884
|
+
*
|
|
3885
|
+
* Checks run cheapest-first; the first failure wins so the reason is specific.
|
|
3886
|
+
*/
|
|
3887
|
+
declare function evaluatePolicy(intent: PaymentIntent, policy: PaymentPolicy | undefined, spentForAssetBase: bigint): PolicyDecision;
|
|
3888
|
+
|
|
3889
|
+
interface SpendRecord {
|
|
3890
|
+
url: string;
|
|
3891
|
+
host: string;
|
|
3892
|
+
network: Caip2;
|
|
3893
|
+
asset: string;
|
|
3894
|
+
/** Base units paid (already scaled by decimals). */
|
|
3895
|
+
amountBase: string;
|
|
3896
|
+
/** Human-readable amount, e.g. '0.05'. */
|
|
3897
|
+
amountFormatted: string;
|
|
3898
|
+
symbol?: string;
|
|
3899
|
+
/** Proof ref (EVM tx hash, Solana signature, TON locator, Stellar tx hash). */
|
|
3900
|
+
ref: string;
|
|
3901
|
+
/** ISO timestamp of settlement. */
|
|
3902
|
+
at: string;
|
|
3903
|
+
}
|
|
3904
|
+
interface SpendAssetTotal {
|
|
3905
|
+
network: Caip2;
|
|
3906
|
+
asset: string;
|
|
3907
|
+
symbol?: string;
|
|
3908
|
+
decimals: number;
|
|
3909
|
+
totalBase: string;
|
|
3910
|
+
totalFormatted: string;
|
|
3911
|
+
count: number;
|
|
3912
|
+
}
|
|
3913
|
+
interface SpendSummary {
|
|
3914
|
+
/** Total number of settled payments. */
|
|
3915
|
+
count: number;
|
|
3916
|
+
/** Cumulative spend per distinct (network, asset). */
|
|
3917
|
+
byAsset: SpendAssetTotal[];
|
|
3918
|
+
/** Every settled payment, in order. */
|
|
3919
|
+
records: SpendRecord[];
|
|
3920
|
+
}
|
|
3921
|
+
|
|
3922
|
+
/** Observability events. `ref` is the proof — a chain-specific id (EVM tx hash, Solana signature, TON locator, Stellar tx hash). */
|
|
3923
|
+
type PipRailEvent = {
|
|
3924
|
+
kind: 'payment-required';
|
|
3925
|
+
challenge: X402Challenge;
|
|
3926
|
+
accept: X402AcceptEntry;
|
|
3927
|
+
} | {
|
|
3928
|
+
kind: 'payment-broadcast';
|
|
3929
|
+
ref: string;
|
|
3930
|
+
} | {
|
|
3931
|
+
kind: 'payment-confirmed';
|
|
3932
|
+
ref: string;
|
|
3933
|
+
blockNumber: bigint;
|
|
3934
|
+
} | {
|
|
3935
|
+
kind: 'payment-settled';
|
|
3936
|
+
receipt: X402Receipt | null;
|
|
3937
|
+
} | {
|
|
3938
|
+
kind: 'payment-failed';
|
|
3939
|
+
reason: string;
|
|
3940
|
+
};
|
|
3941
|
+
/**
|
|
3942
|
+
* Wallet for the chosen chain family (the `chain` selector routes; each driver
|
|
3943
|
+
* validates its own key format):
|
|
3944
|
+
* - EVM → `{ privateKey }` (0x… hex) or a viem `{ walletClient }`
|
|
3945
|
+
* - Tron → `{ privateKey }` (32-byte hex — secp256k1, like EVM)
|
|
3946
|
+
* - Sui → `{ privateKey }` (suiprivkey1… bech32) or a ready `{ keypair }`
|
|
3947
|
+
* - Solana → `{ secretKey }` (Uint8Array | base58) or `{ signer }`
|
|
3948
|
+
* - TON → `{ mnemonic }` (24 words) or a ready `{ keyPair }`
|
|
3949
|
+
* - Stellar → `{ secret }` (S… seed) or a ready `{ keypair }`
|
|
3950
|
+
* - XRPL → `{ seed }` (s… seed) or a ready `{ wallet }`
|
|
3951
|
+
* - NEAR → `{ accountId, privateKey }` (privateKey = ed25519:… secret)
|
|
3952
|
+
*/
|
|
3953
|
+
type WalletInput = {
|
|
3954
|
+
privateKey: string;
|
|
3955
|
+
} | {
|
|
3956
|
+
walletClient: unknown;
|
|
3957
|
+
} | {
|
|
3958
|
+
secretKey: Uint8Array | string;
|
|
3959
|
+
} | {
|
|
3960
|
+
signer: unknown;
|
|
3961
|
+
} | {
|
|
3962
|
+
mnemonic: string | string[];
|
|
3963
|
+
version?: 'v4' | 'v5r1';
|
|
3964
|
+
} | {
|
|
3965
|
+
keyPair: unknown;
|
|
3966
|
+
version?: 'v4' | 'v5r1';
|
|
3967
|
+
} | {
|
|
3968
|
+
secret: string;
|
|
3969
|
+
} | {
|
|
3970
|
+
keypair: unknown;
|
|
3971
|
+
} | {
|
|
3972
|
+
seed: string;
|
|
3973
|
+
} | {
|
|
3974
|
+
wallet: unknown;
|
|
3975
|
+
} | {
|
|
3976
|
+
accountId: string;
|
|
3977
|
+
privateKey: string;
|
|
3978
|
+
};
|
|
3979
|
+
/**
|
|
3980
|
+
* A priced payment requirement — what `client.quote(url)` returns and what an
|
|
3981
|
+
* `onBeforePay` hook receives, so an agent can decide BEFORE any funds move.
|
|
3982
|
+
* `amount`/`decimals`/`symbol` reflect the TRUE token (the SDK's, via
|
|
3983
|
+
* `describeAsset`) when recognised, falling back to the server's stated values.
|
|
3984
|
+
*/
|
|
3985
|
+
interface PipRailQuote {
|
|
3986
|
+
/** The gated URL. */
|
|
3987
|
+
url: string;
|
|
3988
|
+
/** The chain the client is configured for. */
|
|
3989
|
+
chain: ChainSelector;
|
|
3990
|
+
network: Caip2;
|
|
3991
|
+
/** On-chain asset id (0x… / mint / jetton master / CODE:ISSUER / 'native'). */
|
|
3992
|
+
asset: string;
|
|
3993
|
+
/** Amount in base units (what actually transfers). */
|
|
3994
|
+
amount: string;
|
|
3995
|
+
/** Human-readable amount, e.g. '0.05'. */
|
|
3996
|
+
amountFormatted: string;
|
|
3997
|
+
decimals: number;
|
|
3998
|
+
symbol?: string;
|
|
3999
|
+
payTo: string;
|
|
4000
|
+
description?: string;
|
|
4001
|
+
maxTimeoutSeconds: number;
|
|
4002
|
+
/** Did the SDK recognise the asset (and so trust its decimals/symbol)? */
|
|
4003
|
+
recognized: boolean;
|
|
4004
|
+
/** True if the challenge's stated symbol disagrees with the SDK's real one — a
|
|
4005
|
+
* red flag worth surfacing to the agent. */
|
|
4006
|
+
symbolMismatch: boolean;
|
|
4007
|
+
/** Would the configured `policy` allow paying this? (true when no policy set.) */
|
|
4008
|
+
withinPolicy: boolean;
|
|
4009
|
+
/** Why the policy would refuse it (only when `withinPolicy === false`). */
|
|
4010
|
+
policyReason?: string;
|
|
4011
|
+
}
|
|
4012
|
+
/**
|
|
4013
|
+
* What `client.estimateCost(url)` returns: the priced payment requirement plus
|
|
4014
|
+
* the estimated NETWORK FEE (gas) to settle it, in the chain's native coin.
|
|
4015
|
+
* Two distinct numbers an agent weighs before paying — `quote.amountFormatted`
|
|
4016
|
+
* is what leaves the wallet as payment; `cost.feeFormatted` is the native-coin
|
|
4017
|
+
* gas burned to send it (you pay USDC but spend ETH/SOL/TRX/… on gas).
|
|
4018
|
+
*/
|
|
4019
|
+
interface PipRailCostQuote {
|
|
4020
|
+
/** The priced payment requirement (amount/token/chain/recipient/policy). */
|
|
4021
|
+
quote: PipRailQuote;
|
|
4022
|
+
/** Estimated network fee (gas) in the chain's native coin. */
|
|
4023
|
+
cost: CostEstimate;
|
|
4024
|
+
}
|
|
4025
|
+
interface PipRailClientOptions {
|
|
4026
|
+
/** Wallet for the chosen chain family. */
|
|
4027
|
+
wallet: WalletInput;
|
|
4028
|
+
/** Which chain to pay on. EVM ('bnb'|'base'|…), 'solana', 'ton', 'stellar',
|
|
4029
|
+
* 'xrpl', 'tron', 'sui', or 'near'. */
|
|
4030
|
+
chain: ChainSelector;
|
|
4031
|
+
/** Override the chain's default RPC URL (recommended in production). */
|
|
4032
|
+
rpcUrl?: string;
|
|
4033
|
+
/**
|
|
4034
|
+
* Spend guardrails for autonomous payment — per-payment + lifetime ceilings
|
|
4035
|
+
* and chain/token/host allowlists. A 402 that violates the policy is refused
|
|
4036
|
+
* with {@link PaymentDeclinedError} BEFORE any on-chain send. Omit for the
|
|
4037
|
+
* (unguarded) default. See {@link PaymentPolicy}.
|
|
4038
|
+
*/
|
|
4039
|
+
policy?: PaymentPolicy;
|
|
4040
|
+
/**
|
|
4041
|
+
* Final approval hook, called with the {@link PipRailQuote} after the policy
|
|
4042
|
+
* passes but before paying. Return `false` (or a rejected promise resolving
|
|
4043
|
+
* false) to refuse — the client throws {@link PaymentDeclinedError} and no
|
|
4044
|
+
* funds move. Use for human-in-the-loop or custom per-payment logic.
|
|
4045
|
+
*/
|
|
4046
|
+
onBeforePay?: (quote: PipRailQuote) => boolean | Promise<boolean>;
|
|
4047
|
+
/**
|
|
4048
|
+
* After paying, how many times to re-send the request with proof before
|
|
4049
|
+
* giving up. Default 3, with a short backoff between attempts — this
|
|
4050
|
+
* absorbs RPC propagation lag (the server's node briefly trailing the
|
|
4051
|
+
* client's, so it hasn't seen the confirmation yet). If the server still
|
|
4052
|
+
* returns 402 on the last attempt the SDK throws `MaxRetriesExceededError`.
|
|
4053
|
+
*/
|
|
4054
|
+
maxPaymentRetries?: number;
|
|
4055
|
+
/** Timeout (ms) for the retry leg after broadcast. Default 30_000. */
|
|
4056
|
+
retryTimeoutMs?: number;
|
|
4057
|
+
/** Logger hook. Default no-op. */
|
|
4058
|
+
onEvent?: (event: PipRailEvent) => void;
|
|
4059
|
+
}
|
|
4060
|
+
declare class PipRailClient {
|
|
4061
|
+
private readonly opts;
|
|
4062
|
+
private readonly maxRetries;
|
|
4063
|
+
private readonly retryTimeoutMs;
|
|
4064
|
+
private readonly onEvent;
|
|
4065
|
+
private readonly ledger;
|
|
4066
|
+
private bound?;
|
|
4067
|
+
constructor(opts: PipRailClientOptions);
|
|
4068
|
+
/** Emit an observability event, never letting a throwing handler break the
|
|
4069
|
+
* payment flow (mirrors the server gate's `onPaid` isolation). */
|
|
4070
|
+
private safeEmit;
|
|
4071
|
+
/** Auto-mount the chain's driver, resolve the network, and bind the wallet — once. */
|
|
4072
|
+
private ensure;
|
|
4073
|
+
/** GET that auto-handles 402. Pass a full URL to any x402-gated endpoint. */
|
|
4074
|
+
get(url: string, init?: RequestInit): Promise<Response>;
|
|
4075
|
+
/**
|
|
4076
|
+
* POST that auto-handles 402.
|
|
4077
|
+
*
|
|
4078
|
+
* `body` can be a string/FormData/URLSearchParams/ArrayBuffer/Blob (sent
|
|
4079
|
+
* as-is) or a plain object (serialised as JSON).
|
|
4080
|
+
*/
|
|
4081
|
+
post(url: string, body?: BodyInit | object | undefined, init?: RequestInit): Promise<Response>;
|
|
4082
|
+
/**
|
|
4083
|
+
* Price a gated URL WITHOUT paying. Does the initial request, and if it's a
|
|
4084
|
+
* 402, returns a {@link PipRailQuote} — the amount (in the token's TRUE
|
|
4085
|
+
* decimals), token, chain, recipient, and whether the configured `policy`
|
|
4086
|
+
* would allow it. Returns `null` when the URL isn't payment-gated (no 402).
|
|
4087
|
+
*
|
|
4088
|
+
* This is what lets an agent (or its planner) decide *before* spending —
|
|
4089
|
+
* "0.05 USDC on Base, within budget → pay it." No funds move.
|
|
4090
|
+
*/
|
|
4091
|
+
quote(url: string, init?: RequestInit): Promise<PipRailQuote | null>;
|
|
4092
|
+
/**
|
|
4093
|
+
* Estimate the network fee (gas) to pay a gated URL — WITHOUT paying. Returns
|
|
4094
|
+
* the {@link PipRailQuote} (what the payment is) plus a {@link CostEstimate}
|
|
4095
|
+
* (the gas it will burn, in the chain's NATIVE coin), so an agent can budget
|
|
4096
|
+
* the *total* — payment + gas — before any funds move. Returns `null` when the
|
|
4097
|
+
* URL isn't payment-gated (no 402).
|
|
4098
|
+
*
|
|
4099
|
+
* The estimate is best-effort and labelled (`cost.basis`): live-RPC ('estimated')
|
|
4100
|
+
* where cheap (EVM gas price, XRPL fee), a typical-cost constant ('heuristic')
|
|
4101
|
+
* otherwise. It never throws for a transient RPC issue. Gas is in the native
|
|
4102
|
+
* coin (ETH/SOL/TON/XLM/XRP/TRX), distinct from the payment token — most useful
|
|
4103
|
+
* on Tron, where a USD₮ transfer can cost real TRX.
|
|
4104
|
+
*/
|
|
4105
|
+
estimateCost(url: string, init?: RequestInit): Promise<PipRailCostQuote | null>;
|
|
4106
|
+
/** Aggregated snapshot of every payment this client has settled — total
|
|
4107
|
+
* count, cumulative spend per token, and the individual records. */
|
|
4108
|
+
spent(): SpendSummary;
|
|
4109
|
+
/**
|
|
4110
|
+
* Lower-level: drive any HTTP method through the 402 flow.
|
|
4111
|
+
*
|
|
4112
|
+
* `init.body` (if any) must be replayable — the SDK may send the request
|
|
4113
|
+
* twice (once to fetch the 402, once with the proof attached). One-shot
|
|
4114
|
+
* streams throw `NonReplayableBodyError`.
|
|
4115
|
+
*/
|
|
4116
|
+
fetch(url: string, init?: RequestInit): Promise<Response>;
|
|
4117
|
+
/**
|
|
4118
|
+
* From a confirmed-402 response: parse the challenge, mount + bind the
|
|
4119
|
+
* network, pick the accept the client can pay, and build its quote. Shared by
|
|
4120
|
+
* `quote()` (read-only) and `fetch()` (which then authorises + pays).
|
|
4121
|
+
*/
|
|
4122
|
+
private resolveChallenge;
|
|
4123
|
+
/** Build the agent-facing quote for an accept: TRUE decimals/symbol (via the
|
|
4124
|
+
* driver's describeAsset) + the policy verdict + a symbol-mismatch flag. */
|
|
4125
|
+
private buildQuote;
|
|
4126
|
+
/** Enforce the spend policy and the onBeforePay hook — both refuse by
|
|
4127
|
+
* throwing PaymentDeclinedError, before any funds move. */
|
|
4128
|
+
private authorize;
|
|
4129
|
+
/** Record a settled payment in the ledger (true decimals for the running total). */
|
|
4130
|
+
private recordSpend;
|
|
4131
|
+
private payAndConfirm;
|
|
4132
|
+
private retryWithProof;
|
|
4133
|
+
}
|
|
4134
|
+
|
|
4135
|
+
/** A framework-agnostic tool definition an agent runtime can register. */
|
|
4136
|
+
interface AgentTool {
|
|
4137
|
+
/** Unique tool name (snake_case, namespaced `piprail_…`). */
|
|
4138
|
+
name: string;
|
|
4139
|
+
/** What the tool does — written for an LLM to read. */
|
|
4140
|
+
description: string;
|
|
4141
|
+
/** JSON Schema (draft-07 object) describing the arguments. */
|
|
4142
|
+
parameters: Record<string, unknown>;
|
|
4143
|
+
/** Execute the tool. Returns a JSON-serialisable result. */
|
|
4144
|
+
invoke: (args: Record<string, unknown>) => Promise<unknown>;
|
|
4145
|
+
}
|
|
4146
|
+
/**
|
|
4147
|
+
* Two tools wrapping a configured {@link PipRailClient}:
|
|
4148
|
+
* - `piprail_quote_payment(url)` — price a gated URL WITHOUT paying.
|
|
4149
|
+
* - `piprail_pay_request(url, method?, body?)` — pay if needed and return the result.
|
|
4150
|
+
*
|
|
4151
|
+
* A policy/approval refusal comes back as a structured `{ declined: true, reason }`
|
|
4152
|
+
* (not a thrown error), so the model can reason about it instead of crashing.
|
|
4153
|
+
*/
|
|
4154
|
+
declare function paymentTools(client: PipRailClient): AgentTool[];
|
|
4155
|
+
|
|
4156
|
+
/**
|
|
4157
|
+
* The accept side: gate any endpoint behind a payment with one function.
|
|
4158
|
+
*
|
|
4159
|
+
* import { requirePayment } from '@piprail/sdk'
|
|
4160
|
+
*
|
|
4161
|
+
* app.get('/report',
|
|
4162
|
+
* requirePayment({ chain: 'base', amount: '0.05', payTo: '0xMerchant…' }),
|
|
4163
|
+
* (req, res) => res.json({ secret: 42 })
|
|
4164
|
+
* )
|
|
4165
|
+
*
|
|
4166
|
+
* One parameter picks the chain family: 'base'/'bnb'/… → EVM, 'solana' →
|
|
4167
|
+
* Solana, 'ton' → TON. Non-EVM drivers auto-mount on first use — no setup
|
|
4168
|
+
* call. The payment is verified against the chain's RPC, in-process — no
|
|
4169
|
+
* backend, no database.
|
|
4170
|
+
*
|
|
4171
|
+
* Replay protection is an in-memory used-tx set scoped to the gate —
|
|
4172
|
+
* single-process by design; pass your own `isUsed`/`markUsed` to share it.
|
|
4173
|
+
*/
|
|
4174
|
+
|
|
4175
|
+
/**
|
|
4176
|
+
* One payment option a gate offers. Pass several to `requirePayment({ accept:
|
|
4177
|
+
* [...] })` and the challenge offers them all in `accepts[]` — the agent pays on
|
|
4178
|
+
* whichever chain it holds funds for (USDC on Base OR Solana OR …). `payTo`/
|
|
4179
|
+
* `rpcUrl` fall back to the top-level option when omitted (per-family payTo is
|
|
4180
|
+
* usually given here, since address shapes differ across chains).
|
|
4181
|
+
*/
|
|
4182
|
+
interface AcceptOption {
|
|
4183
|
+
/** Which chain. EVM ('bnb'|'base'|…), 'solana', 'ton', 'stellar', 'xrpl',
|
|
4184
|
+
* 'tron', 'near', or 'sui'. */
|
|
4185
|
+
chain: ChainSelector;
|
|
4186
|
+
/** Token to be paid in (symbol / 'native' / custom descriptor). */
|
|
4187
|
+
token: TokenInput;
|
|
4188
|
+
/** Human-readable amount for THIS option, e.g. "0.05". */
|
|
4189
|
+
amount: string;
|
|
4190
|
+
/** Recipient for this chain (defaults to the top-level `payTo`). */
|
|
4191
|
+
payTo?: AddressId;
|
|
4192
|
+
/** RPC override for this chain (defaults to the top-level `rpcUrl`). */
|
|
4193
|
+
rpcUrl?: string;
|
|
4194
|
+
}
|
|
4195
|
+
interface RequirePaymentOptions {
|
|
4196
|
+
/**
|
|
4197
|
+
* Single-chain form: which chain to accept payment on. EVM ('bnb'|'base'|…),
|
|
4198
|
+
* 'solana', 'ton', 'stellar', 'xrpl', 'tron', 'near', or 'sui'. Provide
|
|
4199
|
+
* `chain` + `token` + `amount`, OR use the multi-chain `accept` array below.
|
|
4200
|
+
*/
|
|
4201
|
+
chain?: ChainSelector;
|
|
4202
|
+
/** Override the chain's default RPC URL (recommended in production). */
|
|
4203
|
+
rpcUrl?: string;
|
|
4204
|
+
/**
|
|
4205
|
+
* What to be paid in (single-chain form). Use a symbol the chain ships
|
|
4206
|
+
* (`'USDC'` / `'USDT'`), the chain's coin (`'native'`), or a custom token:
|
|
4207
|
+
* `{ address, decimals }` on EVM/Tron, `{ mint, decimals }` on Solana,
|
|
4208
|
+
* `{ master, decimals }` on TON, `{ issuer, code, decimals }` on Stellar,
|
|
4209
|
+
* `{ issuer, currencyHex, decimals }` on XRPL, `{ contractId, decimals }` on
|
|
4210
|
+
* NEAR, `{ coinType, decimals }` on Sui. You name the token; the SDK fills in
|
|
4211
|
+
* the contract + decimals for built-in symbols. (Note: native USDC doesn't
|
|
4212
|
+
* exist on TON/Tron — USDT does; NEAR is FT-only, so `'native'` is rejected.)
|
|
4213
|
+
*/
|
|
4214
|
+
token?: TokenInput;
|
|
4215
|
+
/** Human-readable amount, e.g. "0.05" (single-chain form). */
|
|
4216
|
+
amount?: string;
|
|
4217
|
+
/**
|
|
4218
|
+
* Multi-chain form: offer several payment options in ONE challenge. The agent
|
|
4219
|
+
* picks the chain/token it can pay. Mutually exclusive with the single-chain
|
|
4220
|
+
* `chain`/`token`/`amount` fields above; provide one form or the other.
|
|
4221
|
+
*/
|
|
4222
|
+
accept?: AcceptOption[];
|
|
4223
|
+
/** Address that receives the payment (0x… EVM/Sui, base58 Solana, EQ…/UQ… TON,
|
|
4224
|
+
* G… Stellar, r… XRPL, T… Tron, account id on NEAR). Required for the single
|
|
4225
|
+
* form; the per-option fallback for the multi form. */
|
|
4226
|
+
payTo?: AddressId;
|
|
4227
|
+
/** Shown to the agent in the challenge. */
|
|
4228
|
+
description?: string;
|
|
4229
|
+
/** Confirmations required before access is granted. Default 1. */
|
|
4230
|
+
minConfirmations?: number;
|
|
4231
|
+
/** Max age of an accepted payment, in seconds. Default 600. */
|
|
4232
|
+
maxTimeoutSeconds?: number;
|
|
4233
|
+
/** Nonce generator. Default `crypto.randomUUID()`. */
|
|
4234
|
+
generateNonce?: () => string;
|
|
4235
|
+
/** Replay hook — return true if this proof was already redeemed. */
|
|
4236
|
+
isUsed?: (ref: string) => boolean | Promise<boolean>;
|
|
4237
|
+
/** Replay hook — record a redeemed proof. */
|
|
4238
|
+
markUsed?: (ref: string) => void | Promise<void>;
|
|
4239
|
+
/** Fired when a payment verifies successfully. */
|
|
4240
|
+
onPaid?: (receipt: X402Receipt) => void;
|
|
4241
|
+
}
|
|
4242
|
+
type VerifyPaymentResult = {
|
|
4243
|
+
kind: 'paid';
|
|
4244
|
+
receipt: X402Receipt;
|
|
4245
|
+
receiptHeader: string;
|
|
4246
|
+
} | {
|
|
4247
|
+
kind: 'challenge';
|
|
4248
|
+
challenge: X402Challenge;
|
|
4249
|
+
requiredHeader: string;
|
|
4250
|
+
statusCode: 402;
|
|
4251
|
+
} | {
|
|
4252
|
+
kind: 'invalid';
|
|
4253
|
+
error: string;
|
|
4254
|
+
detail: string;
|
|
4255
|
+
statusCode: 402;
|
|
4256
|
+
};
|
|
4257
|
+
/** The canonical x402 v2 JSON body for a rejected proof (a 402 'invalid'). */
|
|
4258
|
+
interface X402InvalidBody {
|
|
4259
|
+
x402Version: 2;
|
|
4260
|
+
status: 'invalid';
|
|
4261
|
+
error: string;
|
|
4262
|
+
detail: string;
|
|
4263
|
+
}
|
|
4264
|
+
/**
|
|
4265
|
+
* Build the canonical 402 'invalid' body. Use this in EVERY framework adapter
|
|
4266
|
+
* (Express, Hono, Fastify, Workers, …) so a rejected proof returns the IDENTICAL
|
|
4267
|
+
* envelope everywhere — `verify()` produces the reason, this shapes the body.
|
|
4268
|
+
*/
|
|
4269
|
+
declare function toInvalidBody(result: {
|
|
4270
|
+
error: string;
|
|
4271
|
+
detail: string;
|
|
4272
|
+
}): X402InvalidBody;
|
|
4273
|
+
interface PaymentGate {
|
|
4274
|
+
/** Build a fresh 402 challenge (new nonce) for a resource URL. */
|
|
4275
|
+
challenge(resourceUrl?: string): Promise<{
|
|
4276
|
+
challenge: X402Challenge;
|
|
4277
|
+
requiredHeader: string;
|
|
4278
|
+
}>;
|
|
4279
|
+
/** Verify an incoming `payment-signature` header value. */
|
|
4280
|
+
verify(paymentSignature: string | string[] | undefined): Promise<VerifyPaymentResult>;
|
|
4281
|
+
}
|
|
4282
|
+
/**
|
|
4283
|
+
* Framework-agnostic core. Build one gate per gated resource and reuse it
|
|
4284
|
+
* — its in-memory used-tx set is what stops the same proof being redeemed
|
|
4285
|
+
* twice. Wrap it for Express with `requirePayment`, or call it directly
|
|
4286
|
+
* from Hono / Fastify / Adonis / Workers / etc.
|
|
4287
|
+
*
|
|
4288
|
+
* The chain's driver is resolved lazily on first `challenge()`/`verify()`,
|
|
4289
|
+
* which is what lets Solana (and future families) auto-mount with no setup.
|
|
4290
|
+
*/
|
|
4291
|
+
declare function createPaymentGate(options: RequirePaymentOptions): PaymentGate;
|
|
4292
|
+
interface ExpressLikeRequest {
|
|
4293
|
+
headers: Record<string, string | string[] | undefined>;
|
|
4294
|
+
originalUrl?: string;
|
|
4295
|
+
url?: string;
|
|
4296
|
+
}
|
|
4297
|
+
interface ExpressLikeResponse {
|
|
4298
|
+
setHeader: (name: string, value: string) => void;
|
|
4299
|
+
status: (code: number) => unknown;
|
|
4300
|
+
json: (body: unknown) => unknown;
|
|
4301
|
+
}
|
|
4302
|
+
type ExpressLikeNext = (err?: unknown) => void;
|
|
4303
|
+
type ExpressLikeMiddleware = (req: ExpressLikeRequest, res: ExpressLikeResponse, next: ExpressLikeNext) => Promise<void> | void;
|
|
4304
|
+
/**
|
|
4305
|
+
* Express/Connect-style middleware. The 80% case — drop it in front of a
|
|
4306
|
+
* route handler and the route is paid-only. The driver auto-mounts on the
|
|
4307
|
+
* first request; config/driver errors are forwarded to `next(err)`.
|
|
4308
|
+
*/
|
|
4309
|
+
declare function requirePayment(options: RequirePaymentOptions): ExpressLikeMiddleware;
|
|
4310
|
+
|
|
4311
|
+
/**
|
|
4312
|
+
* The driver registry — the ONLY place the families meet. Routing decides a
|
|
4313
|
+
* family from the `chain` value (synchronously), then asks that family's
|
|
4314
|
+
* driver to bind the network. Add a family = register a driver here.
|
|
4315
|
+
*/
|
|
4316
|
+
|
|
4317
|
+
declare function registerDriver(driver: PaymentDriver): void;
|
|
4318
|
+
|
|
4319
|
+
/**
|
|
4320
|
+
* ── The PipRail error model (the SDK-wide standard) ───────────────────────
|
|
4321
|
+
* Full standard: `sdk/ERRORS.md`. In short, errors surface through exactly two
|
|
4322
|
+
* channels, both chain-agnostic — an EVM, Solana, TON or Stellar failure looks
|
|
4323
|
+
* identical to the caller:
|
|
4324
|
+
*
|
|
4325
|
+
* 1. THROWN — a typed {@link PipRailError} subclass, each with a stable
|
|
4326
|
+
* SCREAMING_SNAKE `.code`. For config / flow / wallet / registry problems
|
|
4327
|
+
* the caller can act on (wrong-family wallet, missing driver, insufficient
|
|
4328
|
+
* funds, retries exhausted, …). Catch with `err instanceof PipRailError`.
|
|
4329
|
+
* 2. RETURNED — `verify()` returns a `VerifyResult` `{ ok: false, error,
|
|
4330
|
+
* detail }`, where `error` is a closed `VerifyErrorCode` (see x402.ts).
|
|
4331
|
+
* This is how server-side proof verification rejects; the gate turns it
|
|
4332
|
+
* into a 402 body `{ status: 'invalid', error, detail }` (built once by
|
|
4333
|
+
* {@link toInvalidBody}), and the client relays that reason to the agent.
|
|
4334
|
+
*
|
|
4335
|
+
* Affordability ("wallet can't pay") always converges on ONE typed
|
|
4336
|
+
* {@link InsufficientFundsError}, by two mechanisms: message-regex drivers
|
|
4337
|
+
* (Solana, TON) call {@link toInsufficientFundsError}; structured-error drivers
|
|
4338
|
+
* (EVM via viem's `BaseError` walk, Stellar via Horizon `result_codes`) detect
|
|
4339
|
+
* it from typed data — but every one throws the same InsufficientFundsError.
|
|
4340
|
+
*
|
|
4341
|
+
* So whoever hits an error — a human, the merchant server, or an AI agent —
|
|
4342
|
+
* gets a typed `.code` (thrown) or a `VerifyErrorCode` (returned) plus a
|
|
4343
|
+
* human-readable message, never an opaque chain-library error.
|
|
4344
|
+
*
|
|
4345
|
+
* Base class: every error the SDK throws extends this, so consumers can filter
|
|
4346
|
+
* SDK-originated errors from arbitrary ones with:
|
|
4347
|
+
*
|
|
4348
|
+
* catch (err) {
|
|
4349
|
+
* if (err instanceof PipRailError) ...
|
|
4350
|
+
* }
|
|
4351
|
+
*/
|
|
4352
|
+
declare abstract class PipRailError extends Error {
|
|
4353
|
+
abstract readonly code: string;
|
|
4354
|
+
constructor(message: string, options?: ErrorOptions);
|
|
4355
|
+
}
|
|
4356
|
+
/** Wallet balance too low for the quoted amount + gas. */
|
|
4357
|
+
declare class InsufficientFundsError extends PipRailError {
|
|
4358
|
+
readonly code = "INSUFFICIENT_FUNDS";
|
|
4359
|
+
}
|
|
4360
|
+
/**
|
|
4361
|
+
* Best-effort: turn a chain library's "wallet can't afford it" error into the
|
|
4362
|
+
* SDK's typed {@link InsufficientFundsError}, by matching its message. Drivers
|
|
4363
|
+
* WITHOUT structured error data (Solana, TON) call this in their `send()` catch
|
|
4364
|
+
* and rethrow the original on a miss:
|
|
4365
|
+
*
|
|
4366
|
+
* catch (err) { throw toInsufficientFundsError(err) ?? err }
|
|
4367
|
+
*
|
|
4368
|
+
* Drivers WITH structured data (EVM via viem `BaseError.walk`, Stellar via
|
|
4369
|
+
* Horizon `result_codes`) detect affordability from that data but still throw
|
|
4370
|
+
* the SAME InsufficientFundsError, and fall through to this as a message-level
|
|
4371
|
+
* backstop so the two paths can't drift. A miss returns null, so the original
|
|
4372
|
+
* (still descriptive) error propagates unchanged — never swallowed.
|
|
4373
|
+
*/
|
|
4374
|
+
declare function toInsufficientFundsError(err: unknown): InsufficientFundsError | null;
|
|
4375
|
+
/** Paywall is on chain X, client wallet is on chain Y. */
|
|
4376
|
+
declare class WrongChainError extends PipRailError {
|
|
4377
|
+
readonly code = "WRONG_CHAIN";
|
|
4378
|
+
}
|
|
4379
|
+
/**
|
|
4380
|
+
* Broadcast confirmed on-chain but server didn't return 200 within timeout.
|
|
4381
|
+
* The user got their tokens debited but the gated content is unreachable —
|
|
4382
|
+
* retry manually with the receipt nonce.
|
|
4383
|
+
*/
|
|
4384
|
+
declare class PaymentTimeoutError extends PipRailError {
|
|
4385
|
+
readonly code = "PAYMENT_TIMEOUT";
|
|
4386
|
+
}
|
|
4387
|
+
/** Paid, retried, still got 402. Means the server rejected our proof. */
|
|
4388
|
+
declare class MaxRetriesExceededError extends PipRailError {
|
|
4389
|
+
readonly code = "MAX_RETRIES_EXCEEDED";
|
|
4390
|
+
}
|
|
4391
|
+
/**
|
|
4392
|
+
* The client refused to pay BEFORE any on-chain send — the quoted payment
|
|
4393
|
+
* exceeded the configured {@link PaymentPolicy} (amount/total ceiling, or a
|
|
4394
|
+
* chain/token/host outside the allowlist), or an `onBeforePay` hook returned
|
|
4395
|
+
* `false`. No funds moved. The message names which guard fired; inspect the
|
|
4396
|
+
* `quote` via `client.quote(url)` to see the full breakdown.
|
|
4397
|
+
*/
|
|
4398
|
+
declare class PaymentDeclinedError extends PipRailError {
|
|
4399
|
+
readonly code = "PAYMENT_DECLINED";
|
|
4400
|
+
}
|
|
4401
|
+
/**
|
|
4402
|
+
* The payment broadcast but didn't confirm within the driver's polling window
|
|
4403
|
+
* (EVM: minConfirmations; Solana: commitment; TON: seqno; Stellar: ledger
|
|
4404
|
+
* visibility). The tx may still confirm — re-check the proof ref. Distinct from
|
|
4405
|
+
* {@link PaymentTimeoutError}, which is the SERVER not responding *after* a
|
|
4406
|
+
* confirmed payment.
|
|
4407
|
+
*/
|
|
4408
|
+
declare class ConfirmationTimeoutError extends PipRailError {
|
|
4409
|
+
readonly code = "CONFIRMATION_TIMEOUT";
|
|
4410
|
+
}
|
|
4411
|
+
/** Server returned 402 but the PAYMENT-REQUIRED envelope was missing or malformed. */
|
|
4412
|
+
declare class InvalidEnvelopeError extends PipRailError {
|
|
4413
|
+
readonly code = "INVALID_ENVELOPE";
|
|
4414
|
+
}
|
|
4415
|
+
/**
|
|
4416
|
+
* The envelope didn't include any accepts[] entry compatible with the
|
|
4417
|
+
* client's chain id (or all entries used unsupported schemes).
|
|
4418
|
+
*/
|
|
4419
|
+
declare class NoCompatibleAcceptError extends PipRailError {
|
|
4420
|
+
readonly code = "NO_COMPATIBLE_ACCEPT";
|
|
4421
|
+
}
|
|
4422
|
+
/** init.body was provided but isn't replayable (e.g. a one-shot ReadableStream). */
|
|
4423
|
+
declare class NonReplayableBodyError extends PipRailError {
|
|
4424
|
+
readonly code = "NON_REPLAYABLE_BODY";
|
|
4425
|
+
}
|
|
4426
|
+
/**
|
|
4427
|
+
* The chosen chain belongs to one family (EVM, Solana, TON, Stellar, XRPL, Tron,
|
|
4428
|
+
* Sui, NEAR) but the wallet, payTo, or token was given in another family's form
|
|
4429
|
+
* (e.g. an `0x…` payTo on Solana, or a `{ mint }` token on a Stellar chain).
|
|
4430
|
+
*/
|
|
4431
|
+
declare class WrongFamilyError extends PipRailError {
|
|
4432
|
+
readonly code = "WRONG_FAMILY";
|
|
4433
|
+
}
|
|
4434
|
+
/**
|
|
4435
|
+
* A built-in token symbol was requested that the chosen chain doesn't ship
|
|
4436
|
+
* (e.g. `token: 'DOGE'`). Use a symbol the chain ships, `'native'`, or pass the
|
|
4437
|
+
* token by full descriptor ({ address, decimals } EVM/Tron · { mint, decimals }
|
|
4438
|
+
* Solana · { master, decimals } TON · { issuer, code, decimals } Stellar ·
|
|
4439
|
+
* { issuer, currencyHex, decimals } XRPL · { coinType, decimals } Sui ·
|
|
4440
|
+
* { contractId, decimals } NEAR).
|
|
4441
|
+
*/
|
|
4442
|
+
declare class UnknownTokenError extends PipRailError {
|
|
4443
|
+
readonly code = "UNKNOWN_TOKEN";
|
|
4444
|
+
}
|
|
4445
|
+
/**
|
|
4446
|
+
* The requested chain family couldn't be mounted. Drivers auto-mount on first
|
|
4447
|
+
* use, so this means its optional peer deps aren't installed — Solana:
|
|
4448
|
+
* `npm install @solana/web3.js @solana/spl-token bs58`; TON:
|
|
4449
|
+
* `npm install @ton/ton @ton/core @ton/crypto`; Stellar:
|
|
4450
|
+
* `npm install @stellar/stellar-sdk`; XRPL: `npm install xrpl`; Tron:
|
|
4451
|
+
* `npm install tronweb`; Sui: `npm install @mysten/sui`; NEAR:
|
|
4452
|
+
* `npm install near-api-js`.
|
|
4453
|
+
*/
|
|
4454
|
+
declare class MissingDriverError extends PipRailError {
|
|
4455
|
+
readonly code = "MISSING_DRIVER";
|
|
4456
|
+
}
|
|
4457
|
+
/** No registered driver recognised the given `chain` value. */
|
|
4458
|
+
declare class UnsupportedNetworkError extends PipRailError {
|
|
4459
|
+
readonly code = "UNSUPPORTED_NETWORK";
|
|
4460
|
+
}
|
|
4461
|
+
|
|
4462
|
+
/**
|
|
4463
|
+
* ── EVM SECTION: x402 `exact` scheme (interop building block) ──────────────
|
|
4464
|
+
*
|
|
4465
|
+
* EXPERIMENTAL / ADVANCED. PipRail's own gates use the `onchain-proof` scheme
|
|
4466
|
+
* (client pays first, proves with a tx ref, server verifies locally — no
|
|
4467
|
+
* facilitator). This module is the opposite end: the building blocks to PAY a
|
|
4468
|
+
* server that speaks the mainstream x402 `exact` scheme (Coinbase-style), where
|
|
4469
|
+
* the client signs an EIP-3009 `transferWithAuthorization` and a third-party
|
|
4470
|
+
* facilitator broadcasts it. It lets a PipRail agent buy from `exact` servers
|
|
4471
|
+
* too — making PipRail a *universal* x402 client — while our servers stay
|
|
4472
|
+
* backendless.
|
|
4473
|
+
*
|
|
4474
|
+
* What's here is the deterministic, unit-testable core: parse an `exact`
|
|
4475
|
+
* requirement, build + EIP-712-sign the authorization, and encode the
|
|
4476
|
+
* `X-PAYMENT` header. It is intentionally NOT wired into `PipRailClient.fetch`'s
|
|
4477
|
+
* default flow: `exact` is a cross-vendor wire protocol whose live acceptance
|
|
4478
|
+
* can only be confirmed against a real facilitator, and bolting a second
|
|
4479
|
+
* payment protocol into the core would cut against PipRail's keep-it-simple
|
|
4480
|
+
* design. Use these helpers to hand-roll an `exact` payment, and validate
|
|
4481
|
+
* against your target facilitator before production. See
|
|
4482
|
+
* `.claude/plans/agent-readiness/04-universal-exact.md`.
|
|
4483
|
+
*
|
|
4484
|
+
* EVM + EIP-3009 only (USDC and kin). Uses the existing `viem` peer — no new dep.
|
|
4485
|
+
*/
|
|
4486
|
+
|
|
4487
|
+
/** x402 network slug → EVM chain id, for the chains PipRail ships with EIP-3009
|
|
4488
|
+
* USDC. Extend as needed; an unknown slug just won't be selected. */
|
|
4489
|
+
declare const EXACT_NETWORK_SLUGS: Readonly<Record<string, number>>;
|
|
4490
|
+
/** Resolve an x402 `exact` network slug (e.g. "base") to its EVM chain id. */
|
|
4491
|
+
declare function chainIdForExactNetwork(slug: string): number | null;
|
|
4492
|
+
/** A parsed x402 `exact` PaymentRequirements entry (the fields we consume). */
|
|
4493
|
+
interface ExactAccept {
|
|
4494
|
+
scheme: 'exact';
|
|
4495
|
+
network: string;
|
|
4496
|
+
/** Amount in base units (x402 names this `maxAmountRequired`). */
|
|
4497
|
+
maxAmountRequired: string;
|
|
4498
|
+
/** EIP-3009 token contract. */
|
|
4499
|
+
asset: `0x${string}`;
|
|
4500
|
+
payTo: `0x${string}`;
|
|
4501
|
+
maxTimeoutSeconds: number;
|
|
4502
|
+
/** EIP-712 domain of the token (USDC: name 'USD Coin', version '2'). */
|
|
4503
|
+
extra?: {
|
|
4504
|
+
name?: string;
|
|
4505
|
+
version?: string;
|
|
4506
|
+
};
|
|
4507
|
+
description?: string;
|
|
4508
|
+
resource?: string;
|
|
4509
|
+
}
|
|
4510
|
+
/** The EIP-3009 authorization the payer signs. */
|
|
4511
|
+
interface ExactAuthorization {
|
|
4512
|
+
from: `0x${string}`;
|
|
4513
|
+
to: `0x${string}`;
|
|
4514
|
+
value: string;
|
|
4515
|
+
validAfter: string;
|
|
4516
|
+
validBefore: string;
|
|
4517
|
+
nonce: Hex;
|
|
4518
|
+
}
|
|
4519
|
+
/** EIP-712 type set for `transferWithAuthorization` (EIP-3009). */
|
|
4520
|
+
declare const EIP3009_TYPES: {
|
|
4521
|
+
readonly TransferWithAuthorization: readonly [{
|
|
4522
|
+
readonly name: "from";
|
|
4523
|
+
readonly type: "address";
|
|
4524
|
+
}, {
|
|
4525
|
+
readonly name: "to";
|
|
4526
|
+
readonly type: "address";
|
|
4527
|
+
}, {
|
|
4528
|
+
readonly name: "value";
|
|
4529
|
+
readonly type: "uint256";
|
|
4530
|
+
}, {
|
|
4531
|
+
readonly name: "validAfter";
|
|
4532
|
+
readonly type: "uint256";
|
|
4533
|
+
}, {
|
|
4534
|
+
readonly name: "validBefore";
|
|
4535
|
+
readonly type: "uint256";
|
|
4536
|
+
}, {
|
|
4537
|
+
readonly name: "nonce";
|
|
4538
|
+
readonly type: "bytes32";
|
|
4539
|
+
}];
|
|
4540
|
+
};
|
|
4541
|
+
/**
|
|
4542
|
+
* Parse a standard x402 challenge body into its `exact` requirements. Tolerant
|
|
4543
|
+
* of x402Version 1 or 2 and of the `maxAmountRequired`/`amount` field name.
|
|
4544
|
+
* Returns `[]` when there are no `exact` entries, `null` when the body isn't a
|
|
4545
|
+
* recognisable x402 challenge.
|
|
4546
|
+
*/
|
|
4547
|
+
declare function parseExactRequirements(body: unknown): ExactAccept[] | null;
|
|
4548
|
+
interface BuildExactParams {
|
|
4549
|
+
/** A viem account able to sign EIP-712 typed data. */
|
|
4550
|
+
account: Account;
|
|
4551
|
+
accept: ExactAccept;
|
|
4552
|
+
/** EVM chain id (must match the token's deployment / EIP-712 domain). */
|
|
4553
|
+
chainId: number;
|
|
4554
|
+
/** Unix seconds 'now' — injectable for deterministic tests. */
|
|
4555
|
+
now: number;
|
|
4556
|
+
/** 32-byte hex authorization nonce — injectable for deterministic tests
|
|
4557
|
+
* (use a CSPRNG value in production). */
|
|
4558
|
+
nonce: Hex;
|
|
4559
|
+
}
|
|
4560
|
+
/**
|
|
4561
|
+
* Build + EIP-712-sign an EIP-3009 `transferWithAuthorization` for an `exact`
|
|
4562
|
+
* requirement. Returns the authorization and its signature; pass both to
|
|
4563
|
+
* {@link encodeXPaymentHeader} to produce the `X-PAYMENT` header value.
|
|
4564
|
+
*/
|
|
4565
|
+
declare function buildExactAuthorization(params: BuildExactParams): Promise<{
|
|
4566
|
+
authorization: ExactAuthorization;
|
|
4567
|
+
signature: Hex;
|
|
4568
|
+
}>;
|
|
4569
|
+
/** Encode an x402 `exact` PaymentPayload into an `X-PAYMENT` header value. */
|
|
4570
|
+
declare function encodeXPaymentHeader(input: {
|
|
4571
|
+
network: string;
|
|
4572
|
+
authorization: ExactAuthorization;
|
|
4573
|
+
signature: Hex;
|
|
4574
|
+
/** x402 envelope version (Coinbase's reference uses 1). */
|
|
4575
|
+
x402Version?: number;
|
|
4576
|
+
}): string;
|
|
4577
|
+
|
|
4578
|
+
export { type AcceptOption, type AddressId, type AgentTool, type AssetId, type BuildExactParams, CHAINS, type Caip2, type ChainFamily, type ChainInput, type ChainName, type ChainPreset, type ChainSelector, type ConfirmInfo, ConfirmationTimeoutError, type CostEstimate, EIP3009_TYPES, EXACT_NETWORK_SLUGS, type EvmToken, type ExactAccept, type ExactAuthorization, type ExpressLikeMiddleware, type ExpressLikeNext, type ExpressLikeRequest, type ExpressLikeResponse, InsufficientFundsError, InvalidEnvelopeError, MaxRetriesExceededError, MissingDriverError, type NearToken, NoCompatibleAcceptError, NonReplayableBodyError, PaymentDeclinedError, type PaymentDriver, type PaymentGate, type PaymentIntent, type PaymentPolicy, PaymentTimeoutError, PipRailClient, type PipRailClientOptions, type PipRailCostQuote, PipRailError, type PipRailEvent, type PipRailQuote, type PolicyDecision, type RequirePaymentOptions, type ResolveOptions, type ResolvedChain, type ResolvedNetwork, type ResolvedToken, type SolanaToken, type SpendAssetTotal, type SpendRecord, type SpendSummary, type StellarToken, type SuiToken, type TokenInfo, type TokenInput, type TonToken, type TronToken, UnknownTokenError, UnsupportedNetworkError, type VerifyErrorCode, type VerifyPaymentResult, type VerifyResult, type WalletHandle, type WalletInput, WrongChainError, WrongFamilyError, type X402AcceptEntry, type X402Challenge, type X402InvalidBody, type X402PaymentSignature, type X402Receipt, type X402ResourceObject, type XrplToken, buildChallengeHeader, buildExactAuthorization, buildReceiptHeader, buildSignatureHeader, chainIdForExactNetwork, createPaymentGate, encodeXPaymentHeader, evaluatePolicy, parseChallenge, parseExactRequirements, parseReceipt, parseSignatureHeader, paymentTools, pickAccept, registerDriver, requirePayment, resolveChain, toInsufficientFundsError, toInvalidBody };
|