@stableflow/core 0.0.0-experimental-5a8afd7389-20260703

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 StableFlow AI
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,78 @@
1
+ # @stableflow/core
2
+
3
+ StableFlow core: HTTP client, API models, token/chain configuration, and shared utilities.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ pnpm add @stableflow/core
9
+ ```
10
+
11
+ ## When to use
12
+
13
+ - You need direct access to the StableFlow HTTP API (`SFA`).
14
+ - You need shared types (`TokenConfig`, `WalletConfig`), bridge `Service` enums, or chain/token registries.
15
+ - You are building on top of `@stableflow/bridges` or `@stableflow/wallet-*` (they depend on this package).
16
+
17
+ For full cross-chain bridge flows (multi-route quote, send, status), use [`@stableflow/bridges`](../bridges/README.md) instead of calling `SFA` alone.
18
+
19
+ ## Main exports
20
+
21
+ | Category | Symbols |
22
+ |----------|---------|
23
+ | HTTP API | `SFA`, `OpenAPI`, `request`, `ApiError`, `CancelablePromise` |
24
+ | Bridge types | `Service`, `ServiceBackend`, `TransactionStatus`, `SendType` |
25
+ | Models | `QuoteRequest`, `QuoteResponse`, `TokenResponse`, `TokenConfig`, `WalletConfig`, … |
26
+ | Token / chain config | `tokens`, `usdtChains`, `usdcChains`, `frxusdChains`, `usdt0Chains` |
27
+ | RPC | `setRpcUrls`, `getRpcUrls`, `getChainRpcUrl`, `NetworkRpcUrlsMap` |
28
+ | Utilities | `numberRemoveEndZero`, `getRouteStatus`, `getPrice`, `Csl`, `ExecTime`, … |
29
+
30
+ See `dist/index.d.ts` after running `pnpm build`.
31
+
32
+ ## Authentication
33
+
34
+ Required for API access:
35
+
36
+ ```ts
37
+ import { OpenAPI } from '@stableflow/core';
38
+
39
+ OpenAPI.TOKEN = 'your-jwt-token';
40
+ ```
41
+
42
+ **👉 [Apply for JWT Token](https://docs.google.com/forms/u/3/d/e/1FAIpQLSdTeV7UaZ1MiFxdJ2jH_PU60PIN3iqYJ1WXEOFY45TsAy6O5g/viewform)**
43
+
44
+ Optional for OneClick routes(SFA.getQuote) — pass your NearIntents JWT for authenticated OneClick API access and fee-free swaps:
45
+
46
+ ```ts
47
+ OpenAPI.NEARINTENTS_TOKEN = 'your-nearintents-jwt-token';
48
+ ```
49
+
50
+ **👉 [Apply for NearIntents JWT Token](https://partners.near-intents.org/home)**
51
+
52
+ ## RPC configuration (optional)
53
+
54
+ Override or extend chain RPC URLs when the built-in defaults are insufficient:
55
+
56
+ ```ts
57
+ import { setRpcUrls } from '@stableflow/core';
58
+
59
+ setRpcUrls({
60
+ eth: ['https://your-eth-rpc.example.com'],
61
+ arb: ['https://your-arb-rpc.example.com'],
62
+ });
63
+ ```
64
+
65
+ Use `getChainRpcUrl(chainKey)` to read the active URL or URLs for a chain.
66
+
67
+ ## Debug Logs (optional)
68
+
69
+ ```typescript
70
+ import { OpenAPI } from "@stableflow/core";
71
+
72
+ OpenAPI.DEBUG = true;
73
+ ```
74
+
75
+ ## See also
76
+
77
+ - [Developer Guide](../../DEVELOPER_GUIDE.md)
78
+ - [@stableflow/bridges](../bridges/README.md)