@venly/venly-core-sdk
Version:
Javascrip/Typescript SDK for Venly's Web3 Services
33 lines • 1.42 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getApiUrl = getApiUrl;
const VyEnums_1 = require("../models/enums/VyEnums");
const getBaseUrl = (endpoint, env) => {
switch (endpoint) {
case VyEnums_1.VyApiEndpoint.Auth:
return env == VyEnums_1.VyEnvironment.Sandbox ?
'https://login-sandbox.venly.io' :
'https://login.venly.io';
case VyEnums_1.VyApiEndpoint.Wallet:
return env == VyEnums_1.VyEnvironment.Sandbox ?
'https://api-wallet-sandbox.venly.io' :
'https://api-wallet.venly.io';
// case VyApiEndpoint.Nft :
// return env == VyEnvironment.Sandbox?
// 'https://token-api-sandbox.venly.io/':
// 'https://token-api.venly.io/';
case VyEnums_1.VyApiEndpoint.Pay:
return env == VyEnums_1.VyEnvironment.Sandbox ?
'https://api-pay-sandbox.venly.io' :
'https://api-pay.venly.io';
case VyEnums_1.VyApiEndpoint.Token:
return env == VyEnums_1.VyEnvironment.Sandbox ?
'https://token-api-sandbox.venly.io/' :
'https://token-api.venly.io/';
default: return '';
}
};
function getApiUrl(uri, endpoint, env = VyEnums_1.VyEnvironment.Sandbox) {
return `${getBaseUrl(endpoint, env)}${uri}`;
}
//# sourceMappingURL=VyHttpHelper.js.map