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