@spicenet-io/spiceflow-ui 4.15.2-rc.0 → 4.16.0-rc.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.
- package/README.md +3 -3
- package/dist/auth-privy.js +1 -1
- package/dist/components/SpiceSupply/lib/executors.d.ts +1 -0
- package/dist/components/SpiceSupply/lib/feePreview.d.ts +12 -1
- package/dist/components/SpiceWithdraw/lib/useEmbeddedWithdraw.d.ts +7 -1
- package/dist/hooks/useSpiceSupply.d.ts +1 -0
- package/dist/index.cjs.js +7 -7
- package/dist/index.js +7 -7
- package/dist/{privy-CbyTXV2C.js → privy-f2CjOGBQ.js} +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -90,7 +90,7 @@ host-configured RPC. Keep private credentials out of browser bundles.
|
|
|
90
90
|
- Use controller recovery for uncertain funding and `retryFinalization()` for failed
|
|
91
91
|
application updates after settlement. Preserve original host terms across reload.
|
|
92
92
|
- Deposit and rollup Withdraw retain distinct execution semantics while sharing
|
|
93
|
-
inventory/policy. Account wallet withdrawal uses the
|
|
93
|
+
inventory/policy. Account wallet withdrawal uses the inclusive Supply controller and its fee hierarchy.
|
|
94
94
|
|
|
95
95
|
Inventory isolation does not establish support for simultaneous differently configured
|
|
96
96
|
providers: underlying quote/execution transports still have global state.
|
|
@@ -309,7 +309,7 @@ a failed application callback after the external action has confirmed.
|
|
|
309
309
|
- Routed Supply, Pay and Lock actions must surface fee estimation before enabling submission.
|
|
310
310
|
- 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.
|
|
311
311
|
- Deposit gas and rollup withdrawal semantics remain distinct from action intent fees. Preserve their existing quote/readiness requirements.
|
|
312
|
-
- Account wallet withdrawal
|
|
312
|
+
- 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".
|
|
313
313
|
- Custom actions use the shared controller's `canExecute`; an available balance or old quote alone is insufficient.
|
|
314
314
|
- `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.
|
|
315
315
|
- `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.
|
|
@@ -411,7 +411,7 @@ during prewarming. The time available before typing determines how much work it
|
|
|
411
411
|
- 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.
|
|
412
412
|
- `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`.
|
|
413
413
|
- A `selectedAsset` on a fee-only action is an explicit host choice and funds the fee from that balance as before.
|
|
414
|
-
- Account wallet withdrawals use this hierarchy automatically and display the chosen fee asset without a selector.
|
|
414
|
+
- 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`.
|
|
415
415
|
- `feeOnlyAction` alone declares the action: `amountDirection` defaults to `"output"` and `paymentAmount` to `"0"`. Explicit values still win.
|
|
416
416
|
- `submit()` on the controller runs the executor that matches `amountDirection`. `submitSupply()` and `submitPay()` remain for existing callers.
|
|
417
417
|
|
package/dist/auth-privy.js
CHANGED
|
@@ -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-
|
|
3
|
+
import{P as g}from"./privy-f2CjOGBQ.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;
|
|
@@ -22,6 +22,7 @@ export type SupplyFeeQuote = {
|
|
|
22
22
|
proceedsAvailable?: bigint;
|
|
23
23
|
proceedsUsed?: bigint;
|
|
24
24
|
batches?: ChainBatch[];
|
|
25
|
+
feePricingBatches?: ChainBatch[];
|
|
25
26
|
actionContext?: Partial<import("../../../types/supply").BuildActionCallsContext>;
|
|
26
27
|
fundingAmount?: bigint;
|
|
27
28
|
destinationSwap?: ResolvedSwap;
|
|
@@ -49,6 +50,15 @@ export declare function sizePivotSourceGasSkim(params: {
|
|
|
49
50
|
signal?: AbortSignal;
|
|
50
51
|
}): Promise<bigint>;
|
|
51
52
|
export declare function retainQuotedFixedFees(estimate: FeeEstimateSummary, previous: FeeEstimateSummary): FeeEstimateSummary;
|
|
53
|
+
export declare function estimateQuotedSupplyFees(params: {
|
|
54
|
+
estimate: EstimateFn;
|
|
55
|
+
batches: ChainBatch[];
|
|
56
|
+
pricingBatches: ChainBatch[];
|
|
57
|
+
tokenAddress: string;
|
|
58
|
+
fundingAmount: bigint;
|
|
59
|
+
options: ExecutionOptions;
|
|
60
|
+
signedEstimate?: FeeEstimateSummary;
|
|
61
|
+
}): Promise<FeeEstimateSummary>;
|
|
52
62
|
export declare function solveGrossFunding(fees: Pick<FeePreview, "grossAmount" | "gasFee" | "spicenetFee" | "bridgeFee">, requiredNetFunding: bigint): bigint;
|
|
53
63
|
export declare function estimatePayFunding(args: {
|
|
54
64
|
requiredNetFunding: bigint;
|
|
@@ -109,6 +119,7 @@ export interface FeePreviewContext {
|
|
|
109
119
|
selectedAsset: SelectedAsset | null;
|
|
110
120
|
isPayMode: boolean;
|
|
111
121
|
isFeeInclusiveInput?: boolean;
|
|
122
|
+
quotedInclusivePlatformFee?: boolean;
|
|
112
123
|
parsedAmount: number;
|
|
113
124
|
needsSwap: boolean;
|
|
114
125
|
exactOutputSwap: ResolvedExactOutputSwap | null;
|
|
@@ -142,5 +153,5 @@ export declare class FeeShortfallError extends Error {
|
|
|
142
153
|
readonly preview: FeePreview;
|
|
143
154
|
constructor(preview: FeePreview);
|
|
144
155
|
}
|
|
145
|
-
export declare function supplyContextForFees(fees: FeePreview, amount: bigint, inclusive: boolean, mode: SpiceSupplyProps["feeExecutionMode"], reserveFee?: bigint): Required<Pick<import("../../../types/supply").BuildActionCallsContext, "grossAmount" | "netAmount" | "combinedFeeAmount" | "feeExecutionMode" | "feeBreakdown">>;
|
|
156
|
+
export declare function supplyContextForFees(fees: FeePreview, amount: bigint, inclusive: boolean, mode: SpiceSupplyProps["feeExecutionMode"], reserveFee?: bigint, quotedInclusivePlatformFee?: boolean): Required<Pick<import("../../../types/supply").BuildActionCallsContext, "grossAmount" | "netAmount" | "combinedFeeAmount" | "feeExecutionMode" | "feeBreakdown">>;
|
|
146
157
|
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;
|