@flaunch/sdk 0.6.0 → 0.7.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 +25 -41
- package/dist/index.cjs.js +24 -0
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +24 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/sdk/factory.d.ts +21 -0
- package/dist/sdk/factory.d.ts.map +1 -0
- package/package.json +3 -4
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;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -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;
|
|
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
|
@@ -2,6 +2,7 @@ import { createDrift } from '@delvtech/drift';
|
|
|
2
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';
|
|
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 {
|
|
@@ -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
|