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