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