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