@spicenet-io/spiceflow-ui 4.23.0-private-rpc.0 → 4.23.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 CHANGED
@@ -456,6 +456,32 @@ wallet activity and the backend order list before creating another order.
456
456
  Changing wallets or provider policy retires prepared and signed requests. No
457
457
  browser transaction journal or parallel recovery tracker is required.
458
458
 
459
+ ### Conditional Limit/Stop orders
460
+
461
+ `useSpiceLimitOrders({ combineSourceBalances: true }).conditional` bridges
462
+ `prepareOrder(input, condition, fundingPolicy, triggerForCash?)`, `sign(prepared)`
463
+ and `register(signed)` to the conditional service. Use `"cash-first"` for an
464
+ inclusive cash budget with same-chain wallet shortfall funding, or
465
+ `"execution-balances"` for a fixed-input swap using the existing conditional
466
+ swap planner. The host owns the evaluator criteria and chosen policy.
467
+
468
+ For cash-first orders, `fees.amount` includes execution and upfront funding
469
+ fees, `fundingFeeAmount` identifies the funding portion, and `swapAmountIn`
470
+ is the resulting fixed swap input. `triggerForCash`, when supplied, receives
471
+ the gross execution budget after the funding fee; encode that amount into the
472
+ signed evaluator criteria. Preparation and conditional signing never deposit
473
+ funds. Registration uses the same funding, receipt, credit and pending-outcome
474
+ controller as native limit orders; consume the parent `status` and
475
+ `refreshStatus`. A signed amendment (`condition.replacesIntentId`) never creates
476
+ a new funding deposit. Backend validation must enforce amendment ownership and
477
+ claim races.
478
+
479
+ The root export `CONDITIONAL_INTENT_UNTIL_CANCELLED` is the only accepted expiry
480
+ beyond the normal 30-day window. Pass it as `condition.expiresAt` and
481
+ `Number(CONDITIONAL_INTENT_UNTIL_CANCELLED)` as `input.expiresAt`. The service and
482
+ evaluator must support that exact expiry and the selected trigger kind.
483
+ This bridge does not add bundles, sequences or deferred Supply creation.
484
+
459
485
  ### Fee funding for funded actions
460
486
 
461
487
  Set `feeFunding: ["input", "proceeds", "balance"]` on `useSpiceSupply`,
@@ -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-DcMzp0Q9.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-EeJJv3H5.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};
@@ -38,6 +38,7 @@ export declare function limitOrderCancelMessage(id: string): string;
38
38
  export declare function limitOrderId(request: CreateActionRequest): string;
39
39
  export declare function buildLimitOrderRequest(params: {
40
40
  replacesOrderId?: string;
41
+ conditional?: boolean;
41
42
  user: Address;
42
43
  chainId: number;
43
44
  tokenIn: Address;
@@ -1,8 +1,27 @@
1
- import { type CreateActionRequest } from "@spicenet-io/spiceflow-core";
1
+ import { type Hex } from "viem";
2
+ import { type RegisterConditionalIntentResponse, type CreateActionRequest } from "@spicenet-io/spiceflow-core";
3
+ import type { ConditionalIntentDraft, PreparedConditionalIntent } from "../types/conditionalIntents";
2
4
  import type { LimitOrder, LimitOrderInput, PreparedLimitOrder } from "../types/limitOrders";
3
5
  export declare function useSpiceLimitOrders(options?: {
4
6
  combineSourceBalances?: boolean;
5
7
  }): {
8
+ conditional: {
9
+ prepareOrder(input: LimitOrderInput, condition: Omit<ConditionalIntentDraft, "chainBatches">, fundingPolicy: "cash-first" | "execution-balances", triggerForCash?: (cashAmount: bigint) => Hex): Promise<PreparedConditionalIntent>;
10
+ sign(value: PreparedConditionalIntent): Promise<PreparedConditionalIntent>;
11
+ register(value: PreparedConditionalIntent): Promise<RegisterConditionalIntentResponse>;
12
+ prepare: (draft: ConditionalIntentDraft) => Promise<PreparedConditionalIntent>;
13
+ prepareSwap: (draft: import(".").ConditionalSwapDraft) => Promise<PreparedConditionalIntent>;
14
+ authorizeRead: (serviceId: string) => Promise<string>;
15
+ get: (id: string, serviceId: string) => Promise<import("@spicenet-io/spiceflow-core").ConditionalIntentStatus>;
16
+ list: (serviceId: string, options?: {
17
+ limit?: number;
18
+ cursor?: string;
19
+ }) => Promise<{
20
+ intents: import("@spicenet-io/spiceflow-core").ConditionalIntentStatus[];
21
+ nextCursor?: string;
22
+ }>;
23
+ cancel: (id: string, serviceId: string) => Promise<import("@spicenet-io/spiceflow-core").ConditionalIntentStatus>;
24
+ };
6
25
  status: {
7
26
  step: string;
8
27
  isExecuting: boolean;