@spicenet-io/spiceflow-ui 4.16.0-rc.1 → 4.16.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 +29 -15
- package/dist/auth-privy.cjs.js +1 -1
- package/dist/auth-privy.js +1 -1
- package/dist/components/SpiceSupply/lib/executors.d.ts +0 -1
- package/dist/components/SpiceSupply/lib/feePreview.d.ts +1 -12
- package/dist/components/SpiceWithdraw/lib/executors.d.ts +1 -2
- package/dist/components/SpiceWithdraw/lib/useEmbeddedWithdraw.d.ts +3 -9
- package/dist/components/ui/FeeBreakdownCard.d.ts +1 -0
- package/dist/execution/pollIntentStep.d.ts +2 -3
- package/dist/hooks/useSpiceExecution.d.ts +1 -5
- package/dist/hooks/useSpiceLock.d.ts +2 -0
- package/dist/hooks/useSpiceSupply.d.ts +4 -6
- package/dist/index.cjs.js +9 -10
- package/dist/index.d.ts +2 -1
- package/dist/index.js +9 -10
- package/dist/privy-CJrJ-_kT.js +2 -0
- package/dist/privy-CVgeMt74.js +2 -0
- package/dist/types/supply.d.ts +26 -1
- package/dist/utils/relayer/index.d.ts +3 -6
- package/package.json +1 -1
- package/dist/components/SpiceWithdraw/lib/pendingWithdrawal.d.ts +0 -41
- package/dist/components/SpiceWithdraw/lib/useWithdrawalRecovery.d.ts +0 -25
- package/dist/privy-BVlSQ7nR.js +0 -2
- package/dist/privy-NjNrRvlu.js +0 -2
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 fee-only Supply path.
|
|
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.
|
|
@@ -277,18 +277,6 @@ callbacks are unchanged.
|
|
|
277
277
|
`initialSourceAssetId` selects a current balance by ID; it does not supply a
|
|
278
278
|
cached balance or change the receipt's supported withdrawal routes.
|
|
279
279
|
|
|
280
|
-
Native `SpiceWithdraw` actions save a pending submission for the current relayer,
|
|
281
|
-
network and wallet before sending it. Reopening the modal after a timeout or
|
|
282
|
-
reload shows **Check or resume withdrawal**; it looks up the original submission
|
|
283
|
-
and continues its unfinished steps without another signature or source transfer.
|
|
284
|
-
The pending record also shows a copyable submission key and action ID for support.
|
|
285
|
-
A missing lookup result or unresolved action keeps a new withdrawal blocked,
|
|
286
|
-
because the original submission may still arrive. The relayer must support
|
|
287
|
-
idempotent `POST /actions`, submission lookup, and the action recovery status
|
|
288
|
-
endpoint for this flow. Browser storage and Web Locks must be available before
|
|
289
|
-
the native action can start. A host-provided non-7702 `onWithdrawExecute` remains
|
|
290
|
-
the host's execution and recovery responsibility.
|
|
291
|
-
|
|
292
280
|
### Funding sources
|
|
293
281
|
|
|
294
282
|
Supply, Pay and Lock list every balance that can fund the action: the embedded wallet
|
|
@@ -321,11 +309,37 @@ a failed application callback after the external action has confirmed.
|
|
|
321
309
|
- Routed Supply, Pay and Lock actions must surface fee estimation before enabling submission.
|
|
322
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.
|
|
323
311
|
- Deposit gas and rollup withdrawal semantics remain distinct from action intent fees. Preserve their existing quote/readiness requirements.
|
|
324
|
-
- Account wallet withdrawal
|
|
312
|
+
- Account wallet withdrawal is a fee-only Supply action. Do not bypass its fee/readiness gates based on the label "withdraw".
|
|
325
313
|
- Custom actions use the shared controller's `canExecute`; an available balance or old quote alone is insufficient.
|
|
326
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.
|
|
327
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.
|
|
328
316
|
|
|
317
|
+
### Native action review
|
|
318
|
+
|
|
319
|
+
`SpiceSupply` displays the actual fee total for `feeOnlyAction` even when no
|
|
320
|
+
source is selected and the principal payment is zero. It omits the zero-value
|
|
321
|
+
payment estimate. Pass `feeFundingReserve: { asset, amount }` when principal
|
|
322
|
+
already in the executor must remain unavailable for fee funding.
|
|
323
|
+
|
|
324
|
+
Use `onStateChange(state: SupplyModalState)` to review the native controller's
|
|
325
|
+
`feeQuote`, `feePreview`, selected asset, operation key, readiness, progress and
|
|
326
|
+
transaction hash. Do not create a second controller to approximate its fees.
|
|
327
|
+
`submitDisabled` vetoes a new confirmation while native quoting remains active.
|
|
328
|
+
|
|
329
|
+
`beforeSubmit(review: SupplySubmissionReview)` can await application checks such
|
|
330
|
+
as a fresh position read. The SDK captures the accepted quote and rejects changed
|
|
331
|
+
quotes, wallets, policies, closed forms and retired components before calling
|
|
332
|
+
the synchronous `onSubmit` callback or starting execution. Use `onSubmit` for
|
|
333
|
+
application feedback that the action was accepted. The controller
|
|
334
|
+
holds submission readiness while those checks run, including across rerenders.
|
|
335
|
+
After acceptance, `submitDisabled` may become true to reflect host busy state;
|
|
336
|
+
it does not cancel that accepted execution. Application checks
|
|
337
|
+
must still reject revoked consent in their `beforeSubmit` callback.
|
|
338
|
+
|
|
339
|
+
Return the application receipt-verification promise from `onSuccess`. A failed
|
|
340
|
+
application update uses the existing finalization retry without submitting the
|
|
341
|
+
financial action again.
|
|
342
|
+
|
|
329
343
|
### Fee funding for funded actions
|
|
330
344
|
|
|
331
345
|
Set `feeFunding: ["input", "proceeds", "balance"]` on `useSpiceSupply`,
|
|
@@ -423,7 +437,7 @@ during prewarming. The time available before typing determines how much work it
|
|
|
423
437
|
- 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.
|
|
424
438
|
- `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`.
|
|
425
439
|
- A `selectedAsset` on a fee-only action is an explicit host choice and funds the fee from that balance as before.
|
|
426
|
-
- Account wallet withdrawals use this hierarchy automatically and display the chosen fee asset without a selector.
|
|
440
|
+
- 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`.
|
|
427
441
|
- `feeOnlyAction` alone declares the action: `amountDirection` defaults to `"output"` and `paymentAmount` to `"0"`. Explicit values still win.
|
|
428
442
|
- `submit()` on the controller runs the executor that matches `amountDirection`. `submitSupply()` and `submitPay()` remain for existing callers.
|
|
429
443
|
|
package/dist/auth-privy.cjs.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
|
-
"use strict";const r=require("./privy-
|
|
3
|
+
"use strict";const r=require("./privy-CVgeMt74.js");require("react/jsx-runtime"),require("react"),require("@spicenet-io/spiceflow-core"),require("@tanstack/react-query"),require("viem"),require("@privy-io/react-auth"),require("wagmi"),require("viem/actions"),exports.PrivyLogin=r.PrivyLogin;
|
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-CJrJ-_kT.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,7 +21,6 @@ export type ExecutorContext = {
|
|
|
21
21
|
isInsufficientBalance: boolean;
|
|
22
22
|
isPayMode: boolean;
|
|
23
23
|
isFeeInclusiveInput?: boolean;
|
|
24
|
-
quotedInclusivePlatformFee?: boolean;
|
|
25
24
|
feeOnlyAction?: boolean;
|
|
26
25
|
actionProceeds?: Exclude<SpiceSupplyProps["actionProceeds"], "output">;
|
|
27
26
|
validateFeeQuote?: () => void;
|
|
@@ -22,7 +22,6 @@ export type SupplyFeeQuote = {
|
|
|
22
22
|
proceedsAvailable?: bigint;
|
|
23
23
|
proceedsUsed?: bigint;
|
|
24
24
|
batches?: ChainBatch[];
|
|
25
|
-
feePricingBatches?: ChainBatch[];
|
|
26
25
|
actionContext?: Partial<import("../../../types/supply").BuildActionCallsContext>;
|
|
27
26
|
fundingAmount?: bigint;
|
|
28
27
|
destinationSwap?: ResolvedSwap;
|
|
@@ -50,15 +49,6 @@ export declare function sizePivotSourceGasSkim(params: {
|
|
|
50
49
|
signal?: AbortSignal;
|
|
51
50
|
}): Promise<bigint>;
|
|
52
51
|
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>;
|
|
62
52
|
export declare function solveGrossFunding(fees: Pick<FeePreview, "grossAmount" | "gasFee" | "spicenetFee" | "bridgeFee">, requiredNetFunding: bigint): bigint;
|
|
63
53
|
export declare function estimatePayFunding(args: {
|
|
64
54
|
requiredNetFunding: bigint;
|
|
@@ -119,7 +109,6 @@ export interface FeePreviewContext {
|
|
|
119
109
|
selectedAsset: SelectedAsset | null;
|
|
120
110
|
isPayMode: boolean;
|
|
121
111
|
isFeeInclusiveInput?: boolean;
|
|
122
|
-
quotedInclusivePlatformFee?: boolean;
|
|
123
112
|
parsedAmount: number;
|
|
124
113
|
needsSwap: boolean;
|
|
125
114
|
exactOutputSwap: ResolvedExactOutputSwap | null;
|
|
@@ -153,5 +142,5 @@ export declare class FeeShortfallError extends Error {
|
|
|
153
142
|
readonly preview: FeePreview;
|
|
154
143
|
constructor(preview: FeePreview);
|
|
155
144
|
}
|
|
156
|
-
export declare function supplyContextForFees(fees: FeePreview, amount: bigint, inclusive: boolean, mode: SpiceSupplyProps["feeExecutionMode"], reserveFee?: bigint
|
|
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">>;
|
|
157
146
|
export {};
|
|
@@ -2,7 +2,7 @@ import type { Dispatch, MutableRefObject, SetStateAction } from "react";
|
|
|
2
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 {
|
|
5
|
+
import type { ExecutionProgress } from "../../../hooks/useSpiceExecution";
|
|
6
6
|
import type { FeeEstimateSummary } from "@spicenet-io/spiceflow-core";
|
|
7
7
|
export type WithdrawalExecutionContext = {
|
|
8
8
|
actionId: string;
|
|
@@ -31,7 +31,6 @@ export type WithdrawExecutorContext = {
|
|
|
31
31
|
};
|
|
32
32
|
executionContextRef: MutableRefObject<WithdrawalExecutionContext | null>;
|
|
33
33
|
isMountedRef: MutableRefObject<boolean>;
|
|
34
|
-
withdrawalRecovery?: ExecutionOptions["withdrawalRecovery"];
|
|
35
34
|
} & Pick<SpiceWithdrawProps, "onWithdrawExecute" | "onWithdrawSuccess" | "buildSpicenetBatch">;
|
|
36
35
|
export declare function executeWithdraw(ctx: WithdrawExecutorContext): Promise<void>;
|
|
37
36
|
export declare function retryWithdraw(ctx: WithdrawExecutorContext): Promise<void>;
|
|
@@ -1,25 +1,19 @@
|
|
|
1
1
|
import { type Address } from "viem";
|
|
2
|
-
import type { ExecutionOptions } from "../../../hooks/useSpiceExecution";
|
|
3
2
|
import type { Asset } from "../../../types/assets";
|
|
4
3
|
import type { SpiceWithdrawProps } from "../../../types/withdraw";
|
|
5
4
|
export declare function useSpiceEmbeddedWithdraw(params: {
|
|
6
5
|
enabled: boolean;
|
|
7
6
|
asset: Asset | null;
|
|
8
7
|
amount: bigint;
|
|
9
|
-
destination?: {
|
|
10
|
-
address: Address;
|
|
11
|
-
symbol: string;
|
|
12
|
-
decimals: number;
|
|
13
|
-
chainId: number;
|
|
14
|
-
} | null;
|
|
15
8
|
recipient?: Address;
|
|
16
9
|
owner?: Address;
|
|
17
10
|
sourceChains?: number[];
|
|
18
11
|
onSuccess?: SpiceWithdrawProps["onWithdrawSuccess"];
|
|
19
12
|
onError?: SpiceWithdrawProps["onWithdrawError"];
|
|
20
|
-
withdrawalRecovery?: ExecutionOptions["withdrawalRecovery"];
|
|
21
13
|
}): {
|
|
22
14
|
supply: {
|
|
15
|
+
operationKey: `0x${string}`;
|
|
16
|
+
feeQuote: import("../../..").SupplyFeeQuote | null;
|
|
23
17
|
selectedAsset: import("../../..").SelectedAsset | null;
|
|
24
18
|
capability: {
|
|
25
19
|
eligible: boolean;
|
|
@@ -121,6 +115,6 @@ export declare function useSpiceEmbeddedWithdraw(params: {
|
|
|
121
115
|
resetAfterSuccess: () => void;
|
|
122
116
|
resetPaymentState: () => void;
|
|
123
117
|
};
|
|
124
|
-
source: Asset |
|
|
118
|
+
source: Asset | undefined;
|
|
125
119
|
maximumFeeFunding: bigint | null | undefined;
|
|
126
120
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { RelayerService } from "../utils/relayer";
|
|
2
1
|
type StepResult = {
|
|
3
2
|
status: string;
|
|
4
3
|
transactionHash?: string;
|
|
5
4
|
error?: string;
|
|
5
|
+
executionStatus?: "success" | "reverted";
|
|
6
6
|
};
|
|
7
7
|
type PollIntentStepOptions = {
|
|
8
8
|
actionId: string;
|
|
@@ -17,8 +17,7 @@ type PollIntentStepOptions = {
|
|
|
17
17
|
onStepUpdate?: (result: StepResult) => void;
|
|
18
18
|
signal?: AbortSignal;
|
|
19
19
|
chainId?: number;
|
|
20
|
-
|
|
21
|
-
relayer?: Pick<RelayerService, "executeStep" | "checkStepStatus">;
|
|
20
|
+
completeOnExecution?: boolean;
|
|
22
21
|
};
|
|
23
22
|
export declare function pollIntentStepUntilSuccess(options: PollIntentStepOptions): Promise<string | undefined>;
|
|
24
23
|
export declare function runAllIntentSteps(options: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { FeeEstimateSummary } from "@spicenet-io/spiceflow-core";
|
|
2
2
|
import { Address } from "viem";
|
|
3
3
|
import { Call, ChainBatch } from "../types/authorization";
|
|
4
4
|
import { type ActionOutputCredit } from "../utils/actionOutputEscrowFunding";
|
|
@@ -42,10 +42,6 @@ export interface ExecutionOptions {
|
|
|
42
42
|
submittedFeeEstimate?: FeeEstimateSummary;
|
|
43
43
|
skipUserFundingPreflight?: boolean;
|
|
44
44
|
validateFeeCalls?: boolean;
|
|
45
|
-
withdrawalRecovery?: {
|
|
46
|
-
submitAction: (user: Address, totalSteps: number, create: (idempotencyKey: string) => Promise<CreateActionResponse>) => Promise<CreateActionResponse>;
|
|
47
|
-
onActionComplete: (actionId: string) => Promise<void>;
|
|
48
|
-
};
|
|
49
45
|
signal?: AbortSignal;
|
|
50
46
|
}
|
|
51
47
|
export declare function validateUserFundingCapacity(chainBatches: ChainBatch[], userAddress: Address, options?: Pick<ExecutionOptions, "walletFundingRequirement"> & {
|
|
@@ -43,6 +43,8 @@ export declare function useSpiceLock(params: UseSpiceLockParams): {
|
|
|
43
43
|
};
|
|
44
44
|
metadataError: string | null;
|
|
45
45
|
canExecute: boolean;
|
|
46
|
+
operationKey: `0x${string}`;
|
|
47
|
+
feeQuote: import("..").SupplyFeeQuote | null;
|
|
46
48
|
selectedAsset: SelectedAsset | null;
|
|
47
49
|
capability: {
|
|
48
50
|
eligible: boolean;
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { type ResolvedSwap } from "@spicenet-io/spiceflow-core";
|
|
2
2
|
import { type Address } from "viem";
|
|
3
3
|
import { type PaymentResult, type SupplyStep } from "../components/SpiceSupply/lib/executors";
|
|
4
|
-
import { type
|
|
4
|
+
import { type SupplyFeeQuote } from "../components/SpiceSupply/lib/feePreview";
|
|
5
5
|
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
|
-
|
|
9
|
-
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"> {
|
|
10
|
-
quotedInclusivePlatformFee?: boolean;
|
|
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" | "feeFundingReserve" | "beforeSubmit" | "submitDisabled"> {
|
|
11
9
|
enabled?: boolean;
|
|
12
10
|
destinationToken: DestinationTokenDeclaration | undefined;
|
|
13
11
|
selectedAsset: SelectedAsset | null;
|
|
@@ -19,10 +17,10 @@ export interface UseSpiceSupplyParams extends Pick<SpiceSupplyProps, "sourceChai
|
|
|
19
17
|
recoveryKey: string;
|
|
20
18
|
};
|
|
21
19
|
prependSourceEscrow?: boolean;
|
|
22
|
-
feeFundingReserve?: FeePreviewContext["feeFundingReserve"];
|
|
23
|
-
withdrawalRecovery?: ExecutionOptions["withdrawalRecovery"];
|
|
24
20
|
}
|
|
25
21
|
export declare function useSpiceSupply(params: UseSpiceSupplyParams): {
|
|
22
|
+
operationKey: `0x${string}`;
|
|
23
|
+
feeQuote: SupplyFeeQuote | null;
|
|
26
24
|
selectedAsset: SelectedAsset | null;
|
|
27
25
|
capability: {
|
|
28
26
|
eligible: boolean;
|