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