@spicenet-io/spiceflow-ui 4.2.0-satsuma.1 → 4.3.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/dist/auth-privy.cjs.js +1 -1
- package/dist/auth-privy.js +1 -1
- package/dist/components/AccountDisplay/parts/AccountActions.d.ts +0 -1
- package/dist/components/AccountDisplay/parts/AccountPanel.d.ts +0 -1
- package/dist/components/SpiceDeposit/lib/feePreview.d.ts +1 -0
- package/dist/components/SpiceLock/lib/executors.d.ts +14 -1
- package/dist/components/SpiceSupply/lib/buildBatches.d.ts +0 -1
- package/dist/components/SpiceSupply/lib/executors.d.ts +3 -3
- package/dist/components/SpiceSupply/lib/feePreview.d.ts +25 -3
- package/dist/components/SpiceWithdraw/lib/executors.d.ts +2 -0
- package/dist/components/SpiceWithdraw/lib/feePreview.d.ts +7 -1
- package/dist/hooks/useDebouncedEstimate.d.ts +1 -0
- package/dist/hooks/useSpiceExecution.d.ts +1 -0
- package/dist/hooks/useSupplyAssets.d.ts +1 -3
- package/dist/hooks/useSupplyQuote.d.ts +1 -4
- package/dist/index.cjs.js +7 -7
- package/dist/index.d.ts +7 -10
- package/dist/index.js +9 -9
- package/dist/privy-B7Vdbw-A.js +2 -0
- package/dist/privy-DpzFP70H.js +2 -0
- package/dist/types/assets.d.ts +0 -2
- package/dist/types/supply.d.ts +0 -3
- package/dist/utils/crossChainRouter/liquidityVenues.d.ts +0 -5
- package/dist/utils/relayer/index.d.ts +4 -1
- package/dist/utils/spiceConstants.d.ts +0 -1
- package/package.json +2 -2
- package/dist/components/SpiceSupply/useSupplyController.d.ts +0 -71
- package/dist/privy-BOhmZnpZ.js +0 -2
- package/dist/privy-BeOm0JvD.js +0 -2
- package/dist/utils/crossChainRouter/algebra.d.ts +0 -83
- package/dist/utils/spicenetBatch.d.ts +0 -18
package/dist/auth-privy.cjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";const r=require("./privy-
|
|
2
|
+
"use strict";const r=require("./privy-B7Vdbw-A.js");require("react/jsx-runtime"),require("react"),require("@spicenet-io/spiceflow-core"),require("viem"),require("viem/actions"),require("@privy-io/react-auth"),require("wagmi"),require("@tanstack/react-query"),exports.PrivyLogin=r.PrivyLogin;
|
package/dist/auth-privy.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{P as g}from"./privy-
|
|
2
|
+
import{P as g}from"./privy-DpzFP70H.js";import"react/jsx-runtime";import"react";import"@spicenet-io/spiceflow-core";import"viem";import"viem/actions";import"@privy-io/react-auth";import"wagmi";import"@tanstack/react-query";export{g as PrivyLogin};
|
|
@@ -17,7 +17,6 @@ interface AccountPanelProps {
|
|
|
17
17
|
notice?: AccountNotice | null;
|
|
18
18
|
onDepositClick?: () => void;
|
|
19
19
|
onWithdrawClick?: () => void;
|
|
20
|
-
onDisconnectClick: () => void;
|
|
21
20
|
depositDisabled?: boolean;
|
|
22
21
|
onCompleteDeposit?: (deposit: VerifiedPendingDeposit) => void;
|
|
23
22
|
primaryColor?: string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Dispatch, SetStateAction } from "react";
|
|
2
2
|
import { type Address } from "viem";
|
|
3
|
+
import { type FeeEstimateSummary } from "@spicenet-io/spiceflow-core";
|
|
3
4
|
import type { ChainBatch } from "../../../types/authorization";
|
|
4
5
|
import type { SelectedAsset } from "../../../types/assets";
|
|
5
6
|
import type { LockDurationOption, SpiceLockModalProps } from "../../../types/lock";
|
|
@@ -47,11 +48,23 @@ export type LockExecutorContext = {
|
|
|
47
48
|
}) => void;
|
|
48
49
|
refreshSpiceAssets: () => void;
|
|
49
50
|
refreshWalletAssets: () => void;
|
|
51
|
+
feeQuote: LockFeeQuote | null;
|
|
50
52
|
ui: {
|
|
51
53
|
setError: Dispatch<SetStateAction<string | null>>;
|
|
52
54
|
setIsExecuting: Dispatch<SetStateAction<boolean>>;
|
|
53
55
|
setShowStatusPanel: Dispatch<SetStateAction<boolean>>;
|
|
54
56
|
};
|
|
55
57
|
} & Pick<SpiceLockModalProps, "onLockExecute" | "onLockSuccess" | "buildSpicenetBatch">;
|
|
56
|
-
|
|
58
|
+
type LockFundingPlan = {
|
|
59
|
+
grossAmount: bigint;
|
|
60
|
+
netAmount: bigint;
|
|
61
|
+
feeAmount: bigint;
|
|
62
|
+
};
|
|
63
|
+
export type LockFeeQuote = {
|
|
64
|
+
preview: FeePreview;
|
|
65
|
+
feeEstimate: FeeEstimateSummary;
|
|
66
|
+
plan: LockFundingPlan;
|
|
67
|
+
};
|
|
68
|
+
export declare function estimateLockFees(ctx: LockExecutorContext, signal?: AbortSignal): Promise<LockFeeQuote | null>;
|
|
57
69
|
export declare function handleConvert(ctx: LockExecutorContext): Promise<void>;
|
|
70
|
+
export {};
|
|
@@ -7,7 +7,6 @@ import type { ResolvedExactOutputSwap } from "../../../utils/swapQuotes";
|
|
|
7
7
|
import type { ExecutionOptions } from "../../../hooks/useSpiceExecution";
|
|
8
8
|
import type { FeeEstimateSummary } from "@spicenet-io/spiceflow-core";
|
|
9
9
|
type EstimateFn = (chainBatches: ChainBatch[], tokenAddress: string, tokenTransferAmount: bigint, options?: ExecutionOptions) => Promise<FeeEstimateSummary>;
|
|
10
|
-
export declare function buildEmbeddedEscrowDepositBatch(token: Address, amount: bigint, chainId: number): ChainBatch;
|
|
11
10
|
export declare function stripSpicenetFundingBatches(batches: ChainBatch[]): ChainBatch[];
|
|
12
11
|
export declare function scaleTokenAmount(amount: bigint, fromDecimals: number, toDecimals: number): bigint;
|
|
13
12
|
export interface BatchBuilderContext {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { Dispatch, MutableRefObject, SetStateAction } from "react";
|
|
2
2
|
import { type Address } from "viem";
|
|
3
3
|
import type { SelectedAsset } from "../../../types/assets";
|
|
4
|
-
import type { BuildPayBatchesFn, BuildSupplyBatchesFn,
|
|
4
|
+
import type { BuildPayBatchesFn, BuildSupplyBatchesFn, SpiceSupplyProps } from "../../../types/supply";
|
|
5
|
+
import { type SupplyFeeQuote } from "./feePreview";
|
|
5
6
|
import type { ResolvedExactOutputSwap } from "../../../utils/swapQuotes";
|
|
6
7
|
import type { ExecutionProgress } from "../../../hooks/useSpiceExecution";
|
|
7
8
|
import type { ExecutionRunner } from "../../../execution/runner";
|
|
@@ -11,7 +12,6 @@ export type PaymentResult = {
|
|
|
11
12
|
txHash?: string;
|
|
12
13
|
error?: string;
|
|
13
14
|
};
|
|
14
|
-
export declare function isExternalSource(asset: SelectedAsset["asset"] | null | undefined, isNon7702: boolean): boolean;
|
|
15
15
|
export type ExecutorContext = {
|
|
16
16
|
selectedAsset: SelectedAsset | null;
|
|
17
17
|
parsedAmount: number;
|
|
@@ -42,10 +42,10 @@ export type ExecutorContext = {
|
|
|
42
42
|
provider: string | null | undefined;
|
|
43
43
|
resolvedChainId: number;
|
|
44
44
|
executionTokenAddress: Address;
|
|
45
|
+
feeQuote: SupplyFeeQuote | null;
|
|
45
46
|
execution: ExecutionRunner & {
|
|
46
47
|
buildPayChainBatches: BuildPayBatchesFn;
|
|
47
48
|
buildSupplyChainBatches: BuildSupplyBatchesFn;
|
|
48
|
-
estimateRequiredGrossFunding: EstimateRequiredGrossFundingFn;
|
|
49
49
|
onProgress: (progress: ExecutionProgress) => void;
|
|
50
50
|
};
|
|
51
51
|
ui: {
|
|
@@ -10,7 +10,29 @@ import type { ExecutionOptions } from "../../../hooks/useSpiceExecution";
|
|
|
10
10
|
type EstimateFn = (chainBatches: ChainBatch[], tokenAddress: string, tokenTransferAmount: bigint, options?: ExecutionOptions) => Promise<FeeEstimateSummary>;
|
|
11
11
|
type BuildPayBatchesFn = (options?: SupplyBatchBuildOptions) => Promise<ChainBatch[]>;
|
|
12
12
|
type BuildSupplyBatchesFn = (options?: SupplyBatchBuildOptions) => Promise<ChainBatch[]>;
|
|
13
|
-
type
|
|
13
|
+
export type SupplyFeeQuote = {
|
|
14
|
+
preview: FeePreview;
|
|
15
|
+
feeEstimate: FeeEstimateSummary | null;
|
|
16
|
+
grossFundingAmount?: bigint;
|
|
17
|
+
};
|
|
18
|
+
export declare function solveGrossFunding(fees: Pick<FeePreview, "grossAmount" | "gasFee" | "spicenetFee" | "bridgeFee">, requiredNetFunding: bigint): bigint;
|
|
19
|
+
export declare function estimatePayFunding(args: {
|
|
20
|
+
requiredNetFunding: bigint;
|
|
21
|
+
buildBatches: (gross: bigint) => ChainBatch[] | Promise<ChainBatch[]>;
|
|
22
|
+
fundingToken: Address;
|
|
23
|
+
estimate: EstimateFn;
|
|
24
|
+
executionOptions?: ExecutionOptions;
|
|
25
|
+
tokenDescriptor: {
|
|
26
|
+
chainId: number;
|
|
27
|
+
tokenAddress: Address;
|
|
28
|
+
symbol: string;
|
|
29
|
+
decimals: number;
|
|
30
|
+
};
|
|
31
|
+
}): Promise<{
|
|
32
|
+
preview: FeePreview | null;
|
|
33
|
+
feeEstimate: FeeEstimateSummary;
|
|
34
|
+
grossFundingAmount: bigint;
|
|
35
|
+
}>;
|
|
14
36
|
export declare function estimateSupplyMaxAmount(ctx: {
|
|
15
37
|
asset: Asset;
|
|
16
38
|
isPayMode: boolean;
|
|
@@ -24,6 +46,7 @@ export declare function estimateSupplyMaxAmount(ctx: {
|
|
|
24
46
|
feeExecutionMode: SpiceSupplyProps["feeExecutionMode"];
|
|
25
47
|
}): Promise<string | null>;
|
|
26
48
|
export interface FeePreviewContext {
|
|
49
|
+
signal?: AbortSignal;
|
|
27
50
|
selectedAsset: SelectedAsset | null;
|
|
28
51
|
isPayMode: boolean;
|
|
29
52
|
parsedAmount: number;
|
|
@@ -50,7 +73,6 @@ export interface FeePreviewContext {
|
|
|
50
73
|
buildPayChainBatches: BuildPayBatchesFn;
|
|
51
74
|
buildSupplyChainBatches: BuildSupplyBatchesFn;
|
|
52
75
|
estimate: EstimateFn;
|
|
53
|
-
estimateRequiredGrossFunding: EstimateRequiredGrossFundingFn;
|
|
54
76
|
}
|
|
55
|
-
export declare function estimateFeePreview(ctx: FeePreviewContext): Promise<
|
|
77
|
+
export declare function estimateFeePreview(ctx: FeePreviewContext): Promise<SupplyFeeQuote | null>;
|
|
56
78
|
export {};
|
|
@@ -3,6 +3,7 @@ import type { ExecutionRunner } from "../../../execution/runner";
|
|
|
3
3
|
import type { DestinationToken, SpiceWithdrawDeliveryTransfer, SpiceWithdrawProps } from "../../../types/withdraw";
|
|
4
4
|
import type { ChainBatch } from "../../../types/authorization";
|
|
5
5
|
import type { ExecutionProgress } from "../../../hooks/useSpiceExecution";
|
|
6
|
+
import type { FeeEstimateSummary } from "@spicenet-io/spiceflow-core";
|
|
6
7
|
export type WithdrawalExecutionContext = {
|
|
7
8
|
actionId: string;
|
|
8
9
|
intentId: string;
|
|
@@ -18,6 +19,7 @@ export type WithdrawExecutorContext = {
|
|
|
18
19
|
amount: string;
|
|
19
20
|
receiveAmountRaw: bigint;
|
|
20
21
|
gasFee: bigint | null;
|
|
22
|
+
feeEstimate: FeeEstimateSummary | null;
|
|
21
23
|
isNon7702: boolean;
|
|
22
24
|
buildWithdrawBatches: (withdrawalTransfersOrAmount?: bigint | SpiceWithdrawDeliveryTransfer[]) => ChainBatch[];
|
|
23
25
|
execution: ExecutionRunner;
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import type { Address } from "viem";
|
|
2
|
+
import type { FeeEstimateSummary } from "@spicenet-io/spiceflow-core";
|
|
2
3
|
import type { ExecutionRunner } from "../../../execution/runner";
|
|
3
4
|
import type { ChainBatch } from "../../../types/authorization";
|
|
5
|
+
export type WithdrawFeeQuote = {
|
|
6
|
+
gasFee: bigint;
|
|
7
|
+
feeEstimate: FeeEstimateSummary;
|
|
8
|
+
};
|
|
4
9
|
export declare function estimateWithdrawGasFee(ctx: {
|
|
5
10
|
batches: ChainBatch[];
|
|
6
11
|
tokenAddress: Address;
|
|
7
12
|
chainId: number;
|
|
8
13
|
estimate: ExecutionRunner["estimate"];
|
|
9
|
-
|
|
14
|
+
signal?: AbortSignal;
|
|
15
|
+
}): Promise<WithdrawFeeQuote>;
|
|
@@ -31,6 +31,7 @@ export interface ExecutionOptions {
|
|
|
31
31
|
skipPreSubmitFeeEstimate?: boolean;
|
|
32
32
|
submittedFeeEstimate?: FeeEstimateSummary;
|
|
33
33
|
skipUserFundingPreflight?: boolean;
|
|
34
|
+
signal?: AbortSignal;
|
|
34
35
|
}
|
|
35
36
|
export declare function useSpiceExecution(): {
|
|
36
37
|
execute: (chainBatches: ChainBatch[], tokenAddress: string, tokenTransferAmount: bigint, onProgress?: OnProgress, signal?: AbortSignal, options?: ExecutionOptions) => Promise<string>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Address } from "viem";
|
|
2
2
|
import type { Asset } from "../types/assets";
|
|
3
|
-
export declare function isSupportedSupplyAsset(asset: Pick<Asset, "address" | "chainTokens"
|
|
3
|
+
export declare function isSupportedSupplyAsset(asset: Pick<Asset, "address" | "chainTokens">, supportedSourceAssets?: string[]): boolean;
|
|
4
4
|
type DestinationToken = {
|
|
5
5
|
address: Address;
|
|
6
6
|
decimals: number;
|
|
@@ -14,11 +14,9 @@ export declare function useSupplyAssets(opts: {
|
|
|
14
14
|
supportedSourceAssets?: string[];
|
|
15
15
|
sourceChains?: number[];
|
|
16
16
|
enabled: boolean;
|
|
17
|
-
includeExternalWalletAssets?: boolean;
|
|
18
17
|
}): {
|
|
19
18
|
displayAssets: (Asset & {
|
|
20
19
|
_source: "wallet" | "spice";
|
|
21
|
-
_fundingWallet?: "embedded" | "external";
|
|
22
20
|
})[];
|
|
23
21
|
filteredSpiceAssets: Asset[];
|
|
24
22
|
walletAssets: Asset[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Address } from "viem";
|
|
2
|
-
import type {
|
|
2
|
+
import type { ResolvedSwap } from "../utils/crossChainRouter/liquidityVenues";
|
|
3
3
|
import { type ExactOutputSwapIntent, type ResolvedExactOutputSwap } from "../utils/swapQuotes";
|
|
4
4
|
import type { SelectedAsset } from "../types/assets";
|
|
5
5
|
export interface UseSupplyQuoteOpts {
|
|
@@ -14,8 +14,6 @@ export interface UseSupplyQuoteOpts {
|
|
|
14
14
|
chainId: number;
|
|
15
15
|
recipient: Address | undefined;
|
|
16
16
|
paymentAmount?: string;
|
|
17
|
-
maxSlippage?: number;
|
|
18
|
-
resolveInputSwap?: LiquidityVenue["resolve"];
|
|
19
17
|
resolveExactOutputSwap?: (intent: ExactOutputSwapIntent, chainId: number, recipient: Address) => Promise<ResolvedExactOutputSwap | null>;
|
|
20
18
|
}
|
|
21
19
|
export interface SupplyQuoteResult {
|
|
@@ -37,6 +35,5 @@ export declare function resolveInputSupplySwapQuote(params: {
|
|
|
37
35
|
tokenIn: Address;
|
|
38
36
|
tokenOut: Address;
|
|
39
37
|
amountIn: bigint;
|
|
40
|
-
maxSlippage?: number;
|
|
41
38
|
}): Promise<ResolvedSwap>;
|
|
42
39
|
export declare function useSupplyQuote(opts: UseSupplyQuoteOpts): SupplyQuoteResult;
|