@flaunch/sdk 0.9.0 → 0.9.2

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.
@@ -5372,16 +5372,16 @@ const TreasuryManagerFactoryAddress = {
5372
5372
  [baseSepolia.id]: "0xD2F3C6185e06925dCBE794C6574315b2202E9CcD",
5373
5373
  };
5374
5374
  const RevenueManagerAddress = {
5375
- [base.id]: "0x712fa8ddc7347b4b6b029aa21710f365cd02d898",
5376
- [baseSepolia.id]: "0x17E02501dE3e420347e7C5fCAe3AD787C5aea690",
5375
+ [base.id]: "0xb6c0cca8b3a354fa0f348c121657f4a952e92b3d",
5376
+ [baseSepolia.id]: "0xd32b7236f45b787d808a65bb3e2160aa3a9ced09",
5377
5377
  };
5378
5378
  const AddressFeeSplitManagerAddress = {
5379
- [base.id]: "0x6baa4ec493a9698dc7388c0f290e29ea3d149f99",
5380
- [baseSepolia.id]: "0xf72dcdee692c188de6b14c6213e849982e04069b",
5379
+ [base.id]: "0xabde686e8a710ade941189d634596215ba78334b",
5380
+ [baseSepolia.id]: "0x3e0edadf33085d47e53212aff8a85ed292fe201c",
5381
5381
  };
5382
5382
  const StakingManagerAddress = {
5383
- [base.id]: "0xB5dD2Fbca9b746a56cF9e5e2ADaBf8BEF0BAdBEA",
5384
- [baseSepolia.id]: "0x8Ea4074c38cA7a596C740DD9E9D7122ea8E78c3c",
5383
+ [base.id]: "0x540677596a3aa2d75f2eb1e791b8f27ec4a9622d",
5384
+ [baseSepolia.id]: "0xfaff975c1cf48767e053d0777309578c6b3ae44c",
5385
5385
  };
5386
5386
  /** Verifiers */
5387
5387
  const TokenImporterAddress = {
@@ -5368,16 +5368,16 @@ const TreasuryManagerFactoryAddress = {
5368
5368
  [baseSepolia.id]: "0xD2F3C6185e06925dCBE794C6574315b2202E9CcD",
5369
5369
  };
5370
5370
  const RevenueManagerAddress = {
5371
- [base.id]: "0x712fa8ddc7347b4b6b029aa21710f365cd02d898",
5372
- [baseSepolia.id]: "0x17E02501dE3e420347e7C5fCAe3AD787C5aea690",
5371
+ [base.id]: "0xb6c0cca8b3a354fa0f348c121657f4a952e92b3d",
5372
+ [baseSepolia.id]: "0xd32b7236f45b787d808a65bb3e2160aa3a9ced09",
5373
5373
  };
5374
5374
  const AddressFeeSplitManagerAddress = {
5375
- [base.id]: "0x6baa4ec493a9698dc7388c0f290e29ea3d149f99",
5376
- [baseSepolia.id]: "0xf72dcdee692c188de6b14c6213e849982e04069b",
5375
+ [base.id]: "0xabde686e8a710ade941189d634596215ba78334b",
5376
+ [baseSepolia.id]: "0x3e0edadf33085d47e53212aff8a85ed292fe201c",
5377
5377
  };
5378
5378
  const StakingManagerAddress = {
5379
- [base.id]: "0xB5dD2Fbca9b746a56cF9e5e2ADaBf8BEF0BAdBEA",
5380
- [baseSepolia.id]: "0x8Ea4074c38cA7a596C740DD9E9D7122ea8E78c3c",
5379
+ [base.id]: "0x540677596a3aa2d75f2eb1e791b8f27ec4a9622d",
5380
+ [baseSepolia.id]: "0xfaff975c1cf48767e053d0777309578c6b3ae44c",
5381
5381
  };
5382
5382
  /** Verifiers */
5383
5383
  const TokenImporterAddress = {
@@ -1,14 +1,16 @@
1
1
  import { type ReadContract, type Address, type Drift, type ReadWriteContract, type HexString } from "@delvtech/drift";
2
+ import { type PublicClient } from "viem";
2
3
  import { TreasuryManagerFactoryAbi } from "../abi/TreasuryManagerFactory";
3
4
  export type TreasuryManagerFactoryABI = typeof TreasuryManagerFactoryAbi;
4
5
  export declare class ReadTreasuryManagerFactory {
5
6
  chainId: number;
6
7
  readonly contract: ReadContract<TreasuryManagerFactoryABI>;
7
- constructor(chainId: number, address: Address, drift?: Drift);
8
+ readonly publicClient: PublicClient | undefined;
9
+ constructor(chainId: number, address: Address, drift?: Drift, publicClient?: PublicClient);
8
10
  getManagerDeployedAddressFromTx(hash: HexString): Promise<`0x${string}`>;
9
11
  }
10
12
  export declare class ReadWriteTreasuryManagerFactory extends ReadTreasuryManagerFactory {
11
13
  contract: ReadWriteContract<TreasuryManagerFactoryABI>;
12
- constructor(chainId: number, address: Address, drift?: Drift);
14
+ constructor(chainId: number, address: Address, drift?: Drift, publicClient?: PublicClient);
13
15
  }
14
16
  //# sourceMappingURL=TreasuryManagerFactoryClient.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TreasuryManagerFactoryClient.d.ts","sourceRoot":"","sources":["../../src/clients/TreasuryManagerFactoryClient.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,OAAO,EACZ,KAAK,KAAK,EAEV,KAAK,iBAAiB,EAEtB,KAAK,SAAS,EAEf,MAAM,iBAAiB,CAAC;AAOzB,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAG1E,MAAM,MAAM,yBAAyB,GAAG,OAAO,yBAAyB,CAAC;AAEzE,qBAAa,0BAA0B;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAgB,QAAQ,EAAE,YAAY,CAAC,yBAAyB,CAAC,CAAC;gBAEtD,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,GAAE,KAAqB;IAWrE,+BAA+B,CAAC,IAAI,EAAE,SAAS;CA2BtD;AAED,qBAAa,+BAAgC,SAAQ,0BAA0B;IACrE,QAAQ,EAAE,iBAAiB,CAAC,yBAAyB,CAAC,CAAC;gBAEnD,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,GAAE,KAAqB;CAG5E"}
1
+ {"version":3,"file":"TreasuryManagerFactoryClient.d.ts","sourceRoot":"","sources":["../../src/clients/TreasuryManagerFactoryClient.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,OAAO,EACZ,KAAK,KAAK,EAEV,KAAK,iBAAiB,EAEtB,KAAK,SAAS,EAEf,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAEL,KAAK,YAAY,EAIlB,MAAM,MAAM,CAAC;AACd,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAG1E,MAAM,MAAM,yBAAyB,GAAG,OAAO,yBAAyB,CAAC;AAEzE,qBAAa,0BAA0B;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAgB,QAAQ,EAAE,YAAY,CAAC,yBAAyB,CAAC,CAAC;IAClE,SAAgB,YAAY,EAAE,YAAY,GAAG,SAAS,CAAC;gBAGrD,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,OAAO,EAChB,KAAK,GAAE,KAAqB,EAC5B,YAAY,CAAC,EAAE,YAAY;IAavB,+BAA+B,CAAC,IAAI,EAAE,SAAS;CAyBtD;AAED,qBAAa,+BAAgC,SAAQ,0BAA0B;IACrE,QAAQ,EAAE,iBAAiB,CAAC,yBAAyB,CAAC,CAAC;gBAG7D,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,OAAO,EAChB,KAAK,GAAE,KAAqB,EAC5B,YAAY,CAAC,EAAE,YAAY;CAI9B"}
package/dist/index.cjs.js CHANGED
@@ -5750,16 +5750,16 @@ const TreasuryManagerFactoryAddress = {
5750
5750
  [baseSepolia.id]: "0xD2F3C6185e06925dCBE794C6574315b2202E9CcD",
5751
5751
  };
5752
5752
  const RevenueManagerAddress = {
5753
- [base.id]: "0x712fa8ddc7347b4b6b029aa21710f365cd02d898",
5754
- [baseSepolia.id]: "0x17E02501dE3e420347e7C5fCAe3AD787C5aea690",
5753
+ [base.id]: "0xb6c0cca8b3a354fa0f348c121657f4a952e92b3d",
5754
+ [baseSepolia.id]: "0xd32b7236f45b787d808a65bb3e2160aa3a9ced09",
5755
5755
  };
5756
5756
  const AddressFeeSplitManagerAddress = {
5757
- [base.id]: "0x6baa4ec493a9698dc7388c0f290e29ea3d149f99",
5758
- [baseSepolia.id]: "0xf72dcdee692c188de6b14c6213e849982e04069b",
5757
+ [base.id]: "0xabde686e8a710ade941189d634596215ba78334b",
5758
+ [baseSepolia.id]: "0x3e0edadf33085d47e53212aff8a85ed292fe201c",
5759
5759
  };
5760
5760
  const StakingManagerAddress = {
5761
- [base.id]: "0xB5dD2Fbca9b746a56cF9e5e2ADaBf8BEF0BAdBEA",
5762
- [baseSepolia.id]: "0x8Ea4074c38cA7a596C740DD9E9D7122ea8E78c3c",
5761
+ [base.id]: "0x540677596a3aa2d75f2eb1e791b8f27ec4a9622d",
5762
+ [baseSepolia.id]: "0xfaff975c1cf48767e053d0777309578c6b3ae44c",
5763
5763
  };
5764
5764
  /** Verifiers */
5765
5765
  const TokenImporterAddress = {
@@ -23884,13 +23884,8 @@ const TreasuryManagerFactoryAbi = [
23884
23884
  { type: "error", name: "UnknownManagerImplemention", inputs: [] },
23885
23885
  ];
23886
23886
 
23887
- const chainIdToChain = {
23888
- [base.id]: base,
23889
- [baseSepolia.id]: baseSepolia,
23890
- };
23891
-
23892
23887
  class ReadTreasuryManagerFactory {
23893
- constructor(chainId, address, drift$1 = drift.createDrift()) {
23888
+ constructor(chainId, address, drift$1 = drift.createDrift(), publicClient) {
23894
23889
  if (!address) {
23895
23890
  throw new Error("Address is required");
23896
23891
  }
@@ -23899,15 +23894,14 @@ class ReadTreasuryManagerFactory {
23899
23894
  address,
23900
23895
  });
23901
23896
  this.chainId = chainId;
23897
+ this.publicClient = publicClient;
23902
23898
  }
23903
23899
  async getManagerDeployedAddressFromTx(hash) {
23904
- // Create a public client to get the transaction receipt with logs
23905
- const publicClient = viem.createPublicClient({
23906
- chain: chainIdToChain[this.chainId],
23907
- transport: viem.http(),
23908
- });
23909
23900
  // Wait for transaction receipt
23910
- const receipt = await publicClient.waitForTransactionReceipt({ hash });
23901
+ if (!this.publicClient) {
23902
+ throw new Error("Public client is required");
23903
+ }
23904
+ const receipt = await this.publicClient.waitForTransactionReceipt({ hash });
23911
23905
  // Parse the ManagerDeployed event from receipt logs
23912
23906
  const parsedLogs = viem.parseEventLogs({
23913
23907
  abi: TreasuryManagerFactoryAbi,
@@ -23923,8 +23917,8 @@ class ReadTreasuryManagerFactory {
23923
23917
  }
23924
23918
  }
23925
23919
  class ReadWriteTreasuryManagerFactory extends ReadTreasuryManagerFactory {
23926
- constructor(chainId, address, drift$1 = drift.createDrift()) {
23927
- super(chainId, address, drift$1);
23920
+ constructor(chainId, address, drift$1 = drift.createDrift(), publicClient) {
23921
+ super(chainId, address, drift$1, publicClient);
23928
23922
  }
23929
23923
  }
23930
23924
 
@@ -25522,6 +25516,11 @@ const getAmountsForLiquidity = (params) => {
25522
25516
  return { amount0, amount1 };
25523
25517
  };
25524
25518
 
25519
+ const chainIdToChain = {
25520
+ [base.id]: base,
25521
+ [baseSepolia.id]: baseSepolia,
25522
+ };
25523
+
25525
25524
  const FastFlaunchZapAbi = [
25526
25525
  {
25527
25526
  inputs: [
@@ -26055,10 +26054,11 @@ class ReadTrustedSignerFeeCalculator {
26055
26054
  * Base class for interacting with Flaunch protocol in read-only mode
26056
26055
  */
26057
26056
  class ReadFlaunchSDK {
26058
- constructor(chainId, drift$1 = drift.createDrift()) {
26057
+ constructor(chainId, drift$1 = drift.createDrift(), publicClient) {
26059
26058
  this.TICK_SPACING = TICK_SPACING;
26060
26059
  this.chainId = chainId;
26061
26060
  this.drift = drift$1;
26061
+ this.publicClient = publicClient;
26062
26062
  this.resolveIPFS = resolveIPFS;
26063
26063
  this.readPositionManager = new ReadFlaunchPositionManager(FlaunchPositionManagerAddress[this.chainId], drift$1);
26064
26064
  this.readPositionManagerV1_1 = new ReadFlaunchPositionManagerV1_1(FlaunchPositionManagerV1_1Address[this.chainId], drift$1);
@@ -27327,8 +27327,8 @@ class ReadFlaunchSDK {
27327
27327
  }
27328
27328
  }
27329
27329
  class ReadWriteFlaunchSDK extends ReadFlaunchSDK {
27330
- constructor(chainId, drift$1 = drift.createDrift()) {
27331
- super(chainId, drift$1);
27330
+ constructor(chainId, drift$1 = drift.createDrift(), publicClient) {
27331
+ super(chainId, drift$1, publicClient);
27332
27332
  this.readWritePositionManager = new ReadWriteFlaunchPositionManager(FlaunchPositionManagerAddress[this.chainId], drift$1);
27333
27333
  this.readWritePositionManagerV1_1 = new ReadWriteFlaunchPositionManagerV1_1(FlaunchPositionManagerV1_1Address[this.chainId], drift$1);
27334
27334
  this.readWriteAnyPositionManager = new ReadWriteAnyPositionManager(AnyPositionManagerAddress[this.chainId], drift$1);
@@ -27336,7 +27336,7 @@ class ReadWriteFlaunchSDK extends ReadFlaunchSDK {
27336
27336
  this.readWriteFeeEscrow = new ReadWriteFeeEscrow(FeeEscrowAddress[this.chainId], drift$1);
27337
27337
  this.readWriteReferralEscrow = new ReadWriteReferralEscrow(ReferralEscrowAddress[this.chainId], drift$1);
27338
27338
  this.readWriteFlaunchZap = new ReadWriteFlaunchZap(this.chainId, FlaunchZapAddress[this.chainId], drift$1);
27339
- this.readWriteTreasuryManagerFactory = new ReadWriteTreasuryManagerFactory(this.chainId, TreasuryManagerFactoryAddress[this.chainId], drift$1);
27339
+ this.readWriteTreasuryManagerFactory = new ReadWriteTreasuryManagerFactory(this.chainId, TreasuryManagerFactoryAddress[this.chainId], drift$1, this.publicClient);
27340
27340
  this.readWritePermit2 = new ReadWritePermit2(Permit2Address[this.chainId], drift$1);
27341
27341
  }
27342
27342
  /**
@@ -28180,8 +28180,8 @@ function createFlaunch(params) {
28180
28180
  const chainId = publicClient.chain.id;
28181
28181
  // Return appropriate SDK type based on whether walletClient is provided
28182
28182
  return walletClient
28183
- ? new ReadWriteFlaunchSDK(chainId, createDrift({ publicClient, walletClient }))
28184
- : new ReadFlaunchSDK(chainId, createDrift({ publicClient }));
28183
+ ? new ReadWriteFlaunchSDK(chainId, createDrift({ publicClient, walletClient }), publicClient)
28184
+ : new ReadFlaunchSDK(chainId, createDrift({ publicClient }), publicClient);
28185
28185
  }
28186
28186
 
28187
28187
  // ABI for encoding the call data