-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c31bb20
commit 4ba7e0b
Showing
6 changed files
with
36 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,25 @@ | ||
const API_URL = 'https://api.dlc.link'; | ||
export const POINTS_API_URL = `${API_URL}/points`; | ||
export const PROOF_OF_RESERVE_API_URL = `${API_URL}/proof-of-reserve`; | ||
export const MINT_BURN_EVENTS_API_URL = `${API_URL}/mint-burn-events`; | ||
export const TOTAL_SUPPLY_API_URL = `${API_URL}/dlcbtc/total-supply`; | ||
import { AppEnvironment } from '@models/configuration'; | ||
|
||
const BASE_API_URLS = { | ||
[AppEnvironment.MAINNET]: 'https://api.dlc.link', | ||
[AppEnvironment.TESTNET]: 'https://testnet.api.dlc.link', | ||
[AppEnvironment.DEVNET]: 'https://devnet.api.dlc.link', | ||
[AppEnvironment.LOCALHOST]: 'http://localhost:3000', | ||
}; | ||
|
||
const API_PATHS = { | ||
POINTS: '/v1/points', | ||
PROOF_OF_RESERVE: '/v1/ibtc/proof-of-reserve', | ||
MINT_BURN_EVENTS: '/v1/ibtc/mint-burn-events', | ||
TOTAL_SUPPLY: '/v1/ibtc/total-supply', | ||
}; | ||
|
||
const getBaseApiUrl = (): string => BASE_API_URLS[appConfiguration.appEnvironment]; | ||
|
||
export const API = { | ||
BASE: getBaseApiUrl(), | ||
POINTS: `${getBaseApiUrl()}${API_PATHS.POINTS}`, | ||
PROOF_OF_RESERVE: `${getBaseApiUrl()}${API_PATHS.PROOF_OF_RESERVE}`, | ||
MINT_BURN_EVENTS: `${getBaseApiUrl()}${API_PATHS.MINT_BURN_EVENTS}`, | ||
TOTAL_SUPPLY: `${getBaseApiUrl()}${API_PATHS.TOTAL_SUPPLY}`, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters