@flaunch/sdk 0.9.0 → 0.9.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/addresses/index.cjs +6 -6
- package/dist/addresses/index.js +6 -6
- package/dist/clients/TreasuryManagerFactoryClient.d.ts +4 -2
- package/dist/clients/TreasuryManagerFactoryClient.d.ts.map +1 -1
- package/dist/index.cjs.js +26 -26
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +27 -27
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +2 -2
- package/dist/index.umd.js.map +1 -1
- package/dist/sdk/FlaunchSDK.d.ts +4 -3
- package/dist/sdk/FlaunchSDK.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createDrift as createDrift$1 } from '@delvtech/drift';
|
|
2
|
-
import { zeroAddress, parseEther, encodeAbiParameters as encodeAbiParameters$1, maxUint256 as maxUint256$1, encodeFunctionData, maxUint160, maxUint48, parseUnits, hexToBigInt as hexToBigInt$1, pad as pad$1, keccak256 as keccak256$1, encodePacked, stringToHex as stringToHex$1, zeroHash, formatUnits as formatUnits$1,
|
|
2
|
+
import { zeroAddress, parseEther, encodeAbiParameters as encodeAbiParameters$1, maxUint256 as maxUint256$1, encodeFunctionData, maxUint160, maxUint48, parseUnits, hexToBigInt as hexToBigInt$1, pad as pad$1, keccak256 as keccak256$1, encodePacked, stringToHex as stringToHex$1, zeroHash, formatUnits as formatUnits$1, parseEventLogs, concat as concat$1, toHex as toHex$1, formatEther, erc721Abi, erc20Abi, parseAbi, createWalletClient, http, decodeFunctionData } from 'viem';
|
|
3
3
|
import axios from 'axios';
|
|
4
4
|
import { viemAdapter } from '@delvtech/drift-viem';
|
|
5
5
|
|
|
@@ -5742,16 +5742,16 @@ const TreasuryManagerFactoryAddress = {
|
|
|
5742
5742
|
[baseSepolia.id]: "0xD2F3C6185e06925dCBE794C6574315b2202E9CcD",
|
|
5743
5743
|
};
|
|
5744
5744
|
const RevenueManagerAddress = {
|
|
5745
|
-
[base.id]: "
|
|
5746
|
-
[baseSepolia.id]: "
|
|
5745
|
+
[base.id]: "0x4Fb9dE6bbe970A49C19fB967F937351728C01b8f",
|
|
5746
|
+
[baseSepolia.id]: "0x34077816CC8EAb21FF8E87FDC35b95F1602A2221",
|
|
5747
5747
|
};
|
|
5748
5748
|
const AddressFeeSplitManagerAddress = {
|
|
5749
|
-
[base.id]: "
|
|
5750
|
-
[baseSepolia.id]: "
|
|
5749
|
+
[base.id]: "0xC3F4E72DE4D37988F12C101b0766Fd8462F6Faf9",
|
|
5750
|
+
[baseSepolia.id]: "0x487583E8543ac9D68f11824ED611645Ca088c07F",
|
|
5751
5751
|
};
|
|
5752
5752
|
const StakingManagerAddress = {
|
|
5753
|
-
[base.id]: "
|
|
5754
|
-
[baseSepolia.id]: "
|
|
5753
|
+
[base.id]: "0x3C3BC8e63DF9CCd5cdaa01F6833B2e4dCdB40bF0",
|
|
5754
|
+
[baseSepolia.id]: "0x9ebBe3f8b72494aB00144a8844dbeA8B8817c323",
|
|
5755
5755
|
};
|
|
5756
5756
|
/** Verifiers */
|
|
5757
5757
|
const TokenImporterAddress = {
|
|
@@ -23876,13 +23876,8 @@ const TreasuryManagerFactoryAbi = [
|
|
|
23876
23876
|
{ type: "error", name: "UnknownManagerImplemention", inputs: [] },
|
|
23877
23877
|
];
|
|
23878
23878
|
|
|
23879
|
-
const chainIdToChain = {
|
|
23880
|
-
[base.id]: base,
|
|
23881
|
-
[baseSepolia.id]: baseSepolia,
|
|
23882
|
-
};
|
|
23883
|
-
|
|
23884
23879
|
class ReadTreasuryManagerFactory {
|
|
23885
|
-
constructor(chainId, address, drift = createDrift$1()) {
|
|
23880
|
+
constructor(chainId, address, drift = createDrift$1(), publicClient) {
|
|
23886
23881
|
if (!address) {
|
|
23887
23882
|
throw new Error("Address is required");
|
|
23888
23883
|
}
|
|
@@ -23891,15 +23886,14 @@ class ReadTreasuryManagerFactory {
|
|
|
23891
23886
|
address,
|
|
23892
23887
|
});
|
|
23893
23888
|
this.chainId = chainId;
|
|
23889
|
+
this.publicClient = publicClient;
|
|
23894
23890
|
}
|
|
23895
23891
|
async getManagerDeployedAddressFromTx(hash) {
|
|
23896
|
-
// Create a public client to get the transaction receipt with logs
|
|
23897
|
-
const publicClient = createPublicClient({
|
|
23898
|
-
chain: chainIdToChain[this.chainId],
|
|
23899
|
-
transport: http(),
|
|
23900
|
-
});
|
|
23901
23892
|
// Wait for transaction receipt
|
|
23902
|
-
|
|
23893
|
+
if (!this.publicClient) {
|
|
23894
|
+
throw new Error("Public client is required");
|
|
23895
|
+
}
|
|
23896
|
+
const receipt = await this.publicClient.waitForTransactionReceipt({ hash });
|
|
23903
23897
|
// Parse the ManagerDeployed event from receipt logs
|
|
23904
23898
|
const parsedLogs = parseEventLogs({
|
|
23905
23899
|
abi: TreasuryManagerFactoryAbi,
|
|
@@ -23915,8 +23909,8 @@ class ReadTreasuryManagerFactory {
|
|
|
23915
23909
|
}
|
|
23916
23910
|
}
|
|
23917
23911
|
class ReadWriteTreasuryManagerFactory extends ReadTreasuryManagerFactory {
|
|
23918
|
-
constructor(chainId, address, drift = createDrift$1()) {
|
|
23919
|
-
super(chainId, address, drift);
|
|
23912
|
+
constructor(chainId, address, drift = createDrift$1(), publicClient) {
|
|
23913
|
+
super(chainId, address, drift, publicClient);
|
|
23920
23914
|
}
|
|
23921
23915
|
}
|
|
23922
23916
|
|
|
@@ -25514,6 +25508,11 @@ const getAmountsForLiquidity = (params) => {
|
|
|
25514
25508
|
return { amount0, amount1 };
|
|
25515
25509
|
};
|
|
25516
25510
|
|
|
25511
|
+
const chainIdToChain = {
|
|
25512
|
+
[base.id]: base,
|
|
25513
|
+
[baseSepolia.id]: baseSepolia,
|
|
25514
|
+
};
|
|
25515
|
+
|
|
25517
25516
|
const FastFlaunchZapAbi = [
|
|
25518
25517
|
{
|
|
25519
25518
|
inputs: [
|
|
@@ -26047,10 +26046,11 @@ class ReadTrustedSignerFeeCalculator {
|
|
|
26047
26046
|
* Base class for interacting with Flaunch protocol in read-only mode
|
|
26048
26047
|
*/
|
|
26049
26048
|
class ReadFlaunchSDK {
|
|
26050
|
-
constructor(chainId, drift = createDrift$1()) {
|
|
26049
|
+
constructor(chainId, drift = createDrift$1(), publicClient) {
|
|
26051
26050
|
this.TICK_SPACING = TICK_SPACING;
|
|
26052
26051
|
this.chainId = chainId;
|
|
26053
26052
|
this.drift = drift;
|
|
26053
|
+
this.publicClient = publicClient;
|
|
26054
26054
|
this.resolveIPFS = resolveIPFS;
|
|
26055
26055
|
this.readPositionManager = new ReadFlaunchPositionManager(FlaunchPositionManagerAddress[this.chainId], drift);
|
|
26056
26056
|
this.readPositionManagerV1_1 = new ReadFlaunchPositionManagerV1_1(FlaunchPositionManagerV1_1Address[this.chainId], drift);
|
|
@@ -27319,8 +27319,8 @@ class ReadFlaunchSDK {
|
|
|
27319
27319
|
}
|
|
27320
27320
|
}
|
|
27321
27321
|
class ReadWriteFlaunchSDK extends ReadFlaunchSDK {
|
|
27322
|
-
constructor(chainId, drift = createDrift$1()) {
|
|
27323
|
-
super(chainId, drift);
|
|
27322
|
+
constructor(chainId, drift = createDrift$1(), publicClient) {
|
|
27323
|
+
super(chainId, drift, publicClient);
|
|
27324
27324
|
this.readWritePositionManager = new ReadWriteFlaunchPositionManager(FlaunchPositionManagerAddress[this.chainId], drift);
|
|
27325
27325
|
this.readWritePositionManagerV1_1 = new ReadWriteFlaunchPositionManagerV1_1(FlaunchPositionManagerV1_1Address[this.chainId], drift);
|
|
27326
27326
|
this.readWriteAnyPositionManager = new ReadWriteAnyPositionManager(AnyPositionManagerAddress[this.chainId], drift);
|
|
@@ -27328,7 +27328,7 @@ class ReadWriteFlaunchSDK extends ReadFlaunchSDK {
|
|
|
27328
27328
|
this.readWriteFeeEscrow = new ReadWriteFeeEscrow(FeeEscrowAddress[this.chainId], drift);
|
|
27329
27329
|
this.readWriteReferralEscrow = new ReadWriteReferralEscrow(ReferralEscrowAddress[this.chainId], drift);
|
|
27330
27330
|
this.readWriteFlaunchZap = new ReadWriteFlaunchZap(this.chainId, FlaunchZapAddress[this.chainId], drift);
|
|
27331
|
-
this.readWriteTreasuryManagerFactory = new ReadWriteTreasuryManagerFactory(this.chainId, TreasuryManagerFactoryAddress[this.chainId], drift);
|
|
27331
|
+
this.readWriteTreasuryManagerFactory = new ReadWriteTreasuryManagerFactory(this.chainId, TreasuryManagerFactoryAddress[this.chainId], drift, this.publicClient);
|
|
27332
27332
|
this.readWritePermit2 = new ReadWritePermit2(Permit2Address[this.chainId], drift);
|
|
27333
27333
|
}
|
|
27334
27334
|
/**
|
|
@@ -28172,8 +28172,8 @@ function createFlaunch(params) {
|
|
|
28172
28172
|
const chainId = publicClient.chain.id;
|
|
28173
28173
|
// Return appropriate SDK type based on whether walletClient is provided
|
|
28174
28174
|
return walletClient
|
|
28175
|
-
? new ReadWriteFlaunchSDK(chainId, createDrift({ publicClient, walletClient }))
|
|
28176
|
-
: new ReadFlaunchSDK(chainId, createDrift({ publicClient }));
|
|
28175
|
+
? new ReadWriteFlaunchSDK(chainId, createDrift({ publicClient, walletClient }), publicClient)
|
|
28176
|
+
: new ReadFlaunchSDK(chainId, createDrift({ publicClient }), publicClient);
|
|
28177
28177
|
}
|
|
28178
28178
|
|
|
28179
28179
|
// ABI for encoding the call data
|