@spicenet-io/spiceflow-ui 3.3.85 → 4.0.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/ProviderLogins/index.d.ts +0 -2
- package/dist/components/SpiceLock/lib/executors.d.ts +6 -1
- package/dist/components/SpiceLock/parts/LabeledInfoRow.d.ts +5 -0
- package/dist/components/SpiceSupply/lib/buildBatches.d.ts +3 -3
- package/dist/components/SpiceSupply/lib/executors.d.ts +5 -5
- package/dist/components/SpiceSupply/lib/feePreview.d.ts +5 -5
- package/dist/components/SpiceWithdraw/lib/executors.d.ts +4 -4
- package/dist/components/SpiceWithdraw/lib/feePreview.d.ts +2 -2
- package/dist/components/index.d.ts +0 -1
- package/dist/components/ui/index.d.ts +0 -1
- package/dist/execution/batchHashes.d.ts +2 -0
- package/dist/execution/fundEmbeddedWallet.d.ts +10 -0
- package/dist/execution/intentStatus.d.ts +31 -0
- package/dist/execution/pollIntentStep.d.ts +10 -0
- package/dist/execution/runner.d.ts +7 -0
- package/dist/execution/stripFeeCalls.d.ts +3 -0
- package/dist/execution/switchChain.d.ts +5 -0
- package/dist/hooks/index.d.ts +3 -7
- package/dist/hooks/useDirectWithdraw.d.ts +2 -2
- package/dist/hooks/useSpiceExecution.d.ts +12 -7
- package/dist/hooks/useSupplyAssets.d.ts +9 -7
- package/dist/hooks/{useWallet/index.d.ts → useWallet.d.ts} +2 -2
- package/dist/index.cjs.js +12 -12
- package/dist/index.d.ts +3 -15
- package/dist/index.js +12 -12
- package/dist/privy-2vbGci0p.js +0 -0
- package/dist/privy-BdHp5Owr.js +0 -0
- package/dist/providers/SpiceFlowProvider.d.ts +5 -3
- package/dist/types/lock.d.ts +3 -9
- package/dist/types/theme.d.ts +15 -13
- package/dist/types/wallet.d.ts +0 -11
- package/dist/utils/crossChainRouter/executeSwapThenAction.d.ts +4 -4
- package/dist/{hooks/directWithdrawPlan.d.ts → utils/directWithdraw.d.ts} +4 -0
- package/dist/utils/fees.d.ts +3 -1
- package/dist/utils/providerWallet.d.ts +2 -17
- package/dist/utils/relayer/index.d.ts +1 -0
- package/dist/utils/sleep.d.ts +1 -0
- package/dist/utils/theme.d.ts +2 -14
- package/dist/utils/tokenMetadata.d.ts +14 -0
- package/package.json +1 -23
- package/dist/Button-BtGAHwBv.js +0 -0
- package/dist/Button-bcAB126C.js +0 -0
- package/dist/auth-dynamic.cjs.js +0 -2
- package/dist/auth-dynamic.js +0 -2
- package/dist/components/ExportWallet/ExportWalletButton.d.ts +0 -4
- package/dist/components/ExportWallet/index.d.ts +0 -2
- package/dist/components/ProviderLogins/parts/DynamicLogin.d.ts +0 -4
- package/dist/components/SdkErrorBoundary/SdkErrorBoundary.d.ts +0 -21
- package/dist/components/SdkErrorBoundary/index.d.ts +0 -1
- package/dist/components/SpiceBalance/SpiceBalance.d.ts +0 -3
- package/dist/components/SpiceBalance/index.d.ts +0 -4
- package/dist/components/SpiceBalance/parts/AccountItem.d.ts +0 -11
- package/dist/components/SpiceBalance/parts/BalanceSection.d.ts +0 -10
- package/dist/components/SpiceBalance/types.d.ts +0 -66
- package/dist/components/SpiceLock/parts/LockExpiryRow.d.ts +0 -4
- package/dist/components/SpiceLock/parts/VotingPowerRow.d.ts +0 -4
- package/dist/components/SpicePay/SpicePay.d.ts +0 -14
- package/dist/components/SpicePay/index.d.ts +0 -1
- package/dist/components/SpiceWalletNotice/SpiceWalletNotice.d.ts +0 -35
- package/dist/components/SpiceWalletNotice/index.d.ts +0 -2
- package/dist/components/ui/Modal.d.ts +0 -3
- package/dist/execution/gasless.d.ts +0 -7
- package/dist/hooks/directWithdrawGate.d.ts +0 -4
- package/dist/hooks/useEmbeddedWalletAddress.d.ts +0 -2
- package/dist/hooks/useSpiceAction.d.ts +0 -55
- package/dist/hooks/useStatus.d.ts +0 -27
- package/dist/hooks/useWallet/useDynamicWallet.d.ts +0 -2
- package/dist/providers/dynamic.d.ts +0 -3
- package/dist/providers/whitelistGate.d.ts +0 -33
- package/dist/utils/portal/index.d.ts +0 -14
- package/dist/utils/rebalancing/index.d.ts +0 -70
- package/dist/utils/retry/index.d.ts +0 -1
package/dist/auth-privy.cjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";const
|
|
2
|
+
"use strict";const r=require("./privy-BdHp5Owr.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{
|
|
2
|
+
import{P as g}from"./privy-2vbGci0p.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,6 +1,4 @@
|
|
|
1
1
|
export { ProviderLogin } from "./ProviderLogin";
|
|
2
2
|
export { PrivyLogin } from "./parts/PrivyLogin";
|
|
3
|
-
export { DynamicLogin } from "./parts/DynamicLogin";
|
|
4
3
|
export type { ProviderLoginProps } from "./ProviderLogin";
|
|
5
4
|
export type { PrivyLoginProps } from "./parts/PrivyLogin";
|
|
6
|
-
export type { DynamicLoginProps } from "./parts/DynamicLogin";
|
|
@@ -39,7 +39,12 @@ export type LockExecutorContext = {
|
|
|
39
39
|
grossAmount: string;
|
|
40
40
|
grossAmountWei: bigint;
|
|
41
41
|
}) => ChainBatch[];
|
|
42
|
-
|
|
42
|
+
beginStatusTracking: (intentId: string, steps: SwapStep[]) => void;
|
|
43
|
+
applyStepUpdate: (stepIndex: number, result: {
|
|
44
|
+
status: string;
|
|
45
|
+
transactionHash?: string;
|
|
46
|
+
error?: string;
|
|
47
|
+
}) => void;
|
|
43
48
|
refreshSpiceAssets: () => void;
|
|
44
49
|
refreshWalletAssets: () => void;
|
|
45
50
|
ui: {
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { LabeledInfoRowProps } from "../../../types/lock";
|
|
3
|
+
export type { LabeledInfoRowProps };
|
|
4
|
+
export declare function formatExpiryDate(months: number): string;
|
|
5
|
+
export declare const LabeledInfoRow: React.NamedExoticComponent<LabeledInfoRowProps>;
|
|
@@ -4,9 +4,9 @@ import type { ChainBatch } from "../../../types/authorization";
|
|
|
4
4
|
import type { SelectedAsset } from "../../../types/assets";
|
|
5
5
|
import type { SpiceSupplyProps, SupplyBatchBuildOptions } from "../../../types/supply";
|
|
6
6
|
import type { ResolvedExactOutputSwap } from "../../../utils/swapQuotes";
|
|
7
|
-
import type {
|
|
7
|
+
import type { ExecutionOptions } from "../../../hooks/useSpiceExecution";
|
|
8
8
|
import type { FeeEstimateSummary } from "@spicenet-io/spiceflow-core";
|
|
9
|
-
type
|
|
9
|
+
type EstimateFn = (chainBatches: ChainBatch[], tokenAddress: string, tokenTransferAmount: bigint, options?: ExecutionOptions) => Promise<FeeEstimateSummary>;
|
|
10
10
|
export declare function stripSpicenetFundingBatches(batches: ChainBatch[]): ChainBatch[];
|
|
11
11
|
export declare function scaleTokenAmount(amount: bigint, fromDecimals: number, toDecimals: number): bigint;
|
|
12
12
|
export interface BatchBuilderContext {
|
|
@@ -33,5 +33,5 @@ export interface BatchBuilderContext {
|
|
|
33
33
|
}
|
|
34
34
|
export declare function buildPayChainBatches(ctx: BatchBuilderContext, options?: SupplyBatchBuildOptions): Promise<ChainBatch[]>;
|
|
35
35
|
export declare function buildSupplyChainBatches(ctx: BatchBuilderContext, options?: SupplyBatchBuildOptions): Promise<ChainBatch[]>;
|
|
36
|
-
export declare function estimateRequiredGrossFunding(requiredNetFunding: bigint, buildBatches: (grossFundingAmount: bigint) => ChainBatch[] | Promise<ChainBatch[]>, fundingToken: Address,
|
|
36
|
+
export declare function estimateRequiredGrossFunding(requiredNetFunding: bigint, buildBatches: (grossFundingAmount: bigint) => ChainBatch[] | Promise<ChainBatch[]>, fundingToken: Address, estimate: EstimateFn, executionOptions?: Pick<ExecutionOptions, "useCustomTransfers" | "userOverride">): Promise<bigint>;
|
|
37
37
|
export {};
|
|
@@ -4,8 +4,8 @@ import type { ChainBatch } from "../../../types/authorization";
|
|
|
4
4
|
import type { SelectedAsset } from "../../../types/assets";
|
|
5
5
|
import type { SpiceSupplyProps, SupplyBatchBuildOptions } from "../../../types/supply";
|
|
6
6
|
import type { ResolvedExactOutputSwap } from "../../../utils/swapQuotes";
|
|
7
|
-
import type {
|
|
8
|
-
import type {
|
|
7
|
+
import type { ExecutionOptions, ExecutionProgress } from "../../../hooks/useSpiceExecution";
|
|
8
|
+
import type { ExecutionRunner } from "../../../execution/runner";
|
|
9
9
|
export type SupplyStep = "idle" | "signing-delegation" | "signing-intent" | "submitting" | "executing" | "success" | "error";
|
|
10
10
|
export type PaymentResult = {
|
|
11
11
|
status: "processing" | "success" | "failed";
|
|
@@ -14,7 +14,7 @@ export type PaymentResult = {
|
|
|
14
14
|
};
|
|
15
15
|
type BuildPayBatchesFn = (options?: SupplyBatchBuildOptions) => Promise<ChainBatch[]>;
|
|
16
16
|
type BuildSupplyBatchesFn = (options?: SupplyBatchBuildOptions) => Promise<ChainBatch[]>;
|
|
17
|
-
type EstimateRequiredGrossFundingFn = (requiredNetFunding: bigint, buildBatches: (grossFundingAmount: bigint) => ChainBatch[] | Promise<ChainBatch[]>, fundingToken: Address,
|
|
17
|
+
type EstimateRequiredGrossFundingFn = (requiredNetFunding: bigint, buildBatches: (grossFundingAmount: bigint) => ChainBatch[] | Promise<ChainBatch[]>, fundingToken: Address, executionOptions?: Pick<ExecutionOptions, "useCustomTransfers" | "userOverride">) => Promise<bigint>;
|
|
18
18
|
export type ExecutorContext = {
|
|
19
19
|
selectedAsset: SelectedAsset | null;
|
|
20
20
|
parsedAmount: number;
|
|
@@ -45,11 +45,11 @@ export type ExecutorContext = {
|
|
|
45
45
|
provider: string | null | undefined;
|
|
46
46
|
resolvedChainId: number;
|
|
47
47
|
executionTokenAddress: Address;
|
|
48
|
-
|
|
48
|
+
execution: ExecutionRunner & {
|
|
49
49
|
buildPayChainBatches: BuildPayBatchesFn;
|
|
50
50
|
buildSupplyChainBatches: BuildSupplyBatchesFn;
|
|
51
51
|
estimateRequiredGrossFunding: EstimateRequiredGrossFundingFn;
|
|
52
|
-
onProgress: (progress:
|
|
52
|
+
onProgress: (progress: ExecutionProgress) => void;
|
|
53
53
|
};
|
|
54
54
|
ui: {
|
|
55
55
|
setError: Dispatch<SetStateAction<string | null>>;
|
|
@@ -6,11 +6,11 @@ import type { Asset, SelectedAsset } from "../../../types/assets";
|
|
|
6
6
|
import type { SpiceSupplyProps, SupplyBatchBuildOptions } from "../../../types/supply";
|
|
7
7
|
import type { ResolvedExactOutputSwap } from "../../../utils/swapQuotes";
|
|
8
8
|
import type { ResolvedSwap } from "@spicenet-io/spiceflow-core";
|
|
9
|
-
import type {
|
|
10
|
-
type
|
|
9
|
+
import type { ExecutionOptions } from "../../../hooks/useSpiceExecution";
|
|
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 EstimateRequiredGrossFundingFn = (requiredNetFunding: bigint, buildBatches: (grossFundingAmount: bigint) => ChainBatch[] | Promise<ChainBatch[]>, fundingToken: Address,
|
|
13
|
+
type EstimateRequiredGrossFundingFn = (requiredNetFunding: bigint, buildBatches: (grossFundingAmount: bigint) => ChainBatch[] | Promise<ChainBatch[]>, fundingToken: Address, executionOptions?: Pick<ExecutionOptions, "useCustomTransfers" | "userOverride">) => Promise<bigint>;
|
|
14
14
|
export declare function estimateSupplyMaxAmount(ctx: {
|
|
15
15
|
asset: Asset;
|
|
16
16
|
isPayMode: boolean;
|
|
@@ -19,7 +19,7 @@ export declare function estimateSupplyMaxAmount(ctx: {
|
|
|
19
19
|
isQuoting: boolean;
|
|
20
20
|
embeddedWalletAddress: string | null | undefined;
|
|
21
21
|
buildSupplyChainBatches: BuildSupplyBatchesFn;
|
|
22
|
-
|
|
22
|
+
estimate: EstimateFn;
|
|
23
23
|
executionTokenAddress: Address;
|
|
24
24
|
feeExecutionMode: SpiceSupplyProps["feeExecutionMode"];
|
|
25
25
|
}): Promise<string | null>;
|
|
@@ -49,7 +49,7 @@ export interface FeePreviewContext {
|
|
|
49
49
|
executionTokenAddress: Address;
|
|
50
50
|
buildPayChainBatches: BuildPayBatchesFn;
|
|
51
51
|
buildSupplyChainBatches: BuildSupplyBatchesFn;
|
|
52
|
-
|
|
52
|
+
estimate: EstimateFn;
|
|
53
53
|
estimateRequiredGrossFunding: EstimateRequiredGrossFundingFn;
|
|
54
54
|
}
|
|
55
55
|
export declare function estimateFeePreview(ctx: FeePreviewContext): Promise<FeePreview | null>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Dispatch, MutableRefObject, SetStateAction } from "react";
|
|
2
|
-
import type {
|
|
2
|
+
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
|
-
import type {
|
|
5
|
+
import type { ExecutionProgress } from "../../../hooks/useSpiceExecution";
|
|
6
6
|
export type WithdrawalExecutionContext = {
|
|
7
7
|
actionId: string;
|
|
8
8
|
intentId: string;
|
|
@@ -20,11 +20,11 @@ export type WithdrawExecutorContext = {
|
|
|
20
20
|
gasFee: bigint | null;
|
|
21
21
|
isNon7702: boolean;
|
|
22
22
|
buildWithdrawBatches: (withdrawalTransfersOrAmount?: bigint | SpiceWithdrawDeliveryTransfer[]) => ChainBatch[];
|
|
23
|
-
|
|
23
|
+
execution: ExecutionRunner;
|
|
24
24
|
ui: {
|
|
25
25
|
setIsExecuting: Dispatch<SetStateAction<boolean>>;
|
|
26
26
|
setExecutionError: Dispatch<SetStateAction<string | null>>;
|
|
27
|
-
setExecutionProgress: Dispatch<SetStateAction<
|
|
27
|
+
setExecutionProgress: Dispatch<SetStateAction<ExecutionProgress | null>>;
|
|
28
28
|
setLockedGasFee: Dispatch<SetStateAction<bigint | null>>;
|
|
29
29
|
};
|
|
30
30
|
executionContextRef: MutableRefObject<WithdrawalExecutionContext | null>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { Address } from "viem";
|
|
2
|
-
import type {
|
|
2
|
+
import type { ExecutionRunner } from "../../../execution/runner";
|
|
3
3
|
import type { ChainBatch } from "../../../types/authorization";
|
|
4
4
|
export declare function estimateWithdrawGasFee(ctx: {
|
|
5
5
|
batches: ChainBatch[];
|
|
6
6
|
tokenAddress: Address;
|
|
7
7
|
chainId: number;
|
|
8
|
-
|
|
8
|
+
estimate: ExecutionRunner["estimate"];
|
|
9
9
|
}): Promise<bigint>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { IntentStatus, SwapStep } from "../types/status";
|
|
2
|
+
export interface StepResult {
|
|
3
|
+
status: string;
|
|
4
|
+
transactionHash?: string;
|
|
5
|
+
error?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface UseIntentStatusConfig {
|
|
8
|
+
checkStepStatus?: (intentId: string, stepId: number) => Promise<{
|
|
9
|
+
success: boolean;
|
|
10
|
+
data: StepResult;
|
|
11
|
+
}>;
|
|
12
|
+
retryStep?: (intentId: string, stepId: number) => Promise<void>;
|
|
13
|
+
maxRetries?: number;
|
|
14
|
+
pollingInterval?: number;
|
|
15
|
+
pollTimeoutMs?: number;
|
|
16
|
+
}
|
|
17
|
+
export interface UseIntentStatusReturn {
|
|
18
|
+
intentStatus: IntentStatus | null;
|
|
19
|
+
startStatusPolling: (intentId: string, steps: SwapStep[]) => void;
|
|
20
|
+
beginStatusTracking: (intentId: string, steps: SwapStep[]) => void;
|
|
21
|
+
applyStepUpdate: (stepIndex: number, result: StepResult) => void;
|
|
22
|
+
stopStatusPolling: () => void;
|
|
23
|
+
clearStatus: () => void;
|
|
24
|
+
}
|
|
25
|
+
export declare function shouldExpirePoll(args: {
|
|
26
|
+
now: number;
|
|
27
|
+
lastProgressAt: number;
|
|
28
|
+
pollTimeoutMs: number;
|
|
29
|
+
}): boolean;
|
|
30
|
+
export declare function applyStepResult(current: IntentStatus, stepIndex: number, result: StepResult): IntentStatus;
|
|
31
|
+
export declare function useIntentStatus({ checkStepStatus, retryStep, maxRetries, pollingInterval, pollTimeoutMs, }: UseIntentStatusConfig): UseIntentStatusReturn;
|
|
@@ -10,6 +10,11 @@ export type PollIntentStepOptions = {
|
|
|
10
10
|
pollsBeforeRetry?: number;
|
|
11
11
|
maxConsecutiveStatusErrors?: number;
|
|
12
12
|
onStatusMessage?: (message: string, txHash?: string) => void;
|
|
13
|
+
onStepUpdate?: (result: {
|
|
14
|
+
status: string;
|
|
15
|
+
transactionHash?: string;
|
|
16
|
+
error?: string;
|
|
17
|
+
}) => void;
|
|
13
18
|
signal?: AbortSignal;
|
|
14
19
|
chainId?: number;
|
|
15
20
|
};
|
|
@@ -24,5 +29,10 @@ export declare function runAllIntentSteps(options: {
|
|
|
24
29
|
maxExecuteAttemptsForStep?: (stepIndex: number) => number;
|
|
25
30
|
maxPolls?: number;
|
|
26
31
|
onStatusMessage?: (message: string, txHash?: string) => void;
|
|
32
|
+
onStepUpdate?: (stepIndex: number, result: {
|
|
33
|
+
status: string;
|
|
34
|
+
transactionHash?: string;
|
|
35
|
+
error?: string;
|
|
36
|
+
}) => void;
|
|
27
37
|
signal?: AbortSignal;
|
|
28
38
|
}): Promise<string | undefined>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { FeeEstimateSummary } from "@spicenet-io/spiceflow-core";
|
|
2
|
+
import type { ChainBatch } from "../types/authorization";
|
|
3
|
+
import type { ExecutionOptions, ExecutionProgress } from "../hooks/useSpiceExecution";
|
|
4
|
+
export type ExecutionRunner = {
|
|
5
|
+
estimate: (chainBatches: ChainBatch[], tokenAddress: string, tokenTransferAmount: bigint, options?: ExecutionOptions) => Promise<FeeEstimateSummary>;
|
|
6
|
+
execute: (chainBatches: ChainBatch[], tokenAddress: string, tokenTransferAmount: bigint, onProgress?: (progress: ExecutionProgress) => void, signal?: AbortSignal, options?: ExecutionOptions) => Promise<string>;
|
|
7
|
+
};
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -3,12 +3,10 @@ export { useAssetInput } from "./useAssetInput";
|
|
|
3
3
|
export type { UseAssetInputReturn } from "./useAssetInput";
|
|
4
4
|
export { useWallet } from "./useWallet";
|
|
5
5
|
export type { UseWalletReturn, WalletState, WalletActions } from "./useWallet";
|
|
6
|
-
export { useEmbeddedWalletAddress } from "./useEmbeddedWalletAddress";
|
|
7
6
|
export { useSpiceAssets } from "./useSpiceAssets";
|
|
8
7
|
export type { UseSpiceAssetsConfig, UseSpiceAssetsReturn, } from "./useSpiceAssets";
|
|
9
8
|
export { useSpiceExecution } from "./useSpiceExecution";
|
|
10
|
-
export {
|
|
11
|
-
export type { GaslessProgress, GaslessStep, GaslessExecutionOptions, OnProgress, } from "./useSpiceExecution";
|
|
9
|
+
export type { ExecutionProgress, ExecutionStep, ExecutionOptions, OnProgress, } from "./useSpiceExecution";
|
|
12
10
|
export { useLockDuration } from "./useLockDuration";
|
|
13
11
|
export type { UseLockDurationReturn } from "./useLockDuration";
|
|
14
12
|
export type { VerifiedPendingDeposit } from "./usePendingDeposit";
|
|
@@ -19,7 +17,5 @@ export { useSmartWallet } from "./useSmartWallet";
|
|
|
19
17
|
export { useIsUserWhitelisted } from "./useIsUserWhitelisted";
|
|
20
18
|
export type { PartnerWhitelistCheckResponse, UseIsUserWhitelistedOptions, } from "./useIsUserWhitelisted";
|
|
21
19
|
export { useSupplyAssets, isSupportedSupplyAsset } from "./useSupplyAssets";
|
|
22
|
-
export { useSupplyQuote, resolveInputSupplySwapQuote
|
|
23
|
-
export type { UseSupplyQuoteOpts, SupplyQuoteResult
|
|
24
|
-
export { useSpiceAction, useSupply, usePay, useRepay, } from "./useSpiceAction";
|
|
25
|
-
export type { UseSpiceActionOpts, UseSpiceActionReturn, SpiceActionQuote, UseSupplyOpts, UsePayOpts, UseRepayOpts, } from "./useSpiceAction";
|
|
20
|
+
export { useSupplyQuote, resolveInputSupplySwapQuote } from "./useSupplyQuote";
|
|
21
|
+
export type { UseSupplyQuoteOpts, SupplyQuoteResult } from "./useSupplyQuote";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Address } from "viem";
|
|
2
|
-
import { type
|
|
2
|
+
import { type ExecutionProgress } from "./useSpiceExecution";
|
|
3
3
|
export interface DirectWithdrawParams {
|
|
4
4
|
tokenAddress: Address | string;
|
|
5
5
|
chainId: number;
|
|
6
6
|
balance: bigint;
|
|
7
7
|
recipient: Address | string;
|
|
8
|
-
onProgress?: (progress:
|
|
8
|
+
onProgress?: (progress: ExecutionProgress) => void;
|
|
9
9
|
}
|
|
10
10
|
export declare function useDirectWithdraw(): {
|
|
11
11
|
withdraw: ({ tokenAddress, chainId, balance, recipient, onProgress, }: DirectWithdrawParams) => Promise<string>;
|
|
@@ -2,9 +2,9 @@ import { Address } from "viem";
|
|
|
2
2
|
import { ChainBatch, Call } from "../types/authorization";
|
|
3
3
|
import type { FeeEstimateSummary } from "@spicenet-io/spiceflow-core";
|
|
4
4
|
export type { Call, ChainBatch };
|
|
5
|
-
export type
|
|
6
|
-
export interface
|
|
7
|
-
step:
|
|
5
|
+
export type ExecutionStep = "idle" | "building" | "signing-delegation" | "signing-intent" | "submitting" | "executing" | "confirming-rollup" | "success" | "error";
|
|
6
|
+
export interface ExecutionProgress {
|
|
7
|
+
step: ExecutionStep;
|
|
8
8
|
message: string;
|
|
9
9
|
txHash?: string;
|
|
10
10
|
error?: string;
|
|
@@ -13,8 +13,8 @@ export interface GaslessProgress {
|
|
|
13
13
|
intentIndex?: number;
|
|
14
14
|
totalSteps?: number;
|
|
15
15
|
}
|
|
16
|
-
export type OnProgress = (progress:
|
|
17
|
-
export interface
|
|
16
|
+
export type OnProgress = (progress: ExecutionProgress) => void;
|
|
17
|
+
export interface ExecutionOptions {
|
|
18
18
|
depositToEscrow?: {
|
|
19
19
|
token: Address;
|
|
20
20
|
amount: bigint;
|
|
@@ -33,8 +33,13 @@ export interface GaslessExecutionOptions {
|
|
|
33
33
|
skipUserFundingPreflight?: boolean;
|
|
34
34
|
}
|
|
35
35
|
export declare function useSpiceExecution(): {
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
execute: (chainBatches: ChainBatch[], tokenAddress: string, tokenTransferAmount: bigint, onProgress?: OnProgress, signal?: AbortSignal, options?: ExecutionOptions) => Promise<string>;
|
|
37
|
+
estimate: (chainBatches: ChainBatch[], tokenAddress: string, tokenTransferAmount: bigint, options?: ExecutionOptions) => Promise<FeeEstimateSummary>;
|
|
38
38
|
lastFeeEstimate: FeeEstimateSummary | null;
|
|
39
39
|
hasEmbeddedWallet: boolean;
|
|
40
|
+
intentStatus: import("../types").IntentStatus | null;
|
|
41
|
+
startStatusPolling: (intentId: string, steps: import("../types").SwapStep[]) => void;
|
|
42
|
+
beginStatusTracking: (intentId: string, steps: import("../types").SwapStep[]) => void;
|
|
43
|
+
applyStepUpdate: (stepIndex: number, result: import("../execution/intentStatus").StepResult) => void;
|
|
44
|
+
clearStatus: () => void;
|
|
40
45
|
};
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { type Address } from "viem";
|
|
2
2
|
import type { Asset } from "../types/assets";
|
|
3
3
|
export declare function isSupportedSupplyAsset(asset: Pick<Asset, "address" | "chainTokens">, supportedSourceAssets?: string[]): boolean;
|
|
4
|
+
type DestinationToken = {
|
|
5
|
+
address: Address;
|
|
6
|
+
decimals: number;
|
|
7
|
+
symbol: string;
|
|
8
|
+
chainId: number;
|
|
9
|
+
logoURI?: string;
|
|
10
|
+
};
|
|
4
11
|
export declare function useSupplyAssets(opts: {
|
|
5
12
|
address: string | undefined;
|
|
6
|
-
destinationToken:
|
|
7
|
-
address: Address;
|
|
8
|
-
decimals: number;
|
|
9
|
-
symbol: string;
|
|
10
|
-
chainId: number;
|
|
11
|
-
logoURI?: string;
|
|
12
|
-
};
|
|
13
|
+
destinationToken: DestinationToken;
|
|
13
14
|
supportedSourceAssets?: string[];
|
|
14
15
|
sourceChains?: number[];
|
|
15
16
|
enabled: boolean;
|
|
@@ -25,3 +26,4 @@ export declare function useSupplyAssets(opts: {
|
|
|
25
26
|
refreshSpiceAssets: () => Promise<void>;
|
|
26
27
|
refreshWalletAssets: () => void;
|
|
27
28
|
};
|
|
29
|
+
export {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Address } from "viem";
|
|
2
|
-
import { Authorization } from "
|
|
2
|
+
import { Authorization } from "../types/authorization";
|
|
3
3
|
export interface WalletState {
|
|
4
4
|
isReady: boolean;
|
|
5
5
|
isAuthenticated: boolean;
|
|
6
6
|
isConnected: boolean;
|
|
7
7
|
address?: Address;
|
|
8
|
-
provider: "privy" |
|
|
8
|
+
provider: "privy" | null;
|
|
9
9
|
}
|
|
10
10
|
export type SignableMessage = string | {
|
|
11
11
|
raw: `0x${string}`;
|