@solana-program/system 0.1.0 → 0.1.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 +125 -128
- package/dist/src/index.js.map +1 -1
- package/dist/src/index.mjs +1 -4
- package/dist/src/index.mjs.map +1 -1
- package/dist/types/src/generated/accounts/nonce.d.ts +1 -1
- package/dist/types/src/generated/accounts/nonce.d.ts.map +1 -1
- package/dist/types/src/generated/instructions/advanceNonceAccount.d.ts +1 -1
- package/dist/types/src/generated/instructions/advanceNonceAccount.d.ts.map +1 -1
- package/dist/types/src/generated/instructions/allocate.d.ts +1 -1
- package/dist/types/src/generated/instructions/allocate.d.ts.map +1 -1
- package/dist/types/src/generated/instructions/allocateWithSeed.d.ts +1 -1
- package/dist/types/src/generated/instructions/allocateWithSeed.d.ts.map +1 -1
- package/dist/types/src/generated/instructions/assign.d.ts +1 -1
- package/dist/types/src/generated/instructions/assign.d.ts.map +1 -1
- package/dist/types/src/generated/instructions/assignWithSeed.d.ts +1 -1
- package/dist/types/src/generated/instructions/assignWithSeed.d.ts.map +1 -1
- package/dist/types/src/generated/instructions/authorizeNonceAccount.d.ts +1 -1
- package/dist/types/src/generated/instructions/authorizeNonceAccount.d.ts.map +1 -1
- package/dist/types/src/generated/instructions/createAccount.d.ts +1 -1
- package/dist/types/src/generated/instructions/createAccount.d.ts.map +1 -1
- package/dist/types/src/generated/instructions/createAccountWithSeed.d.ts +1 -1
- package/dist/types/src/generated/instructions/createAccountWithSeed.d.ts.map +1 -1
- package/dist/types/src/generated/instructions/initializeNonceAccount.d.ts +1 -1
- package/dist/types/src/generated/instructions/initializeNonceAccount.d.ts.map +1 -1
- package/dist/types/src/generated/instructions/transferSol.d.ts +1 -1
- package/dist/types/src/generated/instructions/transferSol.d.ts.map +1 -1
- package/dist/types/src/generated/instructions/transferSolWithSeed.d.ts +1 -1
- package/dist/types/src/generated/instructions/transferSolWithSeed.d.ts.map +1 -1
- package/dist/types/src/generated/instructions/upgradeNonceAccount.d.ts +1 -1
- package/dist/types/src/generated/instructions/upgradeNonceAccount.d.ts.map +1 -1
- package/dist/types/src/generated/instructions/withdrawNonceAccount.d.ts +1 -1
- package/dist/types/src/generated/instructions/withdrawNonceAccount.d.ts.map +1 -1
- package/dist/types/src/generated/types/nonceState.d.ts +1 -1
- package/dist/types/src/generated/types/nonceState.d.ts.map +1 -1
- package/dist/types/src/generated/types/nonceVersion.d.ts +1 -1
- package/dist/types/src/generated/types/nonceVersion.d.ts.map +1 -1
- package/dist/types/test/_setup.d.ts +1 -0
- package/dist/types/test/_setup.d.ts.map +1 -1
- package/dist/types/test/advanceNonceAccount.test.d.ts +2 -0
- package/dist/types/test/advanceNonceAccount.test.d.ts.map +1 -0
- package/dist/types/test/createAccount.test.d.ts +2 -0
- package/dist/types/test/createAccount.test.d.ts.map +1 -0
- package/package.json +7 -13
package/dist/src/index.js
CHANGED
|
@@ -2,12 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
var accounts = require('@solana/accounts');
|
|
4
4
|
var addresses = require('@solana/addresses');
|
|
5
|
-
var
|
|
6
|
-
var codecsDataStructures = require('@solana/codecs-data-structures');
|
|
7
|
-
var codecsNumbers = require('@solana/codecs-numbers');
|
|
5
|
+
var codecs = require('@solana/codecs');
|
|
8
6
|
var instructions = require('@solana/instructions');
|
|
9
7
|
var signers = require('@solana/signers');
|
|
10
|
-
var codecsStrings = require('@solana/codecs-strings');
|
|
11
8
|
|
|
12
9
|
// env-shim.ts
|
|
13
10
|
var __DEV__ = /* @__PURE__ */ (() => process["env"].NODE_ENV === "development")();
|
|
@@ -17,13 +14,13 @@ var NonceState = /* @__PURE__ */ ((NonceState3) => {
|
|
|
17
14
|
return NonceState3;
|
|
18
15
|
})(NonceState || {});
|
|
19
16
|
function getNonceStateEncoder() {
|
|
20
|
-
return
|
|
17
|
+
return codecs.getScalarEnumEncoder(NonceState, { size: codecs.getU32Encoder() });
|
|
21
18
|
}
|
|
22
19
|
function getNonceStateDecoder() {
|
|
23
|
-
return
|
|
20
|
+
return codecs.getScalarEnumDecoder(NonceState, { size: codecs.getU32Decoder() });
|
|
24
21
|
}
|
|
25
22
|
function getNonceStateCodec() {
|
|
26
|
-
return
|
|
23
|
+
return codecs.combineCodec(getNonceStateEncoder(), getNonceStateDecoder());
|
|
27
24
|
}
|
|
28
25
|
var NonceVersion = /* @__PURE__ */ ((NonceVersion3) => {
|
|
29
26
|
NonceVersion3[NonceVersion3["Legacy"] = 0] = "Legacy";
|
|
@@ -31,36 +28,36 @@ var NonceVersion = /* @__PURE__ */ ((NonceVersion3) => {
|
|
|
31
28
|
return NonceVersion3;
|
|
32
29
|
})(NonceVersion || {});
|
|
33
30
|
function getNonceVersionEncoder() {
|
|
34
|
-
return
|
|
31
|
+
return codecs.getScalarEnumEncoder(NonceVersion, { size: codecs.getU32Encoder() });
|
|
35
32
|
}
|
|
36
33
|
function getNonceVersionDecoder() {
|
|
37
|
-
return
|
|
34
|
+
return codecs.getScalarEnumDecoder(NonceVersion, { size: codecs.getU32Decoder() });
|
|
38
35
|
}
|
|
39
36
|
function getNonceVersionCodec() {
|
|
40
|
-
return
|
|
37
|
+
return codecs.combineCodec(getNonceVersionEncoder(), getNonceVersionDecoder());
|
|
41
38
|
}
|
|
42
39
|
|
|
43
40
|
// src/generated/accounts/nonce.ts
|
|
44
41
|
function getNonceAccountDataEncoder() {
|
|
45
|
-
return
|
|
42
|
+
return codecs.getStructEncoder([
|
|
46
43
|
["version", getNonceVersionEncoder()],
|
|
47
44
|
["state", getNonceStateEncoder()],
|
|
48
45
|
["authority", addresses.getAddressEncoder()],
|
|
49
46
|
["blockhash", addresses.getAddressEncoder()],
|
|
50
|
-
["lamportsPerSignature",
|
|
47
|
+
["lamportsPerSignature", codecs.getU64Encoder()]
|
|
51
48
|
]);
|
|
52
49
|
}
|
|
53
50
|
function getNonceAccountDataDecoder() {
|
|
54
|
-
return
|
|
51
|
+
return codecs.getStructDecoder([
|
|
55
52
|
["version", getNonceVersionDecoder()],
|
|
56
53
|
["state", getNonceStateDecoder()],
|
|
57
54
|
["authority", addresses.getAddressDecoder()],
|
|
58
55
|
["blockhash", addresses.getAddressDecoder()],
|
|
59
|
-
["lamportsPerSignature",
|
|
56
|
+
["lamportsPerSignature", codecs.getU64Decoder()]
|
|
60
57
|
]);
|
|
61
58
|
}
|
|
62
59
|
function getNonceAccountDataCodec() {
|
|
63
|
-
return
|
|
60
|
+
return codecs.combineCodec(
|
|
64
61
|
getNonceAccountDataEncoder(),
|
|
65
62
|
getNonceAccountDataDecoder()
|
|
66
63
|
);
|
|
@@ -241,16 +238,16 @@ function memcmp(data, bytes, offset) {
|
|
|
241
238
|
|
|
242
239
|
// src/generated/instructions/advanceNonceAccount.ts
|
|
243
240
|
function getAdvanceNonceAccountInstructionDataEncoder() {
|
|
244
|
-
return
|
|
245
|
-
|
|
241
|
+
return codecs.mapEncoder(
|
|
242
|
+
codecs.getStructEncoder([["discriminator", codecs.getU32Encoder()]]),
|
|
246
243
|
(value) => ({ ...value, discriminator: 4 })
|
|
247
244
|
);
|
|
248
245
|
}
|
|
249
246
|
function getAdvanceNonceAccountInstructionDataDecoder() {
|
|
250
|
-
return
|
|
247
|
+
return codecs.getStructDecoder([["discriminator", codecs.getU32Decoder()]]);
|
|
251
248
|
}
|
|
252
249
|
function getAdvanceNonceAccountInstructionDataCodec() {
|
|
253
|
-
return
|
|
250
|
+
return codecs.combineCodec(
|
|
254
251
|
getAdvanceNonceAccountInstructionDataEncoder(),
|
|
255
252
|
getAdvanceNonceAccountInstructionDataDecoder()
|
|
256
253
|
);
|
|
@@ -320,22 +317,22 @@ function parseAdvanceNonceAccountInstruction(instruction) {
|
|
|
320
317
|
};
|
|
321
318
|
}
|
|
322
319
|
function getAllocateInstructionDataEncoder() {
|
|
323
|
-
return
|
|
324
|
-
|
|
325
|
-
["discriminator",
|
|
326
|
-
["space",
|
|
320
|
+
return codecs.mapEncoder(
|
|
321
|
+
codecs.getStructEncoder([
|
|
322
|
+
["discriminator", codecs.getU32Encoder()],
|
|
323
|
+
["space", codecs.getU64Encoder()]
|
|
327
324
|
]),
|
|
328
325
|
(value) => ({ ...value, discriminator: 8 })
|
|
329
326
|
);
|
|
330
327
|
}
|
|
331
328
|
function getAllocateInstructionDataDecoder() {
|
|
332
|
-
return
|
|
333
|
-
["discriminator",
|
|
334
|
-
["space",
|
|
329
|
+
return codecs.getStructDecoder([
|
|
330
|
+
["discriminator", codecs.getU32Decoder()],
|
|
331
|
+
["space", codecs.getU64Decoder()]
|
|
335
332
|
]);
|
|
336
333
|
}
|
|
337
334
|
function getAllocateInstructionDataCodec() {
|
|
338
|
-
return
|
|
335
|
+
return codecs.combineCodec(
|
|
339
336
|
getAllocateInstructionDataEncoder(),
|
|
340
337
|
getAllocateInstructionDataDecoder()
|
|
341
338
|
);
|
|
@@ -387,28 +384,28 @@ function parseAllocateInstruction(instruction) {
|
|
|
387
384
|
};
|
|
388
385
|
}
|
|
389
386
|
function getAllocateWithSeedInstructionDataEncoder() {
|
|
390
|
-
return
|
|
391
|
-
|
|
392
|
-
["discriminator",
|
|
387
|
+
return codecs.mapEncoder(
|
|
388
|
+
codecs.getStructEncoder([
|
|
389
|
+
["discriminator", codecs.getU32Encoder()],
|
|
393
390
|
["base", addresses.getAddressEncoder()],
|
|
394
|
-
["seed",
|
|
395
|
-
["space",
|
|
391
|
+
["seed", codecs.getStringEncoder()],
|
|
392
|
+
["space", codecs.getU64Encoder()],
|
|
396
393
|
["programAddress", addresses.getAddressEncoder()]
|
|
397
394
|
]),
|
|
398
395
|
(value) => ({ ...value, discriminator: 9 })
|
|
399
396
|
);
|
|
400
397
|
}
|
|
401
398
|
function getAllocateWithSeedInstructionDataDecoder() {
|
|
402
|
-
return
|
|
403
|
-
["discriminator",
|
|
399
|
+
return codecs.getStructDecoder([
|
|
400
|
+
["discriminator", codecs.getU32Decoder()],
|
|
404
401
|
["base", addresses.getAddressDecoder()],
|
|
405
|
-
["seed",
|
|
406
|
-
["space",
|
|
402
|
+
["seed", codecs.getStringDecoder()],
|
|
403
|
+
["space", codecs.getU64Decoder()],
|
|
407
404
|
["programAddress", addresses.getAddressDecoder()]
|
|
408
405
|
]);
|
|
409
406
|
}
|
|
410
407
|
function getAllocateWithSeedInstructionDataCodec() {
|
|
411
|
-
return
|
|
408
|
+
return codecs.combineCodec(
|
|
412
409
|
getAllocateWithSeedInstructionDataEncoder(),
|
|
413
410
|
getAllocateWithSeedInstructionDataDecoder()
|
|
414
411
|
);
|
|
@@ -463,22 +460,22 @@ function parseAllocateWithSeedInstruction(instruction) {
|
|
|
463
460
|
};
|
|
464
461
|
}
|
|
465
462
|
function getAssignInstructionDataEncoder() {
|
|
466
|
-
return
|
|
467
|
-
|
|
468
|
-
["discriminator",
|
|
463
|
+
return codecs.mapEncoder(
|
|
464
|
+
codecs.getStructEncoder([
|
|
465
|
+
["discriminator", codecs.getU32Encoder()],
|
|
469
466
|
["programAddress", addresses.getAddressEncoder()]
|
|
470
467
|
]),
|
|
471
468
|
(value) => ({ ...value, discriminator: 1 })
|
|
472
469
|
);
|
|
473
470
|
}
|
|
474
471
|
function getAssignInstructionDataDecoder() {
|
|
475
|
-
return
|
|
476
|
-
["discriminator",
|
|
472
|
+
return codecs.getStructDecoder([
|
|
473
|
+
["discriminator", codecs.getU32Decoder()],
|
|
477
474
|
["programAddress", addresses.getAddressDecoder()]
|
|
478
475
|
]);
|
|
479
476
|
}
|
|
480
477
|
function getAssignInstructionDataCodec() {
|
|
481
|
-
return
|
|
478
|
+
return codecs.combineCodec(
|
|
482
479
|
getAssignInstructionDataEncoder(),
|
|
483
480
|
getAssignInstructionDataDecoder()
|
|
484
481
|
);
|
|
@@ -530,26 +527,26 @@ function parseAssignInstruction(instruction) {
|
|
|
530
527
|
};
|
|
531
528
|
}
|
|
532
529
|
function getAssignWithSeedInstructionDataEncoder() {
|
|
533
|
-
return
|
|
534
|
-
|
|
535
|
-
["discriminator",
|
|
530
|
+
return codecs.mapEncoder(
|
|
531
|
+
codecs.getStructEncoder([
|
|
532
|
+
["discriminator", codecs.getU32Encoder()],
|
|
536
533
|
["base", addresses.getAddressEncoder()],
|
|
537
|
-
["seed",
|
|
534
|
+
["seed", codecs.getStringEncoder()],
|
|
538
535
|
["programAddress", addresses.getAddressEncoder()]
|
|
539
536
|
]),
|
|
540
537
|
(value) => ({ ...value, discriminator: 10 })
|
|
541
538
|
);
|
|
542
539
|
}
|
|
543
540
|
function getAssignWithSeedInstructionDataDecoder() {
|
|
544
|
-
return
|
|
545
|
-
["discriminator",
|
|
541
|
+
return codecs.getStructDecoder([
|
|
542
|
+
["discriminator", codecs.getU32Decoder()],
|
|
546
543
|
["base", addresses.getAddressDecoder()],
|
|
547
|
-
["seed",
|
|
544
|
+
["seed", codecs.getStringDecoder()],
|
|
548
545
|
["programAddress", addresses.getAddressDecoder()]
|
|
549
546
|
]);
|
|
550
547
|
}
|
|
551
548
|
function getAssignWithSeedInstructionDataCodec() {
|
|
552
|
-
return
|
|
549
|
+
return codecs.combineCodec(
|
|
553
550
|
getAssignWithSeedInstructionDataEncoder(),
|
|
554
551
|
getAssignWithSeedInstructionDataDecoder()
|
|
555
552
|
);
|
|
@@ -604,22 +601,22 @@ function parseAssignWithSeedInstruction(instruction) {
|
|
|
604
601
|
};
|
|
605
602
|
}
|
|
606
603
|
function getAuthorizeNonceAccountInstructionDataEncoder() {
|
|
607
|
-
return
|
|
608
|
-
|
|
609
|
-
["discriminator",
|
|
604
|
+
return codecs.mapEncoder(
|
|
605
|
+
codecs.getStructEncoder([
|
|
606
|
+
["discriminator", codecs.getU32Encoder()],
|
|
610
607
|
["newNonceAuthority", addresses.getAddressEncoder()]
|
|
611
608
|
]),
|
|
612
609
|
(value) => ({ ...value, discriminator: 7 })
|
|
613
610
|
);
|
|
614
611
|
}
|
|
615
612
|
function getAuthorizeNonceAccountInstructionDataDecoder() {
|
|
616
|
-
return
|
|
617
|
-
["discriminator",
|
|
613
|
+
return codecs.getStructDecoder([
|
|
614
|
+
["discriminator", codecs.getU32Decoder()],
|
|
618
615
|
["newNonceAuthority", addresses.getAddressDecoder()]
|
|
619
616
|
]);
|
|
620
617
|
}
|
|
621
618
|
function getAuthorizeNonceAccountInstructionDataCodec() {
|
|
622
|
-
return
|
|
619
|
+
return codecs.combineCodec(
|
|
623
620
|
getAuthorizeNonceAccountInstructionDataEncoder(),
|
|
624
621
|
getAuthorizeNonceAccountInstructionDataDecoder()
|
|
625
622
|
);
|
|
@@ -679,26 +676,26 @@ function parseAuthorizeNonceAccountInstruction(instruction) {
|
|
|
679
676
|
};
|
|
680
677
|
}
|
|
681
678
|
function getCreateAccountInstructionDataEncoder() {
|
|
682
|
-
return
|
|
683
|
-
|
|
684
|
-
["discriminator",
|
|
685
|
-
["lamports",
|
|
686
|
-
["space",
|
|
679
|
+
return codecs.mapEncoder(
|
|
680
|
+
codecs.getStructEncoder([
|
|
681
|
+
["discriminator", codecs.getU32Encoder()],
|
|
682
|
+
["lamports", codecs.getU64Encoder()],
|
|
683
|
+
["space", codecs.getU64Encoder()],
|
|
687
684
|
["programAddress", addresses.getAddressEncoder()]
|
|
688
685
|
]),
|
|
689
686
|
(value) => ({ ...value, discriminator: 0 })
|
|
690
687
|
);
|
|
691
688
|
}
|
|
692
689
|
function getCreateAccountInstructionDataDecoder() {
|
|
693
|
-
return
|
|
694
|
-
["discriminator",
|
|
695
|
-
["lamports",
|
|
696
|
-
["space",
|
|
690
|
+
return codecs.getStructDecoder([
|
|
691
|
+
["discriminator", codecs.getU32Decoder()],
|
|
692
|
+
["lamports", codecs.getU64Decoder()],
|
|
693
|
+
["space", codecs.getU64Decoder()],
|
|
697
694
|
["programAddress", addresses.getAddressDecoder()]
|
|
698
695
|
]);
|
|
699
696
|
}
|
|
700
697
|
function getCreateAccountInstructionDataCodec() {
|
|
701
|
-
return
|
|
698
|
+
return codecs.combineCodec(
|
|
702
699
|
getCreateAccountInstructionDataEncoder(),
|
|
703
700
|
getCreateAccountInstructionDataDecoder()
|
|
704
701
|
);
|
|
@@ -757,30 +754,30 @@ function parseCreateAccountInstruction(instruction) {
|
|
|
757
754
|
};
|
|
758
755
|
}
|
|
759
756
|
function getCreateAccountWithSeedInstructionDataEncoder() {
|
|
760
|
-
return
|
|
761
|
-
|
|
762
|
-
["discriminator",
|
|
757
|
+
return codecs.mapEncoder(
|
|
758
|
+
codecs.getStructEncoder([
|
|
759
|
+
["discriminator", codecs.getU32Encoder()],
|
|
763
760
|
["base", addresses.getAddressEncoder()],
|
|
764
|
-
["seed",
|
|
765
|
-
["amount",
|
|
766
|
-
["space",
|
|
761
|
+
["seed", codecs.getStringEncoder()],
|
|
762
|
+
["amount", codecs.getU64Encoder()],
|
|
763
|
+
["space", codecs.getU64Encoder()],
|
|
767
764
|
["programAddress", addresses.getAddressEncoder()]
|
|
768
765
|
]),
|
|
769
766
|
(value) => ({ ...value, discriminator: 3 })
|
|
770
767
|
);
|
|
771
768
|
}
|
|
772
769
|
function getCreateAccountWithSeedInstructionDataDecoder() {
|
|
773
|
-
return
|
|
774
|
-
["discriminator",
|
|
770
|
+
return codecs.getStructDecoder([
|
|
771
|
+
["discriminator", codecs.getU32Decoder()],
|
|
775
772
|
["base", addresses.getAddressDecoder()],
|
|
776
|
-
["seed",
|
|
777
|
-
["amount",
|
|
778
|
-
["space",
|
|
773
|
+
["seed", codecs.getStringDecoder()],
|
|
774
|
+
["amount", codecs.getU64Decoder()],
|
|
775
|
+
["space", codecs.getU64Decoder()],
|
|
779
776
|
["programAddress", addresses.getAddressDecoder()]
|
|
780
777
|
]);
|
|
781
778
|
}
|
|
782
779
|
function getCreateAccountWithSeedInstructionDataCodec() {
|
|
783
|
-
return
|
|
780
|
+
return codecs.combineCodec(
|
|
784
781
|
getCreateAccountWithSeedInstructionDataEncoder(),
|
|
785
782
|
getCreateAccountWithSeedInstructionDataDecoder()
|
|
786
783
|
);
|
|
@@ -840,22 +837,22 @@ function parseCreateAccountWithSeedInstruction(instruction) {
|
|
|
840
837
|
};
|
|
841
838
|
}
|
|
842
839
|
function getInitializeNonceAccountInstructionDataEncoder() {
|
|
843
|
-
return
|
|
844
|
-
|
|
845
|
-
["discriminator",
|
|
840
|
+
return codecs.mapEncoder(
|
|
841
|
+
codecs.getStructEncoder([
|
|
842
|
+
["discriminator", codecs.getU32Encoder()],
|
|
846
843
|
["nonceAuthority", addresses.getAddressEncoder()]
|
|
847
844
|
]),
|
|
848
845
|
(value) => ({ ...value, discriminator: 6 })
|
|
849
846
|
);
|
|
850
847
|
}
|
|
851
848
|
function getInitializeNonceAccountInstructionDataDecoder() {
|
|
852
|
-
return
|
|
853
|
-
["discriminator",
|
|
849
|
+
return codecs.getStructDecoder([
|
|
850
|
+
["discriminator", codecs.getU32Decoder()],
|
|
854
851
|
["nonceAuthority", addresses.getAddressDecoder()]
|
|
855
852
|
]);
|
|
856
853
|
}
|
|
857
854
|
function getInitializeNonceAccountInstructionDataCodec() {
|
|
858
|
-
return
|
|
855
|
+
return codecs.combineCodec(
|
|
859
856
|
getInitializeNonceAccountInstructionDataEncoder(),
|
|
860
857
|
getInitializeNonceAccountInstructionDataDecoder()
|
|
861
858
|
);
|
|
@@ -930,22 +927,22 @@ function parseInitializeNonceAccountInstruction(instruction) {
|
|
|
930
927
|
};
|
|
931
928
|
}
|
|
932
929
|
function getTransferSolInstructionDataEncoder() {
|
|
933
|
-
return
|
|
934
|
-
|
|
935
|
-
["discriminator",
|
|
936
|
-
["amount",
|
|
930
|
+
return codecs.mapEncoder(
|
|
931
|
+
codecs.getStructEncoder([
|
|
932
|
+
["discriminator", codecs.getU32Encoder()],
|
|
933
|
+
["amount", codecs.getU64Encoder()]
|
|
937
934
|
]),
|
|
938
935
|
(value) => ({ ...value, discriminator: 2 })
|
|
939
936
|
);
|
|
940
937
|
}
|
|
941
938
|
function getTransferSolInstructionDataDecoder() {
|
|
942
|
-
return
|
|
943
|
-
["discriminator",
|
|
944
|
-
["amount",
|
|
939
|
+
return codecs.getStructDecoder([
|
|
940
|
+
["discriminator", codecs.getU32Decoder()],
|
|
941
|
+
["amount", codecs.getU64Decoder()]
|
|
945
942
|
]);
|
|
946
943
|
}
|
|
947
944
|
function getTransferSolInstructionDataCodec() {
|
|
948
|
-
return
|
|
945
|
+
return codecs.combineCodec(
|
|
949
946
|
getTransferSolInstructionDataEncoder(),
|
|
950
947
|
getTransferSolInstructionDataDecoder()
|
|
951
948
|
);
|
|
@@ -1000,26 +997,26 @@ function parseTransferSolInstruction(instruction) {
|
|
|
1000
997
|
};
|
|
1001
998
|
}
|
|
1002
999
|
function getTransferSolWithSeedInstructionDataEncoder() {
|
|
1003
|
-
return
|
|
1004
|
-
|
|
1005
|
-
["discriminator",
|
|
1006
|
-
["amount",
|
|
1007
|
-
["fromSeed",
|
|
1000
|
+
return codecs.mapEncoder(
|
|
1001
|
+
codecs.getStructEncoder([
|
|
1002
|
+
["discriminator", codecs.getU32Encoder()],
|
|
1003
|
+
["amount", codecs.getU64Encoder()],
|
|
1004
|
+
["fromSeed", codecs.getStringEncoder()],
|
|
1008
1005
|
["fromOwner", addresses.getAddressEncoder()]
|
|
1009
1006
|
]),
|
|
1010
1007
|
(value) => ({ ...value, discriminator: 11 })
|
|
1011
1008
|
);
|
|
1012
1009
|
}
|
|
1013
1010
|
function getTransferSolWithSeedInstructionDataDecoder() {
|
|
1014
|
-
return
|
|
1015
|
-
["discriminator",
|
|
1016
|
-
["amount",
|
|
1017
|
-
["fromSeed",
|
|
1011
|
+
return codecs.getStructDecoder([
|
|
1012
|
+
["discriminator", codecs.getU32Decoder()],
|
|
1013
|
+
["amount", codecs.getU64Decoder()],
|
|
1014
|
+
["fromSeed", codecs.getStringDecoder()],
|
|
1018
1015
|
["fromOwner", addresses.getAddressDecoder()]
|
|
1019
1016
|
]);
|
|
1020
1017
|
}
|
|
1021
1018
|
function getTransferSolWithSeedInstructionDataCodec() {
|
|
1022
|
-
return
|
|
1019
|
+
return codecs.combineCodec(
|
|
1023
1020
|
getTransferSolWithSeedInstructionDataEncoder(),
|
|
1024
1021
|
getTransferSolWithSeedInstructionDataDecoder()
|
|
1025
1022
|
);
|
|
@@ -1079,16 +1076,16 @@ function parseTransferSolWithSeedInstruction(instruction) {
|
|
|
1079
1076
|
};
|
|
1080
1077
|
}
|
|
1081
1078
|
function getUpgradeNonceAccountInstructionDataEncoder() {
|
|
1082
|
-
return
|
|
1083
|
-
|
|
1079
|
+
return codecs.mapEncoder(
|
|
1080
|
+
codecs.getStructEncoder([["discriminator", codecs.getU32Encoder()]]),
|
|
1084
1081
|
(value) => ({ ...value, discriminator: 12 })
|
|
1085
1082
|
);
|
|
1086
1083
|
}
|
|
1087
1084
|
function getUpgradeNonceAccountInstructionDataDecoder() {
|
|
1088
|
-
return
|
|
1085
|
+
return codecs.getStructDecoder([["discriminator", codecs.getU32Decoder()]]);
|
|
1089
1086
|
}
|
|
1090
1087
|
function getUpgradeNonceAccountInstructionDataCodec() {
|
|
1091
|
-
return
|
|
1088
|
+
return codecs.combineCodec(
|
|
1092
1089
|
getUpgradeNonceAccountInstructionDataEncoder(),
|
|
1093
1090
|
getUpgradeNonceAccountInstructionDataDecoder()
|
|
1094
1091
|
);
|
|
@@ -1140,22 +1137,22 @@ function parseUpgradeNonceAccountInstruction(instruction) {
|
|
|
1140
1137
|
};
|
|
1141
1138
|
}
|
|
1142
1139
|
function getWithdrawNonceAccountInstructionDataEncoder() {
|
|
1143
|
-
return
|
|
1144
|
-
|
|
1145
|
-
["discriminator",
|
|
1146
|
-
["withdrawAmount",
|
|
1140
|
+
return codecs.mapEncoder(
|
|
1141
|
+
codecs.getStructEncoder([
|
|
1142
|
+
["discriminator", codecs.getU32Encoder()],
|
|
1143
|
+
["withdrawAmount", codecs.getU64Encoder()]
|
|
1147
1144
|
]),
|
|
1148
1145
|
(value) => ({ ...value, discriminator: 5 })
|
|
1149
1146
|
);
|
|
1150
1147
|
}
|
|
1151
1148
|
function getWithdrawNonceAccountInstructionDataDecoder() {
|
|
1152
|
-
return
|
|
1153
|
-
["discriminator",
|
|
1154
|
-
["withdrawAmount",
|
|
1149
|
+
return codecs.getStructDecoder([
|
|
1150
|
+
["discriminator", codecs.getU32Decoder()],
|
|
1151
|
+
["withdrawAmount", codecs.getU64Decoder()]
|
|
1155
1152
|
]);
|
|
1156
1153
|
}
|
|
1157
1154
|
function getWithdrawNonceAccountInstructionDataCodec() {
|
|
1158
|
-
return
|
|
1155
|
+
return codecs.combineCodec(
|
|
1159
1156
|
getWithdrawNonceAccountInstructionDataEncoder(),
|
|
1160
1157
|
getWithdrawNonceAccountInstructionDataDecoder()
|
|
1161
1158
|
);
|
|
@@ -1273,43 +1270,43 @@ var SystemInstruction = /* @__PURE__ */ ((SystemInstruction2) => {
|
|
|
1273
1270
|
})(SystemInstruction || {});
|
|
1274
1271
|
function identifySystemInstruction(instruction) {
|
|
1275
1272
|
const data = instruction instanceof Uint8Array ? instruction : instruction.data;
|
|
1276
|
-
if (memcmp(data,
|
|
1273
|
+
if (memcmp(data, codecs.getU32Encoder().encode(0), 0)) {
|
|
1277
1274
|
return 0 /* CreateAccount */;
|
|
1278
1275
|
}
|
|
1279
|
-
if (memcmp(data,
|
|
1276
|
+
if (memcmp(data, codecs.getU32Encoder().encode(1), 0)) {
|
|
1280
1277
|
return 1 /* Assign */;
|
|
1281
1278
|
}
|
|
1282
|
-
if (memcmp(data,
|
|
1279
|
+
if (memcmp(data, codecs.getU32Encoder().encode(2), 0)) {
|
|
1283
1280
|
return 2 /* TransferSol */;
|
|
1284
1281
|
}
|
|
1285
|
-
if (memcmp(data,
|
|
1282
|
+
if (memcmp(data, codecs.getU32Encoder().encode(3), 0)) {
|
|
1286
1283
|
return 3 /* CreateAccountWithSeed */;
|
|
1287
1284
|
}
|
|
1288
|
-
if (memcmp(data,
|
|
1285
|
+
if (memcmp(data, codecs.getU32Encoder().encode(4), 0)) {
|
|
1289
1286
|
return 4 /* AdvanceNonceAccount */;
|
|
1290
1287
|
}
|
|
1291
|
-
if (memcmp(data,
|
|
1288
|
+
if (memcmp(data, codecs.getU32Encoder().encode(5), 0)) {
|
|
1292
1289
|
return 5 /* WithdrawNonceAccount */;
|
|
1293
1290
|
}
|
|
1294
|
-
if (memcmp(data,
|
|
1291
|
+
if (memcmp(data, codecs.getU32Encoder().encode(6), 0)) {
|
|
1295
1292
|
return 6 /* InitializeNonceAccount */;
|
|
1296
1293
|
}
|
|
1297
|
-
if (memcmp(data,
|
|
1294
|
+
if (memcmp(data, codecs.getU32Encoder().encode(7), 0)) {
|
|
1298
1295
|
return 7 /* AuthorizeNonceAccount */;
|
|
1299
1296
|
}
|
|
1300
|
-
if (memcmp(data,
|
|
1297
|
+
if (memcmp(data, codecs.getU32Encoder().encode(8), 0)) {
|
|
1301
1298
|
return 8 /* Allocate */;
|
|
1302
1299
|
}
|
|
1303
|
-
if (memcmp(data,
|
|
1300
|
+
if (memcmp(data, codecs.getU32Encoder().encode(9), 0)) {
|
|
1304
1301
|
return 9 /* AllocateWithSeed */;
|
|
1305
1302
|
}
|
|
1306
|
-
if (memcmp(data,
|
|
1303
|
+
if (memcmp(data, codecs.getU32Encoder().encode(10), 0)) {
|
|
1307
1304
|
return 10 /* AssignWithSeed */;
|
|
1308
1305
|
}
|
|
1309
|
-
if (memcmp(data,
|
|
1306
|
+
if (memcmp(data, codecs.getU32Encoder().encode(11), 0)) {
|
|
1310
1307
|
return 11 /* TransferSolWithSeed */;
|
|
1311
1308
|
}
|
|
1312
|
-
if (memcmp(data,
|
|
1309
|
+
if (memcmp(data, codecs.getU32Encoder().encode(12), 0)) {
|
|
1313
1310
|
return 12 /* UpgradeNonceAccount */;
|
|
1314
1311
|
}
|
|
1315
1312
|
throw new Error(
|