@stableflow/core 3.0.2 → 3.0.3-rc-6501a38666-20260630

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
@@ -41,6 +41,14 @@ OpenAPI.TOKEN = 'your-jwt-token';
41
41
 
42
42
  **👉 [Apply for JWT Token](https://docs.google.com/forms/u/3/d/e/1FAIpQLSdTeV7UaZ1MiFxdJ2jH_PU60PIN3iqYJ1WXEOFY45TsAy6O5g/viewform)**
43
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
+
44
52
  ## RPC configuration (optional)
45
53
 
46
54
  Override or extend chain RPC URLs when the built-in defaults are insufficient:
package/dist/index.d.mts CHANGED
@@ -61,6 +61,7 @@ type OpenAPIConfig = {
61
61
  WITH_CREDENTIALS: boolean;
62
62
  CREDENTIALS: 'include' | 'omit' | 'same-origin';
63
63
  TOKEN?: string | Resolver<string> | undefined;
64
+ NEARINTENTS_TOKEN?: string | Resolver<string> | undefined;
64
65
  USERNAME?: string | Resolver<string> | undefined;
65
66
  PASSWORD?: string | Resolver<string> | undefined;
66
67
  HEADERS?: Headers | Resolver<Headers> | undefined;
package/dist/index.d.ts CHANGED
@@ -61,6 +61,7 @@ type OpenAPIConfig = {
61
61
  WITH_CREDENTIALS: boolean;
62
62
  CREDENTIALS: 'include' | 'omit' | 'same-origin';
63
63
  TOKEN?: string | Resolver<string> | undefined;
64
+ NEARINTENTS_TOKEN?: string | Resolver<string> | undefined;
64
65
  USERNAME?: string | Resolver<string> | undefined;
65
66
  PASSWORD?: string | Resolver<string> | undefined;
66
67
  HEADERS?: Headers | Resolver<Headers> | undefined;
package/dist/index.js CHANGED
@@ -138,6 +138,7 @@ var OpenAPI = {
138
138
  WITH_CREDENTIALS: false,
139
139
  CREDENTIALS: "include",
140
140
  TOKEN: void 0,
141
+ NEARINTENTS_TOKEN: void 0,
141
142
  USERNAME: void 0,
142
143
  PASSWORD: void 0,
143
144
  HEADERS: void 0,
@@ -424,11 +425,12 @@ var resolve = async (options, resolver) => {
424
425
  return resolver;
425
426
  };
426
427
  var getHeaders = async (config, options, formData) => {
427
- const [token, username, password, additionalHeaders] = await Promise.all([
428
+ const [token, username, password, additionalHeaders, nearintentsToken] = await Promise.all([
428
429
  resolve(options, config.TOKEN),
429
430
  resolve(options, config.USERNAME),
430
431
  resolve(options, config.PASSWORD),
431
- resolve(options, config.HEADERS)
432
+ resolve(options, config.HEADERS),
433
+ resolve(options, config.NEARINTENTS_TOKEN)
432
434
  ]);
433
435
  const formHeaders = typeof formData?.getHeaders === "function" && formData?.getHeaders() || {};
434
436
  const headers = Object.entries({
@@ -443,6 +445,9 @@ var getHeaders = async (config, options, formData) => {
443
445
  if (isStringWithValue(token)) {
444
446
  headers["Authorization"] = `Bearer ${token}`;
445
447
  }
448
+ if (isStringWithValue(nearintentsToken)) {
449
+ headers["nearintent-api-key"] = nearintentsToken;
450
+ }
446
451
  if (isStringWithValue(username) && isStringWithValue(password)) {
447
452
  const credentials = base64(`${username}:${password}`);
448
453
  headers["Authorization"] = `Basic ${credentials}`;