@spicenet-io/spiceflow-ui 4.10.0-next.2 → 4.10.0-next.3

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.
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- "use strict";const r=require("./privy-8_x0Dkgt.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;
2
+ "use strict";const r=require("./privy-XbtFily9.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{P as g}from"./privy-CPjsWYyb.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};
2
+ import{P as g}from"./privy-C4NTw6Dl.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};
@@ -5,6 +5,7 @@ interface AccountHeaderProps {
5
5
  status: "active" | "inactive";
6
6
  statusLabel?: string;
7
7
  totalUsdValue: number;
8
+ hasUnpricedAssets?: boolean;
8
9
  breakdownSubtitle: string;
9
10
  showUsdSummary?: boolean;
10
11
  address?: string;
@@ -8,6 +8,7 @@ interface AccountPanelProps {
8
8
  status: "active" | "inactive";
9
9
  statusLabel?: string;
10
10
  totalUsdValue: number;
11
+ hasUnpricedAssets?: boolean;
11
12
  breakdownSubtitle: string;
12
13
  showUsdSummary?: boolean;
13
14
  address?: string;
@@ -0,0 +1,14 @@
1
+ import { type Address } from "viem";
2
+ import type { ChainBatch } from "../../../types/authorization";
3
+ import type { SpiceSupplyProps } from "../../../types/supply";
4
+ import type { SupplyFeeQuote } from "./feePreview";
5
+ export declare function appendProceedsFees(batches: ChainBatch[], owner: Address, token: Address, gas: bigint, platform: bigint): ChainBatch[];
6
+ export declare function simulateProceedsBatch(batches: ChainBatch[], owner: Address, token: Address, signal?: AbortSignal, platformFeeMaximum?: bigint): Promise<bigint>;
7
+ export declare function estimateProceedsFunding(args: {
8
+ proceeds: NonNullable<SpiceSupplyProps["actionProceeds"]>;
9
+ owner: Address;
10
+ token: Address;
11
+ signal?: AbortSignal;
12
+ baseline: () => Promise<SupplyFeeQuote | null>;
13
+ buildBatches: (amount: bigint) => Promise<ChainBatch[]>;
14
+ }): Promise<SupplyFeeQuote>;
@@ -17,6 +17,7 @@ export type PaymentResult = {
17
17
  };
18
18
  export { isExternalSource } from "./buildBatches";
19
19
  export type ExecutorContext = {
20
+ signal?: AbortSignal;
20
21
  selectedAsset: SelectedAsset | null;
21
22
  parsedAmount: number;
22
23
  currentPaymentAmount: string;
@@ -24,6 +25,8 @@ export type ExecutorContext = {
24
25
  isPayMode: boolean;
25
26
  isFeeInclusiveInput?: boolean;
26
27
  feeOnlyAction?: boolean;
28
+ actionProceeds?: SpiceSupplyProps["actionProceeds"];
29
+ validateFeeQuote?: () => void;
27
30
  isNon7702: boolean;
28
31
  isSourceDestToken: boolean;
29
32
  needsSwap: boolean;
@@ -75,6 +78,7 @@ export type ExecutorContext = {
75
78
  abortControllerRef: MutableRefObject<AbortController | null>;
76
79
  };
77
80
  } & Pick<SpiceSupplyProps, "destinationToken" | "buildActionCalls" | "feeExecutionMode" | "buildSpicenetBatch" | "onPayExecute" | "onSuccess">;
81
+ export declare function sourceFundingSelection(ctx: ExecutorContext): SelectedAsset | null;
78
82
  export declare function sourceFundingIdentity(ctx: ExecutorContext): string;
79
83
  export declare function executeSupply(ctx: ExecutorContext): Promise<void>;
80
84
  export declare function executePay(ctx: ExecutorContext): Promise<void>;
@@ -0,0 +1,11 @@
1
+ import type { Address } from "viem";
2
+ import type { FeePreviewContext, SupplyFeeQuote } from "./feePreview";
3
+ export declare function resolveFeeFundingToken(asset: NonNullable<FeePreviewContext["selectedAsset"]>["asset"], chainId: number, feeToken: Address): Address | null;
4
+ export interface FundingConversion {
5
+ tokenIn: Address;
6
+ tokenOut: Address;
7
+ amountInMax: bigint;
8
+ amountOut: bigint;
9
+ sourceAmountMax: bigint;
10
+ }
11
+ export declare function quoteConvertedFees(ctx: FeePreviewContext): Promise<SupplyFeeQuote>;
@@ -3,4 +3,4 @@ import type { ChainBatch } from "../../../types/authorization";
3
3
  import type { ExecutionOptions } from "../../../hooks/useSpiceExecution";
4
4
  import type { ExecutorContext } from "./executors";
5
5
  export declare function stripFeeOnlyCalls(batches: ChainBatch[], chainId: number, token: Address): ChainBatch[];
6
- export declare function feeOnlyExecutionOptions(ctx: ExecutorContext, token: Address, fundingCap: bigint): Pick<ExecutionOptions, "prepareForSigning" | "validateBeforeSubmit">;
6
+ export declare function feeOnlyExecutionOptions(ctx: ExecutorContext, token: Address, fundingCap: bigint): Pick<ExecutionOptions, "prepareForSigning" | "validateBeforeSubmit" | "resolveActionOutputCredits">;
@@ -1,3 +1,5 @@
1
+ import { type FundingConversion } from "./feeConversion";
2
+ import type { LiquidityVenuesConfig } from "../../../utils/crossChainRouter/venueConfig";
1
3
  import { type Address } from "viem";
2
4
  import { type FeeEstimateSummary } from "@spicenet-io/spiceflow-core";
3
5
  import type { FeePreview } from "../../../types/ui";
@@ -14,6 +16,10 @@ export type SupplyFeeQuote = {
14
16
  preview: FeePreview;
15
17
  feeEstimate: FeeEstimateSummary | null;
16
18
  grossFundingAmount?: bigint;
19
+ proceedsUsed?: bigint;
20
+ proceedsAvailable?: bigint;
21
+ fundingConversion?: FundingConversion;
22
+ fundingBatches?: ChainBatch[];
17
23
  };
18
24
  export declare function solveGrossFunding(fees: Pick<FeePreview, "grossAmount" | "gasFee" | "spicenetFee" | "bridgeFee">, requiredNetFunding: bigint): bigint;
19
25
  export declare function estimatePayFunding(args: {
@@ -48,11 +54,15 @@ export declare function estimateSupplyMaxAmount(ctx: {
48
54
  feeExecutionMode: SpiceSupplyProps["feeExecutionMode"];
49
55
  }): Promise<string | null>;
50
56
  export interface FeePreviewContext {
57
+ liquidityVenues?: LiquidityVenuesConfig;
58
+ maxSlippage?: number;
59
+ resolveExactOutputSwap?: SpiceSupplyProps["resolveExactOutputSwap"];
51
60
  signal?: AbortSignal;
52
61
  selectedAsset: SelectedAsset | null;
53
62
  isPayMode: boolean;
54
63
  isFeeInclusiveInput?: boolean;
55
64
  feeOnlyAction?: boolean;
65
+ actionProceeds?: SpiceSupplyProps["actionProceeds"];
56
66
  parsedAmount: number;
57
67
  needsSwap: boolean;
58
68
  exactOutputSwap: ResolvedExactOutputSwap | null;
@@ -34,6 +34,7 @@ export interface ExecutionOptions {
34
34
  validateBeforeSubmit?: (chainBatches: ChainBatch[]) => void | Promise<void>;
35
35
  requireDestinationReceipt?: boolean;
36
36
  prepareForSigning?: (chainBatches: ChainBatch[]) => Promise<ChainBatch[]>;
37
+ resolveActionOutputCredits?: () => Promise<ActionOutputCredit[]>;
37
38
  skipUserFundingPreflight?: boolean;
38
39
  signal?: AbortSignal;
39
40
  }
@@ -10,7 +10,7 @@ import type { LiquidityVenue } from "../utils/crossChainRouter/liquidityVenues";
10
10
  import type { SpiceSupplyProps } from "../types/supply";
11
11
  import type { Asset, SelectedAsset } from "../types/assets";
12
12
  import type { FeePreview } from "../types/ui";
13
- export interface UseSpiceSupplyParams extends Pick<SpiceSupplyProps, "destinationToken" | "sourceChains" | "supportedSourceAssets" | "includeExternalWalletAssets" | "includeCrossChainEmbeddedAssets" | "sourceFundingRecoveryKey" | "sourceFundingRecovery" | "feeOnlyAction" | "buildActionCalls" | "feeExecutionMode" | "buildSpicenetBatch" | "onPayExecute" | "resolveExactOutputSwap" | "amountDirection" | "onSuccess" | "onError"> {
13
+ export interface UseSpiceSupplyParams extends Pick<SpiceSupplyProps, "destinationToken" | "sourceChains" | "supportedSourceAssets" | "includeExternalWalletAssets" | "includeCrossChainEmbeddedAssets" | "sourceFundingRecoveryKey" | "sourceFundingRecovery" | "feeOnlyAction" | "actionProceeds" | "buildActionCalls" | "feeExecutionMode" | "buildSpicenetBatch" | "onPayExecute" | "resolveExactOutputSwap" | "amountDirection" | "onSuccess" | "onError"> {
14
14
  enabled: boolean;
15
15
  actionExecution?: ExternalActionExecution;
16
16
  selectedAsset: SelectedAsset | null;
@@ -35,7 +35,10 @@ export interface UseSpiceSupplyResult {
35
35
  } | null;
36
36
  };
37
37
  fees: {
38
+ fundingConversion?: import("../components/SpiceSupply/lib/feeConversion").FundingConversion;
38
39
  preview: FeePreview | null;
40
+ proceedsUsed?: bigint;
41
+ fundingShortfall?: bigint;
39
42
  source: {
40
43
  symbol: string;
41
44
  decimals: number;