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