@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.
Files changed (74) hide show
  1. package/dist/auth-privy.cjs.js +1 -1
  2. package/dist/auth-privy.js +1 -1
  3. package/dist/components/ProviderLogins/index.d.ts +0 -2
  4. package/dist/components/SpiceLock/lib/executors.d.ts +6 -1
  5. package/dist/components/SpiceLock/parts/LabeledInfoRow.d.ts +5 -0
  6. package/dist/components/SpiceSupply/lib/buildBatches.d.ts +3 -3
  7. package/dist/components/SpiceSupply/lib/executors.d.ts +5 -5
  8. package/dist/components/SpiceSupply/lib/feePreview.d.ts +5 -5
  9. package/dist/components/SpiceWithdraw/lib/executors.d.ts +4 -4
  10. package/dist/components/SpiceWithdraw/lib/feePreview.d.ts +2 -2
  11. package/dist/components/index.d.ts +0 -1
  12. package/dist/components/ui/index.d.ts +0 -1
  13. package/dist/execution/batchHashes.d.ts +2 -0
  14. package/dist/execution/fundEmbeddedWallet.d.ts +10 -0
  15. package/dist/execution/intentStatus.d.ts +31 -0
  16. package/dist/execution/pollIntentStep.d.ts +10 -0
  17. package/dist/execution/runner.d.ts +7 -0
  18. package/dist/execution/stripFeeCalls.d.ts +3 -0
  19. package/dist/execution/switchChain.d.ts +5 -0
  20. package/dist/hooks/index.d.ts +3 -7
  21. package/dist/hooks/useDirectWithdraw.d.ts +2 -2
  22. package/dist/hooks/useSpiceExecution.d.ts +12 -7
  23. package/dist/hooks/useSupplyAssets.d.ts +9 -7
  24. package/dist/hooks/{useWallet/index.d.ts → useWallet.d.ts} +2 -2
  25. package/dist/index.cjs.js +12 -12
  26. package/dist/index.d.ts +3 -15
  27. package/dist/index.js +12 -12
  28. package/dist/privy-2vbGci0p.js +0 -0
  29. package/dist/privy-BdHp5Owr.js +0 -0
  30. package/dist/providers/SpiceFlowProvider.d.ts +5 -3
  31. package/dist/types/lock.d.ts +3 -9
  32. package/dist/types/theme.d.ts +15 -13
  33. package/dist/types/wallet.d.ts +0 -11
  34. package/dist/utils/crossChainRouter/executeSwapThenAction.d.ts +4 -4
  35. package/dist/{hooks/directWithdrawPlan.d.ts → utils/directWithdraw.d.ts} +4 -0
  36. package/dist/utils/fees.d.ts +3 -1
  37. package/dist/utils/providerWallet.d.ts +2 -17
  38. package/dist/utils/relayer/index.d.ts +1 -0
  39. package/dist/utils/sleep.d.ts +1 -0
  40. package/dist/utils/theme.d.ts +2 -14
  41. package/dist/utils/tokenMetadata.d.ts +14 -0
  42. package/package.json +1 -23
  43. package/dist/Button-BtGAHwBv.js +0 -0
  44. package/dist/Button-bcAB126C.js +0 -0
  45. package/dist/auth-dynamic.cjs.js +0 -2
  46. package/dist/auth-dynamic.js +0 -2
  47. package/dist/components/ExportWallet/ExportWalletButton.d.ts +0 -4
  48. package/dist/components/ExportWallet/index.d.ts +0 -2
  49. package/dist/components/ProviderLogins/parts/DynamicLogin.d.ts +0 -4
  50. package/dist/components/SdkErrorBoundary/SdkErrorBoundary.d.ts +0 -21
  51. package/dist/components/SdkErrorBoundary/index.d.ts +0 -1
  52. package/dist/components/SpiceBalance/SpiceBalance.d.ts +0 -3
  53. package/dist/components/SpiceBalance/index.d.ts +0 -4
  54. package/dist/components/SpiceBalance/parts/AccountItem.d.ts +0 -11
  55. package/dist/components/SpiceBalance/parts/BalanceSection.d.ts +0 -10
  56. package/dist/components/SpiceBalance/types.d.ts +0 -66
  57. package/dist/components/SpiceLock/parts/LockExpiryRow.d.ts +0 -4
  58. package/dist/components/SpiceLock/parts/VotingPowerRow.d.ts +0 -4
  59. package/dist/components/SpicePay/SpicePay.d.ts +0 -14
  60. package/dist/components/SpicePay/index.d.ts +0 -1
  61. package/dist/components/SpiceWalletNotice/SpiceWalletNotice.d.ts +0 -35
  62. package/dist/components/SpiceWalletNotice/index.d.ts +0 -2
  63. package/dist/components/ui/Modal.d.ts +0 -3
  64. package/dist/execution/gasless.d.ts +0 -7
  65. package/dist/hooks/directWithdrawGate.d.ts +0 -4
  66. package/dist/hooks/useEmbeddedWalletAddress.d.ts +0 -2
  67. package/dist/hooks/useSpiceAction.d.ts +0 -55
  68. package/dist/hooks/useStatus.d.ts +0 -27
  69. package/dist/hooks/useWallet/useDynamicWallet.d.ts +0 -2
  70. package/dist/providers/dynamic.d.ts +0 -3
  71. package/dist/providers/whitelistGate.d.ts +0 -33
  72. package/dist/utils/portal/index.d.ts +0 -14
  73. package/dist/utils/rebalancing/index.d.ts +0 -70
  74. package/dist/utils/retry/index.d.ts +0 -1
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- "use strict";const e=require("react/jsx-runtime"),o=require("react"),c=require("./Button-BtGAHwBv.js"),f=require("@privy-io/react-auth");require("@spicenet-io/spiceflow-core"),require("viem"),require("viem/actions"),require("@tanstack/react-query"),require("@dynamic-labs/sdk-react-core"),require("wagmi");const S=({onAuthSuccess:d,onAuthError:a,theme:v="light",className:l="",buttonText:g="Login with Privy",autoTrigger:h=!1})=>{const u=c.createTheme(v),[m,j]=o.useState(!1),[x,p]=o.useState(!1),{ready:s,authenticated:n,user:t}=f.usePrivy(),{login:q}=f.useLogin(),{logout:L}=f.useLogout();o.useEffect(()=>{j(!0)},[]),o.useEffect(()=>{h&&s&&!n&&m&&!x&&(p(!0),y())},[h,s,n,m,x]),o.useEffect(()=>{if(s&&n&&t&&d){const r=t.wallet?.address||t.email?.address;r&&d(r)}},[s,n,t,d]),o.useEffect(()=>{},[s,n,a]);const y=()=>{try{q()}catch(r){const i=`Login failed: ${String(r)}`;a?a(i):console.error(i)}},b=()=>{try{L()}catch(r){const i=`Logout failed: ${String(r)}`;a?a(i):console.error(i)}};if(!m)return e.jsx("div",{className:l,children:e.jsx(c.Button,{variant:"primary",disabled:!0,theme:u,children:g})});if(!s)return e.jsx("div",{className:l,children:e.jsx(c.Button,{variant:"primary",disabled:!0,theme:u,children:"Loading..."})});if(n&&t){const r=t.wallet?.address||t.email?.address,i=r?`${r.slice(0,6)}...${r.slice(-4)}`:"Connected";return e.jsx("div",{className:l,children:e.jsxs(c.Button,{variant:"primary",onClick:b,theme:u,children:["Logout (",i,")"]})})}return h?e.jsx("div",{className:l,children:e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"20px",flexDirection:"column",gap:"12px"},children:[e.jsx(c.Spinner,{size:40,borderWidth:3,color:"#3b82f6"}),e.jsx("p",{style:{color:"#6b7280",fontSize:"14px"},children:"Opening login..."})]})}):e.jsx("div",{className:l,children:e.jsx(c.Button,{variant:"primary",onClick:y,theme:u,children:g})})};exports.PrivyLogin=S;
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;
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{jsx as r,jsxs as y}from"react/jsx-runtime";import{useState as v,useEffect as c}from"react";import{B as d,c as P,S as $}from"./Button-bcAB126C.js";import{usePrivy as j,useLogin as w,useLogout as B}from"@privy-io/react-auth";import"@spicenet-io/spiceflow-core";import"viem";import"viem/actions";import"@tanstack/react-query";import"@dynamic-labs/sdk-react-core";import"wagmi";const T=({onAuthSuccess:m,onAuthError:n,theme:x="light",className:a="",buttonText:p="Login with Privy",autoTrigger:u=!1})=>{const l=P(x),[h,L]=v(!1),[g,b]=v(!1),{ready:o,authenticated:s,user:t}=j(),{login:S}=w(),{logout:N}=B();c(()=>{L(!0)},[]),c(()=>{u&&o&&!s&&h&&!g&&(b(!0),f())},[u,o,s,h,g]),c(()=>{if(o&&s&&t&&m){const e=t.wallet?.address||t.email?.address;e&&m(e)}},[o,s,t,m]),c(()=>{},[o,s,n]);const f=()=>{try{S()}catch(e){const i=`Login failed: ${String(e)}`;n?n(i):console.error(i)}},C=()=>{try{N()}catch(e){const i=`Logout failed: ${String(e)}`;n?n(i):console.error(i)}};if(!h)return r("div",{className:a,children:r(d,{variant:"primary",disabled:!0,theme:l,children:p})});if(!o)return r("div",{className:a,children:r(d,{variant:"primary",disabled:!0,theme:l,children:"Loading..."})});if(s&&t){const e=t.wallet?.address||t.email?.address,i=e?`${e.slice(0,6)}...${e.slice(-4)}`:"Connected";return r("div",{className:a,children:y(d,{variant:"primary",onClick:C,theme:l,children:["Logout (",i,")"]})})}return u?r("div",{className:a,children:y("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"20px",flexDirection:"column",gap:"12px"},children:[r($,{size:40,borderWidth:3,color:"#3b82f6"}),r("p",{style:{color:"#6b7280",fontSize:"14px"},children:"Opening login..."})]})}):r("div",{className:a,children:r(d,{variant:"primary",onClick:f,theme:l,children:p})})};export{T as PrivyLogin};
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
- startStatusPolling: (intentId: string, steps: SwapStep[]) => void;
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 { GaslessExecutionOptions } from "../../../hooks/useSpiceExecution";
7
+ import type { ExecutionOptions } from "../../../hooks/useSpiceExecution";
8
8
  import type { FeeEstimateSummary } from "@spicenet-io/spiceflow-core";
9
- type EstimateGaslessFn = (chainBatches: ChainBatch[], tokenAddress: string, tokenTransferAmount: bigint, options?: GaslessExecutionOptions) => Promise<FeeEstimateSummary>;
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, estimateGasless: EstimateGaslessFn, gaslessOptions?: Pick<GaslessExecutionOptions, "useCustomTransfers" | "userOverride">): Promise<bigint>;
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 { GaslessExecutionOptions, GaslessProgress } from "../../../hooks/useSpiceExecution";
8
- import type { GaslessRunner } from "../../../execution/gasless";
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, gaslessOptions?: Pick<GaslessExecutionOptions, "useCustomTransfers" | "userOverride">) => Promise<bigint>;
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
- gasless: GaslessRunner & {
48
+ execution: ExecutionRunner & {
49
49
  buildPayChainBatches: BuildPayBatchesFn;
50
50
  buildSupplyChainBatches: BuildSupplyBatchesFn;
51
51
  estimateRequiredGrossFunding: EstimateRequiredGrossFundingFn;
52
- onProgress: (progress: GaslessProgress) => void;
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 { GaslessExecutionOptions } from "../../../hooks/useSpiceExecution";
10
- type EstimateGaslessFn = (chainBatches: ChainBatch[], tokenAddress: string, tokenTransferAmount: bigint, options?: GaslessExecutionOptions) => Promise<FeeEstimateSummary>;
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, gaslessOptions?: Pick<GaslessExecutionOptions, "useCustomTransfers" | "userOverride">) => Promise<bigint>;
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
- estimateGasless: EstimateGaslessFn;
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
- estimateGasless: EstimateGaslessFn;
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 { GaslessRunner } from "../../../execution/gasless";
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 { GaslessProgress } from "../../../hooks/useSpiceExecution";
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
- gasless: GaslessRunner;
23
+ execution: ExecutionRunner;
24
24
  ui: {
25
25
  setIsExecuting: Dispatch<SetStateAction<boolean>>;
26
26
  setExecutionError: Dispatch<SetStateAction<string | null>>;
27
- setExecutionProgress: Dispatch<SetStateAction<GaslessProgress | null>>;
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 { GaslessRunner } from "../../../execution/gasless";
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
- estimateGasless: GaslessRunner["estimateGasless"];
8
+ estimate: ExecutionRunner["estimate"];
9
9
  }): Promise<bigint>;
@@ -1,6 +1,5 @@
1
1
  export * from "./AssetSelector";
2
2
  export * from "./StatusDisplay";
3
3
  export * from "./ProviderLogins";
4
- export * from "./SpiceBalance";
5
4
  export * from "./SpiceWithdraw";
6
5
  export * from "./ui";
@@ -1,6 +1,5 @@
1
1
  export { Button } from "./Button";
2
2
  export { Input } from "./Input";
3
- export { Modal } from "./Modal";
4
3
  export { Spinner } from "./Spinner";
5
4
  export { StatusBanner } from "./StatusBanner";
6
5
  export { DetailRow } from "./DetailRow";
@@ -0,0 +1,2 @@
1
+ import type { ChainBatch } from "../types/authorization";
2
+ export declare function haveSameBatchHashes(a: ChainBatch[], b: ChainBatch[]): boolean;
@@ -0,0 +1,10 @@
1
+ import { type Address } from "viem";
2
+ export declare function fundEmbeddedWallet(params: {
3
+ extWc: any;
4
+ sourceClient: any;
5
+ recipient: Address;
6
+ tokenAddr: Address;
7
+ isNative: boolean;
8
+ amount: bigint;
9
+ viemChain?: unknown;
10
+ }): Promise<void>;
@@ -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
+ };
@@ -0,0 +1,3 @@
1
+ import { type Address } from "viem";
2
+ import type { ChainBatch } from "../types/authorization";
3
+ export declare function stripLeadingUserPayoutCalls(batches: ChainBatch[], userAddress: Address): ChainBatch[];
@@ -0,0 +1,5 @@
1
+ export declare function switchExternalWalletToChain(extProvider: {
2
+ request: (args: {
3
+ method: string;
4
+ }) => Promise<unknown>;
5
+ }, targetChainId: number, onSwitching?: () => void): Promise<void>;
@@ -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 { useSpiceExecution as useGaslessExecution } from "./useSpiceExecution";
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, } from "./useSupplyQuote";
23
- export type { UseSupplyQuoteOpts, SupplyQuoteResult, } from "./useSupplyQuote";
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 GaslessProgress } from "./useSpiceExecution";
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: GaslessProgress) => void;
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 GaslessStep = "idle" | "building" | "signing-delegation" | "signing-intent" | "submitting" | "executing" | "confirming-rollup" | "success" | "error";
6
- export interface GaslessProgress {
7
- step: GaslessStep;
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: GaslessProgress) => void;
17
- export interface GaslessExecutionOptions {
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
- executeGasless: (chainBatches: ChainBatch[], tokenAddress: string, tokenTransferAmount: bigint, onProgress?: OnProgress, signal?: AbortSignal, options?: GaslessExecutionOptions) => Promise<string>;
37
- estimateGasless: (chainBatches: ChainBatch[], tokenAddress: string, tokenTransferAmount: bigint, options?: GaslessExecutionOptions) => Promise<FeeEstimateSummary>;
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 "../../types/authorization";
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" | "dynamic" | null;
8
+ provider: "privy" | null;
9
9
  }
10
10
  export type SignableMessage = string | {
11
11
  raw: `0x${string}`;