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