@spicenet-io/spiceflow-ui 4.0.14 → 4.1.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/executors.d.ts +2 -1
- package/dist/components/SpiceLock/lib/executors.d.ts +1 -6
- package/dist/components/SpiceSupply/lib/executors.d.ts +2 -10
- package/dist/components/SpiceSupply/parts/SupplyStepStatusCard.d.ts +20 -0
- package/dist/components/SpiceWithdraw/SpiceWithdraw.d.ts +0 -1
- package/dist/components/SpiceWithdraw/parts/WithdrawBalanceCardHeader.d.ts +12 -0
- package/dist/components/SpiceWithdraw/parts/WithdrawDestinationCard.d.ts +28 -0
- package/dist/components/SpiceWithdraw/parts/WithdrawSourceCard.d.ts +34 -0
- package/dist/components/SpiceWithdraw/parts/WithdrawSubtitle.d.ts +8 -0
- package/dist/components/ui/AmountText.d.ts +0 -1
- package/dist/components/ui/PercentageDial.d.ts +8 -0
- package/dist/components/ui/WarningBanner.d.ts +16 -0
- package/dist/components/ui/icons.d.ts +3 -0
- package/dist/components/ui/index.d.ts +1 -1
- package/dist/execution/externalWalletClient.d.ts +21 -0
- package/dist/execution/fundEmbeddedWallet.d.ts +7 -0
- package/dist/execution/intentSigning.d.ts +12 -0
- package/dist/execution/intentStatus.d.ts +0 -6
- package/dist/execution/pollIntentStep.d.ts +2 -3
- package/dist/hooks/useDebouncedEstimate.d.ts +12 -0
- package/dist/hooks/useLockWalletAssets.d.ts +18 -0
- package/dist/index.cjs.js +21 -44
- package/dist/index.d.ts +7 -11
- package/dist/index.js +25 -48
- package/dist/privy-COlZvldu.js +2 -0
- package/dist/privy-JCBW-mP2.js +2 -0
- package/dist/types/deposit.d.ts +3 -2
- package/dist/types/lock.d.ts +2 -1
- package/dist/types/status.d.ts +1 -0
- package/dist/types/supply.d.ts +6 -1
- package/dist/types/withdraw.d.ts +2 -15
- package/dist/utils/actionOutputEscrowFunding.d.ts +0 -7
- package/dist/utils/amounts.d.ts +1 -0
- package/dist/utils/chains/index.d.ts +0 -1
- package/dist/utils/crossChainRouter/index.d.ts +0 -1
- package/dist/utils/crossChainRouter/liquidityVenues.d.ts +0 -2
- package/dist/utils/crossChainRouter/uniV3.d.ts +0 -4
- package/dist/utils/errors.d.ts +8 -0
- package/dist/utils/logos.d.ts +0 -4
- package/dist/utils/relayer/index.d.ts +4 -1
- package/package.json +2 -16
- package/dist/privy-BdHp5Owr.js +0 -0
- package/dist/privy-Ds5DCgFX.js +0 -0
- package/dist/utils/crossChainRouter/buildIntent.d.ts +0 -34
- package/dist/utils/crossChainRouter/executeSwapThenAction.d.ts +0 -17
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-JCBW-mP2.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-COlZvldu.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 { Address } from "viem";
|
|
2
2
|
import { SelectedAsset } from "../../../types/assets";
|
|
3
|
+
import type { ExecutionRunner } from "../../../execution/runner";
|
|
3
4
|
import type { DepositConfirmationData } from "../steps/DepositStatusModal";
|
|
4
5
|
import type { DepositModalProps } from "../../../types";
|
|
5
6
|
export interface DepositFee {
|
|
@@ -57,7 +58,7 @@ export interface DepositExecutorContext {
|
|
|
57
58
|
onDepositExecute?: (amount: string) => Promise<void> | void;
|
|
58
59
|
onDepositSelect?: (asset: any) => void;
|
|
59
60
|
onDepositSuccess?: (detail: any) => void;
|
|
60
|
-
|
|
61
|
+
execution: Pick<ExecutionRunner, "execute">;
|
|
61
62
|
getCurrentIntentStatus: () => any;
|
|
62
63
|
getCurrentPostDepositStatus: () => string;
|
|
63
64
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Dispatch, SetStateAction } from "react";
|
|
2
2
|
import { type Address } from "viem";
|
|
3
|
-
import type {
|
|
3
|
+
import type { ChainBatch } from "../../../types/authorization";
|
|
4
4
|
import type { SelectedAsset } from "../../../types/assets";
|
|
5
5
|
import type { LockDurationOption, SpiceLockModalProps } from "../../../types/lock";
|
|
6
6
|
import type { FeePreview } from "../../../types/ui";
|
|
@@ -53,10 +53,5 @@ export type LockExecutorContext = {
|
|
|
53
53
|
setShowStatusPanel: Dispatch<SetStateAction<boolean>>;
|
|
54
54
|
};
|
|
55
55
|
} & Pick<SpiceLockModalProps, "onLockExecute" | "onLockSuccess" | "buildSpicenetBatch">;
|
|
56
|
-
export declare function run7702LockIntent(ctx: LockExecutorContext, batches: ChainBatch[], preSignedAuthorizations?: Authorization[]): Promise<void>;
|
|
57
|
-
export declare function executeLock(ctx: LockExecutorContext): Promise<void>;
|
|
58
|
-
export declare function executeEmbeddedDepositLock(ctx: LockExecutorContext): Promise<void>;
|
|
59
|
-
export declare function executeSemi7702Lock(ctx: LockExecutorContext): Promise<void>;
|
|
60
56
|
export declare function estimateLockFees(ctx: LockExecutorContext): Promise<FeePreview | null>;
|
|
61
|
-
export declare function executeDirectExternalLock(ctx: LockExecutorContext): Promise<void>;
|
|
62
57
|
export declare function handleConvert(ctx: LockExecutorContext): Promise<void>;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import type { Dispatch, MutableRefObject, SetStateAction } from "react";
|
|
2
2
|
import { type Address } from "viem";
|
|
3
|
-
import type { ChainBatch } from "../../../types/authorization";
|
|
4
3
|
import type { SelectedAsset } from "../../../types/assets";
|
|
5
|
-
import type {
|
|
4
|
+
import type { BuildPayBatchesFn, BuildSupplyBatchesFn, EstimateRequiredGrossFundingFn, SpiceSupplyProps } from "../../../types/supply";
|
|
6
5
|
import type { ResolvedExactOutputSwap } from "../../../utils/swapQuotes";
|
|
7
|
-
import type {
|
|
6
|
+
import type { ExecutionProgress } from "../../../hooks/useSpiceExecution";
|
|
8
7
|
import type { ExecutionRunner } from "../../../execution/runner";
|
|
9
8
|
export type SupplyStep = "idle" | "signing-delegation" | "signing-intent" | "submitting" | "executing" | "success" | "error";
|
|
10
9
|
export type PaymentResult = {
|
|
@@ -12,9 +11,6 @@ export type PaymentResult = {
|
|
|
12
11
|
txHash?: string;
|
|
13
12
|
error?: string;
|
|
14
13
|
};
|
|
15
|
-
type BuildPayBatchesFn = (options?: SupplyBatchBuildOptions) => Promise<ChainBatch[]>;
|
|
16
|
-
type BuildSupplyBatchesFn = (options?: SupplyBatchBuildOptions) => Promise<ChainBatch[]>;
|
|
17
|
-
type EstimateRequiredGrossFundingFn = (requiredNetFunding: bigint, buildBatches: (grossFundingAmount: bigint) => ChainBatch[] | Promise<ChainBatch[]>, fundingToken: Address, executionOptions?: Pick<ExecutionOptions, "useCustomTransfers" | "userOverride">) => Promise<bigint>;
|
|
18
14
|
export type ExecutorContext = {
|
|
19
15
|
selectedAsset: SelectedAsset | null;
|
|
20
16
|
parsedAmount: number;
|
|
@@ -66,8 +62,4 @@ export type ExecutorContext = {
|
|
|
66
62
|
};
|
|
67
63
|
} & Pick<SpiceSupplyProps, "destinationToken" | "buildActionCalls" | "feeExecutionMode" | "buildSpicenetBatch" | "onPayExecute" | "onSuccess">;
|
|
68
64
|
export declare function executeSupply(ctx: ExecutorContext): Promise<void>;
|
|
69
|
-
export declare function executeNon7702Supply(ctx: ExecutorContext, signal?: AbortSignal): Promise<void>;
|
|
70
|
-
export declare function executeDirectExternalAction(ctx: ExecutorContext): Promise<`0x${string}` | undefined>;
|
|
71
|
-
export declare function executeNon7702Pay(ctx: ExecutorContext): Promise<string>;
|
|
72
65
|
export declare function executePay(ctx: ExecutorContext): Promise<void>;
|
|
73
|
-
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { ResolvedDarkPalette } from "../../../utils/theme";
|
|
3
|
+
import type { SupplyStep } from "../lib/executors";
|
|
4
|
+
export declare const STEP_LABELS: Record<SupplyStep, string>;
|
|
5
|
+
export declare const PROGRESS_STEPS: SupplyStep[];
|
|
6
|
+
export declare const SupplyStepStatusCard: React.FC<{
|
|
7
|
+
step: SupplyStep;
|
|
8
|
+
statusMsg: string;
|
|
9
|
+
txHash: string | null;
|
|
10
|
+
explorerUrl: string;
|
|
11
|
+
currentStepIdx: number;
|
|
12
|
+
palette: ResolvedDarkPalette;
|
|
13
|
+
cardBg: string;
|
|
14
|
+
cardBorder: string;
|
|
15
|
+
textPrimary: string;
|
|
16
|
+
textSecondary: string;
|
|
17
|
+
fontFamily: string;
|
|
18
|
+
primaryColor: string;
|
|
19
|
+
onRetry: () => void;
|
|
20
|
+
}>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { ResolvedDarkPalette } from "../../../utils/theme";
|
|
3
|
+
interface WithdrawBalanceCardHeaderProps {
|
|
4
|
+
label: string;
|
|
5
|
+
spiceAssetsLoading: boolean;
|
|
6
|
+
totalSelectedBalance: number;
|
|
7
|
+
onOpenBalancePopover: (anchor: HTMLElement | null) => void;
|
|
8
|
+
dark: boolean;
|
|
9
|
+
dk: ResolvedDarkPalette;
|
|
10
|
+
}
|
|
11
|
+
export declare const WithdrawBalanceCardHeader: React.FC<WithdrawBalanceCardHeaderProps>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { ResolvedDarkPalette } from "../../../utils/theme";
|
|
3
|
+
import type { DestinationToken } from "../../../types/withdraw";
|
|
4
|
+
interface WithdrawDestinationCardProps {
|
|
5
|
+
header: React.ReactNode;
|
|
6
|
+
amount: string;
|
|
7
|
+
receiveAmountDisplay: string;
|
|
8
|
+
receiveUsdEstimate: string;
|
|
9
|
+
selectedDestToken: DestinationToken | null;
|
|
10
|
+
destTokenSymbol: string;
|
|
11
|
+
destChainName: string;
|
|
12
|
+
destChainLogo: string | null;
|
|
13
|
+
compatibleDestinationChains: number[];
|
|
14
|
+
networkSwitchRef: React.RefObject<HTMLButtonElement>;
|
|
15
|
+
onOpenNetworkPopover: (anchor: HTMLButtonElement | null) => void;
|
|
16
|
+
showNetworkPopover: boolean;
|
|
17
|
+
setShowNetworkPopover: React.Dispatch<React.SetStateAction<boolean>>;
|
|
18
|
+
networkPopoverPos: {
|
|
19
|
+
top: number;
|
|
20
|
+
left: number;
|
|
21
|
+
} | null;
|
|
22
|
+
selectedChainId: number | null;
|
|
23
|
+
setSelectedChainId: React.Dispatch<React.SetStateAction<number | null>>;
|
|
24
|
+
dark: boolean;
|
|
25
|
+
dk: ResolvedDarkPalette;
|
|
26
|
+
}
|
|
27
|
+
export declare const WithdrawDestinationCard: React.FC<WithdrawDestinationCardProps>;
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { ResolvedDarkPalette } from "../../../utils/theme";
|
|
3
|
+
import type { Asset } from "../../../types/assets";
|
|
4
|
+
interface WithdrawSourceCardProps {
|
|
5
|
+
header: React.ReactNode;
|
|
6
|
+
amount: string;
|
|
7
|
+
setAmount: React.Dispatch<React.SetStateAction<string>>;
|
|
8
|
+
isInsufficient: boolean;
|
|
9
|
+
sourceAmountDecimals: number | undefined;
|
|
10
|
+
selectedSourceAsset: Asset | null;
|
|
11
|
+
resolvedSelectedSourceAsset: Asset | null;
|
|
12
|
+
spiceAssets: Asset[];
|
|
13
|
+
setSelectedSourceAsset: React.Dispatch<React.SetStateAction<Asset | null>>;
|
|
14
|
+
sourceUsdEstimate: string;
|
|
15
|
+
sourceTokenLabel: string;
|
|
16
|
+
sourceChainLabel: string;
|
|
17
|
+
totalSelectedBalance: number;
|
|
18
|
+
showSourceTokenPopover: boolean;
|
|
19
|
+
setShowSourceTokenPopover: React.Dispatch<React.SetStateAction<boolean>>;
|
|
20
|
+
tokenPopoverPos: {
|
|
21
|
+
top: number;
|
|
22
|
+
left: number;
|
|
23
|
+
} | null;
|
|
24
|
+
setTokenPopoverPos: React.Dispatch<React.SetStateAction<{
|
|
25
|
+
top: number;
|
|
26
|
+
left: number;
|
|
27
|
+
} | null>>;
|
|
28
|
+
tokenTriggerRef: React.RefObject<HTMLDivElement>;
|
|
29
|
+
primaryColor: string;
|
|
30
|
+
dark: boolean;
|
|
31
|
+
dk: ResolvedDarkPalette;
|
|
32
|
+
}
|
|
33
|
+
export declare const WithdrawSourceCard: React.FC<WithdrawSourceCardProps>;
|
|
34
|
+
export {};
|
|
@@ -23,6 +23,5 @@ type AmountTextProps = {
|
|
|
23
23
|
title?: string;
|
|
24
24
|
style?: React.CSSProperties;
|
|
25
25
|
};
|
|
26
|
-
export declare function getAmountTextFontSize(value: string, maxFontSize?: number, minFontSize?: number): number;
|
|
27
26
|
export declare const AmountText: React.FC<AmountTextProps>;
|
|
28
27
|
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { ResolvedDarkPalette } from "../../utils/theme";
|
|
3
|
+
export declare const WarningActionCard: React.FC<{
|
|
4
|
+
dk: ResolvedDarkPalette;
|
|
5
|
+
dark: boolean;
|
|
6
|
+
message: React.ReactNode;
|
|
7
|
+
buttonLabel: string;
|
|
8
|
+
onAction: () => void;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
}>;
|
|
11
|
+
export declare const WarningNote: React.FC<{
|
|
12
|
+
dk: ResolvedDarkPalette;
|
|
13
|
+
dark: boolean;
|
|
14
|
+
borderRadius: string;
|
|
15
|
+
children: React.ReactNode;
|
|
16
|
+
}>;
|
|
@@ -10,4 +10,7 @@ export interface IconProps {
|
|
|
10
10
|
export declare const ChevronIcon: React.FC<IconProps & {
|
|
11
11
|
direction?: "down" | "up";
|
|
12
12
|
}>;
|
|
13
|
+
export declare const SearchIcon: React.FC<IconProps>;
|
|
14
|
+
export declare const ChevronDownIcon: React.FC<IconProps>;
|
|
15
|
+
export declare const ChevronRightIcon: React.FC<IconProps>;
|
|
13
16
|
export declare const CheckIcon: React.FC<IconProps>;
|
|
@@ -4,7 +4,7 @@ export { Spinner } from "./Spinner";
|
|
|
4
4
|
export { StatusBanner } from "./StatusBanner";
|
|
5
5
|
export { DetailRow } from "./DetailRow";
|
|
6
6
|
export { AddFundsLink } from "./AddFundsLink";
|
|
7
|
-
export { AmountText
|
|
7
|
+
export { AmountText } from "./AmountText";
|
|
8
8
|
export { CloseIcon } from "./CloseIcon";
|
|
9
9
|
export { SearchInput } from "./SearchInput";
|
|
10
10
|
export type { SearchInputProps } from "./SearchInput";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type Address } from "viem";
|
|
2
|
+
import type { Call } from "../types/authorization";
|
|
3
|
+
export declare function createExternalWalletClient(params: {
|
|
4
|
+
wallet?: {
|
|
5
|
+
getEthereumProvider: () => Promise<any>;
|
|
6
|
+
} | null;
|
|
7
|
+
provider?: any;
|
|
8
|
+
account: Address;
|
|
9
|
+
chainId: number;
|
|
10
|
+
onSwitch?: () => void;
|
|
11
|
+
}): Promise<{
|
|
12
|
+
extWc: any;
|
|
13
|
+
viemChain?: any;
|
|
14
|
+
}>;
|
|
15
|
+
export declare function sendCallsWithExternalWallet(params: {
|
|
16
|
+
extWc: any;
|
|
17
|
+
client: any;
|
|
18
|
+
calls: Call[];
|
|
19
|
+
viemChain?: any;
|
|
20
|
+
errorMessage: string;
|
|
21
|
+
}): Promise<`0x${string}` | undefined>;
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
import { type Address } from "viem";
|
|
2
|
+
export declare function sendTokenTransferTx(extWc: any, params: {
|
|
3
|
+
recipient: Address;
|
|
4
|
+
tokenAddr: Address;
|
|
5
|
+
isNative: boolean;
|
|
6
|
+
amount: bigint;
|
|
7
|
+
viemChain?: unknown;
|
|
8
|
+
}): Promise<`0x${string}`>;
|
|
2
9
|
export declare function fundEmbeddedWallet(params: {
|
|
3
10
|
extWc: any;
|
|
4
11
|
sourceClient: any;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type Address, type Hex } from "viem";
|
|
2
|
+
import type { ChainAuthorization, ChainBatch } from "../types/authorization";
|
|
3
|
+
import type { WalletActions } from "../hooks/useWallet";
|
|
4
|
+
export declare function build7702IntentDigest(chainBatches: ChainBatch[], exp: bigint): `0x${string}`;
|
|
5
|
+
export declare function sign7702IntentDigest(actions: Pick<WalletActions, "signMessage">, chainBatches: ChainBatch[], exp: bigint, signal?: AbortSignal): Promise<Hex>;
|
|
6
|
+
export declare function getChainAuthorizations(params: {
|
|
7
|
+
chainBatches: ChainBatch[];
|
|
8
|
+
signingAddress: Address;
|
|
9
|
+
actions: Pick<WalletActions, "signAuthorization">;
|
|
10
|
+
cache?: Map<string, ChainAuthorization>;
|
|
11
|
+
signal?: AbortSignal;
|
|
12
|
+
}): Promise<ChainAuthorization[]>;
|
|
@@ -22,10 +22,4 @@ export interface UseIntentStatusReturn {
|
|
|
22
22
|
stopStatusPolling: () => void;
|
|
23
23
|
clearStatus: () => void;
|
|
24
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
25
|
export declare function useIntentStatus({ checkStepStatus, retryStep, maxRetries, pollingInterval, pollTimeoutMs, }: UseIntentStatusConfig): UseIntentStatusReturn;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const STEP_POLL_MS = 2500;
|
|
3
|
-
export type PollIntentStepOptions = {
|
|
1
|
+
type PollIntentStepOptions = {
|
|
4
2
|
actionId: string;
|
|
5
3
|
intentIndex: number;
|
|
6
4
|
intentId: string;
|
|
@@ -36,3 +34,4 @@ export declare function runAllIntentSteps(options: {
|
|
|
36
34
|
}) => void;
|
|
37
35
|
signal?: AbortSignal;
|
|
38
36
|
}): Promise<string | undefined>;
|
|
37
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare function useDebouncedEstimate(opts: {
|
|
2
|
+
shouldRun: boolean;
|
|
3
|
+
deps: readonly unknown[];
|
|
4
|
+
delayMs?: number;
|
|
5
|
+
backgroundIntervalMs?: number;
|
|
6
|
+
onSkip?: () => void;
|
|
7
|
+
onCleanup?: () => void;
|
|
8
|
+
run: (ctx: {
|
|
9
|
+
isBackground: boolean;
|
|
10
|
+
isCurrent: () => boolean;
|
|
11
|
+
}) => Promise<void> | void;
|
|
12
|
+
}): void;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type Address } from "viem";
|
|
2
|
+
import type { Asset } from "../types/assets";
|
|
3
|
+
export declare function useLockWalletAssets(params: {
|
|
4
|
+
isOpen: boolean;
|
|
5
|
+
includeWalletAssets: boolean;
|
|
6
|
+
isWhitelistGateActive: boolean;
|
|
7
|
+
isSemi7702: boolean;
|
|
8
|
+
destinationTokenAddress?: string;
|
|
9
|
+
sourceAssets: Address[];
|
|
10
|
+
sourceChains: number[];
|
|
11
|
+
walletAddressForAssets: string | null | undefined;
|
|
12
|
+
lockChainId: number;
|
|
13
|
+
lockTokenSymbol?: string;
|
|
14
|
+
lockTokenLogoURI?: string;
|
|
15
|
+
}): {
|
|
16
|
+
walletAssets: Asset[];
|
|
17
|
+
refreshWalletAssets: () => void;
|
|
18
|
+
};
|