From 03a1eb4a4946cc0f168283f5453badc8f71e4b23 Mon Sep 17 00:00:00 2001 From: kuduzow Date: Thu, 5 Jan 2023 22:32:53 +0300 Subject: [PATCH] =?UTF-8?q?URL=20custom-=D0=BE=D0=BA=D1=80=D1=83=D0=B6?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BE=D0=B1=D1=80=D0=B0=D0=B1=D0=B0?= =?UTF-8?q?=D1=82=D1=8B=D0=B2=D0=B0=D0=B5=D1=82=D1=81=D1=8F=20=D1=82=D0=B5?= =?UTF-8?q?=D0=BF=D0=B5=D1=80=D1=8C=20=D1=82=D0=B0=D0=BA=D0=B6=D0=B5=20?= =?UTF-8?q?=D0=BA=D0=B0=D0=BA=20testing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/services/ReferralSystem/index.ts | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 4399845..122aef7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@orionprotocol/sdk", - "version": "0.15.27-rc.3", + "version": "0.15.27-rc.4", "description": "Orion Protocol SDK", "main": "./lib/esm/index.js", "module": "./lib/esm/index.js", diff --git a/src/services/ReferralSystem/index.ts b/src/services/ReferralSystem/index.ts index 4216e52..81c698a 100644 --- a/src/services/ReferralSystem/index.ts +++ b/src/services/ReferralSystem/index.ts @@ -33,13 +33,13 @@ class ReferralSystem { // testing.orionprotocol.io/referral-api вместо обычного // testing.orionprotocol.io/bsc-testnet/referral-api, поэтому лишняя часть вырезается static getActualApiUrl = (apiUrl: string, env: string) => { - if (env !== 'testing') { - return `${apiUrl}/referral-api`; + if (env === 'testing' || env === 'custom') { + const { protocol, hostname } = new URL(apiUrl); + + return `${protocol}//${hostname}/referral-api`; } - const { protocol, hostname } = new URL(apiUrl); - - return `${protocol}//${hostname}/referral-api`; + return `${apiUrl}/referral-api`; }; getLink = (refererAddress: string) => fetchWithValidation(`${this.apiUrl}/referer/view/link`, linkSchema, {