@qntx/wallet-engine 0.4.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE-APACHE +201 -0
- package/LICENSE-MIT +21 -0
- package/README.md +80 -0
- package/dist/contract-D5pguqiZ.mjs +284 -0
- package/dist/contract-D5pguqiZ.mjs.map +1 -0
- package/dist/gateway-contract.d.mts +297 -0
- package/dist/gateway-contract.mjs +1 -0
- package/dist/index.d.mts +758 -167
- package/dist/index.mjs +4427 -1295
- package/dist/index.mjs.map +1 -1
- package/dist/registry-9oeWs_yZ.d.mts +25 -0
- package/package.json +28 -10
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
import { a as networkById, i as SOLANA_NETWORKS, n as NETWORKS, r as NetworkInfo, t as BITCOIN_NETWORKS } from "./registry-9oeWs_yZ.mjs";
|
|
2
|
+
import * as z from "zod/mini";
|
|
3
|
+
//#region src/gateway/contract/primitives.d.ts
|
|
4
|
+
export declare const INSTALL_ID_HEADER = "x-install-id";
|
|
5
|
+
export declare const PROVIDERS_HEADER = "x-gateway-providers";
|
|
6
|
+
/** 128 random bits as lowercase hex — generated once per install, unrelated to wallet secrets. */
|
|
7
|
+
export declare const installId: z.ZodMiniString<string>;
|
|
8
|
+
/** CAIP-2 chain id: `namespace:reference`. */
|
|
9
|
+
export declare const caip2: z.ZodMiniString<string>;
|
|
10
|
+
export type Caip2 = z.infer<typeof caip2>;
|
|
11
|
+
export type InstallId = z.infer<typeof installId>;
|
|
12
|
+
export declare const GATEWAY_ERRORS: readonly ["invalid-request", "unknown-network", "not-found", "rate-limited", "unavailable", "internal"];
|
|
13
|
+
export declare const gatewayError: z.ZodMiniObject<{
|
|
14
|
+
error: z.ZodMiniEnum<{
|
|
15
|
+
internal: "internal";
|
|
16
|
+
"invalid-request": "invalid-request";
|
|
17
|
+
"not-found": "not-found";
|
|
18
|
+
"rate-limited": "rate-limited";
|
|
19
|
+
unavailable: "unavailable";
|
|
20
|
+
"unknown-network": "unknown-network";
|
|
21
|
+
}>;
|
|
22
|
+
}, z.core.$strip>;
|
|
23
|
+
export type GatewayErrorCode = (typeof GATEWAY_ERRORS)[number];
|
|
24
|
+
//#endregion
|
|
25
|
+
//#region src/gateway/contract/endpoint.d.ts
|
|
26
|
+
export type HttpMethod = "GET" | "POST" | "DELETE";
|
|
27
|
+
export type Endpoint<Req extends z.ZodMiniType, Res extends z.ZodMiniType> = {
|
|
28
|
+
readonly method: HttpMethod;
|
|
29
|
+
readonly path: string;
|
|
30
|
+
readonly request: Req;
|
|
31
|
+
readonly response: Res;
|
|
32
|
+
};
|
|
33
|
+
/** One gateway route: its verb, versioned path template, and request/response schemas. */
|
|
34
|
+
export declare function endpoint<Req extends z.ZodMiniType, Res extends z.ZodMiniType>(method: HttpMethod, path: `/v1/${string}`, request: Req, response: Res): Endpoint<Req, Res>;
|
|
35
|
+
/** `value` typed by `schema`, or `undefined` when it does not satisfy it. */
|
|
36
|
+
export declare function parseWith<S extends z.ZodMiniType>(schema: S, value: unknown): z.output<S> | undefined;
|
|
37
|
+
/** Whether `value` satisfies `schema` — lets consumers validate without importing zod. */
|
|
38
|
+
export declare function accepts(schema: z.ZodMiniType, value: unknown): boolean;
|
|
39
|
+
//#endregion
|
|
40
|
+
//#region src/gateway/contract/health.d.ts
|
|
41
|
+
export declare const healthRequest: z.ZodMiniUndefined;
|
|
42
|
+
export declare const healthResponse: z.ZodMiniObject<{
|
|
43
|
+
status: z.ZodMiniLiteral<"ok">;
|
|
44
|
+
}, z.core.$strip>;
|
|
45
|
+
export declare const health: Endpoint<z.ZodMiniUndefined, z.ZodMiniObject<{
|
|
46
|
+
status: z.ZodMiniLiteral<"ok">;
|
|
47
|
+
}, z.core.$strip>>;
|
|
48
|
+
//#endregion
|
|
49
|
+
//#region src/gateway/contract/rpc.d.ts
|
|
50
|
+
/** One JSON-RPC call plus nothing else: batches may carry at most this many entries. */
|
|
51
|
+
export declare const RPC_BATCH_MAX = 20;
|
|
52
|
+
/** Read-only EVM methods plus `eth_sendRawTransaction`. Anything not listed is rejected. */
|
|
53
|
+
export declare const EVM_RPC_METHODS: readonly ["eth_blobBaseFee", "eth_blockNumber", "eth_call", "eth_chainId", "eth_createAccessList", "eth_estimateGas", "eth_feeHistory", "eth_gasPrice", "eth_getBalance", "eth_getBlockByHash", "eth_getBlockByNumber", "eth_getBlockReceipts", "eth_getBlockTransactionCountByHash", "eth_getBlockTransactionCountByNumber", "eth_getCode", "eth_getProof", "eth_getStorageAt", "eth_getTransactionByBlockHashAndIndex", "eth_getTransactionByBlockNumberAndIndex", "eth_getTransactionByHash", "eth_getTransactionCount", "eth_getTransactionReceipt", "eth_maxPriorityFeePerGas", "eth_sendRawTransaction", "net_version", "web3_clientVersion"];
|
|
54
|
+
/** Read-only Solana methods plus `sendTransaction`. Anything not listed is rejected. */
|
|
55
|
+
export declare const SOLANA_RPC_METHODS: readonly ["getAccountInfo", "getBalance", "getBlock", "getBlockHeight", "getBlockTime", "getEpochInfo", "getFeeForMessage", "getGenesisHash", "getLatestBlockhash", "getMinimumBalanceForRentExemption", "getMultipleAccounts", "getRecentPrioritizationFees", "getSignatureStatuses", "getSignaturesForAddress", "getSlot", "getTokenAccountBalance", "getTokenAccountsByOwner", "getTokenSupply", "getTransaction", "getVersion", "isBlockhashValid", "sendTransaction", "simulateTransaction"];
|
|
56
|
+
export type EvmRpcMethod = (typeof EVM_RPC_METHODS)[number];
|
|
57
|
+
export type SolanaRpcMethod = (typeof SOLANA_RPC_METHODS)[number];
|
|
58
|
+
export declare const jsonRpcId: z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniNumber<number>, z.ZodMiniNull]>;
|
|
59
|
+
/** Method-agnostic wire shape of a call or batch (the gateway narrows by family). */
|
|
60
|
+
export declare const rpcRequest: z.ZodMiniUnion<readonly [z.ZodMiniObject<{
|
|
61
|
+
jsonrpc: z.ZodMiniLiteral<"2.0">;
|
|
62
|
+
id: z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniNumber<number>, z.ZodMiniNull]>;
|
|
63
|
+
method: z.ZodMiniString<string>;
|
|
64
|
+
params: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniArray<z.ZodMiniUnknown>, z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnknown>]>>;
|
|
65
|
+
}, z.core.$strip>, z.ZodMiniArray<z.ZodMiniObject<{
|
|
66
|
+
jsonrpc: z.ZodMiniLiteral<"2.0">;
|
|
67
|
+
id: z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniNumber<number>, z.ZodMiniNull]>;
|
|
68
|
+
method: z.ZodMiniString<string>;
|
|
69
|
+
params: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniArray<z.ZodMiniUnknown>, z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnknown>]>>;
|
|
70
|
+
}, z.core.$strip>>]>;
|
|
71
|
+
export declare const evmRpcRequest: z.ZodMiniUnion<readonly [z.ZodMiniObject<{
|
|
72
|
+
jsonrpc: z.ZodMiniLiteral<"2.0">;
|
|
73
|
+
id: z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniNumber<number>, z.ZodMiniNull]>;
|
|
74
|
+
method: z.ZodMiniEnum<{
|
|
75
|
+
eth_blobBaseFee: "eth_blobBaseFee";
|
|
76
|
+
eth_blockNumber: "eth_blockNumber";
|
|
77
|
+
eth_call: "eth_call";
|
|
78
|
+
eth_chainId: "eth_chainId";
|
|
79
|
+
eth_createAccessList: "eth_createAccessList";
|
|
80
|
+
eth_estimateGas: "eth_estimateGas";
|
|
81
|
+
eth_feeHistory: "eth_feeHistory";
|
|
82
|
+
eth_gasPrice: "eth_gasPrice";
|
|
83
|
+
eth_getBalance: "eth_getBalance";
|
|
84
|
+
eth_getBlockByHash: "eth_getBlockByHash";
|
|
85
|
+
eth_getBlockByNumber: "eth_getBlockByNumber";
|
|
86
|
+
eth_getBlockReceipts: "eth_getBlockReceipts";
|
|
87
|
+
eth_getBlockTransactionCountByHash: "eth_getBlockTransactionCountByHash";
|
|
88
|
+
eth_getBlockTransactionCountByNumber: "eth_getBlockTransactionCountByNumber";
|
|
89
|
+
eth_getCode: "eth_getCode";
|
|
90
|
+
eth_getProof: "eth_getProof";
|
|
91
|
+
eth_getStorageAt: "eth_getStorageAt";
|
|
92
|
+
eth_getTransactionByBlockHashAndIndex: "eth_getTransactionByBlockHashAndIndex";
|
|
93
|
+
eth_getTransactionByBlockNumberAndIndex: "eth_getTransactionByBlockNumberAndIndex";
|
|
94
|
+
eth_getTransactionByHash: "eth_getTransactionByHash";
|
|
95
|
+
eth_getTransactionCount: "eth_getTransactionCount";
|
|
96
|
+
eth_getTransactionReceipt: "eth_getTransactionReceipt";
|
|
97
|
+
eth_maxPriorityFeePerGas: "eth_maxPriorityFeePerGas";
|
|
98
|
+
eth_sendRawTransaction: "eth_sendRawTransaction";
|
|
99
|
+
net_version: "net_version";
|
|
100
|
+
web3_clientVersion: "web3_clientVersion";
|
|
101
|
+
}>;
|
|
102
|
+
params: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniArray<z.ZodMiniUnknown>, z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnknown>]>>;
|
|
103
|
+
}, z.core.$strip>, z.ZodMiniArray<z.ZodMiniObject<{
|
|
104
|
+
jsonrpc: z.ZodMiniLiteral<"2.0">;
|
|
105
|
+
id: z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniNumber<number>, z.ZodMiniNull]>;
|
|
106
|
+
method: z.ZodMiniEnum<{
|
|
107
|
+
eth_blobBaseFee: "eth_blobBaseFee";
|
|
108
|
+
eth_blockNumber: "eth_blockNumber";
|
|
109
|
+
eth_call: "eth_call";
|
|
110
|
+
eth_chainId: "eth_chainId";
|
|
111
|
+
eth_createAccessList: "eth_createAccessList";
|
|
112
|
+
eth_estimateGas: "eth_estimateGas";
|
|
113
|
+
eth_feeHistory: "eth_feeHistory";
|
|
114
|
+
eth_gasPrice: "eth_gasPrice";
|
|
115
|
+
eth_getBalance: "eth_getBalance";
|
|
116
|
+
eth_getBlockByHash: "eth_getBlockByHash";
|
|
117
|
+
eth_getBlockByNumber: "eth_getBlockByNumber";
|
|
118
|
+
eth_getBlockReceipts: "eth_getBlockReceipts";
|
|
119
|
+
eth_getBlockTransactionCountByHash: "eth_getBlockTransactionCountByHash";
|
|
120
|
+
eth_getBlockTransactionCountByNumber: "eth_getBlockTransactionCountByNumber";
|
|
121
|
+
eth_getCode: "eth_getCode";
|
|
122
|
+
eth_getProof: "eth_getProof";
|
|
123
|
+
eth_getStorageAt: "eth_getStorageAt";
|
|
124
|
+
eth_getTransactionByBlockHashAndIndex: "eth_getTransactionByBlockHashAndIndex";
|
|
125
|
+
eth_getTransactionByBlockNumberAndIndex: "eth_getTransactionByBlockNumberAndIndex";
|
|
126
|
+
eth_getTransactionByHash: "eth_getTransactionByHash";
|
|
127
|
+
eth_getTransactionCount: "eth_getTransactionCount";
|
|
128
|
+
eth_getTransactionReceipt: "eth_getTransactionReceipt";
|
|
129
|
+
eth_maxPriorityFeePerGas: "eth_maxPriorityFeePerGas";
|
|
130
|
+
eth_sendRawTransaction: "eth_sendRawTransaction";
|
|
131
|
+
net_version: "net_version";
|
|
132
|
+
web3_clientVersion: "web3_clientVersion";
|
|
133
|
+
}>;
|
|
134
|
+
params: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniArray<z.ZodMiniUnknown>, z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnknown>]>>;
|
|
135
|
+
}, z.core.$strip>>]>;
|
|
136
|
+
export declare const solanaRpcRequest: z.ZodMiniUnion<readonly [z.ZodMiniObject<{
|
|
137
|
+
jsonrpc: z.ZodMiniLiteral<"2.0">;
|
|
138
|
+
id: z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniNumber<number>, z.ZodMiniNull]>;
|
|
139
|
+
method: z.ZodMiniEnum<{
|
|
140
|
+
getAccountInfo: "getAccountInfo";
|
|
141
|
+
getBalance: "getBalance";
|
|
142
|
+
getBlock: "getBlock";
|
|
143
|
+
getBlockHeight: "getBlockHeight";
|
|
144
|
+
getBlockTime: "getBlockTime";
|
|
145
|
+
getEpochInfo: "getEpochInfo";
|
|
146
|
+
getFeeForMessage: "getFeeForMessage";
|
|
147
|
+
getGenesisHash: "getGenesisHash";
|
|
148
|
+
getLatestBlockhash: "getLatestBlockhash";
|
|
149
|
+
getMinimumBalanceForRentExemption: "getMinimumBalanceForRentExemption";
|
|
150
|
+
getMultipleAccounts: "getMultipleAccounts";
|
|
151
|
+
getRecentPrioritizationFees: "getRecentPrioritizationFees";
|
|
152
|
+
getSignatureStatuses: "getSignatureStatuses";
|
|
153
|
+
getSignaturesForAddress: "getSignaturesForAddress";
|
|
154
|
+
getSlot: "getSlot";
|
|
155
|
+
getTokenAccountBalance: "getTokenAccountBalance";
|
|
156
|
+
getTokenAccountsByOwner: "getTokenAccountsByOwner";
|
|
157
|
+
getTokenSupply: "getTokenSupply";
|
|
158
|
+
getTransaction: "getTransaction";
|
|
159
|
+
getVersion: "getVersion";
|
|
160
|
+
isBlockhashValid: "isBlockhashValid";
|
|
161
|
+
sendTransaction: "sendTransaction";
|
|
162
|
+
simulateTransaction: "simulateTransaction";
|
|
163
|
+
}>;
|
|
164
|
+
params: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniArray<z.ZodMiniUnknown>, z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnknown>]>>;
|
|
165
|
+
}, z.core.$strip>, z.ZodMiniArray<z.ZodMiniObject<{
|
|
166
|
+
jsonrpc: z.ZodMiniLiteral<"2.0">;
|
|
167
|
+
id: z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniNumber<number>, z.ZodMiniNull]>;
|
|
168
|
+
method: z.ZodMiniEnum<{
|
|
169
|
+
getAccountInfo: "getAccountInfo";
|
|
170
|
+
getBalance: "getBalance";
|
|
171
|
+
getBlock: "getBlock";
|
|
172
|
+
getBlockHeight: "getBlockHeight";
|
|
173
|
+
getBlockTime: "getBlockTime";
|
|
174
|
+
getEpochInfo: "getEpochInfo";
|
|
175
|
+
getFeeForMessage: "getFeeForMessage";
|
|
176
|
+
getGenesisHash: "getGenesisHash";
|
|
177
|
+
getLatestBlockhash: "getLatestBlockhash";
|
|
178
|
+
getMinimumBalanceForRentExemption: "getMinimumBalanceForRentExemption";
|
|
179
|
+
getMultipleAccounts: "getMultipleAccounts";
|
|
180
|
+
getRecentPrioritizationFees: "getRecentPrioritizationFees";
|
|
181
|
+
getSignatureStatuses: "getSignatureStatuses";
|
|
182
|
+
getSignaturesForAddress: "getSignaturesForAddress";
|
|
183
|
+
getSlot: "getSlot";
|
|
184
|
+
getTokenAccountBalance: "getTokenAccountBalance";
|
|
185
|
+
getTokenAccountsByOwner: "getTokenAccountsByOwner";
|
|
186
|
+
getTokenSupply: "getTokenSupply";
|
|
187
|
+
getTransaction: "getTransaction";
|
|
188
|
+
getVersion: "getVersion";
|
|
189
|
+
isBlockhashValid: "isBlockhashValid";
|
|
190
|
+
sendTransaction: "sendTransaction";
|
|
191
|
+
simulateTransaction: "simulateTransaction";
|
|
192
|
+
}>;
|
|
193
|
+
params: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniArray<z.ZodMiniUnknown>, z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnknown>]>>;
|
|
194
|
+
}, z.core.$strip>>]>;
|
|
195
|
+
export declare const jsonRpcResponse: z.ZodMiniUnion<readonly [z.ZodMiniObject<{
|
|
196
|
+
jsonrpc: z.ZodMiniLiteral<"2.0">;
|
|
197
|
+
id: z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniNumber<number>, z.ZodMiniNull]>;
|
|
198
|
+
result: z.ZodMiniUnknown;
|
|
199
|
+
}, z.core.$strip>, z.ZodMiniObject<{
|
|
200
|
+
jsonrpc: z.ZodMiniLiteral<"2.0">;
|
|
201
|
+
id: z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniNumber<number>, z.ZodMiniNull]>;
|
|
202
|
+
error: z.ZodMiniObject<{
|
|
203
|
+
code: z.ZodMiniInt;
|
|
204
|
+
message: z.ZodMiniString<string>;
|
|
205
|
+
data: z.ZodMiniOptional<z.ZodMiniUnknown>;
|
|
206
|
+
}, z.core.$strip>;
|
|
207
|
+
}, z.core.$strip>]>;
|
|
208
|
+
export declare const rpcResponse: z.ZodMiniUnion<readonly [z.ZodMiniUnion<readonly [z.ZodMiniObject<{
|
|
209
|
+
jsonrpc: z.ZodMiniLiteral<"2.0">;
|
|
210
|
+
id: z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniNumber<number>, z.ZodMiniNull]>;
|
|
211
|
+
result: z.ZodMiniUnknown;
|
|
212
|
+
}, z.core.$strip>, z.ZodMiniObject<{
|
|
213
|
+
jsonrpc: z.ZodMiniLiteral<"2.0">;
|
|
214
|
+
id: z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniNumber<number>, z.ZodMiniNull]>;
|
|
215
|
+
error: z.ZodMiniObject<{
|
|
216
|
+
code: z.ZodMiniInt;
|
|
217
|
+
message: z.ZodMiniString<string>;
|
|
218
|
+
data: z.ZodMiniOptional<z.ZodMiniUnknown>;
|
|
219
|
+
}, z.core.$strip>;
|
|
220
|
+
}, z.core.$strip>]>, z.ZodMiniArray<z.ZodMiniUnion<readonly [z.ZodMiniObject<{
|
|
221
|
+
jsonrpc: z.ZodMiniLiteral<"2.0">;
|
|
222
|
+
id: z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniNumber<number>, z.ZodMiniNull]>;
|
|
223
|
+
result: z.ZodMiniUnknown;
|
|
224
|
+
}, z.core.$strip>, z.ZodMiniObject<{
|
|
225
|
+
jsonrpc: z.ZodMiniLiteral<"2.0">;
|
|
226
|
+
id: z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniNumber<number>, z.ZodMiniNull]>;
|
|
227
|
+
error: z.ZodMiniObject<{
|
|
228
|
+
code: z.ZodMiniInt;
|
|
229
|
+
message: z.ZodMiniString<string>;
|
|
230
|
+
data: z.ZodMiniOptional<z.ZodMiniUnknown>;
|
|
231
|
+
}, z.core.$strip>;
|
|
232
|
+
}, z.core.$strip>]>>]>;
|
|
233
|
+
export declare const rpc: Endpoint<z.ZodMiniUnion<readonly [z.ZodMiniObject<{
|
|
234
|
+
jsonrpc: z.ZodMiniLiteral<"2.0">;
|
|
235
|
+
id: z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniNumber<number>, z.ZodMiniNull]>;
|
|
236
|
+
method: z.ZodMiniString<string>;
|
|
237
|
+
params: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniArray<z.ZodMiniUnknown>, z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnknown>]>>;
|
|
238
|
+
}, z.core.$strip>, z.ZodMiniArray<z.ZodMiniObject<{
|
|
239
|
+
jsonrpc: z.ZodMiniLiteral<"2.0">;
|
|
240
|
+
id: z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniNumber<number>, z.ZodMiniNull]>;
|
|
241
|
+
method: z.ZodMiniString<string>;
|
|
242
|
+
params: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniArray<z.ZodMiniUnknown>, z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnknown>]>>;
|
|
243
|
+
}, z.core.$strip>>]>, z.ZodMiniUnion<readonly [z.ZodMiniUnion<readonly [z.ZodMiniObject<{
|
|
244
|
+
jsonrpc: z.ZodMiniLiteral<"2.0">;
|
|
245
|
+
id: z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniNumber<number>, z.ZodMiniNull]>;
|
|
246
|
+
result: z.ZodMiniUnknown;
|
|
247
|
+
}, z.core.$strip>, z.ZodMiniObject<{
|
|
248
|
+
jsonrpc: z.ZodMiniLiteral<"2.0">;
|
|
249
|
+
id: z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniNumber<number>, z.ZodMiniNull]>;
|
|
250
|
+
error: z.ZodMiniObject<{
|
|
251
|
+
code: z.ZodMiniInt;
|
|
252
|
+
message: z.ZodMiniString<string>;
|
|
253
|
+
data: z.ZodMiniOptional<z.ZodMiniUnknown>;
|
|
254
|
+
}, z.core.$strip>;
|
|
255
|
+
}, z.core.$strip>]>, z.ZodMiniArray<z.ZodMiniUnion<readonly [z.ZodMiniObject<{
|
|
256
|
+
jsonrpc: z.ZodMiniLiteral<"2.0">;
|
|
257
|
+
id: z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniNumber<number>, z.ZodMiniNull]>;
|
|
258
|
+
result: z.ZodMiniUnknown;
|
|
259
|
+
}, z.core.$strip>, z.ZodMiniObject<{
|
|
260
|
+
jsonrpc: z.ZodMiniLiteral<"2.0">;
|
|
261
|
+
id: z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniNumber<number>, z.ZodMiniNull]>;
|
|
262
|
+
error: z.ZodMiniObject<{
|
|
263
|
+
code: z.ZodMiniInt;
|
|
264
|
+
message: z.ZodMiniString<string>;
|
|
265
|
+
data: z.ZodMiniOptional<z.ZodMiniUnknown>;
|
|
266
|
+
}, z.core.$strip>;
|
|
267
|
+
}, z.core.$strip>]>>]>>;
|
|
268
|
+
/** The JSON-RPC URL path for one network. */
|
|
269
|
+
export declare const rpcPath: (caip2: string) => string;
|
|
270
|
+
//#endregion
|
|
271
|
+
//#region src/gateway/contract/esplora.d.ts
|
|
272
|
+
type EsploraRoute = {
|
|
273
|
+
readonly method: "GET" | "POST";
|
|
274
|
+
readonly pattern: RegExp;
|
|
275
|
+
};
|
|
276
|
+
/** The Esplora surface the engine uses; every other path is rejected. */
|
|
277
|
+
export declare const ESPLORA_ROUTES: ReadonlyArray<EsploraRoute>;
|
|
278
|
+
/** `path` is the Esplora path after `/v1/esplora/:caip2`, with a leading slash and no query. */
|
|
279
|
+
export declare const esploraPathAllowed: (method: string, path: string) => boolean;
|
|
280
|
+
export declare const esploraGet: Endpoint<z.ZodMiniUndefined, z.ZodMiniUnknown>;
|
|
281
|
+
/** The Esplora base path for one network; allow-listed paths are appended to it. */
|
|
282
|
+
export declare const esploraBasePath: (caip2: string) => string;
|
|
283
|
+
export declare const esploraPost: Endpoint<z.ZodMiniString<string>, z.ZodMiniString<string>>;
|
|
284
|
+
//#endregion
|
|
285
|
+
//#region src/gateway/contract/served.d.ts
|
|
286
|
+
export declare const servedNetworksRequest: z.ZodMiniUndefined;
|
|
287
|
+
/** The networks the gateway actually serves, in its configured order. */
|
|
288
|
+
export declare const servedNetworksResponse: z.ZodMiniObject<{
|
|
289
|
+
networks: z.ZodMiniArray<z.ZodMiniString<string>>;
|
|
290
|
+
}, z.core.$strip>;
|
|
291
|
+
export declare const servedNetworks: Endpoint<z.ZodMiniUndefined, z.ZodMiniObject<{
|
|
292
|
+
networks: z.ZodMiniArray<z.ZodMiniString<string>>;
|
|
293
|
+
}, z.core.$strip>>;
|
|
294
|
+
export declare const networksPath: string;
|
|
295
|
+
//#endregion
|
|
296
|
+
export { BITCOIN_NETWORKS, NETWORKS, type NetworkInfo, SOLANA_NETWORKS, networkById };
|
|
297
|
+
//# sourceMappingURL=gateway-contract.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { a as BITCOIN_NETWORKS, l as ESPLORA_ROUTES, m as EVM_RPC_METHODS, j as GATEWAY_ERRORS, M as INSTALL_ID_HEADER, o as NETWORKS, N as PROVIDERS_HEADER, h as RPC_BATCH_MAX, s as SOLANA_NETWORKS, g as SOLANA_RPC_METHODS, O as accepts, P as caip2, k as endpoint, u as esploraBasePath, d as esploraGet, f as esploraPathAllowed, p as esploraPost, _ as evmRpcRequest, F as gatewayError, T as health, E as healthRequest, D as healthResponse, I as installId, v as jsonRpcId, y as jsonRpcResponse, c as networkById, t as networksPath, A as parseWith, b as rpc, x as rpcPath, S as rpcRequest, C as rpcResponse, n as servedNetworks, r as servedNetworksRequest, i as servedNetworksResponse, w as solanaRpcRequest } from "./contract-D5pguqiZ.mjs";
|