@solana/rpc-graphql 2.0.0-experimental.eb5fd16 → 2.0.0-experimental.fc4e943
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 +1 -1
- package/dist/index.browser.cjs +2128 -3
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.js +2129 -4
- package/dist/index.browser.js.map +1 -1
- package/dist/index.native.js +2129 -4
- package/dist/index.native.js.map +1 -1
- package/dist/index.node.cjs +2128 -3
- package/dist/index.node.cjs.map +1 -1
- package/dist/index.node.js +2129 -4
- package/dist/index.node.js.map +1 -1
- package/dist/types/context.d.ts +13 -0
- package/dist/types/schema/account/index.d.ts +3 -0
- package/dist/types/schema/account/query.d.ts +38 -0
- package/dist/types/schema/account/types.d.ts +5 -0
- package/dist/types/schema/block/index.d.ts +3 -0
- package/dist/types/schema/block/query.d.ts +42 -0
- package/dist/types/schema/block/types.d.ts +7 -0
- package/dist/types/schema/inputs.d.ts +9 -0
- package/dist/types/schema/picks.d.ts +36 -0
- package/dist/types/schema/program-accounts/index.d.ts +2 -0
- package/dist/types/schema/program-accounts/query.d.ts +47 -0
- package/dist/types/schema/program-accounts/types.d.ts +3 -0
- package/dist/types/schema/scalars.d.ts +3 -0
- package/dist/types/schema/transaction/index.d.ts +3 -0
- package/dist/types/schema/transaction/query.d.ts +33 -0
- package/dist/types/schema/transaction/types.d.ts +12 -0
- package/package.json +8 -7
package/dist/index.native.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GraphQLSchema, GraphQLObjectType, graphql } from 'graphql';
|
|
1
|
+
import { GraphQLSchema, GraphQLObjectType, graphql, GraphQLList, GraphQLBoolean, GraphQLString, GraphQLNonNull, GraphQLEnumType, GraphQLInputObjectType, GraphQLInterfaceType, GraphQLScalarType, Kind, GraphQLInt, GraphQLUnionType } from 'graphql';
|
|
2
2
|
|
|
3
3
|
// src/rpc.ts
|
|
4
4
|
|
|
@@ -34,10 +34,2132 @@ function createGraphQLCache() {
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
// src/context.ts
|
|
37
|
+
async function resolveAccount({ address, encoding = "jsonParsed", ...config }, cache, rpc) {
|
|
38
|
+
const requestConfig = { encoding, ...config };
|
|
39
|
+
const cached = cache.get(address, requestConfig);
|
|
40
|
+
if (cached !== null) {
|
|
41
|
+
return cached;
|
|
42
|
+
}
|
|
43
|
+
const account = await rpc.getAccountInfo(address, requestConfig).send().then((res) => res.value).catch((e) => {
|
|
44
|
+
throw e;
|
|
45
|
+
});
|
|
46
|
+
if (account === null) {
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
const [data, responseEncoding] = Array.isArray(account.data) ? encoding === "jsonParsed" ? [account.data[0], "base64"] : [account.data[0], encoding] : [account.data, "jsonParsed"];
|
|
50
|
+
const queryResponse = {
|
|
51
|
+
...account,
|
|
52
|
+
data,
|
|
53
|
+
encoding: responseEncoding
|
|
54
|
+
};
|
|
55
|
+
cache.insert(address, requestConfig, queryResponse);
|
|
56
|
+
return queryResponse;
|
|
57
|
+
}
|
|
58
|
+
async function resolveBlock({ slot, encoding = "jsonParsed", ...config }, cache, rpc) {
|
|
59
|
+
const requestConfig = { encoding, ...config };
|
|
60
|
+
const cached = cache.get(slot, config);
|
|
61
|
+
if (cached !== null) {
|
|
62
|
+
return cached;
|
|
63
|
+
}
|
|
64
|
+
const block = await rpc.getBlock(slot, requestConfig).send();
|
|
65
|
+
if (block === null) {
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
cache.insert(slot, config, block);
|
|
69
|
+
return block;
|
|
70
|
+
}
|
|
71
|
+
async function resolveProgramAccounts({ programAddress, encoding = "jsonParsed", ...config }, cache, rpc) {
|
|
72
|
+
const requestConfig = { encoding, ...config };
|
|
73
|
+
const cached = cache.get(programAddress, requestConfig);
|
|
74
|
+
if (cached !== null) {
|
|
75
|
+
return cached;
|
|
76
|
+
}
|
|
77
|
+
const programAccounts = await rpc.getProgramAccounts(programAddress, requestConfig).send().then((res) => {
|
|
78
|
+
if ("value" in res) {
|
|
79
|
+
return res.value;
|
|
80
|
+
}
|
|
81
|
+
return res;
|
|
82
|
+
}).catch((e) => {
|
|
83
|
+
throw e;
|
|
84
|
+
});
|
|
85
|
+
const queryResponse = programAccounts.map((programAccount2) => {
|
|
86
|
+
const [data, responseEncoding] = Array.isArray(programAccount2.account.data) ? encoding === "jsonParsed" ? [programAccount2.account.data[0], "base64"] : [programAccount2.account.data[0], encoding] : [programAccount2.account.data, "jsonParsed"];
|
|
87
|
+
const pubkey = programAccount2.pubkey;
|
|
88
|
+
const account = { ...programAccount2.account, data, encoding: responseEncoding };
|
|
89
|
+
return {
|
|
90
|
+
account,
|
|
91
|
+
pubkey
|
|
92
|
+
};
|
|
93
|
+
});
|
|
94
|
+
cache.insert(programAddress, requestConfig, queryResponse);
|
|
95
|
+
return queryResponse;
|
|
96
|
+
}
|
|
97
|
+
async function resolveTransaction({ signature, encoding = "jsonParsed", ...config }, cache, rpc) {
|
|
98
|
+
const requestConfig = { encoding, ...config };
|
|
99
|
+
const cached = cache.get(signature, requestConfig);
|
|
100
|
+
if (cached !== null) {
|
|
101
|
+
return cached;
|
|
102
|
+
}
|
|
103
|
+
const transaction = await rpc.getTransaction(signature, requestConfig).send();
|
|
104
|
+
if (transaction === null) {
|
|
105
|
+
return null;
|
|
106
|
+
}
|
|
107
|
+
const [transactionData, responseEncoding, responseFormat] = Array.isArray(transaction.transaction) ? encoding === "jsonParsed" ? [transaction.transaction[0], "base64", "unparsed"] : [transaction.transaction[0], encoding, "unparsed"] : encoding === "jsonParsed" ? [transaction.transaction, encoding, "parsed"] : [transaction.transaction, encoding, "unparsed"];
|
|
108
|
+
if (transaction.meta) {
|
|
109
|
+
transaction.meta["format"] = responseFormat;
|
|
110
|
+
}
|
|
111
|
+
if (transactionData.message) {
|
|
112
|
+
transactionData.message["format"] = responseFormat;
|
|
113
|
+
}
|
|
114
|
+
const queryResponse = {
|
|
115
|
+
...transaction,
|
|
116
|
+
encoding: responseEncoding,
|
|
117
|
+
transaction: transactionData
|
|
118
|
+
};
|
|
119
|
+
cache.insert(signature, requestConfig, queryResponse);
|
|
120
|
+
return queryResponse;
|
|
121
|
+
}
|
|
37
122
|
function createSolanaGraphQLContext(rpc) {
|
|
38
123
|
const cache = createGraphQLCache();
|
|
39
|
-
return {
|
|
124
|
+
return {
|
|
125
|
+
cache,
|
|
126
|
+
resolveAccount(args) {
|
|
127
|
+
return resolveAccount(args, this.cache, this.rpc);
|
|
128
|
+
},
|
|
129
|
+
resolveBlock(args) {
|
|
130
|
+
return resolveBlock(args, this.cache, this.rpc);
|
|
131
|
+
},
|
|
132
|
+
resolveProgramAccounts(args) {
|
|
133
|
+
return resolveProgramAccounts(args, this.cache, this.rpc);
|
|
134
|
+
},
|
|
135
|
+
resolveTransaction(args) {
|
|
136
|
+
return resolveTransaction(args, this.cache, this.rpc);
|
|
137
|
+
},
|
|
138
|
+
rpc
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
var BigIntScalar = () => new GraphQLScalarType({
|
|
142
|
+
name: "BigInt",
|
|
143
|
+
parseLiteral(ast) {
|
|
144
|
+
if (ast.kind === Kind.STRING) {
|
|
145
|
+
return BigInt(ast.value);
|
|
146
|
+
}
|
|
147
|
+
return null;
|
|
148
|
+
},
|
|
149
|
+
parseValue(value) {
|
|
150
|
+
return BigInt(value);
|
|
151
|
+
},
|
|
152
|
+
serialize(value) {
|
|
153
|
+
return BigInt(value);
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
// src/schema/picks.ts
|
|
158
|
+
function boolean() {
|
|
159
|
+
return { type: GraphQLBoolean };
|
|
160
|
+
}
|
|
161
|
+
var memoisedBigint;
|
|
162
|
+
function bigint() {
|
|
163
|
+
if (!memoisedBigint)
|
|
164
|
+
memoisedBigint = { type: BigIntScalar() };
|
|
165
|
+
return memoisedBigint;
|
|
166
|
+
}
|
|
167
|
+
function number() {
|
|
168
|
+
return { type: GraphQLInt };
|
|
40
169
|
}
|
|
170
|
+
function string() {
|
|
171
|
+
return { type: GraphQLString };
|
|
172
|
+
}
|
|
173
|
+
function type(fieldType) {
|
|
174
|
+
return {
|
|
175
|
+
type: fieldType
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
function nonNull(fieldType) {
|
|
179
|
+
return {
|
|
180
|
+
type: new GraphQLNonNull(fieldType.type)
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
function list(elementType) {
|
|
184
|
+
return {
|
|
185
|
+
type: new GraphQLList(elementType.type)
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
function object(name, fields) {
|
|
189
|
+
return {
|
|
190
|
+
type: new GraphQLObjectType({
|
|
191
|
+
fields,
|
|
192
|
+
name
|
|
193
|
+
})
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
// src/schema/inputs.ts
|
|
198
|
+
var memoisedAccountEncodingInputType;
|
|
199
|
+
var accountEncodingInputType = () => {
|
|
200
|
+
if (!memoisedAccountEncodingInputType)
|
|
201
|
+
memoisedAccountEncodingInputType = new GraphQLEnumType({
|
|
202
|
+
name: "AccountEncoding",
|
|
203
|
+
values: {
|
|
204
|
+
base58: {
|
|
205
|
+
value: "base58"
|
|
206
|
+
},
|
|
207
|
+
base64: {
|
|
208
|
+
value: "base64"
|
|
209
|
+
},
|
|
210
|
+
base64Zstd: {
|
|
211
|
+
value: "base64+zstd"
|
|
212
|
+
},
|
|
213
|
+
jsonParsed: {
|
|
214
|
+
value: "jsonParsed"
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
});
|
|
218
|
+
return memoisedAccountEncodingInputType;
|
|
219
|
+
};
|
|
220
|
+
var memoisedBlockTransactionDetailsInputType;
|
|
221
|
+
var blockTransactionDetailsInputType = () => {
|
|
222
|
+
if (!memoisedBlockTransactionDetailsInputType)
|
|
223
|
+
memoisedBlockTransactionDetailsInputType = new GraphQLEnumType({
|
|
224
|
+
name: "BlockTransactionDetails",
|
|
225
|
+
values: {
|
|
226
|
+
accounts: {
|
|
227
|
+
value: "accounts"
|
|
228
|
+
},
|
|
229
|
+
full: {
|
|
230
|
+
value: "full"
|
|
231
|
+
},
|
|
232
|
+
none: {
|
|
233
|
+
value: "none"
|
|
234
|
+
},
|
|
235
|
+
signatures: {
|
|
236
|
+
value: "signatures"
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
});
|
|
240
|
+
return memoisedBlockTransactionDetailsInputType;
|
|
241
|
+
};
|
|
242
|
+
var memoisedCommitmentInputType;
|
|
243
|
+
var commitmentInputType = () => {
|
|
244
|
+
if (!memoisedCommitmentInputType)
|
|
245
|
+
memoisedCommitmentInputType = new GraphQLEnumType({
|
|
246
|
+
name: "Commitment",
|
|
247
|
+
values: {
|
|
248
|
+
confirmed: {
|
|
249
|
+
value: "confirmed"
|
|
250
|
+
},
|
|
251
|
+
finalized: {
|
|
252
|
+
value: "finalized"
|
|
253
|
+
},
|
|
254
|
+
processed: {
|
|
255
|
+
value: "processed"
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
});
|
|
259
|
+
return memoisedCommitmentInputType;
|
|
260
|
+
};
|
|
261
|
+
var memoisedDataSliceInputType;
|
|
262
|
+
var dataSliceInputType = () => {
|
|
263
|
+
if (!memoisedDataSliceInputType)
|
|
264
|
+
memoisedDataSliceInputType = new GraphQLInputObjectType({
|
|
265
|
+
fields: {
|
|
266
|
+
length: number(),
|
|
267
|
+
offset: number()
|
|
268
|
+
},
|
|
269
|
+
name: "DataSliceConfig"
|
|
270
|
+
});
|
|
271
|
+
return memoisedDataSliceInputType;
|
|
272
|
+
};
|
|
273
|
+
var memoisedMaxSupportedTransactionVersionInputType;
|
|
274
|
+
var maxSupportedTransactionVersionInputType = () => {
|
|
275
|
+
if (!memoisedMaxSupportedTransactionVersionInputType)
|
|
276
|
+
memoisedMaxSupportedTransactionVersionInputType = new GraphQLEnumType({
|
|
277
|
+
name: "MaxSupportedTransactionVersion",
|
|
278
|
+
values: {
|
|
279
|
+
legacy: {
|
|
280
|
+
value: "legacy"
|
|
281
|
+
},
|
|
282
|
+
zero: {
|
|
283
|
+
value: "0"
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
});
|
|
287
|
+
return memoisedMaxSupportedTransactionVersionInputType;
|
|
288
|
+
};
|
|
289
|
+
var memoisedProgramAccountFilterInputType;
|
|
290
|
+
var programAccountFilterInputType = () => {
|
|
291
|
+
if (!memoisedProgramAccountFilterInputType)
|
|
292
|
+
memoisedProgramAccountFilterInputType = new GraphQLInputObjectType({
|
|
293
|
+
fields: {
|
|
294
|
+
bytes: bigint(),
|
|
295
|
+
dataSize: bigint(),
|
|
296
|
+
encoding: string(),
|
|
297
|
+
offset: bigint()
|
|
298
|
+
},
|
|
299
|
+
name: "ProgramAccountFilter"
|
|
300
|
+
});
|
|
301
|
+
return memoisedProgramAccountFilterInputType;
|
|
302
|
+
};
|
|
303
|
+
var memoisedTransactionEncodingInputType;
|
|
304
|
+
var transactionEncodingInputType = () => {
|
|
305
|
+
if (!memoisedTransactionEncodingInputType)
|
|
306
|
+
memoisedTransactionEncodingInputType = new GraphQLEnumType({
|
|
307
|
+
name: "TransactionEncoding",
|
|
308
|
+
values: {
|
|
309
|
+
base58: {
|
|
310
|
+
value: "base58"
|
|
311
|
+
},
|
|
312
|
+
base64: {
|
|
313
|
+
value: "base64"
|
|
314
|
+
},
|
|
315
|
+
json: {
|
|
316
|
+
value: "json"
|
|
317
|
+
},
|
|
318
|
+
jsonParsed: {
|
|
319
|
+
value: "jsonParsed"
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
});
|
|
323
|
+
return memoisedTransactionEncodingInputType;
|
|
324
|
+
};
|
|
325
|
+
var memoisedTokenAmountType;
|
|
326
|
+
var tokenAmountType = () => {
|
|
327
|
+
if (!memoisedTokenAmountType) {
|
|
328
|
+
memoisedTokenAmountType = new GraphQLObjectType({
|
|
329
|
+
fields: {
|
|
330
|
+
amount: string(),
|
|
331
|
+
decimals: number(),
|
|
332
|
+
uiAmount: bigint(),
|
|
333
|
+
uiAmountString: string()
|
|
334
|
+
},
|
|
335
|
+
name: "TokenAmount"
|
|
336
|
+
});
|
|
337
|
+
}
|
|
338
|
+
return memoisedTokenAmountType;
|
|
339
|
+
};
|
|
340
|
+
var memoisedAccountInterfaceFields;
|
|
341
|
+
var accountInterfaceFields = () => {
|
|
342
|
+
if (!memoisedAccountInterfaceFields) {
|
|
343
|
+
memoisedAccountInterfaceFields = {
|
|
344
|
+
encoding: string(),
|
|
345
|
+
executable: boolean(),
|
|
346
|
+
lamports: bigint(),
|
|
347
|
+
rentEpoch: bigint()
|
|
348
|
+
};
|
|
349
|
+
}
|
|
350
|
+
return memoisedAccountInterfaceFields;
|
|
351
|
+
};
|
|
352
|
+
var memoisedAccountInterface;
|
|
353
|
+
var accountInterface = () => {
|
|
354
|
+
if (!memoisedAccountInterface) {
|
|
355
|
+
memoisedAccountInterface = new GraphQLInterfaceType({
|
|
356
|
+
description: "A Solana account",
|
|
357
|
+
fields: () => ({
|
|
358
|
+
...accountInterfaceFields(),
|
|
359
|
+
owner: type(accountInterface())
|
|
360
|
+
}),
|
|
361
|
+
name: "Account",
|
|
362
|
+
resolveType(account) {
|
|
363
|
+
if (account.encoding === "base58") {
|
|
364
|
+
return "AccountBase58";
|
|
365
|
+
}
|
|
366
|
+
if (account.encoding === "base64") {
|
|
367
|
+
return "AccountBase64";
|
|
368
|
+
}
|
|
369
|
+
if (account.encoding === "base64+zstd") {
|
|
370
|
+
return "AccountBase64Zstd";
|
|
371
|
+
}
|
|
372
|
+
if (account.encoding === "jsonParsed") {
|
|
373
|
+
if (account.data.parsed.type === "mint" && account.data.program === "spl-token") {
|
|
374
|
+
return "MintAccount";
|
|
375
|
+
}
|
|
376
|
+
if (account.data.parsed.type === "account" && account.data.program === "spl-token") {
|
|
377
|
+
return "TokenAccount";
|
|
378
|
+
}
|
|
379
|
+
if (account.data.program === "nonce") {
|
|
380
|
+
return "NonceAccount";
|
|
381
|
+
}
|
|
382
|
+
if (account.data.program === "stake") {
|
|
383
|
+
return "StakeAccount";
|
|
384
|
+
}
|
|
385
|
+
if (account.data.parsed.type === "vote" && account.data.program === "vote") {
|
|
386
|
+
return "VoteAccount";
|
|
387
|
+
}
|
|
388
|
+
if (account.data.parsed.type === "lookupTable" && account.data.program === "address-lookup-table") {
|
|
389
|
+
return "LookupTableAccount";
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
return "AccountBase64";
|
|
393
|
+
}
|
|
394
|
+
});
|
|
395
|
+
}
|
|
396
|
+
return memoisedAccountInterface;
|
|
397
|
+
};
|
|
398
|
+
var accountType = (name, description, data) => new GraphQLObjectType({
|
|
399
|
+
description,
|
|
400
|
+
fields: {
|
|
401
|
+
...accountInterfaceFields(),
|
|
402
|
+
data,
|
|
403
|
+
owner: {
|
|
404
|
+
args: {
|
|
405
|
+
commitment: type(commitmentInputType()),
|
|
406
|
+
dataSlice: type(dataSliceInputType()),
|
|
407
|
+
encoding: type(accountEncodingInputType()),
|
|
408
|
+
minContextSlot: bigint()
|
|
409
|
+
},
|
|
410
|
+
resolve: (parent, args, context) => context.resolveAccount({ ...args, address: parent.owner }),
|
|
411
|
+
type: accountInterface()
|
|
412
|
+
}
|
|
413
|
+
},
|
|
414
|
+
interfaces: [accountInterface()],
|
|
415
|
+
name
|
|
416
|
+
});
|
|
417
|
+
var accountDataJsonParsed = (name, parsedInfoFields) => object(name + "Data", {
|
|
418
|
+
parsed: object(name + "DataParsed", {
|
|
419
|
+
info: object(name + "DataParsedInfo", parsedInfoFields),
|
|
420
|
+
type: string()
|
|
421
|
+
}),
|
|
422
|
+
program: string(),
|
|
423
|
+
space: bigint()
|
|
424
|
+
});
|
|
425
|
+
var memoisedAccountBase58;
|
|
426
|
+
var accountBase58 = () => {
|
|
427
|
+
if (!memoisedAccountBase58)
|
|
428
|
+
memoisedAccountBase58 = accountType("AccountBase58", "A Solana account with base58 encoded data", string());
|
|
429
|
+
return memoisedAccountBase58;
|
|
430
|
+
};
|
|
431
|
+
var memoisedAccountBase64;
|
|
432
|
+
var accountBase64 = () => {
|
|
433
|
+
if (!memoisedAccountBase64)
|
|
434
|
+
memoisedAccountBase64 = accountType("AccountBase64", "A Solana account with base64 encoded data", string());
|
|
435
|
+
return memoisedAccountBase64;
|
|
436
|
+
};
|
|
437
|
+
var memoisedAccountBase64Zstd;
|
|
438
|
+
var accountBase64Zstd = () => {
|
|
439
|
+
if (!memoisedAccountBase64Zstd)
|
|
440
|
+
memoisedAccountBase64Zstd = accountType(
|
|
441
|
+
"AccountBase64Zstd",
|
|
442
|
+
"A Solana account with base64 encoded data compressed with zstd",
|
|
443
|
+
string()
|
|
444
|
+
);
|
|
445
|
+
return memoisedAccountBase64Zstd;
|
|
446
|
+
};
|
|
447
|
+
var memoisedAccountNonceAccount;
|
|
448
|
+
var accountNonceAccount = () => {
|
|
449
|
+
if (!memoisedAccountNonceAccount)
|
|
450
|
+
memoisedAccountNonceAccount = accountType(
|
|
451
|
+
"NonceAccount",
|
|
452
|
+
"A nonce account",
|
|
453
|
+
accountDataJsonParsed("Nonce", {
|
|
454
|
+
authority: string(),
|
|
455
|
+
blockhash: string(),
|
|
456
|
+
feeCalculator: object("NonceFeeCalculator", {
|
|
457
|
+
lamportsPerSignature: string()
|
|
458
|
+
})
|
|
459
|
+
})
|
|
460
|
+
);
|
|
461
|
+
return memoisedAccountNonceAccount;
|
|
462
|
+
};
|
|
463
|
+
var memoisedAccountLookupTable;
|
|
464
|
+
var accountLookupTable = () => {
|
|
465
|
+
if (!memoisedAccountLookupTable)
|
|
466
|
+
memoisedAccountLookupTable = accountType(
|
|
467
|
+
"LookupTableAccount",
|
|
468
|
+
"An address lookup table account",
|
|
469
|
+
accountDataJsonParsed("LookupTable", {
|
|
470
|
+
addresses: list(string()),
|
|
471
|
+
authority: string(),
|
|
472
|
+
deactivationSlot: string(),
|
|
473
|
+
lastExtendedSlot: string(),
|
|
474
|
+
lastExtendedSlotStartIndex: number()
|
|
475
|
+
})
|
|
476
|
+
);
|
|
477
|
+
return memoisedAccountLookupTable;
|
|
478
|
+
};
|
|
479
|
+
var memoisedAccountMint;
|
|
480
|
+
var accountMint = () => {
|
|
481
|
+
if (!memoisedAccountMint)
|
|
482
|
+
memoisedAccountMint = accountType(
|
|
483
|
+
"MintAccount",
|
|
484
|
+
"An SPL mint",
|
|
485
|
+
accountDataJsonParsed("Mint", {
|
|
486
|
+
decimals: number(),
|
|
487
|
+
freezeAuthority: string(),
|
|
488
|
+
isInitialized: boolean(),
|
|
489
|
+
mintAuthority: string(),
|
|
490
|
+
supply: string()
|
|
491
|
+
})
|
|
492
|
+
);
|
|
493
|
+
return memoisedAccountMint;
|
|
494
|
+
};
|
|
495
|
+
var memoisedAccountTokenAccount;
|
|
496
|
+
var accountTokenAccount = () => {
|
|
497
|
+
if (!memoisedAccountTokenAccount)
|
|
498
|
+
memoisedAccountTokenAccount = accountType(
|
|
499
|
+
"TokenAccount",
|
|
500
|
+
"An SPL token account",
|
|
501
|
+
accountDataJsonParsed("TokenAccount", {
|
|
502
|
+
isNative: boolean(),
|
|
503
|
+
mint: string(),
|
|
504
|
+
owner: string(),
|
|
505
|
+
state: string(),
|
|
506
|
+
tokenAmount: type(tokenAmountType())
|
|
507
|
+
})
|
|
508
|
+
);
|
|
509
|
+
return memoisedAccountTokenAccount;
|
|
510
|
+
};
|
|
511
|
+
var memoisedAccountStakeAccount;
|
|
512
|
+
var accountStakeAccount = () => {
|
|
513
|
+
if (!memoisedAccountStakeAccount)
|
|
514
|
+
memoisedAccountStakeAccount = accountType(
|
|
515
|
+
"StakeAccount",
|
|
516
|
+
"A stake account",
|
|
517
|
+
accountDataJsonParsed("Stake", {
|
|
518
|
+
meta: object("StakeMeta", {
|
|
519
|
+
authorized: object("StakeMetaAuthorized", {
|
|
520
|
+
staker: string(),
|
|
521
|
+
withdrawer: string()
|
|
522
|
+
}),
|
|
523
|
+
lockup: object("StakeMetaLockup", {
|
|
524
|
+
custodian: string(),
|
|
525
|
+
epoch: bigint(),
|
|
526
|
+
unixTimestamp: bigint()
|
|
527
|
+
}),
|
|
528
|
+
rentExemptReserve: string()
|
|
529
|
+
}),
|
|
530
|
+
stake: object("StakeStake", {
|
|
531
|
+
creditsObserved: bigint(),
|
|
532
|
+
delegation: object("StakeStakeDelegation", {
|
|
533
|
+
activationEpoch: bigint(),
|
|
534
|
+
deactivationEpoch: bigint(),
|
|
535
|
+
stake: string(),
|
|
536
|
+
voter: string(),
|
|
537
|
+
warmupCooldownRate: number()
|
|
538
|
+
})
|
|
539
|
+
})
|
|
540
|
+
})
|
|
541
|
+
);
|
|
542
|
+
return memoisedAccountStakeAccount;
|
|
543
|
+
};
|
|
544
|
+
var memoisedAccountVoteAccount;
|
|
545
|
+
var accountVoteAccount = () => {
|
|
546
|
+
if (!memoisedAccountVoteAccount)
|
|
547
|
+
memoisedAccountVoteAccount = accountType(
|
|
548
|
+
"VoteAccount",
|
|
549
|
+
"A vote account",
|
|
550
|
+
accountDataJsonParsed("Vote", {
|
|
551
|
+
authorizedVoters: list(
|
|
552
|
+
object("VoteAuthorizedVoter", {
|
|
553
|
+
authorizedVoter: string(),
|
|
554
|
+
epoch: bigint()
|
|
555
|
+
})
|
|
556
|
+
),
|
|
557
|
+
authorizedWithdrawer: string(),
|
|
558
|
+
commission: number(),
|
|
559
|
+
epochCredits: list(
|
|
560
|
+
object("VoteEpochCredits", {
|
|
561
|
+
credits: string(),
|
|
562
|
+
epoch: bigint(),
|
|
563
|
+
previousCredits: string()
|
|
564
|
+
})
|
|
565
|
+
),
|
|
566
|
+
lastTimestamp: object("VoteLastTimestamp", {
|
|
567
|
+
slot: bigint(),
|
|
568
|
+
timestamp: bigint()
|
|
569
|
+
}),
|
|
570
|
+
nodePubkey: string(),
|
|
571
|
+
priorVoters: list(string()),
|
|
572
|
+
rootSlot: bigint(),
|
|
573
|
+
votes: list(
|
|
574
|
+
object("VoteVote", {
|
|
575
|
+
confirmationCount: number(),
|
|
576
|
+
slot: bigint()
|
|
577
|
+
})
|
|
578
|
+
)
|
|
579
|
+
})
|
|
580
|
+
);
|
|
581
|
+
return memoisedAccountVoteAccount;
|
|
582
|
+
};
|
|
583
|
+
var memoisedAccountTypes;
|
|
584
|
+
var accountTypes = () => {
|
|
585
|
+
if (!memoisedAccountTypes)
|
|
586
|
+
memoisedAccountTypes = [
|
|
587
|
+
accountBase58(),
|
|
588
|
+
accountBase64(),
|
|
589
|
+
accountBase64Zstd(),
|
|
590
|
+
accountNonceAccount(),
|
|
591
|
+
accountLookupTable(),
|
|
592
|
+
accountMint(),
|
|
593
|
+
accountTokenAccount(),
|
|
594
|
+
accountStakeAccount(),
|
|
595
|
+
accountVoteAccount()
|
|
596
|
+
];
|
|
597
|
+
return memoisedAccountTypes;
|
|
598
|
+
};
|
|
599
|
+
|
|
600
|
+
// src/schema/account/query.ts
|
|
601
|
+
var accountQuery = () => ({
|
|
602
|
+
account: {
|
|
603
|
+
args: {
|
|
604
|
+
address: nonNull(string()),
|
|
605
|
+
commitment: type(commitmentInputType()),
|
|
606
|
+
dataSlice: type(dataSliceInputType()),
|
|
607
|
+
encoding: type(accountEncodingInputType()),
|
|
608
|
+
minContextSlot: bigint()
|
|
609
|
+
},
|
|
610
|
+
resolve: (_parent, args, context) => context.resolveAccount(args),
|
|
611
|
+
type: accountInterface()
|
|
612
|
+
}
|
|
613
|
+
});
|
|
614
|
+
var memoisedTokenBalance;
|
|
615
|
+
var tokenBalance = () => {
|
|
616
|
+
if (!memoisedTokenBalance)
|
|
617
|
+
memoisedTokenBalance = new GraphQLObjectType({
|
|
618
|
+
fields: {
|
|
619
|
+
accountIndex: number(),
|
|
620
|
+
mint: string(),
|
|
621
|
+
owner: string(),
|
|
622
|
+
programId: string(),
|
|
623
|
+
uiAmountString: string()
|
|
624
|
+
},
|
|
625
|
+
name: "TokenBalance"
|
|
626
|
+
});
|
|
627
|
+
return memoisedTokenBalance;
|
|
628
|
+
};
|
|
629
|
+
var memoisedTransactionStatus;
|
|
630
|
+
var transactionStatus = () => {
|
|
631
|
+
if (!memoisedTransactionStatus)
|
|
632
|
+
memoisedTransactionStatus = new GraphQLUnionType({
|
|
633
|
+
name: "TransactionStatus",
|
|
634
|
+
types: [
|
|
635
|
+
new GraphQLObjectType({
|
|
636
|
+
fields: {
|
|
637
|
+
Err: string()
|
|
638
|
+
},
|
|
639
|
+
name: "TransactionStatusError"
|
|
640
|
+
}),
|
|
641
|
+
new GraphQLObjectType({
|
|
642
|
+
fields: {
|
|
643
|
+
Ok: string()
|
|
644
|
+
},
|
|
645
|
+
name: "TransactionStatusOk"
|
|
646
|
+
})
|
|
647
|
+
]
|
|
648
|
+
});
|
|
649
|
+
return memoisedTransactionStatus;
|
|
650
|
+
};
|
|
651
|
+
var memoisedReward;
|
|
652
|
+
var reward = () => {
|
|
653
|
+
if (!memoisedReward)
|
|
654
|
+
memoisedReward = new GraphQLObjectType({
|
|
655
|
+
fields: {
|
|
656
|
+
commission: number(),
|
|
657
|
+
lamports: bigint(),
|
|
658
|
+
postBalance: bigint(),
|
|
659
|
+
pubkey: string(),
|
|
660
|
+
rewardType: string()
|
|
661
|
+
},
|
|
662
|
+
name: "Reward"
|
|
663
|
+
});
|
|
664
|
+
return memoisedReward;
|
|
665
|
+
};
|
|
666
|
+
var memoisedAddressTableLookup;
|
|
667
|
+
var addressTableLookup = () => {
|
|
668
|
+
if (!memoisedAddressTableLookup)
|
|
669
|
+
memoisedAddressTableLookup = new GraphQLObjectType({
|
|
670
|
+
fields: {
|
|
671
|
+
accountKey: string(),
|
|
672
|
+
readableIndexes: list(number()),
|
|
673
|
+
writableIndexes: list(number())
|
|
674
|
+
},
|
|
675
|
+
name: "AddressTableLookup"
|
|
676
|
+
});
|
|
677
|
+
return memoisedAddressTableLookup;
|
|
678
|
+
};
|
|
679
|
+
var memoisedReturnData;
|
|
680
|
+
var returnData = () => {
|
|
681
|
+
if (!memoisedReturnData)
|
|
682
|
+
memoisedReturnData = new GraphQLObjectType({
|
|
683
|
+
fields: {
|
|
684
|
+
data: string(),
|
|
685
|
+
programId: string()
|
|
686
|
+
},
|
|
687
|
+
name: "ReturnData"
|
|
688
|
+
});
|
|
689
|
+
return memoisedReturnData;
|
|
690
|
+
};
|
|
691
|
+
var memoisedTransactionInstruction;
|
|
692
|
+
var transactionInstruction = () => {
|
|
693
|
+
if (!memoisedTransactionInstruction)
|
|
694
|
+
memoisedTransactionInstruction = new GraphQLObjectType({
|
|
695
|
+
fields: {
|
|
696
|
+
accounts: list(number()),
|
|
697
|
+
data: string(),
|
|
698
|
+
programIdIndex: number()
|
|
699
|
+
},
|
|
700
|
+
name: "TransactionInstruction"
|
|
701
|
+
});
|
|
702
|
+
return memoisedTransactionInstruction;
|
|
703
|
+
};
|
|
704
|
+
var memoisedTransactionMetaLoadedAddresses;
|
|
705
|
+
var transactionMetaLoadedAddresses = () => {
|
|
706
|
+
if (!memoisedTransactionMetaLoadedAddresses)
|
|
707
|
+
memoisedTransactionMetaLoadedAddresses = new GraphQLObjectType({
|
|
708
|
+
fields: {
|
|
709
|
+
readonly: list(string()),
|
|
710
|
+
// Base58 encoded addresses
|
|
711
|
+
writable: list(string())
|
|
712
|
+
// Base58 encoded addresses
|
|
713
|
+
},
|
|
714
|
+
name: "TransactionMetaLoadedAddresses"
|
|
715
|
+
});
|
|
716
|
+
return memoisedTransactionMetaLoadedAddresses;
|
|
717
|
+
};
|
|
718
|
+
var memoisedParsedTransactionInstructionInterface;
|
|
719
|
+
var parsedTransactionInstructionInterface = () => {
|
|
720
|
+
if (!memoisedParsedTransactionInstructionInterface)
|
|
721
|
+
memoisedParsedTransactionInstructionInterface = new GraphQLInterfaceType({
|
|
722
|
+
fields: {
|
|
723
|
+
programId: string()
|
|
724
|
+
},
|
|
725
|
+
name: "ParsedTransactionInstruction",
|
|
726
|
+
resolveType(instruction) {
|
|
727
|
+
if (instruction.program === "address-lookup-table") {
|
|
728
|
+
if (instruction.info.type === "createLookupTable") {
|
|
729
|
+
return "CreateLookupTableInstruction";
|
|
730
|
+
}
|
|
731
|
+
if (instruction.info.type === "freezeLookupTable") {
|
|
732
|
+
return "FreezeLookupTableInstruction";
|
|
733
|
+
}
|
|
734
|
+
if (instruction.info.type === "extendLookupTable") {
|
|
735
|
+
return "ExtendLookupTableInstruction";
|
|
736
|
+
}
|
|
737
|
+
if (instruction.info.type === "deactivateLookupTable") {
|
|
738
|
+
return "DeactivateLookupTableInstruction";
|
|
739
|
+
}
|
|
740
|
+
if (instruction.info.type === "closeLookupTable") {
|
|
741
|
+
return "CloseLookupTableInstruction";
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
if (instruction.program === "bpf-loader") {
|
|
745
|
+
if (instruction.info.type === "write") {
|
|
746
|
+
return "BpfLoaderWriteInstruction";
|
|
747
|
+
}
|
|
748
|
+
if (instruction.info.type === "finalize") {
|
|
749
|
+
return "BpfLoaderFinalizeInstruction";
|
|
750
|
+
}
|
|
751
|
+
}
|
|
752
|
+
if (instruction.program === "bpf-upgradeable-loader") {
|
|
753
|
+
if (instruction.info.type === "initializeBuffer") {
|
|
754
|
+
return "BpfUpgradeableLoaderInitializeBufferInstruction";
|
|
755
|
+
}
|
|
756
|
+
if (instruction.info.type === "write") {
|
|
757
|
+
return "BpfUpgradeableLoaderWriteInstruction";
|
|
758
|
+
}
|
|
759
|
+
if (instruction.info.type === "deployWithMaxDataLen") {
|
|
760
|
+
return "BpfUpgradeableLoaderDeployWithMaxDataLenInstruction";
|
|
761
|
+
}
|
|
762
|
+
if (instruction.info.type === "upgrade") {
|
|
763
|
+
return "BpfUpgradeableLoaderUpgradeInstruction";
|
|
764
|
+
}
|
|
765
|
+
if (instruction.info.type === "setAuthority") {
|
|
766
|
+
return "BpfUpgradeableLoaderSetAuthorityInstruction";
|
|
767
|
+
}
|
|
768
|
+
if (instruction.info.type === "setAuthorityChecked") {
|
|
769
|
+
return "BpfUpgradeableLoaderSetAuthorityCheckedInstruction";
|
|
770
|
+
}
|
|
771
|
+
if (instruction.info.type === "close") {
|
|
772
|
+
return "BpfUpgradeableLoaderCloseInstruction";
|
|
773
|
+
}
|
|
774
|
+
if (instruction.info.type === "extendProgram") {
|
|
775
|
+
return "BpfUpgradeableLoaderExtendProgramInstruction";
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
if (instruction.program === "spl-associated-token-account") {
|
|
779
|
+
if (instruction.info.type === "create") {
|
|
780
|
+
return "SplAssociatedTokenCreateInstruction";
|
|
781
|
+
}
|
|
782
|
+
if (instruction.info.type === "createIdempotent") {
|
|
783
|
+
return "SplAssociatedTokenCreateIdempotentInstruction";
|
|
784
|
+
}
|
|
785
|
+
if (instruction.info.type === "recoverNested") {
|
|
786
|
+
return "SplAssociatedTokenRecoverNestedInstruction";
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
if (instruction.program === "spl-memo") {
|
|
790
|
+
return "SplMemoInstruction";
|
|
791
|
+
}
|
|
792
|
+
if (instruction.program === "spl-token") {
|
|
793
|
+
if (instruction.info.type === "initializeMint") {
|
|
794
|
+
return "SplTokenInitializeMintInstruction";
|
|
795
|
+
}
|
|
796
|
+
if (instruction.info.type === "initializeMint2") {
|
|
797
|
+
return "SplTokenInitializeMint2Instruction";
|
|
798
|
+
}
|
|
799
|
+
if (instruction.info.type === "initializeAccount") {
|
|
800
|
+
return "SplTokenInitializeAccountInstruction";
|
|
801
|
+
}
|
|
802
|
+
if (instruction.info.type === "initializeAccount2") {
|
|
803
|
+
return "SplTokenInitializeAccount2Instruction";
|
|
804
|
+
}
|
|
805
|
+
if (instruction.info.type === "initializeAccount3") {
|
|
806
|
+
return "SplTokenInitializeAccount3Instruction";
|
|
807
|
+
}
|
|
808
|
+
if (instruction.info.type === "initializeMultisig") {
|
|
809
|
+
return "SplTokenInitializeMultisigInstruction";
|
|
810
|
+
}
|
|
811
|
+
if (instruction.info.type === "initializeMultisig2") {
|
|
812
|
+
return "SplTokenInitializeMultisig2Instruction";
|
|
813
|
+
}
|
|
814
|
+
if (instruction.info.type === "transfer") {
|
|
815
|
+
return "SplTokenTransferInstruction";
|
|
816
|
+
}
|
|
817
|
+
if (instruction.info.type === "approve") {
|
|
818
|
+
return "SplTokenApproveInstruction";
|
|
819
|
+
}
|
|
820
|
+
if (instruction.info.type === "revoke") {
|
|
821
|
+
return "SplTokenRevokeInstruction";
|
|
822
|
+
}
|
|
823
|
+
if (instruction.info.type === "setAuthority") {
|
|
824
|
+
return "SplTokenSetAuthorityInstruction";
|
|
825
|
+
}
|
|
826
|
+
if (instruction.info.type === "mintTo") {
|
|
827
|
+
return "SplTokenMintToInstruction";
|
|
828
|
+
}
|
|
829
|
+
if (instruction.info.type === "burn") {
|
|
830
|
+
return "SplTokenBurnInstruction";
|
|
831
|
+
}
|
|
832
|
+
if (instruction.info.type === "closeAccount") {
|
|
833
|
+
return "SplTokenCloseAccountInstruction";
|
|
834
|
+
}
|
|
835
|
+
if (instruction.info.type === "freezeAccount") {
|
|
836
|
+
return "SplTokenFreezeAccountInstruction";
|
|
837
|
+
}
|
|
838
|
+
if (instruction.info.type === "thawAccount") {
|
|
839
|
+
return "SplTokenThawAccountInstruction";
|
|
840
|
+
}
|
|
841
|
+
if (instruction.info.type === "transferChecked") {
|
|
842
|
+
return "SplTokenTransferCheckedInstruction";
|
|
843
|
+
}
|
|
844
|
+
if (instruction.info.type === "approveChecked") {
|
|
845
|
+
return "SplTokenApproveCheckedInstruction";
|
|
846
|
+
}
|
|
847
|
+
if (instruction.info.type === "mintToChecked") {
|
|
848
|
+
return "SplTokenMintToCheckedInstruction";
|
|
849
|
+
}
|
|
850
|
+
if (instruction.info.type === "burnChecked") {
|
|
851
|
+
return "SplTokenBurnCheckedInstruction";
|
|
852
|
+
}
|
|
853
|
+
if (instruction.info.type === "syncNative") {
|
|
854
|
+
return "SplTokenSyncNativeInstruction";
|
|
855
|
+
}
|
|
856
|
+
if (instruction.info.type === "getAccountDataSize") {
|
|
857
|
+
return "SplTokenGetAccountDataSizeInstruction";
|
|
858
|
+
}
|
|
859
|
+
if (instruction.info.type === "initializeImmutableOwner") {
|
|
860
|
+
return "SplTokenInitializeImmutableOwnerInstruction";
|
|
861
|
+
}
|
|
862
|
+
if (instruction.info.type === "amountToUiAmount") {
|
|
863
|
+
return "SplTokenAmountToUiAmountInstruction";
|
|
864
|
+
}
|
|
865
|
+
if (instruction.info.type === "uiAmountToAmount") {
|
|
866
|
+
return "SplTokenUiAmountToAmountInstruction";
|
|
867
|
+
}
|
|
868
|
+
if (instruction.info.type === "initializeMintCloseAuthority") {
|
|
869
|
+
return "SplTokenInitializeMintCloseAuthorityInstruction";
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
if (instruction.program === "stake") {
|
|
873
|
+
if (instruction.info.type === "initialize") {
|
|
874
|
+
return "StakeInitializeInstruction";
|
|
875
|
+
}
|
|
876
|
+
if (instruction.info.type === "authorize") {
|
|
877
|
+
return "StakeAuthorizeInstruction";
|
|
878
|
+
}
|
|
879
|
+
if (instruction.info.type === "delegate") {
|
|
880
|
+
return "StakeDelegateStakeInstruction";
|
|
881
|
+
}
|
|
882
|
+
if (instruction.info.type === "split") {
|
|
883
|
+
return "StakeSplitInstruction";
|
|
884
|
+
}
|
|
885
|
+
if (instruction.info.type === "withdraw") {
|
|
886
|
+
return "StakeWithdrawInstruction";
|
|
887
|
+
}
|
|
888
|
+
if (instruction.info.type === "deactivate") {
|
|
889
|
+
return "StakeDeactivateInstruction";
|
|
890
|
+
}
|
|
891
|
+
if (instruction.info.type === "setLockup") {
|
|
892
|
+
return "StakeSetLockupInstruction";
|
|
893
|
+
}
|
|
894
|
+
if (instruction.info.type === "merge") {
|
|
895
|
+
return "StakeMergeInstruction";
|
|
896
|
+
}
|
|
897
|
+
if (instruction.info.type === "authorizeWithSeed") {
|
|
898
|
+
return "StakeAuthorizeWithSeedInstruction";
|
|
899
|
+
}
|
|
900
|
+
if (instruction.info.type === "initializeChecked") {
|
|
901
|
+
return "StakeInitializeCheckedInstruction";
|
|
902
|
+
}
|
|
903
|
+
if (instruction.info.type === "authorizeChecked") {
|
|
904
|
+
return "StakeAuthorizeCheckedInstruction";
|
|
905
|
+
}
|
|
906
|
+
if (instruction.info.type === "authorizeCheckedWithSeed") {
|
|
907
|
+
return "StakeAuthorizeCheckedWithSeedInstruction";
|
|
908
|
+
}
|
|
909
|
+
if (instruction.info.type === "setLockupChecked") {
|
|
910
|
+
return "StakeSetLockupCheckedInstruction";
|
|
911
|
+
}
|
|
912
|
+
if (instruction.info.type === "deactivateDelinquent") {
|
|
913
|
+
return "StakeDeactivateDelinquentInstruction";
|
|
914
|
+
}
|
|
915
|
+
if (instruction.info.type === "redelegate") {
|
|
916
|
+
return "StakeRedelegateInstruction";
|
|
917
|
+
}
|
|
918
|
+
}
|
|
919
|
+
if (instruction.program === "system") {
|
|
920
|
+
if (instruction.info.type === "createAccount") {
|
|
921
|
+
return "CreateAccountInstruction";
|
|
922
|
+
}
|
|
923
|
+
if (instruction.info.type === "assign") {
|
|
924
|
+
return "AssignInstruction";
|
|
925
|
+
}
|
|
926
|
+
if (instruction.info.type === "transfer") {
|
|
927
|
+
return "TransferInstruction";
|
|
928
|
+
}
|
|
929
|
+
if (instruction.info.type === "createAccountWithSeed") {
|
|
930
|
+
return "CreateAccountWithSeedInstruction";
|
|
931
|
+
}
|
|
932
|
+
if (instruction.info.type === "advanceNonceAccount") {
|
|
933
|
+
return "AdvanceNonceAccountInstruction";
|
|
934
|
+
}
|
|
935
|
+
if (instruction.info.type === "withdrawNonceAccount") {
|
|
936
|
+
return "WithdrawNonceAccountInstruction";
|
|
937
|
+
}
|
|
938
|
+
if (instruction.info.type === "initializeNonceAccount") {
|
|
939
|
+
return "InitializeNonceAccountInstruction";
|
|
940
|
+
}
|
|
941
|
+
if (instruction.info.type === "authorizeNonceAccount") {
|
|
942
|
+
return "AuthorizeNonceAccountInstruction";
|
|
943
|
+
}
|
|
944
|
+
if (instruction.info.type === "upgradeNonceAccount") {
|
|
945
|
+
return "UpgradeNonceAccountInstruction";
|
|
946
|
+
}
|
|
947
|
+
if (instruction.info.type === "allocate") {
|
|
948
|
+
return "AllocateInstruction";
|
|
949
|
+
}
|
|
950
|
+
if (instruction.info.type === "allocateWithSeed") {
|
|
951
|
+
return "AllocateWithSeedInstruction";
|
|
952
|
+
}
|
|
953
|
+
if (instruction.info.type === "assignWithSeed") {
|
|
954
|
+
return "AssignWithSeedInstruction";
|
|
955
|
+
}
|
|
956
|
+
if (instruction.info.type === "transferWithSeed") {
|
|
957
|
+
return "TransferWithSeedInstruction";
|
|
958
|
+
}
|
|
959
|
+
}
|
|
960
|
+
if (instruction.program === "vote") {
|
|
961
|
+
if (instruction.info.type === "initialize") {
|
|
962
|
+
return "VoteInitializeAccountInstruction";
|
|
963
|
+
}
|
|
964
|
+
if (instruction.info.type === "authorize") {
|
|
965
|
+
return "VoteAuthorizeInstruction";
|
|
966
|
+
}
|
|
967
|
+
if (instruction.info.type === "authorizeWithSeed") {
|
|
968
|
+
return "VoteAuthorizeWithSeedInstruction";
|
|
969
|
+
}
|
|
970
|
+
if (instruction.info.type === "authorizeCheckedWithSeed") {
|
|
971
|
+
return "VoteAuthorizeCheckedWithSeedInstruction";
|
|
972
|
+
}
|
|
973
|
+
if (instruction.info.type === "vote") {
|
|
974
|
+
return "VoteVoteInstruction";
|
|
975
|
+
}
|
|
976
|
+
if (instruction.info.type === "updatevotestate") {
|
|
977
|
+
return "VoteUpdateVoteStateInstruction";
|
|
978
|
+
}
|
|
979
|
+
if (instruction.info.type === "updatevotestateswitch") {
|
|
980
|
+
return "VoteUpdateVoteStateSwitchInstruction";
|
|
981
|
+
}
|
|
982
|
+
if (instruction.info.type === "compactupdatevotestate") {
|
|
983
|
+
return "VoteCompactUpdateVoteStateInstruction";
|
|
984
|
+
}
|
|
985
|
+
if (instruction.info.type === "compactupdatevotestateswitch") {
|
|
986
|
+
return "VoteCompactUpdateVoteStateSwitchInstruction";
|
|
987
|
+
}
|
|
988
|
+
if (instruction.info.type === "withdraw") {
|
|
989
|
+
return "VoteWithdrawInstruction";
|
|
990
|
+
}
|
|
991
|
+
if (instruction.info.type === "updateValidatorIdentity") {
|
|
992
|
+
return "VoteUpdateValidatorIdentityInstruction";
|
|
993
|
+
}
|
|
994
|
+
if (instruction.info.type === "updateCommission") {
|
|
995
|
+
return "VoteUpdateCommissionInstruction";
|
|
996
|
+
}
|
|
997
|
+
if (instruction.info.type === "voteSwitch") {
|
|
998
|
+
return "VoteVoteSwitchInstruction";
|
|
999
|
+
}
|
|
1000
|
+
if (instruction.info.type === "authorizeChecked") {
|
|
1001
|
+
return "VoteAuthorizeCheckedInstruction";
|
|
1002
|
+
}
|
|
1003
|
+
}
|
|
1004
|
+
return "PartiallyDecodedInstruction";
|
|
1005
|
+
}
|
|
1006
|
+
});
|
|
1007
|
+
return memoisedParsedTransactionInstructionInterface;
|
|
1008
|
+
};
|
|
1009
|
+
var parsedTransactionInstructionType = (name, parsedInfoFields) => new GraphQLObjectType({
|
|
1010
|
+
fields: {
|
|
1011
|
+
parsed: object(name + "Parsed", {
|
|
1012
|
+
info: object(name + "ParsedInfo", parsedInfoFields),
|
|
1013
|
+
type: string()
|
|
1014
|
+
}),
|
|
1015
|
+
program: string(),
|
|
1016
|
+
programId: string()
|
|
1017
|
+
},
|
|
1018
|
+
interfaces: [parsedTransactionInstructionInterface()],
|
|
1019
|
+
name
|
|
1020
|
+
});
|
|
1021
|
+
var memoisedPartiallyDecodedTransactionInstruction;
|
|
1022
|
+
var partiallyDecodedTransactionInstruction = () => {
|
|
1023
|
+
if (!memoisedPartiallyDecodedTransactionInstruction)
|
|
1024
|
+
memoisedPartiallyDecodedTransactionInstruction = new GraphQLObjectType({
|
|
1025
|
+
fields: {
|
|
1026
|
+
accounts: list(string()),
|
|
1027
|
+
data: string(),
|
|
1028
|
+
programId: string()
|
|
1029
|
+
},
|
|
1030
|
+
interfaces: [parsedTransactionInstructionInterface()],
|
|
1031
|
+
name: "PartiallyDecodedInstruction"
|
|
1032
|
+
});
|
|
1033
|
+
return memoisedPartiallyDecodedTransactionInstruction;
|
|
1034
|
+
};
|
|
1035
|
+
var memoisedParsedInstructionsAddressLookupTable;
|
|
1036
|
+
var parsedInstructionsAddressLookupTable = () => {
|
|
1037
|
+
if (!memoisedParsedInstructionsAddressLookupTable)
|
|
1038
|
+
memoisedParsedInstructionsAddressLookupTable = [
|
|
1039
|
+
parsedTransactionInstructionType("CreateLookupTableInstruction", {
|
|
1040
|
+
bumpSeed: number(),
|
|
1041
|
+
lookupTableAccount: string(),
|
|
1042
|
+
lookupTableAuthority: string(),
|
|
1043
|
+
payerAccount: string(),
|
|
1044
|
+
recentSlot: bigint(),
|
|
1045
|
+
systemProgram: string()
|
|
1046
|
+
}),
|
|
1047
|
+
parsedTransactionInstructionType("FreezeLookupTableInstruction", {
|
|
1048
|
+
lookupTableAccount: string(),
|
|
1049
|
+
lookupTableAuthority: string()
|
|
1050
|
+
}),
|
|
1051
|
+
parsedTransactionInstructionType("ExtendLookupTableInstruction", {
|
|
1052
|
+
lookupTableAccount: string(),
|
|
1053
|
+
lookupTableAuthority: string(),
|
|
1054
|
+
newAddresses: list(string()),
|
|
1055
|
+
payerAccount: string(),
|
|
1056
|
+
systemProgram: string()
|
|
1057
|
+
}),
|
|
1058
|
+
parsedTransactionInstructionType("DeactivateLookupTableInstruction", {
|
|
1059
|
+
lookupTableAccount: string(),
|
|
1060
|
+
lookupTableAuthority: string()
|
|
1061
|
+
}),
|
|
1062
|
+
parsedTransactionInstructionType("CloseLookupTableInstruction", {
|
|
1063
|
+
lookupTableAccount: string(),
|
|
1064
|
+
lookupTableAuthority: string(),
|
|
1065
|
+
recipient: string()
|
|
1066
|
+
})
|
|
1067
|
+
];
|
|
1068
|
+
return memoisedParsedInstructionsAddressLookupTable;
|
|
1069
|
+
};
|
|
1070
|
+
var memoisedParsedInstructionsBpfLoader;
|
|
1071
|
+
var parsedInstructionsBpfLoader = () => {
|
|
1072
|
+
if (!memoisedParsedInstructionsBpfLoader)
|
|
1073
|
+
memoisedParsedInstructionsBpfLoader = [
|
|
1074
|
+
parsedTransactionInstructionType("BpfLoaderWriteInstruction", {
|
|
1075
|
+
account: string(),
|
|
1076
|
+
bytes: string(),
|
|
1077
|
+
offset: number()
|
|
1078
|
+
}),
|
|
1079
|
+
parsedTransactionInstructionType("BpfLoaderFinalizeInstruction", {
|
|
1080
|
+
account: string()
|
|
1081
|
+
})
|
|
1082
|
+
];
|
|
1083
|
+
return memoisedParsedInstructionsBpfLoader;
|
|
1084
|
+
};
|
|
1085
|
+
var memoisedParsedInstructionsBpfUpgradeableLoader;
|
|
1086
|
+
var parsedInstructionsBpfUpgradeableLoader = () => {
|
|
1087
|
+
if (!memoisedParsedInstructionsBpfUpgradeableLoader)
|
|
1088
|
+
memoisedParsedInstructionsBpfUpgradeableLoader = [
|
|
1089
|
+
parsedTransactionInstructionType("BpfUpgradeableLoaderInitializeBufferInstruction", {
|
|
1090
|
+
account: string()
|
|
1091
|
+
}),
|
|
1092
|
+
parsedTransactionInstructionType("BpfUpgradeableLoaderWriteInstruction", {
|
|
1093
|
+
account: string(),
|
|
1094
|
+
authority: string(),
|
|
1095
|
+
bytes: string(),
|
|
1096
|
+
offset: number()
|
|
1097
|
+
}),
|
|
1098
|
+
parsedTransactionInstructionType("BpfUpgradeableLoaderDeployWithMaxDataLenInstruction", {
|
|
1099
|
+
authority: string(),
|
|
1100
|
+
bufferAccount: string(),
|
|
1101
|
+
clockSysvar: string(),
|
|
1102
|
+
maxDataLen: bigint(),
|
|
1103
|
+
payerAccount: string(),
|
|
1104
|
+
programAccount: string(),
|
|
1105
|
+
programDataAccount: string(),
|
|
1106
|
+
rentSysvar: string()
|
|
1107
|
+
}),
|
|
1108
|
+
parsedTransactionInstructionType("BpfUpgradeableLoaderUpgradeInstruction", {
|
|
1109
|
+
authority: string(),
|
|
1110
|
+
bufferAccount: string(),
|
|
1111
|
+
clockSysvar: string(),
|
|
1112
|
+
programAccount: string(),
|
|
1113
|
+
programDataAccount: string(),
|
|
1114
|
+
rentSysvar: string(),
|
|
1115
|
+
spillAccount: string()
|
|
1116
|
+
}),
|
|
1117
|
+
parsedTransactionInstructionType("BpfUpgradeableLoaderSetAuthorityInstruction", {
|
|
1118
|
+
account: string(),
|
|
1119
|
+
authority: string(),
|
|
1120
|
+
newAuthority: string()
|
|
1121
|
+
}),
|
|
1122
|
+
parsedTransactionInstructionType("BpfUpgradeableLoaderSetAuthorityCheckedInstruction", {
|
|
1123
|
+
account: string(),
|
|
1124
|
+
authority: string(),
|
|
1125
|
+
newAuthority: string()
|
|
1126
|
+
}),
|
|
1127
|
+
parsedTransactionInstructionType("BpfUpgradeableLoaderCloseInstruction", {
|
|
1128
|
+
account: string(),
|
|
1129
|
+
authority: string(),
|
|
1130
|
+
programAccount: string(),
|
|
1131
|
+
recipient: string()
|
|
1132
|
+
}),
|
|
1133
|
+
parsedTransactionInstructionType("BpfUpgradeableLoaderExtendProgramInstruction", {
|
|
1134
|
+
additionalBytes: bigint(),
|
|
1135
|
+
payerAccount: string(),
|
|
1136
|
+
programAccount: string(),
|
|
1137
|
+
programDataAccount: string(),
|
|
1138
|
+
systemProgram: string()
|
|
1139
|
+
})
|
|
1140
|
+
];
|
|
1141
|
+
return memoisedParsedInstructionsBpfUpgradeableLoader;
|
|
1142
|
+
};
|
|
1143
|
+
var memoisedParsedInstructionsSplAssociatedToken;
|
|
1144
|
+
var parsedInstructionsSplAssociatedToken = () => {
|
|
1145
|
+
if (!memoisedParsedInstructionsSplAssociatedToken)
|
|
1146
|
+
memoisedParsedInstructionsSplAssociatedToken = [
|
|
1147
|
+
parsedTransactionInstructionType("SplAssociatedTokenCreateInstruction", {
|
|
1148
|
+
account: string(),
|
|
1149
|
+
mint: string(),
|
|
1150
|
+
source: string(),
|
|
1151
|
+
systemProgram: string(),
|
|
1152
|
+
tokenProgram: string(),
|
|
1153
|
+
wallet: string()
|
|
1154
|
+
}),
|
|
1155
|
+
parsedTransactionInstructionType("SplAssociatedTokenCreateIdempotentInstruction", {
|
|
1156
|
+
account: string(),
|
|
1157
|
+
mint: string(),
|
|
1158
|
+
source: string(),
|
|
1159
|
+
systemProgram: string(),
|
|
1160
|
+
tokenProgram: string(),
|
|
1161
|
+
wallet: string()
|
|
1162
|
+
}),
|
|
1163
|
+
parsedTransactionInstructionType("SplAssociatedTokenRecoverNestedInstruction", {
|
|
1164
|
+
destination: string(),
|
|
1165
|
+
nestedMint: string(),
|
|
1166
|
+
nestedOwner: string(),
|
|
1167
|
+
nestedSource: string(),
|
|
1168
|
+
ownerMint: string(),
|
|
1169
|
+
tokenProgram: string(),
|
|
1170
|
+
wallet: string()
|
|
1171
|
+
})
|
|
1172
|
+
];
|
|
1173
|
+
return memoisedParsedInstructionsSplAssociatedToken;
|
|
1174
|
+
};
|
|
1175
|
+
var memoisedParsedInstructionSplMemo;
|
|
1176
|
+
var parsedInstructionSplMemo = () => {
|
|
1177
|
+
if (!memoisedParsedInstructionSplMemo)
|
|
1178
|
+
memoisedParsedInstructionSplMemo = new GraphQLObjectType({
|
|
1179
|
+
fields: {
|
|
1180
|
+
parsed: string(),
|
|
1181
|
+
program: string(),
|
|
1182
|
+
programId: string()
|
|
1183
|
+
},
|
|
1184
|
+
interfaces: [parsedTransactionInstructionInterface()],
|
|
1185
|
+
name: "SplMemoInstruction"
|
|
1186
|
+
});
|
|
1187
|
+
return memoisedParsedInstructionSplMemo;
|
|
1188
|
+
};
|
|
1189
|
+
var memoisedParsedInstructionsSplToken;
|
|
1190
|
+
var parsedInstructionsSplToken = () => {
|
|
1191
|
+
if (!memoisedParsedInstructionsSplToken)
|
|
1192
|
+
memoisedParsedInstructionsSplToken = [
|
|
1193
|
+
parsedTransactionInstructionType("SplTokenInitializeMintInstruction", {
|
|
1194
|
+
decimals: number(),
|
|
1195
|
+
freezeAuthority: string(),
|
|
1196
|
+
mint: string(),
|
|
1197
|
+
mintAuthority: string(),
|
|
1198
|
+
rentSysvar: string()
|
|
1199
|
+
}),
|
|
1200
|
+
parsedTransactionInstructionType("SplTokenInitializeMint2Instruction", {
|
|
1201
|
+
decimals: number(),
|
|
1202
|
+
freezeAuthority: string(),
|
|
1203
|
+
mint: string(),
|
|
1204
|
+
mintAuthority: string()
|
|
1205
|
+
}),
|
|
1206
|
+
parsedTransactionInstructionType("SplTokenInitializeAccountInstruction", {
|
|
1207
|
+
account: string(),
|
|
1208
|
+
mint: string(),
|
|
1209
|
+
owner: string(),
|
|
1210
|
+
rentSysvar: string()
|
|
1211
|
+
}),
|
|
1212
|
+
parsedTransactionInstructionType("SplTokenInitializeAccount2Instruction", {
|
|
1213
|
+
account: string(),
|
|
1214
|
+
mint: string(),
|
|
1215
|
+
owner: string(),
|
|
1216
|
+
rentSysvar: string()
|
|
1217
|
+
}),
|
|
1218
|
+
parsedTransactionInstructionType("SplTokenInitializeAccount3Instruction", {
|
|
1219
|
+
account: string(),
|
|
1220
|
+
mint: string(),
|
|
1221
|
+
owner: string()
|
|
1222
|
+
}),
|
|
1223
|
+
parsedTransactionInstructionType("SplTokenInitializeMultisigInstruction", {
|
|
1224
|
+
m: number(),
|
|
1225
|
+
multisig: string(),
|
|
1226
|
+
rentSysvar: string(),
|
|
1227
|
+
signers: list(string())
|
|
1228
|
+
}),
|
|
1229
|
+
parsedTransactionInstructionType("SplTokenInitializeMultisig2Instruction", {
|
|
1230
|
+
m: number(),
|
|
1231
|
+
multisig: string(),
|
|
1232
|
+
signers: list(string())
|
|
1233
|
+
}),
|
|
1234
|
+
parsedTransactionInstructionType("SplTokenTransferInstruction", {
|
|
1235
|
+
amount: string(),
|
|
1236
|
+
authority: string(),
|
|
1237
|
+
destination: string(),
|
|
1238
|
+
multisigAuthority: string(),
|
|
1239
|
+
source: string()
|
|
1240
|
+
}),
|
|
1241
|
+
parsedTransactionInstructionType("SplTokenApproveInstruction", {
|
|
1242
|
+
amount: string(),
|
|
1243
|
+
delegate: string(),
|
|
1244
|
+
multisigOwner: string(),
|
|
1245
|
+
owner: string(),
|
|
1246
|
+
source: string()
|
|
1247
|
+
}),
|
|
1248
|
+
parsedTransactionInstructionType("SplTokenRevokeInstruction", {
|
|
1249
|
+
multisigOwner: string(),
|
|
1250
|
+
owner: string(),
|
|
1251
|
+
source: string()
|
|
1252
|
+
}),
|
|
1253
|
+
parsedTransactionInstructionType("SplTokenSetAuthorityInstruction", {
|
|
1254
|
+
authority: string(),
|
|
1255
|
+
authorityType: string(),
|
|
1256
|
+
multisigAuthority: string(),
|
|
1257
|
+
newAuthority: string()
|
|
1258
|
+
}),
|
|
1259
|
+
parsedTransactionInstructionType("SplTokenMintToInstruction", {
|
|
1260
|
+
account: string(),
|
|
1261
|
+
amount: string(),
|
|
1262
|
+
authority: string(),
|
|
1263
|
+
mint: string(),
|
|
1264
|
+
mintAuthority: string(),
|
|
1265
|
+
multisigMintAuthority: string()
|
|
1266
|
+
}),
|
|
1267
|
+
parsedTransactionInstructionType("SplTokenBurnInstruction", {
|
|
1268
|
+
account: string(),
|
|
1269
|
+
amount: string(),
|
|
1270
|
+
authority: string(),
|
|
1271
|
+
mint: string(),
|
|
1272
|
+
multisigAuthority: string()
|
|
1273
|
+
}),
|
|
1274
|
+
parsedTransactionInstructionType("SplTokenCloseAccountInstruction", {
|
|
1275
|
+
account: string(),
|
|
1276
|
+
destination: string(),
|
|
1277
|
+
multisigOwner: string(),
|
|
1278
|
+
owner: string()
|
|
1279
|
+
}),
|
|
1280
|
+
parsedTransactionInstructionType("SplTokenFreezeAccountInstruction", {
|
|
1281
|
+
account: string(),
|
|
1282
|
+
freezeAuthority: string(),
|
|
1283
|
+
mint: string(),
|
|
1284
|
+
multisigFreezeAuthority: string()
|
|
1285
|
+
}),
|
|
1286
|
+
parsedTransactionInstructionType("SplTokenThawAccountInstruction", {
|
|
1287
|
+
account: string(),
|
|
1288
|
+
freezeAuthority: string(),
|
|
1289
|
+
mint: string(),
|
|
1290
|
+
multisigFreezeAuthority: string()
|
|
1291
|
+
}),
|
|
1292
|
+
parsedTransactionInstructionType("SplTokenTransferCheckedInstruction", {
|
|
1293
|
+
authority: string(),
|
|
1294
|
+
destination: string(),
|
|
1295
|
+
mint: string(),
|
|
1296
|
+
multisigAuthority: string(),
|
|
1297
|
+
source: string(),
|
|
1298
|
+
tokenAmount: string()
|
|
1299
|
+
}),
|
|
1300
|
+
parsedTransactionInstructionType("SplTokenApproveCheckedInstruction", {
|
|
1301
|
+
delegate: string(),
|
|
1302
|
+
mint: string(),
|
|
1303
|
+
multisigOwner: string(),
|
|
1304
|
+
owner: string(),
|
|
1305
|
+
source: string(),
|
|
1306
|
+
tokenAmount: string()
|
|
1307
|
+
}),
|
|
1308
|
+
parsedTransactionInstructionType("SplTokenMintToCheckedInstruction", {
|
|
1309
|
+
account: string(),
|
|
1310
|
+
authority: string(),
|
|
1311
|
+
mint: string(),
|
|
1312
|
+
mintAuthority: string(),
|
|
1313
|
+
multisigMintAuthority: string(),
|
|
1314
|
+
tokenAmount: string()
|
|
1315
|
+
}),
|
|
1316
|
+
parsedTransactionInstructionType("SplTokenBurnCheckedInstruction", {
|
|
1317
|
+
account: string(),
|
|
1318
|
+
authority: string(),
|
|
1319
|
+
mint: string(),
|
|
1320
|
+
multisigAuthority: string(),
|
|
1321
|
+
tokenAmount: string()
|
|
1322
|
+
}),
|
|
1323
|
+
parsedTransactionInstructionType("SplTokenSyncNativeInstruction", {
|
|
1324
|
+
account: string()
|
|
1325
|
+
}),
|
|
1326
|
+
parsedTransactionInstructionType("SplTokenGetAccountDataSizeInstruction", {
|
|
1327
|
+
extensionTypes: list(string()),
|
|
1328
|
+
mint: string()
|
|
1329
|
+
}),
|
|
1330
|
+
parsedTransactionInstructionType("SplTokenInitializeImmutableOwnerInstruction", {
|
|
1331
|
+
account: string()
|
|
1332
|
+
}),
|
|
1333
|
+
parsedTransactionInstructionType("SplTokenAmountToUiAmountInstruction", {
|
|
1334
|
+
amount: string(),
|
|
1335
|
+
mint: string()
|
|
1336
|
+
}),
|
|
1337
|
+
parsedTransactionInstructionType("SplTokenUiAmountToAmountInstruction", {
|
|
1338
|
+
mint: string(),
|
|
1339
|
+
uiAmount: string()
|
|
1340
|
+
}),
|
|
1341
|
+
parsedTransactionInstructionType("SplTokenInitializeMintCloseAuthorityInstruction", {
|
|
1342
|
+
mint: string(),
|
|
1343
|
+
newAuthority: string()
|
|
1344
|
+
})
|
|
1345
|
+
// TODO: Extensions!
|
|
1346
|
+
// - TransferFeeExtension
|
|
1347
|
+
// - ConfidentialTransferFeeExtension
|
|
1348
|
+
// - DefaultAccountStateExtension
|
|
1349
|
+
// - Reallocate
|
|
1350
|
+
// - MemoTransferExtension
|
|
1351
|
+
// - CreateNativeMint
|
|
1352
|
+
// - InitializeNonTransferableMint
|
|
1353
|
+
// - InterestBearingMintExtension
|
|
1354
|
+
// - CpiGuardExtension
|
|
1355
|
+
// - InitializePermanentDelegate
|
|
1356
|
+
// - TransferHookExtension
|
|
1357
|
+
// - ConfidentialTransferFeeExtension
|
|
1358
|
+
// - WithdrawExcessLamports
|
|
1359
|
+
// - MetadataPointerExtension
|
|
1360
|
+
];
|
|
1361
|
+
return memoisedParsedInstructionsSplToken;
|
|
1362
|
+
};
|
|
1363
|
+
var memoisedLockup;
|
|
1364
|
+
var lockup = () => {
|
|
1365
|
+
if (!memoisedLockup)
|
|
1366
|
+
memoisedLockup = new GraphQLObjectType({
|
|
1367
|
+
fields: {
|
|
1368
|
+
custodian: string(),
|
|
1369
|
+
epoch: bigint(),
|
|
1370
|
+
unixTimestamp: bigint()
|
|
1371
|
+
},
|
|
1372
|
+
name: "Lockup"
|
|
1373
|
+
});
|
|
1374
|
+
return memoisedLockup;
|
|
1375
|
+
};
|
|
1376
|
+
var memoisedParsedInstructionsStake;
|
|
1377
|
+
var parsedInstructionsStake = () => {
|
|
1378
|
+
if (!memoisedParsedInstructionsStake)
|
|
1379
|
+
memoisedParsedInstructionsStake = [
|
|
1380
|
+
parsedTransactionInstructionType("StakeInitializeInstruction", {
|
|
1381
|
+
authorized: object("StakeInitializeInstructionAuthorized", {
|
|
1382
|
+
staker: string(),
|
|
1383
|
+
withdrawer: string()
|
|
1384
|
+
}),
|
|
1385
|
+
lockup: object("StakeInitializeInstructionLockup", {
|
|
1386
|
+
custodian: string(),
|
|
1387
|
+
epoch: bigint(),
|
|
1388
|
+
unixTimestamp: bigint()
|
|
1389
|
+
}),
|
|
1390
|
+
rentSysvar: string(),
|
|
1391
|
+
stakeAccount: string()
|
|
1392
|
+
}),
|
|
1393
|
+
parsedTransactionInstructionType("StakeAuthorizeInstruction", {
|
|
1394
|
+
authority: string(),
|
|
1395
|
+
authorityType: string(),
|
|
1396
|
+
clockSysvar: string(),
|
|
1397
|
+
custodian: string(),
|
|
1398
|
+
newAuthority: string(),
|
|
1399
|
+
stakeAccount: string()
|
|
1400
|
+
}),
|
|
1401
|
+
parsedTransactionInstructionType("StakeDelegateStakeInstruction", {
|
|
1402
|
+
clockSysvar: string(),
|
|
1403
|
+
stakeAccount: string(),
|
|
1404
|
+
stakeAuthority: string(),
|
|
1405
|
+
stakeConfigAccount: string(),
|
|
1406
|
+
stakeHistorySysvar: string(),
|
|
1407
|
+
voteAccount: string()
|
|
1408
|
+
}),
|
|
1409
|
+
parsedTransactionInstructionType("StakeSplitInstruction", {
|
|
1410
|
+
lamports: bigint(),
|
|
1411
|
+
newSplitAccount: string(),
|
|
1412
|
+
stakeAccount: string(),
|
|
1413
|
+
stakeAuthority: string()
|
|
1414
|
+
}),
|
|
1415
|
+
parsedTransactionInstructionType("StakeWithdrawInstruction", {
|
|
1416
|
+
clockSysvar: string(),
|
|
1417
|
+
destination: string(),
|
|
1418
|
+
lamports: bigint(),
|
|
1419
|
+
stakeAccount: string(),
|
|
1420
|
+
withdrawAuthority: string()
|
|
1421
|
+
}),
|
|
1422
|
+
parsedTransactionInstructionType("StakeDeactivateInstruction", {
|
|
1423
|
+
clockSysvar: string(),
|
|
1424
|
+
stakeAccount: string(),
|
|
1425
|
+
stakeAuthority: string()
|
|
1426
|
+
}),
|
|
1427
|
+
parsedTransactionInstructionType("StakeSetLockupInstruction", {
|
|
1428
|
+
custodian: string(),
|
|
1429
|
+
lockup: type(lockup()),
|
|
1430
|
+
stakeAccount: string()
|
|
1431
|
+
}),
|
|
1432
|
+
parsedTransactionInstructionType("StakeMergeInstruction", {
|
|
1433
|
+
clockSysvar: string(),
|
|
1434
|
+
destination: string(),
|
|
1435
|
+
source: string(),
|
|
1436
|
+
stakeAuthority: string(),
|
|
1437
|
+
stakeHistorySysvar: string()
|
|
1438
|
+
}),
|
|
1439
|
+
parsedTransactionInstructionType("StakeAuthorizeWithSeedInstruction", {
|
|
1440
|
+
authorityBase: string(),
|
|
1441
|
+
authorityOwner: string(),
|
|
1442
|
+
authoritySeed: string(),
|
|
1443
|
+
authorityType: string(),
|
|
1444
|
+
clockSysvar: string(),
|
|
1445
|
+
custodian: string(),
|
|
1446
|
+
newAuthorized: string(),
|
|
1447
|
+
stakeAccount: string()
|
|
1448
|
+
}),
|
|
1449
|
+
parsedTransactionInstructionType("StakeInitializeCheckedInstruction", {
|
|
1450
|
+
rentSysvar: string(),
|
|
1451
|
+
stakeAccount: string(),
|
|
1452
|
+
staker: string(),
|
|
1453
|
+
withdrawer: string()
|
|
1454
|
+
}),
|
|
1455
|
+
parsedTransactionInstructionType("StakeAuthorizeCheckedInstruction", {
|
|
1456
|
+
authority: string(),
|
|
1457
|
+
authorityType: string(),
|
|
1458
|
+
clockSysvar: string(),
|
|
1459
|
+
custodian: string(),
|
|
1460
|
+
newAuthority: string(),
|
|
1461
|
+
stakeAccount: string()
|
|
1462
|
+
}),
|
|
1463
|
+
parsedTransactionInstructionType("StakeAuthorizeCheckedWithSeedInstruction", {
|
|
1464
|
+
authorityBase: string(),
|
|
1465
|
+
authorityOwner: string(),
|
|
1466
|
+
authoritySeed: string(),
|
|
1467
|
+
authorityType: string(),
|
|
1468
|
+
clockSysvar: string(),
|
|
1469
|
+
custodian: string(),
|
|
1470
|
+
newAuthorized: string(),
|
|
1471
|
+
stakeAccount: string()
|
|
1472
|
+
}),
|
|
1473
|
+
parsedTransactionInstructionType("StakeSetLockupCheckedInstruction", {
|
|
1474
|
+
custodian: string(),
|
|
1475
|
+
lockup: type(lockup()),
|
|
1476
|
+
stakeAccount: string()
|
|
1477
|
+
}),
|
|
1478
|
+
parsedTransactionInstructionType("StakeDeactivateDelinquentInstruction", {
|
|
1479
|
+
referenceVoteAccount: string(),
|
|
1480
|
+
stakeAccount: string(),
|
|
1481
|
+
voteAccount: string()
|
|
1482
|
+
}),
|
|
1483
|
+
parsedTransactionInstructionType("StakeRedelegateInstruction", {
|
|
1484
|
+
newStakeAccount: string(),
|
|
1485
|
+
stakeAccount: string(),
|
|
1486
|
+
stakeAuthority: string(),
|
|
1487
|
+
stakeConfigAccount: string(),
|
|
1488
|
+
voteAccount: string()
|
|
1489
|
+
})
|
|
1490
|
+
];
|
|
1491
|
+
return memoisedParsedInstructionsStake;
|
|
1492
|
+
};
|
|
1493
|
+
var memoisedParsedInstructionsSystem;
|
|
1494
|
+
var parsedInstructionsSystem = () => {
|
|
1495
|
+
if (!memoisedParsedInstructionsSystem)
|
|
1496
|
+
memoisedParsedInstructionsSystem = [
|
|
1497
|
+
parsedTransactionInstructionType("CreateAccountInstruction", {
|
|
1498
|
+
lamports: bigint(),
|
|
1499
|
+
newAccount: string(),
|
|
1500
|
+
owner: string(),
|
|
1501
|
+
source: string(),
|
|
1502
|
+
space: bigint()
|
|
1503
|
+
}),
|
|
1504
|
+
parsedTransactionInstructionType("AssignInstruction", {
|
|
1505
|
+
owner: string()
|
|
1506
|
+
}),
|
|
1507
|
+
parsedTransactionInstructionType("TransferInstruction", {
|
|
1508
|
+
amount: string(),
|
|
1509
|
+
lamports: number(),
|
|
1510
|
+
source: string()
|
|
1511
|
+
}),
|
|
1512
|
+
parsedTransactionInstructionType("CreateAccountWithSeedInstruction", {
|
|
1513
|
+
base: string(),
|
|
1514
|
+
lamports: bigint(),
|
|
1515
|
+
owner: string(),
|
|
1516
|
+
seed: string(),
|
|
1517
|
+
space: bigint()
|
|
1518
|
+
}),
|
|
1519
|
+
parsedTransactionInstructionType("AdvanceNonceAccountInstruction", {
|
|
1520
|
+
nonceAccount: string(),
|
|
1521
|
+
nonceAuthority: string(),
|
|
1522
|
+
recentBlockhashesSysvar: string()
|
|
1523
|
+
}),
|
|
1524
|
+
parsedTransactionInstructionType("WithdrawNonceAccountInstruction", {
|
|
1525
|
+
destination: string(),
|
|
1526
|
+
lamports: bigint(),
|
|
1527
|
+
nonceAccount: string(),
|
|
1528
|
+
nonceAuthority: string(),
|
|
1529
|
+
recentBlockhashesSysvar: string(),
|
|
1530
|
+
rentSysvar: string()
|
|
1531
|
+
}),
|
|
1532
|
+
parsedTransactionInstructionType("InitializeNonceAccountInstruction", {
|
|
1533
|
+
nonceAccount: string(),
|
|
1534
|
+
nonceAuthority: string(),
|
|
1535
|
+
recentBlockhashesSysvar: string(),
|
|
1536
|
+
rentSysvar: string()
|
|
1537
|
+
}),
|
|
1538
|
+
parsedTransactionInstructionType("AuthorizeNonceAccountInstruction", {
|
|
1539
|
+
newAuthorized: string(),
|
|
1540
|
+
nonceAccount: string(),
|
|
1541
|
+
nonceAuthority: string()
|
|
1542
|
+
}),
|
|
1543
|
+
parsedTransactionInstructionType("UpgradeNonceAccountInstruction", {
|
|
1544
|
+
nonceAccount: string()
|
|
1545
|
+
}),
|
|
1546
|
+
parsedTransactionInstructionType("AllocateInstruction", {
|
|
1547
|
+
account: string(),
|
|
1548
|
+
space: bigint()
|
|
1549
|
+
}),
|
|
1550
|
+
parsedTransactionInstructionType("AllocateWithSeedInstruction", {
|
|
1551
|
+
account: string(),
|
|
1552
|
+
base: string(),
|
|
1553
|
+
owner: string(),
|
|
1554
|
+
seed: string(),
|
|
1555
|
+
space: bigint()
|
|
1556
|
+
}),
|
|
1557
|
+
parsedTransactionInstructionType("AssignWithSeedInstruction", {
|
|
1558
|
+
account: string(),
|
|
1559
|
+
base: string(),
|
|
1560
|
+
owner: string(),
|
|
1561
|
+
seed: string()
|
|
1562
|
+
}),
|
|
1563
|
+
parsedTransactionInstructionType("TransferWithSeedInstruction", {
|
|
1564
|
+
destination: string(),
|
|
1565
|
+
lamports: bigint(),
|
|
1566
|
+
source: string(),
|
|
1567
|
+
sourceBase: string(),
|
|
1568
|
+
sourceOwner: string(),
|
|
1569
|
+
sourceSeed: string()
|
|
1570
|
+
})
|
|
1571
|
+
];
|
|
1572
|
+
return memoisedParsedInstructionsSystem;
|
|
1573
|
+
};
|
|
1574
|
+
var memoisedVote;
|
|
1575
|
+
var vote = () => {
|
|
1576
|
+
if (!memoisedVote)
|
|
1577
|
+
memoisedVote = new GraphQLObjectType({
|
|
1578
|
+
fields: {
|
|
1579
|
+
hash: string(),
|
|
1580
|
+
slots: list(bigint()),
|
|
1581
|
+
timestamp: bigint()
|
|
1582
|
+
},
|
|
1583
|
+
name: "Vote"
|
|
1584
|
+
});
|
|
1585
|
+
return memoisedVote;
|
|
1586
|
+
};
|
|
1587
|
+
var memoisedVoteStateUpdate;
|
|
1588
|
+
var voteStateUpdate = () => {
|
|
1589
|
+
if (!memoisedVoteStateUpdate)
|
|
1590
|
+
memoisedVoteStateUpdate = new GraphQLObjectType({
|
|
1591
|
+
fields: {
|
|
1592
|
+
hash: string(),
|
|
1593
|
+
lockouts: list(
|
|
1594
|
+
object("VoteStateUpdateLockout", {
|
|
1595
|
+
confirmationCount: number(),
|
|
1596
|
+
slot: bigint()
|
|
1597
|
+
})
|
|
1598
|
+
),
|
|
1599
|
+
root: bigint(),
|
|
1600
|
+
timestamp: bigint()
|
|
1601
|
+
},
|
|
1602
|
+
name: "VoteStateUpdate"
|
|
1603
|
+
});
|
|
1604
|
+
return memoisedVoteStateUpdate;
|
|
1605
|
+
};
|
|
1606
|
+
var memoisedParsedInstructionsVote;
|
|
1607
|
+
var parsedInstructionsVote = () => {
|
|
1608
|
+
if (!memoisedParsedInstructionsVote)
|
|
1609
|
+
memoisedParsedInstructionsVote = [
|
|
1610
|
+
parsedTransactionInstructionType("VoteInitializeAccountInstruction", {
|
|
1611
|
+
authorizedVoter: string(),
|
|
1612
|
+
authorizedWithdrawer: string(),
|
|
1613
|
+
clockSysvar: string(),
|
|
1614
|
+
commission: number(),
|
|
1615
|
+
node: string(),
|
|
1616
|
+
rentSysvar: string(),
|
|
1617
|
+
voteAccount: string()
|
|
1618
|
+
}),
|
|
1619
|
+
parsedTransactionInstructionType("VoteAuthorizeInstruction", {
|
|
1620
|
+
authority: string(),
|
|
1621
|
+
authorityType: string(),
|
|
1622
|
+
clockSysvar: string(),
|
|
1623
|
+
newAuthority: string(),
|
|
1624
|
+
voteAccount: string()
|
|
1625
|
+
}),
|
|
1626
|
+
parsedTransactionInstructionType("VoteAuthorizeWithSeedInstruction", {
|
|
1627
|
+
authorityBaseKey: string(),
|
|
1628
|
+
authorityOwner: string(),
|
|
1629
|
+
authoritySeed: string(),
|
|
1630
|
+
authorityType: string(),
|
|
1631
|
+
clockSysvar: string(),
|
|
1632
|
+
newAuthority: string(),
|
|
1633
|
+
voteAccount: string()
|
|
1634
|
+
}),
|
|
1635
|
+
parsedTransactionInstructionType("VoteAuthorizeCheckedWithSeedInstruction", {
|
|
1636
|
+
authorityBaseKey: string(),
|
|
1637
|
+
authorityOwner: string(),
|
|
1638
|
+
authoritySeed: string(),
|
|
1639
|
+
authorityType: string(),
|
|
1640
|
+
clockSysvar: string(),
|
|
1641
|
+
newAuthority: string(),
|
|
1642
|
+
voteAccount: string()
|
|
1643
|
+
}),
|
|
1644
|
+
parsedTransactionInstructionType("VoteVoteInstruction", {
|
|
1645
|
+
clockSysvar: string(),
|
|
1646
|
+
slotHashedSysvar: string(),
|
|
1647
|
+
vote: type(vote()),
|
|
1648
|
+
voteAccount: string(),
|
|
1649
|
+
voteAuthority: string()
|
|
1650
|
+
}),
|
|
1651
|
+
parsedTransactionInstructionType("VoteUpdateVoteStateInstruction", {
|
|
1652
|
+
hash: string(),
|
|
1653
|
+
voteAccount: string(),
|
|
1654
|
+
voteAuthority: string(),
|
|
1655
|
+
voteStateUpdate: type(voteStateUpdate())
|
|
1656
|
+
}),
|
|
1657
|
+
parsedTransactionInstructionType("VoteUpdateVoteStateSwitchInstruction", {
|
|
1658
|
+
hash: string(),
|
|
1659
|
+
voteAccount: string(),
|
|
1660
|
+
voteAuthority: string(),
|
|
1661
|
+
voteStateUpdate: type(voteStateUpdate())
|
|
1662
|
+
}),
|
|
1663
|
+
parsedTransactionInstructionType("VoteCompactUpdateVoteStateInstruction", {
|
|
1664
|
+
hash: string(),
|
|
1665
|
+
voteAccount: string(),
|
|
1666
|
+
voteAuthority: string(),
|
|
1667
|
+
voteStateUpdate: type(voteStateUpdate())
|
|
1668
|
+
}),
|
|
1669
|
+
parsedTransactionInstructionType("VoteCompactUpdateVoteStateSwitchInstruction", {
|
|
1670
|
+
hash: string(),
|
|
1671
|
+
voteAccount: string(),
|
|
1672
|
+
voteAuthority: string(),
|
|
1673
|
+
voteStateUpdate: type(voteStateUpdate())
|
|
1674
|
+
}),
|
|
1675
|
+
parsedTransactionInstructionType("VoteWithdrawInstruction", {
|
|
1676
|
+
destination: string(),
|
|
1677
|
+
lamports: bigint(),
|
|
1678
|
+
voteAccount: string(),
|
|
1679
|
+
withdrawAuthority: string()
|
|
1680
|
+
}),
|
|
1681
|
+
parsedTransactionInstructionType("VoteUpdateValidatorIdentityInstruction", {
|
|
1682
|
+
newValidatorIdentity: string(),
|
|
1683
|
+
voteAccount: string(),
|
|
1684
|
+
withdrawAuthority: string()
|
|
1685
|
+
}),
|
|
1686
|
+
parsedTransactionInstructionType("VoteUpdateCommissionInstruction", {
|
|
1687
|
+
commission: string(),
|
|
1688
|
+
voteAccount: string(),
|
|
1689
|
+
withdrawAuthority: string()
|
|
1690
|
+
}),
|
|
1691
|
+
parsedTransactionInstructionType("VoteVoteSwitchInstruction", {
|
|
1692
|
+
clockSysvar: string(),
|
|
1693
|
+
hash: string(),
|
|
1694
|
+
slotHashesSysvar: string(),
|
|
1695
|
+
vote: type(vote()),
|
|
1696
|
+
voteAccount: string(),
|
|
1697
|
+
voteAuthority: string()
|
|
1698
|
+
}),
|
|
1699
|
+
parsedTransactionInstructionType("VoteAuthorizeCheckedInstruction", {
|
|
1700
|
+
authority: string(),
|
|
1701
|
+
authorityType: string(),
|
|
1702
|
+
clockSysvar: string(),
|
|
1703
|
+
newAuthority: string(),
|
|
1704
|
+
voteAccount: string()
|
|
1705
|
+
})
|
|
1706
|
+
];
|
|
1707
|
+
return memoisedParsedInstructionsVote;
|
|
1708
|
+
};
|
|
1709
|
+
var memoisedTransactionMetaInterfaceFields;
|
|
1710
|
+
var transactionMetaInterfaceFields = () => {
|
|
1711
|
+
if (!memoisedTransactionMetaInterfaceFields)
|
|
1712
|
+
memoisedTransactionMetaInterfaceFields = {
|
|
1713
|
+
computeUnitsConsumed: bigint(),
|
|
1714
|
+
err: string(),
|
|
1715
|
+
fee: bigint(),
|
|
1716
|
+
format: string(),
|
|
1717
|
+
loadedAddresses: type(transactionMetaLoadedAddresses()),
|
|
1718
|
+
logMessages: list(string()),
|
|
1719
|
+
postBalances: list(bigint()),
|
|
1720
|
+
postTokenBalances: list(type(tokenBalance())),
|
|
1721
|
+
preBalances: list(bigint()),
|
|
1722
|
+
preTokenBalances: list(type(tokenBalance())),
|
|
1723
|
+
returnData: type(returnData()),
|
|
1724
|
+
rewards: list(type(reward())),
|
|
1725
|
+
status: type(transactionStatus())
|
|
1726
|
+
};
|
|
1727
|
+
return memoisedTransactionMetaInterfaceFields;
|
|
1728
|
+
};
|
|
1729
|
+
var memoisedTransactionMetaInterface;
|
|
1730
|
+
var transactionMetaInterface = () => {
|
|
1731
|
+
if (!memoisedTransactionMetaInterface)
|
|
1732
|
+
memoisedTransactionMetaInterface = new GraphQLInterfaceType({
|
|
1733
|
+
fields: {
|
|
1734
|
+
...transactionMetaInterfaceFields()
|
|
1735
|
+
},
|
|
1736
|
+
name: "TransactionMeta",
|
|
1737
|
+
resolveType(meta) {
|
|
1738
|
+
if (meta.format === "parsed") {
|
|
1739
|
+
return "TransactionMetaParsed";
|
|
1740
|
+
}
|
|
1741
|
+
return "TransactionMetaUnparsed";
|
|
1742
|
+
}
|
|
1743
|
+
});
|
|
1744
|
+
return memoisedTransactionMetaInterface;
|
|
1745
|
+
};
|
|
1746
|
+
var transactionMetaType = (name, description, innerInstructions) => new GraphQLObjectType({
|
|
1747
|
+
description,
|
|
1748
|
+
fields: {
|
|
1749
|
+
...transactionMetaInterfaceFields(),
|
|
1750
|
+
innerInstructions
|
|
1751
|
+
},
|
|
1752
|
+
interfaces: [transactionMetaInterface()],
|
|
1753
|
+
name
|
|
1754
|
+
});
|
|
1755
|
+
var memoisedTransactionMetaUnparsed;
|
|
1756
|
+
var transactionMetaUnparsed = () => {
|
|
1757
|
+
if (!memoisedTransactionMetaUnparsed)
|
|
1758
|
+
memoisedTransactionMetaUnparsed = transactionMetaType(
|
|
1759
|
+
"TransactionMetaUnparsed",
|
|
1760
|
+
"Non-parsed transaction meta",
|
|
1761
|
+
list(
|
|
1762
|
+
object("TransactionMetaInnerInstructionsUnparsed", {
|
|
1763
|
+
index: number(),
|
|
1764
|
+
instructions: list(
|
|
1765
|
+
object("TransactionMetaInnerInstructionsUnparsedInstruction", {
|
|
1766
|
+
index: number(),
|
|
1767
|
+
instructions: list(type(transactionInstruction()))
|
|
1768
|
+
})
|
|
1769
|
+
)
|
|
1770
|
+
})
|
|
1771
|
+
)
|
|
1772
|
+
);
|
|
1773
|
+
return memoisedTransactionMetaUnparsed;
|
|
1774
|
+
};
|
|
1775
|
+
var memoisedTransactionMetaParsed;
|
|
1776
|
+
var transactionMetaParsed = () => {
|
|
1777
|
+
if (!memoisedTransactionMetaParsed)
|
|
1778
|
+
memoisedTransactionMetaParsed = transactionMetaType(
|
|
1779
|
+
"TransactionMetaParsed",
|
|
1780
|
+
"Parsed transaction meta",
|
|
1781
|
+
list(
|
|
1782
|
+
object("TransactionMetaInnerInstructionsParsed", {
|
|
1783
|
+
index: number(),
|
|
1784
|
+
instructions: list(type(parsedTransactionInstructionInterface()))
|
|
1785
|
+
})
|
|
1786
|
+
)
|
|
1787
|
+
);
|
|
1788
|
+
return memoisedTransactionMetaParsed;
|
|
1789
|
+
};
|
|
1790
|
+
var memoisedTransactionMessageInterfaceFields;
|
|
1791
|
+
var transactionMessageInterfaceFields = () => {
|
|
1792
|
+
if (!memoisedTransactionMessageInterfaceFields)
|
|
1793
|
+
memoisedTransactionMessageInterfaceFields = {
|
|
1794
|
+
addressTableLookups: list(type(addressTableLookup())),
|
|
1795
|
+
format: string(),
|
|
1796
|
+
header: object("TransactionJsonTransactionHeader", {
|
|
1797
|
+
numReadonlySignedAccounts: number(),
|
|
1798
|
+
numReadonlyUnsignedAccounts: number(),
|
|
1799
|
+
numRequiredSignatures: number()
|
|
1800
|
+
}),
|
|
1801
|
+
recentBlockhash: string()
|
|
1802
|
+
};
|
|
1803
|
+
return memoisedTransactionMessageInterfaceFields;
|
|
1804
|
+
};
|
|
1805
|
+
var memoisedTransactionMessageInterface;
|
|
1806
|
+
var transactionMessageInterface = () => {
|
|
1807
|
+
if (!memoisedTransactionMessageInterface)
|
|
1808
|
+
memoisedTransactionMessageInterface = new GraphQLInterfaceType({
|
|
1809
|
+
fields: {
|
|
1810
|
+
...transactionMessageInterfaceFields()
|
|
1811
|
+
},
|
|
1812
|
+
name: "TransactionMessage",
|
|
1813
|
+
resolveType(message) {
|
|
1814
|
+
if (message.format === "parsed") {
|
|
1815
|
+
return "TransactionMessageParsed";
|
|
1816
|
+
}
|
|
1817
|
+
return "TransactionMessageUnparsed";
|
|
1818
|
+
}
|
|
1819
|
+
});
|
|
1820
|
+
return memoisedTransactionMessageInterface;
|
|
1821
|
+
};
|
|
1822
|
+
var transactionMessageType = (name, description, accountKeys, instructions) => new GraphQLObjectType({
|
|
1823
|
+
description,
|
|
1824
|
+
fields: {
|
|
1825
|
+
...transactionMessageInterfaceFields(),
|
|
1826
|
+
accountKeys,
|
|
1827
|
+
instructions
|
|
1828
|
+
},
|
|
1829
|
+
interfaces: [transactionMessageInterface()],
|
|
1830
|
+
name
|
|
1831
|
+
});
|
|
1832
|
+
var memoisedTransactionMessageUnparsed;
|
|
1833
|
+
var transactionMessageUnparsed = () => {
|
|
1834
|
+
if (!memoisedTransactionMessageUnparsed)
|
|
1835
|
+
memoisedTransactionMessageUnparsed = transactionMessageType(
|
|
1836
|
+
"TransactionMessageUnparsed",
|
|
1837
|
+
"Non-parsed transaction message",
|
|
1838
|
+
list(string()),
|
|
1839
|
+
list(type(transactionInstruction()))
|
|
1840
|
+
);
|
|
1841
|
+
return memoisedTransactionMessageUnparsed;
|
|
1842
|
+
};
|
|
1843
|
+
var memoisedTransactionMessageParsed;
|
|
1844
|
+
var transactionMessageParsed = () => {
|
|
1845
|
+
if (!memoisedTransactionMessageParsed)
|
|
1846
|
+
memoisedTransactionMessageParsed = transactionMessageType(
|
|
1847
|
+
"TransactionMessageParsed",
|
|
1848
|
+
"Parsed transaction message",
|
|
1849
|
+
list(
|
|
1850
|
+
object("transactionMessageParsedAccountKey", {
|
|
1851
|
+
pubkey: string(),
|
|
1852
|
+
signer: boolean(),
|
|
1853
|
+
source: string(),
|
|
1854
|
+
writable: boolean()
|
|
1855
|
+
})
|
|
1856
|
+
),
|
|
1857
|
+
list(type(parsedTransactionInstructionInterface()))
|
|
1858
|
+
);
|
|
1859
|
+
return memoisedTransactionMessageParsed;
|
|
1860
|
+
};
|
|
1861
|
+
var memoisedTransactionTransaction;
|
|
1862
|
+
var transactionTransaction = () => {
|
|
1863
|
+
if (!memoisedTransactionTransaction)
|
|
1864
|
+
memoisedTransactionTransaction = new GraphQLObjectType({
|
|
1865
|
+
fields: {
|
|
1866
|
+
message: type(transactionMessageInterface()),
|
|
1867
|
+
signatures: list(string())
|
|
1868
|
+
},
|
|
1869
|
+
name: "TransactionTransaction"
|
|
1870
|
+
});
|
|
1871
|
+
return memoisedTransactionTransaction;
|
|
1872
|
+
};
|
|
1873
|
+
var memoisedTransactionInterfaceFields;
|
|
1874
|
+
var transactionInterfaceFields = () => {
|
|
1875
|
+
if (!memoisedTransactionInterfaceFields)
|
|
1876
|
+
memoisedTransactionInterfaceFields = {
|
|
1877
|
+
blockTime: bigint(),
|
|
1878
|
+
encoding: string(),
|
|
1879
|
+
meta: type(transactionMetaInterface()),
|
|
1880
|
+
slot: bigint()
|
|
1881
|
+
};
|
|
1882
|
+
return memoisedTransactionInterfaceFields;
|
|
1883
|
+
};
|
|
1884
|
+
var memoisedTransactionInterface;
|
|
1885
|
+
var transactionInterface = () => {
|
|
1886
|
+
if (!memoisedTransactionInterface)
|
|
1887
|
+
memoisedTransactionInterface = new GraphQLInterfaceType({
|
|
1888
|
+
fields: {
|
|
1889
|
+
...transactionInterfaceFields()
|
|
1890
|
+
},
|
|
1891
|
+
name: "Transaction",
|
|
1892
|
+
resolveType(transaction) {
|
|
1893
|
+
if (transaction.encoding === "base58") {
|
|
1894
|
+
return "TransactionBase58";
|
|
1895
|
+
}
|
|
1896
|
+
if (transaction.encoding === "base64") {
|
|
1897
|
+
return "TransactionBase64";
|
|
1898
|
+
}
|
|
1899
|
+
if (transaction.encoding === "json") {
|
|
1900
|
+
return "TransactionJson";
|
|
1901
|
+
}
|
|
1902
|
+
return "TransactionJsonParsed";
|
|
1903
|
+
}
|
|
1904
|
+
});
|
|
1905
|
+
return memoisedTransactionInterface;
|
|
1906
|
+
};
|
|
1907
|
+
var transactionType = (name, description, transaction) => new GraphQLObjectType({
|
|
1908
|
+
description,
|
|
1909
|
+
fields: {
|
|
1910
|
+
...transactionInterfaceFields(),
|
|
1911
|
+
transaction
|
|
1912
|
+
},
|
|
1913
|
+
interfaces: [transactionInterface()],
|
|
1914
|
+
name
|
|
1915
|
+
});
|
|
1916
|
+
var memoisedTransactionBase58;
|
|
1917
|
+
var transactionBase58 = () => {
|
|
1918
|
+
if (!memoisedTransactionBase58)
|
|
1919
|
+
memoisedTransactionBase58 = transactionType(
|
|
1920
|
+
"TransactionBase58",
|
|
1921
|
+
"A Solana transaction as base58 encoded data",
|
|
1922
|
+
string()
|
|
1923
|
+
);
|
|
1924
|
+
return memoisedTransactionBase58;
|
|
1925
|
+
};
|
|
1926
|
+
var memoisedTransactionBase64;
|
|
1927
|
+
var transactionBase64 = () => {
|
|
1928
|
+
if (!memoisedTransactionBase64)
|
|
1929
|
+
memoisedTransactionBase64 = transactionType(
|
|
1930
|
+
"TransactionBase64",
|
|
1931
|
+
"A Solana transaction as base64 encoded data",
|
|
1932
|
+
string()
|
|
1933
|
+
);
|
|
1934
|
+
return memoisedTransactionBase64;
|
|
1935
|
+
};
|
|
1936
|
+
var memoisedTransactionJson;
|
|
1937
|
+
var transactionJson = () => {
|
|
1938
|
+
if (!memoisedTransactionJson)
|
|
1939
|
+
memoisedTransactionJson = transactionType(
|
|
1940
|
+
"TransactionJson",
|
|
1941
|
+
"A Solana transaction as a JSON object",
|
|
1942
|
+
type(transactionTransaction())
|
|
1943
|
+
);
|
|
1944
|
+
return memoisedTransactionJson;
|
|
1945
|
+
};
|
|
1946
|
+
var memoisedTransactionJsonParsed;
|
|
1947
|
+
var transactionJsonParsed = () => {
|
|
1948
|
+
if (!memoisedTransactionJsonParsed)
|
|
1949
|
+
memoisedTransactionJsonParsed = transactionType(
|
|
1950
|
+
"TransactionJsonParsed",
|
|
1951
|
+
"A Solana transaction as a parsed JSON object",
|
|
1952
|
+
type(transactionTransaction())
|
|
1953
|
+
);
|
|
1954
|
+
return memoisedTransactionJsonParsed;
|
|
1955
|
+
};
|
|
1956
|
+
var memoisedTransactionTypes;
|
|
1957
|
+
var transactionTypes = () => {
|
|
1958
|
+
if (!memoisedTransactionTypes)
|
|
1959
|
+
memoisedTransactionTypes = [
|
|
1960
|
+
partiallyDecodedTransactionInstruction(),
|
|
1961
|
+
...parsedInstructionsAddressLookupTable(),
|
|
1962
|
+
...parsedInstructionsBpfLoader(),
|
|
1963
|
+
...parsedInstructionsBpfUpgradeableLoader(),
|
|
1964
|
+
...parsedInstructionsStake(),
|
|
1965
|
+
...parsedInstructionsSplAssociatedToken(),
|
|
1966
|
+
parsedInstructionSplMemo(),
|
|
1967
|
+
...parsedInstructionsSplToken(),
|
|
1968
|
+
...parsedInstructionsSystem(),
|
|
1969
|
+
...parsedInstructionsVote(),
|
|
1970
|
+
transactionMetaUnparsed(),
|
|
1971
|
+
transactionMetaParsed(),
|
|
1972
|
+
transactionMessageUnparsed(),
|
|
1973
|
+
transactionMessageParsed(),
|
|
1974
|
+
transactionBase58(),
|
|
1975
|
+
transactionBase64(),
|
|
1976
|
+
transactionJson(),
|
|
1977
|
+
transactionJsonParsed()
|
|
1978
|
+
];
|
|
1979
|
+
return memoisedTransactionTypes;
|
|
1980
|
+
};
|
|
1981
|
+
|
|
1982
|
+
// src/schema/transaction/query.ts
|
|
1983
|
+
var transactionQuery = () => ({
|
|
1984
|
+
transaction: {
|
|
1985
|
+
args: {
|
|
1986
|
+
commitment: type(commitmentInputType()),
|
|
1987
|
+
encoding: type(transactionEncodingInputType()),
|
|
1988
|
+
maxSupportedTransactionVersion: type(maxSupportedTransactionVersionInputType()),
|
|
1989
|
+
signature: nonNull(string())
|
|
1990
|
+
},
|
|
1991
|
+
resolve: (_parent, args, context) => context.resolveTransaction(args),
|
|
1992
|
+
type: transactionInterface()
|
|
1993
|
+
}
|
|
1994
|
+
});
|
|
1995
|
+
|
|
1996
|
+
// src/schema/block/types.ts
|
|
1997
|
+
var memoisedTransactionForAccounts;
|
|
1998
|
+
var transactionForAccounts = () => {
|
|
1999
|
+
if (!memoisedTransactionForAccounts)
|
|
2000
|
+
memoisedTransactionForAccounts = new GraphQLObjectType({
|
|
2001
|
+
fields: {
|
|
2002
|
+
meta: object("TransactionMetaForAccounts", {
|
|
2003
|
+
computeUnitsUsed: bigint(),
|
|
2004
|
+
err: string(),
|
|
2005
|
+
fee: bigint(),
|
|
2006
|
+
format: string(),
|
|
2007
|
+
loadedAddresses: type(transactionMetaLoadedAddresses()),
|
|
2008
|
+
logMessages: list(string()),
|
|
2009
|
+
postBalances: list(bigint()),
|
|
2010
|
+
postTokenBalances: list(type(tokenBalance())),
|
|
2011
|
+
preBalances: list(bigint()),
|
|
2012
|
+
preTokenBalances: list(type(tokenBalance())),
|
|
2013
|
+
returnData: type(returnData()),
|
|
2014
|
+
rewards: list(type(reward())),
|
|
2015
|
+
status: type(transactionStatus())
|
|
2016
|
+
}),
|
|
2017
|
+
transaction: type(transactionInterface()),
|
|
2018
|
+
// TODO
|
|
2019
|
+
version: string()
|
|
2020
|
+
},
|
|
2021
|
+
name: "TransactionForAccounts"
|
|
2022
|
+
});
|
|
2023
|
+
return memoisedTransactionForAccounts;
|
|
2024
|
+
};
|
|
2025
|
+
var memoisedBlockInterfaceFields;
|
|
2026
|
+
var blockInterfaceFields = () => {
|
|
2027
|
+
if (!memoisedBlockInterfaceFields)
|
|
2028
|
+
memoisedBlockInterfaceFields = {
|
|
2029
|
+
blockHeight: bigint(),
|
|
2030
|
+
blockTime: bigint(),
|
|
2031
|
+
blockhash: string(),
|
|
2032
|
+
parentSlot: bigint(),
|
|
2033
|
+
previousBlockhash: string(),
|
|
2034
|
+
rewards: list(type(reward()))
|
|
2035
|
+
};
|
|
2036
|
+
return memoisedBlockInterfaceFields;
|
|
2037
|
+
};
|
|
2038
|
+
var memoisedBlockInterface;
|
|
2039
|
+
var blockInterface = () => {
|
|
2040
|
+
if (!memoisedBlockInterface)
|
|
2041
|
+
memoisedBlockInterface = new GraphQLInterfaceType({
|
|
2042
|
+
fields: {
|
|
2043
|
+
...blockInterfaceFields()
|
|
2044
|
+
},
|
|
2045
|
+
name: "Block",
|
|
2046
|
+
resolveType(block) {
|
|
2047
|
+
if (block.transactionDetails === "signatures") {
|
|
2048
|
+
return "BlockWithSignatures";
|
|
2049
|
+
}
|
|
2050
|
+
if (block.transactionDetails === "accounts") {
|
|
2051
|
+
return "BlockWithAccounts";
|
|
2052
|
+
}
|
|
2053
|
+
if (block.transactionDetails === "none") {
|
|
2054
|
+
return "BlockWithNoTransactions";
|
|
2055
|
+
}
|
|
2056
|
+
return "BlockWithTransactions";
|
|
2057
|
+
}
|
|
2058
|
+
});
|
|
2059
|
+
return memoisedBlockInterface;
|
|
2060
|
+
};
|
|
2061
|
+
var memoisedBlockWithNoTransactions;
|
|
2062
|
+
var blockWithNoTransactions = () => {
|
|
2063
|
+
if (!memoisedBlockWithNoTransactions)
|
|
2064
|
+
memoisedBlockWithNoTransactions = new GraphQLObjectType({
|
|
2065
|
+
fields: {
|
|
2066
|
+
...blockInterfaceFields()
|
|
2067
|
+
},
|
|
2068
|
+
interfaces: [blockInterface()],
|
|
2069
|
+
name: "BlockWithNoTransactions"
|
|
2070
|
+
});
|
|
2071
|
+
return memoisedBlockWithNoTransactions;
|
|
2072
|
+
};
|
|
2073
|
+
var memoisedBlockWithSignatures;
|
|
2074
|
+
var blockWithSignatures = () => {
|
|
2075
|
+
if (!memoisedBlockWithSignatures)
|
|
2076
|
+
memoisedBlockWithSignatures = new GraphQLObjectType({
|
|
2077
|
+
fields: {
|
|
2078
|
+
...blockInterfaceFields(),
|
|
2079
|
+
signatures: list(string())
|
|
2080
|
+
},
|
|
2081
|
+
interfaces: [blockInterface()],
|
|
2082
|
+
name: "BlockWithSignatures"
|
|
2083
|
+
});
|
|
2084
|
+
return memoisedBlockWithSignatures;
|
|
2085
|
+
};
|
|
2086
|
+
var memoisedBlockWithAccounts;
|
|
2087
|
+
var blockWithAccounts = () => {
|
|
2088
|
+
if (!memoisedBlockWithAccounts)
|
|
2089
|
+
memoisedBlockWithAccounts = new GraphQLObjectType({
|
|
2090
|
+
fields: {
|
|
2091
|
+
...blockInterfaceFields(),
|
|
2092
|
+
transactions: list(type(transactionForAccounts()))
|
|
2093
|
+
},
|
|
2094
|
+
interfaces: [blockInterface()],
|
|
2095
|
+
name: "BlockWithAccounts"
|
|
2096
|
+
});
|
|
2097
|
+
return memoisedBlockWithAccounts;
|
|
2098
|
+
};
|
|
2099
|
+
var memoisedBlockWithTransactions;
|
|
2100
|
+
var blockWithTransactions = () => {
|
|
2101
|
+
if (!memoisedBlockWithTransactions)
|
|
2102
|
+
memoisedBlockWithTransactions = new GraphQLObjectType({
|
|
2103
|
+
fields: {
|
|
2104
|
+
...blockInterfaceFields(),
|
|
2105
|
+
transactions: list(type(transactionInterface()))
|
|
2106
|
+
},
|
|
2107
|
+
interfaces: [blockInterface()],
|
|
2108
|
+
name: "BlockWithTransactions"
|
|
2109
|
+
});
|
|
2110
|
+
return memoisedBlockWithTransactions;
|
|
2111
|
+
};
|
|
2112
|
+
var memoisedBlockTypes;
|
|
2113
|
+
var blockTypes = () => {
|
|
2114
|
+
if (!memoisedBlockTypes)
|
|
2115
|
+
memoisedBlockTypes = [
|
|
2116
|
+
blockWithNoTransactions(),
|
|
2117
|
+
blockWithSignatures(),
|
|
2118
|
+
blockWithAccounts(),
|
|
2119
|
+
blockWithTransactions()
|
|
2120
|
+
];
|
|
2121
|
+
return memoisedBlockTypes;
|
|
2122
|
+
};
|
|
2123
|
+
|
|
2124
|
+
// src/schema/block/query.ts
|
|
2125
|
+
var blockQuery = () => ({
|
|
2126
|
+
block: {
|
|
2127
|
+
args: {
|
|
2128
|
+
commitment: type(commitmentInputType()),
|
|
2129
|
+
encoding: type(transactionEncodingInputType()),
|
|
2130
|
+
maxSupportedTransactionVersion: string(),
|
|
2131
|
+
rewards: boolean(),
|
|
2132
|
+
slot: nonNull(bigint()),
|
|
2133
|
+
transactionDetails: type(blockTransactionDetailsInputType())
|
|
2134
|
+
},
|
|
2135
|
+
resolve: (_parent, args, context) => context.resolveBlock(args),
|
|
2136
|
+
type: blockInterface()
|
|
2137
|
+
}
|
|
2138
|
+
});
|
|
2139
|
+
var programAccount = () => new GraphQLObjectType({
|
|
2140
|
+
fields: {
|
|
2141
|
+
account: type(accountInterface()),
|
|
2142
|
+
pubkey: string()
|
|
2143
|
+
},
|
|
2144
|
+
name: "ProgramAccount"
|
|
2145
|
+
});
|
|
2146
|
+
|
|
2147
|
+
// src/schema/program-accounts/query.ts
|
|
2148
|
+
var programAccountsQuery = () => ({
|
|
2149
|
+
programAccounts: {
|
|
2150
|
+
args: {
|
|
2151
|
+
commitment: type(commitmentInputType()),
|
|
2152
|
+
dataSlice: type(dataSliceInputType()),
|
|
2153
|
+
encoding: type(accountEncodingInputType()),
|
|
2154
|
+
filters: list(type(programAccountFilterInputType())),
|
|
2155
|
+
minContextSlot: bigint(),
|
|
2156
|
+
programAddress: nonNull(string()),
|
|
2157
|
+
withContext: string()
|
|
2158
|
+
},
|
|
2159
|
+
resolve: (_parent, args, context) => context.resolveProgramAccounts(args),
|
|
2160
|
+
type: new GraphQLList(programAccount())
|
|
2161
|
+
}
|
|
2162
|
+
});
|
|
41
2163
|
|
|
42
2164
|
// src/rpc.ts
|
|
43
2165
|
function createRpcGraphQL(rpc) {
|
|
@@ -45,11 +2167,14 @@ function createRpcGraphQL(rpc) {
|
|
|
45
2167
|
const schema = new GraphQLSchema({
|
|
46
2168
|
query: new GraphQLObjectType({
|
|
47
2169
|
fields: {
|
|
48
|
-
|
|
2170
|
+
...accountQuery(),
|
|
2171
|
+
...blockQuery(),
|
|
2172
|
+
...programAccountsQuery(),
|
|
2173
|
+
...transactionQuery()
|
|
49
2174
|
},
|
|
50
2175
|
name: "RootQuery"
|
|
51
2176
|
}),
|
|
52
|
-
types: []
|
|
2177
|
+
types: [...accountTypes(), ...blockTypes(), ...transactionTypes()]
|
|
53
2178
|
});
|
|
54
2179
|
return {
|
|
55
2180
|
context,
|