@spicenet-io/spiceflow-ui 4.2.0 → 4.3.1
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/SpiceDeposit/lib/feePreview.d.ts +1 -0
- package/dist/components/SpiceLock/lib/executors.d.ts +14 -1
- package/dist/components/SpiceSupply/lib/executors.d.ts +3 -2
- 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/index.cjs.js +9 -9
- package/dist/index.js +7 -7
- package/dist/privy-B7Vdbw-A.js +2 -0
- package/dist/privy-DpzFP70H.js +2 -0
- package/dist/types/supply.d.ts +0 -2
- package/dist/utils/relayer/index.d.ts +4 -1
- package/package.json +2 -2
- package/dist/privy-BOhmZnpZ.js +0 -2
- package/dist/privy-CJe6d9DR.js +0 -2
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};
|
|
@@ -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 {};
|
|
@@ -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";
|
|
@@ -41,10 +42,10 @@ export type ExecutorContext = {
|
|
|
41
42
|
provider: string | null | undefined;
|
|
42
43
|
resolvedChainId: number;
|
|
43
44
|
executionTokenAddress: Address;
|
|
45
|
+
feeQuote: SupplyFeeQuote | null;
|
|
44
46
|
execution: ExecutionRunner & {
|
|
45
47
|
buildPayChainBatches: BuildPayBatchesFn;
|
|
46
48
|
buildSupplyChainBatches: BuildSupplyBatchesFn;
|
|
47
|
-
estimateRequiredGrossFunding: EstimateRequiredGrossFundingFn;
|
|
48
49
|
onProgress: (progress: ExecutionProgress) => void;
|
|
49
50
|
};
|
|
50
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>;
|