@ubi.fun/sdk 0.1.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/LICENSE +10 -0
- package/README.md +279 -0
- package/dist/abi/AddressFeeSplitManager.d.cts +938 -0
- package/dist/abi/AddressFeeSplitManager.d.ts +939 -0
- package/dist/abi/AddressFeeSplitManager.d.ts.map +1 -0
- package/dist/abi/BidWall.d.cts +739 -0
- package/dist/abi/BidWall.d.ts +740 -0
- package/dist/abi/BidWall.d.ts.map +1 -0
- package/dist/abi/FairLaunch.d.cts +535 -0
- package/dist/abi/FairLaunch.d.ts +536 -0
- package/dist/abi/FairLaunch.d.ts.map +1 -0
- package/dist/abi/FeeEscrow.d.cts +281 -0
- package/dist/abi/FeeEscrow.d.ts +282 -0
- package/dist/abi/FeeEscrow.d.ts.map +1 -0
- package/dist/abi/Flaunch.d.cts +775 -0
- package/dist/abi/Flaunch.d.ts +776 -0
- package/dist/abi/Flaunch.d.ts.map +1 -0
- package/dist/abi/FlaunchPositionManager.d.cts +2170 -0
- package/dist/abi/FlaunchPositionManager.d.ts +2171 -0
- package/dist/abi/FlaunchPositionManager.d.ts.map +1 -0
- package/dist/abi/FlaunchZap.d.cts +300 -0
- package/dist/abi/FlaunchZap.d.ts +301 -0
- package/dist/abi/FlaunchZap.d.ts.map +1 -0
- package/dist/abi/InitialPrice.d.cts +252 -0
- package/dist/abi/InitialPrice.d.ts +253 -0
- package/dist/abi/InitialPrice.d.ts.map +1 -0
- package/dist/abi/Memecoin.d.cts +680 -0
- package/dist/abi/Memecoin.d.ts +681 -0
- package/dist/abi/Memecoin.d.ts.map +1 -0
- package/dist/abi/Multicall.d.cts +332 -0
- package/dist/abi/Multicall.d.ts +333 -0
- package/dist/abi/Multicall.d.ts.map +1 -0
- package/dist/abi/PoolManager.d.cts +1056 -0
- package/dist/abi/PoolManager.d.ts +1057 -0
- package/dist/abi/PoolManager.d.ts.map +1 -0
- package/dist/abi/PoolSwap.d.cts +89 -0
- package/dist/abi/PoolSwap.d.ts +90 -0
- package/dist/abi/PoolSwap.d.ts.map +1 -0
- package/dist/abi/Quoter.d.cts +485 -0
- package/dist/abi/Quoter.d.ts +486 -0
- package/dist/abi/Quoter.d.ts.map +1 -0
- package/dist/abi/ReferralEscrow.d.cts +459 -0
- package/dist/abi/ReferralEscrow.d.ts +460 -0
- package/dist/abi/ReferralEscrow.d.ts.map +1 -0
- package/dist/abi/TreasuryManager.d.cts +325 -0
- package/dist/abi/TreasuryManager.d.ts +326 -0
- package/dist/abi/TreasuryManager.d.ts.map +1 -0
- package/dist/abi/TreasuryManagerFactory.d.cts +433 -0
- package/dist/abi/TreasuryManagerFactory.d.ts +434 -0
- package/dist/abi/TreasuryManagerFactory.d.ts.map +1 -0
- package/dist/abi/UniversalRewardsDistributor.d.cts +191 -0
- package/dist/abi/UniversalRewardsDistributor.d.ts +192 -0
- package/dist/abi/UniversalRewardsDistributor.d.ts.map +1 -0
- package/dist/abi/XHandleClaims.d.cts +383 -0
- package/dist/abi/XHandleClaims.d.ts +384 -0
- package/dist/abi/XHandleClaims.d.ts.map +1 -0
- package/dist/abi/index.cjs +13541 -0
- package/dist/abi/index.cjs.map +1 -0
- package/dist/abi/index.d.cts +18 -0
- package/dist/abi/index.d.ts +19 -0
- package/dist/abi/index.d.ts.map +1 -0
- package/dist/abi/index.js +13522 -0
- package/dist/abi/index.js.map +1 -0
- package/dist/addresses/index.cjs +90 -0
- package/dist/addresses/index.cjs.map +1 -0
- package/dist/addresses/index.js +70 -0
- package/dist/addresses/index.js.map +1 -0
- package/dist/addresses.d.cts +48 -0
- package/dist/addresses.d.ts +49 -0
- package/dist/addresses.d.ts.map +1 -0
- package/dist/clients/BidWallClient.d.cts +44 -0
- package/dist/clients/BidWallClient.d.ts +45 -0
- package/dist/clients/BidWallClient.d.ts.map +1 -0
- package/dist/clients/FairLaunchClient.d.cts +47 -0
- package/dist/clients/FairLaunchClient.d.ts +48 -0
- package/dist/clients/FairLaunchClient.d.ts.map +1 -0
- package/dist/clients/FeeEscrowClient.d.cts +40 -0
- package/dist/clients/FeeEscrowClient.d.ts +41 -0
- package/dist/clients/FeeEscrowClient.d.ts.map +1 -0
- package/dist/clients/FlaunchClient.d.cts +35 -0
- package/dist/clients/FlaunchClient.d.ts +36 -0
- package/dist/clients/FlaunchClient.d.ts.map +1 -0
- package/dist/clients/FlaunchPositionManagerClient.d.cts +117 -0
- package/dist/clients/FlaunchPositionManagerClient.d.ts +118 -0
- package/dist/clients/FlaunchPositionManagerClient.d.ts.map +1 -0
- package/dist/clients/FlaunchZapClient.d.cts +127 -0
- package/dist/clients/FlaunchZapClient.d.ts +128 -0
- package/dist/clients/FlaunchZapClient.d.ts.map +1 -0
- package/dist/clients/InitialPriceClient.d.cts +32 -0
- package/dist/clients/InitialPriceClient.d.ts +33 -0
- package/dist/clients/InitialPriceClient.d.ts.map +1 -0
- package/dist/clients/MemecoinClient.d.cts +66 -0
- package/dist/clients/MemecoinClient.d.ts +67 -0
- package/dist/clients/MemecoinClient.d.ts.map +1 -0
- package/dist/clients/MulticallClient.d.cts +15 -0
- package/dist/clients/MulticallClient.d.ts +16 -0
- package/dist/clients/MulticallClient.d.ts.map +1 -0
- package/dist/clients/PoolManagerClient.d.cts +50 -0
- package/dist/clients/PoolManagerClient.d.ts +51 -0
- package/dist/clients/PoolManagerClient.d.ts.map +1 -0
- package/dist/clients/PoolSwapClient.d.cts +37 -0
- package/dist/clients/PoolSwapClient.d.ts +38 -0
- package/dist/clients/PoolSwapClient.d.ts.map +1 -0
- package/dist/clients/QuoterClient.d.cts +58 -0
- package/dist/clients/QuoterClient.d.ts +59 -0
- package/dist/clients/QuoterClient.d.ts.map +1 -0
- package/dist/clients/ReferralEscrowClient.d.cts +39 -0
- package/dist/clients/ReferralEscrowClient.d.ts +40 -0
- package/dist/clients/ReferralEscrowClient.d.ts.map +1 -0
- package/dist/clients/TreasuryManagerClient.d.cts +71 -0
- package/dist/clients/TreasuryManagerClient.d.ts +72 -0
- package/dist/clients/TreasuryManagerClient.d.ts.map +1 -0
- package/dist/clients/TreasuryManagerFactoryClient.d.cts +15 -0
- package/dist/clients/TreasuryManagerFactoryClient.d.ts +16 -0
- package/dist/clients/TreasuryManagerFactoryClient.d.ts.map +1 -0
- package/dist/clients/UniversalRewardsDistributorClient.d.cts +45 -0
- package/dist/clients/UniversalRewardsDistributorClient.d.ts +46 -0
- package/dist/clients/UniversalRewardsDistributorClient.d.ts.map +1 -0
- package/dist/clients/XHandleClaimsClient.d.cts +64 -0
- package/dist/clients/XHandleClaimsClient.d.ts +65 -0
- package/dist/clients/XHandleClaimsClient.d.ts.map +1 -0
- package/dist/helpers/chainIdToChain.d.cts +113 -0
- package/dist/helpers/chainIdToChain.d.ts +114 -0
- package/dist/helpers/chainIdToChain.d.ts.map +1 -0
- package/dist/helpers/hex.d.cts +3 -0
- package/dist/helpers/hex.d.ts +4 -0
- package/dist/helpers/hex.d.ts.map +1 -0
- package/dist/helpers/index.cjs +196 -0
- package/dist/helpers/index.cjs.map +1 -0
- package/dist/helpers/index.d.cts +3 -0
- package/dist/helpers/index.d.ts +4 -0
- package/dist/helpers/index.d.ts.map +1 -0
- package/dist/helpers/index.js +184 -0
- package/dist/helpers/index.js.map +1 -0
- package/dist/helpers/ipfs.d.cts +56 -0
- package/dist/helpers/ipfs.d.ts +57 -0
- package/dist/helpers/ipfs.d.ts.map +1 -0
- package/dist/hooks/FlaunchPositionManagerHooks.d.cts +28 -0
- package/dist/hooks/FlaunchPositionManagerHooks.d.ts +29 -0
- package/dist/hooks/FlaunchPositionManagerHooks.d.ts.map +1 -0
- package/dist/hooks/index.cjs +73 -0
- package/dist/hooks/index.cjs.map +1 -0
- package/dist/hooks/index.d.cts +1 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +70 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/index.cjs +16808 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +31 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +16718 -0
- package/dist/index.js.map +1 -0
- package/dist/index.umd.cjs +2 -0
- package/dist/index.umd.cjs.map +1 -0
- package/dist/sdk/FlaunchSDK.d.cts +520 -0
- package/dist/sdk/FlaunchSDK.d.ts +521 -0
- package/dist/sdk/FlaunchSDK.d.ts.map +1 -0
- package/dist/sdk/calldata.d.cts +65 -0
- package/dist/sdk/calldata.d.ts +66 -0
- package/dist/sdk/calldata.d.ts.map +1 -0
- package/dist/sdk/drift.d.cts +20 -0
- package/dist/sdk/drift.d.ts +21 -0
- package/dist/sdk/drift.d.ts.map +1 -0
- package/dist/sdk/factory.d.cts +20 -0
- package/dist/sdk/factory.d.ts +21 -0
- package/dist/sdk/factory.d.ts.map +1 -0
- package/dist/types.d.cts +56 -0
- package/dist/types.d.ts +57 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/utils/index.cjs +455 -0
- package/dist/utils/index.cjs.map +1 -0
- package/dist/utils/index.d.cts +4 -0
- package/dist/utils/index.d.ts +5 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +431 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/parseSwap.d.cts +45 -0
- package/dist/utils/parseSwap.d.ts +46 -0
- package/dist/utils/parseSwap.d.ts.map +1 -0
- package/dist/utils/slippage.d.cts +11 -0
- package/dist/utils/slippage.d.ts +12 -0
- package/dist/utils/slippage.d.ts.map +1 -0
- package/dist/utils/swap.d.cts +49 -0
- package/dist/utils/swap.d.ts +50 -0
- package/dist/utils/swap.d.ts.map +1 -0
- package/dist/utils/univ4.d.cts +78 -0
- package/dist/utils/univ4.d.ts +79 -0
- package/dist/utils/univ4.d.ts.map +1 -0
- package/package.json +161 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { type ReadContract, type Address, type Drift, type ReadWriteContract } from "@delvtech/drift";
|
|
2
|
+
import { MemecoinAbi } from "../abi/Memecoin.js";
|
|
3
|
+
export type MemecoinABI = typeof MemecoinAbi;
|
|
4
|
+
/**
|
|
5
|
+
* Client for interacting with Memecoin (ERC20) contracts in read-only mode
|
|
6
|
+
* Provides methods to query basic token information and balances
|
|
7
|
+
*/
|
|
8
|
+
export declare class ReadMemecoin {
|
|
9
|
+
readonly contract: ReadContract<MemecoinABI>;
|
|
10
|
+
/**
|
|
11
|
+
* Creates a new ReadMemecoin instance
|
|
12
|
+
* @param address - The address of the Memecoin contract
|
|
13
|
+
* @param drift - Optional drift instance for contract interactions (creates new instance if not provided)
|
|
14
|
+
* @throws Error if address is not provided
|
|
15
|
+
*/
|
|
16
|
+
constructor(address: Address, drift?: Drift);
|
|
17
|
+
/**
|
|
18
|
+
* Gets the name of the token
|
|
19
|
+
* @returns Promise<string> - The name of the token
|
|
20
|
+
*/
|
|
21
|
+
name(): Promise<string>;
|
|
22
|
+
/**
|
|
23
|
+
* Gets the symbol of the token
|
|
24
|
+
* @returns Promise<string> - The symbol of the token
|
|
25
|
+
*/
|
|
26
|
+
symbol(): Promise<string>;
|
|
27
|
+
/**
|
|
28
|
+
* Gets the token URI containing metadata
|
|
29
|
+
* @returns Promise<string> - The token URI
|
|
30
|
+
*/
|
|
31
|
+
tokenURI(): Promise<string>;
|
|
32
|
+
/**
|
|
33
|
+
* Gets the decimals of the token
|
|
34
|
+
* @returns Promise<number> - The decimals of the token
|
|
35
|
+
*/
|
|
36
|
+
decimals(): Promise<number>;
|
|
37
|
+
/**
|
|
38
|
+
* Gets the total supply of the token
|
|
39
|
+
* @returns Promise<bigint> - The total supply
|
|
40
|
+
*/
|
|
41
|
+
totalSupply(): Promise<bigint>;
|
|
42
|
+
/**
|
|
43
|
+
* Gets the token balance of a specific user
|
|
44
|
+
* @param user - The address of the user to check
|
|
45
|
+
* @returns Promise<bigint> - The token balance
|
|
46
|
+
*/
|
|
47
|
+
balanceOf(user: Address): Promise<bigint>;
|
|
48
|
+
/**
|
|
49
|
+
* Gets the allowance of an ERC20 token to a spender
|
|
50
|
+
* @param owner - The address of the owner to check
|
|
51
|
+
* @param spender - The address of the spender to check
|
|
52
|
+
* @returns Promise<bigint> - The allowance of the coin to the spender
|
|
53
|
+
*/
|
|
54
|
+
allowance(owner: Address, spender: Address): Promise<bigint>;
|
|
55
|
+
}
|
|
56
|
+
export declare class ReadWriteMemecoin extends ReadMemecoin {
|
|
57
|
+
contract: ReadWriteContract<MemecoinABI>;
|
|
58
|
+
constructor(address: Address, drift?: Drift);
|
|
59
|
+
/**
|
|
60
|
+
* Approves an amount of the token to be spent by another address
|
|
61
|
+
* @param spender - The address of the spender to approve
|
|
62
|
+
* @param amount - The amount of the token to approve
|
|
63
|
+
* @returns Promise<void> - The transaction receipt
|
|
64
|
+
*/
|
|
65
|
+
approve(spender: Address, amount: bigint): Promise<`0x${string}`>;
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=MemecoinClient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MemecoinClient.d.ts","sourceRoot":"","sources":["../../src/clients/MemecoinClient.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,OAAO,EACZ,KAAK,KAAK,EAEV,KAAK,iBAAiB,EAIvB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,MAAM,MAAM,WAAW,GAAG,OAAO,WAAW,CAAC;AAE7C;;;GAGG;AACH,qBAAa,YAAY;IACvB,SAAgB,QAAQ,EAAE,YAAY,CAAC,WAAW,CAAC,CAAC;IAEpD;;;;;OAKG;gBACS,OAAO,EAAE,OAAO,EAAE,KAAK,GAAE,KAAqB;IAW1D;;;OAGG;IACH,IAAI;IAIJ;;;OAGG;IACH,MAAM;IAIN;;;OAGG;IACH,QAAQ;IAIR;;;OAGG;IACH,QAAQ;IAIR;;;OAGG;IACH,WAAW;IAIX;;;;OAIG;IACH,SAAS,CAAC,IAAI,EAAE,OAAO;IAMvB;;;;;OAKG;IACH,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO;CAM3C;AAED,qBAAa,iBAAkB,SAAQ,YAAY;IACzC,QAAQ,EAAE,iBAAiB,CAAC,WAAW,CAAC,CAAC;gBAErC,OAAO,EAAE,OAAO,EAAE,KAAK,GAAE,KAAqB;IAI1D;;;;;OAKG;IACH,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM;CAMzC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type ReadContract, type Address, type Drift, type HexString } from "@delvtech/drift";
|
|
2
|
+
import { MulticallAbi } from "../abi/Multicall.cjs";
|
|
3
|
+
export type MulticallABI = typeof MulticallAbi;
|
|
4
|
+
export declare class ReadMulticall {
|
|
5
|
+
readonly address: Address;
|
|
6
|
+
readonly contract: ReadContract<MulticallABI>;
|
|
7
|
+
constructor(drift: Drift);
|
|
8
|
+
aggregate3(calls: {
|
|
9
|
+
target: Address;
|
|
10
|
+
callData: HexString;
|
|
11
|
+
}[]): Promise<readonly {
|
|
12
|
+
success: boolean;
|
|
13
|
+
returnData: `0x${string}`;
|
|
14
|
+
}[]>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type ReadContract, type Address, type Drift, type HexString } from "@delvtech/drift";
|
|
2
|
+
import { MulticallAbi } from "../abi/Multicall.js";
|
|
3
|
+
export type MulticallABI = typeof MulticallAbi;
|
|
4
|
+
export declare class ReadMulticall {
|
|
5
|
+
readonly address: Address;
|
|
6
|
+
readonly contract: ReadContract<MulticallABI>;
|
|
7
|
+
constructor(drift: Drift);
|
|
8
|
+
aggregate3(calls: {
|
|
9
|
+
target: Address;
|
|
10
|
+
callData: HexString;
|
|
11
|
+
}[]): Promise<readonly {
|
|
12
|
+
success: boolean;
|
|
13
|
+
returnData: `0x${string}`;
|
|
14
|
+
}[]>;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=MulticallClient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MulticallClient.d.ts","sourceRoot":"","sources":["../../src/clients/MulticallClient.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,OAAO,EACZ,KAAK,KAAK,EAIV,KAAK,SAAS,EAEf,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD,MAAM,MAAM,YAAY,GAAG,OAAO,YAAY,CAAC;AAE/C,qBAAa,aAAa;IAExB,SAAgB,OAAO,EAAE,OAAO,CACe;IAE/C,SAAgB,QAAQ,EAAE,YAAY,CAAC,YAAY,CAAC,CAAC;gBAEzC,KAAK,EAAE,KAAK;IAOxB,UAAU,CAAC,KAAK,EAAE;QAAE,MAAM,EAAE,OAAO,CAAC;QAAC,QAAQ,EAAE,SAAS,CAAA;KAAE,EAAE;;;;CAS7D"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { type ReadContract, type Address, type Drift, type HexString } from "@delvtech/drift";
|
|
2
|
+
import { PoolManagerAbi } from "../abi/PoolManager.cjs";
|
|
3
|
+
export type PoolManagerABI = typeof PoolManagerAbi;
|
|
4
|
+
export interface PositionInfoParams {
|
|
5
|
+
poolId: HexString;
|
|
6
|
+
owner: Address;
|
|
7
|
+
tickLower: number;
|
|
8
|
+
tickUpper: number;
|
|
9
|
+
salt: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Client for the Uniswap v4 PoolManager. Pool state is read straight off the
|
|
13
|
+
* singleton's storage via extsload (StateView is not deployed on Arc), using
|
|
14
|
+
* the same slot derivations as Uniswap's StateLibrary.
|
|
15
|
+
*/
|
|
16
|
+
export declare class ReadPoolManager {
|
|
17
|
+
readonly contract: ReadContract<PoolManagerABI>;
|
|
18
|
+
constructor(address: Address, drift?: Drift);
|
|
19
|
+
/** The base storage slot of a pool's State struct (_pools is at slot 6). */
|
|
20
|
+
poolStateSlot({ poolId }: {
|
|
21
|
+
poolId: HexString;
|
|
22
|
+
}): `0x${string}`;
|
|
23
|
+
/**
|
|
24
|
+
* Reads a pool's Slot0: current sqrt price, tick, and fee configuration
|
|
25
|
+
* @param poolId - The ID of the pool
|
|
26
|
+
* @returns Promise<{sqrtPriceX96: bigint, tick: number, protocolFee: number, lpFee: number}>
|
|
27
|
+
*/
|
|
28
|
+
poolSlot0({ poolId }: {
|
|
29
|
+
poolId: HexString;
|
|
30
|
+
}): Promise<{
|
|
31
|
+
sqrtPriceX96: bigint;
|
|
32
|
+
tick: number;
|
|
33
|
+
protocolFee: number;
|
|
34
|
+
lpFee: number;
|
|
35
|
+
}>;
|
|
36
|
+
/**
|
|
37
|
+
* Reads a liquidity position's state
|
|
38
|
+
* @param poolId - The ID of the pool
|
|
39
|
+
* @param owner - The address of the position owner
|
|
40
|
+
* @param tickLower - The lower tick of the position
|
|
41
|
+
* @param tickUpper - The upper tick of the position
|
|
42
|
+
* @param salt - The salt used to identify the position
|
|
43
|
+
* @returns Promise<{liquidity, feeGrowthInside0LastX128, feeGrowthInside1LastX128}>
|
|
44
|
+
*/
|
|
45
|
+
positionInfo({ poolId, owner, tickLower, tickUpper, salt, }: PositionInfoParams): Promise<{
|
|
46
|
+
liquidity: bigint;
|
|
47
|
+
feeGrowthInside0LastX128: bigint;
|
|
48
|
+
feeGrowthInside1LastX128: bigint;
|
|
49
|
+
}>;
|
|
50
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { type ReadContract, type Address, type Drift, type HexString } from "@delvtech/drift";
|
|
2
|
+
import { PoolManagerAbi } from "../abi/PoolManager.js";
|
|
3
|
+
export type PoolManagerABI = typeof PoolManagerAbi;
|
|
4
|
+
export interface PositionInfoParams {
|
|
5
|
+
poolId: HexString;
|
|
6
|
+
owner: Address;
|
|
7
|
+
tickLower: number;
|
|
8
|
+
tickUpper: number;
|
|
9
|
+
salt: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Client for the Uniswap v4 PoolManager. Pool state is read straight off the
|
|
13
|
+
* singleton's storage via extsload (StateView is not deployed on Arc), using
|
|
14
|
+
* the same slot derivations as Uniswap's StateLibrary.
|
|
15
|
+
*/
|
|
16
|
+
export declare class ReadPoolManager {
|
|
17
|
+
readonly contract: ReadContract<PoolManagerABI>;
|
|
18
|
+
constructor(address: Address, drift?: Drift);
|
|
19
|
+
/** The base storage slot of a pool's State struct (_pools is at slot 6). */
|
|
20
|
+
poolStateSlot({ poolId }: {
|
|
21
|
+
poolId: HexString;
|
|
22
|
+
}): `0x${string}`;
|
|
23
|
+
/**
|
|
24
|
+
* Reads a pool's Slot0: current sqrt price, tick, and fee configuration
|
|
25
|
+
* @param poolId - The ID of the pool
|
|
26
|
+
* @returns Promise<{sqrtPriceX96: bigint, tick: number, protocolFee: number, lpFee: number}>
|
|
27
|
+
*/
|
|
28
|
+
poolSlot0({ poolId }: {
|
|
29
|
+
poolId: HexString;
|
|
30
|
+
}): Promise<{
|
|
31
|
+
sqrtPriceX96: bigint;
|
|
32
|
+
tick: number;
|
|
33
|
+
protocolFee: number;
|
|
34
|
+
lpFee: number;
|
|
35
|
+
}>;
|
|
36
|
+
/**
|
|
37
|
+
* Reads a liquidity position's state
|
|
38
|
+
* @param poolId - The ID of the pool
|
|
39
|
+
* @param owner - The address of the position owner
|
|
40
|
+
* @param tickLower - The lower tick of the position
|
|
41
|
+
* @param tickUpper - The upper tick of the position
|
|
42
|
+
* @param salt - The salt used to identify the position
|
|
43
|
+
* @returns Promise<{liquidity, feeGrowthInside0LastX128, feeGrowthInside1LastX128}>
|
|
44
|
+
*/
|
|
45
|
+
positionInfo({ poolId, owner, tickLower, tickUpper, salt, }: PositionInfoParams): Promise<{
|
|
46
|
+
liquidity: bigint;
|
|
47
|
+
feeGrowthInside0LastX128: bigint;
|
|
48
|
+
feeGrowthInside1LastX128: bigint;
|
|
49
|
+
}>;
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=PoolManagerClient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PoolManagerClient.d.ts","sourceRoot":"","sources":["../../src/clients/PoolManagerClient.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,OAAO,EACZ,KAAK,KAAK,EACV,KAAK,SAAS,EAEf,MAAM,iBAAiB,CAAC;AAWzB,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,MAAM,MAAM,cAAc,GAAG,OAAO,cAAc,CAAC;AAEnD,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,SAAS,CAAC;IAClB,KAAK,EAAE,OAAO,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;GAIG;AACH,qBAAa,eAAe;IAC1B,SAAgB,QAAQ,EAAE,YAAY,CAAC,cAAc,CAAC,CAAC;gBAE3C,OAAO,EAAE,OAAO,EAAE,KAAK,GAAE,KAAqB;IAW1D,4EAA4E;IAC5E,aAAa,CAAC,EAAE,MAAM,EAAE,EAAE;QAAE,MAAM,EAAE,SAAS,CAAA;KAAE;IAQ/C;;;;OAIG;IACG,SAAS,CAAC,EAAE,MAAM,EAAE,EAAE;QAAE,MAAM,EAAE,SAAS,CAAA;KAAE;;;;;;IAuBjD;;;;;;;;OAQG;IACG,YAAY,CAAC,EACjB,MAAM,EACN,KAAK,EACL,SAAS,EACT,SAAS,EACT,IAAI,GACL,EAAE,kBAAkB,GAAG,OAAO,CAAC;QAC9B,SAAS,EAAE,MAAM,CAAC;QAClB,wBAAwB,EAAE,MAAM,CAAC;QACjC,wBAAwB,EAAE,MAAM,CAAC;KAClC,CAAC;CA8CH"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type ReadContract, type ReadWriteContract, type ReadWriteAdapter, type Address, type Drift } from "@delvtech/drift";
|
|
2
|
+
import { PoolSwapAbi } from "../abi/PoolSwap.cjs";
|
|
3
|
+
import { PoolKey } from "../types.cjs";
|
|
4
|
+
export type PoolSwapABI = typeof PoolSwapAbi;
|
|
5
|
+
/**
|
|
6
|
+
* Client for the PoolSwap contract, the supported way to trade ubi.fun pools:
|
|
7
|
+
* unlike a generic v4 router it forwards a referrer to the hook, which assigns
|
|
8
|
+
* that address 5% of the swap fee in the ReferralEscrow.
|
|
9
|
+
*
|
|
10
|
+
* Approve the input token to PoolSwap before swapping: USDC for buys, the coin
|
|
11
|
+
* for sells. Amounts are USDC 6 decimals on the cash side and 18 decimals on
|
|
12
|
+
* the coin side.
|
|
13
|
+
*/
|
|
14
|
+
export declare class ReadPoolSwap {
|
|
15
|
+
readonly contract: ReadContract<PoolSwapABI>;
|
|
16
|
+
constructor(address: Address, drift?: Drift);
|
|
17
|
+
}
|
|
18
|
+
export declare class ReadWritePoolSwap extends ReadPoolSwap {
|
|
19
|
+
contract: ReadWriteContract<PoolSwapABI>;
|
|
20
|
+
constructor(address: Address, drift?: Drift<ReadWriteAdapter>);
|
|
21
|
+
/**
|
|
22
|
+
* Executes a swap against a ubi.fun pool
|
|
23
|
+
* @param params.poolKey - The pool key (read it back with PositionManager.poolKey)
|
|
24
|
+
* @param params.zeroForOne - v4 direction against the pool key ordering
|
|
25
|
+
* @param params.amountSpecified - Negative for exact-in, positive for exact-out
|
|
26
|
+
* @param params.sqrtPriceLimitX96 - Slippage bound on the pool price
|
|
27
|
+
* @param params.referrer - Optional referrer credited with 5% of the swap fee
|
|
28
|
+
* @returns Transaction response
|
|
29
|
+
*/
|
|
30
|
+
swap(params: {
|
|
31
|
+
poolKey: PoolKey;
|
|
32
|
+
zeroForOne: boolean;
|
|
33
|
+
amountSpecified: bigint;
|
|
34
|
+
sqrtPriceLimitX96: bigint;
|
|
35
|
+
referrer?: Address;
|
|
36
|
+
}): Promise<`0x${string}`>;
|
|
37
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type ReadContract, type ReadWriteContract, type ReadWriteAdapter, type Address, type Drift } from "@delvtech/drift";
|
|
2
|
+
import { PoolSwapAbi } from "../abi/PoolSwap.js";
|
|
3
|
+
import { PoolKey } from "../types.js";
|
|
4
|
+
export type PoolSwapABI = typeof PoolSwapAbi;
|
|
5
|
+
/**
|
|
6
|
+
* Client for the PoolSwap contract, the supported way to trade ubi.fun pools:
|
|
7
|
+
* unlike a generic v4 router it forwards a referrer to the hook, which assigns
|
|
8
|
+
* that address 5% of the swap fee in the ReferralEscrow.
|
|
9
|
+
*
|
|
10
|
+
* Approve the input token to PoolSwap before swapping: USDC for buys, the coin
|
|
11
|
+
* for sells. Amounts are USDC 6 decimals on the cash side and 18 decimals on
|
|
12
|
+
* the coin side.
|
|
13
|
+
*/
|
|
14
|
+
export declare class ReadPoolSwap {
|
|
15
|
+
readonly contract: ReadContract<PoolSwapABI>;
|
|
16
|
+
constructor(address: Address, drift?: Drift);
|
|
17
|
+
}
|
|
18
|
+
export declare class ReadWritePoolSwap extends ReadPoolSwap {
|
|
19
|
+
contract: ReadWriteContract<PoolSwapABI>;
|
|
20
|
+
constructor(address: Address, drift?: Drift<ReadWriteAdapter>);
|
|
21
|
+
/**
|
|
22
|
+
* Executes a swap against a ubi.fun pool
|
|
23
|
+
* @param params.poolKey - The pool key (read it back with PositionManager.poolKey)
|
|
24
|
+
* @param params.zeroForOne - v4 direction against the pool key ordering
|
|
25
|
+
* @param params.amountSpecified - Negative for exact-in, positive for exact-out
|
|
26
|
+
* @param params.sqrtPriceLimitX96 - Slippage bound on the pool price
|
|
27
|
+
* @param params.referrer - Optional referrer credited with 5% of the swap fee
|
|
28
|
+
* @returns Transaction response
|
|
29
|
+
*/
|
|
30
|
+
swap(params: {
|
|
31
|
+
poolKey: PoolKey;
|
|
32
|
+
zeroForOne: boolean;
|
|
33
|
+
amountSpecified: bigint;
|
|
34
|
+
sqrtPriceLimitX96: bigint;
|
|
35
|
+
referrer?: Address;
|
|
36
|
+
}): Promise<`0x${string}`>;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=PoolSwapClient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PoolSwapClient.d.ts","sourceRoot":"","sources":["../../src/clients/PoolSwapClient.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,OAAO,EACZ,KAAK,KAAK,EAEX,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAEnC,MAAM,MAAM,WAAW,GAAG,OAAO,WAAW,CAAC;AAE7C;;;;;;;;GAQG;AACH,qBAAa,YAAY;IACvB,SAAgB,QAAQ,EAAE,YAAY,CAAC,WAAW,CAAC,CAAC;gBAExC,OAAO,EAAE,OAAO,EAAE,KAAK,GAAE,KAAqB;CAU3D;AAED,qBAAa,iBAAkB,SAAQ,YAAY;IACzC,QAAQ,EAAE,iBAAiB,CAAC,WAAW,CAAC,CAAC;gBAG/C,OAAO,EAAE,OAAO,EAChB,KAAK,GAAE,KAAK,CAAC,gBAAgB,CAAiB;IAKhD;;;;;;;;OAQG;IACH,IAAI,CAAC,MAAM,EAAE;QACX,OAAO,EAAE,OAAO,CAAC;QACjB,UAAU,EAAE,OAAO,CAAC;QACpB,eAAe,EAAE,MAAM,CAAC;QACxB,iBAAiB,EAAE,MAAM,CAAC;QAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;KACpB;CAWF"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { type ReadContract, type Address, type Drift } from "@delvtech/drift";
|
|
2
|
+
import { QuoterAbi } from "../abi/Quoter.cjs";
|
|
3
|
+
export type QuoterABI = typeof QuoterAbi;
|
|
4
|
+
/**
|
|
5
|
+
* Client for the Uniswap V4Quoter. Every ubi.fun pool is a single hop between
|
|
6
|
+
* the coin and USDC (6 decimals) with the PositionManager as the hook, so all
|
|
7
|
+
* quotes are quoteExactInputSingle / quoteExactOutputSingle calls.
|
|
8
|
+
*
|
|
9
|
+
* Pass the SAME referrer you will swap with: the hook data changes how the fee
|
|
10
|
+
* is assigned, and a quote without it will not match execution.
|
|
11
|
+
*/
|
|
12
|
+
export declare class ReadQuoter {
|
|
13
|
+
chainId: number;
|
|
14
|
+
readonly contract: ReadContract<QuoterABI>;
|
|
15
|
+
constructor(chainId: number, address: Address, drift?: Drift);
|
|
16
|
+
/**
|
|
17
|
+
* Quote for buying a coin with an exact amount of USDC
|
|
18
|
+
* @param coinAddress - The coin to buy
|
|
19
|
+
* @param amountIn - Exact USDC to spend (6 decimals)
|
|
20
|
+
* @param positionManagerAddress - The PositionManager (pool hook)
|
|
21
|
+
* @param referrer - Optional referrer address, must match the swap's referrer
|
|
22
|
+
* @returns Promise<bigint> - Expected coins out (18 decimals)
|
|
23
|
+
*/
|
|
24
|
+
getBuyQuoteExactInput({ coinAddress, amountIn, positionManagerAddress, referrer, }: {
|
|
25
|
+
coinAddress: Address;
|
|
26
|
+
amountIn: bigint;
|
|
27
|
+
positionManagerAddress: Address;
|
|
28
|
+
referrer?: Address;
|
|
29
|
+
}): Promise<bigint>;
|
|
30
|
+
/**
|
|
31
|
+
* Quote for selling an exact amount of a coin for USDC
|
|
32
|
+
* @param coinAddress - The coin to sell
|
|
33
|
+
* @param amountIn - Exact coins to sell (18 decimals)
|
|
34
|
+
* @param positionManagerAddress - The PositionManager (pool hook)
|
|
35
|
+
* @param referrer - Optional referrer address, must match the swap's referrer
|
|
36
|
+
* @returns Promise<bigint> - Expected USDC out (6 decimals)
|
|
37
|
+
*/
|
|
38
|
+
getSellQuoteExactInput({ coinAddress, amountIn, positionManagerAddress, referrer, }: {
|
|
39
|
+
coinAddress: Address;
|
|
40
|
+
amountIn: bigint;
|
|
41
|
+
positionManagerAddress: Address;
|
|
42
|
+
referrer?: Address;
|
|
43
|
+
}): Promise<bigint>;
|
|
44
|
+
/**
|
|
45
|
+
* Quote for buying an exact amount of a coin, answering the USDC required
|
|
46
|
+
* @param coinAddress - The coin to buy
|
|
47
|
+
* @param coinOut - Exact coins to receive (18 decimals)
|
|
48
|
+
* @param positionManagerAddress - The PositionManager (pool hook)
|
|
49
|
+
* @param referrer - Optional referrer address, must match the swap's referrer
|
|
50
|
+
* @returns Promise<bigint> - Required USDC in (6 decimals)
|
|
51
|
+
*/
|
|
52
|
+
getBuyQuoteExactOutput({ coinAddress, coinOut, positionManagerAddress, referrer, }: {
|
|
53
|
+
coinAddress: Address;
|
|
54
|
+
coinOut: bigint;
|
|
55
|
+
positionManagerAddress: Address;
|
|
56
|
+
referrer?: Address;
|
|
57
|
+
}): Promise<bigint>;
|
|
58
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { type ReadContract, type Address, type Drift } from "@delvtech/drift";
|
|
2
|
+
import { QuoterAbi } from "../abi/Quoter.js";
|
|
3
|
+
export type QuoterABI = typeof QuoterAbi;
|
|
4
|
+
/**
|
|
5
|
+
* Client for the Uniswap V4Quoter. Every ubi.fun pool is a single hop between
|
|
6
|
+
* the coin and USDC (6 decimals) with the PositionManager as the hook, so all
|
|
7
|
+
* quotes are quoteExactInputSingle / quoteExactOutputSingle calls.
|
|
8
|
+
*
|
|
9
|
+
* Pass the SAME referrer you will swap with: the hook data changes how the fee
|
|
10
|
+
* is assigned, and a quote without it will not match execution.
|
|
11
|
+
*/
|
|
12
|
+
export declare class ReadQuoter {
|
|
13
|
+
chainId: number;
|
|
14
|
+
readonly contract: ReadContract<QuoterABI>;
|
|
15
|
+
constructor(chainId: number, address: Address, drift?: Drift);
|
|
16
|
+
/**
|
|
17
|
+
* Quote for buying a coin with an exact amount of USDC
|
|
18
|
+
* @param coinAddress - The coin to buy
|
|
19
|
+
* @param amountIn - Exact USDC to spend (6 decimals)
|
|
20
|
+
* @param positionManagerAddress - The PositionManager (pool hook)
|
|
21
|
+
* @param referrer - Optional referrer address, must match the swap's referrer
|
|
22
|
+
* @returns Promise<bigint> - Expected coins out (18 decimals)
|
|
23
|
+
*/
|
|
24
|
+
getBuyQuoteExactInput({ coinAddress, amountIn, positionManagerAddress, referrer, }: {
|
|
25
|
+
coinAddress: Address;
|
|
26
|
+
amountIn: bigint;
|
|
27
|
+
positionManagerAddress: Address;
|
|
28
|
+
referrer?: Address;
|
|
29
|
+
}): Promise<bigint>;
|
|
30
|
+
/**
|
|
31
|
+
* Quote for selling an exact amount of a coin for USDC
|
|
32
|
+
* @param coinAddress - The coin to sell
|
|
33
|
+
* @param amountIn - Exact coins to sell (18 decimals)
|
|
34
|
+
* @param positionManagerAddress - The PositionManager (pool hook)
|
|
35
|
+
* @param referrer - Optional referrer address, must match the swap's referrer
|
|
36
|
+
* @returns Promise<bigint> - Expected USDC out (6 decimals)
|
|
37
|
+
*/
|
|
38
|
+
getSellQuoteExactInput({ coinAddress, amountIn, positionManagerAddress, referrer, }: {
|
|
39
|
+
coinAddress: Address;
|
|
40
|
+
amountIn: bigint;
|
|
41
|
+
positionManagerAddress: Address;
|
|
42
|
+
referrer?: Address;
|
|
43
|
+
}): Promise<bigint>;
|
|
44
|
+
/**
|
|
45
|
+
* Quote for buying an exact amount of a coin, answering the USDC required
|
|
46
|
+
* @param coinAddress - The coin to buy
|
|
47
|
+
* @param coinOut - Exact coins to receive (18 decimals)
|
|
48
|
+
* @param positionManagerAddress - The PositionManager (pool hook)
|
|
49
|
+
* @param referrer - Optional referrer address, must match the swap's referrer
|
|
50
|
+
* @returns Promise<bigint> - Required USDC in (6 decimals)
|
|
51
|
+
*/
|
|
52
|
+
getBuyQuoteExactOutput({ coinAddress, coinOut, positionManagerAddress, referrer, }: {
|
|
53
|
+
coinAddress: Address;
|
|
54
|
+
coinOut: bigint;
|
|
55
|
+
positionManagerAddress: Address;
|
|
56
|
+
referrer?: Address;
|
|
57
|
+
}): Promise<bigint>;
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=QuoterClient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QuoterClient.d.ts","sourceRoot":"","sources":["../../src/clients/QuoterClient.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,OAAO,EACZ,KAAK,KAAK,EAEX,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAG1C,MAAM,MAAM,SAAS,GAAG,OAAO,SAAS,CAAC;AAEzC;;;;;;;GAOG;AACH,qBAAa,UAAU;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAgB,QAAQ,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC;gBAEtC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,GAAE,KAAqB;IAY3E;;;;;;;OAOG;IACG,qBAAqB,CAAC,EAC1B,WAAW,EACX,QAAQ,EACR,sBAAsB,EACtB,QAAQ,GACT,EAAE;QACD,WAAW,EAAE,OAAO,CAAC;QACrB,QAAQ,EAAE,MAAM,CAAC;QACjB,sBAAsB,EAAE,OAAO,CAAC;QAChC,QAAQ,CAAC,EAAE,OAAO,CAAC;KACpB;IAaD;;;;;;;OAOG;IACG,sBAAsB,CAAC,EAC3B,WAAW,EACX,QAAQ,EACR,sBAAsB,EACtB,QAAQ,GACT,EAAE;QACD,WAAW,EAAE,OAAO,CAAC;QACrB,QAAQ,EAAE,MAAM,CAAC;QACjB,sBAAsB,EAAE,OAAO,CAAC;QAChC,QAAQ,CAAC,EAAE,OAAO,CAAC;KACpB;IAaD;;;;;;;OAOG;IACG,sBAAsB,CAAC,EAC3B,WAAW,EACX,OAAO,EACP,sBAAsB,EACtB,QAAQ,GACT,EAAE;QACD,WAAW,EAAE,OAAO,CAAC;QACrB,OAAO,EAAE,MAAM,CAAC;QAChB,sBAAsB,EAAE,OAAO,CAAC;QAChC,QAAQ,CAAC,EAAE,OAAO,CAAC;KACpB;CAYF"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { type ReadContract, type Address, type Drift, type ReadWriteContract, type ReadWriteAdapter } from "@delvtech/drift";
|
|
2
|
+
import { ReferralEscrowAbi } from "../abi/ReferralEscrow.cjs";
|
|
3
|
+
export type ReferralEscrowABI = typeof ReferralEscrowAbi;
|
|
4
|
+
/**
|
|
5
|
+
* Client for interacting with the ReferralEscrow contract in read-only mode
|
|
6
|
+
* Provides methods to query token allocations
|
|
7
|
+
*/
|
|
8
|
+
export declare class ReadReferralEscrow {
|
|
9
|
+
readonly contract: ReadContract<ReferralEscrowABI>;
|
|
10
|
+
/**
|
|
11
|
+
* Creates a new ReadReferralEscrow instance
|
|
12
|
+
* @param address - The address of the ReferralEscrow contract
|
|
13
|
+
* @param drift - Optional drift instance for contract interactions (creates new instance if not provided)
|
|
14
|
+
* @throws Error if address is not provided
|
|
15
|
+
*/
|
|
16
|
+
constructor(address: Address, drift?: Drift);
|
|
17
|
+
/**
|
|
18
|
+
* Gets the token allocation for a specific user and token
|
|
19
|
+
* @param user - The address of the user to check
|
|
20
|
+
* @param token - The address of the token
|
|
21
|
+
* @returns Promise<bigint> - The allocated token amount
|
|
22
|
+
*/
|
|
23
|
+
allocations(user: Address, token: Address): Promise<bigint>;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Extended client for interacting with the ReferralEscrow contract with write capabilities
|
|
27
|
+
* Provides methods to claim tokens
|
|
28
|
+
*/
|
|
29
|
+
export declare class ReadWriteReferralEscrow extends ReadReferralEscrow {
|
|
30
|
+
contract: ReadWriteContract<ReferralEscrowABI>;
|
|
31
|
+
constructor(address: Address, drift?: Drift<ReadWriteAdapter>);
|
|
32
|
+
/**
|
|
33
|
+
* Claims tokens for a recipient
|
|
34
|
+
* @param tokens - Array of token addresses to claim
|
|
35
|
+
* @param recipient - The address to receive the claimed tokens
|
|
36
|
+
* @returns Promise<void>
|
|
37
|
+
*/
|
|
38
|
+
claimTokens(tokens: Address[], recipient: Address): Promise<`0x${string}`>;
|
|
39
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { type ReadContract, type Address, type Drift, type ReadWriteContract, type ReadWriteAdapter } from "@delvtech/drift";
|
|
2
|
+
import { ReferralEscrowAbi } from "../abi/ReferralEscrow.js";
|
|
3
|
+
export type ReferralEscrowABI = typeof ReferralEscrowAbi;
|
|
4
|
+
/**
|
|
5
|
+
* Client for interacting with the ReferralEscrow contract in read-only mode
|
|
6
|
+
* Provides methods to query token allocations
|
|
7
|
+
*/
|
|
8
|
+
export declare class ReadReferralEscrow {
|
|
9
|
+
readonly contract: ReadContract<ReferralEscrowABI>;
|
|
10
|
+
/**
|
|
11
|
+
* Creates a new ReadReferralEscrow instance
|
|
12
|
+
* @param address - The address of the ReferralEscrow contract
|
|
13
|
+
* @param drift - Optional drift instance for contract interactions (creates new instance if not provided)
|
|
14
|
+
* @throws Error if address is not provided
|
|
15
|
+
*/
|
|
16
|
+
constructor(address: Address, drift?: Drift);
|
|
17
|
+
/**
|
|
18
|
+
* Gets the token allocation for a specific user and token
|
|
19
|
+
* @param user - The address of the user to check
|
|
20
|
+
* @param token - The address of the token
|
|
21
|
+
* @returns Promise<bigint> - The allocated token amount
|
|
22
|
+
*/
|
|
23
|
+
allocations(user: Address, token: Address): Promise<bigint>;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Extended client for interacting with the ReferralEscrow contract with write capabilities
|
|
27
|
+
* Provides methods to claim tokens
|
|
28
|
+
*/
|
|
29
|
+
export declare class ReadWriteReferralEscrow extends ReadReferralEscrow {
|
|
30
|
+
contract: ReadWriteContract<ReferralEscrowABI>;
|
|
31
|
+
constructor(address: Address, drift?: Drift<ReadWriteAdapter>);
|
|
32
|
+
/**
|
|
33
|
+
* Claims tokens for a recipient
|
|
34
|
+
* @param tokens - Array of token addresses to claim
|
|
35
|
+
* @param recipient - The address to receive the claimed tokens
|
|
36
|
+
* @returns Promise<void>
|
|
37
|
+
*/
|
|
38
|
+
claimTokens(tokens: Address[], recipient: Address): Promise<`0x${string}`>;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=ReferralEscrowClient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReferralEscrowClient.d.ts","sourceRoot":"","sources":["../../src/clients/ReferralEscrowClient.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,OAAO,EACZ,KAAK,KAAK,EACV,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EAEtB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1D,MAAM,MAAM,iBAAiB,GAAG,OAAO,iBAAiB,CAAC;AAEzD;;;GAGG;AACH,qBAAa,kBAAkB;IAC7B,SAAgB,QAAQ,EAAE,YAAY,CAAC,iBAAiB,CAAC,CAAC;IAE1D;;;;;OAKG;gBACS,OAAO,EAAE,OAAO,EAAE,KAAK,GAAE,KAAqB;IAW1D;;;;;OAKG;IACH,WAAW,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO;CAM1C;AAED;;;GAGG;AACH,qBAAa,uBAAwB,SAAQ,kBAAkB;IACrD,QAAQ,EAAE,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;gBAGrD,OAAO,EAAE,OAAO,EAChB,KAAK,GAAE,KAAK,CAAC,gBAAgB,CAAiB;IAKhD;;;;;OAKG;IACH,WAAW,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE,SAAS,EAAE,OAAO;CAMlD"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { type ReadContract, type Address, type Drift, type ReadWriteContract, type ReadWriteAdapter } from "@delvtech/drift";
|
|
2
|
+
import { TreasuryManagerAbi } from "../abi/TreasuryManager.cjs";
|
|
3
|
+
export type TreasuryManagerABI = typeof TreasuryManagerAbi;
|
|
4
|
+
export type FlaunchToken = {
|
|
5
|
+
flaunch: Address;
|
|
6
|
+
tokenId: bigint;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Client for interacting with the TreasuryManager contract in read-only mode
|
|
10
|
+
* Provides methods to query permissions and manager owner
|
|
11
|
+
*/
|
|
12
|
+
export declare class ReadTreasuryManager {
|
|
13
|
+
readonly contract: ReadContract<TreasuryManagerABI>;
|
|
14
|
+
/**
|
|
15
|
+
* Creates a new ReadTreasuryManager instance
|
|
16
|
+
* @param address - The address of the TreasuryManager contract
|
|
17
|
+
* @param drift - Optional drift instance for contract interactions (creates new instance if not provided)
|
|
18
|
+
* @throws Error if address is not provided
|
|
19
|
+
*/
|
|
20
|
+
constructor(address: Address, drift?: Drift);
|
|
21
|
+
/**
|
|
22
|
+
* Gets the permissions contract address
|
|
23
|
+
* @returns Promise<Address> - The address of the permissions contract
|
|
24
|
+
*/
|
|
25
|
+
permissions(): Promise<`0x${string}`>;
|
|
26
|
+
/**
|
|
27
|
+
* Gets the manager owner address
|
|
28
|
+
* @returns Promise<Address> - The address of the manager owner
|
|
29
|
+
*/
|
|
30
|
+
managerOwner(): Promise<`0x${string}`>;
|
|
31
|
+
/**
|
|
32
|
+
* Gets a recipient's claimable USDC balance inside this manager (e.g. a
|
|
33
|
+
* split recipient's accrued share)
|
|
34
|
+
* @param recipient - The address to check
|
|
35
|
+
* @returns Promise<bigint> - The claimable balance (USDC, 6 decimals)
|
|
36
|
+
*/
|
|
37
|
+
balances(recipient: Address): Promise<bigint>;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Extended client for interacting with the TreasuryManager contract with write capabilities
|
|
41
|
+
* Provides methods to deposit tokens, set permissions, and transfer ownership
|
|
42
|
+
*/
|
|
43
|
+
export declare class ReadWriteTreasuryManager extends ReadTreasuryManager {
|
|
44
|
+
contract: ReadWriteContract<TreasuryManagerABI>;
|
|
45
|
+
constructor(address: Address, drift?: Drift<ReadWriteAdapter>);
|
|
46
|
+
/**
|
|
47
|
+
* Deposits a flaunch token to the treasury
|
|
48
|
+
* @param flaunchToken - The flaunch token to deposit
|
|
49
|
+
* @param creator - The address of the creator
|
|
50
|
+
* @param data - Additional data for the deposit
|
|
51
|
+
* @returns Promise<void>
|
|
52
|
+
*/
|
|
53
|
+
deposit(flaunchToken: FlaunchToken, creator: Address, data: `0x${string}`): Promise<`0x${string}`>;
|
|
54
|
+
/**
|
|
55
|
+
* Sets the permissions contract address
|
|
56
|
+
* @param permissions - The address of the new permissions contract
|
|
57
|
+
* @returns Promise<void>
|
|
58
|
+
*/
|
|
59
|
+
setPermissions(permissions: Address): Promise<`0x${string}`>;
|
|
60
|
+
/**
|
|
61
|
+
* Transfers the manager ownership to a new address
|
|
62
|
+
* @param newManagerOwner - The address of the new manager owner
|
|
63
|
+
* @returns Promise<void>
|
|
64
|
+
*/
|
|
65
|
+
transferManagerOwnership(newManagerOwner: Address): Promise<`0x${string}`>;
|
|
66
|
+
/**
|
|
67
|
+
* Claims the caller's accrued share from this manager, paid out as USDC
|
|
68
|
+
* @returns Transaction response
|
|
69
|
+
*/
|
|
70
|
+
claim(): Promise<`0x${string}`>;
|
|
71
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { type ReadContract, type Address, type Drift, type ReadWriteContract, type ReadWriteAdapter } from "@delvtech/drift";
|
|
2
|
+
import { TreasuryManagerAbi } from "../abi/TreasuryManager.js";
|
|
3
|
+
export type TreasuryManagerABI = typeof TreasuryManagerAbi;
|
|
4
|
+
export type FlaunchToken = {
|
|
5
|
+
flaunch: Address;
|
|
6
|
+
tokenId: bigint;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Client for interacting with the TreasuryManager contract in read-only mode
|
|
10
|
+
* Provides methods to query permissions and manager owner
|
|
11
|
+
*/
|
|
12
|
+
export declare class ReadTreasuryManager {
|
|
13
|
+
readonly contract: ReadContract<TreasuryManagerABI>;
|
|
14
|
+
/**
|
|
15
|
+
* Creates a new ReadTreasuryManager instance
|
|
16
|
+
* @param address - The address of the TreasuryManager contract
|
|
17
|
+
* @param drift - Optional drift instance for contract interactions (creates new instance if not provided)
|
|
18
|
+
* @throws Error if address is not provided
|
|
19
|
+
*/
|
|
20
|
+
constructor(address: Address, drift?: Drift);
|
|
21
|
+
/**
|
|
22
|
+
* Gets the permissions contract address
|
|
23
|
+
* @returns Promise<Address> - The address of the permissions contract
|
|
24
|
+
*/
|
|
25
|
+
permissions(): Promise<`0x${string}`>;
|
|
26
|
+
/**
|
|
27
|
+
* Gets the manager owner address
|
|
28
|
+
* @returns Promise<Address> - The address of the manager owner
|
|
29
|
+
*/
|
|
30
|
+
managerOwner(): Promise<`0x${string}`>;
|
|
31
|
+
/**
|
|
32
|
+
* Gets a recipient's claimable USDC balance inside this manager (e.g. a
|
|
33
|
+
* split recipient's accrued share)
|
|
34
|
+
* @param recipient - The address to check
|
|
35
|
+
* @returns Promise<bigint> - The claimable balance (USDC, 6 decimals)
|
|
36
|
+
*/
|
|
37
|
+
balances(recipient: Address): Promise<bigint>;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Extended client for interacting with the TreasuryManager contract with write capabilities
|
|
41
|
+
* Provides methods to deposit tokens, set permissions, and transfer ownership
|
|
42
|
+
*/
|
|
43
|
+
export declare class ReadWriteTreasuryManager extends ReadTreasuryManager {
|
|
44
|
+
contract: ReadWriteContract<TreasuryManagerABI>;
|
|
45
|
+
constructor(address: Address, drift?: Drift<ReadWriteAdapter>);
|
|
46
|
+
/**
|
|
47
|
+
* Deposits a flaunch token to the treasury
|
|
48
|
+
* @param flaunchToken - The flaunch token to deposit
|
|
49
|
+
* @param creator - The address of the creator
|
|
50
|
+
* @param data - Additional data for the deposit
|
|
51
|
+
* @returns Promise<void>
|
|
52
|
+
*/
|
|
53
|
+
deposit(flaunchToken: FlaunchToken, creator: Address, data: `0x${string}`): Promise<`0x${string}`>;
|
|
54
|
+
/**
|
|
55
|
+
* Sets the permissions contract address
|
|
56
|
+
* @param permissions - The address of the new permissions contract
|
|
57
|
+
* @returns Promise<void>
|
|
58
|
+
*/
|
|
59
|
+
setPermissions(permissions: Address): Promise<`0x${string}`>;
|
|
60
|
+
/**
|
|
61
|
+
* Transfers the manager ownership to a new address
|
|
62
|
+
* @param newManagerOwner - The address of the new manager owner
|
|
63
|
+
* @returns Promise<void>
|
|
64
|
+
*/
|
|
65
|
+
transferManagerOwnership(newManagerOwner: Address): Promise<`0x${string}`>;
|
|
66
|
+
/**
|
|
67
|
+
* Claims the caller's accrued share from this manager, paid out as USDC
|
|
68
|
+
* @returns Transaction response
|
|
69
|
+
*/
|
|
70
|
+
claim(): Promise<`0x${string}`>;
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=TreasuryManagerClient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TreasuryManagerClient.d.ts","sourceRoot":"","sources":["../../src/clients/TreasuryManagerClient.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,OAAO,EACZ,KAAK,KAAK,EACV,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EAEtB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE5D,MAAM,MAAM,kBAAkB,GAAG,OAAO,kBAAkB,CAAC;AAE3D,MAAM,MAAM,YAAY,GAAG;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;;GAGG;AACH,qBAAa,mBAAmB;IAC9B,SAAgB,QAAQ,EAAE,YAAY,CAAC,kBAAkB,CAAC,CAAC;IAE3D;;;;;OAKG;gBACS,OAAO,EAAE,OAAO,EAAE,KAAK,GAAE,KAAqB;IAW1D;;;OAGG;IACH,WAAW;IAIX;;;OAGG;IACH,YAAY;IAIZ;;;;;OAKG;IACH,QAAQ,CAAC,SAAS,EAAE,OAAO;CAK5B;AAED;;;GAGG;AACH,qBAAa,wBAAyB,SAAQ,mBAAmB;IACvD,QAAQ,EAAE,iBAAiB,CAAC,kBAAkB,CAAC,CAAC;gBAGtD,OAAO,EAAE,OAAO,EAChB,KAAK,GAAE,KAAK,CAAC,gBAAgB,CAAiB;IAKhD;;;;;;OAMG;IACH,OAAO,CAAC,YAAY,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,MAAM,EAAE;IAQzE;;;;OAIG;IACH,cAAc,CAAC,WAAW,EAAE,OAAO;IAMnC;;;;OAIG;IACH,wBAAwB,CAAC,eAAe,EAAE,OAAO;IAMjD;;;OAGG;IACH,KAAK;CAGN"}
|