@solana-program/system 0.8.1 → 0.9.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.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.mjs
CHANGED
|
@@ -251,16 +251,15 @@ function getAdvanceNonceAccountInstruction(input, config) {
|
|
|
251
251
|
accounts.recentBlockhashesSysvar.value = "SysvarRecentB1ockHashes11111111111111111111";
|
|
252
252
|
}
|
|
253
253
|
const getAccountMeta = getAccountMetaFactory();
|
|
254
|
-
|
|
254
|
+
return Object.freeze({
|
|
255
255
|
accounts: [
|
|
256
256
|
getAccountMeta(accounts.nonceAccount),
|
|
257
257
|
getAccountMeta(accounts.recentBlockhashesSysvar),
|
|
258
258
|
getAccountMeta(accounts.nonceAuthority)
|
|
259
259
|
],
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
};
|
|
263
|
-
return instruction;
|
|
260
|
+
data: getAdvanceNonceAccountInstructionDataEncoder().encode({}),
|
|
261
|
+
programAddress
|
|
262
|
+
});
|
|
264
263
|
}
|
|
265
264
|
function parseAdvanceNonceAccountInstruction(instruction) {
|
|
266
265
|
if (instruction.accounts.length < 3) {
|
|
@@ -317,14 +316,13 @@ function getAllocateInstruction(input, config) {
|
|
|
317
316
|
const accounts = originalAccounts;
|
|
318
317
|
const args = { ...input };
|
|
319
318
|
const getAccountMeta = getAccountMetaFactory();
|
|
320
|
-
|
|
319
|
+
return Object.freeze({
|
|
321
320
|
accounts: [getAccountMeta(accounts.newAccount)],
|
|
322
|
-
programAddress,
|
|
323
321
|
data: getAllocateInstructionDataEncoder().encode(
|
|
324
322
|
args
|
|
325
|
-
)
|
|
326
|
-
|
|
327
|
-
|
|
323
|
+
),
|
|
324
|
+
programAddress
|
|
325
|
+
});
|
|
328
326
|
}
|
|
329
327
|
function parseAllocateInstruction(instruction) {
|
|
330
328
|
if (instruction.accounts.length < 1) {
|
|
@@ -338,9 +336,7 @@ function parseAllocateInstruction(instruction) {
|
|
|
338
336
|
};
|
|
339
337
|
return {
|
|
340
338
|
programAddress: instruction.programAddress,
|
|
341
|
-
accounts: {
|
|
342
|
-
newAccount: getNextAccount()
|
|
343
|
-
},
|
|
339
|
+
accounts: { newAccount: getNextAccount() },
|
|
344
340
|
data: getAllocateInstructionDataDecoder().decode(instruction.data)
|
|
345
341
|
};
|
|
346
342
|
}
|
|
@@ -384,17 +380,16 @@ function getAllocateWithSeedInstruction(input, config) {
|
|
|
384
380
|
const accounts = originalAccounts;
|
|
385
381
|
const args = { ...input };
|
|
386
382
|
const getAccountMeta = getAccountMetaFactory();
|
|
387
|
-
|
|
383
|
+
return Object.freeze({
|
|
388
384
|
accounts: [
|
|
389
385
|
getAccountMeta(accounts.newAccount),
|
|
390
386
|
getAccountMeta(accounts.baseAccount)
|
|
391
387
|
],
|
|
392
|
-
programAddress,
|
|
393
388
|
data: getAllocateWithSeedInstructionDataEncoder().encode(
|
|
394
389
|
args
|
|
395
|
-
)
|
|
396
|
-
|
|
397
|
-
|
|
390
|
+
),
|
|
391
|
+
programAddress
|
|
392
|
+
});
|
|
398
393
|
}
|
|
399
394
|
function parseAllocateWithSeedInstruction(instruction) {
|
|
400
395
|
if (instruction.accounts.length < 2) {
|
|
@@ -408,10 +403,7 @@ function parseAllocateWithSeedInstruction(instruction) {
|
|
|
408
403
|
};
|
|
409
404
|
return {
|
|
410
405
|
programAddress: instruction.programAddress,
|
|
411
|
-
accounts: {
|
|
412
|
-
newAccount: getNextAccount(),
|
|
413
|
-
baseAccount: getNextAccount()
|
|
414
|
-
},
|
|
406
|
+
accounts: { newAccount: getNextAccount(), baseAccount: getNextAccount() },
|
|
415
407
|
data: getAllocateWithSeedInstructionDataDecoder().decode(instruction.data)
|
|
416
408
|
};
|
|
417
409
|
}
|
|
@@ -448,14 +440,13 @@ function getAssignInstruction(input, config) {
|
|
|
448
440
|
const accounts = originalAccounts;
|
|
449
441
|
const args = { ...input };
|
|
450
442
|
const getAccountMeta = getAccountMetaFactory();
|
|
451
|
-
|
|
443
|
+
return Object.freeze({
|
|
452
444
|
accounts: [getAccountMeta(accounts.account)],
|
|
453
|
-
programAddress,
|
|
454
445
|
data: getAssignInstructionDataEncoder().encode(
|
|
455
446
|
args
|
|
456
|
-
)
|
|
457
|
-
|
|
458
|
-
|
|
447
|
+
),
|
|
448
|
+
programAddress
|
|
449
|
+
});
|
|
459
450
|
}
|
|
460
451
|
function parseAssignInstruction(instruction) {
|
|
461
452
|
if (instruction.accounts.length < 1) {
|
|
@@ -469,9 +460,7 @@ function parseAssignInstruction(instruction) {
|
|
|
469
460
|
};
|
|
470
461
|
return {
|
|
471
462
|
programAddress: instruction.programAddress,
|
|
472
|
-
accounts: {
|
|
473
|
-
account: getNextAccount()
|
|
474
|
-
},
|
|
463
|
+
accounts: { account: getNextAccount() },
|
|
475
464
|
data: getAssignInstructionDataDecoder().decode(instruction.data)
|
|
476
465
|
};
|
|
477
466
|
}
|
|
@@ -513,17 +502,16 @@ function getAssignWithSeedInstruction(input, config) {
|
|
|
513
502
|
const accounts = originalAccounts;
|
|
514
503
|
const args = { ...input };
|
|
515
504
|
const getAccountMeta = getAccountMetaFactory();
|
|
516
|
-
|
|
505
|
+
return Object.freeze({
|
|
517
506
|
accounts: [
|
|
518
507
|
getAccountMeta(accounts.account),
|
|
519
508
|
getAccountMeta(accounts.baseAccount)
|
|
520
509
|
],
|
|
521
|
-
programAddress,
|
|
522
510
|
data: getAssignWithSeedInstructionDataEncoder().encode(
|
|
523
511
|
args
|
|
524
|
-
)
|
|
525
|
-
|
|
526
|
-
|
|
512
|
+
),
|
|
513
|
+
programAddress
|
|
514
|
+
});
|
|
527
515
|
}
|
|
528
516
|
function parseAssignWithSeedInstruction(instruction) {
|
|
529
517
|
if (instruction.accounts.length < 2) {
|
|
@@ -537,10 +525,7 @@ function parseAssignWithSeedInstruction(instruction) {
|
|
|
537
525
|
};
|
|
538
526
|
return {
|
|
539
527
|
programAddress: instruction.programAddress,
|
|
540
|
-
accounts: {
|
|
541
|
-
account: getNextAccount(),
|
|
542
|
-
baseAccount: getNextAccount()
|
|
543
|
-
},
|
|
528
|
+
accounts: { account: getNextAccount(), baseAccount: getNextAccount() },
|
|
544
529
|
data: getAssignWithSeedInstructionDataDecoder().decode(instruction.data)
|
|
545
530
|
};
|
|
546
531
|
}
|
|
@@ -581,17 +566,16 @@ function getAuthorizeNonceAccountInstruction(input, config) {
|
|
|
581
566
|
const accounts = originalAccounts;
|
|
582
567
|
const args = { ...input };
|
|
583
568
|
const getAccountMeta = getAccountMetaFactory();
|
|
584
|
-
|
|
569
|
+
return Object.freeze({
|
|
585
570
|
accounts: [
|
|
586
571
|
getAccountMeta(accounts.nonceAccount),
|
|
587
572
|
getAccountMeta(accounts.nonceAuthority)
|
|
588
573
|
],
|
|
589
|
-
programAddress,
|
|
590
574
|
data: getAuthorizeNonceAccountInstructionDataEncoder().encode(
|
|
591
575
|
args
|
|
592
|
-
)
|
|
593
|
-
|
|
594
|
-
|
|
576
|
+
),
|
|
577
|
+
programAddress
|
|
578
|
+
});
|
|
595
579
|
}
|
|
596
580
|
function parseAuthorizeNonceAccountInstruction(instruction) {
|
|
597
581
|
if (instruction.accounts.length < 2) {
|
|
@@ -656,17 +640,17 @@ function getCreateAccountInstruction(input, config) {
|
|
|
656
640
|
0
|
|
657
641
|
);
|
|
658
642
|
const getAccountMeta = getAccountMetaFactory();
|
|
659
|
-
|
|
643
|
+
return Object.freeze({
|
|
660
644
|
accounts: [
|
|
661
645
|
getAccountMeta(accounts.payer),
|
|
662
646
|
getAccountMeta(accounts.newAccount)
|
|
663
647
|
],
|
|
664
|
-
|
|
648
|
+
byteDelta,
|
|
665
649
|
data: getCreateAccountInstructionDataEncoder().encode(
|
|
666
650
|
args
|
|
667
|
-
)
|
|
668
|
-
|
|
669
|
-
|
|
651
|
+
),
|
|
652
|
+
programAddress
|
|
653
|
+
});
|
|
670
654
|
}
|
|
671
655
|
function parseCreateAccountInstruction(instruction) {
|
|
672
656
|
if (instruction.accounts.length < 2) {
|
|
@@ -680,10 +664,7 @@ function parseCreateAccountInstruction(instruction) {
|
|
|
680
664
|
};
|
|
681
665
|
return {
|
|
682
666
|
programAddress: instruction.programAddress,
|
|
683
|
-
accounts: {
|
|
684
|
-
payer: getNextAccount(),
|
|
685
|
-
newAccount: getNextAccount()
|
|
686
|
-
},
|
|
667
|
+
accounts: { payer: getNextAccount(), newAccount: getNextAccount() },
|
|
687
668
|
data: getCreateAccountInstructionDataDecoder().decode(instruction.data)
|
|
688
669
|
};
|
|
689
670
|
}
|
|
@@ -733,18 +714,17 @@ function getCreateAccountWithSeedInstruction(input, config) {
|
|
|
733
714
|
const accounts = originalAccounts;
|
|
734
715
|
const args = { ...input };
|
|
735
716
|
const getAccountMeta = getAccountMetaFactory();
|
|
736
|
-
|
|
717
|
+
return Object.freeze({
|
|
737
718
|
accounts: [
|
|
738
719
|
getAccountMeta(accounts.payer),
|
|
739
720
|
getAccountMeta(accounts.newAccount),
|
|
740
721
|
getAccountMeta(accounts.baseAccount)
|
|
741
722
|
].filter((x) => x !== void 0),
|
|
742
|
-
programAddress,
|
|
743
723
|
data: getCreateAccountWithSeedInstructionDataEncoder().encode(
|
|
744
724
|
args
|
|
745
|
-
)
|
|
746
|
-
|
|
747
|
-
|
|
725
|
+
),
|
|
726
|
+
programAddress
|
|
727
|
+
});
|
|
748
728
|
}
|
|
749
729
|
function parseCreateAccountWithSeedInstruction(instruction) {
|
|
750
730
|
if (instruction.accounts.length < 2) {
|
|
@@ -821,18 +801,17 @@ function getInitializeNonceAccountInstruction(input, config) {
|
|
|
821
801
|
accounts.rentSysvar.value = "SysvarRent111111111111111111111111111111111";
|
|
822
802
|
}
|
|
823
803
|
const getAccountMeta = getAccountMetaFactory();
|
|
824
|
-
|
|
804
|
+
return Object.freeze({
|
|
825
805
|
accounts: [
|
|
826
806
|
getAccountMeta(accounts.nonceAccount),
|
|
827
807
|
getAccountMeta(accounts.recentBlockhashesSysvar),
|
|
828
808
|
getAccountMeta(accounts.rentSysvar)
|
|
829
809
|
],
|
|
830
|
-
programAddress,
|
|
831
810
|
data: getInitializeNonceAccountInstructionDataEncoder().encode(
|
|
832
811
|
args
|
|
833
|
-
)
|
|
834
|
-
|
|
835
|
-
|
|
812
|
+
),
|
|
813
|
+
programAddress
|
|
814
|
+
});
|
|
836
815
|
}
|
|
837
816
|
function parseInitializeNonceAccountInstruction(instruction) {
|
|
838
817
|
if (instruction.accounts.length < 3) {
|
|
@@ -890,17 +869,16 @@ function getTransferSolInstruction(input, config) {
|
|
|
890
869
|
const accounts = originalAccounts;
|
|
891
870
|
const args = { ...input };
|
|
892
871
|
const getAccountMeta = getAccountMetaFactory();
|
|
893
|
-
|
|
872
|
+
return Object.freeze({
|
|
894
873
|
accounts: [
|
|
895
874
|
getAccountMeta(accounts.source),
|
|
896
875
|
getAccountMeta(accounts.destination)
|
|
897
876
|
],
|
|
898
|
-
programAddress,
|
|
899
877
|
data: getTransferSolInstructionDataEncoder().encode(
|
|
900
878
|
args
|
|
901
|
-
)
|
|
902
|
-
|
|
903
|
-
|
|
879
|
+
),
|
|
880
|
+
programAddress
|
|
881
|
+
});
|
|
904
882
|
}
|
|
905
883
|
function parseTransferSolInstruction(instruction) {
|
|
906
884
|
if (instruction.accounts.length < 2) {
|
|
@@ -914,10 +892,7 @@ function parseTransferSolInstruction(instruction) {
|
|
|
914
892
|
};
|
|
915
893
|
return {
|
|
916
894
|
programAddress: instruction.programAddress,
|
|
917
|
-
accounts: {
|
|
918
|
-
source: getNextAccount(),
|
|
919
|
-
destination: getNextAccount()
|
|
920
|
-
},
|
|
895
|
+
accounts: { source: getNextAccount(), destination: getNextAccount() },
|
|
921
896
|
data: getTransferSolInstructionDataDecoder().decode(instruction.data)
|
|
922
897
|
};
|
|
923
898
|
}
|
|
@@ -963,18 +938,17 @@ function getTransferSolWithSeedInstruction(input, config) {
|
|
|
963
938
|
const accounts = originalAccounts;
|
|
964
939
|
const args = { ...input };
|
|
965
940
|
const getAccountMeta = getAccountMetaFactory();
|
|
966
|
-
|
|
941
|
+
return Object.freeze({
|
|
967
942
|
accounts: [
|
|
968
943
|
getAccountMeta(accounts.source),
|
|
969
944
|
getAccountMeta(accounts.baseAccount),
|
|
970
945
|
getAccountMeta(accounts.destination)
|
|
971
946
|
],
|
|
972
|
-
programAddress,
|
|
973
947
|
data: getTransferSolWithSeedInstructionDataEncoder().encode(
|
|
974
948
|
args
|
|
975
|
-
)
|
|
976
|
-
|
|
977
|
-
|
|
949
|
+
),
|
|
950
|
+
programAddress
|
|
951
|
+
});
|
|
978
952
|
}
|
|
979
953
|
function parseTransferSolWithSeedInstruction(instruction) {
|
|
980
954
|
if (instruction.accounts.length < 3) {
|
|
@@ -1027,12 +1001,11 @@ function getUpgradeNonceAccountInstruction(input, config) {
|
|
|
1027
1001
|
};
|
|
1028
1002
|
const accounts = originalAccounts;
|
|
1029
1003
|
const getAccountMeta = getAccountMetaFactory();
|
|
1030
|
-
|
|
1004
|
+
return Object.freeze({
|
|
1031
1005
|
accounts: [getAccountMeta(accounts.nonceAccount)],
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
};
|
|
1035
|
-
return instruction;
|
|
1006
|
+
data: getUpgradeNonceAccountInstructionDataEncoder().encode({}),
|
|
1007
|
+
programAddress
|
|
1008
|
+
});
|
|
1036
1009
|
}
|
|
1037
1010
|
function parseUpgradeNonceAccountInstruction(instruction) {
|
|
1038
1011
|
if (instruction.accounts.length < 1) {
|
|
@@ -1046,9 +1019,7 @@ function parseUpgradeNonceAccountInstruction(instruction) {
|
|
|
1046
1019
|
};
|
|
1047
1020
|
return {
|
|
1048
1021
|
programAddress: instruction.programAddress,
|
|
1049
|
-
accounts: {
|
|
1050
|
-
nonceAccount: getNextAccount()
|
|
1051
|
-
},
|
|
1022
|
+
accounts: { nonceAccount: getNextAccount() },
|
|
1052
1023
|
data: getUpgradeNonceAccountInstructionDataDecoder().decode(
|
|
1053
1024
|
instruction.data
|
|
1054
1025
|
)
|
|
@@ -1106,7 +1077,7 @@ function getWithdrawNonceAccountInstruction(input, config) {
|
|
|
1106
1077
|
accounts.rentSysvar.value = "SysvarRent111111111111111111111111111111111";
|
|
1107
1078
|
}
|
|
1108
1079
|
const getAccountMeta = getAccountMetaFactory();
|
|
1109
|
-
|
|
1080
|
+
return Object.freeze({
|
|
1110
1081
|
accounts: [
|
|
1111
1082
|
getAccountMeta(accounts.nonceAccount),
|
|
1112
1083
|
getAccountMeta(accounts.recipientAccount),
|
|
@@ -1114,12 +1085,11 @@ function getWithdrawNonceAccountInstruction(input, config) {
|
|
|
1114
1085
|
getAccountMeta(accounts.rentSysvar),
|
|
1115
1086
|
getAccountMeta(accounts.nonceAuthority)
|
|
1116
1087
|
],
|
|
1117
|
-
programAddress,
|
|
1118
1088
|
data: getWithdrawNonceAccountInstructionDataEncoder().encode(
|
|
1119
1089
|
args
|
|
1120
|
-
)
|
|
1121
|
-
|
|
1122
|
-
|
|
1090
|
+
),
|
|
1091
|
+
programAddress
|
|
1092
|
+
});
|
|
1123
1093
|
}
|
|
1124
1094
|
function parseWithdrawNonceAccountInstruction(instruction) {
|
|
1125
1095
|
if (instruction.accounts.length < 5) {
|