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