@solana-program/system 0.1.3 → 0.3.0
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/dist/src/index.cjs +414 -678
- package/dist/src/index.cjs.map +1 -1
- package/dist/src/index.js +281 -530
- package/dist/src/index.js.map +1 -1
- package/dist/types/src/generated/accounts/nonce.d.ts +12 -16
- package/dist/types/src/generated/accounts/nonce.d.ts.map +1 -1
- package/dist/types/src/generated/errors/system.d.ts +20 -27
- package/dist/types/src/generated/errors/system.d.ts.map +1 -1
- package/dist/types/src/generated/index.d.ts +0 -1
- package/dist/types/src/generated/index.d.ts.map +1 -1
- package/dist/types/src/generated/instructions/advanceNonceAccount.d.ts +6 -25
- package/dist/types/src/generated/instructions/advanceNonceAccount.d.ts.map +1 -1
- package/dist/types/src/generated/instructions/allocate.d.ts +6 -20
- package/dist/types/src/generated/instructions/allocate.d.ts.map +1 -1
- package/dist/types/src/generated/instructions/allocateWithSeed.d.ts +6 -26
- package/dist/types/src/generated/instructions/allocateWithSeed.d.ts.map +1 -1
- package/dist/types/src/generated/instructions/assign.d.ts +6 -20
- package/dist/types/src/generated/instructions/assign.d.ts.map +1 -1
- package/dist/types/src/generated/instructions/assignWithSeed.d.ts +6 -25
- package/dist/types/src/generated/instructions/assignWithSeed.d.ts.map +1 -1
- package/dist/types/src/generated/instructions/authorizeNonceAccount.d.ts +6 -23
- package/dist/types/src/generated/instructions/authorizeNonceAccount.d.ts.map +1 -1
- package/dist/types/src/generated/instructions/createAccount.d.ts +6 -25
- package/dist/types/src/generated/instructions/createAccount.d.ts.map +1 -1
- package/dist/types/src/generated/instructions/createAccountWithSeed.d.ts +6 -30
- package/dist/types/src/generated/instructions/createAccountWithSeed.d.ts.map +1 -1
- package/dist/types/src/generated/instructions/initializeNonceAccount.d.ts +6 -25
- package/dist/types/src/generated/instructions/initializeNonceAccount.d.ts.map +1 -1
- package/dist/types/src/generated/instructions/transferSol.d.ts +6 -23
- package/dist/types/src/generated/instructions/transferSol.d.ts.map +1 -1
- package/dist/types/src/generated/instructions/transferSolWithSeed.d.ts +6 -28
- package/dist/types/src/generated/instructions/transferSolWithSeed.d.ts.map +1 -1
- package/dist/types/src/generated/instructions/upgradeNonceAccount.d.ts +6 -18
- package/dist/types/src/generated/instructions/upgradeNonceAccount.d.ts.map +1 -1
- package/dist/types/src/generated/instructions/withdrawNonceAccount.d.ts +6 -32
- package/dist/types/src/generated/instructions/withdrawNonceAccount.d.ts.map +1 -1
- package/dist/types/src/generated/programs/system.d.ts +1 -5
- package/dist/types/src/generated/programs/system.d.ts.map +1 -1
- package/dist/types/src/generated/shared/index.d.ts +2 -13
- package/dist/types/src/generated/shared/index.d.ts.map +1 -1
- package/dist/types/src/generated/types/nonceState.d.ts +1 -1
- package/dist/types/src/generated/types/nonceState.d.ts.map +1 -1
- package/dist/types/src/generated/types/nonceVersion.d.ts +1 -1
- package/dist/types/src/generated/types/nonceVersion.d.ts.map +1 -1
- package/dist/types/test/_setup.d.ts +5 -5
- package/dist/types/test/_setup.d.ts.map +1 -1
- package/package.json +13 -22
package/dist/src/index.js
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import { decodeAccount, assertAccountExists, fetchEncodedAccount, assertAccountsExist, fetchEncodedAccounts, BASE_ACCOUNT_SIZE } from '@solana/
|
|
2
|
-
import { getAddressEncoder, getAddressDecoder, isProgramDerivedAddress } from '@solana/addresses';
|
|
3
|
-
import { getScalarEnumEncoder, getU32Encoder, getScalarEnumDecoder, getU32Decoder, combineCodec, getStructEncoder, getU64Encoder, getStructDecoder, getU64Decoder, mapEncoder, getStringEncoder, getStringDecoder } from '@solana/codecs';
|
|
4
|
-
import { AccountRole, upgradeRoleToSigner } from '@solana/instructions';
|
|
5
|
-
import { isTransactionSigner as isTransactionSigner$1 } from '@solana/signers';
|
|
1
|
+
import { getEnumEncoder, getU32Encoder, getEnumDecoder, getU32Decoder, combineCodec, getStructEncoder, getAddressEncoder, getU64Encoder, getStructDecoder, getAddressDecoder, getU64Decoder, decodeAccount, assertAccountExists, fetchEncodedAccount, assertAccountsExist, fetchEncodedAccounts, containsBytes, transformEncoder, addEncoderSizePrefix, getUtf8Encoder, addDecoderSizePrefix, getUtf8Decoder, BASE_ACCOUNT_SIZE, AccountRole, upgradeRoleToSigner, isTransactionSigner as isTransactionSigner$1 } from '@solana/web3.js';
|
|
6
2
|
|
|
7
3
|
// env-shim.ts
|
|
8
4
|
var __DEV__ = /* @__PURE__ */ (() => process["env"].NODE_ENV === "development")();
|
|
@@ -12,10 +8,10 @@ var NonceState = /* @__PURE__ */ ((NonceState3) => {
|
|
|
12
8
|
return NonceState3;
|
|
13
9
|
})(NonceState || {});
|
|
14
10
|
function getNonceStateEncoder() {
|
|
15
|
-
return
|
|
11
|
+
return getEnumEncoder(NonceState, { size: getU32Encoder() });
|
|
16
12
|
}
|
|
17
13
|
function getNonceStateDecoder() {
|
|
18
|
-
return
|
|
14
|
+
return getEnumDecoder(NonceState, { size: getU32Decoder() });
|
|
19
15
|
}
|
|
20
16
|
function getNonceStateCodec() {
|
|
21
17
|
return combineCodec(getNonceStateEncoder(), getNonceStateDecoder());
|
|
@@ -26,17 +22,17 @@ var NonceVersion = /* @__PURE__ */ ((NonceVersion3) => {
|
|
|
26
22
|
return NonceVersion3;
|
|
27
23
|
})(NonceVersion || {});
|
|
28
24
|
function getNonceVersionEncoder() {
|
|
29
|
-
return
|
|
25
|
+
return getEnumEncoder(NonceVersion, { size: getU32Encoder() });
|
|
30
26
|
}
|
|
31
27
|
function getNonceVersionDecoder() {
|
|
32
|
-
return
|
|
28
|
+
return getEnumDecoder(NonceVersion, { size: getU32Decoder() });
|
|
33
29
|
}
|
|
34
30
|
function getNonceVersionCodec() {
|
|
35
31
|
return combineCodec(getNonceVersionEncoder(), getNonceVersionDecoder());
|
|
36
32
|
}
|
|
37
33
|
|
|
38
34
|
// src/generated/accounts/nonce.ts
|
|
39
|
-
function
|
|
35
|
+
function getNonceEncoder() {
|
|
40
36
|
return getStructEncoder([
|
|
41
37
|
["version", getNonceVersionEncoder()],
|
|
42
38
|
["state", getNonceStateEncoder()],
|
|
@@ -45,7 +41,7 @@ function getNonceAccountDataEncoder() {
|
|
|
45
41
|
["lamportsPerSignature", getU64Encoder()]
|
|
46
42
|
]);
|
|
47
43
|
}
|
|
48
|
-
function
|
|
44
|
+
function getNonceDecoder() {
|
|
49
45
|
return getStructDecoder([
|
|
50
46
|
["version", getNonceVersionDecoder()],
|
|
51
47
|
["state", getNonceStateDecoder()],
|
|
@@ -54,16 +50,13 @@ function getNonceAccountDataDecoder() {
|
|
|
54
50
|
["lamportsPerSignature", getU64Decoder()]
|
|
55
51
|
]);
|
|
56
52
|
}
|
|
57
|
-
function
|
|
58
|
-
return combineCodec(
|
|
59
|
-
getNonceAccountDataEncoder(),
|
|
60
|
-
getNonceAccountDataDecoder()
|
|
61
|
-
);
|
|
53
|
+
function getNonceCodec() {
|
|
54
|
+
return combineCodec(getNonceEncoder(), getNonceDecoder());
|
|
62
55
|
}
|
|
63
56
|
function decodeNonce(encodedAccount) {
|
|
64
57
|
return decodeAccount(
|
|
65
58
|
encodedAccount,
|
|
66
|
-
|
|
59
|
+
getNonceDecoder()
|
|
67
60
|
);
|
|
68
61
|
}
|
|
69
62
|
async function fetchNonce(rpc, address, config) {
|
|
@@ -89,89 +82,100 @@ function getNonceSize() {
|
|
|
89
82
|
}
|
|
90
83
|
|
|
91
84
|
// src/generated/errors/system.ts
|
|
92
|
-
var
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
return SystemProgramErrorCode3;
|
|
103
|
-
})(SystemProgramErrorCode || {});
|
|
104
|
-
var SystemProgramError = class extends Error {
|
|
105
|
-
name = "SystemProgramError";
|
|
106
|
-
code;
|
|
107
|
-
cause;
|
|
108
|
-
constructor(code, name, message, cause) {
|
|
109
|
-
super(`${name} (${code}): ${message}`);
|
|
110
|
-
this.code = code;
|
|
111
|
-
this.cause = cause;
|
|
112
|
-
}
|
|
113
|
-
};
|
|
114
|
-
var systemProgramErrorCodeMap;
|
|
85
|
+
var SYSTEM_ERROR__ACCOUNT_ALREADY_IN_USE = 0;
|
|
86
|
+
var SYSTEM_ERROR__RESULT_WITH_NEGATIVE_LAMPORTS = 1;
|
|
87
|
+
var SYSTEM_ERROR__INVALID_PROGRAM_ID = 2;
|
|
88
|
+
var SYSTEM_ERROR__INVALID_ACCOUNT_DATA_LENGTH = 3;
|
|
89
|
+
var SYSTEM_ERROR__MAX_SEED_LENGTH_EXCEEDED = 4;
|
|
90
|
+
var SYSTEM_ERROR__ADDRESS_WITH_SEED_MISMATCH = 5;
|
|
91
|
+
var SYSTEM_ERROR__NONCE_NO_RECENT_BLOCKHASHES = 6;
|
|
92
|
+
var SYSTEM_ERROR__NONCE_BLOCKHASH_NOT_EXPIRED = 7;
|
|
93
|
+
var SYSTEM_ERROR__NONCE_UNEXPECTED_BLOCKHASH_VALUE = 8;
|
|
94
|
+
var systemErrorMessages;
|
|
115
95
|
if (__DEV__) {
|
|
116
|
-
|
|
117
|
-
[
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
]
|
|
121
|
-
[
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
]
|
|
125
|
-
[
|
|
126
|
-
"InvalidProgramId",
|
|
127
|
-
`cannot assign account to this program id`
|
|
128
|
-
],
|
|
129
|
-
[3 /* INVALID_ACCOUNT_DATA_LENGTH */]: [
|
|
130
|
-
"InvalidAccountDataLength",
|
|
131
|
-
`cannot allocate account data of this length`
|
|
132
|
-
],
|
|
133
|
-
[4 /* MAX_SEED_LENGTH_EXCEEDED */]: [
|
|
134
|
-
"MaxSeedLengthExceeded",
|
|
135
|
-
`length of requested seed is too long`
|
|
136
|
-
],
|
|
137
|
-
[5 /* ADDRESS_WITH_SEED_MISMATCH */]: [
|
|
138
|
-
"AddressWithSeedMismatch",
|
|
139
|
-
`provided address does not match addressed derived from seed`
|
|
140
|
-
],
|
|
141
|
-
[6 /* NONCE_NO_RECENT_BLOCKHASHES */]: [
|
|
142
|
-
"NonceNoRecentBlockhashes",
|
|
143
|
-
`advancing stored nonce requires a populated RecentBlockhashes sysvar`
|
|
144
|
-
],
|
|
145
|
-
[7 /* NONCE_BLOCKHASH_NOT_EXPIRED */]: [
|
|
146
|
-
"NonceBlockhashNotExpired",
|
|
147
|
-
`stored nonce is still in recent_blockhashes`
|
|
148
|
-
],
|
|
149
|
-
[8 /* NONCE_UNEXPECTED_BLOCKHASH_VALUE */]: [
|
|
150
|
-
"NonceUnexpectedBlockhashValue",
|
|
151
|
-
`specified nonce does not match stored nonce`
|
|
152
|
-
]
|
|
96
|
+
systemErrorMessages = {
|
|
97
|
+
[SYSTEM_ERROR__ACCOUNT_ALREADY_IN_USE]: `an account with the same address already exists`,
|
|
98
|
+
[SYSTEM_ERROR__ADDRESS_WITH_SEED_MISMATCH]: `provided address does not match addressed derived from seed`,
|
|
99
|
+
[SYSTEM_ERROR__INVALID_ACCOUNT_DATA_LENGTH]: `cannot allocate account data of this length`,
|
|
100
|
+
[SYSTEM_ERROR__INVALID_PROGRAM_ID]: `cannot assign account to this program id`,
|
|
101
|
+
[SYSTEM_ERROR__MAX_SEED_LENGTH_EXCEEDED]: `length of requested seed is too long`,
|
|
102
|
+
[SYSTEM_ERROR__NONCE_BLOCKHASH_NOT_EXPIRED]: `stored nonce is still in recent_blockhashes`,
|
|
103
|
+
[SYSTEM_ERROR__NONCE_NO_RECENT_BLOCKHASHES]: `advancing stored nonce requires a populated RecentBlockhashes sysvar`,
|
|
104
|
+
[SYSTEM_ERROR__NONCE_UNEXPECTED_BLOCKHASH_VALUE]: `specified nonce does not match stored nonce`,
|
|
105
|
+
[SYSTEM_ERROR__RESULT_WITH_NEGATIVE_LAMPORTS]: `account does not have enough SOL to perform the operation`
|
|
153
106
|
};
|
|
154
107
|
}
|
|
155
|
-
function
|
|
108
|
+
function getSystemErrorMessage(code) {
|
|
156
109
|
if (__DEV__) {
|
|
157
|
-
return
|
|
158
|
-
code,
|
|
159
|
-
...systemProgramErrorCodeMap[code],
|
|
160
|
-
cause
|
|
161
|
-
);
|
|
110
|
+
return systemErrorMessages[code];
|
|
162
111
|
}
|
|
163
|
-
return
|
|
164
|
-
code,
|
|
165
|
-
"Unknown",
|
|
166
|
-
"Error message not available in production bundles. Compile with __DEV__ set to true to see more information.",
|
|
167
|
-
cause
|
|
168
|
-
);
|
|
112
|
+
return "Error message not available in production bundles. Compile with `__DEV__` set to true to see more information.";
|
|
169
113
|
}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
114
|
+
var SYSTEM_PROGRAM_ADDRESS = "11111111111111111111111111111111";
|
|
115
|
+
var SystemAccount = /* @__PURE__ */ ((SystemAccount2) => {
|
|
116
|
+
SystemAccount2[SystemAccount2["Nonce"] = 0] = "Nonce";
|
|
117
|
+
return SystemAccount2;
|
|
118
|
+
})(SystemAccount || {});
|
|
119
|
+
var SystemInstruction = /* @__PURE__ */ ((SystemInstruction2) => {
|
|
120
|
+
SystemInstruction2[SystemInstruction2["CreateAccount"] = 0] = "CreateAccount";
|
|
121
|
+
SystemInstruction2[SystemInstruction2["Assign"] = 1] = "Assign";
|
|
122
|
+
SystemInstruction2[SystemInstruction2["TransferSol"] = 2] = "TransferSol";
|
|
123
|
+
SystemInstruction2[SystemInstruction2["CreateAccountWithSeed"] = 3] = "CreateAccountWithSeed";
|
|
124
|
+
SystemInstruction2[SystemInstruction2["AdvanceNonceAccount"] = 4] = "AdvanceNonceAccount";
|
|
125
|
+
SystemInstruction2[SystemInstruction2["WithdrawNonceAccount"] = 5] = "WithdrawNonceAccount";
|
|
126
|
+
SystemInstruction2[SystemInstruction2["InitializeNonceAccount"] = 6] = "InitializeNonceAccount";
|
|
127
|
+
SystemInstruction2[SystemInstruction2["AuthorizeNonceAccount"] = 7] = "AuthorizeNonceAccount";
|
|
128
|
+
SystemInstruction2[SystemInstruction2["Allocate"] = 8] = "Allocate";
|
|
129
|
+
SystemInstruction2[SystemInstruction2["AllocateWithSeed"] = 9] = "AllocateWithSeed";
|
|
130
|
+
SystemInstruction2[SystemInstruction2["AssignWithSeed"] = 10] = "AssignWithSeed";
|
|
131
|
+
SystemInstruction2[SystemInstruction2["TransferSolWithSeed"] = 11] = "TransferSolWithSeed";
|
|
132
|
+
SystemInstruction2[SystemInstruction2["UpgradeNonceAccount"] = 12] = "UpgradeNonceAccount";
|
|
133
|
+
return SystemInstruction2;
|
|
134
|
+
})(SystemInstruction || {});
|
|
135
|
+
function identifySystemInstruction(instruction) {
|
|
136
|
+
const data = instruction instanceof Uint8Array ? instruction : instruction.data;
|
|
137
|
+
if (containsBytes(data, getU32Encoder().encode(0), 0)) {
|
|
138
|
+
return 0 /* CreateAccount */;
|
|
173
139
|
}
|
|
174
|
-
|
|
140
|
+
if (containsBytes(data, getU32Encoder().encode(1), 0)) {
|
|
141
|
+
return 1 /* Assign */;
|
|
142
|
+
}
|
|
143
|
+
if (containsBytes(data, getU32Encoder().encode(2), 0)) {
|
|
144
|
+
return 2 /* TransferSol */;
|
|
145
|
+
}
|
|
146
|
+
if (containsBytes(data, getU32Encoder().encode(3), 0)) {
|
|
147
|
+
return 3 /* CreateAccountWithSeed */;
|
|
148
|
+
}
|
|
149
|
+
if (containsBytes(data, getU32Encoder().encode(4), 0)) {
|
|
150
|
+
return 4 /* AdvanceNonceAccount */;
|
|
151
|
+
}
|
|
152
|
+
if (containsBytes(data, getU32Encoder().encode(5), 0)) {
|
|
153
|
+
return 5 /* WithdrawNonceAccount */;
|
|
154
|
+
}
|
|
155
|
+
if (containsBytes(data, getU32Encoder().encode(6), 0)) {
|
|
156
|
+
return 6 /* InitializeNonceAccount */;
|
|
157
|
+
}
|
|
158
|
+
if (containsBytes(data, getU32Encoder().encode(7), 0)) {
|
|
159
|
+
return 7 /* AuthorizeNonceAccount */;
|
|
160
|
+
}
|
|
161
|
+
if (containsBytes(data, getU32Encoder().encode(8), 0)) {
|
|
162
|
+
return 8 /* Allocate */;
|
|
163
|
+
}
|
|
164
|
+
if (containsBytes(data, getU32Encoder().encode(9), 0)) {
|
|
165
|
+
return 9 /* AllocateWithSeed */;
|
|
166
|
+
}
|
|
167
|
+
if (containsBytes(data, getU32Encoder().encode(10), 0)) {
|
|
168
|
+
return 10 /* AssignWithSeed */;
|
|
169
|
+
}
|
|
170
|
+
if (containsBytes(data, getU32Encoder().encode(11), 0)) {
|
|
171
|
+
return 11 /* TransferSolWithSeed */;
|
|
172
|
+
}
|
|
173
|
+
if (containsBytes(data, getU32Encoder().encode(12), 0)) {
|
|
174
|
+
return 12 /* UpgradeNonceAccount */;
|
|
175
|
+
}
|
|
176
|
+
throw new Error(
|
|
177
|
+
"The provided instruction could not be identified as a system instruction."
|
|
178
|
+
);
|
|
175
179
|
}
|
|
176
180
|
function expectAddress(value) {
|
|
177
181
|
if (!value) {
|
|
@@ -185,58 +189,29 @@ function expectAddress(value) {
|
|
|
185
189
|
}
|
|
186
190
|
return value;
|
|
187
191
|
}
|
|
188
|
-
function
|
|
189
|
-
|
|
190
|
-
throw new Error("Expected a ProgramDerivedAddress.");
|
|
191
|
-
}
|
|
192
|
-
return value;
|
|
193
|
-
}
|
|
194
|
-
function expectTransactionSigner(value) {
|
|
195
|
-
if (!value || !isTransactionSigner(value)) {
|
|
196
|
-
throw new Error("Expected a TransactionSigner.");
|
|
197
|
-
}
|
|
198
|
-
return value;
|
|
199
|
-
}
|
|
200
|
-
function accountMetaWithDefault(account, role) {
|
|
201
|
-
if (account === void 0)
|
|
202
|
-
return void 0;
|
|
203
|
-
return typeof account === "string" ? { address: account, role } : account;
|
|
204
|
-
}
|
|
205
|
-
function getAccountMetasWithSigners(accounts, optionalAccountStrategy, programAddress) {
|
|
206
|
-
const accountMetas = {};
|
|
207
|
-
Object.keys(accounts).forEach((key) => {
|
|
208
|
-
const account = accounts[key];
|
|
192
|
+
function getAccountMetaFactory(programAddress, optionalAccountStrategy) {
|
|
193
|
+
return (account) => {
|
|
209
194
|
if (!account.value) {
|
|
210
|
-
|
|
211
|
-
return;
|
|
212
|
-
accountMetas[key] = {
|
|
195
|
+
return Object.freeze({
|
|
213
196
|
address: programAddress,
|
|
214
197
|
role: AccountRole.READONLY
|
|
215
|
-
};
|
|
216
|
-
return;
|
|
198
|
+
});
|
|
217
199
|
}
|
|
218
200
|
const writableRole = account.isWritable ? AccountRole.WRITABLE : AccountRole.READONLY;
|
|
219
|
-
|
|
201
|
+
return Object.freeze({
|
|
220
202
|
address: expectAddress(account.value),
|
|
221
203
|
role: isTransactionSigner(account.value) ? upgradeRoleToSigner(writableRole) : writableRole,
|
|
222
204
|
...isTransactionSigner(account.value) ? { signer: account.value } : {}
|
|
223
205
|
});
|
|
224
|
-
}
|
|
225
|
-
return accountMetas;
|
|
206
|
+
};
|
|
226
207
|
}
|
|
227
208
|
function isTransactionSigner(value) {
|
|
228
209
|
return !!value && typeof value === "object" && "address" in value && isTransactionSigner$1(value);
|
|
229
210
|
}
|
|
230
|
-
function memcmp(data, bytes, offset) {
|
|
231
|
-
const slice = data.slice(offset, offset + bytes.length);
|
|
232
|
-
if (slice.length !== bytes.length)
|
|
233
|
-
return false;
|
|
234
|
-
return bytes.every((b, i) => b === slice[i]);
|
|
235
|
-
}
|
|
236
211
|
|
|
237
212
|
// src/generated/instructions/advanceNonceAccount.ts
|
|
238
213
|
function getAdvanceNonceAccountInstructionDataEncoder() {
|
|
239
|
-
return
|
|
214
|
+
return transformEncoder(
|
|
240
215
|
getStructEncoder([["discriminator", getU32Encoder()]]),
|
|
241
216
|
(value) => ({ ...value, discriminator: 4 })
|
|
242
217
|
);
|
|
@@ -251,8 +226,8 @@ function getAdvanceNonceAccountInstructionDataCodec() {
|
|
|
251
226
|
);
|
|
252
227
|
}
|
|
253
228
|
function getAdvanceNonceAccountInstruction(input) {
|
|
254
|
-
const programAddress =
|
|
255
|
-
const
|
|
229
|
+
const programAddress = SYSTEM_PROGRAM_ADDRESS;
|
|
230
|
+
const originalAccounts = {
|
|
256
231
|
nonceAccount: { value: input.nonceAccount ?? null, isWritable: true },
|
|
257
232
|
recentBlockhashesSysvar: {
|
|
258
233
|
value: input.recentBlockhashesSysvar ?? null,
|
|
@@ -260,37 +235,21 @@ function getAdvanceNonceAccountInstruction(input) {
|
|
|
260
235
|
},
|
|
261
236
|
nonceAuthority: { value: input.nonceAuthority ?? null, isWritable: false }
|
|
262
237
|
};
|
|
238
|
+
const accounts = originalAccounts;
|
|
263
239
|
if (!accounts.recentBlockhashesSysvar.value) {
|
|
264
240
|
accounts.recentBlockhashesSysvar.value = "SysvarRecentB1ockHashes11111111111111111111";
|
|
265
241
|
}
|
|
266
|
-
const
|
|
267
|
-
|
|
268
|
-
"programId",
|
|
269
|
-
programAddress
|
|
270
|
-
);
|
|
271
|
-
const instruction = getAdvanceNonceAccountInstructionRaw(
|
|
272
|
-
accountMetas,
|
|
273
|
-
programAddress
|
|
274
|
-
);
|
|
275
|
-
return instruction;
|
|
276
|
-
}
|
|
277
|
-
function getAdvanceNonceAccountInstructionRaw(accounts, programAddress = "11111111111111111111111111111111", remainingAccounts) {
|
|
278
|
-
return {
|
|
242
|
+
const getAccountMeta = getAccountMetaFactory(programAddress);
|
|
243
|
+
const instruction = {
|
|
279
244
|
accounts: [
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
AccountRole.READONLY
|
|
284
|
-
),
|
|
285
|
-
accountMetaWithDefault(
|
|
286
|
-
accounts.nonceAuthority,
|
|
287
|
-
AccountRole.READONLY_SIGNER
|
|
288
|
-
),
|
|
289
|
-
...remainingAccounts ?? []
|
|
245
|
+
getAccountMeta(accounts.nonceAccount),
|
|
246
|
+
getAccountMeta(accounts.recentBlockhashesSysvar),
|
|
247
|
+
getAccountMeta(accounts.nonceAuthority)
|
|
290
248
|
],
|
|
291
|
-
|
|
292
|
-
|
|
249
|
+
programAddress,
|
|
250
|
+
data: getAdvanceNonceAccountInstructionDataEncoder().encode({})
|
|
293
251
|
};
|
|
252
|
+
return instruction;
|
|
294
253
|
}
|
|
295
254
|
function parseAdvanceNonceAccountInstruction(instruction) {
|
|
296
255
|
if (instruction.accounts.length < 3) {
|
|
@@ -315,7 +274,7 @@ function parseAdvanceNonceAccountInstruction(instruction) {
|
|
|
315
274
|
};
|
|
316
275
|
}
|
|
317
276
|
function getAllocateInstructionDataEncoder() {
|
|
318
|
-
return
|
|
277
|
+
return transformEncoder(
|
|
319
278
|
getStructEncoder([
|
|
320
279
|
["discriminator", getU32Encoder()],
|
|
321
280
|
["space", getU64Encoder()]
|
|
@@ -336,32 +295,21 @@ function getAllocateInstructionDataCodec() {
|
|
|
336
295
|
);
|
|
337
296
|
}
|
|
338
297
|
function getAllocateInstruction(input) {
|
|
339
|
-
const programAddress =
|
|
340
|
-
const
|
|
298
|
+
const programAddress = SYSTEM_PROGRAM_ADDRESS;
|
|
299
|
+
const originalAccounts = {
|
|
341
300
|
newAccount: { value: input.newAccount ?? null, isWritable: true }
|
|
342
301
|
};
|
|
302
|
+
const accounts = originalAccounts;
|
|
343
303
|
const args = { ...input };
|
|
344
|
-
const
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
programAddress
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
args,
|
|
352
|
-
programAddress
|
|
353
|
-
);
|
|
354
|
-
return instruction;
|
|
355
|
-
}
|
|
356
|
-
function getAllocateInstructionRaw(accounts, args, programAddress = "11111111111111111111111111111111", remainingAccounts) {
|
|
357
|
-
return {
|
|
358
|
-
accounts: [
|
|
359
|
-
accountMetaWithDefault(accounts.newAccount, AccountRole.WRITABLE_SIGNER),
|
|
360
|
-
...remainingAccounts ?? []
|
|
361
|
-
],
|
|
362
|
-
data: getAllocateInstructionDataEncoder().encode(args),
|
|
363
|
-
programAddress
|
|
304
|
+
const getAccountMeta = getAccountMetaFactory(programAddress);
|
|
305
|
+
const instruction = {
|
|
306
|
+
accounts: [getAccountMeta(accounts.newAccount)],
|
|
307
|
+
programAddress,
|
|
308
|
+
data: getAllocateInstructionDataEncoder().encode(
|
|
309
|
+
args
|
|
310
|
+
)
|
|
364
311
|
};
|
|
312
|
+
return instruction;
|
|
365
313
|
}
|
|
366
314
|
function parseAllocateInstruction(instruction) {
|
|
367
315
|
if (instruction.accounts.length < 1) {
|
|
@@ -382,11 +330,11 @@ function parseAllocateInstruction(instruction) {
|
|
|
382
330
|
};
|
|
383
331
|
}
|
|
384
332
|
function getAllocateWithSeedInstructionDataEncoder() {
|
|
385
|
-
return
|
|
333
|
+
return transformEncoder(
|
|
386
334
|
getStructEncoder([
|
|
387
335
|
["discriminator", getU32Encoder()],
|
|
388
336
|
["base", getAddressEncoder()],
|
|
389
|
-
["seed",
|
|
337
|
+
["seed", addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())],
|
|
390
338
|
["space", getU64Encoder()],
|
|
391
339
|
["programAddress", getAddressEncoder()]
|
|
392
340
|
]),
|
|
@@ -397,7 +345,7 @@ function getAllocateWithSeedInstructionDataDecoder() {
|
|
|
397
345
|
return getStructDecoder([
|
|
398
346
|
["discriminator", getU32Decoder()],
|
|
399
347
|
["base", getAddressDecoder()],
|
|
400
|
-
["seed",
|
|
348
|
+
["seed", addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())],
|
|
401
349
|
["space", getU64Decoder()],
|
|
402
350
|
["programAddress", getAddressDecoder()]
|
|
403
351
|
]);
|
|
@@ -409,34 +357,25 @@ function getAllocateWithSeedInstructionDataCodec() {
|
|
|
409
357
|
);
|
|
410
358
|
}
|
|
411
359
|
function getAllocateWithSeedInstruction(input) {
|
|
412
|
-
const programAddress =
|
|
413
|
-
const
|
|
360
|
+
const programAddress = SYSTEM_PROGRAM_ADDRESS;
|
|
361
|
+
const originalAccounts = {
|
|
414
362
|
newAccount: { value: input.newAccount ?? null, isWritable: true },
|
|
415
363
|
baseAccount: { value: input.baseAccount ?? null, isWritable: false }
|
|
416
364
|
};
|
|
365
|
+
const accounts = originalAccounts;
|
|
417
366
|
const args = { ...input };
|
|
418
|
-
const
|
|
419
|
-
|
|
420
|
-
"programId",
|
|
421
|
-
programAddress
|
|
422
|
-
);
|
|
423
|
-
const instruction = getAllocateWithSeedInstructionRaw(
|
|
424
|
-
accountMetas,
|
|
425
|
-
args,
|
|
426
|
-
programAddress
|
|
427
|
-
);
|
|
428
|
-
return instruction;
|
|
429
|
-
}
|
|
430
|
-
function getAllocateWithSeedInstructionRaw(accounts, args, programAddress = "11111111111111111111111111111111", remainingAccounts) {
|
|
431
|
-
return {
|
|
367
|
+
const getAccountMeta = getAccountMetaFactory(programAddress);
|
|
368
|
+
const instruction = {
|
|
432
369
|
accounts: [
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
...remainingAccounts ?? []
|
|
370
|
+
getAccountMeta(accounts.newAccount),
|
|
371
|
+
getAccountMeta(accounts.baseAccount)
|
|
436
372
|
],
|
|
437
|
-
|
|
438
|
-
|
|
373
|
+
programAddress,
|
|
374
|
+
data: getAllocateWithSeedInstructionDataEncoder().encode(
|
|
375
|
+
args
|
|
376
|
+
)
|
|
439
377
|
};
|
|
378
|
+
return instruction;
|
|
440
379
|
}
|
|
441
380
|
function parseAllocateWithSeedInstruction(instruction) {
|
|
442
381
|
if (instruction.accounts.length < 2) {
|
|
@@ -458,7 +397,7 @@ function parseAllocateWithSeedInstruction(instruction) {
|
|
|
458
397
|
};
|
|
459
398
|
}
|
|
460
399
|
function getAssignInstructionDataEncoder() {
|
|
461
|
-
return
|
|
400
|
+
return transformEncoder(
|
|
462
401
|
getStructEncoder([
|
|
463
402
|
["discriminator", getU32Encoder()],
|
|
464
403
|
["programAddress", getAddressEncoder()]
|
|
@@ -479,32 +418,21 @@ function getAssignInstructionDataCodec() {
|
|
|
479
418
|
);
|
|
480
419
|
}
|
|
481
420
|
function getAssignInstruction(input) {
|
|
482
|
-
const programAddress =
|
|
483
|
-
const
|
|
421
|
+
const programAddress = SYSTEM_PROGRAM_ADDRESS;
|
|
422
|
+
const originalAccounts = {
|
|
484
423
|
account: { value: input.account ?? null, isWritable: true }
|
|
485
424
|
};
|
|
425
|
+
const accounts = originalAccounts;
|
|
486
426
|
const args = { ...input };
|
|
487
|
-
const
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
programAddress
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
args,
|
|
495
|
-
programAddress
|
|
496
|
-
);
|
|
497
|
-
return instruction;
|
|
498
|
-
}
|
|
499
|
-
function getAssignInstructionRaw(accounts, args, programAddress = "11111111111111111111111111111111", remainingAccounts) {
|
|
500
|
-
return {
|
|
501
|
-
accounts: [
|
|
502
|
-
accountMetaWithDefault(accounts.account, AccountRole.WRITABLE_SIGNER),
|
|
503
|
-
...remainingAccounts ?? []
|
|
504
|
-
],
|
|
505
|
-
data: getAssignInstructionDataEncoder().encode(args),
|
|
506
|
-
programAddress
|
|
427
|
+
const getAccountMeta = getAccountMetaFactory(programAddress);
|
|
428
|
+
const instruction = {
|
|
429
|
+
accounts: [getAccountMeta(accounts.account)],
|
|
430
|
+
programAddress,
|
|
431
|
+
data: getAssignInstructionDataEncoder().encode(
|
|
432
|
+
args
|
|
433
|
+
)
|
|
507
434
|
};
|
|
435
|
+
return instruction;
|
|
508
436
|
}
|
|
509
437
|
function parseAssignInstruction(instruction) {
|
|
510
438
|
if (instruction.accounts.length < 1) {
|
|
@@ -525,11 +453,11 @@ function parseAssignInstruction(instruction) {
|
|
|
525
453
|
};
|
|
526
454
|
}
|
|
527
455
|
function getAssignWithSeedInstructionDataEncoder() {
|
|
528
|
-
return
|
|
456
|
+
return transformEncoder(
|
|
529
457
|
getStructEncoder([
|
|
530
458
|
["discriminator", getU32Encoder()],
|
|
531
459
|
["base", getAddressEncoder()],
|
|
532
|
-
["seed",
|
|
460
|
+
["seed", addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())],
|
|
533
461
|
["programAddress", getAddressEncoder()]
|
|
534
462
|
]),
|
|
535
463
|
(value) => ({ ...value, discriminator: 10 })
|
|
@@ -539,7 +467,7 @@ function getAssignWithSeedInstructionDataDecoder() {
|
|
|
539
467
|
return getStructDecoder([
|
|
540
468
|
["discriminator", getU32Decoder()],
|
|
541
469
|
["base", getAddressDecoder()],
|
|
542
|
-
["seed",
|
|
470
|
+
["seed", addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())],
|
|
543
471
|
["programAddress", getAddressDecoder()]
|
|
544
472
|
]);
|
|
545
473
|
}
|
|
@@ -550,34 +478,25 @@ function getAssignWithSeedInstructionDataCodec() {
|
|
|
550
478
|
);
|
|
551
479
|
}
|
|
552
480
|
function getAssignWithSeedInstruction(input) {
|
|
553
|
-
const programAddress =
|
|
554
|
-
const
|
|
481
|
+
const programAddress = SYSTEM_PROGRAM_ADDRESS;
|
|
482
|
+
const originalAccounts = {
|
|
555
483
|
account: { value: input.account ?? null, isWritable: true },
|
|
556
484
|
baseAccount: { value: input.baseAccount ?? null, isWritable: false }
|
|
557
485
|
};
|
|
486
|
+
const accounts = originalAccounts;
|
|
558
487
|
const args = { ...input };
|
|
559
|
-
const
|
|
560
|
-
|
|
561
|
-
"programId",
|
|
562
|
-
programAddress
|
|
563
|
-
);
|
|
564
|
-
const instruction = getAssignWithSeedInstructionRaw(
|
|
565
|
-
accountMetas,
|
|
566
|
-
args,
|
|
567
|
-
programAddress
|
|
568
|
-
);
|
|
569
|
-
return instruction;
|
|
570
|
-
}
|
|
571
|
-
function getAssignWithSeedInstructionRaw(accounts, args, programAddress = "11111111111111111111111111111111", remainingAccounts) {
|
|
572
|
-
return {
|
|
488
|
+
const getAccountMeta = getAccountMetaFactory(programAddress);
|
|
489
|
+
const instruction = {
|
|
573
490
|
accounts: [
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
...remainingAccounts ?? []
|
|
491
|
+
getAccountMeta(accounts.account),
|
|
492
|
+
getAccountMeta(accounts.baseAccount)
|
|
577
493
|
],
|
|
578
|
-
|
|
579
|
-
|
|
494
|
+
programAddress,
|
|
495
|
+
data: getAssignWithSeedInstructionDataEncoder().encode(
|
|
496
|
+
args
|
|
497
|
+
)
|
|
580
498
|
};
|
|
499
|
+
return instruction;
|
|
581
500
|
}
|
|
582
501
|
function parseAssignWithSeedInstruction(instruction) {
|
|
583
502
|
if (instruction.accounts.length < 2) {
|
|
@@ -599,7 +518,7 @@ function parseAssignWithSeedInstruction(instruction) {
|
|
|
599
518
|
};
|
|
600
519
|
}
|
|
601
520
|
function getAuthorizeNonceAccountInstructionDataEncoder() {
|
|
602
|
-
return
|
|
521
|
+
return transformEncoder(
|
|
603
522
|
getStructEncoder([
|
|
604
523
|
["discriminator", getU32Encoder()],
|
|
605
524
|
["newNonceAuthority", getAddressEncoder()]
|
|
@@ -620,37 +539,25 @@ function getAuthorizeNonceAccountInstructionDataCodec() {
|
|
|
620
539
|
);
|
|
621
540
|
}
|
|
622
541
|
function getAuthorizeNonceAccountInstruction(input) {
|
|
623
|
-
const programAddress =
|
|
624
|
-
const
|
|
542
|
+
const programAddress = SYSTEM_PROGRAM_ADDRESS;
|
|
543
|
+
const originalAccounts = {
|
|
625
544
|
nonceAccount: { value: input.nonceAccount ?? null, isWritable: true },
|
|
626
545
|
nonceAuthority: { value: input.nonceAuthority ?? null, isWritable: false }
|
|
627
546
|
};
|
|
547
|
+
const accounts = originalAccounts;
|
|
628
548
|
const args = { ...input };
|
|
629
|
-
const
|
|
630
|
-
|
|
631
|
-
"programId",
|
|
632
|
-
programAddress
|
|
633
|
-
);
|
|
634
|
-
const instruction = getAuthorizeNonceAccountInstructionRaw(
|
|
635
|
-
accountMetas,
|
|
636
|
-
args,
|
|
637
|
-
programAddress
|
|
638
|
-
);
|
|
639
|
-
return instruction;
|
|
640
|
-
}
|
|
641
|
-
function getAuthorizeNonceAccountInstructionRaw(accounts, args, programAddress = "11111111111111111111111111111111", remainingAccounts) {
|
|
642
|
-
return {
|
|
549
|
+
const getAccountMeta = getAccountMetaFactory(programAddress);
|
|
550
|
+
const instruction = {
|
|
643
551
|
accounts: [
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
accounts.nonceAuthority,
|
|
647
|
-
AccountRole.READONLY_SIGNER
|
|
648
|
-
),
|
|
649
|
-
...remainingAccounts ?? []
|
|
552
|
+
getAccountMeta(accounts.nonceAccount),
|
|
553
|
+
getAccountMeta(accounts.nonceAuthority)
|
|
650
554
|
],
|
|
651
|
-
|
|
652
|
-
|
|
555
|
+
programAddress,
|
|
556
|
+
data: getAuthorizeNonceAccountInstructionDataEncoder().encode(
|
|
557
|
+
args
|
|
558
|
+
)
|
|
653
559
|
};
|
|
560
|
+
return instruction;
|
|
654
561
|
}
|
|
655
562
|
function parseAuthorizeNonceAccountInstruction(instruction) {
|
|
656
563
|
if (instruction.accounts.length < 2) {
|
|
@@ -674,7 +581,7 @@ function parseAuthorizeNonceAccountInstruction(instruction) {
|
|
|
674
581
|
};
|
|
675
582
|
}
|
|
676
583
|
function getCreateAccountInstructionDataEncoder() {
|
|
677
|
-
return
|
|
584
|
+
return transformEncoder(
|
|
678
585
|
getStructEncoder([
|
|
679
586
|
["discriminator", getU32Encoder()],
|
|
680
587
|
["lamports", getU64Encoder()],
|
|
@@ -699,38 +606,29 @@ function getCreateAccountInstructionDataCodec() {
|
|
|
699
606
|
);
|
|
700
607
|
}
|
|
701
608
|
function getCreateAccountInstruction(input) {
|
|
702
|
-
const programAddress =
|
|
703
|
-
const
|
|
609
|
+
const programAddress = SYSTEM_PROGRAM_ADDRESS;
|
|
610
|
+
const originalAccounts = {
|
|
704
611
|
payer: { value: input.payer ?? null, isWritable: true },
|
|
705
612
|
newAccount: { value: input.newAccount ?? null, isWritable: true }
|
|
706
613
|
};
|
|
614
|
+
const accounts = originalAccounts;
|
|
707
615
|
const args = { ...input };
|
|
708
616
|
const byteDelta = [Number(args.space) + BASE_ACCOUNT_SIZE].reduce(
|
|
709
617
|
(a, b) => a + b,
|
|
710
618
|
0
|
|
711
619
|
);
|
|
712
|
-
const
|
|
713
|
-
|
|
714
|
-
"programId",
|
|
715
|
-
programAddress
|
|
716
|
-
);
|
|
717
|
-
const instruction = getCreateAccountInstructionRaw(
|
|
718
|
-
accountMetas,
|
|
719
|
-
args,
|
|
720
|
-
programAddress
|
|
721
|
-
);
|
|
722
|
-
return Object.freeze({ ...instruction, byteDelta });
|
|
723
|
-
}
|
|
724
|
-
function getCreateAccountInstructionRaw(accounts, args, programAddress = "11111111111111111111111111111111", remainingAccounts) {
|
|
725
|
-
return {
|
|
620
|
+
const getAccountMeta = getAccountMetaFactory(programAddress);
|
|
621
|
+
const instruction = {
|
|
726
622
|
accounts: [
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
...remainingAccounts ?? []
|
|
623
|
+
getAccountMeta(accounts.payer),
|
|
624
|
+
getAccountMeta(accounts.newAccount)
|
|
730
625
|
],
|
|
731
|
-
|
|
732
|
-
|
|
626
|
+
programAddress,
|
|
627
|
+
data: getCreateAccountInstructionDataEncoder().encode(
|
|
628
|
+
args
|
|
629
|
+
)
|
|
733
630
|
};
|
|
631
|
+
return Object.freeze({ ...instruction, byteDelta });
|
|
734
632
|
}
|
|
735
633
|
function parseCreateAccountInstruction(instruction) {
|
|
736
634
|
if (instruction.accounts.length < 2) {
|
|
@@ -752,11 +650,11 @@ function parseCreateAccountInstruction(instruction) {
|
|
|
752
650
|
};
|
|
753
651
|
}
|
|
754
652
|
function getCreateAccountWithSeedInstructionDataEncoder() {
|
|
755
|
-
return
|
|
653
|
+
return transformEncoder(
|
|
756
654
|
getStructEncoder([
|
|
757
655
|
["discriminator", getU32Encoder()],
|
|
758
656
|
["base", getAddressEncoder()],
|
|
759
|
-
["seed",
|
|
657
|
+
["seed", addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())],
|
|
760
658
|
["amount", getU64Encoder()],
|
|
761
659
|
["space", getU64Encoder()],
|
|
762
660
|
["programAddress", getAddressEncoder()]
|
|
@@ -768,7 +666,7 @@ function getCreateAccountWithSeedInstructionDataDecoder() {
|
|
|
768
666
|
return getStructDecoder([
|
|
769
667
|
["discriminator", getU32Decoder()],
|
|
770
668
|
["base", getAddressDecoder()],
|
|
771
|
-
["seed",
|
|
669
|
+
["seed", addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())],
|
|
772
670
|
["amount", getU64Decoder()],
|
|
773
671
|
["space", getU64Decoder()],
|
|
774
672
|
["programAddress", getAddressDecoder()]
|
|
@@ -781,36 +679,27 @@ function getCreateAccountWithSeedInstructionDataCodec() {
|
|
|
781
679
|
);
|
|
782
680
|
}
|
|
783
681
|
function getCreateAccountWithSeedInstruction(input) {
|
|
784
|
-
const programAddress =
|
|
785
|
-
const
|
|
682
|
+
const programAddress = SYSTEM_PROGRAM_ADDRESS;
|
|
683
|
+
const originalAccounts = {
|
|
786
684
|
payer: { value: input.payer ?? null, isWritable: true },
|
|
787
685
|
newAccount: { value: input.newAccount ?? null, isWritable: true },
|
|
788
686
|
baseAccount: { value: input.baseAccount ?? null, isWritable: false }
|
|
789
687
|
};
|
|
688
|
+
const accounts = originalAccounts;
|
|
790
689
|
const args = { ...input };
|
|
791
|
-
const
|
|
792
|
-
|
|
793
|
-
"programId",
|
|
794
|
-
programAddress
|
|
795
|
-
);
|
|
796
|
-
const instruction = getCreateAccountWithSeedInstructionRaw(
|
|
797
|
-
accountMetas,
|
|
798
|
-
args,
|
|
799
|
-
programAddress
|
|
800
|
-
);
|
|
801
|
-
return instruction;
|
|
802
|
-
}
|
|
803
|
-
function getCreateAccountWithSeedInstructionRaw(accounts, args, programAddress = "11111111111111111111111111111111", remainingAccounts) {
|
|
804
|
-
return {
|
|
690
|
+
const getAccountMeta = getAccountMetaFactory(programAddress);
|
|
691
|
+
const instruction = {
|
|
805
692
|
accounts: [
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
...remainingAccounts ?? []
|
|
693
|
+
getAccountMeta(accounts.payer),
|
|
694
|
+
getAccountMeta(accounts.newAccount),
|
|
695
|
+
getAccountMeta(accounts.baseAccount)
|
|
810
696
|
],
|
|
811
|
-
|
|
812
|
-
|
|
697
|
+
programAddress,
|
|
698
|
+
data: getCreateAccountWithSeedInstructionDataEncoder().encode(
|
|
699
|
+
args
|
|
700
|
+
)
|
|
813
701
|
};
|
|
702
|
+
return instruction;
|
|
814
703
|
}
|
|
815
704
|
function parseCreateAccountWithSeedInstruction(instruction) {
|
|
816
705
|
if (instruction.accounts.length < 3) {
|
|
@@ -835,7 +724,7 @@ function parseCreateAccountWithSeedInstruction(instruction) {
|
|
|
835
724
|
};
|
|
836
725
|
}
|
|
837
726
|
function getInitializeNonceAccountInstructionDataEncoder() {
|
|
838
|
-
return
|
|
727
|
+
return transformEncoder(
|
|
839
728
|
getStructEncoder([
|
|
840
729
|
["discriminator", getU32Encoder()],
|
|
841
730
|
["nonceAuthority", getAddressEncoder()]
|
|
@@ -856,8 +745,8 @@ function getInitializeNonceAccountInstructionDataCodec() {
|
|
|
856
745
|
);
|
|
857
746
|
}
|
|
858
747
|
function getInitializeNonceAccountInstruction(input) {
|
|
859
|
-
const programAddress =
|
|
860
|
-
const
|
|
748
|
+
const programAddress = SYSTEM_PROGRAM_ADDRESS;
|
|
749
|
+
const originalAccounts = {
|
|
861
750
|
nonceAccount: { value: input.nonceAccount ?? null, isWritable: true },
|
|
862
751
|
recentBlockhashesSysvar: {
|
|
863
752
|
value: input.recentBlockhashesSysvar ?? null,
|
|
@@ -865,6 +754,7 @@ function getInitializeNonceAccountInstruction(input) {
|
|
|
865
754
|
},
|
|
866
755
|
rentSysvar: { value: input.rentSysvar ?? null, isWritable: false }
|
|
867
756
|
};
|
|
757
|
+
const accounts = originalAccounts;
|
|
868
758
|
const args = { ...input };
|
|
869
759
|
if (!accounts.recentBlockhashesSysvar.value) {
|
|
870
760
|
accounts.recentBlockhashesSysvar.value = "SysvarRecentB1ockHashes11111111111111111111";
|
|
@@ -872,35 +762,19 @@ function getInitializeNonceAccountInstruction(input) {
|
|
|
872
762
|
if (!accounts.rentSysvar.value) {
|
|
873
763
|
accounts.rentSysvar.value = "SysvarRent111111111111111111111111111111111";
|
|
874
764
|
}
|
|
875
|
-
const
|
|
876
|
-
|
|
877
|
-
"programId",
|
|
878
|
-
programAddress
|
|
879
|
-
);
|
|
880
|
-
const instruction = getInitializeNonceAccountInstructionRaw(
|
|
881
|
-
accountMetas,
|
|
882
|
-
args,
|
|
883
|
-
programAddress
|
|
884
|
-
);
|
|
885
|
-
return instruction;
|
|
886
|
-
}
|
|
887
|
-
function getInitializeNonceAccountInstructionRaw(accounts, args, programAddress = "11111111111111111111111111111111", remainingAccounts) {
|
|
888
|
-
return {
|
|
765
|
+
const getAccountMeta = getAccountMetaFactory(programAddress);
|
|
766
|
+
const instruction = {
|
|
889
767
|
accounts: [
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
AccountRole.READONLY
|
|
894
|
-
),
|
|
895
|
-
accountMetaWithDefault(
|
|
896
|
-
accounts.rentSysvar ?? "SysvarRent111111111111111111111111111111111",
|
|
897
|
-
AccountRole.READONLY
|
|
898
|
-
),
|
|
899
|
-
...remainingAccounts ?? []
|
|
768
|
+
getAccountMeta(accounts.nonceAccount),
|
|
769
|
+
getAccountMeta(accounts.recentBlockhashesSysvar),
|
|
770
|
+
getAccountMeta(accounts.rentSysvar)
|
|
900
771
|
],
|
|
901
|
-
|
|
902
|
-
|
|
772
|
+
programAddress,
|
|
773
|
+
data: getInitializeNonceAccountInstructionDataEncoder().encode(
|
|
774
|
+
args
|
|
775
|
+
)
|
|
903
776
|
};
|
|
777
|
+
return instruction;
|
|
904
778
|
}
|
|
905
779
|
function parseInitializeNonceAccountInstruction(instruction) {
|
|
906
780
|
if (instruction.accounts.length < 3) {
|
|
@@ -925,7 +799,7 @@ function parseInitializeNonceAccountInstruction(instruction) {
|
|
|
925
799
|
};
|
|
926
800
|
}
|
|
927
801
|
function getTransferSolInstructionDataEncoder() {
|
|
928
|
-
return
|
|
802
|
+
return transformEncoder(
|
|
929
803
|
getStructEncoder([
|
|
930
804
|
["discriminator", getU32Encoder()],
|
|
931
805
|
["amount", getU64Encoder()]
|
|
@@ -946,34 +820,25 @@ function getTransferSolInstructionDataCodec() {
|
|
|
946
820
|
);
|
|
947
821
|
}
|
|
948
822
|
function getTransferSolInstruction(input) {
|
|
949
|
-
const programAddress =
|
|
950
|
-
const
|
|
823
|
+
const programAddress = SYSTEM_PROGRAM_ADDRESS;
|
|
824
|
+
const originalAccounts = {
|
|
951
825
|
source: { value: input.source ?? null, isWritable: true },
|
|
952
826
|
destination: { value: input.destination ?? null, isWritable: true }
|
|
953
827
|
};
|
|
828
|
+
const accounts = originalAccounts;
|
|
954
829
|
const args = { ...input };
|
|
955
|
-
const
|
|
956
|
-
|
|
957
|
-
"programId",
|
|
958
|
-
programAddress
|
|
959
|
-
);
|
|
960
|
-
const instruction = getTransferSolInstructionRaw(
|
|
961
|
-
accountMetas,
|
|
962
|
-
args,
|
|
963
|
-
programAddress
|
|
964
|
-
);
|
|
965
|
-
return instruction;
|
|
966
|
-
}
|
|
967
|
-
function getTransferSolInstructionRaw(accounts, args, programAddress = "11111111111111111111111111111111", remainingAccounts) {
|
|
968
|
-
return {
|
|
830
|
+
const getAccountMeta = getAccountMetaFactory(programAddress);
|
|
831
|
+
const instruction = {
|
|
969
832
|
accounts: [
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
...remainingAccounts ?? []
|
|
833
|
+
getAccountMeta(accounts.source),
|
|
834
|
+
getAccountMeta(accounts.destination)
|
|
973
835
|
],
|
|
974
|
-
|
|
975
|
-
|
|
836
|
+
programAddress,
|
|
837
|
+
data: getTransferSolInstructionDataEncoder().encode(
|
|
838
|
+
args
|
|
839
|
+
)
|
|
976
840
|
};
|
|
841
|
+
return instruction;
|
|
977
842
|
}
|
|
978
843
|
function parseTransferSolInstruction(instruction) {
|
|
979
844
|
if (instruction.accounts.length < 2) {
|
|
@@ -995,11 +860,11 @@ function parseTransferSolInstruction(instruction) {
|
|
|
995
860
|
};
|
|
996
861
|
}
|
|
997
862
|
function getTransferSolWithSeedInstructionDataEncoder() {
|
|
998
|
-
return
|
|
863
|
+
return transformEncoder(
|
|
999
864
|
getStructEncoder([
|
|
1000
865
|
["discriminator", getU32Encoder()],
|
|
1001
866
|
["amount", getU64Encoder()],
|
|
1002
|
-
["fromSeed",
|
|
867
|
+
["fromSeed", addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())],
|
|
1003
868
|
["fromOwner", getAddressEncoder()]
|
|
1004
869
|
]),
|
|
1005
870
|
(value) => ({ ...value, discriminator: 11 })
|
|
@@ -1009,7 +874,7 @@ function getTransferSolWithSeedInstructionDataDecoder() {
|
|
|
1009
874
|
return getStructDecoder([
|
|
1010
875
|
["discriminator", getU32Decoder()],
|
|
1011
876
|
["amount", getU64Decoder()],
|
|
1012
|
-
["fromSeed",
|
|
877
|
+
["fromSeed", addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())],
|
|
1013
878
|
["fromOwner", getAddressDecoder()]
|
|
1014
879
|
]);
|
|
1015
880
|
}
|
|
@@ -1020,36 +885,27 @@ function getTransferSolWithSeedInstructionDataCodec() {
|
|
|
1020
885
|
);
|
|
1021
886
|
}
|
|
1022
887
|
function getTransferSolWithSeedInstruction(input) {
|
|
1023
|
-
const programAddress =
|
|
1024
|
-
const
|
|
888
|
+
const programAddress = SYSTEM_PROGRAM_ADDRESS;
|
|
889
|
+
const originalAccounts = {
|
|
1025
890
|
source: { value: input.source ?? null, isWritable: true },
|
|
1026
891
|
baseAccount: { value: input.baseAccount ?? null, isWritable: false },
|
|
1027
892
|
destination: { value: input.destination ?? null, isWritable: true }
|
|
1028
893
|
};
|
|
894
|
+
const accounts = originalAccounts;
|
|
1029
895
|
const args = { ...input };
|
|
1030
|
-
const
|
|
1031
|
-
|
|
1032
|
-
"programId",
|
|
1033
|
-
programAddress
|
|
1034
|
-
);
|
|
1035
|
-
const instruction = getTransferSolWithSeedInstructionRaw(
|
|
1036
|
-
accountMetas,
|
|
1037
|
-
args,
|
|
1038
|
-
programAddress
|
|
1039
|
-
);
|
|
1040
|
-
return instruction;
|
|
1041
|
-
}
|
|
1042
|
-
function getTransferSolWithSeedInstructionRaw(accounts, args, programAddress = "11111111111111111111111111111111", remainingAccounts) {
|
|
1043
|
-
return {
|
|
896
|
+
const getAccountMeta = getAccountMetaFactory(programAddress);
|
|
897
|
+
const instruction = {
|
|
1044
898
|
accounts: [
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
...remainingAccounts ?? []
|
|
899
|
+
getAccountMeta(accounts.source),
|
|
900
|
+
getAccountMeta(accounts.baseAccount),
|
|
901
|
+
getAccountMeta(accounts.destination)
|
|
1049
902
|
],
|
|
1050
|
-
|
|
1051
|
-
|
|
903
|
+
programAddress,
|
|
904
|
+
data: getTransferSolWithSeedInstructionDataEncoder().encode(
|
|
905
|
+
args
|
|
906
|
+
)
|
|
1052
907
|
};
|
|
908
|
+
return instruction;
|
|
1053
909
|
}
|
|
1054
910
|
function parseTransferSolWithSeedInstruction(instruction) {
|
|
1055
911
|
if (instruction.accounts.length < 3) {
|
|
@@ -1074,7 +930,7 @@ function parseTransferSolWithSeedInstruction(instruction) {
|
|
|
1074
930
|
};
|
|
1075
931
|
}
|
|
1076
932
|
function getUpgradeNonceAccountInstructionDataEncoder() {
|
|
1077
|
-
return
|
|
933
|
+
return transformEncoder(
|
|
1078
934
|
getStructEncoder([["discriminator", getU32Encoder()]]),
|
|
1079
935
|
(value) => ({ ...value, discriminator: 12 })
|
|
1080
936
|
);
|
|
@@ -1089,30 +945,18 @@ function getUpgradeNonceAccountInstructionDataCodec() {
|
|
|
1089
945
|
);
|
|
1090
946
|
}
|
|
1091
947
|
function getUpgradeNonceAccountInstruction(input) {
|
|
1092
|
-
const programAddress =
|
|
1093
|
-
const
|
|
948
|
+
const programAddress = SYSTEM_PROGRAM_ADDRESS;
|
|
949
|
+
const originalAccounts = {
|
|
1094
950
|
nonceAccount: { value: input.nonceAccount ?? null, isWritable: true }
|
|
1095
951
|
};
|
|
1096
|
-
const
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
accountMetas,
|
|
1103
|
-
programAddress
|
|
1104
|
-
);
|
|
1105
|
-
return instruction;
|
|
1106
|
-
}
|
|
1107
|
-
function getUpgradeNonceAccountInstructionRaw(accounts, programAddress = "11111111111111111111111111111111", remainingAccounts) {
|
|
1108
|
-
return {
|
|
1109
|
-
accounts: [
|
|
1110
|
-
accountMetaWithDefault(accounts.nonceAccount, AccountRole.WRITABLE),
|
|
1111
|
-
...remainingAccounts ?? []
|
|
1112
|
-
],
|
|
1113
|
-
data: getUpgradeNonceAccountInstructionDataEncoder().encode({}),
|
|
1114
|
-
programAddress
|
|
952
|
+
const accounts = originalAccounts;
|
|
953
|
+
const getAccountMeta = getAccountMetaFactory(programAddress);
|
|
954
|
+
const instruction = {
|
|
955
|
+
accounts: [getAccountMeta(accounts.nonceAccount)],
|
|
956
|
+
programAddress,
|
|
957
|
+
data: getUpgradeNonceAccountInstructionDataEncoder().encode({})
|
|
1115
958
|
};
|
|
959
|
+
return instruction;
|
|
1116
960
|
}
|
|
1117
961
|
function parseUpgradeNonceAccountInstruction(instruction) {
|
|
1118
962
|
if (instruction.accounts.length < 1) {
|
|
@@ -1135,7 +979,7 @@ function parseUpgradeNonceAccountInstruction(instruction) {
|
|
|
1135
979
|
};
|
|
1136
980
|
}
|
|
1137
981
|
function getWithdrawNonceAccountInstructionDataEncoder() {
|
|
1138
|
-
return
|
|
982
|
+
return transformEncoder(
|
|
1139
983
|
getStructEncoder([
|
|
1140
984
|
["discriminator", getU32Encoder()],
|
|
1141
985
|
["withdrawAmount", getU64Encoder()]
|
|
@@ -1156,8 +1000,8 @@ function getWithdrawNonceAccountInstructionDataCodec() {
|
|
|
1156
1000
|
);
|
|
1157
1001
|
}
|
|
1158
1002
|
function getWithdrawNonceAccountInstruction(input) {
|
|
1159
|
-
const programAddress =
|
|
1160
|
-
const
|
|
1003
|
+
const programAddress = SYSTEM_PROGRAM_ADDRESS;
|
|
1004
|
+
const originalAccounts = {
|
|
1161
1005
|
nonceAccount: { value: input.nonceAccount ?? null, isWritable: true },
|
|
1162
1006
|
recipientAccount: {
|
|
1163
1007
|
value: input.recipientAccount ?? null,
|
|
@@ -1170,6 +1014,7 @@ function getWithdrawNonceAccountInstruction(input) {
|
|
|
1170
1014
|
rentSysvar: { value: input.rentSysvar ?? null, isWritable: false },
|
|
1171
1015
|
nonceAuthority: { value: input.nonceAuthority ?? null, isWritable: false }
|
|
1172
1016
|
};
|
|
1017
|
+
const accounts = originalAccounts;
|
|
1173
1018
|
const args = { ...input };
|
|
1174
1019
|
if (!accounts.recentBlockhashesSysvar.value) {
|
|
1175
1020
|
accounts.recentBlockhashesSysvar.value = "SysvarRecentB1ockHashes11111111111111111111";
|
|
@@ -1177,40 +1022,21 @@ function getWithdrawNonceAccountInstruction(input) {
|
|
|
1177
1022
|
if (!accounts.rentSysvar.value) {
|
|
1178
1023
|
accounts.rentSysvar.value = "SysvarRent111111111111111111111111111111111";
|
|
1179
1024
|
}
|
|
1180
|
-
const
|
|
1181
|
-
|
|
1182
|
-
"programId",
|
|
1183
|
-
programAddress
|
|
1184
|
-
);
|
|
1185
|
-
const instruction = getWithdrawNonceAccountInstructionRaw(
|
|
1186
|
-
accountMetas,
|
|
1187
|
-
args,
|
|
1188
|
-
programAddress
|
|
1189
|
-
);
|
|
1190
|
-
return instruction;
|
|
1191
|
-
}
|
|
1192
|
-
function getWithdrawNonceAccountInstructionRaw(accounts, args, programAddress = "11111111111111111111111111111111", remainingAccounts) {
|
|
1193
|
-
return {
|
|
1025
|
+
const getAccountMeta = getAccountMetaFactory(programAddress);
|
|
1026
|
+
const instruction = {
|
|
1194
1027
|
accounts: [
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
),
|
|
1201
|
-
accountMetaWithDefault(
|
|
1202
|
-
accounts.rentSysvar ?? "SysvarRent111111111111111111111111111111111",
|
|
1203
|
-
AccountRole.READONLY
|
|
1204
|
-
),
|
|
1205
|
-
accountMetaWithDefault(
|
|
1206
|
-
accounts.nonceAuthority,
|
|
1207
|
-
AccountRole.READONLY_SIGNER
|
|
1208
|
-
),
|
|
1209
|
-
...remainingAccounts ?? []
|
|
1028
|
+
getAccountMeta(accounts.nonceAccount),
|
|
1029
|
+
getAccountMeta(accounts.recipientAccount),
|
|
1030
|
+
getAccountMeta(accounts.recentBlockhashesSysvar),
|
|
1031
|
+
getAccountMeta(accounts.rentSysvar),
|
|
1032
|
+
getAccountMeta(accounts.nonceAuthority)
|
|
1210
1033
|
],
|
|
1211
|
-
|
|
1212
|
-
|
|
1034
|
+
programAddress,
|
|
1035
|
+
data: getWithdrawNonceAccountInstructionDataEncoder().encode(
|
|
1036
|
+
args
|
|
1037
|
+
)
|
|
1213
1038
|
};
|
|
1039
|
+
return instruction;
|
|
1214
1040
|
}
|
|
1215
1041
|
function parseWithdrawNonceAccountInstruction(instruction) {
|
|
1216
1042
|
if (instruction.accounts.length < 5) {
|
|
@@ -1236,82 +1062,7 @@ function parseWithdrawNonceAccountInstruction(instruction) {
|
|
|
1236
1062
|
)
|
|
1237
1063
|
};
|
|
1238
1064
|
}
|
|
1239
|
-
var SYSTEM_PROGRAM_ADDRESS = "11111111111111111111111111111111";
|
|
1240
|
-
function getSystemProgram() {
|
|
1241
|
-
return {
|
|
1242
|
-
name: "system",
|
|
1243
|
-
address: SYSTEM_PROGRAM_ADDRESS,
|
|
1244
|
-
getErrorFromCode(code, cause) {
|
|
1245
|
-
return getSystemProgramErrorFromCode(code, cause);
|
|
1246
|
-
}
|
|
1247
|
-
};
|
|
1248
|
-
}
|
|
1249
|
-
var SystemAccount = /* @__PURE__ */ ((SystemAccount2) => {
|
|
1250
|
-
SystemAccount2[SystemAccount2["Nonce"] = 0] = "Nonce";
|
|
1251
|
-
return SystemAccount2;
|
|
1252
|
-
})(SystemAccount || {});
|
|
1253
|
-
var SystemInstruction = /* @__PURE__ */ ((SystemInstruction2) => {
|
|
1254
|
-
SystemInstruction2[SystemInstruction2["CreateAccount"] = 0] = "CreateAccount";
|
|
1255
|
-
SystemInstruction2[SystemInstruction2["Assign"] = 1] = "Assign";
|
|
1256
|
-
SystemInstruction2[SystemInstruction2["TransferSol"] = 2] = "TransferSol";
|
|
1257
|
-
SystemInstruction2[SystemInstruction2["CreateAccountWithSeed"] = 3] = "CreateAccountWithSeed";
|
|
1258
|
-
SystemInstruction2[SystemInstruction2["AdvanceNonceAccount"] = 4] = "AdvanceNonceAccount";
|
|
1259
|
-
SystemInstruction2[SystemInstruction2["WithdrawNonceAccount"] = 5] = "WithdrawNonceAccount";
|
|
1260
|
-
SystemInstruction2[SystemInstruction2["InitializeNonceAccount"] = 6] = "InitializeNonceAccount";
|
|
1261
|
-
SystemInstruction2[SystemInstruction2["AuthorizeNonceAccount"] = 7] = "AuthorizeNonceAccount";
|
|
1262
|
-
SystemInstruction2[SystemInstruction2["Allocate"] = 8] = "Allocate";
|
|
1263
|
-
SystemInstruction2[SystemInstruction2["AllocateWithSeed"] = 9] = "AllocateWithSeed";
|
|
1264
|
-
SystemInstruction2[SystemInstruction2["AssignWithSeed"] = 10] = "AssignWithSeed";
|
|
1265
|
-
SystemInstruction2[SystemInstruction2["TransferSolWithSeed"] = 11] = "TransferSolWithSeed";
|
|
1266
|
-
SystemInstruction2[SystemInstruction2["UpgradeNonceAccount"] = 12] = "UpgradeNonceAccount";
|
|
1267
|
-
return SystemInstruction2;
|
|
1268
|
-
})(SystemInstruction || {});
|
|
1269
|
-
function identifySystemInstruction(instruction) {
|
|
1270
|
-
const data = instruction instanceof Uint8Array ? instruction : instruction.data;
|
|
1271
|
-
if (memcmp(data, getU32Encoder().encode(0), 0)) {
|
|
1272
|
-
return 0 /* CreateAccount */;
|
|
1273
|
-
}
|
|
1274
|
-
if (memcmp(data, getU32Encoder().encode(1), 0)) {
|
|
1275
|
-
return 1 /* Assign */;
|
|
1276
|
-
}
|
|
1277
|
-
if (memcmp(data, getU32Encoder().encode(2), 0)) {
|
|
1278
|
-
return 2 /* TransferSol */;
|
|
1279
|
-
}
|
|
1280
|
-
if (memcmp(data, getU32Encoder().encode(3), 0)) {
|
|
1281
|
-
return 3 /* CreateAccountWithSeed */;
|
|
1282
|
-
}
|
|
1283
|
-
if (memcmp(data, getU32Encoder().encode(4), 0)) {
|
|
1284
|
-
return 4 /* AdvanceNonceAccount */;
|
|
1285
|
-
}
|
|
1286
|
-
if (memcmp(data, getU32Encoder().encode(5), 0)) {
|
|
1287
|
-
return 5 /* WithdrawNonceAccount */;
|
|
1288
|
-
}
|
|
1289
|
-
if (memcmp(data, getU32Encoder().encode(6), 0)) {
|
|
1290
|
-
return 6 /* InitializeNonceAccount */;
|
|
1291
|
-
}
|
|
1292
|
-
if (memcmp(data, getU32Encoder().encode(7), 0)) {
|
|
1293
|
-
return 7 /* AuthorizeNonceAccount */;
|
|
1294
|
-
}
|
|
1295
|
-
if (memcmp(data, getU32Encoder().encode(8), 0)) {
|
|
1296
|
-
return 8 /* Allocate */;
|
|
1297
|
-
}
|
|
1298
|
-
if (memcmp(data, getU32Encoder().encode(9), 0)) {
|
|
1299
|
-
return 9 /* AllocateWithSeed */;
|
|
1300
|
-
}
|
|
1301
|
-
if (memcmp(data, getU32Encoder().encode(10), 0)) {
|
|
1302
|
-
return 10 /* AssignWithSeed */;
|
|
1303
|
-
}
|
|
1304
|
-
if (memcmp(data, getU32Encoder().encode(11), 0)) {
|
|
1305
|
-
return 11 /* TransferSolWithSeed */;
|
|
1306
|
-
}
|
|
1307
|
-
if (memcmp(data, getU32Encoder().encode(12), 0)) {
|
|
1308
|
-
return 12 /* UpgradeNonceAccount */;
|
|
1309
|
-
}
|
|
1310
|
-
throw new Error(
|
|
1311
|
-
"The provided instruction could not be identified as a system instruction."
|
|
1312
|
-
);
|
|
1313
|
-
}
|
|
1314
1065
|
|
|
1315
|
-
export { NonceState, NonceVersion,
|
|
1066
|
+
export { NonceState, NonceVersion, SYSTEM_ERROR__ACCOUNT_ALREADY_IN_USE, SYSTEM_ERROR__ADDRESS_WITH_SEED_MISMATCH, SYSTEM_ERROR__INVALID_ACCOUNT_DATA_LENGTH, SYSTEM_ERROR__INVALID_PROGRAM_ID, SYSTEM_ERROR__MAX_SEED_LENGTH_EXCEEDED, SYSTEM_ERROR__NONCE_BLOCKHASH_NOT_EXPIRED, SYSTEM_ERROR__NONCE_NO_RECENT_BLOCKHASHES, SYSTEM_ERROR__NONCE_UNEXPECTED_BLOCKHASH_VALUE, SYSTEM_ERROR__RESULT_WITH_NEGATIVE_LAMPORTS, SYSTEM_PROGRAM_ADDRESS, SystemAccount, SystemInstruction, decodeNonce, fetchAllMaybeNonce, fetchAllNonce, fetchMaybeNonce, fetchNonce, getAdvanceNonceAccountInstruction, getAdvanceNonceAccountInstructionDataCodec, getAdvanceNonceAccountInstructionDataDecoder, getAdvanceNonceAccountInstructionDataEncoder, getAllocateInstruction, getAllocateInstructionDataCodec, getAllocateInstructionDataDecoder, getAllocateInstructionDataEncoder, getAllocateWithSeedInstruction, getAllocateWithSeedInstructionDataCodec, getAllocateWithSeedInstructionDataDecoder, getAllocateWithSeedInstructionDataEncoder, getAssignInstruction, getAssignInstructionDataCodec, getAssignInstructionDataDecoder, getAssignInstructionDataEncoder, getAssignWithSeedInstruction, getAssignWithSeedInstructionDataCodec, getAssignWithSeedInstructionDataDecoder, getAssignWithSeedInstructionDataEncoder, getAuthorizeNonceAccountInstruction, getAuthorizeNonceAccountInstructionDataCodec, getAuthorizeNonceAccountInstructionDataDecoder, getAuthorizeNonceAccountInstructionDataEncoder, getCreateAccountInstruction, getCreateAccountInstructionDataCodec, getCreateAccountInstructionDataDecoder, getCreateAccountInstructionDataEncoder, getCreateAccountWithSeedInstruction, getCreateAccountWithSeedInstructionDataCodec, getCreateAccountWithSeedInstructionDataDecoder, getCreateAccountWithSeedInstructionDataEncoder, getInitializeNonceAccountInstruction, getInitializeNonceAccountInstructionDataCodec, getInitializeNonceAccountInstructionDataDecoder, getInitializeNonceAccountInstructionDataEncoder, getNonceCodec, getNonceDecoder, getNonceEncoder, getNonceSize, getNonceStateCodec, getNonceStateDecoder, getNonceStateEncoder, getNonceVersionCodec, getNonceVersionDecoder, getNonceVersionEncoder, getSystemErrorMessage, getTransferSolInstruction, getTransferSolInstructionDataCodec, getTransferSolInstructionDataDecoder, getTransferSolInstructionDataEncoder, getTransferSolWithSeedInstruction, getTransferSolWithSeedInstructionDataCodec, getTransferSolWithSeedInstructionDataDecoder, getTransferSolWithSeedInstructionDataEncoder, getUpgradeNonceAccountInstruction, getUpgradeNonceAccountInstructionDataCodec, getUpgradeNonceAccountInstructionDataDecoder, getUpgradeNonceAccountInstructionDataEncoder, getWithdrawNonceAccountInstruction, getWithdrawNonceAccountInstructionDataCodec, getWithdrawNonceAccountInstructionDataDecoder, getWithdrawNonceAccountInstructionDataEncoder, identifySystemInstruction, parseAdvanceNonceAccountInstruction, parseAllocateInstruction, parseAllocateWithSeedInstruction, parseAssignInstruction, parseAssignWithSeedInstruction, parseAuthorizeNonceAccountInstruction, parseCreateAccountInstruction, parseCreateAccountWithSeedInstruction, parseInitializeNonceAccountInstruction, parseTransferSolInstruction, parseTransferSolWithSeedInstruction, parseUpgradeNonceAccountInstruction, parseWithdrawNonceAccountInstruction };
|
|
1316
1067
|
//# sourceMappingURL=out.js.map
|
|
1317
1068
|
//# sourceMappingURL=index.js.map
|