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