@sodax/sdk 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.
- package/dist/index.cjs +186 -73
- package/dist/index.d.cts +60 -10
- package/dist/index.d.ts +60 -10
- package/dist/index.mjs +185 -74
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -3517,6 +3517,7 @@ var ICON_TX_RESULT_WAIT_MAX_RETRY = 10;
|
|
|
3517
3517
|
var MAX_UINT256 = (1n << 256n) - 1n;
|
|
3518
3518
|
var FEE_PERCENTAGE_SCALE = 10000n;
|
|
3519
3519
|
var DEFAULT_DEADLINE_OFFSET = 300n;
|
|
3520
|
+
var DEFAULT_API_BASE_URL = "https://api.sodax.com/v1";
|
|
3520
3521
|
var DEFAULT_BACKEND_API_ENDPOINT = "https://api.sodax.com/v1/be";
|
|
3521
3522
|
var DEFAULT_BACKEND_API_TIMEOUT = 3e4;
|
|
3522
3523
|
var DEFAULT_BACKEND_API_HEADERS = {
|
|
@@ -3527,8 +3528,9 @@ var DEFAULT_RELAYER_API_ENDPOINT = "https://xcall-relay.nw.iconblockchain.xyz";
|
|
|
3527
3528
|
var VAULT_TOKEN_DECIMALS = 18;
|
|
3528
3529
|
var DEFAULT_SPONSORING_API_ENDPOINT = "https://api.sodax.com/v1";
|
|
3529
3530
|
var SPONSORING_API_STELLAR_BASE_PATH = "/sponsorships/stellar";
|
|
3531
|
+
var BACKEND_API_BASE_PATH = "/be";
|
|
3530
3532
|
var apiConfig = {
|
|
3531
|
-
baseURL:
|
|
3533
|
+
baseURL: DEFAULT_API_BASE_URL,
|
|
3532
3534
|
timeout: DEFAULT_BACKEND_API_TIMEOUT,
|
|
3533
3535
|
headers: DEFAULT_BACKEND_API_HEADERS
|
|
3534
3536
|
};
|
|
@@ -4456,7 +4458,7 @@ function isValidWalletProviderForChainKey(chainKey, walletProvider) {
|
|
|
4456
4458
|
}
|
|
4457
4459
|
|
|
4458
4460
|
// ../types/dist/index.js
|
|
4459
|
-
var CONFIG_VERSION =
|
|
4461
|
+
var CONFIG_VERSION = 225;
|
|
4460
4462
|
|
|
4461
4463
|
// src/shared/utils/resolveTimeoutMs.ts
|
|
4462
4464
|
function resolveTimeoutMs(timeout, fallbackMs) {
|
|
@@ -30379,16 +30381,112 @@ function toInvalidResponseShapeError(params) {
|
|
|
30379
30381
|
context: { api, endpoint, reason: "invalid_response_shape", issues }
|
|
30380
30382
|
});
|
|
30381
30383
|
}
|
|
30384
|
+
|
|
30385
|
+
// src/backendApi/apiConfig.ts
|
|
30386
|
+
function flatLayer({ baseURL, timeout, headers }) {
|
|
30387
|
+
return { baseURL, timeout, headers };
|
|
30388
|
+
}
|
|
30389
|
+
function layerConfigs(...slices) {
|
|
30390
|
+
return slices.reduce(
|
|
30391
|
+
(acc, slice) => slice ? {
|
|
30392
|
+
// Truthy (not nullish) so a set-but-empty env var falls back, matching `makeRequest`.
|
|
30393
|
+
baseURL: slice.baseURL || acc.baseURL,
|
|
30394
|
+
timeout: slice.timeout ?? acc.timeout,
|
|
30395
|
+
headers: { ...acc.headers, ...slice.headers }
|
|
30396
|
+
} : acc,
|
|
30397
|
+
{
|
|
30398
|
+
baseURL: DEFAULT_API_BASE_URL,
|
|
30399
|
+
timeout: DEFAULT_BACKEND_API_TIMEOUT,
|
|
30400
|
+
headers: { ...DEFAULT_BACKEND_API_HEADERS }
|
|
30401
|
+
}
|
|
30402
|
+
);
|
|
30403
|
+
}
|
|
30404
|
+
function isHttpUrl(value) {
|
|
30405
|
+
return value.startsWith("http://") || value.startsWith("https://");
|
|
30406
|
+
}
|
|
30407
|
+
function normalizeBaseURL(baseURL) {
|
|
30408
|
+
const trimmed = trimTrailingSlashes(baseURL);
|
|
30409
|
+
return isHttpUrl(trimmed) ? trimmed : baseURL;
|
|
30410
|
+
}
|
|
30411
|
+
function stripBackendMount(baseURL) {
|
|
30412
|
+
const trimmed = trimTrailingSlashes(baseURL);
|
|
30413
|
+
if (!trimmed.endsWith(BACKEND_API_BASE_PATH)) return void 0;
|
|
30414
|
+
const root = trimmed.slice(0, -BACKEND_API_BASE_PATH.length);
|
|
30415
|
+
return isHttpUrl(root) ? root : void 0;
|
|
30416
|
+
}
|
|
30417
|
+
function stripLegacyBackendMount(baseURL) {
|
|
30418
|
+
return stripBackendMount(baseURL) ?? baseURL;
|
|
30419
|
+
}
|
|
30420
|
+
function normalizeOverrideBaseURL(override) {
|
|
30421
|
+
if (!override?.baseURL) return override;
|
|
30422
|
+
return { ...override, baseURL: stripLegacyBackendMount(override.baseURL) };
|
|
30423
|
+
}
|
|
30424
|
+
function toGatewayRoot(baseURL) {
|
|
30425
|
+
return stripBackendMount(baseURL) ?? normalizeBaseURL(baseURL);
|
|
30426
|
+
}
|
|
30427
|
+
function configuredBasePath(layers) {
|
|
30428
|
+
return layers.baseApiConfig?.basePath ?? layers.basePath;
|
|
30429
|
+
}
|
|
30430
|
+
function hasExplicitBasePath(layers) {
|
|
30431
|
+
return configuredBasePath(layers) !== void 0;
|
|
30432
|
+
}
|
|
30433
|
+
function hasLegacyBackendBaseURL(layers) {
|
|
30434
|
+
if (configuredBasePath(layers) !== void 0) return false;
|
|
30435
|
+
return stripBackendMount(layerConfigs(flatLayer(layers), layers.baseApiConfig).baseURL) !== void 0;
|
|
30436
|
+
}
|
|
30437
|
+
var PACKAGED_API_ORIGIN = new URL(DEFAULT_API_BASE_URL).origin;
|
|
30438
|
+
function isOnPackagedOrigin(baseURL) {
|
|
30439
|
+
return baseURL === PACKAGED_API_ORIGIN || baseURL.startsWith(`${PACKAGED_API_ORIGIN}/`);
|
|
30440
|
+
}
|
|
30441
|
+
function isMissingVersionPrefix(baseURL) {
|
|
30442
|
+
const normalized = trimTrailingSlashes(baseURL);
|
|
30443
|
+
if (!isOnPackagedOrigin(normalized)) return false;
|
|
30444
|
+
return normalized !== DEFAULT_API_BASE_URL && !normalized.startsWith(`${DEFAULT_API_BASE_URL}/`);
|
|
30445
|
+
}
|
|
30446
|
+
function normalizeBasePath(basePath) {
|
|
30447
|
+
const trimmed = trimTrailingSlashes(basePath.trim());
|
|
30448
|
+
const withoutLeadingSlashes = trimmed.replace(/^\/+/, "");
|
|
30449
|
+
return withoutLeadingSlashes.length === 0 ? "" : `/${withoutLeadingSlashes}`;
|
|
30450
|
+
}
|
|
30451
|
+
function resolveSharedApiConfig(layers, slice) {
|
|
30452
|
+
const layered = layerConfigs(flatLayer(layers), layers.baseApiConfig, slice);
|
|
30453
|
+
const baseURL = configuredBasePath(layers) === void 0 ? toGatewayRoot(layered.baseURL) : normalizeBaseURL(layered.baseURL);
|
|
30454
|
+
return { ...layered, baseURL };
|
|
30455
|
+
}
|
|
30456
|
+
function resolveBaseApiConfig(layers) {
|
|
30457
|
+
return {
|
|
30458
|
+
...resolveSharedApiConfig(layers),
|
|
30459
|
+
basePath: normalizeBasePath(configuredBasePath(layers) ?? BACKEND_API_BASE_PATH)
|
|
30460
|
+
};
|
|
30461
|
+
}
|
|
30462
|
+
function resolveSwapsApiConfig(layers) {
|
|
30463
|
+
return resolveSharedApiConfig(layers, layers.swapsApiConfig);
|
|
30464
|
+
}
|
|
30465
|
+
function resolveSponsoringApiConfig(layers) {
|
|
30466
|
+
const slice = layers.sponsoringApiConfig;
|
|
30467
|
+
return {
|
|
30468
|
+
baseURL: normalizeBaseURL(slice?.baseURL ?? DEFAULT_SPONSORING_API_ENDPOINT),
|
|
30469
|
+
timeout: slice?.timeout ?? resolveSharedApiConfig(layers).timeout,
|
|
30470
|
+
headers: { ...DEFAULT_BACKEND_API_HEADERS, ...slice?.headers },
|
|
30471
|
+
...slice?.apiKey === void 0 ? {} : { apiKey: slice.apiKey }
|
|
30472
|
+
};
|
|
30473
|
+
}
|
|
30474
|
+
function resolveBridgeApiConfig(layers) {
|
|
30475
|
+
return resolveSharedApiConfig(layers);
|
|
30476
|
+
}
|
|
30382
30477
|
var SwapsApiService = class _SwapsApiService {
|
|
30383
30478
|
// Fully-resolved swaps-API config supplied by the caller (BackendApiService resolves the
|
|
30384
30479
|
// `ApiConfig` union via `resolveSwapsApiConfig`); this service does not resolve the union.
|
|
30385
30480
|
config;
|
|
30386
30481
|
headers;
|
|
30387
30482
|
logger;
|
|
30388
|
-
|
|
30483
|
+
/** See {@link SwapsApiServiceOptions.trimLegacyOverrides}. */
|
|
30484
|
+
trimsLegacyOverrides;
|
|
30485
|
+
constructor(config, logger = consoleLogger, options = {}) {
|
|
30389
30486
|
this.config = config;
|
|
30390
30487
|
this.headers = { ...config.headers };
|
|
30391
30488
|
this.logger = logger;
|
|
30489
|
+
this.trimsLegacyOverrides = options.trimLegacyOverrides ?? true;
|
|
30392
30490
|
}
|
|
30393
30491
|
/**
|
|
30394
30492
|
* Build a `@sodax/swaps-api` client for a single call. Maps the SDK's `SwapsApiConfig`
|
|
@@ -30399,7 +30497,8 @@ var SwapsApiService = class _SwapsApiService {
|
|
|
30399
30497
|
* overrides both take effect without caching stale state.
|
|
30400
30498
|
*/
|
|
30401
30499
|
buildClient(overrideConfig) {
|
|
30402
|
-
const
|
|
30500
|
+
const override = overrideConfig?.baseURL;
|
|
30501
|
+
const baseUrl = override ? this.trimsLegacyOverrides ? stripLegacyBackendMount(override) : override : this.config.baseURL;
|
|
30403
30502
|
const timeout = overrideConfig?.timeout ?? this.config.timeout ?? DEFAULT_BACKEND_API_TIMEOUT;
|
|
30404
30503
|
const headers = { ...this.headers, ...overrideConfig?.headers };
|
|
30405
30504
|
return new swapsApi.SwapsApi({ baseUrl, headers, timeout });
|
|
@@ -30874,10 +30973,13 @@ var BridgeApiService = class {
|
|
|
30874
30973
|
config;
|
|
30875
30974
|
headers;
|
|
30876
30975
|
logger;
|
|
30877
|
-
|
|
30976
|
+
/** See {@link BridgeApiServiceOptions.trimLegacyOverrides}. */
|
|
30977
|
+
trimsLegacyOverrides;
|
|
30978
|
+
constructor(config, logger = consoleLogger, options = {}) {
|
|
30878
30979
|
this.config = config;
|
|
30879
30980
|
this.headers = { ...config.headers };
|
|
30880
30981
|
this.logger = logger;
|
|
30982
|
+
this.trimsLegacyOverrides = options.trimLegacyOverrides ?? true;
|
|
30881
30983
|
}
|
|
30882
30984
|
/**
|
|
30883
30985
|
* Issues a single HTTP request, validates the JSON body against `schema`, and
|
|
@@ -30890,7 +30992,10 @@ var BridgeApiService = class {
|
|
|
30890
30992
|
const raw = await makeRequest({
|
|
30891
30993
|
endpoint,
|
|
30892
30994
|
config: { baseURL: this.config.baseURL, timeout: this.config.timeout, headers: this.headers, ...config },
|
|
30893
|
-
|
|
30995
|
+
// Normalized like a configured base URL: the override is the gateway root, so a legacy
|
|
30996
|
+
// `/be`-suffixed value must not nest `/bridge/*` under the data API's mount — unless the config
|
|
30997
|
+
// opted out of the legacy trim, in which case the per-call value is left exactly as given.
|
|
30998
|
+
overrideConfig: this.trimsLegacyOverrides ? normalizeOverrideBaseURL(overrideConfig) : overrideConfig,
|
|
30894
30999
|
logger: this.logger,
|
|
30895
31000
|
serviceLabel: "BridgeApiService"
|
|
30896
31001
|
});
|
|
@@ -31095,53 +31200,6 @@ var BridgeApiService = class {
|
|
|
31095
31200
|
return this.config.timeout;
|
|
31096
31201
|
}
|
|
31097
31202
|
};
|
|
31098
|
-
|
|
31099
|
-
// src/backendApi/apiConfig.ts
|
|
31100
|
-
function flatLayer({ baseURL, timeout, headers }) {
|
|
31101
|
-
return { baseURL, timeout, headers };
|
|
31102
|
-
}
|
|
31103
|
-
function layerConfigs(...slices) {
|
|
31104
|
-
return slices.reduce(
|
|
31105
|
-
(acc, slice) => slice ? {
|
|
31106
|
-
baseURL: slice.baseURL ?? acc.baseURL,
|
|
31107
|
-
timeout: slice.timeout ?? acc.timeout,
|
|
31108
|
-
headers: { ...acc.headers, ...slice.headers }
|
|
31109
|
-
} : acc,
|
|
31110
|
-
{
|
|
31111
|
-
baseURL: DEFAULT_BACKEND_API_ENDPOINT,
|
|
31112
|
-
timeout: DEFAULT_BACKEND_API_TIMEOUT,
|
|
31113
|
-
headers: { ...DEFAULT_BACKEND_API_HEADERS }
|
|
31114
|
-
}
|
|
31115
|
-
);
|
|
31116
|
-
}
|
|
31117
|
-
function resolveBaseApiConfig(config) {
|
|
31118
|
-
const layers = config;
|
|
31119
|
-
return layerConfigs(flatLayer(layers), layers.baseApiConfig);
|
|
31120
|
-
}
|
|
31121
|
-
function resolveSwapsApiConfig(config) {
|
|
31122
|
-
const layers = config;
|
|
31123
|
-
return layerConfigs(flatLayer(layers), layers.baseApiConfig, layers.swapsApiConfig);
|
|
31124
|
-
}
|
|
31125
|
-
function isHttpUrl(value) {
|
|
31126
|
-
return value.startsWith("http://") || value.startsWith("https://");
|
|
31127
|
-
}
|
|
31128
|
-
function normalizeBaseURL(baseURL) {
|
|
31129
|
-
const trimmed = trimTrailingSlashes(baseURL);
|
|
31130
|
-
return isHttpUrl(trimmed) ? trimmed : baseURL;
|
|
31131
|
-
}
|
|
31132
|
-
function resolveSponsoringApiConfig(config) {
|
|
31133
|
-
const layers = config;
|
|
31134
|
-
const slice = layers.sponsoringApiConfig;
|
|
31135
|
-
return {
|
|
31136
|
-
baseURL: normalizeBaseURL(slice?.baseURL ?? DEFAULT_SPONSORING_API_ENDPOINT),
|
|
31137
|
-
timeout: slice?.timeout ?? resolveBaseApiConfig(config).timeout,
|
|
31138
|
-
headers: { ...DEFAULT_BACKEND_API_HEADERS, ...slice?.headers },
|
|
31139
|
-
...slice?.apiKey === void 0 ? {} : { apiKey: slice.apiKey }
|
|
31140
|
-
};
|
|
31141
|
-
}
|
|
31142
|
-
function resolveBridgeApiConfig(config) {
|
|
31143
|
-
return resolveBaseApiConfig(config);
|
|
31144
|
-
}
|
|
31145
31203
|
var ChainKeySchema = v7__namespace.custom((input) => typeof input === "string");
|
|
31146
31204
|
var SpokeChainKeySchema = v7__namespace.custom((input) => typeof input === "string");
|
|
31147
31205
|
var AddressSchema2 = v7__namespace.custom((input) => typeof input === "string");
|
|
@@ -31280,17 +31338,70 @@ var BackendApiService = class {
|
|
|
31280
31338
|
swaps;
|
|
31281
31339
|
sponsoring;
|
|
31282
31340
|
bridge;
|
|
31283
|
-
// resolved base-API config: the flat fields of the ApiConfig union with any `baseApiConfig` layered on
|
|
31341
|
+
// resolved base-API config: the flat fields of the ApiConfig union with any `baseApiConfig` layered on
|
|
31342
|
+
// top. `baseURL` is the gateway root; `basePath` is this service's own mount below it.
|
|
31284
31343
|
config;
|
|
31285
31344
|
headers;
|
|
31286
31345
|
logger;
|
|
31346
|
+
/**
|
|
31347
|
+
* Whether a legacy `/be` suffix is trimmed off a per-call `baseURL` override. Mirrors the config-level
|
|
31348
|
+
* decision: an explicit `basePath` means the consumer writes complete roots, so their per-call value is
|
|
31349
|
+
* left exactly as given rather than having a real path segment eaten.
|
|
31350
|
+
*/
|
|
31351
|
+
trimsLegacyOverrides;
|
|
31287
31352
|
constructor(config, logger = consoleLogger) {
|
|
31288
31353
|
this.config = resolveBaseApiConfig(config);
|
|
31289
31354
|
this.headers = { ...this.config.headers };
|
|
31290
31355
|
this.logger = logger;
|
|
31291
|
-
this.
|
|
31292
|
-
|
|
31293
|
-
|
|
31356
|
+
this.trimsLegacyOverrides = !hasExplicitBasePath(config);
|
|
31357
|
+
const swapsConfig2 = resolveSwapsApiConfig(config);
|
|
31358
|
+
const sponsoringConfig = resolveSponsoringApiConfig(config);
|
|
31359
|
+
const bridgeConfig2 = resolveBridgeApiConfig(config);
|
|
31360
|
+
const shortRoots = [
|
|
31361
|
+
["backendApi", this.config.baseURL],
|
|
31362
|
+
["api.swaps", swapsConfig2.baseURL],
|
|
31363
|
+
["api.bridge", bridgeConfig2.baseURL],
|
|
31364
|
+
["api.sponsoring", sponsoringConfig.baseURL]
|
|
31365
|
+
].filter(([, baseURL]) => isMissingVersionPrefix(baseURL));
|
|
31366
|
+
if (shortRoots.length > 0) {
|
|
31367
|
+
const named = shortRoots.map(([service, baseURL]) => `${service} ("${baseURL}")`).join(", ");
|
|
31368
|
+
this.logger.warn(
|
|
31369
|
+
`[BackendApiService] api.baseURL is missing the gateway's version prefix for ${named}: every route resolves one segment short. Use "${DEFAULT_API_BASE_URL}" \u2014 the prefix is deployment-owned, so it belongs in baseURL, and only the data API has a basePath to compensate.`
|
|
31370
|
+
);
|
|
31371
|
+
}
|
|
31372
|
+
if (hasLegacyBackendBaseURL(config)) {
|
|
31373
|
+
this.logger.warn(
|
|
31374
|
+
`[BackendApiService] api.baseURL should be the gateway root, not the backend data API's mount: trimmed "${BACKEND_API_BASE_PATH}" to "${this.config.baseURL}". Drop the suffix \u2014 the SDK appends it, and sibling services (/swaps, /bridge) must not sit under it.`
|
|
31375
|
+
);
|
|
31376
|
+
}
|
|
31377
|
+
const overrideOptions = { trimLegacyOverrides: this.trimsLegacyOverrides };
|
|
31378
|
+
this.swaps = new SwapsApiService(swapsConfig2, this.logger, overrideOptions);
|
|
31379
|
+
this.sponsoring = new SponsoringApiService(sponsoringConfig, this.logger);
|
|
31380
|
+
this.bridge = new BridgeApiService(bridgeConfig2, this.logger, overrideOptions);
|
|
31381
|
+
}
|
|
31382
|
+
/**
|
|
31383
|
+
* Issue the HTTP call for a route.
|
|
31384
|
+
*
|
|
31385
|
+
* The mount is applied here rather than at each route literal, so `error.context.endpoint` stays
|
|
31386
|
+
* route-relative and the mount survives a per-call `baseURL` override — that retargets the gateway
|
|
31387
|
+
* root, not which service the route belongs to. For the same reason an override is put through the
|
|
31388
|
+
* legacy-mount trim: without it, passing the old `…/v1/be` value per call would yield `/be/be/…`.
|
|
31389
|
+
*
|
|
31390
|
+
* Defaults are listed field by field so `basePath` cannot cross into `RequestConfig`, where it has no
|
|
31391
|
+
* meaning — a spread would pass it silently, since TypeScript skips excess-property checks on spreads.
|
|
31392
|
+
*/
|
|
31393
|
+
async send(endpoint, config) {
|
|
31394
|
+
const { baseURL, ...rest } = config;
|
|
31395
|
+
const overrideBaseURL = baseURL !== void 0 && this.trimsLegacyOverrides ? stripLegacyBackendMount(baseURL) : baseURL;
|
|
31396
|
+
return makeRequest({
|
|
31397
|
+
endpoint: `${this.config.basePath}${endpoint}`,
|
|
31398
|
+
config: resolveRequestConfig(
|
|
31399
|
+
{ ...rest, ...overrideBaseURL === void 0 ? {} : { baseURL: overrideBaseURL } },
|
|
31400
|
+
{ baseURL: this.config.baseURL, timeout: this.config.timeout, headers: this.headers }
|
|
31401
|
+
),
|
|
31402
|
+
logger: this.logger,
|
|
31403
|
+
serviceLabel: "BackendApiService"
|
|
31404
|
+
});
|
|
31294
31405
|
}
|
|
31295
31406
|
/**
|
|
31296
31407
|
* Issue a request and validate the JSON body against `schema`, wrapping the result in `Result<T>`.
|
|
@@ -31301,12 +31412,7 @@ var BackendApiService = class {
|
|
|
31301
31412
|
*/
|
|
31302
31413
|
async request(endpoint, config, schema) {
|
|
31303
31414
|
try {
|
|
31304
|
-
const raw = await
|
|
31305
|
-
endpoint,
|
|
31306
|
-
config: resolveRequestConfig(config, { ...this.config, headers: this.headers }),
|
|
31307
|
-
logger: this.logger,
|
|
31308
|
-
serviceLabel: "BackendApiService"
|
|
31309
|
-
});
|
|
31415
|
+
const raw = await this.send(endpoint, config);
|
|
31310
31416
|
const parsed = v7__namespace.safeParse(schema, raw);
|
|
31311
31417
|
if (!parsed.success) {
|
|
31312
31418
|
return {
|
|
@@ -31333,12 +31439,7 @@ var BackendApiService = class {
|
|
|
31333
31439
|
*/
|
|
31334
31440
|
async requestUnvalidated(endpoint, config) {
|
|
31335
31441
|
try {
|
|
31336
|
-
const value = await
|
|
31337
|
-
endpoint,
|
|
31338
|
-
config: resolveRequestConfig(config, { ...this.config, headers: this.headers }),
|
|
31339
|
-
logger: this.logger,
|
|
31340
|
-
serviceLabel: "BackendApiService"
|
|
31341
|
-
});
|
|
31442
|
+
const value = await this.send(endpoint, config);
|
|
31342
31443
|
return { ok: true, value };
|
|
31343
31444
|
} catch (error) {
|
|
31344
31445
|
return { ok: false, error: toExternalApiError({ api: "backend", feature: "backend", endpoint, error }) };
|
|
@@ -31640,8 +31741,9 @@ var BackendApiService = class {
|
|
|
31640
31741
|
* without constructing a new service instance. Existing header keys are
|
|
31641
31742
|
* overwritten; keys absent from `headers` are preserved.
|
|
31642
31743
|
*
|
|
31643
|
-
* Headers also reach `swaps
|
|
31644
|
-
*
|
|
31744
|
+
* Headers also reach `swaps` and `bridge`, but never `sponsoring`: it is configured independently, so
|
|
31745
|
+
* base-API credentials must not be forwarded to whatever origin it points at. Note `swaps` can also be
|
|
31746
|
+
* retargeted to another origin via `swapsApiConfig`, in which case a header set here follows it.
|
|
31645
31747
|
*
|
|
31646
31748
|
* @param headers - Key-value pairs to add or overwrite in the default headers.
|
|
31647
31749
|
*/
|
|
@@ -31653,13 +31755,22 @@ var BackendApiService = class {
|
|
|
31653
31755
|
this.bridge.setHeaders(headers);
|
|
31654
31756
|
}
|
|
31655
31757
|
/**
|
|
31656
|
-
* Return the
|
|
31758
|
+
* Return the gateway root the service is currently pointing at — WITHOUT this service's own mount.
|
|
31759
|
+
* Requests go to `getBaseURL() + getBasePath() + <route>`.
|
|
31657
31760
|
*
|
|
31658
|
-
* @returns The `baseURL` from the `ApiConfig` this instance was
|
|
31761
|
+
* @returns The resolved gateway root, i.e. the `baseURL` from the `ApiConfig` this instance was
|
|
31762
|
+
* constructed with, minus a legacy `/be` suffix if one was supplied.
|
|
31659
31763
|
*/
|
|
31660
31764
|
getBaseURL() {
|
|
31661
31765
|
return this.config.baseURL;
|
|
31662
31766
|
}
|
|
31767
|
+
/**
|
|
31768
|
+
* Return the backend data API's mount below {@link getBaseURL} — `/be` by default, or whatever
|
|
31769
|
+
* `basePath` the `ApiConfig` supplied (`''` for a service addressed directly at its origin).
|
|
31770
|
+
*/
|
|
31771
|
+
getBasePath() {
|
|
31772
|
+
return this.config.basePath;
|
|
31773
|
+
}
|
|
31663
31774
|
};
|
|
31664
31775
|
|
|
31665
31776
|
// src/bridge/errors.ts
|
|
@@ -42104,6 +42215,7 @@ Object.defineProperty(exports, "SwapsApiError", {
|
|
|
42104
42215
|
exports.ALLOWANCE_CHECK_CODES = ALLOWANCE_CHECK_CODES;
|
|
42105
42216
|
exports.APPROVE_CODES = APPROVE_CODES;
|
|
42106
42217
|
exports.AssetService = AssetService;
|
|
42218
|
+
exports.BACKEND_API_BASE_PATH = BACKEND_API_BASE_PATH;
|
|
42107
42219
|
exports.BITCOIN_CHAIN_KEYS = BITCOIN_CHAIN_KEYS;
|
|
42108
42220
|
exports.BITCOIN_CHAIN_KEYS_SET = BITCOIN_CHAIN_KEYS_SET;
|
|
42109
42221
|
exports.BITCOIN_DUST_SATS = BITCOIN_DUST_SATS;
|
|
@@ -42127,6 +42239,7 @@ exports.ClService = ClService;
|
|
|
42127
42239
|
exports.ConfigService = ConfigService;
|
|
42128
42240
|
exports.CustomSorobanServer = CustomSorobanServer;
|
|
42129
42241
|
exports.CustomStellarAccount = CustomStellarAccount;
|
|
42242
|
+
exports.DEFAULT_API_BASE_URL = DEFAULT_API_BASE_URL;
|
|
42130
42243
|
exports.DEFAULT_BACKEND_API_ENDPOINT = DEFAULT_BACKEND_API_ENDPOINT;
|
|
42131
42244
|
exports.DEFAULT_BACKEND_API_HEADERS = DEFAULT_BACKEND_API_HEADERS;
|
|
42132
42245
|
exports.DEFAULT_BACKEND_API_TIMEOUT = DEFAULT_BACKEND_API_TIMEOUT;
|
package/dist/index.d.cts
CHANGED
|
@@ -7551,11 +7551,23 @@ type ResultifiedSwapsApiV2 = {
|
|
|
7551
7551
|
*
|
|
7552
7552
|
* Reachable on the Sodax facade as `sodax.api.swaps`.
|
|
7553
7553
|
*/
|
|
7554
|
+
/** Construction options for {@link SwapsApiService}. */
|
|
7555
|
+
type SwapsApiServiceOptions = {
|
|
7556
|
+
/**
|
|
7557
|
+
* Whether a legacy `/be` suffix is trimmed off a per-call `baseURL` override. Defaults to `true`, the
|
|
7558
|
+
* migration behaviour. `BackendApiService` passes `false` when the `ApiConfig` states a `basePath`
|
|
7559
|
+
* explicitly: that marks a config written against the current contract, whose base URLs are deliberate
|
|
7560
|
+
* roots, so a trailing `/be` is a real path segment rather than the data API's mount.
|
|
7561
|
+
*/
|
|
7562
|
+
trimLegacyOverrides?: boolean;
|
|
7563
|
+
};
|
|
7554
7564
|
declare class SwapsApiService implements ResultifiedSwapsApiV2 {
|
|
7555
7565
|
private readonly config;
|
|
7556
7566
|
private readonly headers;
|
|
7557
7567
|
private readonly logger;
|
|
7558
|
-
|
|
7568
|
+
/** See {@link SwapsApiServiceOptions.trimLegacyOverrides}. */
|
|
7569
|
+
private readonly trimsLegacyOverrides;
|
|
7570
|
+
constructor(config: SwapsApiConfig, logger?: SodaxLogger, options?: SwapsApiServiceOptions);
|
|
7559
7571
|
/**
|
|
7560
7572
|
* Build a `@sodax/swaps-api` client for a single call. Maps the SDK's `SwapsApiConfig`
|
|
7561
7573
|
* (`baseURL`/`timeout`/`headers`) to the package's config (`baseUrl`/`timeout`/`headers`), layering
|
|
@@ -7731,18 +7743,30 @@ declare function toCreateBridgeIntentParamsV2(params: {
|
|
|
7731
7743
|
* Per-call request overrides (base URL, timeout, headers) can be passed as the
|
|
7732
7744
|
* optional last argument to any method via `RequestOverrideConfig`.
|
|
7733
7745
|
*
|
|
7734
|
-
* The Bridge API
|
|
7735
|
-
*
|
|
7736
|
-
*
|
|
7746
|
+
* The Bridge API hangs off the shared gateway root as `/bridge/*` — a sibling of the data API's `/be`
|
|
7747
|
+
* mount, not a child of it, so `resolveBridgeApiConfig` returns a flat {@link BaseApiConfig} with no
|
|
7748
|
+
* `basePath`. It defaults to the same host as the swaps client but is not configured with it:
|
|
7737
7749
|
* a `swapsApiConfig` slice does not move the bridge routes; set `baseURL` / `baseApiConfig` instead.
|
|
7738
7750
|
*
|
|
7739
7751
|
* Reachable on the Sodax facade as `sodax.api.bridge`.
|
|
7740
7752
|
*/
|
|
7753
|
+
/** Construction options for {@link BridgeApiService}. */
|
|
7754
|
+
type BridgeApiServiceOptions = {
|
|
7755
|
+
/**
|
|
7756
|
+
* Whether a legacy `/be` suffix is trimmed off a per-call `baseURL` override. Defaults to `true`, the
|
|
7757
|
+
* migration behaviour. `BackendApiService` passes `false` when the `ApiConfig` states a `basePath`
|
|
7758
|
+
* explicitly: that marks a config written against the current contract, whose base URLs are deliberate
|
|
7759
|
+
* roots, so a trailing `/be` is a real path segment rather than the data API's mount.
|
|
7760
|
+
*/
|
|
7761
|
+
trimLegacyOverrides?: boolean;
|
|
7762
|
+
};
|
|
7741
7763
|
declare class BridgeApiService implements ResultifiedBridgeApiV2 {
|
|
7742
7764
|
private readonly config;
|
|
7743
7765
|
private readonly headers;
|
|
7744
7766
|
private readonly logger;
|
|
7745
|
-
|
|
7767
|
+
/** See {@link BridgeApiServiceOptions.trimLegacyOverrides}. */
|
|
7768
|
+
private readonly trimsLegacyOverrides;
|
|
7769
|
+
constructor(config: BaseApiConfig, logger?: SodaxLogger, options?: BridgeApiServiceOptions);
|
|
7746
7770
|
/**
|
|
7747
7771
|
* Issues a single HTTP request, validates the JSON body against `schema`, and
|
|
7748
7772
|
* wraps the result in `Result<T>`. The service-level `baseURL`/`timeout`/
|
|
@@ -7984,7 +8008,25 @@ declare class BackendApiService implements IConfigApiV1 {
|
|
|
7984
8008
|
private readonly config;
|
|
7985
8009
|
private readonly headers;
|
|
7986
8010
|
private readonly logger;
|
|
8011
|
+
/**
|
|
8012
|
+
* Whether a legacy `/be` suffix is trimmed off a per-call `baseURL` override. Mirrors the config-level
|
|
8013
|
+
* decision: an explicit `basePath` means the consumer writes complete roots, so their per-call value is
|
|
8014
|
+
* left exactly as given rather than having a real path segment eaten.
|
|
8015
|
+
*/
|
|
8016
|
+
private readonly trimsLegacyOverrides;
|
|
7987
8017
|
constructor(config: ApiConfig, logger?: SodaxLogger);
|
|
8018
|
+
/**
|
|
8019
|
+
* Issue the HTTP call for a route.
|
|
8020
|
+
*
|
|
8021
|
+
* The mount is applied here rather than at each route literal, so `error.context.endpoint` stays
|
|
8022
|
+
* route-relative and the mount survives a per-call `baseURL` override — that retargets the gateway
|
|
8023
|
+
* root, not which service the route belongs to. For the same reason an override is put through the
|
|
8024
|
+
* legacy-mount trim: without it, passing the old `…/v1/be` value per call would yield `/be/be/…`.
|
|
8025
|
+
*
|
|
8026
|
+
* Defaults are listed field by field so `basePath` cannot cross into `RequestConfig`, where it has no
|
|
8027
|
+
* meaning — a spread would pass it silently, since TypeScript skips excess-property checks on spreads.
|
|
8028
|
+
*/
|
|
8029
|
+
private send;
|
|
7988
8030
|
/**
|
|
7989
8031
|
* Issue a request and validate the JSON body against `schema`, wrapping the result in `Result<T>`.
|
|
7990
8032
|
* Mirrors {@link SwapsApiService}: a 2xx body that fails the schema is surfaced as
|
|
@@ -8224,18 +8266,26 @@ declare class BackendApiService implements IConfigApiV1 {
|
|
|
8224
8266
|
* without constructing a new service instance. Existing header keys are
|
|
8225
8267
|
* overwritten; keys absent from `headers` are preserved.
|
|
8226
8268
|
*
|
|
8227
|
-
* Headers also reach `swaps
|
|
8228
|
-
*
|
|
8269
|
+
* Headers also reach `swaps` and `bridge`, but never `sponsoring`: it is configured independently, so
|
|
8270
|
+
* base-API credentials must not be forwarded to whatever origin it points at. Note `swaps` can also be
|
|
8271
|
+
* retargeted to another origin via `swapsApiConfig`, in which case a header set here follows it.
|
|
8229
8272
|
*
|
|
8230
8273
|
* @param headers - Key-value pairs to add or overwrite in the default headers.
|
|
8231
8274
|
*/
|
|
8232
8275
|
setHeaders(headers: Record<string, string>): void;
|
|
8233
8276
|
/**
|
|
8234
|
-
* Return the
|
|
8277
|
+
* Return the gateway root the service is currently pointing at — WITHOUT this service's own mount.
|
|
8278
|
+
* Requests go to `getBaseURL() + getBasePath() + <route>`.
|
|
8235
8279
|
*
|
|
8236
|
-
* @returns The `baseURL` from the `ApiConfig` this instance was
|
|
8280
|
+
* @returns The resolved gateway root, i.e. the `baseURL` from the `ApiConfig` this instance was
|
|
8281
|
+
* constructed with, minus a legacy `/be` suffix if one was supplied.
|
|
8237
8282
|
*/
|
|
8238
8283
|
getBaseURL(): string;
|
|
8284
|
+
/**
|
|
8285
|
+
* Return the backend data API's mount below {@link getBaseURL} — `/be` by default, or whatever
|
|
8286
|
+
* `basePath` the `ApiConfig` supplied (`''` for a service addressed directly at its origin).
|
|
8287
|
+
*/
|
|
8288
|
+
getBasePath(): string;
|
|
8239
8289
|
}
|
|
8240
8290
|
|
|
8241
8291
|
/**
|
|
@@ -18475,4 +18525,4 @@ type DexApproveErrorCode = ApproveErrorCode;
|
|
|
18475
18525
|
type DexApproveError = SodaxError<DexApproveErrorCode>;
|
|
18476
18526
|
declare const isDexApproveError: (e: unknown) => e is SodaxError<ApproveErrorCode>;
|
|
18477
18527
|
|
|
18478
|
-
export { ALLOWANCE_CHECK_CODES, APPROVE_CODES, type ActivateStellarAccountParams, type ActivateStellarAccountResult, type AggregatedReserveData, type AllowanceCheckErrorCode, type AllowanceInfo, type AllowanceResponse, type AllowanceTransferDetails, type AnalyticsActionData, type ApiResponse, type ApprovalTxs, type ApproveErrorCode, type ApyRange, type AssetDepositAction, type AssetEntry, AssetService, type AssetServiceConstructorParams, type AssetWithdrawAction, type AutoSwapPreferences, BackendApiService, BackendHttpError, type BalnLockParams, type BalnMigrateAction, type BalnMigrateParams, type BalnSwapAbi, BalnSwapService, type BalnSwapServiceConstructorParams, type BaseCurrencyInfo, BigIntToHex, type BigNumberValue, BigNumberZeroDecimal, type BitcoinBoundExtras, BitcoinSpokeService, type BitcoinTransactionResult, type BitcoinUTXO, BnUSDMigrationService, type BnUSDMigrationServiceConstructorParams, type BnUSDRevertMigrationParams, type BorrowInfo, type BridgeAction, type BridgeAllowanceCheckError, type BridgeAllowanceCheckErrorCode, BridgeApiService, type BridgeApproveError, type BridgeApproveErrorCode, type BridgeCreateIntentError, type BridgeCreateIntentErrorCode, type BridgeError, type BridgeErrorCode, type BridgeExtras, type BridgeLookupError, type BridgeLookupErrorCode, type BridgeOrchestrationError, type BridgeOrchestrationErrorCode, type BridgeParams, BridgeService, type BridgeServiceConstructorParams, type BtcPayload, CREATE_INTENT_CODES, type CalculateAllReserveIncentivesRequest, type CalculateAllUserIncentivesRequest, type CalculateCompoundedRateRequest, type CallResponse, type CancelIntentActionParams, type CancelIntentParams, type CancelUnstakeAction, type CancelUnstakeParams, type ClClaimRewardsParams, type ClDecreaseLiquidityParams, type ClGetPoolDataParams, type ClIncreaseLiquidityParams, type ClLiquidityClaimRewardsAction, type ClLiquidityDecreaseLiquidityAction, type ClLiquidityIncreaseLiquidityAction, type ClLiquidityWithdrawAction, type ClMintPositionEventLog, type ClPositionInfo, ClService, type ClServiceConstructorParams, type ClSupplyAction, type ClSupplyParams, type ClWithdrawParams, type ClaimAction, type ClaimParams, type CombinedReserveData, type ComputedUserReserve, type ConcentratedLiquidityParams, type ConcentratedLiquidityTokenInfo, ConfigService, type ConfigServiceConstructorParams, type ConnMsg, type CreateAssetDepositParams, type CreateAssetWithdrawParams, type CreateBridgeIntentParams, type CreateIntentErrorCode, type CreateIntentParams, type CreateIntentResult, type CreateLimitOrderParams, type CreateSonicSwapIntentParams, type CreateVaultIntentResult, type CreateViemPublicClientParams, CustomSorobanServer, CustomStellarAccount, type DepositParams, type DepositSimulationParams, type DestinationParamsType, type DetailedLock, type DexApproveError, type DexApproveErrorCode, type DexCreateIntentError, type DexCreateIntentErrorCode, type DexError, type DexErrorCode, DexService, type DexServiceConstructorParams, type EModeCategory, type EModeCategoryHumanized, type EModeData, type EModeDataString, type EmodeDataHumanized, type EnrichedToken, type Erc20ApprovalPlan, type Erc20ApprovalPlanReason, type Erc20ApproveParams, type Erc20GetAllowanceParams, type Erc20IsAllowanceParams, type Erc20PlanApprovalParams, Erc20Service, type Erc20Token, Erc4626Service, type EstimateGasParams, EvmAssetManagerService, type EvmDepositToDataParams, EvmHubProvider, type EvmHubProviderConstructorParams, EvmSolverService, EvmSpokeService, EvmVaultTokenService, type EvmWithdrawAssetDataParams, type ExecuteMsg, type FeatureInvariant, type FeeData, type FeeTokenApproveAction, type FeeTokenApproveParams, type FetchHubAssetBalancesParams, type FormatReserveRequest, type FormatReserveResponse, type FormatReserveUSDRequest, type FormatReserveUSDResponse, type FormatReservesAndIncentivesUSDRequest, type FormatReservesUSDRequest, type FormatUserSummaryAndIncentivesRequest, type FormatUserSummaryAndIncentivesResponse, type FormatUserSummaryRequest, type FormatUserSummaryResponse, type FormattedReserveEMode, GAS_ESTIMATION_CODES, type GasEstimationErrorCode, type GetDepositParams, type GetIntentSubmitTxExtraDataParams, type GetPacketParams, type GetPacketResponse, type GetQuoteParams, type GetRelayRequestParamType, type GetRelayResponse, type GetSpokeServiceType, type GetTransactionPacketsParams, type GetTransactionPacketsResponse, type GetTxReceiptType, type GetUserIntentParams, type GetUserRouterParams, HALF_RAY, HALF_WAD, type HanaWalletRequestEvent, type HanaWalletResponseEvent, type HookRequest, HookService, HttpRelayError, type HubAssetBalance, type HubProvider, type IconJsonRpcVersion, IconSpokeService, type IcxCreateRevertMigrationParams, type IcxMigrateAction, type IcxMigrateParams, IcxMigrationService, type IcxMigrationServiceConstructorParams, type IcxRevertMigrationAction, type IcxRevertMigrationParams, type IncentiveDataHumanized, type InjTokenInfo, Injective20Token, type InjectiveBalance, InjectiveSpokeService, type InstantUnstakeAction, type InstantUnstakeParams, type InstantiateMsg, type Intent, type IntentAutoSwapResult, IntentCreatedEventAbi, type IntentCreatedEventLog, type IntentData, IntentDataService, IntentDataType, type IntentDeliveryInfo, IntentFilledEventAbi, type IntentFilledEventLog, type IntentRelayRequest, type IntentRelayRequestParams, type IntentResponse, type IntentState, type IntentTxResult, IntentsAbi, type JsonRpcPayloadResponse, LOOKUP_CODES, LTV_PRECISION, LendingPoolService, type LendingPoolServiceConstructorParams, type LeverageYieldAction, type LeverageYieldAllowanceCheckError, type LeverageYieldAllowanceCheckErrorCode, type LeverageYieldAllowanceParams, type LeverageYieldApproveError, type LeverageYieldApproveErrorCode, type LeverageYieldApproveParams, type LeverageYieldApr, type LeverageYieldCreateIntentError, type LeverageYieldCreateIntentErrorCode, type LeverageYieldEffectiveApr, type LeverageYieldError, type LeverageYieldErrorCode, type LeverageYieldLookupError, type LeverageYieldLookupErrorCode, type LeverageYieldLsdApr, type LeverageYieldPosition, type LeverageYieldPostExecutionError, type LeverageYieldPostExecutionErrorCode, type LeverageYieldQuoteParams, LeverageYieldService, type LeverageYieldServiceConstructorParams, type LeverageYieldSwapDepositParams, type LeverageYieldSwapError, type LeverageYieldSwapErrorCode, type LeverageYieldSwapPayload, type LeverageYieldSwapWithdrawParams, type LimitOrderActionParams, LockupMultiplier, LockupPeriod, type LookupErrorCode, type MapRelayFailureCtx, type MigrateOrchestrationError, type MigrateOrchestrationErrorCode, type MigrationAction, type MigrationAllowanceCheckError, type MigrationAllowanceCheckErrorCode, type MigrationApproveError, type MigrationApproveErrorCode, type MigrationCreateIntentError, type MigrationCreateIntentErrorCode, type MigrationDirection, type MigrationError, type MigrationErrorCode, type MigrationLookupError, type MigrationLookupErrorCode, type MigrationOp, type MigrationParams, type MigrationRevertParams, MigrationService, type MigrationServiceConstructorParams, type MigrationTokens, MintPositionEventAbi, type MintPositionEventLog, type MoneyMarketAction, type MoneyMarketAllowanceCheckError, type MoneyMarketAllowanceCheckErrorCode, type MoneyMarketAllowanceParams, type MoneyMarketApproveActionParams, type MoneyMarketApproveError, type MoneyMarketApproveErrorCode, type MoneyMarketAsset, type MoneyMarketAssetBorrowers, type MoneyMarketAssetSuppliers, type MoneyMarketBorrowActionParams, type MoneyMarketBorrowParams, type MoneyMarketBorrowers, type MoneyMarketCreateIntentError, type MoneyMarketCreateIntentErrorCode, MoneyMarketDataService, type MoneyMarketDataServiceConstructorParams, type MoneyMarketEncodeBorrowParams, type MoneyMarketEncodeRepayParams, type MoneyMarketEncodeRepayWithATokensParams, type MoneyMarketEncodeSupplyParams, type MoneyMarketEncodeWithdrawParams, type MoneyMarketError, type MoneyMarketErrorCode, type MoneyMarketGasEstimationError, type MoneyMarketGasEstimationErrorCode, type MoneyMarketOrchestrationError, type MoneyMarketOrchestrationErrorCode, type MoneyMarketParams, type MoneyMarketPosition, type MoneyMarketRepayActionParams, type MoneyMarketRepayParams, MoneyMarketService, type MoneyMarketServiceConstructorParams, type MoneyMarketSupplyActionParams, type MoneyMarketSupplyParams, type MoneyMarketWithdrawActionParams, type MoneyMarketWithdrawParams, NEAR_DEFAULT_GAS, NEAR_STORAGE_DEPOSIT, NearSpokeService, type OnDemandBtcPayload, type OnDemandRelayData, type OptionalRaw, type OptionalSkipSimulation, type OptionalTimeout, type OrderbookResponse, type PacketData, type PartnerAction, type PartnerError, type PartnerErrorCode, type PartnerFeeClaimAssetBalance, type PartnerFeeClaimCancelAction, type PartnerFeeClaimCancelParams, PartnerFeeClaimService, type PartnerFeeClaimServiceConstructorParams, type PartnerFeeClaimSwapAction, type PartnerFeeClaimSwapParams, PartnerService, type PartnerServiceConfig, type PartnerServiceConstructorParams, Permit2Service, type PermitBatch, type PermitDetails, type PermitSingle, type PoolBaseCurrencyHumanized, type PoolData, type PoolRewardConfig, type PoolSpokeAssets, type PostExecutionError, type PostExecutionErrorCode, ProtocolIntentsAbi, type QueryMsg, type QueryResponse, RAY, RAY_DECIMALS, RELAY_ERROR_CODES, RELAY_FALLBACK_FLOOR_MS, RadfiApiError, type RadfiAuthResult, type RadfiBuildTxResponse, type RadfiErrorBody, type RadfiMaxSpentResponse, RadfiProvider, type RadfiProviderOptions, type RadfiResponseEnvelope, type RadfiTradingWallet, type RadfiUtxo, type RadfiUtxoListResponse, type RadfiWalletBalance, type RateLimitConfig, type RawDestinationParams, type RecoveryAction, type RecoveryError, type RecoveryErrorCode, RecoveryService, type RecoveryServiceConstructorParams, type RelayAction, type RelayAndWaitParams, type RelayCode, type RelayErrorCode, type RelayExtraData, type RelayRequestDetail, type RelayRequestSigning, type RelayTxStatus, type RelayWrappedErrorCode, type RequestConfig, type RequestOverrideConfig, type RequestTrustlineParams, type ReserveCalculationData, type ReserveData, type ReserveDataHumanized, type ReserveDataLegacy, type ReserveDataWithPrice, type ReserveEMode, type ReserveIncentiveDict, type ReservesDataHumanized, type ReservesIncentiveDataHumanized, type ResolvedAnalytics, type ResponseAddressType, type ResponseSigningType, type RevertMigrationOrchestrationError, type RevertMigrationOrchestrationErrorCode, type RewardInfoHumanized, SECONDS_PER_YEAR, SODAX_ERROR_CODES, SODAX_FEATURES, SPONSOR_CONFIG_TTL_MS, STELLAR_BASE_RESERVE_TTL_MS, STELLAR_TRUSTLINE_MIN_XLM_STROOPS, type SendMessageParams, type SetSwapPreferenceAction, type SetSwapPreferenceParams, Sodax, SodaxError, type SodaxErrorCode, type SodaxErrorContext, type SodaxErrorJSON, type SodaxPhase, SolanaSpokeService, SolverApiService, SonicSpokeService, type SpokeApproveParams, type SpokeApproveParamsEvmSpoke, type SpokeApproveParamsHub, type SpokeApproveParamsStellar, type SpokeIsAllowanceValidParams, type SpokeIsAllowanceValidParamsEvmSpoke, type SpokeIsAllowanceValidParamsHub, type SpokeIsAllowanceValidParamsOther, type SpokeIsAllowanceValidParamsStellar, SpokeService, type SpokeServiceConstructorParams, type SpokeServiceType, type SponsorFailureAction, type SponsorFailureClass, type SponsoringAction, SponsoringApiService, type SponsoringConfigError, type SponsoringConfigErrorCode, type SponsoringLookupError, type SponsoringLookupErrorCode, type SponsoringOrchestrationError, type SponsoringOrchestrationErrorCode, SponsoringService, StacksSpokeService, type StakeAction, type StakeOrchestrationError, type StakeOrchestrationErrorCode, type StakeParams, type StakingActionType, type StakingActionUnion, type StakingAllowanceCheckError, type StakingAllowanceCheckErrorCode, type StakingApproveError, type StakingApproveErrorCode, type StakingConfig, type StakingCreateIntentError, type StakingCreateIntentErrorCode, type StakingError, type StakingErrorCode, type StakingInfo, type StakingInfoFetchError, type StakingInfoFetchErrorCode, StakingLogic, type StakingOrchestrationError, type StakingOrchestrationErrorCode, type StakingParamsUnion, StakingService, type StakingServiceConstructorParams, type State, type StellarAccountStatus, StellarSpokeService, type SubmitTxParams, type SubmitTxResponse, SuiSpokeService, SupportedMigrationTokens, type SwapAction, type SwapActionParams, type SwapCreateIntentError, type SwapCreateIntentErrorCode, type SwapError, type SwapErrorCode, type SwapExtras, type SwapResponse, SwapService, type SwapServiceConstructorParams, SwapsApiService, type TokenSpenderPair, type TokenWithConversion, type TxHashPair, type TxStatus, USD_DECIMALS, type UiPoolDataProviderInterface, UiPoolDataProviderService, type UiPoolDataProviderServiceConstructorParams, type UnifiedBnUSDMigrateAction, type UnifiedBnUSDMigrateParams, type UnstakeAction, type UnstakeParams, type UnstakeRequest, type UnstakeRequestWithPenalty, type UnstakingInfo, type UserIncentiveData, type UserIncentiveDataHumanized, type UserIncentiveDict, type UserIntentsResponse, type UserReserveCalculationData, type UserReserveData, type UserReserveDataHumanized, type UserReserveDataString, type UserReservesIncentivesDataHumanized, type UserRewardInfoHumanized, type VaultSwapActionParams, type VaultSwapResponse, type VerifySimulationParams, type VerifyTxHashParams, WAD, WAD_RAY_RATIO, WEI_DECIMALS, type WaitForTxReceiptParams, type WaitForTxReceiptReturnType, type WaitUntilIntentExecutedPayload, type WalletMode, type WalletSimulationParams, type WithdrawHubAssetAction, type WithdrawHubAssetParams, type WithdrawInfo, adjustAmountByFee, allowanceCheckFailed, approveFailed, assetManagerAbi, balnSwapAbi, binomialApproximatedRayPow, bridgeInvariant, calcOpReturnOutputVbytes, calculateAllReserveIncentives, calculateAllUserIncentives, calculateAvailableBorrowsMarketReferenceCurrency, calculateCompoundedInterest, calculateCompoundedRate, calculateFeeAmount, calculateHealthFactorFromBalances, calculateHealthFactorFromBalancesBigUnits, calculateLinearInterest, calculatePercentageFeeAmount, clPoolAbi, clPoolManagerAbi, clPositionManagerAbi, clQuoterAbi, clRouterAbi, clTickLensAbi, classifySponsorError, connectionAbi, consoleLogger, convertTransactionInstructionToRaw, createInvariant, deepMerge, defaultHookAbi, dexInvariant, encodeAddress, encodeBtcPayloadToBytes, encodeContractCalls, erc20Abi, erc4626Abi, estimateBitcoinTxSize, executionFailed, formatBasisPoints, formatEModeCategory, formatEModes, formatPercentage, formatReserve, formatReserveUSD, formatReserves, formatReservesAndIncentives, formatUserSummary, formatUserSummaryAndIncentives, gasEstimationFailed, getAndFormatReserveEModes, getAssetManagerIdl, getAssetManagerProgram, getCompoundedBalance, getConnectionIdl, getConnectionProgram, getEvmViemChain, getIconAddressBytes, getLinearBalance, getMarketReferenceCurrencyAndUsdBalance, getPacket, getProvider, getRandomBytes, getReserveNormalizedIncome, getReservesEModes, getSolanaAddressBytes, getTransactionPackets, hexToBigInt, hexToSolanaAddress, hyper, intentCreationFailed, isBackendHttpError, isBalnMigrateParams, isBitcoinChainKeyType, isBitcoinWalletProviderType, isBridgeAllowanceCheckError, isBridgeApproveError, isBridgeCreateIntentError, isBridgeError, isBridgeLookupError, isBridgeOrchestrationError, isCodeMember, isDexApproveError, isDexCreateIntentError, isDexError, isEvmChainKeyType, isEvmSpokeChainConfig, isEvmSpokeOnlyChainKeyType, isEvmWalletProviderType, isFeatureError, isHubChainKeyType, isIconAddress, isIconChainKeyType, isIcxCreateRevertMigrationParams, isIcxMigrateParams, isInjectiveChainKeyType, isJsonRpcPayloadResponse, isLeverageYieldAllowanceCheckError, isLeverageYieldApproveError, isLeverageYieldCreateIntentError, isLeverageYieldError, isLeverageYieldLookupError, isLeverageYieldPostExecutionError, isLeverageYieldSwapError, isMigrateOrchestrationError, isMigrationAllowanceCheckError, isMigrationApproveError, isMigrationCreateIntentError, isMigrationError, isMigrationLookupError, isMoneyMarketAllowanceCheckError, isMoneyMarketApproveError, isMoneyMarketCreateIntentError, isMoneyMarketError, isMoneyMarketGasEstimationError, isMoneyMarketOrchestrationError, isNativeBitcoinTransfer, isNearChainKeyType, isOptionalBitcoinWalletProviderType, isOptionalEvmWalletProviderType, isOptionalStellarWalletProviderType, isPartnerError, isPartnerFeeAmount, isPartnerFeePercentage, isPostExecutionError, isRawDestinationParams, isRecoveryError, isResponseAddressType, isResponseSigningType, isRevertMigrationOrchestrationError, isSodaxError, isSolanaChainKeyType, isSolanaNativeToken, isSonicChainKeyType, isSpokeApproveParamsEvmSpoke, isSpokeApproveParamsHub, isSpokeApproveParamsStellar, isSpokeIsAllowanceValidParamsEvmSpoke, isSpokeIsAllowanceValidParamsHub, isSpokeIsAllowanceValidParamsStellar, isSponsoringConfigError, isSponsoringLookupError, isSponsoringOrchestrationError, isStacksChainKeyType, isStakeOrchestrationError, isStakingAllowanceCheckError, isStakingApproveError, isStakingCreateIntentError, isStakingError, isStakingInfoFetchError, isStakingOrchestrationError, isStellarChainKeyType, isStellarWalletProviderType, isSuiChainKeyType, isSwapCreateIntentError, isSwapError, isUndefinedOrValidWalletProviderForChainKey, isUnifiedBnUSDMigrateParams, leverageYieldInvariant, lookupFailed, mapRelayFailure, mergeSodaxConfig, messageOf, migrationInvariant, mintPositionParamsAbi, mmInvariant, modifyLiquidityParamsAbi, nativeToUSD, noopAnalytics, normalize, normalizeBN, normalizePsbtToBase64, normalizeSignatureToBase64, normalizedToUsd, pancakeSwapInfinityDefaultHookAbi, pancakeSwapInfinityPoolManagerAbi, pancakeSwapInfinityPositionManagerAbi, parseToStroops, parseTokenArrayFromJson, partnerInvariant, permit2Abi, poolAbi, poolKeyAbi, randomUint256, rayDiv, rayMul, rayPow, rayToWad, recoveryInvariant, relayTxAndWaitPacket, requestAddress, requestJsonRpc, requestSigning, resolveAnalytics, resolveLogger, retry, reverseEncodeAddress, serializeAddressData, silentLogger, sleep, sodaxInvariant, sonicWalletFactoryAbi, spokeAssetManagerAbi, sponsoringInvariant, stakedSodaAbi, stakingInvariant, stakingRouterAbi, stataTokenFactoryAbi, submitTransaction, swapExactInSingleParamsAbi, swapInvariant, toCreateBridgeIntentParamsV2, uiPoolDataAbi, universalRouterAbi, unknownFailed, valueToBigNumber, valueToZDBigNumber, variableDebtTokenAbi, vaultTokenAbi, verifyFailed, wadToRay, waitForStacksTransaction, waitForTransactionReceipt, waitUntilIntentExecuted, walletFactoryAbi, wrappedSonicAbi };
|
|
18528
|
+
export { ALLOWANCE_CHECK_CODES, APPROVE_CODES, type ActivateStellarAccountParams, type ActivateStellarAccountResult, type AggregatedReserveData, type AllowanceCheckErrorCode, type AllowanceInfo, type AllowanceResponse, type AllowanceTransferDetails, type AnalyticsActionData, type ApiResponse, type ApprovalTxs, type ApproveErrorCode, type ApyRange, type AssetDepositAction, type AssetEntry, AssetService, type AssetServiceConstructorParams, type AssetWithdrawAction, type AutoSwapPreferences, BackendApiService, BackendHttpError, type BalnLockParams, type BalnMigrateAction, type BalnMigrateParams, type BalnSwapAbi, BalnSwapService, type BalnSwapServiceConstructorParams, type BaseCurrencyInfo, BigIntToHex, type BigNumberValue, BigNumberZeroDecimal, type BitcoinBoundExtras, BitcoinSpokeService, type BitcoinTransactionResult, type BitcoinUTXO, BnUSDMigrationService, type BnUSDMigrationServiceConstructorParams, type BnUSDRevertMigrationParams, type BorrowInfo, type BridgeAction, type BridgeAllowanceCheckError, type BridgeAllowanceCheckErrorCode, BridgeApiService, type BridgeApiServiceOptions, type BridgeApproveError, type BridgeApproveErrorCode, type BridgeCreateIntentError, type BridgeCreateIntentErrorCode, type BridgeError, type BridgeErrorCode, type BridgeExtras, type BridgeLookupError, type BridgeLookupErrorCode, type BridgeOrchestrationError, type BridgeOrchestrationErrorCode, type BridgeParams, BridgeService, type BridgeServiceConstructorParams, type BtcPayload, CREATE_INTENT_CODES, type CalculateAllReserveIncentivesRequest, type CalculateAllUserIncentivesRequest, type CalculateCompoundedRateRequest, type CallResponse, type CancelIntentActionParams, type CancelIntentParams, type CancelUnstakeAction, type CancelUnstakeParams, type ClClaimRewardsParams, type ClDecreaseLiquidityParams, type ClGetPoolDataParams, type ClIncreaseLiquidityParams, type ClLiquidityClaimRewardsAction, type ClLiquidityDecreaseLiquidityAction, type ClLiquidityIncreaseLiquidityAction, type ClLiquidityWithdrawAction, type ClMintPositionEventLog, type ClPositionInfo, ClService, type ClServiceConstructorParams, type ClSupplyAction, type ClSupplyParams, type ClWithdrawParams, type ClaimAction, type ClaimParams, type CombinedReserveData, type ComputedUserReserve, type ConcentratedLiquidityParams, type ConcentratedLiquidityTokenInfo, ConfigService, type ConfigServiceConstructorParams, type ConnMsg, type CreateAssetDepositParams, type CreateAssetWithdrawParams, type CreateBridgeIntentParams, type CreateIntentErrorCode, type CreateIntentParams, type CreateIntentResult, type CreateLimitOrderParams, type CreateSonicSwapIntentParams, type CreateVaultIntentResult, type CreateViemPublicClientParams, CustomSorobanServer, CustomStellarAccount, type DepositParams, type DepositSimulationParams, type DestinationParamsType, type DetailedLock, type DexApproveError, type DexApproveErrorCode, type DexCreateIntentError, type DexCreateIntentErrorCode, type DexError, type DexErrorCode, DexService, type DexServiceConstructorParams, type EModeCategory, type EModeCategoryHumanized, type EModeData, type EModeDataString, type EmodeDataHumanized, type EnrichedToken, type Erc20ApprovalPlan, type Erc20ApprovalPlanReason, type Erc20ApproveParams, type Erc20GetAllowanceParams, type Erc20IsAllowanceParams, type Erc20PlanApprovalParams, Erc20Service, type Erc20Token, Erc4626Service, type EstimateGasParams, EvmAssetManagerService, type EvmDepositToDataParams, EvmHubProvider, type EvmHubProviderConstructorParams, EvmSolverService, EvmSpokeService, EvmVaultTokenService, type EvmWithdrawAssetDataParams, type ExecuteMsg, type FeatureInvariant, type FeeData, type FeeTokenApproveAction, type FeeTokenApproveParams, type FetchHubAssetBalancesParams, type FormatReserveRequest, type FormatReserveResponse, type FormatReserveUSDRequest, type FormatReserveUSDResponse, type FormatReservesAndIncentivesUSDRequest, type FormatReservesUSDRequest, type FormatUserSummaryAndIncentivesRequest, type FormatUserSummaryAndIncentivesResponse, type FormatUserSummaryRequest, type FormatUserSummaryResponse, type FormattedReserveEMode, GAS_ESTIMATION_CODES, type GasEstimationErrorCode, type GetDepositParams, type GetIntentSubmitTxExtraDataParams, type GetPacketParams, type GetPacketResponse, type GetQuoteParams, type GetRelayRequestParamType, type GetRelayResponse, type GetSpokeServiceType, type GetTransactionPacketsParams, type GetTransactionPacketsResponse, type GetTxReceiptType, type GetUserIntentParams, type GetUserRouterParams, HALF_RAY, HALF_WAD, type HanaWalletRequestEvent, type HanaWalletResponseEvent, type HookRequest, HookService, HttpRelayError, type HubAssetBalance, type HubProvider, type IconJsonRpcVersion, IconSpokeService, type IcxCreateRevertMigrationParams, type IcxMigrateAction, type IcxMigrateParams, IcxMigrationService, type IcxMigrationServiceConstructorParams, type IcxRevertMigrationAction, type IcxRevertMigrationParams, type IncentiveDataHumanized, type InjTokenInfo, Injective20Token, type InjectiveBalance, InjectiveSpokeService, type InstantUnstakeAction, type InstantUnstakeParams, type InstantiateMsg, type Intent, type IntentAutoSwapResult, IntentCreatedEventAbi, type IntentCreatedEventLog, type IntentData, IntentDataService, IntentDataType, type IntentDeliveryInfo, IntentFilledEventAbi, type IntentFilledEventLog, type IntentRelayRequest, type IntentRelayRequestParams, type IntentResponse, type IntentState, type IntentTxResult, IntentsAbi, type JsonRpcPayloadResponse, LOOKUP_CODES, LTV_PRECISION, LendingPoolService, type LendingPoolServiceConstructorParams, type LeverageYieldAction, type LeverageYieldAllowanceCheckError, type LeverageYieldAllowanceCheckErrorCode, type LeverageYieldAllowanceParams, type LeverageYieldApproveError, type LeverageYieldApproveErrorCode, type LeverageYieldApproveParams, type LeverageYieldApr, type LeverageYieldCreateIntentError, type LeverageYieldCreateIntentErrorCode, type LeverageYieldEffectiveApr, type LeverageYieldError, type LeverageYieldErrorCode, type LeverageYieldLookupError, type LeverageYieldLookupErrorCode, type LeverageYieldLsdApr, type LeverageYieldPosition, type LeverageYieldPostExecutionError, type LeverageYieldPostExecutionErrorCode, type LeverageYieldQuoteParams, LeverageYieldService, type LeverageYieldServiceConstructorParams, type LeverageYieldSwapDepositParams, type LeverageYieldSwapError, type LeverageYieldSwapErrorCode, type LeverageYieldSwapPayload, type LeverageYieldSwapWithdrawParams, type LimitOrderActionParams, LockupMultiplier, LockupPeriod, type LookupErrorCode, type MapRelayFailureCtx, type MigrateOrchestrationError, type MigrateOrchestrationErrorCode, type MigrationAction, type MigrationAllowanceCheckError, type MigrationAllowanceCheckErrorCode, type MigrationApproveError, type MigrationApproveErrorCode, type MigrationCreateIntentError, type MigrationCreateIntentErrorCode, type MigrationDirection, type MigrationError, type MigrationErrorCode, type MigrationLookupError, type MigrationLookupErrorCode, type MigrationOp, type MigrationParams, type MigrationRevertParams, MigrationService, type MigrationServiceConstructorParams, type MigrationTokens, MintPositionEventAbi, type MintPositionEventLog, type MoneyMarketAction, type MoneyMarketAllowanceCheckError, type MoneyMarketAllowanceCheckErrorCode, type MoneyMarketAllowanceParams, type MoneyMarketApproveActionParams, type MoneyMarketApproveError, type MoneyMarketApproveErrorCode, type MoneyMarketAsset, type MoneyMarketAssetBorrowers, type MoneyMarketAssetSuppliers, type MoneyMarketBorrowActionParams, type MoneyMarketBorrowParams, type MoneyMarketBorrowers, type MoneyMarketCreateIntentError, type MoneyMarketCreateIntentErrorCode, MoneyMarketDataService, type MoneyMarketDataServiceConstructorParams, type MoneyMarketEncodeBorrowParams, type MoneyMarketEncodeRepayParams, type MoneyMarketEncodeRepayWithATokensParams, type MoneyMarketEncodeSupplyParams, type MoneyMarketEncodeWithdrawParams, type MoneyMarketError, type MoneyMarketErrorCode, type MoneyMarketGasEstimationError, type MoneyMarketGasEstimationErrorCode, type MoneyMarketOrchestrationError, type MoneyMarketOrchestrationErrorCode, type MoneyMarketParams, type MoneyMarketPosition, type MoneyMarketRepayActionParams, type MoneyMarketRepayParams, MoneyMarketService, type MoneyMarketServiceConstructorParams, type MoneyMarketSupplyActionParams, type MoneyMarketSupplyParams, type MoneyMarketWithdrawActionParams, type MoneyMarketWithdrawParams, NEAR_DEFAULT_GAS, NEAR_STORAGE_DEPOSIT, NearSpokeService, type OnDemandBtcPayload, type OnDemandRelayData, type OptionalRaw, type OptionalSkipSimulation, type OptionalTimeout, type OrderbookResponse, type PacketData, type PartnerAction, type PartnerError, type PartnerErrorCode, type PartnerFeeClaimAssetBalance, type PartnerFeeClaimCancelAction, type PartnerFeeClaimCancelParams, PartnerFeeClaimService, type PartnerFeeClaimServiceConstructorParams, type PartnerFeeClaimSwapAction, type PartnerFeeClaimSwapParams, PartnerService, type PartnerServiceConfig, type PartnerServiceConstructorParams, Permit2Service, type PermitBatch, type PermitDetails, type PermitSingle, type PoolBaseCurrencyHumanized, type PoolData, type PoolRewardConfig, type PoolSpokeAssets, type PostExecutionError, type PostExecutionErrorCode, ProtocolIntentsAbi, type QueryMsg, type QueryResponse, RAY, RAY_DECIMALS, RELAY_ERROR_CODES, RELAY_FALLBACK_FLOOR_MS, RadfiApiError, type RadfiAuthResult, type RadfiBuildTxResponse, type RadfiErrorBody, type RadfiMaxSpentResponse, RadfiProvider, type RadfiProviderOptions, type RadfiResponseEnvelope, type RadfiTradingWallet, type RadfiUtxo, type RadfiUtxoListResponse, type RadfiWalletBalance, type RateLimitConfig, type RawDestinationParams, type RecoveryAction, type RecoveryError, type RecoveryErrorCode, RecoveryService, type RecoveryServiceConstructorParams, type RelayAction, type RelayAndWaitParams, type RelayCode, type RelayErrorCode, type RelayExtraData, type RelayRequestDetail, type RelayRequestSigning, type RelayTxStatus, type RelayWrappedErrorCode, type RequestConfig, type RequestOverrideConfig, type RequestTrustlineParams, type ReserveCalculationData, type ReserveData, type ReserveDataHumanized, type ReserveDataLegacy, type ReserveDataWithPrice, type ReserveEMode, type ReserveIncentiveDict, type ReservesDataHumanized, type ReservesIncentiveDataHumanized, type ResolvedAnalytics, type ResponseAddressType, type ResponseSigningType, type RevertMigrationOrchestrationError, type RevertMigrationOrchestrationErrorCode, type RewardInfoHumanized, SECONDS_PER_YEAR, SODAX_ERROR_CODES, SODAX_FEATURES, SPONSOR_CONFIG_TTL_MS, STELLAR_BASE_RESERVE_TTL_MS, STELLAR_TRUSTLINE_MIN_XLM_STROOPS, type SendMessageParams, type SetSwapPreferenceAction, type SetSwapPreferenceParams, Sodax, SodaxError, type SodaxErrorCode, type SodaxErrorContext, type SodaxErrorJSON, type SodaxPhase, SolanaSpokeService, SolverApiService, SonicSpokeService, type SpokeApproveParams, type SpokeApproveParamsEvmSpoke, type SpokeApproveParamsHub, type SpokeApproveParamsStellar, type SpokeIsAllowanceValidParams, type SpokeIsAllowanceValidParamsEvmSpoke, type SpokeIsAllowanceValidParamsHub, type SpokeIsAllowanceValidParamsOther, type SpokeIsAllowanceValidParamsStellar, SpokeService, type SpokeServiceConstructorParams, type SpokeServiceType, type SponsorFailureAction, type SponsorFailureClass, type SponsoringAction, SponsoringApiService, type SponsoringConfigError, type SponsoringConfigErrorCode, type SponsoringLookupError, type SponsoringLookupErrorCode, type SponsoringOrchestrationError, type SponsoringOrchestrationErrorCode, SponsoringService, StacksSpokeService, type StakeAction, type StakeOrchestrationError, type StakeOrchestrationErrorCode, type StakeParams, type StakingActionType, type StakingActionUnion, type StakingAllowanceCheckError, type StakingAllowanceCheckErrorCode, type StakingApproveError, type StakingApproveErrorCode, type StakingConfig, type StakingCreateIntentError, type StakingCreateIntentErrorCode, type StakingError, type StakingErrorCode, type StakingInfo, type StakingInfoFetchError, type StakingInfoFetchErrorCode, StakingLogic, type StakingOrchestrationError, type StakingOrchestrationErrorCode, type StakingParamsUnion, StakingService, type StakingServiceConstructorParams, type State, type StellarAccountStatus, StellarSpokeService, type SubmitTxParams, type SubmitTxResponse, SuiSpokeService, SupportedMigrationTokens, type SwapAction, type SwapActionParams, type SwapCreateIntentError, type SwapCreateIntentErrorCode, type SwapError, type SwapErrorCode, type SwapExtras, type SwapResponse, SwapService, type SwapServiceConstructorParams, SwapsApiService, type SwapsApiServiceOptions, type TokenSpenderPair, type TokenWithConversion, type TxHashPair, type TxStatus, USD_DECIMALS, type UiPoolDataProviderInterface, UiPoolDataProviderService, type UiPoolDataProviderServiceConstructorParams, type UnifiedBnUSDMigrateAction, type UnifiedBnUSDMigrateParams, type UnstakeAction, type UnstakeParams, type UnstakeRequest, type UnstakeRequestWithPenalty, type UnstakingInfo, type UserIncentiveData, type UserIncentiveDataHumanized, type UserIncentiveDict, type UserIntentsResponse, type UserReserveCalculationData, type UserReserveData, type UserReserveDataHumanized, type UserReserveDataString, type UserReservesIncentivesDataHumanized, type UserRewardInfoHumanized, type VaultSwapActionParams, type VaultSwapResponse, type VerifySimulationParams, type VerifyTxHashParams, WAD, WAD_RAY_RATIO, WEI_DECIMALS, type WaitForTxReceiptParams, type WaitForTxReceiptReturnType, type WaitUntilIntentExecutedPayload, type WalletMode, type WalletSimulationParams, type WithdrawHubAssetAction, type WithdrawHubAssetParams, type WithdrawInfo, adjustAmountByFee, allowanceCheckFailed, approveFailed, assetManagerAbi, balnSwapAbi, binomialApproximatedRayPow, bridgeInvariant, calcOpReturnOutputVbytes, calculateAllReserveIncentives, calculateAllUserIncentives, calculateAvailableBorrowsMarketReferenceCurrency, calculateCompoundedInterest, calculateCompoundedRate, calculateFeeAmount, calculateHealthFactorFromBalances, calculateHealthFactorFromBalancesBigUnits, calculateLinearInterest, calculatePercentageFeeAmount, clPoolAbi, clPoolManagerAbi, clPositionManagerAbi, clQuoterAbi, clRouterAbi, clTickLensAbi, classifySponsorError, connectionAbi, consoleLogger, convertTransactionInstructionToRaw, createInvariant, deepMerge, defaultHookAbi, dexInvariant, encodeAddress, encodeBtcPayloadToBytes, encodeContractCalls, erc20Abi, erc4626Abi, estimateBitcoinTxSize, executionFailed, formatBasisPoints, formatEModeCategory, formatEModes, formatPercentage, formatReserve, formatReserveUSD, formatReserves, formatReservesAndIncentives, formatUserSummary, formatUserSummaryAndIncentives, gasEstimationFailed, getAndFormatReserveEModes, getAssetManagerIdl, getAssetManagerProgram, getCompoundedBalance, getConnectionIdl, getConnectionProgram, getEvmViemChain, getIconAddressBytes, getLinearBalance, getMarketReferenceCurrencyAndUsdBalance, getPacket, getProvider, getRandomBytes, getReserveNormalizedIncome, getReservesEModes, getSolanaAddressBytes, getTransactionPackets, hexToBigInt, hexToSolanaAddress, hyper, intentCreationFailed, isBackendHttpError, isBalnMigrateParams, isBitcoinChainKeyType, isBitcoinWalletProviderType, isBridgeAllowanceCheckError, isBridgeApproveError, isBridgeCreateIntentError, isBridgeError, isBridgeLookupError, isBridgeOrchestrationError, isCodeMember, isDexApproveError, isDexCreateIntentError, isDexError, isEvmChainKeyType, isEvmSpokeChainConfig, isEvmSpokeOnlyChainKeyType, isEvmWalletProviderType, isFeatureError, isHubChainKeyType, isIconAddress, isIconChainKeyType, isIcxCreateRevertMigrationParams, isIcxMigrateParams, isInjectiveChainKeyType, isJsonRpcPayloadResponse, isLeverageYieldAllowanceCheckError, isLeverageYieldApproveError, isLeverageYieldCreateIntentError, isLeverageYieldError, isLeverageYieldLookupError, isLeverageYieldPostExecutionError, isLeverageYieldSwapError, isMigrateOrchestrationError, isMigrationAllowanceCheckError, isMigrationApproveError, isMigrationCreateIntentError, isMigrationError, isMigrationLookupError, isMoneyMarketAllowanceCheckError, isMoneyMarketApproveError, isMoneyMarketCreateIntentError, isMoneyMarketError, isMoneyMarketGasEstimationError, isMoneyMarketOrchestrationError, isNativeBitcoinTransfer, isNearChainKeyType, isOptionalBitcoinWalletProviderType, isOptionalEvmWalletProviderType, isOptionalStellarWalletProviderType, isPartnerError, isPartnerFeeAmount, isPartnerFeePercentage, isPostExecutionError, isRawDestinationParams, isRecoveryError, isResponseAddressType, isResponseSigningType, isRevertMigrationOrchestrationError, isSodaxError, isSolanaChainKeyType, isSolanaNativeToken, isSonicChainKeyType, isSpokeApproveParamsEvmSpoke, isSpokeApproveParamsHub, isSpokeApproveParamsStellar, isSpokeIsAllowanceValidParamsEvmSpoke, isSpokeIsAllowanceValidParamsHub, isSpokeIsAllowanceValidParamsStellar, isSponsoringConfigError, isSponsoringLookupError, isSponsoringOrchestrationError, isStacksChainKeyType, isStakeOrchestrationError, isStakingAllowanceCheckError, isStakingApproveError, isStakingCreateIntentError, isStakingError, isStakingInfoFetchError, isStakingOrchestrationError, isStellarChainKeyType, isStellarWalletProviderType, isSuiChainKeyType, isSwapCreateIntentError, isSwapError, isUndefinedOrValidWalletProviderForChainKey, isUnifiedBnUSDMigrateParams, leverageYieldInvariant, lookupFailed, mapRelayFailure, mergeSodaxConfig, messageOf, migrationInvariant, mintPositionParamsAbi, mmInvariant, modifyLiquidityParamsAbi, nativeToUSD, noopAnalytics, normalize, normalizeBN, normalizePsbtToBase64, normalizeSignatureToBase64, normalizedToUsd, pancakeSwapInfinityDefaultHookAbi, pancakeSwapInfinityPoolManagerAbi, pancakeSwapInfinityPositionManagerAbi, parseToStroops, parseTokenArrayFromJson, partnerInvariant, permit2Abi, poolAbi, poolKeyAbi, randomUint256, rayDiv, rayMul, rayPow, rayToWad, recoveryInvariant, relayTxAndWaitPacket, requestAddress, requestJsonRpc, requestSigning, resolveAnalytics, resolveLogger, retry, reverseEncodeAddress, serializeAddressData, silentLogger, sleep, sodaxInvariant, sonicWalletFactoryAbi, spokeAssetManagerAbi, sponsoringInvariant, stakedSodaAbi, stakingInvariant, stakingRouterAbi, stataTokenFactoryAbi, submitTransaction, swapExactInSingleParamsAbi, swapInvariant, toCreateBridgeIntentParamsV2, uiPoolDataAbi, universalRouterAbi, unknownFailed, valueToBigNumber, valueToZDBigNumber, variableDebtTokenAbi, vaultTokenAbi, verifyFailed, wadToRay, waitForStacksTransaction, waitForTransactionReceipt, waitUntilIntentExecuted, walletFactoryAbi, wrappedSonicAbi };
|
package/dist/index.d.ts
CHANGED
|
@@ -7551,11 +7551,23 @@ type ResultifiedSwapsApiV2 = {
|
|
|
7551
7551
|
*
|
|
7552
7552
|
* Reachable on the Sodax facade as `sodax.api.swaps`.
|
|
7553
7553
|
*/
|
|
7554
|
+
/** Construction options for {@link SwapsApiService}. */
|
|
7555
|
+
type SwapsApiServiceOptions = {
|
|
7556
|
+
/**
|
|
7557
|
+
* Whether a legacy `/be` suffix is trimmed off a per-call `baseURL` override. Defaults to `true`, the
|
|
7558
|
+
* migration behaviour. `BackendApiService` passes `false` when the `ApiConfig` states a `basePath`
|
|
7559
|
+
* explicitly: that marks a config written against the current contract, whose base URLs are deliberate
|
|
7560
|
+
* roots, so a trailing `/be` is a real path segment rather than the data API's mount.
|
|
7561
|
+
*/
|
|
7562
|
+
trimLegacyOverrides?: boolean;
|
|
7563
|
+
};
|
|
7554
7564
|
declare class SwapsApiService implements ResultifiedSwapsApiV2 {
|
|
7555
7565
|
private readonly config;
|
|
7556
7566
|
private readonly headers;
|
|
7557
7567
|
private readonly logger;
|
|
7558
|
-
|
|
7568
|
+
/** See {@link SwapsApiServiceOptions.trimLegacyOverrides}. */
|
|
7569
|
+
private readonly trimsLegacyOverrides;
|
|
7570
|
+
constructor(config: SwapsApiConfig, logger?: SodaxLogger, options?: SwapsApiServiceOptions);
|
|
7559
7571
|
/**
|
|
7560
7572
|
* Build a `@sodax/swaps-api` client for a single call. Maps the SDK's `SwapsApiConfig`
|
|
7561
7573
|
* (`baseURL`/`timeout`/`headers`) to the package's config (`baseUrl`/`timeout`/`headers`), layering
|
|
@@ -7731,18 +7743,30 @@ declare function toCreateBridgeIntentParamsV2(params: {
|
|
|
7731
7743
|
* Per-call request overrides (base URL, timeout, headers) can be passed as the
|
|
7732
7744
|
* optional last argument to any method via `RequestOverrideConfig`.
|
|
7733
7745
|
*
|
|
7734
|
-
* The Bridge API
|
|
7735
|
-
*
|
|
7736
|
-
*
|
|
7746
|
+
* The Bridge API hangs off the shared gateway root as `/bridge/*` — a sibling of the data API's `/be`
|
|
7747
|
+
* mount, not a child of it, so `resolveBridgeApiConfig` returns a flat {@link BaseApiConfig} with no
|
|
7748
|
+
* `basePath`. It defaults to the same host as the swaps client but is not configured with it:
|
|
7737
7749
|
* a `swapsApiConfig` slice does not move the bridge routes; set `baseURL` / `baseApiConfig` instead.
|
|
7738
7750
|
*
|
|
7739
7751
|
* Reachable on the Sodax facade as `sodax.api.bridge`.
|
|
7740
7752
|
*/
|
|
7753
|
+
/** Construction options for {@link BridgeApiService}. */
|
|
7754
|
+
type BridgeApiServiceOptions = {
|
|
7755
|
+
/**
|
|
7756
|
+
* Whether a legacy `/be` suffix is trimmed off a per-call `baseURL` override. Defaults to `true`, the
|
|
7757
|
+
* migration behaviour. `BackendApiService` passes `false` when the `ApiConfig` states a `basePath`
|
|
7758
|
+
* explicitly: that marks a config written against the current contract, whose base URLs are deliberate
|
|
7759
|
+
* roots, so a trailing `/be` is a real path segment rather than the data API's mount.
|
|
7760
|
+
*/
|
|
7761
|
+
trimLegacyOverrides?: boolean;
|
|
7762
|
+
};
|
|
7741
7763
|
declare class BridgeApiService implements ResultifiedBridgeApiV2 {
|
|
7742
7764
|
private readonly config;
|
|
7743
7765
|
private readonly headers;
|
|
7744
7766
|
private readonly logger;
|
|
7745
|
-
|
|
7767
|
+
/** See {@link BridgeApiServiceOptions.trimLegacyOverrides}. */
|
|
7768
|
+
private readonly trimsLegacyOverrides;
|
|
7769
|
+
constructor(config: BaseApiConfig, logger?: SodaxLogger, options?: BridgeApiServiceOptions);
|
|
7746
7770
|
/**
|
|
7747
7771
|
* Issues a single HTTP request, validates the JSON body against `schema`, and
|
|
7748
7772
|
* wraps the result in `Result<T>`. The service-level `baseURL`/`timeout`/
|
|
@@ -7984,7 +8008,25 @@ declare class BackendApiService implements IConfigApiV1 {
|
|
|
7984
8008
|
private readonly config;
|
|
7985
8009
|
private readonly headers;
|
|
7986
8010
|
private readonly logger;
|
|
8011
|
+
/**
|
|
8012
|
+
* Whether a legacy `/be` suffix is trimmed off a per-call `baseURL` override. Mirrors the config-level
|
|
8013
|
+
* decision: an explicit `basePath` means the consumer writes complete roots, so their per-call value is
|
|
8014
|
+
* left exactly as given rather than having a real path segment eaten.
|
|
8015
|
+
*/
|
|
8016
|
+
private readonly trimsLegacyOverrides;
|
|
7987
8017
|
constructor(config: ApiConfig, logger?: SodaxLogger);
|
|
8018
|
+
/**
|
|
8019
|
+
* Issue the HTTP call for a route.
|
|
8020
|
+
*
|
|
8021
|
+
* The mount is applied here rather than at each route literal, so `error.context.endpoint` stays
|
|
8022
|
+
* route-relative and the mount survives a per-call `baseURL` override — that retargets the gateway
|
|
8023
|
+
* root, not which service the route belongs to. For the same reason an override is put through the
|
|
8024
|
+
* legacy-mount trim: without it, passing the old `…/v1/be` value per call would yield `/be/be/…`.
|
|
8025
|
+
*
|
|
8026
|
+
* Defaults are listed field by field so `basePath` cannot cross into `RequestConfig`, where it has no
|
|
8027
|
+
* meaning — a spread would pass it silently, since TypeScript skips excess-property checks on spreads.
|
|
8028
|
+
*/
|
|
8029
|
+
private send;
|
|
7988
8030
|
/**
|
|
7989
8031
|
* Issue a request and validate the JSON body against `schema`, wrapping the result in `Result<T>`.
|
|
7990
8032
|
* Mirrors {@link SwapsApiService}: a 2xx body that fails the schema is surfaced as
|
|
@@ -8224,18 +8266,26 @@ declare class BackendApiService implements IConfigApiV1 {
|
|
|
8224
8266
|
* without constructing a new service instance. Existing header keys are
|
|
8225
8267
|
* overwritten; keys absent from `headers` are preserved.
|
|
8226
8268
|
*
|
|
8227
|
-
* Headers also reach `swaps
|
|
8228
|
-
*
|
|
8269
|
+
* Headers also reach `swaps` and `bridge`, but never `sponsoring`: it is configured independently, so
|
|
8270
|
+
* base-API credentials must not be forwarded to whatever origin it points at. Note `swaps` can also be
|
|
8271
|
+
* retargeted to another origin via `swapsApiConfig`, in which case a header set here follows it.
|
|
8229
8272
|
*
|
|
8230
8273
|
* @param headers - Key-value pairs to add or overwrite in the default headers.
|
|
8231
8274
|
*/
|
|
8232
8275
|
setHeaders(headers: Record<string, string>): void;
|
|
8233
8276
|
/**
|
|
8234
|
-
* Return the
|
|
8277
|
+
* Return the gateway root the service is currently pointing at — WITHOUT this service's own mount.
|
|
8278
|
+
* Requests go to `getBaseURL() + getBasePath() + <route>`.
|
|
8235
8279
|
*
|
|
8236
|
-
* @returns The `baseURL` from the `ApiConfig` this instance was
|
|
8280
|
+
* @returns The resolved gateway root, i.e. the `baseURL` from the `ApiConfig` this instance was
|
|
8281
|
+
* constructed with, minus a legacy `/be` suffix if one was supplied.
|
|
8237
8282
|
*/
|
|
8238
8283
|
getBaseURL(): string;
|
|
8284
|
+
/**
|
|
8285
|
+
* Return the backend data API's mount below {@link getBaseURL} — `/be` by default, or whatever
|
|
8286
|
+
* `basePath` the `ApiConfig` supplied (`''` for a service addressed directly at its origin).
|
|
8287
|
+
*/
|
|
8288
|
+
getBasePath(): string;
|
|
8239
8289
|
}
|
|
8240
8290
|
|
|
8241
8291
|
/**
|
|
@@ -18475,4 +18525,4 @@ type DexApproveErrorCode = ApproveErrorCode;
|
|
|
18475
18525
|
type DexApproveError = SodaxError<DexApproveErrorCode>;
|
|
18476
18526
|
declare const isDexApproveError: (e: unknown) => e is SodaxError<ApproveErrorCode>;
|
|
18477
18527
|
|
|
18478
|
-
export { ALLOWANCE_CHECK_CODES, APPROVE_CODES, type ActivateStellarAccountParams, type ActivateStellarAccountResult, type AggregatedReserveData, type AllowanceCheckErrorCode, type AllowanceInfo, type AllowanceResponse, type AllowanceTransferDetails, type AnalyticsActionData, type ApiResponse, type ApprovalTxs, type ApproveErrorCode, type ApyRange, type AssetDepositAction, type AssetEntry, AssetService, type AssetServiceConstructorParams, type AssetWithdrawAction, type AutoSwapPreferences, BackendApiService, BackendHttpError, type BalnLockParams, type BalnMigrateAction, type BalnMigrateParams, type BalnSwapAbi, BalnSwapService, type BalnSwapServiceConstructorParams, type BaseCurrencyInfo, BigIntToHex, type BigNumberValue, BigNumberZeroDecimal, type BitcoinBoundExtras, BitcoinSpokeService, type BitcoinTransactionResult, type BitcoinUTXO, BnUSDMigrationService, type BnUSDMigrationServiceConstructorParams, type BnUSDRevertMigrationParams, type BorrowInfo, type BridgeAction, type BridgeAllowanceCheckError, type BridgeAllowanceCheckErrorCode, BridgeApiService, type BridgeApproveError, type BridgeApproveErrorCode, type BridgeCreateIntentError, type BridgeCreateIntentErrorCode, type BridgeError, type BridgeErrorCode, type BridgeExtras, type BridgeLookupError, type BridgeLookupErrorCode, type BridgeOrchestrationError, type BridgeOrchestrationErrorCode, type BridgeParams, BridgeService, type BridgeServiceConstructorParams, type BtcPayload, CREATE_INTENT_CODES, type CalculateAllReserveIncentivesRequest, type CalculateAllUserIncentivesRequest, type CalculateCompoundedRateRequest, type CallResponse, type CancelIntentActionParams, type CancelIntentParams, type CancelUnstakeAction, type CancelUnstakeParams, type ClClaimRewardsParams, type ClDecreaseLiquidityParams, type ClGetPoolDataParams, type ClIncreaseLiquidityParams, type ClLiquidityClaimRewardsAction, type ClLiquidityDecreaseLiquidityAction, type ClLiquidityIncreaseLiquidityAction, type ClLiquidityWithdrawAction, type ClMintPositionEventLog, type ClPositionInfo, ClService, type ClServiceConstructorParams, type ClSupplyAction, type ClSupplyParams, type ClWithdrawParams, type ClaimAction, type ClaimParams, type CombinedReserveData, type ComputedUserReserve, type ConcentratedLiquidityParams, type ConcentratedLiquidityTokenInfo, ConfigService, type ConfigServiceConstructorParams, type ConnMsg, type CreateAssetDepositParams, type CreateAssetWithdrawParams, type CreateBridgeIntentParams, type CreateIntentErrorCode, type CreateIntentParams, type CreateIntentResult, type CreateLimitOrderParams, type CreateSonicSwapIntentParams, type CreateVaultIntentResult, type CreateViemPublicClientParams, CustomSorobanServer, CustomStellarAccount, type DepositParams, type DepositSimulationParams, type DestinationParamsType, type DetailedLock, type DexApproveError, type DexApproveErrorCode, type DexCreateIntentError, type DexCreateIntentErrorCode, type DexError, type DexErrorCode, DexService, type DexServiceConstructorParams, type EModeCategory, type EModeCategoryHumanized, type EModeData, type EModeDataString, type EmodeDataHumanized, type EnrichedToken, type Erc20ApprovalPlan, type Erc20ApprovalPlanReason, type Erc20ApproveParams, type Erc20GetAllowanceParams, type Erc20IsAllowanceParams, type Erc20PlanApprovalParams, Erc20Service, type Erc20Token, Erc4626Service, type EstimateGasParams, EvmAssetManagerService, type EvmDepositToDataParams, EvmHubProvider, type EvmHubProviderConstructorParams, EvmSolverService, EvmSpokeService, EvmVaultTokenService, type EvmWithdrawAssetDataParams, type ExecuteMsg, type FeatureInvariant, type FeeData, type FeeTokenApproveAction, type FeeTokenApproveParams, type FetchHubAssetBalancesParams, type FormatReserveRequest, type FormatReserveResponse, type FormatReserveUSDRequest, type FormatReserveUSDResponse, type FormatReservesAndIncentivesUSDRequest, type FormatReservesUSDRequest, type FormatUserSummaryAndIncentivesRequest, type FormatUserSummaryAndIncentivesResponse, type FormatUserSummaryRequest, type FormatUserSummaryResponse, type FormattedReserveEMode, GAS_ESTIMATION_CODES, type GasEstimationErrorCode, type GetDepositParams, type GetIntentSubmitTxExtraDataParams, type GetPacketParams, type GetPacketResponse, type GetQuoteParams, type GetRelayRequestParamType, type GetRelayResponse, type GetSpokeServiceType, type GetTransactionPacketsParams, type GetTransactionPacketsResponse, type GetTxReceiptType, type GetUserIntentParams, type GetUserRouterParams, HALF_RAY, HALF_WAD, type HanaWalletRequestEvent, type HanaWalletResponseEvent, type HookRequest, HookService, HttpRelayError, type HubAssetBalance, type HubProvider, type IconJsonRpcVersion, IconSpokeService, type IcxCreateRevertMigrationParams, type IcxMigrateAction, type IcxMigrateParams, IcxMigrationService, type IcxMigrationServiceConstructorParams, type IcxRevertMigrationAction, type IcxRevertMigrationParams, type IncentiveDataHumanized, type InjTokenInfo, Injective20Token, type InjectiveBalance, InjectiveSpokeService, type InstantUnstakeAction, type InstantUnstakeParams, type InstantiateMsg, type Intent, type IntentAutoSwapResult, IntentCreatedEventAbi, type IntentCreatedEventLog, type IntentData, IntentDataService, IntentDataType, type IntentDeliveryInfo, IntentFilledEventAbi, type IntentFilledEventLog, type IntentRelayRequest, type IntentRelayRequestParams, type IntentResponse, type IntentState, type IntentTxResult, IntentsAbi, type JsonRpcPayloadResponse, LOOKUP_CODES, LTV_PRECISION, LendingPoolService, type LendingPoolServiceConstructorParams, type LeverageYieldAction, type LeverageYieldAllowanceCheckError, type LeverageYieldAllowanceCheckErrorCode, type LeverageYieldAllowanceParams, type LeverageYieldApproveError, type LeverageYieldApproveErrorCode, type LeverageYieldApproveParams, type LeverageYieldApr, type LeverageYieldCreateIntentError, type LeverageYieldCreateIntentErrorCode, type LeverageYieldEffectiveApr, type LeverageYieldError, type LeverageYieldErrorCode, type LeverageYieldLookupError, type LeverageYieldLookupErrorCode, type LeverageYieldLsdApr, type LeverageYieldPosition, type LeverageYieldPostExecutionError, type LeverageYieldPostExecutionErrorCode, type LeverageYieldQuoteParams, LeverageYieldService, type LeverageYieldServiceConstructorParams, type LeverageYieldSwapDepositParams, type LeverageYieldSwapError, type LeverageYieldSwapErrorCode, type LeverageYieldSwapPayload, type LeverageYieldSwapWithdrawParams, type LimitOrderActionParams, LockupMultiplier, LockupPeriod, type LookupErrorCode, type MapRelayFailureCtx, type MigrateOrchestrationError, type MigrateOrchestrationErrorCode, type MigrationAction, type MigrationAllowanceCheckError, type MigrationAllowanceCheckErrorCode, type MigrationApproveError, type MigrationApproveErrorCode, type MigrationCreateIntentError, type MigrationCreateIntentErrorCode, type MigrationDirection, type MigrationError, type MigrationErrorCode, type MigrationLookupError, type MigrationLookupErrorCode, type MigrationOp, type MigrationParams, type MigrationRevertParams, MigrationService, type MigrationServiceConstructorParams, type MigrationTokens, MintPositionEventAbi, type MintPositionEventLog, type MoneyMarketAction, type MoneyMarketAllowanceCheckError, type MoneyMarketAllowanceCheckErrorCode, type MoneyMarketAllowanceParams, type MoneyMarketApproveActionParams, type MoneyMarketApproveError, type MoneyMarketApproveErrorCode, type MoneyMarketAsset, type MoneyMarketAssetBorrowers, type MoneyMarketAssetSuppliers, type MoneyMarketBorrowActionParams, type MoneyMarketBorrowParams, type MoneyMarketBorrowers, type MoneyMarketCreateIntentError, type MoneyMarketCreateIntentErrorCode, MoneyMarketDataService, type MoneyMarketDataServiceConstructorParams, type MoneyMarketEncodeBorrowParams, type MoneyMarketEncodeRepayParams, type MoneyMarketEncodeRepayWithATokensParams, type MoneyMarketEncodeSupplyParams, type MoneyMarketEncodeWithdrawParams, type MoneyMarketError, type MoneyMarketErrorCode, type MoneyMarketGasEstimationError, type MoneyMarketGasEstimationErrorCode, type MoneyMarketOrchestrationError, type MoneyMarketOrchestrationErrorCode, type MoneyMarketParams, type MoneyMarketPosition, type MoneyMarketRepayActionParams, type MoneyMarketRepayParams, MoneyMarketService, type MoneyMarketServiceConstructorParams, type MoneyMarketSupplyActionParams, type MoneyMarketSupplyParams, type MoneyMarketWithdrawActionParams, type MoneyMarketWithdrawParams, NEAR_DEFAULT_GAS, NEAR_STORAGE_DEPOSIT, NearSpokeService, type OnDemandBtcPayload, type OnDemandRelayData, type OptionalRaw, type OptionalSkipSimulation, type OptionalTimeout, type OrderbookResponse, type PacketData, type PartnerAction, type PartnerError, type PartnerErrorCode, type PartnerFeeClaimAssetBalance, type PartnerFeeClaimCancelAction, type PartnerFeeClaimCancelParams, PartnerFeeClaimService, type PartnerFeeClaimServiceConstructorParams, type PartnerFeeClaimSwapAction, type PartnerFeeClaimSwapParams, PartnerService, type PartnerServiceConfig, type PartnerServiceConstructorParams, Permit2Service, type PermitBatch, type PermitDetails, type PermitSingle, type PoolBaseCurrencyHumanized, type PoolData, type PoolRewardConfig, type PoolSpokeAssets, type PostExecutionError, type PostExecutionErrorCode, ProtocolIntentsAbi, type QueryMsg, type QueryResponse, RAY, RAY_DECIMALS, RELAY_ERROR_CODES, RELAY_FALLBACK_FLOOR_MS, RadfiApiError, type RadfiAuthResult, type RadfiBuildTxResponse, type RadfiErrorBody, type RadfiMaxSpentResponse, RadfiProvider, type RadfiProviderOptions, type RadfiResponseEnvelope, type RadfiTradingWallet, type RadfiUtxo, type RadfiUtxoListResponse, type RadfiWalletBalance, type RateLimitConfig, type RawDestinationParams, type RecoveryAction, type RecoveryError, type RecoveryErrorCode, RecoveryService, type RecoveryServiceConstructorParams, type RelayAction, type RelayAndWaitParams, type RelayCode, type RelayErrorCode, type RelayExtraData, type RelayRequestDetail, type RelayRequestSigning, type RelayTxStatus, type RelayWrappedErrorCode, type RequestConfig, type RequestOverrideConfig, type RequestTrustlineParams, type ReserveCalculationData, type ReserveData, type ReserveDataHumanized, type ReserveDataLegacy, type ReserveDataWithPrice, type ReserveEMode, type ReserveIncentiveDict, type ReservesDataHumanized, type ReservesIncentiveDataHumanized, type ResolvedAnalytics, type ResponseAddressType, type ResponseSigningType, type RevertMigrationOrchestrationError, type RevertMigrationOrchestrationErrorCode, type RewardInfoHumanized, SECONDS_PER_YEAR, SODAX_ERROR_CODES, SODAX_FEATURES, SPONSOR_CONFIG_TTL_MS, STELLAR_BASE_RESERVE_TTL_MS, STELLAR_TRUSTLINE_MIN_XLM_STROOPS, type SendMessageParams, type SetSwapPreferenceAction, type SetSwapPreferenceParams, Sodax, SodaxError, type SodaxErrorCode, type SodaxErrorContext, type SodaxErrorJSON, type SodaxPhase, SolanaSpokeService, SolverApiService, SonicSpokeService, type SpokeApproveParams, type SpokeApproveParamsEvmSpoke, type SpokeApproveParamsHub, type SpokeApproveParamsStellar, type SpokeIsAllowanceValidParams, type SpokeIsAllowanceValidParamsEvmSpoke, type SpokeIsAllowanceValidParamsHub, type SpokeIsAllowanceValidParamsOther, type SpokeIsAllowanceValidParamsStellar, SpokeService, type SpokeServiceConstructorParams, type SpokeServiceType, type SponsorFailureAction, type SponsorFailureClass, type SponsoringAction, SponsoringApiService, type SponsoringConfigError, type SponsoringConfigErrorCode, type SponsoringLookupError, type SponsoringLookupErrorCode, type SponsoringOrchestrationError, type SponsoringOrchestrationErrorCode, SponsoringService, StacksSpokeService, type StakeAction, type StakeOrchestrationError, type StakeOrchestrationErrorCode, type StakeParams, type StakingActionType, type StakingActionUnion, type StakingAllowanceCheckError, type StakingAllowanceCheckErrorCode, type StakingApproveError, type StakingApproveErrorCode, type StakingConfig, type StakingCreateIntentError, type StakingCreateIntentErrorCode, type StakingError, type StakingErrorCode, type StakingInfo, type StakingInfoFetchError, type StakingInfoFetchErrorCode, StakingLogic, type StakingOrchestrationError, type StakingOrchestrationErrorCode, type StakingParamsUnion, StakingService, type StakingServiceConstructorParams, type State, type StellarAccountStatus, StellarSpokeService, type SubmitTxParams, type SubmitTxResponse, SuiSpokeService, SupportedMigrationTokens, type SwapAction, type SwapActionParams, type SwapCreateIntentError, type SwapCreateIntentErrorCode, type SwapError, type SwapErrorCode, type SwapExtras, type SwapResponse, SwapService, type SwapServiceConstructorParams, SwapsApiService, type TokenSpenderPair, type TokenWithConversion, type TxHashPair, type TxStatus, USD_DECIMALS, type UiPoolDataProviderInterface, UiPoolDataProviderService, type UiPoolDataProviderServiceConstructorParams, type UnifiedBnUSDMigrateAction, type UnifiedBnUSDMigrateParams, type UnstakeAction, type UnstakeParams, type UnstakeRequest, type UnstakeRequestWithPenalty, type UnstakingInfo, type UserIncentiveData, type UserIncentiveDataHumanized, type UserIncentiveDict, type UserIntentsResponse, type UserReserveCalculationData, type UserReserveData, type UserReserveDataHumanized, type UserReserveDataString, type UserReservesIncentivesDataHumanized, type UserRewardInfoHumanized, type VaultSwapActionParams, type VaultSwapResponse, type VerifySimulationParams, type VerifyTxHashParams, WAD, WAD_RAY_RATIO, WEI_DECIMALS, type WaitForTxReceiptParams, type WaitForTxReceiptReturnType, type WaitUntilIntentExecutedPayload, type WalletMode, type WalletSimulationParams, type WithdrawHubAssetAction, type WithdrawHubAssetParams, type WithdrawInfo, adjustAmountByFee, allowanceCheckFailed, approveFailed, assetManagerAbi, balnSwapAbi, binomialApproximatedRayPow, bridgeInvariant, calcOpReturnOutputVbytes, calculateAllReserveIncentives, calculateAllUserIncentives, calculateAvailableBorrowsMarketReferenceCurrency, calculateCompoundedInterest, calculateCompoundedRate, calculateFeeAmount, calculateHealthFactorFromBalances, calculateHealthFactorFromBalancesBigUnits, calculateLinearInterest, calculatePercentageFeeAmount, clPoolAbi, clPoolManagerAbi, clPositionManagerAbi, clQuoterAbi, clRouterAbi, clTickLensAbi, classifySponsorError, connectionAbi, consoleLogger, convertTransactionInstructionToRaw, createInvariant, deepMerge, defaultHookAbi, dexInvariant, encodeAddress, encodeBtcPayloadToBytes, encodeContractCalls, erc20Abi, erc4626Abi, estimateBitcoinTxSize, executionFailed, formatBasisPoints, formatEModeCategory, formatEModes, formatPercentage, formatReserve, formatReserveUSD, formatReserves, formatReservesAndIncentives, formatUserSummary, formatUserSummaryAndIncentives, gasEstimationFailed, getAndFormatReserveEModes, getAssetManagerIdl, getAssetManagerProgram, getCompoundedBalance, getConnectionIdl, getConnectionProgram, getEvmViemChain, getIconAddressBytes, getLinearBalance, getMarketReferenceCurrencyAndUsdBalance, getPacket, getProvider, getRandomBytes, getReserveNormalizedIncome, getReservesEModes, getSolanaAddressBytes, getTransactionPackets, hexToBigInt, hexToSolanaAddress, hyper, intentCreationFailed, isBackendHttpError, isBalnMigrateParams, isBitcoinChainKeyType, isBitcoinWalletProviderType, isBridgeAllowanceCheckError, isBridgeApproveError, isBridgeCreateIntentError, isBridgeError, isBridgeLookupError, isBridgeOrchestrationError, isCodeMember, isDexApproveError, isDexCreateIntentError, isDexError, isEvmChainKeyType, isEvmSpokeChainConfig, isEvmSpokeOnlyChainKeyType, isEvmWalletProviderType, isFeatureError, isHubChainKeyType, isIconAddress, isIconChainKeyType, isIcxCreateRevertMigrationParams, isIcxMigrateParams, isInjectiveChainKeyType, isJsonRpcPayloadResponse, isLeverageYieldAllowanceCheckError, isLeverageYieldApproveError, isLeverageYieldCreateIntentError, isLeverageYieldError, isLeverageYieldLookupError, isLeverageYieldPostExecutionError, isLeverageYieldSwapError, isMigrateOrchestrationError, isMigrationAllowanceCheckError, isMigrationApproveError, isMigrationCreateIntentError, isMigrationError, isMigrationLookupError, isMoneyMarketAllowanceCheckError, isMoneyMarketApproveError, isMoneyMarketCreateIntentError, isMoneyMarketError, isMoneyMarketGasEstimationError, isMoneyMarketOrchestrationError, isNativeBitcoinTransfer, isNearChainKeyType, isOptionalBitcoinWalletProviderType, isOptionalEvmWalletProviderType, isOptionalStellarWalletProviderType, isPartnerError, isPartnerFeeAmount, isPartnerFeePercentage, isPostExecutionError, isRawDestinationParams, isRecoveryError, isResponseAddressType, isResponseSigningType, isRevertMigrationOrchestrationError, isSodaxError, isSolanaChainKeyType, isSolanaNativeToken, isSonicChainKeyType, isSpokeApproveParamsEvmSpoke, isSpokeApproveParamsHub, isSpokeApproveParamsStellar, isSpokeIsAllowanceValidParamsEvmSpoke, isSpokeIsAllowanceValidParamsHub, isSpokeIsAllowanceValidParamsStellar, isSponsoringConfigError, isSponsoringLookupError, isSponsoringOrchestrationError, isStacksChainKeyType, isStakeOrchestrationError, isStakingAllowanceCheckError, isStakingApproveError, isStakingCreateIntentError, isStakingError, isStakingInfoFetchError, isStakingOrchestrationError, isStellarChainKeyType, isStellarWalletProviderType, isSuiChainKeyType, isSwapCreateIntentError, isSwapError, isUndefinedOrValidWalletProviderForChainKey, isUnifiedBnUSDMigrateParams, leverageYieldInvariant, lookupFailed, mapRelayFailure, mergeSodaxConfig, messageOf, migrationInvariant, mintPositionParamsAbi, mmInvariant, modifyLiquidityParamsAbi, nativeToUSD, noopAnalytics, normalize, normalizeBN, normalizePsbtToBase64, normalizeSignatureToBase64, normalizedToUsd, pancakeSwapInfinityDefaultHookAbi, pancakeSwapInfinityPoolManagerAbi, pancakeSwapInfinityPositionManagerAbi, parseToStroops, parseTokenArrayFromJson, partnerInvariant, permit2Abi, poolAbi, poolKeyAbi, randomUint256, rayDiv, rayMul, rayPow, rayToWad, recoveryInvariant, relayTxAndWaitPacket, requestAddress, requestJsonRpc, requestSigning, resolveAnalytics, resolveLogger, retry, reverseEncodeAddress, serializeAddressData, silentLogger, sleep, sodaxInvariant, sonicWalletFactoryAbi, spokeAssetManagerAbi, sponsoringInvariant, stakedSodaAbi, stakingInvariant, stakingRouterAbi, stataTokenFactoryAbi, submitTransaction, swapExactInSingleParamsAbi, swapInvariant, toCreateBridgeIntentParamsV2, uiPoolDataAbi, universalRouterAbi, unknownFailed, valueToBigNumber, valueToZDBigNumber, variableDebtTokenAbi, vaultTokenAbi, verifyFailed, wadToRay, waitForStacksTransaction, waitForTransactionReceipt, waitUntilIntentExecuted, walletFactoryAbi, wrappedSonicAbi };
|
|
18528
|
+
export { ALLOWANCE_CHECK_CODES, APPROVE_CODES, type ActivateStellarAccountParams, type ActivateStellarAccountResult, type AggregatedReserveData, type AllowanceCheckErrorCode, type AllowanceInfo, type AllowanceResponse, type AllowanceTransferDetails, type AnalyticsActionData, type ApiResponse, type ApprovalTxs, type ApproveErrorCode, type ApyRange, type AssetDepositAction, type AssetEntry, AssetService, type AssetServiceConstructorParams, type AssetWithdrawAction, type AutoSwapPreferences, BackendApiService, BackendHttpError, type BalnLockParams, type BalnMigrateAction, type BalnMigrateParams, type BalnSwapAbi, BalnSwapService, type BalnSwapServiceConstructorParams, type BaseCurrencyInfo, BigIntToHex, type BigNumberValue, BigNumberZeroDecimal, type BitcoinBoundExtras, BitcoinSpokeService, type BitcoinTransactionResult, type BitcoinUTXO, BnUSDMigrationService, type BnUSDMigrationServiceConstructorParams, type BnUSDRevertMigrationParams, type BorrowInfo, type BridgeAction, type BridgeAllowanceCheckError, type BridgeAllowanceCheckErrorCode, BridgeApiService, type BridgeApiServiceOptions, type BridgeApproveError, type BridgeApproveErrorCode, type BridgeCreateIntentError, type BridgeCreateIntentErrorCode, type BridgeError, type BridgeErrorCode, type BridgeExtras, type BridgeLookupError, type BridgeLookupErrorCode, type BridgeOrchestrationError, type BridgeOrchestrationErrorCode, type BridgeParams, BridgeService, type BridgeServiceConstructorParams, type BtcPayload, CREATE_INTENT_CODES, type CalculateAllReserveIncentivesRequest, type CalculateAllUserIncentivesRequest, type CalculateCompoundedRateRequest, type CallResponse, type CancelIntentActionParams, type CancelIntentParams, type CancelUnstakeAction, type CancelUnstakeParams, type ClClaimRewardsParams, type ClDecreaseLiquidityParams, type ClGetPoolDataParams, type ClIncreaseLiquidityParams, type ClLiquidityClaimRewardsAction, type ClLiquidityDecreaseLiquidityAction, type ClLiquidityIncreaseLiquidityAction, type ClLiquidityWithdrawAction, type ClMintPositionEventLog, type ClPositionInfo, ClService, type ClServiceConstructorParams, type ClSupplyAction, type ClSupplyParams, type ClWithdrawParams, type ClaimAction, type ClaimParams, type CombinedReserveData, type ComputedUserReserve, type ConcentratedLiquidityParams, type ConcentratedLiquidityTokenInfo, ConfigService, type ConfigServiceConstructorParams, type ConnMsg, type CreateAssetDepositParams, type CreateAssetWithdrawParams, type CreateBridgeIntentParams, type CreateIntentErrorCode, type CreateIntentParams, type CreateIntentResult, type CreateLimitOrderParams, type CreateSonicSwapIntentParams, type CreateVaultIntentResult, type CreateViemPublicClientParams, CustomSorobanServer, CustomStellarAccount, type DepositParams, type DepositSimulationParams, type DestinationParamsType, type DetailedLock, type DexApproveError, type DexApproveErrorCode, type DexCreateIntentError, type DexCreateIntentErrorCode, type DexError, type DexErrorCode, DexService, type DexServiceConstructorParams, type EModeCategory, type EModeCategoryHumanized, type EModeData, type EModeDataString, type EmodeDataHumanized, type EnrichedToken, type Erc20ApprovalPlan, type Erc20ApprovalPlanReason, type Erc20ApproveParams, type Erc20GetAllowanceParams, type Erc20IsAllowanceParams, type Erc20PlanApprovalParams, Erc20Service, type Erc20Token, Erc4626Service, type EstimateGasParams, EvmAssetManagerService, type EvmDepositToDataParams, EvmHubProvider, type EvmHubProviderConstructorParams, EvmSolverService, EvmSpokeService, EvmVaultTokenService, type EvmWithdrawAssetDataParams, type ExecuteMsg, type FeatureInvariant, type FeeData, type FeeTokenApproveAction, type FeeTokenApproveParams, type FetchHubAssetBalancesParams, type FormatReserveRequest, type FormatReserveResponse, type FormatReserveUSDRequest, type FormatReserveUSDResponse, type FormatReservesAndIncentivesUSDRequest, type FormatReservesUSDRequest, type FormatUserSummaryAndIncentivesRequest, type FormatUserSummaryAndIncentivesResponse, type FormatUserSummaryRequest, type FormatUserSummaryResponse, type FormattedReserveEMode, GAS_ESTIMATION_CODES, type GasEstimationErrorCode, type GetDepositParams, type GetIntentSubmitTxExtraDataParams, type GetPacketParams, type GetPacketResponse, type GetQuoteParams, type GetRelayRequestParamType, type GetRelayResponse, type GetSpokeServiceType, type GetTransactionPacketsParams, type GetTransactionPacketsResponse, type GetTxReceiptType, type GetUserIntentParams, type GetUserRouterParams, HALF_RAY, HALF_WAD, type HanaWalletRequestEvent, type HanaWalletResponseEvent, type HookRequest, HookService, HttpRelayError, type HubAssetBalance, type HubProvider, type IconJsonRpcVersion, IconSpokeService, type IcxCreateRevertMigrationParams, type IcxMigrateAction, type IcxMigrateParams, IcxMigrationService, type IcxMigrationServiceConstructorParams, type IcxRevertMigrationAction, type IcxRevertMigrationParams, type IncentiveDataHumanized, type InjTokenInfo, Injective20Token, type InjectiveBalance, InjectiveSpokeService, type InstantUnstakeAction, type InstantUnstakeParams, type InstantiateMsg, type Intent, type IntentAutoSwapResult, IntentCreatedEventAbi, type IntentCreatedEventLog, type IntentData, IntentDataService, IntentDataType, type IntentDeliveryInfo, IntentFilledEventAbi, type IntentFilledEventLog, type IntentRelayRequest, type IntentRelayRequestParams, type IntentResponse, type IntentState, type IntentTxResult, IntentsAbi, type JsonRpcPayloadResponse, LOOKUP_CODES, LTV_PRECISION, LendingPoolService, type LendingPoolServiceConstructorParams, type LeverageYieldAction, type LeverageYieldAllowanceCheckError, type LeverageYieldAllowanceCheckErrorCode, type LeverageYieldAllowanceParams, type LeverageYieldApproveError, type LeverageYieldApproveErrorCode, type LeverageYieldApproveParams, type LeverageYieldApr, type LeverageYieldCreateIntentError, type LeverageYieldCreateIntentErrorCode, type LeverageYieldEffectiveApr, type LeverageYieldError, type LeverageYieldErrorCode, type LeverageYieldLookupError, type LeverageYieldLookupErrorCode, type LeverageYieldLsdApr, type LeverageYieldPosition, type LeverageYieldPostExecutionError, type LeverageYieldPostExecutionErrorCode, type LeverageYieldQuoteParams, LeverageYieldService, type LeverageYieldServiceConstructorParams, type LeverageYieldSwapDepositParams, type LeverageYieldSwapError, type LeverageYieldSwapErrorCode, type LeverageYieldSwapPayload, type LeverageYieldSwapWithdrawParams, type LimitOrderActionParams, LockupMultiplier, LockupPeriod, type LookupErrorCode, type MapRelayFailureCtx, type MigrateOrchestrationError, type MigrateOrchestrationErrorCode, type MigrationAction, type MigrationAllowanceCheckError, type MigrationAllowanceCheckErrorCode, type MigrationApproveError, type MigrationApproveErrorCode, type MigrationCreateIntentError, type MigrationCreateIntentErrorCode, type MigrationDirection, type MigrationError, type MigrationErrorCode, type MigrationLookupError, type MigrationLookupErrorCode, type MigrationOp, type MigrationParams, type MigrationRevertParams, MigrationService, type MigrationServiceConstructorParams, type MigrationTokens, MintPositionEventAbi, type MintPositionEventLog, type MoneyMarketAction, type MoneyMarketAllowanceCheckError, type MoneyMarketAllowanceCheckErrorCode, type MoneyMarketAllowanceParams, type MoneyMarketApproveActionParams, type MoneyMarketApproveError, type MoneyMarketApproveErrorCode, type MoneyMarketAsset, type MoneyMarketAssetBorrowers, type MoneyMarketAssetSuppliers, type MoneyMarketBorrowActionParams, type MoneyMarketBorrowParams, type MoneyMarketBorrowers, type MoneyMarketCreateIntentError, type MoneyMarketCreateIntentErrorCode, MoneyMarketDataService, type MoneyMarketDataServiceConstructorParams, type MoneyMarketEncodeBorrowParams, type MoneyMarketEncodeRepayParams, type MoneyMarketEncodeRepayWithATokensParams, type MoneyMarketEncodeSupplyParams, type MoneyMarketEncodeWithdrawParams, type MoneyMarketError, type MoneyMarketErrorCode, type MoneyMarketGasEstimationError, type MoneyMarketGasEstimationErrorCode, type MoneyMarketOrchestrationError, type MoneyMarketOrchestrationErrorCode, type MoneyMarketParams, type MoneyMarketPosition, type MoneyMarketRepayActionParams, type MoneyMarketRepayParams, MoneyMarketService, type MoneyMarketServiceConstructorParams, type MoneyMarketSupplyActionParams, type MoneyMarketSupplyParams, type MoneyMarketWithdrawActionParams, type MoneyMarketWithdrawParams, NEAR_DEFAULT_GAS, NEAR_STORAGE_DEPOSIT, NearSpokeService, type OnDemandBtcPayload, type OnDemandRelayData, type OptionalRaw, type OptionalSkipSimulation, type OptionalTimeout, type OrderbookResponse, type PacketData, type PartnerAction, type PartnerError, type PartnerErrorCode, type PartnerFeeClaimAssetBalance, type PartnerFeeClaimCancelAction, type PartnerFeeClaimCancelParams, PartnerFeeClaimService, type PartnerFeeClaimServiceConstructorParams, type PartnerFeeClaimSwapAction, type PartnerFeeClaimSwapParams, PartnerService, type PartnerServiceConfig, type PartnerServiceConstructorParams, Permit2Service, type PermitBatch, type PermitDetails, type PermitSingle, type PoolBaseCurrencyHumanized, type PoolData, type PoolRewardConfig, type PoolSpokeAssets, type PostExecutionError, type PostExecutionErrorCode, ProtocolIntentsAbi, type QueryMsg, type QueryResponse, RAY, RAY_DECIMALS, RELAY_ERROR_CODES, RELAY_FALLBACK_FLOOR_MS, RadfiApiError, type RadfiAuthResult, type RadfiBuildTxResponse, type RadfiErrorBody, type RadfiMaxSpentResponse, RadfiProvider, type RadfiProviderOptions, type RadfiResponseEnvelope, type RadfiTradingWallet, type RadfiUtxo, type RadfiUtxoListResponse, type RadfiWalletBalance, type RateLimitConfig, type RawDestinationParams, type RecoveryAction, type RecoveryError, type RecoveryErrorCode, RecoveryService, type RecoveryServiceConstructorParams, type RelayAction, type RelayAndWaitParams, type RelayCode, type RelayErrorCode, type RelayExtraData, type RelayRequestDetail, type RelayRequestSigning, type RelayTxStatus, type RelayWrappedErrorCode, type RequestConfig, type RequestOverrideConfig, type RequestTrustlineParams, type ReserveCalculationData, type ReserveData, type ReserveDataHumanized, type ReserveDataLegacy, type ReserveDataWithPrice, type ReserveEMode, type ReserveIncentiveDict, type ReservesDataHumanized, type ReservesIncentiveDataHumanized, type ResolvedAnalytics, type ResponseAddressType, type ResponseSigningType, type RevertMigrationOrchestrationError, type RevertMigrationOrchestrationErrorCode, type RewardInfoHumanized, SECONDS_PER_YEAR, SODAX_ERROR_CODES, SODAX_FEATURES, SPONSOR_CONFIG_TTL_MS, STELLAR_BASE_RESERVE_TTL_MS, STELLAR_TRUSTLINE_MIN_XLM_STROOPS, type SendMessageParams, type SetSwapPreferenceAction, type SetSwapPreferenceParams, Sodax, SodaxError, type SodaxErrorCode, type SodaxErrorContext, type SodaxErrorJSON, type SodaxPhase, SolanaSpokeService, SolverApiService, SonicSpokeService, type SpokeApproveParams, type SpokeApproveParamsEvmSpoke, type SpokeApproveParamsHub, type SpokeApproveParamsStellar, type SpokeIsAllowanceValidParams, type SpokeIsAllowanceValidParamsEvmSpoke, type SpokeIsAllowanceValidParamsHub, type SpokeIsAllowanceValidParamsOther, type SpokeIsAllowanceValidParamsStellar, SpokeService, type SpokeServiceConstructorParams, type SpokeServiceType, type SponsorFailureAction, type SponsorFailureClass, type SponsoringAction, SponsoringApiService, type SponsoringConfigError, type SponsoringConfigErrorCode, type SponsoringLookupError, type SponsoringLookupErrorCode, type SponsoringOrchestrationError, type SponsoringOrchestrationErrorCode, SponsoringService, StacksSpokeService, type StakeAction, type StakeOrchestrationError, type StakeOrchestrationErrorCode, type StakeParams, type StakingActionType, type StakingActionUnion, type StakingAllowanceCheckError, type StakingAllowanceCheckErrorCode, type StakingApproveError, type StakingApproveErrorCode, type StakingConfig, type StakingCreateIntentError, type StakingCreateIntentErrorCode, type StakingError, type StakingErrorCode, type StakingInfo, type StakingInfoFetchError, type StakingInfoFetchErrorCode, StakingLogic, type StakingOrchestrationError, type StakingOrchestrationErrorCode, type StakingParamsUnion, StakingService, type StakingServiceConstructorParams, type State, type StellarAccountStatus, StellarSpokeService, type SubmitTxParams, type SubmitTxResponse, SuiSpokeService, SupportedMigrationTokens, type SwapAction, type SwapActionParams, type SwapCreateIntentError, type SwapCreateIntentErrorCode, type SwapError, type SwapErrorCode, type SwapExtras, type SwapResponse, SwapService, type SwapServiceConstructorParams, SwapsApiService, type SwapsApiServiceOptions, type TokenSpenderPair, type TokenWithConversion, type TxHashPair, type TxStatus, USD_DECIMALS, type UiPoolDataProviderInterface, UiPoolDataProviderService, type UiPoolDataProviderServiceConstructorParams, type UnifiedBnUSDMigrateAction, type UnifiedBnUSDMigrateParams, type UnstakeAction, type UnstakeParams, type UnstakeRequest, type UnstakeRequestWithPenalty, type UnstakingInfo, type UserIncentiveData, type UserIncentiveDataHumanized, type UserIncentiveDict, type UserIntentsResponse, type UserReserveCalculationData, type UserReserveData, type UserReserveDataHumanized, type UserReserveDataString, type UserReservesIncentivesDataHumanized, type UserRewardInfoHumanized, type VaultSwapActionParams, type VaultSwapResponse, type VerifySimulationParams, type VerifyTxHashParams, WAD, WAD_RAY_RATIO, WEI_DECIMALS, type WaitForTxReceiptParams, type WaitForTxReceiptReturnType, type WaitUntilIntentExecutedPayload, type WalletMode, type WalletSimulationParams, type WithdrawHubAssetAction, type WithdrawHubAssetParams, type WithdrawInfo, adjustAmountByFee, allowanceCheckFailed, approveFailed, assetManagerAbi, balnSwapAbi, binomialApproximatedRayPow, bridgeInvariant, calcOpReturnOutputVbytes, calculateAllReserveIncentives, calculateAllUserIncentives, calculateAvailableBorrowsMarketReferenceCurrency, calculateCompoundedInterest, calculateCompoundedRate, calculateFeeAmount, calculateHealthFactorFromBalances, calculateHealthFactorFromBalancesBigUnits, calculateLinearInterest, calculatePercentageFeeAmount, clPoolAbi, clPoolManagerAbi, clPositionManagerAbi, clQuoterAbi, clRouterAbi, clTickLensAbi, classifySponsorError, connectionAbi, consoleLogger, convertTransactionInstructionToRaw, createInvariant, deepMerge, defaultHookAbi, dexInvariant, encodeAddress, encodeBtcPayloadToBytes, encodeContractCalls, erc20Abi, erc4626Abi, estimateBitcoinTxSize, executionFailed, formatBasisPoints, formatEModeCategory, formatEModes, formatPercentage, formatReserve, formatReserveUSD, formatReserves, formatReservesAndIncentives, formatUserSummary, formatUserSummaryAndIncentives, gasEstimationFailed, getAndFormatReserveEModes, getAssetManagerIdl, getAssetManagerProgram, getCompoundedBalance, getConnectionIdl, getConnectionProgram, getEvmViemChain, getIconAddressBytes, getLinearBalance, getMarketReferenceCurrencyAndUsdBalance, getPacket, getProvider, getRandomBytes, getReserveNormalizedIncome, getReservesEModes, getSolanaAddressBytes, getTransactionPackets, hexToBigInt, hexToSolanaAddress, hyper, intentCreationFailed, isBackendHttpError, isBalnMigrateParams, isBitcoinChainKeyType, isBitcoinWalletProviderType, isBridgeAllowanceCheckError, isBridgeApproveError, isBridgeCreateIntentError, isBridgeError, isBridgeLookupError, isBridgeOrchestrationError, isCodeMember, isDexApproveError, isDexCreateIntentError, isDexError, isEvmChainKeyType, isEvmSpokeChainConfig, isEvmSpokeOnlyChainKeyType, isEvmWalletProviderType, isFeatureError, isHubChainKeyType, isIconAddress, isIconChainKeyType, isIcxCreateRevertMigrationParams, isIcxMigrateParams, isInjectiveChainKeyType, isJsonRpcPayloadResponse, isLeverageYieldAllowanceCheckError, isLeverageYieldApproveError, isLeverageYieldCreateIntentError, isLeverageYieldError, isLeverageYieldLookupError, isLeverageYieldPostExecutionError, isLeverageYieldSwapError, isMigrateOrchestrationError, isMigrationAllowanceCheckError, isMigrationApproveError, isMigrationCreateIntentError, isMigrationError, isMigrationLookupError, isMoneyMarketAllowanceCheckError, isMoneyMarketApproveError, isMoneyMarketCreateIntentError, isMoneyMarketError, isMoneyMarketGasEstimationError, isMoneyMarketOrchestrationError, isNativeBitcoinTransfer, isNearChainKeyType, isOptionalBitcoinWalletProviderType, isOptionalEvmWalletProviderType, isOptionalStellarWalletProviderType, isPartnerError, isPartnerFeeAmount, isPartnerFeePercentage, isPostExecutionError, isRawDestinationParams, isRecoveryError, isResponseAddressType, isResponseSigningType, isRevertMigrationOrchestrationError, isSodaxError, isSolanaChainKeyType, isSolanaNativeToken, isSonicChainKeyType, isSpokeApproveParamsEvmSpoke, isSpokeApproveParamsHub, isSpokeApproveParamsStellar, isSpokeIsAllowanceValidParamsEvmSpoke, isSpokeIsAllowanceValidParamsHub, isSpokeIsAllowanceValidParamsStellar, isSponsoringConfigError, isSponsoringLookupError, isSponsoringOrchestrationError, isStacksChainKeyType, isStakeOrchestrationError, isStakingAllowanceCheckError, isStakingApproveError, isStakingCreateIntentError, isStakingError, isStakingInfoFetchError, isStakingOrchestrationError, isStellarChainKeyType, isStellarWalletProviderType, isSuiChainKeyType, isSwapCreateIntentError, isSwapError, isUndefinedOrValidWalletProviderForChainKey, isUnifiedBnUSDMigrateParams, leverageYieldInvariant, lookupFailed, mapRelayFailure, mergeSodaxConfig, messageOf, migrationInvariant, mintPositionParamsAbi, mmInvariant, modifyLiquidityParamsAbi, nativeToUSD, noopAnalytics, normalize, normalizeBN, normalizePsbtToBase64, normalizeSignatureToBase64, normalizedToUsd, pancakeSwapInfinityDefaultHookAbi, pancakeSwapInfinityPoolManagerAbi, pancakeSwapInfinityPositionManagerAbi, parseToStroops, parseTokenArrayFromJson, partnerInvariant, permit2Abi, poolAbi, poolKeyAbi, randomUint256, rayDiv, rayMul, rayPow, rayToWad, recoveryInvariant, relayTxAndWaitPacket, requestAddress, requestJsonRpc, requestSigning, resolveAnalytics, resolveLogger, retry, reverseEncodeAddress, serializeAddressData, silentLogger, sleep, sodaxInvariant, sonicWalletFactoryAbi, spokeAssetManagerAbi, sponsoringInvariant, stakedSodaAbi, stakingInvariant, stakingRouterAbi, stataTokenFactoryAbi, submitTransaction, swapExactInSingleParamsAbi, swapInvariant, toCreateBridgeIntentParamsV2, uiPoolDataAbi, universalRouterAbi, unknownFailed, valueToBigNumber, valueToZDBigNumber, variableDebtTokenAbi, vaultTokenAbi, verifyFailed, wadToRay, waitForStacksTransaction, waitForTransactionReceipt, waitUntilIntentExecuted, walletFactoryAbi, wrappedSonicAbi };
|
package/dist/index.mjs
CHANGED
|
@@ -3489,6 +3489,7 @@ var ICON_TX_RESULT_WAIT_MAX_RETRY = 10;
|
|
|
3489
3489
|
var MAX_UINT256 = (1n << 256n) - 1n;
|
|
3490
3490
|
var FEE_PERCENTAGE_SCALE = 10000n;
|
|
3491
3491
|
var DEFAULT_DEADLINE_OFFSET = 300n;
|
|
3492
|
+
var DEFAULT_API_BASE_URL = "https://api.sodax.com/v1";
|
|
3492
3493
|
var DEFAULT_BACKEND_API_ENDPOINT = "https://api.sodax.com/v1/be";
|
|
3493
3494
|
var DEFAULT_BACKEND_API_TIMEOUT = 3e4;
|
|
3494
3495
|
var DEFAULT_BACKEND_API_HEADERS = {
|
|
@@ -3499,8 +3500,9 @@ var DEFAULT_RELAYER_API_ENDPOINT = "https://xcall-relay.nw.iconblockchain.xyz";
|
|
|
3499
3500
|
var VAULT_TOKEN_DECIMALS = 18;
|
|
3500
3501
|
var DEFAULT_SPONSORING_API_ENDPOINT = "https://api.sodax.com/v1";
|
|
3501
3502
|
var SPONSORING_API_STELLAR_BASE_PATH = "/sponsorships/stellar";
|
|
3503
|
+
var BACKEND_API_BASE_PATH = "/be";
|
|
3502
3504
|
var apiConfig = {
|
|
3503
|
-
baseURL:
|
|
3505
|
+
baseURL: DEFAULT_API_BASE_URL,
|
|
3504
3506
|
timeout: DEFAULT_BACKEND_API_TIMEOUT,
|
|
3505
3507
|
headers: DEFAULT_BACKEND_API_HEADERS
|
|
3506
3508
|
};
|
|
@@ -4428,7 +4430,7 @@ function isValidWalletProviderForChainKey(chainKey, walletProvider) {
|
|
|
4428
4430
|
}
|
|
4429
4431
|
|
|
4430
4432
|
// ../types/dist/index.js
|
|
4431
|
-
var CONFIG_VERSION =
|
|
4433
|
+
var CONFIG_VERSION = 225;
|
|
4432
4434
|
|
|
4433
4435
|
// src/shared/utils/resolveTimeoutMs.ts
|
|
4434
4436
|
function resolveTimeoutMs(timeout, fallbackMs) {
|
|
@@ -30351,16 +30353,112 @@ function toInvalidResponseShapeError(params) {
|
|
|
30351
30353
|
context: { api, endpoint, reason: "invalid_response_shape", issues }
|
|
30352
30354
|
});
|
|
30353
30355
|
}
|
|
30356
|
+
|
|
30357
|
+
// src/backendApi/apiConfig.ts
|
|
30358
|
+
function flatLayer({ baseURL, timeout, headers }) {
|
|
30359
|
+
return { baseURL, timeout, headers };
|
|
30360
|
+
}
|
|
30361
|
+
function layerConfigs(...slices) {
|
|
30362
|
+
return slices.reduce(
|
|
30363
|
+
(acc, slice) => slice ? {
|
|
30364
|
+
// Truthy (not nullish) so a set-but-empty env var falls back, matching `makeRequest`.
|
|
30365
|
+
baseURL: slice.baseURL || acc.baseURL,
|
|
30366
|
+
timeout: slice.timeout ?? acc.timeout,
|
|
30367
|
+
headers: { ...acc.headers, ...slice.headers }
|
|
30368
|
+
} : acc,
|
|
30369
|
+
{
|
|
30370
|
+
baseURL: DEFAULT_API_BASE_URL,
|
|
30371
|
+
timeout: DEFAULT_BACKEND_API_TIMEOUT,
|
|
30372
|
+
headers: { ...DEFAULT_BACKEND_API_HEADERS }
|
|
30373
|
+
}
|
|
30374
|
+
);
|
|
30375
|
+
}
|
|
30376
|
+
function isHttpUrl(value) {
|
|
30377
|
+
return value.startsWith("http://") || value.startsWith("https://");
|
|
30378
|
+
}
|
|
30379
|
+
function normalizeBaseURL(baseURL) {
|
|
30380
|
+
const trimmed = trimTrailingSlashes(baseURL);
|
|
30381
|
+
return isHttpUrl(trimmed) ? trimmed : baseURL;
|
|
30382
|
+
}
|
|
30383
|
+
function stripBackendMount(baseURL) {
|
|
30384
|
+
const trimmed = trimTrailingSlashes(baseURL);
|
|
30385
|
+
if (!trimmed.endsWith(BACKEND_API_BASE_PATH)) return void 0;
|
|
30386
|
+
const root = trimmed.slice(0, -BACKEND_API_BASE_PATH.length);
|
|
30387
|
+
return isHttpUrl(root) ? root : void 0;
|
|
30388
|
+
}
|
|
30389
|
+
function stripLegacyBackendMount(baseURL) {
|
|
30390
|
+
return stripBackendMount(baseURL) ?? baseURL;
|
|
30391
|
+
}
|
|
30392
|
+
function normalizeOverrideBaseURL(override) {
|
|
30393
|
+
if (!override?.baseURL) return override;
|
|
30394
|
+
return { ...override, baseURL: stripLegacyBackendMount(override.baseURL) };
|
|
30395
|
+
}
|
|
30396
|
+
function toGatewayRoot(baseURL) {
|
|
30397
|
+
return stripBackendMount(baseURL) ?? normalizeBaseURL(baseURL);
|
|
30398
|
+
}
|
|
30399
|
+
function configuredBasePath(layers) {
|
|
30400
|
+
return layers.baseApiConfig?.basePath ?? layers.basePath;
|
|
30401
|
+
}
|
|
30402
|
+
function hasExplicitBasePath(layers) {
|
|
30403
|
+
return configuredBasePath(layers) !== void 0;
|
|
30404
|
+
}
|
|
30405
|
+
function hasLegacyBackendBaseURL(layers) {
|
|
30406
|
+
if (configuredBasePath(layers) !== void 0) return false;
|
|
30407
|
+
return stripBackendMount(layerConfigs(flatLayer(layers), layers.baseApiConfig).baseURL) !== void 0;
|
|
30408
|
+
}
|
|
30409
|
+
var PACKAGED_API_ORIGIN = new URL(DEFAULT_API_BASE_URL).origin;
|
|
30410
|
+
function isOnPackagedOrigin(baseURL) {
|
|
30411
|
+
return baseURL === PACKAGED_API_ORIGIN || baseURL.startsWith(`${PACKAGED_API_ORIGIN}/`);
|
|
30412
|
+
}
|
|
30413
|
+
function isMissingVersionPrefix(baseURL) {
|
|
30414
|
+
const normalized = trimTrailingSlashes(baseURL);
|
|
30415
|
+
if (!isOnPackagedOrigin(normalized)) return false;
|
|
30416
|
+
return normalized !== DEFAULT_API_BASE_URL && !normalized.startsWith(`${DEFAULT_API_BASE_URL}/`);
|
|
30417
|
+
}
|
|
30418
|
+
function normalizeBasePath(basePath) {
|
|
30419
|
+
const trimmed = trimTrailingSlashes(basePath.trim());
|
|
30420
|
+
const withoutLeadingSlashes = trimmed.replace(/^\/+/, "");
|
|
30421
|
+
return withoutLeadingSlashes.length === 0 ? "" : `/${withoutLeadingSlashes}`;
|
|
30422
|
+
}
|
|
30423
|
+
function resolveSharedApiConfig(layers, slice) {
|
|
30424
|
+
const layered = layerConfigs(flatLayer(layers), layers.baseApiConfig, slice);
|
|
30425
|
+
const baseURL = configuredBasePath(layers) === void 0 ? toGatewayRoot(layered.baseURL) : normalizeBaseURL(layered.baseURL);
|
|
30426
|
+
return { ...layered, baseURL };
|
|
30427
|
+
}
|
|
30428
|
+
function resolveBaseApiConfig(layers) {
|
|
30429
|
+
return {
|
|
30430
|
+
...resolveSharedApiConfig(layers),
|
|
30431
|
+
basePath: normalizeBasePath(configuredBasePath(layers) ?? BACKEND_API_BASE_PATH)
|
|
30432
|
+
};
|
|
30433
|
+
}
|
|
30434
|
+
function resolveSwapsApiConfig(layers) {
|
|
30435
|
+
return resolveSharedApiConfig(layers, layers.swapsApiConfig);
|
|
30436
|
+
}
|
|
30437
|
+
function resolveSponsoringApiConfig(layers) {
|
|
30438
|
+
const slice = layers.sponsoringApiConfig;
|
|
30439
|
+
return {
|
|
30440
|
+
baseURL: normalizeBaseURL(slice?.baseURL ?? DEFAULT_SPONSORING_API_ENDPOINT),
|
|
30441
|
+
timeout: slice?.timeout ?? resolveSharedApiConfig(layers).timeout,
|
|
30442
|
+
headers: { ...DEFAULT_BACKEND_API_HEADERS, ...slice?.headers },
|
|
30443
|
+
...slice?.apiKey === void 0 ? {} : { apiKey: slice.apiKey }
|
|
30444
|
+
};
|
|
30445
|
+
}
|
|
30446
|
+
function resolveBridgeApiConfig(layers) {
|
|
30447
|
+
return resolveSharedApiConfig(layers);
|
|
30448
|
+
}
|
|
30354
30449
|
var SwapsApiService = class _SwapsApiService {
|
|
30355
30450
|
// Fully-resolved swaps-API config supplied by the caller (BackendApiService resolves the
|
|
30356
30451
|
// `ApiConfig` union via `resolveSwapsApiConfig`); this service does not resolve the union.
|
|
30357
30452
|
config;
|
|
30358
30453
|
headers;
|
|
30359
30454
|
logger;
|
|
30360
|
-
|
|
30455
|
+
/** See {@link SwapsApiServiceOptions.trimLegacyOverrides}. */
|
|
30456
|
+
trimsLegacyOverrides;
|
|
30457
|
+
constructor(config, logger = consoleLogger, options = {}) {
|
|
30361
30458
|
this.config = config;
|
|
30362
30459
|
this.headers = { ...config.headers };
|
|
30363
30460
|
this.logger = logger;
|
|
30461
|
+
this.trimsLegacyOverrides = options.trimLegacyOverrides ?? true;
|
|
30364
30462
|
}
|
|
30365
30463
|
/**
|
|
30366
30464
|
* Build a `@sodax/swaps-api` client for a single call. Maps the SDK's `SwapsApiConfig`
|
|
@@ -30371,7 +30469,8 @@ var SwapsApiService = class _SwapsApiService {
|
|
|
30371
30469
|
* overrides both take effect without caching stale state.
|
|
30372
30470
|
*/
|
|
30373
30471
|
buildClient(overrideConfig) {
|
|
30374
|
-
const
|
|
30472
|
+
const override = overrideConfig?.baseURL;
|
|
30473
|
+
const baseUrl = override ? this.trimsLegacyOverrides ? stripLegacyBackendMount(override) : override : this.config.baseURL;
|
|
30375
30474
|
const timeout = overrideConfig?.timeout ?? this.config.timeout ?? DEFAULT_BACKEND_API_TIMEOUT;
|
|
30376
30475
|
const headers = { ...this.headers, ...overrideConfig?.headers };
|
|
30377
30476
|
return new SwapsApi({ baseUrl, headers, timeout });
|
|
@@ -30846,10 +30945,13 @@ var BridgeApiService = class {
|
|
|
30846
30945
|
config;
|
|
30847
30946
|
headers;
|
|
30848
30947
|
logger;
|
|
30849
|
-
|
|
30948
|
+
/** See {@link BridgeApiServiceOptions.trimLegacyOverrides}. */
|
|
30949
|
+
trimsLegacyOverrides;
|
|
30950
|
+
constructor(config, logger = consoleLogger, options = {}) {
|
|
30850
30951
|
this.config = config;
|
|
30851
30952
|
this.headers = { ...config.headers };
|
|
30852
30953
|
this.logger = logger;
|
|
30954
|
+
this.trimsLegacyOverrides = options.trimLegacyOverrides ?? true;
|
|
30853
30955
|
}
|
|
30854
30956
|
/**
|
|
30855
30957
|
* Issues a single HTTP request, validates the JSON body against `schema`, and
|
|
@@ -30862,7 +30964,10 @@ var BridgeApiService = class {
|
|
|
30862
30964
|
const raw = await makeRequest({
|
|
30863
30965
|
endpoint,
|
|
30864
30966
|
config: { baseURL: this.config.baseURL, timeout: this.config.timeout, headers: this.headers, ...config },
|
|
30865
|
-
|
|
30967
|
+
// Normalized like a configured base URL: the override is the gateway root, so a legacy
|
|
30968
|
+
// `/be`-suffixed value must not nest `/bridge/*` under the data API's mount — unless the config
|
|
30969
|
+
// opted out of the legacy trim, in which case the per-call value is left exactly as given.
|
|
30970
|
+
overrideConfig: this.trimsLegacyOverrides ? normalizeOverrideBaseURL(overrideConfig) : overrideConfig,
|
|
30866
30971
|
logger: this.logger,
|
|
30867
30972
|
serviceLabel: "BridgeApiService"
|
|
30868
30973
|
});
|
|
@@ -31067,53 +31172,6 @@ var BridgeApiService = class {
|
|
|
31067
31172
|
return this.config.timeout;
|
|
31068
31173
|
}
|
|
31069
31174
|
};
|
|
31070
|
-
|
|
31071
|
-
// src/backendApi/apiConfig.ts
|
|
31072
|
-
function flatLayer({ baseURL, timeout, headers }) {
|
|
31073
|
-
return { baseURL, timeout, headers };
|
|
31074
|
-
}
|
|
31075
|
-
function layerConfigs(...slices) {
|
|
31076
|
-
return slices.reduce(
|
|
31077
|
-
(acc, slice) => slice ? {
|
|
31078
|
-
baseURL: slice.baseURL ?? acc.baseURL,
|
|
31079
|
-
timeout: slice.timeout ?? acc.timeout,
|
|
31080
|
-
headers: { ...acc.headers, ...slice.headers }
|
|
31081
|
-
} : acc,
|
|
31082
|
-
{
|
|
31083
|
-
baseURL: DEFAULT_BACKEND_API_ENDPOINT,
|
|
31084
|
-
timeout: DEFAULT_BACKEND_API_TIMEOUT,
|
|
31085
|
-
headers: { ...DEFAULT_BACKEND_API_HEADERS }
|
|
31086
|
-
}
|
|
31087
|
-
);
|
|
31088
|
-
}
|
|
31089
|
-
function resolveBaseApiConfig(config) {
|
|
31090
|
-
const layers = config;
|
|
31091
|
-
return layerConfigs(flatLayer(layers), layers.baseApiConfig);
|
|
31092
|
-
}
|
|
31093
|
-
function resolveSwapsApiConfig(config) {
|
|
31094
|
-
const layers = config;
|
|
31095
|
-
return layerConfigs(flatLayer(layers), layers.baseApiConfig, layers.swapsApiConfig);
|
|
31096
|
-
}
|
|
31097
|
-
function isHttpUrl(value) {
|
|
31098
|
-
return value.startsWith("http://") || value.startsWith("https://");
|
|
31099
|
-
}
|
|
31100
|
-
function normalizeBaseURL(baseURL) {
|
|
31101
|
-
const trimmed = trimTrailingSlashes(baseURL);
|
|
31102
|
-
return isHttpUrl(trimmed) ? trimmed : baseURL;
|
|
31103
|
-
}
|
|
31104
|
-
function resolveSponsoringApiConfig(config) {
|
|
31105
|
-
const layers = config;
|
|
31106
|
-
const slice = layers.sponsoringApiConfig;
|
|
31107
|
-
return {
|
|
31108
|
-
baseURL: normalizeBaseURL(slice?.baseURL ?? DEFAULT_SPONSORING_API_ENDPOINT),
|
|
31109
|
-
timeout: slice?.timeout ?? resolveBaseApiConfig(config).timeout,
|
|
31110
|
-
headers: { ...DEFAULT_BACKEND_API_HEADERS, ...slice?.headers },
|
|
31111
|
-
...slice?.apiKey === void 0 ? {} : { apiKey: slice.apiKey }
|
|
31112
|
-
};
|
|
31113
|
-
}
|
|
31114
|
-
function resolveBridgeApiConfig(config) {
|
|
31115
|
-
return resolveBaseApiConfig(config);
|
|
31116
|
-
}
|
|
31117
31175
|
var ChainKeySchema = v7.custom((input) => typeof input === "string");
|
|
31118
31176
|
var SpokeChainKeySchema = v7.custom((input) => typeof input === "string");
|
|
31119
31177
|
var AddressSchema2 = v7.custom((input) => typeof input === "string");
|
|
@@ -31252,17 +31310,70 @@ var BackendApiService = class {
|
|
|
31252
31310
|
swaps;
|
|
31253
31311
|
sponsoring;
|
|
31254
31312
|
bridge;
|
|
31255
|
-
// resolved base-API config: the flat fields of the ApiConfig union with any `baseApiConfig` layered on
|
|
31313
|
+
// resolved base-API config: the flat fields of the ApiConfig union with any `baseApiConfig` layered on
|
|
31314
|
+
// top. `baseURL` is the gateway root; `basePath` is this service's own mount below it.
|
|
31256
31315
|
config;
|
|
31257
31316
|
headers;
|
|
31258
31317
|
logger;
|
|
31318
|
+
/**
|
|
31319
|
+
* Whether a legacy `/be` suffix is trimmed off a per-call `baseURL` override. Mirrors the config-level
|
|
31320
|
+
* decision: an explicit `basePath` means the consumer writes complete roots, so their per-call value is
|
|
31321
|
+
* left exactly as given rather than having a real path segment eaten.
|
|
31322
|
+
*/
|
|
31323
|
+
trimsLegacyOverrides;
|
|
31259
31324
|
constructor(config, logger = consoleLogger) {
|
|
31260
31325
|
this.config = resolveBaseApiConfig(config);
|
|
31261
31326
|
this.headers = { ...this.config.headers };
|
|
31262
31327
|
this.logger = logger;
|
|
31263
|
-
this.
|
|
31264
|
-
|
|
31265
|
-
|
|
31328
|
+
this.trimsLegacyOverrides = !hasExplicitBasePath(config);
|
|
31329
|
+
const swapsConfig2 = resolveSwapsApiConfig(config);
|
|
31330
|
+
const sponsoringConfig = resolveSponsoringApiConfig(config);
|
|
31331
|
+
const bridgeConfig2 = resolveBridgeApiConfig(config);
|
|
31332
|
+
const shortRoots = [
|
|
31333
|
+
["backendApi", this.config.baseURL],
|
|
31334
|
+
["api.swaps", swapsConfig2.baseURL],
|
|
31335
|
+
["api.bridge", bridgeConfig2.baseURL],
|
|
31336
|
+
["api.sponsoring", sponsoringConfig.baseURL]
|
|
31337
|
+
].filter(([, baseURL]) => isMissingVersionPrefix(baseURL));
|
|
31338
|
+
if (shortRoots.length > 0) {
|
|
31339
|
+
const named = shortRoots.map(([service, baseURL]) => `${service} ("${baseURL}")`).join(", ");
|
|
31340
|
+
this.logger.warn(
|
|
31341
|
+
`[BackendApiService] api.baseURL is missing the gateway's version prefix for ${named}: every route resolves one segment short. Use "${DEFAULT_API_BASE_URL}" \u2014 the prefix is deployment-owned, so it belongs in baseURL, and only the data API has a basePath to compensate.`
|
|
31342
|
+
);
|
|
31343
|
+
}
|
|
31344
|
+
if (hasLegacyBackendBaseURL(config)) {
|
|
31345
|
+
this.logger.warn(
|
|
31346
|
+
`[BackendApiService] api.baseURL should be the gateway root, not the backend data API's mount: trimmed "${BACKEND_API_BASE_PATH}" to "${this.config.baseURL}". Drop the suffix \u2014 the SDK appends it, and sibling services (/swaps, /bridge) must not sit under it.`
|
|
31347
|
+
);
|
|
31348
|
+
}
|
|
31349
|
+
const overrideOptions = { trimLegacyOverrides: this.trimsLegacyOverrides };
|
|
31350
|
+
this.swaps = new SwapsApiService(swapsConfig2, this.logger, overrideOptions);
|
|
31351
|
+
this.sponsoring = new SponsoringApiService(sponsoringConfig, this.logger);
|
|
31352
|
+
this.bridge = new BridgeApiService(bridgeConfig2, this.logger, overrideOptions);
|
|
31353
|
+
}
|
|
31354
|
+
/**
|
|
31355
|
+
* Issue the HTTP call for a route.
|
|
31356
|
+
*
|
|
31357
|
+
* The mount is applied here rather than at each route literal, so `error.context.endpoint` stays
|
|
31358
|
+
* route-relative and the mount survives a per-call `baseURL` override — that retargets the gateway
|
|
31359
|
+
* root, not which service the route belongs to. For the same reason an override is put through the
|
|
31360
|
+
* legacy-mount trim: without it, passing the old `…/v1/be` value per call would yield `/be/be/…`.
|
|
31361
|
+
*
|
|
31362
|
+
* Defaults are listed field by field so `basePath` cannot cross into `RequestConfig`, where it has no
|
|
31363
|
+
* meaning — a spread would pass it silently, since TypeScript skips excess-property checks on spreads.
|
|
31364
|
+
*/
|
|
31365
|
+
async send(endpoint, config) {
|
|
31366
|
+
const { baseURL, ...rest } = config;
|
|
31367
|
+
const overrideBaseURL = baseURL !== void 0 && this.trimsLegacyOverrides ? stripLegacyBackendMount(baseURL) : baseURL;
|
|
31368
|
+
return makeRequest({
|
|
31369
|
+
endpoint: `${this.config.basePath}${endpoint}`,
|
|
31370
|
+
config: resolveRequestConfig(
|
|
31371
|
+
{ ...rest, ...overrideBaseURL === void 0 ? {} : { baseURL: overrideBaseURL } },
|
|
31372
|
+
{ baseURL: this.config.baseURL, timeout: this.config.timeout, headers: this.headers }
|
|
31373
|
+
),
|
|
31374
|
+
logger: this.logger,
|
|
31375
|
+
serviceLabel: "BackendApiService"
|
|
31376
|
+
});
|
|
31266
31377
|
}
|
|
31267
31378
|
/**
|
|
31268
31379
|
* Issue a request and validate the JSON body against `schema`, wrapping the result in `Result<T>`.
|
|
@@ -31273,12 +31384,7 @@ var BackendApiService = class {
|
|
|
31273
31384
|
*/
|
|
31274
31385
|
async request(endpoint, config, schema) {
|
|
31275
31386
|
try {
|
|
31276
|
-
const raw = await
|
|
31277
|
-
endpoint,
|
|
31278
|
-
config: resolveRequestConfig(config, { ...this.config, headers: this.headers }),
|
|
31279
|
-
logger: this.logger,
|
|
31280
|
-
serviceLabel: "BackendApiService"
|
|
31281
|
-
});
|
|
31387
|
+
const raw = await this.send(endpoint, config);
|
|
31282
31388
|
const parsed = v7.safeParse(schema, raw);
|
|
31283
31389
|
if (!parsed.success) {
|
|
31284
31390
|
return {
|
|
@@ -31305,12 +31411,7 @@ var BackendApiService = class {
|
|
|
31305
31411
|
*/
|
|
31306
31412
|
async requestUnvalidated(endpoint, config) {
|
|
31307
31413
|
try {
|
|
31308
|
-
const value = await
|
|
31309
|
-
endpoint,
|
|
31310
|
-
config: resolveRequestConfig(config, { ...this.config, headers: this.headers }),
|
|
31311
|
-
logger: this.logger,
|
|
31312
|
-
serviceLabel: "BackendApiService"
|
|
31313
|
-
});
|
|
31414
|
+
const value = await this.send(endpoint, config);
|
|
31314
31415
|
return { ok: true, value };
|
|
31315
31416
|
} catch (error) {
|
|
31316
31417
|
return { ok: false, error: toExternalApiError({ api: "backend", feature: "backend", endpoint, error }) };
|
|
@@ -31612,8 +31713,9 @@ var BackendApiService = class {
|
|
|
31612
31713
|
* without constructing a new service instance. Existing header keys are
|
|
31613
31714
|
* overwritten; keys absent from `headers` are preserved.
|
|
31614
31715
|
*
|
|
31615
|
-
* Headers also reach `swaps
|
|
31616
|
-
*
|
|
31716
|
+
* Headers also reach `swaps` and `bridge`, but never `sponsoring`: it is configured independently, so
|
|
31717
|
+
* base-API credentials must not be forwarded to whatever origin it points at. Note `swaps` can also be
|
|
31718
|
+
* retargeted to another origin via `swapsApiConfig`, in which case a header set here follows it.
|
|
31617
31719
|
*
|
|
31618
31720
|
* @param headers - Key-value pairs to add or overwrite in the default headers.
|
|
31619
31721
|
*/
|
|
@@ -31625,13 +31727,22 @@ var BackendApiService = class {
|
|
|
31625
31727
|
this.bridge.setHeaders(headers);
|
|
31626
31728
|
}
|
|
31627
31729
|
/**
|
|
31628
|
-
* Return the
|
|
31730
|
+
* Return the gateway root the service is currently pointing at — WITHOUT this service's own mount.
|
|
31731
|
+
* Requests go to `getBaseURL() + getBasePath() + <route>`.
|
|
31629
31732
|
*
|
|
31630
|
-
* @returns The `baseURL` from the `ApiConfig` this instance was
|
|
31733
|
+
* @returns The resolved gateway root, i.e. the `baseURL` from the `ApiConfig` this instance was
|
|
31734
|
+
* constructed with, minus a legacy `/be` suffix if one was supplied.
|
|
31631
31735
|
*/
|
|
31632
31736
|
getBaseURL() {
|
|
31633
31737
|
return this.config.baseURL;
|
|
31634
31738
|
}
|
|
31739
|
+
/**
|
|
31740
|
+
* Return the backend data API's mount below {@link getBaseURL} — `/be` by default, or whatever
|
|
31741
|
+
* `basePath` the `ApiConfig` supplied (`''` for a service addressed directly at its origin).
|
|
31742
|
+
*/
|
|
31743
|
+
getBasePath() {
|
|
31744
|
+
return this.config.basePath;
|
|
31745
|
+
}
|
|
31635
31746
|
};
|
|
31636
31747
|
|
|
31637
31748
|
// src/bridge/errors.ts
|
|
@@ -42069,4 +42180,4 @@ var isPartnerError = isCodeMember(PARTNER_CODES);
|
|
|
42069
42180
|
(*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
42070
42181
|
*/
|
|
42071
42182
|
|
|
42072
|
-
export { ALLOWANCE_CHECK_CODES, APPROVE_CODES, AssetService, BITCOIN_CHAIN_KEYS, BITCOIN_CHAIN_KEYS_SET, BITCOIN_DUST_SATS, BTC_WALLET_ADDRESS_TYPES, BackendApiService, BackendHttpError, BalnSwapService, BigIntToHex, BigNumberZeroDecimal, BitcoinSpokeService, BnUSDMigrationService, BridgeApiService, BridgeService, CHAIN_KEYS, CHAIN_LOGO_BASE_URL, CONFIG_VERSION, CREATE_INTENT_CODES, ChainKeys, ChainTypeArr, ClService, ConfigService, CustomSorobanServer, CustomStellarAccount, DEFAULT_BACKEND_API_ENDPOINT, DEFAULT_BACKEND_API_HEADERS, DEFAULT_BACKEND_API_TIMEOUT, DEFAULT_DEADLINE_OFFSET, DEFAULT_MAX_RETRY, DEFAULT_RELAYER_API_ENDPOINT, DEFAULT_RELAY_TX_TIMEOUT, DEFAULT_RETRY_DELAY_MS, DEFAULT_SPONSORING_API_ENDPOINT, DexService, EVM_CHAIN_ID_TO_KEY, EVM_CHAIN_KEYS, EVM_CHAIN_KEYS_SET, EVM_SPOKE_ONLY_CHAIN_KEYS, EVM_SPOKE_ONLY_CHAIN_KEYS_SET, Erc20Service, Erc4626Service, EvmAssetManagerService, EvmHubProvider, EvmSolverService, EvmSpokeService, EvmVaultTokenService, FEE_PERCENTAGE_SCALE, GAS_ESTIMATION_CODES, HALF_RAY, HALF_WAD, HUB_CHAIN_KEY, HookKind, HookService, HttpRelayError, HubVaultSymbols, ICON_CHAIN_KEYS, ICON_CHAIN_KEYS_SET, ICON_TX_RESULT_WAIT_MAX_RETRY, INJECTIVE_CHAIN_KEYS, INJECTIVE_CHAIN_KEYS_SET, INTENT_CHAIN_IDS, IconSpokeService, IcxMigrationService, Injective20Token, InjectiveSpokeService, IntentCreatedEventAbi, IntentDataService, IntentDataType, IntentFilledEventAbi, IntentRelayChainIdToChainKey, IntentsAbi, LOOKUP_CODES, LTV_PRECISION, LendingPoolService, LeverageYieldService, LockupMultiplier, LockupPeriod, LsodaSymbols, LsodaTokens, MAX_UINT256, MigrationService, MintPositionEventAbi, MoneyMarketDataService, MoneyMarketService, NEAR_CHAIN_KEYS, NEAR_CHAIN_KEYS_SET, NEAR_DEFAULT_GAS, NEAR_STORAGE_DEPOSIT, NearSpokeService, PartnerFeeClaimService, PartnerService, Permit2Service, ProtocolIntentsAbi, RAY, RAY_DECIMALS, RELAY_ERROR_CODES, RELAY_FALLBACK_FLOOR_MS, RadfiApiError, RadfiProvider, RecoveryService, RelayChainIdMap, SECONDS_PER_YEAR, SODAX_ERROR_CODES, SODAX_FEATURES, SOLANA_CHAIN_KEYS, SOLANA_CHAIN_KEYS_SET, SONIC_CHAIN_KEYS, SONIC_CHAIN_KEYS_SET, SPONSORING_API_ERROR_CODES, SPONSORING_API_STELLAR_BASE_PATH, SPONSOR_CONFIG_TTL_MS, STACKS_CHAIN_KEYS, STACKS_CHAIN_KEYS_SET, STELLAR_BASE_RESERVE_TTL_MS, STELLAR_CHAIN_KEYS, STELLAR_CHAIN_KEYS_SET, STELLAR_TRUSTLINE_MIN_XLM_STROOPS, SUI_CHAIN_KEYS, SUI_CHAIN_KEYS_SET, SodaTokens, Sodax, SodaxError, SolanaSpokeService, SolverApiService, SolverIntentErrorCode, SolverIntentStatusCode, SonicSpokeService, SpokeService, SponsoringApiService, SponsoringService, StacksSpokeService, StakingLogic, StakingService, StatATokenAddresses, StellarSpokeService, SuiSpokeService, SupportedMigrationTokens, SwapService, SwapsApiService, TOKEN_LOGO_BASE_URL, USD_DECIMALS, UiPoolDataProviderService, VAULT_TOKEN_DECIMALS, WAD, WAD_RAY_RATIO, WEI_DECIMALS, adjustAmountByFee, allowanceCheckFailed, apiConfig, approveFailed, arbitrumSupportedTokens, assetManagerAbi, avalancheSupportedTokens, balnSwapAbi, baseChainInfo, baseSupportedTokens, binomialApproximatedRayPow, bitcoinSupportedTokens, bnUSDLegacySpokeChainIds, bnUSDLegacyTokens, bridgeConfig, bridgeInvariant, bscSupportedTokens, calcOpReturnOutputVbytes, calculateAllReserveIncentives, calculateAllUserIncentives, calculateAvailableBorrowsMarketReferenceCurrency, calculateCompoundedInterest, calculateCompoundedRate, calculateFeeAmount, calculateHealthFactorFromBalances, calculateHealthFactorFromBalancesBigUnits, calculateLinearInterest, calculatePercentageFeeAmount, clPoolAbi, clPoolManagerAbi, clPositionManagerAbi, clQuoterAbi, clRouterAbi, clTickLensAbi, classifySponsorError, concentratedLiquidityConfig, connectionAbi, consoleLogger, convertTransactionInstructionToRaw, createInvariant, deepMerge, defaultHookAbi, detectBitcoinAddressType, dexConfig, dexInvariant, dexPools, encodeAddress, encodeBtcPayloadToBytes, encodeContractCalls, erc20Abi, erc4626Abi, estimateBitcoinTxSize, ethereumSupportedTokens, executionFailed, formatBasisPoints, formatEModeCategory, formatEModes, formatPercentage, formatReserve, formatReserveUSD, formatReserves, formatReservesAndIncentives, formatUserSummary, formatUserSummaryAndIncentives, gasEstimationFailed, getAllLegacybnUSDTokens, getAndFormatReserveEModes, getAssetManagerIdl, getAssetManagerProgram, getChainKeyFromRelayChainId, getChainType, getCompoundedBalance, getConcentratedLiquidityConfig, getConnectionIdl, getConnectionProgram, getEvmChainKeyByChainId, getEvmViemChain, getIconAddressBytes, getIntentRelayChainId, getLinearBalance, getMarketReferenceCurrencyAndUsdBalance, getPacket, getProvider, getRandomBytes, getReserveNormalizedIncome, getReservesEModes, getSolanaAddressBytes, getSolverConfig, getSpokeHook, getSpokeHooks, getStagingSolverTokens, getSupportedSolverTokens, getTransactionPackets, getbnUSDToken, hederaSupportedTokens, hexToBigInt, hexToSolanaAddress, hubConfig, hyper, hyperevmSupportedTokens, iconSupportedTokens, injectiveSupportedTokens, intentCreationFailed, isBackendHttpError, isBalnMigrateParams, isBitcoinChainKey, isBitcoinChainKeyType, isBitcoinWalletProviderType, isBridgeAllowanceCheckError, isBridgeApproveError, isBridgeCreateIntentError, isBridgeError, isBridgeLookupError, isBridgeOrchestrationError, isCodeMember, isDexApproveError, isDexCreateIntentError, isDexError, isEvmChainKey, isEvmChainKeyType, isEvmSpokeChainConfig, isEvmSpokeOnlyChainKey, isEvmSpokeOnlyChainKeyType, isEvmWalletProviderType, isFeatureError, isHookSupportedToken, isHubChainKey, isHubChainKeyType, isIconAddress, isIconChainKey, isIconChainKeyType, isIcxCreateRevertMigrationParams, isIcxMigrateParams, isInjectiveChainKey, isInjectiveChainKeyType, isJsonRpcPayloadResponse, isLegacybnUSDChainId, isLegacybnUSDToken, isLeverageYieldAllowanceCheckError, isLeverageYieldApproveError, isLeverageYieldCreateIntentError, isLeverageYieldError, isLeverageYieldLookupError, isLeverageYieldPostExecutionError, isLeverageYieldSwapError, isMigrateOrchestrationError, isMigrationAllowanceCheckError, isMigrationApproveError, isMigrationCreateIntentError, isMigrationError, isMigrationLookupError, isMoneyMarketAllowanceCheckError, isMoneyMarketApproveError, isMoneyMarketCreateIntentError, isMoneyMarketError, isMoneyMarketGasEstimationError, isMoneyMarketOrchestrationError, isNativeBitcoinToken, isNativeBitcoinTransfer, isNativeToken, isNearChainKey, isNearChainKeyType, isNewbnUSDChainId, isNewbnUSDToken, isOptionalBitcoinWalletProviderType, isOptionalEvmWalletProviderType, isOptionalStellarWalletProviderType, isPartnerError, isPartnerFeeAmount, isPartnerFeePercentage, isPostExecutionError, isRawDestinationParams, isRecoveryError, isResponseAddressType, isResponseSigningType, isRevertMigrationOrchestrationError, isSodaxError, isSolanaChainKey, isSolanaChainKeyType, isSolanaNativeToken, isSonicChainKey, isSonicChainKeyType, isSpokeApproveParamsEvmSpoke, isSpokeApproveParamsHub, isSpokeApproveParamsStellar, isSpokeChainKey, isSpokeIsAllowanceValidParamsEvmSpoke, isSpokeIsAllowanceValidParamsHub, isSpokeIsAllowanceValidParamsStellar, isSponsoringConfigError, isSponsoringLookupError, isSponsoringOrchestrationError, isStacksChainKey, isStacksChainKeyType, isStakeOrchestrationError, isStakingAllowanceCheckError, isStakingApproveError, isStakingCreateIntentError, isStakingError, isStakingInfoFetchError, isStakingOrchestrationError, isStellarChainKey, isStellarChainKeyType, isStellarWalletProviderType, isSuiChainKey, isSuiChainKeyType, isSupportedBitcoinAddressType, isSwapCreateIntentError, isSwapError, isSwapSupportedToken, isUndefinedOrValidWalletProviderForChainKey, isUnifiedBnUSDMigrateParams, isValidWalletProviderForChainKey, kaiaSupportedTokens, leverageYieldConfig, leverageYieldInvariant, leverageYieldVaults, lightlinkSupportedTokens, lookupFailed, mapRelayFailure, mergeSodaxConfig, messageOf, migrationInvariant, mintPositionParamsAbi, mmInvariant, modifyLiquidityParamsAbi, moneyMarketConfig, moneyMarketReserveAssets, moneyMarketSupportedTokens, nativeToUSD, nearSupportedTokens, newbnUSDSpokeChainIds, noopAnalytics, normalize, normalizeBN, normalizePsbtToBase64, normalizeSignatureToBase64, normalizedToUsd, optimismSupportedTokens, pancakeSwapInfinityDefaultHookAbi, pancakeSwapInfinityPoolManagerAbi, pancakeSwapInfinityPositionManagerAbi, parseToStroops, parseTokenArrayFromJson, partnerInvariant, permit2Abi, polygonSupportedTokens, poolAbi, poolKeyAbi, randomUint256, rayDiv, rayMul, rayPow, rayToWad, recoveryInvariant, redbellySupportedTokens, relayConfig, relayTxAndWaitPacket, requestAddress, requestJsonRpc, requestSigning, resolveAnalytics, resolveLogger, retry, reverseEncodeAddress, serializeAddressData, silentLogger, sleep, sodaxConfig, sodaxInvariant, solanaSupportedTokens, solverConfig, sonicSupportedTokens, sonicWalletFactoryAbi, spokeAssetManagerAbi, spokeChainConfig, spokeChainKeysSet, spokeHooks, sponsoringInvariant, stacksSupportedTokens, stagingSwapSupportedTokens, stakedSodaAbi, stakingInvariant, stakingRouterAbi, stataTokenFactoryAbi, stellarSupportedTokens, submitTransaction, suiSupportedTokens, supportedSpokeChains, supportedTokensByChain, swapExactInSingleParamsAbi, swapInvariant, swapSupportedTokens, swapsConfig, toCreateBridgeIntentParamsV2, tokenLogo, tokenLogoSlug, uiPoolDataAbi, universalRouterAbi, unknownFailed, usesBip322MessageSigning, valueToBigNumber, valueToZDBigNumber, variableDebtTokenAbi, vaultTokenAbi, verifyFailed, wadToRay, waitForStacksTransaction, waitForTransactionReceipt, waitUntilIntentExecuted, walletFactoryAbi, wrappedSonicAbi };
|
|
42183
|
+
export { ALLOWANCE_CHECK_CODES, APPROVE_CODES, AssetService, BACKEND_API_BASE_PATH, BITCOIN_CHAIN_KEYS, BITCOIN_CHAIN_KEYS_SET, BITCOIN_DUST_SATS, BTC_WALLET_ADDRESS_TYPES, BackendApiService, BackendHttpError, BalnSwapService, BigIntToHex, BigNumberZeroDecimal, BitcoinSpokeService, BnUSDMigrationService, BridgeApiService, BridgeService, CHAIN_KEYS, CHAIN_LOGO_BASE_URL, CONFIG_VERSION, CREATE_INTENT_CODES, ChainKeys, ChainTypeArr, ClService, ConfigService, CustomSorobanServer, CustomStellarAccount, DEFAULT_API_BASE_URL, DEFAULT_BACKEND_API_ENDPOINT, DEFAULT_BACKEND_API_HEADERS, DEFAULT_BACKEND_API_TIMEOUT, DEFAULT_DEADLINE_OFFSET, DEFAULT_MAX_RETRY, DEFAULT_RELAYER_API_ENDPOINT, DEFAULT_RELAY_TX_TIMEOUT, DEFAULT_RETRY_DELAY_MS, DEFAULT_SPONSORING_API_ENDPOINT, DexService, EVM_CHAIN_ID_TO_KEY, EVM_CHAIN_KEYS, EVM_CHAIN_KEYS_SET, EVM_SPOKE_ONLY_CHAIN_KEYS, EVM_SPOKE_ONLY_CHAIN_KEYS_SET, Erc20Service, Erc4626Service, EvmAssetManagerService, EvmHubProvider, EvmSolverService, EvmSpokeService, EvmVaultTokenService, FEE_PERCENTAGE_SCALE, GAS_ESTIMATION_CODES, HALF_RAY, HALF_WAD, HUB_CHAIN_KEY, HookKind, HookService, HttpRelayError, HubVaultSymbols, ICON_CHAIN_KEYS, ICON_CHAIN_KEYS_SET, ICON_TX_RESULT_WAIT_MAX_RETRY, INJECTIVE_CHAIN_KEYS, INJECTIVE_CHAIN_KEYS_SET, INTENT_CHAIN_IDS, IconSpokeService, IcxMigrationService, Injective20Token, InjectiveSpokeService, IntentCreatedEventAbi, IntentDataService, IntentDataType, IntentFilledEventAbi, IntentRelayChainIdToChainKey, IntentsAbi, LOOKUP_CODES, LTV_PRECISION, LendingPoolService, LeverageYieldService, LockupMultiplier, LockupPeriod, LsodaSymbols, LsodaTokens, MAX_UINT256, MigrationService, MintPositionEventAbi, MoneyMarketDataService, MoneyMarketService, NEAR_CHAIN_KEYS, NEAR_CHAIN_KEYS_SET, NEAR_DEFAULT_GAS, NEAR_STORAGE_DEPOSIT, NearSpokeService, PartnerFeeClaimService, PartnerService, Permit2Service, ProtocolIntentsAbi, RAY, RAY_DECIMALS, RELAY_ERROR_CODES, RELAY_FALLBACK_FLOOR_MS, RadfiApiError, RadfiProvider, RecoveryService, RelayChainIdMap, SECONDS_PER_YEAR, SODAX_ERROR_CODES, SODAX_FEATURES, SOLANA_CHAIN_KEYS, SOLANA_CHAIN_KEYS_SET, SONIC_CHAIN_KEYS, SONIC_CHAIN_KEYS_SET, SPONSORING_API_ERROR_CODES, SPONSORING_API_STELLAR_BASE_PATH, SPONSOR_CONFIG_TTL_MS, STACKS_CHAIN_KEYS, STACKS_CHAIN_KEYS_SET, STELLAR_BASE_RESERVE_TTL_MS, STELLAR_CHAIN_KEYS, STELLAR_CHAIN_KEYS_SET, STELLAR_TRUSTLINE_MIN_XLM_STROOPS, SUI_CHAIN_KEYS, SUI_CHAIN_KEYS_SET, SodaTokens, Sodax, SodaxError, SolanaSpokeService, SolverApiService, SolverIntentErrorCode, SolverIntentStatusCode, SonicSpokeService, SpokeService, SponsoringApiService, SponsoringService, StacksSpokeService, StakingLogic, StakingService, StatATokenAddresses, StellarSpokeService, SuiSpokeService, SupportedMigrationTokens, SwapService, SwapsApiService, TOKEN_LOGO_BASE_URL, USD_DECIMALS, UiPoolDataProviderService, VAULT_TOKEN_DECIMALS, WAD, WAD_RAY_RATIO, WEI_DECIMALS, adjustAmountByFee, allowanceCheckFailed, apiConfig, approveFailed, arbitrumSupportedTokens, assetManagerAbi, avalancheSupportedTokens, balnSwapAbi, baseChainInfo, baseSupportedTokens, binomialApproximatedRayPow, bitcoinSupportedTokens, bnUSDLegacySpokeChainIds, bnUSDLegacyTokens, bridgeConfig, bridgeInvariant, bscSupportedTokens, calcOpReturnOutputVbytes, calculateAllReserveIncentives, calculateAllUserIncentives, calculateAvailableBorrowsMarketReferenceCurrency, calculateCompoundedInterest, calculateCompoundedRate, calculateFeeAmount, calculateHealthFactorFromBalances, calculateHealthFactorFromBalancesBigUnits, calculateLinearInterest, calculatePercentageFeeAmount, clPoolAbi, clPoolManagerAbi, clPositionManagerAbi, clQuoterAbi, clRouterAbi, clTickLensAbi, classifySponsorError, concentratedLiquidityConfig, connectionAbi, consoleLogger, convertTransactionInstructionToRaw, createInvariant, deepMerge, defaultHookAbi, detectBitcoinAddressType, dexConfig, dexInvariant, dexPools, encodeAddress, encodeBtcPayloadToBytes, encodeContractCalls, erc20Abi, erc4626Abi, estimateBitcoinTxSize, ethereumSupportedTokens, executionFailed, formatBasisPoints, formatEModeCategory, formatEModes, formatPercentage, formatReserve, formatReserveUSD, formatReserves, formatReservesAndIncentives, formatUserSummary, formatUserSummaryAndIncentives, gasEstimationFailed, getAllLegacybnUSDTokens, getAndFormatReserveEModes, getAssetManagerIdl, getAssetManagerProgram, getChainKeyFromRelayChainId, getChainType, getCompoundedBalance, getConcentratedLiquidityConfig, getConnectionIdl, getConnectionProgram, getEvmChainKeyByChainId, getEvmViemChain, getIconAddressBytes, getIntentRelayChainId, getLinearBalance, getMarketReferenceCurrencyAndUsdBalance, getPacket, getProvider, getRandomBytes, getReserveNormalizedIncome, getReservesEModes, getSolanaAddressBytes, getSolverConfig, getSpokeHook, getSpokeHooks, getStagingSolverTokens, getSupportedSolverTokens, getTransactionPackets, getbnUSDToken, hederaSupportedTokens, hexToBigInt, hexToSolanaAddress, hubConfig, hyper, hyperevmSupportedTokens, iconSupportedTokens, injectiveSupportedTokens, intentCreationFailed, isBackendHttpError, isBalnMigrateParams, isBitcoinChainKey, isBitcoinChainKeyType, isBitcoinWalletProviderType, isBridgeAllowanceCheckError, isBridgeApproveError, isBridgeCreateIntentError, isBridgeError, isBridgeLookupError, isBridgeOrchestrationError, isCodeMember, isDexApproveError, isDexCreateIntentError, isDexError, isEvmChainKey, isEvmChainKeyType, isEvmSpokeChainConfig, isEvmSpokeOnlyChainKey, isEvmSpokeOnlyChainKeyType, isEvmWalletProviderType, isFeatureError, isHookSupportedToken, isHubChainKey, isHubChainKeyType, isIconAddress, isIconChainKey, isIconChainKeyType, isIcxCreateRevertMigrationParams, isIcxMigrateParams, isInjectiveChainKey, isInjectiveChainKeyType, isJsonRpcPayloadResponse, isLegacybnUSDChainId, isLegacybnUSDToken, isLeverageYieldAllowanceCheckError, isLeverageYieldApproveError, isLeverageYieldCreateIntentError, isLeverageYieldError, isLeverageYieldLookupError, isLeverageYieldPostExecutionError, isLeverageYieldSwapError, isMigrateOrchestrationError, isMigrationAllowanceCheckError, isMigrationApproveError, isMigrationCreateIntentError, isMigrationError, isMigrationLookupError, isMoneyMarketAllowanceCheckError, isMoneyMarketApproveError, isMoneyMarketCreateIntentError, isMoneyMarketError, isMoneyMarketGasEstimationError, isMoneyMarketOrchestrationError, isNativeBitcoinToken, isNativeBitcoinTransfer, isNativeToken, isNearChainKey, isNearChainKeyType, isNewbnUSDChainId, isNewbnUSDToken, isOptionalBitcoinWalletProviderType, isOptionalEvmWalletProviderType, isOptionalStellarWalletProviderType, isPartnerError, isPartnerFeeAmount, isPartnerFeePercentage, isPostExecutionError, isRawDestinationParams, isRecoveryError, isResponseAddressType, isResponseSigningType, isRevertMigrationOrchestrationError, isSodaxError, isSolanaChainKey, isSolanaChainKeyType, isSolanaNativeToken, isSonicChainKey, isSonicChainKeyType, isSpokeApproveParamsEvmSpoke, isSpokeApproveParamsHub, isSpokeApproveParamsStellar, isSpokeChainKey, isSpokeIsAllowanceValidParamsEvmSpoke, isSpokeIsAllowanceValidParamsHub, isSpokeIsAllowanceValidParamsStellar, isSponsoringConfigError, isSponsoringLookupError, isSponsoringOrchestrationError, isStacksChainKey, isStacksChainKeyType, isStakeOrchestrationError, isStakingAllowanceCheckError, isStakingApproveError, isStakingCreateIntentError, isStakingError, isStakingInfoFetchError, isStakingOrchestrationError, isStellarChainKey, isStellarChainKeyType, isStellarWalletProviderType, isSuiChainKey, isSuiChainKeyType, isSupportedBitcoinAddressType, isSwapCreateIntentError, isSwapError, isSwapSupportedToken, isUndefinedOrValidWalletProviderForChainKey, isUnifiedBnUSDMigrateParams, isValidWalletProviderForChainKey, kaiaSupportedTokens, leverageYieldConfig, leverageYieldInvariant, leverageYieldVaults, lightlinkSupportedTokens, lookupFailed, mapRelayFailure, mergeSodaxConfig, messageOf, migrationInvariant, mintPositionParamsAbi, mmInvariant, modifyLiquidityParamsAbi, moneyMarketConfig, moneyMarketReserveAssets, moneyMarketSupportedTokens, nativeToUSD, nearSupportedTokens, newbnUSDSpokeChainIds, noopAnalytics, normalize, normalizeBN, normalizePsbtToBase64, normalizeSignatureToBase64, normalizedToUsd, optimismSupportedTokens, pancakeSwapInfinityDefaultHookAbi, pancakeSwapInfinityPoolManagerAbi, pancakeSwapInfinityPositionManagerAbi, parseToStroops, parseTokenArrayFromJson, partnerInvariant, permit2Abi, polygonSupportedTokens, poolAbi, poolKeyAbi, randomUint256, rayDiv, rayMul, rayPow, rayToWad, recoveryInvariant, redbellySupportedTokens, relayConfig, relayTxAndWaitPacket, requestAddress, requestJsonRpc, requestSigning, resolveAnalytics, resolveLogger, retry, reverseEncodeAddress, serializeAddressData, silentLogger, sleep, sodaxConfig, sodaxInvariant, solanaSupportedTokens, solverConfig, sonicSupportedTokens, sonicWalletFactoryAbi, spokeAssetManagerAbi, spokeChainConfig, spokeChainKeysSet, spokeHooks, sponsoringInvariant, stacksSupportedTokens, stagingSwapSupportedTokens, stakedSodaAbi, stakingInvariant, stakingRouterAbi, stataTokenFactoryAbi, stellarSupportedTokens, submitTransaction, suiSupportedTokens, supportedSpokeChains, supportedTokensByChain, swapExactInSingleParamsAbi, swapInvariant, swapSupportedTokens, swapsConfig, toCreateBridgeIntentParamsV2, tokenLogo, tokenLogoSlug, uiPoolDataAbi, universalRouterAbi, unknownFailed, usesBip322MessageSigning, valueToBigNumber, valueToZDBigNumber, variableDebtTokenAbi, vaultTokenAbi, verifyFailed, wadToRay, waitForStacksTransaction, waitForTransactionReceipt, waitUntilIntentExecuted, walletFactoryAbi, wrappedSonicAbi };
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"version": "2.1.0-rc.
|
|
7
|
+
"version": "2.1.0-rc.5",
|
|
8
8
|
"license": "MIT",
|
|
9
9
|
"description": "Sodax SDK",
|
|
10
10
|
"keywords": [
|
|
@@ -67,9 +67,9 @@
|
|
|
67
67
|
"rlp": "3.0.0",
|
|
68
68
|
"viem": "2.29.2",
|
|
69
69
|
"valibot": "1.4.1",
|
|
70
|
-
"@sodax/swaps-api": "2.1.0-rc.
|
|
71
|
-
"@sodax/
|
|
72
|
-
"@sodax/
|
|
70
|
+
"@sodax/swaps-api": "2.1.0-rc.5",
|
|
71
|
+
"@sodax/libs": "2.1.0-rc.5",
|
|
72
|
+
"@sodax/types": "2.1.0-rc.5"
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
75
|
"@arethetypeswrong/cli": "0.17.4",
|