@solana/rpc-graphql 2.0.0-experimental.cf6ca9d → 2.0.0-experimental.d148156
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 +2381 -1931
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.js +2377 -1932
- package/dist/index.browser.js.map +1 -1
- package/dist/index.native.js +2376 -1927
- package/dist/index.native.js.map +1 -1
- package/dist/index.node.cjs +2380 -1926
- package/dist/index.node.cjs.map +1 -1
- package/dist/index.node.js +2376 -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 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/loaders/account.d.ts +7 -0
- package/dist/types/loaders/account.d.ts.map +1 -0
- package/dist/types/loaders/block.d.ts +7 -0
- package/dist/types/loaders/block.d.ts.map +1 -0
- package/dist/types/loaders/common/resolve-info.d.ts +3 -0
- package/dist/types/loaders/common/resolve-info.d.ts.map +1 -0
- package/dist/types/loaders/program-accounts.d.ts +9 -0
- package/dist/types/loaders/program-accounts.d.ts.map +1 -0
- package/dist/types/loaders/transaction.d.ts +7 -0
- package/dist/types/loaders/transaction.d.ts.map +1 -0
- package/dist/types/loaders/transformers/account.d.ts +8 -0
- package/dist/types/loaders/transformers/account.d.ts.map +1 -0
- package/dist/types/loaders/transformers/block.d.ts +6 -0
- package/dist/types/loaders/transformers/block.d.ts.map +1 -0
- package/dist/types/loaders/transformers/transaction.d.ts +5 -0
- package/dist/types/loaders/transformers/transaction.d.ts.map +1 -0
- package/dist/types/resolvers/account.d.ts +8 -0
- package/dist/types/resolvers/account.d.ts.map +1 -0
- package/dist/types/rpc.d.ts +6 -4
- package/dist/types/rpc.d.ts.map +1 -1
- package/dist/types/schema/account.d.ts +112 -0
- package/dist/types/schema/account.d.ts.map +1 -0
- package/dist/types/schema/block.d.ts +17 -0
- package/dist/types/schema/block.d.ts.map +1 -0
- package/dist/types/schema/common/inputs.d.ts +3 -0
- package/dist/types/schema/common/inputs.d.ts.map +1 -0
- package/dist/types/schema/common/scalars.d.ts +45 -0
- package/dist/types/schema/common/scalars.d.ts.map +1 -0
- package/dist/types/schema/common/types.d.ts +27 -0
- package/dist/types/schema/common/types.d.ts.map +1 -0
- package/dist/types/schema/index.d.ts +2 -0
- package/dist/types/schema/index.d.ts.map +1 -0
- package/dist/types/schema/instruction.d.ts +949 -0
- package/dist/types/schema/instruction.d.ts.map +1 -0
- package/dist/types/schema/program-accounts.d.ts +12 -0
- package/dist/types/schema/program-accounts.d.ts.map +1 -0
- package/dist/types/schema/transaction.d.ts +16 -0
- package/dist/types/schema/transaction.d.ts.map +1 -0
- package/package.json +15 -11
- package/dist/types/cache.d.ts +0 -7
- package/dist/types/cache.d.ts.map +0 -1
- package/dist/types/schema/account/index.d.ts +0 -3
- package/dist/types/schema/account/index.d.ts.map +0 -1
- package/dist/types/schema/account/query.d.ts +0 -38
- package/dist/types/schema/account/query.d.ts.map +0 -1
- package/dist/types/schema/account/types.d.ts +0 -5
- package/dist/types/schema/account/types.d.ts.map +0 -1
- package/dist/types/schema/block/index.d.ts +0 -3
- package/dist/types/schema/block/index.d.ts.map +0 -1
- package/dist/types/schema/block/query.d.ts +0 -42
- package/dist/types/schema/block/query.d.ts.map +0 -1
- package/dist/types/schema/block/types.d.ts +0 -7
- package/dist/types/schema/block/types.d.ts.map +0 -1
- package/dist/types/schema/inputs.d.ts +0 -9
- package/dist/types/schema/inputs.d.ts.map +0 -1
- package/dist/types/schema/picks.d.ts +0 -36
- package/dist/types/schema/picks.d.ts.map +0 -1
- package/dist/types/schema/program-accounts/index.d.ts +0 -2
- package/dist/types/schema/program-accounts/index.d.ts.map +0 -1
- package/dist/types/schema/program-accounts/query.d.ts +0 -47
- package/dist/types/schema/program-accounts/query.d.ts.map +0 -1
- package/dist/types/schema/program-accounts/types.d.ts +0 -3
- package/dist/types/schema/program-accounts/types.d.ts.map +0 -1
- package/dist/types/schema/scalars.d.ts +0 -3
- package/dist/types/schema/scalars.d.ts.map +0 -1
- package/dist/types/schema/transaction/index.d.ts +0 -3
- package/dist/types/schema/transaction/index.d.ts.map +0 -1
- package/dist/types/schema/transaction/query.d.ts +0 -33
- package/dist/types/schema/transaction/query.d.ts.map +0 -1
- package/dist/types/schema/transaction/types.d.ts +0 -12
- package/dist/types/schema/transaction/types.d.ts.map +0 -1
package/dist/index.node.cjs
CHANGED
|
@@ -1,2194 +1,2648 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var graphql = require('graphql');
|
|
4
|
+
var DataLoader = require('dataloader');
|
|
5
|
+
var fastStableStringify = require('fast-stable-stringify');
|
|
6
|
+
var schema = require('@graphql-tools/schema');
|
|
7
|
+
|
|
8
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
|
|
10
|
+
var DataLoader__default = /*#__PURE__*/_interopDefault(DataLoader);
|
|
11
|
+
var fastStableStringify__default = /*#__PURE__*/_interopDefault(fastStableStringify);
|
|
4
12
|
|
|
5
13
|
// src/rpc.ts
|
|
6
14
|
|
|
7
|
-
// src/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
|
+
}
|
|
18
28
|
}
|
|
19
|
-
return
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
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;
|
|
23
72
|
return {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
Object.keys(inMemoryCache).forEach((key) => delete inMemoryCache[key]);
|
|
27
|
-
},
|
|
28
|
-
get: (key, variables) => {
|
|
29
|
-
const value = inMemoryCache[cacheKey(key, variables)];
|
|
30
|
-
return value === void 0 ? null : parseValue(value);
|
|
31
|
-
},
|
|
32
|
-
insert: (key, variables, value) => {
|
|
33
|
-
inMemoryCache[cacheKey(key, variables)] = stringifyValue(value);
|
|
34
|
-
}
|
|
73
|
+
...account,
|
|
74
|
+
...data
|
|
35
75
|
};
|
|
36
76
|
}
|
|
37
77
|
|
|
38
|
-
// src/
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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) => {
|
|
46
90
|
throw e;
|
|
47
91
|
});
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
data,
|
|
55
|
-
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)));
|
|
56
98
|
};
|
|
57
|
-
cache.insert(address, requestConfig, queryResponse);
|
|
58
|
-
return queryResponse;
|
|
59
99
|
}
|
|
60
|
-
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
100
|
+
function createAccountLoader(rpc) {
|
|
101
|
+
const loader = new DataLoader__default.default(createAccountBatchLoadFn(rpc), { cacheKeyFn: fastStableStringify__default.default });
|
|
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;
|
|
65
123
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
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
|
+
});
|
|
69
168
|
}
|
|
70
|
-
|
|
169
|
+
block.encoding = encoding;
|
|
170
|
+
block.transactionDetails = transactionDetails;
|
|
71
171
|
return block;
|
|
72
172
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
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) => {
|
|
85
196
|
throw e;
|
|
86
197
|
});
|
|
87
|
-
|
|
88
|
-
const [data, responseEncoding] = Array.isArray(programAccount2.account.data) ? encoding === "jsonParsed" ? [programAccount2.account.data[0], "base64"] : [programAccount2.account.data[0], encoding] : [programAccount2.account.data, "jsonParsed"];
|
|
89
|
-
const pubkey = programAccount2.pubkey;
|
|
90
|
-
const account = { ...programAccount2.account, data, encoding: responseEncoding };
|
|
91
|
-
return {
|
|
92
|
-
account,
|
|
93
|
-
pubkey
|
|
94
|
-
};
|
|
95
|
-
});
|
|
96
|
-
cache.insert(programAddress, requestConfig, queryResponse);
|
|
97
|
-
return queryResponse;
|
|
198
|
+
return block === null ? { slot } : transformLoadedBlock({ block, encoding: config.encoding, transactionDetails: config.transactionDetails });
|
|
98
199
|
}
|
|
99
|
-
|
|
100
|
-
const
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
return cached;
|
|
104
|
-
}
|
|
105
|
-
const transaction = await rpc.getTransaction(signature, requestConfig).send();
|
|
106
|
-
if (transaction === null) {
|
|
107
|
-
return null;
|
|
108
|
-
}
|
|
109
|
-
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"];
|
|
110
|
-
if (transaction.meta) {
|
|
111
|
-
transaction.meta["format"] = responseFormat;
|
|
112
|
-
}
|
|
113
|
-
if (transactionData.message) {
|
|
114
|
-
transactionData.message["format"] = responseFormat;
|
|
115
|
-
}
|
|
116
|
-
const queryResponse = {
|
|
117
|
-
...transaction,
|
|
118
|
-
encoding: responseEncoding,
|
|
119
|
-
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)));
|
|
120
204
|
};
|
|
121
|
-
cache.insert(signature, requestConfig, queryResponse);
|
|
122
|
-
return queryResponse;
|
|
123
205
|
}
|
|
124
|
-
function
|
|
125
|
-
const
|
|
206
|
+
function createBlockLoader(rpc) {
|
|
207
|
+
const loader = new DataLoader__default.default(createBlockBatchLoadFn(rpc), { cacheKeyFn: fastStableStringify__default.default });
|
|
126
208
|
return {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
return resolveBlock(args, this.cache, this.rpc);
|
|
133
|
-
},
|
|
134
|
-
resolveProgramAccounts(args) {
|
|
135
|
-
return resolveProgramAccounts(args, this.cache, this.rpc);
|
|
136
|
-
},
|
|
137
|
-
resolveTransaction(args) {
|
|
138
|
-
return resolveTransaction(args, this.cache, this.rpc);
|
|
139
|
-
},
|
|
140
|
-
rpc
|
|
141
|
-
};
|
|
142
|
-
}
|
|
143
|
-
var BigIntScalar = () => new graphql.GraphQLScalarType({
|
|
144
|
-
name: "BigInt",
|
|
145
|
-
parseLiteral(ast) {
|
|
146
|
-
if (ast.kind === graphql.Kind.STRING) {
|
|
147
|
-
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));
|
|
148
214
|
}
|
|
149
|
-
|
|
150
|
-
},
|
|
151
|
-
parseValue(value) {
|
|
152
|
-
return BigInt(value);
|
|
153
|
-
},
|
|
154
|
-
serialize(value) {
|
|
155
|
-
return BigInt(value);
|
|
156
|
-
}
|
|
157
|
-
});
|
|
158
|
-
|
|
159
|
-
// src/schema/picks.ts
|
|
160
|
-
function boolean() {
|
|
161
|
-
return { type: graphql.GraphQLBoolean };
|
|
215
|
+
};
|
|
162
216
|
}
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
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 };
|
|
168
226
|
}
|
|
169
|
-
function
|
|
170
|
-
|
|
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
|
+
);
|
|
171
238
|
}
|
|
172
|
-
function
|
|
173
|
-
|
|
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
|
+
};
|
|
174
246
|
}
|
|
175
|
-
function
|
|
247
|
+
function createProgramAccountsLoader(rpc) {
|
|
248
|
+
const loader = new DataLoader__default.default(createProgramAccountsBatchLoadFn(rpc), { cacheKeyFn: fastStableStringify__default.default });
|
|
176
249
|
return {
|
|
177
|
-
|
|
250
|
+
load: async (args, info) => {
|
|
251
|
+
if (onlyPresentFieldRequested("programAddress", info)) {
|
|
252
|
+
return { programAddress: args.programAddress };
|
|
253
|
+
}
|
|
254
|
+
return loader.load(normalizeArgs3(args));
|
|
255
|
+
}
|
|
178
256
|
};
|
|
179
257
|
}
|
|
180
|
-
function
|
|
258
|
+
function normalizeArgs4({ commitment = "confirmed", encoding = "jsonParsed", signature }) {
|
|
181
259
|
return {
|
|
182
|
-
|
|
260
|
+
commitment,
|
|
261
|
+
encoding,
|
|
262
|
+
// Always use 0 to avoid silly errors
|
|
263
|
+
maxSupportedTransactionVersion: 0,
|
|
264
|
+
signature
|
|
183
265
|
};
|
|
184
266
|
}
|
|
185
|
-
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__default.default(createTransactionBatchLoadFn(rpc), { cacheKeyFn: fastStableStringify__default.default });
|
|
186
303
|
return {
|
|
187
|
-
|
|
304
|
+
load: async (args, info) => {
|
|
305
|
+
if (onlyPresentFieldRequested("signature", info)) {
|
|
306
|
+
return { signature: args.signature };
|
|
307
|
+
}
|
|
308
|
+
return loader.load(normalizeArgs4(args));
|
|
309
|
+
}
|
|
188
310
|
};
|
|
189
311
|
}
|
|
190
|
-
|
|
312
|
+
|
|
313
|
+
// src/context.ts
|
|
314
|
+
function createSolanaGraphQLContext(rpc) {
|
|
191
315
|
return {
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
316
|
+
loaders: {
|
|
317
|
+
account: createAccountLoader(rpc),
|
|
318
|
+
block: createBlockLoader(rpc),
|
|
319
|
+
programAccounts: createProgramAccountsLoader(rpc),
|
|
320
|
+
transaction: createTransactionLoader(rpc)
|
|
321
|
+
},
|
|
322
|
+
rpc
|
|
196
323
|
};
|
|
197
324
|
}
|
|
198
325
|
|
|
199
|
-
// src/
|
|
200
|
-
var
|
|
201
|
-
|
|
202
|
-
if (!memoisedAccountEncodingInputType)
|
|
203
|
-
memoisedAccountEncodingInputType = new graphql.GraphQLEnumType({
|
|
204
|
-
name: "AccountEncoding",
|
|
205
|
-
values: {
|
|
206
|
-
base58: {
|
|
207
|
-
value: "base58"
|
|
208
|
-
},
|
|
209
|
-
base64: {
|
|
210
|
-
value: "base64"
|
|
211
|
-
},
|
|
212
|
-
base64Zstd: {
|
|
213
|
-
value: "base64+zstd"
|
|
214
|
-
},
|
|
215
|
-
jsonParsed: {
|
|
216
|
-
value: "jsonParsed"
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
});
|
|
220
|
-
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);
|
|
221
329
|
};
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
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";
|
|
240
518
|
}
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
};
|
|
244
|
-
var memoisedCommitmentInputType;
|
|
245
|
-
var commitmentInputType = () => {
|
|
246
|
-
if (!memoisedCommitmentInputType)
|
|
247
|
-
memoisedCommitmentInputType = new graphql.GraphQLEnumType({
|
|
248
|
-
name: "Commitment",
|
|
249
|
-
values: {
|
|
250
|
-
confirmed: {
|
|
251
|
-
value: "confirmed"
|
|
252
|
-
},
|
|
253
|
-
finalized: {
|
|
254
|
-
value: "finalized"
|
|
255
|
-
},
|
|
256
|
-
processed: {
|
|
257
|
-
value: "processed"
|
|
258
|
-
}
|
|
519
|
+
if (account.encoding === "base64") {
|
|
520
|
+
return "AccountBase64";
|
|
259
521
|
}
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
};
|
|
263
|
-
var memoisedDataSliceInputType;
|
|
264
|
-
var dataSliceInputType = () => {
|
|
265
|
-
if (!memoisedDataSliceInputType)
|
|
266
|
-
memoisedDataSliceInputType = new graphql.GraphQLInputObjectType({
|
|
267
|
-
fields: {
|
|
268
|
-
length: number(),
|
|
269
|
-
offset: number()
|
|
270
|
-
},
|
|
271
|
-
name: "DataSliceConfig"
|
|
272
|
-
});
|
|
273
|
-
return memoisedDataSliceInputType;
|
|
274
|
-
};
|
|
275
|
-
var memoisedMaxSupportedTransactionVersionInputType;
|
|
276
|
-
var maxSupportedTransactionVersionInputType = () => {
|
|
277
|
-
if (!memoisedMaxSupportedTransactionVersionInputType)
|
|
278
|
-
memoisedMaxSupportedTransactionVersionInputType = new graphql.GraphQLEnumType({
|
|
279
|
-
name: "MaxSupportedTransactionVersion",
|
|
280
|
-
values: {
|
|
281
|
-
legacy: {
|
|
282
|
-
value: "legacy"
|
|
283
|
-
},
|
|
284
|
-
zero: {
|
|
285
|
-
value: "0"
|
|
286
|
-
}
|
|
522
|
+
if (account.encoding === "base64+zstd") {
|
|
523
|
+
return "AccountBase64Zstd";
|
|
287
524
|
}
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
var memoisedProgramAccountFilterInputType;
|
|
292
|
-
var programAccountFilterInputType = () => {
|
|
293
|
-
if (!memoisedProgramAccountFilterInputType)
|
|
294
|
-
memoisedProgramAccountFilterInputType = new graphql.GraphQLInputObjectType({
|
|
295
|
-
fields: {
|
|
296
|
-
bytes: bigint(),
|
|
297
|
-
dataSize: bigint(),
|
|
298
|
-
encoding: string(),
|
|
299
|
-
offset: bigint()
|
|
300
|
-
},
|
|
301
|
-
name: "ProgramAccountFilter"
|
|
302
|
-
});
|
|
303
|
-
return memoisedProgramAccountFilterInputType;
|
|
304
|
-
};
|
|
305
|
-
var memoisedTransactionEncodingInputType;
|
|
306
|
-
var transactionEncodingInputType = () => {
|
|
307
|
-
if (!memoisedTransactionEncodingInputType)
|
|
308
|
-
memoisedTransactionEncodingInputType = new graphql.GraphQLEnumType({
|
|
309
|
-
name: "TransactionEncoding",
|
|
310
|
-
values: {
|
|
311
|
-
base58: {
|
|
312
|
-
value: "base58"
|
|
313
|
-
},
|
|
314
|
-
base64: {
|
|
315
|
-
value: "base64"
|
|
316
|
-
},
|
|
317
|
-
json: {
|
|
318
|
-
value: "json"
|
|
319
|
-
},
|
|
320
|
-
jsonParsed: {
|
|
321
|
-
value: "jsonParsed"
|
|
525
|
+
if (account.encoding === "jsonParsed") {
|
|
526
|
+
if (account.programName === "nonce") {
|
|
527
|
+
return "NonceAccount";
|
|
322
528
|
}
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
return memoisedTransactionEncodingInputType;
|
|
326
|
-
};
|
|
327
|
-
var memoisedTokenAmountType;
|
|
328
|
-
var tokenAmountType = () => {
|
|
329
|
-
if (!memoisedTokenAmountType) {
|
|
330
|
-
memoisedTokenAmountType = new graphql.GraphQLObjectType({
|
|
331
|
-
fields: {
|
|
332
|
-
amount: string(),
|
|
333
|
-
decimals: number(),
|
|
334
|
-
uiAmount: bigint(),
|
|
335
|
-
uiAmountString: string()
|
|
336
|
-
},
|
|
337
|
-
name: "TokenAmount"
|
|
338
|
-
});
|
|
339
|
-
}
|
|
340
|
-
return memoisedTokenAmountType;
|
|
341
|
-
};
|
|
342
|
-
var memoisedAccountInterfaceFields;
|
|
343
|
-
var accountInterfaceFields = () => {
|
|
344
|
-
if (!memoisedAccountInterfaceFields) {
|
|
345
|
-
memoisedAccountInterfaceFields = {
|
|
346
|
-
encoding: string(),
|
|
347
|
-
executable: boolean(),
|
|
348
|
-
lamports: bigint(),
|
|
349
|
-
rentEpoch: bigint()
|
|
350
|
-
};
|
|
351
|
-
}
|
|
352
|
-
return memoisedAccountInterfaceFields;
|
|
353
|
-
};
|
|
354
|
-
var memoisedAccountInterface;
|
|
355
|
-
var accountInterface = () => {
|
|
356
|
-
if (!memoisedAccountInterface) {
|
|
357
|
-
memoisedAccountInterface = new graphql.GraphQLInterfaceType({
|
|
358
|
-
description: "A Solana account",
|
|
359
|
-
fields: () => ({
|
|
360
|
-
...accountInterfaceFields(),
|
|
361
|
-
owner: type(accountInterface())
|
|
362
|
-
}),
|
|
363
|
-
name: "Account",
|
|
364
|
-
resolveType(account) {
|
|
365
|
-
if (account.encoding === "base58") {
|
|
366
|
-
return "AccountBase58";
|
|
529
|
+
if (account.accountType === "mint" && account.programName === "spl-token") {
|
|
530
|
+
return "MintAccount";
|
|
367
531
|
}
|
|
368
|
-
if (account.
|
|
369
|
-
return "
|
|
532
|
+
if (account.accountType === "account" && account.programName === "spl-token") {
|
|
533
|
+
return "TokenAccount";
|
|
370
534
|
}
|
|
371
|
-
if (account.
|
|
372
|
-
return "
|
|
535
|
+
if (account.programName === "stake") {
|
|
536
|
+
return "StakeAccount";
|
|
373
537
|
}
|
|
374
|
-
if (account.
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
return "TokenAccount";
|
|
380
|
-
}
|
|
381
|
-
if (account.data.program === "nonce") {
|
|
382
|
-
return "NonceAccount";
|
|
383
|
-
}
|
|
384
|
-
if (account.data.program === "stake") {
|
|
385
|
-
return "StakeAccount";
|
|
386
|
-
}
|
|
387
|
-
if (account.data.parsed.type === "vote" && account.data.program === "vote") {
|
|
388
|
-
return "VoteAccount";
|
|
389
|
-
}
|
|
390
|
-
if (account.data.parsed.type === "lookupTable" && account.data.program === "address-lookup-table") {
|
|
391
|
-
return "LookupTableAccount";
|
|
392
|
-
}
|
|
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";
|
|
393
543
|
}
|
|
394
|
-
return "AccountBase64";
|
|
395
544
|
}
|
|
396
|
-
|
|
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")
|
|
397
595
|
}
|
|
398
|
-
return memoisedAccountInterface;
|
|
399
|
-
};
|
|
400
|
-
var accountType = (name, description, data) => new graphql.GraphQLObjectType({
|
|
401
|
-
description,
|
|
402
|
-
fields: {
|
|
403
|
-
...accountInterfaceFields(),
|
|
404
|
-
data,
|
|
405
|
-
owner: {
|
|
406
|
-
args: {
|
|
407
|
-
commitment: type(commitmentInputType()),
|
|
408
|
-
dataSlice: type(dataSliceInputType()),
|
|
409
|
-
encoding: type(accountEncodingInputType()),
|
|
410
|
-
minContextSlot: bigint()
|
|
411
|
-
},
|
|
412
|
-
resolve: (parent, args, context) => context.resolveAccount({ ...args, address: parent.owner }),
|
|
413
|
-
type: accountInterface()
|
|
414
|
-
}
|
|
415
|
-
},
|
|
416
|
-
interfaces: [accountInterface()],
|
|
417
|
-
name
|
|
418
|
-
});
|
|
419
|
-
var accountDataJsonParsed = (name, parsedInfoFields) => object(name + "Data", {
|
|
420
|
-
parsed: object(name + "DataParsed", {
|
|
421
|
-
info: object(name + "DataParsedInfo", parsedInfoFields),
|
|
422
|
-
type: string()
|
|
423
|
-
}),
|
|
424
|
-
program: string(),
|
|
425
|
-
space: bigint()
|
|
426
|
-
});
|
|
427
|
-
var memoisedAccountBase58;
|
|
428
|
-
var accountBase58 = () => {
|
|
429
|
-
if (!memoisedAccountBase58)
|
|
430
|
-
memoisedAccountBase58 = accountType("AccountBase58", "A Solana account with base58 encoded data", string());
|
|
431
|
-
return memoisedAccountBase58;
|
|
432
|
-
};
|
|
433
|
-
var memoisedAccountBase64;
|
|
434
|
-
var accountBase64 = () => {
|
|
435
|
-
if (!memoisedAccountBase64)
|
|
436
|
-
memoisedAccountBase64 = accountType("AccountBase64", "A Solana account with base64 encoded data", string());
|
|
437
|
-
return memoisedAccountBase64;
|
|
438
596
|
};
|
|
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
|
-
|
|
510
|
-
|
|
511
|
-
|
|
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
|
+
}
|
|
512
697
|
};
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
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 === graphql.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
|
+
}
|
|
545
740
|
};
|
|
546
|
-
var
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
previousCredits: string()
|
|
566
|
-
})
|
|
567
|
-
),
|
|
568
|
-
lastTimestamp: object("VoteLastTimestamp", {
|
|
569
|
-
slot: bigint(),
|
|
570
|
-
timestamp: bigint()
|
|
571
|
-
}),
|
|
572
|
-
nodePubkey: string(),
|
|
573
|
-
priorVoters: list(string()),
|
|
574
|
-
rootSlot: bigint(),
|
|
575
|
-
votes: list(
|
|
576
|
-
object("VoteVote", {
|
|
577
|
-
confirmationCount: number(),
|
|
578
|
-
slot: bigint()
|
|
579
|
-
})
|
|
580
|
-
)
|
|
581
|
-
})
|
|
582
|
-
);
|
|
583
|
-
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 === graphql.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
|
+
}
|
|
584
760
|
};
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
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
|
+
}
|
|
600
846
|
};
|
|
601
847
|
|
|
602
|
-
// src/schema/
|
|
603
|
-
var
|
|
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
|
-
|
|
729
|
-
|
|
730
|
-
|
|
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") {
|
|
731
1724
|
return "CreateLookupTableInstruction";
|
|
732
1725
|
}
|
|
733
|
-
if (instruction.
|
|
1726
|
+
if (instruction.instructionType === "freezeLookupTable") {
|
|
734
1727
|
return "FreezeLookupTableInstruction";
|
|
735
1728
|
}
|
|
736
|
-
if (instruction.
|
|
1729
|
+
if (instruction.instructionType === "extendLookupTable") {
|
|
737
1730
|
return "ExtendLookupTableInstruction";
|
|
738
1731
|
}
|
|
739
|
-
if (instruction.
|
|
1732
|
+
if (instruction.instructionType === "deactivateLookupTable") {
|
|
740
1733
|
return "DeactivateLookupTableInstruction";
|
|
741
1734
|
}
|
|
742
|
-
if (instruction.
|
|
1735
|
+
if (instruction.instructionType === "closeLookupTable") {
|
|
743
1736
|
return "CloseLookupTableInstruction";
|
|
744
1737
|
}
|
|
745
1738
|
}
|
|
746
|
-
if (instruction.
|
|
747
|
-
if (instruction.
|
|
1739
|
+
if (instruction.programName === "bpf-loader") {
|
|
1740
|
+
if (instruction.instructionType === "write") {
|
|
748
1741
|
return "BpfLoaderWriteInstruction";
|
|
749
1742
|
}
|
|
750
|
-
if (instruction.
|
|
1743
|
+
if (instruction.instructionType === "finalize") {
|
|
751
1744
|
return "BpfLoaderFinalizeInstruction";
|
|
752
1745
|
}
|
|
753
1746
|
}
|
|
754
|
-
if (instruction.
|
|
755
|
-
if (instruction.
|
|
1747
|
+
if (instruction.programName === "bpf-upgradeable-loader") {
|
|
1748
|
+
if (instruction.instructionType === "initializeBuffer") {
|
|
756
1749
|
return "BpfUpgradeableLoaderInitializeBufferInstruction";
|
|
757
1750
|
}
|
|
758
|
-
if (instruction.
|
|
1751
|
+
if (instruction.instructionType === "write") {
|
|
759
1752
|
return "BpfUpgradeableLoaderWriteInstruction";
|
|
760
1753
|
}
|
|
761
|
-
if (instruction.
|
|
1754
|
+
if (instruction.instructionType === "deployWithMaxDataLen") {
|
|
762
1755
|
return "BpfUpgradeableLoaderDeployWithMaxDataLenInstruction";
|
|
763
1756
|
}
|
|
764
|
-
if (instruction.
|
|
1757
|
+
if (instruction.instructionType === "upgrade") {
|
|
765
1758
|
return "BpfUpgradeableLoaderUpgradeInstruction";
|
|
766
1759
|
}
|
|
767
|
-
if (instruction.
|
|
1760
|
+
if (instruction.instructionType === "setAuthority") {
|
|
768
1761
|
return "BpfUpgradeableLoaderSetAuthorityInstruction";
|
|
769
1762
|
}
|
|
770
|
-
if (instruction.
|
|
1763
|
+
if (instruction.instructionType === "setAuthorityChecked") {
|
|
771
1764
|
return "BpfUpgradeableLoaderSetAuthorityCheckedInstruction";
|
|
772
1765
|
}
|
|
773
|
-
if (instruction.
|
|
1766
|
+
if (instruction.instructionType === "close") {
|
|
774
1767
|
return "BpfUpgradeableLoaderCloseInstruction";
|
|
775
1768
|
}
|
|
776
|
-
if (instruction.
|
|
1769
|
+
if (instruction.instructionType === "extendProgram") {
|
|
777
1770
|
return "BpfUpgradeableLoaderExtendProgramInstruction";
|
|
778
1771
|
}
|
|
779
1772
|
}
|
|
780
|
-
if (instruction.
|
|
781
|
-
if (instruction.
|
|
1773
|
+
if (instruction.programName === "spl-associated-token-account") {
|
|
1774
|
+
if (instruction.instructionType === "create") {
|
|
782
1775
|
return "SplAssociatedTokenCreateInstruction";
|
|
783
1776
|
}
|
|
784
|
-
if (instruction.
|
|
1777
|
+
if (instruction.instructionType === "createIdempotent") {
|
|
785
1778
|
return "SplAssociatedTokenCreateIdempotentInstruction";
|
|
786
1779
|
}
|
|
787
|
-
if (instruction.
|
|
1780
|
+
if (instruction.instructionType === "recoverNested") {
|
|
788
1781
|
return "SplAssociatedTokenRecoverNestedInstruction";
|
|
789
1782
|
}
|
|
790
1783
|
}
|
|
791
|
-
if (instruction.
|
|
1784
|
+
if (instruction.programName === "spl-memo") {
|
|
792
1785
|
return "SplMemoInstruction";
|
|
793
1786
|
}
|
|
794
|
-
if (instruction.
|
|
795
|
-
if (instruction.
|
|
1787
|
+
if (instruction.programName === "spl-token") {
|
|
1788
|
+
if (instruction.instructionType === "initializeMint") {
|
|
796
1789
|
return "SplTokenInitializeMintInstruction";
|
|
797
1790
|
}
|
|
798
|
-
if (instruction.
|
|
1791
|
+
if (instruction.instructionType === "initializeMint2") {
|
|
799
1792
|
return "SplTokenInitializeMint2Instruction";
|
|
800
1793
|
}
|
|
801
|
-
if (instruction.
|
|
1794
|
+
if (instruction.instructionType === "initializeAccount") {
|
|
802
1795
|
return "SplTokenInitializeAccountInstruction";
|
|
803
1796
|
}
|
|
804
|
-
if (instruction.
|
|
1797
|
+
if (instruction.instructionType === "initializeAccount2") {
|
|
805
1798
|
return "SplTokenInitializeAccount2Instruction";
|
|
806
1799
|
}
|
|
807
|
-
if (instruction.
|
|
1800
|
+
if (instruction.instructionType === "initializeAccount3") {
|
|
808
1801
|
return "SplTokenInitializeAccount3Instruction";
|
|
809
1802
|
}
|
|
810
|
-
if (instruction.
|
|
1803
|
+
if (instruction.instructionType === "initializeMultisig") {
|
|
811
1804
|
return "SplTokenInitializeMultisigInstruction";
|
|
812
1805
|
}
|
|
813
|
-
if (instruction.
|
|
1806
|
+
if (instruction.instructionType === "initializeMultisig2") {
|
|
814
1807
|
return "SplTokenInitializeMultisig2Instruction";
|
|
815
1808
|
}
|
|
816
|
-
if (instruction.
|
|
1809
|
+
if (instruction.instructionType === "transfer") {
|
|
817
1810
|
return "SplTokenTransferInstruction";
|
|
818
1811
|
}
|
|
819
|
-
if (instruction.
|
|
1812
|
+
if (instruction.instructionType === "approve") {
|
|
820
1813
|
return "SplTokenApproveInstruction";
|
|
821
1814
|
}
|
|
822
|
-
if (instruction.
|
|
1815
|
+
if (instruction.instructionType === "revoke") {
|
|
823
1816
|
return "SplTokenRevokeInstruction";
|
|
824
1817
|
}
|
|
825
|
-
if (instruction.
|
|
1818
|
+
if (instruction.instructionType === "setAuthority") {
|
|
826
1819
|
return "SplTokenSetAuthorityInstruction";
|
|
827
1820
|
}
|
|
828
|
-
if (instruction.
|
|
1821
|
+
if (instruction.instructionType === "mintTo") {
|
|
829
1822
|
return "SplTokenMintToInstruction";
|
|
830
1823
|
}
|
|
831
|
-
if (instruction.
|
|
1824
|
+
if (instruction.instructionType === "burn") {
|
|
832
1825
|
return "SplTokenBurnInstruction";
|
|
833
1826
|
}
|
|
834
|
-
if (instruction.
|
|
1827
|
+
if (instruction.instructionType === "closeAccount") {
|
|
835
1828
|
return "SplTokenCloseAccountInstruction";
|
|
836
1829
|
}
|
|
837
|
-
if (instruction.
|
|
1830
|
+
if (instruction.instructionType === "freezeAccount") {
|
|
838
1831
|
return "SplTokenFreezeAccountInstruction";
|
|
839
1832
|
}
|
|
840
|
-
if (instruction.
|
|
1833
|
+
if (instruction.instructionType === "thawAccount") {
|
|
841
1834
|
return "SplTokenThawAccountInstruction";
|
|
842
1835
|
}
|
|
843
|
-
if (instruction.
|
|
1836
|
+
if (instruction.instructionType === "transferChecked") {
|
|
844
1837
|
return "SplTokenTransferCheckedInstruction";
|
|
845
1838
|
}
|
|
846
|
-
if (instruction.
|
|
1839
|
+
if (instruction.instructionType === "approveChecked") {
|
|
847
1840
|
return "SplTokenApproveCheckedInstruction";
|
|
848
1841
|
}
|
|
849
|
-
if (instruction.
|
|
1842
|
+
if (instruction.instructionType === "mintToChecked") {
|
|
850
1843
|
return "SplTokenMintToCheckedInstruction";
|
|
851
1844
|
}
|
|
852
|
-
if (instruction.
|
|
1845
|
+
if (instruction.instructionType === "burnChecked") {
|
|
853
1846
|
return "SplTokenBurnCheckedInstruction";
|
|
854
1847
|
}
|
|
855
|
-
if (instruction.
|
|
1848
|
+
if (instruction.instructionType === "syncNative") {
|
|
856
1849
|
return "SplTokenSyncNativeInstruction";
|
|
857
1850
|
}
|
|
858
|
-
if (instruction.
|
|
1851
|
+
if (instruction.instructionType === "getAccountDataSize") {
|
|
859
1852
|
return "SplTokenGetAccountDataSizeInstruction";
|
|
860
1853
|
}
|
|
861
|
-
if (instruction.
|
|
1854
|
+
if (instruction.instructionType === "initializeImmutableOwner") {
|
|
862
1855
|
return "SplTokenInitializeImmutableOwnerInstruction";
|
|
863
1856
|
}
|
|
864
|
-
if (instruction.
|
|
1857
|
+
if (instruction.instructionType === "amountToUiAmount") {
|
|
865
1858
|
return "SplTokenAmountToUiAmountInstruction";
|
|
866
1859
|
}
|
|
867
|
-
if (instruction.
|
|
1860
|
+
if (instruction.instructionType === "uiAmountToAmount") {
|
|
868
1861
|
return "SplTokenUiAmountToAmountInstruction";
|
|
869
1862
|
}
|
|
870
|
-
if (instruction.
|
|
1863
|
+
if (instruction.instructionType === "initializeMintCloseAuthority") {
|
|
871
1864
|
return "SplTokenInitializeMintCloseAuthorityInstruction";
|
|
872
1865
|
}
|
|
873
1866
|
}
|
|
874
|
-
if (instruction.
|
|
875
|
-
if (instruction.
|
|
1867
|
+
if (instruction.programName === "stake") {
|
|
1868
|
+
if (instruction.instructionType === "initialize") {
|
|
876
1869
|
return "StakeInitializeInstruction";
|
|
877
1870
|
}
|
|
878
|
-
if (instruction.
|
|
1871
|
+
if (instruction.instructionType === "authorize") {
|
|
879
1872
|
return "StakeAuthorizeInstruction";
|
|
880
1873
|
}
|
|
881
|
-
if (instruction.
|
|
1874
|
+
if (instruction.instructionType === "delegate") {
|
|
882
1875
|
return "StakeDelegateStakeInstruction";
|
|
883
1876
|
}
|
|
884
|
-
if (instruction.
|
|
1877
|
+
if (instruction.instructionType === "split") {
|
|
885
1878
|
return "StakeSplitInstruction";
|
|
886
1879
|
}
|
|
887
|
-
if (instruction.
|
|
1880
|
+
if (instruction.instructionType === "withdraw") {
|
|
888
1881
|
return "StakeWithdrawInstruction";
|
|
889
1882
|
}
|
|
890
|
-
if (instruction.
|
|
1883
|
+
if (instruction.instructionType === "deactivate") {
|
|
891
1884
|
return "StakeDeactivateInstruction";
|
|
892
1885
|
}
|
|
893
|
-
if (instruction.
|
|
1886
|
+
if (instruction.instructionType === "setLockup") {
|
|
894
1887
|
return "StakeSetLockupInstruction";
|
|
895
1888
|
}
|
|
896
|
-
if (instruction.
|
|
1889
|
+
if (instruction.instructionType === "merge") {
|
|
897
1890
|
return "StakeMergeInstruction";
|
|
898
1891
|
}
|
|
899
|
-
if (instruction.
|
|
1892
|
+
if (instruction.instructionType === "authorizeWithSeed") {
|
|
900
1893
|
return "StakeAuthorizeWithSeedInstruction";
|
|
901
1894
|
}
|
|
902
|
-
if (instruction.
|
|
1895
|
+
if (instruction.instructionType === "initializeChecked") {
|
|
903
1896
|
return "StakeInitializeCheckedInstruction";
|
|
904
1897
|
}
|
|
905
|
-
if (instruction.
|
|
1898
|
+
if (instruction.instructionType === "authorizeChecked") {
|
|
906
1899
|
return "StakeAuthorizeCheckedInstruction";
|
|
907
1900
|
}
|
|
908
|
-
if (instruction.
|
|
1901
|
+
if (instruction.instructionType === "authorizeCheckedWithSeed") {
|
|
909
1902
|
return "StakeAuthorizeCheckedWithSeedInstruction";
|
|
910
1903
|
}
|
|
911
|
-
if (instruction.
|
|
1904
|
+
if (instruction.instructionType === "setLockupChecked") {
|
|
912
1905
|
return "StakeSetLockupCheckedInstruction";
|
|
913
1906
|
}
|
|
914
|
-
if (instruction.
|
|
1907
|
+
if (instruction.instructionType === "deactivateDelinquent") {
|
|
915
1908
|
return "StakeDeactivateDelinquentInstruction";
|
|
916
1909
|
}
|
|
917
|
-
if (instruction.
|
|
1910
|
+
if (instruction.instructionType === "redelegate") {
|
|
918
1911
|
return "StakeRedelegateInstruction";
|
|
919
1912
|
}
|
|
920
1913
|
}
|
|
921
|
-
if (instruction.
|
|
922
|
-
if (instruction.
|
|
1914
|
+
if (instruction.programName === "system") {
|
|
1915
|
+
if (instruction.instructionType === "createAccount") {
|
|
923
1916
|
return "CreateAccountInstruction";
|
|
924
1917
|
}
|
|
925
|
-
if (instruction.
|
|
1918
|
+
if (instruction.instructionType === "assign") {
|
|
926
1919
|
return "AssignInstruction";
|
|
927
1920
|
}
|
|
928
|
-
if (instruction.
|
|
1921
|
+
if (instruction.instructionType === "transfer") {
|
|
929
1922
|
return "TransferInstruction";
|
|
930
1923
|
}
|
|
931
|
-
if (instruction.
|
|
1924
|
+
if (instruction.instructionType === "createAccountWithSeed") {
|
|
932
1925
|
return "CreateAccountWithSeedInstruction";
|
|
933
1926
|
}
|
|
934
|
-
if (instruction.
|
|
1927
|
+
if (instruction.instructionType === "advanceNonceAccount") {
|
|
935
1928
|
return "AdvanceNonceAccountInstruction";
|
|
936
1929
|
}
|
|
937
|
-
if (instruction.
|
|
1930
|
+
if (instruction.instructionType === "withdrawNonceAccount") {
|
|
938
1931
|
return "WithdrawNonceAccountInstruction";
|
|
939
1932
|
}
|
|
940
|
-
if (instruction.
|
|
1933
|
+
if (instruction.instructionType === "initializeNonceAccount") {
|
|
941
1934
|
return "InitializeNonceAccountInstruction";
|
|
942
1935
|
}
|
|
943
|
-
if (instruction.
|
|
1936
|
+
if (instruction.instructionType === "authorizeNonceAccount") {
|
|
944
1937
|
return "AuthorizeNonceAccountInstruction";
|
|
945
1938
|
}
|
|
946
|
-
if (instruction.
|
|
1939
|
+
if (instruction.instructionType === "upgradeNonceAccount") {
|
|
947
1940
|
return "UpgradeNonceAccountInstruction";
|
|
948
1941
|
}
|
|
949
|
-
if (instruction.
|
|
1942
|
+
if (instruction.instructionType === "allocate") {
|
|
950
1943
|
return "AllocateInstruction";
|
|
951
1944
|
}
|
|
952
|
-
if (instruction.
|
|
1945
|
+
if (instruction.instructionType === "allocateWithSeed") {
|
|
953
1946
|
return "AllocateWithSeedInstruction";
|
|
954
1947
|
}
|
|
955
|
-
if (instruction.
|
|
1948
|
+
if (instruction.instructionType === "assignWithSeed") {
|
|
956
1949
|
return "AssignWithSeedInstruction";
|
|
957
1950
|
}
|
|
958
|
-
if (instruction.
|
|
1951
|
+
if (instruction.instructionType === "transferWithSeed") {
|
|
959
1952
|
return "TransferWithSeedInstruction";
|
|
960
1953
|
}
|
|
961
1954
|
}
|
|
962
|
-
if (instruction.
|
|
963
|
-
if (instruction.
|
|
1955
|
+
if (instruction.programName === "vote") {
|
|
1956
|
+
if (instruction.instructionType === "initialize") {
|
|
964
1957
|
return "VoteInitializeAccountInstruction";
|
|
965
1958
|
}
|
|
966
|
-
if (instruction.
|
|
1959
|
+
if (instruction.instructionType === "authorize") {
|
|
967
1960
|
return "VoteAuthorizeInstruction";
|
|
968
1961
|
}
|
|
969
|
-
if (instruction.
|
|
1962
|
+
if (instruction.instructionType === "authorizeWithSeed") {
|
|
970
1963
|
return "VoteAuthorizeWithSeedInstruction";
|
|
971
1964
|
}
|
|
972
|
-
if (instruction.
|
|
1965
|
+
if (instruction.instructionType === "authorizeCheckedWithSeed") {
|
|
973
1966
|
return "VoteAuthorizeCheckedWithSeedInstruction";
|
|
974
1967
|
}
|
|
975
|
-
if (instruction.
|
|
1968
|
+
if (instruction.instructionType === "vote") {
|
|
976
1969
|
return "VoteVoteInstruction";
|
|
977
1970
|
}
|
|
978
|
-
if (instruction.
|
|
1971
|
+
if (instruction.instructionType === "updatevotestate") {
|
|
979
1972
|
return "VoteUpdateVoteStateInstruction";
|
|
980
1973
|
}
|
|
981
|
-
if (instruction.
|
|
1974
|
+
if (instruction.instructionType === "updatevotestateswitch") {
|
|
982
1975
|
return "VoteUpdateVoteStateSwitchInstruction";
|
|
983
1976
|
}
|
|
984
|
-
if (instruction.
|
|
1977
|
+
if (instruction.instructionType === "compactupdatevotestate") {
|
|
985
1978
|
return "VoteCompactUpdateVoteStateInstruction";
|
|
986
1979
|
}
|
|
987
|
-
if (instruction.
|
|
1980
|
+
if (instruction.instructionType === "compactupdatevotestateswitch") {
|
|
988
1981
|
return "VoteCompactUpdateVoteStateSwitchInstruction";
|
|
989
1982
|
}
|
|
990
|
-
if (instruction.
|
|
1983
|
+
if (instruction.instructionType === "withdraw") {
|
|
991
1984
|
return "VoteWithdrawInstruction";
|
|
992
1985
|
}
|
|
993
|
-
if (instruction.
|
|
1986
|
+
if (instruction.instructionType === "updateValidatorIdentity") {
|
|
994
1987
|
return "VoteUpdateValidatorIdentityInstruction";
|
|
995
1988
|
}
|
|
996
|
-
if (instruction.
|
|
1989
|
+
if (instruction.instructionType === "updateCommission") {
|
|
997
1990
|
return "VoteUpdateCommissionInstruction";
|
|
998
1991
|
}
|
|
999
|
-
if (instruction.
|
|
1992
|
+
if (instruction.instructionType === "voteSwitch") {
|
|
1000
1993
|
return "VoteVoteSwitchInstruction";
|
|
1001
1994
|
}
|
|
1002
|
-
if (instruction.
|
|
1995
|
+
if (instruction.instructionType === "authorizeChecked") {
|
|
1003
1996
|
return "VoteAuthorizeCheckedInstruction";
|
|
1004
1997
|
}
|
|
1005
1998
|
}
|
|
1006
|
-
return "PartiallyDecodedInstruction";
|
|
1007
|
-
}
|
|
1008
|
-
});
|
|
1009
|
-
return memoisedParsedTransactionInstructionInterface;
|
|
1010
|
-
};
|
|
1011
|
-
var parsedTransactionInstructionType = (name, parsedInfoFields) => new graphql.GraphQLObjectType({
|
|
1012
|
-
fields: {
|
|
1013
|
-
parsed: object(name + "Parsed", {
|
|
1014
|
-
info: object(name + "ParsedInfo", parsedInfoFields),
|
|
1015
|
-
type: string()
|
|
1016
|
-
}),
|
|
1017
|
-
program: string(),
|
|
1018
|
-
programId: string()
|
|
1019
|
-
},
|
|
1020
|
-
interfaces: [parsedTransactionInstructionInterface()],
|
|
1021
|
-
name
|
|
1022
|
-
});
|
|
1023
|
-
var memoisedPartiallyDecodedTransactionInstruction;
|
|
1024
|
-
var partiallyDecodedTransactionInstruction = () => {
|
|
1025
|
-
if (!memoisedPartiallyDecodedTransactionInstruction)
|
|
1026
|
-
memoisedPartiallyDecodedTransactionInstruction = new graphql.GraphQLObjectType({
|
|
1027
|
-
fields: {
|
|
1028
|
-
accounts: list(string()),
|
|
1029
|
-
data: string(),
|
|
1030
|
-
programId: string()
|
|
1031
|
-
},
|
|
1032
|
-
interfaces: [parsedTransactionInstructionInterface()],
|
|
1033
|
-
name: "PartiallyDecodedInstruction"
|
|
1034
|
-
});
|
|
1035
|
-
return memoisedPartiallyDecodedTransactionInstruction;
|
|
1036
|
-
};
|
|
1037
|
-
var memoisedParsedInstructionsAddressLookupTable;
|
|
1038
|
-
var parsedInstructionsAddressLookupTable = () => {
|
|
1039
|
-
if (!memoisedParsedInstructionsAddressLookupTable)
|
|
1040
|
-
memoisedParsedInstructionsAddressLookupTable = [
|
|
1041
|
-
parsedTransactionInstructionType("CreateLookupTableInstruction", {
|
|
1042
|
-
bumpSeed: number(),
|
|
1043
|
-
lookupTableAccount: string(),
|
|
1044
|
-
lookupTableAuthority: string(),
|
|
1045
|
-
payerAccount: string(),
|
|
1046
|
-
recentSlot: bigint(),
|
|
1047
|
-
systemProgram: string()
|
|
1048
|
-
}),
|
|
1049
|
-
parsedTransactionInstructionType("FreezeLookupTableInstruction", {
|
|
1050
|
-
lookupTableAccount: string(),
|
|
1051
|
-
lookupTableAuthority: string()
|
|
1052
|
-
}),
|
|
1053
|
-
parsedTransactionInstructionType("ExtendLookupTableInstruction", {
|
|
1054
|
-
lookupTableAccount: string(),
|
|
1055
|
-
lookupTableAuthority: string(),
|
|
1056
|
-
newAddresses: list(string()),
|
|
1057
|
-
payerAccount: string(),
|
|
1058
|
-
systemProgram: string()
|
|
1059
|
-
}),
|
|
1060
|
-
parsedTransactionInstructionType("DeactivateLookupTableInstruction", {
|
|
1061
|
-
lookupTableAccount: string(),
|
|
1062
|
-
lookupTableAuthority: string()
|
|
1063
|
-
}),
|
|
1064
|
-
parsedTransactionInstructionType("CloseLookupTableInstruction", {
|
|
1065
|
-
lookupTableAccount: string(),
|
|
1066
|
-
lookupTableAuthority: string(),
|
|
1067
|
-
recipient: string()
|
|
1068
|
-
})
|
|
1069
|
-
];
|
|
1070
|
-
return memoisedParsedInstructionsAddressLookupTable;
|
|
1071
|
-
};
|
|
1072
|
-
var memoisedParsedInstructionsBpfLoader;
|
|
1073
|
-
var parsedInstructionsBpfLoader = () => {
|
|
1074
|
-
if (!memoisedParsedInstructionsBpfLoader)
|
|
1075
|
-
memoisedParsedInstructionsBpfLoader = [
|
|
1076
|
-
parsedTransactionInstructionType("BpfLoaderWriteInstruction", {
|
|
1077
|
-
account: string(),
|
|
1078
|
-
bytes: string(),
|
|
1079
|
-
offset: number()
|
|
1080
|
-
}),
|
|
1081
|
-
parsedTransactionInstructionType("BpfLoaderFinalizeInstruction", {
|
|
1082
|
-
account: string()
|
|
1083
|
-
})
|
|
1084
|
-
];
|
|
1085
|
-
return memoisedParsedInstructionsBpfLoader;
|
|
1086
|
-
};
|
|
1087
|
-
var memoisedParsedInstructionsBpfUpgradeableLoader;
|
|
1088
|
-
var parsedInstructionsBpfUpgradeableLoader = () => {
|
|
1089
|
-
if (!memoisedParsedInstructionsBpfUpgradeableLoader)
|
|
1090
|
-
memoisedParsedInstructionsBpfUpgradeableLoader = [
|
|
1091
|
-
parsedTransactionInstructionType("BpfUpgradeableLoaderInitializeBufferInstruction", {
|
|
1092
|
-
account: string()
|
|
1093
|
-
}),
|
|
1094
|
-
parsedTransactionInstructionType("BpfUpgradeableLoaderWriteInstruction", {
|
|
1095
|
-
account: string(),
|
|
1096
|
-
authority: string(),
|
|
1097
|
-
bytes: string(),
|
|
1098
|
-
offset: number()
|
|
1099
|
-
}),
|
|
1100
|
-
parsedTransactionInstructionType("BpfUpgradeableLoaderDeployWithMaxDataLenInstruction", {
|
|
1101
|
-
authority: string(),
|
|
1102
|
-
bufferAccount: string(),
|
|
1103
|
-
clockSysvar: string(),
|
|
1104
|
-
maxDataLen: bigint(),
|
|
1105
|
-
payerAccount: string(),
|
|
1106
|
-
programAccount: string(),
|
|
1107
|
-
programDataAccount: string(),
|
|
1108
|
-
rentSysvar: string()
|
|
1109
|
-
}),
|
|
1110
|
-
parsedTransactionInstructionType("BpfUpgradeableLoaderUpgradeInstruction", {
|
|
1111
|
-
authority: string(),
|
|
1112
|
-
bufferAccount: string(),
|
|
1113
|
-
clockSysvar: string(),
|
|
1114
|
-
programAccount: string(),
|
|
1115
|
-
programDataAccount: string(),
|
|
1116
|
-
rentSysvar: string(),
|
|
1117
|
-
spillAccount: string()
|
|
1118
|
-
}),
|
|
1119
|
-
parsedTransactionInstructionType("BpfUpgradeableLoaderSetAuthorityInstruction", {
|
|
1120
|
-
account: string(),
|
|
1121
|
-
authority: string(),
|
|
1122
|
-
newAuthority: string()
|
|
1123
|
-
}),
|
|
1124
|
-
parsedTransactionInstructionType("BpfUpgradeableLoaderSetAuthorityCheckedInstruction", {
|
|
1125
|
-
account: string(),
|
|
1126
|
-
authority: string(),
|
|
1127
|
-
newAuthority: string()
|
|
1128
|
-
}),
|
|
1129
|
-
parsedTransactionInstructionType("BpfUpgradeableLoaderCloseInstruction", {
|
|
1130
|
-
account: string(),
|
|
1131
|
-
authority: string(),
|
|
1132
|
-
programAccount: string(),
|
|
1133
|
-
recipient: string()
|
|
1134
|
-
}),
|
|
1135
|
-
parsedTransactionInstructionType("BpfUpgradeableLoaderExtendProgramInstruction", {
|
|
1136
|
-
additionalBytes: bigint(),
|
|
1137
|
-
payerAccount: string(),
|
|
1138
|
-
programAccount: string(),
|
|
1139
|
-
programDataAccount: string(),
|
|
1140
|
-
systemProgram: string()
|
|
1141
|
-
})
|
|
1142
|
-
];
|
|
1143
|
-
return memoisedParsedInstructionsBpfUpgradeableLoader;
|
|
1144
|
-
};
|
|
1145
|
-
var memoisedParsedInstructionsSplAssociatedToken;
|
|
1146
|
-
var parsedInstructionsSplAssociatedToken = () => {
|
|
1147
|
-
if (!memoisedParsedInstructionsSplAssociatedToken)
|
|
1148
|
-
memoisedParsedInstructionsSplAssociatedToken = [
|
|
1149
|
-
parsedTransactionInstructionType("SplAssociatedTokenCreateInstruction", {
|
|
1150
|
-
account: string(),
|
|
1151
|
-
mint: string(),
|
|
1152
|
-
source: string(),
|
|
1153
|
-
systemProgram: string(),
|
|
1154
|
-
tokenProgram: string(),
|
|
1155
|
-
wallet: string()
|
|
1156
|
-
}),
|
|
1157
|
-
parsedTransactionInstructionType("SplAssociatedTokenCreateIdempotentInstruction", {
|
|
1158
|
-
account: string(),
|
|
1159
|
-
mint: string(),
|
|
1160
|
-
source: string(),
|
|
1161
|
-
systemProgram: string(),
|
|
1162
|
-
tokenProgram: string(),
|
|
1163
|
-
wallet: string()
|
|
1164
|
-
}),
|
|
1165
|
-
parsedTransactionInstructionType("SplAssociatedTokenRecoverNestedInstruction", {
|
|
1166
|
-
destination: string(),
|
|
1167
|
-
nestedMint: string(),
|
|
1168
|
-
nestedOwner: string(),
|
|
1169
|
-
nestedSource: string(),
|
|
1170
|
-
ownerMint: string(),
|
|
1171
|
-
tokenProgram: string(),
|
|
1172
|
-
wallet: string()
|
|
1173
|
-
})
|
|
1174
|
-
];
|
|
1175
|
-
return memoisedParsedInstructionsSplAssociatedToken;
|
|
1176
|
-
};
|
|
1177
|
-
var memoisedParsedInstructionSplMemo;
|
|
1178
|
-
var parsedInstructionSplMemo = () => {
|
|
1179
|
-
if (!memoisedParsedInstructionSplMemo)
|
|
1180
|
-
memoisedParsedInstructionSplMemo = new graphql.GraphQLObjectType({
|
|
1181
|
-
fields: {
|
|
1182
|
-
parsed: string(),
|
|
1183
|
-
program: string(),
|
|
1184
|
-
programId: string()
|
|
1185
|
-
},
|
|
1186
|
-
interfaces: [parsedTransactionInstructionInterface()],
|
|
1187
|
-
name: "SplMemoInstruction"
|
|
1188
|
-
});
|
|
1189
|
-
return memoisedParsedInstructionSplMemo;
|
|
1190
|
-
};
|
|
1191
|
-
var memoisedParsedInstructionsSplToken;
|
|
1192
|
-
var parsedInstructionsSplToken = () => {
|
|
1193
|
-
if (!memoisedParsedInstructionsSplToken)
|
|
1194
|
-
memoisedParsedInstructionsSplToken = [
|
|
1195
|
-
parsedTransactionInstructionType("SplTokenInitializeMintInstruction", {
|
|
1196
|
-
decimals: number(),
|
|
1197
|
-
freezeAuthority: string(),
|
|
1198
|
-
mint: string(),
|
|
1199
|
-
mintAuthority: string(),
|
|
1200
|
-
rentSysvar: string()
|
|
1201
|
-
}),
|
|
1202
|
-
parsedTransactionInstructionType("SplTokenInitializeMint2Instruction", {
|
|
1203
|
-
decimals: number(),
|
|
1204
|
-
freezeAuthority: string(),
|
|
1205
|
-
mint: string(),
|
|
1206
|
-
mintAuthority: string()
|
|
1207
|
-
}),
|
|
1208
|
-
parsedTransactionInstructionType("SplTokenInitializeAccountInstruction", {
|
|
1209
|
-
account: string(),
|
|
1210
|
-
mint: string(),
|
|
1211
|
-
owner: string(),
|
|
1212
|
-
rentSysvar: string()
|
|
1213
|
-
}),
|
|
1214
|
-
parsedTransactionInstructionType("SplTokenInitializeAccount2Instruction", {
|
|
1215
|
-
account: string(),
|
|
1216
|
-
mint: string(),
|
|
1217
|
-
owner: string(),
|
|
1218
|
-
rentSysvar: string()
|
|
1219
|
-
}),
|
|
1220
|
-
parsedTransactionInstructionType("SplTokenInitializeAccount3Instruction", {
|
|
1221
|
-
account: string(),
|
|
1222
|
-
mint: string(),
|
|
1223
|
-
owner: string()
|
|
1224
|
-
}),
|
|
1225
|
-
parsedTransactionInstructionType("SplTokenInitializeMultisigInstruction", {
|
|
1226
|
-
m: number(),
|
|
1227
|
-
multisig: string(),
|
|
1228
|
-
rentSysvar: string(),
|
|
1229
|
-
signers: list(string())
|
|
1230
|
-
}),
|
|
1231
|
-
parsedTransactionInstructionType("SplTokenInitializeMultisig2Instruction", {
|
|
1232
|
-
m: number(),
|
|
1233
|
-
multisig: string(),
|
|
1234
|
-
signers: list(string())
|
|
1235
|
-
}),
|
|
1236
|
-
parsedTransactionInstructionType("SplTokenTransferInstruction", {
|
|
1237
|
-
amount: string(),
|
|
1238
|
-
authority: string(),
|
|
1239
|
-
destination: string(),
|
|
1240
|
-
multisigAuthority: string(),
|
|
1241
|
-
source: string()
|
|
1242
|
-
}),
|
|
1243
|
-
parsedTransactionInstructionType("SplTokenApproveInstruction", {
|
|
1244
|
-
amount: string(),
|
|
1245
|
-
delegate: string(),
|
|
1246
|
-
multisigOwner: string(),
|
|
1247
|
-
owner: string(),
|
|
1248
|
-
source: string()
|
|
1249
|
-
}),
|
|
1250
|
-
parsedTransactionInstructionType("SplTokenRevokeInstruction", {
|
|
1251
|
-
multisigOwner: string(),
|
|
1252
|
-
owner: string(),
|
|
1253
|
-
source: string()
|
|
1254
|
-
}),
|
|
1255
|
-
parsedTransactionInstructionType("SplTokenSetAuthorityInstruction", {
|
|
1256
|
-
authority: string(),
|
|
1257
|
-
authorityType: string(),
|
|
1258
|
-
multisigAuthority: string(),
|
|
1259
|
-
newAuthority: string()
|
|
1260
|
-
}),
|
|
1261
|
-
parsedTransactionInstructionType("SplTokenMintToInstruction", {
|
|
1262
|
-
account: string(),
|
|
1263
|
-
amount: string(),
|
|
1264
|
-
authority: string(),
|
|
1265
|
-
mint: string(),
|
|
1266
|
-
mintAuthority: string(),
|
|
1267
|
-
multisigMintAuthority: string()
|
|
1268
|
-
}),
|
|
1269
|
-
parsedTransactionInstructionType("SplTokenBurnInstruction", {
|
|
1270
|
-
account: string(),
|
|
1271
|
-
amount: string(),
|
|
1272
|
-
authority: string(),
|
|
1273
|
-
mint: string(),
|
|
1274
|
-
multisigAuthority: string()
|
|
1275
|
-
}),
|
|
1276
|
-
parsedTransactionInstructionType("SplTokenCloseAccountInstruction", {
|
|
1277
|
-
account: string(),
|
|
1278
|
-
destination: string(),
|
|
1279
|
-
multisigOwner: string(),
|
|
1280
|
-
owner: string()
|
|
1281
|
-
}),
|
|
1282
|
-
parsedTransactionInstructionType("SplTokenFreezeAccountInstruction", {
|
|
1283
|
-
account: string(),
|
|
1284
|
-
freezeAuthority: string(),
|
|
1285
|
-
mint: string(),
|
|
1286
|
-
multisigFreezeAuthority: string()
|
|
1287
|
-
}),
|
|
1288
|
-
parsedTransactionInstructionType("SplTokenThawAccountInstruction", {
|
|
1289
|
-
account: string(),
|
|
1290
|
-
freezeAuthority: string(),
|
|
1291
|
-
mint: string(),
|
|
1292
|
-
multisigFreezeAuthority: string()
|
|
1293
|
-
}),
|
|
1294
|
-
parsedTransactionInstructionType("SplTokenTransferCheckedInstruction", {
|
|
1295
|
-
authority: string(),
|
|
1296
|
-
destination: string(),
|
|
1297
|
-
mint: string(),
|
|
1298
|
-
multisigAuthority: string(),
|
|
1299
|
-
source: string(),
|
|
1300
|
-
tokenAmount: string()
|
|
1301
|
-
}),
|
|
1302
|
-
parsedTransactionInstructionType("SplTokenApproveCheckedInstruction", {
|
|
1303
|
-
delegate: string(),
|
|
1304
|
-
mint: string(),
|
|
1305
|
-
multisigOwner: string(),
|
|
1306
|
-
owner: string(),
|
|
1307
|
-
source: string(),
|
|
1308
|
-
tokenAmount: string()
|
|
1309
|
-
}),
|
|
1310
|
-
parsedTransactionInstructionType("SplTokenMintToCheckedInstruction", {
|
|
1311
|
-
account: string(),
|
|
1312
|
-
authority: string(),
|
|
1313
|
-
mint: string(),
|
|
1314
|
-
mintAuthority: string(),
|
|
1315
|
-
multisigMintAuthority: string(),
|
|
1316
|
-
tokenAmount: string()
|
|
1317
|
-
}),
|
|
1318
|
-
parsedTransactionInstructionType("SplTokenBurnCheckedInstruction", {
|
|
1319
|
-
account: string(),
|
|
1320
|
-
authority: string(),
|
|
1321
|
-
mint: string(),
|
|
1322
|
-
multisigAuthority: string(),
|
|
1323
|
-
tokenAmount: string()
|
|
1324
|
-
}),
|
|
1325
|
-
parsedTransactionInstructionType("SplTokenSyncNativeInstruction", {
|
|
1326
|
-
account: string()
|
|
1327
|
-
}),
|
|
1328
|
-
parsedTransactionInstructionType("SplTokenGetAccountDataSizeInstruction", {
|
|
1329
|
-
extensionTypes: list(string()),
|
|
1330
|
-
mint: string()
|
|
1331
|
-
}),
|
|
1332
|
-
parsedTransactionInstructionType("SplTokenInitializeImmutableOwnerInstruction", {
|
|
1333
|
-
account: string()
|
|
1334
|
-
}),
|
|
1335
|
-
parsedTransactionInstructionType("SplTokenAmountToUiAmountInstruction", {
|
|
1336
|
-
amount: string(),
|
|
1337
|
-
mint: string()
|
|
1338
|
-
}),
|
|
1339
|
-
parsedTransactionInstructionType("SplTokenUiAmountToAmountInstruction", {
|
|
1340
|
-
mint: string(),
|
|
1341
|
-
uiAmount: string()
|
|
1342
|
-
}),
|
|
1343
|
-
parsedTransactionInstructionType("SplTokenInitializeMintCloseAuthorityInstruction", {
|
|
1344
|
-
mint: string(),
|
|
1345
|
-
newAuthority: string()
|
|
1346
|
-
})
|
|
1347
|
-
// TODO: Extensions!
|
|
1348
|
-
// - TransferFeeExtension
|
|
1349
|
-
// - ConfidentialTransferFeeExtension
|
|
1350
|
-
// - DefaultAccountStateExtension
|
|
1351
|
-
// - Reallocate
|
|
1352
|
-
// - MemoTransferExtension
|
|
1353
|
-
// - CreateNativeMint
|
|
1354
|
-
// - InitializeNonTransferableMint
|
|
1355
|
-
// - InterestBearingMintExtension
|
|
1356
|
-
// - CpiGuardExtension
|
|
1357
|
-
// - InitializePermanentDelegate
|
|
1358
|
-
// - TransferHookExtension
|
|
1359
|
-
// - ConfidentialTransferFeeExtension
|
|
1360
|
-
// - WithdrawExcessLamports
|
|
1361
|
-
// - MetadataPointerExtension
|
|
1362
|
-
];
|
|
1363
|
-
return memoisedParsedInstructionsSplToken;
|
|
1364
|
-
};
|
|
1365
|
-
var memoisedLockup;
|
|
1366
|
-
var lockup = () => {
|
|
1367
|
-
if (!memoisedLockup)
|
|
1368
|
-
memoisedLockup = new graphql.GraphQLObjectType({
|
|
1369
|
-
fields: {
|
|
1370
|
-
custodian: string(),
|
|
1371
|
-
epoch: bigint(),
|
|
1372
|
-
unixTimestamp: bigint()
|
|
1373
|
-
},
|
|
1374
|
-
name: "Lockup"
|
|
1375
|
-
});
|
|
1376
|
-
return memoisedLockup;
|
|
1377
|
-
};
|
|
1378
|
-
var memoisedParsedInstructionsStake;
|
|
1379
|
-
var parsedInstructionsStake = () => {
|
|
1380
|
-
if (!memoisedParsedInstructionsStake)
|
|
1381
|
-
memoisedParsedInstructionsStake = [
|
|
1382
|
-
parsedTransactionInstructionType("StakeInitializeInstruction", {
|
|
1383
|
-
authorized: object("StakeInitializeInstructionAuthorized", {
|
|
1384
|
-
staker: string(),
|
|
1385
|
-
withdrawer: string()
|
|
1386
|
-
}),
|
|
1387
|
-
lockup: object("StakeInitializeInstructionLockup", {
|
|
1388
|
-
custodian: string(),
|
|
1389
|
-
epoch: bigint(),
|
|
1390
|
-
unixTimestamp: bigint()
|
|
1391
|
-
}),
|
|
1392
|
-
rentSysvar: string(),
|
|
1393
|
-
stakeAccount: string()
|
|
1394
|
-
}),
|
|
1395
|
-
parsedTransactionInstructionType("StakeAuthorizeInstruction", {
|
|
1396
|
-
authority: string(),
|
|
1397
|
-
authorityType: string(),
|
|
1398
|
-
clockSysvar: string(),
|
|
1399
|
-
custodian: string(),
|
|
1400
|
-
newAuthority: string(),
|
|
1401
|
-
stakeAccount: string()
|
|
1402
|
-
}),
|
|
1403
|
-
parsedTransactionInstructionType("StakeDelegateStakeInstruction", {
|
|
1404
|
-
clockSysvar: string(),
|
|
1405
|
-
stakeAccount: string(),
|
|
1406
|
-
stakeAuthority: string(),
|
|
1407
|
-
stakeConfigAccount: string(),
|
|
1408
|
-
stakeHistorySysvar: string(),
|
|
1409
|
-
voteAccount: string()
|
|
1410
|
-
}),
|
|
1411
|
-
parsedTransactionInstructionType("StakeSplitInstruction", {
|
|
1412
|
-
lamports: bigint(),
|
|
1413
|
-
newSplitAccount: string(),
|
|
1414
|
-
stakeAccount: string(),
|
|
1415
|
-
stakeAuthority: string()
|
|
1416
|
-
}),
|
|
1417
|
-
parsedTransactionInstructionType("StakeWithdrawInstruction", {
|
|
1418
|
-
clockSysvar: string(),
|
|
1419
|
-
destination: string(),
|
|
1420
|
-
lamports: bigint(),
|
|
1421
|
-
stakeAccount: string(),
|
|
1422
|
-
withdrawAuthority: string()
|
|
1423
|
-
}),
|
|
1424
|
-
parsedTransactionInstructionType("StakeDeactivateInstruction", {
|
|
1425
|
-
clockSysvar: string(),
|
|
1426
|
-
stakeAccount: string(),
|
|
1427
|
-
stakeAuthority: string()
|
|
1428
|
-
}),
|
|
1429
|
-
parsedTransactionInstructionType("StakeSetLockupInstruction", {
|
|
1430
|
-
custodian: string(),
|
|
1431
|
-
lockup: type(lockup()),
|
|
1432
|
-
stakeAccount: string()
|
|
1433
|
-
}),
|
|
1434
|
-
parsedTransactionInstructionType("StakeMergeInstruction", {
|
|
1435
|
-
clockSysvar: string(),
|
|
1436
|
-
destination: string(),
|
|
1437
|
-
source: string(),
|
|
1438
|
-
stakeAuthority: string(),
|
|
1439
|
-
stakeHistorySysvar: string()
|
|
1440
|
-
}),
|
|
1441
|
-
parsedTransactionInstructionType("StakeAuthorizeWithSeedInstruction", {
|
|
1442
|
-
authorityBase: string(),
|
|
1443
|
-
authorityOwner: string(),
|
|
1444
|
-
authoritySeed: string(),
|
|
1445
|
-
authorityType: string(),
|
|
1446
|
-
clockSysvar: string(),
|
|
1447
|
-
custodian: string(),
|
|
1448
|
-
newAuthorized: string(),
|
|
1449
|
-
stakeAccount: string()
|
|
1450
|
-
}),
|
|
1451
|
-
parsedTransactionInstructionType("StakeInitializeCheckedInstruction", {
|
|
1452
|
-
rentSysvar: string(),
|
|
1453
|
-
stakeAccount: string(),
|
|
1454
|
-
staker: string(),
|
|
1455
|
-
withdrawer: string()
|
|
1456
|
-
}),
|
|
1457
|
-
parsedTransactionInstructionType("StakeAuthorizeCheckedInstruction", {
|
|
1458
|
-
authority: string(),
|
|
1459
|
-
authorityType: string(),
|
|
1460
|
-
clockSysvar: string(),
|
|
1461
|
-
custodian: string(),
|
|
1462
|
-
newAuthority: string(),
|
|
1463
|
-
stakeAccount: string()
|
|
1464
|
-
}),
|
|
1465
|
-
parsedTransactionInstructionType("StakeAuthorizeCheckedWithSeedInstruction", {
|
|
1466
|
-
authorityBase: string(),
|
|
1467
|
-
authorityOwner: string(),
|
|
1468
|
-
authoritySeed: string(),
|
|
1469
|
-
authorityType: string(),
|
|
1470
|
-
clockSysvar: string(),
|
|
1471
|
-
custodian: string(),
|
|
1472
|
-
newAuthorized: string(),
|
|
1473
|
-
stakeAccount: string()
|
|
1474
|
-
}),
|
|
1475
|
-
parsedTransactionInstructionType("StakeSetLockupCheckedInstruction", {
|
|
1476
|
-
custodian: string(),
|
|
1477
|
-
lockup: type(lockup()),
|
|
1478
|
-
stakeAccount: string()
|
|
1479
|
-
}),
|
|
1480
|
-
parsedTransactionInstructionType("StakeDeactivateDelinquentInstruction", {
|
|
1481
|
-
referenceVoteAccount: string(),
|
|
1482
|
-
stakeAccount: string(),
|
|
1483
|
-
voteAccount: string()
|
|
1484
|
-
}),
|
|
1485
|
-
parsedTransactionInstructionType("StakeRedelegateInstruction", {
|
|
1486
|
-
newStakeAccount: string(),
|
|
1487
|
-
stakeAccount: string(),
|
|
1488
|
-
stakeAuthority: string(),
|
|
1489
|
-
stakeConfigAccount: string(),
|
|
1490
|
-
voteAccount: string()
|
|
1491
|
-
})
|
|
1492
|
-
];
|
|
1493
|
-
return memoisedParsedInstructionsStake;
|
|
1494
|
-
};
|
|
1495
|
-
var memoisedParsedInstructionsSystem;
|
|
1496
|
-
var parsedInstructionsSystem = () => {
|
|
1497
|
-
if (!memoisedParsedInstructionsSystem)
|
|
1498
|
-
memoisedParsedInstructionsSystem = [
|
|
1499
|
-
parsedTransactionInstructionType("CreateAccountInstruction", {
|
|
1500
|
-
lamports: bigint(),
|
|
1501
|
-
newAccount: string(),
|
|
1502
|
-
owner: string(),
|
|
1503
|
-
source: string(),
|
|
1504
|
-
space: bigint()
|
|
1505
|
-
}),
|
|
1506
|
-
parsedTransactionInstructionType("AssignInstruction", {
|
|
1507
|
-
owner: string()
|
|
1508
|
-
}),
|
|
1509
|
-
parsedTransactionInstructionType("TransferInstruction", {
|
|
1510
|
-
amount: string(),
|
|
1511
|
-
lamports: number(),
|
|
1512
|
-
source: string()
|
|
1513
|
-
}),
|
|
1514
|
-
parsedTransactionInstructionType("CreateAccountWithSeedInstruction", {
|
|
1515
|
-
base: string(),
|
|
1516
|
-
lamports: bigint(),
|
|
1517
|
-
owner: string(),
|
|
1518
|
-
seed: string(),
|
|
1519
|
-
space: bigint()
|
|
1520
|
-
}),
|
|
1521
|
-
parsedTransactionInstructionType("AdvanceNonceAccountInstruction", {
|
|
1522
|
-
nonceAccount: string(),
|
|
1523
|
-
nonceAuthority: string(),
|
|
1524
|
-
recentBlockhashesSysvar: string()
|
|
1525
|
-
}),
|
|
1526
|
-
parsedTransactionInstructionType("WithdrawNonceAccountInstruction", {
|
|
1527
|
-
destination: string(),
|
|
1528
|
-
lamports: bigint(),
|
|
1529
|
-
nonceAccount: string(),
|
|
1530
|
-
nonceAuthority: string(),
|
|
1531
|
-
recentBlockhashesSysvar: string(),
|
|
1532
|
-
rentSysvar: string()
|
|
1533
|
-
}),
|
|
1534
|
-
parsedTransactionInstructionType("InitializeNonceAccountInstruction", {
|
|
1535
|
-
nonceAccount: string(),
|
|
1536
|
-
nonceAuthority: string(),
|
|
1537
|
-
recentBlockhashesSysvar: string(),
|
|
1538
|
-
rentSysvar: string()
|
|
1539
|
-
}),
|
|
1540
|
-
parsedTransactionInstructionType("AuthorizeNonceAccountInstruction", {
|
|
1541
|
-
newAuthorized: string(),
|
|
1542
|
-
nonceAccount: string(),
|
|
1543
|
-
nonceAuthority: string()
|
|
1544
|
-
}),
|
|
1545
|
-
parsedTransactionInstructionType("UpgradeNonceAccountInstruction", {
|
|
1546
|
-
nonceAccount: string()
|
|
1547
|
-
}),
|
|
1548
|
-
parsedTransactionInstructionType("AllocateInstruction", {
|
|
1549
|
-
account: string(),
|
|
1550
|
-
space: bigint()
|
|
1551
|
-
}),
|
|
1552
|
-
parsedTransactionInstructionType("AllocateWithSeedInstruction", {
|
|
1553
|
-
account: string(),
|
|
1554
|
-
base: string(),
|
|
1555
|
-
owner: string(),
|
|
1556
|
-
seed: string(),
|
|
1557
|
-
space: bigint()
|
|
1558
|
-
}),
|
|
1559
|
-
parsedTransactionInstructionType("AssignWithSeedInstruction", {
|
|
1560
|
-
account: string(),
|
|
1561
|
-
base: string(),
|
|
1562
|
-
owner: string(),
|
|
1563
|
-
seed: string()
|
|
1564
|
-
}),
|
|
1565
|
-
parsedTransactionInstructionType("TransferWithSeedInstruction", {
|
|
1566
|
-
destination: string(),
|
|
1567
|
-
lamports: bigint(),
|
|
1568
|
-
source: string(),
|
|
1569
|
-
sourceBase: string(),
|
|
1570
|
-
sourceOwner: string(),
|
|
1571
|
-
sourceSeed: string()
|
|
1572
|
-
})
|
|
1573
|
-
];
|
|
1574
|
-
return memoisedParsedInstructionsSystem;
|
|
1575
|
-
};
|
|
1576
|
-
var memoisedVote;
|
|
1577
|
-
var vote = () => {
|
|
1578
|
-
if (!memoisedVote)
|
|
1579
|
-
memoisedVote = new graphql.GraphQLObjectType({
|
|
1580
|
-
fields: {
|
|
1581
|
-
hash: string(),
|
|
1582
|
-
slots: list(bigint()),
|
|
1583
|
-
timestamp: bigint()
|
|
1584
|
-
},
|
|
1585
|
-
name: "Vote"
|
|
1586
|
-
});
|
|
1587
|
-
return memoisedVote;
|
|
1588
|
-
};
|
|
1589
|
-
var memoisedVoteStateUpdate;
|
|
1590
|
-
var voteStateUpdate = () => {
|
|
1591
|
-
if (!memoisedVoteStateUpdate)
|
|
1592
|
-
memoisedVoteStateUpdate = new graphql.GraphQLObjectType({
|
|
1593
|
-
fields: {
|
|
1594
|
-
hash: string(),
|
|
1595
|
-
lockouts: list(
|
|
1596
|
-
object("VoteStateUpdateLockout", {
|
|
1597
|
-
confirmationCount: number(),
|
|
1598
|
-
slot: bigint()
|
|
1599
|
-
})
|
|
1600
|
-
),
|
|
1601
|
-
root: bigint(),
|
|
1602
|
-
timestamp: bigint()
|
|
1603
|
-
},
|
|
1604
|
-
name: "VoteStateUpdate"
|
|
1605
|
-
});
|
|
1606
|
-
return memoisedVoteStateUpdate;
|
|
1607
|
-
};
|
|
1608
|
-
var memoisedParsedInstructionsVote;
|
|
1609
|
-
var parsedInstructionsVote = () => {
|
|
1610
|
-
if (!memoisedParsedInstructionsVote)
|
|
1611
|
-
memoisedParsedInstructionsVote = [
|
|
1612
|
-
parsedTransactionInstructionType("VoteInitializeAccountInstruction", {
|
|
1613
|
-
authorizedVoter: string(),
|
|
1614
|
-
authorizedWithdrawer: string(),
|
|
1615
|
-
clockSysvar: string(),
|
|
1616
|
-
commission: number(),
|
|
1617
|
-
node: string(),
|
|
1618
|
-
rentSysvar: string(),
|
|
1619
|
-
voteAccount: string()
|
|
1620
|
-
}),
|
|
1621
|
-
parsedTransactionInstructionType("VoteAuthorizeInstruction", {
|
|
1622
|
-
authority: string(),
|
|
1623
|
-
authorityType: string(),
|
|
1624
|
-
clockSysvar: string(),
|
|
1625
|
-
newAuthority: string(),
|
|
1626
|
-
voteAccount: string()
|
|
1627
|
-
}),
|
|
1628
|
-
parsedTransactionInstructionType("VoteAuthorizeWithSeedInstruction", {
|
|
1629
|
-
authorityBaseKey: string(),
|
|
1630
|
-
authorityOwner: string(),
|
|
1631
|
-
authoritySeed: string(),
|
|
1632
|
-
authorityType: string(),
|
|
1633
|
-
clockSysvar: string(),
|
|
1634
|
-
newAuthority: string(),
|
|
1635
|
-
voteAccount: string()
|
|
1636
|
-
}),
|
|
1637
|
-
parsedTransactionInstructionType("VoteAuthorizeCheckedWithSeedInstruction", {
|
|
1638
|
-
authorityBaseKey: string(),
|
|
1639
|
-
authorityOwner: string(),
|
|
1640
|
-
authoritySeed: string(),
|
|
1641
|
-
authorityType: string(),
|
|
1642
|
-
clockSysvar: string(),
|
|
1643
|
-
newAuthority: string(),
|
|
1644
|
-
voteAccount: string()
|
|
1645
|
-
}),
|
|
1646
|
-
parsedTransactionInstructionType("VoteVoteInstruction", {
|
|
1647
|
-
clockSysvar: string(),
|
|
1648
|
-
slotHashedSysvar: string(),
|
|
1649
|
-
vote: type(vote()),
|
|
1650
|
-
voteAccount: string(),
|
|
1651
|
-
voteAuthority: string()
|
|
1652
|
-
}),
|
|
1653
|
-
parsedTransactionInstructionType("VoteUpdateVoteStateInstruction", {
|
|
1654
|
-
hash: string(),
|
|
1655
|
-
voteAccount: string(),
|
|
1656
|
-
voteAuthority: string(),
|
|
1657
|
-
voteStateUpdate: type(voteStateUpdate())
|
|
1658
|
-
}),
|
|
1659
|
-
parsedTransactionInstructionType("VoteUpdateVoteStateSwitchInstruction", {
|
|
1660
|
-
hash: string(),
|
|
1661
|
-
voteAccount: string(),
|
|
1662
|
-
voteAuthority: string(),
|
|
1663
|
-
voteStateUpdate: type(voteStateUpdate())
|
|
1664
|
-
}),
|
|
1665
|
-
parsedTransactionInstructionType("VoteCompactUpdateVoteStateInstruction", {
|
|
1666
|
-
hash: string(),
|
|
1667
|
-
voteAccount: string(),
|
|
1668
|
-
voteAuthority: string(),
|
|
1669
|
-
voteStateUpdate: type(voteStateUpdate())
|
|
1670
|
-
}),
|
|
1671
|
-
parsedTransactionInstructionType("VoteCompactUpdateVoteStateSwitchInstruction", {
|
|
1672
|
-
hash: string(),
|
|
1673
|
-
voteAccount: string(),
|
|
1674
|
-
voteAuthority: string(),
|
|
1675
|
-
voteStateUpdate: type(voteStateUpdate())
|
|
1676
|
-
}),
|
|
1677
|
-
parsedTransactionInstructionType("VoteWithdrawInstruction", {
|
|
1678
|
-
destination: string(),
|
|
1679
|
-
lamports: bigint(),
|
|
1680
|
-
voteAccount: string(),
|
|
1681
|
-
withdrawAuthority: string()
|
|
1682
|
-
}),
|
|
1683
|
-
parsedTransactionInstructionType("VoteUpdateValidatorIdentityInstruction", {
|
|
1684
|
-
newValidatorIdentity: string(),
|
|
1685
|
-
voteAccount: string(),
|
|
1686
|
-
withdrawAuthority: string()
|
|
1687
|
-
}),
|
|
1688
|
-
parsedTransactionInstructionType("VoteUpdateCommissionInstruction", {
|
|
1689
|
-
commission: string(),
|
|
1690
|
-
voteAccount: string(),
|
|
1691
|
-
withdrawAuthority: string()
|
|
1692
|
-
}),
|
|
1693
|
-
parsedTransactionInstructionType("VoteVoteSwitchInstruction", {
|
|
1694
|
-
clockSysvar: string(),
|
|
1695
|
-
hash: string(),
|
|
1696
|
-
slotHashesSysvar: string(),
|
|
1697
|
-
vote: type(vote()),
|
|
1698
|
-
voteAccount: string(),
|
|
1699
|
-
voteAuthority: string()
|
|
1700
|
-
}),
|
|
1701
|
-
parsedTransactionInstructionType("VoteAuthorizeCheckedInstruction", {
|
|
1702
|
-
authority: string(),
|
|
1703
|
-
authorityType: string(),
|
|
1704
|
-
clockSysvar: string(),
|
|
1705
|
-
newAuthority: string(),
|
|
1706
|
-
voteAccount: string()
|
|
1707
|
-
})
|
|
1708
|
-
];
|
|
1709
|
-
return memoisedParsedInstructionsVote;
|
|
1710
|
-
};
|
|
1711
|
-
var memoisedTransactionMetaInterfaceFields;
|
|
1712
|
-
var transactionMetaInterfaceFields = () => {
|
|
1713
|
-
if (!memoisedTransactionMetaInterfaceFields)
|
|
1714
|
-
memoisedTransactionMetaInterfaceFields = {
|
|
1715
|
-
computeUnitsConsumed: bigint(),
|
|
1716
|
-
err: string(),
|
|
1717
|
-
fee: bigint(),
|
|
1718
|
-
format: string(),
|
|
1719
|
-
loadedAddresses: type(transactionMetaLoadedAddresses()),
|
|
1720
|
-
logMessages: list(string()),
|
|
1721
|
-
postBalances: list(bigint()),
|
|
1722
|
-
postTokenBalances: list(type(tokenBalance())),
|
|
1723
|
-
preBalances: list(bigint()),
|
|
1724
|
-
preTokenBalances: list(type(tokenBalance())),
|
|
1725
|
-
returnData: type(returnData()),
|
|
1726
|
-
rewards: list(type(reward())),
|
|
1727
|
-
status: type(transactionStatus())
|
|
1728
|
-
};
|
|
1729
|
-
return memoisedTransactionMetaInterfaceFields;
|
|
1730
|
-
};
|
|
1731
|
-
var memoisedTransactionMetaInterface;
|
|
1732
|
-
var transactionMetaInterface = () => {
|
|
1733
|
-
if (!memoisedTransactionMetaInterface)
|
|
1734
|
-
memoisedTransactionMetaInterface = new graphql.GraphQLInterfaceType({
|
|
1735
|
-
fields: {
|
|
1736
|
-
...transactionMetaInterfaceFields()
|
|
1737
|
-
},
|
|
1738
|
-
name: "TransactionMeta",
|
|
1739
|
-
resolveType(meta) {
|
|
1740
|
-
if (meta.format === "parsed") {
|
|
1741
|
-
return "TransactionMetaParsed";
|
|
1742
|
-
}
|
|
1743
|
-
return "TransactionMetaUnparsed";
|
|
1744
|
-
}
|
|
1745
|
-
});
|
|
1746
|
-
return memoisedTransactionMetaInterface;
|
|
1747
|
-
};
|
|
1748
|
-
var transactionMetaType = (name, description, innerInstructions) => new graphql.GraphQLObjectType({
|
|
1749
|
-
description,
|
|
1750
|
-
fields: {
|
|
1751
|
-
...transactionMetaInterfaceFields(),
|
|
1752
|
-
innerInstructions
|
|
1753
|
-
},
|
|
1754
|
-
interfaces: [transactionMetaInterface()],
|
|
1755
|
-
name
|
|
1756
|
-
});
|
|
1757
|
-
var memoisedTransactionMetaUnparsed;
|
|
1758
|
-
var transactionMetaUnparsed = () => {
|
|
1759
|
-
if (!memoisedTransactionMetaUnparsed)
|
|
1760
|
-
memoisedTransactionMetaUnparsed = transactionMetaType(
|
|
1761
|
-
"TransactionMetaUnparsed",
|
|
1762
|
-
"Non-parsed transaction meta",
|
|
1763
|
-
list(
|
|
1764
|
-
object("TransactionMetaInnerInstructionsUnparsed", {
|
|
1765
|
-
index: number(),
|
|
1766
|
-
instructions: list(
|
|
1767
|
-
object("TransactionMetaInnerInstructionsUnparsedInstruction", {
|
|
1768
|
-
index: number(),
|
|
1769
|
-
instructions: list(type(transactionInstruction()))
|
|
1770
|
-
})
|
|
1771
|
-
)
|
|
1772
|
-
})
|
|
1773
|
-
)
|
|
1774
|
-
);
|
|
1775
|
-
return memoisedTransactionMetaUnparsed;
|
|
1776
|
-
};
|
|
1777
|
-
var memoisedTransactionMetaParsed;
|
|
1778
|
-
var transactionMetaParsed = () => {
|
|
1779
|
-
if (!memoisedTransactionMetaParsed)
|
|
1780
|
-
memoisedTransactionMetaParsed = transactionMetaType(
|
|
1781
|
-
"TransactionMetaParsed",
|
|
1782
|
-
"Parsed transaction meta",
|
|
1783
|
-
list(
|
|
1784
|
-
object("TransactionMetaInnerInstructionsParsed", {
|
|
1785
|
-
index: number(),
|
|
1786
|
-
instructions: list(type(parsedTransactionInstructionInterface()))
|
|
1787
|
-
})
|
|
1788
|
-
)
|
|
1789
|
-
);
|
|
1790
|
-
return memoisedTransactionMetaParsed;
|
|
1791
|
-
};
|
|
1792
|
-
var memoisedTransactionMessageInterfaceFields;
|
|
1793
|
-
var transactionMessageInterfaceFields = () => {
|
|
1794
|
-
if (!memoisedTransactionMessageInterfaceFields)
|
|
1795
|
-
memoisedTransactionMessageInterfaceFields = {
|
|
1796
|
-
addressTableLookups: list(type(addressTableLookup())),
|
|
1797
|
-
format: string(),
|
|
1798
|
-
header: object("TransactionJsonTransactionHeader", {
|
|
1799
|
-
numReadonlySignedAccounts: number(),
|
|
1800
|
-
numReadonlyUnsignedAccounts: number(),
|
|
1801
|
-
numRequiredSignatures: number()
|
|
1802
|
-
}),
|
|
1803
|
-
recentBlockhash: string()
|
|
1804
|
-
};
|
|
1805
|
-
return memoisedTransactionMessageInterfaceFields;
|
|
1806
|
-
};
|
|
1807
|
-
var memoisedTransactionMessageInterface;
|
|
1808
|
-
var transactionMessageInterface = () => {
|
|
1809
|
-
if (!memoisedTransactionMessageInterface)
|
|
1810
|
-
memoisedTransactionMessageInterface = new graphql.GraphQLInterfaceType({
|
|
1811
|
-
fields: {
|
|
1812
|
-
...transactionMessageInterfaceFields()
|
|
1813
|
-
},
|
|
1814
|
-
name: "TransactionMessage",
|
|
1815
|
-
resolveType(message) {
|
|
1816
|
-
if (message.format === "parsed") {
|
|
1817
|
-
return "TransactionMessageParsed";
|
|
1818
|
-
}
|
|
1819
|
-
return "TransactionMessageUnparsed";
|
|
1820
1999
|
}
|
|
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
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
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
|
+
}
|
|
1885
2432
|
};
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
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":
|
|
1896
2544
|
return "TransactionBase58";
|
|
1897
|
-
|
|
1898
|
-
if (transaction.encoding === "base64") {
|
|
2545
|
+
case "base64":
|
|
1899
2546
|
return "TransactionBase64";
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
return "TransactionJson";
|
|
1903
|
-
}
|
|
1904
|
-
return "TransactionJsonParsed";
|
|
2547
|
+
default:
|
|
2548
|
+
return "TransactionParsed";
|
|
1905
2549
|
}
|
|
1906
|
-
}
|
|
1907
|
-
return memoisedTransactionInterface;
|
|
1908
|
-
};
|
|
1909
|
-
var transactionType = (name, description, transaction) => new graphql.GraphQLObjectType({
|
|
1910
|
-
description,
|
|
1911
|
-
fields: {
|
|
1912
|
-
...transactionInterfaceFields(),
|
|
1913
|
-
transaction
|
|
1914
|
-
},
|
|
1915
|
-
interfaces: [transactionInterface()],
|
|
1916
|
-
name
|
|
1917
|
-
});
|
|
1918
|
-
var memoisedTransactionBase58;
|
|
1919
|
-
var transactionBase58 = () => {
|
|
1920
|
-
if (!memoisedTransactionBase58)
|
|
1921
|
-
memoisedTransactionBase58 = transactionType(
|
|
1922
|
-
"TransactionBase58",
|
|
1923
|
-
"A Solana transaction as base58 encoded data",
|
|
1924
|
-
string()
|
|
1925
|
-
);
|
|
1926
|
-
return memoisedTransactionBase58;
|
|
1927
|
-
};
|
|
1928
|
-
var memoisedTransactionBase64;
|
|
1929
|
-
var transactionBase64 = () => {
|
|
1930
|
-
if (!memoisedTransactionBase64)
|
|
1931
|
-
memoisedTransactionBase64 = transactionType(
|
|
1932
|
-
"TransactionBase64",
|
|
1933
|
-
"A Solana transaction as base64 encoded data",
|
|
1934
|
-
string()
|
|
1935
|
-
);
|
|
1936
|
-
return memoisedTransactionBase64;
|
|
1937
|
-
};
|
|
1938
|
-
var memoisedTransactionJson;
|
|
1939
|
-
var transactionJson = () => {
|
|
1940
|
-
if (!memoisedTransactionJson)
|
|
1941
|
-
memoisedTransactionJson = transactionType(
|
|
1942
|
-
"TransactionJson",
|
|
1943
|
-
"A Solana transaction as a JSON object",
|
|
1944
|
-
type(transactionTransaction())
|
|
1945
|
-
);
|
|
1946
|
-
return memoisedTransactionJson;
|
|
1947
|
-
};
|
|
1948
|
-
var memoisedTransactionJsonParsed;
|
|
1949
|
-
var transactionJsonParsed = () => {
|
|
1950
|
-
if (!memoisedTransactionJsonParsed)
|
|
1951
|
-
memoisedTransactionJsonParsed = transactionType(
|
|
1952
|
-
"TransactionJsonParsed",
|
|
1953
|
-
"A Solana transaction as a parsed JSON object",
|
|
1954
|
-
type(transactionTransaction())
|
|
1955
|
-
);
|
|
1956
|
-
return memoisedTransactionJsonParsed;
|
|
1957
|
-
};
|
|
1958
|
-
var memoisedTransactionTypes;
|
|
1959
|
-
var transactionTypes = () => {
|
|
1960
|
-
if (!memoisedTransactionTypes)
|
|
1961
|
-
memoisedTransactionTypes = [
|
|
1962
|
-
partiallyDecodedTransactionInstruction(),
|
|
1963
|
-
...parsedInstructionsAddressLookupTable(),
|
|
1964
|
-
...parsedInstructionsBpfLoader(),
|
|
1965
|
-
...parsedInstructionsBpfUpgradeableLoader(),
|
|
1966
|
-
...parsedInstructionsStake(),
|
|
1967
|
-
...parsedInstructionsSplAssociatedToken(),
|
|
1968
|
-
parsedInstructionSplMemo(),
|
|
1969
|
-
...parsedInstructionsSplToken(),
|
|
1970
|
-
...parsedInstructionsSystem(),
|
|
1971
|
-
...parsedInstructionsVote(),
|
|
1972
|
-
transactionMetaUnparsed(),
|
|
1973
|
-
transactionMetaParsed(),
|
|
1974
|
-
transactionMessageUnparsed(),
|
|
1975
|
-
transactionMessageParsed(),
|
|
1976
|
-
transactionBase58(),
|
|
1977
|
-
transactionBase64(),
|
|
1978
|
-
transactionJson(),
|
|
1979
|
-
transactionJsonParsed()
|
|
1980
|
-
];
|
|
1981
|
-
return memoisedTransactionTypes;
|
|
1982
|
-
};
|
|
1983
|
-
|
|
1984
|
-
// src/schema/transaction/query.ts
|
|
1985
|
-
var transactionQuery = () => ({
|
|
1986
|
-
transaction: {
|
|
1987
|
-
args: {
|
|
1988
|
-
commitment: type(commitmentInputType()),
|
|
1989
|
-
encoding: type(transactionEncodingInputType()),
|
|
1990
|
-
maxSupportedTransactionVersion: type(maxSupportedTransactionVersionInputType()),
|
|
1991
|
-
signature: nonNull(string())
|
|
1992
|
-
},
|
|
1993
|
-
resolve: (_parent, args, context) => context.resolveTransaction(args),
|
|
1994
|
-
type: transactionInterface()
|
|
2550
|
+
}
|
|
1995
2551
|
}
|
|
1996
|
-
});
|
|
1997
|
-
|
|
1998
|
-
// src/schema/block/types.ts
|
|
1999
|
-
var memoisedTransactionForAccounts;
|
|
2000
|
-
var transactionForAccounts = () => {
|
|
2001
|
-
if (!memoisedTransactionForAccounts)
|
|
2002
|
-
memoisedTransactionForAccounts = new graphql.GraphQLObjectType({
|
|
2003
|
-
fields: {
|
|
2004
|
-
meta: object("TransactionMetaForAccounts", {
|
|
2005
|
-
computeUnitsUsed: bigint(),
|
|
2006
|
-
err: string(),
|
|
2007
|
-
fee: bigint(),
|
|
2008
|
-
format: string(),
|
|
2009
|
-
loadedAddresses: type(transactionMetaLoadedAddresses()),
|
|
2010
|
-
logMessages: list(string()),
|
|
2011
|
-
postBalances: list(bigint()),
|
|
2012
|
-
postTokenBalances: list(type(tokenBalance())),
|
|
2013
|
-
preBalances: list(bigint()),
|
|
2014
|
-
preTokenBalances: list(type(tokenBalance())),
|
|
2015
|
-
returnData: type(returnData()),
|
|
2016
|
-
rewards: list(type(reward())),
|
|
2017
|
-
status: type(transactionStatus())
|
|
2018
|
-
}),
|
|
2019
|
-
transaction: type(transactionInterface()),
|
|
2020
|
-
// TODO
|
|
2021
|
-
version: string()
|
|
2022
|
-
},
|
|
2023
|
-
name: "TransactionForAccounts"
|
|
2024
|
-
});
|
|
2025
|
-
return memoisedTransactionForAccounts;
|
|
2026
|
-
};
|
|
2027
|
-
var memoisedBlockInterfaceFields;
|
|
2028
|
-
var blockInterfaceFields = () => {
|
|
2029
|
-
if (!memoisedBlockInterfaceFields)
|
|
2030
|
-
memoisedBlockInterfaceFields = {
|
|
2031
|
-
blockHeight: bigint(),
|
|
2032
|
-
blockTime: bigint(),
|
|
2033
|
-
blockhash: string(),
|
|
2034
|
-
parentSlot: bigint(),
|
|
2035
|
-
previousBlockhash: string(),
|
|
2036
|
-
rewards: list(type(reward()))
|
|
2037
|
-
};
|
|
2038
|
-
return memoisedBlockInterfaceFields;
|
|
2039
|
-
};
|
|
2040
|
-
var memoisedBlockInterface;
|
|
2041
|
-
var blockInterface = () => {
|
|
2042
|
-
if (!memoisedBlockInterface)
|
|
2043
|
-
memoisedBlockInterface = new graphql.GraphQLInterfaceType({
|
|
2044
|
-
fields: {
|
|
2045
|
-
...blockInterfaceFields()
|
|
2046
|
-
},
|
|
2047
|
-
name: "Block",
|
|
2048
|
-
resolveType(block) {
|
|
2049
|
-
if (block.transactionDetails === "signatures") {
|
|
2050
|
-
return "BlockWithSignatures";
|
|
2051
|
-
}
|
|
2052
|
-
if (block.transactionDetails === "accounts") {
|
|
2053
|
-
return "BlockWithAccounts";
|
|
2054
|
-
}
|
|
2055
|
-
if (block.transactionDetails === "none") {
|
|
2056
|
-
return "BlockWithNoTransactions";
|
|
2057
|
-
}
|
|
2058
|
-
return "BlockWithTransactions";
|
|
2059
|
-
}
|
|
2060
|
-
});
|
|
2061
|
-
return memoisedBlockInterface;
|
|
2062
|
-
};
|
|
2063
|
-
var memoisedBlockWithNoTransactions;
|
|
2064
|
-
var blockWithNoTransactions = () => {
|
|
2065
|
-
if (!memoisedBlockWithNoTransactions)
|
|
2066
|
-
memoisedBlockWithNoTransactions = new graphql.GraphQLObjectType({
|
|
2067
|
-
fields: {
|
|
2068
|
-
...blockInterfaceFields()
|
|
2069
|
-
},
|
|
2070
|
-
interfaces: [blockInterface()],
|
|
2071
|
-
name: "BlockWithNoTransactions"
|
|
2072
|
-
});
|
|
2073
|
-
return memoisedBlockWithNoTransactions;
|
|
2074
|
-
};
|
|
2075
|
-
var memoisedBlockWithSignatures;
|
|
2076
|
-
var blockWithSignatures = () => {
|
|
2077
|
-
if (!memoisedBlockWithSignatures)
|
|
2078
|
-
memoisedBlockWithSignatures = new graphql.GraphQLObjectType({
|
|
2079
|
-
fields: {
|
|
2080
|
-
...blockInterfaceFields(),
|
|
2081
|
-
signatures: list(string())
|
|
2082
|
-
},
|
|
2083
|
-
interfaces: [blockInterface()],
|
|
2084
|
-
name: "BlockWithSignatures"
|
|
2085
|
-
});
|
|
2086
|
-
return memoisedBlockWithSignatures;
|
|
2087
|
-
};
|
|
2088
|
-
var memoisedBlockWithAccounts;
|
|
2089
|
-
var blockWithAccounts = () => {
|
|
2090
|
-
if (!memoisedBlockWithAccounts)
|
|
2091
|
-
memoisedBlockWithAccounts = new graphql.GraphQLObjectType({
|
|
2092
|
-
fields: {
|
|
2093
|
-
...blockInterfaceFields(),
|
|
2094
|
-
transactions: list(type(transactionForAccounts()))
|
|
2095
|
-
},
|
|
2096
|
-
interfaces: [blockInterface()],
|
|
2097
|
-
name: "BlockWithAccounts"
|
|
2098
|
-
});
|
|
2099
|
-
return memoisedBlockWithAccounts;
|
|
2100
|
-
};
|
|
2101
|
-
var memoisedBlockWithTransactions;
|
|
2102
|
-
var blockWithTransactions = () => {
|
|
2103
|
-
if (!memoisedBlockWithTransactions)
|
|
2104
|
-
memoisedBlockWithTransactions = new graphql.GraphQLObjectType({
|
|
2105
|
-
fields: {
|
|
2106
|
-
...blockInterfaceFields(),
|
|
2107
|
-
transactions: list(type(transactionInterface()))
|
|
2108
|
-
},
|
|
2109
|
-
interfaces: [blockInterface()],
|
|
2110
|
-
name: "BlockWithTransactions"
|
|
2111
|
-
});
|
|
2112
|
-
return memoisedBlockWithTransactions;
|
|
2113
|
-
};
|
|
2114
|
-
var memoisedBlockTypes;
|
|
2115
|
-
var blockTypes = () => {
|
|
2116
|
-
if (!memoisedBlockTypes)
|
|
2117
|
-
memoisedBlockTypes = [
|
|
2118
|
-
blockWithNoTransactions(),
|
|
2119
|
-
blockWithSignatures(),
|
|
2120
|
-
blockWithAccounts(),
|
|
2121
|
-
blockWithTransactions()
|
|
2122
|
-
];
|
|
2123
|
-
return memoisedBlockTypes;
|
|
2124
2552
|
};
|
|
2125
2553
|
|
|
2126
|
-
// src/schema/
|
|
2127
|
-
var
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
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);
|
|
2136
2596
|
},
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
fields: {
|
|
2143
|
-
account: type(accountInterface()),
|
|
2144
|
-
pubkey: string()
|
|
2145
|
-
},
|
|
2146
|
-
name: "ProgramAccount"
|
|
2147
|
-
});
|
|
2148
|
-
|
|
2149
|
-
// src/schema/program-accounts/query.ts
|
|
2150
|
-
var programAccountsQuery = () => ({
|
|
2151
|
-
programAccounts: {
|
|
2152
|
-
args: {
|
|
2153
|
-
commitment: type(commitmentInputType()),
|
|
2154
|
-
dataSlice: type(dataSliceInputType()),
|
|
2155
|
-
encoding: type(accountEncodingInputType()),
|
|
2156
|
-
filters: list(type(programAccountFilterInputType())),
|
|
2157
|
-
minContextSlot: bigint(),
|
|
2158
|
-
programAddress: nonNull(string()),
|
|
2159
|
-
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);
|
|
2160
2602
|
},
|
|
2161
|
-
|
|
2162
|
-
|
|
2603
|
+
transaction(_, args, context, info) {
|
|
2604
|
+
return context.loaders.transaction.load(args, info);
|
|
2605
|
+
}
|
|
2163
2606
|
}
|
|
2164
|
-
}
|
|
2607
|
+
};
|
|
2608
|
+
function createSolanaGraphQLSchema() {
|
|
2609
|
+
return schema.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
|
+
}
|
|
2165
2632
|
|
|
2166
2633
|
// src/rpc.ts
|
|
2167
2634
|
function createRpcGraphQL(rpc) {
|
|
2168
2635
|
const context = createSolanaGraphQLContext(rpc);
|
|
2169
|
-
const schema =
|
|
2170
|
-
query: new graphql.GraphQLObjectType({
|
|
2171
|
-
fields: {
|
|
2172
|
-
...accountQuery(),
|
|
2173
|
-
...blockQuery(),
|
|
2174
|
-
...programAccountsQuery(),
|
|
2175
|
-
...transactionQuery()
|
|
2176
|
-
},
|
|
2177
|
-
name: "RootQuery"
|
|
2178
|
-
}),
|
|
2179
|
-
types: [...accountTypes(), ...blockTypes(), ...transactionTypes()]
|
|
2180
|
-
});
|
|
2636
|
+
const schema = createSolanaGraphQLSchema();
|
|
2181
2637
|
return {
|
|
2182
2638
|
context,
|
|
2183
2639
|
async query(source, variableValues) {
|
|
2184
|
-
|
|
2640
|
+
return graphql.graphql({
|
|
2185
2641
|
contextValue: this.context,
|
|
2186
2642
|
schema: this.schema,
|
|
2187
2643
|
source,
|
|
2188
2644
|
variableValues
|
|
2189
2645
|
});
|
|
2190
|
-
this.context.cache.flush();
|
|
2191
|
-
return result;
|
|
2192
2646
|
},
|
|
2193
2647
|
schema
|
|
2194
2648
|
};
|