@clawnch/clawncher-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.
Files changed (98) hide show
  1. package/README.md +603 -0
  2. package/dist/abis.d.ts +935 -0
  3. package/dist/abis.d.ts.map +1 -0
  4. package/dist/abis.js +486 -0
  5. package/dist/abis.js.map +1 -0
  6. package/dist/addresses.d.ts +51 -0
  7. package/dist/addresses.d.ts.map +1 -0
  8. package/dist/addresses.js +80 -0
  9. package/dist/addresses.js.map +1 -0
  10. package/dist/api-deployer-types.d.ts +165 -0
  11. package/dist/api-deployer-types.d.ts.map +1 -0
  12. package/dist/api-deployer-types.js +9 -0
  13. package/dist/api-deployer-types.js.map +1 -0
  14. package/dist/api-deployer.d.ts +114 -0
  15. package/dist/api-deployer.d.ts.map +1 -0
  16. package/dist/api-deployer.js +309 -0
  17. package/dist/api-deployer.js.map +1 -0
  18. package/dist/claimer.d.ts +197 -0
  19. package/dist/claimer.d.ts.map +1 -0
  20. package/dist/claimer.js +311 -0
  21. package/dist/claimer.js.map +1 -0
  22. package/dist/deployer.d.ts +229 -0
  23. package/dist/deployer.d.ts.map +1 -0
  24. package/dist/deployer.js +305 -0
  25. package/dist/deployer.js.map +1 -0
  26. package/dist/erc8004-types.d.ts +94 -0
  27. package/dist/erc8004-types.d.ts.map +1 -0
  28. package/dist/erc8004-types.js +8 -0
  29. package/dist/erc8004-types.js.map +1 -0
  30. package/dist/errors.d.ts +62 -0
  31. package/dist/errors.d.ts.map +1 -0
  32. package/dist/errors.js +75 -0
  33. package/dist/errors.js.map +1 -0
  34. package/dist/index.d.ts +204 -0
  35. package/dist/index.d.ts.map +1 -0
  36. package/dist/index.js +358 -0
  37. package/dist/index.js.map +1 -0
  38. package/dist/liquidity-types.d.ts +198 -0
  39. package/dist/liquidity-types.d.ts.map +1 -0
  40. package/dist/liquidity-types.js +8 -0
  41. package/dist/liquidity-types.js.map +1 -0
  42. package/dist/liquidity.d.ts +111 -0
  43. package/dist/liquidity.d.ts.map +1 -0
  44. package/dist/liquidity.js +608 -0
  45. package/dist/liquidity.js.map +1 -0
  46. package/dist/molten-types.d.ts +282 -0
  47. package/dist/molten-types.d.ts.map +1 -0
  48. package/dist/molten-types.js +8 -0
  49. package/dist/molten-types.js.map +1 -0
  50. package/dist/molten.d.ts +336 -0
  51. package/dist/molten.d.ts.map +1 -0
  52. package/dist/molten.js +560 -0
  53. package/dist/molten.js.map +1 -0
  54. package/dist/portfolio.d.ts +129 -0
  55. package/dist/portfolio.d.ts.map +1 -0
  56. package/dist/portfolio.js +218 -0
  57. package/dist/portfolio.js.map +1 -0
  58. package/dist/reader.d.ts +249 -0
  59. package/dist/reader.d.ts.map +1 -0
  60. package/dist/reader.js +488 -0
  61. package/dist/reader.js.map +1 -0
  62. package/dist/swap-types.d.ts +159 -0
  63. package/dist/swap-types.d.ts.map +1 -0
  64. package/dist/swap-types.js +22 -0
  65. package/dist/swap-types.js.map +1 -0
  66. package/dist/swap.d.ts +762 -0
  67. package/dist/swap.d.ts.map +1 -0
  68. package/dist/swap.js +345 -0
  69. package/dist/swap.js.map +1 -0
  70. package/dist/token-verification-data.d.ts +4 -0
  71. package/dist/token-verification-data.d.ts.map +1 -0
  72. package/dist/token-verification-data.js +6 -0
  73. package/dist/token-verification-data.js.map +1 -0
  74. package/dist/types.d.ts +244 -0
  75. package/dist/types.d.ts.map +1 -0
  76. package/dist/types.js +5 -0
  77. package/dist/types.js.map +1 -0
  78. package/dist/uniswap-abis.d.ts +470 -0
  79. package/dist/uniswap-abis.d.ts.map +1 -0
  80. package/dist/uniswap-abis.js +322 -0
  81. package/dist/uniswap-abis.js.map +1 -0
  82. package/dist/uniswap-addresses.d.ts +38 -0
  83. package/dist/uniswap-addresses.d.ts.map +1 -0
  84. package/dist/uniswap-addresses.js +67 -0
  85. package/dist/uniswap-addresses.js.map +1 -0
  86. package/dist/vanity.d.ts +115 -0
  87. package/dist/vanity.d.ts.map +1 -0
  88. package/dist/vanity.js +166 -0
  89. package/dist/vanity.js.map +1 -0
  90. package/dist/verify.d.ts +88 -0
  91. package/dist/verify.d.ts.map +1 -0
  92. package/dist/verify.js +181 -0
  93. package/dist/verify.js.map +1 -0
  94. package/dist/watcher.d.ts +112 -0
  95. package/dist/watcher.d.ts.map +1 -0
  96. package/dist/watcher.js +132 -0
  97. package/dist/watcher.js.map +1 -0
  98. package/package.json +59 -0
@@ -0,0 +1,111 @@
1
+ /**
2
+ * ClawnchLiquidity - Uniswap V3 & V4 Liquidity Management
3
+ *
4
+ * Manages liquidity positions on both Uniswap V3 and V4 pools on Base.
5
+ * Supports minting, adding/removing liquidity, and fee collection.
6
+ *
7
+ * V4 uses the PositionManager with multicall + command encoding.
8
+ * V3 uses the NonfungiblePositionManager directly.
9
+ *
10
+ * @example
11
+ * ```typescript
12
+ * import { ClawnchLiquidity } from '@clawnch/clawncher-sdk';
13
+ * import { createWalletClient, createPublicClient, http } from 'viem';
14
+ * import { privateKeyToAccount } from 'viem/accounts';
15
+ * import { base } from 'viem/chains';
16
+ *
17
+ * const account = privateKeyToAccount('0x...');
18
+ * const wallet = createWalletClient({ account, chain: base, transport: http() });
19
+ * const publicClient = createPublicClient({ chain: base, transport: http() });
20
+ *
21
+ * const liquidity = new ClawnchLiquidity({ wallet, publicClient });
22
+ *
23
+ * // Read a V3 position
24
+ * const pos = await liquidity.v3GetPosition(123456n);
25
+ * console.log(pos.liquidity, pos.unclaimedFees);
26
+ * ```
27
+ */
28
+ import { type Address, type Hex, type Hash } from 'viem';
29
+ import type { LiquidityConfig, V4PoolKey, V4PoolState, V4MintParams, V3MintParams, V3AddLiquidityParams, V3RemoveLiquidityParams, V3CollectFeesParams, PositionInfo, MintResult, ModifyLiquidityResult, CollectFeesResult } from './liquidity-types.js';
30
+ export type { LiquidityConfig, V4PoolKey, V4PoolState, V4MintParams, V4AddLiquidityParams, V4RemoveLiquidityParams, V4CollectFeesParams, V3MintParams, V3AddLiquidityParams, V3RemoveLiquidityParams, V3CollectFeesParams, PositionInfo, MintResult, ModifyLiquidityResult, CollectFeesResult, } from './liquidity-types.js';
31
+ export declare class ClawnchLiquidity {
32
+ private readonly wallet;
33
+ private readonly publicClient;
34
+ private readonly network;
35
+ constructor(config: LiquidityConfig);
36
+ private getChain;
37
+ private getWalletAddress;
38
+ /**
39
+ * Approve an ERC20 token for a spender if current allowance is insufficient
40
+ */
41
+ private ensureApproval;
42
+ /**
43
+ * Get V4 pool state via StateView
44
+ */
45
+ v4GetPoolState(poolKey: V4PoolKey): Promise<V4PoolState>;
46
+ /**
47
+ * Get V4 position details from a token ID
48
+ */
49
+ v4GetPosition(tokenId: bigint): Promise<PositionInfo>;
50
+ /**
51
+ * Mint a new V4 liquidity position
52
+ *
53
+ * Note: For full V4 SDK integration (Pool/Position math, calldata encoding),
54
+ * the @uniswap/v4-sdk package is required. This method provides a lower-level
55
+ * interface using direct contract calls for environments where the Uniswap SDK
56
+ * may not be available.
57
+ *
58
+ * For production use, consider using the Uniswap V4 SDK's
59
+ * V4PositionManager.addCallParameters() for proper slippage calculation.
60
+ */
61
+ v4MintPosition(params: V4MintParams): Promise<MintResult>;
62
+ /**
63
+ * Execute a V4 PositionManager multicall with pre-built calldata
64
+ *
65
+ * Use this with calldata generated by @uniswap/v4-sdk's
66
+ * V4PositionManager.addCallParameters(), removeCallParameters(), or
67
+ * collectCallParameters().
68
+ *
69
+ * @param calldata - Encoded calldata bytes from V4 SDK
70
+ * @param value - ETH value to send (for native ETH positions)
71
+ * @returns Transaction hash and receipt
72
+ */
73
+ v4ExecuteMulticall(calldata: Hex, value?: bigint): Promise<{
74
+ txHash: Hash;
75
+ receipt: any;
76
+ }>;
77
+ /**
78
+ * Get V3 position details from a token ID
79
+ */
80
+ v3GetPosition(tokenId: bigint): Promise<PositionInfo>;
81
+ /**
82
+ * List all V3 positions for a wallet
83
+ */
84
+ v3GetPositionsForWallet(wallet?: Address): Promise<PositionInfo[]>;
85
+ /**
86
+ * Mint a new V3 liquidity position
87
+ */
88
+ v3MintPosition(params: V3MintParams): Promise<MintResult>;
89
+ /**
90
+ * Add liquidity to an existing V3 position
91
+ */
92
+ v3AddLiquidity(tokenId: bigint, params: V3AddLiquidityParams): Promise<ModifyLiquidityResult>;
93
+ /**
94
+ * Remove liquidity from a V3 position
95
+ *
96
+ * This decreases liquidity and then collects the withdrawn tokens.
97
+ * If removing 100% and burnToken is true, also burns the NFT.
98
+ */
99
+ v3RemoveLiquidity(tokenId: bigint, params: V3RemoveLiquidityParams): Promise<ModifyLiquidityResult>;
100
+ /**
101
+ * Collect unclaimed fees from a V3 position
102
+ *
103
+ * This calls collect() with max amounts to sweep all available fees.
104
+ */
105
+ v3CollectFees(tokenId: bigint, params?: V3CollectFeesParams): Promise<CollectFeesResult>;
106
+ /**
107
+ * Get all V3 positions for a wallet, optionally filtered by a specific token
108
+ */
109
+ getPositionsForToken(tokenAddress: Address, wallet?: Address): Promise<PositionInfo[]>;
110
+ }
111
+ //# sourceMappingURL=liquidity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"liquidity.d.ts","sourceRoot":"","sources":["../src/liquidity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,GAAG,EACR,KAAK,IAAI,EAKV,MAAM,MAAM,CAAC;AAKd,OAAO,KAAK,EACV,eAAe,EACf,SAAS,EACT,WAAW,EACX,YAAY,EAIZ,YAAY,EACZ,oBAAoB,EACpB,uBAAuB,EACvB,mBAAmB,EACnB,YAAY,EACZ,UAAU,EACV,qBAAqB,EACrB,iBAAiB,EAClB,MAAM,sBAAsB,CAAC;AAG9B,YAAY,EACV,eAAe,EACf,SAAS,EACT,WAAW,EACX,YAAY,EACZ,oBAAoB,EACpB,uBAAuB,EACvB,mBAAmB,EACnB,YAAY,EACZ,oBAAoB,EACpB,uBAAuB,EACvB,mBAAmB,EACnB,YAAY,EACZ,UAAU,EACV,qBAAq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