From afcedd44615d20423d58f4d9c9d8cfa3838a54d4 Mon Sep 17 00:00:00 2001 From: kaotisk Date: Fri, 29 Nov 2024 16:23:39 +0200 Subject: Major refactoring --- src/js/url-generators.js | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'src/js/url-generators.js') diff --git a/src/js/url-generators.js b/src/js/url-generators.js index d0739dc..55b9cdb 100644 --- a/src/js/url-generators.js +++ b/src/js/url-generators.js @@ -14,16 +14,27 @@ * Apparently, we need `arching-kaos-web-ui-settings` to be loaded first * */ +import { getSettings } from "./arching-kaos-web-ui-settings.js"; -function getIPNSURL(ipnsKey){ +const settings = getSettings(); + +export function getStellarConfigurationVariableURL(stellarAddress){ + return settings.stellar.horizon.list[settings.stellar.horizon.active]+ + 'accounts/'+ + stellarAddress+ + '/data/'+ + settings.stellar.variableNames.list[settings.stellar.variableNames.active]; +} + +export function getIPNSURL(ipnsKey){ return settings.ipfs.gateway.list[settings.ipfs.gateway.active]+'ipns/'+ipnsKey; } -function getIPFSURL(ipfsHash){ +export function getIPFSURL(ipfsHash){ return settings.ipfs.gateway.list[settings.ipfs.gateway.active]+'ipfs/'+ipfsHash; } -function getHoldersOfActiveAssetURL(){ +export function getHoldersOfActiveAssetURL(){ return settings.stellar.horizon.list[settings.stellar.horizon.active]+ 'accounts?asset='+ settings.stellar.asset.list[settings.stellar.asset.active].code+ @@ -32,7 +43,7 @@ function getHoldersOfActiveAssetURL(){ '&limit=200'; } -function getTrustlinesURL(code=null, issuer=null){ +export function getTrustlinesURL(code=null, issuer=null){ var code = (code === null)? settings.stellar.asset.list[settings.stellar.asset.active].code : code; var issuer = (issuer === null) ? settings.stellar.asset.list[settings.stellar.asset.active].issuer : issuer; return settings.stellar.horizon.list[settings.stellar.horizon.active]+ -- cgit v1.2.3