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