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