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