@meteora-ag/dynamic-bonding-curve-sdk 1.5.8 → 1.5.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -29685,10 +29685,38 @@ var DynamicBondingCurveProgram = class {
29685
29685
 
29686
29686
 
29687
29687
 
29688
+
29689
+
29688
29690
  var StateService = class extends DynamicBondingCurveProgram {
29689
29691
  constructor(connection, commitment) {
29690
29692
  super(connection, commitment);
29691
29693
  }
29694
+ /**
29695
+ * Fetch virtual pools across both the standard and transfer-hook account variants.
29696
+ */
29697
+ async fetchVirtualPools(filters) {
29698
+ const [pools, transferHookPools] = await Promise.all([
29699
+ this.program.account.virtualPool.all(filters),
29700
+ this.program.account.transferHookPool.all(filters)
29701
+ ]);
29702
+ return [...pools, ...transferHookPools];
29703
+ }
29704
+ /**
29705
+ * Fetch pool configs across both the standard and transfer-hook account variants.
29706
+ */
29707
+ async fetchPoolConfigs(filters) {
29708
+ const [configs, transferHookConfigs] = await Promise.all([
29709
+ this.program.account.poolConfig.all(filters),
29710
+ this.program.account.configWithTransferHook.all(filters)
29711
+ ]);
29712
+ return [
29713
+ ...configs,
29714
+ ...transferHookConfigs.map((account) => ({
29715
+ publicKey: account.publicKey,
29716
+ account: account.account.config
29717
+ }))
29718
+ ];
29719
+ }
29692
29720
  /**
29693
29721
  * Fetch a pool config account.
29694
29722
  */
@@ -29714,14 +29742,14 @@ var StateService = class extends DynamicBondingCurveProgram {
29714
29742
  * Fetch all pool config accounts.
29715
29743
  */
29716
29744
  async getPoolConfigs() {
29717
- return this.program.account.poolConfig.all();
29745
+ return this.fetchPoolConfigs();
29718
29746
  }
29719
29747
  /**
29720
29748
  * Fetch all pool configs owned by a wallet.
29721
29749
  */
29722
29750
  async getPoolConfigsByOwner(owner) {
29723
29751
  const filters = createProgramAccountFilter(owner, 72);
29724
- return this.program.account.poolConfig.all(filters);
29752
+ return this.fetchPoolConfigs(filters);
29725
29753
  }
29726
29754
  /**
29727
29755
  * Fetch a virtual pool account.
@@ -29747,28 +29775,28 @@ var StateService = class extends DynamicBondingCurveProgram {
29747
29775
  * Fetch all virtual pool accounts.
29748
29776
  */
29749
29777
  async getPools() {
29750
- return this.program.account.virtualPool.all();
29778
+ return this.fetchVirtualPools();
29751
29779
  }
29752
29780
  /**
29753
29781
  * Fetch all virtual pools that use a config.
29754
29782
  */
29755
29783
  async getPoolsByConfig(configAddress) {
29756
29784
  const filters = createProgramAccountFilter(configAddress, 72);
29757
- return this.program.account.virtualPool.all(filters);
29785
+ return this.fetchVirtualPools(filters);
29758
29786
  }
29759
29787
  /**
29760
29788
  * Fetch all virtual pools created by a wallet.
29761
29789
  */
29762
29790
  async getPoolsByCreator(creatorAddress) {
29763
29791
  const filters = createProgramAccountFilter(creatorAddress, 104);
29764
- return this.program.account.virtualPool.all(filters);
29792
+ return this.fetchVirtualPools(filters);
29765
29793
  }
29766
29794
  /**
29767
29795
  * Fetch the first virtual pool that uses a base mint.
29768
29796
  */
29769
29797
  async getPoolByBaseMint(baseMint) {
29770
29798
  const filters = createProgramAccountFilter(baseMint, 136);
29771
- const pools = await this.program.account.virtualPool.all(filters);
29799
+ const pools = await this.fetchVirtualPools(filters);
29772
29800
  return pools.length > 0 ? pools[0] : null;
29773
29801
  }
29774
29802
  /**