@sodax/types 2.1.0-rc.4 → 2.1.0-rc.5

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.
@@ -34,8 +34,7 @@ export interface BitcoinBoundExtrasV2 {
34
34
  */
35
35
  export interface SwapExtrasV2 {
36
36
  /**
37
- * Per-request partner-fee override; defaults to the backend's configured fee. Keeps the fee-adjusted
38
- * quote and the built intent consistent with `createIntent`.
37
+ * No default on `/swaps/*` — omit and the swap charges nothing. SDK `fee` / `swaps.partnerFee` does not apply here.
39
38
  */
40
39
  partnerFee?: PartnerFeeV2;
41
40
  /**
@@ -7,6 +7,18 @@ export declare const ICON_TX_RESULT_WAIT_MAX_RETRY = 10;
7
7
  export declare const MAX_UINT256: bigint;
8
8
  export declare const FEE_PERCENTAGE_SCALE = 10000n;
9
9
  export declare const DEFAULT_DEADLINE_OFFSET = 300n;
10
+ /**
11
+ * Gateway root shared by every backend API service: origin plus the deployment-owned version
12
+ * prefix. It never contains a service segment — each service appends its own path below it
13
+ * (`/be`, `/swaps`, `/bridge`, `/sponsorships/stellar`).
14
+ */
15
+ export declare const DEFAULT_API_BASE_URL = "https://api.sodax.com/v1";
16
+ /**
17
+ * @deprecated The gateway root plus the backend data API's own mount. Pass
18
+ * {@link DEFAULT_API_BASE_URL} as `baseURL` instead — the SDK appends
19
+ * {@link BACKEND_API_BASE_PATH} itself. A `baseURL` still ending in `/be` keeps working, but the
20
+ * SDK trims it and logs a warning.
21
+ */
10
22
  export declare const DEFAULT_BACKEND_API_ENDPOINT = "https://api.sodax.com/v1/be";
11
23
  export declare const DEFAULT_BACKEND_API_TIMEOUT = 30000;
12
24
  export declare const DEFAULT_BACKEND_API_HEADERS: {
@@ -16,16 +28,29 @@ export declare const DEFAULT_BACKEND_API_HEADERS: {
16
28
  export declare const DEFAULT_RELAYER_API_ENDPOINT = "https://xcall-relay.nw.iconblockchain.xyz";
17
29
  export declare const VAULT_TOKEN_DECIMALS = 18;
18
30
  /**
19
- * Gateway base URL, including its deployment-owned version prefix.
31
+ * Sponsoring gateway base URL. Deliberately a standalone literal, not an alias of
32
+ * {@link DEFAULT_API_BASE_URL}: sponsoring resolves independently, and consumers compare against this
33
+ * value to decide whether a target is real mainnet before spending real XLM — retargeting the shared
34
+ * root must not silently move that guard.
20
35
  */
21
36
  export declare const DEFAULT_SPONSORING_API_ENDPOINT = "https://api.sodax.com/v1";
22
37
  /** Stellar sponsorship route relative to the configured base URL. */
23
38
  export declare const SPONSORING_API_STELLAR_BASE_PATH = "/sponsorships/stellar";
39
+ /** Backend data API mount relative to the configured base URL (`/config/*`, `/intent/*`, `/moneymarket/*`, `/solver/*`). */
40
+ export declare const BACKEND_API_BASE_PATH = "/be";
24
41
  export type BaseApiConfig = {
25
42
  baseURL: HttpUrl;
26
43
  timeout: number;
27
44
  headers: Record<string, string>;
28
45
  };
46
+ /**
47
+ * Backend data API config. `basePath` is the service's mount below `baseURL`, defaulting to
48
+ * {@link BACKEND_API_BASE_PATH} — the gateway's mount. Set it to `''` for a directly addressed
49
+ * service that serves `/config/*`, `/intent/*`, … at the bare origin.
50
+ */
51
+ export type BackendApiConfig = BaseApiConfig & {
52
+ basePath?: string;
53
+ };
29
54
  /** Per-endpoint config for the swaps API. Structurally identical to {@link BaseApiConfig}. */
30
55
  export type SwapsApiConfig = BaseApiConfig;
31
56
  /**
@@ -37,24 +62,24 @@ export type SponsoringApiConfig = BaseApiConfig & {
37
62
  };
38
63
  /**
39
64
  * Independent service configs. At least one slice is required to keep this
40
- * union distinct from flat {@link BaseApiConfig}.
65
+ * union distinct from flat {@link BackendApiConfig}.
41
66
  */
42
67
  export type CustomApiConfig = {
43
- baseApiConfig: BaseApiConfig;
68
+ baseApiConfig: BackendApiConfig;
44
69
  swapsApiConfig?: SwapsApiConfig;
45
70
  sponsoringApiConfig?: SponsoringApiConfig;
46
71
  } | {
47
- baseApiConfig?: BaseApiConfig;
72
+ baseApiConfig?: BackendApiConfig;
48
73
  swapsApiConfig: SwapsApiConfig;
49
74
  sponsoringApiConfig?: SponsoringApiConfig;
50
75
  } | {
51
- baseApiConfig?: BaseApiConfig;
76
+ baseApiConfig?: BackendApiConfig;
52
77
  swapsApiConfig?: SwapsApiConfig;
53
78
  sponsoringApiConfig: SponsoringApiConfig;
54
79
  };
55
- export type ApiConfig = BaseApiConfig | CustomApiConfig;
80
+ export type ApiConfig = BackendApiConfig | CustomApiConfig;
56
81
  export declare const apiConfig: {
57
- baseURL: "https://api.sodax.com/v1/be";
82
+ baseURL: "https://api.sodax.com/v1";
58
83
  timeout: number;
59
84
  headers: {
60
85
  'Content-Type': string;
@@ -6,6 +6,18 @@ export const ICON_TX_RESULT_WAIT_MAX_RETRY = 10;
6
6
  export const MAX_UINT256 = (1n << 256n) - 1n;
7
7
  export const FEE_PERCENTAGE_SCALE = 10000n; // 100% = 10000
8
8
  export const DEFAULT_DEADLINE_OFFSET = 300n; // 5 minutes in seconds
9
+ /**
10
+ * Gateway root shared by every backend API service: origin plus the deployment-owned version
11
+ * prefix. It never contains a service segment — each service appends its own path below it
12
+ * (`/be`, `/swaps`, `/bridge`, `/sponsorships/stellar`).
13
+ */
14
+ export const DEFAULT_API_BASE_URL = 'https://api.sodax.com/v1';
15
+ /**
16
+ * @deprecated The gateway root plus the backend data API's own mount. Pass
17
+ * {@link DEFAULT_API_BASE_URL} as `baseURL` instead — the SDK appends
18
+ * {@link BACKEND_API_BASE_PATH} itself. A `baseURL` still ending in `/be` keeps working, but the
19
+ * SDK trims it and logs a warning.
20
+ */
9
21
  export const DEFAULT_BACKEND_API_ENDPOINT = 'https://api.sodax.com/v1/be';
10
22
  export const DEFAULT_BACKEND_API_TIMEOUT = 30000; // 30 seconds
11
23
  export const DEFAULT_BACKEND_API_HEADERS = {
@@ -15,13 +27,18 @@ export const DEFAULT_BACKEND_API_HEADERS = {
15
27
  export const DEFAULT_RELAYER_API_ENDPOINT = 'https://xcall-relay.nw.iconblockchain.xyz';
16
28
  export const VAULT_TOKEN_DECIMALS = 18;
17
29
  /**
18
- * Gateway base URL, including its deployment-owned version prefix.
30
+ * Sponsoring gateway base URL. Deliberately a standalone literal, not an alias of
31
+ * {@link DEFAULT_API_BASE_URL}: sponsoring resolves independently, and consumers compare against this
32
+ * value to decide whether a target is real mainnet before spending real XLM — retargeting the shared
33
+ * root must not silently move that guard.
19
34
  */
20
35
  export const DEFAULT_SPONSORING_API_ENDPOINT = 'https://api.sodax.com/v1';
21
36
  /** Stellar sponsorship route relative to the configured base URL. */
22
37
  export const SPONSORING_API_STELLAR_BASE_PATH = '/sponsorships/stellar';
38
+ /** Backend data API mount relative to the configured base URL (`/config/*`, `/intent/*`, `/moneymarket/*`, `/solver/*`). */
39
+ export const BACKEND_API_BASE_PATH = '/be';
23
40
  export const apiConfig = {
24
- baseURL: DEFAULT_BACKEND_API_ENDPOINT,
41
+ baseURL: DEFAULT_API_BASE_URL,
25
42
  timeout: DEFAULT_BACKEND_API_TIMEOUT,
26
43
  headers: DEFAULT_BACKEND_API_HEADERS,
27
44
  };
package/dist/index.d.ts CHANGED
@@ -19,4 +19,4 @@ export * from './sui/index.js';
19
19
  export * from './swap/index.js';
20
20
  export * from './utils/index.js';
21
21
  export * from './wallet/index.js';
22
- export declare const CONFIG_VERSION = 224;
22
+ export declare const CONFIG_VERSION = 225;
package/dist/index.js CHANGED
@@ -19,4 +19,4 @@ export * from './sui/index.js';
19
19
  export * from './swap/index.js';
20
20
  export * from './utils/index.js';
21
21
  export * from './wallet/index.js';
22
- export const CONFIG_VERSION = 224; // this value should be incremented (inside release/sdk branch) each time @sodax/types package is updated
22
+ export const CONFIG_VERSION = 225; // this value should be incremented (inside release/sdk branch) each time @sodax/types package is updated
@@ -6856,7 +6856,7 @@ export declare const sodaxConfig: {
6856
6856
  readonly rpcUrl: "https://rpc.soniclabs.com";
6857
6857
  };
6858
6858
  api: {
6859
- baseURL: "https://api.sodax.com/v1/be";
6859
+ baseURL: "https://api.sodax.com/v1";
6860
6860
  timeout: number;
6861
6861
  headers: {
6862
6862
  'Content-Type': string;
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "version": "2.1.0-rc.4",
7
+ "version": "2.1.0-rc.5",
8
8
  "description": "Sodax Common Types",
9
9
  "main": "dist/index.js",
10
10
  "homepage": "https://github.com/icon-project/sodax-sdks/tree/main/packages/types",