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