@spicenet-io/spiceflow-ui 4.23.2-stocks.0 → 4.23.2
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 +21 -33
- package/dist/auth-privy.cjs +1 -1
- package/dist/auth-privy.js +1 -1
- package/dist/components/SpiceSupply/lib/buildBatches.d.ts +0 -1
- package/dist/hooks/useSpiceSupply.d.ts +0 -1
- package/dist/index.cjs +7 -7
- package/dist/index.d.ts +2 -0
- package/dist/index.js +7 -7
- package/dist/privy-CDtAaiTV.js +2 -0
- package/dist/privy-D01MvNL9.cjs +1 -0
- package/dist/types/deposit.d.ts +0 -2
- package/dist/utils/crossChainRouter/metric.d.ts +93 -0
- package/dist/utils/crossChainRouter/venueConfig.d.ts +5 -0
- package/package.json +1 -1
- package/dist/components/SpiceDeposit/lib/normalizedCredit.d.ts +0 -2
- package/dist/components/SpiceDeposit/steps/NormalizedDepositModal.d.ts +0 -6
- package/dist/privy-CBOML0zJ.js +0 -2
- package/dist/privy-CBW14wMQ.cjs +0 -1
package/README.md
CHANGED
|
@@ -125,8 +125,8 @@ providers: underlying quote/execution transports still have global state.
|
|
|
125
125
|
|
|
126
126
|
When a flow has to swap on the destination chain, the SDK quotes every liquidity
|
|
127
127
|
venue that covers that chain and takes the best fill: the most output on a
|
|
128
|
-
supply, the least input on a pay. Routing is decided
|
|
129
|
-
solver only executes the calls the winning quote produced.
|
|
128
|
+
supply, the least input on a pay. Routing is decided in the SDK using venue RPC
|
|
129
|
+
or API quotes. The solver only executes the calls the winning quote produced.
|
|
130
130
|
|
|
131
131
|
Leave `liquidityVenues` off and you get the built-in venues. Declare it once on
|
|
132
132
|
the provider to add your own, and every component picks them up.
|
|
@@ -166,6 +166,24 @@ spacings) and hub currencies.
|
|
|
166
166
|
| `uniswap-v3` | `chainId`, `swapRouter`, `quoterV2` | `name`, `feeTiers`, `hubCurrencies`, `routerHasDeadline` |
|
|
167
167
|
| `uniswap-v4` | `chainId`, `quoter`, `universalRouter`, `permit2` | `name`, `hubCurrencies` |
|
|
168
168
|
| `aerodrome-slipstream` | `chainId`, `swapRouter`, `quoterV2` | `name`, `tickSpacings`, `hubCurrencies` |
|
|
169
|
+
| `metric` | `chainId` | `name`, `apiUrl`, `swapRouter` |
|
|
170
|
+
|
|
171
|
+
Metric uses the tx API's `/liquidity/metric` proxy when running inside
|
|
172
|
+
`SpiceFlowProvider`, derived from its existing `apiUrl`. The backend injects
|
|
173
|
+
`METRIC_API_KEY`; no credential is included in the browser or SDK config.
|
|
174
|
+
Deploy the backend proxy and configure its secret before adopting this SDK.
|
|
175
|
+
|
|
176
|
+
Partner defaults cover Ethereum, BSC, Polygon, Monad, HyperEVM, MegaETH,
|
|
177
|
+
Robinhood, Base, Arbitrum, and Avalanche. This adds venue coverage only: the
|
|
178
|
+
app's supported chains, token policy and `includeDefaults: false` remain intact.
|
|
179
|
+
Standalone factories without a proxy retain the three public-chain defaults.
|
|
180
|
+
Set `liquidityVenues.metricApiUrl` to override the proxy base URL, or set a
|
|
181
|
+
Metric venue's `apiUrl` for that individual venue. Both exact-input and
|
|
182
|
+
exact-output use the same proxy and selected-pool metadata. Split routes are
|
|
183
|
+
not requested; the SDK encodes v1 router calls with recipient/slippage bounds.
|
|
184
|
+
A quote is not execution proof: pool extensions and oracle freshness can reject
|
|
185
|
+
a swap, and Ethereum conditional-update pools require compatible submission
|
|
186
|
+
ordering. Verify the actual caller and submission path before release.
|
|
169
187
|
|
|
170
188
|
`name` is the label shown to the user as "via <name>" once a swap is quoted, so
|
|
171
189
|
give it the name people know the venue by. It defaults to the protocol, which
|
|
@@ -367,39 +385,13 @@ a failed application callback after the external action has confirmed.
|
|
|
367
385
|
- `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.
|
|
368
386
|
- `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.
|
|
369
387
|
|
|
370
|
-
### USDC cash deposits
|
|
371
|
-
|
|
372
|
-
In 7702 mode, `<SpiceDeposit normalizeToUsdc />` converts non-USDC wallet
|
|
373
|
-
assets into the source chain's supported USDC and deposits the result into
|
|
374
|
-
escrow. This opt-in is for standalone Add cash flows. It uses the existing
|
|
375
|
-
source chooser, Supply quote/execution controller and backend recovery. It
|
|
376
|
-
keeps ordinary supported-USDC deposits on the existing gas-only deposit path.
|
|
377
|
-
Other wallet modes and consumers that omit the option retain their defaults.
|
|
378
|
-
|
|
379
|
-
Conversions include quoted conversion/intent fees within the entered source
|
|
380
|
-
budget. The form shows the minimum USDC cash received before submission.
|
|
381
|
-
Conversion success requires a successful USDC transfer from the embedded wallet
|
|
382
|
-
to the configured escrow and observed rollup credit; delayed credit can be
|
|
383
|
-
checked again without executing the transaction again. Do not combine this
|
|
384
|
-
standalone cash option with `depositBatches` or `onDepositExecute` actions.
|
|
385
|
-
|
|
386
|
-
Local rehearsal: `bun test tests/hooks/useSpiceSupply.test.tsx --test-name-pattern
|
|
387
|
-
'normalizes a deposit'` (external source, embedded source, delayed credit and
|
|
388
|
-
wallet-only receipt). Receipt negatives are in
|
|
389
|
-
`tests/components/SpiceDeposit/normalizedCredit.test.ts`. These offline fixtures
|
|
390
|
-
do not establish funded dev acceptance or live liquidity.
|
|
391
|
-
|
|
392
388
|
### Combined Cash balance
|
|
393
389
|
|
|
394
390
|
`SpiceDeposit` opens a new Add cash flow by default, even when the embedded
|
|
395
391
|
wallet holds leftover funds. With combined Cash enabled, those funds remain
|
|
396
392
|
available to Cash actions.
|
|
397
393
|
Clients that still need the legacy incomplete-deposit prompt can set
|
|
398
|
-
`skipRecovery={false}
|
|
399
|
-
by default. Set `discoverWalletBalances={false}` alongside `skipRecovery={false}`
|
|
400
|
-
to retain recorded incomplete-deposit recovery without prompting to deposit
|
|
401
|
-
ordinary wallet inventory. This option does not disable execution recovery or
|
|
402
|
-
change explicit deposits.
|
|
394
|
+
`skipRecovery={false}`; it is no longer shown automatically from a wallet balance.
|
|
403
395
|
|
|
404
396
|
Set `combineSourceBalances: true` on `SpiceSupply`, `SpiceLock`, `useSpiceSupply`,
|
|
405
397
|
`useSpiceLock` or `useSpiceAction` to show a token in the embedded wallet and its
|
|
@@ -723,7 +715,3 @@ The playground will automatically pick up the new example and display it as a ta
|
|
|
723
715
|
## License
|
|
724
716
|
|
|
725
717
|
MIT
|
|
726
|
-
|
|
727
|
-
### Stocks prerelease line
|
|
728
|
-
|
|
729
|
-
Stocks prereleases accumulate on `update/stocks-prerelease` and publish under the npm `stocks` tag (`4.23.2-stocks.N`). Continue from the latest published commit on that branch and preserve all preceding Stocks changes, including deposit discovery/loading, normalized cash conversion/recovery and combined wallet/escrow funding. Do not restart a Stocks fix from main or publish it as an isolated fix line. Consumers pin the verified exact version; eventual main integration includes the entire cumulative branch.
|
package/dist/auth-privy.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
(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)})();
|
|
2
|
-
"use strict";const r=require("./privy-
|
|
2
|
+
"use strict";const r=require("./privy-D01MvNL9.cjs");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-CDtAaiTV.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};
|
|
@@ -14,7 +14,6 @@ export declare function scaleTokenAmount(amount: bigint, fromDecimals: number, t
|
|
|
14
14
|
export interface BatchBuilderContext {
|
|
15
15
|
combinedSourceGroup?: CombinedSourceGroup;
|
|
16
16
|
currentPaymentAmount: string;
|
|
17
|
-
convertBeforeEscrow?: boolean;
|
|
18
17
|
isFeeInclusiveInput?: boolean;
|
|
19
18
|
feeOnlyAction?: boolean;
|
|
20
19
|
swapInputAmount?: bigint | null;
|
|
@@ -20,7 +20,6 @@ export interface UseSpiceSupplyParams extends Pick<SpiceSupplyProps, "sourceChai
|
|
|
20
20
|
recoveryKey: string;
|
|
21
21
|
};
|
|
22
22
|
prependSourceEscrow?: boolean;
|
|
23
|
-
convertBeforeEscrow?: boolean;
|
|
24
23
|
}
|
|
25
24
|
export declare function useSpiceSupply(params: UseSpiceSupplyParams): {
|
|
26
25
|
operationKey: `0x${string}`;
|