@solana/rpc-graphql 2.0.0-experimental.9c8a30e → 2.0.0-experimental.a157265
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1088 -30
- package/dist/index.browser.cjs +2367 -2055
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.js +2363 -2056
- package/dist/index.browser.js.map +1 -1
- package/dist/index.native.js +2363 -2052
- package/dist/index.native.js.map +1 -1
- package/dist/index.node.cjs +2367 -2051
- package/dist/index.node.cjs.map +1 -1
- package/dist/index.node.js +2363 -2052
- package/dist/index.node.js.map +1 -1
- package/dist/types/context.d.ts +19 -18
- package/dist/types/context.d.ts.map +1 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/loaders/account.d.ts +7 -0
- package/dist/types/loaders/account.d.ts.map +1 -0
- package/dist/types/loaders/block.d.ts +7 -0
- package/dist/types/loaders/block.d.ts.map +1 -0
- package/dist/types/loaders/common/resolve-info.d.ts +3 -0
- package/dist/types/loaders/common/resolve-info.d.ts.map +1 -0
- package/dist/types/loaders/program-accounts.d.ts +9 -0
- package/dist/types/loaders/program-accounts.d.ts.map +1 -0
- package/dist/types/loaders/transaction.d.ts +7 -0
- package/dist/types/loaders/transaction.d.ts.map +1 -0
- package/dist/types/loaders/transformers/account.d.ts +8 -0
- package/dist/types/loaders/transformers/account.d.ts.map +1 -0
- package/dist/types/loaders/transformers/block.d.ts +6 -0
- package/dist/types/loaders/transformers/block.d.ts.map +1 -0
- package/dist/types/loaders/transformers/transaction.d.ts +5 -0
- package/dist/types/loaders/transformers/transaction.d.ts.map +1 -0
- package/dist/types/resolvers/account.d.ts +8 -0
- package/dist/types/resolvers/account.d.ts.map +1 -0
- package/dist/types/rpc.d.ts +6 -4
- package/dist/types/rpc.d.ts.map +1 -0
- package/dist/types/schema/account.d.ts +112 -0
- package/dist/types/schema/account.d.ts.map +1 -0
- package/dist/types/schema/block.d.ts +17 -0
- package/dist/types/schema/block.d.ts.map +1 -0
- package/dist/types/schema/common/inputs.d.ts +3 -0
- package/dist/types/schema/common/inputs.d.ts.map +1 -0
- package/dist/types/schema/common/scalars.d.ts +45 -0
- package/dist/types/schema/common/scalars.d.ts.map +1 -0
- package/dist/types/schema/common/types.d.ts +27 -0
- package/dist/types/schema/common/types.d.ts.map +1 -0
- package/dist/types/schema/index.d.ts +2 -0
- package/dist/types/schema/index.d.ts.map +1 -0
- package/dist/types/schema/instruction.d.ts +949 -0
- package/dist/types/schema/instruction.d.ts.map +1 -0
- package/dist/types/schema/program-accounts.d.ts +12 -0
- package/dist/types/schema/program-accounts.d.ts.map +1 -0
- package/dist/types/schema/transaction.d.ts +16 -0
- package/dist/types/schema/transaction.d.ts.map +1 -0
- package/package.json +15 -11
- package/dist/types/cache.d.ts +0 -7
- package/dist/types/schema/account/index.d.ts +0 -3
- package/dist/types/schema/account/query.d.ts +0 -38
- package/dist/types/schema/account/types.d.ts +0 -5
- package/dist/types/schema/block/index.d.ts +0 -3
- package/dist/types/schema/block/query.d.ts +0 -42
- package/dist/types/schema/block/types.d.ts +0 -7
- package/dist/types/schema/inputs.d.ts +0 -9
- package/dist/types/schema/picks.d.ts +0 -36
- package/dist/types/schema/program-accounts/index.d.ts +0 -2
- package/dist/types/schema/program-accounts/query.d.ts +0 -47
- package/dist/types/schema/scalars.d.ts +0 -3
- package/dist/types/schema/transaction/index.d.ts +0 -3
- package/dist/types/schema/transaction/query.d.ts +0 -33
- package/dist/types/schema/transaction/types.d.ts +0 -12
package/dist/index.browser.cjs
CHANGED
|
@@ -1,46 +1,19 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var graphql = require('graphql');
|
|
4
|
+
var DataLoader = require('dataloader');
|
|
5
|
+
var fastStableStringify = require('fast-stable-stringify');
|
|
6
|
+
var schema = require('@graphql-tools/schema');
|
|
4
7
|
|
|
5
|
-
|
|
8
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
6
9
|
|
|
7
|
-
|
|
8
|
-
var
|
|
9
|
-
if (typeof value2 === "bigint") {
|
|
10
|
-
return value2.toString() + "n";
|
|
11
|
-
}
|
|
12
|
-
return value2;
|
|
13
|
-
});
|
|
14
|
-
var parseValue = (value) => JSON.parse(value, (_, value2) => {
|
|
15
|
-
if (typeof value2 === "string" && /\d+n$/.test(value2)) {
|
|
16
|
-
return BigInt(value2.slice(0, -1));
|
|
17
|
-
}
|
|
18
|
-
return value2;
|
|
19
|
-
});
|
|
20
|
-
var cacheKey = (key, variables) => `GraphQLCache:${stringifyValue(key)}:${stringifyValue(variables)}`;
|
|
21
|
-
function createGraphQLCache() {
|
|
22
|
-
return {
|
|
23
|
-
// Browser
|
|
24
|
-
flush: () => {
|
|
25
|
-
for (let i = localStorage.length - 1; i >= 0; i--) {
|
|
26
|
-
const storageKey = localStorage.key(i);
|
|
27
|
-
if (storageKey && storageKey.startsWith("GraphQLCache:")) {
|
|
28
|
-
localStorage.removeItem(storageKey);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
get: (key, variables) => {
|
|
33
|
-
const value = localStorage.getItem(cacheKey(key, variables));
|
|
34
|
-
return value === null ? null : parseValue(value);
|
|
35
|
-
},
|
|
36
|
-
insert: (key, variables, value) => {
|
|
37
|
-
localStorage.setItem(cacheKey(key, variables), stringifyValue(value));
|
|
38
|
-
}
|
|
39
|
-
} ;
|
|
40
|
-
}
|
|
10
|
+
var DataLoader__default = /*#__PURE__*/_interopDefault(DataLoader);
|
|
11
|
+
var fastStableStringify__default = /*#__PURE__*/_interopDefault(fastStableStringify);
|
|
41
12
|
|
|
42
|
-
// src/
|
|
43
|
-
|
|
13
|
+
// src/rpc.ts
|
|
14
|
+
|
|
15
|
+
// src/loaders/common/resolve-info.ts
|
|
16
|
+
function onlyPresentFieldRequested(fieldName, info) {
|
|
44
17
|
if (info && info.fieldNodes[0].selectionSet) {
|
|
45
18
|
const selectionSet = info.fieldNodes[0].selectionSet;
|
|
46
19
|
const requestedFields = selectionSet.selections.map((field) => {
|
|
@@ -49,53 +22,206 @@ async function resolveAccount({ address, encoding = "jsonParsed", ...config }, c
|
|
|
49
22
|
}
|
|
50
23
|
return null;
|
|
51
24
|
});
|
|
52
|
-
if (requestedFields && requestedFields.length === 1 && requestedFields[0] ===
|
|
53
|
-
return
|
|
25
|
+
if (requestedFields && requestedFields.length === 1 && requestedFields[0] === fieldName) {
|
|
26
|
+
return true;
|
|
54
27
|
}
|
|
55
28
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
const
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// src/loaders/transformers/account.ts
|
|
33
|
+
function transformParsedAccountData(parsedAccountData) {
|
|
34
|
+
const {
|
|
35
|
+
parsed: { info: result, type: accountType },
|
|
36
|
+
program: programName,
|
|
37
|
+
programId
|
|
38
|
+
} = parsedAccountData;
|
|
39
|
+
result.accountType = accountType;
|
|
40
|
+
result.programId = programId;
|
|
41
|
+
result.programName = programName;
|
|
42
|
+
return result;
|
|
43
|
+
}
|
|
44
|
+
function transformLoadedAccount({
|
|
45
|
+
account,
|
|
46
|
+
address,
|
|
47
|
+
encoding
|
|
48
|
+
}) {
|
|
49
|
+
const [
|
|
50
|
+
// The account's data, either encoded or parsed.
|
|
51
|
+
data,
|
|
52
|
+
// Tells GraphQL which encoding has been returned
|
|
53
|
+
// by the RPC.
|
|
54
|
+
responseEncoding
|
|
55
|
+
] = Array.isArray(account.data) ? encoding === "jsonParsed" ? (
|
|
56
|
+
// The requested encoding is jsonParsed,
|
|
57
|
+
// but the data could not be parsed.
|
|
58
|
+
// Defaults to base64 encoding.
|
|
59
|
+
[{ data: account.data[0] }, "base64"]
|
|
60
|
+
) : (
|
|
61
|
+
// The requested encoding is base58,
|
|
62
|
+
// base64, or base64+zstd.
|
|
63
|
+
[{ data: account.data[0] }, encoding]
|
|
64
|
+
) : (
|
|
65
|
+
// The account data was returned as an object,
|
|
66
|
+
// so it was parsed successfully.
|
|
67
|
+
[transformParsedAccountData(account.data), "jsonParsed"]
|
|
68
|
+
);
|
|
69
|
+
account.address = address;
|
|
70
|
+
account.encoding = responseEncoding;
|
|
71
|
+
account.ownerProgram = account.owner;
|
|
72
|
+
return {
|
|
73
|
+
...account,
|
|
74
|
+
...data
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// src/loaders/account.ts
|
|
79
|
+
function normalizeArgs({
|
|
80
|
+
address,
|
|
81
|
+
commitment = "confirmed",
|
|
82
|
+
dataSlice,
|
|
83
|
+
encoding = "jsonParsed",
|
|
84
|
+
minContextSlot
|
|
85
|
+
}) {
|
|
86
|
+
return { address, commitment, dataSlice, encoding, minContextSlot };
|
|
87
|
+
}
|
|
88
|
+
async function loadAccount(rpc, { address, ...config }) {
|
|
89
|
+
const account = await rpc.getAccountInfo(address, config).send().then((res) => res.value).catch((e) => {
|
|
62
90
|
throw e;
|
|
63
91
|
});
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
92
|
+
return account === null ? { address } : transformLoadedAccount({ account, address, encoding: config.encoding });
|
|
93
|
+
}
|
|
94
|
+
function createAccountBatchLoadFn(rpc) {
|
|
95
|
+
const resolveAccountUsingRpc = loadAccount.bind(null, rpc);
|
|
96
|
+
return async (accountQueryArgs) => {
|
|
97
|
+
return await Promise.all(accountQueryArgs.map(async (args) => await resolveAccountUsingRpc(args)));
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
function createAccountLoader(rpc) {
|
|
101
|
+
const loader = new DataLoader__default.default(createAccountBatchLoadFn(rpc), { cacheKeyFn: fastStableStringify__default.default });
|
|
102
|
+
return {
|
|
103
|
+
load: async (args, info) => {
|
|
104
|
+
if (onlyPresentFieldRequested("address", info)) {
|
|
105
|
+
return { address: args.address };
|
|
106
|
+
}
|
|
107
|
+
return loader.load(normalizeArgs(args));
|
|
108
|
+
}
|
|
75
109
|
};
|
|
76
|
-
cache.insert(address, requestConfig, queryResponse);
|
|
77
|
-
return queryResponse;
|
|
78
110
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
if (
|
|
83
|
-
|
|
111
|
+
|
|
112
|
+
// src/loaders/transformers/transaction.ts
|
|
113
|
+
function transformParsedInstruction(parsedInstruction) {
|
|
114
|
+
if ("parsed" in parsedInstruction) {
|
|
115
|
+
const {
|
|
116
|
+
parsed: { info: data, type: instructionType },
|
|
117
|
+
program: programName,
|
|
118
|
+
programId
|
|
119
|
+
} = parsedInstruction;
|
|
120
|
+
return { instructionType, programId, programName, ...data };
|
|
121
|
+
} else {
|
|
122
|
+
return parsedInstruction;
|
|
84
123
|
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
124
|
+
}
|
|
125
|
+
function transformParsedTransaction(parsedTransaction) {
|
|
126
|
+
const transactionData = parsedTransaction.transaction;
|
|
127
|
+
const transactionMeta = parsedTransaction.meta;
|
|
128
|
+
transactionData.message.instructions = transactionData.message.instructions.map(transformParsedInstruction);
|
|
129
|
+
transactionMeta.innerInstructions = transactionMeta.innerInstructions.map((innerInstruction) => {
|
|
130
|
+
innerInstruction.instructions = innerInstruction.instructions.map(transformParsedInstruction);
|
|
131
|
+
return innerInstruction;
|
|
132
|
+
});
|
|
133
|
+
return [transactionData, transactionMeta];
|
|
134
|
+
}
|
|
135
|
+
function transformLoadedTransaction({ encoding, transaction }) {
|
|
136
|
+
const [transactionData, transactionMeta] = Array.isArray(transaction.transaction) ? (
|
|
137
|
+
// The requested encoding is base58 or base64.
|
|
138
|
+
[transaction.transaction[0], transaction.meta]
|
|
139
|
+
) : (
|
|
140
|
+
// The transaction was either partially parsed or
|
|
141
|
+
// fully JSON-parsed, which will be sorted later.
|
|
142
|
+
transformParsedTransaction(transaction)
|
|
143
|
+
);
|
|
144
|
+
transaction.data = transactionData;
|
|
145
|
+
transaction.encoding = encoding;
|
|
146
|
+
transaction.meta = transactionMeta;
|
|
147
|
+
return transaction;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
// src/loaders/transformers/block.ts
|
|
151
|
+
function transformLoadedBlock({
|
|
152
|
+
encoding,
|
|
153
|
+
block,
|
|
154
|
+
transactionDetails
|
|
155
|
+
}) {
|
|
156
|
+
if (typeof block === "object" && "transactions" in block) {
|
|
157
|
+
block.transactions = block.transactions.map((transaction) => {
|
|
158
|
+
if (transactionDetails === "accounts") {
|
|
159
|
+
return {
|
|
160
|
+
data: transaction.transaction,
|
|
161
|
+
meta: transaction.meta,
|
|
162
|
+
version: transaction.version
|
|
163
|
+
};
|
|
164
|
+
} else {
|
|
165
|
+
return transformLoadedTransaction({ encoding, transaction });
|
|
166
|
+
}
|
|
167
|
+
});
|
|
88
168
|
}
|
|
89
|
-
|
|
169
|
+
block.encoding = encoding;
|
|
170
|
+
block.transactionDetails = transactionDetails;
|
|
90
171
|
return block;
|
|
91
172
|
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
173
|
+
|
|
174
|
+
// src/loaders/block.ts
|
|
175
|
+
function normalizeArgs2({
|
|
176
|
+
commitment = "confirmed",
|
|
177
|
+
encoding = "jsonParsed",
|
|
178
|
+
slot,
|
|
179
|
+
transactionDetails = "full"
|
|
180
|
+
}) {
|
|
181
|
+
return {
|
|
182
|
+
commitment,
|
|
183
|
+
encoding,
|
|
184
|
+
// Always use 0 to avoid silly errors
|
|
185
|
+
maxSupportedTransactionVersion: 0,
|
|
186
|
+
slot,
|
|
187
|
+
transactionDetails
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
async function loadBlock(rpc, { slot, ...config }) {
|
|
191
|
+
const block = await rpc.getBlock(slot, config).send().catch((e) => {
|
|
192
|
+
throw e;
|
|
193
|
+
});
|
|
194
|
+
return block === null ? { slot } : transformLoadedBlock({ block, encoding: config.encoding, transactionDetails: config.transactionDetails });
|
|
195
|
+
}
|
|
196
|
+
function createBlockBatchLoadFn(rpc) {
|
|
197
|
+
const resolveBlockUsingRpc = loadBlock.bind(null, rpc);
|
|
198
|
+
return async (blockQueryArgs) => {
|
|
199
|
+
return await Promise.all(blockQueryArgs.map(async (args) => await resolveBlockUsingRpc(args)));
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
function createBlockLoader(rpc) {
|
|
203
|
+
const loader = new DataLoader__default.default(createBlockBatchLoadFn(rpc), { cacheKeyFn: fastStableStringify__default.default });
|
|
204
|
+
return {
|
|
205
|
+
load: async (args, info) => {
|
|
206
|
+
if (onlyPresentFieldRequested("slot", info)) {
|
|
207
|
+
return { slot: args.slot };
|
|
208
|
+
}
|
|
209
|
+
return loader.load(normalizeArgs2(args));
|
|
210
|
+
}
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
function normalizeArgs3({
|
|
214
|
+
commitment = "confirmed",
|
|
215
|
+
dataSlice,
|
|
216
|
+
encoding = "jsonParsed",
|
|
217
|
+
filters,
|
|
218
|
+
minContextSlot,
|
|
219
|
+
programAddress
|
|
220
|
+
}) {
|
|
221
|
+
return { commitment, dataSlice, encoding, filters, minContextSlot, programAddress };
|
|
222
|
+
}
|
|
223
|
+
async function loadProgramAccounts(rpc, { programAddress, ...config }) {
|
|
224
|
+
const programAccounts = await rpc.getProgramAccounts(programAddress, config).send().then((res) => {
|
|
99
225
|
if ("value" in res) {
|
|
100
226
|
return res.value;
|
|
101
227
|
}
|
|
@@ -103,2227 +229,2413 @@ async function resolveProgramAccounts({ programAddress, encoding = "jsonParsed",
|
|
|
103
229
|
}).catch((e) => {
|
|
104
230
|
throw e;
|
|
105
231
|
});
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
encoding: responseEncoding
|
|
114
|
-
};
|
|
115
|
-
});
|
|
116
|
-
cache.insert(programAddress, requestConfig, queryResponse);
|
|
117
|
-
return queryResponse;
|
|
232
|
+
return programAccounts.map(
|
|
233
|
+
(programAccount) => transformLoadedAccount({
|
|
234
|
+
account: programAccount.account,
|
|
235
|
+
address: programAccount.pubkey,
|
|
236
|
+
encoding: config.encoding
|
|
237
|
+
})
|
|
238
|
+
);
|
|
118
239
|
}
|
|
119
|
-
|
|
120
|
-
const
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
const transaction = await rpc.getTransaction(signature, requestConfig).send();
|
|
126
|
-
if (transaction === null) {
|
|
127
|
-
return null;
|
|
128
|
-
}
|
|
129
|
-
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"];
|
|
130
|
-
if (transaction.meta) {
|
|
131
|
-
transaction.meta["format"] = responseFormat;
|
|
132
|
-
}
|
|
133
|
-
if (transactionData.message) {
|
|
134
|
-
transactionData.message["format"] = responseFormat;
|
|
135
|
-
}
|
|
136
|
-
const queryResponse = {
|
|
137
|
-
...transaction,
|
|
138
|
-
encoding: responseEncoding,
|
|
139
|
-
transaction: transactionData
|
|
240
|
+
function createProgramAccountsBatchLoadFn(rpc) {
|
|
241
|
+
const resolveProgramAccountsUsingRpc = loadProgramAccounts.bind(null, rpc);
|
|
242
|
+
return async (programAccountsQueryArgs) => {
|
|
243
|
+
return await Promise.all(
|
|
244
|
+
programAccountsQueryArgs.map(async (args) => await resolveProgramAccountsUsingRpc(args))
|
|
245
|
+
);
|
|
140
246
|
};
|
|
141
|
-
cache.insert(signature, requestConfig, queryResponse);
|
|
142
|
-
return queryResponse;
|
|
143
247
|
}
|
|
144
|
-
function
|
|
145
|
-
const
|
|
248
|
+
function createProgramAccountsLoader(rpc) {
|
|
249
|
+
const loader = new DataLoader__default.default(createProgramAccountsBatchLoadFn(rpc), { cacheKeyFn: fastStableStringify__default.default });
|
|
146
250
|
return {
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
return resolveBlock(args, this.cache, this.rpc);
|
|
153
|
-
},
|
|
154
|
-
resolveProgramAccounts(args) {
|
|
155
|
-
return resolveProgramAccounts(args, this.cache, this.rpc);
|
|
156
|
-
},
|
|
157
|
-
resolveTransaction(args) {
|
|
158
|
-
return resolveTransaction(args, this.cache, this.rpc);
|
|
159
|
-
},
|
|
160
|
-
rpc
|
|
161
|
-
};
|
|
162
|
-
}
|
|
163
|
-
var BigIntScalar = () => new graphql.GraphQLScalarType({
|
|
164
|
-
name: "BigInt",
|
|
165
|
-
parseLiteral(ast) {
|
|
166
|
-
if (ast.kind === graphql.Kind.STRING) {
|
|
167
|
-
return BigInt(ast.value);
|
|
251
|
+
load: async (args, info) => {
|
|
252
|
+
if (onlyPresentFieldRequested("programAddress", info)) {
|
|
253
|
+
return { programAddress: args.programAddress };
|
|
254
|
+
}
|
|
255
|
+
return loader.load(normalizeArgs3(args));
|
|
168
256
|
}
|
|
169
|
-
|
|
170
|
-
},
|
|
171
|
-
parseValue(value) {
|
|
172
|
-
return BigInt(value);
|
|
173
|
-
},
|
|
174
|
-
serialize(value) {
|
|
175
|
-
return BigInt(value);
|
|
176
|
-
}
|
|
177
|
-
});
|
|
178
|
-
|
|
179
|
-
// src/schema/picks.ts
|
|
180
|
-
function boolean() {
|
|
181
|
-
return { type: graphql.GraphQLBoolean };
|
|
182
|
-
}
|
|
183
|
-
var memoisedBigint;
|
|
184
|
-
function bigint() {
|
|
185
|
-
if (!memoisedBigint)
|
|
186
|
-
memoisedBigint = { type: BigIntScalar() };
|
|
187
|
-
return memoisedBigint;
|
|
188
|
-
}
|
|
189
|
-
function number() {
|
|
190
|
-
return { type: graphql.GraphQLInt };
|
|
191
|
-
}
|
|
192
|
-
function string() {
|
|
193
|
-
return { type: graphql.GraphQLString };
|
|
257
|
+
};
|
|
194
258
|
}
|
|
195
|
-
function
|
|
259
|
+
function normalizeArgs4({ commitment = "confirmed", encoding = "jsonParsed", signature }) {
|
|
196
260
|
return {
|
|
197
|
-
|
|
261
|
+
commitment,
|
|
262
|
+
encoding,
|
|
263
|
+
// Always use 0 to avoid silly errors
|
|
264
|
+
maxSupportedTransactionVersion: 0,
|
|
265
|
+
signature
|
|
198
266
|
};
|
|
199
267
|
}
|
|
200
|
-
function
|
|
201
|
-
|
|
202
|
-
|
|
268
|
+
async function loadTransaction(rpc, { signature, ...config }) {
|
|
269
|
+
const { encoding } = config;
|
|
270
|
+
const transaction = await rpc.getTransaction(signature, config).send().catch((e) => {
|
|
271
|
+
throw e;
|
|
272
|
+
});
|
|
273
|
+
if (transaction === null) {
|
|
274
|
+
return null;
|
|
275
|
+
}
|
|
276
|
+
if (encoding !== "jsonParsed") {
|
|
277
|
+
const jsonParsedConfig = { ...config, encoding: "jsonParsed" };
|
|
278
|
+
const transactionJsonParsed = await rpc.getTransaction(signature, jsonParsedConfig).send().catch((e) => {
|
|
279
|
+
throw e;
|
|
280
|
+
});
|
|
281
|
+
if (transactionJsonParsed === null) {
|
|
282
|
+
return null;
|
|
283
|
+
}
|
|
284
|
+
transaction.meta = transactionJsonParsed.meta;
|
|
285
|
+
}
|
|
286
|
+
return transformLoadedTransaction({ encoding, transaction });
|
|
287
|
+
}
|
|
288
|
+
function createTransactionBatchLoadFn(rpc) {
|
|
289
|
+
const resolveTransactionUsingRpc = loadTransaction.bind(null, rpc);
|
|
290
|
+
return async (transactionQueryArgs) => {
|
|
291
|
+
return await Promise.all(transactionQueryArgs.map(async (args) => await resolveTransactionUsingRpc(args)));
|
|
203
292
|
};
|
|
204
293
|
}
|
|
205
|
-
function
|
|
294
|
+
function createTransactionLoader(rpc) {
|
|
295
|
+
const loader = new DataLoader__default.default(createTransactionBatchLoadFn(rpc), { cacheKeyFn: fastStableStringify__default.default });
|
|
206
296
|
return {
|
|
207
|
-
|
|
297
|
+
load: async (args, info) => {
|
|
298
|
+
if (onlyPresentFieldRequested("signature", info)) {
|
|
299
|
+
return { signature: args.signature };
|
|
300
|
+
}
|
|
301
|
+
return loader.load(normalizeArgs4(args));
|
|
302
|
+
}
|
|
208
303
|
};
|
|
209
304
|
}
|
|
210
|
-
|
|
305
|
+
|
|
306
|
+
// src/context.ts
|
|
307
|
+
function createSolanaGraphQLContext(rpc) {
|
|
211
308
|
return {
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
309
|
+
loaders: {
|
|
310
|
+
account: createAccountLoader(rpc),
|
|
311
|
+
block: createBlockLoader(rpc),
|
|
312
|
+
programAccounts: createProgramAccountsLoader(rpc),
|
|
313
|
+
transaction: createTransactionLoader(rpc)
|
|
314
|
+
},
|
|
315
|
+
rpc
|
|
216
316
|
};
|
|
217
317
|
}
|
|
218
318
|
|
|
219
|
-
// src/
|
|
220
|
-
var
|
|
221
|
-
|
|
222
|
-
if (!memoisedAccountEncodingInputType)
|
|
223
|
-
memoisedAccountEncodingInputType = new graphql.GraphQLEnumType({
|
|
224
|
-
name: "AccountEncoding",
|
|
225
|
-
values: {
|
|
226
|
-
base58: {
|
|
227
|
-
value: "base58"
|
|
228
|
-
},
|
|
229
|
-
base64: {
|
|
230
|
-
value: "base64"
|
|
231
|
-
},
|
|
232
|
-
base64Zstd: {
|
|
233
|
-
value: "base64+zstd"
|
|
234
|
-
},
|
|
235
|
-
jsonParsed: {
|
|
236
|
-
value: "jsonParsed"
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
});
|
|
240
|
-
return memoisedAccountEncodingInputType;
|
|
319
|
+
// src/resolvers/account.ts
|
|
320
|
+
var resolveAccount = (fieldName) => {
|
|
321
|
+
return (parent, args, context, info) => parent[fieldName] === null ? null : context.loaders.account.load({ ...args, address: parent[fieldName] }, info);
|
|
241
322
|
};
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
323
|
+
|
|
324
|
+
// src/schema/account.ts
|
|
325
|
+
var accountTypeDefs = (
|
|
326
|
+
/* GraphQL */
|
|
327
|
+
`
|
|
328
|
+
# Account interface
|
|
329
|
+
interface Account {
|
|
330
|
+
address: Address
|
|
331
|
+
executable: Boolean
|
|
332
|
+
lamports: BigInt
|
|
333
|
+
ownerProgram: Account
|
|
334
|
+
space: BigInt
|
|
335
|
+
rentEpoch: BigInt
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
# An account with base58 encoded data
|
|
339
|
+
type AccountBase58 implements Account {
|
|
340
|
+
address: Address
|
|
341
|
+
data: Base58EncodedBytes
|
|
342
|
+
executable: Boolean
|
|
343
|
+
lamports: BigInt
|
|
344
|
+
ownerProgram: Account
|
|
345
|
+
space: BigInt
|
|
346
|
+
rentEpoch: BigInt
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
# An account with base64 encoded data
|
|
350
|
+
type AccountBase64 implements Account {
|
|
351
|
+
address: Address
|
|
352
|
+
data: Base64EncodedBytes
|
|
353
|
+
executable: Boolean
|
|
354
|
+
lamports: BigInt
|
|
355
|
+
ownerProgram: Account
|
|
356
|
+
space: BigInt
|
|
357
|
+
rentEpoch: BigInt
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
# An account with base64+zstd encoded data
|
|
361
|
+
type AccountBase64Zstd implements Account {
|
|
362
|
+
address: Address
|
|
363
|
+
data: Base64ZstdEncodedBytes
|
|
364
|
+
executable: Boolean
|
|
365
|
+
lamports: BigInt
|
|
366
|
+
ownerProgram: Account
|
|
367
|
+
space: BigInt
|
|
368
|
+
rentEpoch: BigInt
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
# A nonce account
|
|
372
|
+
type NonceAccountFeeCalculator {
|
|
373
|
+
lamportsPerSignature: String
|
|
374
|
+
}
|
|
375
|
+
type NonceAccount implements Account {
|
|
376
|
+
address: Address
|
|
377
|
+
executable: Boolean
|
|
378
|
+
lamports: BigInt
|
|
379
|
+
ownerProgram: Account
|
|
380
|
+
space: BigInt
|
|
381
|
+
rentEpoch: BigInt
|
|
382
|
+
authority: Account
|
|
383
|
+
blockhash: String
|
|
384
|
+
feeCalculator: NonceAccountFeeCalculator
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
# A lookup table account
|
|
388
|
+
type LookupTableAccount implements Account {
|
|
389
|
+
address: Address
|
|
390
|
+
executable: Boolean
|
|
391
|
+
lamports: BigInt
|
|
392
|
+
ownerProgram: Account
|
|
393
|
+
space: BigInt
|
|
394
|
+
rentEpoch: BigInt
|
|
395
|
+
addresses: [Address]
|
|
396
|
+
authority: Account
|
|
397
|
+
deactivationSlot: String
|
|
398
|
+
lastExtendedSlot: String
|
|
399
|
+
lastExtendedSlotStartIndex: Int
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
# A mint account
|
|
403
|
+
type MintAccount implements Account {
|
|
404
|
+
address: Address
|
|
405
|
+
executable: Boolean
|
|
406
|
+
lamports: BigInt
|
|
407
|
+
ownerProgram: Account
|
|
408
|
+
space: BigInt
|
|
409
|
+
rentEpoch: BigInt
|
|
410
|
+
decimals: Int
|
|
411
|
+
freezeAuthority: Account
|
|
412
|
+
isInitialized: Boolean
|
|
413
|
+
mintAuthority: Account
|
|
414
|
+
supply: String
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
# A token account
|
|
418
|
+
type TokenAccount implements Account {
|
|
419
|
+
address: Address
|
|
420
|
+
executable: Boolean
|
|
421
|
+
lamports: BigInt
|
|
422
|
+
ownerProgram: Account
|
|
423
|
+
space: BigInt
|
|
424
|
+
rentEpoch: BigInt
|
|
425
|
+
isNative: Boolean
|
|
426
|
+
mint: Account
|
|
427
|
+
owner: Account
|
|
428
|
+
state: String
|
|
429
|
+
tokenAmount: TokenAmount
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
# A stake account
|
|
433
|
+
type StakeAccountDataMetaAuthorized {
|
|
434
|
+
staker: Account
|
|
435
|
+
withdrawer: Account
|
|
436
|
+
}
|
|
437
|
+
type StakeAccountDataMetaLockup {
|
|
438
|
+
custodian: Account
|
|
439
|
+
epoch: BigInt
|
|
440
|
+
unixTimestamp: BigInt
|
|
441
|
+
}
|
|
442
|
+
type StakeAccountDataMeta {
|
|
443
|
+
authorized: StakeAccountDataMetaAuthorized
|
|
444
|
+
lockup: StakeAccountDataMetaLockup
|
|
445
|
+
rentExemptReserve: String
|
|
446
|
+
}
|
|
447
|
+
type StakeAccountDataStakeDelegation {
|
|
448
|
+
activationEpoch: BigInt
|
|
449
|
+
deactivationEpoch: BigInt
|
|
450
|
+
stake: String
|
|
451
|
+
voter: Account
|
|
452
|
+
warmupCooldownRate: Int
|
|
453
|
+
}
|
|
454
|
+
type StakeAccountDataStake {
|
|
455
|
+
creditsObserved: BigInt
|
|
456
|
+
delegation: StakeAccountDataStakeDelegation
|
|
457
|
+
}
|
|
458
|
+
type StakeAccount implements Account {
|
|
459
|
+
address: Address
|
|
460
|
+
executable: Boolean
|
|
461
|
+
lamports: BigInt
|
|
462
|
+
ownerProgram: Account
|
|
463
|
+
space: BigInt
|
|
464
|
+
rentEpoch: BigInt
|
|
465
|
+
meta: StakeAccountDataMeta
|
|
466
|
+
stake: StakeAccountDataStake
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
# A vote account
|
|
470
|
+
type VoteAccountDataAuthorizedVoter {
|
|
471
|
+
authorizedVoter: Account
|
|
472
|
+
epoch: BigInt
|
|
473
|
+
}
|
|
474
|
+
type VoteAccountDataEpochCredit {
|
|
475
|
+
credits: String
|
|
476
|
+
epoch: BigInt
|
|
477
|
+
previousCredits: String
|
|
478
|
+
}
|
|
479
|
+
type VoteAccountDataLastTimestamp {
|
|
480
|
+
slot: BigInt
|
|
481
|
+
timestamp: BigInt
|
|
482
|
+
}
|
|
483
|
+
type VoteAccountDataVote {
|
|
484
|
+
confirmationCount: Int
|
|
485
|
+
slot: BigInt
|
|
486
|
+
}
|
|
487
|
+
type VoteAccount implements Account {
|
|
488
|
+
address: Address
|
|
489
|
+
executable: Boolean
|
|
490
|
+
lamports: BigInt
|
|
491
|
+
ownerProgram: Account
|
|
492
|
+
space: BigInt
|
|
493
|
+
rentEpoch: BigInt
|
|
494
|
+
authorizedVoters: [VoteAccountDataAuthorizedVoter]
|
|
495
|
+
authorizedWithdrawer: Account
|
|
496
|
+
commission: Int
|
|
497
|
+
epochCredits: [VoteAccountDataEpochCredit]
|
|
498
|
+
lastTimestamp: VoteAccountDataLastTimestamp
|
|
499
|
+
node: Account
|
|
500
|
+
priorVoters: [Address]
|
|
501
|
+
rootSlot: BigInt
|
|
502
|
+
votes: [VoteAccountDataVote]
|
|
503
|
+
}
|
|
504
|
+
`
|
|
505
|
+
);
|
|
506
|
+
var accountResolvers = {
|
|
507
|
+
Account: {
|
|
508
|
+
__resolveType(account) {
|
|
509
|
+
if (account.encoding === "base58") {
|
|
510
|
+
return "AccountBase58";
|
|
260
511
|
}
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
};
|
|
264
|
-
var memoisedCommitmentInputType;
|
|
265
|
-
var commitmentInputType = () => {
|
|
266
|
-
if (!memoisedCommitmentInputType)
|
|
267
|
-
memoisedCommitmentInputType = new graphql.GraphQLEnumType({
|
|
268
|
-
name: "Commitment",
|
|
269
|
-
values: {
|
|
270
|
-
confirmed: {
|
|
271
|
-
value: "confirmed"
|
|
272
|
-
},
|
|
273
|
-
finalized: {
|
|
274
|
-
value: "finalized"
|
|
275
|
-
},
|
|
276
|
-
processed: {
|
|
277
|
-
value: "processed"
|
|
278
|
-
}
|
|
512
|
+
if (account.encoding === "base64") {
|
|
513
|
+
return "AccountBase64";
|
|
279
514
|
}
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
};
|
|
283
|
-
var memoisedDataSliceInputType;
|
|
284
|
-
var dataSliceInputType = () => {
|
|
285
|
-
if (!memoisedDataSliceInputType)
|
|
286
|
-
memoisedDataSliceInputType = new graphql.GraphQLInputObjectType({
|
|
287
|
-
fields: {
|
|
288
|
-
length: number(),
|
|
289
|
-
offset: number()
|
|
290
|
-
},
|
|
291
|
-
name: "DataSlice"
|
|
292
|
-
});
|
|
293
|
-
return memoisedDataSliceInputType;
|
|
294
|
-
};
|
|
295
|
-
var memoisedMaxSupportedTransactionVersionInputType;
|
|
296
|
-
var maxSupportedTransactionVersionInputType = () => {
|
|
297
|
-
if (!memoisedMaxSupportedTransactionVersionInputType)
|
|
298
|
-
memoisedMaxSupportedTransactionVersionInputType = new graphql.GraphQLEnumType({
|
|
299
|
-
name: "MaxSupportedTransactionVersion",
|
|
300
|
-
values: {
|
|
301
|
-
legacy: {
|
|
302
|
-
value: "legacy"
|
|
303
|
-
},
|
|
304
|
-
zero: {
|
|
305
|
-
value: "0"
|
|
306
|
-
}
|
|
515
|
+
if (account.encoding === "base64+zstd") {
|
|
516
|
+
return "AccountBase64Zstd";
|
|
307
517
|
}
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
var memoisedProgramAccountFilterInputType;
|
|
312
|
-
var programAccountFilterInputType = () => {
|
|
313
|
-
if (!memoisedProgramAccountFilterInputType)
|
|
314
|
-
memoisedProgramAccountFilterInputType = new graphql.GraphQLInputObjectType({
|
|
315
|
-
fields: {
|
|
316
|
-
bytes: bigint(),
|
|
317
|
-
dataSize: bigint(),
|
|
318
|
-
encoding: string(),
|
|
319
|
-
offset: bigint()
|
|
320
|
-
},
|
|
321
|
-
name: "ProgramAccountFilter"
|
|
322
|
-
});
|
|
323
|
-
return memoisedProgramAccountFilterInputType;
|
|
324
|
-
};
|
|
325
|
-
var memoisedTransactionEncodingInputType;
|
|
326
|
-
var transactionEncodingInputType = () => {
|
|
327
|
-
if (!memoisedTransactionEncodingInputType)
|
|
328
|
-
memoisedTransactionEncodingInputType = new graphql.GraphQLEnumType({
|
|
329
|
-
name: "TransactionEncoding",
|
|
330
|
-
values: {
|
|
331
|
-
base58: {
|
|
332
|
-
value: "base58"
|
|
333
|
-
},
|
|
334
|
-
base64: {
|
|
335
|
-
value: "base64"
|
|
336
|
-
},
|
|
337
|
-
json: {
|
|
338
|
-
value: "json"
|
|
339
|
-
},
|
|
340
|
-
jsonParsed: {
|
|
341
|
-
value: "jsonParsed"
|
|
518
|
+
if (account.encoding === "jsonParsed") {
|
|
519
|
+
if (account.programName === "nonce") {
|
|
520
|
+
return "NonceAccount";
|
|
342
521
|
}
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
return memoisedTransactionEncodingInputType;
|
|
346
|
-
};
|
|
347
|
-
var memoisedTokenAmountType;
|
|
348
|
-
var tokenAmountType = () => {
|
|
349
|
-
if (!memoisedTokenAmountType) {
|
|
350
|
-
memoisedTokenAmountType = new graphql.GraphQLObjectType({
|
|
351
|
-
fields: {
|
|
352
|
-
amount: string(),
|
|
353
|
-
decimals: number(),
|
|
354
|
-
uiAmount: bigint(),
|
|
355
|
-
uiAmountString: string()
|
|
356
|
-
},
|
|
357
|
-
name: "TokenAmount"
|
|
358
|
-
});
|
|
359
|
-
}
|
|
360
|
-
return memoisedTokenAmountType;
|
|
361
|
-
};
|
|
362
|
-
var memoisedAccountInterfaceFields;
|
|
363
|
-
var accountInterfaceFields = () => {
|
|
364
|
-
if (!memoisedAccountInterfaceFields) {
|
|
365
|
-
memoisedAccountInterfaceFields = {
|
|
366
|
-
address: string(),
|
|
367
|
-
encoding: string(),
|
|
368
|
-
executable: boolean(),
|
|
369
|
-
lamports: bigint(),
|
|
370
|
-
rentEpoch: bigint()
|
|
371
|
-
};
|
|
372
|
-
}
|
|
373
|
-
return memoisedAccountInterfaceFields;
|
|
374
|
-
};
|
|
375
|
-
var memoisedAccountInterface;
|
|
376
|
-
var accountInterface = () => {
|
|
377
|
-
if (!memoisedAccountInterface) {
|
|
378
|
-
memoisedAccountInterface = new graphql.GraphQLInterfaceType({
|
|
379
|
-
description: "A Solana account",
|
|
380
|
-
fields: () => ({
|
|
381
|
-
...accountInterfaceFields(),
|
|
382
|
-
owner: type(accountInterface())
|
|
383
|
-
}),
|
|
384
|
-
name: "Account",
|
|
385
|
-
resolveType(account) {
|
|
386
|
-
if (account.encoding === "base58") {
|
|
387
|
-
return "AccountBase58";
|
|
522
|
+
if (account.accountType === "mint" && account.programName === "spl-token") {
|
|
523
|
+
return "MintAccount";
|
|
388
524
|
}
|
|
389
|
-
if (account.
|
|
390
|
-
return "
|
|
525
|
+
if (account.accountType === "account" && account.programName === "spl-token") {
|
|
526
|
+
return "TokenAccount";
|
|
391
527
|
}
|
|
392
|
-
if (account.
|
|
393
|
-
return "
|
|
528
|
+
if (account.programName === "stake") {
|
|
529
|
+
return "StakeAccount";
|
|
394
530
|
}
|
|
395
|
-
if (account.
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
return "TokenAccount";
|
|
401
|
-
}
|
|
402
|
-
if (account.data.program === "nonce") {
|
|
403
|
-
return "NonceAccount";
|
|
404
|
-
}
|
|
405
|
-
if (account.data.program === "stake") {
|
|
406
|
-
return "StakeAccount";
|
|
407
|
-
}
|
|
408
|
-
if (account.data.parsed.type === "vote" && account.data.program === "vote") {
|
|
409
|
-
return "VoteAccount";
|
|
410
|
-
}
|
|
411
|
-
if (account.data.parsed.type === "lookupTable" && account.data.program === "address-lookup-table") {
|
|
412
|
-
return "LookupTableAccount";
|
|
413
|
-
}
|
|
531
|
+
if (account.accountType === "vote" && account.programName === "vote") {
|
|
532
|
+
return "VoteAccount";
|
|
533
|
+
}
|
|
534
|
+
if (account.accountType === "lookupTable" && account.programName === "address-lookup-table") {
|
|
535
|
+
return "LookupTableAccount";
|
|
414
536
|
}
|
|
415
|
-
return "AccountBase64";
|
|
416
537
|
}
|
|
417
|
-
|
|
538
|
+
return "AccountBase64";
|
|
539
|
+
}
|
|
540
|
+
},
|
|
541
|
+
AccountBase58: {
|
|
542
|
+
ownerProgram: resolveAccount("ownerProgram")
|
|
543
|
+
},
|
|
544
|
+
AccountBase64: {
|
|
545
|
+
ownerProgram: resolveAccount("ownerProgram")
|
|
546
|
+
},
|
|
547
|
+
AccountBase64Zstd: {
|
|
548
|
+
ownerProgram: resolveAccount("ownerProgram")
|
|
549
|
+
},
|
|
550
|
+
NonceAccount: {
|
|
551
|
+
authority: resolveAccount("authority"),
|
|
552
|
+
ownerProgram: resolveAccount("ownerProgram")
|
|
553
|
+
},
|
|
554
|
+
LookupTableAccount: {
|
|
555
|
+
authority: resolveAccount("authority"),
|
|
556
|
+
ownerProgram: resolveAccount("ownerProgram")
|
|
557
|
+
},
|
|
558
|
+
MintAccount: {
|
|
559
|
+
freezeAuthority: resolveAccount("freezeAuthority"),
|
|
560
|
+
mintAuthority: resolveAccount("mintAuthority"),
|
|
561
|
+
ownerProgram: resolveAccount("ownerProgram")
|
|
562
|
+
},
|
|
563
|
+
TokenAccount: {
|
|
564
|
+
mint: resolveAccount("mint"),
|
|
565
|
+
owner: resolveAccount("owner"),
|
|
566
|
+
ownerProgram: resolveAccount("ownerProgram")
|
|
567
|
+
},
|
|
568
|
+
StakeAccountDataMetaAuthorized: {
|
|
569
|
+
staker: resolveAccount("staker"),
|
|
570
|
+
withdrawer: resolveAccount("withdrawer")
|
|
571
|
+
},
|
|
572
|
+
StakeAccountDataMetaLockup: {
|
|
573
|
+
custodian: resolveAccount("custodian")
|
|
574
|
+
},
|
|
575
|
+
StakeAccountDataStakeDelegation: {
|
|
576
|
+
voter: resolveAccount("voter")
|
|
577
|
+
},
|
|
578
|
+
StakeAccount: {
|
|
579
|
+
ownerProgram: resolveAccount("ownerProgram")
|
|
580
|
+
},
|
|
581
|
+
VoteAccountDataAuthorizedVoter: {
|
|
582
|
+
authorizedVoter: resolveAccount("authorizedVoter")
|
|
583
|
+
},
|
|
584
|
+
VoteAccount: {
|
|
585
|
+
authorizedWithdrawer: resolveAccount("authorizedWithdrawer"),
|
|
586
|
+
node: resolveAccount("nodePubkey"),
|
|
587
|
+
ownerProgram: resolveAccount("ownerProgram")
|
|
418
588
|
}
|
|
419
|
-
return memoisedAccountInterface;
|
|
420
|
-
};
|
|
421
|
-
var accountType = (name, description, data) => new graphql.GraphQLObjectType({
|
|
422
|
-
description,
|
|
423
|
-
fields: {
|
|
424
|
-
...accountInterfaceFields(),
|
|
425
|
-
data,
|
|
426
|
-
// Nested Account interface
|
|
427
|
-
owner: {
|
|
428
|
-
args: {
|
|
429
|
-
commitment: type(commitmentInputType()),
|
|
430
|
-
dataSlice: type(dataSliceInputType()),
|
|
431
|
-
encoding: type(accountEncodingInputType()),
|
|
432
|
-
minContextSlot: bigint()
|
|
433
|
-
},
|
|
434
|
-
resolve: (parent, args, context, info) => context.resolveAccount({ ...args, address: parent.owner }, info),
|
|
435
|
-
type: accountInterface()
|
|
436
|
-
}
|
|
437
|
-
},
|
|
438
|
-
interfaces: [accountInterface()],
|
|
439
|
-
name
|
|
440
|
-
});
|
|
441
|
-
var accountDataJsonParsed = (name, parsedInfoFields) => object(name + "Data", {
|
|
442
|
-
parsed: object(name + "DataParsed", {
|
|
443
|
-
info: object(name + "DataParsedInfo", parsedInfoFields),
|
|
444
|
-
type: string()
|
|
445
|
-
}),
|
|
446
|
-
program: string(),
|
|
447
|
-
space: bigint()
|
|
448
|
-
});
|
|
449
|
-
var memoisedAccountBase58;
|
|
450
|
-
var accountBase58 = () => {
|
|
451
|
-
if (!memoisedAccountBase58)
|
|
452
|
-
memoisedAccountBase58 = accountType("AccountBase58", "A Solana account with base58 encoded data", string());
|
|
453
|
-
return memoisedAccountBase58;
|
|
454
589
|
};
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
memoisedAccountTokenAccount = accountType(
|
|
556
|
-
"TokenAccount",
|
|
557
|
-
"An SPL token account",
|
|
558
|
-
accountDataJsonParsed("TokenAccount", {
|
|
559
|
-
isNative: boolean(),
|
|
560
|
-
mint: string(),
|
|
561
|
-
// Nested Account interface
|
|
562
|
-
owner: {
|
|
563
|
-
args: {
|
|
564
|
-
commitment: type(commitmentInputType()),
|
|
565
|
-
dataSlice: type(dataSliceInputType()),
|
|
566
|
-
encoding: type(accountEncodingInputType()),
|
|
567
|
-
minContextSlot: bigint()
|
|
568
|
-
},
|
|
569
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
570
|
-
resolve: (parent, args, context, info) => context.resolveAccount({ ...args, address: parent.owner }, info),
|
|
571
|
-
type: accountInterface()
|
|
572
|
-
},
|
|
573
|
-
state: string(),
|
|
574
|
-
tokenAmount: type(tokenAmountType())
|
|
575
|
-
})
|
|
576
|
-
);
|
|
577
|
-
return memoisedAccountTokenAccount;
|
|
590
|
+
|
|
591
|
+
// src/schema/block.ts
|
|
592
|
+
var blockTypeDefs = (
|
|
593
|
+
/* GraphQL */
|
|
594
|
+
`
|
|
595
|
+
type TransactionMetaForAccounts {
|
|
596
|
+
err: String
|
|
597
|
+
fee: BigInt
|
|
598
|
+
postBalances: [BigInt]
|
|
599
|
+
postTokenBalances: [TokenBalance]
|
|
600
|
+
preBalances: [BigInt]
|
|
601
|
+
preTokenBalances: [TokenBalance]
|
|
602
|
+
status: TransactionStatus
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
type TransactionDataForAccounts {
|
|
606
|
+
accountKeys: [Address]
|
|
607
|
+
signatures: [String]
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
type BlockTransactionAccounts {
|
|
611
|
+
meta: TransactionMetaForAccounts
|
|
612
|
+
data: TransactionDataForAccounts
|
|
613
|
+
version: String
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
# Block interface
|
|
617
|
+
interface Block {
|
|
618
|
+
blockhash: String
|
|
619
|
+
blockHeight: BigInt
|
|
620
|
+
blockTime: Int
|
|
621
|
+
parentSlot: BigInt
|
|
622
|
+
previousBlockhash: String
|
|
623
|
+
rewards: [Reward]
|
|
624
|
+
transactionDetails: String
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
# A block with account transaction details
|
|
628
|
+
type BlockWithAccounts implements Block {
|
|
629
|
+
blockhash: String
|
|
630
|
+
blockHeight: BigInt
|
|
631
|
+
blockTime: Int
|
|
632
|
+
parentSlot: BigInt
|
|
633
|
+
previousBlockhash: String
|
|
634
|
+
rewards: [Reward]
|
|
635
|
+
transactions: [BlockTransactionAccounts]
|
|
636
|
+
transactionDetails: String
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
# A block with full transaction details
|
|
640
|
+
type BlockWithFull implements Block {
|
|
641
|
+
blockhash: String
|
|
642
|
+
blockHeight: BigInt
|
|
643
|
+
blockTime: Int
|
|
644
|
+
parentSlot: BigInt
|
|
645
|
+
previousBlockhash: String
|
|
646
|
+
rewards: [Reward]
|
|
647
|
+
transactions: [Transaction]
|
|
648
|
+
transactionDetails: String
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
# A block with none transaction details
|
|
652
|
+
type BlockWithNone implements Block {
|
|
653
|
+
blockhash: String
|
|
654
|
+
blockHeight: BigInt
|
|
655
|
+
blockTime: Int
|
|
656
|
+
parentSlot: BigInt
|
|
657
|
+
previousBlockhash: String
|
|
658
|
+
rewards: [Reward]
|
|
659
|
+
transactionDetails: String
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
# A block with signature transaction details
|
|
663
|
+
type BlockWithSignatures implements Block {
|
|
664
|
+
blockhash: String
|
|
665
|
+
blockHeight: BigInt
|
|
666
|
+
blockTime: Int
|
|
667
|
+
parentSlot: BigInt
|
|
668
|
+
previousBlockhash: String
|
|
669
|
+
rewards: [Reward]
|
|
670
|
+
signatures: [String]
|
|
671
|
+
transactionDetails: String
|
|
672
|
+
}
|
|
673
|
+
`
|
|
674
|
+
);
|
|
675
|
+
var blockResolvers = {
|
|
676
|
+
Block: {
|
|
677
|
+
__resolveType(block) {
|
|
678
|
+
switch (block.transactionDetails) {
|
|
679
|
+
case "accounts":
|
|
680
|
+
return "BlockWithAccounts";
|
|
681
|
+
case "none":
|
|
682
|
+
return "BlockWithNone";
|
|
683
|
+
case "signatures":
|
|
684
|
+
return "BlockWithSignatures";
|
|
685
|
+
default:
|
|
686
|
+
return "BlockWithFull";
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
}
|
|
578
690
|
};
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
},
|
|
622
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
623
|
-
resolve: (parent, args, context, info) => context.resolveAccount({ ...args, address: parent.custodian }, info),
|
|
624
|
-
type: accountInterface()
|
|
625
|
-
},
|
|
626
|
-
epoch: bigint(),
|
|
627
|
-
unixTimestamp: bigint()
|
|
628
|
-
}),
|
|
629
|
-
rentExemptReserve: string()
|
|
630
|
-
}),
|
|
631
|
-
stake: object("StakeStake", {
|
|
632
|
-
creditsObserved: bigint(),
|
|
633
|
-
delegation: object("StakeStakeDelegation", {
|
|
634
|
-
activationEpoch: bigint(),
|
|
635
|
-
deactivationEpoch: bigint(),
|
|
636
|
-
stake: string(),
|
|
637
|
-
// Nested Account interface
|
|
638
|
-
voter: {
|
|
639
|
-
args: {
|
|
640
|
-
commitment: type(commitmentInputType()),
|
|
641
|
-
dataSlice: type(dataSliceInputType()),
|
|
642
|
-
encoding: type(accountEncodingInputType()),
|
|
643
|
-
minContextSlot: bigint()
|
|
644
|
-
},
|
|
645
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
646
|
-
resolve: (parent, args, context, info) => context.resolveAccount({ ...args, address: parent.voter }, info),
|
|
647
|
-
type: accountInterface()
|
|
648
|
-
},
|
|
649
|
-
warmupCooldownRate: number()
|
|
650
|
-
})
|
|
651
|
-
})
|
|
652
|
-
})
|
|
653
|
-
);
|
|
654
|
-
return memoisedAccountStakeAccount;
|
|
691
|
+
|
|
692
|
+
// src/schema/common/inputs.ts
|
|
693
|
+
var inputTypeDefs = (
|
|
694
|
+
/* GraphQL */
|
|
695
|
+
`
|
|
696
|
+
input DataSlice {
|
|
697
|
+
offset: Int
|
|
698
|
+
length: Int
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
input ProgramAccountsFilter {
|
|
702
|
+
bytes: BigInt
|
|
703
|
+
dataSize: BigInt
|
|
704
|
+
encoding: AccountEncoding
|
|
705
|
+
offset: BigInt
|
|
706
|
+
}
|
|
707
|
+
`
|
|
708
|
+
);
|
|
709
|
+
var inputResolvers = {};
|
|
710
|
+
var scalarTypeDefs = (
|
|
711
|
+
/* GraphQL */
|
|
712
|
+
`
|
|
713
|
+
scalar Address
|
|
714
|
+
scalar Base58EncodedBytes
|
|
715
|
+
scalar Base64EncodedBytes
|
|
716
|
+
scalar Base64ZstdEncodedBytes
|
|
717
|
+
scalar BigInt
|
|
718
|
+
`
|
|
719
|
+
);
|
|
720
|
+
var stringScalarAlias = {
|
|
721
|
+
__parseLiteral(ast) {
|
|
722
|
+
if (ast.kind === graphql.Kind.STRING) {
|
|
723
|
+
return ast.value.toString();
|
|
724
|
+
}
|
|
725
|
+
return null;
|
|
726
|
+
},
|
|
727
|
+
__parseValue(value) {
|
|
728
|
+
return value;
|
|
729
|
+
},
|
|
730
|
+
__serialize(value) {
|
|
731
|
+
return value;
|
|
732
|
+
}
|
|
655
733
|
};
|
|
656
|
-
var
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
type: accountInterface()
|
|
676
|
-
},
|
|
677
|
-
epoch: bigint()
|
|
678
|
-
})
|
|
679
|
-
),
|
|
680
|
-
// Nested Account interface
|
|
681
|
-
authorizedWithdrawer: {
|
|
682
|
-
args: {
|
|
683
|
-
commitment: type(commitmentInputType()),
|
|
684
|
-
dataSlice: type(dataSliceInputType()),
|
|
685
|
-
encoding: type(accountEncodingInputType()),
|
|
686
|
-
minContextSlot: bigint()
|
|
687
|
-
},
|
|
688
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
689
|
-
resolve: (parent, args, context, info) => context.resolveAccount({ ...args, address: parent.authorizedWithdrawer }, info),
|
|
690
|
-
type: accountInterface()
|
|
691
|
-
},
|
|
692
|
-
commission: number(),
|
|
693
|
-
epochCredits: list(
|
|
694
|
-
object("VoteEpochCredits", {
|
|
695
|
-
credits: string(),
|
|
696
|
-
epoch: bigint(),
|
|
697
|
-
previousCredits: string()
|
|
698
|
-
})
|
|
699
|
-
),
|
|
700
|
-
lastTimestamp: object("VoteLastTimestamp", {
|
|
701
|
-
slot: bigint(),
|
|
702
|
-
timestamp: bigint()
|
|
703
|
-
}),
|
|
704
|
-
// Nested Account interface
|
|
705
|
-
node: {
|
|
706
|
-
args: {
|
|
707
|
-
commitment: type(commitmentInputType()),
|
|
708
|
-
dataSlice: type(dataSliceInputType()),
|
|
709
|
-
encoding: type(accountEncodingInputType()),
|
|
710
|
-
minContextSlot: bigint()
|
|
711
|
-
},
|
|
712
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
713
|
-
resolve: (parent, args, context, info) => context.resolveAccount({ ...args, address: parent.nodePubkey }, info),
|
|
714
|
-
type: accountInterface()
|
|
715
|
-
},
|
|
716
|
-
priorVoters: list(string()),
|
|
717
|
-
rootSlot: bigint(),
|
|
718
|
-
votes: list(
|
|
719
|
-
object("VoteVote", {
|
|
720
|
-
confirmationCount: number(),
|
|
721
|
-
slot: bigint()
|
|
722
|
-
})
|
|
723
|
-
)
|
|
724
|
-
})
|
|
725
|
-
);
|
|
726
|
-
return memoisedAccountVoteAccount;
|
|
734
|
+
var scalarResolvers = {
|
|
735
|
+
Address: stringScalarAlias,
|
|
736
|
+
Base58EncodedBytes: stringScalarAlias,
|
|
737
|
+
Base64EncodedBytes: stringScalarAlias,
|
|
738
|
+
Base64ZstdEncodedBytes: stringScalarAlias,
|
|
739
|
+
BigInt: {
|
|
740
|
+
__parseLiteral(ast) {
|
|
741
|
+
if (ast.kind === graphql.Kind.STRING) {
|
|
742
|
+
return BigInt(ast.value);
|
|
743
|
+
}
|
|
744
|
+
return null;
|
|
745
|
+
},
|
|
746
|
+
__parseValue(value) {
|
|
747
|
+
return BigInt(value);
|
|
748
|
+
},
|
|
749
|
+
__serialize(value) {
|
|
750
|
+
return BigInt(value);
|
|
751
|
+
}
|
|
752
|
+
}
|
|
727
753
|
};
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
754
|
+
|
|
755
|
+
// src/schema/common/types.ts
|
|
756
|
+
var commonTypeDefs = (
|
|
757
|
+
/* GraphQL */
|
|
758
|
+
`
|
|
759
|
+
enum AccountEncoding {
|
|
760
|
+
BASE_58
|
|
761
|
+
BASE_64
|
|
762
|
+
BASE_64_ZSTD
|
|
763
|
+
PARSED
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
enum BlockTransactionDetails {
|
|
767
|
+
accounts
|
|
768
|
+
full
|
|
769
|
+
none
|
|
770
|
+
signatures
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
enum Commitment {
|
|
774
|
+
confirmed
|
|
775
|
+
finalized
|
|
776
|
+
processed
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
type ReturnData {
|
|
780
|
+
data: Base64EncodedBytes
|
|
781
|
+
programId: Address
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
type Reward {
|
|
785
|
+
commission: Int
|
|
786
|
+
lamports: BigInt
|
|
787
|
+
postBalance: BigInt
|
|
788
|
+
pubkey: Address
|
|
789
|
+
rewardType: String
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
type TokenAmount {
|
|
793
|
+
amount: String
|
|
794
|
+
decimals: Int
|
|
795
|
+
uiAmount: BigInt
|
|
796
|
+
uiAmountString: String
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
type TokenBalance {
|
|
800
|
+
accountIndex: Int
|
|
801
|
+
mint: Account
|
|
802
|
+
owner: Account
|
|
803
|
+
programId: Address
|
|
804
|
+
uiTokenAmount: TokenAmount
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
enum TransactionEncoding {
|
|
808
|
+
BASE_58
|
|
809
|
+
BASE_64
|
|
810
|
+
PARSED
|
|
811
|
+
}
|
|
812
|
+
|
|
813
|
+
enum TransactionVersion {
|
|
814
|
+
LEGACY
|
|
815
|
+
ZERO
|
|
816
|
+
}
|
|
817
|
+
`
|
|
818
|
+
);
|
|
819
|
+
var commonResolvers = {
|
|
820
|
+
AccountEncoding: {
|
|
821
|
+
BASE_58: "base58",
|
|
822
|
+
BASE_64: "base64",
|
|
823
|
+
BASE_64_ZSTD: "base64+zstd",
|
|
824
|
+
PARSED: "jsonParsed"
|
|
825
|
+
},
|
|
826
|
+
TokenBalance: {
|
|
827
|
+
mint: resolveAccount("mint"),
|
|
828
|
+
owner: resolveAccount("owner")
|
|
829
|
+
},
|
|
830
|
+
TransactionEncoding: {
|
|
831
|
+
BASE_58: "base58",
|
|
832
|
+
BASE_64: "base64",
|
|
833
|
+
PARSED: "jsonParsed"
|
|
834
|
+
},
|
|
835
|
+
TransactionVersion: {
|
|
836
|
+
LEGACY: "legacy",
|
|
837
|
+
ZERO: 0
|
|
838
|
+
}
|
|
743
839
|
};
|
|
744
840
|
|
|
745
|
-
// src/schema/
|
|
746
|
-
var
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
}
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
}
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
}
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
programId:
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
841
|
+
// src/schema/instruction.ts
|
|
842
|
+
var instructionTypeDefs = (
|
|
843
|
+
/* GraphQL */
|
|
844
|
+
`
|
|
845
|
+
# Transaction instruction interface
|
|
846
|
+
interface TransactionInstruction {
|
|
847
|
+
programId: Address
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
# Generic transaction instruction
|
|
851
|
+
type GenericInstruction implements TransactionInstruction {
|
|
852
|
+
accounts: [Address]
|
|
853
|
+
data: Base64EncodedBytes
|
|
854
|
+
programId: Address
|
|
855
|
+
}
|
|
856
|
+
|
|
857
|
+
# AddressLookupTable: CreateLookupTable
|
|
858
|
+
type CreateLookupTableInstruction implements TransactionInstruction {
|
|
859
|
+
programId: Address
|
|
860
|
+
bumpSeed: BigInt # FIXME:*
|
|
861
|
+
lookupTableAccount: Account
|
|
862
|
+
lookupTableAuthority: Account
|
|
863
|
+
payerAccount: Account
|
|
864
|
+
recentSlot: BigInt
|
|
865
|
+
systemProgram: Account
|
|
866
|
+
}
|
|
867
|
+
|
|
868
|
+
# AddressLookupTable: ExtendLookupTable
|
|
869
|
+
type ExtendLookupTableInstruction implements TransactionInstruction {
|
|
870
|
+
programId: Address
|
|
871
|
+
lookupTableAccount: Account
|
|
872
|
+
lookupTableAuthority: Account
|
|
873
|
+
newAddresses: [Address]
|
|
874
|
+
payerAccount: Account
|
|
875
|
+
systemProgram: Account
|
|
876
|
+
}
|
|
877
|
+
|
|
878
|
+
# AddressLookupTable: FreezeLookupTable
|
|
879
|
+
type FreezeLookupTableInstruction implements TransactionInstruction {
|
|
880
|
+
programId: Address
|
|
881
|
+
lookupTableAccount: Account
|
|
882
|
+
lookupTableAuthority: Account
|
|
883
|
+
}
|
|
884
|
+
|
|
885
|
+
# AddressLookupTable: DeactivateLookupTable
|
|
886
|
+
type DeactivateLookupTableInstruction implements TransactionInstruction {
|
|
887
|
+
programId: Address
|
|
888
|
+
lookupTableAccount: Account
|
|
889
|
+
lookupTableAuthority: Account
|
|
890
|
+
}
|
|
891
|
+
|
|
892
|
+
# AddressLookupTable: CloseLookupTable
|
|
893
|
+
type CloseLookupTableInstruction implements TransactionInstruction {
|
|
894
|
+
programId: Address
|
|
895
|
+
lookupTableAccount: Account
|
|
896
|
+
lookupTableAuthority: Account
|
|
897
|
+
recipient: Account
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
# BpfLoader: Write
|
|
901
|
+
type BpfLoaderWriteInstruction implements TransactionInstruction {
|
|
902
|
+
programId: Address
|
|
903
|
+
account: Account
|
|
904
|
+
bytes: Base64EncodedBytes
|
|
905
|
+
offset: BigInt # FIXME:*
|
|
906
|
+
}
|
|
907
|
+
|
|
908
|
+
# BpfLoader: Finalize
|
|
909
|
+
type BpfLoaderFinalizeInstruction implements TransactionInstruction {
|
|
910
|
+
programId: Address
|
|
911
|
+
account: Account
|
|
912
|
+
}
|
|
913
|
+
|
|
914
|
+
# BpfUpgradeableLoader: InitializeBuffer
|
|
915
|
+
type BpfUpgradeableLoaderInitializeBufferInstruction implements TransactionInstruction {
|
|
916
|
+
programId: Address
|
|
917
|
+
account: Account
|
|
918
|
+
}
|
|
919
|
+
|
|
920
|
+
# BpfUpgradeableLoader: Write
|
|
921
|
+
type BpfUpgradeableLoaderWriteInstruction implements TransactionInstruction {
|
|
922
|
+
programId: Address
|
|
923
|
+
account: Account
|
|
924
|
+
authority: Account
|
|
925
|
+
bytes: Base64EncodedBytes
|
|
926
|
+
offset: BigInt # FIXME:*
|
|
927
|
+
}
|
|
928
|
+
|
|
929
|
+
# BpfUpgradeableLoader: DeployWithMaxDataLen
|
|
930
|
+
type BpfUpgradeableLoaderDeployWithMaxDataLenInstruction implements TransactionInstruction {
|
|
931
|
+
programId: Address
|
|
932
|
+
authority: Account
|
|
933
|
+
bufferAccount: Account
|
|
934
|
+
clockSysvar: Address
|
|
935
|
+
maxDataLen: BigInt
|
|
936
|
+
payerAccount: Account
|
|
937
|
+
programAccount: Account
|
|
938
|
+
programDataAccount: Account
|
|
939
|
+
rentSysvar: Address
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
# BpfUpgradeableLoader: Upgrade
|
|
943
|
+
type BpfUpgradeableLoaderUpgradeInstruction implements TransactionInstruction {
|
|
944
|
+
programId: Address
|
|
945
|
+
authority: Account
|
|
946
|
+
bufferAccount: Account
|
|
947
|
+
clockSysvar: Address
|
|
948
|
+
programAccount: Account
|
|
949
|
+
programDataAccount: Account
|
|
950
|
+
rentSysvar: Address
|
|
951
|
+
spillAccount: Account
|
|
952
|
+
}
|
|
953
|
+
|
|
954
|
+
# BpfUpgradeableLoader: SetAuthority
|
|
955
|
+
|
|
956
|
+
type BpfUpgradeableLoaderSetAuthorityInstruction implements TransactionInstruction {
|
|
957
|
+
programId: Address
|
|
958
|
+
account: Account
|
|
959
|
+
authority: Account
|
|
960
|
+
newAuthority: Account
|
|
961
|
+
}
|
|
962
|
+
|
|
963
|
+
# BpfUpgradeableLoader: SetAuthorityChecked
|
|
964
|
+
type BpfUpgradeableLoaderSetAuthorityCheckedInstruction implements TransactionInstruction {
|
|
965
|
+
programId: Address
|
|
966
|
+
account: Account
|
|
967
|
+
authority: Account
|
|
968
|
+
newAuthority: Account
|
|
969
|
+
}
|
|
970
|
+
|
|
971
|
+
# BpfUpgradeableLoader: Close
|
|
972
|
+
type BpfUpgradeableLoaderCloseInstruction implements TransactionInstruction {
|
|
973
|
+
programId: Address
|
|
974
|
+
account: Account
|
|
975
|
+
authority: Account
|
|
976
|
+
programAccount: Account
|
|
977
|
+
recipient: Account
|
|
978
|
+
}
|
|
979
|
+
|
|
980
|
+
# BpfUpgradeableLoader: ExtendProgram
|
|
981
|
+
type BpfUpgradeableLoaderExtendProgramInstruction implements TransactionInstruction {
|
|
982
|
+
programId: Address
|
|
983
|
+
additionalBytes: BigInt
|
|
984
|
+
payerAccount: Account
|
|
985
|
+
programAccount: Account
|
|
986
|
+
programDataAccount: Account
|
|
987
|
+
systemProgram: Account
|
|
988
|
+
}
|
|
989
|
+
|
|
990
|
+
# SplAssociatedTokenAccount: Create
|
|
991
|
+
type SplAssociatedTokenCreateInstruction implements TransactionInstruction {
|
|
992
|
+
programId: Address
|
|
993
|
+
account: Account
|
|
994
|
+
mint: Address
|
|
995
|
+
source: Account
|
|
996
|
+
systemProgram: Account
|
|
997
|
+
tokenProgram: Account
|
|
998
|
+
wallet: Account
|
|
999
|
+
}
|
|
1000
|
+
|
|
1001
|
+
# SplAssociatedTokenAccount: CreateIdempotent
|
|
1002
|
+
type SplAssociatedTokenCreateIdempotentInstruction implements TransactionInstruction {
|
|
1003
|
+
programId: Address
|
|
1004
|
+
account: Account
|
|
1005
|
+
mint: Address
|
|
1006
|
+
source: Account
|
|
1007
|
+
systemProgram: Account
|
|
1008
|
+
tokenProgram: Account
|
|
1009
|
+
wallet: Account
|
|
1010
|
+
}
|
|
1011
|
+
|
|
1012
|
+
# SplAssociatedTokenAccount: RecoverNested
|
|
1013
|
+
type SplAssociatedTokenRecoverNestedInstruction implements TransactionInstruction {
|
|
1014
|
+
programId: Address
|
|
1015
|
+
destination: Account
|
|
1016
|
+
nestedMint: Account
|
|
1017
|
+
nestedOwner: Account
|
|
1018
|
+
nestedSource: Account
|
|
1019
|
+
ownerMint: Account
|
|
1020
|
+
tokenProgram: Account
|
|
1021
|
+
wallet: Account
|
|
1022
|
+
}
|
|
1023
|
+
|
|
1024
|
+
# SplMemo
|
|
1025
|
+
type SplMemoInstruction implements TransactionInstruction {
|
|
1026
|
+
programId: Address
|
|
1027
|
+
data: String
|
|
1028
|
+
}
|
|
1029
|
+
|
|
1030
|
+
# SplToken: InitializeMint
|
|
1031
|
+
type SplTokenInitializeMintInstruction implements TransactionInstruction {
|
|
1032
|
+
programId: Address
|
|
1033
|
+
decimals: BigInt # FIXME:*
|
|
1034
|
+
freezeAuthority: Account
|
|
1035
|
+
mint: Account
|
|
1036
|
+
mintAuthority: Account
|
|
1037
|
+
rentSysvar: Address
|
|
1038
|
+
}
|
|
1039
|
+
|
|
1040
|
+
# SplToken: InitializeMint2
|
|
1041
|
+
type SplTokenInitializeMint2Instruction implements TransactionInstruction {
|
|
1042
|
+
programId: Address
|
|
1043
|
+
decimals: BigInt # FIXME:*
|
|
1044
|
+
freezeAuthority: Account
|
|
1045
|
+
mint: Account
|
|
1046
|
+
mintAuthority: Account
|
|
1047
|
+
}
|
|
1048
|
+
|
|
1049
|
+
# SplToken: InitializeAccount
|
|
1050
|
+
type SplTokenInitializeAccountInstruction implements TransactionInstruction {
|
|
1051
|
+
programId: Address
|
|
1052
|
+
account: Account
|
|
1053
|
+
mint: Account
|
|
1054
|
+
owner: Account
|
|
1055
|
+
rentSysvar: Address
|
|
1056
|
+
}
|
|
1057
|
+
|
|
1058
|
+
# SplToken: InitializeAccount2
|
|
1059
|
+
type SplTokenInitializeAccount2Instruction implements TransactionInstruction {
|
|
1060
|
+
programId: Address
|
|
1061
|
+
account: Account
|
|
1062
|
+
mint: Account
|
|
1063
|
+
owner: Account
|
|
1064
|
+
rentSysvar: Address
|
|
1065
|
+
}
|
|
1066
|
+
|
|
1067
|
+
# SplToken: InitializeAccount3
|
|
1068
|
+
type SplTokenInitializeAccount3Instruction implements TransactionInstruction {
|
|
1069
|
+
programId: Address
|
|
1070
|
+
account: Account
|
|
1071
|
+
mint: Account
|
|
1072
|
+
owner: Account
|
|
1073
|
+
}
|
|
1074
|
+
|
|
1075
|
+
# SplToken: InitializeMultisig
|
|
1076
|
+
type SplTokenInitializeMultisigInstruction implements TransactionInstruction {
|
|
1077
|
+
programId: Address
|
|
1078
|
+
m: BigInt # FIXME:*
|
|
1079
|
+
multisig: Account
|
|
1080
|
+
rentSysvar: Address
|
|
1081
|
+
signers: [Address]
|
|
1082
|
+
}
|
|
1083
|
+
|
|
1084
|
+
# SplToken: InitializeMultisig2
|
|
1085
|
+
type SplTokenInitializeMultisig2Instruction implements TransactionInstruction {
|
|
1086
|
+
programId: Address
|
|
1087
|
+
m: BigInt # FIXME:*
|
|
1088
|
+
multisig: Account
|
|
1089
|
+
signers: [Address]
|
|
1090
|
+
}
|
|
1091
|
+
|
|
1092
|
+
# SplToken: Transfer
|
|
1093
|
+
type SplTokenTransferInstruction implements TransactionInstruction {
|
|
1094
|
+
programId: Address
|
|
1095
|
+
amount: String
|
|
1096
|
+
authority: Account
|
|
1097
|
+
destination: Account
|
|
1098
|
+
multisigAuthority: Account
|
|
1099
|
+
source: Account
|
|
1100
|
+
}
|
|
1101
|
+
|
|
1102
|
+
# SplToken: Approve
|
|
1103
|
+
type SplTokenApproveInstruction implements TransactionInstruction {
|
|
1104
|
+
programId: Address
|
|
1105
|
+
amount: String
|
|
1106
|
+
delegate: Account
|
|
1107
|
+
multisigOwner: Account
|
|
1108
|
+
owner: Account
|
|
1109
|
+
source: Account
|
|
1110
|
+
}
|
|
1111
|
+
|
|
1112
|
+
# SplToken: Revoke
|
|
1113
|
+
type SplTokenRevokeInstruction implements TransactionInstruction {
|
|
1114
|
+
programId: Address
|
|
1115
|
+
multisigOwner: Account
|
|
1116
|
+
owner: Account
|
|
1117
|
+
source: Account
|
|
1118
|
+
}
|
|
1119
|
+
|
|
1120
|
+
# SplToken: SetAuthority
|
|
1121
|
+
type SplTokenSetAuthorityInstruction implements TransactionInstruction {
|
|
1122
|
+
programId: Address
|
|
1123
|
+
authority: Account
|
|
1124
|
+
authorityType: String
|
|
1125
|
+
multisigAuthority: Account
|
|
1126
|
+
newAuthority: Account
|
|
1127
|
+
}
|
|
1128
|
+
|
|
1129
|
+
# SplToken: MintTo
|
|
1130
|
+
type SplTokenMintToInstruction implements TransactionInstruction {
|
|
1131
|
+
programId: Address
|
|
1132
|
+
account: Account
|
|
1133
|
+
amount: String
|
|
1134
|
+
authority: Account
|
|
1135
|
+
mint: Account
|
|
1136
|
+
mintAuthority: Account
|
|
1137
|
+
multisigMintAuthority: Account
|
|
1138
|
+
}
|
|
1139
|
+
|
|
1140
|
+
# SplToken: Burn
|
|
1141
|
+
type SplTokenBurnInstruction implements TransactionInstruction {
|
|
1142
|
+
programId: Address
|
|
1143
|
+
account: Account
|
|
1144
|
+
amount: String
|
|
1145
|
+
authority: Account
|
|
1146
|
+
mint: Account
|
|
1147
|
+
multisigAuthority: Account
|
|
1148
|
+
}
|
|
1149
|
+
|
|
1150
|
+
# SplToken: CloseAccount
|
|
1151
|
+
type SplTokenCloseAccountInstruction implements TransactionInstruction {
|
|
1152
|
+
programId: Address
|
|
1153
|
+
account: Account
|
|
1154
|
+
destination: Account
|
|
1155
|
+
multisigOwner: Account
|
|
1156
|
+
owner: Account
|
|
1157
|
+
}
|
|
1158
|
+
|
|
1159
|
+
# SplToken: FreezeAccount
|
|
1160
|
+
type SplTokenFreezeAccountInstruction implements TransactionInstruction {
|
|
1161
|
+
programId: Address
|
|
1162
|
+
account: Account
|
|
1163
|
+
freezeAuthority: Account
|
|
1164
|
+
mint: Account
|
|
1165
|
+
multisigFreezeAuthority: Account
|
|
1166
|
+
}
|
|
1167
|
+
|
|
1168
|
+
# SplToken: ThawAccount
|
|
1169
|
+
type SplTokenThawAccountInstruction implements TransactionInstruction {
|
|
1170
|
+
programId: Address
|
|
1171
|
+
account: Account
|
|
1172
|
+
freezeAuthority: Account
|
|
1173
|
+
mint: Account
|
|
1174
|
+
multisigFreezeAuthority: Account
|
|
1175
|
+
}
|
|
1176
|
+
|
|
1177
|
+
# SplToken: TransferChecked
|
|
1178
|
+
type SplTokenTransferCheckedInstruction implements TransactionInstruction {
|
|
1179
|
+
programId: Address
|
|
1180
|
+
amount: String
|
|
1181
|
+
authority: Account
|
|
1182
|
+
decimals: BigInt # FIXME:*
|
|
1183
|
+
destination: Account
|
|
1184
|
+
mint: Account
|
|
1185
|
+
multisigAuthority: Account
|
|
1186
|
+
source: Account
|
|
1187
|
+
tokenAmount: String
|
|
1188
|
+
}
|
|
1189
|
+
|
|
1190
|
+
# SplToken: ApproveChecked
|
|
1191
|
+
type SplTokenApproveCheckedInstruction implements TransactionInstruction {
|
|
1192
|
+
programId: Address
|
|
1193
|
+
delegate: Account
|
|
1194
|
+
mint: Account
|
|
1195
|
+
multisigOwner: Account
|
|
1196
|
+
owner: Account
|
|
1197
|
+
source: Account
|
|
1198
|
+
tokenAmount: String
|
|
1199
|
+
}
|
|
1200
|
+
|
|
1201
|
+
# SplToken: MintToChecked
|
|
1202
|
+
type SplTokenMintToCheckedInstruction implements TransactionInstruction {
|
|
1203
|
+
programId: Address
|
|
1204
|
+
account: Account
|
|
1205
|
+
authority: Account
|
|
1206
|
+
mint: Account
|
|
1207
|
+
mintAuthority: Account
|
|
1208
|
+
multisigMintAuthority: Account
|
|
1209
|
+
tokenAmount: String
|
|
1210
|
+
}
|
|
1211
|
+
|
|
1212
|
+
# SplToken: BurnChecked
|
|
1213
|
+
type SplTokenBurnCheckedInstruction implements TransactionInstruction {
|
|
1214
|
+
programId: Address
|
|
1215
|
+
account: Account
|
|
1216
|
+
authority: Account
|
|
1217
|
+
mint: Account
|
|
1218
|
+
multisigAuthority: Account
|
|
1219
|
+
tokenAmount: String
|
|
1220
|
+
}
|
|
1221
|
+
|
|
1222
|
+
# SplToken: SyncNative
|
|
1223
|
+
type SplTokenSyncNativeInstruction implements TransactionInstruction {
|
|
1224
|
+
programId: Address
|
|
1225
|
+
account: Account
|
|
1226
|
+
}
|
|
1227
|
+
|
|
1228
|
+
# SplToken: GetAccountDataSize
|
|
1229
|
+
type SplTokenGetAccountDataSizeInstruction implements TransactionInstruction {
|
|
1230
|
+
programId: Address
|
|
1231
|
+
extensionTypes: [String]
|
|
1232
|
+
mint: Account
|
|
1233
|
+
}
|
|
1234
|
+
|
|
1235
|
+
# SplToken: InitializeImmutableOwner
|
|
1236
|
+
type SplTokenInitializeImmutableOwnerInstruction implements TransactionInstruction {
|
|
1237
|
+
programId: Address
|
|
1238
|
+
account: Account
|
|
1239
|
+
}
|
|
1240
|
+
|
|
1241
|
+
# SplToken: AmountToUiAmount
|
|
1242
|
+
type SplTokenAmountToUiAmountInstruction implements TransactionInstruction {
|
|
1243
|
+
programId: Address
|
|
1244
|
+
amount: String
|
|
1245
|
+
mint: Account
|
|
1246
|
+
}
|
|
1247
|
+
|
|
1248
|
+
# SplToken: UiAmountToAmount
|
|
1249
|
+
type SplTokenUiAmountToAmountInstruction implements TransactionInstruction {
|
|
1250
|
+
programId: Address
|
|
1251
|
+
mint: Account
|
|
1252
|
+
uiAmount: String
|
|
1253
|
+
}
|
|
1254
|
+
|
|
1255
|
+
# SplToken: InitializeMintCloseAuthority
|
|
1256
|
+
type SplTokenInitializeMintCloseAuthorityInstruction implements TransactionInstruction {
|
|
1257
|
+
programId: Address
|
|
1258
|
+
mint: Account
|
|
1259
|
+
newAuthority: Account
|
|
1260
|
+
}
|
|
1261
|
+
|
|
1262
|
+
# TODO: Extensions!
|
|
1263
|
+
# - TransferFeeExtension
|
|
1264
|
+
# - ConfidentialTransferFeeExtension
|
|
1265
|
+
# - DefaultAccountStateExtension
|
|
1266
|
+
# - Reallocate
|
|
1267
|
+
# - MemoTransferExtension
|
|
1268
|
+
# - CreateNativeMint
|
|
1269
|
+
# - InitializeNonTransferableMint
|
|
1270
|
+
# - InterestBearingMintExtension
|
|
1271
|
+
# - CpiGuardExtension
|
|
1272
|
+
# - InitializePermanentDelegate
|
|
1273
|
+
# - TransferHookExtension
|
|
1274
|
+
# - ConfidentialTransferFeeExtension
|
|
1275
|
+
# - WithdrawExcessLamports
|
|
1276
|
+
# - MetadataPointerExtension
|
|
1277
|
+
|
|
1278
|
+
type Lockup {
|
|
1279
|
+
custodian: Account
|
|
1280
|
+
epoch: BigInt
|
|
1281
|
+
unixTimestamp: BigInt
|
|
1282
|
+
}
|
|
1283
|
+
|
|
1284
|
+
# Stake: Initialize
|
|
1285
|
+
type StakeInitializeInstructionDataAuthorized {
|
|
1286
|
+
staker: Account
|
|
1287
|
+
withdrawer: Account
|
|
1288
|
+
}
|
|
1289
|
+
type StakeInitializeInstruction implements TransactionInstruction {
|
|
1290
|
+
programId: Address
|
|
1291
|
+
authorized: StakeInitializeInstructionDataAuthorized
|
|
1292
|
+
lockup: Lockup
|
|
1293
|
+
rentSysvar: Address
|
|
1294
|
+
stakeAccount: Account
|
|
1295
|
+
}
|
|
1296
|
+
|
|
1297
|
+
# Stake: Authorize
|
|
1298
|
+
type StakeAuthorizeInstruction implements TransactionInstruction {
|
|
1299
|
+
programId: Address
|
|
1300
|
+
authority: Account
|
|
1301
|
+
authorityType: String
|
|
1302
|
+
clockSysvar: Address
|
|
1303
|
+
custodian: Account
|
|
1304
|
+
newAuthority: Account
|
|
1305
|
+
stakeAccount: Account
|
|
1306
|
+
}
|
|
1307
|
+
|
|
1308
|
+
# Stake: DelegateStake
|
|
1309
|
+
type StakeDelegateStakeInstruction implements TransactionInstruction {
|
|
1310
|
+
programId: Address
|
|
1311
|
+
clockSysvar: Address
|
|
1312
|
+
stakeAccount: Account
|
|
1313
|
+
stakeAuthority: Account
|
|
1314
|
+
stakeConfigAccount: Account
|
|
1315
|
+
stakeHistorySysvar: Address
|
|
1316
|
+
voteAccount: Account
|
|
1317
|
+
}
|
|
1318
|
+
|
|
1319
|
+
# Stake: Split
|
|
1320
|
+
type StakeSplitInstruction implements TransactionInstruction {
|
|
1321
|
+
programId: Address
|
|
1322
|
+
lamports: BigInt
|
|
1323
|
+
newSplitAccount: Account
|
|
1324
|
+
stakeAccount: Account
|
|
1325
|
+
stakeAuthority: Account
|
|
1326
|
+
}
|
|
1327
|
+
|
|
1328
|
+
# Stake: Withdraw
|
|
1329
|
+
type StakeWithdrawInstruction implements TransactionInstruction {
|
|
1330
|
+
programId: Address
|
|
1331
|
+
clockSysvar: Address
|
|
1332
|
+
destination: Account
|
|
1333
|
+
lamports: BigInt
|
|
1334
|
+
stakeAccount: Account
|
|
1335
|
+
withdrawAuthority: Account
|
|
1336
|
+
}
|
|
1337
|
+
|
|
1338
|
+
# Stake: Deactivate
|
|
1339
|
+
type StakeDeactivateInstruction implements TransactionInstruction {
|
|
1340
|
+
programId: Address
|
|
1341
|
+
clockSysvar: Address
|
|
1342
|
+
stakeAccount: Account
|
|
1343
|
+
stakeAuthority: Account
|
|
1344
|
+
}
|
|
1345
|
+
|
|
1346
|
+
# Stake: SetLockup
|
|
1347
|
+
type StakeSetLockupInstruction implements TransactionInstruction {
|
|
1348
|
+
programId: Address
|
|
1349
|
+
custodian: Account
|
|
1350
|
+
lockup: Lockup
|
|
1351
|
+
stakeAccount: Account
|
|
1352
|
+
}
|
|
1353
|
+
|
|
1354
|
+
# Stake: Merge
|
|
1355
|
+
type StakeMergeInstruction implements TransactionInstruction {
|
|
1356
|
+
programId: Address
|
|
1357
|
+
clockSysvar: Address
|
|
1358
|
+
destination: Account
|
|
1359
|
+
source: Account
|
|
1360
|
+
stakeAuthority: Account
|
|
1361
|
+
stakeHistorySysvar: Address
|
|
1362
|
+
}
|
|
1363
|
+
|
|
1364
|
+
# Stake: AuthorizeWithSeed
|
|
1365
|
+
type StakeAuthorizeWithSeedInstruction implements TransactionInstruction {
|
|
1366
|
+
programId: Address
|
|
1367
|
+
authorityBase: Account
|
|
1368
|
+
authorityOwner: Account
|
|
1369
|
+
authoritySeed: String
|
|
1370
|
+
authorityType: String
|
|
1371
|
+
clockSysvar: Address
|
|
1372
|
+
custodian: Account
|
|
1373
|
+
newAuthorized: Account
|
|
1374
|
+
stakeAccount: Account
|
|
1375
|
+
}
|
|
1376
|
+
|
|
1377
|
+
# Stake: InitializeChecked
|
|
1378
|
+
type StakeInitializeCheckedInstructionDataAuthorized {
|
|
1379
|
+
staker: Account
|
|
1380
|
+
withdrawer: Account
|
|
1381
|
+
}
|
|
1382
|
+
type StakeInitializeCheckedInstruction implements TransactionInstruction {
|
|
1383
|
+
programId: Address
|
|
1384
|
+
authorized: StakeInitializeCheckedInstructionDataAuthorized
|
|
1385
|
+
lockup: Lockup
|
|
1386
|
+
rentSysvar: Address
|
|
1387
|
+
stakeAccount: Account
|
|
1388
|
+
}
|
|
1389
|
+
|
|
1390
|
+
# Stake: AuthorizeChecked
|
|
1391
|
+
type StakeAuthorizeCheckedInstruction implements TransactionInstruction {
|
|
1392
|
+
programId: Address
|
|
1393
|
+
authority: Account
|
|
1394
|
+
authorityType: String
|
|
1395
|
+
clockSysvar: Address
|
|
1396
|
+
custodian: Account
|
|
1397
|
+
newAuthority: Account
|
|
1398
|
+
stakeAccount: Account
|
|
1399
|
+
}
|
|
1400
|
+
|
|
1401
|
+
# Stake: AuthorizeCheckedWithSeed
|
|
1402
|
+
type StakeAuthorizeCheckedWithSeedInstruction implements TransactionInstruction {
|
|
1403
|
+
programId: Address
|
|
1404
|
+
authorityBase: Account
|
|
1405
|
+
authorityOwner: Account
|
|
1406
|
+
authoritySeed: String
|
|
1407
|
+
authorityType: String
|
|
1408
|
+
clockSysvar: Address
|
|
1409
|
+
custodian: Account
|
|
1410
|
+
newAuthorized: Account
|
|
1411
|
+
stakeAccount: Account
|
|
1412
|
+
}
|
|
1413
|
+
|
|
1414
|
+
# Stake: SetLockupChecked
|
|
1415
|
+
type StakeSetLockupCheckedInstruction implements TransactionInstruction {
|
|
1416
|
+
programId: Address
|
|
1417
|
+
custodian: Account
|
|
1418
|
+
lockup: Lockup
|
|
1419
|
+
stakeAccount: Account
|
|
1420
|
+
}
|
|
1421
|
+
|
|
1422
|
+
# Stake: DeactivateDelinquent
|
|
1423
|
+
type StakeDeactivateDelinquentInstruction implements TransactionInstruction {
|
|
1424
|
+
programId: Address
|
|
1425
|
+
referenceVoteAccount: Account
|
|
1426
|
+
stakeAccount: Account
|
|
1427
|
+
voteAccount: Account
|
|
1428
|
+
}
|
|
1429
|
+
|
|
1430
|
+
# Stake: Redelegate
|
|
1431
|
+
type StakeRedelegateInstruction implements TransactionInstruction {
|
|
1432
|
+
programId: Address
|
|
1433
|
+
newStakeAccount: Account
|
|
1434
|
+
stakeAccount: Account
|
|
1435
|
+
stakeAuthority: Account
|
|
1436
|
+
stakeConfigAccount: Account
|
|
1437
|
+
voteAccount: Account
|
|
1438
|
+
}
|
|
1439
|
+
|
|
1440
|
+
# System: CreateAccount
|
|
1441
|
+
type CreateAccountInstruction implements TransactionInstruction {
|
|
1442
|
+
programId: Address
|
|
1443
|
+
lamports: BigInt
|
|
1444
|
+
newAccount: Account
|
|
1445
|
+
owner: Account
|
|
1446
|
+
source: Account
|
|
1447
|
+
space: BigInt
|
|
1448
|
+
}
|
|
1449
|
+
|
|
1450
|
+
# System: Assign
|
|
1451
|
+
type AssignInstruction implements TransactionInstruction {
|
|
1452
|
+
programId: Address
|
|
1453
|
+
account: Account
|
|
1454
|
+
owner: Account
|
|
1455
|
+
}
|
|
1456
|
+
|
|
1457
|
+
# System: Transfer
|
|
1458
|
+
type TransferInstruction implements TransactionInstruction {
|
|
1459
|
+
programId: Address
|
|
1460
|
+
destination: Account
|
|
1461
|
+
lamports: BigInt
|
|
1462
|
+
source: Account
|
|
1463
|
+
}
|
|
1464
|
+
|
|
1465
|
+
# System: CreateAccountWithSeed
|
|
1466
|
+
type CreateAccountWithSeedInstruction implements TransactionInstruction {
|
|
1467
|
+
programId: Address
|
|
1468
|
+
base: Account
|
|
1469
|
+
lamports: BigInt
|
|
1470
|
+
owner: Account
|
|
1471
|
+
seed: String
|
|
1472
|
+
space: BigInt
|
|
1473
|
+
}
|
|
1474
|
+
|
|
1475
|
+
# System: AdvanceNonceAccount
|
|
1476
|
+
type AdvanceNonceAccountInstruction implements TransactionInstruction {
|
|
1477
|
+
programId: Address
|
|
1478
|
+
nonceAccount: Account
|
|
1479
|
+
nonceAuthority: Account
|
|
1480
|
+
recentBlockhashesSysvar: Address
|
|
1481
|
+
}
|
|
1482
|
+
|
|
1483
|
+
# System: WithdrawNonceAccount
|
|
1484
|
+
type WithdrawNonceAccountInstruction implements TransactionInstruction {
|
|
1485
|
+
programId: Address
|
|
1486
|
+
destination: Account
|
|
1487
|
+
lamports: BigInt
|
|
1488
|
+
nonceAccount: Account
|
|
1489
|
+
nonceAuthority: Account
|
|
1490
|
+
recentBlockhashesSysvar: Address
|
|
1491
|
+
rentSysvar: Address
|
|
1492
|
+
}
|
|
1493
|
+
|
|
1494
|
+
# System: InitializeNonceAccount
|
|
1495
|
+
type InitializeNonceAccountInstruction implements TransactionInstruction {
|
|
1496
|
+
programId: Address
|
|
1497
|
+
nonceAccount: Account
|
|
1498
|
+
nonceAuthority: Account
|
|
1499
|
+
recentBlockhashesSysvar: Address
|
|
1500
|
+
rentSysvar: Address
|
|
1501
|
+
}
|
|
1502
|
+
|
|
1503
|
+
# System: AuthorizeNonceAccount
|
|
1504
|
+
type AuthorizeNonceAccountInstruction implements TransactionInstruction {
|
|
1505
|
+
programId: Address
|
|
1506
|
+
newAuthorized: Account
|
|
1507
|
+
nonceAccount: Account
|
|
1508
|
+
nonceAuthority: Account
|
|
1509
|
+
}
|
|
1510
|
+
|
|
1511
|
+
# System: UpgradeNonceAccount
|
|
1512
|
+
type UpgradeNonceAccountInstruction implements TransactionInstruction {
|
|
1513
|
+
programId: Address
|
|
1514
|
+
nonceAccount: Account
|
|
1515
|
+
nonceAuthority: Account
|
|
1516
|
+
}
|
|
1517
|
+
|
|
1518
|
+
# System: Allocate
|
|
1519
|
+
type AllocateInstruction implements TransactionInstruction {
|
|
1520
|
+
programId: Address
|
|
1521
|
+
account: Account
|
|
1522
|
+
space: BigInt
|
|
1523
|
+
}
|
|
1524
|
+
|
|
1525
|
+
# System: AllocateWithSeed
|
|
1526
|
+
type AllocateWithSeedInstruction implements TransactionInstruction {
|
|
1527
|
+
programId: Address
|
|
1528
|
+
account: Account
|
|
1529
|
+
base: Address
|
|
1530
|
+
owner: Account
|
|
1531
|
+
seed: String
|
|
1532
|
+
space: BigInt
|
|
1533
|
+
}
|
|
1534
|
+
|
|
1535
|
+
# System: AssignWithSeed
|
|
1536
|
+
type AssignWithSeedInstruction implements TransactionInstruction {
|
|
1537
|
+
programId: Address
|
|
1538
|
+
account: Account
|
|
1539
|
+
base: Address
|
|
1540
|
+
owner: Account
|
|
1541
|
+
seed: String
|
|
1542
|
+
}
|
|
1543
|
+
|
|
1544
|
+
# System: TransferWithSeed
|
|
1545
|
+
type TransferWithSeedInstruction implements TransactionInstruction {
|
|
1546
|
+
programId: Address
|
|
1547
|
+
destination: Account
|
|
1548
|
+
lamports: BigInt
|
|
1549
|
+
source: Account
|
|
1550
|
+
sourceBase: Address
|
|
1551
|
+
sourceOwner: Account
|
|
1552
|
+
sourceSeed: String
|
|
1553
|
+
}
|
|
1554
|
+
|
|
1555
|
+
# Vote: InitializeAccount
|
|
1556
|
+
type VoteInitializeAccountInstruction implements TransactionInstruction {
|
|
1557
|
+
programId: Address
|
|
1558
|
+
authorizedVoter: Account
|
|
1559
|
+
authorizedWithdrawer: Account
|
|
1560
|
+
clockSysvar: Address
|
|
1561
|
+
commission: BigInt # FIXME:*
|
|
1562
|
+
node: Account
|
|
1563
|
+
rentSysvar: Address
|
|
1564
|
+
voteAccount: Account
|
|
1565
|
+
}
|
|
1566
|
+
|
|
1567
|
+
# Vote: Authorize
|
|
1568
|
+
type VoteAuthorizeInstruction implements TransactionInstruction {
|
|
1569
|
+
programId: Address
|
|
1570
|
+
authority: Account
|
|
1571
|
+
authorityType: String
|
|
1572
|
+
clockSysvar: Address
|
|
1573
|
+
newAuthority: Account
|
|
1574
|
+
voteAccount: Account
|
|
1575
|
+
}
|
|
1576
|
+
|
|
1577
|
+
# Vote: AuthorizeWithSeed
|
|
1578
|
+
type VoteAuthorizeWithSeedInstruction implements TransactionInstruction {
|
|
1579
|
+
programId: Address
|
|
1580
|
+
authorityBaseKey: String
|
|
1581
|
+
authorityOwner: Account
|
|
1582
|
+
authoritySeed: String
|
|
1583
|
+
authorityType: String
|
|
1584
|
+
clockSysvar: Address
|
|
1585
|
+
newAuthority: Account
|
|
1586
|
+
voteAccount: Account
|
|
1587
|
+
}
|
|
1588
|
+
|
|
1589
|
+
# Vote: AuthorizeCheckedWithSeed
|
|
1590
|
+
type VoteAuthorizeCheckedWithSeedInstruction implements TransactionInstruction {
|
|
1591
|
+
programId: Address
|
|
1592
|
+
authorityBaseKey: String
|
|
1593
|
+
authorityOwner: Account
|
|
1594
|
+
authoritySeed: String
|
|
1595
|
+
authorityType: String
|
|
1596
|
+
clockSysvar: Address
|
|
1597
|
+
newAuthority: Account
|
|
1598
|
+
voteAccount: Account
|
|
1599
|
+
}
|
|
1600
|
+
|
|
1601
|
+
type Vote {
|
|
1602
|
+
hash: String
|
|
1603
|
+
slots: [BigInt]
|
|
1604
|
+
timestamp: BigInt
|
|
1605
|
+
}
|
|
1606
|
+
|
|
1607
|
+
# Vote: Vote
|
|
1608
|
+
type VoteVoteInstruction implements TransactionInstruction {
|
|
1609
|
+
programId: Address
|
|
1610
|
+
clockSysvar: Address
|
|
1611
|
+
slotHashesSysvar: Address
|
|
1612
|
+
vote: Vote
|
|
1613
|
+
voteAccount: Account
|
|
1614
|
+
voteAuthority: Account
|
|
1615
|
+
}
|
|
1616
|
+
|
|
1617
|
+
type VoteStateUpdateLockout {
|
|
1618
|
+
confirmationCount: BigInt # FIXME:*
|
|
1619
|
+
slot: BigInt
|
|
1620
|
+
}
|
|
1621
|
+
type VoteStateUpdate {
|
|
1622
|
+
hash: String
|
|
1623
|
+
lockouts: [VoteStateUpdateLockout]
|
|
1624
|
+
root: BigInt
|
|
1625
|
+
timestamp: BigInt
|
|
1626
|
+
}
|
|
1627
|
+
|
|
1628
|
+
# Vote: UpdateVoteState
|
|
1629
|
+
type VoteUpdateVoteStateInstruction implements TransactionInstruction {
|
|
1630
|
+
programId: Address
|
|
1631
|
+
hash: String
|
|
1632
|
+
voteAccount: Account
|
|
1633
|
+
voteAuthority: Account
|
|
1634
|
+
voteStateUpdate: VoteStateUpdate
|
|
1635
|
+
}
|
|
1636
|
+
|
|
1637
|
+
# Vote: UpdateVoteStateSwitch
|
|
1638
|
+
type VoteUpdateVoteStateSwitchInstruction implements TransactionInstruction {
|
|
1639
|
+
programId: Address
|
|
1640
|
+
hash: String
|
|
1641
|
+
voteAccount: Account
|
|
1642
|
+
voteAuthority: Account
|
|
1643
|
+
voteStateUpdate: VoteStateUpdate
|
|
1644
|
+
}
|
|
1645
|
+
|
|
1646
|
+
# Vote: CompactUpdateVoteState
|
|
1647
|
+
type VoteCompactUpdateVoteStateInstruction implements TransactionInstruction {
|
|
1648
|
+
programId: Address
|
|
1649
|
+
hash: String
|
|
1650
|
+
voteAccount: Account
|
|
1651
|
+
voteAuthority: Account
|
|
1652
|
+
voteStateUpdate: VoteStateUpdate
|
|
1653
|
+
}
|
|
1654
|
+
|
|
1655
|
+
# Vote: CompactUpdateVoteStateSwitch
|
|
1656
|
+
type VoteCompactUpdateVoteStateSwitchInstruction implements TransactionInstruction {
|
|
1657
|
+
programId: Address
|
|
1658
|
+
hash: String
|
|
1659
|
+
voteAccount: Account
|
|
1660
|
+
voteAuthority: Account
|
|
1661
|
+
voteStateUpdate: VoteStateUpdate
|
|
1662
|
+
}
|
|
1663
|
+
|
|
1664
|
+
# Vote: Withdraw
|
|
1665
|
+
type VoteWithdrawInstruction implements TransactionInstruction {
|
|
1666
|
+
programId: Address
|
|
1667
|
+
destination: Account
|
|
1668
|
+
lamports: BigInt
|
|
1669
|
+
voteAccount: Account
|
|
1670
|
+
withdrawAuthority: Account
|
|
1671
|
+
}
|
|
1672
|
+
|
|
1673
|
+
# Vote: UpdateValidatorIdentity
|
|
1674
|
+
type VoteUpdateValidatorIdentityInstruction implements TransactionInstruction {
|
|
1675
|
+
programId: Address
|
|
1676
|
+
newValidatorIdentity: Account
|
|
1677
|
+
voteAccount: Account
|
|
1678
|
+
withdrawAuthority: Account
|
|
1679
|
+
}
|
|
1680
|
+
|
|
1681
|
+
# Vote: UpdateCommission
|
|
1682
|
+
type VoteUpdateCommissionInstruction implements TransactionInstruction {
|
|
1683
|
+
programId: Address
|
|
1684
|
+
commission: BigInt # FIXME:*
|
|
1685
|
+
voteAccount: Account
|
|
1686
|
+
withdrawAuthority: Account
|
|
1687
|
+
}
|
|
1688
|
+
|
|
1689
|
+
# Vote: VoteSwitch
|
|
1690
|
+
type VoteVoteSwitchInstruction implements TransactionInstruction {
|
|
1691
|
+
programId: Address
|
|
1692
|
+
clockSysvar: Address
|
|
1693
|
+
hash: String
|
|
1694
|
+
slotHashesSysvar: Address
|
|
1695
|
+
vote: Vote
|
|
1696
|
+
voteAccount: Account
|
|
1697
|
+
voteAuthority: Account
|
|
1698
|
+
}
|
|
1699
|
+
|
|
1700
|
+
# Vote: AuthorizeChecked
|
|
1701
|
+
type VoteAuthorizeCheckedInstruction implements TransactionInstruction {
|
|
1702
|
+
programId: Address
|
|
1703
|
+
authority: Account
|
|
1704
|
+
authorityType: String
|
|
1705
|
+
clockSysvar: Address
|
|
1706
|
+
newAuthority: Account
|
|
1707
|
+
voteAccount: Account
|
|
1708
|
+
}
|
|
1709
|
+
`
|
|
1710
|
+
);
|
|
1711
|
+
var instructionResolvers = {
|
|
1712
|
+
TransactionInstruction: {
|
|
1713
|
+
__resolveType(instruction) {
|
|
1714
|
+
if (instruction.programName) {
|
|
1715
|
+
if (instruction.programName === "address-lookup-table") {
|
|
1716
|
+
if (instruction.instructionType === "createLookupTable") {
|
|
875
1717
|
return "CreateLookupTableInstruction";
|
|
876
1718
|
}
|
|
877
|
-
if (instruction.
|
|
1719
|
+
if (instruction.instructionType === "freezeLookupTable") {
|
|
878
1720
|
return "FreezeLookupTableInstruction";
|
|
879
1721
|
}
|
|
880
|
-
if (instruction.
|
|
1722
|
+
if (instruction.instructionType === "extendLookupTable") {
|
|
881
1723
|
return "ExtendLookupTableInstruction";
|
|
882
1724
|
}
|
|
883
|
-
if (instruction.
|
|
1725
|
+
if (instruction.instructionType === "deactivateLookupTable") {
|
|
884
1726
|
return "DeactivateLookupTableInstruction";
|
|
885
1727
|
}
|
|
886
|
-
if (instruction.
|
|
1728
|
+
if (instruction.instructionType === "closeLookupTable") {
|
|
887
1729
|
return "CloseLookupTableInstruction";
|
|
888
1730
|
}
|
|
889
1731
|
}
|
|
890
|
-
if (instruction.
|
|
891
|
-
if (instruction.
|
|
1732
|
+
if (instruction.programName === "bpf-loader") {
|
|
1733
|
+
if (instruction.instructionType === "write") {
|
|
892
1734
|
return "BpfLoaderWriteInstruction";
|
|
893
1735
|
}
|
|
894
|
-
if (instruction.
|
|
1736
|
+
if (instruction.instructionType === "finalize") {
|
|
895
1737
|
return "BpfLoaderFinalizeInstruction";
|
|
896
1738
|
}
|
|
897
1739
|
}
|
|
898
|
-
if (instruction.
|
|
899
|
-
if (instruction.
|
|
1740
|
+
if (instruction.programName === "bpf-upgradeable-loader") {
|
|
1741
|
+
if (instruction.instructionType === "initializeBuffer") {
|
|
900
1742
|
return "BpfUpgradeableLoaderInitializeBufferInstruction";
|
|
901
1743
|
}
|
|
902
|
-
if (instruction.
|
|
1744
|
+
if (instruction.instructionType === "write") {
|
|
903
1745
|
return "BpfUpgradeableLoaderWriteInstruction";
|
|
904
1746
|
}
|
|
905
|
-
if (instruction.
|
|
1747
|
+
if (instruction.instructionType === "deployWithMaxDataLen") {
|
|
906
1748
|
return "BpfUpgradeableLoaderDeployWithMaxDataLenInstruction";
|
|
907
1749
|
}
|
|
908
|
-
if (instruction.
|
|
1750
|
+
if (instruction.instructionType === "upgrade") {
|
|
909
1751
|
return "BpfUpgradeableLoaderUpgradeInstruction";
|
|
910
1752
|
}
|
|
911
|
-
if (instruction.
|
|
1753
|
+
if (instruction.instructionType === "setAuthority") {
|
|
912
1754
|
return "BpfUpgradeableLoaderSetAuthorityInstruction";
|
|
913
1755
|
}
|
|
914
|
-
if (instruction.
|
|
1756
|
+
if (instruction.instructionType === "setAuthorityChecked") {
|
|
915
1757
|
return "BpfUpgradeableLoaderSetAuthorityCheckedInstruction";
|
|
916
1758
|
}
|
|
917
|
-
if (instruction.
|
|
1759
|
+
if (instruction.instructionType === "close") {
|
|
918
1760
|
return "BpfUpgradeableLoaderCloseInstruction";
|
|
919
1761
|
}
|
|
920
|
-
if (instruction.
|
|
1762
|
+
if (instruction.instructionType === "extendProgram") {
|
|
921
1763
|
return "BpfUpgradeableLoaderExtendProgramInstruction";
|
|
922
1764
|
}
|
|
923
1765
|
}
|
|
924
|
-
if (instruction.
|
|
925
|
-
if (instruction.
|
|
1766
|
+
if (instruction.programName === "spl-associated-token-account") {
|
|
1767
|
+
if (instruction.instructionType === "create") {
|
|
926
1768
|
return "SplAssociatedTokenCreateInstruction";
|
|
927
1769
|
}
|
|
928
|
-
if (instruction.
|
|
1770
|
+
if (instruction.instructionType === "createIdempotent") {
|
|
929
1771
|
return "SplAssociatedTokenCreateIdempotentInstruction";
|
|
930
1772
|
}
|
|
931
|
-
if (instruction.
|
|
1773
|
+
if (instruction.instructionType === "recoverNested") {
|
|
932
1774
|
return "SplAssociatedTokenRecoverNestedInstruction";
|
|
933
1775
|
}
|
|
934
1776
|
}
|
|
935
|
-
if (instruction.
|
|
1777
|
+
if (instruction.programName === "spl-memo") {
|
|
936
1778
|
return "SplMemoInstruction";
|
|
937
1779
|
}
|
|
938
|
-
if (instruction.
|
|
939
|
-
if (instruction.
|
|
1780
|
+
if (instruction.programName === "spl-token") {
|
|
1781
|
+
if (instruction.instructionType === "initializeMint") {
|
|
940
1782
|
return "SplTokenInitializeMintInstruction";
|
|
941
1783
|
}
|
|
942
|
-
if (instruction.
|
|
1784
|
+
if (instruction.instructionType === "initializeMint2") {
|
|
943
1785
|
return "SplTokenInitializeMint2Instruction";
|
|
944
1786
|
}
|
|
945
|
-
if (instruction.
|
|
1787
|
+
if (instruction.instructionType === "initializeAccount") {
|
|
946
1788
|
return "SplTokenInitializeAccountInstruction";
|
|
947
1789
|
}
|
|
948
|
-
if (instruction.
|
|
1790
|
+
if (instruction.instructionType === "initializeAccount2") {
|
|
949
1791
|
return "SplTokenInitializeAccount2Instruction";
|
|
950
1792
|
}
|
|
951
|
-
if (instruction.
|
|
1793
|
+
if (instruction.instructionType === "initializeAccount3") {
|
|
952
1794
|
return "SplTokenInitializeAccount3Instruction";
|
|
953
1795
|
}
|
|
954
|
-
if (instruction.
|
|
1796
|
+
if (instruction.instructionType === "initializeMultisig") {
|
|
955
1797
|
return "SplTokenInitializeMultisigInstruction";
|
|
956
1798
|
}
|
|
957
|
-
if (instruction.
|
|
1799
|
+
if (instruction.instructionType === "initializeMultisig2") {
|
|
958
1800
|
return "SplTokenInitializeMultisig2Instruction";
|
|
959
1801
|
}
|
|
960
|
-
if (instruction.
|
|
1802
|
+
if (instruction.instructionType === "transfer") {
|
|
961
1803
|
return "SplTokenTransferInstruction";
|
|
962
1804
|
}
|
|
963
|
-
if (instruction.
|
|
1805
|
+
if (instruction.instructionType === "approve") {
|
|
964
1806
|
return "SplTokenApproveInstruction";
|
|
965
1807
|
}
|
|
966
|
-
if (instruction.
|
|
1808
|
+
if (instruction.instructionType === "revoke") {
|
|
967
1809
|
return "SplTokenRevokeInstruction";
|
|
968
1810
|
}
|
|
969
|
-
if (instruction.
|
|
1811
|
+
if (instruction.instructionType === "setAuthority") {
|
|
970
1812
|
return "SplTokenSetAuthorityInstruction";
|
|
971
1813
|
}
|
|
972
|
-
if (instruction.
|
|
1814
|
+
if (instruction.instructionType === "mintTo") {
|
|
973
1815
|
return "SplTokenMintToInstruction";
|
|
974
1816
|
}
|
|
975
|
-
if (instruction.
|
|
1817
|
+
if (instruction.instructionType === "burn") {
|
|
976
1818
|
return "SplTokenBurnInstruction";
|
|
977
1819
|
}
|
|
978
|
-
if (instruction.
|
|
1820
|
+
if (instruction.instructionType === "closeAccount") {
|
|
979
1821
|
return "SplTokenCloseAccountInstruction";
|
|
980
1822
|
}
|
|
981
|
-
if (instruction.
|
|
1823
|
+
if (instruction.instructionType === "freezeAccount") {
|
|
982
1824
|
return "SplTokenFreezeAccountInstruction";
|
|
983
1825
|
}
|
|
984
|
-
if (instruction.
|
|
1826
|
+
if (instruction.instructionType === "thawAccount") {
|
|
985
1827
|
return "SplTokenThawAccountInstruction";
|
|
986
1828
|
}
|
|
987
|
-
if (instruction.
|
|
1829
|
+
if (instruction.instructionType === "transferChecked") {
|
|
988
1830
|
return "SplTokenTransferCheckedInstruction";
|
|
989
1831
|
}
|
|
990
|
-
if (instruction.
|
|
1832
|
+
if (instruction.instructionType === "approveChecked") {
|
|
991
1833
|
return "SplTokenApproveCheckedInstruction";
|
|
992
1834
|
}
|
|
993
|
-
if (instruction.
|
|
1835
|
+
if (instruction.instructionType === "mintToChecked") {
|
|
994
1836
|
return "SplTokenMintToCheckedInstruction";
|
|
995
1837
|
}
|
|
996
|
-
if (instruction.
|
|
1838
|
+
if (instruction.instructionType === "burnChecked") {
|
|
997
1839
|
return "SplTokenBurnCheckedInstruction";
|
|
998
1840
|
}
|
|
999
|
-
if (instruction.
|
|
1841
|
+
if (instruction.instructionType === "syncNative") {
|
|
1000
1842
|
return "SplTokenSyncNativeInstruction";
|
|
1001
1843
|
}
|
|
1002
|
-
if (instruction.
|
|
1844
|
+
if (instruction.instructionType === "getAccountDataSize") {
|
|
1003
1845
|
return "SplTokenGetAccountDataSizeInstruction";
|
|
1004
1846
|
}
|
|
1005
|
-
if (instruction.
|
|
1847
|
+
if (instruction.instructionType === "initializeImmutableOwner") {
|
|
1006
1848
|
return "SplTokenInitializeImmutableOwnerInstruction";
|
|
1007
1849
|
}
|
|
1008
|
-
if (instruction.
|
|
1850
|
+
if (instruction.instructionType === "amountToUiAmount") {
|
|
1009
1851
|
return "SplTokenAmountToUiAmountInstruction";
|
|
1010
1852
|
}
|
|
1011
|
-
if (instruction.
|
|
1853
|
+
if (instruction.instructionType === "uiAmountToAmount") {
|
|
1012
1854
|
return "SplTokenUiAmountToAmountInstruction";
|
|
1013
1855
|
}
|
|
1014
|
-
if (instruction.
|
|
1856
|
+
if (instruction.instructionType === "initializeMintCloseAuthority") {
|
|
1015
1857
|
return "SplTokenInitializeMintCloseAuthorityInstruction";
|
|
1016
1858
|
}
|
|
1017
1859
|
}
|
|
1018
|
-
if (instruction.
|
|
1019
|
-
if (instruction.
|
|
1860
|
+
if (instruction.programName === "stake") {
|
|
1861
|
+
if (instruction.instructionType === "initialize") {
|
|
1020
1862
|
return "StakeInitializeInstruction";
|
|
1021
1863
|
}
|
|
1022
|
-
if (instruction.
|
|
1864
|
+
if (instruction.instructionType === "authorize") {
|
|
1023
1865
|
return "StakeAuthorizeInstruction";
|
|
1024
1866
|
}
|
|
1025
|
-
if (instruction.
|
|
1867
|
+
if (instruction.instructionType === "delegate") {
|
|
1026
1868
|
return "StakeDelegateStakeInstruction";
|
|
1027
1869
|
}
|
|
1028
|
-
if (instruction.
|
|
1870
|
+
if (instruction.instructionType === "split") {
|
|
1029
1871
|
return "StakeSplitInstruction";
|
|
1030
1872
|
}
|
|
1031
|
-
if (instruction.
|
|
1873
|
+
if (instruction.instructionType === "withdraw") {
|
|
1032
1874
|
return "StakeWithdrawInstruction";
|
|
1033
1875
|
}
|
|
1034
|
-
if (instruction.
|
|
1876
|
+
if (instruction.instructionType === "deactivate") {
|
|
1035
1877
|
return "StakeDeactivateInstruction";
|
|
1036
1878
|
}
|
|
1037
|
-
if (instruction.
|
|
1879
|
+
if (instruction.instructionType === "setLockup") {
|
|
1038
1880
|
return "StakeSetLockupInstruction";
|
|
1039
1881
|
}
|
|
1040
|
-
if (instruction.
|
|
1882
|
+
if (instruction.instructionType === "merge") {
|
|
1041
1883
|
return "StakeMergeInstruction";
|
|
1042
1884
|
}
|
|
1043
|
-
if (instruction.
|
|
1885
|
+
if (instruction.instructionType === "authorizeWithSeed") {
|
|
1044
1886
|
return "StakeAuthorizeWithSeedInstruction";
|
|
1045
1887
|
}
|
|
1046
|
-
if (instruction.
|
|
1888
|
+
if (instruction.instructionType === "initializeChecked") {
|
|
1047
1889
|
return "StakeInitializeCheckedInstruction";
|
|
1048
1890
|
}
|
|
1049
|
-
if (instruction.
|
|
1891
|
+
if (instruction.instructionType === "authorizeChecked") {
|
|
1050
1892
|
return "StakeAuthorizeCheckedInstruction";
|
|
1051
1893
|
}
|
|
1052
|
-
if (instruction.
|
|
1894
|
+
if (instruction.instructionType === "authorizeCheckedWithSeed") {
|
|
1053
1895
|
return "StakeAuthorizeCheckedWithSeedInstruction";
|
|
1054
1896
|
}
|
|
1055
|
-
if (instruction.
|
|
1897
|
+
if (instruction.instructionType === "setLockupChecked") {
|
|
1056
1898
|
return "StakeSetLockupCheckedInstruction";
|
|
1057
1899
|
}
|
|
1058
|
-
if (instruction.
|
|
1900
|
+
if (instruction.instructionType === "deactivateDelinquent") {
|
|
1059
1901
|
return "StakeDeactivateDelinquentInstruction";
|
|
1060
1902
|
}
|
|
1061
|
-
if (instruction.
|
|
1903
|
+
if (instruction.instructionType === "redelegate") {
|
|
1062
1904
|
return "StakeRedelegateInstruction";
|
|
1063
1905
|
}
|
|
1064
1906
|
}
|
|
1065
|
-
if (instruction.
|
|
1066
|
-
if (instruction.
|
|
1907
|
+
if (instruction.programName === "system") {
|
|
1908
|
+
if (instruction.instructionType === "createAccount") {
|
|
1067
1909
|
return "CreateAccountInstruction";
|
|
1068
1910
|
}
|
|
1069
|
-
if (instruction.
|
|
1911
|
+
if (instruction.instructionType === "assign") {
|
|
1070
1912
|
return "AssignInstruction";
|
|
1071
1913
|
}
|
|
1072
|
-
if (instruction.
|
|
1914
|
+
if (instruction.instructionType === "transfer") {
|
|
1073
1915
|
return "TransferInstruction";
|
|
1074
1916
|
}
|
|
1075
|
-
if (instruction.
|
|
1917
|
+
if (instruction.instructionType === "createAccountWithSeed") {
|
|
1076
1918
|
return "CreateAccountWithSeedInstruction";
|
|
1077
1919
|
}
|
|
1078
|
-
if (instruction.
|
|
1920
|
+
if (instruction.instructionType === "advanceNonceAccount") {
|
|
1079
1921
|
return "AdvanceNonceAccountInstruction";
|
|
1080
1922
|
}
|
|
1081
|
-
if (instruction.
|
|
1923
|
+
if (instruction.instructionType === "withdrawNonceAccount") {
|
|
1082
1924
|
return "WithdrawNonceAccountInstruction";
|
|
1083
1925
|
}
|
|
1084
|
-
if (instruction.
|
|
1926
|
+
if (instruction.instructionType === "initializeNonceAccount") {
|
|
1085
1927
|
return "InitializeNonceAccountInstruction";
|
|
1086
1928
|
}
|
|
1087
|
-
if (instruction.
|
|
1929
|
+
if (instruction.instructionType === "authorizeNonceAccount") {
|
|
1088
1930
|
return "AuthorizeNonceAccountInstruction";
|
|
1089
1931
|
}
|
|
1090
|
-
if (instruction.
|
|
1932
|
+
if (instruction.instructionType === "upgradeNonceAccount") {
|
|
1091
1933
|
return "UpgradeNonceAccountInstruction";
|
|
1092
1934
|
}
|
|
1093
|
-
if (instruction.
|
|
1935
|
+
if (instruction.instructionType === "allocate") {
|
|
1094
1936
|
return "AllocateInstruction";
|
|
1095
1937
|
}
|
|
1096
|
-
if (instruction.
|
|
1938
|
+
if (instruction.instructionType === "allocateWithSeed") {
|
|
1097
1939
|
return "AllocateWithSeedInstruction";
|
|
1098
1940
|
}
|
|
1099
|
-
if (instruction.
|
|
1941
|
+
if (instruction.instructionType === "assignWithSeed") {
|
|
1100
1942
|
return "AssignWithSeedInstruction";
|
|
1101
1943
|
}
|
|
1102
|
-
if (instruction.
|
|
1944
|
+
if (instruction.instructionType === "transferWithSeed") {
|
|
1103
1945
|
return "TransferWithSeedInstruction";
|
|
1104
1946
|
}
|
|
1105
1947
|
}
|
|
1106
|
-
if (instruction.
|
|
1107
|
-
if (instruction.
|
|
1948
|
+
if (instruction.programName === "vote") {
|
|
1949
|
+
if (instruction.instructionType === "initialize") {
|
|
1108
1950
|
return "VoteInitializeAccountInstruction";
|
|
1109
1951
|
}
|
|
1110
|
-
if (instruction.
|
|
1952
|
+
if (instruction.instructionType === "authorize") {
|
|
1111
1953
|
return "VoteAuthorizeInstruction";
|
|
1112
1954
|
}
|
|
1113
|
-
if (instruction.
|
|
1955
|
+
if (instruction.instructionType === "authorizeWithSeed") {
|
|
1114
1956
|
return "VoteAuthorizeWithSeedInstruction";
|
|
1115
1957
|
}
|
|
1116
|
-
if (instruction.
|
|
1958
|
+
if (instruction.instructionType === "authorizeCheckedWithSeed") {
|
|
1117
1959
|
return "VoteAuthorizeCheckedWithSeedInstruction";
|
|
1118
1960
|
}
|
|
1119
|
-
if (instruction.
|
|
1961
|
+
if (instruction.instructionType === "vote") {
|
|
1120
1962
|
return "VoteVoteInstruction";
|
|
1121
1963
|
}
|
|
1122
|
-
if (instruction.
|
|
1964
|
+
if (instruction.instructionType === "updatevotestate") {
|
|
1123
1965
|
return "VoteUpdateVoteStateInstruction";
|
|
1124
1966
|
}
|
|
1125
|
-
if (instruction.
|
|
1967
|
+
if (instruction.instructionType === "updatevotestateswitch") {
|
|
1126
1968
|
return "VoteUpdateVoteStateSwitchInstruction";
|
|
1127
1969
|
}
|
|
1128
|
-
if (instruction.
|
|
1970
|
+
if (instruction.instructionType === "compactupdatevotestate") {
|
|
1129
1971
|
return "VoteCompactUpdateVoteStateInstruction";
|
|
1130
1972
|
}
|
|
1131
|
-
if (instruction.
|
|
1973
|
+
if (instruction.instructionType === "compactupdatevotestateswitch") {
|
|
1132
1974
|
return "VoteCompactUpdateVoteStateSwitchInstruction";
|
|
1133
1975
|
}
|
|
1134
|
-
if (instruction.
|
|
1976
|
+
if (instruction.instructionType === "withdraw") {
|
|
1135
1977
|
return "VoteWithdrawInstruction";
|
|
1136
1978
|
}
|
|
1137
|
-
if (instruction.
|
|
1979
|
+
if (instruction.instructionType === "updateValidatorIdentity") {
|
|
1138
1980
|
return "VoteUpdateValidatorIdentityInstruction";
|
|
1139
1981
|
}
|
|
1140
|
-
if (instruction.
|
|
1982
|
+
if (instruction.instructionType === "updateCommission") {
|
|
1141
1983
|
return "VoteUpdateCommissionInstruction";
|
|
1142
1984
|
}
|
|
1143
|
-
if (instruction.
|
|
1985
|
+
if (instruction.instructionType === "voteSwitch") {
|
|
1144
1986
|
return "VoteVoteSwitchInstruction";
|
|
1145
1987
|
}
|
|
1146
|
-
if (instruction.
|
|
1988
|
+
if (instruction.instructionType === "authorizeChecked") {
|
|
1147
1989
|
return "VoteAuthorizeCheckedInstruction";
|
|
1148
1990
|
}
|
|
1149
1991
|
}
|
|
1150
|
-
return "PartiallyDecodedInstruction";
|
|
1151
|
-
}
|
|
1152
|
-
});
|
|
1153
|
-
return memoisedParsedTransactionInstructionInterface;
|
|
1154
|
-
};
|
|
1155
|
-
var parsedTransactionInstructionType = (name, parsedInfoFields) => new graphql.GraphQLObjectType({
|
|
1156
|
-
fields: {
|
|
1157
|
-
parsed: object(name + "Parsed", {
|
|
1158
|
-
info: object(name + "ParsedInfo", parsedInfoFields),
|
|
1159
|
-
type: string()
|
|
1160
|
-
}),
|
|
1161
|
-
program: string(),
|
|
1162
|
-
programId: string()
|
|
1163
|
-
},
|
|
1164
|
-
interfaces: [parsedTransactionInstructionInterface()],
|
|
1165
|
-
name
|
|
1166
|
-
});
|
|
1167
|
-
var memoisedPartiallyDecodedTransactionInstruction;
|
|
1168
|
-
var partiallyDecodedTransactionInstruction = () => {
|
|
1169
|
-
if (!memoisedPartiallyDecodedTransactionInstruction)
|
|
1170
|
-
memoisedPartiallyDecodedTransactionInstruction = new graphql.GraphQLObjectType({
|
|
1171
|
-
fields: {
|
|
1172
|
-
accounts: list(string()),
|
|
1173
|
-
data: string(),
|
|
1174
|
-
programId: string()
|
|
1175
|
-
},
|
|
1176
|
-
interfaces: [parsedTransactionInstructionInterface()],
|
|
1177
|
-
name: "PartiallyDecodedInstruction"
|
|
1178
|
-
});
|
|
1179
|
-
return memoisedPartiallyDecodedTransactionInstruction;
|
|
1180
|
-
};
|
|
1181
|
-
var memoisedParsedInstructionsAddressLookupTable;
|
|
1182
|
-
var parsedInstructionsAddressLookupTable = () => {
|
|
1183
|
-
if (!memoisedParsedInstructionsAddressLookupTable)
|
|
1184
|
-
memoisedParsedInstructionsAddressLookupTable = [
|
|
1185
|
-
parsedTransactionInstructionType("CreateLookupTableInstruction", {
|
|
1186
|
-
bumpSeed: number(),
|
|
1187
|
-
lookupTableAccount: string(),
|
|
1188
|
-
lookupTableAuthority: string(),
|
|
1189
|
-
payerAccount: string(),
|
|
1190
|
-
recentSlot: bigint(),
|
|
1191
|
-
systemProgram: string()
|
|
1192
|
-
}),
|
|
1193
|
-
parsedTransactionInstructionType("FreezeLookupTableInstruction", {
|
|
1194
|
-
lookupTableAccount: string(),
|
|
1195
|
-
lookupTableAuthority: string()
|
|
1196
|
-
}),
|
|
1197
|
-
parsedTransactionInstructionType("ExtendLookupTableInstruction", {
|
|
1198
|
-
lookupTableAccount: string(),
|
|
1199
|
-
lookupTableAuthority: string(),
|
|
1200
|
-
newAddresses: list(string()),
|
|
1201
|
-
payerAccount: string(),
|
|
1202
|
-
systemProgram: string()
|
|
1203
|
-
}),
|
|
1204
|
-
parsedTransactionInstructionType("DeactivateLookupTableInstruction", {
|
|
1205
|
-
lookupTableAccount: string(),
|
|
1206
|
-
lookupTableAuthority: string()
|
|
1207
|
-
}),
|
|
1208
|
-
parsedTransactionInstructionType("CloseLookupTableInstruction", {
|
|
1209
|
-
lookupTableAccount: string(),
|
|
1210
|
-
lookupTableAuthority: string(),
|
|
1211
|
-
recipient: string()
|
|
1212
|
-
})
|
|
1213
|
-
];
|
|
1214
|
-
return memoisedParsedInstructionsAddressLookupTable;
|
|
1215
|
-
};
|
|
1216
|
-
var memoisedParsedInstructionsBpfLoader;
|
|
1217
|
-
var parsedInstructionsBpfLoader = () => {
|
|
1218
|
-
if (!memoisedParsedInstructionsBpfLoader)
|
|
1219
|
-
memoisedParsedInstructionsBpfLoader = [
|
|
1220
|
-
parsedTransactionInstructionType("BpfLoaderWriteInstruction", {
|
|
1221
|
-
account: string(),
|
|
1222
|
-
bytes: string(),
|
|
1223
|
-
offset: number()
|
|
1224
|
-
}),
|
|
1225
|
-
parsedTransactionInstructionType("BpfLoaderFinalizeInstruction", {
|
|
1226
|
-
account: string()
|
|
1227
|
-
})
|
|
1228
|
-
];
|
|
1229
|
-
return memoisedParsedInstructionsBpfLoader;
|
|
1230
|
-
};
|
|
1231
|
-
var memoisedParsedInstructionsBpfUpgradeableLoader;
|
|
1232
|
-
var parsedInstructionsBpfUpgradeableLoader = () => {
|
|
1233
|
-
if (!memoisedParsedInstructionsBpfUpgradeableLoader)
|
|
1234
|
-
memoisedParsedInstructionsBpfUpgradeableLoader = [
|
|
1235
|
-
parsedTransactionInstructionType("BpfUpgradeableLoaderInitializeBufferInstruction", {
|
|
1236
|
-
account: string()
|
|
1237
|
-
}),
|
|
1238
|
-
parsedTransactionInstructionType("BpfUpgradeableLoaderWriteInstruction", {
|
|
1239
|
-
account: string(),
|
|
1240
|
-
authority: string(),
|
|
1241
|
-
bytes: string(),
|
|
1242
|
-
offset: number()
|
|
1243
|
-
}),
|
|
1244
|
-
parsedTransactionInstructionType("BpfUpgradeableLoaderDeployWithMaxDataLenInstruction", {
|
|
1245
|
-
authority: string(),
|
|
1246
|
-
bufferAccount: string(),
|
|
1247
|
-
clockSysvar: string(),
|
|
1248
|
-
maxDataLen: bigint(),
|
|
1249
|
-
payerAccount: string(),
|
|
1250
|
-
programAccount: string(),
|
|
1251
|
-
programDataAccount: string(),
|
|
1252
|
-
rentSysvar: string()
|
|
1253
|
-
}),
|
|
1254
|
-
parsedTransactionInstructionType("BpfUpgradeableLoaderUpgradeInstruction", {
|
|
1255
|
-
authority: string(),
|
|
1256
|
-
bufferAccount: string(),
|
|
1257
|
-
clockSysvar: string(),
|
|
1258
|
-
programAccount: string(),
|
|
1259
|
-
programDataAccount: string(),
|
|
1260
|
-
rentSysvar: string(),
|
|
1261
|
-
spillAccount: string()
|
|
1262
|
-
}),
|
|
1263
|
-
parsedTransactionInstructionType("BpfUpgradeableLoaderSetAuthorityInstruction", {
|
|
1264
|
-
account: string(),
|
|
1265
|
-
authority: string(),
|
|
1266
|
-
newAuthority: string()
|
|
1267
|
-
}),
|
|
1268
|
-
parsedTransactionInstructionType("BpfUpgradeableLoaderSetAuthorityCheckedInstruction", {
|
|
1269
|
-
account: string(),
|
|
1270
|
-
authority: string(),
|
|
1271
|
-
newAuthority: string()
|
|
1272
|
-
}),
|
|
1273
|
-
parsedTransactionInstructionType("BpfUpgradeableLoaderCloseInstruction", {
|
|
1274
|
-
account: string(),
|
|
1275
|
-
authority: string(),
|
|
1276
|
-
programAccount: string(),
|
|
1277
|
-
recipient: string()
|
|
1278
|
-
}),
|
|
1279
|
-
parsedTransactionInstructionType("BpfUpgradeableLoaderExtendProgramInstruction", {
|
|
1280
|
-
additionalBytes: bigint(),
|
|
1281
|
-
payerAccount: string(),
|
|
1282
|
-
programAccount: string(),
|
|
1283
|
-
programDataAccount: string(),
|
|
1284
|
-
systemProgram: string()
|
|
1285
|
-
})
|
|
1286
|
-
];
|
|
1287
|
-
return memoisedParsedInstructionsBpfUpgradeableLoader;
|
|
1288
|
-
};
|
|
1289
|
-
var memoisedParsedInstructionsSplAssociatedToken;
|
|
1290
|
-
var parsedInstructionsSplAssociatedToken = () => {
|
|
1291
|
-
if (!memoisedParsedInstructionsSplAssociatedToken)
|
|
1292
|
-
memoisedParsedInstructionsSplAssociatedToken = [
|
|
1293
|
-
parsedTransactionInstructionType("SplAssociatedTokenCreateInstruction", {
|
|
1294
|
-
account: string(),
|
|
1295
|
-
mint: string(),
|
|
1296
|
-
source: string(),
|
|
1297
|
-
systemProgram: string(),
|
|
1298
|
-
tokenProgram: string(),
|
|
1299
|
-
wallet: string()
|
|
1300
|
-
}),
|
|
1301
|
-
parsedTransactionInstructionType("SplAssociatedTokenCreateIdempotentInstruction", {
|
|
1302
|
-
account: string(),
|
|
1303
|
-
mint: string(),
|
|
1304
|
-
source: string(),
|
|
1305
|
-
systemProgram: string(),
|
|
1306
|
-
tokenProgram: string(),
|
|
1307
|
-
wallet: string()
|
|
1308
|
-
}),
|
|
1309
|
-
parsedTransactionInstructionType("SplAssociatedTokenRecoverNestedInstruction", {
|
|
1310
|
-
destination: string(),
|
|
1311
|
-
nestedMint: string(),
|
|
1312
|
-
nestedOwner: string(),
|
|
1313
|
-
nestedSource: string(),
|
|
1314
|
-
ownerMint: string(),
|
|
1315
|
-
tokenProgram: string(),
|
|
1316
|
-
wallet: string()
|
|
1317
|
-
})
|
|
1318
|
-
];
|
|
1319
|
-
return memoisedParsedInstructionsSplAssociatedToken;
|
|
1320
|
-
};
|
|
1321
|
-
var memoisedParsedInstructionSplMemo;
|
|
1322
|
-
var parsedInstructionSplMemo = () => {
|
|
1323
|
-
if (!memoisedParsedInstructionSplMemo)
|
|
1324
|
-
memoisedParsedInstructionSplMemo = new graphql.GraphQLObjectType({
|
|
1325
|
-
fields: {
|
|
1326
|
-
parsed: string(),
|
|
1327
|
-
program: string(),
|
|
1328
|
-
programId: string()
|
|
1329
|
-
},
|
|
1330
|
-
interfaces: [parsedTransactionInstructionInterface()],
|
|
1331
|
-
name: "SplMemoInstruction"
|
|
1332
|
-
});
|
|
1333
|
-
return memoisedParsedInstructionSplMemo;
|
|
1334
|
-
};
|
|
1335
|
-
var memoisedParsedInstructionsSplToken;
|
|
1336
|
-
var parsedInstructionsSplToken = () => {
|
|
1337
|
-
if (!memoisedParsedInstructionsSplToken)
|
|
1338
|
-
memoisedParsedInstructionsSplToken = [
|
|
1339
|
-
parsedTransactionInstructionType("SplTokenInitializeMintInstruction", {
|
|
1340
|
-
decimals: number(),
|
|
1341
|
-
freezeAuthority: string(),
|
|
1342
|
-
mint: string(),
|
|
1343
|
-
mintAuthority: string(),
|
|
1344
|
-
rentSysvar: string()
|
|
1345
|
-
}),
|
|
1346
|
-
parsedTransactionInstructionType("SplTokenInitializeMint2Instruction", {
|
|
1347
|
-
decimals: number(),
|
|
1348
|
-
freezeAuthority: string(),
|
|
1349
|
-
mint: string(),
|
|
1350
|
-
mintAuthority: string()
|
|
1351
|
-
}),
|
|
1352
|
-
parsedTransactionInstructionType("SplTokenInitializeAccountInstruction", {
|
|
1353
|
-
account: string(),
|
|
1354
|
-
mint: string(),
|
|
1355
|
-
owner: string(),
|
|
1356
|
-
rentSysvar: string()
|
|
1357
|
-
}),
|
|
1358
|
-
parsedTransactionInstructionType("SplTokenInitializeAccount2Instruction", {
|
|
1359
|
-
account: string(),
|
|
1360
|
-
mint: string(),
|
|
1361
|
-
owner: string(),
|
|
1362
|
-
rentSysvar: string()
|
|
1363
|
-
}),
|
|
1364
|
-
parsedTransactionInstructionType("SplTokenInitializeAccount3Instruction", {
|
|
1365
|
-
account: string(),
|
|
1366
|
-
mint: string(),
|
|
1367
|
-
owner: string()
|
|
1368
|
-
}),
|
|
1369
|
-
parsedTransactionInstructionType("SplTokenInitializeMultisigInstruction", {
|
|
1370
|
-
m: number(),
|
|
1371
|
-
multisig: string(),
|
|
1372
|
-
rentSysvar: string(),
|
|
1373
|
-
signers: list(string())
|
|
1374
|
-
}),
|
|
1375
|
-
parsedTransactionInstructionType("SplTokenInitializeMultisig2Instruction", {
|
|
1376
|
-
m: number(),
|
|
1377
|
-
multisig: string(),
|
|
1378
|
-
signers: list(string())
|
|
1379
|
-
}),
|
|
1380
|
-
parsedTransactionInstructionType("SplTokenTransferInstruction", {
|
|
1381
|
-
amount: string(),
|
|
1382
|
-
authority: string(),
|
|
1383
|
-
destination: string(),
|
|
1384
|
-
multisigAuthority: string(),
|
|
1385
|
-
source: string()
|
|
1386
|
-
}),
|
|
1387
|
-
parsedTransactionInstructionType("SplTokenApproveInstruction", {
|
|
1388
|
-
amount: string(),
|
|
1389
|
-
delegate: string(),
|
|
1390
|
-
multisigOwner: string(),
|
|
1391
|
-
owner: string(),
|
|
1392
|
-
source: string()
|
|
1393
|
-
}),
|
|
1394
|
-
parsedTransactionInstructionType("SplTokenRevokeInstruction", {
|
|
1395
|
-
multisigOwner: string(),
|
|
1396
|
-
owner: string(),
|
|
1397
|
-
source: string()
|
|
1398
|
-
}),
|
|
1399
|
-
parsedTransactionInstructionType("SplTokenSetAuthorityInstruction", {
|
|
1400
|
-
authority: string(),
|
|
1401
|
-
authorityType: string(),
|
|
1402
|
-
multisigAuthority: string(),
|
|
1403
|
-
newAuthority: string()
|
|
1404
|
-
}),
|
|
1405
|
-
parsedTransactionInstructionType("SplTokenMintToInstruction", {
|
|
1406
|
-
account: string(),
|
|
1407
|
-
amount: string(),
|
|
1408
|
-
authority: string(),
|
|
1409
|
-
mint: string(),
|
|
1410
|
-
mintAuthority: string(),
|
|
1411
|
-
multisigMintAuthority: string()
|
|
1412
|
-
}),
|
|
1413
|
-
parsedTransactionInstructionType("SplTokenBurnInstruction", {
|
|
1414
|
-
account: string(),
|
|
1415
|
-
amount: string(),
|
|
1416
|
-
authority: string(),
|
|
1417
|
-
mint: string(),
|
|
1418
|
-
multisigAuthority: string()
|
|
1419
|
-
}),
|
|
1420
|
-
parsedTransactionInstructionType("SplTokenCloseAccountInstruction", {
|
|
1421
|
-
account: string(),
|
|
1422
|
-
destination: string(),
|
|
1423
|
-
multisigOwner: string(),
|
|
1424
|
-
owner: string()
|
|
1425
|
-
}),
|
|
1426
|
-
parsedTransactionInstructionType("SplTokenFreezeAccountInstruction", {
|
|
1427
|
-
account: string(),
|
|
1428
|
-
freezeAuthority: string(),
|
|
1429
|
-
mint: string(),
|
|
1430
|
-
multisigFreezeAuthority: string()
|
|
1431
|
-
}),
|
|
1432
|
-
parsedTransactionInstructionType("SplTokenThawAccountInstruction", {
|
|
1433
|
-
account: string(),
|
|
1434
|
-
freezeAuthority: string(),
|
|
1435
|
-
mint: string(),
|
|
1436
|
-
multisigFreezeAuthority: string()
|
|
1437
|
-
}),
|
|
1438
|
-
parsedTransactionInstructionType("SplTokenTransferCheckedInstruction", {
|
|
1439
|
-
authority: string(),
|
|
1440
|
-
destination: string(),
|
|
1441
|
-
mint: string(),
|
|
1442
|
-
multisigAuthority: string(),
|
|
1443
|
-
source: string(),
|
|
1444
|
-
tokenAmount: string()
|
|
1445
|
-
}),
|
|
1446
|
-
parsedTransactionInstructionType("SplTokenApproveCheckedInstruction", {
|
|
1447
|
-
delegate: string(),
|
|
1448
|
-
mint: string(),
|
|
1449
|
-
multisigOwner: string(),
|
|
1450
|
-
owner: string(),
|
|
1451
|
-
source: string(),
|
|
1452
|
-
tokenAmount: string()
|
|
1453
|
-
}),
|
|
1454
|
-
parsedTransactionInstructionType("SplTokenMintToCheckedInstruction", {
|
|
1455
|
-
account: string(),
|
|
1456
|
-
authority: string(),
|
|
1457
|
-
mint: string(),
|
|
1458
|
-
mintAuthority: string(),
|
|
1459
|
-
multisigMintAuthority: string(),
|
|
1460
|
-
tokenAmount: string()
|
|
1461
|
-
}),
|
|
1462
|
-
parsedTransactionInstructionType("SplTokenBurnCheckedInstruction", {
|
|
1463
|
-
account: string(),
|
|
1464
|
-
authority: string(),
|
|
1465
|
-
mint: string(),
|
|
1466
|
-
multisigAuthority: string(),
|
|
1467
|
-
tokenAmount: string()
|
|
1468
|
-
}),
|
|
1469
|
-
parsedTransactionInstructionType("SplTokenSyncNativeInstruction", {
|
|
1470
|
-
account: string()
|
|
1471
|
-
}),
|
|
1472
|
-
parsedTransactionInstructionType("SplTokenGetAccountDataSizeInstruction", {
|
|
1473
|
-
extensionTypes: list(string()),
|
|
1474
|
-
mint: string()
|
|
1475
|
-
}),
|
|
1476
|
-
parsedTransactionInstructionType("SplTokenInitializeImmutableOwnerInstruction", {
|
|
1477
|
-
account: string()
|
|
1478
|
-
}),
|
|
1479
|
-
parsedTransactionInstructionType("SplTokenAmountToUiAmountInstruction", {
|
|
1480
|
-
amount: string(),
|
|
1481
|
-
mint: string()
|
|
1482
|
-
}),
|
|
1483
|
-
parsedTransactionInstructionType("SplTokenUiAmountToAmountInstruction", {
|
|
1484
|
-
mint: string(),
|
|
1485
|
-
uiAmount: string()
|
|
1486
|
-
}),
|
|
1487
|
-
parsedTransactionInstructionType("SplTokenInitializeMintCloseAuthorityInstruction", {
|
|
1488
|
-
mint: string(),
|
|
1489
|
-
newAuthority: string()
|
|
1490
|
-
})
|
|
1491
|
-
// TODO: Extensions!
|
|
1492
|
-
// - TransferFeeExtension
|
|
1493
|
-
// - ConfidentialTransferFeeExtension
|
|
1494
|
-
// - DefaultAccountStateExtension
|
|
1495
|
-
// - Reallocate
|
|
1496
|
-
// - MemoTransferExtension
|
|
1497
|
-
// - CreateNativeMint
|
|
1498
|
-
// - InitializeNonTransferableMint
|
|
1499
|
-
// - InterestBearingMintExtension
|
|
1500
|
-
// - CpiGuardExtension
|
|
1501
|
-
// - InitializePermanentDelegate
|
|
1502
|
-
// - TransferHookExtension
|
|
1503
|
-
// - ConfidentialTransferFeeExtension
|
|
1504
|
-
// - WithdrawExcessLamports
|
|
1505
|
-
// - MetadataPointerExtension
|
|
1506
|
-
];
|
|
1507
|
-
return memoisedParsedInstructionsSplToken;
|
|
1508
|
-
};
|
|
1509
|
-
var memoisedLockup;
|
|
1510
|
-
var lockup = () => {
|
|
1511
|
-
if (!memoisedLockup)
|
|
1512
|
-
memoisedLockup = new graphql.GraphQLObjectType({
|
|
1513
|
-
fields: {
|
|
1514
|
-
custodian: string(),
|
|
1515
|
-
epoch: bigint(),
|
|
1516
|
-
unixTimestamp: bigint()
|
|
1517
|
-
},
|
|
1518
|
-
name: "Lockup"
|
|
1519
|
-
});
|
|
1520
|
-
return memoisedLockup;
|
|
1521
|
-
};
|
|
1522
|
-
var memoisedParsedInstructionsStake;
|
|
1523
|
-
var parsedInstructionsStake = () => {
|
|
1524
|
-
if (!memoisedParsedInstructionsStake)
|
|
1525
|
-
memoisedParsedInstructionsStake = [
|
|
1526
|
-
parsedTransactionInstructionType("StakeInitializeInstruction", {
|
|
1527
|
-
authorized: object("StakeInitializeInstructionAuthorized", {
|
|
1528
|
-
staker: string(),
|
|
1529
|
-
withdrawer: string()
|
|
1530
|
-
}),
|
|
1531
|
-
lockup: object("StakeInitializeInstructionLockup", {
|
|
1532
|
-
custodian: string(),
|
|
1533
|
-
epoch: bigint(),
|
|
1534
|
-
unixTimestamp: bigint()
|
|
1535
|
-
}),
|
|
1536
|
-
rentSysvar: string(),
|
|
1537
|
-
stakeAccount: string()
|
|
1538
|
-
}),
|
|
1539
|
-
parsedTransactionInstructionType("StakeAuthorizeInstruction", {
|
|
1540
|
-
authority: string(),
|
|
1541
|
-
authorityType: string(),
|
|
1542
|
-
clockSysvar: string(),
|
|
1543
|
-
custodian: string(),
|
|
1544
|
-
newAuthority: string(),
|
|
1545
|
-
stakeAccount: string()
|
|
1546
|
-
}),
|
|
1547
|
-
parsedTransactionInstructionType("StakeDelegateStakeInstruction", {
|
|
1548
|
-
clockSysvar: string(),
|
|
1549
|
-
stakeAccount: string(),
|
|
1550
|
-
stakeAuthority: string(),
|
|
1551
|
-
stakeConfigAccount: string(),
|
|
1552
|
-
stakeHistorySysvar: string(),
|
|
1553
|
-
voteAccount: string()
|
|
1554
|
-
}),
|
|
1555
|
-
parsedTransactionInstructionType("StakeSplitInstruction", {
|
|
1556
|
-
lamports: bigint(),
|
|
1557
|
-
newSplitAccount: string(),
|
|
1558
|
-
stakeAccount: string(),
|
|
1559
|
-
stakeAuthority: string()
|
|
1560
|
-
}),
|
|
1561
|
-
parsedTransactionInstructionType("StakeWithdrawInstruction", {
|
|
1562
|
-
clockSysvar: string(),
|
|
1563
|
-
destination: string(),
|
|
1564
|
-
lamports: bigint(),
|
|
1565
|
-
stakeAccount: string(),
|
|
1566
|
-
withdrawAuthority: string()
|
|
1567
|
-
}),
|
|
1568
|
-
parsedTransactionInstructionType("StakeDeactivateInstruction", {
|
|
1569
|
-
clockSysvar: string(),
|
|
1570
|
-
stakeAccount: string(),
|
|
1571
|
-
stakeAuthority: string()
|
|
1572
|
-
}),
|
|
1573
|
-
parsedTransactionInstructionType("StakeSetLockupInstruction", {
|
|
1574
|
-
custodian: string(),
|
|
1575
|
-
lockup: type(lockup()),
|
|
1576
|
-
stakeAccount: string()
|
|
1577
|
-
}),
|
|
1578
|
-
parsedTransactionInstructionType("StakeMergeInstruction", {
|
|
1579
|
-
clockSysvar: string(),
|
|
1580
|
-
destination: string(),
|
|
1581
|
-
source: string(),
|
|
1582
|
-
stakeAuthority: string(),
|
|
1583
|
-
stakeHistorySysvar: string()
|
|
1584
|
-
}),
|
|
1585
|
-
parsedTransactionInstructionType("StakeAuthorizeWithSeedInstruction", {
|
|
1586
|
-
authorityBase: string(),
|
|
1587
|
-
authorityOwner: string(),
|
|
1588
|
-
authoritySeed: string(),
|
|
1589
|
-
authorityType: string(),
|
|
1590
|
-
clockSysvar: string(),
|
|
1591
|
-
custodian: string(),
|
|
1592
|
-
newAuthorized: string(),
|
|
1593
|
-
stakeAccount: string()
|
|
1594
|
-
}),
|
|
1595
|
-
parsedTransactionInstructionType("StakeInitializeCheckedInstruction", {
|
|
1596
|
-
rentSysvar: string(),
|
|
1597
|
-
stakeAccount: string(),
|
|
1598
|
-
staker: string(),
|
|
1599
|
-
withdrawer: string()
|
|
1600
|
-
}),
|
|
1601
|
-
parsedTransactionInstructionType("StakeAuthorizeCheckedInstruction", {
|
|
1602
|
-
authority: string(),
|
|
1603
|
-
authorityType: string(),
|
|
1604
|
-
clockSysvar: string(),
|
|
1605
|
-
custodian: string(),
|
|
1606
|
-
newAuthority: string(),
|
|
1607
|
-
stakeAccount: string()
|
|
1608
|
-
}),
|
|
1609
|
-
parsedTransactionInstructionType("StakeAuthorizeCheckedWithSeedInstruction", {
|
|
1610
|
-
authorityBase: string(),
|
|
1611
|
-
authorityOwner: string(),
|
|
1612
|
-
authoritySeed: string(),
|
|
1613
|
-
authorityType: string(),
|
|
1614
|
-
clockSysvar: string(),
|
|
1615
|
-
custodian: string(),
|
|
1616
|
-
newAuthorized: string(),
|
|
1617
|
-
stakeAccount: string()
|
|
1618
|
-
}),
|
|
1619
|
-
parsedTransactionInstructionType("StakeSetLockupCheckedInstruction", {
|
|
1620
|
-
custodian: string(),
|
|
1621
|
-
lockup: type(lockup()),
|
|
1622
|
-
stakeAccount: string()
|
|
1623
|
-
}),
|
|
1624
|
-
parsedTransactionInstructionType("StakeDeactivateDelinquentInstruction", {
|
|
1625
|
-
referenceVoteAccount: string(),
|
|
1626
|
-
stakeAccount: string(),
|
|
1627
|
-
voteAccount: string()
|
|
1628
|
-
}),
|
|
1629
|
-
parsedTransactionInstructionType("StakeRedelegateInstruction", {
|
|
1630
|
-
newStakeAccount: string(),
|
|
1631
|
-
stakeAccount: string(),
|
|
1632
|
-
stakeAuthority: string(),
|
|
1633
|
-
stakeConfigAccount: string(),
|
|
1634
|
-
voteAccount: string()
|
|
1635
|
-
})
|
|
1636
|
-
];
|
|
1637
|
-
return memoisedParsedInstructionsStake;
|
|
1638
|
-
};
|
|
1639
|
-
var memoisedParsedInstructionsSystem;
|
|
1640
|
-
var parsedInstructionsSystem = () => {
|
|
1641
|
-
if (!memoisedParsedInstructionsSystem)
|
|
1642
|
-
memoisedParsedInstructionsSystem = [
|
|
1643
|
-
parsedTransactionInstructionType("CreateAccountInstruction", {
|
|
1644
|
-
lamports: bigint(),
|
|
1645
|
-
newAccount: string(),
|
|
1646
|
-
owner: string(),
|
|
1647
|
-
source: string(),
|
|
1648
|
-
space: bigint()
|
|
1649
|
-
}),
|
|
1650
|
-
parsedTransactionInstructionType("AssignInstruction", {
|
|
1651
|
-
owner: string()
|
|
1652
|
-
}),
|
|
1653
|
-
parsedTransactionInstructionType("TransferInstruction", {
|
|
1654
|
-
amount: string(),
|
|
1655
|
-
lamports: number(),
|
|
1656
|
-
source: string()
|
|
1657
|
-
}),
|
|
1658
|
-
parsedTransactionInstructionType("CreateAccountWithSeedInstruction", {
|
|
1659
|
-
base: string(),
|
|
1660
|
-
lamports: bigint(),
|
|
1661
|
-
owner: string(),
|
|
1662
|
-
seed: string(),
|
|
1663
|
-
space: bigint()
|
|
1664
|
-
}),
|
|
1665
|
-
parsedTransactionInstructionType("AdvanceNonceAccountInstruction", {
|
|
1666
|
-
nonceAccount: string(),
|
|
1667
|
-
nonceAuthority: string(),
|
|
1668
|
-
recentBlockhashesSysvar: string()
|
|
1669
|
-
}),
|
|
1670
|
-
parsedTransactionInstructionType("WithdrawNonceAccountInstruction", {
|
|
1671
|
-
destination: string(),
|
|
1672
|
-
lamports: bigint(),
|
|
1673
|
-
nonceAccount: string(),
|
|
1674
|
-
nonceAuthority: string(),
|
|
1675
|
-
recentBlockhashesSysvar: string(),
|
|
1676
|
-
rentSysvar: string()
|
|
1677
|
-
}),
|
|
1678
|
-
parsedTransactionInstructionType("InitializeNonceAccountInstruction", {
|
|
1679
|
-
nonceAccount: string(),
|
|
1680
|
-
nonceAuthority: string(),
|
|
1681
|
-
recentBlockhashesSysvar: string(),
|
|
1682
|
-
rentSysvar: string()
|
|
1683
|
-
}),
|
|
1684
|
-
parsedTransactionInstructionType("AuthorizeNonceAccountInstruction", {
|
|
1685
|
-
newAuthorized: string(),
|
|
1686
|
-
nonceAccount: string(),
|
|
1687
|
-
nonceAuthority: string()
|
|
1688
|
-
}),
|
|
1689
|
-
parsedTransactionInstructionType("UpgradeNonceAccountInstruction", {
|
|
1690
|
-
nonceAccount: string()
|
|
1691
|
-
}),
|
|
1692
|
-
parsedTransactionInstructionType("AllocateInstruction", {
|
|
1693
|
-
account: string(),
|
|
1694
|
-
space: bigint()
|
|
1695
|
-
}),
|
|
1696
|
-
parsedTransactionInstructionType("AllocateWithSeedInstruction", {
|
|
1697
|
-
account: string(),
|
|
1698
|
-
base: string(),
|
|
1699
|
-
owner: string(),
|
|
1700
|
-
seed: string(),
|
|
1701
|
-
space: bigint()
|
|
1702
|
-
}),
|
|
1703
|
-
parsedTransactionInstructionType("AssignWithSeedInstruction", {
|
|
1704
|
-
account: string(),
|
|
1705
|
-
base: string(),
|
|
1706
|
-
owner: string(),
|
|
1707
|
-
seed: string()
|
|
1708
|
-
}),
|
|
1709
|
-
parsedTransactionInstructionType("TransferWithSeedInstruction", {
|
|
1710
|
-
destination: string(),
|
|
1711
|
-
lamports: bigint(),
|
|
1712
|
-
source: string(),
|
|
1713
|
-
sourceBase: string(),
|
|
1714
|
-
sourceOwner: string(),
|
|
1715
|
-
sourceSeed: string()
|
|
1716
|
-
})
|
|
1717
|
-
];
|
|
1718
|
-
return memoisedParsedInstructionsSystem;
|
|
1719
|
-
};
|
|
1720
|
-
var memoisedVote;
|
|
1721
|
-
var vote = () => {
|
|
1722
|
-
if (!memoisedVote)
|
|
1723
|
-
memoisedVote = new graphql.GraphQLObjectType({
|
|
1724
|
-
fields: {
|
|
1725
|
-
hash: string(),
|
|
1726
|
-
slots: list(bigint()),
|
|
1727
|
-
timestamp: bigint()
|
|
1728
|
-
},
|
|
1729
|
-
name: "Vote"
|
|
1730
|
-
});
|
|
1731
|
-
return memoisedVote;
|
|
1732
|
-
};
|
|
1733
|
-
var memoisedVoteStateUpdate;
|
|
1734
|
-
var voteStateUpdate = () => {
|
|
1735
|
-
if (!memoisedVoteStateUpdate)
|
|
1736
|
-
memoisedVoteStateUpdate = new graphql.GraphQLObjectType({
|
|
1737
|
-
fields: {
|
|
1738
|
-
hash: string(),
|
|
1739
|
-
lockouts: list(
|
|
1740
|
-
object("VoteStateUpdateLockout", {
|
|
1741
|
-
confirmationCount: number(),
|
|
1742
|
-
slot: bigint()
|
|
1743
|
-
})
|
|
1744
|
-
),
|
|
1745
|
-
root: bigint(),
|
|
1746
|
-
timestamp: bigint()
|
|
1747
|
-
},
|
|
1748
|
-
name: "VoteStateUpdate"
|
|
1749
|
-
});
|
|
1750
|
-
return memoisedVoteStateUpdate;
|
|
1751
|
-
};
|
|
1752
|
-
var memoisedParsedInstructionsVote;
|
|
1753
|
-
var parsedInstructionsVote = () => {
|
|
1754
|
-
if (!memoisedParsedInstructionsVote)
|
|
1755
|
-
memoisedParsedInstructionsVote = [
|
|
1756
|
-
parsedTransactionInstructionType("VoteInitializeAccountInstruction", {
|
|
1757
|
-
authorizedVoter: string(),
|
|
1758
|
-
authorizedWithdrawer: string(),
|
|
1759
|
-
clockSysvar: string(),
|
|
1760
|
-
commission: number(),
|
|
1761
|
-
node: string(),
|
|
1762
|
-
rentSysvar: string(),
|
|
1763
|
-
voteAccount: string()
|
|
1764
|
-
}),
|
|
1765
|
-
parsedTransactionInstructionType("VoteAuthorizeInstruction", {
|
|
1766
|
-
authority: string(),
|
|
1767
|
-
authorityType: string(),
|
|
1768
|
-
clockSysvar: string(),
|
|
1769
|
-
newAuthority: string(),
|
|
1770
|
-
voteAccount: string()
|
|
1771
|
-
}),
|
|
1772
|
-
parsedTransactionInstructionType("VoteAuthorizeWithSeedInstruction", {
|
|
1773
|
-
authorityBaseKey: string(),
|
|
1774
|
-
authorityOwner: string(),
|
|
1775
|
-
authoritySeed: string(),
|
|
1776
|
-
authorityType: string(),
|
|
1777
|
-
clockSysvar: string(),
|
|
1778
|
-
newAuthority: string(),
|
|
1779
|
-
voteAccount: string()
|
|
1780
|
-
}),
|
|
1781
|
-
parsedTransactionInstructionType("VoteAuthorizeCheckedWithSeedInstruction", {
|
|
1782
|
-
authorityBaseKey: string(),
|
|
1783
|
-
authorityOwner: string(),
|
|
1784
|
-
authoritySeed: string(),
|
|
1785
|
-
authorityType: string(),
|
|
1786
|
-
clockSysvar: string(),
|
|
1787
|
-
newAuthority: string(),
|
|
1788
|
-
voteAccount: string()
|
|
1789
|
-
}),
|
|
1790
|
-
parsedTransactionInstructionType("VoteVoteInstruction", {
|
|
1791
|
-
clockSysvar: string(),
|
|
1792
|
-
slotHashedSysvar: string(),
|
|
1793
|
-
vote: type(vote()),
|
|
1794
|
-
voteAccount: string(),
|
|
1795
|
-
voteAuthority: string()
|
|
1796
|
-
}),
|
|
1797
|
-
parsedTransactionInstructionType("VoteUpdateVoteStateInstruction", {
|
|
1798
|
-
hash: string(),
|
|
1799
|
-
voteAccount: string(),
|
|
1800
|
-
voteAuthority: string(),
|
|
1801
|
-
voteStateUpdate: type(voteStateUpdate())
|
|
1802
|
-
}),
|
|
1803
|
-
parsedTransactionInstructionType("VoteUpdateVoteStateSwitchInstruction", {
|
|
1804
|
-
hash: string(),
|
|
1805
|
-
voteAccount: string(),
|
|
1806
|
-
voteAuthority: string(),
|
|
1807
|
-
voteStateUpdate: type(voteStateUpdate())
|
|
1808
|
-
}),
|
|
1809
|
-
parsedTransactionInstructionType("VoteCompactUpdateVoteStateInstruction", {
|
|
1810
|
-
hash: string(),
|
|
1811
|
-
voteAccount: string(),
|
|
1812
|
-
voteAuthority: string(),
|
|
1813
|
-
voteStateUpdate: type(voteStateUpdate())
|
|
1814
|
-
}),
|
|
1815
|
-
parsedTransactionInstructionType("VoteCompactUpdateVoteStateSwitchInstruction", {
|
|
1816
|
-
hash: string(),
|
|
1817
|
-
voteAccount: string(),
|
|
1818
|
-
voteAuthority: string(),
|
|
1819
|
-
voteStateUpdate: type(voteStateUpdate())
|
|
1820
|
-
}),
|
|
1821
|
-
parsedTransactionInstructionType("VoteWithdrawInstruction", {
|
|
1822
|
-
destination: string(),
|
|
1823
|
-
lamports: bigint(),
|
|
1824
|
-
voteAccount: string(),
|
|
1825
|
-
withdrawAuthority: string()
|
|
1826
|
-
}),
|
|
1827
|
-
parsedTransactionInstructionType("VoteUpdateValidatorIdentityInstruction", {
|
|
1828
|
-
newValidatorIdentity: string(),
|
|
1829
|
-
voteAccount: string(),
|
|
1830
|
-
withdrawAuthority: string()
|
|
1831
|
-
}),
|
|
1832
|
-
parsedTransactionInstructionType("VoteUpdateCommissionInstruction", {
|
|
1833
|
-
commission: string(),
|
|
1834
|
-
voteAccount: string(),
|
|
1835
|
-
withdrawAuthority: string()
|
|
1836
|
-
}),
|
|
1837
|
-
parsedTransactionInstructionType("VoteVoteSwitchInstruction", {
|
|
1838
|
-
clockSysvar: string(),
|
|
1839
|
-
hash: string(),
|
|
1840
|
-
slotHashesSysvar: string(),
|
|
1841
|
-
vote: type(vote()),
|
|
1842
|
-
voteAccount: string(),
|
|
1843
|
-
voteAuthority: string()
|
|
1844
|
-
}),
|
|
1845
|
-
parsedTransactionInstructionType("VoteAuthorizeCheckedInstruction", {
|
|
1846
|
-
authority: string(),
|
|
1847
|
-
authorityType: string(),
|
|
1848
|
-
clockSysvar: string(),
|
|
1849
|
-
newAuthority: string(),
|
|
1850
|
-
voteAccount: string()
|
|
1851
|
-
})
|
|
1852
|
-
];
|
|
1853
|
-
return memoisedParsedInstructionsVote;
|
|
1854
|
-
};
|
|
1855
|
-
var memoisedTransactionMetaInterfaceFields;
|
|
1856
|
-
var transactionMetaInterfaceFields = () => {
|
|
1857
|
-
if (!memoisedTransactionMetaInterfaceFields)
|
|
1858
|
-
memoisedTransactionMetaInterfaceFields = {
|
|
1859
|
-
computeUnitsConsumed: bigint(),
|
|
1860
|
-
err: string(),
|
|
1861
|
-
fee: bigint(),
|
|
1862
|
-
format: string(),
|
|
1863
|
-
loadedAddresses: type(transactionMetaLoadedAddresses()),
|
|
1864
|
-
logMessages: list(string()),
|
|
1865
|
-
postBalances: list(bigint()),
|
|
1866
|
-
postTokenBalances: list(type(tokenBalance())),
|
|
1867
|
-
preBalances: list(bigint()),
|
|
1868
|
-
preTokenBalances: list(type(tokenBalance())),
|
|
1869
|
-
returnData: type(returnData()),
|
|
1870
|
-
rewards: list(type(reward())),
|
|
1871
|
-
status: type(transactionStatus())
|
|
1872
|
-
};
|
|
1873
|
-
return memoisedTransactionMetaInterfaceFields;
|
|
1874
|
-
};
|
|
1875
|
-
var memoisedTransactionMetaInterface;
|
|
1876
|
-
var transactionMetaInterface = () => {
|
|
1877
|
-
if (!memoisedTransactionMetaInterface)
|
|
1878
|
-
memoisedTransactionMetaInterface = new graphql.GraphQLInterfaceType({
|
|
1879
|
-
fields: {
|
|
1880
|
-
...transactionMetaInterfaceFields()
|
|
1881
|
-
},
|
|
1882
|
-
name: "TransactionMeta",
|
|
1883
|
-
resolveType(meta) {
|
|
1884
|
-
if (meta.format === "parsed") {
|
|
1885
|
-
return "TransactionMetaParsed";
|
|
1886
|
-
}
|
|
1887
|
-
return "TransactionMetaUnparsed";
|
|
1888
|
-
}
|
|
1889
|
-
});
|
|
1890
|
-
return memoisedTransactionMetaInterface;
|
|
1891
|
-
};
|
|
1892
|
-
var transactionMetaType = (name, description, innerInstructions) => new graphql.GraphQLObjectType({
|
|
1893
|
-
description,
|
|
1894
|
-
fields: {
|
|
1895
|
-
...transactionMetaInterfaceFields(),
|
|
1896
|
-
innerInstructions
|
|
1897
|
-
},
|
|
1898
|
-
interfaces: [transactionMetaInterface()],
|
|
1899
|
-
name
|
|
1900
|
-
});
|
|
1901
|
-
var memoisedTransactionMetaUnparsed;
|
|
1902
|
-
var transactionMetaUnparsed = () => {
|
|
1903
|
-
if (!memoisedTransactionMetaUnparsed)
|
|
1904
|
-
memoisedTransactionMetaUnparsed = transactionMetaType(
|
|
1905
|
-
"TransactionMetaUnparsed",
|
|
1906
|
-
"Non-parsed transaction meta",
|
|
1907
|
-
list(
|
|
1908
|
-
object("TransactionMetaInnerInstructionsUnparsed", {
|
|
1909
|
-
index: number(),
|
|
1910
|
-
instructions: list(
|
|
1911
|
-
object("TransactionMetaInnerInstructionsUnparsedInstruction", {
|
|
1912
|
-
index: number(),
|
|
1913
|
-
instructions: list(type(transactionInstruction()))
|
|
1914
|
-
})
|
|
1915
|
-
)
|
|
1916
|
-
})
|
|
1917
|
-
)
|
|
1918
|
-
);
|
|
1919
|
-
return memoisedTransactionMetaUnparsed;
|
|
1920
|
-
};
|
|
1921
|
-
var memoisedTransactionMetaParsed;
|
|
1922
|
-
var transactionMetaParsed = () => {
|
|
1923
|
-
if (!memoisedTransactionMetaParsed)
|
|
1924
|
-
memoisedTransactionMetaParsed = transactionMetaType(
|
|
1925
|
-
"TransactionMetaParsed",
|
|
1926
|
-
"Parsed transaction meta",
|
|
1927
|
-
list(
|
|
1928
|
-
object("TransactionMetaInnerInstructionsParsed", {
|
|
1929
|
-
index: number(),
|
|
1930
|
-
instructions: list(type(parsedTransactionInstructionInterface()))
|
|
1931
|
-
})
|
|
1932
|
-
)
|
|
1933
|
-
);
|
|
1934
|
-
return memoisedTransactionMetaParsed;
|
|
1935
|
-
};
|
|
1936
|
-
var memoisedTransactionMessageInterfaceFields;
|
|
1937
|
-
var transactionMessageInterfaceFields = () => {
|
|
1938
|
-
if (!memoisedTransactionMessageInterfaceFields)
|
|
1939
|
-
memoisedTransactionMessageInterfaceFields = {
|
|
1940
|
-
addressTableLookups: list(type(addressTableLookup())),
|
|
1941
|
-
format: string(),
|
|
1942
|
-
header: object("TransactionJsonTransactionHeader", {
|
|
1943
|
-
numReadonlySignedAccounts: number(),
|
|
1944
|
-
numReadonlyUnsignedAccounts: number(),
|
|
1945
|
-
numRequiredSignatures: number()
|
|
1946
|
-
}),
|
|
1947
|
-
recentBlockhash: string()
|
|
1948
|
-
};
|
|
1949
|
-
return memoisedTransactionMessageInterfaceFields;
|
|
1950
|
-
};
|
|
1951
|
-
var memoisedTransactionMessageInterface;
|
|
1952
|
-
var transactionMessageInterface = () => {
|
|
1953
|
-
if (!memoisedTransactionMessageInterface)
|
|
1954
|
-
memoisedTransactionMessageInterface = new graphql.GraphQLInterfaceType({
|
|
1955
|
-
fields: {
|
|
1956
|
-
...transactionMessageInterfaceFields()
|
|
1957
|
-
},
|
|
1958
|
-
name: "TransactionMessage",
|
|
1959
|
-
resolveType(message) {
|
|
1960
|
-
if (message.format === "parsed") {
|
|
1961
|
-
return "TransactionMessageParsed";
|
|
1962
|
-
}
|
|
1963
|
-
return "TransactionMessageUnparsed";
|
|
1964
1992
|
}
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
}
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
)
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
)
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
}
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
1993
|
+
return "GenericInstruction";
|
|
1994
|
+
}
|
|
1995
|
+
},
|
|
1996
|
+
CreateLookupTableInstruction: {
|
|
1997
|
+
lookupTableAccount: resolveAccount("lookupTableAccount"),
|
|
1998
|
+
lookupTableAuthority: resolveAccount("lookupTableAuthority"),
|
|
1999
|
+
payerAccount: resolveAccount("payerAccount"),
|
|
2000
|
+
systemProgram: resolveAccount("systemProgram")
|
|
2001
|
+
},
|
|
2002
|
+
ExtendLookupTableInstruction: {
|
|
2003
|
+
lookupTableAccount: resolveAccount("lookupTableAccount"),
|
|
2004
|
+
lookupTableAuthority: resolveAccount("lookupTableAuthority"),
|
|
2005
|
+
payerAccount: resolveAccount("payerAccount"),
|
|
2006
|
+
systemProgram: resolveAccount("systemProgram")
|
|
2007
|
+
},
|
|
2008
|
+
FreezeLookupTableInstruction: {
|
|
2009
|
+
lookupTableAccount: resolveAccount("lookupTableAccount"),
|
|
2010
|
+
lookupTableAuthority: resolveAccount("lookupTableAuthority")
|
|
2011
|
+
},
|
|
2012
|
+
DeactivateLookupTableInstruction: {
|
|
2013
|
+
lookupTableAccount: resolveAccount("lookupTableAccount"),
|
|
2014
|
+
lookupTableAuthority: resolveAccount("lookupTableAuthority")
|
|
2015
|
+
},
|
|
2016
|
+
CloseLookupTableInstruction: {
|
|
2017
|
+
lookupTableAccount: resolveAccount("lookupTableAccount"),
|
|
2018
|
+
lookupTableAuthority: resolveAccount("lookupTableAuthority"),
|
|
2019
|
+
recipient: resolveAccount("recipient")
|
|
2020
|
+
},
|
|
2021
|
+
BpfLoaderWriteInstruction: {
|
|
2022
|
+
account: resolveAccount("account")
|
|
2023
|
+
},
|
|
2024
|
+
BpfLoaderFinalizeInstruction: {
|
|
2025
|
+
account: resolveAccount("account")
|
|
2026
|
+
},
|
|
2027
|
+
BpfUpgradeableLoaderInitializeBufferInstruction: {
|
|
2028
|
+
account: resolveAccount("account")
|
|
2029
|
+
},
|
|
2030
|
+
BpfUpgradeableLoaderWriteInstruction: {
|
|
2031
|
+
account: resolveAccount("account"),
|
|
2032
|
+
authority: resolveAccount("authority")
|
|
2033
|
+
},
|
|
2034
|
+
BpfUpgradeableLoaderDeployWithMaxDataLenInstruction: {
|
|
2035
|
+
authority: resolveAccount("authority"),
|
|
2036
|
+
bufferAccount: resolveAccount("bufferAccount"),
|
|
2037
|
+
payerAccount: resolveAccount("payerAccount"),
|
|
2038
|
+
programAccount: resolveAccount("programAccount"),
|
|
2039
|
+
programDataAccount: resolveAccount("programDataAccount")
|
|
2040
|
+
},
|
|
2041
|
+
BpfUpgradeableLoaderUpgradeInstruction: {
|
|
2042
|
+
authority: resolveAccount("authority"),
|
|
2043
|
+
bufferAccount: resolveAccount("bufferAccount"),
|
|
2044
|
+
programAccount: resolveAccount("programAccount"),
|
|
2045
|
+
programDataAccount: resolveAccount("programDataAccount")
|
|
2046
|
+
},
|
|
2047
|
+
BpfUpgradeableLoaderSetAuthorityInstruction: {
|
|
2048
|
+
account: resolveAccount("account"),
|
|
2049
|
+
authority: resolveAccount("authority"),
|
|
2050
|
+
newAuthority: resolveAccount("newAuthority")
|
|
2051
|
+
},
|
|
2052
|
+
BpfUpgradeableLoaderSetAuthorityCheckedInstruction: {
|
|
2053
|
+
account: resolveAccount("account"),
|
|
2054
|
+
authority: resolveAccount("authority"),
|
|
2055
|
+
newAuthority: resolveAccount("newAuthority")
|
|
2056
|
+
},
|
|
2057
|
+
BpfUpgradeableLoaderCloseInstruction: {
|
|
2058
|
+
account: resolveAccount("account"),
|
|
2059
|
+
authority: resolveAccount("authority"),
|
|
2060
|
+
programAccount: resolveAccount("programAccount"),
|
|
2061
|
+
recipient: resolveAccount("recipient")
|
|
2062
|
+
},
|
|
2063
|
+
BpfUpgradeableLoaderExtendProgramInstruction: {
|
|
2064
|
+
payerAccount: resolveAccount("payerAccount"),
|
|
2065
|
+
programAccount: resolveAccount("programAccount"),
|
|
2066
|
+
programDataAccount: resolveAccount("programDataAccount"),
|
|
2067
|
+
systemProgram: resolveAccount("systemProgram")
|
|
2068
|
+
},
|
|
2069
|
+
SplAssociatedTokenCreateInstruction: {
|
|
2070
|
+
account: resolveAccount("account"),
|
|
2071
|
+
mint: resolveAccount("mint"),
|
|
2072
|
+
source: resolveAccount("source"),
|
|
2073
|
+
systemProgram: resolveAccount("systemProgram"),
|
|
2074
|
+
tokenProgram: resolveAccount("tokenProgram"),
|
|
2075
|
+
wallet: resolveAccount("wallet")
|
|
2076
|
+
},
|
|
2077
|
+
SplAssociatedTokenCreateIdempotentInstruction: {
|
|
2078
|
+
account: resolveAccount("account"),
|
|
2079
|
+
mint: resolveAccount("mint"),
|
|
2080
|
+
source: resolveAccount("source"),
|
|
2081
|
+
systemProgram: resolveAccount("systemProgram"),
|
|
2082
|
+
tokenProgram: resolveAccount("tokenProgram"),
|
|
2083
|
+
wallet: resolveAccount("wallet")
|
|
2084
|
+
},
|
|
2085
|
+
SplAssociatedTokenRecoverNestedInstruction: {
|
|
2086
|
+
destination: resolveAccount("destination"),
|
|
2087
|
+
nestedMint: resolveAccount("nestedMint"),
|
|
2088
|
+
nestedOwner: resolveAccount("nestedOwner"),
|
|
2089
|
+
nestedSource: resolveAccount("nestedSource"),
|
|
2090
|
+
ownerMint: resolveAccount("ownerMint"),
|
|
2091
|
+
tokenProgram: resolveAccount("tokenProgram"),
|
|
2092
|
+
wallet: resolveAccount("wallet")
|
|
2093
|
+
},
|
|
2094
|
+
SplTokenInitializeMintInstruction: {
|
|
2095
|
+
freezeAuthority: resolveAccount("freezeAuthority"),
|
|
2096
|
+
mint: resolveAccount("mint"),
|
|
2097
|
+
mintAuthority: resolveAccount("mintAuthority")
|
|
2098
|
+
},
|
|
2099
|
+
SplTokenInitializeMint2Instruction: {
|
|
2100
|
+
freezeAuthority: resolveAccount("freezeAuthority"),
|
|
2101
|
+
mint: resolveAccount("mint"),
|
|
2102
|
+
mintAuthority: resolveAccount("mintAuthority")
|
|
2103
|
+
},
|
|
2104
|
+
SplTokenInitializeAccountInstruction: {
|
|
2105
|
+
account: resolveAccount("account"),
|
|
2106
|
+
mint: resolveAccount("mint"),
|
|
2107
|
+
owner: resolveAccount("owner")
|
|
2108
|
+
},
|
|
2109
|
+
SplTokenInitializeAccount2Instruction: {
|
|
2110
|
+
account: resolveAccount("account"),
|
|
2111
|
+
mint: resolveAccount("mint"),
|
|
2112
|
+
owner: resolveAccount("owner")
|
|
2113
|
+
},
|
|
2114
|
+
SplTokenInitializeAccount3Instruction: {
|
|
2115
|
+
account: resolveAccount("account"),
|
|
2116
|
+
mint: resolveAccount("mint"),
|
|
2117
|
+
owner: resolveAccount("owner")
|
|
2118
|
+
},
|
|
2119
|
+
SplTokenInitializeMultisigInstruction: {
|
|
2120
|
+
multisig: resolveAccount("multisig")
|
|
2121
|
+
},
|
|
2122
|
+
SplTokenInitializeMultisig2Instruction: {
|
|
2123
|
+
multisig: resolveAccount("multisig")
|
|
2124
|
+
},
|
|
2125
|
+
SplTokenTransferInstruction: {
|
|
2126
|
+
authority: resolveAccount("authority"),
|
|
2127
|
+
destination: resolveAccount("destination"),
|
|
2128
|
+
multisigAuthority: resolveAccount("multisigAuthority"),
|
|
2129
|
+
source: resolveAccount("source")
|
|
2130
|
+
},
|
|
2131
|
+
SplTokenApproveInstruction: {
|
|
2132
|
+
delegate: resolveAccount("delegate"),
|
|
2133
|
+
multisigOwner: resolveAccount("multisigOwner"),
|
|
2134
|
+
owner: resolveAccount("owner"),
|
|
2135
|
+
source: resolveAccount("source")
|
|
2136
|
+
},
|
|
2137
|
+
SplTokenRevokeInstruction: {
|
|
2138
|
+
multisigOwner: resolveAccount("multisigOwner"),
|
|
2139
|
+
owner: resolveAccount("owner"),
|
|
2140
|
+
source: resolveAccount("source")
|
|
2141
|
+
},
|
|
2142
|
+
SplTokenSetAuthorityInstruction: {
|
|
2143
|
+
authority: resolveAccount("authority"),
|
|
2144
|
+
multisigAuthority: resolveAccount("multisigAuthority"),
|
|
2145
|
+
newAuthority: resolveAccount("newAuthority")
|
|
2146
|
+
},
|
|
2147
|
+
SplTokenMintToInstruction: {
|
|
2148
|
+
account: resolveAccount("account"),
|
|
2149
|
+
authority: resolveAccount("authority"),
|
|
2150
|
+
mint: resolveAccount("mint"),
|
|
2151
|
+
mintAuthority: resolveAccount("mintAuthority"),
|
|
2152
|
+
multisigMintAuthority: resolveAccount("multisigMintAuthority")
|
|
2153
|
+
},
|
|
2154
|
+
SplTokenBurnInstruction: {
|
|
2155
|
+
account: resolveAccount("account"),
|
|
2156
|
+
authority: resolveAccount("authority"),
|
|
2157
|
+
mint: resolveAccount("mint"),
|
|
2158
|
+
multisigAuthority: resolveAccount("multisigAuthority")
|
|
2159
|
+
},
|
|
2160
|
+
SplTokenCloseAccountInstruction: {
|
|
2161
|
+
account: resolveAccount("account"),
|
|
2162
|
+
destination: resolveAccount("destination"),
|
|
2163
|
+
multisigOwner: resolveAccount("multisigOwner"),
|
|
2164
|
+
owner: resolveAccount("owner")
|
|
2165
|
+
},
|
|
2166
|
+
SplTokenFreezeAccountInstruction: {
|
|
2167
|
+
account: resolveAccount("account"),
|
|
2168
|
+
freezeAuthority: resolveAccount("freezeAuthority"),
|
|
2169
|
+
mint: resolveAccount("mint"),
|
|
2170
|
+
multisigFreezeAuthority: resolveAccount("multisigFreezeAuthority")
|
|
2171
|
+
},
|
|
2172
|
+
SplTokenThawAccountInstruction: {
|
|
2173
|
+
account: resolveAccount("account"),
|
|
2174
|
+
freezeAuthority: resolveAccount("freezeAuthority"),
|
|
2175
|
+
mint: resolveAccount("mint"),
|
|
2176
|
+
multisigFreezeAuthority: resolveAccount("multisigFreezeAuthority")
|
|
2177
|
+
},
|
|
2178
|
+
SplTokenTransferCheckedInstruction: {
|
|
2179
|
+
authority: resolveAccount("authority"),
|
|
2180
|
+
destination: resolveAccount("destination"),
|
|
2181
|
+
mint: resolveAccount("mint"),
|
|
2182
|
+
multisigAuthority: resolveAccount("multisigAuthority"),
|
|
2183
|
+
source: resolveAccount("source")
|
|
2184
|
+
},
|
|
2185
|
+
SplTokenApproveCheckedInstruction: {
|
|
2186
|
+
delegate: resolveAccount("delegate"),
|
|
2187
|
+
mint: resolveAccount("mint"),
|
|
2188
|
+
multisigOwner: resolveAccount("multisigOwner"),
|
|
2189
|
+
owner: resolveAccount("owner"),
|
|
2190
|
+
source: resolveAccount("source")
|
|
2191
|
+
},
|
|
2192
|
+
SplTokenMintToCheckedInstruction: {
|
|
2193
|
+
account: resolveAccount("account"),
|
|
2194
|
+
authority: resolveAccount("authority"),
|
|
2195
|
+
mint: resolveAccount("mint"),
|
|
2196
|
+
mintAuthority: resolveAccount("mintAuthority"),
|
|
2197
|
+
multisigMintAuthority: resolveAccount("multisigMintAuthority")
|
|
2198
|
+
},
|
|
2199
|
+
SplTokenBurnCheckedInstruction: {
|
|
2200
|
+
account: resolveAccount("account"),
|
|
2201
|
+
authority: resolveAccount("authority"),
|
|
2202
|
+
mint: resolveAccount("mint"),
|
|
2203
|
+
multisigAuthority: resolveAccount("multisigAuthority")
|
|
2204
|
+
},
|
|
2205
|
+
SplTokenSyncNativeInstruction: {
|
|
2206
|
+
account: resolveAccount("account")
|
|
2207
|
+
},
|
|
2208
|
+
SplTokenGetAccountDataSizeInstruction: {
|
|
2209
|
+
mint: resolveAccount("mint")
|
|
2210
|
+
},
|
|
2211
|
+
SplTokenAmountToUiAmountInstruction: {
|
|
2212
|
+
mint: resolveAccount("mint")
|
|
2213
|
+
},
|
|
2214
|
+
SplTokenUiAmountToAmountInstruction: {
|
|
2215
|
+
mint: resolveAccount("mint")
|
|
2216
|
+
},
|
|
2217
|
+
SplTokenInitializeMintCloseAuthorityInstruction: {
|
|
2218
|
+
mint: resolveAccount("mint"),
|
|
2219
|
+
newAuthority: resolveAccount("newAuthority")
|
|
2220
|
+
},
|
|
2221
|
+
Lockup: {
|
|
2222
|
+
custodian: resolveAccount("custodian")
|
|
2223
|
+
},
|
|
2224
|
+
StakeInitializeInstructionDataAuthorized: {
|
|
2225
|
+
staker: resolveAccount("staker"),
|
|
2226
|
+
withdrawer: resolveAccount("withdrawer")
|
|
2227
|
+
},
|
|
2228
|
+
StakeInitializeInstruction: {
|
|
2229
|
+
stakeAccount: resolveAccount("stakeAccount")
|
|
2230
|
+
},
|
|
2231
|
+
StakeAuthorizeInstruction: {
|
|
2232
|
+
authority: resolveAccount("authority"),
|
|
2233
|
+
custodian: resolveAccount("custodian"),
|
|
2234
|
+
newAuthority: resolveAccount("newAuthority"),
|
|
2235
|
+
stakeAccount: resolveAccount("stakeAccount")
|
|
2236
|
+
},
|
|
2237
|
+
StakeDelegateStakeInstruction: {
|
|
2238
|
+
stakeAccount: resolveAccount("stakeAccount"),
|
|
2239
|
+
stakeAuthority: resolveAccount("stakeAuthority"),
|
|
2240
|
+
stakeConfigAccount: resolveAccount("stakeConfigAccount"),
|
|
2241
|
+
voteAccount: resolveAccount("voteAccount")
|
|
2242
|
+
},
|
|
2243
|
+
StakeSplitInstruction: {
|
|
2244
|
+
newSplitAccount: resolveAccount("newSplitAccount"),
|
|
2245
|
+
stakeAccount: resolveAccount("stakeAccount"),
|
|
2246
|
+
stakeAuthority: resolveAccount("stakeAuthority")
|
|
2247
|
+
},
|
|
2248
|
+
StakeWithdrawInstruction: {
|
|
2249
|
+
destination: resolveAccount("destination"),
|
|
2250
|
+
stakeAccount: resolveAccount("stakeAccount"),
|
|
2251
|
+
withdrawAuthority: resolveAccount("withdrawAuthority")
|
|
2252
|
+
},
|
|
2253
|
+
StakeDeactivateInstruction: {
|
|
2254
|
+
stakeAccount: resolveAccount("stakeAccount"),
|
|
2255
|
+
stakeAuthority: resolveAccount("stakeAuthority")
|
|
2256
|
+
},
|
|
2257
|
+
StakeSetLockupInstruction: {
|
|
2258
|
+
custodian: resolveAccount("custodian"),
|
|
2259
|
+
stakeAccount: resolveAccount("stakeAccount")
|
|
2260
|
+
},
|
|
2261
|
+
StakeMergeInstruction: {
|
|
2262
|
+
destination: resolveAccount("destination"),
|
|
2263
|
+
source: resolveAccount("source"),
|
|
2264
|
+
stakeAuthority: resolveAccount("stakeAuthority")
|
|
2265
|
+
},
|
|
2266
|
+
StakeAuthorizeWithSeedInstruction: {
|
|
2267
|
+
authorityBase: resolveAccount("authorityBase"),
|
|
2268
|
+
authorityOwner: resolveAccount("authorityOwner"),
|
|
2269
|
+
custodian: resolveAccount("custodian"),
|
|
2270
|
+
newAuthorized: resolveAccount("newAuthorized"),
|
|
2271
|
+
stakeAccount: resolveAccount("stakeAccount")
|
|
2272
|
+
},
|
|
2273
|
+
StakeInitializeCheckedInstructionDataAuthorized: {
|
|
2274
|
+
staker: resolveAccount("staker"),
|
|
2275
|
+
withdrawer: resolveAccount("withdrawer")
|
|
2276
|
+
},
|
|
2277
|
+
StakeAuthorizeCheckedInstruction: {
|
|
2278
|
+
authority: resolveAccount("authority"),
|
|
2279
|
+
custodian: resolveAccount("custodian"),
|
|
2280
|
+
newAuthority: resolveAccount("newAuthority"),
|
|
2281
|
+
stakeAccount: resolveAccount("stakeAccount")
|
|
2282
|
+
},
|
|
2283
|
+
StakeAuthorizeCheckedWithSeedInstruction: {
|
|
2284
|
+
authorityBase: resolveAccount("authorityBase"),
|
|
2285
|
+
authorityOwner: resolveAccount("authorityOwner"),
|
|
2286
|
+
custodian: resolveAccount("custodian"),
|
|
2287
|
+
newAuthorized: resolveAccount("newAuthorized"),
|
|
2288
|
+
stakeAccount: resolveAccount("stakeAccount")
|
|
2289
|
+
},
|
|
2290
|
+
StakeSetLockupCheckedInstruction: {
|
|
2291
|
+
custodian: resolveAccount("custodian"),
|
|
2292
|
+
stakeAccount: resolveAccount("stakeAccount")
|
|
2293
|
+
},
|
|
2294
|
+
StakeDeactivateDelinquentInstruction: {
|
|
2295
|
+
referenceVoteAccount: resolveAccount("referenceVoteAccount"),
|
|
2296
|
+
stakeAccount: resolveAccount("stakeAccount"),
|
|
2297
|
+
voteAccount: resolveAccount("voteAccount")
|
|
2298
|
+
},
|
|
2299
|
+
StakeRedelegateInstruction: {
|
|
2300
|
+
newStakeAccount: resolveAccount("newStakeAccount"),
|
|
2301
|
+
stakeAccount: resolveAccount("stakeAccount"),
|
|
2302
|
+
stakeAuthority: resolveAccount("stakeAuthority"),
|
|
2303
|
+
stakeConfigAccount: resolveAccount("stakeConfigAccount"),
|
|
2304
|
+
voteAccount: resolveAccount("voteAccount")
|
|
2305
|
+
},
|
|
2306
|
+
CreateAccountInstruction: {
|
|
2307
|
+
newAccount: resolveAccount("newAccount"),
|
|
2308
|
+
owner: resolveAccount("owner"),
|
|
2309
|
+
source: resolveAccount("source")
|
|
2310
|
+
},
|
|
2311
|
+
AssignInstruction: {
|
|
2312
|
+
account: resolveAccount("account"),
|
|
2313
|
+
owner: resolveAccount("owner")
|
|
2314
|
+
},
|
|
2315
|
+
TransferInstruction: {
|
|
2316
|
+
destination: resolveAccount("destination"),
|
|
2317
|
+
source: resolveAccount("source")
|
|
2318
|
+
},
|
|
2319
|
+
CreateAccountWithSeedInstruction: {
|
|
2320
|
+
base: resolveAccount("base"),
|
|
2321
|
+
owner: resolveAccount("owner"),
|
|
2322
|
+
seed: resolveAccount("seed")
|
|
2323
|
+
},
|
|
2324
|
+
AdvanceNonceAccountInstruction: {
|
|
2325
|
+
nonceAccount: resolveAccount("nonceAccount"),
|
|
2326
|
+
nonceAuthority: resolveAccount("nonceAuthority")
|
|
2327
|
+
},
|
|
2328
|
+
WithdrawNonceAccountInstruction: {
|
|
2329
|
+
destination: resolveAccount("destination"),
|
|
2330
|
+
nonceAccount: resolveAccount("nonceAccount"),
|
|
2331
|
+
nonceAuthority: resolveAccount("nonceAuthority")
|
|
2332
|
+
},
|
|
2333
|
+
InitializeNonceAccountInstruction: {
|
|
2334
|
+
nonceAccount: resolveAccount("nonceAccount"),
|
|
2335
|
+
nonceAuthority: resolveAccount("nonceAuthority")
|
|
2336
|
+
},
|
|
2337
|
+
AuthorizeNonceAccountInstruction: {
|
|
2338
|
+
newAuthorized: resolveAccount("newAuthorized"),
|
|
2339
|
+
nonceAccount: resolveAccount("nonceAccount"),
|
|
2340
|
+
nonceAuthority: resolveAccount("nonceAuthority")
|
|
2341
|
+
},
|
|
2342
|
+
UpgradeNonceAccountInstruction: {
|
|
2343
|
+
nonceAccount: resolveAccount("nonceAccount"),
|
|
2344
|
+
nonceAuthority: resolveAccount("nonceAuthority")
|
|
2345
|
+
},
|
|
2346
|
+
AllocateInstruction: {
|
|
2347
|
+
account: resolveAccount("account")
|
|
2348
|
+
},
|
|
2349
|
+
AllocateWithSeedInstruction: {
|
|
2350
|
+
account: resolveAccount("account"),
|
|
2351
|
+
owner: resolveAccount("owner")
|
|
2352
|
+
},
|
|
2353
|
+
AssignWithSeedInstruction: {
|
|
2354
|
+
account: resolveAccount("account"),
|
|
2355
|
+
owner: resolveAccount("owner")
|
|
2356
|
+
},
|
|
2357
|
+
TransferWithSeedInstruction: {
|
|
2358
|
+
destination: resolveAccount("destination"),
|
|
2359
|
+
source: resolveAccount("source"),
|
|
2360
|
+
sourceOwner: resolveAccount("sourceOwner")
|
|
2361
|
+
},
|
|
2362
|
+
VoteInitializeAccountInstruction: {
|
|
2363
|
+
authorizedVoter: resolveAccount("authorizedVoter"),
|
|
2364
|
+
authorizedWithdrawer: resolveAccount("authorizedWithdrawer"),
|
|
2365
|
+
node: resolveAccount("node"),
|
|
2366
|
+
voteAccount: resolveAccount("voteAccount")
|
|
2367
|
+
},
|
|
2368
|
+
VoteAuthorizeInstruction: {
|
|
2369
|
+
authority: resolveAccount("authority"),
|
|
2370
|
+
newAuthority: resolveAccount("newAuthority"),
|
|
2371
|
+
voteAccount: resolveAccount("voteAccount")
|
|
2372
|
+
},
|
|
2373
|
+
VoteAuthorizeWithSeedInstruction: {
|
|
2374
|
+
authorityOwner: resolveAccount("authorityOwner"),
|
|
2375
|
+
newAuthority: resolveAccount("newAuthority"),
|
|
2376
|
+
voteAccount: resolveAccount("voteAccount")
|
|
2377
|
+
},
|
|
2378
|
+
VoteAuthorizeCheckedWithSeedInstruction: {
|
|
2379
|
+
authorityOwner: resolveAccount("authorityOwner"),
|
|
2380
|
+
newAuthority: resolveAccount("newAuthority"),
|
|
2381
|
+
voteAccount: resolveAccount("voteAccount")
|
|
2382
|
+
},
|
|
2383
|
+
VoteVoteInstruction: {
|
|
2384
|
+
voteAccount: resolveAccount("voteAccount"),
|
|
2385
|
+
voteAuthority: resolveAccount("voteAuthority")
|
|
2386
|
+
},
|
|
2387
|
+
VoteUpdateVoteStateInstruction: {
|
|
2388
|
+
voteAccount: resolveAccount("voteAccount"),
|
|
2389
|
+
voteAuthority: resolveAccount("voteAuthority")
|
|
2390
|
+
},
|
|
2391
|
+
VoteUpdateVoteStateSwitchInstruction: {
|
|
2392
|
+
voteAccount: resolveAccount("voteAccount"),
|
|
2393
|
+
voteAuthority: resolveAccount("voteAuthority")
|
|
2394
|
+
},
|
|
2395
|
+
VoteCompactUpdateVoteStateInstruction: {
|
|
2396
|
+
voteAccount: resolveAccount("voteAccount"),
|
|
2397
|
+
voteAuthority: resolveAccount("voteAuthority")
|
|
2398
|
+
},
|
|
2399
|
+
VoteCompactUpdateVoteStateSwitchInstruction: {
|
|
2400
|
+
voteAccount: resolveAccount("voteAccount"),
|
|
2401
|
+
voteAuthority: resolveAccount("voteAuthority")
|
|
2402
|
+
},
|
|
2403
|
+
VoteWithdrawInstruction: {
|
|
2404
|
+
voteAccount: resolveAccount("voteAccount"),
|
|
2405
|
+
withdrawAuthority: resolveAccount("withdrawAuthority")
|
|
2406
|
+
},
|
|
2407
|
+
VoteUpdateValidatorIdentityInstruction: {
|
|
2408
|
+
newValidatorIdentity: resolveAccount("newValidatorIdentity"),
|
|
2409
|
+
voteAccount: resolveAccount("voteAccount"),
|
|
2410
|
+
withdrawAuthority: resolveAccount("withdrawAuthority")
|
|
2411
|
+
},
|
|
2412
|
+
VoteUpdateCommissionInstruction: {
|
|
2413
|
+
voteAccount: resolveAccount("voteAccount"),
|
|
2414
|
+
withdrawAuthority: resolveAccount("withdrawAuthority")
|
|
2415
|
+
},
|
|
2416
|
+
VoteVoteSwitchInstruction: {
|
|
2417
|
+
voteAccount: resolveAccount("voteAccount"),
|
|
2418
|
+
voteAuthority: resolveAccount("voteAuthority")
|
|
2419
|
+
},
|
|
2420
|
+
VoteAuthorizeCheckedInstruction: {
|
|
2421
|
+
authority: resolveAccount("authority"),
|
|
2422
|
+
newAuthority: resolveAccount("newAuthority"),
|
|
2423
|
+
voteAccount: resolveAccount("voteAccount")
|
|
2424
|
+
}
|
|
2029
2425
|
};
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2426
|
+
|
|
2427
|
+
// src/schema/transaction.ts
|
|
2428
|
+
var transactionTypeDefs = (
|
|
2429
|
+
/* GraphQL */
|
|
2430
|
+
`
|
|
2431
|
+
type TransactionStatusOk {
|
|
2432
|
+
Ok: String
|
|
2433
|
+
}
|
|
2434
|
+
type TransactionStatusErr {
|
|
2435
|
+
Err: String
|
|
2436
|
+
}
|
|
2437
|
+
union TransactionStatus = TransactionStatusOk | TransactionStatusErr
|
|
2438
|
+
|
|
2439
|
+
type TransactionLoadedAddresses {
|
|
2440
|
+
readonly: [String]
|
|
2441
|
+
writable: [String]
|
|
2442
|
+
}
|
|
2443
|
+
|
|
2444
|
+
type TransactionInnerInstruction {
|
|
2445
|
+
index: Int
|
|
2446
|
+
instructions: [TransactionInstruction]
|
|
2447
|
+
}
|
|
2448
|
+
|
|
2449
|
+
type TransactionMeta {
|
|
2450
|
+
computeUnitsConsumed: BigInt
|
|
2451
|
+
err: String
|
|
2452
|
+
fee: BigInt
|
|
2453
|
+
innerInstructions: [TransactionInnerInstruction]
|
|
2454
|
+
loadedAddresses: TransactionLoadedAddresses
|
|
2455
|
+
logMessages: [String]
|
|
2456
|
+
postBalances: [BigInt]
|
|
2457
|
+
postTokenBalances: [TokenBalance]
|
|
2458
|
+
preBalances: [BigInt]
|
|
2459
|
+
preTokenBalances: [TokenBalance]
|
|
2460
|
+
returnData: ReturnData
|
|
2461
|
+
rewards: [Reward]
|
|
2462
|
+
status: TransactionStatus
|
|
2463
|
+
}
|
|
2464
|
+
|
|
2465
|
+
type TransactionMessageAccountKey {
|
|
2466
|
+
pubkey: Address
|
|
2467
|
+
signer: Boolean
|
|
2468
|
+
source: String
|
|
2469
|
+
writable: Boolean
|
|
2470
|
+
}
|
|
2471
|
+
|
|
2472
|
+
type TransactionMessageAddressTableLookup {
|
|
2473
|
+
accountKey: Address
|
|
2474
|
+
readableIndexes: [Int]
|
|
2475
|
+
writableIndexes: [Int]
|
|
2476
|
+
}
|
|
2477
|
+
|
|
2478
|
+
type TransactionMessageHeader {
|
|
2479
|
+
numReadonlySignedAccounts: Int
|
|
2480
|
+
numReadonlyUnsignedAccounts: Int
|
|
2481
|
+
numRequiredSignatures: Int
|
|
2482
|
+
}
|
|
2483
|
+
|
|
2484
|
+
type TransactionMessage {
|
|
2485
|
+
accountKeys: [TransactionMessageAccountKey]
|
|
2486
|
+
addressTableLookups: [TransactionMessageAddressTableLookup]
|
|
2487
|
+
header: TransactionMessageHeader
|
|
2488
|
+
instructions: [TransactionInstruction]
|
|
2489
|
+
recentBlockhash: String
|
|
2490
|
+
}
|
|
2491
|
+
|
|
2492
|
+
# Transaction interface
|
|
2493
|
+
interface Transaction {
|
|
2494
|
+
blockTime: String
|
|
2495
|
+
meta: TransactionMeta
|
|
2496
|
+
slot: BigInt
|
|
2497
|
+
version: String
|
|
2498
|
+
}
|
|
2499
|
+
|
|
2500
|
+
# A transaction with base58 encoded data
|
|
2501
|
+
type TransactionBase58 implements Transaction {
|
|
2502
|
+
blockTime: String
|
|
2503
|
+
data: Base58EncodedBytes
|
|
2504
|
+
meta: TransactionMeta
|
|
2505
|
+
slot: BigInt
|
|
2506
|
+
version: String
|
|
2507
|
+
}
|
|
2508
|
+
|
|
2509
|
+
# A transaction with base64 encoded data
|
|
2510
|
+
type TransactionBase64 implements Transaction {
|
|
2511
|
+
blockTime: String
|
|
2512
|
+
data: Base64EncodedBytes
|
|
2513
|
+
meta: TransactionMeta
|
|
2514
|
+
slot: BigInt
|
|
2515
|
+
version: String
|
|
2516
|
+
}
|
|
2517
|
+
|
|
2518
|
+
# A transaction with JSON encoded data
|
|
2519
|
+
type TransactionDataParsed {
|
|
2520
|
+
message: TransactionMessage
|
|
2521
|
+
signatures: [String]
|
|
2522
|
+
}
|
|
2523
|
+
type TransactionParsed implements Transaction {
|
|
2524
|
+
blockTime: String
|
|
2525
|
+
data: TransactionDataParsed
|
|
2526
|
+
meta: TransactionMeta
|
|
2527
|
+
slot: BigInt
|
|
2528
|
+
version: String
|
|
2529
|
+
}
|
|
2530
|
+
`
|
|
2531
|
+
);
|
|
2532
|
+
var transactionResolvers = {
|
|
2533
|
+
Transaction: {
|
|
2534
|
+
__resolveType(transaction) {
|
|
2535
|
+
switch (transaction.encoding) {
|
|
2536
|
+
case "base58":
|
|
2040
2537
|
return "TransactionBase58";
|
|
2041
|
-
|
|
2042
|
-
if (transaction.encoding === "base64") {
|
|
2538
|
+
case "base64":
|
|
2043
2539
|
return "TransactionBase64";
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
return "TransactionJson";
|
|
2047
|
-
}
|
|
2048
|
-
return "TransactionJsonParsed";
|
|
2540
|
+
default:
|
|
2541
|
+
return "TransactionParsed";
|
|
2049
2542
|
}
|
|
2050
|
-
}
|
|
2051
|
-
return memoisedTransactionInterface;
|
|
2052
|
-
};
|
|
2053
|
-
var transactionType = (name, description, transaction) => new graphql.GraphQLObjectType({
|
|
2054
|
-
description,
|
|
2055
|
-
fields: {
|
|
2056
|
-
...transactionInterfaceFields(),
|
|
2057
|
-
transaction
|
|
2058
|
-
},
|
|
2059
|
-
interfaces: [transactionInterface()],
|
|
2060
|
-
name
|
|
2061
|
-
});
|
|
2062
|
-
var memoisedTransactionBase58;
|
|
2063
|
-
var transactionBase58 = () => {
|
|
2064
|
-
if (!memoisedTransactionBase58)
|
|
2065
|
-
memoisedTransactionBase58 = transactionType(
|
|
2066
|
-
"TransactionBase58",
|
|
2067
|
-
"A Solana transaction as base58 encoded data",
|
|
2068
|
-
string()
|
|
2069
|
-
);
|
|
2070
|
-
return memoisedTransactionBase58;
|
|
2071
|
-
};
|
|
2072
|
-
var memoisedTransactionBase64;
|
|
2073
|
-
var transactionBase64 = () => {
|
|
2074
|
-
if (!memoisedTransactionBase64)
|
|
2075
|
-
memoisedTransactionBase64 = transactionType(
|
|
2076
|
-
"TransactionBase64",
|
|
2077
|
-
"A Solana transaction as base64 encoded data",
|
|
2078
|
-
string()
|
|
2079
|
-
);
|
|
2080
|
-
return memoisedTransactionBase64;
|
|
2081
|
-
};
|
|
2082
|
-
var memoisedTransactionJson;
|
|
2083
|
-
var transactionJson = () => {
|
|
2084
|
-
if (!memoisedTransactionJson)
|
|
2085
|
-
memoisedTransactionJson = transactionType(
|
|
2086
|
-
"TransactionJson",
|
|
2087
|
-
"A Solana transaction as a JSON object",
|
|
2088
|
-
type(transactionTransaction())
|
|
2089
|
-
);
|
|
2090
|
-
return memoisedTransactionJson;
|
|
2091
|
-
};
|
|
2092
|
-
var memoisedTransactionJsonParsed;
|
|
2093
|
-
var transactionJsonParsed = () => {
|
|
2094
|
-
if (!memoisedTransactionJsonParsed)
|
|
2095
|
-
memoisedTransactionJsonParsed = transactionType(
|
|
2096
|
-
"TransactionJsonParsed",
|
|
2097
|
-
"A Solana transaction as a parsed JSON object",
|
|
2098
|
-
type(transactionTransaction())
|
|
2099
|
-
);
|
|
2100
|
-
return memoisedTransactionJsonParsed;
|
|
2101
|
-
};
|
|
2102
|
-
var memoisedTransactionTypes;
|
|
2103
|
-
var transactionTypes = () => {
|
|
2104
|
-
if (!memoisedTransactionTypes)
|
|
2105
|
-
memoisedTransactionTypes = [
|
|
2106
|
-
partiallyDecodedTransactionInstruction(),
|
|
2107
|
-
...parsedInstructionsAddressLookupTable(),
|
|
2108
|
-
...parsedInstructionsBpfLoader(),
|
|
2109
|
-
...parsedInstructionsBpfUpgradeableLoader(),
|
|
2110
|
-
...parsedInstructionsStake(),
|
|
2111
|
-
...parsedInstructionsSplAssociatedToken(),
|
|
2112
|
-
parsedInstructionSplMemo(),
|
|
2113
|
-
...parsedInstructionsSplToken(),
|
|
2114
|
-
...parsedInstructionsSystem(),
|
|
2115
|
-
...parsedInstructionsVote(),
|
|
2116
|
-
transactionMetaUnparsed(),
|
|
2117
|
-
transactionMetaParsed(),
|
|
2118
|
-
transactionMessageUnparsed(),
|
|
2119
|
-
transactionMessageParsed(),
|
|
2120
|
-
transactionBase58(),
|
|
2121
|
-
transactionBase64(),
|
|
2122
|
-
transactionJson(),
|
|
2123
|
-
transactionJsonParsed()
|
|
2124
|
-
];
|
|
2125
|
-
return memoisedTransactionTypes;
|
|
2126
|
-
};
|
|
2127
|
-
|
|
2128
|
-
// src/schema/transaction/query.ts
|
|
2129
|
-
var transactionQuery = () => ({
|
|
2130
|
-
transaction: {
|
|
2131
|
-
args: {
|
|
2132
|
-
commitment: type(commitmentInputType()),
|
|
2133
|
-
encoding: type(transactionEncodingInputType()),
|
|
2134
|
-
maxSupportedTransactionVersion: type(maxSupportedTransactionVersionInputType()),
|
|
2135
|
-
signature: nonNull(string())
|
|
2136
|
-
},
|
|
2137
|
-
resolve: (_parent, args, context) => context.resolveTransaction(args),
|
|
2138
|
-
type: transactionInterface()
|
|
2543
|
+
}
|
|
2139
2544
|
}
|
|
2140
|
-
});
|
|
2141
|
-
|
|
2142
|
-
// src/schema/block/types.ts
|
|
2143
|
-
var memoisedTransactionForAccounts;
|
|
2144
|
-
var transactionForAccounts = () => {
|
|
2145
|
-
if (!memoisedTransactionForAccounts)
|
|
2146
|
-
memoisedTransactionForAccounts = new graphql.GraphQLObjectType({
|
|
2147
|
-
fields: {
|
|
2148
|
-
meta: object("TransactionMetaForAccounts", {
|
|
2149
|
-
computeUnitsUsed: bigint(),
|
|
2150
|
-
err: string(),
|
|
2151
|
-
fee: bigint(),
|
|
2152
|
-
format: string(),
|
|
2153
|
-
loadedAddresses: type(transactionMetaLoadedAddresses()),
|
|
2154
|
-
logMessages: list(string()),
|
|
2155
|
-
postBalances: list(bigint()),
|
|
2156
|
-
postTokenBalances: list(type(tokenBalance())),
|
|
2157
|
-
preBalances: list(bigint()),
|
|
2158
|
-
preTokenBalances: list(type(tokenBalance())),
|
|
2159
|
-
returnData: type(returnData()),
|
|
2160
|
-
rewards: list(type(reward())),
|
|
2161
|
-
status: type(transactionStatus())
|
|
2162
|
-
}),
|
|
2163
|
-
transaction: type(transactionInterface()),
|
|
2164
|
-
// TODO
|
|
2165
|
-
version: string()
|
|
2166
|
-
},
|
|
2167
|
-
name: "TransactionForAccounts"
|
|
2168
|
-
});
|
|
2169
|
-
return memoisedTransactionForAccounts;
|
|
2170
|
-
};
|
|
2171
|
-
var memoisedBlockInterfaceFields;
|
|
2172
|
-
var blockInterfaceFields = () => {
|
|
2173
|
-
if (!memoisedBlockInterfaceFields)
|
|
2174
|
-
memoisedBlockInterfaceFields = {
|
|
2175
|
-
blockHeight: bigint(),
|
|
2176
|
-
blockTime: bigint(),
|
|
2177
|
-
blockhash: string(),
|
|
2178
|
-
parentSlot: bigint(),
|
|
2179
|
-
previousBlockhash: string(),
|
|
2180
|
-
rewards: list(type(reward()))
|
|
2181
|
-
};
|
|
2182
|
-
return memoisedBlockInterfaceFields;
|
|
2183
|
-
};
|
|
2184
|
-
var memoisedBlockInterface;
|
|
2185
|
-
var blockInterface = () => {
|
|
2186
|
-
if (!memoisedBlockInterface)
|
|
2187
|
-
memoisedBlockInterface = new graphql.GraphQLInterfaceType({
|
|
2188
|
-
fields: {
|
|
2189
|
-
...blockInterfaceFields()
|
|
2190
|
-
},
|
|
2191
|
-
name: "Block",
|
|
2192
|
-
resolveType(block) {
|
|
2193
|
-
if (block.transactionDetails === "signatures") {
|
|
2194
|
-
return "BlockWithSignatures";
|
|
2195
|
-
}
|
|
2196
|
-
if (block.transactionDetails === "accounts") {
|
|
2197
|
-
return "BlockWithAccounts";
|
|
2198
|
-
}
|
|
2199
|
-
if (block.transactionDetails === "none") {
|
|
2200
|
-
return "BlockWithNoTransactions";
|
|
2201
|
-
}
|
|
2202
|
-
return "BlockWithTransactions";
|
|
2203
|
-
}
|
|
2204
|
-
});
|
|
2205
|
-
return memoisedBlockInterface;
|
|
2206
|
-
};
|
|
2207
|
-
var memoisedBlockWithNoTransactions;
|
|
2208
|
-
var blockWithNoTransactions = () => {
|
|
2209
|
-
if (!memoisedBlockWithNoTransactions)
|
|
2210
|
-
memoisedBlockWithNoTransactions = new graphql.GraphQLObjectType({
|
|
2211
|
-
fields: {
|
|
2212
|
-
...blockInterfaceFields()
|
|
2213
|
-
},
|
|
2214
|
-
interfaces: [blockInterface()],
|
|
2215
|
-
name: "BlockWithNoTransactions"
|
|
2216
|
-
});
|
|
2217
|
-
return memoisedBlockWithNoTransactions;
|
|
2218
|
-
};
|
|
2219
|
-
var memoisedBlockWithSignatures;
|
|
2220
|
-
var blockWithSignatures = () => {
|
|
2221
|
-
if (!memoisedBlockWithSignatures)
|
|
2222
|
-
memoisedBlockWithSignatures = new graphql.GraphQLObjectType({
|
|
2223
|
-
fields: {
|
|
2224
|
-
...blockInterfaceFields(),
|
|
2225
|
-
signatures: list(string())
|
|
2226
|
-
},
|
|
2227
|
-
interfaces: [blockInterface()],
|
|
2228
|
-
name: "BlockWithSignatures"
|
|
2229
|
-
});
|
|
2230
|
-
return memoisedBlockWithSignatures;
|
|
2231
|
-
};
|
|
2232
|
-
var memoisedBlockWithAccounts;
|
|
2233
|
-
var blockWithAccounts = () => {
|
|
2234
|
-
if (!memoisedBlockWithAccounts)
|
|
2235
|
-
memoisedBlockWithAccounts = new graphql.GraphQLObjectType({
|
|
2236
|
-
fields: {
|
|
2237
|
-
...blockInterfaceFields(),
|
|
2238
|
-
transactions: list(type(transactionForAccounts()))
|
|
2239
|
-
},
|
|
2240
|
-
interfaces: [blockInterface()],
|
|
2241
|
-
name: "BlockWithAccounts"
|
|
2242
|
-
});
|
|
2243
|
-
return memoisedBlockWithAccounts;
|
|
2244
|
-
};
|
|
2245
|
-
var memoisedBlockWithTransactions;
|
|
2246
|
-
var blockWithTransactions = () => {
|
|
2247
|
-
if (!memoisedBlockWithTransactions)
|
|
2248
|
-
memoisedBlockWithTransactions = new graphql.GraphQLObjectType({
|
|
2249
|
-
fields: {
|
|
2250
|
-
...blockInterfaceFields(),
|
|
2251
|
-
transactions: list(type(transactionInterface()))
|
|
2252
|
-
},
|
|
2253
|
-
interfaces: [blockInterface()],
|
|
2254
|
-
name: "BlockWithTransactions"
|
|
2255
|
-
});
|
|
2256
|
-
return memoisedBlockWithTransactions;
|
|
2257
|
-
};
|
|
2258
|
-
var memoisedBlockTypes;
|
|
2259
|
-
var blockTypes = () => {
|
|
2260
|
-
if (!memoisedBlockTypes)
|
|
2261
|
-
memoisedBlockTypes = [
|
|
2262
|
-
blockWithNoTransactions(),
|
|
2263
|
-
blockWithSignatures(),
|
|
2264
|
-
blockWithAccounts(),
|
|
2265
|
-
blockWithTransactions()
|
|
2266
|
-
];
|
|
2267
|
-
return memoisedBlockTypes;
|
|
2268
2545
|
};
|
|
2269
2546
|
|
|
2270
|
-
// src/schema/
|
|
2271
|
-
var
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2547
|
+
// src/schema/index.ts
|
|
2548
|
+
var schemaTypeDefs = (
|
|
2549
|
+
/* GraphQL */
|
|
2550
|
+
`
|
|
2551
|
+
type Query {
|
|
2552
|
+
account(
|
|
2553
|
+
address: String!
|
|
2554
|
+
commitment: Commitment
|
|
2555
|
+
dataSlice: DataSlice
|
|
2556
|
+
encoding: AccountEncoding
|
|
2557
|
+
minContextSlot: BigInt
|
|
2558
|
+
): Account
|
|
2559
|
+
block(
|
|
2560
|
+
slot: BigInt!
|
|
2561
|
+
commitment: Commitment
|
|
2562
|
+
encoding: TransactionEncoding
|
|
2563
|
+
transactionDetails: BlockTransactionDetails
|
|
2564
|
+
): Block
|
|
2565
|
+
programAccounts(
|
|
2566
|
+
programAddress: String!
|
|
2567
|
+
commitment: Commitment
|
|
2568
|
+
dataSlice: DataSlice
|
|
2569
|
+
encoding: AccountEncoding
|
|
2570
|
+
filters: [ProgramAccountsFilter]
|
|
2571
|
+
minContextSlot: BigInt
|
|
2572
|
+
): [Account]
|
|
2573
|
+
transaction(
|
|
2574
|
+
signature: String!
|
|
2575
|
+
commitment: Commitment
|
|
2576
|
+
encoding: TransactionEncoding
|
|
2577
|
+
): Transaction
|
|
2578
|
+
}
|
|
2579
|
+
|
|
2580
|
+
schema {
|
|
2581
|
+
query: Query
|
|
2582
|
+
}
|
|
2583
|
+
`
|
|
2584
|
+
);
|
|
2585
|
+
var schemaResolvers = {
|
|
2586
|
+
Query: {
|
|
2587
|
+
account(_, args, context, info) {
|
|
2588
|
+
return context.loaders.account.load(args, info);
|
|
2280
2589
|
},
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
programAccounts: {
|
|
2287
|
-
args: {
|
|
2288
|
-
commitment: type(commitmentInputType()),
|
|
2289
|
-
dataSlice: type(dataSliceInputType()),
|
|
2290
|
-
encoding: type(accountEncodingInputType()),
|
|
2291
|
-
filters: list(type(programAccountFilterInputType())),
|
|
2292
|
-
minContextSlot: bigint(),
|
|
2293
|
-
programAddress: nonNull(string()),
|
|
2294
|
-
withContext: string()
|
|
2590
|
+
block(_, args, context, info) {
|
|
2591
|
+
return context.loaders.block.load(args, info);
|
|
2592
|
+
},
|
|
2593
|
+
programAccounts(_, args, context, info) {
|
|
2594
|
+
return context.loaders.programAccounts.load(args, info);
|
|
2295
2595
|
},
|
|
2296
|
-
|
|
2297
|
-
|
|
2596
|
+
transaction(_, args, context, info) {
|
|
2597
|
+
return context.loaders.transaction.load(args, info);
|
|
2598
|
+
}
|
|
2298
2599
|
}
|
|
2299
|
-
}
|
|
2600
|
+
};
|
|
2601
|
+
function createSolanaGraphQLSchema() {
|
|
2602
|
+
return schema.makeExecutableSchema({
|
|
2603
|
+
resolvers: {
|
|
2604
|
+
...accountResolvers,
|
|
2605
|
+
...blockResolvers,
|
|
2606
|
+
...commonResolvers,
|
|
2607
|
+
...inputResolvers,
|
|
2608
|
+
...instructionResolvers,
|
|
2609
|
+
...scalarResolvers,
|
|
2610
|
+
...schemaResolvers,
|
|
2611
|
+
...transactionResolvers
|
|
2612
|
+
},
|
|
2613
|
+
typeDefs: [
|
|
2614
|
+
accountTypeDefs,
|
|
2615
|
+
blockTypeDefs,
|
|
2616
|
+
commonTypeDefs,
|
|
2617
|
+
inputTypeDefs,
|
|
2618
|
+
instructionTypeDefs,
|
|
2619
|
+
scalarTypeDefs,
|
|
2620
|
+
schemaTypeDefs,
|
|
2621
|
+
transactionTypeDefs
|
|
2622
|
+
]
|
|
2623
|
+
});
|
|
2624
|
+
}
|
|
2300
2625
|
|
|
2301
2626
|
// src/rpc.ts
|
|
2302
2627
|
function createRpcGraphQL(rpc) {
|
|
2303
2628
|
const context = createSolanaGraphQLContext(rpc);
|
|
2304
|
-
const schema =
|
|
2305
|
-
query: new graphql.GraphQLObjectType({
|
|
2306
|
-
fields: {
|
|
2307
|
-
...accountQuery(),
|
|
2308
|
-
...blockQuery(),
|
|
2309
|
-
...programAccountsQuery(),
|
|
2310
|
-
...transactionQuery()
|
|
2311
|
-
},
|
|
2312
|
-
name: "RootQuery"
|
|
2313
|
-
}),
|
|
2314
|
-
types: [...accountTypes(), ...blockTypes(), ...transactionTypes()]
|
|
2315
|
-
});
|
|
2629
|
+
const schema = createSolanaGraphQLSchema();
|
|
2316
2630
|
return {
|
|
2317
2631
|
context,
|
|
2318
2632
|
async query(source, variableValues) {
|
|
2319
|
-
|
|
2633
|
+
return graphql.graphql({
|
|
2320
2634
|
contextValue: this.context,
|
|
2321
2635
|
schema: this.schema,
|
|
2322
2636
|
source,
|
|
2323
2637
|
variableValues
|
|
2324
2638
|
});
|
|
2325
|
-
this.context.cache.flush();
|
|
2326
|
-
return result;
|
|
2327
2639
|
},
|
|
2328
2640
|
schema
|
|
2329
2641
|
};
|