@spicenet-io/spiceflow-ui 4.14.4-rc.2 → 4.14.4-rc.4

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/README.md CHANGED
@@ -87,7 +87,7 @@ host-configured RPC. Keep private credentials out of browser bundles.
87
87
  - Use controller recovery for uncertain funding and `retryFinalization()` for failed
88
88
  application updates after settlement. Preserve original host terms across reload.
89
89
  - Deposit and rollup Withdraw retain distinct execution semantics while sharing
90
- inventory/policy. Account wallet withdrawal uses the fee-only Supply path.
90
+ inventory/policy. Account wallet withdrawal uses the inclusive Supply controller and its fee hierarchy.
91
91
 
92
92
  Inventory isolation does not establish support for simultaneous differently configured
93
93
  providers: underlying quote/execution transports still have global state.
@@ -288,7 +288,7 @@ match on `assetPositionId`, not on symbol or address alone.
288
288
  - Routed Supply, Pay and Lock actions must surface fee estimation before enabling submission.
289
289
  - Eligible direct external actions still require an accepted plan but charge no Spicenet fee. Network gas remains payable in the external wallet; native Max reserves gas.
290
290
  - Deposit gas and rollup withdrawal semantics remain distinct from action intent fees. Preserve their existing quote/readiness requirements.
291
- - Account wallet withdrawal is a fee-only Supply action. Do not bypass its fee/readiness gates based on the label "withdraw".
291
+ - Account wallet withdrawal uses the shared input-inclusive Supply controller and its fee-only planner for local fees. Do not bypass its fee/readiness gates based on the label "withdraw".
292
292
  - Custom actions use the shared controller's `canExecute`; an available balance or old quote alone is insufficient.
293
293
  - `onSubmit` on `SpiceSupply`, `SpiceLock`, `SpiceDeposit` and the shared controller fires once when the user submits and the SDK accepts it, before any wallet prompt. Use it for "transaction in progress" feedback instead of listening for clicks on SDK buttons.
294
294
  - `max()` on the shared controller (`useSpiceSupply`, `useSpiceLock`) resolves the fee-aware Max for the selected source, or `null` when there is none or the action fixes its output. The host sets the result as the amount.
@@ -390,7 +390,7 @@ during prewarming. The time available before typing determines how much work it
390
390
  - Declare `actionInput` for every token the action consumes and honour the amount passed to `buildActionCalls`: when fees come from an input, the action is built for the remainder. Declare `actionProceeds` for a token the action leaves in the wallet. Both are optional; with neither, only balances can pay. Omit `actionProceeds` when the output is delivered to another owner.
391
391
  - `feeFunding` overrides the level order per transaction, for example `["proceeds", "input", "balance"]`; the order inside the balance level is fixed. An empty list leaves the choice to the host's `selectedAsset`.
392
392
  - A `selectedAsset` on a fee-only action is an explicit host choice and funds the fee from that balance as before.
393
- - Account wallet withdrawals use this hierarchy automatically and display the chosen fee asset without a selector. The exact withdrawal amount is reserved before ranking balances; only its remainder can pay fees. Custom `useSpiceSupply` actions that must preserve an exact principal can declare `feeFundingReserve: { asset, amount }` instead of offering that principal as `actionInput`.
393
+ - Account wallet withdrawals use this hierarchy automatically and display the chosen fee asset without a selector. Entered amounts and Max are total source-token budgets; applicable fees reduce the net received amount. Same-chain transfers retain the selected token. Choosing another supported chain routes through USDC escrow and delivers registered USDC, with the net output shown before submission. Withdraw discovers permitted embedded balances by default alongside escrow balances; `walletAssets` optionally supplies extra token metadata or an initial wallet selection. Custom `useSpiceSupply` actions that must preserve an exact principal can declare `feeFundingReserve: { asset, amount }` instead of offering that principal as `actionInput`.
394
394
  - `feeOnlyAction` alone declares the action: `amountDirection` defaults to `"output"` and `paymentAmount` to `"0"`. Explicit values still win.
395
395
  - `submit()` on the controller runs the executor that matches `amountDirection`. `submitSupply()` and `submitPay()` remain for existing callers.
396
396
 
@@ -1,3 +1,3 @@
1
1
  "use client";
2
2
  (function(){if(typeof document==="undefined"||document.getElementById("spiceflow-styles"))return;var s=document.createElement("style");s.id="spiceflow-styles";s.textContent="@keyframes spiceflow-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@media (prefers-reduced-motion:reduce){*,:after,:before{animation-duration:.001ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-duration:.001ms!important}}.spiceflow-focus-ring:focus-visible,[data-spiceflow-focus]:focus-visible{border-radius:4px;outline:2px solid currentColor;outline-offset:2px}@media (forced-colors:active){.spiceflow-focus-ring:focus-visible,[data-spiceflow-focus]:focus-visible{outline:2px solid Highlight}}.ibm-plex-mono-thin{font-weight:100}.ibm-plex-mono-extralight,.ibm-plex-mono-thin{font-family:IBM Plex Mono,monospace!important;font-style:normal}.ibm-plex-mono-extralight{font-weight:200}.ibm-plex-mono-light{font-weight:300}.ibm-plex-mono-light,.ibm-plex-mono-regular{font-family:IBM Plex Mono,monospace!important;font-style:normal}.ibm-plex-mono-regular{font-weight:400}.ibm-plex-mono-medium{font-weight:500}.ibm-plex-mono-medium,.ibm-plex-mono-semibold{font-family:IBM Plex Mono,monospace!important;font-style:normal}.ibm-plex-mono-semibold{font-weight:600}.ibm-plex-mono-bold{font-family:IBM Plex Mono,monospace!important;font-style:normal;font-weight:700}#privy-modal-content button{border-radius:6px;font-family:IBM Plex Mono,monospace!important;font-size:small;letter-spacing:-.5px;text-transform:uppercase}#privy-modal-content input{background:#fff;border-radius:6px;padding-top:5px!important}#privy-dialog-title{display:none!important;font-size:18px;padding-bottom:10px;padding-top:10px}.AppLogoContainer-sc-a206bd44-0{display:none}#privy-modal-content{background:var(--Neutral-0,#fafafa);border:6px solid var(--Neutral-1,#e9e9e9);box-shadow:inset 0 0 0 1px rgba(0,0,0,.15),0 330px 92px transparent,0 211px 84px rgba(0,0,0,.01),0 119px 71px rgba(0,0,0,.05),0 53px 53px rgba(0,0,0,.09),0 13px 29px rgba(0,0,0,.1);height:auto!important;padding-bottom:10px}.Subtitle-sc-ddbf22b4-4{font-size:12px;margin-top:-14px;opacity:.5}.StyledLink-sc-1c6127e5-0{background:none!important}.StyledLink-sc-c8577138-0,.login-method-button{font-family:IBM Plex Mono,monospace!important}.StyledLink-sc-c8577138-0{font-style:uppercase}#protected-by-privy{color:#000!important}";document.head.appendChild(s)})();
3
- import{P as g}from"./privy-DBrrQEn2.js";import"react/jsx-runtime";import"react";import"@spicenet-io/spiceflow-core";import"@tanstack/react-query";import"viem";import"@privy-io/react-auth";import"wagmi";import"viem/actions";export{g as PrivyLogin};
3
+ import{P as g}from"./privy-CQoRAq7w.js";import"react/jsx-runtime";import"react";import"@spicenet-io/spiceflow-core";import"@tanstack/react-query";import"viem";import"@privy-io/react-auth";import"wagmi";import"viem/actions";export{g as PrivyLogin};
@@ -21,6 +21,7 @@ export type ExecutorContext = {
21
21
  isInsufficientBalance: boolean;
22
22
  isPayMode: boolean;
23
23
  isFeeInclusiveInput?: boolean;
24
+ quotedInclusivePlatformFee?: boolean;
24
25
  feeOnlyAction?: boolean;
25
26
  actionProceeds?: Exclude<SpiceSupplyProps["actionProceeds"], "output">;
26
27
  validateFeeQuote?: () => void;
@@ -104,6 +104,7 @@ export interface FeePreviewContext {
104
104
  selectedAsset: SelectedAsset | null;
105
105
  isPayMode: boolean;
106
106
  isFeeInclusiveInput?: boolean;
107
+ quotedInclusivePlatformFee?: boolean;
107
108
  parsedAmount: number;
108
109
  needsSwap: boolean;
109
110
  exactOutputSwap: ResolvedExactOutputSwap | null;
@@ -137,5 +138,5 @@ export declare class FeeShortfallError extends Error {
137
138
  readonly preview: FeePreview;
138
139
  constructor(preview: FeePreview);
139
140
  }
140
- export declare function supplyContextForFees(fees: FeePreview, amount: bigint, inclusive: boolean, mode: SpiceSupplyProps["feeExecutionMode"]): Required<Pick<import("../../../types/supply").BuildActionCallsContext, "grossAmount" | "netAmount" | "combinedFeeAmount" | "feeExecutionMode" | "feeBreakdown">>;
141
+ export declare function supplyContextForFees(fees: FeePreview, amount: bigint, inclusive: boolean, mode: SpiceSupplyProps["feeExecutionMode"], quotedInclusivePlatformFee?: boolean): Required<Pick<import("../../../types/supply").BuildActionCallsContext, "grossAmount" | "netAmount" | "combinedFeeAmount" | "feeExecutionMode" | "feeBreakdown">>;
141
142
  export {};
@@ -5,6 +5,12 @@ export declare function useSpiceEmbeddedWithdraw(params: {
5
5
  enabled: boolean;
6
6
  asset: Asset | null;
7
7
  amount: bigint;
8
+ destination?: {
9
+ address: Address;
10
+ symbol: string;
11
+ decimals: number;
12
+ chainId: number;
13
+ } | null;
8
14
  recipient?: Address;
9
15
  owner?: Address;
10
16
  sourceChains?: number[];
@@ -113,6 +119,6 @@ export declare function useSpiceEmbeddedWithdraw(params: {
113
119
  resetAfterSuccess: () => void;
114
120
  resetPaymentState: () => void;
115
121
  };
116
- source: Asset | undefined;
122
+ source: Asset | null | undefined;
117
123
  maximumFeeFunding: bigint | null | undefined;
118
124
  };
@@ -6,6 +6,7 @@ import type { Asset, SelectedAsset } from "../types/assets";
6
6
  import type { DestinationTokenDeclaration, SpiceSupplyProps } from "../types/supply";
7
7
  import type { FeePreview } from "../types/ui";
8
8
  export interface UseSpiceSupplyParams extends Pick<SpiceSupplyProps, "sourceChains" | "supportedSourceAssets" | "buildActionCalls" | "feeExecutionMode" | "buildSpicenetBatch" | "onPayExecute" | "resolveExactOutputSwap" | "amountDirection" | "onSubmit" | "onSuccess" | "onError" | "additionalSourceTokens" | "includeExternalWalletAssets" | "includeCrossChainEmbeddedAssets" | "feeOnlyAction" | "actionInput" | "actionProceeds" | "feeFunding" | "maxSlippage" | "resolveInputSwap"> {
9
+ quotedInclusivePlatformFee?: boolean;
9
10
  enabled?: boolean;
10
11
  destinationToken: DestinationTokenDeclaration | undefined;
11
12
  selectedAsset: SelectedAsset | null;