@orbs-network/spot-react 2.0.1 → 2.1.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.
Files changed (137) hide show
  1. package/README.md +228 -117
  2. package/dist/spot-react/src/context/client-error-notice.d.ts +7 -0
  3. package/dist/spot-react/src/context/client-error-notice.d.ts.map +1 -0
  4. package/dist/spot-react/src/context/error-boundary.d.ts +7 -0
  5. package/dist/spot-react/src/context/error-boundary.d.ts.map +1 -0
  6. package/dist/spot-react/src/context/order-form-context.d.ts +7 -0
  7. package/dist/spot-react/src/context/order-form-context.d.ts.map +1 -0
  8. package/dist/spot-react/src/context/spot-form-synchronizer.d.ts +14 -0
  9. package/dist/spot-react/src/context/spot-form-synchronizer.d.ts.map +1 -0
  10. package/dist/spot-react/src/context/spot-provider.d.ts +3 -0
  11. package/dist/spot-react/src/context/spot-provider.d.ts.map +1 -0
  12. package/dist/spot-react/src/context/spot-store.d.ts +86 -0
  13. package/dist/spot-react/src/context/spot-store.d.ts.map +1 -0
  14. package/dist/spot-react/src/context/use-client.d.ts +10 -0
  15. package/dist/spot-react/src/context/use-client.d.ts.map +1 -0
  16. package/dist/spot-react/src/context/use-spot-analytics.d.ts +3 -0
  17. package/dist/spot-react/src/context/use-spot-analytics.d.ts.map +1 -0
  18. package/dist/spot-react/src/context/use-spot-provider-state.d.ts +10 -0
  19. package/dist/spot-react/src/context/use-spot-provider-state.d.ts.map +1 -0
  20. package/dist/spot-react/src/execute-order.d.ts +24 -0
  21. package/dist/spot-react/src/execute-order.d.ts.map +1 -0
  22. package/dist/spot-react/src/execution-state.d.ts +19 -0
  23. package/dist/spot-react/src/execution-state.d.ts.map +1 -0
  24. package/dist/spot-react/src/hooks/helper-hooks.d.ts +2 -547
  25. package/dist/spot-react/src/hooks/helper-hooks.d.ts.map +1 -1
  26. package/dist/spot-react/src/hooks/order-hooks.d.ts +28 -18
  27. package/dist/spot-react/src/hooks/order-hooks.d.ts.map +1 -1
  28. package/dist/spot-react/src/hooks/use-cancel-order.d.ts +4 -4
  29. package/dist/spot-react/src/hooks/use-cancel-order.d.ts.map +1 -1
  30. package/dist/spot-react/src/hooks/use-disclaimer.d.ts.map +1 -1
  31. package/dist/spot-react/src/hooks/use-duration.d.ts +2 -19
  32. package/dist/spot-react/src/hooks/use-duration.d.ts.map +1 -1
  33. package/dist/spot-react/src/hooks/use-execution.d.ts +30 -0
  34. package/dist/spot-react/src/hooks/use-execution.d.ts.map +1 -0
  35. package/dist/spot-react/src/hooks/use-fill-delay.d.ts +2 -21
  36. package/dist/spot-react/src/hooks/use-fill-delay.d.ts.map +1 -1
  37. package/dist/spot-react/src/hooks/use-history-order.d.ts +51 -27
  38. package/dist/spot-react/src/hooks/use-history-order.d.ts.map +1 -1
  39. package/dist/spot-react/src/hooks/use-input-errors.d.ts +1 -1
  40. package/dist/spot-react/src/hooks/use-input-errors.d.ts.map +1 -1
  41. package/dist/spot-react/src/hooks/use-limit-price.d.ts +14 -21
  42. package/dist/spot-react/src/hooks/use-limit-price.d.ts.map +1 -1
  43. package/dist/spot-react/src/hooks/use-output-amount.d.ts +5 -0
  44. package/dist/spot-react/src/hooks/use-output-amount.d.ts.map +1 -0
  45. package/dist/spot-react/src/hooks/use-price-display.d.ts +10 -0
  46. package/dist/spot-react/src/hooks/use-price-display.d.ts.map +1 -0
  47. package/dist/spot-react/src/hooks/use-submit-order.d.ts +1 -2
  48. package/dist/spot-react/src/hooks/use-submit-order.d.ts.map +1 -1
  49. package/dist/spot-react/src/hooks/use-swap-execution.d.ts +9 -10
  50. package/dist/spot-react/src/hooks/use-swap-execution.d.ts.map +1 -1
  51. package/dist/spot-react/src/hooks/use-trades.d.ts +7 -17
  52. package/dist/spot-react/src/hooks/use-trades.d.ts.map +1 -1
  53. package/dist/spot-react/src/hooks/use-trigger-price.d.ts +13 -20
  54. package/dist/spot-react/src/hooks/use-trigger-price.d.ts.map +1 -1
  55. package/dist/spot-react/src/index.d.ts +19 -10
  56. package/dist/spot-react/src/index.d.ts.map +1 -1
  57. package/dist/spot-react/src/order-history-data.d.ts +14 -0
  58. package/dist/spot-react/src/order-history-data.d.ts.map +1 -0
  59. package/dist/spot-react/src/types.d.ts +90 -106
  60. package/dist/spot-react/src/types.d.ts.map +1 -1
  61. package/dist/spot-react.js +1650 -6497
  62. package/dist/spot-react.umd.cjs +1 -64
  63. package/package.json +8 -13
  64. package/dist/spot-react/package.json.d.ts +0 -56
  65. package/dist/spot-react/src/hooks/use-amounts-usd.d.ts +0 -5
  66. package/dist/spot-react/src/hooks/use-amounts-usd.d.ts.map +0 -1
  67. package/dist/spot-react/src/hooks/use-build-order-info.d.ts +0 -62
  68. package/dist/spot-react/src/hooks/use-build-order-info.d.ts.map +0 -1
  69. package/dist/spot-react/src/hooks/use-deadline.d.ts +0 -2
  70. package/dist/spot-react/src/hooks/use-deadline.d.ts.map +0 -1
  71. package/dist/spot-react/src/hooks/use-default-values.d.ts +0 -3
  72. package/dist/spot-react/src/hooks/use-default-values.d.ts.map +0 -1
  73. package/dist/spot-react/src/hooks/use-dst-amount.d.ts +0 -11
  74. package/dist/spot-react/src/hooks/use-dst-amount.d.ts.map +0 -1
  75. package/dist/spot-react/src/hooks/use-dst-token-panel.d.ts +0 -7
  76. package/dist/spot-react/src/hooks/use-dst-token-panel.d.ts.map +0 -1
  77. package/dist/spot-react/src/hooks/use-fees.d.ts +0 -7
  78. package/dist/spot-react/src/hooks/use-fees.d.ts.map +0 -1
  79. package/dist/spot-react/src/hooks/use-form-data.d.ts +0 -57
  80. package/dist/spot-react/src/hooks/use-form-data.d.ts.map +0 -1
  81. package/dist/spot-react/src/hooks/use-input-with-percentage.d.ts +0 -16
  82. package/dist/spot-react/src/hooks/use-input-with-percentage.d.ts.map +0 -1
  83. package/dist/spot-react/src/hooks/use-limit-price-panel.d.ts +0 -22
  84. package/dist/spot-react/src/hooks/use-limit-price-panel.d.ts.map +0 -1
  85. package/dist/spot-react/src/hooks/use-partner-chains.d.ts +0 -2
  86. package/dist/spot-react/src/hooks/use-partner-chains.d.ts.map +0 -1
  87. package/dist/spot-react/src/hooks/use-price-panel.d.ts +0 -21
  88. package/dist/spot-react/src/hooks/use-price-panel.d.ts.map +0 -1
  89. package/dist/spot-react/src/hooks/use-repermit-data.d.ts +0 -7
  90. package/dist/spot-react/src/hooks/use-repermit-data.d.ts.map +0 -1
  91. package/dist/spot-react/src/hooks/use-repermit-order-data.d.ts +0 -20
  92. package/dist/spot-react/src/hooks/use-repermit-order-data.d.ts.map +0 -1
  93. package/dist/spot-react/src/hooks/use-spot.d.ts +0 -40
  94. package/dist/spot-react/src/hooks/use-spot.d.ts.map +0 -1
  95. package/dist/spot-react/src/hooks/use-src-amount.d.ts +0 -6
  96. package/dist/spot-react/src/hooks/use-src-amount.d.ts.map +0 -1
  97. package/dist/spot-react/src/hooks/use-submit-order-panel.d.ts +0 -28
  98. package/dist/spot-react/src/hooks/use-submit-order-panel.d.ts.map +0 -1
  99. package/dist/spot-react/src/hooks/use-trade-price.d.ts +0 -2
  100. package/dist/spot-react/src/hooks/use-trade-price.d.ts.map +0 -1
  101. package/dist/spot-react/src/hooks/use-trigger-price-panel.d.ts +0 -23
  102. package/dist/spot-react/src/hooks/use-trigger-price-panel.d.ts.map +0 -1
  103. package/dist/spot-react/src/spot-context.d.ts +0 -6
  104. package/dist/spot-react/src/spot-context.d.ts.map +0 -1
  105. package/dist/spot-react/src/store.d.ts +0 -11
  106. package/dist/spot-react/src/store.d.ts.map +0 -1
  107. package/dist/spot-react/src/utils.d.ts +0 -20
  108. package/dist/spot-react/src/utils.d.ts.map +0 -1
  109. package/dist/spot-ui/src/index.d.ts +0 -14
  110. package/dist/spot-ui/src/index.d.ts.map +0 -1
  111. package/dist/spot-ui/src/lib/abi/erc20.json.d.ts +0 -291
  112. package/dist/spot-ui/src/lib/abi/index.d.ts +0 -260
  113. package/dist/spot-ui/src/lib/abi/index.d.ts.map +0 -1
  114. package/dist/spot-ui/src/lib/abi/iweth.json.d.ts +0 -41
  115. package/dist/spot-ui/src/lib/abi/repermit.json.d.ts +0 -315
  116. package/dist/spot-ui/src/lib/analytics.d.ts +0 -111
  117. package/dist/spot-ui/src/lib/analytics.d.ts.map +0 -1
  118. package/dist/spot-ui/src/lib/build-repermit-order-data.d.ts +0 -35
  119. package/dist/spot-ui/src/lib/build-repermit-order-data.d.ts.map +0 -1
  120. package/dist/spot-ui/src/lib/consts.d.ts +0 -99
  121. package/dist/spot-ui/src/lib/consts.d.ts.map +0 -1
  122. package/dist/spot-ui/src/lib/lib.d.ts +0 -80
  123. package/dist/spot-ui/src/lib/lib.d.ts.map +0 -1
  124. package/dist/spot-ui/src/lib/networks.d.ts +0 -571
  125. package/dist/spot-ui/src/lib/networks.d.ts.map +0 -1
  126. package/dist/spot-ui/src/lib/orders/index.d.ts +0 -15
  127. package/dist/spot-ui/src/lib/orders/index.d.ts.map +0 -1
  128. package/dist/spot-ui/src/lib/orders/v1-orders.d.ts +0 -34
  129. package/dist/spot-ui/src/lib/orders/v1-orders.d.ts.map +0 -1
  130. package/dist/spot-ui/src/lib/orders/v2-orders.d.ts +0 -11
  131. package/dist/spot-ui/src/lib/orders/v2-orders.d.ts.map +0 -1
  132. package/dist/spot-ui/src/lib/submit-order.d.ts +0 -3
  133. package/dist/spot-ui/src/lib/submit-order.d.ts.map +0 -1
  134. package/dist/spot-ui/src/lib/types.d.ts +0 -318
  135. package/dist/spot-ui/src/lib/types.d.ts.map +0 -1
  136. package/dist/spot-ui/src/lib/utils.d.ts +0 -578
  137. package/dist/spot-ui/src/lib/utils.d.ts.map +0 -1
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  React SDK for building TWAP, Limit, Stop-Loss, and Take-Profit order interfaces on top of the [Orbs Spot protocol](https://www.orbs.com/).
4
4
 
5
- `spot-react` owns Spot order state and exposes it through `SpotProvider` and `useSpot()`. The host DEX remains responsible for swap-form state, wallet access, components, styling, translations, routing, and modal shells.
5
+ `spot-react` owns Spot order state and exposes it through `SpotProvider` and focused named hooks. The host DEX remains responsible for swap-form state, wallet access, components, styling, translations, routing, and modal shells.
6
6
 
7
7
  For the complete integration workflow, see the [Spot React integration skill](https://github.com/orbs-network/spot-ui/tree/master/skills/spot-react-integration) and the [reference implementation](https://github.com/orbs-network/spot-ui/blob/master/apps/web/components/spot/spot-form.tsx).
8
8
 
@@ -12,9 +12,17 @@ Every DEX needs a member of the exported `Partners` enum and a server-side Orbs
12
12
 
13
13
  ### RePermit configuration security
14
14
 
15
- The `/config` endpoint is a security boundary. The SDK trusts successful JSON responses without client-side schema or contract-identity validation. It uses `domain.verifyingContract` as the ERC-20 approval spender and the v2 cancellation contract, and uses the returned adapter, reactor, and executor when constructing orders. Deployments must use the trusted Orbs endpoint over TLS, and contract-address changes require explicit approval from the protocol/security owner.
15
+ The `/config` endpoint is a security boundary. The SDK rejects configurations whose domain or order chain differs from the requested chain, and rejects zero or malformed RePermit and exchange-adapter addresses. It uses `domain.verifyingContract` as the ERC-20 approval spender and the v2 cancellation contract, and uses the returned adapter, reactor, and executor when constructing orders. The SDK does not independently verify deployed bytecode or contract identity, so deployments must use the trusted Orbs endpoint over TLS and contract-address changes require explicit approval from the protocol/security owner.
16
16
 
17
- `SpotProvider` starts a shared configuration query as soon as the partner and chain are known. Concurrent consumers reuse the same query, successful responses remain cached for that partner/chain/environment, and failed requests are retried twice. `useRePermitData()` exposes the query state and `refetch`; the standard submit panel exposes the same recovery action as `useSpot().submitOrderButton.retry`.
17
+ `SpotProvider` initializes the `spot-ui` client only when the connected chain supports the selected partner. It never substitutes another chain. Client state and order history are scoped to that provider, with no global cache or host query provider required. The framework-neutral `createClient` factory also retains no global state. The client owns configuration-dependent order preparation, signing/approval/cancellation request values, submission, and configured history access; calculations remain package-level functions. Form previews and order construction share the framework-agnostic `calculateOrderForm` model, so defaults, prices, trades, schedules, errors, raw/token-formatted/USD values, and signed execution values cannot diverge. Form calculation is time-independent; `prepareOrder` assigns fresh start, deadline, and nonce values after wrapping and approval, immediately before signing. Initialization is retried twice. After those retries, the provider keeps its children mounted and renders the retryable `clientErrorFallback` alongside them. Supply that component to localize and style the error for the host DEX.
18
+
19
+ The authoritative shared model is available from `useOrderForm()`.
20
+
21
+ Each mounted `SpotProvider` owns one stable store. Changing the module or token
22
+ pair reapplies form defaults without recreating the partner/chain client,
23
+ history cache, or cancellation state. If that scope changes during execution,
24
+ the reset waits until the frozen execution reaches a terminal phase. Changing
25
+ partner or chain reconfigures only the resources whose keys actually changed.
18
26
 
19
27
  The completed integration should:
20
28
 
@@ -36,35 +44,44 @@ npm install @orbs-network/spot-react@latest @orbs-network/swap-ui@latest
36
44
 
37
45
  If migrating from `@orbs-network/twap-ui`, remove it before installing the packages above.
38
46
 
39
- ### Peer Dependencies
47
+ ### Migrating from 1.x
40
48
 
41
- The host application must also provide:
49
+ Version 2 is a deliberately breaking, headless API. Replace the broad `useSpot`
50
+ and `useSwapExecution` interfaces with focused hooks such as `useOrderForm`,
51
+ `useExecution`, `useSubmitButton`, and `useOrders`. Provider values now use
52
+ `input`/`output` terminology (`inputToken`, `outputToken`, `inputBalance`, and
53
+ `minTradeSizeUsd`), and the host supplies wallet operations through
54
+ `walletInteractions`. Debug query parameters and the `isDev` option are no
55
+ longer supported.
42
56
 
43
- ```bash
44
- npm install @tanstack/react-query bignumber.js react-error-boundary zustand react react-dom
45
- ```
57
+ `@orbs-network/swap-ui` is a recommended companion for the documented order
58
+ progress modal, but it is not imported by `spot-react` and is not required for
59
+ a headless or custom-progress integration.
60
+
61
+ ### Peer Dependency
62
+
63
+ The host application must provide React. Zustand is an internal runtime
64
+ dependency of `spot-react`; integrators do not install or configure it.
46
65
 
47
66
  | Package | Version |
48
67
  | --- | --- |
49
- | `@tanstack/react-query` | `^5.90.12` |
50
- | `bignumber.js` | `^9.3.1` |
51
- | `react-error-boundary` | `^6.0.0` |
52
- | `zustand` | `^5.0.9` |
53
68
  | `react` | `^18 \|\| ^19` |
54
- | `react-dom` | `^18 \|\| ^19` |
55
69
 
56
70
  `viem` is not a dependency. Adapt the wallet library already used by the DEX through `walletInteractions`.
57
71
 
72
+ The published entry includes a `"use client"` directive, so it can be imported
73
+ directly from a Next.js App Router client component.
74
+
58
75
  ## Integration Model
59
76
 
60
77
  Keep the DEX swap form as the source of truth. Pass the following adapted values directly to `SpotProvider`:
61
78
 
62
79
  | Value | Expected shape |
63
80
  | --- | --- |
64
- | Selected tokens | `Token` objects with `address`, `symbol`, `decimals`, and `logoUrl` |
81
+ | Selected tokens | `Token` objects with `address`, `symbol`, `decimals`, and optional `logoUrl` |
65
82
  | Typed source amount | User-facing decimal string, for example `"1.25"` |
66
83
  | Quote output | Raw destination-token amount for the current typed input |
67
- | Balances | Raw integer strings |
84
+ | Input balance | Raw integer string |
68
85
  | USD prices | USD value of exactly one whole source/destination token |
69
86
  | Chain and account | Values from the connected wallet/account state |
70
87
 
@@ -77,6 +94,7 @@ Memoize objects with `useMemo` and functions with `useCallback`. In particular,
77
94
  ```tsx
78
95
  import { useMemo } from "react";
79
96
  import {
97
+ type ClientErrorFallbackProps,
80
98
  Module,
81
99
  Partners,
82
100
  SpotProvider,
@@ -86,6 +104,21 @@ import {
86
104
  type WalletInteractions,
87
105
  } from "@orbs-network/spot-react";
88
106
 
107
+ function ClientErrorFallback({
108
+ error,
109
+ retry,
110
+ isRetrying,
111
+ }: ClientErrorFallbackProps) {
112
+ return (
113
+ <div role="alert">
114
+ <p>{getLocalizedErrorMessage(error)}</p>
115
+ <button type="button" disabled={isRetrying} onClick={retry}>
116
+ {isRetrying ? t("retrying") : t("retry")}
117
+ </button>
118
+ </div>
119
+ );
120
+ }
121
+
89
122
  function SpotOrderForm({ module }: { module: Module }) {
90
123
  // Read these from the DEX's existing swap and wallet state.
91
124
  const {
@@ -94,7 +127,6 @@ function SpotOrderForm({ module }: { module: Module }) {
94
127
  inputCurrency,
95
128
  outputCurrency,
96
129
  inputBalance,
97
- outputBalance,
98
130
  typedInputAmount,
99
131
  quotedInputAmount,
100
132
  quoteOutputRaw,
@@ -105,7 +137,7 @@ function SpotOrderForm({ module }: { module: Module }) {
105
137
  dexWallet,
106
138
  } = useDexSpotAdapter();
107
139
 
108
- const srcToken = useMemo<Token | undefined>(() => {
140
+ const inputToken = useMemo<Token | undefined>(() => {
109
141
  if (!inputCurrency) return undefined;
110
142
  return {
111
143
  address: inputCurrency.address,
@@ -115,7 +147,7 @@ function SpotOrderForm({ module }: { module: Module }) {
115
147
  };
116
148
  }, [inputCurrency]);
117
149
 
118
- const dstToken = useMemo<Token | undefined>(() => {
150
+ const outputToken = useMemo<Token | undefined>(() => {
119
151
  if (!outputCurrency) return undefined;
120
152
  return {
121
153
  address: outputCurrency.address,
@@ -169,20 +201,20 @@ function SpotOrderForm({ module }: { module: Module }) {
169
201
  module={module}
170
202
  typedInputAmount={typedInputAmount}
171
203
  priceProtection={3}
172
- minChunkSizeUsd={5}
204
+ minTradeSizeUsd={5}
173
205
  marketReferencePrice={marketReferencePrice}
174
206
  walletInteractions={walletInteractions}
175
207
  chainId={chainId}
176
208
  account={account}
177
- srcToken={srcToken}
178
- dstToken={dstToken}
179
- srcBalance={inputBalance?.toString()}
180
- dstBalance={outputBalance?.toString()}
181
- srcUsd1Token={inputUsdPrice}
182
- dstUsd1Token={outputUsdPrice}
209
+ inputToken={inputToken}
210
+ outputToken={outputToken}
211
+ inputBalance={inputBalance?.toString()}
212
+ inputUsd1Token={inputUsdPrice}
213
+ outputUsd1Token={outputUsdPrice}
183
214
  callbacks={callbacks}
215
+ clientErrorFallback={ClientErrorFallback}
184
216
  appId="my-dex"
185
- fees={0.25}
217
+ displayFeePercent={0.25}
186
218
  >
187
219
  <SpotFormContent />
188
220
  </SpotProvider>
@@ -192,7 +224,7 @@ function SpotOrderForm({ module }: { module: Module }) {
192
224
 
193
225
  `marketReferencePrice.value` is the DEX quote's raw destination amount for the current `typedInputAmount`, not a standalone per-token price. If the quote belongs to an older input or token pair, omit `value` and report `isLoading: true` until a current quote arrives.
194
226
 
195
- Use the connected wallet chain as the UI source of truth. The provider falls back internally to a supported partner chain for configuration lookups when `chainId` is absent or unsupported, so the DEX submit area must still show connect-wallet or switch-network controls and block submission.
227
+ Use the connected wallet chain as the source of truth. When it is absent or unsupported, the provider does not initialize a client and submission stays disabled. The DEX submit area should show its connect-wallet or switch-network control.
196
228
 
197
229
  ### SpotProvider Props
198
230
 
@@ -202,25 +234,30 @@ Use the connected wallet chain as the UI source of truth. The provider falls bac
202
234
  | `module` | `Module` | Yes | `TWAP`, `LIMIT`, `STOP_LOSS`, or `TAKE_PROFIT` |
203
235
  | `typedInputAmount` | `string` | Yes | User-facing source amount from DEX state |
204
236
  | `priceProtection` | `number` | Yes | Price Protection percentage; this is not swap slippage |
205
- | `minChunkSizeUsd` | `number` | Yes | Minimum trade chunk size in USD |
237
+ | `minTradeSizeUsd` | `number` | Yes | Minimum individual trade size in USD |
206
238
  | `marketReferencePrice` | `MarketReferencePrice` | Yes | `{ value?, isLoading?, noLiquidity? }` for the current DEX quote |
207
239
  | `walletInteractions` | `WalletInteractions` | Yes | Five wallet methods implemented by the DEX |
208
240
  | `chainId` | `number` | No | Connected wallet chain ID |
209
- | `account` | `string` | No | Connected wallet address |
210
- | `appId` | `string` | No | Analytics app ID |
211
- | `srcToken` | `Token` | No | Source token metadata |
212
- | `dstToken` | `Token` | No | Destination token metadata |
213
- | `srcBalance` | `string` | No | Raw source-token balance |
214
- | `dstBalance` | `string` | No | Raw destination-token balance |
215
- | `srcUsd1Token` | `string` | No | USD value of one whole source token |
216
- | `dstUsd1Token` | `string` | No | USD value of one whole destination token |
217
- | `enableQueryParams` | `boolean` | No | Sync supported form state to URL query parameters |
241
+ | `account` | `Address` | No | Connected wallet address |
242
+ | `appId` | `string` | No | Stable host-defined analytics identifier (for example the DEX slug) |
243
+ | `inputToken` | `Token` | No | Input token metadata |
244
+ | `outputToken` | `Token` | No | Output token metadata |
245
+ | `inputBalance` | `string` | No | Raw input-token balance |
246
+ | `inputUsd1Token` | `string` | No | USD value of one whole input token |
247
+ | `outputUsd1Token` | `string` | No | USD value of one whole output token |
218
248
  | `callbacks` | `Callbacks` | No | Lifecycle and field-change callbacks |
219
- | `fees` | `number` | No | Fee percentage, for example `0.25` |
220
- | `isDev` | `boolean` | No | Use development services/configuration |
249
+ | `displayFeePercent` | `number` | No | Display-only fee estimate percentage; does not collect or subtract fees |
221
250
  | `supportLegacyOrders` | `boolean` | No | Include supported legacy v1 orders in history |
251
+ | `clientErrorFallback` | `ComponentType<ClientErrorFallbackProps>` | No | Host-rendered client initialization error UI with `error`, `retry`, and `isRetrying` |
252
+ | `errorFallback` | `ComponentType<SpotErrorFallbackProps>` | No | Host-rendered fallback for unexpected calculation or rendering errors |
253
+
254
+ Although the input balance and USD prices are optional in the TypeScript type, production integrations should pass them so validation, loading states, minimum trade size, and review details are correct.
222
255
 
223
- Although balances and USD prices are optional in the TypeScript type, production integrations should pass them so validation, loading states, minimum trade size, and review details are correct.
256
+ `minTradeSizeUsd` must be a positive USD threshold approved for the partner;
257
+ there is intentionally no SDK default. `priceProtection` is a percentage, so
258
+ `3` means 3% (300 bps). `displayFeePercent` only populates `form.fees` for the
259
+ review UI. Protocol fee collection is configured separately by the partner and
260
+ backend.
224
261
 
225
262
  ## WalletInteractions
226
263
 
@@ -255,8 +292,8 @@ const walletInteractions: WalletInteractions = {
255
292
  return txHash;
256
293
  },
257
294
 
258
- signOrder: ({ domain, types, primaryType, message, account }) =>
259
- dexWallet.signTypedData({ domain, types, primaryType, message, account }),
295
+ signOrder: ({ signerAddress, typedData }) =>
296
+ dexWallet.signTypedData({ ...typedData, account: signerAddress }),
260
297
 
261
298
  getAllowance: ({ tokenAddress, spenderAddress }) =>
262
299
  dexWallet.getAllowance({ tokenAddress, spenderAddress }),
@@ -268,39 +305,66 @@ const walletInteractions: WalletInteractions = {
268
305
  | `wrapNativeToken(amountWei)` | Wrap native currency, wait for confirmation, return tx hash |
269
306
  | `approveToken({ tokenAddress, amount, spenderAddress })` | Approve the requested spender, wait for confirmation, return tx hash |
270
307
  | `cancelOrder({ order, contractAddress, args, abi })` | Call `cancel` with the supplied ABI and args, wait for confirmation, return tx hash |
271
- | `signOrder({ domain, types, primaryType, message, account })` | Sign the supplied EIP-712 data and return signature hex |
308
+ | `signOrder({ signerAddress, typedData })` | Adapt the framework-neutral EIP-712 request to the host wallet and return its original `0x`-prefixed signature |
272
309
  | `getAllowance({ tokenAddress, spenderAddress })` | Return the connected account's raw allowance as a string |
273
310
 
274
- ## Building the Form with useSpot()
311
+ The signature returned by `signOrder` is submitted unchanged. Do not split it into `{ v, r, s }`, rewrite its recovery byte, or otherwise normalize the wallet's byte representation.
312
+
313
+ ## Building with focused hooks
275
314
 
276
- Every component rendered under `SpotProvider` can call `useSpot()`:
315
+ Import only the hooks each component needs. Leaf components should call the
316
+ smallest hook that provides what they render:
277
317
 
278
318
  ```tsx
279
- const spot = useSpot();
319
+ import {
320
+ useExecution,
321
+ useLimitPrice,
322
+ useOrderForm,
323
+ useOrders,
324
+ useOutputAmount,
325
+ usePriceDisplay,
326
+ useTrades,
327
+ } from "@orbs-network/spot-react";
328
+
329
+ const calculatedForm = useOrderForm();
330
+ const tradesPanel = useTrades();
331
+ const limitPricePanel = useLimitPrice();
332
+ const outputAmount = useOutputAmount();
333
+
334
+ const execution = useExecution();
335
+ const history = useOrders();
280
336
  ```
281
337
 
338
+ `useOrderForm()` reads the calculated form shared by `OrderFormProvider`; it does not rerun the calculation. The other hooks expose smaller panel contracts for clearer component code. They currently share the same calculated-form context, so a form update can rerender every mounted form-panel hook.
339
+
282
340
  | Value | Key returns |
283
341
  | --- | --- |
284
- | `dstTokenPanel` | `value`, `valueWei`, `isLoading`, `usd` |
285
- | `tradesAmountPanel` | `totalTrades`, `maxTrades`, `onChange`, `error`, per-trade amounts, source/destination tokens |
286
- | `durationPanel` | `duration`, input/unit callbacks, `milliseconds`, `error` |
287
- | `fillDelayPanel` | `fillDelay`, input/unit callbacks, `milliseconds`, `error` |
288
- | `limitPricePanel` | Raw/UI price, percentage, toggle, input/reset callbacks, tokens, USD, loading/error state |
289
- | `triggerPricePanel` | Raw/UI trigger price, percentage, input/reset callbacks, tokens, per-chunk amounts, USD, error state |
290
- | `pricePanel` | Inversion state/callback, source/destination tokens, market-price state |
291
- | `disclaimerPanel` | Disclaimer translation key or `undefined` |
292
- | `inputError` | `{ type, args }` or `undefined` |
293
- | `submitOrderButton` | `disabled`, `loading`, configuration `error`, and `retry` |
294
- | `orderExecutionPanel` | Submission, status, steps, errors, resets, resolved tokens, and tx hashes |
295
- | `orderHistoryPanel` | Filtered order lists, loading state, and `refetchOrders` |
296
- | `derivedFormData` | Review amounts, prices, timing, fees, order type, spender, and RePermit data |
297
- | `supportedChains` | Supported chain IDs for the selected partner |
298
- | `module` | Current `Module` |
299
- | `refetchUntilStatusSynced` | Mutation used to reconcile cancellation status |
300
-
301
- Child components should call `useSpot()` themselves instead of receiving hook-returned panels through intermediate props.
302
-
303
- When `submitOrderButton.error` is set, render a translated retry label and call `submitOrderButton.retry()` instead of opening the review modal. Keep the button disabled while `loading` is true. Legacy v1 order history does not depend on RePermit configuration; v2 history, approvals, v2 cancellation, and submission resume after a successful retry.
342
+ | `useOutputAmount()` | `amount: { raw, ui, usd }`, `isLoading` |
343
+ | `useTrades()` | `totalTrades`, `maxTrades`, `onChange`, `error`, structured input/min-output/trigger-output amounts, input/output tokens |
344
+ | `useDuration()` | `duration`, input/unit callbacks, `milliseconds`, `error` |
345
+ | `useFillDelay()` | `fillDelay`, input/unit callbacks, `milliseconds`, `error` |
346
+ | `useLimitPrice()` | `price: { raw, ui, usd }`, canonical raw price, percentage, enable/toggle actions, tokens, loading/error state |
347
+ | `useTriggerPrice()` | `price: { raw, ui, usd }`, canonical raw price, percentage, structured output-per-trade amount, tokens, loading/error state |
348
+ | `usePriceDisplay()` | Inversion state/callback, actual and display-direction tokens, market-order state |
349
+ | `useDisclaimer()` | Disclaimer translation key or `undefined` |
350
+ | `useInputErrors()` | `{ type, args }` or `undefined` |
351
+ | `useSubmitButton()` | `disabled` and `loading` |
352
+ | `useExecution()` | Submission, status, steps, errors, resets, resolved tokens, and tx hashes |
353
+ | `useOrders()` | Provider-scoped categorized order lists and polling state |
354
+ | `useHistoryOrder()` | Display-ready values for one history order |
355
+ | `useCancelOrder()` | Per-order cancellation state and action |
356
+ | `useClient()` | Provider-scoped initialized client state |
357
+ | `useAmountUi()` | Raw-token amount formatting |
358
+ | `useExplorerLink()` | Chain explorer transaction URL |
359
+ | `useNetwork()` | Current or specified network metadata |
360
+
361
+ Child components should call the relevant focused hook themselves instead of receiving hook-returned panels through intermediate props. `useOrders()` activates order-history fetching while an orders consumer is mounted; form-only integrations do not fetch or poll history.
362
+
363
+ Keep the submit button disabled while `loading` is true. If client initialization fails, `SpotProvider` keeps child components mounted and renders the retryable `clientErrorFallback` alongside them.
364
+
365
+ ### Trade-count validation behavior
366
+
367
+ An explicitly selected TWAP trade count persists when `typedInputAmount` changes. If lowering the amount makes that count greater than the newly calculated `maxTrades`, Spot does not clamp or reset it: `useTrades().error` and `useInputErrors()` report `InputErrors.MAX_TRADES`, and submission remains disabled until the user selects a valid count. This is an intentional behavior change from integrations that silently reset the trade count on every amount edit. Hosts should render the returned validation error so the user can correct the value.
304
368
 
305
369
  ### Panel Visibility
306
370
 
@@ -316,87 +380,106 @@ Use `TimeUnit.Minutes`, `TimeUnit.Hours`, and `TimeUnit.Days` for duration and f
316
380
 
317
381
  ### Display Amounts
318
382
 
319
- Raw fields such as `dstTokenPanel.valueWei`, `tradesAmountPanel.amountPerTrade`, `derivedFormData.feesAmount`, and history fill amounts are integer strings. Convert them into the DEX's native amount type before display when possible:
383
+ Every calculated amount uses the same `{ raw, ui, usd }` shape. Convert `raw`
384
+ into the DEX's native amount type before display when possible:
320
385
 
321
386
  ```tsx
322
387
  const amount = CurrencyAmount.fromRawAmount(
323
388
  inputCurrency,
324
- spot.tradesAmountPanel.amountPerTrade,
389
+ tradesPanel.inputAmountPerTrade.raw,
325
390
  );
326
391
 
327
392
  return `${amount.toSignificant()} ${inputCurrency.symbol}`;
328
393
  ```
329
394
 
330
- Use `*UI` fields for editable text inputs or when the DEX has no amount object. Do not format raw integer strings directly for user display.
395
+ Use `.ui` for editable text inputs or when the DEX has no amount object. Do not
396
+ format `.raw` integer strings directly for user display.
331
397
 
332
398
  ## Submit and Progress Modal
333
399
 
334
- Use `useSpot().orderExecutionPanel` for execution state, `derivedFormData` for review details, and `@orbs-network/swap-ui`'s `SwapFlow` for the creation/progress UI.
400
+ Use `useExecution()` for execution state, `useOrderForm()` for review details, and `@orbs-network/swap-ui`'s `SwapFlow` for the creation/progress UI.
335
401
 
336
402
  ```tsx
337
- import { SwapFlow } from "@orbs-network/swap-ui";
338
- import { useSpot } from "@orbs-network/spot-react";
403
+ import { SwapFlow, SwapStatus as SwapUiStatus } from "@orbs-network/swap-ui";
404
+ import {
405
+ ExecutionStatus,
406
+ useExecution,
407
+ useOrderForm,
408
+ } from "@orbs-network/spot-react";
339
409
 
340
410
  function SpotOrderFlow() {
341
411
  const {
342
412
  status,
343
- parsedError,
344
- srcToken,
345
- dstToken,
346
- stepIndex,
413
+ error,
414
+ inputToken,
415
+ outputToken,
416
+ currentStepIndex,
347
417
  totalSteps,
348
- } = useSpot().orderExecutionPanel;
349
- const form = useSpot().derivedFormData;
418
+ } = useExecution();
419
+ const form = useOrderForm();
420
+ const swapStatus =
421
+ status === ExecutionStatus.SUCCESS
422
+ ? SwapUiStatus.SUCCESS
423
+ : status === ExecutionStatus.FAILED
424
+ ? SwapUiStatus.FAILED
425
+ : status === ExecutionStatus.LOADING
426
+ ? SwapUiStatus.LOADING
427
+ : undefined;
350
428
 
351
429
  return (
352
430
  <SwapFlow
353
- inAmount={form.srcAmountUI}
354
- outAmount={form.dstAmountUI}
355
- inToken={{ symbol: srcToken?.symbol, logoUrl: srcToken?.logoUrl }}
356
- outToken={{ symbol: dstToken?.symbol, logoUrl: dstToken?.logoUrl }}
357
- swapStatus={status}
358
- currentStepIndex={stepIndex}
431
+ inAmount={form.inputAmount.ui}
432
+ outAmount={form.outputAmount.ui}
433
+ inToken={{ symbol: inputToken?.symbol, logoUrl: inputToken?.logoUrl }}
434
+ outToken={{ symbol: outputToken?.symbol, logoUrl: outputToken?.logoUrl }}
435
+ swapStatus={swapStatus}
436
+ currentStepIndex={currentStepIndex}
359
437
  totalSteps={totalSteps}
360
438
  components={{
361
- Main: <SwapFlow.Main inUsd={form.srcAmountUsd} outUsd={form.dstAmountUsd} />,
439
+ Main: <SwapFlow.Main inUsd={form.inputAmount.usd} outUsd={form.outputAmount.usd} />,
362
440
  Success: <SwapFlow.Success title="Order created" />,
363
- Failed: <SwapFlow.Failed error={parsedError?.message} />,
441
+ Failed: <SwapFlow.Failed error={error?.message} />,
364
442
  }}
365
443
  />
366
444
  );
367
445
  }
368
446
  ```
369
447
 
370
- Wrap `SwapFlow` in the DEX's modal shell and skin it with DEX colors, surfaces, typography, token logos, and loaders. Once `orderExecutionPanel.status` is set, hide the review details, confirm button, duplicate title, and secondary footer actions so the progress/success/failure content owns the modal.
448
+ Wrap `SwapFlow` in the DEX's modal shell and skin it with DEX colors, surfaces, typography, token logos, and loaders. Once `useExecution().status` is set, hide the review details, confirm button, duplicate title, and secondary footer actions so the progress/success/failure content owns the modal.
371
449
 
372
450
  ### Execution State and Reset
373
451
 
374
- `orderExecutionPanel` includes:
452
+ `useExecution()` returns:
375
453
 
376
- - `onSubmit`, `status`, `isLoading`, `isSuccess`, `isFailed`, and `confirmButtonLoading`;
377
- - `step`, `stepIndex`, `totalSteps`, and `pendingSteps`;
378
- - `parsedError`, `error`, `srcToken`, `dstToken`, `wrapTxHash`, and `approveTxHash`;
379
- - `resetCurrentSwap()` and `resetState()`.
454
+ - `submitOrder`, `phase`, `status`, `isExecuting`, `isSuccess`, `isFailed`, `isRejected`, `isPreparingOrder`, and `canDismiss`;
455
+ - `currentStep`, `currentStepIndex`, `totalSteps`, and `executionSteps`;
456
+ - `error`, `inputToken`, `outputToken`, `chainId`, `wrapTxHash`, and `approvalTxHash`;
457
+ - `returnToOrderForm()` and `startNewOrder()`.
380
458
 
381
459
  `spot-react` does not clear the DEX input. Do that only when a successful modal closes:
382
460
 
383
461
  ```tsx
384
- const { status, isSuccess, resetCurrentSwap, resetState } =
385
- useSpot().orderExecutionPanel;
462
+ const { status, isSuccess, isExecuting, returnToOrderForm, startNewOrder } =
463
+ useExecution();
386
464
 
387
465
  const onClose = useCallback(() => {
466
+ if (isExecuting) return;
388
467
  setIsModalOpen(false);
389
468
 
390
469
  if (isSuccess) {
391
470
  setInputAmount("");
392
- setTimeout(resetState, 500);
471
+ setTimeout(startNewOrder, 500);
393
472
  } else if (status) {
394
- setTimeout(resetCurrentSwap, 500);
473
+ setTimeout(returnToOrderForm, 500);
395
474
  }
396
- }, [isSuccess, resetCurrentSwap, resetState, setInputAmount, status]);
475
+ }, [isExecuting, isSuccess, returnToOrderForm, setInputAmount, startNewOrder, status]);
397
476
  ```
398
477
 
399
- Failed or rejected submissions should keep the user's input. The short delay lets the close animation finish before state resets.
478
+ Neither reset action can clear an active execution: both return `false` while `isExecuting` is true. Keep the modal open during execution. `returnToOrderForm()` dismisses a failed or rejected execution while preserving the form and a completed native-token wrap for a safe retry. `startNewOrder()` resets Spot's internal form state and all retry metadata after a terminal execution; the host must still clear its own input amount. The short delay lets the close animation finish before state resets.
479
+
480
+ `phase` is the precise execution state: `idle → preparing → wrapping → approving → signing → submitting → success`, with `failed` and `rejected` terminal branches. `status` is the coarser `ExecutionStatus` value. Map it explicitly to the separately versioned `@orbs-network/swap-ui` `SwapStatus` enum as shown above. Each attempt has an internal identity, duplicate starts are rejected atomically, and stale async writes cannot replace a newer attempt. Host callbacks are observational: synchronous throws and rejected callback promises never change a wallet or API result.
481
+
482
+ Once submission begins, `useOrderForm()` exposes the frozen form and `useExecution()` exposes the frozen tokens and chain associated with that execution. The prepared order is frozen internally and reused through approval, wrapping, signing, and submission. Host quote, token, chain, or time updates cannot change the active order.
400
483
 
401
484
  ## Callbacks
402
485
 
@@ -426,7 +509,7 @@ const callbacks: Callbacks = {
426
509
  onTriggerPricePercentChange: (percent) => {},
427
510
  onDurationChange: (duration) => {},
428
511
  onFillDelayChange: (fillDelay) => {},
429
- onChunksChange: (chunks) => {},
512
+ onTradesChange: (trades) => {},
430
513
  };
431
514
  ```
432
515
 
@@ -453,18 +536,31 @@ function CancelButton({ order }) {
453
536
  }
454
537
  ```
455
538
 
456
- For v2 orders, `disabled` remains true while RePermit configuration is loading or unavailable. Legacy v1 history and cancellation do not require that configuration. V2 history is added after configuration succeeds because its request needs the returned exchange adapter.
539
+ Cancellation uses the initialized client for both v1 and v2 orders, keeping request construction on one path; `disabled` remains true while that client is loading or unavailable. History starts after client initialization because v2 requests need the configured exchange adapter. When `supportLegacyOrders` is enabled, v1 history is loaded once and retained while v2 history continues polling.
457
540
 
458
- Order history is available from `useSpot().orderHistoryPanel`:
541
+ Order history is available directly from `useOrders()`. The query is enabled only while a component using this hook is mounted:
459
542
 
460
543
  ```tsx
461
- const { orders, isLoading, isRefetching, refetchOrders } =
462
- useSpot().orderHistoryPanel;
544
+ const { data: orders, isLoading, isRefetching, refetch } = useOrders();
463
545
 
464
- // orders.all, orders.open, orders.completed, orders.cancelled, orders.expired
546
+ // orders?.all, orders?.open, orders?.completed, orders?.cancelled, orders?.expired
465
547
  ```
466
548
 
467
- Use `useDerivedHistoryOrder(order, srcToken?, dstToken?)` for display fields. For large histories, use the virtualization library already present in the DEX for both the orders and fills lists. Store the selected order ID, then look up the current order from `orders.all`; do not store a stale copy of the order object.
549
+ Like `useClient()`, `data` is undefined before the first result. `refetch()`
550
+ resolves to the latest categorized orders or `undefined` when no request can be
551
+ made. Default the category you render to an empty array, for example
552
+ `const allOrders = orders?.all ?? []`.
553
+
554
+ Use `useHistoryOrder(order, inputToken?, outputToken?)` for display fields. For large histories, use the virtualization library already present in the DEX for both the orders and fills lists. Store the selected `order.historyKey`, then look up the current order from `orders?.all ?? []` by that key; do not store a stale copy of the order object. The key avoids collisions between numeric v1 IDs from different TWAP contracts; `order.id` remains the protocol ID used for display and cancellation.
555
+
556
+ Amounts returned by `useHistoryOrder` and its `fills` use `{ raw, ui }`, matching
557
+ the form model without fabricating unavailable historical USD values.
558
+
559
+ `OrderFilter` contains `ALL`, `OPEN`, `COMPLETED`, `CANCELLED`, and `EXPIRED`.
560
+ `OrderType` identifies the calculated module/mode combination: limit, TWAP
561
+ market/limit, stop-loss market/limit, or take-profit market/limit. Normalized
562
+ `Order` and `OrderFill` retain `src`/`dst` and `in`/`out` names because those are
563
+ protocol/history response models; form-facing APIs use `input`/`output`.
468
564
 
469
565
  Keep history, details, and modal portals under `SpotProvider` context. Details should include execution summary, order info, fills, explorer/copy actions, and cancellation for open orders.
470
566
 
@@ -478,35 +574,46 @@ Disclaimer keys are:
478
574
  - `marketOrderDisclaimer`
479
575
  - `triggerMarketPriceDisclaimer`
480
576
 
481
- Input errors have the shape `{ type, args }`. Resolve `type` through the DEX's i18n system and interpolate `args`, including values such as `maxChunks`, `minChunks`, `minTradeSize`, `duration`, and `fillDelay`. Current duration and fill-delay arguments are human-readable; custom or older integrations should convert raw milliseconds before display.
577
+ Input errors have the shape `{ type, args }`. Resolve `type` through the DEX's i18n system and interpolate `args`, including values such as `maxTrades`, `minTrades`, `minTradeSize`, `duration`, and `fillDelay`. Current duration and fill-delay arguments are human-readable; custom or older integrations should convert raw milliseconds before display.
482
578
 
483
- ## Helper and Advanced APIs
579
+ ## React helper APIs
484
580
 
485
581
  ```tsx
486
582
  import {
487
- useAmountUi, // (decimals?, rawAmount?) => formatted amount
488
- useExplorerLink, // (txHash?) => explorer URL
489
- useNetwork, // () => current network metadata
490
- useRePermitData, // () => { data, error, isLoading, refetch }
491
- useSignOrder, // low-level signing hook
492
- useSubmitOrder, // low-level submission mutation
493
- useSwapExecution, // low-level execution state
583
+ useAmountUi,
584
+ useClient,
585
+ useExplorerLink,
586
+ useNetwork,
494
587
  } from "@orbs-network/spot-react";
588
+
589
+ useAmountUi(decimals, rawAmount);
590
+ useClient();
591
+ useExplorerLink(txHash, chainId);
592
+ useNetwork(chainId);
495
593
  ```
496
594
 
497
- Normal integrations should submit through `useSpot().orderExecutionPanel`. Use the low-level hooks only when deliberately replacing the built-in execution flow. `useRePermitData()` must be called under `SpotProvider`; most integrations should use the configuration state already exposed by `useSpot().submitOrderButton`.
595
+ Submit through `useExecution()`. Internal mutations and execution-store hooks
596
+ are deliberately not exported, keeping one supported workflow and one error
597
+ contract. `useClient()` must be called under `SpotProvider`; every caller shares
598
+ the same partner/chain query, and RePermit configuration is available as
599
+ `client?.rePermitData`. Initialization recovery belongs to
600
+ `clientErrorFallback`, which receives the query error and retry action.
498
601
 
499
602
  Public utilities and constants include:
500
603
 
501
604
  ```tsx
502
605
  import {
503
- getMinChunkSizeUsd,
504
606
  getNetwork,
505
607
  getOrderExecutionRate,
506
608
  getOrderFillDelayMillis,
507
609
  getOrderLimitPriceRate,
508
610
  getPartnerChains,
509
611
  getPartners,
612
+ getTwapConfig,
613
+ calculateOrderForm,
614
+ toAmountWei,
615
+ toAmountUI,
616
+ invertPriceInput,
510
617
  getTriggerPriceRate,
511
618
  eqIgnoreCase,
512
619
  isNativeAddress,
@@ -520,7 +627,11 @@ import {
520
627
  } from "@orbs-network/spot-react";
521
628
  ```
522
629
 
523
- Always import from `@orbs-network/spot-react`. Do not import from `dist/*` or package-internal source paths, and verify public exports when upgrading.
630
+ React integrations can import the single `calculateOrderForm` entry point and
631
+ its public calculated types directly from `@orbs-network/spot-react`. Non-React
632
+ integrations should import them from `@orbs-network/spot-ui`. Lower-level
633
+ calculators remain internal entry points; do not import from `dist/*` or
634
+ package-internal source paths.
524
635
 
525
636
  ## Integration Checklist
526
637
 
@@ -0,0 +1,7 @@
1
+ import { ComponentType, ReactNode } from 'react';
2
+ import { ClientErrorFallbackProps } from '../types';
3
+ export declare const ClientErrorNotice: ({ children, fallback: ClientErrorFallback, }: {
4
+ children: ReactNode;
5
+ fallback?: ComponentType<ClientErrorFallbackProps>;
6
+ }) => import("react/jsx-runtime").JSX.Element;
7
+ //# sourceMappingURL=client-error-notice.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client-error-notice.d.ts","sourceRoot":"","sources":["../../../../src/context/client-error-notice.tsx"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,aAAa,EAClB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAsBzD,eAAO,MAAM,iBAAiB,GAAI,8CAG/B;IACD,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,aAAa,CAAC,wBAAwB,CAAC,CAAC;CACpD,4CA8BA,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { ComponentType, ReactNode } from 'react';
2
+ import { SpotErrorFallbackProps } from '../types';
3
+ export declare const SpotErrorBoundary: ({ children, fallback: ErrorFallback, }: {
4
+ children: ReactNode;
5
+ fallback?: ComponentType<SpotErrorFallbackProps>;
6
+ }) => import("react/jsx-runtime").JSX.Element;
7
+ //# sourceMappingURL=error-boundary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error-boundary.d.ts","sourceRoot":"","sources":["../../../../src/context/error-boundary.tsx"],"names":[],"mappings":"AACA,OAAO,EAAa,KAAK,aAAa,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACtE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAavD,eAAO,MAAM,iBAAiB,GAAI,wCAG/B;IACD,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,aAAa,CAAC,sBAAsB,CAAC,CAAC;CAClD,4CAIA,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { CalculatedOrderForm } from '@orbs-network/spot-ui';
2
+ import { ReactNode } from 'react';
3
+ export declare const OrderFormProvider: ({ children }: {
4
+ children: ReactNode;
5
+ }) => import("react/jsx-runtime").JSX.Element;
6
+ export declare const useOrderForm: () => CalculatedOrderForm;
7
+ //# sourceMappingURL=order-form-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"order-form-context.d.ts","sourceRoot":"","sources":["../../../../src/context/order-form-context.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,mBAAmB,EACzB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAsC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAM3E,eAAO,MAAM,iBAAiB,GAAI,cAAc;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,4CA+GtE,CAAC;AAEF,eAAO,MAAM,YAAY,QAAO,mBAM/B,CAAC"}