@spicenet-io/spiceflow-ui 4.14.4 → 4.14.5-limit-orders.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 +2 -23
- package/dist/auth-privy.cjs.js +1 -1
- package/dist/auth-privy.js +1 -1
- package/dist/components/SpiceSupply/lib/feePreview.d.ts +1 -6
- package/dist/execution/limitOrders.d.ts +49 -0
- package/dist/hooks/useSpiceLimitOrders.d.ts +13 -0
- package/dist/index.cjs.js +7 -6
- package/dist/index.d.ts +3 -0
- package/dist/index.js +9 -8
- package/dist/privy-CTb9WM_S.js +2 -0
- package/dist/privy-DSJCjSi0.js +2 -0
- package/dist/types/limitOrders.d.ts +37 -0
- package/dist/utils/relayer/index.d.ts +8 -0
- package/dist/utils/spicenetBatch.d.ts +4 -1
- package/package.json +3 -2
- package/dist/components/SpiceSupply/lib/externalAction.d.ts +0 -24
- package/dist/components/SpiceSupply/lib/externalGasReserve.d.ts +0 -19
- package/dist/privy-BPsKHzUu.js +0 -2
- package/dist/privy-n6MHafwm.js +0 -2
package/README.md
CHANGED
|
@@ -78,11 +78,8 @@ host-configured RPC. Keep private credentials out of browser bundles.
|
|
|
78
78
|
- In this unreleased source, eligible External-mode actions with a matching wallet token
|
|
79
79
|
and destination chain execute directly from the external signer, without embedded funding.
|
|
80
80
|
Other assets/chains still use embedded funding and the shared routed executor.
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
verifies delivery, then submits the captured host calls. This also permits a matching
|
|
84
|
-
external source to execute directly while the app remains in Embedded mode.
|
|
85
|
-
`onPayExecute` and `onLockExecute` remain blocked. Verify contract caller/beneficiary and NFT receiver behavior.
|
|
81
|
+
`onPayExecute` and `onLockExecute` remain blocked; the deprecated external-caller hint
|
|
82
|
+
supports only the direct case. Verify contract caller/beneficiary and NFT receiver behavior.
|
|
86
83
|
Published `.16` does not contain this restoration.
|
|
87
84
|
- Supply `input` adds fees to principal; `input-inclusive` uses a total budget; Pay
|
|
88
85
|
`output` fixes the destination amount. Use controller readiness/Max/status instead of
|
|
@@ -286,24 +283,6 @@ mode to its own wallet, pass `includeExternalWalletAssets={false}` (Embedded mod
|
|
|
286
283
|
token in both wallets sees one row per wallet; a host that preselects a source should
|
|
287
284
|
match on `assetPositionId`, not on symbol or address alone.
|
|
288
285
|
|
|
289
|
-
### Routed external callers
|
|
290
|
-
|
|
291
|
-
The controlled hook supports positive ERC20 input, input-inclusive and fixed-output
|
|
292
|
-
actions with an explicit external caller. Configure `rpcOverrides` for the destination
|
|
293
|
-
and any wallet-source chain. Quotes bind the source spend cap, destination delivery,
|
|
294
|
-
external caller and host calls before funding. The SDK checks the destination receipt,
|
|
295
|
-
ERC20 transfer amount and caller balance before requesting the host transactions.
|
|
296
|
-
Only the final external transaction hash reaches awaited application finalization.
|
|
297
|
-
|
|
298
|
-
Below one destination transaction's native gas cost, the accepted route buys gas for
|
|
299
|
-
the pending external calls plus three later transactions. At or above that threshold
|
|
300
|
-
it adds no reserve; direct execution still pays its own native gas. Native destinations,
|
|
301
|
-
zero-principal, proceeds-funded and explicit source-escrow caller actions remain
|
|
302
|
-
unsupported capability gaps. This does not add a stock-component prop or a durable
|
|
303
|
-
execution journal: after signing fails, delivered tokens remain ordinary wallet assets
|
|
304
|
-
and retrying the original route can fund again. Use `retryFinalization()` to retry only
|
|
305
|
-
a failed application callback after the external action has confirmed.
|
|
306
|
-
|
|
307
286
|
### Action Fee Readiness
|
|
308
287
|
|
|
309
288
|
- Routed Supply, Pay and Lock actions must surface fee estimation before enabling submission.
|
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-CTb9WM_S.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-DSJCjSi0.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};
|
|
@@ -8,12 +8,10 @@ import type { DestinationTokenConfig, FeeFundingSource, PivotRoute, SpiceSupplyP
|
|
|
8
8
|
import type { FeePreview } from "../../../types/ui";
|
|
9
9
|
import type { ResolvedExactOutputSwap } from "../../../utils/swapQuotes";
|
|
10
10
|
import { type FundingConversion } from "./feeConversion";
|
|
11
|
-
import { type ExternalGasReserve } from "./externalGasReserve";
|
|
12
11
|
type EstimateFn = (chainBatches: ChainBatch[], tokenAddress: string, tokenTransferAmount: bigint, options?: ExecutionOptions) => Promise<FeeEstimateSummary>;
|
|
13
12
|
type BuildPayBatchesFn = (options?: SupplyBatchBuildOptions) => Promise<ChainBatch[]>;
|
|
14
13
|
type BuildSupplyBatchesFn = (options?: SupplyBatchBuildOptions) => Promise<ChainBatch[]>;
|
|
15
14
|
export type SupplyFeeQuote = {
|
|
16
|
-
externalGasReserve?: ExternalGasReserve;
|
|
17
15
|
fundedFeeToken?: DestinationTokenConfig;
|
|
18
16
|
actionDefinition?: Parameters<NonNullable<SupplyBatchBuildOptions["onActionCalls"]>>[0];
|
|
19
17
|
fundingConversion?: FundingConversion;
|
|
@@ -87,9 +85,6 @@ export declare function estimateSupplyMaxAmount(ctx: {
|
|
|
87
85
|
feeExecutionMode: SpiceSupplyProps["feeExecutionMode"];
|
|
88
86
|
}): Promise<string | null>;
|
|
89
87
|
export interface FeePreviewContext {
|
|
90
|
-
externalGasRecipient?: Address;
|
|
91
|
-
externalGasCalls?: (plan: SupplyFeeQuote) => Promise<ChainBatch["calls"]>;
|
|
92
|
-
externalGasReserve?: ExternalGasReserve;
|
|
93
88
|
feeToleranceBps?: number;
|
|
94
89
|
initialFeeEstimate?: FeeEstimateSummary;
|
|
95
90
|
initialSourceGasSkim?: bigint;
|
|
@@ -142,5 +137,5 @@ export declare class FeeShortfallError extends Error {
|
|
|
142
137
|
readonly preview: FeePreview;
|
|
143
138
|
constructor(preview: FeePreview);
|
|
144
139
|
}
|
|
145
|
-
export declare function supplyContextForFees(fees: FeePreview, amount: bigint, inclusive: boolean, mode: SpiceSupplyProps["feeExecutionMode"]
|
|
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">>;
|
|
146
141
|
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { type Address, type Hex } from "viem";
|
|
2
|
+
import { type CreateActionRequest } from "@spicenet-io/spiceflow-core";
|
|
3
|
+
export declare const ORDER_MARKER = "spiceflow-limit-order:v1";
|
|
4
|
+
export declare const limitSwapAbi: readonly [{
|
|
5
|
+
readonly name: "exactInput";
|
|
6
|
+
readonly type: "function";
|
|
7
|
+
readonly stateMutability: "payable";
|
|
8
|
+
readonly inputs: readonly [{
|
|
9
|
+
readonly type: "tuple";
|
|
10
|
+
readonly components: readonly [{
|
|
11
|
+
readonly type: "bytes";
|
|
12
|
+
readonly name: "path";
|
|
13
|
+
}, {
|
|
14
|
+
readonly type: "address";
|
|
15
|
+
readonly name: "recipient";
|
|
16
|
+
}, {
|
|
17
|
+
readonly type: "uint256";
|
|
18
|
+
readonly name: "deadline";
|
|
19
|
+
}, {
|
|
20
|
+
readonly type: "uint256";
|
|
21
|
+
readonly name: "amountIn";
|
|
22
|
+
}, {
|
|
23
|
+
readonly type: "uint256";
|
|
24
|
+
readonly name: "amountOutMinimum";
|
|
25
|
+
}];
|
|
26
|
+
readonly name: "params";
|
|
27
|
+
}];
|
|
28
|
+
readonly outputs: readonly [{
|
|
29
|
+
readonly type: "uint256";
|
|
30
|
+
readonly name: "amountOut";
|
|
31
|
+
}];
|
|
32
|
+
}];
|
|
33
|
+
export declare function limitOrderCancelMessage(id: string): string;
|
|
34
|
+
export declare function limitOrderId(request: CreateActionRequest): string;
|
|
35
|
+
export declare function buildLimitOrderRequest(params: {
|
|
36
|
+
user: Address;
|
|
37
|
+
chainId: number;
|
|
38
|
+
tokenIn: Address;
|
|
39
|
+
router: Address;
|
|
40
|
+
path: Hex;
|
|
41
|
+
grossAmount: bigint;
|
|
42
|
+
amountIn: bigint;
|
|
43
|
+
minimumOutput: bigint;
|
|
44
|
+
expiresAt: number;
|
|
45
|
+
platformFee: bigint;
|
|
46
|
+
gasBridgeFee: bigint;
|
|
47
|
+
requestTimestampMs: number;
|
|
48
|
+
requestNonce: Hex;
|
|
49
|
+
}): CreateActionRequest;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type CreateActionRequest } from "@spicenet-io/spiceflow-core";
|
|
2
|
+
import type { LimitOrderInput, PreparedLimitOrder } from "../types/limitOrders";
|
|
3
|
+
export declare function useSpiceLimitOrders(): {
|
|
4
|
+
prepareOrder: (input: LimitOrderInput) => Promise<PreparedLimitOrder>;
|
|
5
|
+
signOrder: (prepared: PreparedLimitOrder) => Promise<CreateActionRequest>;
|
|
6
|
+
placeOrder: (request: CreateActionRequest) => Promise<import("..").LimitOrder>;
|
|
7
|
+
getOrder: (id: string) => Promise<import("..").LimitOrder>;
|
|
8
|
+
listOrders: (after?: string) => Promise<{
|
|
9
|
+
orders: import("..").LimitOrder[];
|
|
10
|
+
nextCursor: string | null;
|
|
11
|
+
}>;
|
|
12
|
+
cancelOrder: (id: string) => Promise<import("..").LimitOrder>;
|
|
13
|
+
};
|