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