@solana-program/system 0.8.1 → 0.9.1
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 +60 -90
- package/dist/src/index.js.map +1 -1
- package/dist/src/index.mjs +60 -90
- package/dist/src/index.mjs.map +1 -1
- package/dist/types/generated/accounts/index.d.ts +2 -2
- package/dist/types/generated/accounts/nonce.d.ts +2 -2
- package/dist/types/generated/errors/index.d.ts +2 -2
- package/dist/types/generated/errors/system.d.ts +2 -2
- package/dist/types/generated/index.d.ts +2 -2
- package/dist/types/generated/instructions/advanceNonceAccount.d.ts +2 -2
- package/dist/types/generated/instructions/advanceNonceAccount.d.ts.map +1 -1
- package/dist/types/generated/instructions/allocate.d.ts +2 -2
- package/dist/types/generated/instructions/allocate.d.ts.map +1 -1
- package/dist/types/generated/instructions/allocateWithSeed.d.ts +2 -2
- package/dist/types/generated/instructions/allocateWithSeed.d.ts.map +1 -1
- package/dist/types/generated/instructions/assign.d.ts +2 -2
- package/dist/types/generated/instructions/assign.d.ts.map +1 -1
- package/dist/types/generated/instructions/assignWithSeed.d.ts +2 -2
- package/dist/types/generated/instructions/assignWithSeed.d.ts.map +1 -1
- package/dist/types/generated/instructions/authorizeNonceAccount.d.ts +2 -2
- package/dist/types/generated/instructions/authorizeNonceAccount.d.ts.map +1 -1
- package/dist/types/generated/instructions/createAccount.d.ts +2 -2
- package/dist/types/generated/instructions/createAccount.d.ts.map +1 -1
- package/dist/types/generated/instructions/createAccountWithSeed.d.ts +2 -2
- package/dist/types/generated/instructions/createAccountWithSeed.d.ts.map +1 -1
- package/dist/types/generated/instructions/index.d.ts +2 -2
- package/dist/types/generated/instructions/initializeNonceAccount.d.ts +2 -2
- package/dist/types/generated/instructions/initializeNonceAccount.d.ts.map +1 -1
- package/dist/types/generated/instructions/transferSol.d.ts +2 -2
- package/dist/types/generated/instructions/transferSol.d.ts.map +1 -1
- package/dist/types/generated/instructions/transferSolWithSeed.d.ts +2 -2
- package/dist/types/generated/instructions/transferSolWithSeed.d.ts.map +1 -1
- package/dist/types/generated/instructions/upgradeNonceAccount.d.ts +2 -2
- package/dist/types/generated/instructions/upgradeNonceAccount.d.ts.map +1 -1
- package/dist/types/generated/instructions/withdrawNonceAccount.d.ts +2 -2
- package/dist/types/generated/instructions/withdrawNonceAccount.d.ts.map +1 -1
- package/dist/types/generated/programs/index.d.ts +2 -2
- package/dist/types/generated/programs/system.d.ts +2 -2
- package/dist/types/generated/shared/index.d.ts +2 -2
- package/dist/types/generated/types/index.d.ts +2 -2
- package/dist/types/generated/types/nonceState.d.ts +2 -2
- package/dist/types/generated/types/nonceVersion.d.ts +2 -2
- package/package.json +3 -3
package/dist/src/index.js
CHANGED
|
@@ -253,16 +253,15 @@ function getAdvanceNonceAccountInstruction(input, config) {
|
|
|
253
253
|
accounts.recentBlockhashesSysvar.value = "SysvarRecentB1ockHashes11111111111111111111";
|
|
254
254
|
}
|
|
255
255
|
const getAccountMeta = getAccountMetaFactory();
|
|
256
|
-
|
|
256
|
+
return Object.freeze({
|
|
257
257
|
accounts: [
|
|
258
258
|
getAccountMeta(accounts.nonceAccount),
|
|
259
259
|
getAccountMeta(accounts.recentBlockhashesSysvar),
|
|
260
260
|
getAccountMeta(accounts.nonceAuthority)
|
|
261
261
|
],
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
};
|
|
265
|
-
return instruction;
|
|
262
|
+
data: getAdvanceNonceAccountInstructionDataEncoder().encode({}),
|
|
263
|
+
programAddress
|
|
264
|
+
});
|
|
266
265
|
}
|
|
267
266
|
function parseAdvanceNonceAccountInstruction(instruction) {
|
|
268
267
|
if (instruction.accounts.length < 3) {
|
|
@@ -319,14 +318,13 @@ function getAllocateInstruction(input, config) {
|
|
|
319
318
|
const accounts = originalAccounts;
|
|
320
319
|
const args = { ...input };
|
|
321
320
|
const getAccountMeta = getAccountMetaFactory();
|
|
322
|
-
|
|
321
|
+
return Object.freeze({
|
|
323
322
|
accounts: [getAccountMeta(accounts.newAccount)],
|
|
324
|
-
programAddress,
|
|
325
323
|
data: getAllocateInstructionDataEncoder().encode(
|
|
326
324
|
args
|
|
327
|
-
)
|
|
328
|
-
|
|
329
|
-
|
|
325
|
+
),
|
|
326
|
+
programAddress
|
|
327
|
+
});
|
|
330
328
|
}
|
|
331
329
|
function parseAllocateInstruction(instruction) {
|
|
332
330
|
if (instruction.accounts.length < 1) {
|
|
@@ -340,9 +338,7 @@ function parseAllocateInstruction(instruction) {
|
|
|
340
338
|
};
|
|
341
339
|
return {
|
|
342
340
|
programAddress: instruction.programAddress,
|
|
343
|
-
accounts: {
|
|
344
|
-
newAccount: getNextAccount()
|
|
345
|
-
},
|
|
341
|
+
accounts: { newAccount: getNextAccount() },
|
|
346
342
|
data: getAllocateInstructionDataDecoder().decode(instruction.data)
|
|
347
343
|
};
|
|
348
344
|
}
|
|
@@ -386,17 +382,16 @@ function getAllocateWithSeedInstruction(input, config) {
|
|
|
386
382
|
const accounts = originalAccounts;
|
|
387
383
|
const args = { ...input };
|
|
388
384
|
const getAccountMeta = getAccountMetaFactory();
|
|
389
|
-
|
|
385
|
+
return Object.freeze({
|
|
390
386
|
accounts: [
|
|
391
387
|
getAccountMeta(accounts.newAccount),
|
|
392
388
|
getAccountMeta(accounts.baseAccount)
|
|
393
389
|
],
|
|
394
|
-
programAddress,
|
|
395
390
|
data: getAllocateWithSeedInstructionDataEncoder().encode(
|
|
396
391
|
args
|
|
397
|
-
)
|
|
398
|
-
|
|
399
|
-
|
|
392
|
+
),
|
|
393
|
+
programAddress
|
|
394
|
+
});
|
|
400
395
|
}
|
|
401
396
|
function parseAllocateWithSeedInstruction(instruction) {
|
|
402
397
|
if (instruction.accounts.length < 2) {
|
|
@@ -410,10 +405,7 @@ function parseAllocateWithSeedInstruction(instruction) {
|
|
|
410
405
|
};
|
|
411
406
|
return {
|
|
412
407
|
programAddress: instruction.programAddress,
|
|
413
|
-
accounts: {
|
|
414
|
-
newAccount: getNextAccount(),
|
|
415
|
-
baseAccount: getNextAccount()
|
|
416
|
-
},
|
|
408
|
+
accounts: { newAccount: getNextAccount(), baseAccount: getNextAccount() },
|
|
417
409
|
data: getAllocateWithSeedInstructionDataDecoder().decode(instruction.data)
|
|
418
410
|
};
|
|
419
411
|
}
|
|
@@ -450,14 +442,13 @@ function getAssignInstruction(input, config) {
|
|
|
450
442
|
const accounts = originalAccounts;
|
|
451
443
|
const args = { ...input };
|
|
452
444
|
const getAccountMeta = getAccountMetaFactory();
|
|
453
|
-
|
|
445
|
+
return Object.freeze({
|
|
454
446
|
accounts: [getAccountMeta(accounts.account)],
|
|
455
|
-
programAddress,
|
|
456
447
|
data: getAssignInstructionDataEncoder().encode(
|
|
457
448
|
args
|
|
458
|
-
)
|
|
459
|
-
|
|
460
|
-
|
|
449
|
+
),
|
|
450
|
+
programAddress
|
|
451
|
+
});
|
|
461
452
|
}
|
|
462
453
|
function parseAssignInstruction(instruction) {
|
|
463
454
|
if (instruction.accounts.length < 1) {
|
|
@@ -471,9 +462,7 @@ function parseAssignInstruction(instruction) {
|
|
|
471
462
|
};
|
|
472
463
|
return {
|
|
473
464
|
programAddress: instruction.programAddress,
|
|
474
|
-
accounts: {
|
|
475
|
-
account: getNextAccount()
|
|
476
|
-
},
|
|
465
|
+
accounts: { account: getNextAccount() },
|
|
477
466
|
data: getAssignInstructionDataDecoder().decode(instruction.data)
|
|
478
467
|
};
|
|
479
468
|
}
|
|
@@ -515,17 +504,16 @@ function getAssignWithSeedInstruction(input, config) {
|
|
|
515
504
|
const accounts = originalAccounts;
|
|
516
505
|
const args = { ...input };
|
|
517
506
|
const getAccountMeta = getAccountMetaFactory();
|
|
518
|
-
|
|
507
|
+
return Object.freeze({
|
|
519
508
|
accounts: [
|
|
520
509
|
getAccountMeta(accounts.account),
|
|
521
510
|
getAccountMeta(accounts.baseAccount)
|
|
522
511
|
],
|
|
523
|
-
programAddress,
|
|
524
512
|
data: getAssignWithSeedInstructionDataEncoder().encode(
|
|
525
513
|
args
|
|
526
|
-
)
|
|
527
|
-
|
|
528
|
-
|
|
514
|
+
),
|
|
515
|
+
programAddress
|
|
516
|
+
});
|
|
529
517
|
}
|
|
530
518
|
function parseAssignWithSeedInstruction(instruction) {
|
|
531
519
|
if (instruction.accounts.length < 2) {
|
|
@@ -539,10 +527,7 @@ function parseAssignWithSeedInstruction(instruction) {
|
|
|
539
527
|
};
|
|
540
528
|
return {
|
|
541
529
|
programAddress: instruction.programAddress,
|
|
542
|
-
accounts: {
|
|
543
|
-
account: getNextAccount(),
|
|
544
|
-
baseAccount: getNextAccount()
|
|
545
|
-
},
|
|
530
|
+
accounts: { account: getNextAccount(), baseAccount: getNextAccount() },
|
|
546
531
|
data: getAssignWithSeedInstructionDataDecoder().decode(instruction.data)
|
|
547
532
|
};
|
|
548
533
|
}
|
|
@@ -583,17 +568,16 @@ function getAuthorizeNonceAccountInstruction(input, config) {
|
|
|
583
568
|
const accounts = originalAccounts;
|
|
584
569
|
const args = { ...input };
|
|
585
570
|
const getAccountMeta = getAccountMetaFactory();
|
|
586
|
-
|
|
571
|
+
return Object.freeze({
|
|
587
572
|
accounts: [
|
|
588
573
|
getAccountMeta(accounts.nonceAccount),
|
|
589
574
|
getAccountMeta(accounts.nonceAuthority)
|
|
590
575
|
],
|
|
591
|
-
programAddress,
|
|
592
576
|
data: getAuthorizeNonceAccountInstructionDataEncoder().encode(
|
|
593
577
|
args
|
|
594
|
-
)
|
|
595
|
-
|
|
596
|
-
|
|
578
|
+
),
|
|
579
|
+
programAddress
|
|
580
|
+
});
|
|
597
581
|
}
|
|
598
582
|
function parseAuthorizeNonceAccountInstruction(instruction) {
|
|
599
583
|
if (instruction.accounts.length < 2) {
|
|
@@ -658,17 +642,17 @@ function getCreateAccountInstruction(input, config) {
|
|
|
658
642
|
0
|
|
659
643
|
);
|
|
660
644
|
const getAccountMeta = getAccountMetaFactory();
|
|
661
|
-
|
|
645
|
+
return Object.freeze({
|
|
662
646
|
accounts: [
|
|
663
647
|
getAccountMeta(accounts.payer),
|
|
664
648
|
getAccountMeta(accounts.newAccount)
|
|
665
649
|
],
|
|
666
|
-
|
|
650
|
+
byteDelta,
|
|
667
651
|
data: getCreateAccountInstructionDataEncoder().encode(
|
|
668
652
|
args
|
|
669
|
-
)
|
|
670
|
-
|
|
671
|
-
|
|
653
|
+
),
|
|
654
|
+
programAddress
|
|
655
|
+
});
|
|
672
656
|
}
|
|
673
657
|
function parseCreateAccountInstruction(instruction) {
|
|
674
658
|
if (instruction.accounts.length < 2) {
|
|
@@ -682,10 +666,7 @@ function parseCreateAccountInstruction(instruction) {
|
|
|
682
666
|
};
|
|
683
667
|
return {
|
|
684
668
|
programAddress: instruction.programAddress,
|
|
685
|
-
accounts: {
|
|
686
|
-
payer: getNextAccount(),
|
|
687
|
-
newAccount: getNextAccount()
|
|
688
|
-
},
|
|
669
|
+
accounts: { payer: getNextAccount(), newAccount: getNextAccount() },
|
|
689
670
|
data: getCreateAccountInstructionDataDecoder().decode(instruction.data)
|
|
690
671
|
};
|
|
691
672
|
}
|
|
@@ -735,18 +716,17 @@ function getCreateAccountWithSeedInstruction(input, config) {
|
|
|
735
716
|
const accounts = originalAccounts;
|
|
736
717
|
const args = { ...input };
|
|
737
718
|
const getAccountMeta = getAccountMetaFactory();
|
|
738
|
-
|
|
719
|
+
return Object.freeze({
|
|
739
720
|
accounts: [
|
|
740
721
|
getAccountMeta(accounts.payer),
|
|
741
722
|
getAccountMeta(accounts.newAccount),
|
|
742
723
|
getAccountMeta(accounts.baseAccount)
|
|
743
724
|
].filter((x) => x !== void 0),
|
|
744
|
-
programAddress,
|
|
745
725
|
data: getCreateAccountWithSeedInstructionDataEncoder().encode(
|
|
746
726
|
args
|
|
747
|
-
)
|
|
748
|
-
|
|
749
|
-
|
|
727
|
+
),
|
|
728
|
+
programAddress
|
|
729
|
+
});
|
|
750
730
|
}
|
|
751
731
|
function parseCreateAccountWithSeedInstruction(instruction) {
|
|
752
732
|
if (instruction.accounts.length < 2) {
|
|
@@ -823,18 +803,17 @@ function getInitializeNonceAccountInstruction(input, config) {
|
|
|
823
803
|
accounts.rentSysvar.value = "SysvarRent111111111111111111111111111111111";
|
|
824
804
|
}
|
|
825
805
|
const getAccountMeta = getAccountMetaFactory();
|
|
826
|
-
|
|
806
|
+
return Object.freeze({
|
|
827
807
|
accounts: [
|
|
828
808
|
getAccountMeta(accounts.nonceAccount),
|
|
829
809
|
getAccountMeta(accounts.recentBlockhashesSysvar),
|
|
830
810
|
getAccountMeta(accounts.rentSysvar)
|
|
831
811
|
],
|
|
832
|
-
programAddress,
|
|
833
812
|
data: getInitializeNonceAccountInstructionDataEncoder().encode(
|
|
834
813
|
args
|
|
835
|
-
)
|
|
836
|
-
|
|
837
|
-
|
|
814
|
+
),
|
|
815
|
+
programAddress
|
|
816
|
+
});
|
|
838
817
|
}
|
|
839
818
|
function parseInitializeNonceAccountInstruction(instruction) {
|
|
840
819
|
if (instruction.accounts.length < 3) {
|
|
@@ -892,17 +871,16 @@ function getTransferSolInstruction(input, config) {
|
|
|
892
871
|
const accounts = originalAccounts;
|
|
893
872
|
const args = { ...input };
|
|
894
873
|
const getAccountMeta = getAccountMetaFactory();
|
|
895
|
-
|
|
874
|
+
return Object.freeze({
|
|
896
875
|
accounts: [
|
|
897
876
|
getAccountMeta(accounts.source),
|
|
898
877
|
getAccountMeta(accounts.destination)
|
|
899
878
|
],
|
|
900
|
-
programAddress,
|
|
901
879
|
data: getTransferSolInstructionDataEncoder().encode(
|
|
902
880
|
args
|
|
903
|
-
)
|
|
904
|
-
|
|
905
|
-
|
|
881
|
+
),
|
|
882
|
+
programAddress
|
|
883
|
+
});
|
|
906
884
|
}
|
|
907
885
|
function parseTransferSolInstruction(instruction) {
|
|
908
886
|
if (instruction.accounts.length < 2) {
|
|
@@ -916,10 +894,7 @@ function parseTransferSolInstruction(instruction) {
|
|
|
916
894
|
};
|
|
917
895
|
return {
|
|
918
896
|
programAddress: instruction.programAddress,
|
|
919
|
-
accounts: {
|
|
920
|
-
source: getNextAccount(),
|
|
921
|
-
destination: getNextAccount()
|
|
922
|
-
},
|
|
897
|
+
accounts: { source: getNextAccount(), destination: getNextAccount() },
|
|
923
898
|
data: getTransferSolInstructionDataDecoder().decode(instruction.data)
|
|
924
899
|
};
|
|
925
900
|
}
|
|
@@ -965,18 +940,17 @@ function getTransferSolWithSeedInstruction(input, config) {
|
|
|
965
940
|
const accounts = originalAccounts;
|
|
966
941
|
const args = { ...input };
|
|
967
942
|
const getAccountMeta = getAccountMetaFactory();
|
|
968
|
-
|
|
943
|
+
return Object.freeze({
|
|
969
944
|
accounts: [
|
|
970
945
|
getAccountMeta(accounts.source),
|
|
971
946
|
getAccountMeta(accounts.baseAccount),
|
|
972
947
|
getAccountMeta(accounts.destination)
|
|
973
948
|
],
|
|
974
|
-
programAddress,
|
|
975
949
|
data: getTransferSolWithSeedInstructionDataEncoder().encode(
|
|
976
950
|
args
|
|
977
|
-
)
|
|
978
|
-
|
|
979
|
-
|
|
951
|
+
),
|
|
952
|
+
programAddress
|
|
953
|
+
});
|
|
980
954
|
}
|
|
981
955
|
function parseTransferSolWithSeedInstruction(instruction) {
|
|
982
956
|
if (instruction.accounts.length < 3) {
|
|
@@ -1029,12 +1003,11 @@ function getUpgradeNonceAccountInstruction(input, config) {
|
|
|
1029
1003
|
};
|
|
1030
1004
|
const accounts = originalAccounts;
|
|
1031
1005
|
const getAccountMeta = getAccountMetaFactory();
|
|
1032
|
-
|
|
1006
|
+
return Object.freeze({
|
|
1033
1007
|
accounts: [getAccountMeta(accounts.nonceAccount)],
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
};
|
|
1037
|
-
return instruction;
|
|
1008
|
+
data: getUpgradeNonceAccountInstructionDataEncoder().encode({}),
|
|
1009
|
+
programAddress
|
|
1010
|
+
});
|
|
1038
1011
|
}
|
|
1039
1012
|
function parseUpgradeNonceAccountInstruction(instruction) {
|
|
1040
1013
|
if (instruction.accounts.length < 1) {
|
|
@@ -1048,9 +1021,7 @@ function parseUpgradeNonceAccountInstruction(instruction) {
|
|
|
1048
1021
|
};
|
|
1049
1022
|
return {
|
|
1050
1023
|
programAddress: instruction.programAddress,
|
|
1051
|
-
accounts: {
|
|
1052
|
-
nonceAccount: getNextAccount()
|
|
1053
|
-
},
|
|
1024
|
+
accounts: { nonceAccount: getNextAccount() },
|
|
1054
1025
|
data: getUpgradeNonceAccountInstructionDataDecoder().decode(
|
|
1055
1026
|
instruction.data
|
|
1056
1027
|
)
|
|
@@ -1108,7 +1079,7 @@ function getWithdrawNonceAccountInstruction(input, config) {
|
|
|
1108
1079
|
accounts.rentSysvar.value = "SysvarRent111111111111111111111111111111111";
|
|
1109
1080
|
}
|
|
1110
1081
|
const getAccountMeta = getAccountMetaFactory();
|
|
1111
|
-
|
|
1082
|
+
return Object.freeze({
|
|
1112
1083
|
accounts: [
|
|
1113
1084
|
getAccountMeta(accounts.nonceAccount),
|
|
1114
1085
|
getAccountMeta(accounts.recipientAccount),
|
|
@@ -1116,12 +1087,11 @@ function getWithdrawNonceAccountInstruction(input, config) {
|
|
|
1116
1087
|
getAccountMeta(accounts.rentSysvar),
|
|
1117
1088
|
getAccountMeta(accounts.nonceAuthority)
|
|
1118
1089
|
],
|
|
1119
|
-
programAddress,
|
|
1120
1090
|
data: getWithdrawNonceAccountInstructionDataEncoder().encode(
|
|
1121
1091
|
args
|
|
1122
|
-
)
|
|
1123
|
-
|
|
1124
|
-
|
|
1092
|
+
),
|
|
1093
|
+
programAddress
|
|
1094
|
+
});
|
|
1125
1095
|
}
|
|
1126
1096
|
function parseWithdrawNonceAccountInstruction(instruction) {
|
|
1127
1097
|
if (instruction.accounts.length < 5) {
|