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