@spicenet-io/spiceflow-ui 4.7.8 → 4.7.9

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.
@@ -17,6 +17,7 @@ export interface SatsumaVenueConfig {
17
17
  quoterV2: Address;
18
18
  chainIds?: number[];
19
19
  feeTiers?: number[];
20
+ hubCurrencies?: Address[];
20
21
  }
21
22
  export declare const SATSUMA_CITREA_CONFIG: SatsumaVenueConfig;
22
23
  export declare const UNIV3_BASE_CONFIG: SatsumaVenueConfig;
@@ -0,0 +1,6 @@
1
+ import { type Address } from "viem";
2
+ import type { LiquidityVenue } from "./liquidityVenues";
3
+ import type { ExactOutputVenue } from "../swapQuotes";
4
+ export declare function getWrappedNative(chainId: number): Address | undefined;
5
+ export declare function withNativeWrapping(venue: LiquidityVenue): LiquidityVenue;
6
+ export declare function withNativeWrappingExactOutput(venue: ExactOutputVenue): ExactOutputVenue;
@@ -1,6 +1,7 @@
1
- import type { Address } from "viem";
1
+ import { type Address } from "viem";
2
2
  import type { UniV3SwapConfig, UniV3QuoteResult, UniV3QuoteParams } from "@spicenet-io/spiceflow-core";
3
3
  export type { UniV3SwapConfig, UniV3QuoteParams, UniV3QuoteResult };
4
+ export declare const DEFAULT_UNIV3_FEE_TIERS: number[];
4
5
  export interface UniV3ExactOutputQuoteParams {
5
6
  tokenIn: Address;
6
7
  tokenOut: Address;
@@ -14,13 +15,30 @@ export interface UniV3ExactOutputQuoteResult {
14
15
  sqrtPriceX96After: bigint;
15
16
  gasEstimate: bigint;
16
17
  }
18
+ export type UniV3Route = {
19
+ fee: number;
20
+ path?: `0x${string}`;
21
+ };
22
+ export declare function buildUniV3HubPaths(tokenIn: Address, tokenOut: Address, hubs: Address[], feeTiers: number[], direction: "in" | "out"): `0x${string}`[];
23
+ export declare function reverseUniV3Path(path: `0x${string}`): `0x${string}`;
24
+ export declare function encodeUniV3ExactOutputCall(params: {
25
+ config: UniV3SwapConfig;
26
+ route: UniV3Route;
27
+ tokenIn: Address;
28
+ tokenOut: Address;
29
+ recipient: Address;
30
+ amountOut: bigint;
31
+ amountInMaximum: bigint;
32
+ }): {
33
+ to: Address;
34
+ value: bigint;
35
+ data: `0x${string}`;
36
+ };
17
37
  export declare function getBestUniV3Quote(params: Omit<UniV3QuoteParams, "fee"> & {
18
38
  feeTiers?: number[];
19
- }): Promise<UniV3QuoteResult & {
20
- fee: number;
21
- }>;
39
+ hubs?: Address[];
40
+ }): Promise<UniV3QuoteResult & UniV3Route>;
22
41
  export declare function getBestUniV3ExactOutputQuote(params: UniV3ExactOutputQuoteParams & {
23
42
  feeTiers?: number[];
24
- }): Promise<UniV3ExactOutputQuoteResult & {
25
- fee: number;
26
- }>;
43
+ hubs?: Address[];
44
+ }): Promise<UniV3ExactOutputQuoteResult & UniV3Route>;
@@ -14,5 +14,39 @@ export interface UniV4VenueConfig extends UniV4SwapConfig {
14
14
  export declare const V4_NATIVE_CURRENCY: Address;
15
15
  export declare const UNIV4_BASE_CONFIG: UniV4VenueConfig;
16
16
  export declare const UNIV4_ROBINHOOD_CONFIG: UniV4VenueConfig;
17
+ type PoolKey = {
18
+ currency0: Address;
19
+ currency1: Address;
20
+ fee: number;
21
+ tickSpacing: number;
22
+ hooks: Address;
23
+ };
24
+ type PathKey = {
25
+ intermediateCurrency: Address;
26
+ fee: number;
27
+ tickSpacing: number;
28
+ hooks: Address;
29
+ hookData: `0x${string}`;
30
+ };
31
+ type Candidate = {
32
+ kind: "single";
33
+ poolKey: PoolKey;
34
+ zeroForOne: boolean;
35
+ } | {
36
+ kind: "multi";
37
+ path: PathKey[];
38
+ };
39
+ export declare function encodeV4Execute(params: {
40
+ candidate: Candidate;
41
+ direction: "in" | "out";
42
+ currencyIn: Address;
43
+ currencyOut: Address;
44
+ recipient: Address;
45
+ exactAmount: bigint;
46
+ limitAmount: bigint;
47
+ deadline: bigint;
48
+ sweepNativeTo?: Address;
49
+ }): `0x${string}`;
17
50
  export declare function createUniV4Venue(config: UniV4VenueConfig): LiquidityVenue;
18
51
  export declare function createUniV4ExactOutputVenue(config: UniV4VenueConfig): ExactOutputVenue;
52
+ export {};
@@ -1,5 +1,5 @@
1
- import type { Address } from "viem";
2
- import type { Call } from "@spicenet-io/spiceflow-core";
1
+ import { type Address } from "viem";
2
+ import { type Call } from "@spicenet-io/spiceflow-core";
3
3
  export interface ExactOutputSwapIntent {
4
4
  tokenIn: Address;
5
5
  tokenOut: Address;
@@ -23,6 +23,7 @@ export interface ExactOutputRegistry {
23
23
  getQuote: (intent: ExactOutputSwapIntent, chainId: number, recipient: Address) => Promise<ResolvedExactOutputSwap>;
24
24
  venues: ExactOutputVenue[];
25
25
  }
26
+ export declare function withCallerApprove(venue: ExactOutputVenue): ExactOutputVenue;
26
27
  export declare function createExactOutputRegistry(config?: {
27
28
  customVenues?: ExactOutputVenue[];
28
29
  }): ExactOutputRegistry;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spicenet-io/spiceflow-ui",
3
- "version": "4.7.8",
3
+ "version": "4.7.9",
4
4
  "description": "Spiceflow UI SDK",
5
5
  "type": "module",
6
6
  "packageManager": "bun@1.3.13",