aboutsummaryrefslogtreecommitdiff
path: root/src/js/url-generators.js
blob: c950f1e87b0bc101cce46290549e2f6ec5014bbc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
 * URL generators
 *
 * This file contains functions that generate URL
 * based on the activeSettings.
 *
 * Apparently, we need `arching-kaos-web-ui-settings` to be loaded first
 *
 */

function getIPNSURL(ipnsKey){
    return activeSettings.ipfsGatewayAddress[activeSettings.ipfsSelectedGatewayAddress]+'ipns/'+ipnsKey;
}

function getIPFSURL(ipfsHash){
    return activeSettings.ipfsGatewayAddress[activeSettings.ipfsSelectedGatewayAddress]+'ipfs/'+ipfsHash;
}

function getHoldersOfActiveAssetURL(){
    return activeSettings.horizonAddresses[activeSettings.horizonSelectedAddress]+
        'accounts?asset='+
        activeSettings.stellarAssetsForScanning[activeSettings.stellarDefaultAsset].code+
        ':'+
        activeSettings.stellarAssetsForScanning[activeSettings.stellarDefaultAsset].issuer+
        '&limit=200';
}

function getTrustlinesURL(code=null, issuer=null){
    var code = (code === null)? activeSettings.stellarAssetsForScanning[activeSettings.stellarDefaultAsset].code : code;
    var issuer = (issuer === null) ? activeSettings.stellarAssetsForScanning[activeSettings.stellarDefaultAsset].issuer : issuer;
    return activeSettings.horizonAddresses[activeSettings.horizonSelectedAddress]+
        'assets?asset_code='+code+
        '&asset_issuer='+issuer;
}

// vim: tabstop=4 shiftwidth=4 expandtab softtabstop=4