@solana-program/system 0.5.1 → 0.5.2
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.js +138 -39
- package/dist/src/index.js.map +1 -1
- package/dist/src/index.mjs +113 -40
- package/dist/src/index.mjs.map +1 -1
- package/dist/types/generated/instructions/advanceNonceAccount.d.ts +5 -1
- package/dist/types/generated/instructions/advanceNonceAccount.d.ts.map +1 -1
- package/dist/types/generated/instructions/allocate.d.ts +5 -1
- package/dist/types/generated/instructions/allocate.d.ts.map +1 -1
- package/dist/types/generated/instructions/allocateWithSeed.d.ts +5 -1
- package/dist/types/generated/instructions/allocateWithSeed.d.ts.map +1 -1
- package/dist/types/generated/instructions/assign.d.ts +5 -1
- package/dist/types/generated/instructions/assign.d.ts.map +1 -1
- package/dist/types/generated/instructions/assignWithSeed.d.ts +5 -1
- package/dist/types/generated/instructions/assignWithSeed.d.ts.map +1 -1
- package/dist/types/generated/instructions/authorizeNonceAccount.d.ts +5 -1
- package/dist/types/generated/instructions/authorizeNonceAccount.d.ts.map +1 -1
- package/dist/types/generated/instructions/createAccount.d.ts +5 -1
- package/dist/types/generated/instructions/createAccount.d.ts.map +1 -1
- package/dist/types/generated/instructions/createAccountWithSeed.d.ts +5 -1
- package/dist/types/generated/instructions/createAccountWithSeed.d.ts.map +1 -1
- package/dist/types/generated/instructions/initializeNonceAccount.d.ts +5 -1
- package/dist/types/generated/instructions/initializeNonceAccount.d.ts.map +1 -1
- package/dist/types/generated/instructions/transferSol.d.ts +5 -1
- package/dist/types/generated/instructions/transferSol.d.ts.map +1 -1
- package/dist/types/generated/instructions/transferSolWithSeed.d.ts +5 -1
- package/dist/types/generated/instructions/transferSolWithSeed.d.ts.map +1 -1
- package/dist/types/generated/instructions/upgradeNonceAccount.d.ts +5 -1
- package/dist/types/generated/instructions/upgradeNonceAccount.d.ts.map +1 -1
- package/dist/types/generated/instructions/withdrawNonceAccount.d.ts +5 -1
- package/dist/types/generated/instructions/withdrawNonceAccount.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/src/index.mjs
CHANGED
|
@@ -217,10 +217,17 @@ function isTransactionSigner(value) {
|
|
|
217
217
|
}
|
|
218
218
|
|
|
219
219
|
// src/generated/instructions/advanceNonceAccount.ts
|
|
220
|
+
var ADVANCE_NONCE_ACCOUNT_DISCRIMINATOR = 4;
|
|
221
|
+
function getAdvanceNonceAccountDiscriminatorBytes() {
|
|
222
|
+
return getU32Encoder().encode(ADVANCE_NONCE_ACCOUNT_DISCRIMINATOR);
|
|
223
|
+
}
|
|
220
224
|
function getAdvanceNonceAccountInstructionDataEncoder() {
|
|
221
225
|
return transformEncoder(
|
|
222
226
|
getStructEncoder([["discriminator", getU32Encoder()]]),
|
|
223
|
-
(value) => ({
|
|
227
|
+
(value) => ({
|
|
228
|
+
...value,
|
|
229
|
+
discriminator: ADVANCE_NONCE_ACCOUNT_DISCRIMINATOR
|
|
230
|
+
})
|
|
224
231
|
);
|
|
225
232
|
}
|
|
226
233
|
function getAdvanceNonceAccountInstructionDataDecoder() {
|
|
@@ -232,8 +239,8 @@ function getAdvanceNonceAccountInstructionDataCodec() {
|
|
|
232
239
|
getAdvanceNonceAccountInstructionDataDecoder()
|
|
233
240
|
);
|
|
234
241
|
}
|
|
235
|
-
function getAdvanceNonceAccountInstruction(input) {
|
|
236
|
-
const programAddress = SYSTEM_PROGRAM_ADDRESS;
|
|
242
|
+
function getAdvanceNonceAccountInstruction(input, config) {
|
|
243
|
+
const programAddress = config?.programAddress ?? SYSTEM_PROGRAM_ADDRESS;
|
|
237
244
|
const originalAccounts = {
|
|
238
245
|
nonceAccount: { value: input.nonceAccount ?? null, isWritable: true },
|
|
239
246
|
recentBlockhashesSysvar: {
|
|
@@ -280,13 +287,17 @@ function parseAdvanceNonceAccountInstruction(instruction) {
|
|
|
280
287
|
)
|
|
281
288
|
};
|
|
282
289
|
}
|
|
290
|
+
var ALLOCATE_DISCRIMINATOR = 8;
|
|
291
|
+
function getAllocateDiscriminatorBytes() {
|
|
292
|
+
return getU32Encoder().encode(ALLOCATE_DISCRIMINATOR);
|
|
293
|
+
}
|
|
283
294
|
function getAllocateInstructionDataEncoder() {
|
|
284
295
|
return transformEncoder(
|
|
285
296
|
getStructEncoder([
|
|
286
297
|
["discriminator", getU32Encoder()],
|
|
287
298
|
["space", getU64Encoder()]
|
|
288
299
|
]),
|
|
289
|
-
(value) => ({ ...value, discriminator:
|
|
300
|
+
(value) => ({ ...value, discriminator: ALLOCATE_DISCRIMINATOR })
|
|
290
301
|
);
|
|
291
302
|
}
|
|
292
303
|
function getAllocateInstructionDataDecoder() {
|
|
@@ -301,8 +312,8 @@ function getAllocateInstructionDataCodec() {
|
|
|
301
312
|
getAllocateInstructionDataDecoder()
|
|
302
313
|
);
|
|
303
314
|
}
|
|
304
|
-
function getAllocateInstruction(input) {
|
|
305
|
-
const programAddress = SYSTEM_PROGRAM_ADDRESS;
|
|
315
|
+
function getAllocateInstruction(input, config) {
|
|
316
|
+
const programAddress = config?.programAddress ?? SYSTEM_PROGRAM_ADDRESS;
|
|
306
317
|
const originalAccounts = {
|
|
307
318
|
newAccount: { value: input.newAccount ?? null, isWritable: true }
|
|
308
319
|
};
|
|
@@ -336,6 +347,10 @@ function parseAllocateInstruction(instruction) {
|
|
|
336
347
|
data: getAllocateInstructionDataDecoder().decode(instruction.data)
|
|
337
348
|
};
|
|
338
349
|
}
|
|
350
|
+
var ALLOCATE_WITH_SEED_DISCRIMINATOR = 9;
|
|
351
|
+
function getAllocateWithSeedDiscriminatorBytes() {
|
|
352
|
+
return getU32Encoder().encode(ALLOCATE_WITH_SEED_DISCRIMINATOR);
|
|
353
|
+
}
|
|
339
354
|
function getAllocateWithSeedInstructionDataEncoder() {
|
|
340
355
|
return transformEncoder(
|
|
341
356
|
getStructEncoder([
|
|
@@ -345,7 +360,7 @@ function getAllocateWithSeedInstructionDataEncoder() {
|
|
|
345
360
|
["space", getU64Encoder()],
|
|
346
361
|
["programAddress", getAddressEncoder()]
|
|
347
362
|
]),
|
|
348
|
-
(value) => ({ ...value, discriminator:
|
|
363
|
+
(value) => ({ ...value, discriminator: ALLOCATE_WITH_SEED_DISCRIMINATOR })
|
|
349
364
|
);
|
|
350
365
|
}
|
|
351
366
|
function getAllocateWithSeedInstructionDataDecoder() {
|
|
@@ -363,8 +378,8 @@ function getAllocateWithSeedInstructionDataCodec() {
|
|
|
363
378
|
getAllocateWithSeedInstructionDataDecoder()
|
|
364
379
|
);
|
|
365
380
|
}
|
|
366
|
-
function getAllocateWithSeedInstruction(input) {
|
|
367
|
-
const programAddress = SYSTEM_PROGRAM_ADDRESS;
|
|
381
|
+
function getAllocateWithSeedInstruction(input, config) {
|
|
382
|
+
const programAddress = config?.programAddress ?? SYSTEM_PROGRAM_ADDRESS;
|
|
368
383
|
const originalAccounts = {
|
|
369
384
|
newAccount: { value: input.newAccount ?? null, isWritable: true },
|
|
370
385
|
baseAccount: { value: input.baseAccount ?? null, isWritable: false }
|
|
@@ -403,13 +418,17 @@ function parseAllocateWithSeedInstruction(instruction) {
|
|
|
403
418
|
data: getAllocateWithSeedInstructionDataDecoder().decode(instruction.data)
|
|
404
419
|
};
|
|
405
420
|
}
|
|
421
|
+
var ASSIGN_DISCRIMINATOR = 1;
|
|
422
|
+
function getAssignDiscriminatorBytes() {
|
|
423
|
+
return getU32Encoder().encode(ASSIGN_DISCRIMINATOR);
|
|
424
|
+
}
|
|
406
425
|
function getAssignInstructionDataEncoder() {
|
|
407
426
|
return transformEncoder(
|
|
408
427
|
getStructEncoder([
|
|
409
428
|
["discriminator", getU32Encoder()],
|
|
410
429
|
["programAddress", getAddressEncoder()]
|
|
411
430
|
]),
|
|
412
|
-
(value) => ({ ...value, discriminator:
|
|
431
|
+
(value) => ({ ...value, discriminator: ASSIGN_DISCRIMINATOR })
|
|
413
432
|
);
|
|
414
433
|
}
|
|
415
434
|
function getAssignInstructionDataDecoder() {
|
|
@@ -424,8 +443,8 @@ function getAssignInstructionDataCodec() {
|
|
|
424
443
|
getAssignInstructionDataDecoder()
|
|
425
444
|
);
|
|
426
445
|
}
|
|
427
|
-
function getAssignInstruction(input) {
|
|
428
|
-
const programAddress = SYSTEM_PROGRAM_ADDRESS;
|
|
446
|
+
function getAssignInstruction(input, config) {
|
|
447
|
+
const programAddress = config?.programAddress ?? SYSTEM_PROGRAM_ADDRESS;
|
|
429
448
|
const originalAccounts = {
|
|
430
449
|
account: { value: input.account ?? null, isWritable: true }
|
|
431
450
|
};
|
|
@@ -459,6 +478,10 @@ function parseAssignInstruction(instruction) {
|
|
|
459
478
|
data: getAssignInstructionDataDecoder().decode(instruction.data)
|
|
460
479
|
};
|
|
461
480
|
}
|
|
481
|
+
var ASSIGN_WITH_SEED_DISCRIMINATOR = 10;
|
|
482
|
+
function getAssignWithSeedDiscriminatorBytes() {
|
|
483
|
+
return getU32Encoder().encode(ASSIGN_WITH_SEED_DISCRIMINATOR);
|
|
484
|
+
}
|
|
462
485
|
function getAssignWithSeedInstructionDataEncoder() {
|
|
463
486
|
return transformEncoder(
|
|
464
487
|
getStructEncoder([
|
|
@@ -467,7 +490,7 @@ function getAssignWithSeedInstructionDataEncoder() {
|
|
|
467
490
|
["seed", addEncoderSizePrefix(getUtf8Encoder(), getU64Encoder())],
|
|
468
491
|
["programAddress", getAddressEncoder()]
|
|
469
492
|
]),
|
|
470
|
-
(value) => ({ ...value, discriminator:
|
|
493
|
+
(value) => ({ ...value, discriminator: ASSIGN_WITH_SEED_DISCRIMINATOR })
|
|
471
494
|
);
|
|
472
495
|
}
|
|
473
496
|
function getAssignWithSeedInstructionDataDecoder() {
|
|
@@ -484,8 +507,8 @@ function getAssignWithSeedInstructionDataCodec() {
|
|
|
484
507
|
getAssignWithSeedInstructionDataDecoder()
|
|
485
508
|
);
|
|
486
509
|
}
|
|
487
|
-
function getAssignWithSeedInstruction(input) {
|
|
488
|
-
const programAddress = SYSTEM_PROGRAM_ADDRESS;
|
|
510
|
+
function getAssignWithSeedInstruction(input, config) {
|
|
511
|
+
const programAddress = config?.programAddress ?? SYSTEM_PROGRAM_ADDRESS;
|
|
489
512
|
const originalAccounts = {
|
|
490
513
|
account: { value: input.account ?? null, isWritable: true },
|
|
491
514
|
baseAccount: { value: input.baseAccount ?? null, isWritable: false }
|
|
@@ -524,13 +547,20 @@ function parseAssignWithSeedInstruction(instruction) {
|
|
|
524
547
|
data: getAssignWithSeedInstructionDataDecoder().decode(instruction.data)
|
|
525
548
|
};
|
|
526
549
|
}
|
|
550
|
+
var AUTHORIZE_NONCE_ACCOUNT_DISCRIMINATOR = 7;
|
|
551
|
+
function getAuthorizeNonceAccountDiscriminatorBytes() {
|
|
552
|
+
return getU32Encoder().encode(AUTHORIZE_NONCE_ACCOUNT_DISCRIMINATOR);
|
|
553
|
+
}
|
|
527
554
|
function getAuthorizeNonceAccountInstructionDataEncoder() {
|
|
528
555
|
return transformEncoder(
|
|
529
556
|
getStructEncoder([
|
|
530
557
|
["discriminator", getU32Encoder()],
|
|
531
558
|
["newNonceAuthority", getAddressEncoder()]
|
|
532
559
|
]),
|
|
533
|
-
(value) => ({
|
|
560
|
+
(value) => ({
|
|
561
|
+
...value,
|
|
562
|
+
discriminator: AUTHORIZE_NONCE_ACCOUNT_DISCRIMINATOR
|
|
563
|
+
})
|
|
534
564
|
);
|
|
535
565
|
}
|
|
536
566
|
function getAuthorizeNonceAccountInstructionDataDecoder() {
|
|
@@ -545,8 +575,8 @@ function getAuthorizeNonceAccountInstructionDataCodec() {
|
|
|
545
575
|
getAuthorizeNonceAccountInstructionDataDecoder()
|
|
546
576
|
);
|
|
547
577
|
}
|
|
548
|
-
function getAuthorizeNonceAccountInstruction(input) {
|
|
549
|
-
const programAddress = SYSTEM_PROGRAM_ADDRESS;
|
|
578
|
+
function getAuthorizeNonceAccountInstruction(input, config) {
|
|
579
|
+
const programAddress = config?.programAddress ?? SYSTEM_PROGRAM_ADDRESS;
|
|
550
580
|
const originalAccounts = {
|
|
551
581
|
nonceAccount: { value: input.nonceAccount ?? null, isWritable: true },
|
|
552
582
|
nonceAuthority: { value: input.nonceAuthority ?? null, isWritable: false }
|
|
@@ -587,6 +617,10 @@ function parseAuthorizeNonceAccountInstruction(instruction) {
|
|
|
587
617
|
)
|
|
588
618
|
};
|
|
589
619
|
}
|
|
620
|
+
var CREATE_ACCOUNT_DISCRIMINATOR = 0;
|
|
621
|
+
function getCreateAccountDiscriminatorBytes() {
|
|
622
|
+
return getU32Encoder().encode(CREATE_ACCOUNT_DISCRIMINATOR);
|
|
623
|
+
}
|
|
590
624
|
function getCreateAccountInstructionDataEncoder() {
|
|
591
625
|
return transformEncoder(
|
|
592
626
|
getStructEncoder([
|
|
@@ -595,7 +629,7 @@ function getCreateAccountInstructionDataEncoder() {
|
|
|
595
629
|
["space", getU64Encoder()],
|
|
596
630
|
["programAddress", getAddressEncoder()]
|
|
597
631
|
]),
|
|
598
|
-
(value) => ({ ...value, discriminator:
|
|
632
|
+
(value) => ({ ...value, discriminator: CREATE_ACCOUNT_DISCRIMINATOR })
|
|
599
633
|
);
|
|
600
634
|
}
|
|
601
635
|
function getCreateAccountInstructionDataDecoder() {
|
|
@@ -612,8 +646,8 @@ function getCreateAccountInstructionDataCodec() {
|
|
|
612
646
|
getCreateAccountInstructionDataDecoder()
|
|
613
647
|
);
|
|
614
648
|
}
|
|
615
|
-
function getCreateAccountInstruction(input) {
|
|
616
|
-
const programAddress = SYSTEM_PROGRAM_ADDRESS;
|
|
649
|
+
function getCreateAccountInstruction(input, config) {
|
|
650
|
+
const programAddress = config?.programAddress ?? SYSTEM_PROGRAM_ADDRESS;
|
|
617
651
|
const originalAccounts = {
|
|
618
652
|
payer: { value: input.payer ?? null, isWritable: true },
|
|
619
653
|
newAccount: { value: input.newAccount ?? null, isWritable: true }
|
|
@@ -656,6 +690,10 @@ function parseCreateAccountInstruction(instruction) {
|
|
|
656
690
|
data: getCreateAccountInstructionDataDecoder().decode(instruction.data)
|
|
657
691
|
};
|
|
658
692
|
}
|
|
693
|
+
var CREATE_ACCOUNT_WITH_SEED_DISCRIMINATOR = 3;
|
|
694
|
+
function getCreateAccountWithSeedDiscriminatorBytes() {
|
|
695
|
+
return getU32Encoder().encode(CREATE_ACCOUNT_WITH_SEED_DISCRIMINATOR);
|
|
696
|
+
}
|
|
659
697
|
function getCreateAccountWithSeedInstructionDataEncoder() {
|
|
660
698
|
return transformEncoder(
|
|
661
699
|
getStructEncoder([
|
|
@@ -666,7 +704,10 @@ function getCreateAccountWithSeedInstructionDataEncoder() {
|
|
|
666
704
|
["space", getU64Encoder()],
|
|
667
705
|
["programAddress", getAddressEncoder()]
|
|
668
706
|
]),
|
|
669
|
-
(value) => ({
|
|
707
|
+
(value) => ({
|
|
708
|
+
...value,
|
|
709
|
+
discriminator: CREATE_ACCOUNT_WITH_SEED_DISCRIMINATOR
|
|
710
|
+
})
|
|
670
711
|
);
|
|
671
712
|
}
|
|
672
713
|
function getCreateAccountWithSeedInstructionDataDecoder() {
|
|
@@ -685,8 +726,8 @@ function getCreateAccountWithSeedInstructionDataCodec() {
|
|
|
685
726
|
getCreateAccountWithSeedInstructionDataDecoder()
|
|
686
727
|
);
|
|
687
728
|
}
|
|
688
|
-
function getCreateAccountWithSeedInstruction(input) {
|
|
689
|
-
const programAddress = SYSTEM_PROGRAM_ADDRESS;
|
|
729
|
+
function getCreateAccountWithSeedInstruction(input, config) {
|
|
730
|
+
const programAddress = config?.programAddress ?? SYSTEM_PROGRAM_ADDRESS;
|
|
690
731
|
const originalAccounts = {
|
|
691
732
|
payer: { value: input.payer ?? null, isWritable: true },
|
|
692
733
|
newAccount: { value: input.newAccount ?? null, isWritable: true },
|
|
@@ -730,13 +771,20 @@ function parseCreateAccountWithSeedInstruction(instruction) {
|
|
|
730
771
|
)
|
|
731
772
|
};
|
|
732
773
|
}
|
|
774
|
+
var INITIALIZE_NONCE_ACCOUNT_DISCRIMINATOR = 6;
|
|
775
|
+
function getInitializeNonceAccountDiscriminatorBytes() {
|
|
776
|
+
return getU32Encoder().encode(INITIALIZE_NONCE_ACCOUNT_DISCRIMINATOR);
|
|
777
|
+
}
|
|
733
778
|
function getInitializeNonceAccountInstructionDataEncoder() {
|
|
734
779
|
return transformEncoder(
|
|
735
780
|
getStructEncoder([
|
|
736
781
|
["discriminator", getU32Encoder()],
|
|
737
782
|
["nonceAuthority", getAddressEncoder()]
|
|
738
783
|
]),
|
|
739
|
-
(value) => ({
|
|
784
|
+
(value) => ({
|
|
785
|
+
...value,
|
|
786
|
+
discriminator: INITIALIZE_NONCE_ACCOUNT_DISCRIMINATOR
|
|
787
|
+
})
|
|
740
788
|
);
|
|
741
789
|
}
|
|
742
790
|
function getInitializeNonceAccountInstructionDataDecoder() {
|
|
@@ -751,8 +799,8 @@ function getInitializeNonceAccountInstructionDataCodec() {
|
|
|
751
799
|
getInitializeNonceAccountInstructionDataDecoder()
|
|
752
800
|
);
|
|
753
801
|
}
|
|
754
|
-
function getInitializeNonceAccountInstruction(input) {
|
|
755
|
-
const programAddress = SYSTEM_PROGRAM_ADDRESS;
|
|
802
|
+
function getInitializeNonceAccountInstruction(input, config) {
|
|
803
|
+
const programAddress = config?.programAddress ?? SYSTEM_PROGRAM_ADDRESS;
|
|
756
804
|
const originalAccounts = {
|
|
757
805
|
nonceAccount: { value: input.nonceAccount ?? null, isWritable: true },
|
|
758
806
|
recentBlockhashesSysvar: {
|
|
@@ -805,13 +853,17 @@ function parseInitializeNonceAccountInstruction(instruction) {
|
|
|
805
853
|
)
|
|
806
854
|
};
|
|
807
855
|
}
|
|
856
|
+
var TRANSFER_SOL_DISCRIMINATOR = 2;
|
|
857
|
+
function getTransferSolDiscriminatorBytes() {
|
|
858
|
+
return getU32Encoder().encode(TRANSFER_SOL_DISCRIMINATOR);
|
|
859
|
+
}
|
|
808
860
|
function getTransferSolInstructionDataEncoder() {
|
|
809
861
|
return transformEncoder(
|
|
810
862
|
getStructEncoder([
|
|
811
863
|
["discriminator", getU32Encoder()],
|
|
812
864
|
["amount", getU64Encoder()]
|
|
813
865
|
]),
|
|
814
|
-
(value) => ({ ...value, discriminator:
|
|
866
|
+
(value) => ({ ...value, discriminator: TRANSFER_SOL_DISCRIMINATOR })
|
|
815
867
|
);
|
|
816
868
|
}
|
|
817
869
|
function getTransferSolInstructionDataDecoder() {
|
|
@@ -826,8 +878,8 @@ function getTransferSolInstructionDataCodec() {
|
|
|
826
878
|
getTransferSolInstructionDataDecoder()
|
|
827
879
|
);
|
|
828
880
|
}
|
|
829
|
-
function getTransferSolInstruction(input) {
|
|
830
|
-
const programAddress = SYSTEM_PROGRAM_ADDRESS;
|
|
881
|
+
function getTransferSolInstruction(input, config) {
|
|
882
|
+
const programAddress = config?.programAddress ?? SYSTEM_PROGRAM_ADDRESS;
|
|
831
883
|
const originalAccounts = {
|
|
832
884
|
source: { value: input.source ?? null, isWritable: true },
|
|
833
885
|
destination: { value: input.destination ?? null, isWritable: true }
|
|
@@ -866,6 +918,10 @@ function parseTransferSolInstruction(instruction) {
|
|
|
866
918
|
data: getTransferSolInstructionDataDecoder().decode(instruction.data)
|
|
867
919
|
};
|
|
868
920
|
}
|
|
921
|
+
var TRANSFER_SOL_WITH_SEED_DISCRIMINATOR = 11;
|
|
922
|
+
function getTransferSolWithSeedDiscriminatorBytes() {
|
|
923
|
+
return getU32Encoder().encode(TRANSFER_SOL_WITH_SEED_DISCRIMINATOR);
|
|
924
|
+
}
|
|
869
925
|
function getTransferSolWithSeedInstructionDataEncoder() {
|
|
870
926
|
return transformEncoder(
|
|
871
927
|
getStructEncoder([
|
|
@@ -874,7 +930,10 @@ function getTransferSolWithSeedInstructionDataEncoder() {
|
|
|
874
930
|
["fromSeed", addEncoderSizePrefix(getUtf8Encoder(), getU64Encoder())],
|
|
875
931
|
["fromOwner", getAddressEncoder()]
|
|
876
932
|
]),
|
|
877
|
-
(value) => ({
|
|
933
|
+
(value) => ({
|
|
934
|
+
...value,
|
|
935
|
+
discriminator: TRANSFER_SOL_WITH_SEED_DISCRIMINATOR
|
|
936
|
+
})
|
|
878
937
|
);
|
|
879
938
|
}
|
|
880
939
|
function getTransferSolWithSeedInstructionDataDecoder() {
|
|
@@ -891,8 +950,8 @@ function getTransferSolWithSeedInstructionDataCodec() {
|
|
|
891
950
|
getTransferSolWithSeedInstructionDataDecoder()
|
|
892
951
|
);
|
|
893
952
|
}
|
|
894
|
-
function getTransferSolWithSeedInstruction(input) {
|
|
895
|
-
const programAddress = SYSTEM_PROGRAM_ADDRESS;
|
|
953
|
+
function getTransferSolWithSeedInstruction(input, config) {
|
|
954
|
+
const programAddress = config?.programAddress ?? SYSTEM_PROGRAM_ADDRESS;
|
|
896
955
|
const originalAccounts = {
|
|
897
956
|
source: { value: input.source ?? null, isWritable: true },
|
|
898
957
|
baseAccount: { value: input.baseAccount ?? null, isWritable: false },
|
|
@@ -936,10 +995,17 @@ function parseTransferSolWithSeedInstruction(instruction) {
|
|
|
936
995
|
)
|
|
937
996
|
};
|
|
938
997
|
}
|
|
998
|
+
var UPGRADE_NONCE_ACCOUNT_DISCRIMINATOR = 12;
|
|
999
|
+
function getUpgradeNonceAccountDiscriminatorBytes() {
|
|
1000
|
+
return getU32Encoder().encode(UPGRADE_NONCE_ACCOUNT_DISCRIMINATOR);
|
|
1001
|
+
}
|
|
939
1002
|
function getUpgradeNonceAccountInstructionDataEncoder() {
|
|
940
1003
|
return transformEncoder(
|
|
941
1004
|
getStructEncoder([["discriminator", getU32Encoder()]]),
|
|
942
|
-
(value) => ({
|
|
1005
|
+
(value) => ({
|
|
1006
|
+
...value,
|
|
1007
|
+
discriminator: UPGRADE_NONCE_ACCOUNT_DISCRIMINATOR
|
|
1008
|
+
})
|
|
943
1009
|
);
|
|
944
1010
|
}
|
|
945
1011
|
function getUpgradeNonceAccountInstructionDataDecoder() {
|
|
@@ -951,8 +1017,8 @@ function getUpgradeNonceAccountInstructionDataCodec() {
|
|
|
951
1017
|
getUpgradeNonceAccountInstructionDataDecoder()
|
|
952
1018
|
);
|
|
953
1019
|
}
|
|
954
|
-
function getUpgradeNonceAccountInstruction(input) {
|
|
955
|
-
const programAddress = SYSTEM_PROGRAM_ADDRESS;
|
|
1020
|
+
function getUpgradeNonceAccountInstruction(input, config) {
|
|
1021
|
+
const programAddress = config?.programAddress ?? SYSTEM_PROGRAM_ADDRESS;
|
|
956
1022
|
const originalAccounts = {
|
|
957
1023
|
nonceAccount: { value: input.nonceAccount ?? null, isWritable: true }
|
|
958
1024
|
};
|
|
@@ -985,13 +1051,20 @@ function parseUpgradeNonceAccountInstruction(instruction) {
|
|
|
985
1051
|
)
|
|
986
1052
|
};
|
|
987
1053
|
}
|
|
1054
|
+
var WITHDRAW_NONCE_ACCOUNT_DISCRIMINATOR = 5;
|
|
1055
|
+
function getWithdrawNonceAccountDiscriminatorBytes() {
|
|
1056
|
+
return getU32Encoder().encode(WITHDRAW_NONCE_ACCOUNT_DISCRIMINATOR);
|
|
1057
|
+
}
|
|
988
1058
|
function getWithdrawNonceAccountInstructionDataEncoder() {
|
|
989
1059
|
return transformEncoder(
|
|
990
1060
|
getStructEncoder([
|
|
991
1061
|
["discriminator", getU32Encoder()],
|
|
992
1062
|
["withdrawAmount", getU64Encoder()]
|
|
993
1063
|
]),
|
|
994
|
-
(value) => ({
|
|
1064
|
+
(value) => ({
|
|
1065
|
+
...value,
|
|
1066
|
+
discriminator: WITHDRAW_NONCE_ACCOUNT_DISCRIMINATOR
|
|
1067
|
+
})
|
|
995
1068
|
);
|
|
996
1069
|
}
|
|
997
1070
|
function getWithdrawNonceAccountInstructionDataDecoder() {
|
|
@@ -1006,8 +1079,8 @@ function getWithdrawNonceAccountInstructionDataCodec() {
|
|
|
1006
1079
|
getWithdrawNonceAccountInstructionDataDecoder()
|
|
1007
1080
|
);
|
|
1008
1081
|
}
|
|
1009
|
-
function getWithdrawNonceAccountInstruction(input) {
|
|
1010
|
-
const programAddress = SYSTEM_PROGRAM_ADDRESS;
|
|
1082
|
+
function getWithdrawNonceAccountInstruction(input, config) {
|
|
1083
|
+
const programAddress = config?.programAddress ?? SYSTEM_PROGRAM_ADDRESS;
|
|
1011
1084
|
const originalAccounts = {
|
|
1012
1085
|
nonceAccount: { value: input.nonceAccount ?? null, isWritable: true },
|
|
1013
1086
|
recipientAccount: {
|
|
@@ -1070,6 +1143,6 @@ function parseWithdrawNonceAccountInstruction(instruction) {
|
|
|
1070
1143
|
};
|
|
1071
1144
|
}
|
|
1072
1145
|
|
|
1073
|
-
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, isSystemError, parseAdvanceNonceAccountInstruction, parseAllocateInstruction, parseAllocateWithSeedInstruction, parseAssignInstruction, parseAssignWithSeedInstruction, parseAuthorizeNonceAccountInstruction, parseCreateAccountInstruction, parseCreateAccountWithSeedInstruction, parseInitializeNonceAccountInstruction, parseTransferSolInstruction, parseTransferSolWithSeedInstruction, parseUpgradeNonceAccountInstruction, parseWithdrawNonceAccountInstruction };
|
|
1146
|
+
export { ADVANCE_NONCE_ACCOUNT_DISCRIMINATOR, ALLOCATE_DISCRIMINATOR, ALLOCATE_WITH_SEED_DISCRIMINATOR, ASSIGN_DISCRIMINATOR, ASSIGN_WITH_SEED_DISCRIMINATOR, AUTHORIZE_NONCE_ACCOUNT_DISCRIMINATOR, CREATE_ACCOUNT_DISCRIMINATOR, CREATE_ACCOUNT_WITH_SEED_DISCRIMINATOR, INITIALIZE_NONCE_ACCOUNT_DISCRIMINATOR, 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, TRANSFER_SOL_DISCRIMINATOR, TRANSFER_SOL_WITH_SEED_DISCRIMINATOR, UPGRADE_NONCE_ACCOUNT_DISCRIMINATOR, WITHDRAW_NONCE_ACCOUNT_DISCRIMINATOR, decodeNonce, fetchAllMaybeNonce, fetchAllNonce, fetchMaybeNonce, fetchNonce, getAdvanceNonceAccountDiscriminatorBytes, getAdvanceNonceAccountInstruction, getAdvanceNonceAccountInstructionDataCodec, getAdvanceNonceAccountInstructionDataDecoder, getAdvanceNonceAccountInstructionDataEncoder, getAllocateDiscriminatorBytes, getAllocateInstruction, getAllocateInstructionDataCodec, getAllocateInstructionDataDecoder, getAllocateInstructionDataEncoder, getAllocateWithSeedDiscriminatorBytes, getAllocateWithSeedInstruction, getAllocateWithSeedInstructionDataCodec, getAllocateWithSeedInstructionDataDecoder, getAllocateWithSeedInstructionDataEncoder, getAssignDiscriminatorBytes, getAssignInstruction, getAssignInstructionDataCodec, getAssignInstructionDataDecoder, getAssignInstructionDataEncoder, getAssignWithSeedDiscriminatorBytes, getAssignWithSeedInstruction, getAssignWithSeedInstructionDataCodec, getAssignWithSeedInstructionDataDecoder, getAssignWithSeedInstructionDataEncoder, getAuthorizeNonceAccountDiscriminatorBytes, getAuthorizeNonceAccountInstruction, getAuthorizeNonceAccountInstructionDataCodec, getAuthorizeNonceAccountInstructionDataDecoder, getAuthorizeNonceAccountInstructionDataEncoder, getCreateAccountDiscriminatorBytes, getCreateAccountInstruction, getCreateAccountInstructionDataCodec, getCreateAccountInstructionDataDecoder, getCreateAccountInstructionDataEncoder, getCreateAccountWithSeedDiscriminatorBytes, getCreateAccountWithSeedInstruction, getCreateAccountWithSeedInstructionDataCodec, getCreateAccountWithSeedInstructionDataDecoder, getCreateAccountWithSeedInstructionDataEncoder, getInitializeNonceAccountDiscriminatorBytes, getInitializeNonceAccountInstruction, getInitializeNonceAccountInstructionDataCodec, getInitializeNonceAccountInstructionDataDecoder, getInitializeNonceAccountInstructionDataEncoder, getNonceCodec, getNonceDecoder, getNonceEncoder, getNonceSize, getNonceStateCodec, getNonceStateDecoder, getNonceStateEncoder, getNonceVersionCodec, getNonceVersionDecoder, getNonceVersionEncoder, getSystemErrorMessage, getTransferSolDiscriminatorBytes, getTransferSolInstruction, getTransferSolInstructionDataCodec, getTransferSolInstructionDataDecoder, getTransferSolInstructionDataEncoder, getTransferSolWithSeedDiscriminatorBytes, getTransferSolWithSeedInstruction, getTransferSolWithSeedInstructionDataCodec, getTransferSolWithSeedInstructionDataDecoder, getTransferSolWithSeedInstructionDataEncoder, getUpgradeNonceAccountDiscriminatorBytes, getUpgradeNonceAccountInstruction, getUpgradeNonceAccountInstructionDataCodec, getUpgradeNonceAccountInstructionDataDecoder, getUpgradeNonceAccountInstructionDataEncoder, getWithdrawNonceAccountDiscriminatorBytes, getWithdrawNonceAccountInstruction, getWithdrawNonceAccountInstructionDataCodec, getWithdrawNonceAccountInstructionDataDecoder, getWithdrawNonceAccountInstructionDataEncoder, identifySystemInstruction, isSystemError, parseAdvanceNonceAccountInstruction, parseAllocateInstruction, parseAllocateWithSeedInstruction, parseAssignInstruction, parseAssignWithSeedInstruction, parseAuthorizeNonceAccountInstruction, parseCreateAccountInstruction, parseCreateAccountWithSeedInstruction, parseInitializeNonceAccountInstruction, parseTransferSolInstruction, parseTransferSolWithSeedInstruction, parseUpgradeNonceAccountInstruction, parseWithdrawNonceAccountInstruction };
|
|
1074
1147
|
//# sourceMappingURL=index.mjs.map
|
|
1075
1148
|
//# sourceMappingURL=index.mjs.map
|