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