@solana-program/system 0.6.2 → 0.8.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.
Files changed (43) hide show
  1. package/dist/src/index.js +175 -175
  2. package/dist/src/index.js.map +1 -1
  3. package/dist/src/index.mjs +1 -1
  4. package/dist/src/index.mjs.map +1 -1
  5. package/dist/types/generated/accounts/nonce.d.ts +4 -4
  6. package/dist/types/generated/accounts/nonce.d.ts.map +1 -1
  7. package/dist/types/generated/errors/system.d.ts +1 -1
  8. package/dist/types/generated/errors/system.d.ts.map +1 -1
  9. package/dist/types/generated/instructions/advanceNonceAccount.d.ts +9 -9
  10. package/dist/types/generated/instructions/advanceNonceAccount.d.ts.map +1 -1
  11. package/dist/types/generated/instructions/allocate.d.ts +9 -9
  12. package/dist/types/generated/instructions/allocate.d.ts.map +1 -1
  13. package/dist/types/generated/instructions/allocateWithSeed.d.ts +6 -6
  14. package/dist/types/generated/instructions/allocateWithSeed.d.ts.map +1 -1
  15. package/dist/types/generated/instructions/assign.d.ts +9 -9
  16. package/dist/types/generated/instructions/assign.d.ts.map +1 -1
  17. package/dist/types/generated/instructions/assignWithSeed.d.ts +6 -6
  18. package/dist/types/generated/instructions/assignWithSeed.d.ts.map +1 -1
  19. package/dist/types/generated/instructions/authorizeNonceAccount.d.ts +9 -9
  20. package/dist/types/generated/instructions/authorizeNonceAccount.d.ts.map +1 -1
  21. package/dist/types/generated/instructions/createAccount.d.ts +12 -12
  22. package/dist/types/generated/instructions/createAccount.d.ts.map +1 -1
  23. package/dist/types/generated/instructions/createAccountWithSeed.d.ts +7 -7
  24. package/dist/types/generated/instructions/createAccountWithSeed.d.ts.map +1 -1
  25. package/dist/types/generated/instructions/initializeNonceAccount.d.ts +8 -8
  26. package/dist/types/generated/instructions/initializeNonceAccount.d.ts.map +1 -1
  27. package/dist/types/generated/instructions/transferSol.d.ts +9 -9
  28. package/dist/types/generated/instructions/transferSol.d.ts.map +1 -1
  29. package/dist/types/generated/instructions/transferSolWithSeed.d.ts +6 -6
  30. package/dist/types/generated/instructions/transferSolWithSeed.d.ts.map +1 -1
  31. package/dist/types/generated/instructions/upgradeNonceAccount.d.ts +8 -8
  32. package/dist/types/generated/instructions/upgradeNonceAccount.d.ts.map +1 -1
  33. package/dist/types/generated/instructions/withdrawNonceAccount.d.ts +9 -9
  34. package/dist/types/generated/instructions/withdrawNonceAccount.d.ts.map +1 -1
  35. package/dist/types/generated/programs/system.d.ts +1 -1
  36. package/dist/types/generated/programs/system.d.ts.map +1 -1
  37. package/dist/types/generated/shared/index.d.ts +3 -3
  38. package/dist/types/generated/shared/index.d.ts.map +1 -1
  39. package/dist/types/generated/types/nonceState.d.ts +4 -4
  40. package/dist/types/generated/types/nonceState.d.ts.map +1 -1
  41. package/dist/types/generated/types/nonceVersion.d.ts +4 -4
  42. package/dist/types/generated/types/nonceVersion.d.ts.map +1 -1
  43. package/package.json +4 -4
package/dist/src/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var web3_js = require('@solana/web3.js');
3
+ var kit = require('@solana/kit');
4
4
 
5
5
  // src/generated/accounts/nonce.ts
6
6
  var NonceState = /* @__PURE__ */ ((NonceState2) => {
@@ -9,13 +9,13 @@ var NonceState = /* @__PURE__ */ ((NonceState2) => {
9
9
  return NonceState2;
10
10
  })(NonceState || {});
11
11
  function getNonceStateEncoder() {
12
- return web3_js.getEnumEncoder(NonceState, { size: web3_js.getU32Encoder() });
12
+ return kit.getEnumEncoder(NonceState, { size: kit.getU32Encoder() });
13
13
  }
14
14
  function getNonceStateDecoder() {
15
- return web3_js.getEnumDecoder(NonceState, { size: web3_js.getU32Decoder() });
15
+ return kit.getEnumDecoder(NonceState, { size: kit.getU32Decoder() });
16
16
  }
17
17
  function getNonceStateCodec() {
18
- return web3_js.combineCodec(getNonceStateEncoder(), getNonceStateDecoder());
18
+ return kit.combineCodec(getNonceStateEncoder(), getNonceStateDecoder());
19
19
  }
20
20
  var NonceVersion = /* @__PURE__ */ ((NonceVersion2) => {
21
21
  NonceVersion2[NonceVersion2["Legacy"] = 0] = "Legacy";
@@ -23,59 +23,59 @@ var NonceVersion = /* @__PURE__ */ ((NonceVersion2) => {
23
23
  return NonceVersion2;
24
24
  })(NonceVersion || {});
25
25
  function getNonceVersionEncoder() {
26
- return web3_js.getEnumEncoder(NonceVersion, { size: web3_js.getU32Encoder() });
26
+ return kit.getEnumEncoder(NonceVersion, { size: kit.getU32Encoder() });
27
27
  }
28
28
  function getNonceVersionDecoder() {
29
- return web3_js.getEnumDecoder(NonceVersion, { size: web3_js.getU32Decoder() });
29
+ return kit.getEnumDecoder(NonceVersion, { size: kit.getU32Decoder() });
30
30
  }
31
31
  function getNonceVersionCodec() {
32
- return web3_js.combineCodec(getNonceVersionEncoder(), getNonceVersionDecoder());
32
+ return kit.combineCodec(getNonceVersionEncoder(), getNonceVersionDecoder());
33
33
  }
34
34
 
35
35
  // src/generated/accounts/nonce.ts
36
36
  function getNonceEncoder() {
37
- return web3_js.getStructEncoder([
37
+ return kit.getStructEncoder([
38
38
  ["version", getNonceVersionEncoder()],
39
39
  ["state", getNonceStateEncoder()],
40
- ["authority", web3_js.getAddressEncoder()],
41
- ["blockhash", web3_js.getAddressEncoder()],
42
- ["lamportsPerSignature", web3_js.getU64Encoder()]
40
+ ["authority", kit.getAddressEncoder()],
41
+ ["blockhash", kit.getAddressEncoder()],
42
+ ["lamportsPerSignature", kit.getU64Encoder()]
43
43
  ]);
44
44
  }
45
45
  function getNonceDecoder() {
46
- return web3_js.getStructDecoder([
46
+ return kit.getStructDecoder([
47
47
  ["version", getNonceVersionDecoder()],
48
48
  ["state", getNonceStateDecoder()],
49
- ["authority", web3_js.getAddressDecoder()],
50
- ["blockhash", web3_js.getAddressDecoder()],
51
- ["lamportsPerSignature", web3_js.getU64Decoder()]
49
+ ["authority", kit.getAddressDecoder()],
50
+ ["blockhash", kit.getAddressDecoder()],
51
+ ["lamportsPerSignature", kit.getU64Decoder()]
52
52
  ]);
53
53
  }
54
54
  function getNonceCodec() {
55
- return web3_js.combineCodec(getNonceEncoder(), getNonceDecoder());
55
+ return kit.combineCodec(getNonceEncoder(), getNonceDecoder());
56
56
  }
57
57
  function decodeNonce(encodedAccount) {
58
- return web3_js.decodeAccount(
58
+ return kit.decodeAccount(
59
59
  encodedAccount,
60
60
  getNonceDecoder()
61
61
  );
62
62
  }
63
63
  async function fetchNonce(rpc, address, config) {
64
64
  const maybeAccount = await fetchMaybeNonce(rpc, address, config);
65
- web3_js.assertAccountExists(maybeAccount);
65
+ kit.assertAccountExists(maybeAccount);
66
66
  return maybeAccount;
67
67
  }
68
68
  async function fetchMaybeNonce(rpc, address, config) {
69
- const maybeAccount = await web3_js.fetchEncodedAccount(rpc, address, config);
69
+ const maybeAccount = await kit.fetchEncodedAccount(rpc, address, config);
70
70
  return decodeNonce(maybeAccount);
71
71
  }
72
72
  async function fetchAllNonce(rpc, addresses, config) {
73
73
  const maybeAccounts = await fetchAllMaybeNonce(rpc, addresses, config);
74
- web3_js.assertAccountsExist(maybeAccounts);
74
+ kit.assertAccountsExist(maybeAccounts);
75
75
  return maybeAccounts;
76
76
  }
77
77
  async function fetchAllMaybeNonce(rpc, addresses, config) {
78
- const maybeAccounts = await web3_js.fetchEncodedAccounts(rpc, addresses, config);
78
+ const maybeAccounts = await kit.fetchEncodedAccounts(rpc, addresses, config);
79
79
  return maybeAccounts.map((maybeAccount) => decodeNonce(maybeAccount));
80
80
  }
81
81
  function getNonceSize() {
@@ -104,43 +104,43 @@ var SystemInstruction = /* @__PURE__ */ ((SystemInstruction2) => {
104
104
  })(SystemInstruction || {});
105
105
  function identifySystemInstruction(instruction) {
106
106
  const data = "data" in instruction ? instruction.data : instruction;
107
- if (web3_js.containsBytes(data, web3_js.getU32Encoder().encode(0), 0)) {
107
+ if (kit.containsBytes(data, kit.getU32Encoder().encode(0), 0)) {
108
108
  return 0 /* CreateAccount */;
109
109
  }
110
- if (web3_js.containsBytes(data, web3_js.getU32Encoder().encode(1), 0)) {
110
+ if (kit.containsBytes(data, kit.getU32Encoder().encode(1), 0)) {
111
111
  return 1 /* Assign */;
112
112
  }
113
- if (web3_js.containsBytes(data, web3_js.getU32Encoder().encode(2), 0)) {
113
+ if (kit.containsBytes(data, kit.getU32Encoder().encode(2), 0)) {
114
114
  return 2 /* TransferSol */;
115
115
  }
116
- if (web3_js.containsBytes(data, web3_js.getU32Encoder().encode(3), 0)) {
116
+ if (kit.containsBytes(data, kit.getU32Encoder().encode(3), 0)) {
117
117
  return 3 /* CreateAccountWithSeed */;
118
118
  }
119
- if (web3_js.containsBytes(data, web3_js.getU32Encoder().encode(4), 0)) {
119
+ if (kit.containsBytes(data, kit.getU32Encoder().encode(4), 0)) {
120
120
  return 4 /* AdvanceNonceAccount */;
121
121
  }
122
- if (web3_js.containsBytes(data, web3_js.getU32Encoder().encode(5), 0)) {
122
+ if (kit.containsBytes(data, kit.getU32Encoder().encode(5), 0)) {
123
123
  return 5 /* WithdrawNonceAccount */;
124
124
  }
125
- if (web3_js.containsBytes(data, web3_js.getU32Encoder().encode(6), 0)) {
125
+ if (kit.containsBytes(data, kit.getU32Encoder().encode(6), 0)) {
126
126
  return 6 /* InitializeNonceAccount */;
127
127
  }
128
- if (web3_js.containsBytes(data, web3_js.getU32Encoder().encode(7), 0)) {
128
+ if (kit.containsBytes(data, kit.getU32Encoder().encode(7), 0)) {
129
129
  return 7 /* AuthorizeNonceAccount */;
130
130
  }
131
- if (web3_js.containsBytes(data, web3_js.getU32Encoder().encode(8), 0)) {
131
+ if (kit.containsBytes(data, kit.getU32Encoder().encode(8), 0)) {
132
132
  return 8 /* Allocate */;
133
133
  }
134
- if (web3_js.containsBytes(data, web3_js.getU32Encoder().encode(9), 0)) {
134
+ if (kit.containsBytes(data, kit.getU32Encoder().encode(9), 0)) {
135
135
  return 9 /* AllocateWithSeed */;
136
136
  }
137
- if (web3_js.containsBytes(data, web3_js.getU32Encoder().encode(10), 0)) {
137
+ if (kit.containsBytes(data, kit.getU32Encoder().encode(10), 0)) {
138
138
  return 10 /* AssignWithSeed */;
139
139
  }
140
- if (web3_js.containsBytes(data, web3_js.getU32Encoder().encode(11), 0)) {
140
+ if (kit.containsBytes(data, kit.getU32Encoder().encode(11), 0)) {
141
141
  return 11 /* TransferSolWithSeed */;
142
142
  }
143
- if (web3_js.containsBytes(data, web3_js.getU32Encoder().encode(12), 0)) {
143
+ if (kit.containsBytes(data, kit.getU32Encoder().encode(12), 0)) {
144
144
  return 12 /* UpgradeNonceAccount */;
145
145
  }
146
146
  throw new Error(
@@ -179,7 +179,7 @@ function getSystemErrorMessage(code) {
179
179
  return "Error message not available in production bundles.";
180
180
  }
181
181
  function isSystemError(error, transactionMessage, code) {
182
- return web3_js.isProgramError(
182
+ return kit.isProgramError(
183
183
  error,
184
184
  transactionMessage,
185
185
  SYSTEM_PROGRAM_ADDRESS,
@@ -203,29 +203,29 @@ function getAccountMetaFactory(programAddress, optionalAccountStrategy) {
203
203
  if (!account.value) {
204
204
  return Object.freeze({
205
205
  address: programAddress,
206
- role: web3_js.AccountRole.READONLY
206
+ role: kit.AccountRole.READONLY
207
207
  });
208
208
  }
209
- const writableRole = account.isWritable ? web3_js.AccountRole.WRITABLE : web3_js.AccountRole.READONLY;
209
+ const writableRole = account.isWritable ? kit.AccountRole.WRITABLE : kit.AccountRole.READONLY;
210
210
  return Object.freeze({
211
211
  address: expectAddress(account.value),
212
- role: isTransactionSigner(account.value) ? web3_js.upgradeRoleToSigner(writableRole) : writableRole,
212
+ role: isTransactionSigner(account.value) ? kit.upgradeRoleToSigner(writableRole) : writableRole,
213
213
  ...isTransactionSigner(account.value) ? { signer: account.value } : {}
214
214
  });
215
215
  };
216
216
  }
217
217
  function isTransactionSigner(value) {
218
- return !!value && typeof value === "object" && "address" in value && web3_js.isTransactionSigner(value);
218
+ return !!value && typeof value === "object" && "address" in value && kit.isTransactionSigner(value);
219
219
  }
220
220
 
221
221
  // src/generated/instructions/advanceNonceAccount.ts
222
222
  var ADVANCE_NONCE_ACCOUNT_DISCRIMINATOR = 4;
223
223
  function getAdvanceNonceAccountDiscriminatorBytes() {
224
- return web3_js.getU32Encoder().encode(ADVANCE_NONCE_ACCOUNT_DISCRIMINATOR);
224
+ return kit.getU32Encoder().encode(ADVANCE_NONCE_ACCOUNT_DISCRIMINATOR);
225
225
  }
226
226
  function getAdvanceNonceAccountInstructionDataEncoder() {
227
- return web3_js.transformEncoder(
228
- web3_js.getStructEncoder([["discriminator", web3_js.getU32Encoder()]]),
227
+ return kit.transformEncoder(
228
+ kit.getStructEncoder([["discriminator", kit.getU32Encoder()]]),
229
229
  (value) => ({
230
230
  ...value,
231
231
  discriminator: ADVANCE_NONCE_ACCOUNT_DISCRIMINATOR
@@ -233,10 +233,10 @@ function getAdvanceNonceAccountInstructionDataEncoder() {
233
233
  );
234
234
  }
235
235
  function getAdvanceNonceAccountInstructionDataDecoder() {
236
- return web3_js.getStructDecoder([["discriminator", web3_js.getU32Decoder()]]);
236
+ return kit.getStructDecoder([["discriminator", kit.getU32Decoder()]]);
237
237
  }
238
238
  function getAdvanceNonceAccountInstructionDataCodec() {
239
- return web3_js.combineCodec(
239
+ return kit.combineCodec(
240
240
  getAdvanceNonceAccountInstructionDataEncoder(),
241
241
  getAdvanceNonceAccountInstructionDataDecoder()
242
242
  );
@@ -291,25 +291,25 @@ function parseAdvanceNonceAccountInstruction(instruction) {
291
291
  }
292
292
  var ALLOCATE_DISCRIMINATOR = 8;
293
293
  function getAllocateDiscriminatorBytes() {
294
- return web3_js.getU32Encoder().encode(ALLOCATE_DISCRIMINATOR);
294
+ return kit.getU32Encoder().encode(ALLOCATE_DISCRIMINATOR);
295
295
  }
296
296
  function getAllocateInstructionDataEncoder() {
297
- return web3_js.transformEncoder(
298
- web3_js.getStructEncoder([
299
- ["discriminator", web3_js.getU32Encoder()],
300
- ["space", web3_js.getU64Encoder()]
297
+ return kit.transformEncoder(
298
+ kit.getStructEncoder([
299
+ ["discriminator", kit.getU32Encoder()],
300
+ ["space", kit.getU64Encoder()]
301
301
  ]),
302
302
  (value) => ({ ...value, discriminator: ALLOCATE_DISCRIMINATOR })
303
303
  );
304
304
  }
305
305
  function getAllocateInstructionDataDecoder() {
306
- return web3_js.getStructDecoder([
307
- ["discriminator", web3_js.getU32Decoder()],
308
- ["space", web3_js.getU64Decoder()]
306
+ return kit.getStructDecoder([
307
+ ["discriminator", kit.getU32Decoder()],
308
+ ["space", kit.getU64Decoder()]
309
309
  ]);
310
310
  }
311
311
  function getAllocateInstructionDataCodec() {
312
- return web3_js.combineCodec(
312
+ return kit.combineCodec(
313
313
  getAllocateInstructionDataEncoder(),
314
314
  getAllocateInstructionDataDecoder()
315
315
  );
@@ -351,31 +351,31 @@ function parseAllocateInstruction(instruction) {
351
351
  }
352
352
  var ALLOCATE_WITH_SEED_DISCRIMINATOR = 9;
353
353
  function getAllocateWithSeedDiscriminatorBytes() {
354
- return web3_js.getU32Encoder().encode(ALLOCATE_WITH_SEED_DISCRIMINATOR);
354
+ return kit.getU32Encoder().encode(ALLOCATE_WITH_SEED_DISCRIMINATOR);
355
355
  }
356
356
  function getAllocateWithSeedInstructionDataEncoder() {
357
- return web3_js.transformEncoder(
358
- web3_js.getStructEncoder([
359
- ["discriminator", web3_js.getU32Encoder()],
360
- ["base", web3_js.getAddressEncoder()],
361
- ["seed", web3_js.addEncoderSizePrefix(web3_js.getUtf8Encoder(), web3_js.getU64Encoder())],
362
- ["space", web3_js.getU64Encoder()],
363
- ["programAddress", web3_js.getAddressEncoder()]
357
+ return kit.transformEncoder(
358
+ kit.getStructEncoder([
359
+ ["discriminator", kit.getU32Encoder()],
360
+ ["base", kit.getAddressEncoder()],
361
+ ["seed", kit.addEncoderSizePrefix(kit.getUtf8Encoder(), kit.getU64Encoder())],
362
+ ["space", kit.getU64Encoder()],
363
+ ["programAddress", kit.getAddressEncoder()]
364
364
  ]),
365
365
  (value) => ({ ...value, discriminator: ALLOCATE_WITH_SEED_DISCRIMINATOR })
366
366
  );
367
367
  }
368
368
  function getAllocateWithSeedInstructionDataDecoder() {
369
- return web3_js.getStructDecoder([
370
- ["discriminator", web3_js.getU32Decoder()],
371
- ["base", web3_js.getAddressDecoder()],
372
- ["seed", web3_js.addDecoderSizePrefix(web3_js.getUtf8Decoder(), web3_js.getU64Decoder())],
373
- ["space", web3_js.getU64Decoder()],
374
- ["programAddress", web3_js.getAddressDecoder()]
369
+ return kit.getStructDecoder([
370
+ ["discriminator", kit.getU32Decoder()],
371
+ ["base", kit.getAddressDecoder()],
372
+ ["seed", kit.addDecoderSizePrefix(kit.getUtf8Decoder(), kit.getU64Decoder())],
373
+ ["space", kit.getU64Decoder()],
374
+ ["programAddress", kit.getAddressDecoder()]
375
375
  ]);
376
376
  }
377
377
  function getAllocateWithSeedInstructionDataCodec() {
378
- return web3_js.combineCodec(
378
+ return kit.combineCodec(
379
379
  getAllocateWithSeedInstructionDataEncoder(),
380
380
  getAllocateWithSeedInstructionDataDecoder()
381
381
  );
@@ -422,25 +422,25 @@ function parseAllocateWithSeedInstruction(instruction) {
422
422
  }
423
423
  var ASSIGN_DISCRIMINATOR = 1;
424
424
  function getAssignDiscriminatorBytes() {
425
- return web3_js.getU32Encoder().encode(ASSIGN_DISCRIMINATOR);
425
+ return kit.getU32Encoder().encode(ASSIGN_DISCRIMINATOR);
426
426
  }
427
427
  function getAssignInstructionDataEncoder() {
428
- return web3_js.transformEncoder(
429
- web3_js.getStructEncoder([
430
- ["discriminator", web3_js.getU32Encoder()],
431
- ["programAddress", web3_js.getAddressEncoder()]
428
+ return kit.transformEncoder(
429
+ kit.getStructEncoder([
430
+ ["discriminator", kit.getU32Encoder()],
431
+ ["programAddress", kit.getAddressEncoder()]
432
432
  ]),
433
433
  (value) => ({ ...value, discriminator: ASSIGN_DISCRIMINATOR })
434
434
  );
435
435
  }
436
436
  function getAssignInstructionDataDecoder() {
437
- return web3_js.getStructDecoder([
438
- ["discriminator", web3_js.getU32Decoder()],
439
- ["programAddress", web3_js.getAddressDecoder()]
437
+ return kit.getStructDecoder([
438
+ ["discriminator", kit.getU32Decoder()],
439
+ ["programAddress", kit.getAddressDecoder()]
440
440
  ]);
441
441
  }
442
442
  function getAssignInstructionDataCodec() {
443
- return web3_js.combineCodec(
443
+ return kit.combineCodec(
444
444
  getAssignInstructionDataEncoder(),
445
445
  getAssignInstructionDataDecoder()
446
446
  );
@@ -482,29 +482,29 @@ function parseAssignInstruction(instruction) {
482
482
  }
483
483
  var ASSIGN_WITH_SEED_DISCRIMINATOR = 10;
484
484
  function getAssignWithSeedDiscriminatorBytes() {
485
- return web3_js.getU32Encoder().encode(ASSIGN_WITH_SEED_DISCRIMINATOR);
485
+ return kit.getU32Encoder().encode(ASSIGN_WITH_SEED_DISCRIMINATOR);
486
486
  }
487
487
  function getAssignWithSeedInstructionDataEncoder() {
488
- return web3_js.transformEncoder(
489
- web3_js.getStructEncoder([
490
- ["discriminator", web3_js.getU32Encoder()],
491
- ["base", web3_js.getAddressEncoder()],
492
- ["seed", web3_js.addEncoderSizePrefix(web3_js.getUtf8Encoder(), web3_js.getU64Encoder())],
493
- ["programAddress", web3_js.getAddressEncoder()]
488
+ return kit.transformEncoder(
489
+ kit.getStructEncoder([
490
+ ["discriminator", kit.getU32Encoder()],
491
+ ["base", kit.getAddressEncoder()],
492
+ ["seed", kit.addEncoderSizePrefix(kit.getUtf8Encoder(), kit.getU64Encoder())],
493
+ ["programAddress", kit.getAddressEncoder()]
494
494
  ]),
495
495
  (value) => ({ ...value, discriminator: ASSIGN_WITH_SEED_DISCRIMINATOR })
496
496
  );
497
497
  }
498
498
  function getAssignWithSeedInstructionDataDecoder() {
499
- return web3_js.getStructDecoder([
500
- ["discriminator", web3_js.getU32Decoder()],
501
- ["base", web3_js.getAddressDecoder()],
502
- ["seed", web3_js.addDecoderSizePrefix(web3_js.getUtf8Decoder(), web3_js.getU64Decoder())],
503
- ["programAddress", web3_js.getAddressDecoder()]
499
+ return kit.getStructDecoder([
500
+ ["discriminator", kit.getU32Decoder()],
501
+ ["base", kit.getAddressDecoder()],
502
+ ["seed", kit.addDecoderSizePrefix(kit.getUtf8Decoder(), kit.getU64Decoder())],
503
+ ["programAddress", kit.getAddressDecoder()]
504
504
  ]);
505
505
  }
506
506
  function getAssignWithSeedInstructionDataCodec() {
507
- return web3_js.combineCodec(
507
+ return kit.combineCodec(
508
508
  getAssignWithSeedInstructionDataEncoder(),
509
509
  getAssignWithSeedInstructionDataDecoder()
510
510
  );
@@ -551,13 +551,13 @@ function parseAssignWithSeedInstruction(instruction) {
551
551
  }
552
552
  var AUTHORIZE_NONCE_ACCOUNT_DISCRIMINATOR = 7;
553
553
  function getAuthorizeNonceAccountDiscriminatorBytes() {
554
- return web3_js.getU32Encoder().encode(AUTHORIZE_NONCE_ACCOUNT_DISCRIMINATOR);
554
+ return kit.getU32Encoder().encode(AUTHORIZE_NONCE_ACCOUNT_DISCRIMINATOR);
555
555
  }
556
556
  function getAuthorizeNonceAccountInstructionDataEncoder() {
557
- return web3_js.transformEncoder(
558
- web3_js.getStructEncoder([
559
- ["discriminator", web3_js.getU32Encoder()],
560
- ["newNonceAuthority", web3_js.getAddressEncoder()]
557
+ return kit.transformEncoder(
558
+ kit.getStructEncoder([
559
+ ["discriminator", kit.getU32Encoder()],
560
+ ["newNonceAuthority", kit.getAddressEncoder()]
561
561
  ]),
562
562
  (value) => ({
563
563
  ...value,
@@ -566,13 +566,13 @@ function getAuthorizeNonceAccountInstructionDataEncoder() {
566
566
  );
567
567
  }
568
568
  function getAuthorizeNonceAccountInstructionDataDecoder() {
569
- return web3_js.getStructDecoder([
570
- ["discriminator", web3_js.getU32Decoder()],
571
- ["newNonceAuthority", web3_js.getAddressDecoder()]
569
+ return kit.getStructDecoder([
570
+ ["discriminator", kit.getU32Decoder()],
571
+ ["newNonceAuthority", kit.getAddressDecoder()]
572
572
  ]);
573
573
  }
574
574
  function getAuthorizeNonceAccountInstructionDataCodec() {
575
- return web3_js.combineCodec(
575
+ return kit.combineCodec(
576
576
  getAuthorizeNonceAccountInstructionDataEncoder(),
577
577
  getAuthorizeNonceAccountInstructionDataDecoder()
578
578
  );
@@ -621,29 +621,29 @@ function parseAuthorizeNonceAccountInstruction(instruction) {
621
621
  }
622
622
  var CREATE_ACCOUNT_DISCRIMINATOR = 0;
623
623
  function getCreateAccountDiscriminatorBytes() {
624
- return web3_js.getU32Encoder().encode(CREATE_ACCOUNT_DISCRIMINATOR);
624
+ return kit.getU32Encoder().encode(CREATE_ACCOUNT_DISCRIMINATOR);
625
625
  }
626
626
  function getCreateAccountInstructionDataEncoder() {
627
- return web3_js.transformEncoder(
628
- web3_js.getStructEncoder([
629
- ["discriminator", web3_js.getU32Encoder()],
630
- ["lamports", web3_js.getU64Encoder()],
631
- ["space", web3_js.getU64Encoder()],
632
- ["programAddress", web3_js.getAddressEncoder()]
627
+ return kit.transformEncoder(
628
+ kit.getStructEncoder([
629
+ ["discriminator", kit.getU32Encoder()],
630
+ ["lamports", kit.getU64Encoder()],
631
+ ["space", kit.getU64Encoder()],
632
+ ["programAddress", kit.getAddressEncoder()]
633
633
  ]),
634
634
  (value) => ({ ...value, discriminator: CREATE_ACCOUNT_DISCRIMINATOR })
635
635
  );
636
636
  }
637
637
  function getCreateAccountInstructionDataDecoder() {
638
- return web3_js.getStructDecoder([
639
- ["discriminator", web3_js.getU32Decoder()],
640
- ["lamports", web3_js.getU64Decoder()],
641
- ["space", web3_js.getU64Decoder()],
642
- ["programAddress", web3_js.getAddressDecoder()]
638
+ return kit.getStructDecoder([
639
+ ["discriminator", kit.getU32Decoder()],
640
+ ["lamports", kit.getU64Decoder()],
641
+ ["space", kit.getU64Decoder()],
642
+ ["programAddress", kit.getAddressDecoder()]
643
643
  ]);
644
644
  }
645
645
  function getCreateAccountInstructionDataCodec() {
646
- return web3_js.combineCodec(
646
+ return kit.combineCodec(
647
647
  getCreateAccountInstructionDataEncoder(),
648
648
  getCreateAccountInstructionDataDecoder()
649
649
  );
@@ -656,7 +656,7 @@ function getCreateAccountInstruction(input, config) {
656
656
  };
657
657
  const accounts = originalAccounts;
658
658
  const args = { ...input };
659
- const byteDelta = [Number(args.space) + web3_js.BASE_ACCOUNT_SIZE].reduce(
659
+ const byteDelta = [Number(args.space) + kit.BASE_ACCOUNT_SIZE].reduce(
660
660
  (a, b) => a + b,
661
661
  0
662
662
  );
@@ -694,17 +694,17 @@ function parseCreateAccountInstruction(instruction) {
694
694
  }
695
695
  var CREATE_ACCOUNT_WITH_SEED_DISCRIMINATOR = 3;
696
696
  function getCreateAccountWithSeedDiscriminatorBytes() {
697
- return web3_js.getU32Encoder().encode(CREATE_ACCOUNT_WITH_SEED_DISCRIMINATOR);
697
+ return kit.getU32Encoder().encode(CREATE_ACCOUNT_WITH_SEED_DISCRIMINATOR);
698
698
  }
699
699
  function getCreateAccountWithSeedInstructionDataEncoder() {
700
- return web3_js.transformEncoder(
701
- web3_js.getStructEncoder([
702
- ["discriminator", web3_js.getU32Encoder()],
703
- ["base", web3_js.getAddressEncoder()],
704
- ["seed", web3_js.addEncoderSizePrefix(web3_js.getUtf8Encoder(), web3_js.getU64Encoder())],
705
- ["amount", web3_js.getU64Encoder()],
706
- ["space", web3_js.getU64Encoder()],
707
- ["programAddress", web3_js.getAddressEncoder()]
700
+ return kit.transformEncoder(
701
+ kit.getStructEncoder([
702
+ ["discriminator", kit.getU32Encoder()],
703
+ ["base", kit.getAddressEncoder()],
704
+ ["seed", kit.addEncoderSizePrefix(kit.getUtf8Encoder(), kit.getU64Encoder())],
705
+ ["amount", kit.getU64Encoder()],
706
+ ["space", kit.getU64Encoder()],
707
+ ["programAddress", kit.getAddressEncoder()]
708
708
  ]),
709
709
  (value) => ({
710
710
  ...value,
@@ -713,17 +713,17 @@ function getCreateAccountWithSeedInstructionDataEncoder() {
713
713
  );
714
714
  }
715
715
  function getCreateAccountWithSeedInstructionDataDecoder() {
716
- return web3_js.getStructDecoder([
717
- ["discriminator", web3_js.getU32Decoder()],
718
- ["base", web3_js.getAddressDecoder()],
719
- ["seed", web3_js.addDecoderSizePrefix(web3_js.getUtf8Decoder(), web3_js.getU64Decoder())],
720
- ["amount", web3_js.getU64Decoder()],
721
- ["space", web3_js.getU64Decoder()],
722
- ["programAddress", web3_js.getAddressDecoder()]
716
+ return kit.getStructDecoder([
717
+ ["discriminator", kit.getU32Decoder()],
718
+ ["base", kit.getAddressDecoder()],
719
+ ["seed", kit.addDecoderSizePrefix(kit.getUtf8Decoder(), kit.getU64Decoder())],
720
+ ["amount", kit.getU64Decoder()],
721
+ ["space", kit.getU64Decoder()],
722
+ ["programAddress", kit.getAddressDecoder()]
723
723
  ]);
724
724
  }
725
725
  function getCreateAccountWithSeedInstructionDataCodec() {
726
- return web3_js.combineCodec(
726
+ return kit.combineCodec(
727
727
  getCreateAccountWithSeedInstructionDataEncoder(),
728
728
  getCreateAccountWithSeedInstructionDataDecoder()
729
729
  );
@@ -775,13 +775,13 @@ function parseCreateAccountWithSeedInstruction(instruction) {
775
775
  }
776
776
  var INITIALIZE_NONCE_ACCOUNT_DISCRIMINATOR = 6;
777
777
  function getInitializeNonceAccountDiscriminatorBytes() {
778
- return web3_js.getU32Encoder().encode(INITIALIZE_NONCE_ACCOUNT_DISCRIMINATOR);
778
+ return kit.getU32Encoder().encode(INITIALIZE_NONCE_ACCOUNT_DISCRIMINATOR);
779
779
  }
780
780
  function getInitializeNonceAccountInstructionDataEncoder() {
781
- return web3_js.transformEncoder(
782
- web3_js.getStructEncoder([
783
- ["discriminator", web3_js.getU32Encoder()],
784
- ["nonceAuthority", web3_js.getAddressEncoder()]
781
+ return kit.transformEncoder(
782
+ kit.getStructEncoder([
783
+ ["discriminator", kit.getU32Encoder()],
784
+ ["nonceAuthority", kit.getAddressEncoder()]
785
785
  ]),
786
786
  (value) => ({
787
787
  ...value,
@@ -790,13 +790,13 @@ function getInitializeNonceAccountInstructionDataEncoder() {
790
790
  );
791
791
  }
792
792
  function getInitializeNonceAccountInstructionDataDecoder() {
793
- return web3_js.getStructDecoder([
794
- ["discriminator", web3_js.getU32Decoder()],
795
- ["nonceAuthority", web3_js.getAddressDecoder()]
793
+ return kit.getStructDecoder([
794
+ ["discriminator", kit.getU32Decoder()],
795
+ ["nonceAuthority", kit.getAddressDecoder()]
796
796
  ]);
797
797
  }
798
798
  function getInitializeNonceAccountInstructionDataCodec() {
799
- return web3_js.combineCodec(
799
+ return kit.combineCodec(
800
800
  getInitializeNonceAccountInstructionDataEncoder(),
801
801
  getInitializeNonceAccountInstructionDataDecoder()
802
802
  );
@@ -857,25 +857,25 @@ function parseInitializeNonceAccountInstruction(instruction) {
857
857
  }
858
858
  var TRANSFER_SOL_DISCRIMINATOR = 2;
859
859
  function getTransferSolDiscriminatorBytes() {
860
- return web3_js.getU32Encoder().encode(TRANSFER_SOL_DISCRIMINATOR);
860
+ return kit.getU32Encoder().encode(TRANSFER_SOL_DISCRIMINATOR);
861
861
  }
862
862
  function getTransferSolInstructionDataEncoder() {
863
- return web3_js.transformEncoder(
864
- web3_js.getStructEncoder([
865
- ["discriminator", web3_js.getU32Encoder()],
866
- ["amount", web3_js.getU64Encoder()]
863
+ return kit.transformEncoder(
864
+ kit.getStructEncoder([
865
+ ["discriminator", kit.getU32Encoder()],
866
+ ["amount", kit.getU64Encoder()]
867
867
  ]),
868
868
  (value) => ({ ...value, discriminator: TRANSFER_SOL_DISCRIMINATOR })
869
869
  );
870
870
  }
871
871
  function getTransferSolInstructionDataDecoder() {
872
- return web3_js.getStructDecoder([
873
- ["discriminator", web3_js.getU32Decoder()],
874
- ["amount", web3_js.getU64Decoder()]
872
+ return kit.getStructDecoder([
873
+ ["discriminator", kit.getU32Decoder()],
874
+ ["amount", kit.getU64Decoder()]
875
875
  ]);
876
876
  }
877
877
  function getTransferSolInstructionDataCodec() {
878
- return web3_js.combineCodec(
878
+ return kit.combineCodec(
879
879
  getTransferSolInstructionDataEncoder(),
880
880
  getTransferSolInstructionDataDecoder()
881
881
  );
@@ -922,15 +922,15 @@ function parseTransferSolInstruction(instruction) {
922
922
  }
923
923
  var TRANSFER_SOL_WITH_SEED_DISCRIMINATOR = 11;
924
924
  function getTransferSolWithSeedDiscriminatorBytes() {
925
- return web3_js.getU32Encoder().encode(TRANSFER_SOL_WITH_SEED_DISCRIMINATOR);
925
+ return kit.getU32Encoder().encode(TRANSFER_SOL_WITH_SEED_DISCRIMINATOR);
926
926
  }
927
927
  function getTransferSolWithSeedInstructionDataEncoder() {
928
- return web3_js.transformEncoder(
929
- web3_js.getStructEncoder([
930
- ["discriminator", web3_js.getU32Encoder()],
931
- ["amount", web3_js.getU64Encoder()],
932
- ["fromSeed", web3_js.addEncoderSizePrefix(web3_js.getUtf8Encoder(), web3_js.getU64Encoder())],
933
- ["fromOwner", web3_js.getAddressEncoder()]
928
+ return kit.transformEncoder(
929
+ kit.getStructEncoder([
930
+ ["discriminator", kit.getU32Encoder()],
931
+ ["amount", kit.getU64Encoder()],
932
+ ["fromSeed", kit.addEncoderSizePrefix(kit.getUtf8Encoder(), kit.getU64Encoder())],
933
+ ["fromOwner", kit.getAddressEncoder()]
934
934
  ]),
935
935
  (value) => ({
936
936
  ...value,
@@ -939,15 +939,15 @@ function getTransferSolWithSeedInstructionDataEncoder() {
939
939
  );
940
940
  }
941
941
  function getTransferSolWithSeedInstructionDataDecoder() {
942
- return web3_js.getStructDecoder([
943
- ["discriminator", web3_js.getU32Decoder()],
944
- ["amount", web3_js.getU64Decoder()],
945
- ["fromSeed", web3_js.addDecoderSizePrefix(web3_js.getUtf8Decoder(), web3_js.getU64Decoder())],
946
- ["fromOwner", web3_js.getAddressDecoder()]
942
+ return kit.getStructDecoder([
943
+ ["discriminator", kit.getU32Decoder()],
944
+ ["amount", kit.getU64Decoder()],
945
+ ["fromSeed", kit.addDecoderSizePrefix(kit.getUtf8Decoder(), kit.getU64Decoder())],
946
+ ["fromOwner", kit.getAddressDecoder()]
947
947
  ]);
948
948
  }
949
949
  function getTransferSolWithSeedInstructionDataCodec() {
950
- return web3_js.combineCodec(
950
+ return kit.combineCodec(
951
951
  getTransferSolWithSeedInstructionDataEncoder(),
952
952
  getTransferSolWithSeedInstructionDataDecoder()
953
953
  );
@@ -999,11 +999,11 @@ function parseTransferSolWithSeedInstruction(instruction) {
999
999
  }
1000
1000
  var UPGRADE_NONCE_ACCOUNT_DISCRIMINATOR = 12;
1001
1001
  function getUpgradeNonceAccountDiscriminatorBytes() {
1002
- return web3_js.getU32Encoder().encode(UPGRADE_NONCE_ACCOUNT_DISCRIMINATOR);
1002
+ return kit.getU32Encoder().encode(UPGRADE_NONCE_ACCOUNT_DISCRIMINATOR);
1003
1003
  }
1004
1004
  function getUpgradeNonceAccountInstructionDataEncoder() {
1005
- return web3_js.transformEncoder(
1006
- web3_js.getStructEncoder([["discriminator", web3_js.getU32Encoder()]]),
1005
+ return kit.transformEncoder(
1006
+ kit.getStructEncoder([["discriminator", kit.getU32Encoder()]]),
1007
1007
  (value) => ({
1008
1008
  ...value,
1009
1009
  discriminator: UPGRADE_NONCE_ACCOUNT_DISCRIMINATOR
@@ -1011,10 +1011,10 @@ function getUpgradeNonceAccountInstructionDataEncoder() {
1011
1011
  );
1012
1012
  }
1013
1013
  function getUpgradeNonceAccountInstructionDataDecoder() {
1014
- return web3_js.getStructDecoder([["discriminator", web3_js.getU32Decoder()]]);
1014
+ return kit.getStructDecoder([["discriminator", kit.getU32Decoder()]]);
1015
1015
  }
1016
1016
  function getUpgradeNonceAccountInstructionDataCodec() {
1017
- return web3_js.combineCodec(
1017
+ return kit.combineCodec(
1018
1018
  getUpgradeNonceAccountInstructionDataEncoder(),
1019
1019
  getUpgradeNonceAccountInstructionDataDecoder()
1020
1020
  );
@@ -1055,13 +1055,13 @@ function parseUpgradeNonceAccountInstruction(instruction) {
1055
1055
  }
1056
1056
  var WITHDRAW_NONCE_ACCOUNT_DISCRIMINATOR = 5;
1057
1057
  function getWithdrawNonceAccountDiscriminatorBytes() {
1058
- return web3_js.getU32Encoder().encode(WITHDRAW_NONCE_ACCOUNT_DISCRIMINATOR);
1058
+ return kit.getU32Encoder().encode(WITHDRAW_NONCE_ACCOUNT_DISCRIMINATOR);
1059
1059
  }
1060
1060
  function getWithdrawNonceAccountInstructionDataEncoder() {
1061
- return web3_js.transformEncoder(
1062
- web3_js.getStructEncoder([
1063
- ["discriminator", web3_js.getU32Encoder()],
1064
- ["withdrawAmount", web3_js.getU64Encoder()]
1061
+ return kit.transformEncoder(
1062
+ kit.getStructEncoder([
1063
+ ["discriminator", kit.getU32Encoder()],
1064
+ ["withdrawAmount", kit.getU64Encoder()]
1065
1065
  ]),
1066
1066
  (value) => ({
1067
1067
  ...value,
@@ -1070,13 +1070,13 @@ function getWithdrawNonceAccountInstructionDataEncoder() {
1070
1070
  );
1071
1071
  }
1072
1072
  function getWithdrawNonceAccountInstructionDataDecoder() {
1073
- return web3_js.getStructDecoder([
1074
- ["discriminator", web3_js.getU32Decoder()],
1075
- ["withdrawAmount", web3_js.getU64Decoder()]
1073
+ return kit.getStructDecoder([
1074
+ ["discriminator", kit.getU32Decoder()],
1075
+ ["withdrawAmount", kit.getU64Decoder()]
1076
1076
  ]);
1077
1077
  }
1078
1078
  function getWithdrawNonceAccountInstructionDataCodec() {
1079
- return web3_js.combineCodec(
1079
+ return kit.combineCodec(
1080
1080
  getWithdrawNonceAccountInstructionDataEncoder(),
1081
1081
  getWithdrawNonceAccountInstructionDataDecoder()
1082
1082
  );