aboutsummaryrefslogtreecommitdiff
path: root/src/js/url-generators.js
diff options
context:
space:
mode:
authorkaotisk <kaotisk@arching-kaos.org>2024-11-29 16:23:39 +0200
committerkaotisk <kaotisk@arching-kaos.org>2024-11-29 16:23:39 +0200
commitafcedd44615d20423d58f4d9c9d8cfa3838a54d4 (patch)
treee16cd7f2eb4040f7b237baa45aa3f8f80516dcc4 /src/js/url-generators.js
parent084e3ce6efc49c2d43ce9b44d96e430f8057848e (diff)
downloadarching-kaos-web-ui-afcedd44615d20423d58f4d9c9d8cfa3838a54d4.tar.gz
arching-kaos-web-ui-afcedd44615d20423d58f4d9c9d8cfa3838a54d4.tar.bz2
arching-kaos-web-ui-afcedd44615d20423d58f4d9c9d8cfa3838a54d4.zip
Major refactoring
Diffstat (limited to 'src/js/url-generators.js')
-rw-r--r--src/js/url-generators.js19
1 files changed, 15 insertions, 4 deletions
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]+