@pendle/sdk-boros 1.0.1-logstore-1 → 1.0.1-logstore-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -22,20 +22,21 @@ const addresses_1 = require("../../addresses");
|
|
|
22
22
|
const LogStoreBackend_1 = require("./LogStoreBackend");
|
|
23
23
|
const PROD_LOG_STORE_BACKEND_URL = 'https://api-v2.pendle.finance/log-store';
|
|
24
24
|
const STAGING_LOG_STORE_BACKEND_URL = 'https://staging-api.pendle.finance/log-store';
|
|
25
|
-
function getLogStoreBackendUrl() {
|
|
26
|
-
|
|
25
|
+
function getLogStoreBackendUrl(customEnv) {
|
|
26
|
+
const currentEnv = customEnv ?? addresses_1.env;
|
|
27
|
+
return currentEnv === 'production' ? PROD_LOG_STORE_BACKEND_URL : STAGING_LOG_STORE_BACKEND_URL;
|
|
27
28
|
}
|
|
28
29
|
exports.cachedSdk = {};
|
|
29
30
|
function createSdk(baseURL, params) {
|
|
30
31
|
const sdk = new LogStoreBackend_1.Sdk({
|
|
31
32
|
baseURL,
|
|
32
|
-
headers: { ...(params.apiKey != null ? { 'api-key': params.apiKey } : {}) },
|
|
33
|
+
headers: { 'x-sdk-ui-version': '0.0.0-boros', ...(params.apiKey != null ? { 'api-key': params.apiKey } : {}) },
|
|
33
34
|
});
|
|
34
35
|
return sdk;
|
|
35
36
|
}
|
|
36
37
|
function getSdk(params) {
|
|
37
38
|
const { apiKey, disableAxiosInterceptors } = params ?? {};
|
|
38
|
-
const baseURL = getLogStoreBackendUrl();
|
|
39
|
+
const baseURL = getLogStoreBackendUrl(params?.env);
|
|
39
40
|
const key = `${addresses_1.env}`;
|
|
40
41
|
const x = exports.cachedSdk[key];
|
|
41
42
|
return x !== undefined ? x : (exports.cachedSdk[key] = createSdk(baseURL, { apiKey, disableAxiosInterceptors }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../../src/backend/LogStore/module.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../../src/backend/LogStore/module.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AA4BA,8BASC;AAED,wBAUC;AA/CD,oDAAkC;AAClC,+CAAmD;AAEnD,uDAAwC;AAMxC,MAAM,0BAA0B,GAAG,yCAAyC,CAAC;AAC7E,MAAM,6BAA6B,GAAG,8CAA8C,CAAC;AAErF,SAAS,qBAAqB,CAAC,SAAuB;IACpD,MAAM,UAAU,GAAG,SAAS,IAAI,eAAG,CAAC;IACpC,OAAO,UAAU,KAAK,YAAY,CAAC,CAAC,CAAC,0BAA0B,CAAC,CAAC,CAAC,6BAA6B,CAAC;AAClG,CAAC;AASY,QAAA,SAAS,GAA6C,EAAE,CAAC;AAEtE,SAAgB,SAAS,CAAC,OAAe,EAAE,MAA+D;IACxG,MAAM,GAAG,GAAG,IAAI,qBAAG,CAAU;QAC3B,OAAO;QACP,OAAO,EAAE,EAAE,kBAAkB,EAAE,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE;KAC/G,CAAC,CAAC;IAIH,OAAO,GAAG,CAAC;AACb,CAAC;AAED,SAAgB,MAAM,CAAC,MAItB;IACC,MAAM,EAAE,MAAM,EAAE,wBAAwB,EAAE,GAAG,MAAM,IAAI,EAAE,CAAC;IAC1D,MAAM,OAAO,GAAG,qBAAqB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACnD,MAAM,GAAG,GAAG,GAAG,eAAG,EAAW,CAAC;IAC9B,MAAM,CAAC,GAAG,iBAAS,CAAC,GAAG,CAAC,CAAC;IACzB,OAAO,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,iBAAS,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,wBAAwB,EAAE,CAAC,CAAC,CAAC;AAC3G,CAAC"}
|