@spicenet-io/spiceflow-ui 4.0.13-next.1 → 4.0.13

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.
@@ -22,7 +22,6 @@ export interface Asset {
22
22
  decimals?: number;
23
23
  }>;
24
24
  isUniversal?: boolean;
25
- _wrapFromNative?: boolean;
26
25
  }
27
26
  export interface SelectedAsset {
28
27
  asset: Asset;
@@ -71,6 +71,7 @@ export interface DepositModalProps {
71
71
  sourceChain?: string;
72
72
  txHash?: string;
73
73
  }) => void;
74
+ onDepositError?: (error: string) => void;
74
75
  onViewAllAssets?: () => void;
75
76
  }
76
77
  export interface EscrowRecovery {
@@ -102,6 +103,7 @@ export interface SpiceDepositProps {
102
103
  sourceChain?: string;
103
104
  txHash?: string;
104
105
  }) => void;
106
+ onDepositError?: (error: string) => void;
105
107
  skipRecovery?: boolean;
106
108
  }
107
109
  export interface SelectTokenModalProps {
@@ -39,6 +39,7 @@ export interface SpiceLockModalProps {
39
39
  votingPowerEstimate?: (amount: number, months: number) => number;
40
40
  escrowAddress?: Address;
41
41
  onLockSuccess?: (txHash?: string) => void;
42
+ onLockError?: (error: string) => void;
42
43
  onLockExecute?: (ctx: LockExecuteContext) => Promise<string | void>;
43
44
  sourceToDestinationConversionRate?: number;
44
45
  estimatedOutputAmount?: string;
@@ -1,6 +1,5 @@
1
1
  import { type Address } from "viem";
2
2
  import type { Call, SwapIntent, BatchEntry, ResolvedSwap } from "@spicenet-io/spiceflow-core";
3
- import { type AlgebraSwapConfig } from "./algebra";
4
3
  import type { ExactOutputVenue } from "../swapQuotes";
5
4
  export type { ResolvedSwap };
6
5
  export declare function isSwapIntent(entry: BatchEntry): entry is SwapIntent;
@@ -25,9 +24,6 @@ export declare const SATSUMA_CITREA_CONFIG: SatsumaVenueConfig;
25
24
  export declare const UNIV3_BASE_CONFIG: SatsumaVenueConfig;
26
25
  export declare function createSatsumaVenue(config: SatsumaVenueConfig): LiquidityVenue;
27
26
  export declare function createSatsumaExactOutputVenue(config: SatsumaVenueConfig): ExactOutputVenue;
28
- export declare const ALGEBRA_CITREA_CONFIG: AlgebraSwapConfig;
29
- export declare function createAlgebraVenue(config: AlgebraSwapConfig): LiquidityVenue;
30
- export declare function createAlgebraExactOutputVenue(config: AlgebraSwapConfig): ExactOutputVenue;
31
27
  export interface LiquidityRegistry {
32
28
  resolveSwapIntents: (entries: BatchEntry[], chainId: number, recipient: Address) => Promise<{
33
29
  calls: Call[];
@@ -39,7 +35,6 @@ export interface LiquidityRegistry {
39
35
  export interface LiquidityRegistryConfig {
40
36
  oneInch?: OneInchVenueConfig;
41
37
  satsuma?: SatsumaVenueConfig;
42
- algebra?: AlgebraSwapConfig;
43
38
  customVenues?: LiquidityVenue[];
44
39
  }
45
40
  export declare function createLiquidityRegistry(config?: LiquidityRegistryConfig): LiquidityRegistry;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spicenet-io/spiceflow-ui",
3
- "version": "4.0.13-next.1",
3
+ "version": "4.0.13",
4
4
  "description": "Spiceflow UI SDK",
5
5
  "type": "module",
6
6
  "packageManager": "bun@1.3.13",
@@ -1,49 +0,0 @@
1
- import { type Address } from "viem";
2
- import { type SupplyStep } from "../components/SpiceSupply/lib/executors";
3
- import type { Asset, SelectedAsset } from "../types/assets";
4
- import type { DestinationTokenConfig, SpiceSupplyProps } from "../types/supply";
5
- import type { FeePreview } from "../types/ui";
6
- export type SpiceActionSource = Asset & {
7
- _source?: "wallet" | "spice";
8
- _fundingWallet?: "embedded" | "external";
9
- };
10
- export interface UseSpiceActionOptions {
11
- destinationToken: DestinationTokenConfig;
12
- recipient?: Address;
13
- buildActionCalls: SpiceSupplyProps["buildActionCalls"];
14
- buildSpicenetBatch?: SpiceSupplyProps["buildSpicenetBatch"];
15
- amount: string;
16
- sourceChains?: number[];
17
- supportedSourceAssets?: string[];
18
- feeExecutionMode?: SpiceSupplyProps["feeExecutionMode"];
19
- enabled?: boolean;
20
- onSuccess?: (txHash: string) => void;
21
- onError?: (error: Error) => void;
22
- }
23
- export interface SpiceActionQuote {
24
- isQuoting: boolean;
25
- error: string | null;
26
- estimatedInput: string | null;
27
- estimatedOutput: string | null;
28
- estimatedMinOutput: string | null;
29
- isDirect: boolean;
30
- needsSwap: boolean;
31
- }
32
- export interface UseSpiceActionResult {
33
- sources: SpiceActionSource[];
34
- selectedAsset: SelectedAsset | null;
35
- setSelectedAsset: (selected: SelectedAsset | null) => void;
36
- selectAsset: (asset: Asset) => void;
37
- quote: SpiceActionQuote;
38
- feePreview: FeePreview | null;
39
- isFeePreviewLoading: boolean;
40
- feePreviewError: string | null;
41
- canSubmit: boolean;
42
- execute: () => Promise<void>;
43
- isExecuting: boolean;
44
- step: SupplyStep;
45
- statusMsg: string;
46
- txHash: string | null;
47
- refreshAssets: () => void;
48
- }
49
- export declare function useSpiceAction({ destinationToken, recipient, buildActionCalls, buildSpicenetBatch, amount, sourceChains: sourceChainsProp, supportedSourceAssets: supportedSourceAssetsProp, feeExecutionMode, enabled, onSuccess, onError, }: UseSpiceActionOptions): UseSpiceActionResult;
@@ -1,146 +0,0 @@
1
- import { type Address, type Hex } from "viem";
2
- export interface AlgebraSwapConfig {
3
- swapRouter: Address;
4
- quoterV2: Address;
5
- subgraphUrl: string;
6
- chainIds?: number[];
7
- }
8
- export declare const algebraQuoterAbi: readonly [{
9
- readonly name: "quoteExactInput";
10
- readonly stateMutability: "nonpayable";
11
- readonly inputs: readonly [{
12
- readonly name: "path";
13
- readonly type: "bytes";
14
- }, {
15
- readonly name: "amountInRequired";
16
- readonly type: "uint256";
17
- }];
18
- readonly outputs: readonly [{
19
- readonly name: "amountOutList";
20
- readonly type: "uint256[]";
21
- }, {
22
- readonly name: "amountInList";
23
- readonly type: "uint256[]";
24
- }, {
25
- readonly name: "sqrtPriceX96AfterList";
26
- readonly type: "uint160[]";
27
- }, {
28
- readonly name: "initializedTicksCrossedList";
29
- readonly type: "uint32[]";
30
- }, {
31
- readonly name: "gasEstimate";
32
- readonly type: "uint256";
33
- }, {
34
- readonly name: "feeList";
35
- readonly type: "uint16[]";
36
- }];
37
- readonly type: "function";
38
- }, {
39
- readonly name: "quoteExactOutput";
40
- readonly stateMutability: "nonpayable";
41
- readonly inputs: readonly [{
42
- readonly name: "path";
43
- readonly type: "bytes";
44
- }, {
45
- readonly name: "amountOutRequired";
46
- readonly type: "uint256";
47
- }];
48
- readonly outputs: readonly [{
49
- readonly name: "amountOutList";
50
- readonly type: "uint256[]";
51
- }, {
52
- readonly name: "amountInList";
53
- readonly type: "uint256[]";
54
- }, {
55
- readonly name: "sqrtPriceX96AfterList";
56
- readonly type: "uint160[]";
57
- }, {
58
- readonly name: "initializedTicksCrossedList";
59
- readonly type: "uint32[]";
60
- }, {
61
- readonly name: "gasEstimate";
62
- readonly type: "uint256";
63
- }, {
64
- readonly name: "feeList";
65
- readonly type: "uint16[]";
66
- }];
67
- readonly type: "function";
68
- }];
69
- export declare const algebraSwapRouterAbi: readonly [{
70
- readonly name: "exactInput";
71
- readonly stateMutability: "payable";
72
- readonly inputs: readonly [{
73
- readonly name: "params";
74
- readonly type: "tuple";
75
- readonly components: readonly [{
76
- readonly name: "path";
77
- readonly type: "bytes";
78
- }, {
79
- readonly name: "recipient";
80
- readonly type: "address";
81
- }, {
82
- readonly name: "deadline";
83
- readonly type: "uint256";
84
- }, {
85
- readonly name: "amountIn";
86
- readonly type: "uint256";
87
- }, {
88
- readonly name: "amountOutMinimum";
89
- readonly type: "uint256";
90
- }];
91
- }];
92
- readonly outputs: readonly [{
93
- readonly name: "amountOut";
94
- readonly type: "uint256";
95
- }];
96
- readonly type: "function";
97
- }, {
98
- readonly name: "exactOutput";
99
- readonly stateMutability: "payable";
100
- readonly inputs: readonly [{
101
- readonly name: "params";
102
- readonly type: "tuple";
103
- readonly components: readonly [{
104
- readonly name: "path";
105
- readonly type: "bytes";
106
- }, {
107
- readonly name: "recipient";
108
- readonly type: "address";
109
- }, {
110
- readonly name: "deadline";
111
- readonly type: "uint256";
112
- }, {
113
- readonly name: "amountOut";
114
- readonly type: "uint256";
115
- }, {
116
- readonly name: "amountInMaximum";
117
- readonly type: "uint256";
118
- }];
119
- }];
120
- readonly outputs: readonly [{
121
- readonly name: "amountIn";
122
- readonly type: "uint256";
123
- }];
124
- readonly type: "function";
125
- }];
126
- export declare function encodeAlgebraPath(tokens: Address[]): Hex;
127
- export declare function getBestAlgebraInputRoute(params: {
128
- tokenIn: Address;
129
- tokenOut: Address;
130
- amountIn: bigint;
131
- chainId: number;
132
- config: AlgebraSwapConfig;
133
- }): Promise<{
134
- path: Address[];
135
- amountOut: bigint;
136
- } | null>;
137
- export declare function getBestAlgebraOutputRoute(params: {
138
- tokenIn: Address;
139
- tokenOut: Address;
140
- amountOut: bigint;
141
- chainId: number;
142
- config: AlgebraSwapConfig;
143
- }): Promise<{
144
- path: Address[];
145
- amountIn: bigint;
146
- } | null>;
File without changes