@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.
Files changed (77) hide show
  1. package/dist/Button-CkSwrat1.js +2 -0
  2. package/dist/Button-jx5yrM-s.js +2 -0
  3. package/dist/auth-dynamic.cjs.js +1 -1
  4. package/dist/auth-dynamic.js +1 -1
  5. package/dist/auth-privy.cjs.js +1 -1
  6. package/dist/auth-privy.js +1 -1
  7. package/dist/components/AccountDisplay/{parts/AccountCustomSection.d.ts → AccountCustomSection.d.ts} +2 -2
  8. package/dist/components/AccountDisplay/{parts/AccountHeader.d.ts → AccountHeader.d.ts} +1 -1
  9. package/dist/components/AccountDisplay/{parts/AccountIdleBalances.d.ts → AccountIdleBalances.d.ts} +2 -2
  10. package/dist/components/AccountDisplay/{parts/AccountPanel.d.ts → AccountPanel.d.ts} +3 -3
  11. package/dist/components/AccountDisplay/{parts/AccountPendingDeposits.d.ts → AccountPendingDeposits.d.ts} +2 -2
  12. package/dist/components/AccountDisplay/types.d.ts +0 -1
  13. package/dist/components/AssetSelector/{parts/AssetDropdown.d.ts → AssetDropdown.d.ts} +1 -1
  14. package/dist/components/AssetSelector/{parts/ChainIcon.d.ts → ChainIcon.d.ts} +1 -1
  15. package/dist/components/AssetSelector/{parts/TokenIcon.d.ts → TokenIcon.d.ts} +1 -1
  16. package/dist/components/AssetSelector/index.d.ts +3 -3
  17. package/dist/components/ProviderLogins/{parts/DynamicLogin.d.ts → DynamicLogin.d.ts} +1 -1
  18. package/dist/components/ProviderLogins/{parts/PrivyLogin.d.ts → PrivyLogin.d.ts} +1 -1
  19. package/dist/components/ProviderLogins/index.d.ts +2 -4
  20. package/dist/components/SpiceBalance/index.d.ts +2 -2
  21. package/dist/components/SpiceDeposit/{steps/ConnectWalletModal.d.ts → ConnectWalletModal.d.ts} +1 -1
  22. package/dist/components/SpiceDeposit/{steps/DepositModal.d.ts → DepositModal.d.ts} +1 -1
  23. package/dist/components/SpiceDeposit/{steps/DepositRecoveryPrompt.d.ts → DepositRecoveryPrompt.d.ts} +1 -1
  24. package/dist/components/SpiceDeposit/{steps/DepositStatusModal.d.ts → DepositStatusModal.d.ts} +3 -3
  25. package/dist/components/SpiceDeposit/{steps/SelectChainModal.d.ts → SelectChainModal.d.ts} +1 -1
  26. package/dist/components/SpiceDeposit/{steps/SelectTokenModal.d.ts → SelectTokenModal.d.ts} +1 -1
  27. package/dist/components/SpiceDeposit/{lib/depositBatches.d.ts → depositBatches.d.ts} +3 -3
  28. package/dist/components/SpiceDeposit/{lib/executors.d.ts → executors.d.ts} +3 -3
  29. package/dist/components/SpiceDeposit/{lib/feePreview.d.ts → feePreview.d.ts} +1 -1
  30. package/dist/components/SpiceDeposit/index.d.ts +3 -3
  31. package/dist/components/SpiceDeposit/views/DepositSubtitle.d.ts +9 -0
  32. package/dist/components/SpiceLock/{parts/LockConfirmationPanel.d.ts → LockConfirmationPanel.d.ts} +1 -1
  33. package/dist/components/SpiceLock/{parts/LockDurationSlider.d.ts → LockDurationSlider.d.ts} +1 -1
  34. package/dist/components/SpiceLock/{parts/LockExpiryRow.d.ts → LockExpiryRow.d.ts} +1 -1
  35. package/dist/components/SpiceLock/{parts/VotingPowerRow.d.ts → VotingPowerRow.d.ts} +1 -1
  36. package/dist/components/SpiceLock/{lib/executors.d.ts → executors.d.ts} +14 -13
  37. package/dist/components/SpiceLock/{lib/helpers.d.ts → helpers.d.ts} +2 -2
  38. package/dist/components/SpiceSupply/{parts/DestinationEstimate.d.ts → DestinationEstimate.d.ts} +2 -2
  39. package/dist/components/SpiceSupply/{parts/SupplyEstimate.d.ts → SupplyEstimate.d.ts} +1 -1
  40. package/dist/components/SpiceSupply/{lib/buildBatches.d.ts → buildBatches.d.ts} +10 -8
  41. package/dist/components/SpiceSupply/executors.d.ts +73 -0
  42. package/dist/components/SpiceSupply/{lib/feePreview.d.ts → feePreview.d.ts} +11 -9
  43. package/dist/components/SpiceWithdraw/{parts/SelectPopover.d.ts → SelectPopover.d.ts} +1 -1
  44. package/dist/components/SpiceWithdraw/executors.d.ts +50 -0
  45. package/dist/components/StatusDisplay/{parts/StatusIcon.d.ts → StatusIcon.d.ts} +1 -1
  46. package/dist/components/StatusDisplay/{parts/StatusPanel.d.ts → StatusPanel.d.ts} +1 -1
  47. package/dist/components/StatusDisplay/{parts/StepItem.d.ts → StepItem.d.ts} +1 -1
  48. package/dist/components/StatusDisplay/index.d.ts +2 -3
  49. package/dist/hooks/useSpiceExecution.d.ts +0 -1
  50. package/dist/index.cjs.js +14 -14
  51. package/dist/index.d.ts +1 -2
  52. package/dist/index.js +14 -14
  53. package/dist/{providerWallet-Ddncx8s5.js → providerWallet-6FpyLYqw.js} +1 -1
  54. package/dist/{providerWallet-B7SytehJ.js → providerWallet-Ds1PM0vC.js} +1 -1
  55. package/dist/providers/SpiceFlowProvider.d.ts +2 -0
  56. package/dist/providers/dynamic.d.ts +2 -2
  57. package/dist/providers/privy.d.ts +2 -2
  58. package/dist/types/deposit.d.ts +0 -3
  59. package/dist/types/lock.d.ts +0 -2
  60. package/dist/types/supply.d.ts +0 -15
  61. package/dist/types/withdraw.d.ts +0 -1
  62. package/package.json +2 -2
  63. package/dist/Button-E8Ln6miF.js +0 -2
  64. package/dist/Button-RzLL2mKv.js +0 -2
  65. package/dist/components/SpiceSupply/lib/executors.d.ts +0 -67
  66. package/dist/components/SpiceWithdraw/lib/executors.d.ts +0 -34
  67. package/dist/execution/gasless.d.ts +0 -7
  68. package/dist/execution/pollIntentStep.d.ts +0 -28
  69. package/dist/utils/spiceConstants.d.ts +0 -3
  70. /package/dist/components/AccountDisplay/{parts/AccountActions.d.ts → AccountActions.d.ts} +0 -0
  71. /package/dist/components/SpiceBalance/{parts/AccountItem.d.ts → AccountItem.d.ts} +0 -0
  72. /package/dist/components/SpiceBalance/{parts/BalanceSection.d.ts → BalanceSection.d.ts} +0 -0
  73. /package/dist/components/SpiceDeposit/{parts/ModalHeader.d.ts → ModalHeader.d.ts} +0 -0
  74. /package/dist/components/SpiceDeposit/{parts/DepositAssetChooser.d.ts → views/AssetChooserList.d.ts} +0 -0
  75. /package/dist/components/SpiceWithdraw/{lib/helpers.d.ts → helpers.d.ts} +0 -0
  76. /package/dist/components/SpiceWithdraw/{parts/WithdrawBalancePopover.d.ts → views/BalancePopover.d.ts} +0 -0
  77. /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 "../../../types/ui";
4
- import type { ChainBatch } from "../../../types/authorization";
5
- import type { SelectedAsset } from "../../../types/assets";
6
- import type { SpiceSupplyProps, SupplyBatchBuildOptions } from "../../../types/supply";
7
- import type { ResolvedExactOutputSwap } from "../../../utils/swapQuotes";
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 "../../../hooks/useSpiceExecution";
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?: SupplyBatchBuildOptions) => Promise<ChainBatch[]>;
12
- type BuildSupplyBatchesFn = (options?: SupplyBatchBuildOptions) => Promise<ChainBatch[]>;
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;
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import type { SelectPopoverItem } from "../../../types/withdraw";
2
+ import type { SelectPopoverItem } from "../../types/withdraw";
3
3
  export type { SelectPopoverItem };
4
4
  interface SelectPopoverProps {
5
5
  isOpen: boolean;
@@ -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,3 +1,3 @@
1
1
  import React from "react";
2
- import type { StatusIconProps } from "../../../types/status";
2
+ import type { StatusIconProps } from "../../types/status";
3
3
  export declare const StatusIcon: React.FC<StatusIconProps>;
@@ -1,4 +1,4 @@
1
1
  import React from "react";
2
- import type { StatusResultItem, StatusPanelProps } from "../../../types/status";
2
+ import type { StatusResultItem, StatusPanelProps } from "../../types/status";
3
3
  export type { StatusResultItem, StatusPanelProps };
4
4
  export declare const StatusPanel: React.FC<StatusPanelProps>;
@@ -1,3 +1,3 @@
1
1
  import React from "react";
2
- import type { StepItemProps } from "../../../types/status";
2
+ import type { StepItemProps } from "../../types/status";
3
3
  export declare const StepItem: React.FC<StepItemProps>;
@@ -1,5 +1,4 @@
1
1
  export { StatusDisplay } from "./StatusDisplay";
2
- export { StatusPanel } from "./parts/StatusPanel";
3
- export { StatusIcon } from "./parts/StatusIcon";
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>;