@flaunch/sdk 0.6.0 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -5,6 +5,8 @@ export * from "./helpers";
5
5
  export * from "./utils/univ4";
6
6
  export type { BuySwapLog, PoolCreatedLogs, SellSwapLog, } from "./clients/FlaunchPositionManagerClient";
7
7
  export { ReadFlaunchSDK, ReadWriteFlaunchSDK };
8
+ export { createFlaunch } from "./sdk/factory";
9
+ export type { CreateFlaunchParams } from "./sdk/factory";
8
10
  export declare const FlaunchSDK: {
9
11
  ReadFlaunchSDK: typeof ReadFlaunchSDK;
10
12
  ReadWriteFlaunchSDK: typeof ReadWriteFlaunchSDK;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAEvE,cAAc,OAAO,CAAC;AACtB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAE9B,YAAY,EACV,UAAU,EACV,eAAe,EACf,WAAW,GACZ,MAAM,wCAAwC,CAAC;AAEhD,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,CAAC;AAE/C,eAAO,MAAM,UAAU;;;CAGtB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAEvE,cAAc,OAAO,CAAC;AACtB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAE9B,YAAY,EACV,UAAU,EACV,eAAe,EACf,WAAW,GACZ,MAAM,wCAAwC,CAAC;AAEhD,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,YAAY,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEzD,eAAO,MAAM,UAAU;;;CAGtB,CAAC"}
package/dist/index.esm.js CHANGED
@@ -1,7 +1,8 @@
1
1
  import { createDrift } from '@delvtech/drift';
2
- import { zeroAddress, parseEther, encodeAbiParameters, maxUint256 as maxUint256$1, encodeFunctionData, maxUint160, maxUint48, hexToBigInt as hexToBigInt$1, pad as pad$1, keccak256 as keccak256$1, encodePacked, stringToHex as stringToHex$1, parseUnits, formatUnits as formatUnits$1, concat, toHex as toHex$1, createPublicClient, http } from 'viem';
2
+ import { zeroAddress, parseEther, encodeAbiParameters, maxUint256 as maxUint256$1, encodeFunctionData, maxUint160, maxUint48, hexToBigInt as hexToBigInt$1, pad as pad$1, keccak256 as keccak256$1, encodePacked, stringToHex as stringToHex$1, parseUnits, zeroHash, formatUnits as formatUnits$1, concat, toHex as toHex$1, createPublicClient, http } from 'viem';
3
3
  import axios from 'axios';
4
4
  import { TickMath } from '@uniswap/v3-sdk';
5
+ import { viemAdapter } from '@delvtech/drift-viem';
5
6
 
6
7
  function defineChain(chain) {
7
8
  return {
@@ -12283,7 +12284,7 @@ class ReadWriteFlaunchZap extends ReadFlaunchZap {
12283
12284
  depositData: "0x",
12284
12285
  },
12285
12286
  _whitelistParams: {
12286
- merkleRoot: "0x",
12287
+ merkleRoot: zeroHash,
12287
12288
  merkleIPFSHash: "",
12288
12289
  maxTokens: 0n,
12289
12290
  },
@@ -12291,7 +12292,7 @@ class ReadWriteFlaunchZap extends ReadFlaunchZap {
12291
12292
  airdropIndex: 0n,
12292
12293
  airdropAmount: 0n,
12293
12294
  airdropEndTime: 0n,
12294
- merkleRoot: "0x",
12295
+ merkleRoot: zeroHash,
12295
12296
  merkleIPFSHash: "",
12296
12297
  },
12297
12298
  }, {
@@ -12359,7 +12360,7 @@ class ReadWriteFlaunchZap extends ReadFlaunchZap {
12359
12360
  depositData: "0x",
12360
12361
  },
12361
12362
  _whitelistParams: {
12362
- merkleRoot: "0x",
12363
+ merkleRoot: zeroHash,
12363
12364
  merkleIPFSHash: "",
12364
12365
  maxTokens: 0n,
12365
12366
  },
@@ -12367,7 +12368,7 @@ class ReadWriteFlaunchZap extends ReadFlaunchZap {
12367
12368
  airdropIndex: 0n,
12368
12369
  airdropAmount: 0n,
12369
12370
  airdropEndTime: 0n,
12370
- merkleRoot: "0x",
12371
+ merkleRoot: zeroHash,
12371
12372
  merkleIPFSHash: "",
12372
12373
  },
12373
12374
  }, {
@@ -18950,10 +18951,32 @@ class ReadWriteFlaunchSDK extends ReadFlaunchSDK {
18950
18951
  }
18951
18952
  }
18952
18953
 
18954
+ /**
18955
+ * Creates a Flaunch SDK instance with the provided clients
18956
+ * @param params - Parameters for creating the SDK
18957
+ * @returns ReadFlaunchSDK if only publicClient is provided, ReadWriteFlaunchSDK if walletClient is also provided
18958
+ * @throws Error if publicClient.chain is not configured
18959
+ */
18960
+ function createFlaunch(params) {
18961
+ const { publicClient, walletClient } = params;
18962
+ if (!publicClient.chain) {
18963
+ throw new Error("publicClient must be configured with a chain");
18964
+ }
18965
+ const chainId = publicClient.chain.id;
18966
+ // Return appropriate SDK type based on whether walletClient is provided
18967
+ return walletClient
18968
+ ? new ReadWriteFlaunchSDK(chainId, createDrift({
18969
+ adapter: viemAdapter({ publicClient, walletClient }),
18970
+ }))
18971
+ : new ReadFlaunchSDK(chainId, createDrift({
18972
+ adapter: viemAdapter({ publicClient }),
18973
+ }));
18974
+ }
18975
+
18953
18976
  const FlaunchSDK = {
18954
18977
  ReadFlaunchSDK,
18955
18978
  ReadWriteFlaunchSDK,
18956
18979
  };
18957
18980
 
18958
- export { BidWallAddress, BidWallV1_1Address, FLETHAddress, FLETHHooksAddress, FairLaunchAbi, FairLaunchAddress, FairLaunchV1_1Address, FastFlaunchZapAbi, FastFlaunchZapAddress, FlaunchAddress, FlaunchPositionManagerAbi, FlaunchPositionManagerAddress, FlaunchPositionManagerV1_1Address, FlaunchSDK, FlaunchV1_1Address, FlaunchZapAddress, MemecoinAbi, Permit2Address, PoolManagerAbi, PoolManagerAddress, QuoterAddress, ReadFlaunchSDK, ReadWriteFlaunchSDK, RevenueManagerAddress, StateViewAddress, TICK_SPACING, TickFinder, TreasuryManagerFactoryAddress, USDCETHPoolKeys, UniversalRouterAddress, bytes32ToUint256, calculateUnderlyingTokenBalances, chainIdToChain, generateTokenUri, getPoolId, getSqrtPriceX96FromTick, getValidTick, orderPoolKey, resolveIPFS, uint256ToBytes32, uploadFileToIPFS, uploadImageToIPFS, uploadJsonToIPFS };
18981
+ export { BidWallAddress, BidWallV1_1Address, FLETHAddress, FLETHHooksAddress, FairLaunchAbi, FairLaunchAddress, FairLaunchV1_1Address, FastFlaunchZapAbi, FastFlaunchZapAddress, FlaunchAddress, FlaunchPositionManagerAbi, FlaunchPositionManagerAddress, FlaunchPositionManagerV1_1Address, FlaunchSDK, FlaunchV1_1Address, FlaunchZapAddress, MemecoinAbi, Permit2Address, PoolManagerAbi, PoolManagerAddress, QuoterAddress, ReadFlaunchSDK, ReadWriteFlaunchSDK, RevenueManagerAddress, StateViewAddress, TICK_SPACING, TickFinder, TreasuryManagerFactoryAddress, USDCETHPoolKeys, UniversalRouterAddress, bytes32ToUint256, calculateUnderlyingTokenBalances, chainIdToChain, createFlaunch, generateTokenUri, getPoolId, getSqrtPriceX96FromTick, getValidTick, orderPoolKey, resolveIPFS, uint256ToBytes32, uploadFileToIPFS, uploadImageToIPFS, uploadJsonToIPFS };
18959
18982
  //# sourceMappingURL=index.esm.js.map