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