@spicenet-io/spiceflow-ui 4.10.0-next.1 → 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-D5qswtTm.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;
@@ -4,14 +4,14 @@ import type React from "react";
4
4
  export interface CustomSectionItem {
5
5
  tokenSymbol: string;
6
6
  tokenLogoURI?: string;
7
- label: string;
7
+ label: React.ReactNode;
8
8
  displayValue: string;
9
9
  valueColor?: "green" | "red" | "default";
10
10
  }
11
11
  export interface CustomSection {
12
12
  title: string;
13
13
  items: CustomSectionItem[];
14
- totalValue: number;
14
+ totalValue?: number;
15
15
  }
16
16
  export interface SpiceAsset {
17
17
  tokenAddress: 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>;
@@ -43,8 +43,10 @@ export interface FundingRecord {
43
43
  }
44
44
  export declare function controlledFundingProgress(record: FundingRecord, ctx: ExecutorContext): SourceFundingProgress;
45
45
  export declare function readControlledFunding(scope: string): FundingRecord | null;
46
+ export declare function reconcileControlledFunding(scope: string): Promise<boolean>;
46
47
  export declare function executeWithSourceFunding(params: {
47
48
  scope: string;
49
+ recovery?: "resume" | "balance";
48
50
  ctx: ExecutorContext;
49
51
  run: (ctx: ExecutorContext) => Promise<void>;
50
52
  isCurrent: () => boolean;
@@ -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>;
@@ -49,13 +49,15 @@ export interface ExternalActionRecord {
49
49
  export declare function externalActionScope(network: string, chainId: number, external: string, embedded: string, recoveryKey: string): string;
50
50
  export declare function readExternalAction(scope: string): ExternalActionRecord | null;
51
51
  export declare function externalActionProgress(record: ExternalActionRecord): ExternalActionProgress;
52
+ export declare function reconcileExternalFunding(scope: string): Promise<boolean>;
52
53
  export declare function clearCompletedExternalAction(scope: string): void;
53
54
  export declare function buildExternalDeliveryCalls(amount: bigint, context: BuildActionCallsContext, recipient: Address): Call[];
54
55
  export declare function executeExternalActionSupply(params: {
55
56
  scope: string;
57
+ recovery?: "resume" | "balance";
56
58
  ctx: ExecutorContext;
57
59
  buildActionCalls: SpiceSupplyProps["buildActionCalls"];
58
- onRecord: (record: ExternalActionRecord) => void;
60
+ onRecord: (record: ExternalActionRecord | null) => void;
59
61
  isCurrent?: () => boolean;
60
62
  }): Promise<void>;
61
63
  export {};
@@ -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;
@@ -24,5 +24,6 @@ export declare function fundSelectedExternalSource(params: {
24
24
  tokenAddr: Address;
25
25
  isNative: boolean;
26
26
  requiredAmount: bigint;
27
+ reconcileOnly?: boolean;
27
28
  observer?: TransactionObserver;
28
29
  }): Promise<void>;
@@ -15,7 +15,7 @@ export declare function useSourceFundingConversion(params: {
15
15
  plan: import("../utils/crossChainRouter/sourceFundingQuote").SourceFundingPlan | null;
16
16
  key: string;
17
17
  virtualSelectedAsset: SelectedAsset | null;
18
- prepare: (requiredBridgeAmount?: bigint) => Promise<SourceFundingExecutionPlan>;
18
+ prepare: (requiredBridgeAmount?: bigint, refresh?: boolean) => Promise<SourceFundingExecutionPlan>;
19
19
  getPrepared: (amount?: bigint) => SourceFundingExecutionPlan | null;
20
20
  error: string | null;
21
21
  isCurrent: () => boolean;
@@ -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" | "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;
@@ -24,6 +24,8 @@ export declare function useSupplyAssets(opts: {
24
24
  includeCrossChainEmbeddedAssets?: boolean;
25
25
  }): {
26
26
  displayAssets: Asset[];
27
+ loading: boolean;
28
+ error: string | null;
27
29
  filteredSpiceAssets: Asset[];
28
30
  walletAssets: Asset[];
29
31
  embeddedWalletAddress: `0x${string}` | undefined;