@spicenet-io/spiceflow-ui 3.3.6 → 3.3.8
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/Button-CkSwrat1.js +2 -0
- package/dist/Button-jx5yrM-s.js +2 -0
- package/dist/auth-dynamic.cjs.js +1 -1
- package/dist/auth-dynamic.js +1 -1
- package/dist/auth-privy.cjs.js +1 -1
- package/dist/auth-privy.js +1 -1
- package/dist/components/AccountDisplay/{parts/AccountCustomSection.d.ts → AccountCustomSection.d.ts} +2 -2
- package/dist/components/AccountDisplay/{parts/AccountHeader.d.ts → AccountHeader.d.ts} +1 -1
- package/dist/components/AccountDisplay/{parts/AccountIdleBalances.d.ts → AccountIdleBalances.d.ts} +2 -2
- package/dist/components/AccountDisplay/{parts/AccountPanel.d.ts → AccountPanel.d.ts} +3 -3
- package/dist/components/AccountDisplay/{parts/AccountPendingDeposits.d.ts → AccountPendingDeposits.d.ts} +2 -2
- package/dist/components/AccountDisplay/types.d.ts +0 -1
- package/dist/components/AssetSelector/{parts/AssetDropdown.d.ts → AssetDropdown.d.ts} +1 -1
- package/dist/components/AssetSelector/{parts/ChainIcon.d.ts → ChainIcon.d.ts} +1 -1
- package/dist/components/AssetSelector/{parts/TokenIcon.d.ts → TokenIcon.d.ts} +1 -1
- package/dist/components/AssetSelector/index.d.ts +3 -3
- package/dist/components/ProviderLogins/{parts/DynamicLogin.d.ts → DynamicLogin.d.ts} +1 -1
- package/dist/components/ProviderLogins/{parts/PrivyLogin.d.ts → PrivyLogin.d.ts} +1 -1
- package/dist/components/ProviderLogins/index.d.ts +2 -4
- package/dist/components/SpiceBalance/index.d.ts +2 -2
- package/dist/components/SpiceDeposit/{steps/ConnectWalletModal.d.ts → ConnectWalletModal.d.ts} +1 -1
- package/dist/components/SpiceDeposit/{steps/DepositModal.d.ts → DepositModal.d.ts} +1 -1
- package/dist/components/SpiceDeposit/{steps/DepositRecoveryPrompt.d.ts → DepositRecoveryPrompt.d.ts} +1 -1
- package/dist/components/SpiceDeposit/{steps/DepositStatusModal.d.ts → DepositStatusModal.d.ts} +3 -3
- package/dist/components/SpiceDeposit/{steps/SelectChainModal.d.ts → SelectChainModal.d.ts} +1 -1
- package/dist/components/SpiceDeposit/{steps/SelectTokenModal.d.ts → SelectTokenModal.d.ts} +1 -1
- package/dist/components/SpiceDeposit/{lib/depositBatches.d.ts → depositBatches.d.ts} +3 -3
- package/dist/components/SpiceDeposit/{lib/executors.d.ts → executors.d.ts} +3 -3
- package/dist/components/SpiceDeposit/{lib/feePreview.d.ts → feePreview.d.ts} +1 -1
- package/dist/components/SpiceDeposit/index.d.ts +3 -3
- package/dist/components/SpiceDeposit/views/DepositSubtitle.d.ts +9 -0
- package/dist/components/SpiceLock/{parts/LockConfirmationPanel.d.ts → LockConfirmationPanel.d.ts} +1 -1
- package/dist/components/SpiceLock/{parts/LockDurationSlider.d.ts → LockDurationSlider.d.ts} +1 -1
- package/dist/components/SpiceLock/{parts/LockExpiryRow.d.ts → LockExpiryRow.d.ts} +1 -1
- package/dist/components/SpiceLock/{parts/VotingPowerRow.d.ts → VotingPowerRow.d.ts} +1 -1
- package/dist/components/SpiceLock/{lib/executors.d.ts → executors.d.ts} +14 -13
- package/dist/components/SpiceLock/{lib/helpers.d.ts → helpers.d.ts} +2 -2
- package/dist/components/SpiceSupply/{parts/DestinationEstimate.d.ts → DestinationEstimate.d.ts} +2 -2
- package/dist/components/SpiceSupply/{parts/SupplyEstimate.d.ts → SupplyEstimate.d.ts} +1 -1
- package/dist/components/SpiceSupply/{lib/buildBatches.d.ts → buildBatches.d.ts} +10 -8
- package/dist/components/SpiceSupply/executors.d.ts +73 -0
- package/dist/components/SpiceSupply/{lib/feePreview.d.ts → feePreview.d.ts} +11 -9
- package/dist/components/SpiceWithdraw/{parts/SelectPopover.d.ts → SelectPopover.d.ts} +1 -1
- package/dist/components/SpiceWithdraw/executors.d.ts +50 -0
- package/dist/components/StatusDisplay/{parts/StatusIcon.d.ts → StatusIcon.d.ts} +1 -1
- package/dist/components/StatusDisplay/{parts/StatusPanel.d.ts → StatusPanel.d.ts} +1 -1
- package/dist/components/StatusDisplay/{parts/StepItem.d.ts → StepItem.d.ts} +1 -1
- package/dist/components/StatusDisplay/index.d.ts +2 -3
- package/dist/hooks/useSpiceExecution.d.ts +0 -1
- package/dist/index.cjs.js +14 -14
- package/dist/index.d.ts +1 -2
- package/dist/index.js +14 -14
- package/dist/{providerWallet-Ddncx8s5.js → providerWallet-6FpyLYqw.js} +1 -1
- package/dist/{providerWallet-B7SytehJ.js → providerWallet-Ds1PM0vC.js} +1 -1
- package/dist/providers/SpiceFlowProvider.d.ts +2 -0
- package/dist/providers/dynamic.d.ts +2 -2
- package/dist/providers/privy.d.ts +2 -2
- package/dist/types/deposit.d.ts +0 -3
- package/dist/types/lock.d.ts +0 -2
- package/dist/types/supply.d.ts +0 -15
- package/dist/types/withdraw.d.ts +0 -1
- package/package.json +2 -2
- package/dist/Button-E8Ln6miF.js +0 -2
- package/dist/Button-RzLL2mKv.js +0 -2
- package/dist/components/SpiceSupply/lib/executors.d.ts +0 -67
- package/dist/components/SpiceWithdraw/lib/executors.d.ts +0 -34
- package/dist/execution/gasless.d.ts +0 -7
- package/dist/execution/pollIntentStep.d.ts +0 -28
- package/dist/utils/spiceConstants.d.ts +0 -3
- /package/dist/components/AccountDisplay/{parts/AccountActions.d.ts → AccountActions.d.ts} +0 -0
- /package/dist/components/SpiceBalance/{parts/AccountItem.d.ts → AccountItem.d.ts} +0 -0
- /package/dist/components/SpiceBalance/{parts/BalanceSection.d.ts → BalanceSection.d.ts} +0 -0
- /package/dist/components/SpiceDeposit/{parts/ModalHeader.d.ts → ModalHeader.d.ts} +0 -0
- /package/dist/components/SpiceDeposit/{parts/DepositAssetChooser.d.ts → views/AssetChooserList.d.ts} +0 -0
- /package/dist/components/SpiceWithdraw/{lib/helpers.d.ts → helpers.d.ts} +0 -0
- /package/dist/components/SpiceWithdraw/{parts/WithdrawBalancePopover.d.ts → views/BalancePopover.d.ts} +0 -0
- /package/dist/components/SpiceWithdraw/{parts → views}/WithdrawDetailsPanel.d.ts +0 -0
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type { Dispatch, MutableRefObject, SetStateAction } from "react";
|
|
2
|
+
import { type Address } from "viem";
|
|
3
|
+
import { type FeeEstimateSummary } from "@spicenet-io/spiceflow-core";
|
|
4
|
+
import type { ChainBatch } from "../../types/authorization";
|
|
5
|
+
import type { SelectedAsset } from "../../types/assets";
|
|
6
|
+
import type { SpiceSupplyProps } from "../../types/supply";
|
|
7
|
+
import type { ResolvedExactOutputSwap } from "../../utils/swapQuotes";
|
|
8
|
+
import type { GaslessExecutionOptions, GaslessProgress } from "../../hooks/useSpiceExecution";
|
|
9
|
+
export type SupplyStep = "idle" | "signing-delegation" | "signing-intent" | "submitting" | "executing" | "success" | "error";
|
|
10
|
+
export type PaymentResult = {
|
|
11
|
+
status: "processing" | "success" | "failed";
|
|
12
|
+
txHash?: string;
|
|
13
|
+
error?: string;
|
|
14
|
+
};
|
|
15
|
+
type EstimateGaslessFn = (chainBatches: ChainBatch[], tokenAddress: string, tokenTransferAmount: bigint, options?: GaslessExecutionOptions) => Promise<FeeEstimateSummary>;
|
|
16
|
+
type ExecuteGaslessFn = (chainBatches: ChainBatch[], tokenAddress: string, tokenTransferAmount: bigint, onProgress?: (progress: GaslessProgress) => void, signal?: AbortSignal, options?: GaslessExecutionOptions) => Promise<string>;
|
|
17
|
+
type BuildPayBatchesFn = (options?: {
|
|
18
|
+
actionAmountOverride?: bigint;
|
|
19
|
+
fundingAmountOverride?: bigint;
|
|
20
|
+
}) => Promise<ChainBatch[]>;
|
|
21
|
+
type BuildSupplyBatchesFn = (spicenetFundingAmount?: bigint) => Promise<ChainBatch[]>;
|
|
22
|
+
type EstimateRequiredGrossFundingFn = (requiredNetFunding: bigint, buildBatches: (grossFundingAmount: bigint) => ChainBatch[] | Promise<ChainBatch[]>, fundingToken: Address, gaslessOptions?: Pick<GaslessExecutionOptions, "useCustomTransfers" | "userOverride">) => Promise<bigint>;
|
|
23
|
+
export interface ExecutorContext {
|
|
24
|
+
selectedAsset: SelectedAsset | null;
|
|
25
|
+
parsedAmount: number;
|
|
26
|
+
currentPaymentAmount: string;
|
|
27
|
+
isInsufficientBalance: boolean;
|
|
28
|
+
isPayMode: boolean;
|
|
29
|
+
isNon7702: boolean;
|
|
30
|
+
isSourceDestToken: boolean;
|
|
31
|
+
needsSwap: boolean;
|
|
32
|
+
exactOutputSwap: ResolvedExactOutputSwap | null;
|
|
33
|
+
selectedIsEquivalent: boolean;
|
|
34
|
+
resolvedTokenIn: Address | null;
|
|
35
|
+
embeddedWalletAddress: string | null | undefined;
|
|
36
|
+
providerEmbeddedAddress: string | null | undefined;
|
|
37
|
+
externalWallet: {
|
|
38
|
+
getEthereumProvider: () => Promise<any>;
|
|
39
|
+
} | null | undefined;
|
|
40
|
+
externalWalletAddress: string | null | undefined;
|
|
41
|
+
address: string | null | undefined;
|
|
42
|
+
isConnected: boolean;
|
|
43
|
+
ready: boolean;
|
|
44
|
+
authenticated: boolean;
|
|
45
|
+
provider: string | null | undefined;
|
|
46
|
+
resolvedChainId: number;
|
|
47
|
+
executionTokenAddress: Address;
|
|
48
|
+
destinationToken: SpiceSupplyProps["destinationToken"];
|
|
49
|
+
buildActionCalls: SpiceSupplyProps["buildActionCalls"];
|
|
50
|
+
buildSpicenetBatch: SpiceSupplyProps["buildSpicenetBatch"];
|
|
51
|
+
onPayExecute?: SpiceSupplyProps["onPayExecute"];
|
|
52
|
+
onError?: (err: Error) => void;
|
|
53
|
+
buildPayChainBatches: BuildPayBatchesFn;
|
|
54
|
+
buildSupplyChainBatches: BuildSupplyBatchesFn;
|
|
55
|
+
estimateGasless: EstimateGaslessFn;
|
|
56
|
+
executeGasless: ExecuteGaslessFn;
|
|
57
|
+
estimateRequiredGrossFunding: EstimateRequiredGrossFundingFn;
|
|
58
|
+
handleProgressCallback: (progress: GaslessProgress) => void;
|
|
59
|
+
setError: Dispatch<SetStateAction<string | null>>;
|
|
60
|
+
setStep: Dispatch<SetStateAction<SupplyStep>>;
|
|
61
|
+
setStatusMsg: Dispatch<SetStateAction<string>>;
|
|
62
|
+
setTxHash: Dispatch<SetStateAction<string | null>>;
|
|
63
|
+
setIsExecuting: Dispatch<SetStateAction<boolean>>;
|
|
64
|
+
setShowStatusPanel: Dispatch<SetStateAction<boolean>>;
|
|
65
|
+
setPaymentResult: Dispatch<SetStateAction<PaymentResult | null>>;
|
|
66
|
+
spiceDepositSubmittedRef: MutableRefObject<boolean>;
|
|
67
|
+
abortControllerRef: MutableRefObject<AbortController | null>;
|
|
68
|
+
}
|
|
69
|
+
export declare function executeSupply(ctx: ExecutorContext): Promise<void>;
|
|
70
|
+
export declare function executeDirectExternalAction(ctx: ExecutorContext): Promise<`0x${string}` | undefined>;
|
|
71
|
+
export declare function executeNon7702Pay(ctx: ExecutorContext): Promise<string>;
|
|
72
|
+
export declare function executePay(ctx: ExecutorContext): Promise<void>;
|
|
73
|
+
export {};
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import { type Address } from "viem";
|
|
2
2
|
import { type FeeEstimateSummary } from "@spicenet-io/spiceflow-core";
|
|
3
|
-
import type { FeePreview } from "
|
|
4
|
-
import type { ChainBatch } from "
|
|
5
|
-
import type { SelectedAsset } from "
|
|
6
|
-
import type { SpiceSupplyProps
|
|
7
|
-
import type { ResolvedExactOutputSwap } from "
|
|
3
|
+
import type { FeePreview } from "../../types/ui";
|
|
4
|
+
import type { ChainBatch } from "../../types/authorization";
|
|
5
|
+
import type { SelectedAsset } from "../../types/assets";
|
|
6
|
+
import type { SpiceSupplyProps } from "../../types/supply";
|
|
7
|
+
import type { ResolvedExactOutputSwap } from "../../utils/swapQuotes";
|
|
8
8
|
import type { ResolvedSwap } from "@spicenet-io/spiceflow-core";
|
|
9
|
-
import type { GaslessExecutionOptions } from "
|
|
9
|
+
import type { GaslessExecutionOptions } from "../../hooks/useSpiceExecution";
|
|
10
10
|
type EstimateGaslessFn = (chainBatches: ChainBatch[], tokenAddress: string, tokenTransferAmount: bigint, options?: GaslessExecutionOptions) => Promise<FeeEstimateSummary>;
|
|
11
|
-
type BuildPayBatchesFn = (options?:
|
|
12
|
-
|
|
11
|
+
type BuildPayBatchesFn = (options?: {
|
|
12
|
+
actionAmountOverride?: bigint;
|
|
13
|
+
fundingAmountOverride?: bigint;
|
|
14
|
+
}) => Promise<ChainBatch[]>;
|
|
15
|
+
type BuildSupplyBatchesFn = (spicenetFundingAmount?: bigint) => Promise<ChainBatch[]>;
|
|
13
16
|
type EstimateRequiredGrossFundingFn = (requiredNetFunding: bigint, buildBatches: (grossFundingAmount: bigint) => ChainBatch[] | Promise<ChainBatch[]>, fundingToken: Address, gaslessOptions?: Pick<GaslessExecutionOptions, "useCustomTransfers" | "userOverride">) => Promise<bigint>;
|
|
14
17
|
export interface FeePreviewContext {
|
|
15
18
|
selectedAsset: SelectedAsset | null;
|
|
@@ -21,7 +24,6 @@ export interface FeePreviewContext {
|
|
|
21
24
|
isSourceDestToken: boolean;
|
|
22
25
|
currentPaymentAmount: string;
|
|
23
26
|
destinationToken: SpiceSupplyProps["destinationToken"];
|
|
24
|
-
feeExecutionMode: SpiceSupplyProps["feeExecutionMode"];
|
|
25
27
|
resolvedTokenIn: Address | null;
|
|
26
28
|
embeddedWalletAddress: string | null | undefined;
|
|
27
29
|
providerEmbeddedAddress: string | null | undefined;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { Dispatch, MutableRefObject, SetStateAction } from "react";
|
|
2
|
+
import { type FeeEstimateSummary } from "@spicenet-io/spiceflow-core";
|
|
3
|
+
import type { Address } from "viem";
|
|
4
|
+
import type { ChainBatch } from "../../types/authorization";
|
|
5
|
+
import type { DestinationToken } from "../../types/withdraw";
|
|
6
|
+
import type { GaslessExecutionOptions, GaslessProgress } from "../../hooks/useSpiceExecution";
|
|
7
|
+
export type WithdrawalExecutionContext = {
|
|
8
|
+
actionId: string;
|
|
9
|
+
intentId: string;
|
|
10
|
+
intentIndex: number;
|
|
11
|
+
totalSteps: number;
|
|
12
|
+
};
|
|
13
|
+
type EstimateGaslessFn = (chainBatches: ChainBatch[], tokenAddress: string, tokenTransferAmount: bigint, options?: GaslessExecutionOptions) => Promise<FeeEstimateSummary>;
|
|
14
|
+
type ExecuteGaslessFn = (chainBatches: ChainBatch[], tokenAddress: string, tokenTransferAmount: bigint, onProgress?: (progress: GaslessProgress) => void, signal?: AbortSignal, options?: GaslessExecutionOptions) => Promise<string>;
|
|
15
|
+
export interface WithdrawExecutorContext {
|
|
16
|
+
computedWithdrawBatches: ChainBatch[];
|
|
17
|
+
walletAddress: string | null | undefined;
|
|
18
|
+
recipientAddress: string | null | undefined;
|
|
19
|
+
selectedDestToken: DestinationToken | null;
|
|
20
|
+
selectedChainId: number | null;
|
|
21
|
+
amount: string;
|
|
22
|
+
receiveAmountRaw: bigint;
|
|
23
|
+
gasFee: bigint | null;
|
|
24
|
+
isNon7702: boolean;
|
|
25
|
+
onWithdrawExecute?: (amount: string) => Promise<void> | void;
|
|
26
|
+
onWithdrawSuccess?: (info: {
|
|
27
|
+
token: string;
|
|
28
|
+
amount: string;
|
|
29
|
+
chainId: number;
|
|
30
|
+
}) => void;
|
|
31
|
+
onWithdrawError?: (msg: string) => void;
|
|
32
|
+
buildSpicenetBatch?: (params: {
|
|
33
|
+
destinationChainId: number;
|
|
34
|
+
deliveryToken: Address;
|
|
35
|
+
deliveryAmount: bigint;
|
|
36
|
+
deliveryRecipient: Address;
|
|
37
|
+
}) => ChainBatch | null;
|
|
38
|
+
buildWithdrawBatches: (spicenetFundingAmount?: bigint) => ChainBatch[];
|
|
39
|
+
estimateGasless: EstimateGaslessFn;
|
|
40
|
+
executeGasless: ExecuteGaslessFn;
|
|
41
|
+
setIsExecuting: Dispatch<SetStateAction<boolean>>;
|
|
42
|
+
setExecutionError: Dispatch<SetStateAction<string | null>>;
|
|
43
|
+
setExecutionProgress: Dispatch<SetStateAction<GaslessProgress | null>>;
|
|
44
|
+
setLockedGasFee: Dispatch<SetStateAction<bigint | null>>;
|
|
45
|
+
executionContextRef: MutableRefObject<WithdrawalExecutionContext | null>;
|
|
46
|
+
isMountedRef: MutableRefObject<boolean>;
|
|
47
|
+
}
|
|
48
|
+
export declare function executeWithdraw(ctx: WithdrawExecutorContext): Promise<void>;
|
|
49
|
+
export declare function retryWithdraw(ctx: WithdrawExecutorContext): Promise<void>;
|
|
50
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import type { StatusResultItem, StatusPanelProps } from "
|
|
2
|
+
import type { StatusResultItem, StatusPanelProps } from "../../types/status";
|
|
3
3
|
export type { StatusResultItem, StatusPanelProps };
|
|
4
4
|
export declare const StatusPanel: React.FC<StatusPanelProps>;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export { StatusDisplay } from "./StatusDisplay";
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export { StepItem } from "./parts/StepItem";
|
|
2
|
+
export { StatusIcon } from "./StatusIcon";
|
|
3
|
+
export { StepItem } from "./StepItem";
|
|
5
4
|
export type { StatusIconProps, StepItemProps } from "../../types/status";
|
|
@@ -22,7 +22,6 @@ export interface GaslessExecutionOptions {
|
|
|
22
22
|
useCustomTransfers?: boolean;
|
|
23
23
|
userOverride?: Address;
|
|
24
24
|
signAuthorizationsForEstimate?: boolean;
|
|
25
|
-
feeExecutionMode?: "backend-transfer" | "user-transfer";
|
|
26
25
|
}
|
|
27
26
|
export declare function useSpiceExecution(): {
|
|
28
27
|
executeGasless: (chainBatches: ChainBatch[], tokenAddress: string, tokenTransferAmount: bigint, onProgress?: OnProgress, signal?: AbortSignal, options?: GaslessExecutionOptions) => Promise<string>;
|