@meteora-ag/cp-amm-sdk 1.0.10 → 1.0.11-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,12 +1,12 @@
1
1
  # Meteora Constant Product AMM SDK (DAMM V2 SDK)
2
2
 
3
- A TypeScript SDK for interacting with the Dynamic CP-AMM on Meteora
3
+ A TypeScript SDK for interacting with the DAMM V2 on Meteora
4
4
 
5
5
  ## Overview
6
6
 
7
- This SDK provides a set of tools and methods to interact with the [Meteora Dynamic CP-AMM](https://github.com/MeteoraAg/cp-amm). It simplifies common operations like creating pools, managing positions, adding/removing liquidity, swapping tokens, and claiming rewards.
7
+ This SDK provides a set of tools and methods to interact with the [Meteora DAMM-V2](https://github.com/MeteoraAg/damm-v2). It simplifies common operations like creating pools, managing positions, adding/removing liquidity, swapping tokens, and claiming rewards.
8
8
 
9
- For detailed technical documentation, please refer to the [CP-AMM SDK Documentation](https://github.com/MeteoraAg/cp-amm-sdk/blob/main/docs.md).
9
+ For detailed technical documentation, please refer to the [DAMM-V2 SDK Documentation](https://github.com/MeteoraAg/damm-v2-sdk/blob/main/docs.md).
10
10
 
11
11
  ## Installation
12
12
 
package/dist/index.d.mts CHANGED
@@ -13,7 +13,7 @@ type CpAmm$1 = {
13
13
  address: "cpamdpZCGKUy5JxQXB4dcpGPiikHawvSWAd6mEn1sGG";
14
14
  metadata: {
15
15
  name: "cpAmm";
16
- version: "0.1.1";
16
+ version: "0.1.2";
17
17
  spec: "0.1.0";
18
18
  description: "Created with Anchor";
19
19
  };
@@ -658,7 +658,16 @@ type CpAmm$1 = {
658
658
  name: "program";
659
659
  }
660
660
  ];
661
- args: [];
661
+ args: [
662
+ {
663
+ name: "maxAmountA";
664
+ type: "u64";
665
+ },
666
+ {
667
+ name: "maxAmountB";
668
+ type: "u64";
669
+ }
670
+ ];
662
671
  },
663
672
  {
664
673
  name: "claimReward";
@@ -760,6 +769,10 @@ type CpAmm$1 = {
760
769
  {
761
770
  name: "rewardIndex";
762
771
  type: "u8";
772
+ },
773
+ {
774
+ name: "skipReward";
775
+ type: "u8";
763
776
  }
764
777
  ];
765
778
  },
@@ -966,6 +979,58 @@ type CpAmm$1 = {
966
979
  ];
967
980
  args: [];
968
981
  },
982
+ {
983
+ name: "closeTokenBadge";
984
+ discriminator: [108, 146, 86, 110, 179, 254, 10, 104];
985
+ accounts: [
986
+ {
987
+ name: "tokenBadge";
988
+ writable: true;
989
+ },
990
+ {
991
+ name: "admin";
992
+ writable: true;
993
+ signer: true;
994
+ },
995
+ {
996
+ name: "rentReceiver";
997
+ writable: true;
998
+ },
999
+ {
1000
+ name: "eventAuthority";
1001
+ pda: {
1002
+ seeds: [
1003
+ {
1004
+ kind: "const";
1005
+ value: [
1006
+ 95,
1007
+ 95,
1008
+ 101,
1009
+ 118,
1010
+ 101,
1011
+ 110,
1012
+ 116,
1013
+ 95,
1014
+ 97,
1015
+ 117,
1016
+ 116,
1017
+ 104,
1018
+ 111,
1019
+ 114,
1020
+ 105,
1021
+ 116,
1022
+ 121
1023
+ ];
1024
+ }
1025
+ ];
1026
+ };
1027
+ },
1028
+ {
1029
+ name: "program";
1030
+ }
1031
+ ];
1032
+ args: [];
1033
+ },
969
1034
  {
970
1035
  name: "createClaimFeeOperator";
971
1036
  discriminator: [169, 62, 207, 107, 58, 187, 162, 109];
@@ -2244,7 +2309,11 @@ type CpAmm$1 = {
2244
2309
  name: "rewardMint";
2245
2310
  },
2246
2311
  {
2247
- name: "admin";
2312
+ name: "signer";
2313
+ signer: true;
2314
+ },
2315
+ {
2316
+ name: "payer";
2248
2317
  writable: true;
2249
2318
  signer: true;
2250
2319
  },
@@ -2919,7 +2988,7 @@ type CpAmm$1 = {
2919
2988
  writable: true;
2920
2989
  },
2921
2990
  {
2922
- name: "admin";
2991
+ name: "signer";
2923
2992
  signer: true;
2924
2993
  },
2925
2994
  {
@@ -2975,7 +3044,7 @@ type CpAmm$1 = {
2975
3044
  writable: true;
2976
3045
  },
2977
3046
  {
2978
- name: "admin";
3047
+ name: "signer";
2979
3048
  signer: true;
2980
3049
  },
2981
3050
  {
@@ -3449,6 +3518,16 @@ type CpAmm$1 = {
3449
3518
  code: 6041;
3450
3519
  name: "invalidConfigType";
3451
3520
  msg: "Invalid config type";
3521
+ },
3522
+ {
3523
+ code: 6042;
3524
+ name: "invalidPoolCreator";
3525
+ msg: "Invalid pool creator";
3526
+ },
3527
+ {
3528
+ code: 6043;
3529
+ name: "rewardVaultFrozenSkipRequired";
3530
+ msg: "Reward vault is frozen, must skip reward to proceed";
3452
3531
  }
3453
3532
  ];
3454
3533
  types: [
@@ -4823,11 +4902,16 @@ type CpAmm$1 = {
4823
4902
  };
4824
4903
  };
4825
4904
  },
4905
+ {
4906
+ name: "creator";
4907
+ docs: ["pool creator"];
4908
+ type: "pubkey";
4909
+ },
4826
4910
  {
4827
4911
  name: "padding1";
4828
4912
  docs: ["Padding for further use"];
4829
4913
  type: {
4830
- array: ["u64", 10];
4914
+ array: ["u64", 6];
4831
4915
  };
4832
4916
  },
4833
4917
  {
@@ -5931,17 +6015,20 @@ type InitializeRewardParams = {
5931
6015
  rewardDuration: BN;
5932
6016
  pool: PublicKey;
5933
6017
  rewardMint: PublicKey;
6018
+ funder: PublicKey;
5934
6019
  payer: PublicKey;
6020
+ creator: PublicKey;
6021
+ rewardMintProgram?: PublicKey;
5935
6022
  };
5936
6023
  type UpdateRewardDurationParams = {
5937
6024
  pool: PublicKey;
5938
- admin: PublicKey;
6025
+ signer: PublicKey;
5939
6026
  rewardIndex: number;
5940
6027
  newDuration: BN;
5941
6028
  };
5942
6029
  type UpdateRewardFunderParams = {
5943
6030
  pool: PublicKey;
5944
- admin: PublicKey;
6031
+ signer: PublicKey;
5945
6032
  rewardIndex: number;
5946
6033
  newFunder: PublicKey;
5947
6034
  };
@@ -5973,6 +6060,7 @@ type ClaimRewardParams = {
5973
6060
  positionState: PositionState;
5974
6061
  positionNftAccount: PublicKey;
5975
6062
  rewardIndex: number;
6063
+ isSkipReward: boolean;
5976
6064
  feePayer?: PublicKey;
5977
6065
  };
5978
6066
  type RefreshVestingParams = {
@@ -6036,7 +6124,7 @@ type DynamicFeeParams = {
6036
6124
  };
6037
6125
 
6038
6126
  /**
6039
- * CpAmm SDK class to interact with the Dynamic CP-AMM
6127
+ * CpAmm SDK class to interact with the DAMM-V2
6040
6128
  */
6041
6129
  declare class CpAmm {
6042
6130
  _program: AmmProgram;
@@ -6387,6 +6475,7 @@ declare class CpAmm {
6387
6475
  * @throws {Error} If either position is locked or incompatible
6388
6476
  */
6389
6477
  mergePosition(params: MergePositionParams): TxBuilder;
6478
+ initializeReward(params: InitializeRewardParams): TxBuilder;
6390
6479
  /**
6391
6480
  * Builds a transaction to update reward duration.
6392
6481
  * @param {UpdateRewardDurationParams} params - Parameters including pool and new duration.
@@ -6678,7 +6767,7 @@ declare function decimalToQ64(num: Decimal): BN;
6678
6767
  var address = "cpamdpZCGKUy5JxQXB4dcpGPiikHawvSWAd6mEn1sGG";
6679
6768
  var metadata = {
6680
6769
  name: "cp_amm",
6681
- version: "0.1.1",
6770
+ version: "0.1.2",
6682
6771
  spec: "0.1.0",
6683
6772
  description: "Created with Anchor"
6684
6773
  };
@@ -7477,6 +7566,14 @@ var instructions = [
7477
7566
  }
7478
7567
  ],
7479
7568
  args: [
7569
+ {
7570
+ name: "max_amount_a",
7571
+ type: "u64"
7572
+ },
7573
+ {
7574
+ name: "max_amount_b",
7575
+ type: "u64"
7576
+ }
7480
7577
  ]
7481
7578
  },
7482
7579
  {
@@ -7596,6 +7693,10 @@ var instructions = [
7596
7693
  {
7597
7694
  name: "reward_index",
7598
7695
  type: "u8"
7696
+ },
7697
+ {
7698
+ name: "skip_reward",
7699
+ type: "u8"
7599
7700
  }
7600
7701
  ]
7601
7702
  },
@@ -7840,6 +7941,68 @@ var instructions = [
7840
7941
  args: [
7841
7942
  ]
7842
7943
  },
7944
+ {
7945
+ name: "close_token_badge",
7946
+ discriminator: [
7947
+ 108,
7948
+ 146,
7949
+ 86,
7950
+ 110,
7951
+ 179,
7952
+ 254,
7953
+ 10,
7954
+ 104
7955
+ ],
7956
+ accounts: [
7957
+ {
7958
+ name: "token_badge",
7959
+ writable: true
7960
+ },
7961
+ {
7962
+ name: "admin",
7963
+ writable: true,
7964
+ signer: true
7965
+ },
7966
+ {
7967
+ name: "rent_receiver",
7968
+ writable: true
7969
+ },
7970
+ {
7971
+ name: "event_authority",
7972
+ pda: {
7973
+ seeds: [
7974
+ {
7975
+ kind: "const",
7976
+ value: [
7977
+ 95,
7978
+ 95,
7979
+ 101,
7980
+ 118,
7981
+ 101,
7982
+ 110,
7983
+ 116,
7984
+ 95,
7985
+ 97,
7986
+ 117,
7987
+ 116,
7988
+ 104,
7989
+ 111,
7990
+ 114,
7991
+ 105,
7992
+ 116,
7993
+ 121
7994
+ ]
7995
+ }
7996
+ ]
7997
+ }
7998
+ },
7999
+ {
8000
+ name: "program"
8001
+ }
8002
+ ],
8003
+ args: [
8004
+ ]
8005
+ },
7843
8006
  {
7844
8007
  name: "create_claim_fee_operator",
7845
8008
  discriminator: [
@@ -9445,7 +9608,11 @@ var instructions = [
9445
9608
  name: "reward_mint"
9446
9609
  },
9447
9610
  {
9448
- name: "admin",
9611
+ name: "signer",
9612
+ signer: true
9613
+ },
9614
+ {
9615
+ name: "payer",
9449
9616
  writable: true,
9450
9617
  signer: true
9451
9618
  },
@@ -10295,7 +10462,7 @@ var instructions = [
10295
10462
  writable: true
10296
10463
  },
10297
10464
  {
10298
- name: "admin",
10465
+ name: "signer",
10299
10466
  signer: true
10300
10467
  },
10301
10468
  {
@@ -10360,7 +10527,7 @@ var instructions = [
10360
10527
  writable: true
10361
10528
  },
10362
10529
  {
10363
- name: "admin",
10530
+ name: "signer",
10364
10531
  signer: true
10365
10532
  },
10366
10533
  {
@@ -11113,6 +11280,16 @@ var errors = [
11113
11280
  code: 6041,
11114
11281
  name: "InvalidConfigType",
11115
11282
  msg: "Invalid config type"
11283
+ },
11284
+ {
11285
+ code: 6042,
11286
+ name: "InvalidPoolCreator",
11287
+ msg: "Invalid pool creator"
11288
+ },
11289
+ {
11290
+ code: 6043,
11291
+ name: "RewardVaultFrozenSkipRequired",
11292
+ msg: "Reward vault is frozen, must skip reward to proceed"
11116
11293
  }
11117
11294
  ];
11118
11295
  var types = [
@@ -12637,6 +12814,13 @@ var types = [
12637
12814
  }
12638
12815
  }
12639
12816
  },
12817
+ {
12818
+ name: "creator",
12819
+ docs: [
12820
+ "pool creator"
12821
+ ],
12822
+ type: "pubkey"
12823
+ },
12640
12824
  {
12641
12825
  name: "_padding_1",
12642
12826
  docs: [
@@ -12645,7 +12829,7 @@ var types = [
12645
12829
  type: {
12646
12830
  array: [
12647
12831
  "u64",
12648
- 10
12832
+ 6
12649
12833
  ]
12650
12834
  }
12651
12835
  },