@stabbleorg/mclmm-sdk 0.2.0 → 0.2.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/idl/stabble_clmm.json +28 -0
- package/lib/generated/types/decreaseLiquidityEvent.d.ts +2 -0
- package/lib/generated/types/decreaseLiquidityEvent.d.ts.map +1 -1
- package/lib/generated/types/index.d.ts +1 -0
- package/lib/generated/types/index.d.ts.map +1 -1
- package/lib/index.js +1011 -1008
- package/lib/index.mjs +494 -485
- package/lib/position-manager.d.ts.map +1 -1
- package/lib/types.d.ts +6 -7
- package/lib/types.d.ts.map +1 -1
- package/lib/utils/math.d.ts +3 -1
- package/lib/utils/math.d.ts.map +1 -1
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -249,6 +249,9 @@ __export(generated_exports, {
|
|
|
249
249
|
getAmmConfigSize: () => getAmmConfigSize,
|
|
250
250
|
getAmmV3ErrorMessage: () => getAmmV3ErrorMessage,
|
|
251
251
|
getClosePositionDiscriminatorBytes: () => getClosePositionDiscriminatorBytes,
|
|
252
|
+
getClosePositionEventCodec: () => getClosePositionEventCodec,
|
|
253
|
+
getClosePositionEventDecoder: () => getClosePositionEventDecoder,
|
|
254
|
+
getClosePositionEventEncoder: () => getClosePositionEventEncoder,
|
|
252
255
|
getClosePositionInstruction: () => getClosePositionInstruction,
|
|
253
256
|
getClosePositionInstructionAsync: () => getClosePositionInstructionAsync,
|
|
254
257
|
getClosePositionInstructionDataCodec: () => getClosePositionInstructionDataCodec,
|
|
@@ -553,454 +556,469 @@ function getAmmConfigSize() {
|
|
|
553
556
|
}
|
|
554
557
|
|
|
555
558
|
// src/generated/accounts/observationState.ts
|
|
556
|
-
var
|
|
559
|
+
var import_kit18 = require("@solana/kit");
|
|
557
560
|
|
|
558
|
-
// src/generated/types/
|
|
561
|
+
// src/generated/types/closePositionEvent.ts
|
|
559
562
|
var import_kit2 = require("@solana/kit");
|
|
560
|
-
function
|
|
561
|
-
return (0, import_kit2.getStructEncoder)([
|
|
562
|
-
["positionNftMint", (0, import_kit2.getAddressEncoder)()],
|
|
563
|
-
["recipientTokenAccount0", (0, import_kit2.getAddressEncoder)()],
|
|
564
|
-
["recipientTokenAccount1", (0, import_kit2.getAddressEncoder)()],
|
|
565
|
-
["amount0", (0, import_kit2.getU64Encoder)()],
|
|
566
|
-
["amount1", (0, import_kit2.getU64Encoder)()]
|
|
567
|
-
]);
|
|
563
|
+
function getClosePositionEventEncoder() {
|
|
564
|
+
return (0, import_kit2.getStructEncoder)([["positionKey", (0, import_kit2.getAddressEncoder)()]]);
|
|
568
565
|
}
|
|
569
|
-
function
|
|
570
|
-
return (0, import_kit2.getStructDecoder)([
|
|
571
|
-
["positionNftMint", (0, import_kit2.getAddressDecoder)()],
|
|
572
|
-
["recipientTokenAccount0", (0, import_kit2.getAddressDecoder)()],
|
|
573
|
-
["recipientTokenAccount1", (0, import_kit2.getAddressDecoder)()],
|
|
574
|
-
["amount0", (0, import_kit2.getU64Decoder)()],
|
|
575
|
-
["amount1", (0, import_kit2.getU64Decoder)()]
|
|
576
|
-
]);
|
|
566
|
+
function getClosePositionEventDecoder() {
|
|
567
|
+
return (0, import_kit2.getStructDecoder)([["positionKey", (0, import_kit2.getAddressDecoder)()]]);
|
|
577
568
|
}
|
|
578
|
-
function
|
|
569
|
+
function getClosePositionEventCodec() {
|
|
579
570
|
return (0, import_kit2.combineCodec)(
|
|
580
|
-
|
|
581
|
-
|
|
571
|
+
getClosePositionEventEncoder(),
|
|
572
|
+
getClosePositionEventDecoder()
|
|
582
573
|
);
|
|
583
574
|
}
|
|
584
575
|
|
|
585
|
-
// src/generated/types/
|
|
576
|
+
// src/generated/types/collectPersonalFeeEvent.ts
|
|
586
577
|
var import_kit3 = require("@solana/kit");
|
|
587
|
-
function
|
|
578
|
+
function getCollectPersonalFeeEventEncoder() {
|
|
588
579
|
return (0, import_kit3.getStructEncoder)([
|
|
589
|
-
["
|
|
580
|
+
["positionNftMint", (0, import_kit3.getAddressEncoder)()],
|
|
590
581
|
["recipientTokenAccount0", (0, import_kit3.getAddressEncoder)()],
|
|
591
582
|
["recipientTokenAccount1", (0, import_kit3.getAddressEncoder)()],
|
|
592
583
|
["amount0", (0, import_kit3.getU64Encoder)()],
|
|
593
584
|
["amount1", (0, import_kit3.getU64Encoder)()]
|
|
594
585
|
]);
|
|
595
586
|
}
|
|
596
|
-
function
|
|
587
|
+
function getCollectPersonalFeeEventDecoder() {
|
|
597
588
|
return (0, import_kit3.getStructDecoder)([
|
|
598
|
-
["
|
|
589
|
+
["positionNftMint", (0, import_kit3.getAddressDecoder)()],
|
|
599
590
|
["recipientTokenAccount0", (0, import_kit3.getAddressDecoder)()],
|
|
600
591
|
["recipientTokenAccount1", (0, import_kit3.getAddressDecoder)()],
|
|
601
592
|
["amount0", (0, import_kit3.getU64Decoder)()],
|
|
602
593
|
["amount1", (0, import_kit3.getU64Decoder)()]
|
|
603
594
|
]);
|
|
604
595
|
}
|
|
605
|
-
function
|
|
596
|
+
function getCollectPersonalFeeEventCodec() {
|
|
606
597
|
return (0, import_kit3.combineCodec)(
|
|
598
|
+
getCollectPersonalFeeEventEncoder(),
|
|
599
|
+
getCollectPersonalFeeEventDecoder()
|
|
600
|
+
);
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
// src/generated/types/collectProtocolFeeEvent.ts
|
|
604
|
+
var import_kit4 = require("@solana/kit");
|
|
605
|
+
function getCollectProtocolFeeEventEncoder() {
|
|
606
|
+
return (0, import_kit4.getStructEncoder)([
|
|
607
|
+
["poolState", (0, import_kit4.getAddressEncoder)()],
|
|
608
|
+
["recipientTokenAccount0", (0, import_kit4.getAddressEncoder)()],
|
|
609
|
+
["recipientTokenAccount1", (0, import_kit4.getAddressEncoder)()],
|
|
610
|
+
["amount0", (0, import_kit4.getU64Encoder)()],
|
|
611
|
+
["amount1", (0, import_kit4.getU64Encoder)()]
|
|
612
|
+
]);
|
|
613
|
+
}
|
|
614
|
+
function getCollectProtocolFeeEventDecoder() {
|
|
615
|
+
return (0, import_kit4.getStructDecoder)([
|
|
616
|
+
["poolState", (0, import_kit4.getAddressDecoder)()],
|
|
617
|
+
["recipientTokenAccount0", (0, import_kit4.getAddressDecoder)()],
|
|
618
|
+
["recipientTokenAccount1", (0, import_kit4.getAddressDecoder)()],
|
|
619
|
+
["amount0", (0, import_kit4.getU64Decoder)()],
|
|
620
|
+
["amount1", (0, import_kit4.getU64Decoder)()]
|
|
621
|
+
]);
|
|
622
|
+
}
|
|
623
|
+
function getCollectProtocolFeeEventCodec() {
|
|
624
|
+
return (0, import_kit4.combineCodec)(
|
|
607
625
|
getCollectProtocolFeeEventEncoder(),
|
|
608
626
|
getCollectProtocolFeeEventDecoder()
|
|
609
627
|
);
|
|
610
628
|
}
|
|
611
629
|
|
|
612
630
|
// src/generated/types/configChangeEvent.ts
|
|
613
|
-
var
|
|
631
|
+
var import_kit5 = require("@solana/kit");
|
|
614
632
|
function getConfigChangeEventEncoder() {
|
|
615
|
-
return (0,
|
|
616
|
-
["index", (0,
|
|
617
|
-
["owner", (0,
|
|
618
|
-
["protocolFeeRate", (0,
|
|
619
|
-
["tradeFeeRate", (0,
|
|
620
|
-
["tickSpacing", (0,
|
|
621
|
-
["fundFeeRate", (0,
|
|
622
|
-
["fundOwner", (0,
|
|
633
|
+
return (0, import_kit5.getStructEncoder)([
|
|
634
|
+
["index", (0, import_kit5.getU16Encoder)()],
|
|
635
|
+
["owner", (0, import_kit5.getAddressEncoder)()],
|
|
636
|
+
["protocolFeeRate", (0, import_kit5.getU32Encoder)()],
|
|
637
|
+
["tradeFeeRate", (0, import_kit5.getU32Encoder)()],
|
|
638
|
+
["tickSpacing", (0, import_kit5.getU16Encoder)()],
|
|
639
|
+
["fundFeeRate", (0, import_kit5.getU32Encoder)()],
|
|
640
|
+
["fundOwner", (0, import_kit5.getAddressEncoder)()]
|
|
623
641
|
]);
|
|
624
642
|
}
|
|
625
643
|
function getConfigChangeEventDecoder() {
|
|
626
|
-
return (0,
|
|
627
|
-
["index", (0,
|
|
628
|
-
["owner", (0,
|
|
629
|
-
["protocolFeeRate", (0,
|
|
630
|
-
["tradeFeeRate", (0,
|
|
631
|
-
["tickSpacing", (0,
|
|
632
|
-
["fundFeeRate", (0,
|
|
633
|
-
["fundOwner", (0,
|
|
644
|
+
return (0, import_kit5.getStructDecoder)([
|
|
645
|
+
["index", (0, import_kit5.getU16Decoder)()],
|
|
646
|
+
["owner", (0, import_kit5.getAddressDecoder)()],
|
|
647
|
+
["protocolFeeRate", (0, import_kit5.getU32Decoder)()],
|
|
648
|
+
["tradeFeeRate", (0, import_kit5.getU32Decoder)()],
|
|
649
|
+
["tickSpacing", (0, import_kit5.getU16Decoder)()],
|
|
650
|
+
["fundFeeRate", (0, import_kit5.getU32Decoder)()],
|
|
651
|
+
["fundOwner", (0, import_kit5.getAddressDecoder)()]
|
|
634
652
|
]);
|
|
635
653
|
}
|
|
636
654
|
function getConfigChangeEventCodec() {
|
|
637
|
-
return (0,
|
|
655
|
+
return (0, import_kit5.combineCodec)(
|
|
638
656
|
getConfigChangeEventEncoder(),
|
|
639
657
|
getConfigChangeEventDecoder()
|
|
640
658
|
);
|
|
641
659
|
}
|
|
642
660
|
|
|
643
661
|
// src/generated/types/createPersonalPositionEvent.ts
|
|
644
|
-
var
|
|
662
|
+
var import_kit6 = require("@solana/kit");
|
|
645
663
|
function getCreatePersonalPositionEventEncoder() {
|
|
646
|
-
return (0,
|
|
647
|
-
["poolState", (0,
|
|
648
|
-
["personalPosition", (0,
|
|
649
|
-
["nftMint", (0,
|
|
650
|
-
["minter", (0,
|
|
651
|
-
["nftOwner", (0,
|
|
652
|
-
["tickLowerIndex", (0,
|
|
653
|
-
["tickUpperIndex", (0,
|
|
654
|
-
["liquidity", (0,
|
|
655
|
-
["depositAmount0", (0,
|
|
656
|
-
["depositAmount1", (0,
|
|
657
|
-
["depositAmount0TransferFee", (0,
|
|
658
|
-
["depositAmount1TransferFee", (0,
|
|
664
|
+
return (0, import_kit6.getStructEncoder)([
|
|
665
|
+
["poolState", (0, import_kit6.getAddressEncoder)()],
|
|
666
|
+
["personalPosition", (0, import_kit6.getAddressEncoder)()],
|
|
667
|
+
["nftMint", (0, import_kit6.getAddressEncoder)()],
|
|
668
|
+
["minter", (0, import_kit6.getAddressEncoder)()],
|
|
669
|
+
["nftOwner", (0, import_kit6.getAddressEncoder)()],
|
|
670
|
+
["tickLowerIndex", (0, import_kit6.getI32Encoder)()],
|
|
671
|
+
["tickUpperIndex", (0, import_kit6.getI32Encoder)()],
|
|
672
|
+
["liquidity", (0, import_kit6.getU128Encoder)()],
|
|
673
|
+
["depositAmount0", (0, import_kit6.getU64Encoder)()],
|
|
674
|
+
["depositAmount1", (0, import_kit6.getU64Encoder)()],
|
|
675
|
+
["depositAmount0TransferFee", (0, import_kit6.getU64Encoder)()],
|
|
676
|
+
["depositAmount1TransferFee", (0, import_kit6.getU64Encoder)()]
|
|
659
677
|
]);
|
|
660
678
|
}
|
|
661
679
|
function getCreatePersonalPositionEventDecoder() {
|
|
662
|
-
return (0,
|
|
663
|
-
["poolState", (0,
|
|
664
|
-
["personalPosition", (0,
|
|
665
|
-
["nftMint", (0,
|
|
666
|
-
["minter", (0,
|
|
667
|
-
["nftOwner", (0,
|
|
668
|
-
["tickLowerIndex", (0,
|
|
669
|
-
["tickUpperIndex", (0,
|
|
670
|
-
["liquidity", (0,
|
|
671
|
-
["depositAmount0", (0,
|
|
672
|
-
["depositAmount1", (0,
|
|
673
|
-
["depositAmount0TransferFee", (0,
|
|
674
|
-
["depositAmount1TransferFee", (0,
|
|
680
|
+
return (0, import_kit6.getStructDecoder)([
|
|
681
|
+
["poolState", (0, import_kit6.getAddressDecoder)()],
|
|
682
|
+
["personalPosition", (0, import_kit6.getAddressDecoder)()],
|
|
683
|
+
["nftMint", (0, import_kit6.getAddressDecoder)()],
|
|
684
|
+
["minter", (0, import_kit6.getAddressDecoder)()],
|
|
685
|
+
["nftOwner", (0, import_kit6.getAddressDecoder)()],
|
|
686
|
+
["tickLowerIndex", (0, import_kit6.getI32Decoder)()],
|
|
687
|
+
["tickUpperIndex", (0, import_kit6.getI32Decoder)()],
|
|
688
|
+
["liquidity", (0, import_kit6.getU128Decoder)()],
|
|
689
|
+
["depositAmount0", (0, import_kit6.getU64Decoder)()],
|
|
690
|
+
["depositAmount1", (0, import_kit6.getU64Decoder)()],
|
|
691
|
+
["depositAmount0TransferFee", (0, import_kit6.getU64Decoder)()],
|
|
692
|
+
["depositAmount1TransferFee", (0, import_kit6.getU64Decoder)()]
|
|
675
693
|
]);
|
|
676
694
|
}
|
|
677
695
|
function getCreatePersonalPositionEventCodec() {
|
|
678
|
-
return (0,
|
|
696
|
+
return (0, import_kit6.combineCodec)(
|
|
679
697
|
getCreatePersonalPositionEventEncoder(),
|
|
680
698
|
getCreatePersonalPositionEventDecoder()
|
|
681
699
|
);
|
|
682
700
|
}
|
|
683
701
|
|
|
684
702
|
// src/generated/types/decreaseLiquidityEvent.ts
|
|
685
|
-
var
|
|
703
|
+
var import_kit7 = require("@solana/kit");
|
|
686
704
|
function getDecreaseLiquidityEventEncoder() {
|
|
687
|
-
return (0,
|
|
688
|
-
["positionNftMint", (0,
|
|
689
|
-
["liquidity", (0,
|
|
690
|
-
["decreaseAmount0", (0,
|
|
691
|
-
["decreaseAmount1", (0,
|
|
692
|
-
["feeAmount0", (0,
|
|
693
|
-
["feeAmount1", (0,
|
|
694
|
-
["rewardAmounts", (0,
|
|
695
|
-
["transferFee0", (0,
|
|
696
|
-
["transferFee1", (0,
|
|
705
|
+
return (0, import_kit7.getStructEncoder)([
|
|
706
|
+
["positionNftMint", (0, import_kit7.getAddressEncoder)()],
|
|
707
|
+
["liquidity", (0, import_kit7.getU128Encoder)()],
|
|
708
|
+
["decreaseAmount0", (0, import_kit7.getU64Encoder)()],
|
|
709
|
+
["decreaseAmount1", (0, import_kit7.getU64Encoder)()],
|
|
710
|
+
["feeAmount0", (0, import_kit7.getU64Encoder)()],
|
|
711
|
+
["feeAmount1", (0, import_kit7.getU64Encoder)()],
|
|
712
|
+
["rewardAmounts", (0, import_kit7.getArrayEncoder)((0, import_kit7.getU64Encoder)(), { size: 3 })],
|
|
713
|
+
["transferFee0", (0, import_kit7.getU64Encoder)()],
|
|
714
|
+
["transferFee1", (0, import_kit7.getU64Encoder)()]
|
|
697
715
|
]);
|
|
698
716
|
}
|
|
699
717
|
function getDecreaseLiquidityEventDecoder() {
|
|
700
|
-
return (0,
|
|
701
|
-
["positionNftMint", (0,
|
|
702
|
-
["liquidity", (0,
|
|
703
|
-
["decreaseAmount0", (0,
|
|
704
|
-
["decreaseAmount1", (0,
|
|
705
|
-
["feeAmount0", (0,
|
|
706
|
-
["feeAmount1", (0,
|
|
707
|
-
["rewardAmounts", (0,
|
|
708
|
-
["transferFee0", (0,
|
|
709
|
-
["transferFee1", (0,
|
|
718
|
+
return (0, import_kit7.getStructDecoder)([
|
|
719
|
+
["positionNftMint", (0, import_kit7.getAddressDecoder)()],
|
|
720
|
+
["liquidity", (0, import_kit7.getU128Decoder)()],
|
|
721
|
+
["decreaseAmount0", (0, import_kit7.getU64Decoder)()],
|
|
722
|
+
["decreaseAmount1", (0, import_kit7.getU64Decoder)()],
|
|
723
|
+
["feeAmount0", (0, import_kit7.getU64Decoder)()],
|
|
724
|
+
["feeAmount1", (0, import_kit7.getU64Decoder)()],
|
|
725
|
+
["rewardAmounts", (0, import_kit7.getArrayDecoder)((0, import_kit7.getU64Decoder)(), { size: 3 })],
|
|
726
|
+
["transferFee0", (0, import_kit7.getU64Decoder)()],
|
|
727
|
+
["transferFee1", (0, import_kit7.getU64Decoder)()]
|
|
710
728
|
]);
|
|
711
729
|
}
|
|
712
730
|
function getDecreaseLiquidityEventCodec() {
|
|
713
|
-
return (0,
|
|
731
|
+
return (0, import_kit7.combineCodec)(
|
|
714
732
|
getDecreaseLiquidityEventEncoder(),
|
|
715
733
|
getDecreaseLiquidityEventDecoder()
|
|
716
734
|
);
|
|
717
735
|
}
|
|
718
736
|
|
|
719
737
|
// src/generated/types/increaseLiquidityEvent.ts
|
|
720
|
-
var
|
|
738
|
+
var import_kit8 = require("@solana/kit");
|
|
721
739
|
function getIncreaseLiquidityEventEncoder() {
|
|
722
|
-
return (0,
|
|
723
|
-
["positionNftMint", (0,
|
|
724
|
-
["liquidity", (0,
|
|
725
|
-
["amount0", (0,
|
|
726
|
-
["amount1", (0,
|
|
727
|
-
["amount0TransferFee", (0,
|
|
728
|
-
["amount1TransferFee", (0,
|
|
740
|
+
return (0, import_kit8.getStructEncoder)([
|
|
741
|
+
["positionNftMint", (0, import_kit8.getAddressEncoder)()],
|
|
742
|
+
["liquidity", (0, import_kit8.getU128Encoder)()],
|
|
743
|
+
["amount0", (0, import_kit8.getU64Encoder)()],
|
|
744
|
+
["amount1", (0, import_kit8.getU64Encoder)()],
|
|
745
|
+
["amount0TransferFee", (0, import_kit8.getU64Encoder)()],
|
|
746
|
+
["amount1TransferFee", (0, import_kit8.getU64Encoder)()]
|
|
729
747
|
]);
|
|
730
748
|
}
|
|
731
749
|
function getIncreaseLiquidityEventDecoder() {
|
|
732
|
-
return (0,
|
|
733
|
-
["positionNftMint", (0,
|
|
734
|
-
["liquidity", (0,
|
|
735
|
-
["amount0", (0,
|
|
736
|
-
["amount1", (0,
|
|
737
|
-
["amount0TransferFee", (0,
|
|
738
|
-
["amount1TransferFee", (0,
|
|
750
|
+
return (0, import_kit8.getStructDecoder)([
|
|
751
|
+
["positionNftMint", (0, import_kit8.getAddressDecoder)()],
|
|
752
|
+
["liquidity", (0, import_kit8.getU128Decoder)()],
|
|
753
|
+
["amount0", (0, import_kit8.getU64Decoder)()],
|
|
754
|
+
["amount1", (0, import_kit8.getU64Decoder)()],
|
|
755
|
+
["amount0TransferFee", (0, import_kit8.getU64Decoder)()],
|
|
756
|
+
["amount1TransferFee", (0, import_kit8.getU64Decoder)()]
|
|
739
757
|
]);
|
|
740
758
|
}
|
|
741
759
|
function getIncreaseLiquidityEventCodec() {
|
|
742
|
-
return (0,
|
|
760
|
+
return (0, import_kit8.combineCodec)(
|
|
743
761
|
getIncreaseLiquidityEventEncoder(),
|
|
744
762
|
getIncreaseLiquidityEventDecoder()
|
|
745
763
|
);
|
|
746
764
|
}
|
|
747
765
|
|
|
748
766
|
// src/generated/types/liquidityCalculateEvent.ts
|
|
749
|
-
var
|
|
767
|
+
var import_kit9 = require("@solana/kit");
|
|
750
768
|
function getLiquidityCalculateEventEncoder() {
|
|
751
|
-
return (0,
|
|
752
|
-
["poolLiquidity", (0,
|
|
753
|
-
["poolSqrtPriceX64", (0,
|
|
754
|
-
["poolTick", (0,
|
|
755
|
-
["calcAmount0", (0,
|
|
756
|
-
["calcAmount1", (0,
|
|
757
|
-
["tradeFeeOwed0", (0,
|
|
758
|
-
["tradeFeeOwed1", (0,
|
|
759
|
-
["transferFee0", (0,
|
|
760
|
-
["transferFee1", (0,
|
|
769
|
+
return (0, import_kit9.getStructEncoder)([
|
|
770
|
+
["poolLiquidity", (0, import_kit9.getU128Encoder)()],
|
|
771
|
+
["poolSqrtPriceX64", (0, import_kit9.getU128Encoder)()],
|
|
772
|
+
["poolTick", (0, import_kit9.getI32Encoder)()],
|
|
773
|
+
["calcAmount0", (0, import_kit9.getU64Encoder)()],
|
|
774
|
+
["calcAmount1", (0, import_kit9.getU64Encoder)()],
|
|
775
|
+
["tradeFeeOwed0", (0, import_kit9.getU64Encoder)()],
|
|
776
|
+
["tradeFeeOwed1", (0, import_kit9.getU64Encoder)()],
|
|
777
|
+
["transferFee0", (0, import_kit9.getU64Encoder)()],
|
|
778
|
+
["transferFee1", (0, import_kit9.getU64Encoder)()]
|
|
761
779
|
]);
|
|
762
780
|
}
|
|
763
781
|
function getLiquidityCalculateEventDecoder() {
|
|
764
|
-
return (0,
|
|
765
|
-
["poolLiquidity", (0,
|
|
766
|
-
["poolSqrtPriceX64", (0,
|
|
767
|
-
["poolTick", (0,
|
|
768
|
-
["calcAmount0", (0,
|
|
769
|
-
["calcAmount1", (0,
|
|
770
|
-
["tradeFeeOwed0", (0,
|
|
771
|
-
["tradeFeeOwed1", (0,
|
|
772
|
-
["transferFee0", (0,
|
|
773
|
-
["transferFee1", (0,
|
|
782
|
+
return (0, import_kit9.getStructDecoder)([
|
|
783
|
+
["poolLiquidity", (0, import_kit9.getU128Decoder)()],
|
|
784
|
+
["poolSqrtPriceX64", (0, import_kit9.getU128Decoder)()],
|
|
785
|
+
["poolTick", (0, import_kit9.getI32Decoder)()],
|
|
786
|
+
["calcAmount0", (0, import_kit9.getU64Decoder)()],
|
|
787
|
+
["calcAmount1", (0, import_kit9.getU64Decoder)()],
|
|
788
|
+
["tradeFeeOwed0", (0, import_kit9.getU64Decoder)()],
|
|
789
|
+
["tradeFeeOwed1", (0, import_kit9.getU64Decoder)()],
|
|
790
|
+
["transferFee0", (0, import_kit9.getU64Decoder)()],
|
|
791
|
+
["transferFee1", (0, import_kit9.getU64Decoder)()]
|
|
774
792
|
]);
|
|
775
793
|
}
|
|
776
794
|
function getLiquidityCalculateEventCodec() {
|
|
777
|
-
return (0,
|
|
795
|
+
return (0, import_kit9.combineCodec)(
|
|
778
796
|
getLiquidityCalculateEventEncoder(),
|
|
779
797
|
getLiquidityCalculateEventDecoder()
|
|
780
798
|
);
|
|
781
799
|
}
|
|
782
800
|
|
|
783
801
|
// src/generated/types/liquidityChangeEvent.ts
|
|
784
|
-
var
|
|
802
|
+
var import_kit10 = require("@solana/kit");
|
|
785
803
|
function getLiquidityChangeEventEncoder() {
|
|
786
|
-
return (0,
|
|
787
|
-
["poolState", (0,
|
|
788
|
-
["tick", (0,
|
|
789
|
-
["tickLower", (0,
|
|
790
|
-
["tickUpper", (0,
|
|
791
|
-
["liquidityBefore", (0,
|
|
792
|
-
["liquidityAfter", (0,
|
|
804
|
+
return (0, import_kit10.getStructEncoder)([
|
|
805
|
+
["poolState", (0, import_kit10.getAddressEncoder)()],
|
|
806
|
+
["tick", (0, import_kit10.getI32Encoder)()],
|
|
807
|
+
["tickLower", (0, import_kit10.getI32Encoder)()],
|
|
808
|
+
["tickUpper", (0, import_kit10.getI32Encoder)()],
|
|
809
|
+
["liquidityBefore", (0, import_kit10.getU128Encoder)()],
|
|
810
|
+
["liquidityAfter", (0, import_kit10.getU128Encoder)()]
|
|
793
811
|
]);
|
|
794
812
|
}
|
|
795
813
|
function getLiquidityChangeEventDecoder() {
|
|
796
|
-
return (0,
|
|
797
|
-
["poolState", (0,
|
|
798
|
-
["tick", (0,
|
|
799
|
-
["tickLower", (0,
|
|
800
|
-
["tickUpper", (0,
|
|
801
|
-
["liquidityBefore", (0,
|
|
802
|
-
["liquidityAfter", (0,
|
|
814
|
+
return (0, import_kit10.getStructDecoder)([
|
|
815
|
+
["poolState", (0, import_kit10.getAddressDecoder)()],
|
|
816
|
+
["tick", (0, import_kit10.getI32Decoder)()],
|
|
817
|
+
["tickLower", (0, import_kit10.getI32Decoder)()],
|
|
818
|
+
["tickUpper", (0, import_kit10.getI32Decoder)()],
|
|
819
|
+
["liquidityBefore", (0, import_kit10.getU128Decoder)()],
|
|
820
|
+
["liquidityAfter", (0, import_kit10.getU128Decoder)()]
|
|
803
821
|
]);
|
|
804
822
|
}
|
|
805
823
|
function getLiquidityChangeEventCodec() {
|
|
806
|
-
return (0,
|
|
824
|
+
return (0, import_kit10.combineCodec)(
|
|
807
825
|
getLiquidityChangeEventEncoder(),
|
|
808
826
|
getLiquidityChangeEventDecoder()
|
|
809
827
|
);
|
|
810
828
|
}
|
|
811
829
|
|
|
812
830
|
// src/generated/types/observation.ts
|
|
813
|
-
var
|
|
831
|
+
var import_kit11 = require("@solana/kit");
|
|
814
832
|
function getObservationEncoder() {
|
|
815
|
-
return (0,
|
|
816
|
-
["blockTimestamp", (0,
|
|
817
|
-
["tickCumulative", (0,
|
|
818
|
-
["padding", (0,
|
|
833
|
+
return (0, import_kit11.getStructEncoder)([
|
|
834
|
+
["blockTimestamp", (0, import_kit11.getU32Encoder)()],
|
|
835
|
+
["tickCumulative", (0, import_kit11.getI64Encoder)()],
|
|
836
|
+
["padding", (0, import_kit11.getArrayEncoder)((0, import_kit11.getU64Encoder)(), { size: 4 })]
|
|
819
837
|
]);
|
|
820
838
|
}
|
|
821
839
|
function getObservationDecoder() {
|
|
822
|
-
return (0,
|
|
823
|
-
["blockTimestamp", (0,
|
|
824
|
-
["tickCumulative", (0,
|
|
825
|
-
["padding", (0,
|
|
840
|
+
return (0, import_kit11.getStructDecoder)([
|
|
841
|
+
["blockTimestamp", (0, import_kit11.getU32Decoder)()],
|
|
842
|
+
["tickCumulative", (0, import_kit11.getI64Decoder)()],
|
|
843
|
+
["padding", (0, import_kit11.getArrayDecoder)((0, import_kit11.getU64Decoder)(), { size: 4 })]
|
|
826
844
|
]);
|
|
827
845
|
}
|
|
828
846
|
function getObservationCodec() {
|
|
829
|
-
return (0,
|
|
847
|
+
return (0, import_kit11.combineCodec)(getObservationEncoder(), getObservationDecoder());
|
|
830
848
|
}
|
|
831
849
|
|
|
832
850
|
// src/generated/types/poolCreatedEvent.ts
|
|
833
|
-
var
|
|
851
|
+
var import_kit12 = require("@solana/kit");
|
|
834
852
|
function getPoolCreatedEventEncoder() {
|
|
835
|
-
return (0,
|
|
836
|
-
["tokenMint0", (0,
|
|
837
|
-
["tokenMint1", (0,
|
|
838
|
-
["tickSpacing", (0,
|
|
839
|
-
["poolState", (0,
|
|
840
|
-
["sqrtPriceX64", (0,
|
|
841
|
-
["tick", (0,
|
|
842
|
-
["tokenVault0", (0,
|
|
843
|
-
["tokenVault1", (0,
|
|
844
|
-
["ammConfig", (0,
|
|
853
|
+
return (0, import_kit12.getStructEncoder)([
|
|
854
|
+
["tokenMint0", (0, import_kit12.getAddressEncoder)()],
|
|
855
|
+
["tokenMint1", (0, import_kit12.getAddressEncoder)()],
|
|
856
|
+
["tickSpacing", (0, import_kit12.getU16Encoder)()],
|
|
857
|
+
["poolState", (0, import_kit12.getAddressEncoder)()],
|
|
858
|
+
["sqrtPriceX64", (0, import_kit12.getU128Encoder)()],
|
|
859
|
+
["tick", (0, import_kit12.getI32Encoder)()],
|
|
860
|
+
["tokenVault0", (0, import_kit12.getAddressEncoder)()],
|
|
861
|
+
["tokenVault1", (0, import_kit12.getAddressEncoder)()],
|
|
862
|
+
["ammConfig", (0, import_kit12.getAddressEncoder)()]
|
|
845
863
|
]);
|
|
846
864
|
}
|
|
847
865
|
function getPoolCreatedEventDecoder() {
|
|
848
|
-
return (0,
|
|
849
|
-
["tokenMint0", (0,
|
|
850
|
-
["tokenMint1", (0,
|
|
851
|
-
["tickSpacing", (0,
|
|
852
|
-
["poolState", (0,
|
|
853
|
-
["sqrtPriceX64", (0,
|
|
854
|
-
["tick", (0,
|
|
855
|
-
["tokenVault0", (0,
|
|
856
|
-
["tokenVault1", (0,
|
|
857
|
-
["ammConfig", (0,
|
|
866
|
+
return (0, import_kit12.getStructDecoder)([
|
|
867
|
+
["tokenMint0", (0, import_kit12.getAddressDecoder)()],
|
|
868
|
+
["tokenMint1", (0, import_kit12.getAddressDecoder)()],
|
|
869
|
+
["tickSpacing", (0, import_kit12.getU16Decoder)()],
|
|
870
|
+
["poolState", (0, import_kit12.getAddressDecoder)()],
|
|
871
|
+
["sqrtPriceX64", (0, import_kit12.getU128Decoder)()],
|
|
872
|
+
["tick", (0, import_kit12.getI32Decoder)()],
|
|
873
|
+
["tokenVault0", (0, import_kit12.getAddressDecoder)()],
|
|
874
|
+
["tokenVault1", (0, import_kit12.getAddressDecoder)()],
|
|
875
|
+
["ammConfig", (0, import_kit12.getAddressDecoder)()]
|
|
858
876
|
]);
|
|
859
877
|
}
|
|
860
878
|
function getPoolCreatedEventCodec() {
|
|
861
|
-
return (0,
|
|
879
|
+
return (0, import_kit12.combineCodec)(
|
|
862
880
|
getPoolCreatedEventEncoder(),
|
|
863
881
|
getPoolCreatedEventDecoder()
|
|
864
882
|
);
|
|
865
883
|
}
|
|
866
884
|
|
|
867
885
|
// src/generated/types/positionRewardInfo.ts
|
|
868
|
-
var
|
|
886
|
+
var import_kit13 = require("@solana/kit");
|
|
869
887
|
function getPositionRewardInfoEncoder() {
|
|
870
|
-
return (0,
|
|
871
|
-
["growthInsideLastX64", (0,
|
|
872
|
-
["rewardAmountOwed", (0,
|
|
888
|
+
return (0, import_kit13.getStructEncoder)([
|
|
889
|
+
["growthInsideLastX64", (0, import_kit13.getU128Encoder)()],
|
|
890
|
+
["rewardAmountOwed", (0, import_kit13.getU64Encoder)()]
|
|
873
891
|
]);
|
|
874
892
|
}
|
|
875
893
|
function getPositionRewardInfoDecoder() {
|
|
876
|
-
return (0,
|
|
877
|
-
["growthInsideLastX64", (0,
|
|
878
|
-
["rewardAmountOwed", (0,
|
|
894
|
+
return (0, import_kit13.getStructDecoder)([
|
|
895
|
+
["growthInsideLastX64", (0, import_kit13.getU128Decoder)()],
|
|
896
|
+
["rewardAmountOwed", (0, import_kit13.getU64Decoder)()]
|
|
879
897
|
]);
|
|
880
898
|
}
|
|
881
899
|
function getPositionRewardInfoCodec() {
|
|
882
|
-
return (0,
|
|
900
|
+
return (0, import_kit13.combineCodec)(
|
|
883
901
|
getPositionRewardInfoEncoder(),
|
|
884
902
|
getPositionRewardInfoDecoder()
|
|
885
903
|
);
|
|
886
904
|
}
|
|
887
905
|
|
|
888
906
|
// src/generated/types/rewardInfo.ts
|
|
889
|
-
var
|
|
907
|
+
var import_kit14 = require("@solana/kit");
|
|
890
908
|
function getRewardInfoEncoder() {
|
|
891
|
-
return (0,
|
|
892
|
-
["rewardState", (0,
|
|
893
|
-
["openTime", (0,
|
|
894
|
-
["endTime", (0,
|
|
895
|
-
["lastUpdateTime", (0,
|
|
896
|
-
["emissionsPerSecondX64", (0,
|
|
897
|
-
["rewardTotalEmissioned", (0,
|
|
898
|
-
["rewardClaimed", (0,
|
|
899
|
-
["tokenMint", (0,
|
|
900
|
-
["tokenVault", (0,
|
|
901
|
-
["authority", (0,
|
|
902
|
-
["rewardGrowthGlobalX64", (0,
|
|
909
|
+
return (0, import_kit14.getStructEncoder)([
|
|
910
|
+
["rewardState", (0, import_kit14.getU8Encoder)()],
|
|
911
|
+
["openTime", (0, import_kit14.getU64Encoder)()],
|
|
912
|
+
["endTime", (0, import_kit14.getU64Encoder)()],
|
|
913
|
+
["lastUpdateTime", (0, import_kit14.getU64Encoder)()],
|
|
914
|
+
["emissionsPerSecondX64", (0, import_kit14.getU128Encoder)()],
|
|
915
|
+
["rewardTotalEmissioned", (0, import_kit14.getU64Encoder)()],
|
|
916
|
+
["rewardClaimed", (0, import_kit14.getU64Encoder)()],
|
|
917
|
+
["tokenMint", (0, import_kit14.getAddressEncoder)()],
|
|
918
|
+
["tokenVault", (0, import_kit14.getAddressEncoder)()],
|
|
919
|
+
["authority", (0, import_kit14.getAddressEncoder)()],
|
|
920
|
+
["rewardGrowthGlobalX64", (0, import_kit14.getU128Encoder)()]
|
|
903
921
|
]);
|
|
904
922
|
}
|
|
905
923
|
function getRewardInfoDecoder() {
|
|
906
|
-
return (0,
|
|
907
|
-
["rewardState", (0,
|
|
908
|
-
["openTime", (0,
|
|
909
|
-
["endTime", (0,
|
|
910
|
-
["lastUpdateTime", (0,
|
|
911
|
-
["emissionsPerSecondX64", (0,
|
|
912
|
-
["rewardTotalEmissioned", (0,
|
|
913
|
-
["rewardClaimed", (0,
|
|
914
|
-
["tokenMint", (0,
|
|
915
|
-
["tokenVault", (0,
|
|
916
|
-
["authority", (0,
|
|
917
|
-
["rewardGrowthGlobalX64", (0,
|
|
924
|
+
return (0, import_kit14.getStructDecoder)([
|
|
925
|
+
["rewardState", (0, import_kit14.getU8Decoder)()],
|
|
926
|
+
["openTime", (0, import_kit14.getU64Decoder)()],
|
|
927
|
+
["endTime", (0, import_kit14.getU64Decoder)()],
|
|
928
|
+
["lastUpdateTime", (0, import_kit14.getU64Decoder)()],
|
|
929
|
+
["emissionsPerSecondX64", (0, import_kit14.getU128Decoder)()],
|
|
930
|
+
["rewardTotalEmissioned", (0, import_kit14.getU64Decoder)()],
|
|
931
|
+
["rewardClaimed", (0, import_kit14.getU64Decoder)()],
|
|
932
|
+
["tokenMint", (0, import_kit14.getAddressDecoder)()],
|
|
933
|
+
["tokenVault", (0, import_kit14.getAddressDecoder)()],
|
|
934
|
+
["authority", (0, import_kit14.getAddressDecoder)()],
|
|
935
|
+
["rewardGrowthGlobalX64", (0, import_kit14.getU128Decoder)()]
|
|
918
936
|
]);
|
|
919
937
|
}
|
|
920
938
|
function getRewardInfoCodec() {
|
|
921
|
-
return (0,
|
|
939
|
+
return (0, import_kit14.combineCodec)(getRewardInfoEncoder(), getRewardInfoDecoder());
|
|
922
940
|
}
|
|
923
941
|
|
|
924
942
|
// src/generated/types/swapEvent.ts
|
|
925
|
-
var
|
|
943
|
+
var import_kit15 = require("@solana/kit");
|
|
926
944
|
function getSwapEventEncoder() {
|
|
927
|
-
return (0,
|
|
928
|
-
["poolState", (0,
|
|
929
|
-
["sender", (0,
|
|
930
|
-
["tokenAccount0", (0,
|
|
931
|
-
["tokenAccount1", (0,
|
|
932
|
-
["amount0", (0,
|
|
933
|
-
["transferFee0", (0,
|
|
934
|
-
["amount1", (0,
|
|
935
|
-
["transferFee1", (0,
|
|
936
|
-
["zeroForOne", (0,
|
|
937
|
-
["sqrtPriceX64", (0,
|
|
938
|
-
["liquidity", (0,
|
|
939
|
-
["tick", (0,
|
|
945
|
+
return (0, import_kit15.getStructEncoder)([
|
|
946
|
+
["poolState", (0, import_kit15.getAddressEncoder)()],
|
|
947
|
+
["sender", (0, import_kit15.getAddressEncoder)()],
|
|
948
|
+
["tokenAccount0", (0, import_kit15.getAddressEncoder)()],
|
|
949
|
+
["tokenAccount1", (0, import_kit15.getAddressEncoder)()],
|
|
950
|
+
["amount0", (0, import_kit15.getU64Encoder)()],
|
|
951
|
+
["transferFee0", (0, import_kit15.getU64Encoder)()],
|
|
952
|
+
["amount1", (0, import_kit15.getU64Encoder)()],
|
|
953
|
+
["transferFee1", (0, import_kit15.getU64Encoder)()],
|
|
954
|
+
["zeroForOne", (0, import_kit15.getBooleanEncoder)()],
|
|
955
|
+
["sqrtPriceX64", (0, import_kit15.getU128Encoder)()],
|
|
956
|
+
["liquidity", (0, import_kit15.getU128Encoder)()],
|
|
957
|
+
["tick", (0, import_kit15.getI32Encoder)()]
|
|
940
958
|
]);
|
|
941
959
|
}
|
|
942
960
|
function getSwapEventDecoder() {
|
|
943
|
-
return (0,
|
|
944
|
-
["poolState", (0,
|
|
945
|
-
["sender", (0,
|
|
946
|
-
["tokenAccount0", (0,
|
|
947
|
-
["tokenAccount1", (0,
|
|
948
|
-
["amount0", (0,
|
|
949
|
-
["transferFee0", (0,
|
|
950
|
-
["amount1", (0,
|
|
951
|
-
["transferFee1", (0,
|
|
952
|
-
["zeroForOne", (0,
|
|
953
|
-
["sqrtPriceX64", (0,
|
|
954
|
-
["liquidity", (0,
|
|
955
|
-
["tick", (0,
|
|
961
|
+
return (0, import_kit15.getStructDecoder)([
|
|
962
|
+
["poolState", (0, import_kit15.getAddressDecoder)()],
|
|
963
|
+
["sender", (0, import_kit15.getAddressDecoder)()],
|
|
964
|
+
["tokenAccount0", (0, import_kit15.getAddressDecoder)()],
|
|
965
|
+
["tokenAccount1", (0, import_kit15.getAddressDecoder)()],
|
|
966
|
+
["amount0", (0, import_kit15.getU64Decoder)()],
|
|
967
|
+
["transferFee0", (0, import_kit15.getU64Decoder)()],
|
|
968
|
+
["amount1", (0, import_kit15.getU64Decoder)()],
|
|
969
|
+
["transferFee1", (0, import_kit15.getU64Decoder)()],
|
|
970
|
+
["zeroForOne", (0, import_kit15.getBooleanDecoder)()],
|
|
971
|
+
["sqrtPriceX64", (0, import_kit15.getU128Decoder)()],
|
|
972
|
+
["liquidity", (0, import_kit15.getU128Decoder)()],
|
|
973
|
+
["tick", (0, import_kit15.getI32Decoder)()]
|
|
956
974
|
]);
|
|
957
975
|
}
|
|
958
976
|
function getSwapEventCodec() {
|
|
959
|
-
return (0,
|
|
977
|
+
return (0, import_kit15.combineCodec)(getSwapEventEncoder(), getSwapEventDecoder());
|
|
960
978
|
}
|
|
961
979
|
|
|
962
980
|
// src/generated/types/tickState.ts
|
|
963
|
-
var
|
|
981
|
+
var import_kit16 = require("@solana/kit");
|
|
964
982
|
function getTickStateEncoder() {
|
|
965
|
-
return (0,
|
|
966
|
-
["tick", (0,
|
|
967
|
-
["liquidityNet", (0,
|
|
968
|
-
["liquidityGross", (0,
|
|
969
|
-
["feeGrowthOutside0X64", (0,
|
|
970
|
-
["feeGrowthOutside1X64", (0,
|
|
971
|
-
["rewardGrowthsOutsideX64", (0,
|
|
972
|
-
["padding", (0,
|
|
983
|
+
return (0, import_kit16.getStructEncoder)([
|
|
984
|
+
["tick", (0, import_kit16.getI32Encoder)()],
|
|
985
|
+
["liquidityNet", (0, import_kit16.getI128Encoder)()],
|
|
986
|
+
["liquidityGross", (0, import_kit16.getU128Encoder)()],
|
|
987
|
+
["feeGrowthOutside0X64", (0, import_kit16.getU128Encoder)()],
|
|
988
|
+
["feeGrowthOutside1X64", (0, import_kit16.getU128Encoder)()],
|
|
989
|
+
["rewardGrowthsOutsideX64", (0, import_kit16.getArrayEncoder)((0, import_kit16.getU128Encoder)(), { size: 3 })],
|
|
990
|
+
["padding", (0, import_kit16.getArrayEncoder)((0, import_kit16.getU32Encoder)(), { size: 13 })]
|
|
973
991
|
]);
|
|
974
992
|
}
|
|
975
993
|
function getTickStateDecoder() {
|
|
976
|
-
return (0,
|
|
977
|
-
["tick", (0,
|
|
978
|
-
["liquidityNet", (0,
|
|
979
|
-
["liquidityGross", (0,
|
|
980
|
-
["feeGrowthOutside0X64", (0,
|
|
981
|
-
["feeGrowthOutside1X64", (0,
|
|
982
|
-
["rewardGrowthsOutsideX64", (0,
|
|
983
|
-
["padding", (0,
|
|
994
|
+
return (0, import_kit16.getStructDecoder)([
|
|
995
|
+
["tick", (0, import_kit16.getI32Decoder)()],
|
|
996
|
+
["liquidityNet", (0, import_kit16.getI128Decoder)()],
|
|
997
|
+
["liquidityGross", (0, import_kit16.getU128Decoder)()],
|
|
998
|
+
["feeGrowthOutside0X64", (0, import_kit16.getU128Decoder)()],
|
|
999
|
+
["feeGrowthOutside1X64", (0, import_kit16.getU128Decoder)()],
|
|
1000
|
+
["rewardGrowthsOutsideX64", (0, import_kit16.getArrayDecoder)((0, import_kit16.getU128Decoder)(), { size: 3 })],
|
|
1001
|
+
["padding", (0, import_kit16.getArrayDecoder)((0, import_kit16.getU32Decoder)(), { size: 13 })]
|
|
984
1002
|
]);
|
|
985
1003
|
}
|
|
986
1004
|
function getTickStateCodec() {
|
|
987
|
-
return (0,
|
|
1005
|
+
return (0, import_kit16.combineCodec)(getTickStateEncoder(), getTickStateDecoder());
|
|
988
1006
|
}
|
|
989
1007
|
|
|
990
1008
|
// src/generated/types/updateRewardInfosEvent.ts
|
|
991
|
-
var
|
|
1009
|
+
var import_kit17 = require("@solana/kit");
|
|
992
1010
|
function getUpdateRewardInfosEventEncoder() {
|
|
993
|
-
return (0,
|
|
994
|
-
["rewardGrowthGlobalX64", (0,
|
|
1011
|
+
return (0, import_kit17.getStructEncoder)([
|
|
1012
|
+
["rewardGrowthGlobalX64", (0, import_kit17.getArrayEncoder)((0, import_kit17.getU128Encoder)(), { size: 3 })]
|
|
995
1013
|
]);
|
|
996
1014
|
}
|
|
997
1015
|
function getUpdateRewardInfosEventDecoder() {
|
|
998
|
-
return (0,
|
|
999
|
-
["rewardGrowthGlobalX64", (0,
|
|
1016
|
+
return (0, import_kit17.getStructDecoder)([
|
|
1017
|
+
["rewardGrowthGlobalX64", (0, import_kit17.getArrayDecoder)((0, import_kit17.getU128Decoder)(), { size: 3 })]
|
|
1000
1018
|
]);
|
|
1001
1019
|
}
|
|
1002
1020
|
function getUpdateRewardInfosEventCodec() {
|
|
1003
|
-
return (0,
|
|
1021
|
+
return (0, import_kit17.combineCodec)(
|
|
1004
1022
|
getUpdateRewardInfosEventEncoder(),
|
|
1005
1023
|
getUpdateRewardInfosEventDecoder()
|
|
1006
1024
|
);
|
|
@@ -1018,54 +1036,54 @@ var OBSERVATION_STATE_DISCRIMINATOR = new Uint8Array([
|
|
|
1018
1036
|
132
|
|
1019
1037
|
]);
|
|
1020
1038
|
function getObservationStateDiscriminatorBytes() {
|
|
1021
|
-
return (0,
|
|
1039
|
+
return (0, import_kit18.fixEncoderSize)((0, import_kit18.getBytesEncoder)(), 8).encode(
|
|
1022
1040
|
OBSERVATION_STATE_DISCRIMINATOR
|
|
1023
1041
|
);
|
|
1024
1042
|
}
|
|
1025
1043
|
function getObservationStateEncoder() {
|
|
1026
|
-
return (0,
|
|
1027
|
-
(0,
|
|
1028
|
-
["discriminator", (0,
|
|
1029
|
-
["initialized", (0,
|
|
1030
|
-
["recentEpoch", (0,
|
|
1031
|
-
["observationIndex", (0,
|
|
1032
|
-
["poolId", (0,
|
|
1033
|
-
["observations", (0,
|
|
1034
|
-
["padding", (0,
|
|
1044
|
+
return (0, import_kit18.transformEncoder)(
|
|
1045
|
+
(0, import_kit18.getStructEncoder)([
|
|
1046
|
+
["discriminator", (0, import_kit18.fixEncoderSize)((0, import_kit18.getBytesEncoder)(), 8)],
|
|
1047
|
+
["initialized", (0, import_kit18.getBooleanEncoder)()],
|
|
1048
|
+
["recentEpoch", (0, import_kit18.getU64Encoder)()],
|
|
1049
|
+
["observationIndex", (0, import_kit18.getU16Encoder)()],
|
|
1050
|
+
["poolId", (0, import_kit18.getAddressEncoder)()],
|
|
1051
|
+
["observations", (0, import_kit18.getArrayEncoder)(getObservationEncoder(), { size: 100 })],
|
|
1052
|
+
["padding", (0, import_kit18.getArrayEncoder)((0, import_kit18.getU64Encoder)(), { size: 4 })]
|
|
1035
1053
|
]),
|
|
1036
1054
|
(value) => ({ ...value, discriminator: OBSERVATION_STATE_DISCRIMINATOR })
|
|
1037
1055
|
);
|
|
1038
1056
|
}
|
|
1039
1057
|
function getObservationStateDecoder() {
|
|
1040
|
-
return (0,
|
|
1041
|
-
["discriminator", (0,
|
|
1042
|
-
["initialized", (0,
|
|
1043
|
-
["recentEpoch", (0,
|
|
1044
|
-
["observationIndex", (0,
|
|
1045
|
-
["poolId", (0,
|
|
1046
|
-
["observations", (0,
|
|
1047
|
-
["padding", (0,
|
|
1058
|
+
return (0, import_kit18.getStructDecoder)([
|
|
1059
|
+
["discriminator", (0, import_kit18.fixDecoderSize)((0, import_kit18.getBytesDecoder)(), 8)],
|
|
1060
|
+
["initialized", (0, import_kit18.getBooleanDecoder)()],
|
|
1061
|
+
["recentEpoch", (0, import_kit18.getU64Decoder)()],
|
|
1062
|
+
["observationIndex", (0, import_kit18.getU16Decoder)()],
|
|
1063
|
+
["poolId", (0, import_kit18.getAddressDecoder)()],
|
|
1064
|
+
["observations", (0, import_kit18.getArrayDecoder)(getObservationDecoder(), { size: 100 })],
|
|
1065
|
+
["padding", (0, import_kit18.getArrayDecoder)((0, import_kit18.getU64Decoder)(), { size: 4 })]
|
|
1048
1066
|
]);
|
|
1049
1067
|
}
|
|
1050
1068
|
function getObservationStateCodec() {
|
|
1051
|
-
return (0,
|
|
1069
|
+
return (0, import_kit18.combineCodec)(
|
|
1052
1070
|
getObservationStateEncoder(),
|
|
1053
1071
|
getObservationStateDecoder()
|
|
1054
1072
|
);
|
|
1055
1073
|
}
|
|
1056
1074
|
function decodeObservationState(encodedAccount) {
|
|
1057
|
-
return (0,
|
|
1075
|
+
return (0, import_kit18.decodeAccount)(
|
|
1058
1076
|
encodedAccount,
|
|
1059
1077
|
getObservationStateDecoder()
|
|
1060
1078
|
);
|
|
1061
1079
|
}
|
|
1062
1080
|
async function fetchObservationState(rpc, address6, config) {
|
|
1063
1081
|
const maybeAccount = await fetchMaybeObservationState(rpc, address6, config);
|
|
1064
|
-
(0,
|
|
1082
|
+
(0, import_kit18.assertAccountExists)(maybeAccount);
|
|
1065
1083
|
return maybeAccount;
|
|
1066
1084
|
}
|
|
1067
1085
|
async function fetchMaybeObservationState(rpc, address6, config) {
|
|
1068
|
-
const maybeAccount = await (0,
|
|
1086
|
+
const maybeAccount = await (0, import_kit18.fetchEncodedAccount)(rpc, address6, config);
|
|
1069
1087
|
return decodeObservationState(maybeAccount);
|
|
1070
1088
|
}
|
|
1071
1089
|
async function fetchAllObservationState(rpc, addresses, config) {
|
|
@@ -1074,11 +1092,11 @@ async function fetchAllObservationState(rpc, addresses, config) {
|
|
|
1074
1092
|
addresses,
|
|
1075
1093
|
config
|
|
1076
1094
|
);
|
|
1077
|
-
(0,
|
|
1095
|
+
(0, import_kit18.assertAccountsExist)(maybeAccounts);
|
|
1078
1096
|
return maybeAccounts;
|
|
1079
1097
|
}
|
|
1080
1098
|
async function fetchAllMaybeObservationState(rpc, addresses, config) {
|
|
1081
|
-
const maybeAccounts = await (0,
|
|
1099
|
+
const maybeAccounts = await (0, import_kit18.fetchEncodedAccounts)(rpc, addresses, config);
|
|
1082
1100
|
return maybeAccounts.map(
|
|
1083
1101
|
(maybeAccount) => decodeObservationState(maybeAccount)
|
|
1084
1102
|
);
|
|
@@ -1088,7 +1106,7 @@ function getObservationStateSize() {
|
|
|
1088
1106
|
}
|
|
1089
1107
|
|
|
1090
1108
|
// src/generated/accounts/operationState.ts
|
|
1091
|
-
var
|
|
1109
|
+
var import_kit19 = require("@solana/kit");
|
|
1092
1110
|
var OPERATION_STATE_DISCRIMINATOR = new Uint8Array([
|
|
1093
1111
|
19,
|
|
1094
1112
|
236,
|
|
@@ -1100,45 +1118,45 @@ var OPERATION_STATE_DISCRIMINATOR = new Uint8Array([
|
|
|
1100
1118
|
252
|
|
1101
1119
|
]);
|
|
1102
1120
|
function getOperationStateDiscriminatorBytes() {
|
|
1103
|
-
return (0,
|
|
1121
|
+
return (0, import_kit19.fixEncoderSize)((0, import_kit19.getBytesEncoder)(), 8).encode(
|
|
1104
1122
|
OPERATION_STATE_DISCRIMINATOR
|
|
1105
1123
|
);
|
|
1106
1124
|
}
|
|
1107
1125
|
function getOperationStateEncoder() {
|
|
1108
|
-
return (0,
|
|
1109
|
-
(0,
|
|
1110
|
-
["discriminator", (0,
|
|
1111
|
-
["bump", (0,
|
|
1112
|
-
["operationOwners", (0,
|
|
1113
|
-
["whitelistMints", (0,
|
|
1126
|
+
return (0, import_kit19.transformEncoder)(
|
|
1127
|
+
(0, import_kit19.getStructEncoder)([
|
|
1128
|
+
["discriminator", (0, import_kit19.fixEncoderSize)((0, import_kit19.getBytesEncoder)(), 8)],
|
|
1129
|
+
["bump", (0, import_kit19.getU8Encoder)()],
|
|
1130
|
+
["operationOwners", (0, import_kit19.getArrayEncoder)((0, import_kit19.getAddressEncoder)(), { size: 10 })],
|
|
1131
|
+
["whitelistMints", (0, import_kit19.getArrayEncoder)((0, import_kit19.getAddressEncoder)(), { size: 100 })]
|
|
1114
1132
|
]),
|
|
1115
1133
|
(value) => ({ ...value, discriminator: OPERATION_STATE_DISCRIMINATOR })
|
|
1116
1134
|
);
|
|
1117
1135
|
}
|
|
1118
1136
|
function getOperationStateDecoder() {
|
|
1119
|
-
return (0,
|
|
1120
|
-
["discriminator", (0,
|
|
1121
|
-
["bump", (0,
|
|
1122
|
-
["operationOwners", (0,
|
|
1123
|
-
["whitelistMints", (0,
|
|
1137
|
+
return (0, import_kit19.getStructDecoder)([
|
|
1138
|
+
["discriminator", (0, import_kit19.fixDecoderSize)((0, import_kit19.getBytesDecoder)(), 8)],
|
|
1139
|
+
["bump", (0, import_kit19.getU8Decoder)()],
|
|
1140
|
+
["operationOwners", (0, import_kit19.getArrayDecoder)((0, import_kit19.getAddressDecoder)(), { size: 10 })],
|
|
1141
|
+
["whitelistMints", (0, import_kit19.getArrayDecoder)((0, import_kit19.getAddressDecoder)(), { size: 100 })]
|
|
1124
1142
|
]);
|
|
1125
1143
|
}
|
|
1126
1144
|
function getOperationStateCodec() {
|
|
1127
|
-
return (0,
|
|
1145
|
+
return (0, import_kit19.combineCodec)(getOperationStateEncoder(), getOperationStateDecoder());
|
|
1128
1146
|
}
|
|
1129
1147
|
function decodeOperationState(encodedAccount) {
|
|
1130
|
-
return (0,
|
|
1148
|
+
return (0, import_kit19.decodeAccount)(
|
|
1131
1149
|
encodedAccount,
|
|
1132
1150
|
getOperationStateDecoder()
|
|
1133
1151
|
);
|
|
1134
1152
|
}
|
|
1135
1153
|
async function fetchOperationState(rpc, address6, config) {
|
|
1136
1154
|
const maybeAccount = await fetchMaybeOperationState(rpc, address6, config);
|
|
1137
|
-
(0,
|
|
1155
|
+
(0, import_kit19.assertAccountExists)(maybeAccount);
|
|
1138
1156
|
return maybeAccount;
|
|
1139
1157
|
}
|
|
1140
1158
|
async function fetchMaybeOperationState(rpc, address6, config) {
|
|
1141
|
-
const maybeAccount = await (0,
|
|
1159
|
+
const maybeAccount = await (0, import_kit19.fetchEncodedAccount)(rpc, address6, config);
|
|
1142
1160
|
return decodeOperationState(maybeAccount);
|
|
1143
1161
|
}
|
|
1144
1162
|
async function fetchAllOperationState(rpc, addresses, config) {
|
|
@@ -1147,11 +1165,11 @@ async function fetchAllOperationState(rpc, addresses, config) {
|
|
|
1147
1165
|
addresses,
|
|
1148
1166
|
config
|
|
1149
1167
|
);
|
|
1150
|
-
(0,
|
|
1168
|
+
(0, import_kit19.assertAccountsExist)(maybeAccounts);
|
|
1151
1169
|
return maybeAccounts;
|
|
1152
1170
|
}
|
|
1153
1171
|
async function fetchAllMaybeOperationState(rpc, addresses, config) {
|
|
1154
|
-
const maybeAccounts = await (0,
|
|
1172
|
+
const maybeAccounts = await (0, import_kit19.fetchEncodedAccounts)(rpc, addresses, config);
|
|
1155
1173
|
return maybeAccounts.map(
|
|
1156
1174
|
(maybeAccount) => decodeOperationState(maybeAccount)
|
|
1157
1175
|
);
|
|
@@ -1161,7 +1179,7 @@ function getOperationStateSize() {
|
|
|
1161
1179
|
}
|
|
1162
1180
|
|
|
1163
1181
|
// src/generated/accounts/personalPositionState.ts
|
|
1164
|
-
var
|
|
1182
|
+
var import_kit20 = require("@solana/kit");
|
|
1165
1183
|
var PERSONAL_POSITION_STATE_DISCRIMINATOR = new Uint8Array([
|
|
1166
1184
|
70,
|
|
1167
1185
|
111,
|
|
@@ -1173,30 +1191,30 @@ var PERSONAL_POSITION_STATE_DISCRIMINATOR = new Uint8Array([
|
|
|
1173
1191
|
117
|
|
1174
1192
|
]);
|
|
1175
1193
|
function getPersonalPositionStateDiscriminatorBytes() {
|
|
1176
|
-
return (0,
|
|
1194
|
+
return (0, import_kit20.fixEncoderSize)((0, import_kit20.getBytesEncoder)(), 8).encode(
|
|
1177
1195
|
PERSONAL_POSITION_STATE_DISCRIMINATOR
|
|
1178
1196
|
);
|
|
1179
1197
|
}
|
|
1180
1198
|
function getPersonalPositionStateEncoder() {
|
|
1181
|
-
return (0,
|
|
1182
|
-
(0,
|
|
1183
|
-
["discriminator", (0,
|
|
1184
|
-
["bump", (0,
|
|
1185
|
-
["nftMint", (0,
|
|
1186
|
-
["poolId", (0,
|
|
1187
|
-
["tickLowerIndex", (0,
|
|
1188
|
-
["tickUpperIndex", (0,
|
|
1189
|
-
["liquidity", (0,
|
|
1190
|
-
["feeGrowthInside0LastX64", (0,
|
|
1191
|
-
["feeGrowthInside1LastX64", (0,
|
|
1192
|
-
["tokenFeesOwed0", (0,
|
|
1193
|
-
["tokenFeesOwed1", (0,
|
|
1199
|
+
return (0, import_kit20.transformEncoder)(
|
|
1200
|
+
(0, import_kit20.getStructEncoder)([
|
|
1201
|
+
["discriminator", (0, import_kit20.fixEncoderSize)((0, import_kit20.getBytesEncoder)(), 8)],
|
|
1202
|
+
["bump", (0, import_kit20.fixEncoderSize)((0, import_kit20.getBytesEncoder)(), 1)],
|
|
1203
|
+
["nftMint", (0, import_kit20.getAddressEncoder)()],
|
|
1204
|
+
["poolId", (0, import_kit20.getAddressEncoder)()],
|
|
1205
|
+
["tickLowerIndex", (0, import_kit20.getI32Encoder)()],
|
|
1206
|
+
["tickUpperIndex", (0, import_kit20.getI32Encoder)()],
|
|
1207
|
+
["liquidity", (0, import_kit20.getU128Encoder)()],
|
|
1208
|
+
["feeGrowthInside0LastX64", (0, import_kit20.getU128Encoder)()],
|
|
1209
|
+
["feeGrowthInside1LastX64", (0, import_kit20.getU128Encoder)()],
|
|
1210
|
+
["tokenFeesOwed0", (0, import_kit20.getU64Encoder)()],
|
|
1211
|
+
["tokenFeesOwed1", (0, import_kit20.getU64Encoder)()],
|
|
1194
1212
|
[
|
|
1195
1213
|
"rewardInfos",
|
|
1196
|
-
(0,
|
|
1214
|
+
(0, import_kit20.getArrayEncoder)(getPositionRewardInfoEncoder(), { size: 3 })
|
|
1197
1215
|
],
|
|
1198
|
-
["recentEpoch", (0,
|
|
1199
|
-
["padding", (0,
|
|
1216
|
+
["recentEpoch", (0, import_kit20.getU64Encoder)()],
|
|
1217
|
+
["padding", (0, import_kit20.getArrayEncoder)((0, import_kit20.getU64Encoder)(), { size: 7 })]
|
|
1200
1218
|
]),
|
|
1201
1219
|
(value) => ({
|
|
1202
1220
|
...value,
|
|
@@ -1205,34 +1223,34 @@ function getPersonalPositionStateEncoder() {
|
|
|
1205
1223
|
);
|
|
1206
1224
|
}
|
|
1207
1225
|
function getPersonalPositionStateDecoder() {
|
|
1208
|
-
return (0,
|
|
1209
|
-
["discriminator", (0,
|
|
1210
|
-
["bump", (0,
|
|
1211
|
-
["nftMint", (0,
|
|
1212
|
-
["poolId", (0,
|
|
1213
|
-
["tickLowerIndex", (0,
|
|
1214
|
-
["tickUpperIndex", (0,
|
|
1215
|
-
["liquidity", (0,
|
|
1216
|
-
["feeGrowthInside0LastX64", (0,
|
|
1217
|
-
["feeGrowthInside1LastX64", (0,
|
|
1218
|
-
["tokenFeesOwed0", (0,
|
|
1219
|
-
["tokenFeesOwed1", (0,
|
|
1226
|
+
return (0, import_kit20.getStructDecoder)([
|
|
1227
|
+
["discriminator", (0, import_kit20.fixDecoderSize)((0, import_kit20.getBytesDecoder)(), 8)],
|
|
1228
|
+
["bump", (0, import_kit20.fixDecoderSize)((0, import_kit20.getBytesDecoder)(), 1)],
|
|
1229
|
+
["nftMint", (0, import_kit20.getAddressDecoder)()],
|
|
1230
|
+
["poolId", (0, import_kit20.getAddressDecoder)()],
|
|
1231
|
+
["tickLowerIndex", (0, import_kit20.getI32Decoder)()],
|
|
1232
|
+
["tickUpperIndex", (0, import_kit20.getI32Decoder)()],
|
|
1233
|
+
["liquidity", (0, import_kit20.getU128Decoder)()],
|
|
1234
|
+
["feeGrowthInside0LastX64", (0, import_kit20.getU128Decoder)()],
|
|
1235
|
+
["feeGrowthInside1LastX64", (0, import_kit20.getU128Decoder)()],
|
|
1236
|
+
["tokenFeesOwed0", (0, import_kit20.getU64Decoder)()],
|
|
1237
|
+
["tokenFeesOwed1", (0, import_kit20.getU64Decoder)()],
|
|
1220
1238
|
[
|
|
1221
1239
|
"rewardInfos",
|
|
1222
|
-
(0,
|
|
1240
|
+
(0, import_kit20.getArrayDecoder)(getPositionRewardInfoDecoder(), { size: 3 })
|
|
1223
1241
|
],
|
|
1224
|
-
["recentEpoch", (0,
|
|
1225
|
-
["padding", (0,
|
|
1242
|
+
["recentEpoch", (0, import_kit20.getU64Decoder)()],
|
|
1243
|
+
["padding", (0, import_kit20.getArrayDecoder)((0, import_kit20.getU64Decoder)(), { size: 7 })]
|
|
1226
1244
|
]);
|
|
1227
1245
|
}
|
|
1228
1246
|
function getPersonalPositionStateCodec() {
|
|
1229
|
-
return (0,
|
|
1247
|
+
return (0, import_kit20.combineCodec)(
|
|
1230
1248
|
getPersonalPositionStateEncoder(),
|
|
1231
1249
|
getPersonalPositionStateDecoder()
|
|
1232
1250
|
);
|
|
1233
1251
|
}
|
|
1234
1252
|
function decodePersonalPositionState(encodedAccount) {
|
|
1235
|
-
return (0,
|
|
1253
|
+
return (0, import_kit20.decodeAccount)(
|
|
1236
1254
|
encodedAccount,
|
|
1237
1255
|
getPersonalPositionStateDecoder()
|
|
1238
1256
|
);
|
|
@@ -1243,11 +1261,11 @@ async function fetchPersonalPositionState(rpc, address6, config) {
|
|
|
1243
1261
|
address6,
|
|
1244
1262
|
config
|
|
1245
1263
|
);
|
|
1246
|
-
(0,
|
|
1264
|
+
(0, import_kit20.assertAccountExists)(maybeAccount);
|
|
1247
1265
|
return maybeAccount;
|
|
1248
1266
|
}
|
|
1249
1267
|
async function fetchMaybePersonalPositionState(rpc, address6, config) {
|
|
1250
|
-
const maybeAccount = await (0,
|
|
1268
|
+
const maybeAccount = await (0, import_kit20.fetchEncodedAccount)(rpc, address6, config);
|
|
1251
1269
|
return decodePersonalPositionState(maybeAccount);
|
|
1252
1270
|
}
|
|
1253
1271
|
async function fetchAllPersonalPositionState(rpc, addresses, config) {
|
|
@@ -1256,11 +1274,11 @@ async function fetchAllPersonalPositionState(rpc, addresses, config) {
|
|
|
1256
1274
|
addresses,
|
|
1257
1275
|
config
|
|
1258
1276
|
);
|
|
1259
|
-
(0,
|
|
1277
|
+
(0, import_kit20.assertAccountsExist)(maybeAccounts);
|
|
1260
1278
|
return maybeAccounts;
|
|
1261
1279
|
}
|
|
1262
1280
|
async function fetchAllMaybePersonalPositionState(rpc, addresses, config) {
|
|
1263
|
-
const maybeAccounts = await (0,
|
|
1281
|
+
const maybeAccounts = await (0, import_kit20.fetchEncodedAccounts)(rpc, addresses, config);
|
|
1264
1282
|
return maybeAccounts.map(
|
|
1265
1283
|
(maybeAccount) => decodePersonalPositionState(maybeAccount)
|
|
1266
1284
|
);
|
|
@@ -1270,7 +1288,7 @@ function getPersonalPositionStateSize() {
|
|
|
1270
1288
|
}
|
|
1271
1289
|
|
|
1272
1290
|
// src/generated/accounts/poolState.ts
|
|
1273
|
-
var
|
|
1291
|
+
var import_kit21 = require("@solana/kit");
|
|
1274
1292
|
var POOL_STATE_DISCRIMINATOR = new Uint8Array([
|
|
1275
1293
|
247,
|
|
1276
1294
|
237,
|
|
@@ -1282,122 +1300,122 @@ var POOL_STATE_DISCRIMINATOR = new Uint8Array([
|
|
|
1282
1300
|
70
|
|
1283
1301
|
]);
|
|
1284
1302
|
function getPoolStateDiscriminatorBytes() {
|
|
1285
|
-
return (0,
|
|
1303
|
+
return (0, import_kit21.fixEncoderSize)((0, import_kit21.getBytesEncoder)(), 8).encode(POOL_STATE_DISCRIMINATOR);
|
|
1286
1304
|
}
|
|
1287
1305
|
function getPoolStateEncoder() {
|
|
1288
|
-
return (0,
|
|
1289
|
-
(0,
|
|
1290
|
-
["discriminator", (0,
|
|
1291
|
-
["bump", (0,
|
|
1292
|
-
["ammConfig", (0,
|
|
1293
|
-
["owner", (0,
|
|
1294
|
-
["tokenMint0", (0,
|
|
1295
|
-
["tokenMint1", (0,
|
|
1296
|
-
["tokenVault0", (0,
|
|
1297
|
-
["tokenVault1", (0,
|
|
1298
|
-
["observationKey", (0,
|
|
1299
|
-
["mintDecimals0", (0,
|
|
1300
|
-
["mintDecimals1", (0,
|
|
1301
|
-
["tickSpacing", (0,
|
|
1302
|
-
["liquidity", (0,
|
|
1303
|
-
["sqrtPriceX64", (0,
|
|
1304
|
-
["tickCurrent", (0,
|
|
1305
|
-
["padding3", (0,
|
|
1306
|
-
["padding4", (0,
|
|
1307
|
-
["feeGrowthGlobal0X64", (0,
|
|
1308
|
-
["feeGrowthGlobal1X64", (0,
|
|
1309
|
-
["protocolFeesToken0", (0,
|
|
1310
|
-
["protocolFeesToken1", (0,
|
|
1311
|
-
["swapInAmountToken0", (0,
|
|
1312
|
-
["swapOutAmountToken1", (0,
|
|
1313
|
-
["swapInAmountToken1", (0,
|
|
1314
|
-
["swapOutAmountToken0", (0,
|
|
1315
|
-
["status", (0,
|
|
1316
|
-
["padding", (0,
|
|
1317
|
-
["rewardInfos", (0,
|
|
1318
|
-
["tickArrayBitmap", (0,
|
|
1319
|
-
["totalFeesToken0", (0,
|
|
1320
|
-
["totalFeesClaimedToken0", (0,
|
|
1321
|
-
["totalFeesToken1", (0,
|
|
1322
|
-
["totalFeesClaimedToken1", (0,
|
|
1323
|
-
["fundFeesToken0", (0,
|
|
1324
|
-
["fundFeesToken1", (0,
|
|
1325
|
-
["openTime", (0,
|
|
1326
|
-
["recentEpoch", (0,
|
|
1327
|
-
["padding1", (0,
|
|
1328
|
-
["padding2", (0,
|
|
1306
|
+
return (0, import_kit21.transformEncoder)(
|
|
1307
|
+
(0, import_kit21.getStructEncoder)([
|
|
1308
|
+
["discriminator", (0, import_kit21.fixEncoderSize)((0, import_kit21.getBytesEncoder)(), 8)],
|
|
1309
|
+
["bump", (0, import_kit21.fixEncoderSize)((0, import_kit21.getBytesEncoder)(), 1)],
|
|
1310
|
+
["ammConfig", (0, import_kit21.getAddressEncoder)()],
|
|
1311
|
+
["owner", (0, import_kit21.getAddressEncoder)()],
|
|
1312
|
+
["tokenMint0", (0, import_kit21.getAddressEncoder)()],
|
|
1313
|
+
["tokenMint1", (0, import_kit21.getAddressEncoder)()],
|
|
1314
|
+
["tokenVault0", (0, import_kit21.getAddressEncoder)()],
|
|
1315
|
+
["tokenVault1", (0, import_kit21.getAddressEncoder)()],
|
|
1316
|
+
["observationKey", (0, import_kit21.getAddressEncoder)()],
|
|
1317
|
+
["mintDecimals0", (0, import_kit21.getU8Encoder)()],
|
|
1318
|
+
["mintDecimals1", (0, import_kit21.getU8Encoder)()],
|
|
1319
|
+
["tickSpacing", (0, import_kit21.getU16Encoder)()],
|
|
1320
|
+
["liquidity", (0, import_kit21.getU128Encoder)()],
|
|
1321
|
+
["sqrtPriceX64", (0, import_kit21.getU128Encoder)()],
|
|
1322
|
+
["tickCurrent", (0, import_kit21.getI32Encoder)()],
|
|
1323
|
+
["padding3", (0, import_kit21.getU16Encoder)()],
|
|
1324
|
+
["padding4", (0, import_kit21.getU16Encoder)()],
|
|
1325
|
+
["feeGrowthGlobal0X64", (0, import_kit21.getU128Encoder)()],
|
|
1326
|
+
["feeGrowthGlobal1X64", (0, import_kit21.getU128Encoder)()],
|
|
1327
|
+
["protocolFeesToken0", (0, import_kit21.getU64Encoder)()],
|
|
1328
|
+
["protocolFeesToken1", (0, import_kit21.getU64Encoder)()],
|
|
1329
|
+
["swapInAmountToken0", (0, import_kit21.getU128Encoder)()],
|
|
1330
|
+
["swapOutAmountToken1", (0, import_kit21.getU128Encoder)()],
|
|
1331
|
+
["swapInAmountToken1", (0, import_kit21.getU128Encoder)()],
|
|
1332
|
+
["swapOutAmountToken0", (0, import_kit21.getU128Encoder)()],
|
|
1333
|
+
["status", (0, import_kit21.getU8Encoder)()],
|
|
1334
|
+
["padding", (0, import_kit21.fixEncoderSize)((0, import_kit21.getBytesEncoder)(), 7)],
|
|
1335
|
+
["rewardInfos", (0, import_kit21.getArrayEncoder)(getRewardInfoEncoder(), { size: 3 })],
|
|
1336
|
+
["tickArrayBitmap", (0, import_kit21.getArrayEncoder)((0, import_kit21.getU64Encoder)(), { size: 16 })],
|
|
1337
|
+
["totalFeesToken0", (0, import_kit21.getU64Encoder)()],
|
|
1338
|
+
["totalFeesClaimedToken0", (0, import_kit21.getU64Encoder)()],
|
|
1339
|
+
["totalFeesToken1", (0, import_kit21.getU64Encoder)()],
|
|
1340
|
+
["totalFeesClaimedToken1", (0, import_kit21.getU64Encoder)()],
|
|
1341
|
+
["fundFeesToken0", (0, import_kit21.getU64Encoder)()],
|
|
1342
|
+
["fundFeesToken1", (0, import_kit21.getU64Encoder)()],
|
|
1343
|
+
["openTime", (0, import_kit21.getU64Encoder)()],
|
|
1344
|
+
["recentEpoch", (0, import_kit21.getU64Encoder)()],
|
|
1345
|
+
["padding1", (0, import_kit21.getArrayEncoder)((0, import_kit21.getU64Encoder)(), { size: 24 })],
|
|
1346
|
+
["padding2", (0, import_kit21.getArrayEncoder)((0, import_kit21.getU64Encoder)(), { size: 32 })]
|
|
1329
1347
|
]),
|
|
1330
1348
|
(value) => ({ ...value, discriminator: POOL_STATE_DISCRIMINATOR })
|
|
1331
1349
|
);
|
|
1332
1350
|
}
|
|
1333
1351
|
function getPoolStateDecoder() {
|
|
1334
|
-
return (0,
|
|
1335
|
-
["discriminator", (0,
|
|
1336
|
-
["bump", (0,
|
|
1337
|
-
["ammConfig", (0,
|
|
1338
|
-
["owner", (0,
|
|
1339
|
-
["tokenMint0", (0,
|
|
1340
|
-
["tokenMint1", (0,
|
|
1341
|
-
["tokenVault0", (0,
|
|
1342
|
-
["tokenVault1", (0,
|
|
1343
|
-
["observationKey", (0,
|
|
1344
|
-
["mintDecimals0", (0,
|
|
1345
|
-
["mintDecimals1", (0,
|
|
1346
|
-
["tickSpacing", (0,
|
|
1347
|
-
["liquidity", (0,
|
|
1348
|
-
["sqrtPriceX64", (0,
|
|
1349
|
-
["tickCurrent", (0,
|
|
1350
|
-
["padding3", (0,
|
|
1351
|
-
["padding4", (0,
|
|
1352
|
-
["feeGrowthGlobal0X64", (0,
|
|
1353
|
-
["feeGrowthGlobal1X64", (0,
|
|
1354
|
-
["protocolFeesToken0", (0,
|
|
1355
|
-
["protocolFeesToken1", (0,
|
|
1356
|
-
["swapInAmountToken0", (0,
|
|
1357
|
-
["swapOutAmountToken1", (0,
|
|
1358
|
-
["swapInAmountToken1", (0,
|
|
1359
|
-
["swapOutAmountToken0", (0,
|
|
1360
|
-
["status", (0,
|
|
1361
|
-
["padding", (0,
|
|
1362
|
-
["rewardInfos", (0,
|
|
1363
|
-
["tickArrayBitmap", (0,
|
|
1364
|
-
["totalFeesToken0", (0,
|
|
1365
|
-
["totalFeesClaimedToken0", (0,
|
|
1366
|
-
["totalFeesToken1", (0,
|
|
1367
|
-
["totalFeesClaimedToken1", (0,
|
|
1368
|
-
["fundFeesToken0", (0,
|
|
1369
|
-
["fundFeesToken1", (0,
|
|
1370
|
-
["openTime", (0,
|
|
1371
|
-
["recentEpoch", (0,
|
|
1372
|
-
["padding1", (0,
|
|
1373
|
-
["padding2", (0,
|
|
1352
|
+
return (0, import_kit21.getStructDecoder)([
|
|
1353
|
+
["discriminator", (0, import_kit21.fixDecoderSize)((0, import_kit21.getBytesDecoder)(), 8)],
|
|
1354
|
+
["bump", (0, import_kit21.fixDecoderSize)((0, import_kit21.getBytesDecoder)(), 1)],
|
|
1355
|
+
["ammConfig", (0, import_kit21.getAddressDecoder)()],
|
|
1356
|
+
["owner", (0, import_kit21.getAddressDecoder)()],
|
|
1357
|
+
["tokenMint0", (0, import_kit21.getAddressDecoder)()],
|
|
1358
|
+
["tokenMint1", (0, import_kit21.getAddressDecoder)()],
|
|
1359
|
+
["tokenVault0", (0, import_kit21.getAddressDecoder)()],
|
|
1360
|
+
["tokenVault1", (0, import_kit21.getAddressDecoder)()],
|
|
1361
|
+
["observationKey", (0, import_kit21.getAddressDecoder)()],
|
|
1362
|
+
["mintDecimals0", (0, import_kit21.getU8Decoder)()],
|
|
1363
|
+
["mintDecimals1", (0, import_kit21.getU8Decoder)()],
|
|
1364
|
+
["tickSpacing", (0, import_kit21.getU16Decoder)()],
|
|
1365
|
+
["liquidity", (0, import_kit21.getU128Decoder)()],
|
|
1366
|
+
["sqrtPriceX64", (0, import_kit21.getU128Decoder)()],
|
|
1367
|
+
["tickCurrent", (0, import_kit21.getI32Decoder)()],
|
|
1368
|
+
["padding3", (0, import_kit21.getU16Decoder)()],
|
|
1369
|
+
["padding4", (0, import_kit21.getU16Decoder)()],
|
|
1370
|
+
["feeGrowthGlobal0X64", (0, import_kit21.getU128Decoder)()],
|
|
1371
|
+
["feeGrowthGlobal1X64", (0, import_kit21.getU128Decoder)()],
|
|
1372
|
+
["protocolFeesToken0", (0, import_kit21.getU64Decoder)()],
|
|
1373
|
+
["protocolFeesToken1", (0, import_kit21.getU64Decoder)()],
|
|
1374
|
+
["swapInAmountToken0", (0, import_kit21.getU128Decoder)()],
|
|
1375
|
+
["swapOutAmountToken1", (0, import_kit21.getU128Decoder)()],
|
|
1376
|
+
["swapInAmountToken1", (0, import_kit21.getU128Decoder)()],
|
|
1377
|
+
["swapOutAmountToken0", (0, import_kit21.getU128Decoder)()],
|
|
1378
|
+
["status", (0, import_kit21.getU8Decoder)()],
|
|
1379
|
+
["padding", (0, import_kit21.fixDecoderSize)((0, import_kit21.getBytesDecoder)(), 7)],
|
|
1380
|
+
["rewardInfos", (0, import_kit21.getArrayDecoder)(getRewardInfoDecoder(), { size: 3 })],
|
|
1381
|
+
["tickArrayBitmap", (0, import_kit21.getArrayDecoder)((0, import_kit21.getU64Decoder)(), { size: 16 })],
|
|
1382
|
+
["totalFeesToken0", (0, import_kit21.getU64Decoder)()],
|
|
1383
|
+
["totalFeesClaimedToken0", (0, import_kit21.getU64Decoder)()],
|
|
1384
|
+
["totalFeesToken1", (0, import_kit21.getU64Decoder)()],
|
|
1385
|
+
["totalFeesClaimedToken1", (0, import_kit21.getU64Decoder)()],
|
|
1386
|
+
["fundFeesToken0", (0, import_kit21.getU64Decoder)()],
|
|
1387
|
+
["fundFeesToken1", (0, import_kit21.getU64Decoder)()],
|
|
1388
|
+
["openTime", (0, import_kit21.getU64Decoder)()],
|
|
1389
|
+
["recentEpoch", (0, import_kit21.getU64Decoder)()],
|
|
1390
|
+
["padding1", (0, import_kit21.getArrayDecoder)((0, import_kit21.getU64Decoder)(), { size: 24 })],
|
|
1391
|
+
["padding2", (0, import_kit21.getArrayDecoder)((0, import_kit21.getU64Decoder)(), { size: 32 })]
|
|
1374
1392
|
]);
|
|
1375
1393
|
}
|
|
1376
1394
|
function getPoolStateCodec() {
|
|
1377
|
-
return (0,
|
|
1395
|
+
return (0, import_kit21.combineCodec)(getPoolStateEncoder(), getPoolStateDecoder());
|
|
1378
1396
|
}
|
|
1379
1397
|
function decodePoolState(encodedAccount) {
|
|
1380
|
-
return (0,
|
|
1398
|
+
return (0, import_kit21.decodeAccount)(
|
|
1381
1399
|
encodedAccount,
|
|
1382
1400
|
getPoolStateDecoder()
|
|
1383
1401
|
);
|
|
1384
1402
|
}
|
|
1385
1403
|
async function fetchPoolState(rpc, address6, config) {
|
|
1386
1404
|
const maybeAccount = await fetchMaybePoolState(rpc, address6, config);
|
|
1387
|
-
(0,
|
|
1405
|
+
(0, import_kit21.assertAccountExists)(maybeAccount);
|
|
1388
1406
|
return maybeAccount;
|
|
1389
1407
|
}
|
|
1390
1408
|
async function fetchMaybePoolState(rpc, address6, config) {
|
|
1391
|
-
const maybeAccount = await (0,
|
|
1409
|
+
const maybeAccount = await (0, import_kit21.fetchEncodedAccount)(rpc, address6, config);
|
|
1392
1410
|
return decodePoolState(maybeAccount);
|
|
1393
1411
|
}
|
|
1394
1412
|
async function fetchAllPoolState(rpc, addresses, config) {
|
|
1395
1413
|
const maybeAccounts = await fetchAllMaybePoolState(rpc, addresses, config);
|
|
1396
|
-
(0,
|
|
1414
|
+
(0, import_kit21.assertAccountsExist)(maybeAccounts);
|
|
1397
1415
|
return maybeAccounts;
|
|
1398
1416
|
}
|
|
1399
1417
|
async function fetchAllMaybePoolState(rpc, addresses, config) {
|
|
1400
|
-
const maybeAccounts = await (0,
|
|
1418
|
+
const maybeAccounts = await (0, import_kit21.fetchEncodedAccounts)(rpc, addresses, config);
|
|
1401
1419
|
return maybeAccounts.map((maybeAccount) => decodePoolState(maybeAccount));
|
|
1402
1420
|
}
|
|
1403
1421
|
function getPoolStateSize() {
|
|
@@ -1405,7 +1423,7 @@ function getPoolStateSize() {
|
|
|
1405
1423
|
}
|
|
1406
1424
|
|
|
1407
1425
|
// src/generated/accounts/protocolPositionState.ts
|
|
1408
|
-
var
|
|
1426
|
+
var import_kit22 = require("@solana/kit");
|
|
1409
1427
|
var PROTOCOL_POSITION_STATE_DISCRIMINATOR = new Uint8Array([
|
|
1410
1428
|
100,
|
|
1411
1429
|
226,
|
|
@@ -1417,26 +1435,26 @@ var PROTOCOL_POSITION_STATE_DISCRIMINATOR = new Uint8Array([
|
|
|
1417
1435
|
106
|
|
1418
1436
|
]);
|
|
1419
1437
|
function getProtocolPositionStateDiscriminatorBytes() {
|
|
1420
|
-
return (0,
|
|
1438
|
+
return (0, import_kit22.fixEncoderSize)((0, import_kit22.getBytesEncoder)(), 8).encode(
|
|
1421
1439
|
PROTOCOL_POSITION_STATE_DISCRIMINATOR
|
|
1422
1440
|
);
|
|
1423
1441
|
}
|
|
1424
1442
|
function getProtocolPositionStateEncoder() {
|
|
1425
|
-
return (0,
|
|
1426
|
-
(0,
|
|
1427
|
-
["discriminator", (0,
|
|
1428
|
-
["bump", (0,
|
|
1429
|
-
["poolId", (0,
|
|
1430
|
-
["tickLowerIndex", (0,
|
|
1431
|
-
["tickUpperIndex", (0,
|
|
1432
|
-
["liquidity", (0,
|
|
1433
|
-
["feeGrowthInside0LastX64", (0,
|
|
1434
|
-
["feeGrowthInside1LastX64", (0,
|
|
1435
|
-
["tokenFeesOwed0", (0,
|
|
1436
|
-
["tokenFeesOwed1", (0,
|
|
1437
|
-
["rewardGrowthInside", (0,
|
|
1438
|
-
["recentEpoch", (0,
|
|
1439
|
-
["padding", (0,
|
|
1443
|
+
return (0, import_kit22.transformEncoder)(
|
|
1444
|
+
(0, import_kit22.getStructEncoder)([
|
|
1445
|
+
["discriminator", (0, import_kit22.fixEncoderSize)((0, import_kit22.getBytesEncoder)(), 8)],
|
|
1446
|
+
["bump", (0, import_kit22.getU8Encoder)()],
|
|
1447
|
+
["poolId", (0, import_kit22.getAddressEncoder)()],
|
|
1448
|
+
["tickLowerIndex", (0, import_kit22.getI32Encoder)()],
|
|
1449
|
+
["tickUpperIndex", (0, import_kit22.getI32Encoder)()],
|
|
1450
|
+
["liquidity", (0, import_kit22.getU128Encoder)()],
|
|
1451
|
+
["feeGrowthInside0LastX64", (0, import_kit22.getU128Encoder)()],
|
|
1452
|
+
["feeGrowthInside1LastX64", (0, import_kit22.getU128Encoder)()],
|
|
1453
|
+
["tokenFeesOwed0", (0, import_kit22.getU64Encoder)()],
|
|
1454
|
+
["tokenFeesOwed1", (0, import_kit22.getU64Encoder)()],
|
|
1455
|
+
["rewardGrowthInside", (0, import_kit22.getArrayEncoder)((0, import_kit22.getU128Encoder)(), { size: 3 })],
|
|
1456
|
+
["recentEpoch", (0, import_kit22.getU64Encoder)()],
|
|
1457
|
+
["padding", (0, import_kit22.getArrayEncoder)((0, import_kit22.getU64Encoder)(), { size: 7 })]
|
|
1440
1458
|
]),
|
|
1441
1459
|
(value) => ({
|
|
1442
1460
|
...value,
|
|
@@ -1445,30 +1463,30 @@ function getProtocolPositionStateEncoder() {
|
|
|
1445
1463
|
);
|
|
1446
1464
|
}
|
|
1447
1465
|
function getProtocolPositionStateDecoder() {
|
|
1448
|
-
return (0,
|
|
1449
|
-
["discriminator", (0,
|
|
1450
|
-
["bump", (0,
|
|
1451
|
-
["poolId", (0,
|
|
1452
|
-
["tickLowerIndex", (0,
|
|
1453
|
-
["tickUpperIndex", (0,
|
|
1454
|
-
["liquidity", (0,
|
|
1455
|
-
["feeGrowthInside0LastX64", (0,
|
|
1456
|
-
["feeGrowthInside1LastX64", (0,
|
|
1457
|
-
["tokenFeesOwed0", (0,
|
|
1458
|
-
["tokenFeesOwed1", (0,
|
|
1459
|
-
["rewardGrowthInside", (0,
|
|
1460
|
-
["recentEpoch", (0,
|
|
1461
|
-
["padding", (0,
|
|
1466
|
+
return (0, import_kit22.getStructDecoder)([
|
|
1467
|
+
["discriminator", (0, import_kit22.fixDecoderSize)((0, import_kit22.getBytesDecoder)(), 8)],
|
|
1468
|
+
["bump", (0, import_kit22.getU8Decoder)()],
|
|
1469
|
+
["poolId", (0, import_kit22.getAddressDecoder)()],
|
|
1470
|
+
["tickLowerIndex", (0, import_kit22.getI32Decoder)()],
|
|
1471
|
+
["tickUpperIndex", (0, import_kit22.getI32Decoder)()],
|
|
1472
|
+
["liquidity", (0, import_kit22.getU128Decoder)()],
|
|
1473
|
+
["feeGrowthInside0LastX64", (0, import_kit22.getU128Decoder)()],
|
|
1474
|
+
["feeGrowthInside1LastX64", (0, import_kit22.getU128Decoder)()],
|
|
1475
|
+
["tokenFeesOwed0", (0, import_kit22.getU64Decoder)()],
|
|
1476
|
+
["tokenFeesOwed1", (0, import_kit22.getU64Decoder)()],
|
|
1477
|
+
["rewardGrowthInside", (0, import_kit22.getArrayDecoder)((0, import_kit22.getU128Decoder)(), { size: 3 })],
|
|
1478
|
+
["recentEpoch", (0, import_kit22.getU64Decoder)()],
|
|
1479
|
+
["padding", (0, import_kit22.getArrayDecoder)((0, import_kit22.getU64Decoder)(), { size: 7 })]
|
|
1462
1480
|
]);
|
|
1463
1481
|
}
|
|
1464
1482
|
function getProtocolPositionStateCodec() {
|
|
1465
|
-
return (0,
|
|
1483
|
+
return (0, import_kit22.combineCodec)(
|
|
1466
1484
|
getProtocolPositionStateEncoder(),
|
|
1467
1485
|
getProtocolPositionStateDecoder()
|
|
1468
1486
|
);
|
|
1469
1487
|
}
|
|
1470
1488
|
function decodeProtocolPositionState(encodedAccount) {
|
|
1471
|
-
return (0,
|
|
1489
|
+
return (0, import_kit22.decodeAccount)(
|
|
1472
1490
|
encodedAccount,
|
|
1473
1491
|
getProtocolPositionStateDecoder()
|
|
1474
1492
|
);
|
|
@@ -1479,11 +1497,11 @@ async function fetchProtocolPositionState(rpc, address6, config) {
|
|
|
1479
1497
|
address6,
|
|
1480
1498
|
config
|
|
1481
1499
|
);
|
|
1482
|
-
(0,
|
|
1500
|
+
(0, import_kit22.assertAccountExists)(maybeAccount);
|
|
1483
1501
|
return maybeAccount;
|
|
1484
1502
|
}
|
|
1485
1503
|
async function fetchMaybeProtocolPositionState(rpc, address6, config) {
|
|
1486
|
-
const maybeAccount = await (0,
|
|
1504
|
+
const maybeAccount = await (0, import_kit22.fetchEncodedAccount)(rpc, address6, config);
|
|
1487
1505
|
return decodeProtocolPositionState(maybeAccount);
|
|
1488
1506
|
}
|
|
1489
1507
|
async function fetchAllProtocolPositionState(rpc, addresses, config) {
|
|
@@ -1492,11 +1510,11 @@ async function fetchAllProtocolPositionState(rpc, addresses, config) {
|
|
|
1492
1510
|
addresses,
|
|
1493
1511
|
config
|
|
1494
1512
|
);
|
|
1495
|
-
(0,
|
|
1513
|
+
(0, import_kit22.assertAccountsExist)(maybeAccounts);
|
|
1496
1514
|
return maybeAccounts;
|
|
1497
1515
|
}
|
|
1498
1516
|
async function fetchAllMaybeProtocolPositionState(rpc, addresses, config) {
|
|
1499
|
-
const maybeAccounts = await (0,
|
|
1517
|
+
const maybeAccounts = await (0, import_kit22.fetchEncodedAccounts)(rpc, addresses, config);
|
|
1500
1518
|
return maybeAccounts.map(
|
|
1501
1519
|
(maybeAccount) => decodeProtocolPositionState(maybeAccount)
|
|
1502
1520
|
);
|
|
@@ -1506,7 +1524,7 @@ function getProtocolPositionStateSize() {
|
|
|
1506
1524
|
}
|
|
1507
1525
|
|
|
1508
1526
|
// src/generated/accounts/supportMintAssociated.ts
|
|
1509
|
-
var
|
|
1527
|
+
var import_kit23 = require("@solana/kit");
|
|
1510
1528
|
var SUPPORT_MINT_ASSOCIATED_DISCRIMINATOR = new Uint8Array([
|
|
1511
1529
|
134,
|
|
1512
1530
|
40,
|
|
@@ -1518,17 +1536,17 @@ var SUPPORT_MINT_ASSOCIATED_DISCRIMINATOR = new Uint8Array([
|
|
|
1518
1536
|
53
|
|
1519
1537
|
]);
|
|
1520
1538
|
function getSupportMintAssociatedDiscriminatorBytes() {
|
|
1521
|
-
return (0,
|
|
1539
|
+
return (0, import_kit23.fixEncoderSize)((0, import_kit23.getBytesEncoder)(), 8).encode(
|
|
1522
1540
|
SUPPORT_MINT_ASSOCIATED_DISCRIMINATOR
|
|
1523
1541
|
);
|
|
1524
1542
|
}
|
|
1525
1543
|
function getSupportMintAssociatedEncoder() {
|
|
1526
|
-
return (0,
|
|
1527
|
-
(0,
|
|
1528
|
-
["discriminator", (0,
|
|
1529
|
-
["bump", (0,
|
|
1530
|
-
["mint", (0,
|
|
1531
|
-
["padding", (0,
|
|
1544
|
+
return (0, import_kit23.transformEncoder)(
|
|
1545
|
+
(0, import_kit23.getStructEncoder)([
|
|
1546
|
+
["discriminator", (0, import_kit23.fixEncoderSize)((0, import_kit23.getBytesEncoder)(), 8)],
|
|
1547
|
+
["bump", (0, import_kit23.getU8Encoder)()],
|
|
1548
|
+
["mint", (0, import_kit23.getAddressEncoder)()],
|
|
1549
|
+
["padding", (0, import_kit23.getArrayEncoder)((0, import_kit23.getU64Encoder)(), { size: 8 })]
|
|
1532
1550
|
]),
|
|
1533
1551
|
(value) => ({
|
|
1534
1552
|
...value,
|
|
@@ -1537,21 +1555,21 @@ function getSupportMintAssociatedEncoder() {
|
|
|
1537
1555
|
);
|
|
1538
1556
|
}
|
|
1539
1557
|
function getSupportMintAssociatedDecoder() {
|
|
1540
|
-
return (0,
|
|
1541
|
-
["discriminator", (0,
|
|
1542
|
-
["bump", (0,
|
|
1543
|
-
["mint", (0,
|
|
1544
|
-
["padding", (0,
|
|
1558
|
+
return (0, import_kit23.getStructDecoder)([
|
|
1559
|
+
["discriminator", (0, import_kit23.fixDecoderSize)((0, import_kit23.getBytesDecoder)(), 8)],
|
|
1560
|
+
["bump", (0, import_kit23.getU8Decoder)()],
|
|
1561
|
+
["mint", (0, import_kit23.getAddressDecoder)()],
|
|
1562
|
+
["padding", (0, import_kit23.getArrayDecoder)((0, import_kit23.getU64Decoder)(), { size: 8 })]
|
|
1545
1563
|
]);
|
|
1546
1564
|
}
|
|
1547
1565
|
function getSupportMintAssociatedCodec() {
|
|
1548
|
-
return (0,
|
|
1566
|
+
return (0, import_kit23.combineCodec)(
|
|
1549
1567
|
getSupportMintAssociatedEncoder(),
|
|
1550
1568
|
getSupportMintAssociatedDecoder()
|
|
1551
1569
|
);
|
|
1552
1570
|
}
|
|
1553
1571
|
function decodeSupportMintAssociated(encodedAccount) {
|
|
1554
|
-
return (0,
|
|
1572
|
+
return (0, import_kit23.decodeAccount)(
|
|
1555
1573
|
encodedAccount,
|
|
1556
1574
|
getSupportMintAssociatedDecoder()
|
|
1557
1575
|
);
|
|
@@ -1562,11 +1580,11 @@ async function fetchSupportMintAssociated(rpc, address6, config) {
|
|
|
1562
1580
|
address6,
|
|
1563
1581
|
config
|
|
1564
1582
|
);
|
|
1565
|
-
(0,
|
|
1583
|
+
(0, import_kit23.assertAccountExists)(maybeAccount);
|
|
1566
1584
|
return maybeAccount;
|
|
1567
1585
|
}
|
|
1568
1586
|
async function fetchMaybeSupportMintAssociated(rpc, address6, config) {
|
|
1569
|
-
const maybeAccount = await (0,
|
|
1587
|
+
const maybeAccount = await (0, import_kit23.fetchEncodedAccount)(rpc, address6, config);
|
|
1570
1588
|
return decodeSupportMintAssociated(maybeAccount);
|
|
1571
1589
|
}
|
|
1572
1590
|
async function fetchAllSupportMintAssociated(rpc, addresses, config) {
|
|
@@ -1575,11 +1593,11 @@ async function fetchAllSupportMintAssociated(rpc, addresses, config) {
|
|
|
1575
1593
|
addresses,
|
|
1576
1594
|
config
|
|
1577
1595
|
);
|
|
1578
|
-
(0,
|
|
1596
|
+
(0, import_kit23.assertAccountsExist)(maybeAccounts);
|
|
1579
1597
|
return maybeAccounts;
|
|
1580
1598
|
}
|
|
1581
1599
|
async function fetchAllMaybeSupportMintAssociated(rpc, addresses, config) {
|
|
1582
|
-
const maybeAccounts = await (0,
|
|
1600
|
+
const maybeAccounts = await (0, import_kit23.fetchEncodedAccounts)(rpc, addresses, config);
|
|
1583
1601
|
return maybeAccounts.map(
|
|
1584
1602
|
(maybeAccount) => decodeSupportMintAssociated(maybeAccount)
|
|
1585
1603
|
);
|
|
@@ -1589,7 +1607,7 @@ function getSupportMintAssociatedSize() {
|
|
|
1589
1607
|
}
|
|
1590
1608
|
|
|
1591
1609
|
// src/generated/accounts/tickArrayBitmapExtension.ts
|
|
1592
|
-
var
|
|
1610
|
+
var import_kit24 = require("@solana/kit");
|
|
1593
1611
|
var TICK_ARRAY_BITMAP_EXTENSION_DISCRIMINATOR = new Uint8Array([
|
|
1594
1612
|
60,
|
|
1595
1613
|
150,
|
|
@@ -1601,24 +1619,24 @@ var TICK_ARRAY_BITMAP_EXTENSION_DISCRIMINATOR = new Uint8Array([
|
|
|
1601
1619
|
153
|
|
1602
1620
|
]);
|
|
1603
1621
|
function getTickArrayBitmapExtensionDiscriminatorBytes() {
|
|
1604
|
-
return (0,
|
|
1622
|
+
return (0, import_kit24.fixEncoderSize)((0, import_kit24.getBytesEncoder)(), 8).encode(
|
|
1605
1623
|
TICK_ARRAY_BITMAP_EXTENSION_DISCRIMINATOR
|
|
1606
1624
|
);
|
|
1607
1625
|
}
|
|
1608
1626
|
function getTickArrayBitmapExtensionEncoder() {
|
|
1609
|
-
return (0,
|
|
1610
|
-
(0,
|
|
1611
|
-
["discriminator", (0,
|
|
1612
|
-
["poolId", (0,
|
|
1627
|
+
return (0, import_kit24.transformEncoder)(
|
|
1628
|
+
(0, import_kit24.getStructEncoder)([
|
|
1629
|
+
["discriminator", (0, import_kit24.fixEncoderSize)((0, import_kit24.getBytesEncoder)(), 8)],
|
|
1630
|
+
["poolId", (0, import_kit24.getAddressEncoder)()],
|
|
1613
1631
|
[
|
|
1614
1632
|
"positiveTickArrayBitmap",
|
|
1615
|
-
(0,
|
|
1633
|
+
(0, import_kit24.getArrayEncoder)((0, import_kit24.getArrayEncoder)((0, import_kit24.getU64Encoder)(), { size: 8 }), {
|
|
1616
1634
|
size: 14
|
|
1617
1635
|
})
|
|
1618
1636
|
],
|
|
1619
1637
|
[
|
|
1620
1638
|
"negativeTickArrayBitmap",
|
|
1621
|
-
(0,
|
|
1639
|
+
(0, import_kit24.getArrayEncoder)((0, import_kit24.getArrayEncoder)((0, import_kit24.getU64Encoder)(), { size: 8 }), {
|
|
1622
1640
|
size: 14
|
|
1623
1641
|
})
|
|
1624
1642
|
]
|
|
@@ -1630,31 +1648,31 @@ function getTickArrayBitmapExtensionEncoder() {
|
|
|
1630
1648
|
);
|
|
1631
1649
|
}
|
|
1632
1650
|
function getTickArrayBitmapExtensionDecoder() {
|
|
1633
|
-
return (0,
|
|
1634
|
-
["discriminator", (0,
|
|
1635
|
-
["poolId", (0,
|
|
1651
|
+
return (0, import_kit24.getStructDecoder)([
|
|
1652
|
+
["discriminator", (0, import_kit24.fixDecoderSize)((0, import_kit24.getBytesDecoder)(), 8)],
|
|
1653
|
+
["poolId", (0, import_kit24.getAddressDecoder)()],
|
|
1636
1654
|
[
|
|
1637
1655
|
"positiveTickArrayBitmap",
|
|
1638
|
-
(0,
|
|
1656
|
+
(0, import_kit24.getArrayDecoder)((0, import_kit24.getArrayDecoder)((0, import_kit24.getU64Decoder)(), { size: 8 }), {
|
|
1639
1657
|
size: 14
|
|
1640
1658
|
})
|
|
1641
1659
|
],
|
|
1642
1660
|
[
|
|
1643
1661
|
"negativeTickArrayBitmap",
|
|
1644
|
-
(0,
|
|
1662
|
+
(0, import_kit24.getArrayDecoder)((0, import_kit24.getArrayDecoder)((0, import_kit24.getU64Decoder)(), { size: 8 }), {
|
|
1645
1663
|
size: 14
|
|
1646
1664
|
})
|
|
1647
1665
|
]
|
|
1648
1666
|
]);
|
|
1649
1667
|
}
|
|
1650
1668
|
function getTickArrayBitmapExtensionCodec() {
|
|
1651
|
-
return (0,
|
|
1669
|
+
return (0, import_kit24.combineCodec)(
|
|
1652
1670
|
getTickArrayBitmapExtensionEncoder(),
|
|
1653
1671
|
getTickArrayBitmapExtensionDecoder()
|
|
1654
1672
|
);
|
|
1655
1673
|
}
|
|
1656
1674
|
function decodeTickArrayBitmapExtension(encodedAccount) {
|
|
1657
|
-
return (0,
|
|
1675
|
+
return (0, import_kit24.decodeAccount)(
|
|
1658
1676
|
encodedAccount,
|
|
1659
1677
|
getTickArrayBitmapExtensionDecoder()
|
|
1660
1678
|
);
|
|
@@ -1665,11 +1683,11 @@ async function fetchTickArrayBitmapExtension(rpc, address6, config) {
|
|
|
1665
1683
|
address6,
|
|
1666
1684
|
config
|
|
1667
1685
|
);
|
|
1668
|
-
(0,
|
|
1686
|
+
(0, import_kit24.assertAccountExists)(maybeAccount);
|
|
1669
1687
|
return maybeAccount;
|
|
1670
1688
|
}
|
|
1671
1689
|
async function fetchMaybeTickArrayBitmapExtension(rpc, address6, config) {
|
|
1672
|
-
const maybeAccount = await (0,
|
|
1690
|
+
const maybeAccount = await (0, import_kit24.fetchEncodedAccount)(rpc, address6, config);
|
|
1673
1691
|
return decodeTickArrayBitmapExtension(maybeAccount);
|
|
1674
1692
|
}
|
|
1675
1693
|
async function fetchAllTickArrayBitmapExtension(rpc, addresses, config) {
|
|
@@ -1678,11 +1696,11 @@ async function fetchAllTickArrayBitmapExtension(rpc, addresses, config) {
|
|
|
1678
1696
|
addresses,
|
|
1679
1697
|
config
|
|
1680
1698
|
);
|
|
1681
|
-
(0,
|
|
1699
|
+
(0, import_kit24.assertAccountsExist)(maybeAccounts);
|
|
1682
1700
|
return maybeAccounts;
|
|
1683
1701
|
}
|
|
1684
1702
|
async function fetchAllMaybeTickArrayBitmapExtension(rpc, addresses, config) {
|
|
1685
|
-
const maybeAccounts = await (0,
|
|
1703
|
+
const maybeAccounts = await (0, import_kit24.fetchEncodedAccounts)(rpc, addresses, config);
|
|
1686
1704
|
return maybeAccounts.map(
|
|
1687
1705
|
(maybeAccount) => decodeTickArrayBitmapExtension(maybeAccount)
|
|
1688
1706
|
);
|
|
@@ -1692,7 +1710,7 @@ function getTickArrayBitmapExtensionSize() {
|
|
|
1692
1710
|
}
|
|
1693
1711
|
|
|
1694
1712
|
// src/generated/accounts/tickArrayState.ts
|
|
1695
|
-
var
|
|
1713
|
+
var import_kit25 = require("@solana/kit");
|
|
1696
1714
|
var TICK_ARRAY_STATE_DISCRIMINATOR = new Uint8Array([
|
|
1697
1715
|
192,
|
|
1698
1716
|
155,
|
|
@@ -1704,51 +1722,51 @@ var TICK_ARRAY_STATE_DISCRIMINATOR = new Uint8Array([
|
|
|
1704
1722
|
42
|
|
1705
1723
|
]);
|
|
1706
1724
|
function getTickArrayStateDiscriminatorBytes() {
|
|
1707
|
-
return (0,
|
|
1725
|
+
return (0, import_kit25.fixEncoderSize)((0, import_kit25.getBytesEncoder)(), 8).encode(
|
|
1708
1726
|
TICK_ARRAY_STATE_DISCRIMINATOR
|
|
1709
1727
|
);
|
|
1710
1728
|
}
|
|
1711
1729
|
function getTickArrayStateEncoder() {
|
|
1712
|
-
return (0,
|
|
1713
|
-
(0,
|
|
1714
|
-
["discriminator", (0,
|
|
1715
|
-
["poolId", (0,
|
|
1716
|
-
["startTickIndex", (0,
|
|
1717
|
-
["ticks", (0,
|
|
1718
|
-
["initializedTickCount", (0,
|
|
1719
|
-
["recentEpoch", (0,
|
|
1720
|
-
["padding", (0,
|
|
1730
|
+
return (0, import_kit25.transformEncoder)(
|
|
1731
|
+
(0, import_kit25.getStructEncoder)([
|
|
1732
|
+
["discriminator", (0, import_kit25.fixEncoderSize)((0, import_kit25.getBytesEncoder)(), 8)],
|
|
1733
|
+
["poolId", (0, import_kit25.getAddressEncoder)()],
|
|
1734
|
+
["startTickIndex", (0, import_kit25.getI32Encoder)()],
|
|
1735
|
+
["ticks", (0, import_kit25.getArrayEncoder)(getTickStateEncoder(), { size: 60 })],
|
|
1736
|
+
["initializedTickCount", (0, import_kit25.getU8Encoder)()],
|
|
1737
|
+
["recentEpoch", (0, import_kit25.getU64Encoder)()],
|
|
1738
|
+
["padding", (0, import_kit25.fixEncoderSize)((0, import_kit25.getBytesEncoder)(), 107)]
|
|
1721
1739
|
]),
|
|
1722
1740
|
(value) => ({ ...value, discriminator: TICK_ARRAY_STATE_DISCRIMINATOR })
|
|
1723
1741
|
);
|
|
1724
1742
|
}
|
|
1725
1743
|
function getTickArrayStateDecoder() {
|
|
1726
|
-
return (0,
|
|
1727
|
-
["discriminator", (0,
|
|
1728
|
-
["poolId", (0,
|
|
1729
|
-
["startTickIndex", (0,
|
|
1730
|
-
["ticks", (0,
|
|
1731
|
-
["initializedTickCount", (0,
|
|
1732
|
-
["recentEpoch", (0,
|
|
1733
|
-
["padding", (0,
|
|
1744
|
+
return (0, import_kit25.getStructDecoder)([
|
|
1745
|
+
["discriminator", (0, import_kit25.fixDecoderSize)((0, import_kit25.getBytesDecoder)(), 8)],
|
|
1746
|
+
["poolId", (0, import_kit25.getAddressDecoder)()],
|
|
1747
|
+
["startTickIndex", (0, import_kit25.getI32Decoder)()],
|
|
1748
|
+
["ticks", (0, import_kit25.getArrayDecoder)(getTickStateDecoder(), { size: 60 })],
|
|
1749
|
+
["initializedTickCount", (0, import_kit25.getU8Decoder)()],
|
|
1750
|
+
["recentEpoch", (0, import_kit25.getU64Decoder)()],
|
|
1751
|
+
["padding", (0, import_kit25.fixDecoderSize)((0, import_kit25.getBytesDecoder)(), 107)]
|
|
1734
1752
|
]);
|
|
1735
1753
|
}
|
|
1736
1754
|
function getTickArrayStateCodec() {
|
|
1737
|
-
return (0,
|
|
1755
|
+
return (0, import_kit25.combineCodec)(getTickArrayStateEncoder(), getTickArrayStateDecoder());
|
|
1738
1756
|
}
|
|
1739
1757
|
function decodeTickArrayState(encodedAccount) {
|
|
1740
|
-
return (0,
|
|
1758
|
+
return (0, import_kit25.decodeAccount)(
|
|
1741
1759
|
encodedAccount,
|
|
1742
1760
|
getTickArrayStateDecoder()
|
|
1743
1761
|
);
|
|
1744
1762
|
}
|
|
1745
1763
|
async function fetchTickArrayState(rpc, address6, config) {
|
|
1746
1764
|
const maybeAccount = await fetchMaybeTickArrayState(rpc, address6, config);
|
|
1747
|
-
(0,
|
|
1765
|
+
(0, import_kit25.assertAccountExists)(maybeAccount);
|
|
1748
1766
|
return maybeAccount;
|
|
1749
1767
|
}
|
|
1750
1768
|
async function fetchMaybeTickArrayState(rpc, address6, config) {
|
|
1751
|
-
const maybeAccount = await (0,
|
|
1769
|
+
const maybeAccount = await (0, import_kit25.fetchEncodedAccount)(rpc, address6, config);
|
|
1752
1770
|
return decodeTickArrayState(maybeAccount);
|
|
1753
1771
|
}
|
|
1754
1772
|
async function fetchAllTickArrayState(rpc, addresses, config) {
|
|
@@ -1757,11 +1775,11 @@ async function fetchAllTickArrayState(rpc, addresses, config) {
|
|
|
1757
1775
|
addresses,
|
|
1758
1776
|
config
|
|
1759
1777
|
);
|
|
1760
|
-
(0,
|
|
1778
|
+
(0, import_kit25.assertAccountsExist)(maybeAccounts);
|
|
1761
1779
|
return maybeAccounts;
|
|
1762
1780
|
}
|
|
1763
1781
|
async function fetchAllMaybeTickArrayState(rpc, addresses, config) {
|
|
1764
|
-
const maybeAccounts = await (0,
|
|
1782
|
+
const maybeAccounts = await (0, import_kit25.fetchEncodedAccounts)(rpc, addresses, config);
|
|
1765
1783
|
return maybeAccounts.map(
|
|
1766
1784
|
(maybeAccount) => decodeTickArrayState(maybeAccount)
|
|
1767
1785
|
);
|
|
@@ -1771,10 +1789,10 @@ function getTickArrayStateSize() {
|
|
|
1771
1789
|
}
|
|
1772
1790
|
|
|
1773
1791
|
// src/generated/errors/ammV3.ts
|
|
1774
|
-
var
|
|
1792
|
+
var import_kit27 = require("@solana/kit");
|
|
1775
1793
|
|
|
1776
1794
|
// src/generated/programs/ammV3.ts
|
|
1777
|
-
var
|
|
1795
|
+
var import_kit26 = require("@solana/kit");
|
|
1778
1796
|
var AMM_V3_PROGRAM_ADDRESS = "6dMXqGZ3ga2dikrYS9ovDXgHGh5RUsb2RTUj6hrQXhk6";
|
|
1779
1797
|
var AmmV3Account = /* @__PURE__ */ ((AmmV3Account2) => {
|
|
1780
1798
|
AmmV3Account2[AmmV3Account2["AmmConfig"] = 0] = "AmmConfig";
|
|
@@ -1790,81 +1808,81 @@ var AmmV3Account = /* @__PURE__ */ ((AmmV3Account2) => {
|
|
|
1790
1808
|
})(AmmV3Account || {});
|
|
1791
1809
|
function identifyAmmV3Account(account) {
|
|
1792
1810
|
const data = "data" in account ? account.data : account;
|
|
1793
|
-
if ((0,
|
|
1811
|
+
if ((0, import_kit26.containsBytes)(
|
|
1794
1812
|
data,
|
|
1795
|
-
(0,
|
|
1813
|
+
(0, import_kit26.fixEncoderSize)((0, import_kit26.getBytesEncoder)(), 8).encode(
|
|
1796
1814
|
new Uint8Array([218, 244, 33, 104, 203, 203, 43, 111])
|
|
1797
1815
|
),
|
|
1798
1816
|
0
|
|
1799
1817
|
)) {
|
|
1800
1818
|
return 0 /* AmmConfig */;
|
|
1801
1819
|
}
|
|
1802
|
-
if ((0,
|
|
1820
|
+
if ((0, import_kit26.containsBytes)(
|
|
1803
1821
|
data,
|
|
1804
|
-
(0,
|
|
1822
|
+
(0, import_kit26.fixEncoderSize)((0, import_kit26.getBytesEncoder)(), 8).encode(
|
|
1805
1823
|
new Uint8Array([122, 174, 197, 53, 129, 9, 165, 132])
|
|
1806
1824
|
),
|
|
1807
1825
|
0
|
|
1808
1826
|
)) {
|
|
1809
1827
|
return 1 /* ObservationState */;
|
|
1810
1828
|
}
|
|
1811
|
-
if ((0,
|
|
1829
|
+
if ((0, import_kit26.containsBytes)(
|
|
1812
1830
|
data,
|
|
1813
|
-
(0,
|
|
1831
|
+
(0, import_kit26.fixEncoderSize)((0, import_kit26.getBytesEncoder)(), 8).encode(
|
|
1814
1832
|
new Uint8Array([19, 236, 58, 237, 81, 222, 183, 252])
|
|
1815
1833
|
),
|
|
1816
1834
|
0
|
|
1817
1835
|
)) {
|
|
1818
1836
|
return 2 /* OperationState */;
|
|
1819
1837
|
}
|
|
1820
|
-
if ((0,
|
|
1838
|
+
if ((0, import_kit26.containsBytes)(
|
|
1821
1839
|
data,
|
|
1822
|
-
(0,
|
|
1840
|
+
(0, import_kit26.fixEncoderSize)((0, import_kit26.getBytesEncoder)(), 8).encode(
|
|
1823
1841
|
new Uint8Array([70, 111, 150, 126, 230, 15, 25, 117])
|
|
1824
1842
|
),
|
|
1825
1843
|
0
|
|
1826
1844
|
)) {
|
|
1827
1845
|
return 3 /* PersonalPositionState */;
|
|
1828
1846
|
}
|
|
1829
|
-
if ((0,
|
|
1847
|
+
if ((0, import_kit26.containsBytes)(
|
|
1830
1848
|
data,
|
|
1831
|
-
(0,
|
|
1849
|
+
(0, import_kit26.fixEncoderSize)((0, import_kit26.getBytesEncoder)(), 8).encode(
|
|
1832
1850
|
new Uint8Array([247, 237, 227, 245, 215, 195, 222, 70])
|
|
1833
1851
|
),
|
|
1834
1852
|
0
|
|
1835
1853
|
)) {
|
|
1836
1854
|
return 4 /* PoolState */;
|
|
1837
1855
|
}
|
|
1838
|
-
if ((0,
|
|
1856
|
+
if ((0, import_kit26.containsBytes)(
|
|
1839
1857
|
data,
|
|
1840
|
-
(0,
|
|
1858
|
+
(0, import_kit26.fixEncoderSize)((0, import_kit26.getBytesEncoder)(), 8).encode(
|
|
1841
1859
|
new Uint8Array([100, 226, 145, 99, 146, 218, 160, 106])
|
|
1842
1860
|
),
|
|
1843
1861
|
0
|
|
1844
1862
|
)) {
|
|
1845
1863
|
return 5 /* ProtocolPositionState */;
|
|
1846
1864
|
}
|
|
1847
|
-
if ((0,
|
|
1865
|
+
if ((0, import_kit26.containsBytes)(
|
|
1848
1866
|
data,
|
|
1849
|
-
(0,
|
|
1867
|
+
(0, import_kit26.fixEncoderSize)((0, import_kit26.getBytesEncoder)(), 8).encode(
|
|
1850
1868
|
new Uint8Array([134, 40, 183, 79, 12, 112, 162, 53])
|
|
1851
1869
|
),
|
|
1852
1870
|
0
|
|
1853
1871
|
)) {
|
|
1854
1872
|
return 6 /* SupportMintAssociated */;
|
|
1855
1873
|
}
|
|
1856
|
-
if ((0,
|
|
1874
|
+
if ((0, import_kit26.containsBytes)(
|
|
1857
1875
|
data,
|
|
1858
|
-
(0,
|
|
1876
|
+
(0, import_kit26.fixEncoderSize)((0, import_kit26.getBytesEncoder)(), 8).encode(
|
|
1859
1877
|
new Uint8Array([60, 150, 36, 219, 97, 128, 139, 153])
|
|
1860
1878
|
),
|
|
1861
1879
|
0
|
|
1862
1880
|
)) {
|
|
1863
1881
|
return 7 /* TickArrayBitmapExtension */;
|
|
1864
1882
|
}
|
|
1865
|
-
if ((0,
|
|
1883
|
+
if ((0, import_kit26.containsBytes)(
|
|
1866
1884
|
data,
|
|
1867
|
-
(0,
|
|
1885
|
+
(0, import_kit26.fixEncoderSize)((0, import_kit26.getBytesEncoder)(), 8).encode(
|
|
1868
1886
|
new Uint8Array([192, 155, 85, 205, 49, 249, 129, 42])
|
|
1869
1887
|
),
|
|
1870
1888
|
0
|
|
@@ -1901,189 +1919,189 @@ var AmmV3Instruction = /* @__PURE__ */ ((AmmV3Instruction2) => {
|
|
|
1901
1919
|
})(AmmV3Instruction || {});
|
|
1902
1920
|
function identifyAmmV3Instruction(instruction) {
|
|
1903
1921
|
const data = "data" in instruction ? instruction.data : instruction;
|
|
1904
|
-
if ((0,
|
|
1922
|
+
if ((0, import_kit26.containsBytes)(
|
|
1905
1923
|
data,
|
|
1906
|
-
(0,
|
|
1924
|
+
(0, import_kit26.fixEncoderSize)((0, import_kit26.getBytesEncoder)(), 8).encode(
|
|
1907
1925
|
new Uint8Array([123, 134, 81, 0, 49, 68, 98, 98])
|
|
1908
1926
|
),
|
|
1909
1927
|
0
|
|
1910
1928
|
)) {
|
|
1911
1929
|
return 0 /* ClosePosition */;
|
|
1912
1930
|
}
|
|
1913
|
-
if ((0,
|
|
1931
|
+
if ((0, import_kit26.containsBytes)(
|
|
1914
1932
|
data,
|
|
1915
|
-
(0,
|
|
1933
|
+
(0, import_kit26.fixEncoderSize)((0, import_kit26.getBytesEncoder)(), 8).encode(
|
|
1916
1934
|
new Uint8Array([201, 117, 152, 144, 85, 85, 108, 178])
|
|
1917
1935
|
),
|
|
1918
1936
|
0
|
|
1919
1937
|
)) {
|
|
1920
1938
|
return 1 /* CloseProtocolPosition */;
|
|
1921
1939
|
}
|
|
1922
|
-
if ((0,
|
|
1940
|
+
if ((0, import_kit26.containsBytes)(
|
|
1923
1941
|
data,
|
|
1924
|
-
(0,
|
|
1942
|
+
(0, import_kit26.fixEncoderSize)((0, import_kit26.getBytesEncoder)(), 8).encode(
|
|
1925
1943
|
new Uint8Array([167, 138, 78, 149, 223, 194, 6, 126])
|
|
1926
1944
|
),
|
|
1927
1945
|
0
|
|
1928
1946
|
)) {
|
|
1929
1947
|
return 2 /* CollectFundFee */;
|
|
1930
1948
|
}
|
|
1931
|
-
if ((0,
|
|
1949
|
+
if ((0, import_kit26.containsBytes)(
|
|
1932
1950
|
data,
|
|
1933
|
-
(0,
|
|
1951
|
+
(0, import_kit26.fixEncoderSize)((0, import_kit26.getBytesEncoder)(), 8).encode(
|
|
1934
1952
|
new Uint8Array([136, 136, 252, 221, 194, 66, 126, 89])
|
|
1935
1953
|
),
|
|
1936
1954
|
0
|
|
1937
1955
|
)) {
|
|
1938
1956
|
return 3 /* CollectProtocolFee */;
|
|
1939
1957
|
}
|
|
1940
|
-
if ((0,
|
|
1958
|
+
if ((0, import_kit26.containsBytes)(
|
|
1941
1959
|
data,
|
|
1942
|
-
(0,
|
|
1960
|
+
(0, import_kit26.fixEncoderSize)((0, import_kit26.getBytesEncoder)(), 8).encode(
|
|
1943
1961
|
new Uint8Array([18, 237, 166, 197, 34, 16, 213, 144])
|
|
1944
1962
|
),
|
|
1945
1963
|
0
|
|
1946
1964
|
)) {
|
|
1947
1965
|
return 4 /* CollectRemainingRewards */;
|
|
1948
1966
|
}
|
|
1949
|
-
if ((0,
|
|
1967
|
+
if ((0, import_kit26.containsBytes)(
|
|
1950
1968
|
data,
|
|
1951
|
-
(0,
|
|
1969
|
+
(0, import_kit26.fixEncoderSize)((0, import_kit26.getBytesEncoder)(), 8).encode(
|
|
1952
1970
|
new Uint8Array([137, 52, 237, 212, 215, 117, 108, 104])
|
|
1953
1971
|
),
|
|
1954
1972
|
0
|
|
1955
1973
|
)) {
|
|
1956
1974
|
return 5 /* CreateAmmConfig */;
|
|
1957
1975
|
}
|
|
1958
|
-
if ((0,
|
|
1976
|
+
if ((0, import_kit26.containsBytes)(
|
|
1959
1977
|
data,
|
|
1960
|
-
(0,
|
|
1978
|
+
(0, import_kit26.fixEncoderSize)((0, import_kit26.getBytesEncoder)(), 8).encode(
|
|
1961
1979
|
new Uint8Array([63, 87, 148, 33, 109, 35, 8, 104])
|
|
1962
1980
|
),
|
|
1963
1981
|
0
|
|
1964
1982
|
)) {
|
|
1965
1983
|
return 6 /* CreateOperationAccount */;
|
|
1966
1984
|
}
|
|
1967
|
-
if ((0,
|
|
1985
|
+
if ((0, import_kit26.containsBytes)(
|
|
1968
1986
|
data,
|
|
1969
|
-
(0,
|
|
1987
|
+
(0, import_kit26.fixEncoderSize)((0, import_kit26.getBytesEncoder)(), 8).encode(
|
|
1970
1988
|
new Uint8Array([233, 146, 209, 142, 207, 104, 64, 188])
|
|
1971
1989
|
),
|
|
1972
1990
|
0
|
|
1973
1991
|
)) {
|
|
1974
1992
|
return 7 /* CreatePool */;
|
|
1975
1993
|
}
|
|
1976
|
-
if ((0,
|
|
1994
|
+
if ((0, import_kit26.containsBytes)(
|
|
1977
1995
|
data,
|
|
1978
|
-
(0,
|
|
1996
|
+
(0, import_kit26.fixEncoderSize)((0, import_kit26.getBytesEncoder)(), 8).encode(
|
|
1979
1997
|
new Uint8Array([17, 251, 65, 92, 136, 242, 14, 169])
|
|
1980
1998
|
),
|
|
1981
1999
|
0
|
|
1982
2000
|
)) {
|
|
1983
2001
|
return 8 /* CreateSupportMintAssociated */;
|
|
1984
2002
|
}
|
|
1985
|
-
if ((0,
|
|
2003
|
+
if ((0, import_kit26.containsBytes)(
|
|
1986
2004
|
data,
|
|
1987
|
-
(0,
|
|
2005
|
+
(0, import_kit26.fixEncoderSize)((0, import_kit26.getBytesEncoder)(), 8).encode(
|
|
1988
2006
|
new Uint8Array([58, 127, 188, 62, 79, 82, 196, 96])
|
|
1989
2007
|
),
|
|
1990
2008
|
0
|
|
1991
2009
|
)) {
|
|
1992
2010
|
return 9 /* DecreaseLiquidityV2 */;
|
|
1993
2011
|
}
|
|
1994
|
-
if ((0,
|
|
2012
|
+
if ((0, import_kit26.containsBytes)(
|
|
1995
2013
|
data,
|
|
1996
|
-
(0,
|
|
2014
|
+
(0, import_kit26.fixEncoderSize)((0, import_kit26.getBytesEncoder)(), 8).encode(
|
|
1997
2015
|
new Uint8Array([133, 29, 89, 223, 69, 238, 176, 10])
|
|
1998
2016
|
),
|
|
1999
2017
|
0
|
|
2000
2018
|
)) {
|
|
2001
2019
|
return 10 /* IncreaseLiquidityV2 */;
|
|
2002
2020
|
}
|
|
2003
|
-
if ((0,
|
|
2021
|
+
if ((0, import_kit26.containsBytes)(
|
|
2004
2022
|
data,
|
|
2005
|
-
(0,
|
|
2023
|
+
(0, import_kit26.fixEncoderSize)((0, import_kit26.getBytesEncoder)(), 8).encode(
|
|
2006
2024
|
new Uint8Array([95, 135, 192, 196, 242, 129, 230, 68])
|
|
2007
2025
|
),
|
|
2008
2026
|
0
|
|
2009
2027
|
)) {
|
|
2010
2028
|
return 11 /* InitializeReward */;
|
|
2011
2029
|
}
|
|
2012
|
-
if ((0,
|
|
2030
|
+
if ((0, import_kit26.containsBytes)(
|
|
2013
2031
|
data,
|
|
2014
|
-
(0,
|
|
2032
|
+
(0, import_kit26.fixEncoderSize)((0, import_kit26.getBytesEncoder)(), 8).encode(
|
|
2015
2033
|
new Uint8Array([77, 255, 174, 82, 125, 29, 201, 46])
|
|
2016
2034
|
),
|
|
2017
2035
|
0
|
|
2018
2036
|
)) {
|
|
2019
2037
|
return 12 /* OpenPositionWithToken22Nft */;
|
|
2020
2038
|
}
|
|
2021
|
-
if ((0,
|
|
2039
|
+
if ((0, import_kit26.containsBytes)(
|
|
2022
2040
|
data,
|
|
2023
|
-
(0,
|
|
2041
|
+
(0, import_kit26.fixEncoderSize)((0, import_kit26.getBytesEncoder)(), 8).encode(
|
|
2024
2042
|
new Uint8Array([112, 52, 167, 75, 32, 201, 211, 137])
|
|
2025
2043
|
),
|
|
2026
2044
|
0
|
|
2027
2045
|
)) {
|
|
2028
2046
|
return 13 /* SetRewardParams */;
|
|
2029
2047
|
}
|
|
2030
|
-
if ((0,
|
|
2048
|
+
if ((0, import_kit26.containsBytes)(
|
|
2031
2049
|
data,
|
|
2032
|
-
(0,
|
|
2050
|
+
(0, import_kit26.fixEncoderSize)((0, import_kit26.getBytesEncoder)(), 8).encode(
|
|
2033
2051
|
new Uint8Array([69, 125, 115, 218, 245, 186, 242, 196])
|
|
2034
2052
|
),
|
|
2035
2053
|
0
|
|
2036
2054
|
)) {
|
|
2037
2055
|
return 14 /* SwapRouterBaseIn */;
|
|
2038
2056
|
}
|
|
2039
|
-
if ((0,
|
|
2057
|
+
if ((0, import_kit26.containsBytes)(
|
|
2040
2058
|
data,
|
|
2041
|
-
(0,
|
|
2059
|
+
(0, import_kit26.fixEncoderSize)((0, import_kit26.getBytesEncoder)(), 8).encode(
|
|
2042
2060
|
new Uint8Array([43, 4, 237, 11, 26, 201, 30, 98])
|
|
2043
2061
|
),
|
|
2044
2062
|
0
|
|
2045
2063
|
)) {
|
|
2046
2064
|
return 15 /* SwapV2 */;
|
|
2047
2065
|
}
|
|
2048
|
-
if ((0,
|
|
2066
|
+
if ((0, import_kit26.containsBytes)(
|
|
2049
2067
|
data,
|
|
2050
|
-
(0,
|
|
2068
|
+
(0, import_kit26.fixEncoderSize)((0, import_kit26.getBytesEncoder)(), 8).encode(
|
|
2051
2069
|
new Uint8Array([7, 22, 12, 83, 242, 43, 48, 121])
|
|
2052
2070
|
),
|
|
2053
2071
|
0
|
|
2054
2072
|
)) {
|
|
2055
2073
|
return 16 /* TransferRewardOwner */;
|
|
2056
2074
|
}
|
|
2057
|
-
if ((0,
|
|
2075
|
+
if ((0, import_kit26.containsBytes)(
|
|
2058
2076
|
data,
|
|
2059
|
-
(0,
|
|
2077
|
+
(0, import_kit26.fixEncoderSize)((0, import_kit26.getBytesEncoder)(), 8).encode(
|
|
2060
2078
|
new Uint8Array([49, 60, 174, 136, 154, 28, 116, 200])
|
|
2061
2079
|
),
|
|
2062
2080
|
0
|
|
2063
2081
|
)) {
|
|
2064
2082
|
return 17 /* UpdateAmmConfig */;
|
|
2065
2083
|
}
|
|
2066
|
-
if ((0,
|
|
2084
|
+
if ((0, import_kit26.containsBytes)(
|
|
2067
2085
|
data,
|
|
2068
|
-
(0,
|
|
2086
|
+
(0, import_kit26.fixEncoderSize)((0, import_kit26.getBytesEncoder)(), 8).encode(
|
|
2069
2087
|
new Uint8Array([127, 70, 119, 40, 188, 227, 61, 7])
|
|
2070
2088
|
),
|
|
2071
2089
|
0
|
|
2072
2090
|
)) {
|
|
2073
2091
|
return 18 /* UpdateOperationAccount */;
|
|
2074
2092
|
}
|
|
2075
|
-
if ((0,
|
|
2093
|
+
if ((0, import_kit26.containsBytes)(
|
|
2076
2094
|
data,
|
|
2077
|
-
(0,
|
|
2095
|
+
(0, import_kit26.fixEncoderSize)((0, import_kit26.getBytesEncoder)(), 8).encode(
|
|
2078
2096
|
new Uint8Array([130, 87, 108, 6, 46, 224, 117, 123])
|
|
2079
2097
|
),
|
|
2080
2098
|
0
|
|
2081
2099
|
)) {
|
|
2082
2100
|
return 19 /* UpdatePoolStatus */;
|
|
2083
2101
|
}
|
|
2084
|
-
if ((0,
|
|
2102
|
+
if ((0, import_kit26.containsBytes)(
|
|
2085
2103
|
data,
|
|
2086
|
-
(0,
|
|
2104
|
+
(0, import_kit26.fixEncoderSize)((0, import_kit26.getBytesEncoder)(), 8).encode(
|
|
2087
2105
|
new Uint8Array([163, 172, 224, 52, 11, 154, 106, 223])
|
|
2088
2106
|
),
|
|
2089
2107
|
0
|
|
@@ -2198,7 +2216,7 @@ function getAmmV3ErrorMessage(code) {
|
|
|
2198
2216
|
return "Error message not available in production bundles.";
|
|
2199
2217
|
}
|
|
2200
2218
|
function isAmmV3Error(error, transactionMessage, code) {
|
|
2201
|
-
return (0,
|
|
2219
|
+
return (0, import_kit27.isProgramError)(
|
|
2202
2220
|
error,
|
|
2203
2221
|
transactionMessage,
|
|
2204
2222
|
AMM_V3_PROGRAM_ADDRESS,
|
|
@@ -2207,10 +2225,10 @@ function isAmmV3Error(error, transactionMessage, code) {
|
|
|
2207
2225
|
}
|
|
2208
2226
|
|
|
2209
2227
|
// src/generated/instructions/closePosition.ts
|
|
2210
|
-
var
|
|
2228
|
+
var import_kit29 = require("@solana/kit");
|
|
2211
2229
|
|
|
2212
2230
|
// src/generated/shared/index.ts
|
|
2213
|
-
var
|
|
2231
|
+
var import_kit28 = require("@solana/kit");
|
|
2214
2232
|
function expectSome(value) {
|
|
2215
2233
|
if (value === null || value === void 0) {
|
|
2216
2234
|
throw new Error("Expected a value but received null or undefined.");
|
|
@@ -2235,19 +2253,19 @@ function getAccountMetaFactory(programAddress, optionalAccountStrategy) {
|
|
|
2235
2253
|
if (optionalAccountStrategy === "omitted") return;
|
|
2236
2254
|
return Object.freeze({
|
|
2237
2255
|
address: programAddress,
|
|
2238
|
-
role:
|
|
2256
|
+
role: import_kit28.AccountRole.READONLY
|
|
2239
2257
|
});
|
|
2240
2258
|
}
|
|
2241
|
-
const writableRole = account.isWritable ?
|
|
2259
|
+
const writableRole = account.isWritable ? import_kit28.AccountRole.WRITABLE : import_kit28.AccountRole.READONLY;
|
|
2242
2260
|
return Object.freeze({
|
|
2243
2261
|
address: expectAddress(account.value),
|
|
2244
|
-
role: isTransactionSigner(account.value) ? (0,
|
|
2262
|
+
role: isTransactionSigner(account.value) ? (0, import_kit28.upgradeRoleToSigner)(writableRole) : writableRole,
|
|
2245
2263
|
...isTransactionSigner(account.value) ? { signer: account.value } : {}
|
|
2246
2264
|
});
|
|
2247
2265
|
};
|
|
2248
2266
|
}
|
|
2249
2267
|
function isTransactionSigner(value) {
|
|
2250
|
-
return !!value && typeof value === "object" && "address" in value && (0,
|
|
2268
|
+
return !!value && typeof value === "object" && "address" in value && (0, import_kit28.isTransactionSigner)(value);
|
|
2251
2269
|
}
|
|
2252
2270
|
|
|
2253
2271
|
// src/generated/instructions/closePosition.ts
|
|
@@ -2262,23 +2280,23 @@ var CLOSE_POSITION_DISCRIMINATOR = new Uint8Array([
|
|
|
2262
2280
|
98
|
|
2263
2281
|
]);
|
|
2264
2282
|
function getClosePositionDiscriminatorBytes() {
|
|
2265
|
-
return (0,
|
|
2283
|
+
return (0, import_kit29.fixEncoderSize)((0, import_kit29.getBytesEncoder)(), 8).encode(
|
|
2266
2284
|
CLOSE_POSITION_DISCRIMINATOR
|
|
2267
2285
|
);
|
|
2268
2286
|
}
|
|
2269
2287
|
function getClosePositionInstructionDataEncoder() {
|
|
2270
|
-
return (0,
|
|
2271
|
-
(0,
|
|
2288
|
+
return (0, import_kit29.transformEncoder)(
|
|
2289
|
+
(0, import_kit29.getStructEncoder)([["discriminator", (0, import_kit29.fixEncoderSize)((0, import_kit29.getBytesEncoder)(), 8)]]),
|
|
2272
2290
|
(value) => ({ ...value, discriminator: CLOSE_POSITION_DISCRIMINATOR })
|
|
2273
2291
|
);
|
|
2274
2292
|
}
|
|
2275
2293
|
function getClosePositionInstructionDataDecoder() {
|
|
2276
|
-
return (0,
|
|
2277
|
-
["discriminator", (0,
|
|
2294
|
+
return (0, import_kit29.getStructDecoder)([
|
|
2295
|
+
["discriminator", (0, import_kit29.fixDecoderSize)((0, import_kit29.getBytesDecoder)(), 8)]
|
|
2278
2296
|
]);
|
|
2279
2297
|
}
|
|
2280
2298
|
function getClosePositionInstructionDataCodec() {
|
|
2281
|
-
return (0,
|
|
2299
|
+
return (0, import_kit29.combineCodec)(
|
|
2282
2300
|
getClosePositionInstructionDataEncoder(),
|
|
2283
2301
|
getClosePositionInstructionDataDecoder()
|
|
2284
2302
|
);
|
|
@@ -2301,13 +2319,13 @@ async function getClosePositionInstructionAsync(input, config) {
|
|
|
2301
2319
|
};
|
|
2302
2320
|
const accounts = originalAccounts;
|
|
2303
2321
|
if (!accounts.personalPosition.value) {
|
|
2304
|
-
accounts.personalPosition.value = await (0,
|
|
2322
|
+
accounts.personalPosition.value = await (0, import_kit29.getProgramDerivedAddress)({
|
|
2305
2323
|
programAddress,
|
|
2306
2324
|
seeds: [
|
|
2307
|
-
(0,
|
|
2325
|
+
(0, import_kit29.getBytesEncoder)().encode(
|
|
2308
2326
|
new Uint8Array([112, 111, 115, 105, 116, 105, 111, 110])
|
|
2309
2327
|
),
|
|
2310
|
-
(0,
|
|
2328
|
+
(0, import_kit29.getAddressEncoder)().encode(
|
|
2311
2329
|
expectAddress(accounts.positionNftMint.value)
|
|
2312
2330
|
)
|
|
2313
2331
|
]
|
|
@@ -2395,7 +2413,7 @@ function parseClosePositionInstruction(instruction) {
|
|
|
2395
2413
|
}
|
|
2396
2414
|
|
|
2397
2415
|
// src/generated/instructions/closeProtocolPosition.ts
|
|
2398
|
-
var
|
|
2416
|
+
var import_kit30 = require("@solana/kit");
|
|
2399
2417
|
var CLOSE_PROTOCOL_POSITION_DISCRIMINATOR = new Uint8Array([
|
|
2400
2418
|
201,
|
|
2401
2419
|
117,
|
|
@@ -2407,13 +2425,13 @@ var CLOSE_PROTOCOL_POSITION_DISCRIMINATOR = new Uint8Array([
|
|
|
2407
2425
|
178
|
|
2408
2426
|
]);
|
|
2409
2427
|
function getCloseProtocolPositionDiscriminatorBytes() {
|
|
2410
|
-
return (0,
|
|
2428
|
+
return (0, import_kit30.fixEncoderSize)((0, import_kit30.getBytesEncoder)(), 8).encode(
|
|
2411
2429
|
CLOSE_PROTOCOL_POSITION_DISCRIMINATOR
|
|
2412
2430
|
);
|
|
2413
2431
|
}
|
|
2414
2432
|
function getCloseProtocolPositionInstructionDataEncoder() {
|
|
2415
|
-
return (0,
|
|
2416
|
-
(0,
|
|
2433
|
+
return (0, import_kit30.transformEncoder)(
|
|
2434
|
+
(0, import_kit30.getStructEncoder)([["discriminator", (0, import_kit30.fixEncoderSize)((0, import_kit30.getBytesEncoder)(), 8)]]),
|
|
2417
2435
|
(value) => ({
|
|
2418
2436
|
...value,
|
|
2419
2437
|
discriminator: CLOSE_PROTOCOL_POSITION_DISCRIMINATOR
|
|
@@ -2421,12 +2439,12 @@ function getCloseProtocolPositionInstructionDataEncoder() {
|
|
|
2421
2439
|
);
|
|
2422
2440
|
}
|
|
2423
2441
|
function getCloseProtocolPositionInstructionDataDecoder() {
|
|
2424
|
-
return (0,
|
|
2425
|
-
["discriminator", (0,
|
|
2442
|
+
return (0, import_kit30.getStructDecoder)([
|
|
2443
|
+
["discriminator", (0, import_kit30.fixDecoderSize)((0, import_kit30.getBytesDecoder)(), 8)]
|
|
2426
2444
|
]);
|
|
2427
2445
|
}
|
|
2428
2446
|
function getCloseProtocolPositionInstructionDataCodec() {
|
|
2429
|
-
return (0,
|
|
2447
|
+
return (0, import_kit30.combineCodec)(
|
|
2430
2448
|
getCloseProtocolPositionInstructionDataEncoder(),
|
|
2431
2449
|
getCloseProtocolPositionInstructionDataDecoder()
|
|
2432
2450
|
);
|
|
@@ -2474,7 +2492,7 @@ function parseCloseProtocolPositionInstruction(instruction) {
|
|
|
2474
2492
|
}
|
|
2475
2493
|
|
|
2476
2494
|
// src/generated/instructions/collectFundFee.ts
|
|
2477
|
-
var
|
|
2495
|
+
var import_kit31 = require("@solana/kit");
|
|
2478
2496
|
var COLLECT_FUND_FEE_DISCRIMINATOR = new Uint8Array([
|
|
2479
2497
|
167,
|
|
2480
2498
|
138,
|
|
@@ -2486,29 +2504,29 @@ var COLLECT_FUND_FEE_DISCRIMINATOR = new Uint8Array([
|
|
|
2486
2504
|
126
|
|
2487
2505
|
]);
|
|
2488
2506
|
function getCollectFundFeeDiscriminatorBytes() {
|
|
2489
|
-
return (0,
|
|
2507
|
+
return (0, import_kit31.fixEncoderSize)((0, import_kit31.getBytesEncoder)(), 8).encode(
|
|
2490
2508
|
COLLECT_FUND_FEE_DISCRIMINATOR
|
|
2491
2509
|
);
|
|
2492
2510
|
}
|
|
2493
2511
|
function getCollectFundFeeInstructionDataEncoder() {
|
|
2494
|
-
return (0,
|
|
2495
|
-
(0,
|
|
2496
|
-
["discriminator", (0,
|
|
2497
|
-
["amount0Requested", (0,
|
|
2498
|
-
["amount1Requested", (0,
|
|
2512
|
+
return (0, import_kit31.transformEncoder)(
|
|
2513
|
+
(0, import_kit31.getStructEncoder)([
|
|
2514
|
+
["discriminator", (0, import_kit31.fixEncoderSize)((0, import_kit31.getBytesEncoder)(), 8)],
|
|
2515
|
+
["amount0Requested", (0, import_kit31.getU64Encoder)()],
|
|
2516
|
+
["amount1Requested", (0, import_kit31.getU64Encoder)()]
|
|
2499
2517
|
]),
|
|
2500
2518
|
(value) => ({ ...value, discriminator: COLLECT_FUND_FEE_DISCRIMINATOR })
|
|
2501
2519
|
);
|
|
2502
2520
|
}
|
|
2503
2521
|
function getCollectFundFeeInstructionDataDecoder() {
|
|
2504
|
-
return (0,
|
|
2505
|
-
["discriminator", (0,
|
|
2506
|
-
["amount0Requested", (0,
|
|
2507
|
-
["amount1Requested", (0,
|
|
2522
|
+
return (0, import_kit31.getStructDecoder)([
|
|
2523
|
+
["discriminator", (0, import_kit31.fixDecoderSize)((0, import_kit31.getBytesDecoder)(), 8)],
|
|
2524
|
+
["amount0Requested", (0, import_kit31.getU64Decoder)()],
|
|
2525
|
+
["amount1Requested", (0, import_kit31.getU64Decoder)()]
|
|
2508
2526
|
]);
|
|
2509
2527
|
}
|
|
2510
2528
|
function getCollectFundFeeInstructionDataCodec() {
|
|
2511
|
-
return (0,
|
|
2529
|
+
return (0, import_kit31.combineCodec)(
|
|
2512
2530
|
getCollectFundFeeInstructionDataEncoder(),
|
|
2513
2531
|
getCollectFundFeeInstructionDataDecoder()
|
|
2514
2532
|
);
|
|
@@ -2596,7 +2614,7 @@ function parseCollectFundFeeInstruction(instruction) {
|
|
|
2596
2614
|
}
|
|
2597
2615
|
|
|
2598
2616
|
// src/generated/instructions/collectProtocolFee.ts
|
|
2599
|
-
var
|
|
2617
|
+
var import_kit32 = require("@solana/kit");
|
|
2600
2618
|
var COLLECT_PROTOCOL_FEE_DISCRIMINATOR = new Uint8Array([
|
|
2601
2619
|
136,
|
|
2602
2620
|
136,
|
|
@@ -2608,29 +2626,29 @@ var COLLECT_PROTOCOL_FEE_DISCRIMINATOR = new Uint8Array([
|
|
|
2608
2626
|
89
|
|
2609
2627
|
]);
|
|
2610
2628
|
function getCollectProtocolFeeDiscriminatorBytes() {
|
|
2611
|
-
return (0,
|
|
2629
|
+
return (0, import_kit32.fixEncoderSize)((0, import_kit32.getBytesEncoder)(), 8).encode(
|
|
2612
2630
|
COLLECT_PROTOCOL_FEE_DISCRIMINATOR
|
|
2613
2631
|
);
|
|
2614
2632
|
}
|
|
2615
2633
|
function getCollectProtocolFeeInstructionDataEncoder() {
|
|
2616
|
-
return (0,
|
|
2617
|
-
(0,
|
|
2618
|
-
["discriminator", (0,
|
|
2619
|
-
["amount0Requested", (0,
|
|
2620
|
-
["amount1Requested", (0,
|
|
2634
|
+
return (0, import_kit32.transformEncoder)(
|
|
2635
|
+
(0, import_kit32.getStructEncoder)([
|
|
2636
|
+
["discriminator", (0, import_kit32.fixEncoderSize)((0, import_kit32.getBytesEncoder)(), 8)],
|
|
2637
|
+
["amount0Requested", (0, import_kit32.getU64Encoder)()],
|
|
2638
|
+
["amount1Requested", (0, import_kit32.getU64Encoder)()]
|
|
2621
2639
|
]),
|
|
2622
2640
|
(value) => ({ ...value, discriminator: COLLECT_PROTOCOL_FEE_DISCRIMINATOR })
|
|
2623
2641
|
);
|
|
2624
2642
|
}
|
|
2625
2643
|
function getCollectProtocolFeeInstructionDataDecoder() {
|
|
2626
|
-
return (0,
|
|
2627
|
-
["discriminator", (0,
|
|
2628
|
-
["amount0Requested", (0,
|
|
2629
|
-
["amount1Requested", (0,
|
|
2644
|
+
return (0, import_kit32.getStructDecoder)([
|
|
2645
|
+
["discriminator", (0, import_kit32.fixDecoderSize)((0, import_kit32.getBytesDecoder)(), 8)],
|
|
2646
|
+
["amount0Requested", (0, import_kit32.getU64Decoder)()],
|
|
2647
|
+
["amount1Requested", (0, import_kit32.getU64Decoder)()]
|
|
2630
2648
|
]);
|
|
2631
2649
|
}
|
|
2632
2650
|
function getCollectProtocolFeeInstructionDataCodec() {
|
|
2633
|
-
return (0,
|
|
2651
|
+
return (0, import_kit32.combineCodec)(
|
|
2634
2652
|
getCollectProtocolFeeInstructionDataEncoder(),
|
|
2635
2653
|
getCollectProtocolFeeInstructionDataDecoder()
|
|
2636
2654
|
);
|
|
@@ -2720,7 +2738,7 @@ function parseCollectProtocolFeeInstruction(instruction) {
|
|
|
2720
2738
|
}
|
|
2721
2739
|
|
|
2722
2740
|
// src/generated/instructions/collectRemainingRewards.ts
|
|
2723
|
-
var
|
|
2741
|
+
var import_kit33 = require("@solana/kit");
|
|
2724
2742
|
var COLLECT_REMAINING_REWARDS_DISCRIMINATOR = new Uint8Array([
|
|
2725
2743
|
18,
|
|
2726
2744
|
237,
|
|
@@ -2732,15 +2750,15 @@ var COLLECT_REMAINING_REWARDS_DISCRIMINATOR = new Uint8Array([
|
|
|
2732
2750
|
144
|
|
2733
2751
|
]);
|
|
2734
2752
|
function getCollectRemainingRewardsDiscriminatorBytes() {
|
|
2735
|
-
return (0,
|
|
2753
|
+
return (0, import_kit33.fixEncoderSize)((0, import_kit33.getBytesEncoder)(), 8).encode(
|
|
2736
2754
|
COLLECT_REMAINING_REWARDS_DISCRIMINATOR
|
|
2737
2755
|
);
|
|
2738
2756
|
}
|
|
2739
2757
|
function getCollectRemainingRewardsInstructionDataEncoder() {
|
|
2740
|
-
return (0,
|
|
2741
|
-
(0,
|
|
2742
|
-
["discriminator", (0,
|
|
2743
|
-
["rewardIndex", (0,
|
|
2758
|
+
return (0, import_kit33.transformEncoder)(
|
|
2759
|
+
(0, import_kit33.getStructEncoder)([
|
|
2760
|
+
["discriminator", (0, import_kit33.fixEncoderSize)((0, import_kit33.getBytesEncoder)(), 8)],
|
|
2761
|
+
["rewardIndex", (0, import_kit33.getU8Encoder)()]
|
|
2744
2762
|
]),
|
|
2745
2763
|
(value) => ({
|
|
2746
2764
|
...value,
|
|
@@ -2749,13 +2767,13 @@ function getCollectRemainingRewardsInstructionDataEncoder() {
|
|
|
2749
2767
|
);
|
|
2750
2768
|
}
|
|
2751
2769
|
function getCollectRemainingRewardsInstructionDataDecoder() {
|
|
2752
|
-
return (0,
|
|
2753
|
-
["discriminator", (0,
|
|
2754
|
-
["rewardIndex", (0,
|
|
2770
|
+
return (0, import_kit33.getStructDecoder)([
|
|
2771
|
+
["discriminator", (0, import_kit33.fixDecoderSize)((0, import_kit33.getBytesDecoder)(), 8)],
|
|
2772
|
+
["rewardIndex", (0, import_kit33.getU8Decoder)()]
|
|
2755
2773
|
]);
|
|
2756
2774
|
}
|
|
2757
2775
|
function getCollectRemainingRewardsInstructionDataCodec() {
|
|
2758
|
-
return (0,
|
|
2776
|
+
return (0, import_kit33.combineCodec)(
|
|
2759
2777
|
getCollectRemainingRewardsInstructionDataEncoder(),
|
|
2760
2778
|
getCollectRemainingRewardsInstructionDataDecoder()
|
|
2761
2779
|
);
|
|
@@ -2842,7 +2860,7 @@ function parseCollectRemainingRewardsInstruction(instruction) {
|
|
|
2842
2860
|
}
|
|
2843
2861
|
|
|
2844
2862
|
// src/generated/instructions/createAmmConfig.ts
|
|
2845
|
-
var
|
|
2863
|
+
var import_kit34 = require("@solana/kit");
|
|
2846
2864
|
var CREATE_AMM_CONFIG_DISCRIMINATOR = new Uint8Array([
|
|
2847
2865
|
137,
|
|
2848
2866
|
52,
|
|
@@ -2854,35 +2872,35 @@ var CREATE_AMM_CONFIG_DISCRIMINATOR = new Uint8Array([
|
|
|
2854
2872
|
104
|
|
2855
2873
|
]);
|
|
2856
2874
|
function getCreateAmmConfigDiscriminatorBytes() {
|
|
2857
|
-
return (0,
|
|
2875
|
+
return (0, import_kit34.fixEncoderSize)((0, import_kit34.getBytesEncoder)(), 8).encode(
|
|
2858
2876
|
CREATE_AMM_CONFIG_DISCRIMINATOR
|
|
2859
2877
|
);
|
|
2860
2878
|
}
|
|
2861
2879
|
function getCreateAmmConfigInstructionDataEncoder() {
|
|
2862
|
-
return (0,
|
|
2863
|
-
(0,
|
|
2864
|
-
["discriminator", (0,
|
|
2865
|
-
["index", (0,
|
|
2866
|
-
["tickSpacing", (0,
|
|
2867
|
-
["tradeFeeRate", (0,
|
|
2868
|
-
["protocolFeeRate", (0,
|
|
2869
|
-
["fundFeeRate", (0,
|
|
2880
|
+
return (0, import_kit34.transformEncoder)(
|
|
2881
|
+
(0, import_kit34.getStructEncoder)([
|
|
2882
|
+
["discriminator", (0, import_kit34.fixEncoderSize)((0, import_kit34.getBytesEncoder)(), 8)],
|
|
2883
|
+
["index", (0, import_kit34.getU16Encoder)()],
|
|
2884
|
+
["tickSpacing", (0, import_kit34.getU16Encoder)()],
|
|
2885
|
+
["tradeFeeRate", (0, import_kit34.getU32Encoder)()],
|
|
2886
|
+
["protocolFeeRate", (0, import_kit34.getU32Encoder)()],
|
|
2887
|
+
["fundFeeRate", (0, import_kit34.getU32Encoder)()]
|
|
2870
2888
|
]),
|
|
2871
2889
|
(value) => ({ ...value, discriminator: CREATE_AMM_CONFIG_DISCRIMINATOR })
|
|
2872
2890
|
);
|
|
2873
2891
|
}
|
|
2874
2892
|
function getCreateAmmConfigInstructionDataDecoder() {
|
|
2875
|
-
return (0,
|
|
2876
|
-
["discriminator", (0,
|
|
2877
|
-
["index", (0,
|
|
2878
|
-
["tickSpacing", (0,
|
|
2879
|
-
["tradeFeeRate", (0,
|
|
2880
|
-
["protocolFeeRate", (0,
|
|
2881
|
-
["fundFeeRate", (0,
|
|
2893
|
+
return (0, import_kit34.getStructDecoder)([
|
|
2894
|
+
["discriminator", (0, import_kit34.fixDecoderSize)((0, import_kit34.getBytesDecoder)(), 8)],
|
|
2895
|
+
["index", (0, import_kit34.getU16Decoder)()],
|
|
2896
|
+
["tickSpacing", (0, import_kit34.getU16Decoder)()],
|
|
2897
|
+
["tradeFeeRate", (0, import_kit34.getU32Decoder)()],
|
|
2898
|
+
["protocolFeeRate", (0, import_kit34.getU32Decoder)()],
|
|
2899
|
+
["fundFeeRate", (0, import_kit34.getU32Decoder)()]
|
|
2882
2900
|
]);
|
|
2883
2901
|
}
|
|
2884
2902
|
function getCreateAmmConfigInstructionDataCodec() {
|
|
2885
|
-
return (0,
|
|
2903
|
+
return (0, import_kit34.combineCodec)(
|
|
2886
2904
|
getCreateAmmConfigInstructionDataEncoder(),
|
|
2887
2905
|
getCreateAmmConfigInstructionDataDecoder()
|
|
2888
2906
|
);
|
|
@@ -2900,13 +2918,13 @@ async function getCreateAmmConfigInstructionAsync(input, config) {
|
|
|
2900
2918
|
accounts.owner.value = "3kXrf8w8Z6EjLJU4S8dAkpRL2von8z7Eh3kJnFrmo7Z2";
|
|
2901
2919
|
}
|
|
2902
2920
|
if (!accounts.ammConfig.value) {
|
|
2903
|
-
accounts.ammConfig.value = await (0,
|
|
2921
|
+
accounts.ammConfig.value = await (0, import_kit34.getProgramDerivedAddress)({
|
|
2904
2922
|
programAddress,
|
|
2905
2923
|
seeds: [
|
|
2906
|
-
(0,
|
|
2924
|
+
(0, import_kit34.getBytesEncoder)().encode(
|
|
2907
2925
|
new Uint8Array([97, 109, 109, 95, 99, 111, 110, 102, 105, 103])
|
|
2908
2926
|
),
|
|
2909
|
-
(0,
|
|
2927
|
+
(0, import_kit34.getU16Encoder)().encode(expectSome(args.index))
|
|
2910
2928
|
]
|
|
2911
2929
|
});
|
|
2912
2930
|
}
|
|
@@ -2976,7 +2994,7 @@ function parseCreateAmmConfigInstruction(instruction) {
|
|
|
2976
2994
|
}
|
|
2977
2995
|
|
|
2978
2996
|
// src/generated/instructions/createOperationAccount.ts
|
|
2979
|
-
var
|
|
2997
|
+
var import_kit35 = require("@solana/kit");
|
|
2980
2998
|
var CREATE_OPERATION_ACCOUNT_DISCRIMINATOR = new Uint8Array([
|
|
2981
2999
|
63,
|
|
2982
3000
|
87,
|
|
@@ -2988,13 +3006,13 @@ var CREATE_OPERATION_ACCOUNT_DISCRIMINATOR = new Uint8Array([
|
|
|
2988
3006
|
104
|
|
2989
3007
|
]);
|
|
2990
3008
|
function getCreateOperationAccountDiscriminatorBytes() {
|
|
2991
|
-
return (0,
|
|
3009
|
+
return (0, import_kit35.fixEncoderSize)((0, import_kit35.getBytesEncoder)(), 8).encode(
|
|
2992
3010
|
CREATE_OPERATION_ACCOUNT_DISCRIMINATOR
|
|
2993
3011
|
);
|
|
2994
3012
|
}
|
|
2995
3013
|
function getCreateOperationAccountInstructionDataEncoder() {
|
|
2996
|
-
return (0,
|
|
2997
|
-
(0,
|
|
3014
|
+
return (0, import_kit35.transformEncoder)(
|
|
3015
|
+
(0, import_kit35.getStructEncoder)([["discriminator", (0, import_kit35.fixEncoderSize)((0, import_kit35.getBytesEncoder)(), 8)]]),
|
|
2998
3016
|
(value) => ({
|
|
2999
3017
|
...value,
|
|
3000
3018
|
discriminator: CREATE_OPERATION_ACCOUNT_DISCRIMINATOR
|
|
@@ -3002,12 +3020,12 @@ function getCreateOperationAccountInstructionDataEncoder() {
|
|
|
3002
3020
|
);
|
|
3003
3021
|
}
|
|
3004
3022
|
function getCreateOperationAccountInstructionDataDecoder() {
|
|
3005
|
-
return (0,
|
|
3006
|
-
["discriminator", (0,
|
|
3023
|
+
return (0, import_kit35.getStructDecoder)([
|
|
3024
|
+
["discriminator", (0, import_kit35.fixDecoderSize)((0, import_kit35.getBytesDecoder)(), 8)]
|
|
3007
3025
|
]);
|
|
3008
3026
|
}
|
|
3009
3027
|
function getCreateOperationAccountInstructionDataCodec() {
|
|
3010
|
-
return (0,
|
|
3028
|
+
return (0, import_kit35.combineCodec)(
|
|
3011
3029
|
getCreateOperationAccountInstructionDataEncoder(),
|
|
3012
3030
|
getCreateOperationAccountInstructionDataDecoder()
|
|
3013
3031
|
);
|
|
@@ -3024,10 +3042,10 @@ async function getCreateOperationAccountInstructionAsync(input, config) {
|
|
|
3024
3042
|
accounts.owner.value = "3kXrf8w8Z6EjLJU4S8dAkpRL2von8z7Eh3kJnFrmo7Z2";
|
|
3025
3043
|
}
|
|
3026
3044
|
if (!accounts.operationState.value) {
|
|
3027
|
-
accounts.operationState.value = await (0,
|
|
3045
|
+
accounts.operationState.value = await (0, import_kit35.getProgramDerivedAddress)({
|
|
3028
3046
|
programAddress,
|
|
3029
3047
|
seeds: [
|
|
3030
|
-
(0,
|
|
3048
|
+
(0, import_kit35.getBytesEncoder)().encode(
|
|
3031
3049
|
new Uint8Array([111, 112, 101, 114, 97, 116, 105, 111, 110])
|
|
3032
3050
|
)
|
|
3033
3051
|
]
|
|
@@ -3096,7 +3114,7 @@ function parseCreateOperationAccountInstruction(instruction) {
|
|
|
3096
3114
|
}
|
|
3097
3115
|
|
|
3098
3116
|
// src/generated/instructions/createPool.ts
|
|
3099
|
-
var
|
|
3117
|
+
var import_kit36 = require("@solana/kit");
|
|
3100
3118
|
var CREATE_POOL_DISCRIMINATOR = new Uint8Array([
|
|
3101
3119
|
233,
|
|
3102
3120
|
146,
|
|
@@ -3108,27 +3126,27 @@ var CREATE_POOL_DISCRIMINATOR = new Uint8Array([
|
|
|
3108
3126
|
188
|
|
3109
3127
|
]);
|
|
3110
3128
|
function getCreatePoolDiscriminatorBytes() {
|
|
3111
|
-
return (0,
|
|
3129
|
+
return (0, import_kit36.fixEncoderSize)((0, import_kit36.getBytesEncoder)(), 8).encode(CREATE_POOL_DISCRIMINATOR);
|
|
3112
3130
|
}
|
|
3113
3131
|
function getCreatePoolInstructionDataEncoder() {
|
|
3114
|
-
return (0,
|
|
3115
|
-
(0,
|
|
3116
|
-
["discriminator", (0,
|
|
3117
|
-
["sqrtPriceX64", (0,
|
|
3118
|
-
["openTime", (0,
|
|
3132
|
+
return (0, import_kit36.transformEncoder)(
|
|
3133
|
+
(0, import_kit36.getStructEncoder)([
|
|
3134
|
+
["discriminator", (0, import_kit36.fixEncoderSize)((0, import_kit36.getBytesEncoder)(), 8)],
|
|
3135
|
+
["sqrtPriceX64", (0, import_kit36.getU128Encoder)()],
|
|
3136
|
+
["openTime", (0, import_kit36.getU64Encoder)()]
|
|
3119
3137
|
]),
|
|
3120
3138
|
(value) => ({ ...value, discriminator: CREATE_POOL_DISCRIMINATOR })
|
|
3121
3139
|
);
|
|
3122
3140
|
}
|
|
3123
3141
|
function getCreatePoolInstructionDataDecoder() {
|
|
3124
|
-
return (0,
|
|
3125
|
-
["discriminator", (0,
|
|
3126
|
-
["sqrtPriceX64", (0,
|
|
3127
|
-
["openTime", (0,
|
|
3142
|
+
return (0, import_kit36.getStructDecoder)([
|
|
3143
|
+
["discriminator", (0, import_kit36.fixDecoderSize)((0, import_kit36.getBytesDecoder)(), 8)],
|
|
3144
|
+
["sqrtPriceX64", (0, import_kit36.getU128Decoder)()],
|
|
3145
|
+
["openTime", (0, import_kit36.getU64Decoder)()]
|
|
3128
3146
|
]);
|
|
3129
3147
|
}
|
|
3130
3148
|
function getCreatePoolInstructionDataCodec() {
|
|
3131
|
-
return (0,
|
|
3149
|
+
return (0, import_kit36.combineCodec)(
|
|
3132
3150
|
getCreatePoolInstructionDataEncoder(),
|
|
3133
3151
|
getCreatePoolInstructionDataDecoder()
|
|
3134
3152
|
);
|
|
@@ -3156,56 +3174,56 @@ async function getCreatePoolInstructionAsync(input, config) {
|
|
|
3156
3174
|
const accounts = originalAccounts;
|
|
3157
3175
|
const args = { ...input };
|
|
3158
3176
|
if (!accounts.poolState.value) {
|
|
3159
|
-
accounts.poolState.value = await (0,
|
|
3177
|
+
accounts.poolState.value = await (0, import_kit36.getProgramDerivedAddress)({
|
|
3160
3178
|
programAddress,
|
|
3161
3179
|
seeds: [
|
|
3162
|
-
(0,
|
|
3163
|
-
(0,
|
|
3164
|
-
(0,
|
|
3165
|
-
(0,
|
|
3180
|
+
(0, import_kit36.getBytesEncoder)().encode(new Uint8Array([112, 111, 111, 108])),
|
|
3181
|
+
(0, import_kit36.getAddressEncoder)().encode(expectAddress(accounts.ammConfig.value)),
|
|
3182
|
+
(0, import_kit36.getAddressEncoder)().encode(expectAddress(accounts.tokenMint0.value)),
|
|
3183
|
+
(0, import_kit36.getAddressEncoder)().encode(expectAddress(accounts.tokenMint1.value))
|
|
3166
3184
|
]
|
|
3167
3185
|
});
|
|
3168
3186
|
}
|
|
3169
3187
|
if (!accounts.tokenVault0.value) {
|
|
3170
|
-
accounts.tokenVault0.value = await (0,
|
|
3188
|
+
accounts.tokenVault0.value = await (0, import_kit36.getProgramDerivedAddress)({
|
|
3171
3189
|
programAddress,
|
|
3172
3190
|
seeds: [
|
|
3173
|
-
(0,
|
|
3191
|
+
(0, import_kit36.getBytesEncoder)().encode(
|
|
3174
3192
|
new Uint8Array([112, 111, 111, 108, 95, 118, 97, 117, 108, 116])
|
|
3175
3193
|
),
|
|
3176
|
-
(0,
|
|
3177
|
-
(0,
|
|
3194
|
+
(0, import_kit36.getAddressEncoder)().encode(expectAddress(accounts.poolState.value)),
|
|
3195
|
+
(0, import_kit36.getAddressEncoder)().encode(expectAddress(accounts.tokenMint0.value))
|
|
3178
3196
|
]
|
|
3179
3197
|
});
|
|
3180
3198
|
}
|
|
3181
3199
|
if (!accounts.tokenVault1.value) {
|
|
3182
|
-
accounts.tokenVault1.value = await (0,
|
|
3200
|
+
accounts.tokenVault1.value = await (0, import_kit36.getProgramDerivedAddress)({
|
|
3183
3201
|
programAddress,
|
|
3184
3202
|
seeds: [
|
|
3185
|
-
(0,
|
|
3203
|
+
(0, import_kit36.getBytesEncoder)().encode(
|
|
3186
3204
|
new Uint8Array([112, 111, 111, 108, 95, 118, 97, 117, 108, 116])
|
|
3187
3205
|
),
|
|
3188
|
-
(0,
|
|
3189
|
-
(0,
|
|
3206
|
+
(0, import_kit36.getAddressEncoder)().encode(expectAddress(accounts.poolState.value)),
|
|
3207
|
+
(0, import_kit36.getAddressEncoder)().encode(expectAddress(accounts.tokenMint1.value))
|
|
3190
3208
|
]
|
|
3191
3209
|
});
|
|
3192
3210
|
}
|
|
3193
3211
|
if (!accounts.observationState.value) {
|
|
3194
|
-
accounts.observationState.value = await (0,
|
|
3212
|
+
accounts.observationState.value = await (0, import_kit36.getProgramDerivedAddress)({
|
|
3195
3213
|
programAddress,
|
|
3196
3214
|
seeds: [
|
|
3197
|
-
(0,
|
|
3215
|
+
(0, import_kit36.getBytesEncoder)().encode(
|
|
3198
3216
|
new Uint8Array([111, 98, 115, 101, 114, 118, 97, 116, 105, 111, 110])
|
|
3199
3217
|
),
|
|
3200
|
-
(0,
|
|
3218
|
+
(0, import_kit36.getAddressEncoder)().encode(expectAddress(accounts.poolState.value))
|
|
3201
3219
|
]
|
|
3202
3220
|
});
|
|
3203
3221
|
}
|
|
3204
3222
|
if (!accounts.tickArrayBitmap.value) {
|
|
3205
|
-
accounts.tickArrayBitmap.value = await (0,
|
|
3223
|
+
accounts.tickArrayBitmap.value = await (0, import_kit36.getProgramDerivedAddress)({
|
|
3206
3224
|
programAddress,
|
|
3207
3225
|
seeds: [
|
|
3208
|
-
(0,
|
|
3226
|
+
(0, import_kit36.getBytesEncoder)().encode(
|
|
3209
3227
|
new Uint8Array([
|
|
3210
3228
|
112,
|
|
3211
3229
|
111,
|
|
@@ -3241,7 +3259,7 @@ async function getCreatePoolInstructionAsync(input, config) {
|
|
|
3241
3259
|
110
|
|
3242
3260
|
])
|
|
3243
3261
|
),
|
|
3244
|
-
(0,
|
|
3262
|
+
(0, import_kit36.getAddressEncoder)().encode(expectAddress(accounts.poolState.value))
|
|
3245
3263
|
]
|
|
3246
3264
|
});
|
|
3247
3265
|
}
|
|
@@ -3357,7 +3375,7 @@ function parseCreatePoolInstruction(instruction) {
|
|
|
3357
3375
|
}
|
|
3358
3376
|
|
|
3359
3377
|
// src/generated/instructions/createSupportMintAssociated.ts
|
|
3360
|
-
var
|
|
3378
|
+
var import_kit37 = require("@solana/kit");
|
|
3361
3379
|
var CREATE_SUPPORT_MINT_ASSOCIATED_DISCRIMINATOR = new Uint8Array([
|
|
3362
3380
|
17,
|
|
3363
3381
|
251,
|
|
@@ -3369,13 +3387,13 @@ var CREATE_SUPPORT_MINT_ASSOCIATED_DISCRIMINATOR = new Uint8Array([
|
|
|
3369
3387
|
169
|
|
3370
3388
|
]);
|
|
3371
3389
|
function getCreateSupportMintAssociatedDiscriminatorBytes() {
|
|
3372
|
-
return (0,
|
|
3390
|
+
return (0, import_kit37.fixEncoderSize)((0, import_kit37.getBytesEncoder)(), 8).encode(
|
|
3373
3391
|
CREATE_SUPPORT_MINT_ASSOCIATED_DISCRIMINATOR
|
|
3374
3392
|
);
|
|
3375
3393
|
}
|
|
3376
3394
|
function getCreateSupportMintAssociatedInstructionDataEncoder() {
|
|
3377
|
-
return (0,
|
|
3378
|
-
(0,
|
|
3395
|
+
return (0, import_kit37.transformEncoder)(
|
|
3396
|
+
(0, import_kit37.getStructEncoder)([["discriminator", (0, import_kit37.fixEncoderSize)((0, import_kit37.getBytesEncoder)(), 8)]]),
|
|
3379
3397
|
(value) => ({
|
|
3380
3398
|
...value,
|
|
3381
3399
|
discriminator: CREATE_SUPPORT_MINT_ASSOCIATED_DISCRIMINATOR
|
|
@@ -3383,12 +3401,12 @@ function getCreateSupportMintAssociatedInstructionDataEncoder() {
|
|
|
3383
3401
|
);
|
|
3384
3402
|
}
|
|
3385
3403
|
function getCreateSupportMintAssociatedInstructionDataDecoder() {
|
|
3386
|
-
return (0,
|
|
3387
|
-
["discriminator", (0,
|
|
3404
|
+
return (0, import_kit37.getStructDecoder)([
|
|
3405
|
+
["discriminator", (0, import_kit37.fixDecoderSize)((0, import_kit37.getBytesDecoder)(), 8)]
|
|
3388
3406
|
]);
|
|
3389
3407
|
}
|
|
3390
3408
|
function getCreateSupportMintAssociatedInstructionDataCodec() {
|
|
3391
|
-
return (0,
|
|
3409
|
+
return (0, import_kit37.combineCodec)(
|
|
3392
3410
|
getCreateSupportMintAssociatedInstructionDataEncoder(),
|
|
3393
3411
|
getCreateSupportMintAssociatedInstructionDataDecoder()
|
|
3394
3412
|
);
|
|
@@ -3406,10 +3424,10 @@ async function getCreateSupportMintAssociatedInstructionAsync(input, config) {
|
|
|
3406
3424
|
};
|
|
3407
3425
|
const accounts = originalAccounts;
|
|
3408
3426
|
if (!accounts.supportMintAssociated.value) {
|
|
3409
|
-
accounts.supportMintAssociated.value = await (0,
|
|
3427
|
+
accounts.supportMintAssociated.value = await (0, import_kit37.getProgramDerivedAddress)({
|
|
3410
3428
|
programAddress,
|
|
3411
3429
|
seeds: [
|
|
3412
|
-
(0,
|
|
3430
|
+
(0, import_kit37.getBytesEncoder)().encode(
|
|
3413
3431
|
new Uint8Array([
|
|
3414
3432
|
115,
|
|
3415
3433
|
117,
|
|
@@ -3425,7 +3443,7 @@ async function getCreateSupportMintAssociatedInstructionAsync(input, config) {
|
|
|
3425
3443
|
116
|
|
3426
3444
|
])
|
|
3427
3445
|
),
|
|
3428
|
-
(0,
|
|
3446
|
+
(0, import_kit37.getAddressEncoder)().encode(expectAddress(accounts.tokenMint.value))
|
|
3429
3447
|
]
|
|
3430
3448
|
});
|
|
3431
3449
|
}
|
|
@@ -3496,7 +3514,7 @@ function parseCreateSupportMintAssociatedInstruction(instruction) {
|
|
|
3496
3514
|
}
|
|
3497
3515
|
|
|
3498
3516
|
// src/generated/instructions/decreaseLiquidityV2.ts
|
|
3499
|
-
var
|
|
3517
|
+
var import_kit38 = require("@solana/kit");
|
|
3500
3518
|
var DECREASE_LIQUIDITY_V2_DISCRIMINATOR = new Uint8Array([
|
|
3501
3519
|
58,
|
|
3502
3520
|
127,
|
|
@@ -3508,17 +3526,17 @@ var DECREASE_LIQUIDITY_V2_DISCRIMINATOR = new Uint8Array([
|
|
|
3508
3526
|
96
|
|
3509
3527
|
]);
|
|
3510
3528
|
function getDecreaseLiquidityV2DiscriminatorBytes() {
|
|
3511
|
-
return (0,
|
|
3529
|
+
return (0, import_kit38.fixEncoderSize)((0, import_kit38.getBytesEncoder)(), 8).encode(
|
|
3512
3530
|
DECREASE_LIQUIDITY_V2_DISCRIMINATOR
|
|
3513
3531
|
);
|
|
3514
3532
|
}
|
|
3515
3533
|
function getDecreaseLiquidityV2InstructionDataEncoder() {
|
|
3516
|
-
return (0,
|
|
3517
|
-
(0,
|
|
3518
|
-
["discriminator", (0,
|
|
3519
|
-
["liquidity", (0,
|
|
3520
|
-
["amount0Min", (0,
|
|
3521
|
-
["amount1Min", (0,
|
|
3534
|
+
return (0, import_kit38.transformEncoder)(
|
|
3535
|
+
(0, import_kit38.getStructEncoder)([
|
|
3536
|
+
["discriminator", (0, import_kit38.fixEncoderSize)((0, import_kit38.getBytesEncoder)(), 8)],
|
|
3537
|
+
["liquidity", (0, import_kit38.getU128Encoder)()],
|
|
3538
|
+
["amount0Min", (0, import_kit38.getU64Encoder)()],
|
|
3539
|
+
["amount1Min", (0, import_kit38.getU64Encoder)()]
|
|
3522
3540
|
]),
|
|
3523
3541
|
(value) => ({
|
|
3524
3542
|
...value,
|
|
@@ -3527,15 +3545,15 @@ function getDecreaseLiquidityV2InstructionDataEncoder() {
|
|
|
3527
3545
|
);
|
|
3528
3546
|
}
|
|
3529
3547
|
function getDecreaseLiquidityV2InstructionDataDecoder() {
|
|
3530
|
-
return (0,
|
|
3531
|
-
["discriminator", (0,
|
|
3532
|
-
["liquidity", (0,
|
|
3533
|
-
["amount0Min", (0,
|
|
3534
|
-
["amount1Min", (0,
|
|
3548
|
+
return (0, import_kit38.getStructDecoder)([
|
|
3549
|
+
["discriminator", (0, import_kit38.fixDecoderSize)((0, import_kit38.getBytesDecoder)(), 8)],
|
|
3550
|
+
["liquidity", (0, import_kit38.getU128Decoder)()],
|
|
3551
|
+
["amount0Min", (0, import_kit38.getU64Decoder)()],
|
|
3552
|
+
["amount1Min", (0, import_kit38.getU64Decoder)()]
|
|
3535
3553
|
]);
|
|
3536
3554
|
}
|
|
3537
3555
|
function getDecreaseLiquidityV2InstructionDataCodec() {
|
|
3538
|
-
return (0,
|
|
3556
|
+
return (0, import_kit38.combineCodec)(
|
|
3539
3557
|
getDecreaseLiquidityV2InstructionDataEncoder(),
|
|
3540
3558
|
getDecreaseLiquidityV2InstructionDataDecoder()
|
|
3541
3559
|
);
|
|
@@ -3649,7 +3667,7 @@ function parseDecreaseLiquidityV2Instruction(instruction) {
|
|
|
3649
3667
|
}
|
|
3650
3668
|
|
|
3651
3669
|
// src/generated/instructions/increaseLiquidityV2.ts
|
|
3652
|
-
var
|
|
3670
|
+
var import_kit39 = require("@solana/kit");
|
|
3653
3671
|
var INCREASE_LIQUIDITY_V2_DISCRIMINATOR = new Uint8Array([
|
|
3654
3672
|
133,
|
|
3655
3673
|
29,
|
|
@@ -3661,18 +3679,18 @@ var INCREASE_LIQUIDITY_V2_DISCRIMINATOR = new Uint8Array([
|
|
|
3661
3679
|
10
|
|
3662
3680
|
]);
|
|
3663
3681
|
function getIncreaseLiquidityV2DiscriminatorBytes() {
|
|
3664
|
-
return (0,
|
|
3682
|
+
return (0, import_kit39.fixEncoderSize)((0, import_kit39.getBytesEncoder)(), 8).encode(
|
|
3665
3683
|
INCREASE_LIQUIDITY_V2_DISCRIMINATOR
|
|
3666
3684
|
);
|
|
3667
3685
|
}
|
|
3668
3686
|
function getIncreaseLiquidityV2InstructionDataEncoder() {
|
|
3669
|
-
return (0,
|
|
3670
|
-
(0,
|
|
3671
|
-
["discriminator", (0,
|
|
3672
|
-
["liquidity", (0,
|
|
3673
|
-
["amount0Max", (0,
|
|
3674
|
-
["amount1Max", (0,
|
|
3675
|
-
["baseFlag", (0,
|
|
3687
|
+
return (0, import_kit39.transformEncoder)(
|
|
3688
|
+
(0, import_kit39.getStructEncoder)([
|
|
3689
|
+
["discriminator", (0, import_kit39.fixEncoderSize)((0, import_kit39.getBytesEncoder)(), 8)],
|
|
3690
|
+
["liquidity", (0, import_kit39.getU128Encoder)()],
|
|
3691
|
+
["amount0Max", (0, import_kit39.getU64Encoder)()],
|
|
3692
|
+
["amount1Max", (0, import_kit39.getU64Encoder)()],
|
|
3693
|
+
["baseFlag", (0, import_kit39.getOptionEncoder)((0, import_kit39.getBooleanEncoder)())]
|
|
3676
3694
|
]),
|
|
3677
3695
|
(value) => ({
|
|
3678
3696
|
...value,
|
|
@@ -3681,16 +3699,16 @@ function getIncreaseLiquidityV2InstructionDataEncoder() {
|
|
|
3681
3699
|
);
|
|
3682
3700
|
}
|
|
3683
3701
|
function getIncreaseLiquidityV2InstructionDataDecoder() {
|
|
3684
|
-
return (0,
|
|
3685
|
-
["discriminator", (0,
|
|
3686
|
-
["liquidity", (0,
|
|
3687
|
-
["amount0Max", (0,
|
|
3688
|
-
["amount1Max", (0,
|
|
3689
|
-
["baseFlag", (0,
|
|
3702
|
+
return (0, import_kit39.getStructDecoder)([
|
|
3703
|
+
["discriminator", (0, import_kit39.fixDecoderSize)((0, import_kit39.getBytesDecoder)(), 8)],
|
|
3704
|
+
["liquidity", (0, import_kit39.getU128Decoder)()],
|
|
3705
|
+
["amount0Max", (0, import_kit39.getU64Decoder)()],
|
|
3706
|
+
["amount1Max", (0, import_kit39.getU64Decoder)()],
|
|
3707
|
+
["baseFlag", (0, import_kit39.getOptionDecoder)((0, import_kit39.getBooleanDecoder)())]
|
|
3690
3708
|
]);
|
|
3691
3709
|
}
|
|
3692
3710
|
function getIncreaseLiquidityV2InstructionDataCodec() {
|
|
3693
|
-
return (0,
|
|
3711
|
+
return (0, import_kit39.combineCodec)(
|
|
3694
3712
|
getIncreaseLiquidityV2InstructionDataEncoder(),
|
|
3695
3713
|
getIncreaseLiquidityV2InstructionDataDecoder()
|
|
3696
3714
|
);
|
|
@@ -3792,7 +3810,7 @@ function parseIncreaseLiquidityV2Instruction(instruction) {
|
|
|
3792
3810
|
}
|
|
3793
3811
|
|
|
3794
3812
|
// src/generated/instructions/initializeReward.ts
|
|
3795
|
-
var
|
|
3813
|
+
var import_kit40 = require("@solana/kit");
|
|
3796
3814
|
var INITIALIZE_REWARD_DISCRIMINATOR = new Uint8Array([
|
|
3797
3815
|
95,
|
|
3798
3816
|
135,
|
|
@@ -3804,31 +3822,31 @@ var INITIALIZE_REWARD_DISCRIMINATOR = new Uint8Array([
|
|
|
3804
3822
|
68
|
|
3805
3823
|
]);
|
|
3806
3824
|
function getInitializeRewardDiscriminatorBytes() {
|
|
3807
|
-
return (0,
|
|
3825
|
+
return (0, import_kit40.fixEncoderSize)((0, import_kit40.getBytesEncoder)(), 8).encode(
|
|
3808
3826
|
INITIALIZE_REWARD_DISCRIMINATOR
|
|
3809
3827
|
);
|
|
3810
3828
|
}
|
|
3811
3829
|
function getInitializeRewardInstructionDataEncoder() {
|
|
3812
|
-
return (0,
|
|
3813
|
-
(0,
|
|
3814
|
-
["discriminator", (0,
|
|
3815
|
-
["openTime", (0,
|
|
3816
|
-
["endTime", (0,
|
|
3817
|
-
["emissionsPerSecondX64", (0,
|
|
3830
|
+
return (0, import_kit40.transformEncoder)(
|
|
3831
|
+
(0, import_kit40.getStructEncoder)([
|
|
3832
|
+
["discriminator", (0, import_kit40.fixEncoderSize)((0, import_kit40.getBytesEncoder)(), 8)],
|
|
3833
|
+
["openTime", (0, import_kit40.getU64Encoder)()],
|
|
3834
|
+
["endTime", (0, import_kit40.getU64Encoder)()],
|
|
3835
|
+
["emissionsPerSecondX64", (0, import_kit40.getU128Encoder)()]
|
|
3818
3836
|
]),
|
|
3819
3837
|
(value) => ({ ...value, discriminator: INITIALIZE_REWARD_DISCRIMINATOR })
|
|
3820
3838
|
);
|
|
3821
3839
|
}
|
|
3822
3840
|
function getInitializeRewardInstructionDataDecoder() {
|
|
3823
|
-
return (0,
|
|
3824
|
-
["discriminator", (0,
|
|
3825
|
-
["openTime", (0,
|
|
3826
|
-
["endTime", (0,
|
|
3827
|
-
["emissionsPerSecondX64", (0,
|
|
3841
|
+
return (0, import_kit40.getStructDecoder)([
|
|
3842
|
+
["discriminator", (0, import_kit40.fixDecoderSize)((0, import_kit40.getBytesDecoder)(), 8)],
|
|
3843
|
+
["openTime", (0, import_kit40.getU64Decoder)()],
|
|
3844
|
+
["endTime", (0, import_kit40.getU64Decoder)()],
|
|
3845
|
+
["emissionsPerSecondX64", (0, import_kit40.getU128Decoder)()]
|
|
3828
3846
|
]);
|
|
3829
3847
|
}
|
|
3830
3848
|
function getInitializeRewardInstructionDataCodec() {
|
|
3831
|
-
return (0,
|
|
3849
|
+
return (0, import_kit40.combineCodec)(
|
|
3832
3850
|
getInitializeRewardInstructionDataEncoder(),
|
|
3833
3851
|
getInitializeRewardInstructionDataDecoder()
|
|
3834
3852
|
);
|
|
@@ -3862,20 +3880,20 @@ async function getInitializeRewardInstructionAsync(input, config) {
|
|
|
3862
3880
|
const accounts = originalAccounts;
|
|
3863
3881
|
const args = { ...input };
|
|
3864
3882
|
if (!accounts.operationState.value) {
|
|
3865
|
-
accounts.operationState.value = await (0,
|
|
3883
|
+
accounts.operationState.value = await (0, import_kit40.getProgramDerivedAddress)({
|
|
3866
3884
|
programAddress,
|
|
3867
3885
|
seeds: [
|
|
3868
|
-
(0,
|
|
3886
|
+
(0, import_kit40.getBytesEncoder)().encode(
|
|
3869
3887
|
new Uint8Array([111, 112, 101, 114, 97, 116, 105, 111, 110])
|
|
3870
3888
|
)
|
|
3871
3889
|
]
|
|
3872
3890
|
});
|
|
3873
3891
|
}
|
|
3874
3892
|
if (!accounts.rewardTokenVault.value) {
|
|
3875
|
-
accounts.rewardTokenVault.value = await (0,
|
|
3893
|
+
accounts.rewardTokenVault.value = await (0, import_kit40.getProgramDerivedAddress)({
|
|
3876
3894
|
programAddress,
|
|
3877
3895
|
seeds: [
|
|
3878
|
-
(0,
|
|
3896
|
+
(0, import_kit40.getBytesEncoder)().encode(
|
|
3879
3897
|
new Uint8Array([
|
|
3880
3898
|
112,
|
|
3881
3899
|
111,
|
|
@@ -3896,8 +3914,8 @@ async function getInitializeRewardInstructionAsync(input, config) {
|
|
|
3896
3914
|
116
|
|
3897
3915
|
])
|
|
3898
3916
|
),
|
|
3899
|
-
(0,
|
|
3900
|
-
(0,
|
|
3917
|
+
(0, import_kit40.getAddressEncoder)().encode(expectAddress(accounts.poolState.value)),
|
|
3918
|
+
(0, import_kit40.getAddressEncoder)().encode(
|
|
3901
3919
|
expectAddress(accounts.rewardTokenMint.value)
|
|
3902
3920
|
)
|
|
3903
3921
|
]
|
|
@@ -4012,7 +4030,7 @@ function parseInitializeRewardInstruction(instruction) {
|
|
|
4012
4030
|
}
|
|
4013
4031
|
|
|
4014
4032
|
// src/generated/instructions/openPositionWithToken22Nft.ts
|
|
4015
|
-
var
|
|
4033
|
+
var import_kit41 = require("@solana/kit");
|
|
4016
4034
|
var OPEN_POSITION_WITH_TOKEN22_NFT_DISCRIMINATOR = new Uint8Array([
|
|
4017
4035
|
77,
|
|
4018
4036
|
255,
|
|
@@ -4024,23 +4042,23 @@ var OPEN_POSITION_WITH_TOKEN22_NFT_DISCRIMINATOR = new Uint8Array([
|
|
|
4024
4042
|
46
|
|
4025
4043
|
]);
|
|
4026
4044
|
function getOpenPositionWithToken22NftDiscriminatorBytes() {
|
|
4027
|
-
return (0,
|
|
4045
|
+
return (0, import_kit41.fixEncoderSize)((0, import_kit41.getBytesEncoder)(), 8).encode(
|
|
4028
4046
|
OPEN_POSITION_WITH_TOKEN22_NFT_DISCRIMINATOR
|
|
4029
4047
|
);
|
|
4030
4048
|
}
|
|
4031
4049
|
function getOpenPositionWithToken22NftInstructionDataEncoder() {
|
|
4032
|
-
return (0,
|
|
4033
|
-
(0,
|
|
4034
|
-
["discriminator", (0,
|
|
4035
|
-
["tickLowerIndex", (0,
|
|
4036
|
-
["tickUpperIndex", (0,
|
|
4037
|
-
["tickArrayLowerStartIndex", (0,
|
|
4038
|
-
["tickArrayUpperStartIndex", (0,
|
|
4039
|
-
["liquidity", (0,
|
|
4040
|
-
["amount0Max", (0,
|
|
4041
|
-
["amount1Max", (0,
|
|
4042
|
-
["withMetadata", (0,
|
|
4043
|
-
["baseFlag", (0,
|
|
4050
|
+
return (0, import_kit41.transformEncoder)(
|
|
4051
|
+
(0, import_kit41.getStructEncoder)([
|
|
4052
|
+
["discriminator", (0, import_kit41.fixEncoderSize)((0, import_kit41.getBytesEncoder)(), 8)],
|
|
4053
|
+
["tickLowerIndex", (0, import_kit41.getI32Encoder)()],
|
|
4054
|
+
["tickUpperIndex", (0, import_kit41.getI32Encoder)()],
|
|
4055
|
+
["tickArrayLowerStartIndex", (0, import_kit41.getI32Encoder)()],
|
|
4056
|
+
["tickArrayUpperStartIndex", (0, import_kit41.getI32Encoder)()],
|
|
4057
|
+
["liquidity", (0, import_kit41.getU128Encoder)()],
|
|
4058
|
+
["amount0Max", (0, import_kit41.getU64Encoder)()],
|
|
4059
|
+
["amount1Max", (0, import_kit41.getU64Encoder)()],
|
|
4060
|
+
["withMetadata", (0, import_kit41.getBooleanEncoder)()],
|
|
4061
|
+
["baseFlag", (0, import_kit41.getOptionEncoder)((0, import_kit41.getBooleanEncoder)())]
|
|
4044
4062
|
]),
|
|
4045
4063
|
(value) => ({
|
|
4046
4064
|
...value,
|
|
@@ -4049,21 +4067,21 @@ function getOpenPositionWithToken22NftInstructionDataEncoder() {
|
|
|
4049
4067
|
);
|
|
4050
4068
|
}
|
|
4051
4069
|
function getOpenPositionWithToken22NftInstructionDataDecoder() {
|
|
4052
|
-
return (0,
|
|
4053
|
-
["discriminator", (0,
|
|
4054
|
-
["tickLowerIndex", (0,
|
|
4055
|
-
["tickUpperIndex", (0,
|
|
4056
|
-
["tickArrayLowerStartIndex", (0,
|
|
4057
|
-
["tickArrayUpperStartIndex", (0,
|
|
4058
|
-
["liquidity", (0,
|
|
4059
|
-
["amount0Max", (0,
|
|
4060
|
-
["amount1Max", (0,
|
|
4061
|
-
["withMetadata", (0,
|
|
4062
|
-
["baseFlag", (0,
|
|
4070
|
+
return (0, import_kit41.getStructDecoder)([
|
|
4071
|
+
["discriminator", (0, import_kit41.fixDecoderSize)((0, import_kit41.getBytesDecoder)(), 8)],
|
|
4072
|
+
["tickLowerIndex", (0, import_kit41.getI32Decoder)()],
|
|
4073
|
+
["tickUpperIndex", (0, import_kit41.getI32Decoder)()],
|
|
4074
|
+
["tickArrayLowerStartIndex", (0, import_kit41.getI32Decoder)()],
|
|
4075
|
+
["tickArrayUpperStartIndex", (0, import_kit41.getI32Decoder)()],
|
|
4076
|
+
["liquidity", (0, import_kit41.getU128Decoder)()],
|
|
4077
|
+
["amount0Max", (0, import_kit41.getU64Decoder)()],
|
|
4078
|
+
["amount1Max", (0, import_kit41.getU64Decoder)()],
|
|
4079
|
+
["withMetadata", (0, import_kit41.getBooleanDecoder)()],
|
|
4080
|
+
["baseFlag", (0, import_kit41.getOptionDecoder)((0, import_kit41.getBooleanDecoder)())]
|
|
4063
4081
|
]);
|
|
4064
4082
|
}
|
|
4065
4083
|
function getOpenPositionWithToken22NftInstructionDataCodec() {
|
|
4066
|
-
return (0,
|
|
4084
|
+
return (0, import_kit41.combineCodec)(
|
|
4067
4085
|
getOpenPositionWithToken22NftInstructionDataEncoder(),
|
|
4068
4086
|
getOpenPositionWithToken22NftInstructionDataDecoder()
|
|
4069
4087
|
);
|
|
@@ -4113,37 +4131,37 @@ async function getOpenPositionWithToken22NftInstructionAsync(input, config) {
|
|
|
4113
4131
|
const accounts = originalAccounts;
|
|
4114
4132
|
const args = { ...input };
|
|
4115
4133
|
if (!accounts.tickArrayLower.value) {
|
|
4116
|
-
accounts.tickArrayLower.value = await (0,
|
|
4134
|
+
accounts.tickArrayLower.value = await (0, import_kit41.getProgramDerivedAddress)({
|
|
4117
4135
|
programAddress,
|
|
4118
4136
|
seeds: [
|
|
4119
|
-
(0,
|
|
4137
|
+
(0, import_kit41.getBytesEncoder)().encode(
|
|
4120
4138
|
new Uint8Array([116, 105, 99, 107, 95, 97, 114, 114, 97, 121])
|
|
4121
4139
|
),
|
|
4122
|
-
(0,
|
|
4123
|
-
(0,
|
|
4140
|
+
(0, import_kit41.getAddressEncoder)().encode(expectAddress(accounts.poolState.value)),
|
|
4141
|
+
(0, import_kit41.getI32Encoder)().encode(expectSome(args.tickArrayLowerStartIndex))
|
|
4124
4142
|
]
|
|
4125
4143
|
});
|
|
4126
4144
|
}
|
|
4127
4145
|
if (!accounts.tickArrayUpper.value) {
|
|
4128
|
-
accounts.tickArrayUpper.value = await (0,
|
|
4146
|
+
accounts.tickArrayUpper.value = await (0, import_kit41.getProgramDerivedAddress)({
|
|
4129
4147
|
programAddress,
|
|
4130
4148
|
seeds: [
|
|
4131
|
-
(0,
|
|
4149
|
+
(0, import_kit41.getBytesEncoder)().encode(
|
|
4132
4150
|
new Uint8Array([116, 105, 99, 107, 95, 97, 114, 114, 97, 121])
|
|
4133
4151
|
),
|
|
4134
|
-
(0,
|
|
4135
|
-
(0,
|
|
4152
|
+
(0, import_kit41.getAddressEncoder)().encode(expectAddress(accounts.poolState.value)),
|
|
4153
|
+
(0, import_kit41.getI32Encoder)().encode(expectSome(args.tickArrayUpperStartIndex))
|
|
4136
4154
|
]
|
|
4137
4155
|
});
|
|
4138
4156
|
}
|
|
4139
4157
|
if (!accounts.personalPosition.value) {
|
|
4140
|
-
accounts.personalPosition.value = await (0,
|
|
4158
|
+
accounts.personalPosition.value = await (0, import_kit41.getProgramDerivedAddress)({
|
|
4141
4159
|
programAddress,
|
|
4142
4160
|
seeds: [
|
|
4143
|
-
(0,
|
|
4161
|
+
(0, import_kit41.getBytesEncoder)().encode(
|
|
4144
4162
|
new Uint8Array([112, 111, 115, 105, 116, 105, 111, 110])
|
|
4145
4163
|
),
|
|
4146
|
-
(0,
|
|
4164
|
+
(0, import_kit41.getAddressEncoder)().encode(
|
|
4147
4165
|
expectAddress(accounts.positionNftMint.value)
|
|
4148
4166
|
)
|
|
4149
4167
|
]
|
|
@@ -4324,7 +4342,7 @@ function parseOpenPositionWithToken22NftInstruction(instruction) {
|
|
|
4324
4342
|
}
|
|
4325
4343
|
|
|
4326
4344
|
// src/generated/instructions/setRewardParams.ts
|
|
4327
|
-
var
|
|
4345
|
+
var import_kit42 = require("@solana/kit");
|
|
4328
4346
|
var SET_REWARD_PARAMS_DISCRIMINATOR = new Uint8Array([
|
|
4329
4347
|
112,
|
|
4330
4348
|
52,
|
|
@@ -4336,33 +4354,33 @@ var SET_REWARD_PARAMS_DISCRIMINATOR = new Uint8Array([
|
|
|
4336
4354
|
137
|
|
4337
4355
|
]);
|
|
4338
4356
|
function getSetRewardParamsDiscriminatorBytes() {
|
|
4339
|
-
return (0,
|
|
4357
|
+
return (0, import_kit42.fixEncoderSize)((0, import_kit42.getBytesEncoder)(), 8).encode(
|
|
4340
4358
|
SET_REWARD_PARAMS_DISCRIMINATOR
|
|
4341
4359
|
);
|
|
4342
4360
|
}
|
|
4343
4361
|
function getSetRewardParamsInstructionDataEncoder() {
|
|
4344
|
-
return (0,
|
|
4345
|
-
(0,
|
|
4346
|
-
["discriminator", (0,
|
|
4347
|
-
["rewardIndex", (0,
|
|
4348
|
-
["emissionsPerSecondX64", (0,
|
|
4349
|
-
["openTime", (0,
|
|
4350
|
-
["endTime", (0,
|
|
4362
|
+
return (0, import_kit42.transformEncoder)(
|
|
4363
|
+
(0, import_kit42.getStructEncoder)([
|
|
4364
|
+
["discriminator", (0, import_kit42.fixEncoderSize)((0, import_kit42.getBytesEncoder)(), 8)],
|
|
4365
|
+
["rewardIndex", (0, import_kit42.getU8Encoder)()],
|
|
4366
|
+
["emissionsPerSecondX64", (0, import_kit42.getU128Encoder)()],
|
|
4367
|
+
["openTime", (0, import_kit42.getU64Encoder)()],
|
|
4368
|
+
["endTime", (0, import_kit42.getU64Encoder)()]
|
|
4351
4369
|
]),
|
|
4352
4370
|
(value) => ({ ...value, discriminator: SET_REWARD_PARAMS_DISCRIMINATOR })
|
|
4353
4371
|
);
|
|
4354
4372
|
}
|
|
4355
4373
|
function getSetRewardParamsInstructionDataDecoder() {
|
|
4356
|
-
return (0,
|
|
4357
|
-
["discriminator", (0,
|
|
4358
|
-
["rewardIndex", (0,
|
|
4359
|
-
["emissionsPerSecondX64", (0,
|
|
4360
|
-
["openTime", (0,
|
|
4361
|
-
["endTime", (0,
|
|
4374
|
+
return (0, import_kit42.getStructDecoder)([
|
|
4375
|
+
["discriminator", (0, import_kit42.fixDecoderSize)((0, import_kit42.getBytesDecoder)(), 8)],
|
|
4376
|
+
["rewardIndex", (0, import_kit42.getU8Decoder)()],
|
|
4377
|
+
["emissionsPerSecondX64", (0, import_kit42.getU128Decoder)()],
|
|
4378
|
+
["openTime", (0, import_kit42.getU64Decoder)()],
|
|
4379
|
+
["endTime", (0, import_kit42.getU64Decoder)()]
|
|
4362
4380
|
]);
|
|
4363
4381
|
}
|
|
4364
4382
|
function getSetRewardParamsInstructionDataCodec() {
|
|
4365
|
-
return (0,
|
|
4383
|
+
return (0, import_kit42.combineCodec)(
|
|
4366
4384
|
getSetRewardParamsInstructionDataEncoder(),
|
|
4367
4385
|
getSetRewardParamsInstructionDataDecoder()
|
|
4368
4386
|
);
|
|
@@ -4383,10 +4401,10 @@ async function getSetRewardParamsInstructionAsync(input, config) {
|
|
|
4383
4401
|
const accounts = originalAccounts;
|
|
4384
4402
|
const args = { ...input };
|
|
4385
4403
|
if (!accounts.operationState.value) {
|
|
4386
|
-
accounts.operationState.value = await (0,
|
|
4404
|
+
accounts.operationState.value = await (0, import_kit42.getProgramDerivedAddress)({
|
|
4387
4405
|
programAddress,
|
|
4388
4406
|
seeds: [
|
|
4389
|
-
(0,
|
|
4407
|
+
(0, import_kit42.getBytesEncoder)().encode(
|
|
4390
4408
|
new Uint8Array([111, 112, 101, 114, 97, 116, 105, 111, 110])
|
|
4391
4409
|
)
|
|
4392
4410
|
]
|
|
@@ -4476,7 +4494,7 @@ function parseSetRewardParamsInstruction(instruction) {
|
|
|
4476
4494
|
}
|
|
4477
4495
|
|
|
4478
4496
|
// src/generated/instructions/swapRouterBaseIn.ts
|
|
4479
|
-
var
|
|
4497
|
+
var import_kit43 = require("@solana/kit");
|
|
4480
4498
|
var SWAP_ROUTER_BASE_IN_DISCRIMINATOR = new Uint8Array([
|
|
4481
4499
|
69,
|
|
4482
4500
|
125,
|
|
@@ -4488,29 +4506,29 @@ var SWAP_ROUTER_BASE_IN_DISCRIMINATOR = new Uint8Array([
|
|
|
4488
4506
|
196
|
|
4489
4507
|
]);
|
|
4490
4508
|
function getSwapRouterBaseInDiscriminatorBytes() {
|
|
4491
|
-
return (0,
|
|
4509
|
+
return (0, import_kit43.fixEncoderSize)((0, import_kit43.getBytesEncoder)(), 8).encode(
|
|
4492
4510
|
SWAP_ROUTER_BASE_IN_DISCRIMINATOR
|
|
4493
4511
|
);
|
|
4494
4512
|
}
|
|
4495
4513
|
function getSwapRouterBaseInInstructionDataEncoder() {
|
|
4496
|
-
return (0,
|
|
4497
|
-
(0,
|
|
4498
|
-
["discriminator", (0,
|
|
4499
|
-
["amountIn", (0,
|
|
4500
|
-
["amountOutMinimum", (0,
|
|
4514
|
+
return (0, import_kit43.transformEncoder)(
|
|
4515
|
+
(0, import_kit43.getStructEncoder)([
|
|
4516
|
+
["discriminator", (0, import_kit43.fixEncoderSize)((0, import_kit43.getBytesEncoder)(), 8)],
|
|
4517
|
+
["amountIn", (0, import_kit43.getU64Encoder)()],
|
|
4518
|
+
["amountOutMinimum", (0, import_kit43.getU64Encoder)()]
|
|
4501
4519
|
]),
|
|
4502
4520
|
(value) => ({ ...value, discriminator: SWAP_ROUTER_BASE_IN_DISCRIMINATOR })
|
|
4503
4521
|
);
|
|
4504
4522
|
}
|
|
4505
4523
|
function getSwapRouterBaseInInstructionDataDecoder() {
|
|
4506
|
-
return (0,
|
|
4507
|
-
["discriminator", (0,
|
|
4508
|
-
["amountIn", (0,
|
|
4509
|
-
["amountOutMinimum", (0,
|
|
4524
|
+
return (0, import_kit43.getStructDecoder)([
|
|
4525
|
+
["discriminator", (0, import_kit43.fixDecoderSize)((0, import_kit43.getBytesDecoder)(), 8)],
|
|
4526
|
+
["amountIn", (0, import_kit43.getU64Decoder)()],
|
|
4527
|
+
["amountOutMinimum", (0, import_kit43.getU64Decoder)()]
|
|
4510
4528
|
]);
|
|
4511
4529
|
}
|
|
4512
4530
|
function getSwapRouterBaseInInstructionDataCodec() {
|
|
4513
|
-
return (0,
|
|
4531
|
+
return (0, import_kit43.combineCodec)(
|
|
4514
4532
|
getSwapRouterBaseInInstructionDataEncoder(),
|
|
4515
4533
|
getSwapRouterBaseInInstructionDataDecoder()
|
|
4516
4534
|
);
|
|
@@ -4583,7 +4601,7 @@ function parseSwapRouterBaseInInstruction(instruction) {
|
|
|
4583
4601
|
}
|
|
4584
4602
|
|
|
4585
4603
|
// src/generated/instructions/swapV2.ts
|
|
4586
|
-
var
|
|
4604
|
+
var import_kit44 = require("@solana/kit");
|
|
4587
4605
|
var SWAP_V2_DISCRIMINATOR = new Uint8Array([
|
|
4588
4606
|
43,
|
|
4589
4607
|
4,
|
|
@@ -4595,31 +4613,31 @@ var SWAP_V2_DISCRIMINATOR = new Uint8Array([
|
|
|
4595
4613
|
98
|
|
4596
4614
|
]);
|
|
4597
4615
|
function getSwapV2DiscriminatorBytes() {
|
|
4598
|
-
return (0,
|
|
4616
|
+
return (0, import_kit44.fixEncoderSize)((0, import_kit44.getBytesEncoder)(), 8).encode(SWAP_V2_DISCRIMINATOR);
|
|
4599
4617
|
}
|
|
4600
4618
|
function getSwapV2InstructionDataEncoder() {
|
|
4601
|
-
return (0,
|
|
4602
|
-
(0,
|
|
4603
|
-
["discriminator", (0,
|
|
4604
|
-
["amount", (0,
|
|
4605
|
-
["otherAmountThreshold", (0,
|
|
4606
|
-
["sqrtPriceLimitX64", (0,
|
|
4607
|
-
["isBaseInput", (0,
|
|
4619
|
+
return (0, import_kit44.transformEncoder)(
|
|
4620
|
+
(0, import_kit44.getStructEncoder)([
|
|
4621
|
+
["discriminator", (0, import_kit44.fixEncoderSize)((0, import_kit44.getBytesEncoder)(), 8)],
|
|
4622
|
+
["amount", (0, import_kit44.getU64Encoder)()],
|
|
4623
|
+
["otherAmountThreshold", (0, import_kit44.getU64Encoder)()],
|
|
4624
|
+
["sqrtPriceLimitX64", (0, import_kit44.getU128Encoder)()],
|
|
4625
|
+
["isBaseInput", (0, import_kit44.getBooleanEncoder)()]
|
|
4608
4626
|
]),
|
|
4609
4627
|
(value) => ({ ...value, discriminator: SWAP_V2_DISCRIMINATOR })
|
|
4610
4628
|
);
|
|
4611
4629
|
}
|
|
4612
4630
|
function getSwapV2InstructionDataDecoder() {
|
|
4613
|
-
return (0,
|
|
4614
|
-
["discriminator", (0,
|
|
4615
|
-
["amount", (0,
|
|
4616
|
-
["otherAmountThreshold", (0,
|
|
4617
|
-
["sqrtPriceLimitX64", (0,
|
|
4618
|
-
["isBaseInput", (0,
|
|
4631
|
+
return (0, import_kit44.getStructDecoder)([
|
|
4632
|
+
["discriminator", (0, import_kit44.fixDecoderSize)((0, import_kit44.getBytesDecoder)(), 8)],
|
|
4633
|
+
["amount", (0, import_kit44.getU64Decoder)()],
|
|
4634
|
+
["otherAmountThreshold", (0, import_kit44.getU64Decoder)()],
|
|
4635
|
+
["sqrtPriceLimitX64", (0, import_kit44.getU128Decoder)()],
|
|
4636
|
+
["isBaseInput", (0, import_kit44.getBooleanDecoder)()]
|
|
4619
4637
|
]);
|
|
4620
4638
|
}
|
|
4621
4639
|
function getSwapV2InstructionDataCodec() {
|
|
4622
|
-
return (0,
|
|
4640
|
+
return (0, import_kit44.combineCodec)(
|
|
4623
4641
|
getSwapV2InstructionDataEncoder(),
|
|
4624
4642
|
getSwapV2InstructionDataDecoder()
|
|
4625
4643
|
);
|
|
@@ -4722,7 +4740,7 @@ function parseSwapV2Instruction(instruction) {
|
|
|
4722
4740
|
}
|
|
4723
4741
|
|
|
4724
4742
|
// src/generated/instructions/transferRewardOwner.ts
|
|
4725
|
-
var
|
|
4743
|
+
var import_kit45 = require("@solana/kit");
|
|
4726
4744
|
var TRANSFER_REWARD_OWNER_DISCRIMINATOR = new Uint8Array([
|
|
4727
4745
|
7,
|
|
4728
4746
|
22,
|
|
@@ -4734,15 +4752,15 @@ var TRANSFER_REWARD_OWNER_DISCRIMINATOR = new Uint8Array([
|
|
|
4734
4752
|
121
|
|
4735
4753
|
]);
|
|
4736
4754
|
function getTransferRewardOwnerDiscriminatorBytes() {
|
|
4737
|
-
return (0,
|
|
4755
|
+
return (0, import_kit45.fixEncoderSize)((0, import_kit45.getBytesEncoder)(), 8).encode(
|
|
4738
4756
|
TRANSFER_REWARD_OWNER_DISCRIMINATOR
|
|
4739
4757
|
);
|
|
4740
4758
|
}
|
|
4741
4759
|
function getTransferRewardOwnerInstructionDataEncoder() {
|
|
4742
|
-
return (0,
|
|
4743
|
-
(0,
|
|
4744
|
-
["discriminator", (0,
|
|
4745
|
-
["newOwner", (0,
|
|
4760
|
+
return (0, import_kit45.transformEncoder)(
|
|
4761
|
+
(0, import_kit45.getStructEncoder)([
|
|
4762
|
+
["discriminator", (0, import_kit45.fixEncoderSize)((0, import_kit45.getBytesEncoder)(), 8)],
|
|
4763
|
+
["newOwner", (0, import_kit45.getAddressEncoder)()]
|
|
4746
4764
|
]),
|
|
4747
4765
|
(value) => ({
|
|
4748
4766
|
...value,
|
|
@@ -4751,13 +4769,13 @@ function getTransferRewardOwnerInstructionDataEncoder() {
|
|
|
4751
4769
|
);
|
|
4752
4770
|
}
|
|
4753
4771
|
function getTransferRewardOwnerInstructionDataDecoder() {
|
|
4754
|
-
return (0,
|
|
4755
|
-
["discriminator", (0,
|
|
4756
|
-
["newOwner", (0,
|
|
4772
|
+
return (0, import_kit45.getStructDecoder)([
|
|
4773
|
+
["discriminator", (0, import_kit45.fixDecoderSize)((0, import_kit45.getBytesDecoder)(), 8)],
|
|
4774
|
+
["newOwner", (0, import_kit45.getAddressDecoder)()]
|
|
4757
4775
|
]);
|
|
4758
4776
|
}
|
|
4759
4777
|
function getTransferRewardOwnerInstructionDataCodec() {
|
|
4760
|
-
return (0,
|
|
4778
|
+
return (0, import_kit45.combineCodec)(
|
|
4761
4779
|
getTransferRewardOwnerInstructionDataEncoder(),
|
|
4762
4780
|
getTransferRewardOwnerInstructionDataDecoder()
|
|
4763
4781
|
);
|
|
@@ -4805,7 +4823,7 @@ function parseTransferRewardOwnerInstruction(instruction) {
|
|
|
4805
4823
|
}
|
|
4806
4824
|
|
|
4807
4825
|
// src/generated/instructions/updateAmmConfig.ts
|
|
4808
|
-
var
|
|
4826
|
+
var import_kit46 = require("@solana/kit");
|
|
4809
4827
|
var UPDATE_AMM_CONFIG_DISCRIMINATOR = new Uint8Array([
|
|
4810
4828
|
49,
|
|
4811
4829
|
60,
|
|
@@ -4817,29 +4835,29 @@ var UPDATE_AMM_CONFIG_DISCRIMINATOR = new Uint8Array([
|
|
|
4817
4835
|
200
|
|
4818
4836
|
]);
|
|
4819
4837
|
function getUpdateAmmConfigDiscriminatorBytes() {
|
|
4820
|
-
return (0,
|
|
4838
|
+
return (0, import_kit46.fixEncoderSize)((0, import_kit46.getBytesEncoder)(), 8).encode(
|
|
4821
4839
|
UPDATE_AMM_CONFIG_DISCRIMINATOR
|
|
4822
4840
|
);
|
|
4823
4841
|
}
|
|
4824
4842
|
function getUpdateAmmConfigInstructionDataEncoder() {
|
|
4825
|
-
return (0,
|
|
4826
|
-
(0,
|
|
4827
|
-
["discriminator", (0,
|
|
4828
|
-
["param", (0,
|
|
4829
|
-
["value", (0,
|
|
4843
|
+
return (0, import_kit46.transformEncoder)(
|
|
4844
|
+
(0, import_kit46.getStructEncoder)([
|
|
4845
|
+
["discriminator", (0, import_kit46.fixEncoderSize)((0, import_kit46.getBytesEncoder)(), 8)],
|
|
4846
|
+
["param", (0, import_kit46.getU8Encoder)()],
|
|
4847
|
+
["value", (0, import_kit46.getU32Encoder)()]
|
|
4830
4848
|
]),
|
|
4831
4849
|
(value) => ({ ...value, discriminator: UPDATE_AMM_CONFIG_DISCRIMINATOR })
|
|
4832
4850
|
);
|
|
4833
4851
|
}
|
|
4834
4852
|
function getUpdateAmmConfigInstructionDataDecoder() {
|
|
4835
|
-
return (0,
|
|
4836
|
-
["discriminator", (0,
|
|
4837
|
-
["param", (0,
|
|
4838
|
-
["value", (0,
|
|
4853
|
+
return (0, import_kit46.getStructDecoder)([
|
|
4854
|
+
["discriminator", (0, import_kit46.fixDecoderSize)((0, import_kit46.getBytesDecoder)(), 8)],
|
|
4855
|
+
["param", (0, import_kit46.getU8Decoder)()],
|
|
4856
|
+
["value", (0, import_kit46.getU32Decoder)()]
|
|
4839
4857
|
]);
|
|
4840
4858
|
}
|
|
4841
4859
|
function getUpdateAmmConfigInstructionDataCodec() {
|
|
4842
|
-
return (0,
|
|
4860
|
+
return (0, import_kit46.combineCodec)(
|
|
4843
4861
|
getUpdateAmmConfigInstructionDataEncoder(),
|
|
4844
4862
|
getUpdateAmmConfigInstructionDataDecoder()
|
|
4845
4863
|
);
|
|
@@ -4885,7 +4903,7 @@ function parseUpdateAmmConfigInstruction(instruction) {
|
|
|
4885
4903
|
}
|
|
4886
4904
|
|
|
4887
4905
|
// src/generated/instructions/updateOperationAccount.ts
|
|
4888
|
-
var
|
|
4906
|
+
var import_kit47 = require("@solana/kit");
|
|
4889
4907
|
var UPDATE_OPERATION_ACCOUNT_DISCRIMINATOR = new Uint8Array([
|
|
4890
4908
|
127,
|
|
4891
4909
|
70,
|
|
@@ -4897,16 +4915,16 @@ var UPDATE_OPERATION_ACCOUNT_DISCRIMINATOR = new Uint8Array([
|
|
|
4897
4915
|
7
|
|
4898
4916
|
]);
|
|
4899
4917
|
function getUpdateOperationAccountDiscriminatorBytes() {
|
|
4900
|
-
return (0,
|
|
4918
|
+
return (0, import_kit47.fixEncoderSize)((0, import_kit47.getBytesEncoder)(), 8).encode(
|
|
4901
4919
|
UPDATE_OPERATION_ACCOUNT_DISCRIMINATOR
|
|
4902
4920
|
);
|
|
4903
4921
|
}
|
|
4904
4922
|
function getUpdateOperationAccountInstructionDataEncoder() {
|
|
4905
|
-
return (0,
|
|
4906
|
-
(0,
|
|
4907
|
-
["discriminator", (0,
|
|
4908
|
-
["param", (0,
|
|
4909
|
-
["keys", (0,
|
|
4923
|
+
return (0, import_kit47.transformEncoder)(
|
|
4924
|
+
(0, import_kit47.getStructEncoder)([
|
|
4925
|
+
["discriminator", (0, import_kit47.fixEncoderSize)((0, import_kit47.getBytesEncoder)(), 8)],
|
|
4926
|
+
["param", (0, import_kit47.getU8Encoder)()],
|
|
4927
|
+
["keys", (0, import_kit47.getArrayEncoder)((0, import_kit47.getAddressEncoder)())]
|
|
4910
4928
|
]),
|
|
4911
4929
|
(value) => ({
|
|
4912
4930
|
...value,
|
|
@@ -4915,14 +4933,14 @@ function getUpdateOperationAccountInstructionDataEncoder() {
|
|
|
4915
4933
|
);
|
|
4916
4934
|
}
|
|
4917
4935
|
function getUpdateOperationAccountInstructionDataDecoder() {
|
|
4918
|
-
return (0,
|
|
4919
|
-
["discriminator", (0,
|
|
4920
|
-
["param", (0,
|
|
4921
|
-
["keys", (0,
|
|
4936
|
+
return (0, import_kit47.getStructDecoder)([
|
|
4937
|
+
["discriminator", (0, import_kit47.fixDecoderSize)((0, import_kit47.getBytesDecoder)(), 8)],
|
|
4938
|
+
["param", (0, import_kit47.getU8Decoder)()],
|
|
4939
|
+
["keys", (0, import_kit47.getArrayDecoder)((0, import_kit47.getAddressDecoder)())]
|
|
4922
4940
|
]);
|
|
4923
4941
|
}
|
|
4924
4942
|
function getUpdateOperationAccountInstructionDataCodec() {
|
|
4925
|
-
return (0,
|
|
4943
|
+
return (0, import_kit47.combineCodec)(
|
|
4926
4944
|
getUpdateOperationAccountInstructionDataEncoder(),
|
|
4927
4945
|
getUpdateOperationAccountInstructionDataDecoder()
|
|
4928
4946
|
);
|
|
@@ -4940,10 +4958,10 @@ async function getUpdateOperationAccountInstructionAsync(input, config) {
|
|
|
4940
4958
|
accounts.owner.value = "3kXrf8w8Z6EjLJU4S8dAkpRL2von8z7Eh3kJnFrmo7Z2";
|
|
4941
4959
|
}
|
|
4942
4960
|
if (!accounts.operationState.value) {
|
|
4943
|
-
accounts.operationState.value = await (0,
|
|
4961
|
+
accounts.operationState.value = await (0, import_kit47.getProgramDerivedAddress)({
|
|
4944
4962
|
programAddress,
|
|
4945
4963
|
seeds: [
|
|
4946
|
-
(0,
|
|
4964
|
+
(0, import_kit47.getBytesEncoder)().encode(
|
|
4947
4965
|
new Uint8Array([111, 112, 101, 114, 97, 116, 105, 111, 110])
|
|
4948
4966
|
)
|
|
4949
4967
|
]
|
|
@@ -5017,7 +5035,7 @@ function parseUpdateOperationAccountInstruction(instruction) {
|
|
|
5017
5035
|
}
|
|
5018
5036
|
|
|
5019
5037
|
// src/generated/instructions/updatePoolStatus.ts
|
|
5020
|
-
var
|
|
5038
|
+
var import_kit48 = require("@solana/kit");
|
|
5021
5039
|
var UPDATE_POOL_STATUS_DISCRIMINATOR = new Uint8Array([
|
|
5022
5040
|
130,
|
|
5023
5041
|
87,
|
|
@@ -5029,27 +5047,27 @@ var UPDATE_POOL_STATUS_DISCRIMINATOR = new Uint8Array([
|
|
|
5029
5047
|
123
|
|
5030
5048
|
]);
|
|
5031
5049
|
function getUpdatePoolStatusDiscriminatorBytes() {
|
|
5032
|
-
return (0,
|
|
5050
|
+
return (0, import_kit48.fixEncoderSize)((0, import_kit48.getBytesEncoder)(), 8).encode(
|
|
5033
5051
|
UPDATE_POOL_STATUS_DISCRIMINATOR
|
|
5034
5052
|
);
|
|
5035
5053
|
}
|
|
5036
5054
|
function getUpdatePoolStatusInstructionDataEncoder() {
|
|
5037
|
-
return (0,
|
|
5038
|
-
(0,
|
|
5039
|
-
["discriminator", (0,
|
|
5040
|
-
["status", (0,
|
|
5055
|
+
return (0, import_kit48.transformEncoder)(
|
|
5056
|
+
(0, import_kit48.getStructEncoder)([
|
|
5057
|
+
["discriminator", (0, import_kit48.fixEncoderSize)((0, import_kit48.getBytesEncoder)(), 8)],
|
|
5058
|
+
["status", (0, import_kit48.getU8Encoder)()]
|
|
5041
5059
|
]),
|
|
5042
5060
|
(value) => ({ ...value, discriminator: UPDATE_POOL_STATUS_DISCRIMINATOR })
|
|
5043
5061
|
);
|
|
5044
5062
|
}
|
|
5045
5063
|
function getUpdatePoolStatusInstructionDataDecoder() {
|
|
5046
|
-
return (0,
|
|
5047
|
-
["discriminator", (0,
|
|
5048
|
-
["status", (0,
|
|
5064
|
+
return (0, import_kit48.getStructDecoder)([
|
|
5065
|
+
["discriminator", (0, import_kit48.fixDecoderSize)((0, import_kit48.getBytesDecoder)(), 8)],
|
|
5066
|
+
["status", (0, import_kit48.getU8Decoder)()]
|
|
5049
5067
|
]);
|
|
5050
5068
|
}
|
|
5051
5069
|
function getUpdatePoolStatusInstructionDataCodec() {
|
|
5052
|
-
return (0,
|
|
5070
|
+
return (0, import_kit48.combineCodec)(
|
|
5053
5071
|
getUpdatePoolStatusInstructionDataEncoder(),
|
|
5054
5072
|
getUpdatePoolStatusInstructionDataDecoder()
|
|
5055
5073
|
);
|
|
@@ -5095,7 +5113,7 @@ function parseUpdatePoolStatusInstruction(instruction) {
|
|
|
5095
5113
|
}
|
|
5096
5114
|
|
|
5097
5115
|
// src/generated/instructions/updateRewardInfos.ts
|
|
5098
|
-
var
|
|
5116
|
+
var import_kit49 = require("@solana/kit");
|
|
5099
5117
|
var UPDATE_REWARD_INFOS_DISCRIMINATOR = new Uint8Array([
|
|
5100
5118
|
163,
|
|
5101
5119
|
172,
|
|
@@ -5107,23 +5125,23 @@ var UPDATE_REWARD_INFOS_DISCRIMINATOR = new Uint8Array([
|
|
|
5107
5125
|
223
|
|
5108
5126
|
]);
|
|
5109
5127
|
function getUpdateRewardInfosDiscriminatorBytes() {
|
|
5110
|
-
return (0,
|
|
5128
|
+
return (0, import_kit49.fixEncoderSize)((0, import_kit49.getBytesEncoder)(), 8).encode(
|
|
5111
5129
|
UPDATE_REWARD_INFOS_DISCRIMINATOR
|
|
5112
5130
|
);
|
|
5113
5131
|
}
|
|
5114
5132
|
function getUpdateRewardInfosInstructionDataEncoder() {
|
|
5115
|
-
return (0,
|
|
5116
|
-
(0,
|
|
5133
|
+
return (0, import_kit49.transformEncoder)(
|
|
5134
|
+
(0, import_kit49.getStructEncoder)([["discriminator", (0, import_kit49.fixEncoderSize)((0, import_kit49.getBytesEncoder)(), 8)]]),
|
|
5117
5135
|
(value) => ({ ...value, discriminator: UPDATE_REWARD_INFOS_DISCRIMINATOR })
|
|
5118
5136
|
);
|
|
5119
5137
|
}
|
|
5120
5138
|
function getUpdateRewardInfosInstructionDataDecoder() {
|
|
5121
|
-
return (0,
|
|
5122
|
-
["discriminator", (0,
|
|
5139
|
+
return (0, import_kit49.getStructDecoder)([
|
|
5140
|
+
["discriminator", (0, import_kit49.fixDecoderSize)((0, import_kit49.getBytesDecoder)(), 8)]
|
|
5123
5141
|
]);
|
|
5124
5142
|
}
|
|
5125
5143
|
function getUpdateRewardInfosInstructionDataCodec() {
|
|
5126
|
-
return (0,
|
|
5144
|
+
return (0, import_kit49.combineCodec)(
|
|
5127
5145
|
getUpdateRewardInfosInstructionDataEncoder(),
|
|
5128
5146
|
getUpdateRewardInfosInstructionDataDecoder()
|
|
5129
5147
|
);
|
|
@@ -5602,9 +5620,9 @@ async function fetchTickArraysForRange(cluster, poolAddress, tickLower, tickUppe
|
|
|
5602
5620
|
}
|
|
5603
5621
|
|
|
5604
5622
|
// src/utils/pda.ts
|
|
5605
|
-
var
|
|
5606
|
-
var addressEncoder = (0,
|
|
5607
|
-
var i32Encoder = (0,
|
|
5623
|
+
var import_kit50 = require("@solana/kit");
|
|
5624
|
+
var addressEncoder = (0, import_kit50.getAddressEncoder)();
|
|
5625
|
+
var i32Encoder = (0, import_kit50.getI32Encoder)({ endian: import_kit50.Endian.Big });
|
|
5608
5626
|
var PdaUtils = class {
|
|
5609
5627
|
/**
|
|
5610
5628
|
* Derive pool state PDA
|
|
@@ -5614,7 +5632,7 @@ var PdaUtils = class {
|
|
|
5614
5632
|
* @returns Pool state PDA
|
|
5615
5633
|
*/
|
|
5616
5634
|
static async getPoolStatePda(ammConfig, tokenMintA, tokenMintB) {
|
|
5617
|
-
return await (0,
|
|
5635
|
+
return await (0, import_kit50.getProgramDerivedAddress)({
|
|
5618
5636
|
programAddress: STABBLE_CLMM_PROGRAM_ID,
|
|
5619
5637
|
seeds: [
|
|
5620
5638
|
PDA_SEEDS.POOL_STATE,
|
|
@@ -5630,9 +5648,9 @@ var PdaUtils = class {
|
|
|
5630
5648
|
* @returns AMM config PDA
|
|
5631
5649
|
*/
|
|
5632
5650
|
static async getAmmConfigPda(index) {
|
|
5633
|
-
return await (0,
|
|
5651
|
+
return await (0, import_kit50.getProgramDerivedAddress)({
|
|
5634
5652
|
programAddress: STABBLE_CLMM_PROGRAM_ID,
|
|
5635
|
-
seeds: [PDA_SEEDS.AMM_CONFIG, (0,
|
|
5653
|
+
seeds: [PDA_SEEDS.AMM_CONFIG, (0, import_kit50.getU16Encoder)().encode(index)]
|
|
5636
5654
|
});
|
|
5637
5655
|
}
|
|
5638
5656
|
/**
|
|
@@ -5641,7 +5659,7 @@ var PdaUtils = class {
|
|
|
5641
5659
|
* @returns Position state PDA
|
|
5642
5660
|
*/
|
|
5643
5661
|
static async getPositionStatePda(nftMint) {
|
|
5644
|
-
return await (0,
|
|
5662
|
+
return await (0, import_kit50.getProgramDerivedAddress)({
|
|
5645
5663
|
programAddress: STABBLE_CLMM_PROGRAM_ID,
|
|
5646
5664
|
seeds: [PDA_SEEDS.POSITION_STATE, addressEncoder.encode(nftMint)]
|
|
5647
5665
|
});
|
|
@@ -5653,7 +5671,7 @@ var PdaUtils = class {
|
|
|
5653
5671
|
* @returns Tick array state PDA
|
|
5654
5672
|
*/
|
|
5655
5673
|
static async getTickArrayStatePda(poolState, startTickIndex) {
|
|
5656
|
-
return await (0,
|
|
5674
|
+
return await (0, import_kit50.getProgramDerivedAddress)({
|
|
5657
5675
|
programAddress: STABBLE_CLMM_PROGRAM_ID,
|
|
5658
5676
|
seeds: [
|
|
5659
5677
|
PDA_SEEDS.TICK_ARRAY_STATE,
|
|
@@ -5668,13 +5686,13 @@ var PdaUtils = class {
|
|
|
5668
5686
|
* @returns Observation state PDA
|
|
5669
5687
|
*/
|
|
5670
5688
|
static async getObservationStatePda(poolState) {
|
|
5671
|
-
return await (0,
|
|
5689
|
+
return await (0, import_kit50.getProgramDerivedAddress)({
|
|
5672
5690
|
programAddress: STABBLE_CLMM_PROGRAM_ID,
|
|
5673
5691
|
seeds: [PDA_SEEDS.OBSERVATION_STATE, addressEncoder.encode(poolState)]
|
|
5674
5692
|
});
|
|
5675
5693
|
}
|
|
5676
5694
|
static async getPoolVaultIdPda(poolAddress, vaultAddress) {
|
|
5677
|
-
return await (0,
|
|
5695
|
+
return await (0, import_kit50.getProgramDerivedAddress)({
|
|
5678
5696
|
seeds: [
|
|
5679
5697
|
PDA_SEEDS.POOL_VAULT,
|
|
5680
5698
|
addressEncoder.encode(poolAddress),
|
|
@@ -5689,7 +5707,7 @@ var PdaUtils = class {
|
|
|
5689
5707
|
* @returns Tick array bitmap extension PDA
|
|
5690
5708
|
*/
|
|
5691
5709
|
static async getTickArrayBitmapExtensionPda(poolState) {
|
|
5692
|
-
return await (0,
|
|
5710
|
+
return await (0, import_kit50.getProgramDerivedAddress)({
|
|
5693
5711
|
programAddress: STABBLE_CLMM_PROGRAM_ID,
|
|
5694
5712
|
seeds: [PDA_SEEDS.BITMAP_EXTENSION, addressEncoder.encode(poolState)]
|
|
5695
5713
|
});
|
|
@@ -5741,7 +5759,7 @@ var PdaUtils = class {
|
|
|
5741
5759
|
* @returns Protocol position state PDA
|
|
5742
5760
|
*/
|
|
5743
5761
|
static async getProtocolPositionStatePda(poolState, tickLowerIndex, tickUpperIndex) {
|
|
5744
|
-
return await (0,
|
|
5762
|
+
return await (0, import_kit50.getProgramDerivedAddress)({
|
|
5745
5763
|
programAddress: STABBLE_CLMM_PROGRAM_ID,
|
|
5746
5764
|
seeds: [
|
|
5747
5765
|
PDA_SEEDS.POSITION_STATE,
|
|
@@ -5757,20 +5775,20 @@ var PdaUtils = class {
|
|
|
5757
5775
|
* @returns Operation state PDA
|
|
5758
5776
|
*/
|
|
5759
5777
|
static async getOperationStatePda(poolState) {
|
|
5760
|
-
return await (0,
|
|
5778
|
+
return await (0, import_kit50.getProgramDerivedAddress)({
|
|
5761
5779
|
programAddress: STABBLE_CLMM_PROGRAM_ID,
|
|
5762
5780
|
seeds: [PDA_SEEDS.OPERATION, addressEncoder.encode(poolState)]
|
|
5763
5781
|
});
|
|
5764
5782
|
}
|
|
5765
5783
|
};
|
|
5766
5784
|
async function getMetadataPda(mint) {
|
|
5767
|
-
return await (0,
|
|
5785
|
+
return await (0, import_kit50.getProgramDerivedAddress)({
|
|
5768
5786
|
seeds: [
|
|
5769
5787
|
"metadata",
|
|
5770
|
-
addressEncoder.encode((0,
|
|
5788
|
+
addressEncoder.encode((0, import_kit50.address)(METADATA_PROGRAM_ID)),
|
|
5771
5789
|
addressEncoder.encode(mint)
|
|
5772
5790
|
],
|
|
5773
|
-
programAddress: (0,
|
|
5791
|
+
programAddress: (0, import_kit50.address)(METADATA_PROGRAM_ID)
|
|
5774
5792
|
});
|
|
5775
5793
|
}
|
|
5776
5794
|
|
|
@@ -6557,7 +6575,7 @@ var LiquidityMath = class _LiquidityMath {
|
|
|
6557
6575
|
};
|
|
6558
6576
|
}
|
|
6559
6577
|
}
|
|
6560
|
-
static getAmountsFromLiquidityWithSlippage(sqrtPriceCurrentX64, sqrtPriceX64A, sqrtPriceX64B, liquidity,
|
|
6578
|
+
static getAmountsFromLiquidityWithSlippage(sqrtPriceCurrentX64, sqrtPriceX64A, sqrtPriceX64B, liquidity, add, roundUp, amountSlippage) {
|
|
6561
6579
|
const { amountA, amountB } = _LiquidityMath.getAmountsFromLiquidity(
|
|
6562
6580
|
sqrtPriceCurrentX64,
|
|
6563
6581
|
sqrtPriceX64A,
|
|
@@ -6565,7 +6583,7 @@ var LiquidityMath = class _LiquidityMath {
|
|
|
6565
6583
|
liquidity,
|
|
6566
6584
|
roundUp
|
|
6567
6585
|
);
|
|
6568
|
-
const coefficient =
|
|
6586
|
+
const coefficient = add ? 1 + amountSlippage : 1 - amountSlippage;
|
|
6569
6587
|
const amount0Slippage = new import_bn3.default(
|
|
6570
6588
|
new import_decimal2.default(amountA.toString()).mul(coefficient).toFixed(0)
|
|
6571
6589
|
);
|
|
@@ -6573,6 +6591,8 @@ var LiquidityMath = class _LiquidityMath {
|
|
|
6573
6591
|
new import_decimal2.default(amountB.toString()).mul(coefficient).toFixed(0)
|
|
6574
6592
|
);
|
|
6575
6593
|
return {
|
|
6594
|
+
amountA,
|
|
6595
|
+
amountB,
|
|
6576
6596
|
amountSlippageA: amount0Slippage,
|
|
6577
6597
|
amountSlippageB: amount1Slippage
|
|
6578
6598
|
};
|
|
@@ -7452,7 +7472,7 @@ var PoolUtils = class {
|
|
|
7452
7472
|
};
|
|
7453
7473
|
|
|
7454
7474
|
// src/utils/index.ts
|
|
7455
|
-
var
|
|
7475
|
+
var import_kit51 = require("@solana/kit");
|
|
7456
7476
|
function validateAddress(address6, name = "address") {
|
|
7457
7477
|
if (!address6 || address6.length === 0) {
|
|
7458
7478
|
throw new ClmmError(
|
|
@@ -7524,7 +7544,7 @@ function isValidSolanaAddress(address6) {
|
|
|
7524
7544
|
}
|
|
7525
7545
|
}
|
|
7526
7546
|
function addresstoBytes(address6) {
|
|
7527
|
-
const encoder = (0,
|
|
7547
|
+
const encoder = (0, import_kit51.getAddressEncoder)();
|
|
7528
7548
|
return encoder.encode(address6);
|
|
7529
7549
|
}
|
|
7530
7550
|
function getFakeSigner(address6) {
|
|
@@ -7614,7 +7634,7 @@ var Clmm = class {
|
|
|
7614
7634
|
};
|
|
7615
7635
|
|
|
7616
7636
|
// src/pool-manager.ts
|
|
7617
|
-
var
|
|
7637
|
+
var import_kit52 = require("@solana/kit");
|
|
7618
7638
|
var import_token2 = require("@solana-program/token");
|
|
7619
7639
|
var import_bn5 = __toESM(require("bn.js"));
|
|
7620
7640
|
var import_decimal3 = __toESM(require("decimal.js"));
|
|
@@ -7653,8 +7673,8 @@ var PoolManager = class {
|
|
|
7653
7673
|
mintADecimals,
|
|
7654
7674
|
mintBDecimals
|
|
7655
7675
|
} = params;
|
|
7656
|
-
const addressA = (0,
|
|
7657
|
-
const addressB = (0,
|
|
7676
|
+
const addressA = (0, import_kit52.address)(tokenMintA);
|
|
7677
|
+
const addressB = (0, import_kit52.address)(tokenMintB);
|
|
7658
7678
|
const isAFirst = new import_bn5.default(Buffer.from(addressB)).gt(
|
|
7659
7679
|
new import_bn5.default(Buffer.from(addressA))
|
|
7660
7680
|
);
|
|
@@ -7880,7 +7900,7 @@ var PoolManager = class {
|
|
|
7880
7900
|
};
|
|
7881
7901
|
|
|
7882
7902
|
// src/position-manager.ts
|
|
7883
|
-
var
|
|
7903
|
+
var import_kit53 = require("@solana/kit");
|
|
7884
7904
|
var import_token4 = require("@solana-program/token");
|
|
7885
7905
|
var import_token_20222 = require("@solana-program/token-2022");
|
|
7886
7906
|
var import_bn6 = __toESM(require("bn.js"));
|
|
@@ -7895,6 +7915,7 @@ var NATIVE_MINT_2022 = new import_web3.PublicKey("9pan9bMn5HatX4EJdBwg9VgCa7Uz5H
|
|
|
7895
7915
|
|
|
7896
7916
|
// src/position-manager.ts
|
|
7897
7917
|
var import_system = require("@solana-program/system");
|
|
7918
|
+
var import_decimal4 = __toESM(require("decimal.js"));
|
|
7898
7919
|
var PositionManager = class {
|
|
7899
7920
|
constructor(config) {
|
|
7900
7921
|
this.config = config;
|
|
@@ -7902,11 +7923,11 @@ var PositionManager = class {
|
|
|
7902
7923
|
buildWrapSolInstructions(params) {
|
|
7903
7924
|
const { payer, ata, owner, amount } = params;
|
|
7904
7925
|
return [
|
|
7905
|
-
(0, import_token4.
|
|
7926
|
+
(0, import_token4.getCreateAssociatedTokenIdempotentInstruction)({
|
|
7906
7927
|
payer,
|
|
7907
7928
|
ata,
|
|
7908
7929
|
owner,
|
|
7909
|
-
mint: (0,
|
|
7930
|
+
mint: (0, import_kit53.address)(NATIVE_MINT.toString()),
|
|
7910
7931
|
tokenProgram: import_token4.TOKEN_PROGRAM_ADDRESS,
|
|
7911
7932
|
systemProgram: SYSTEM_PROGRAM_ID
|
|
7912
7933
|
}),
|
|
@@ -7941,7 +7962,7 @@ var PositionManager = class {
|
|
|
7941
7962
|
if (getEphemeralSigners) {
|
|
7942
7963
|
nftMintAccount = getEphemeralSigners()[0];
|
|
7943
7964
|
} else {
|
|
7944
|
-
let k = await (0,
|
|
7965
|
+
let k = await (0, import_kit53.generateKeyPairSigner)();
|
|
7945
7966
|
signers.push(k);
|
|
7946
7967
|
nftMintAccount = k;
|
|
7947
7968
|
}
|
|
@@ -8026,7 +8047,7 @@ var PositionManager = class {
|
|
|
8026
8047
|
if (getEphemeralSigners) {
|
|
8027
8048
|
nftMintAccount = getEphemeralSigners()[0];
|
|
8028
8049
|
} else {
|
|
8029
|
-
let k = await (0,
|
|
8050
|
+
let k = await (0, import_kit53.generateKeyPairSigner)();
|
|
8030
8051
|
signers.push(k);
|
|
8031
8052
|
nftMintAccount = k;
|
|
8032
8053
|
}
|
|
@@ -8067,21 +8088,21 @@ var PositionManager = class {
|
|
|
8067
8088
|
[tickArrayLowerStartIndex, tickArrayUpperStartIndex]
|
|
8068
8089
|
);
|
|
8069
8090
|
const extBitmapAccount = isOverflow ? await PdaUtils.getTickArrayBitmapExtensionPda(poolAccount.address) : void 0;
|
|
8070
|
-
const remAccounts = extBitmapAccount ? [{ address: extBitmapAccount[0], role:
|
|
8091
|
+
const remAccounts = extBitmapAccount ? [{ address: extBitmapAccount[0], role: import_kit53.AccountRole.WRITABLE }] : [];
|
|
8071
8092
|
let wrapSolInstructions = [];
|
|
8072
8093
|
if (poolAccount.data.tokenMint0.toString() === NATIVE_MINT.toString()) {
|
|
8073
8094
|
wrapSolInstructions = this.buildWrapSolInstructions({
|
|
8074
8095
|
payer: ownerInfo.wallet,
|
|
8075
8096
|
ata: ownerInfo.tokenAccountA,
|
|
8076
8097
|
owner: ownerInfo.wallet.address,
|
|
8077
|
-
amount:
|
|
8098
|
+
amount: amount0Max
|
|
8078
8099
|
});
|
|
8079
8100
|
} else if (poolAccount.data.tokenMint1.toString() === NATIVE_MINT.toString()) {
|
|
8080
8101
|
wrapSolInstructions = this.buildWrapSolInstructions({
|
|
8081
8102
|
payer: ownerInfo.wallet,
|
|
8082
8103
|
ata: ownerInfo.tokenAccountB,
|
|
8083
8104
|
owner: ownerInfo.wallet.address,
|
|
8084
|
-
amount:
|
|
8105
|
+
amount: amount1Max
|
|
8085
8106
|
});
|
|
8086
8107
|
}
|
|
8087
8108
|
const instruction = await getOpenPositionWithToken22NftInstructionAsync({
|
|
@@ -8173,7 +8194,7 @@ var PositionManager = class {
|
|
|
8173
8194
|
[ownerPosition.tickLowerIndex, ownerPosition.tickUpperIndex]
|
|
8174
8195
|
);
|
|
8175
8196
|
const extBitmapAccount = isOverflow ? await PdaUtils.getTickArrayBitmapExtensionPda(poolState.address) : void 0;
|
|
8176
|
-
const remAccounts = extBitmapAccount ? [{ address: extBitmapAccount[0], role:
|
|
8197
|
+
const remAccounts = extBitmapAccount ? [{ address: extBitmapAccount[0], role: import_kit53.AccountRole.WRITABLE }] : [];
|
|
8177
8198
|
const instruction = getIncreaseLiquidityV2Instruction({
|
|
8178
8199
|
nftOwner: ownerInfo.wallet,
|
|
8179
8200
|
nftAccount: positionNftAccount,
|
|
@@ -8258,7 +8279,7 @@ var PositionManager = class {
|
|
|
8258
8279
|
[ownerPosition.tickLowerIndex, ownerPosition.tickUpperIndex]
|
|
8259
8280
|
);
|
|
8260
8281
|
const extBitmapAccount = isOverflow ? await PdaUtils.getTickArrayBitmapExtensionPda(poolState.address) : void 0;
|
|
8261
|
-
const remAccounts = extBitmapAccount ? [{ address: extBitmapAccount[0], role:
|
|
8282
|
+
const remAccounts = extBitmapAccount ? [{ address: extBitmapAccount[0], role: import_kit53.AccountRole.WRITABLE }] : [];
|
|
8262
8283
|
const instruction = getDecreaseLiquidityV2Instruction({
|
|
8263
8284
|
nftOwner: ownerInfo.wallet,
|
|
8264
8285
|
nftAccount: positionNftAccount,
|
|
@@ -8363,45 +8384,29 @@ var PositionManager = class {
|
|
|
8363
8384
|
position.tickUpperIndex
|
|
8364
8385
|
);
|
|
8365
8386
|
const sqrtPriceCurrentX64 = new import_bn6.default(pool.sqrtPriceX64.toString());
|
|
8366
|
-
|
|
8367
|
-
|
|
8368
|
-
|
|
8369
|
-
|
|
8370
|
-
|
|
8371
|
-
|
|
8372
|
-
sqrtPriceUpperX64,
|
|
8373
|
-
liquidity
|
|
8374
|
-
);
|
|
8375
|
-
amount1 = new import_bn6.default(0);
|
|
8376
|
-
} else if (pool.tickCurrent >= position.tickUpperIndex) {
|
|
8377
|
-
amount0 = new import_bn6.default(0);
|
|
8378
|
-
amount1 = PoolUtils.getAmount1FromLiquidity(
|
|
8379
|
-
sqrtPriceLowerX64,
|
|
8380
|
-
sqrtPriceUpperX64,
|
|
8381
|
-
liquidity
|
|
8382
|
-
);
|
|
8383
|
-
} else {
|
|
8384
|
-
amount0 = PoolUtils.getAmount0FromLiquidity(
|
|
8385
|
-
sqrtPriceCurrentX64,
|
|
8386
|
-
sqrtPriceUpperX64,
|
|
8387
|
-
liquidity
|
|
8388
|
-
);
|
|
8389
|
-
amount1 = PoolUtils.getAmount1FromLiquidity(
|
|
8390
|
-
sqrtPriceLowerX64,
|
|
8391
|
-
sqrtPriceCurrentX64,
|
|
8392
|
-
liquidity
|
|
8393
|
-
);
|
|
8394
|
-
}
|
|
8395
|
-
const priceLower = TickUtils.tickToPrice(
|
|
8396
|
-
position.tickLowerIndex,
|
|
8397
|
-
pool.mintDecimals0,
|
|
8398
|
-
pool.mintDecimals1
|
|
8399
|
-
);
|
|
8400
|
-
const priceUpper = TickUtils.tickToPrice(
|
|
8401
|
-
position.tickUpperIndex,
|
|
8402
|
-
pool.mintDecimals0,
|
|
8403
|
-
pool.mintDecimals1
|
|
8387
|
+
const { amountA, amountB } = LiquidityMath.getAmountsFromLiquidity(
|
|
8388
|
+
sqrtPriceCurrentX64,
|
|
8389
|
+
sqrtPriceLowerX64,
|
|
8390
|
+
sqrtPriceUpperX64,
|
|
8391
|
+
new import_bn6.default(position.liquidity.toString()),
|
|
8392
|
+
true
|
|
8404
8393
|
);
|
|
8394
|
+
const [_amountA, _amountB] = [
|
|
8395
|
+
new import_decimal4.default(amountA.toString()).div(10 ** pool.mintDecimals0),
|
|
8396
|
+
new import_decimal4.default(amountB.toString()).div(10 ** pool.mintDecimals1)
|
|
8397
|
+
];
|
|
8398
|
+
const priceLower = TickUtils.getTickPrice({
|
|
8399
|
+
mintADecimals: pool.mintDecimals0,
|
|
8400
|
+
mintBDecimals: pool.mintDecimals1,
|
|
8401
|
+
tick: position.tickLowerIndex,
|
|
8402
|
+
baseIn: true
|
|
8403
|
+
});
|
|
8404
|
+
const priceUpper = TickUtils.getTickPrice({
|
|
8405
|
+
mintADecimals: pool.mintDecimals0,
|
|
8406
|
+
mintBDecimals: pool.mintDecimals1,
|
|
8407
|
+
tick: position.tickUpperIndex,
|
|
8408
|
+
baseIn: true
|
|
8409
|
+
});
|
|
8405
8410
|
const inRange = pool.tickCurrent >= position.tickLowerIndex && pool.tickCurrent < position.tickUpperIndex;
|
|
8406
8411
|
const unclaimedFees = {
|
|
8407
8412
|
token0: new import_bn6.default(position.tokenFeesOwed0.toString()),
|
|
@@ -8412,12 +8417,10 @@ var PositionManager = class {
|
|
|
8412
8417
|
...position,
|
|
8413
8418
|
tokenMint0: pool.tokenMint0,
|
|
8414
8419
|
tokenMint1: pool.tokenMint1,
|
|
8415
|
-
amount0:
|
|
8416
|
-
amount1:
|
|
8417
|
-
|
|
8418
|
-
|
|
8419
|
-
upper: priceUpper
|
|
8420
|
-
},
|
|
8420
|
+
amount0: _amountA.toString(),
|
|
8421
|
+
amount1: _amountB.toString(),
|
|
8422
|
+
priceLower,
|
|
8423
|
+
priceUpper,
|
|
8421
8424
|
inRange,
|
|
8422
8425
|
ageSeconds,
|
|
8423
8426
|
unclaimedFees,
|
|
@@ -8681,7 +8684,7 @@ var ClmmApi = class {
|
|
|
8681
8684
|
var import_token5 = require("@solana-program/token");
|
|
8682
8685
|
|
|
8683
8686
|
// src/managers/pool-data-manager.ts
|
|
8684
|
-
var
|
|
8687
|
+
var import_kit54 = require("@solana/kit");
|
|
8685
8688
|
var PoolDataManager = class {
|
|
8686
8689
|
constructor(config, options) {
|
|
8687
8690
|
this.config = config;
|
|
@@ -8847,13 +8850,13 @@ var PoolDataManager = class {
|
|
|
8847
8850
|
bump: 0,
|
|
8848
8851
|
// Not provided by API. This field is only used for on-chain address derivation and is not accessed or required by the SDK; setting to 0 is safe as the SDK never reads or relies on this value.// Not provided by API. This field is only used for on-chain address derivation and is not accessed or required by the SDK; setting to 0 is safe as the SDK never reads or relies on this value.
|
|
8849
8852
|
index: apiConfig.index,
|
|
8850
|
-
owner: (0,
|
|
8853
|
+
owner: (0, import_kit54.address)(apiConfig.owner),
|
|
8851
8854
|
protocolFeeRate: apiConfig.protocolFeeRate,
|
|
8852
8855
|
tradeFeeRate: apiConfig.tradeFeeRate,
|
|
8853
8856
|
tickSpacing: apiConfig.tickSpacing,
|
|
8854
8857
|
fundFeeRate: apiConfig.fundFeeRate,
|
|
8855
8858
|
paddingU32: 0,
|
|
8856
|
-
fundOwner: (0,
|
|
8859
|
+
fundOwner: (0, import_kit54.address)(apiConfig.fundOwner),
|
|
8857
8860
|
padding: [0n, 0n, 0n]
|
|
8858
8861
|
};
|
|
8859
8862
|
} else {
|
|
@@ -8984,7 +8987,7 @@ var PoolDataManager = class {
|
|
|
8984
8987
|
|
|
8985
8988
|
// src/managers/price-api-client.ts
|
|
8986
8989
|
var import_axios3 = __toESM(require("axios"));
|
|
8987
|
-
var
|
|
8990
|
+
var import_decimal5 = __toESM(require("decimal.js"));
|
|
8988
8991
|
var PriceApiClient = class _PriceApiClient {
|
|
8989
8992
|
client;
|
|
8990
8993
|
logger;
|
|
@@ -9332,7 +9335,7 @@ var PriceApiClient = class _PriceApiClient {
|
|
|
9332
9335
|
continue;
|
|
9333
9336
|
}
|
|
9334
9337
|
try {
|
|
9335
|
-
const price = new
|
|
9338
|
+
const price = new import_decimal5.default(data.usdPrice.toString());
|
|
9336
9339
|
if (!price.isFinite() || price.lte(0)) {
|
|
9337
9340
|
this.log(
|
|
9338
9341
|
"warn",
|
|
@@ -9451,7 +9454,7 @@ var PriceApiClient = class _PriceApiClient {
|
|
|
9451
9454
|
|
|
9452
9455
|
// src/swap.ts
|
|
9453
9456
|
var import_bn7 = __toESM(require("bn.js"));
|
|
9454
|
-
var
|
|
9457
|
+
var import_decimal6 = __toESM(require("decimal.js"));
|
|
9455
9458
|
var DEFAULT_RETRY_CONFIG = {
|
|
9456
9459
|
maxRetries: 3,
|
|
9457
9460
|
baseDelayMs: 100,
|
|
@@ -9707,11 +9710,11 @@ var SwapQuoteResult = class {
|
|
|
9707
9710
|
* before calculating the rate to avoid precision loss from integer division.
|
|
9708
9711
|
*/
|
|
9709
9712
|
get executionPrice() {
|
|
9710
|
-
const inHuman = new
|
|
9711
|
-
new
|
|
9713
|
+
const inHuman = new import_decimal6.default(this.quote.amountIn.toString()).div(
|
|
9714
|
+
new import_decimal6.default(10).pow(this.decIn)
|
|
9712
9715
|
);
|
|
9713
|
-
const outHuman = new
|
|
9714
|
-
new
|
|
9716
|
+
const outHuman = new import_decimal6.default(this.quote.amountOut.toString()).div(
|
|
9717
|
+
new import_decimal6.default(10).pow(this.decOut)
|
|
9715
9718
|
);
|
|
9716
9719
|
return outHuman.div(inHuman);
|
|
9717
9720
|
}
|
|
@@ -9731,7 +9734,7 @@ var SwapQuoteResult = class {
|
|
|
9731
9734
|
return this.quote.fee;
|
|
9732
9735
|
}
|
|
9733
9736
|
get feePercent() {
|
|
9734
|
-
return new
|
|
9737
|
+
return new import_decimal6.default(this.quote.fee.toString()).div(new import_decimal6.default(this.quote.amountIn.toString())).mul(100).toNumber();
|
|
9735
9738
|
}
|
|
9736
9739
|
get hasAcceptableImpact() {
|
|
9737
9740
|
return this.quote.priceImpact < PRICE_IMPACT_THRESHOLDS.WARNING;
|
|
@@ -10459,9 +10462,9 @@ var SwapManager = class {
|
|
|
10459
10462
|
calculateOptimalSlippage(quote, options) {
|
|
10460
10463
|
const { riskTolerance = "medium", maxSlippage = 0.5 } = options || {};
|
|
10461
10464
|
let baseSlippage = Math.max(quote.priceImpact * 2, 1e-3);
|
|
10462
|
-
const tradeSize = new
|
|
10463
|
-
const sizeRatio =
|
|
10464
|
-
const sizeMultiplier = sizeRatio.ln().div(
|
|
10465
|
+
const tradeSize = new import_decimal6.default(quote.amountIn.toString());
|
|
10466
|
+
const sizeRatio = import_decimal6.default.max(1, tradeSize.div(1e6));
|
|
10467
|
+
const sizeMultiplier = sizeRatio.ln().div(import_decimal6.default.ln(10)).mul(1e-3).toNumber();
|
|
10465
10468
|
const riskMultiplier = {
|
|
10466
10469
|
low: 1.5,
|
|
10467
10470
|
medium: 1,
|
|
@@ -10497,9 +10500,9 @@ var SwapManager = class {
|
|
|
10497
10500
|
priceAfter = priceBefore;
|
|
10498
10501
|
}
|
|
10499
10502
|
const zeroForOne = params.tokenIn === pool.tokenMint0;
|
|
10500
|
-
const dec0 = new
|
|
10501
|
-
const dec1 = new
|
|
10502
|
-
const executionPrice = zeroForOne ? new
|
|
10503
|
+
const dec0 = new import_decimal6.default(10).pow(pool.mintDecimals0);
|
|
10504
|
+
const dec1 = new import_decimal6.default(10).pow(pool.mintDecimals1);
|
|
10505
|
+
const executionPrice = zeroForOne ? new import_decimal6.default(quote.amountOut.toString()).div(dec1).div(new import_decimal6.default(quote.amountIn.toString()).div(dec0)) : new import_decimal6.default(quote.amountOut.toString()).div(dec0).div(new import_decimal6.default(quote.amountIn.toString()).div(dec1));
|
|
10503
10506
|
const feeImpact = ammConfig.tradeFeeRate / FEE_RATE_DENOMINATOR_NUMBER;
|
|
10504
10507
|
const pctDifference = executionPrice.minus(priceBefore).div(priceBefore).toNumber();
|
|
10505
10508
|
return {
|