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