@subsquid/portal-client 0.3.2 → 0.4.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/lib/client.d.ts +40 -18
- package/lib/client.d.ts.map +1 -1
- package/lib/client.js +166 -188
- package/lib/client.js.map +1 -1
- package/lib/query/common/data.d.ts +21 -0
- package/lib/query/common/data.d.ts.map +1 -0
- package/lib/query/common/data.js +3 -0
- package/lib/query/common/data.js.map +1 -0
- package/lib/query/common/query.d.ts +7 -0
- package/lib/query/common/query.d.ts.map +1 -0
- package/lib/query/common/query.js +3 -0
- package/lib/query/common/query.js.map +1 -0
- package/lib/query/evm/data.d.ts +159 -0
- package/lib/query/evm/data.d.ts.map +1 -0
- package/lib/query/evm/data.js +3 -0
- package/lib/query/evm/data.js.map +1 -0
- package/lib/query/evm/fields.d.ts +50 -0
- package/lib/query/evm/fields.d.ts.map +1 -0
- package/lib/query/evm/fields.js +3 -0
- package/lib/query/evm/fields.js.map +1 -0
- package/lib/query/evm/index.d.ts +4 -0
- package/lib/query/evm/index.d.ts.map +1 -0
- package/lib/query/evm/index.js +7 -0
- package/lib/query/evm/index.js.map +1 -0
- package/lib/query/evm/query.d.ts +54 -0
- package/lib/query/evm/query.d.ts.map +1 -0
- package/lib/query/evm/query.js +3 -0
- package/lib/query/evm/query.js.map +1 -0
- package/lib/query/evm/schema.d.ts +322 -0
- package/lib/query/evm/schema.d.ts.map +1 -0
- package/lib/query/evm/schema.js +224 -0
- package/lib/query/evm/schema.js.map +1 -0
- package/lib/query/index.d.ts +576 -8
- package/lib/query/index.d.ts.map +1 -1
- package/lib/query/index.js +15 -24
- package/lib/query/index.js.map +1 -1
- package/lib/query/solana/data.d.ts +115 -0
- package/lib/query/solana/data.d.ts.map +1 -0
- package/lib/query/solana/data.js +3 -0
- package/lib/query/solana/data.js.map +1 -0
- package/lib/query/solana/fields.d.ts +31 -0
- package/lib/query/solana/fields.d.ts.map +1 -0
- package/lib/query/solana/fields.js +3 -0
- package/lib/query/solana/fields.js.map +1 -0
- package/lib/query/solana/index.d.ts +4 -0
- package/lib/query/solana/index.d.ts.map +1 -0
- package/lib/query/solana/index.js +7 -0
- package/lib/query/solana/index.js.map +1 -0
- package/lib/query/solana/query.d.ts +74 -0
- package/lib/query/solana/query.d.ts.map +1 -0
- package/lib/query/solana/query.js +3 -0
- package/lib/query/solana/query.js.map +1 -0
- package/lib/query/solana/schema.d.ts +160 -0
- package/lib/query/solana/schema.d.ts.map +1 -0
- package/lib/query/solana/schema.js +130 -0
- package/lib/query/solana/schema.js.map +1 -0
- package/lib/query/substrate/data.d.ts +98 -0
- package/lib/query/substrate/data.d.ts.map +1 -0
- package/lib/query/substrate/data.js +3 -0
- package/lib/query/substrate/data.js.map +1 -0
- package/lib/query/substrate/fields.d.ts +22 -0
- package/lib/query/substrate/fields.d.ts.map +1 -0
- package/lib/query/substrate/fields.js +3 -0
- package/lib/query/substrate/fields.js.map +1 -0
- package/lib/query/substrate/index.d.ts +4 -0
- package/lib/query/substrate/index.d.ts.map +1 -0
- package/lib/query/substrate/index.js +7 -0
- package/lib/query/substrate/index.js.map +1 -0
- package/lib/query/substrate/query.d.ts +50 -0
- package/lib/query/substrate/query.d.ts.map +1 -0
- package/lib/query/substrate/query.js +3 -0
- package/lib/query/substrate/query.js.map +1 -0
- package/lib/query/substrate/schema.d.ts +102 -0
- package/lib/query/substrate/schema.d.ts.map +1 -0
- package/lib/query/substrate/schema.js +88 -0
- package/lib/query/substrate/schema.js.map +1 -0
- package/lib/query/type-util.d.ts +13 -0
- package/lib/query/type-util.d.ts.map +1 -0
- package/lib/query/type-util.js +3 -0
- package/lib/query/type-util.js.map +1 -0
- package/lib/query/util.d.ts +5 -0
- package/lib/query/util.d.ts.map +1 -0
- package/lib/query/util.js +23 -0
- package/lib/query/util.js.map +1 -0
- package/lib/util.d.ts +19 -0
- package/lib/util.d.ts.map +1 -0
- package/lib/util.js +57 -0
- package/lib/util.js.map +1 -0
- package/package.json +3 -3
- package/src/client.ts +231 -247
- package/src/query/common/data.ts +24 -0
- package/src/query/common/query.ts +6 -0
- package/src/query/evm/data.ts +182 -0
- package/src/query/evm/fields.ts +105 -0
- package/src/query/evm/index.ts +3 -0
- package/src/query/evm/query.ts +59 -0
- package/src/query/evm/schema.ts +277 -0
- package/src/query/index.ts +19 -36
- package/src/query/solana/data.ts +132 -0
- package/src/query/solana/fields.ts +42 -0
- package/src/query/solana/index.ts +3 -0
- package/src/query/solana/query.ts +89 -0
- package/src/query/solana/schema.ts +164 -0
- package/src/query/substrate/data.ts +101 -0
- package/src/query/substrate/fields.ts +30 -0
- package/src/query/substrate/index.ts +3 -0
- package/src/query/substrate/query.ts +60 -0
- package/src/query/substrate/schema.ts +114 -0
- package/src/query/type-util.ts +25 -0
- package/src/query/util.ts +23 -0
- package/src/util.ts +56 -0
- package/lib/query/common.d.ts +0 -56
- package/lib/query/common.d.ts.map +0 -1
- package/lib/query/common.js +0 -16
- package/lib/query/common.js.map +0 -1
- package/lib/query/evm.d.ts +0 -267
- package/lib/query/evm.d.ts.map +0 -1
- package/lib/query/evm.js +0 -245
- package/lib/query/evm.js.map +0 -1
- package/lib/query/solana.d.ts +0 -224
- package/lib/query/solana.d.ts.map +0 -1
- package/lib/query/solana.js +0 -121
- package/lib/query/solana.js.map +0 -1
- package/lib/query/substrate.d.ts +0 -173
- package/lib/query/substrate.d.ts.map +0 -1
- package/lib/query/substrate.js +0 -71
- package/lib/query/substrate.js.map +0 -1
- package/src/query/common.ts +0 -83
- package/src/query/evm.ts +0 -677
- package/src/query/solana.ts +0 -438
- package/src/query/substrate.ts +0 -288
package/lib/query/index.d.ts
CHANGED
|
@@ -1,12 +1,580 @@
|
|
|
1
|
-
import { Simplify } from './common';
|
|
2
1
|
import * as evm from './evm';
|
|
3
2
|
import * as solana from './solana';
|
|
4
3
|
import * as substrate from './substrate';
|
|
5
|
-
|
|
6
|
-
export type
|
|
7
|
-
export type
|
|
8
|
-
export
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
export { evm, solana, substrate };
|
|
5
|
+
export type GetQueryBlock<Q> = Q extends evm.Query<infer F> ? evm.Block<F> : Q extends solana.Query<infer F> ? solana.Block<F> : Q extends substrate.Query<infer F> ? substrate.Block<F> : never;
|
|
6
|
+
export type AnyQuery = evm.Query | solana.Query | substrate.Query;
|
|
7
|
+
export declare function getQuery<Q extends AnyQuery>(query: Q): readonly [Q, import("@subsquid/util-internal-validation").Validator<{
|
|
8
|
+
header: {
|
|
9
|
+
number: number;
|
|
10
|
+
hash: string;
|
|
11
|
+
parentHash: string;
|
|
12
|
+
nonce?: string | undefined;
|
|
13
|
+
sha3Uncles?: string | undefined;
|
|
14
|
+
logsBloom?: string | undefined;
|
|
15
|
+
transactionsRoot?: string | undefined;
|
|
16
|
+
stateRoot?: string | undefined;
|
|
17
|
+
receiptsRoot?: string | undefined;
|
|
18
|
+
mixHash?: string | undefined;
|
|
19
|
+
miner?: string | undefined;
|
|
20
|
+
extraData?: string | undefined;
|
|
21
|
+
size?: number | undefined;
|
|
22
|
+
gasLimit?: bigint | undefined;
|
|
23
|
+
gasUsed?: bigint | undefined;
|
|
24
|
+
timestamp?: number | undefined;
|
|
25
|
+
difficulty?: bigint | undefined;
|
|
26
|
+
totalDifficulty?: bigint | undefined;
|
|
27
|
+
baseFeePerGas?: bigint | undefined;
|
|
28
|
+
l1BlockNumber?: number | undefined;
|
|
29
|
+
};
|
|
30
|
+
transactions: {
|
|
31
|
+
transactionIndex?: number | undefined;
|
|
32
|
+
hash?: string | undefined;
|
|
33
|
+
from?: string | undefined;
|
|
34
|
+
to?: string | undefined;
|
|
35
|
+
gas?: bigint | undefined;
|
|
36
|
+
gasPrice?: bigint | undefined;
|
|
37
|
+
maxFeePerGas?: bigint | undefined;
|
|
38
|
+
maxPriorityFeePerGas?: bigint | undefined;
|
|
39
|
+
input?: string | undefined;
|
|
40
|
+
sighash?: string | undefined;
|
|
41
|
+
nonce?: number | undefined;
|
|
42
|
+
value?: bigint | undefined;
|
|
43
|
+
v?: bigint | undefined;
|
|
44
|
+
r?: string | undefined;
|
|
45
|
+
s?: string | undefined;
|
|
46
|
+
yParity?: number | undefined;
|
|
47
|
+
chainId?: number | undefined;
|
|
48
|
+
authorizationList?: {
|
|
49
|
+
chainId: number;
|
|
50
|
+
nonce: number;
|
|
51
|
+
address: string;
|
|
52
|
+
yParity: number;
|
|
53
|
+
r: string;
|
|
54
|
+
s: string;
|
|
55
|
+
}[] | undefined;
|
|
56
|
+
gasUsed?: bigint | undefined;
|
|
57
|
+
cumulativeGasUsed?: bigint | undefined;
|
|
58
|
+
effectiveGasPrice?: bigint | undefined;
|
|
59
|
+
contractAddress?: string | undefined;
|
|
60
|
+
type?: number | undefined;
|
|
61
|
+
status?: number | undefined;
|
|
62
|
+
l1Fee?: bigint | undefined;
|
|
63
|
+
l1FeeScalar?: number | undefined;
|
|
64
|
+
l1GasPrice?: bigint | undefined;
|
|
65
|
+
l1GasUsed?: bigint | undefined;
|
|
66
|
+
l1BlobBaseFee?: bigint | undefined;
|
|
67
|
+
l1BlobBaseFeeScalar?: number | undefined;
|
|
68
|
+
l1BaseFeeScalar?: number | undefined;
|
|
69
|
+
}[];
|
|
70
|
+
logs: {
|
|
71
|
+
logIndex?: number | undefined;
|
|
72
|
+
transactionIndex?: number | undefined;
|
|
73
|
+
transactionHash?: string | undefined;
|
|
74
|
+
address?: string | undefined;
|
|
75
|
+
data?: string | undefined;
|
|
76
|
+
topics?: string[] | undefined;
|
|
77
|
+
}[];
|
|
78
|
+
traces: ({
|
|
79
|
+
action?: {
|
|
80
|
+
from?: string | undefined;
|
|
81
|
+
value?: bigint | undefined;
|
|
82
|
+
gas?: bigint | undefined;
|
|
83
|
+
init?: string | undefined;
|
|
84
|
+
} | undefined;
|
|
85
|
+
result?: {
|
|
86
|
+
gasUsed?: bigint | undefined;
|
|
87
|
+
code?: string | undefined;
|
|
88
|
+
address?: string | undefined;
|
|
89
|
+
} | undefined;
|
|
90
|
+
transactionIndex?: number | undefined;
|
|
91
|
+
traceAddress?: number[] | undefined;
|
|
92
|
+
subtraces?: number | undefined;
|
|
93
|
+
error?: string | undefined;
|
|
94
|
+
revertReason?: string | undefined;
|
|
95
|
+
type: "create";
|
|
96
|
+
} | {
|
|
97
|
+
action?: {
|
|
98
|
+
callType?: string | undefined;
|
|
99
|
+
from?: string | undefined;
|
|
100
|
+
to?: string | undefined;
|
|
101
|
+
value?: bigint | undefined;
|
|
102
|
+
gas?: bigint | undefined;
|
|
103
|
+
input?: string | undefined;
|
|
104
|
+
sighash?: string | undefined;
|
|
105
|
+
} | undefined;
|
|
106
|
+
result?: {
|
|
107
|
+
gasUsed?: bigint | undefined;
|
|
108
|
+
output?: string | undefined;
|
|
109
|
+
} | undefined;
|
|
110
|
+
transactionIndex?: number | undefined;
|
|
111
|
+
traceAddress?: number[] | undefined;
|
|
112
|
+
subtraces?: number | undefined;
|
|
113
|
+
error?: string | undefined;
|
|
114
|
+
revertReason?: string | undefined;
|
|
115
|
+
type: "call";
|
|
116
|
+
} | {
|
|
117
|
+
action?: {
|
|
118
|
+
address?: string | undefined;
|
|
119
|
+
refundAddress?: string | undefined;
|
|
120
|
+
balance?: bigint | undefined;
|
|
121
|
+
} | undefined;
|
|
122
|
+
transactionIndex?: number | undefined;
|
|
123
|
+
traceAddress?: number[] | undefined;
|
|
124
|
+
subtraces?: number | undefined;
|
|
125
|
+
error?: string | undefined;
|
|
126
|
+
revertReason?: string | undefined;
|
|
127
|
+
type: "suicide";
|
|
128
|
+
} | {
|
|
129
|
+
action?: {
|
|
130
|
+
author?: string | undefined;
|
|
131
|
+
value?: bigint | undefined;
|
|
132
|
+
type?: string | undefined;
|
|
133
|
+
} | undefined;
|
|
134
|
+
transactionIndex?: number | undefined;
|
|
135
|
+
traceAddress?: number[] | undefined;
|
|
136
|
+
subtraces?: number | undefined;
|
|
137
|
+
error?: string | undefined;
|
|
138
|
+
revertReason?: string | undefined;
|
|
139
|
+
type: "reward";
|
|
140
|
+
})[];
|
|
141
|
+
stateDiffs: ({
|
|
142
|
+
transactionIndex?: number | undefined;
|
|
143
|
+
address?: string | undefined;
|
|
144
|
+
key?: string | undefined;
|
|
145
|
+
kind: "=";
|
|
146
|
+
} | {
|
|
147
|
+
next?: string | undefined;
|
|
148
|
+
transactionIndex?: number | undefined;
|
|
149
|
+
address?: string | undefined;
|
|
150
|
+
key?: string | undefined;
|
|
151
|
+
kind: "+";
|
|
152
|
+
} | {
|
|
153
|
+
prev?: string | undefined;
|
|
154
|
+
next?: string | undefined;
|
|
155
|
+
transactionIndex?: number | undefined;
|
|
156
|
+
address?: string | undefined;
|
|
157
|
+
key?: string | undefined;
|
|
158
|
+
kind: "*";
|
|
159
|
+
} | {
|
|
160
|
+
prev?: string | undefined;
|
|
161
|
+
transactionIndex?: number | undefined;
|
|
162
|
+
address?: string | undefined;
|
|
163
|
+
key?: string | undefined;
|
|
164
|
+
kind: "-";
|
|
165
|
+
})[];
|
|
166
|
+
}, {
|
|
167
|
+
header: {
|
|
168
|
+
number: number;
|
|
169
|
+
hash: string;
|
|
170
|
+
parentHash: string;
|
|
171
|
+
nonce?: string | undefined;
|
|
172
|
+
sha3Uncles?: string | undefined;
|
|
173
|
+
logsBloom?: string | undefined;
|
|
174
|
+
transactionsRoot?: string | undefined;
|
|
175
|
+
stateRoot?: string | undefined;
|
|
176
|
+
receiptsRoot?: string | undefined;
|
|
177
|
+
mixHash?: string | undefined;
|
|
178
|
+
miner?: string | undefined;
|
|
179
|
+
extraData?: string | undefined;
|
|
180
|
+
size?: number | undefined;
|
|
181
|
+
gasLimit?: string | undefined;
|
|
182
|
+
gasUsed?: string | undefined;
|
|
183
|
+
timestamp?: number | undefined;
|
|
184
|
+
difficulty?: string | undefined;
|
|
185
|
+
totalDifficulty?: string | null | undefined;
|
|
186
|
+
baseFeePerGas?: string | null | undefined;
|
|
187
|
+
l1BlockNumber?: number | null | undefined;
|
|
188
|
+
};
|
|
189
|
+
transactions?: {
|
|
190
|
+
transactionIndex?: number | undefined;
|
|
191
|
+
hash?: string | undefined;
|
|
192
|
+
from?: string | undefined;
|
|
193
|
+
to?: string | null | undefined;
|
|
194
|
+
gas?: string | undefined;
|
|
195
|
+
gasPrice?: string | null | undefined;
|
|
196
|
+
maxFeePerGas?: string | null | undefined;
|
|
197
|
+
maxPriorityFeePerGas?: string | null | undefined;
|
|
198
|
+
input?: string | undefined;
|
|
199
|
+
sighash?: string | null | undefined;
|
|
200
|
+
nonce?: number | undefined;
|
|
201
|
+
value?: string | undefined;
|
|
202
|
+
v?: string | null | undefined;
|
|
203
|
+
r?: string | null | undefined;
|
|
204
|
+
s?: string | null | undefined;
|
|
205
|
+
yParity?: number | null | undefined;
|
|
206
|
+
chainId?: number | null | undefined;
|
|
207
|
+
authorizationList?: {
|
|
208
|
+
chainId: number;
|
|
209
|
+
nonce: number;
|
|
210
|
+
address: string;
|
|
211
|
+
yParity: number;
|
|
212
|
+
r: string;
|
|
213
|
+
s: string;
|
|
214
|
+
}[] | null | undefined;
|
|
215
|
+
gasUsed?: string | undefined;
|
|
216
|
+
cumulativeGasUsed?: string | undefined;
|
|
217
|
+
effectiveGasPrice?: string | undefined;
|
|
218
|
+
contractAddress?: string | null | undefined;
|
|
219
|
+
type?: number | null | undefined;
|
|
220
|
+
status?: number | null | undefined;
|
|
221
|
+
l1Fee?: string | null | undefined;
|
|
222
|
+
l1FeeScalar?: string | null | undefined;
|
|
223
|
+
l1GasPrice?: string | null | undefined;
|
|
224
|
+
l1GasUsed?: string | null | undefined;
|
|
225
|
+
l1BlobBaseFee?: string | null | undefined;
|
|
226
|
+
l1BlobBaseFeeScalar?: number | null | undefined;
|
|
227
|
+
l1BaseFeeScalar?: number | null | undefined;
|
|
228
|
+
}[] | null | undefined;
|
|
229
|
+
logs?: {
|
|
230
|
+
logIndex?: number | undefined;
|
|
231
|
+
transactionIndex?: number | undefined;
|
|
232
|
+
transactionHash?: string | undefined;
|
|
233
|
+
address?: string | undefined;
|
|
234
|
+
data?: string | undefined;
|
|
235
|
+
topics?: string[] | undefined;
|
|
236
|
+
}[] | null | undefined;
|
|
237
|
+
traces?: ({
|
|
238
|
+
action?: {
|
|
239
|
+
from?: string | undefined;
|
|
240
|
+
value?: string | undefined;
|
|
241
|
+
gas?: string | undefined;
|
|
242
|
+
init?: string | null | undefined;
|
|
243
|
+
} | undefined;
|
|
244
|
+
result?: {
|
|
245
|
+
gasUsed?: string | undefined;
|
|
246
|
+
code?: string | null | undefined;
|
|
247
|
+
address?: string | null | undefined;
|
|
248
|
+
} | null | undefined;
|
|
249
|
+
transactionIndex?: number | undefined;
|
|
250
|
+
traceAddress?: number[] | undefined;
|
|
251
|
+
subtraces?: number | undefined;
|
|
252
|
+
error?: string | null | undefined;
|
|
253
|
+
revertReason?: string | null | undefined;
|
|
254
|
+
type: "create";
|
|
255
|
+
} | {
|
|
256
|
+
action?: {
|
|
257
|
+
callType?: string | undefined;
|
|
258
|
+
from?: string | undefined;
|
|
259
|
+
to?: string | undefined;
|
|
260
|
+
value?: string | null | undefined;
|
|
261
|
+
gas?: string | undefined;
|
|
262
|
+
input?: string | undefined;
|
|
263
|
+
sighash?: string | null | undefined;
|
|
264
|
+
} | undefined;
|
|
265
|
+
result?: {
|
|
266
|
+
gasUsed?: string | undefined;
|
|
267
|
+
output?: string | null | undefined;
|
|
268
|
+
} | null | undefined;
|
|
269
|
+
transactionIndex?: number | undefined;
|
|
270
|
+
traceAddress?: number[] | undefined;
|
|
271
|
+
subtraces?: number | undefined;
|
|
272
|
+
error?: string | null | undefined;
|
|
273
|
+
revertReason?: string | null | undefined;
|
|
274
|
+
type: "call";
|
|
275
|
+
} | {
|
|
276
|
+
action?: {
|
|
277
|
+
address?: string | undefined;
|
|
278
|
+
refundAddress?: string | undefined;
|
|
279
|
+
balance?: string | undefined;
|
|
280
|
+
} | undefined;
|
|
281
|
+
transactionIndex?: number | undefined;
|
|
282
|
+
traceAddress?: number[] | undefined;
|
|
283
|
+
subtraces?: number | undefined;
|
|
284
|
+
error?: string | null | undefined;
|
|
285
|
+
revertReason?: string | null | undefined;
|
|
286
|
+
type: "suicide";
|
|
287
|
+
} | {
|
|
288
|
+
action?: {
|
|
289
|
+
author?: string | undefined;
|
|
290
|
+
value?: string | undefined;
|
|
291
|
+
type?: string | undefined;
|
|
292
|
+
} | undefined;
|
|
293
|
+
transactionIndex?: number | undefined;
|
|
294
|
+
traceAddress?: number[] | undefined;
|
|
295
|
+
subtraces?: number | undefined;
|
|
296
|
+
error?: string | null | undefined;
|
|
297
|
+
revertReason?: string | null | undefined;
|
|
298
|
+
type: "reward";
|
|
299
|
+
})[] | null | undefined;
|
|
300
|
+
stateDiffs?: ({
|
|
301
|
+
transactionIndex?: number | undefined;
|
|
302
|
+
address?: string | undefined;
|
|
303
|
+
key?: string | undefined;
|
|
304
|
+
kind: "=";
|
|
305
|
+
} | {
|
|
306
|
+
next?: string | undefined;
|
|
307
|
+
transactionIndex?: number | undefined;
|
|
308
|
+
address?: string | undefined;
|
|
309
|
+
key?: string | undefined;
|
|
310
|
+
kind: "+";
|
|
311
|
+
} | {
|
|
312
|
+
prev?: string | undefined;
|
|
313
|
+
next?: string | undefined;
|
|
314
|
+
transactionIndex?: number | undefined;
|
|
315
|
+
address?: string | undefined;
|
|
316
|
+
key?: string | undefined;
|
|
317
|
+
kind: "*";
|
|
318
|
+
} | {
|
|
319
|
+
prev?: string | undefined;
|
|
320
|
+
transactionIndex?: number | undefined;
|
|
321
|
+
address?: string | undefined;
|
|
322
|
+
key?: string | undefined;
|
|
323
|
+
kind: "-";
|
|
324
|
+
})[] | null | undefined;
|
|
325
|
+
}>] | readonly [Q, import("@subsquid/util-internal-validation").Validator<{
|
|
326
|
+
header: {
|
|
327
|
+
number: number;
|
|
328
|
+
hash: string;
|
|
329
|
+
parentHash: string;
|
|
330
|
+
parentSlot?: number | undefined;
|
|
331
|
+
height?: number | undefined;
|
|
332
|
+
timestamp?: number | undefined;
|
|
333
|
+
};
|
|
334
|
+
transactions: {
|
|
335
|
+
transactionIndex?: number | undefined;
|
|
336
|
+
version?: number | "legacy" | undefined;
|
|
337
|
+
accountKeys?: string[] | undefined;
|
|
338
|
+
addressTableLookups?: {
|
|
339
|
+
accountKey: string;
|
|
340
|
+
readonlyIndexes: number[];
|
|
341
|
+
writableIndexes: number[];
|
|
342
|
+
}[] | undefined;
|
|
343
|
+
numReadonlySignedAccounts?: number | undefined;
|
|
344
|
+
numReadonlyUnsignedAccounts?: number | undefined;
|
|
345
|
+
numRequiredSignatures?: number | undefined;
|
|
346
|
+
recentBlockhash?: string | undefined;
|
|
347
|
+
signatures?: string[] | undefined;
|
|
348
|
+
err?: object | null | undefined;
|
|
349
|
+
computeUnitsConsumed?: bigint | undefined;
|
|
350
|
+
fee?: bigint | undefined;
|
|
351
|
+
loadedAddresses?: {
|
|
352
|
+
readonly: string[];
|
|
353
|
+
writable: string[];
|
|
354
|
+
} | undefined;
|
|
355
|
+
hasDroppedLogMessages?: boolean | undefined;
|
|
356
|
+
}[];
|
|
357
|
+
instructions: {
|
|
358
|
+
transactionIndex?: number | undefined;
|
|
359
|
+
instructionAddress?: number[] | undefined;
|
|
360
|
+
programId?: string | undefined;
|
|
361
|
+
accounts?: string[] | undefined;
|
|
362
|
+
data?: string | undefined;
|
|
363
|
+
computeUnitsConsumed?: bigint | undefined;
|
|
364
|
+
error?: string | undefined;
|
|
365
|
+
isCommitted?: boolean | undefined;
|
|
366
|
+
hasDroppedLogMessages?: boolean | undefined;
|
|
367
|
+
}[];
|
|
368
|
+
logs: {
|
|
369
|
+
transactionIndex?: number | undefined;
|
|
370
|
+
logIndex?: number | undefined;
|
|
371
|
+
instructionAddress?: number[] | undefined;
|
|
372
|
+
programId?: string | undefined;
|
|
373
|
+
kind?: "data" | "log" | "other" | undefined;
|
|
374
|
+
message?: string | undefined;
|
|
375
|
+
}[];
|
|
376
|
+
balances: {
|
|
377
|
+
transactionIndex?: number | undefined;
|
|
378
|
+
account?: string | undefined;
|
|
379
|
+
pre?: bigint | undefined;
|
|
380
|
+
post?: bigint | undefined;
|
|
381
|
+
}[];
|
|
382
|
+
tokenBalances: {
|
|
383
|
+
transactionIndex?: number | undefined;
|
|
384
|
+
account?: string | undefined;
|
|
385
|
+
preProgramId?: string | undefined;
|
|
386
|
+
postProgramId?: string | undefined;
|
|
387
|
+
preMint?: string | undefined;
|
|
388
|
+
postMint?: string | undefined;
|
|
389
|
+
preDecimals?: number | undefined;
|
|
390
|
+
postDecimals?: number | undefined;
|
|
391
|
+
preOwner?: string | undefined;
|
|
392
|
+
postOwner?: string | undefined;
|
|
393
|
+
preAmount?: bigint | undefined;
|
|
394
|
+
postAmount?: bigint | undefined;
|
|
395
|
+
}[];
|
|
396
|
+
rewards: {
|
|
397
|
+
pubkey?: string | undefined;
|
|
398
|
+
lamports?: bigint | undefined;
|
|
399
|
+
postBalance?: bigint | undefined;
|
|
400
|
+
rewardType?: string | undefined;
|
|
401
|
+
commission?: number | undefined;
|
|
402
|
+
}[];
|
|
403
|
+
}, {
|
|
404
|
+
header: {
|
|
405
|
+
number: number;
|
|
406
|
+
hash: string;
|
|
407
|
+
parentHash: string;
|
|
408
|
+
parentSlot?: number | undefined;
|
|
409
|
+
height?: number | undefined;
|
|
410
|
+
timestamp?: number | undefined;
|
|
411
|
+
};
|
|
412
|
+
transactions?: {
|
|
413
|
+
transactionIndex?: number | undefined;
|
|
414
|
+
version?: number | "legacy" | undefined;
|
|
415
|
+
accountKeys?: string[] | undefined;
|
|
416
|
+
addressTableLookups?: {
|
|
417
|
+
accountKey: string;
|
|
418
|
+
readonlyIndexes: number[];
|
|
419
|
+
writableIndexes: number[];
|
|
420
|
+
}[] | undefined;
|
|
421
|
+
numReadonlySignedAccounts?: number | undefined;
|
|
422
|
+
numReadonlyUnsignedAccounts?: number | undefined;
|
|
423
|
+
numRequiredSignatures?: number | undefined;
|
|
424
|
+
recentBlockhash?: string | undefined;
|
|
425
|
+
signatures?: string[] | undefined;
|
|
426
|
+
err?: object | null | undefined;
|
|
427
|
+
computeUnitsConsumed?: string | undefined;
|
|
428
|
+
fee?: string | undefined;
|
|
429
|
+
loadedAddresses?: {
|
|
430
|
+
readonly: string[];
|
|
431
|
+
writable: string[];
|
|
432
|
+
} | null | undefined;
|
|
433
|
+
hasDroppedLogMessages?: boolean | undefined;
|
|
434
|
+
}[] | null | undefined;
|
|
435
|
+
instructions?: {
|
|
436
|
+
transactionIndex?: number | undefined;
|
|
437
|
+
instructionAddress?: number[] | undefined;
|
|
438
|
+
programId?: string | undefined;
|
|
439
|
+
accounts?: string[] | undefined;
|
|
440
|
+
data?: string | undefined;
|
|
441
|
+
computeUnitsConsumed?: string | null | undefined;
|
|
442
|
+
error?: string | null | undefined;
|
|
443
|
+
isCommitted?: boolean | undefined;
|
|
444
|
+
hasDroppedLogMessages?: boolean | undefined;
|
|
445
|
+
}[] | null | undefined;
|
|
446
|
+
logs?: {
|
|
447
|
+
transactionIndex?: number | undefined;
|
|
448
|
+
logIndex?: number | undefined;
|
|
449
|
+
instructionAddress?: number[] | undefined;
|
|
450
|
+
programId?: string | undefined;
|
|
451
|
+
kind?: "data" | "log" | "other" | undefined;
|
|
452
|
+
message?: string | undefined;
|
|
453
|
+
}[] | null | undefined;
|
|
454
|
+
balances?: {
|
|
455
|
+
transactionIndex?: number | undefined;
|
|
456
|
+
account?: string | undefined;
|
|
457
|
+
pre?: string | undefined;
|
|
458
|
+
post?: string | undefined;
|
|
459
|
+
}[] | null | undefined;
|
|
460
|
+
tokenBalances?: {
|
|
461
|
+
transactionIndex?: number | undefined;
|
|
462
|
+
account?: string | undefined;
|
|
463
|
+
preProgramId?: string | null | undefined;
|
|
464
|
+
postProgramId?: string | null | undefined;
|
|
465
|
+
preMint?: string | null | undefined;
|
|
466
|
+
postMint?: string | null | undefined;
|
|
467
|
+
preDecimals?: number | null | undefined;
|
|
468
|
+
postDecimals?: number | null | undefined;
|
|
469
|
+
preOwner?: string | null | undefined;
|
|
470
|
+
postOwner?: string | null | undefined;
|
|
471
|
+
preAmount?: string | null | undefined;
|
|
472
|
+
postAmount?: string | null | undefined;
|
|
473
|
+
}[] | null | undefined;
|
|
474
|
+
rewards?: {
|
|
475
|
+
pubkey?: string | undefined;
|
|
476
|
+
lamports?: string | undefined;
|
|
477
|
+
postBalance?: string | undefined;
|
|
478
|
+
rewardType?: string | null | undefined;
|
|
479
|
+
commission?: number | null | undefined;
|
|
480
|
+
}[] | null | undefined;
|
|
481
|
+
}>] | readonly [Q, import("@subsquid/util-internal-validation").Validator<{
|
|
482
|
+
header: {
|
|
483
|
+
number: number;
|
|
484
|
+
hash: string;
|
|
485
|
+
parentHash?: string | undefined;
|
|
486
|
+
stateRoot?: string | undefined;
|
|
487
|
+
extrinsicsRoot?: string | undefined;
|
|
488
|
+
digest?: {
|
|
489
|
+
logs: string[];
|
|
490
|
+
} | undefined;
|
|
491
|
+
specName?: string | undefined;
|
|
492
|
+
specVersion?: number | undefined;
|
|
493
|
+
implName?: string | undefined;
|
|
494
|
+
implVersion?: number | undefined;
|
|
495
|
+
timestamp?: number | undefined;
|
|
496
|
+
validator?: string | undefined;
|
|
497
|
+
};
|
|
498
|
+
extrinsics: {
|
|
499
|
+
index?: number | undefined;
|
|
500
|
+
version?: number | undefined;
|
|
501
|
+
signature?: {
|
|
502
|
+
address: string;
|
|
503
|
+
signature: object;
|
|
504
|
+
signedExtensions: object;
|
|
505
|
+
} | undefined;
|
|
506
|
+
fee?: bigint | undefined;
|
|
507
|
+
tip?: bigint | undefined;
|
|
508
|
+
error?: any;
|
|
509
|
+
success?: boolean | undefined;
|
|
510
|
+
hash?: string | undefined;
|
|
511
|
+
}[];
|
|
512
|
+
calls: {
|
|
513
|
+
extrinsicIndex?: number | undefined;
|
|
514
|
+
address?: number[] | undefined;
|
|
515
|
+
name?: string | undefined;
|
|
516
|
+
args?: any;
|
|
517
|
+
origin?: any;
|
|
518
|
+
error?: any;
|
|
519
|
+
success?: boolean | undefined;
|
|
520
|
+
}[];
|
|
521
|
+
events: {
|
|
522
|
+
index?: number | undefined;
|
|
523
|
+
name?: string | undefined;
|
|
524
|
+
args?: any;
|
|
525
|
+
phase?: "Initialization" | "ApplyExtrinsic" | "Finalization" | undefined;
|
|
526
|
+
extrinsicIndex?: number | undefined;
|
|
527
|
+
callAddress?: number[] | undefined;
|
|
528
|
+
topics?: string[] | undefined;
|
|
529
|
+
}[];
|
|
530
|
+
}, {
|
|
531
|
+
header: {
|
|
532
|
+
number: number;
|
|
533
|
+
hash: string;
|
|
534
|
+
parentHash?: string | undefined;
|
|
535
|
+
stateRoot?: string | undefined;
|
|
536
|
+
extrinsicsRoot?: string | undefined;
|
|
537
|
+
digest?: {
|
|
538
|
+
logs: string[];
|
|
539
|
+
} | undefined;
|
|
540
|
+
specName?: string | undefined;
|
|
541
|
+
specVersion?: number | undefined;
|
|
542
|
+
implName?: string | undefined;
|
|
543
|
+
implVersion?: number | undefined;
|
|
544
|
+
timestamp?: number | null | undefined;
|
|
545
|
+
validator?: string | null | undefined;
|
|
546
|
+
};
|
|
547
|
+
extrinsics?: {
|
|
548
|
+
index?: number | undefined;
|
|
549
|
+
version?: number | undefined;
|
|
550
|
+
signature?: {
|
|
551
|
+
address: string;
|
|
552
|
+
signature: object;
|
|
553
|
+
signedExtensions: object;
|
|
554
|
+
} | null | undefined;
|
|
555
|
+
fee?: string | null | undefined;
|
|
556
|
+
tip?: string | null | undefined;
|
|
557
|
+
error?: any;
|
|
558
|
+
success?: boolean | null | undefined;
|
|
559
|
+
hash?: string | null | undefined;
|
|
560
|
+
}[] | null | undefined;
|
|
561
|
+
calls?: {
|
|
562
|
+
extrinsicIndex?: number | undefined;
|
|
563
|
+
address?: number[] | undefined;
|
|
564
|
+
name?: string | undefined;
|
|
565
|
+
args?: any;
|
|
566
|
+
origin?: any;
|
|
567
|
+
error?: any;
|
|
568
|
+
success?: boolean | null | undefined;
|
|
569
|
+
}[] | null | undefined;
|
|
570
|
+
events?: {
|
|
571
|
+
index?: number | undefined;
|
|
572
|
+
name?: string | undefined;
|
|
573
|
+
args?: any;
|
|
574
|
+
phase?: "Initialization" | "ApplyExtrinsic" | "Finalization" | undefined;
|
|
575
|
+
extrinsicIndex?: number | null | undefined;
|
|
576
|
+
callAddress?: number[] | null | undefined;
|
|
577
|
+
topics?: string[] | undefined;
|
|
578
|
+
}[] | null | undefined;
|
|
579
|
+
}>];
|
|
12
580
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/query/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/query/index.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/query/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,GAAG,MAAM,OAAO,CAAA;AAC5B,OAAO,KAAK,MAAM,MAAM,UAAU,CAAA;AAClC,OAAO,KAAK,SAAS,MAAM,aAAa,CAAA;AAExC,OAAO,EAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAC,CAAA;AAE/B,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI,CAAC,SAAS,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,GACrD,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,GACZ,CAAC,SAAS,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,GAC/B,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,GACf,CAAC,SAAS,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,GAClC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,GAClB,KAAK,CAAA;AAEX,MAAM,MAAM,QAAQ,GAAG,GAAG,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,GAAG,SAAS,CAAC,KAAK,CAAA;AAEjE,wBAAgB,QAAQ,CAAC,CAAC,SAAS,QAAQ,EAAE,KAAK,EAAE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAepD"}
|
package/lib/query/index.js
CHANGED
|
@@ -23,38 +23,29 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.
|
|
27
|
-
exports.
|
|
26
|
+
exports.substrate = exports.solana = exports.evm = void 0;
|
|
27
|
+
exports.getQuery = getQuery;
|
|
28
28
|
const util_internal_1 = require("@subsquid/util-internal");
|
|
29
29
|
const evm = __importStar(require("./evm"));
|
|
30
|
+
exports.evm = evm;
|
|
30
31
|
const solana = __importStar(require("./solana"));
|
|
32
|
+
exports.solana = solana;
|
|
31
33
|
const substrate = __importStar(require("./substrate"));
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
type: query.type,
|
|
36
|
-
fields: query.fields,
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
const BLOCK_SCHEMAS = new WeakMap();
|
|
40
|
-
function getBlockSchema(query) {
|
|
41
|
-
let schema = BLOCK_SCHEMAS.get(query);
|
|
42
|
-
if (schema)
|
|
43
|
-
return schema;
|
|
34
|
+
exports.substrate = substrate;
|
|
35
|
+
function getQuery(query) {
|
|
36
|
+
query = { ...query };
|
|
44
37
|
switch (query.type) {
|
|
45
|
-
case 'solana':
|
|
46
|
-
schema = solana.getBlockSchema(query.fields);
|
|
47
|
-
break;
|
|
48
38
|
case 'evm':
|
|
49
|
-
|
|
50
|
-
|
|
39
|
+
query.fields = evm.patchQueryFields(query.fields ?? {});
|
|
40
|
+
return [query, evm.getBlockSchema(query.fields)];
|
|
41
|
+
case 'solana':
|
|
42
|
+
query.fields = solana.patchQueryFields(query.fields ?? {});
|
|
43
|
+
return [query, solana.getBlockSchema(query.fields)];
|
|
51
44
|
case 'substrate':
|
|
52
|
-
|
|
53
|
-
|
|
45
|
+
query.fields = substrate.patchQueryFields(query.fields ?? {});
|
|
46
|
+
return [query, substrate.getBlockSchema(query.fields)];
|
|
54
47
|
default:
|
|
55
|
-
throw (0, util_internal_1.unexpectedCase)(query
|
|
48
|
+
throw (0, util_internal_1.unexpectedCase)(query.type);
|
|
56
49
|
}
|
|
57
|
-
BLOCK_SCHEMAS.set(query, schema);
|
|
58
|
-
return schema;
|
|
59
50
|
}
|
|
60
51
|
//# sourceMappingURL=index.js.map
|
package/lib/query/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/query/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/query/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,4BAeC;AAhCD,2DAAsD;AACtD,2CAA4B;AAIpB,kBAAG;AAHX,iDAAkC;AAGrB,wBAAM;AAFnB,uDAAwC;AAEnB,8BAAS;AAY9B,SAAgB,QAAQ,CAAqB,KAAQ;IACjD,KAAK,GAAG,EAAC,GAAG,KAAK,EAAC,CAAA;IAClB,QAAQ,KAAK,CAAC,IAAI,EAAE,CAAC;QACjB,KAAK,KAAK;YACN,KAAK,CAAC,MAAM,GAAG,GAAG,CAAC,gBAAgB,CAAC,KAAK,CAAC,MAAM,IAAI,EAAE,CAAC,CAAA;YACvD,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,cAAc,CAAC,KAAK,CAAC,MAAM,CAAC,CAAU,CAAA;QAC7D,KAAK,QAAQ;YACT,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,gBAAgB,CAAC,KAAK,CAAC,MAAM,IAAI,EAAE,CAAC,CAAA;YAC1D,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,MAAM,CAAC,CAAU,CAAA;QAChE,KAAK,WAAW;YACZ,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC,gBAAgB,CAAC,KAAK,CAAC,MAAM,IAAI,EAAE,CAAC,CAAA;YAC7D,OAAO,CAAC,KAAK,EAAE,SAAS,CAAC,cAAc,CAAC,KAAK,CAAC,MAAM,CAAC,CAAU,CAAA;QACnE;YACI,MAAM,IAAA,8BAAc,EAAE,KAAa,CAAC,IAAI,CAAC,CAAA;IACjD,CAAC;AACL,CAAC"}
|