aboutsummaryrefslogtreecommitdiff
path: root/src/js/arching-kaos-stellar-network.js
diff options
context:
space:
mode:
authorkaotisk <kaotisk@arching-kaos.org>2025-07-21 16:43:41 +0300
committerkaotisk <kaotisk@arching-kaos.org>2025-07-21 16:43:41 +0300
commit81c170c99f58e28270fb5306b759b231578e36a9 (patch)
tree9e442cc6baa98cda0566493e40f7c4491cda1873 /src/js/arching-kaos-stellar-network.js
parent8ad73165db077ced4d9ced285eb5371ac746c5cc (diff)
downloadarching-kaos-web-ui-81c170c99f58e28270fb5306b759b231578e36a9.tar.gz
arching-kaos-web-ui-81c170c99f58e28270fb5306b759b231578e36a9.tar.bz2
arching-kaos-web-ui-81c170c99f58e28270fb5306b759b231578e36a9.zip
AKNS records resolver + Donations page
Diffstat (limited to 'src/js/arching-kaos-stellar-network.js')
-rw-r--r--src/js/arching-kaos-stellar-network.js29
1 files changed, 24 insertions, 5 deletions
diff --git a/src/js/arching-kaos-stellar-network.js b/src/js/arching-kaos-stellar-network.js
index a20365c..85ea8af 100644
--- a/src/js/arching-kaos-stellar-network.js
+++ b/src/js/arching-kaos-stellar-network.js
@@ -66,13 +66,22 @@ function renderStellarAddressesAndProceed(json){
if (json._links.next) getHolders(json._links.next.href);
}
-function renderConfigurationIPNSLinkAndProceed(json, stellarAddress){
+function renderConfigurationLinkAndProceed(json, stellarAddress){
renderStellarAddress(stellarAddress);
document.querySelector('#'+stellarAddress).style="color: #3dbb3d;"
increaseStellarNetworkConfiguredAddresses();
debugLog(atob(json.value));
debugLog(stellarAddress);
- getConfiguration(atob(json.value),stellarAddress);
+ var key = json.value
+ const base64Regex = /^[A-Z0-9+\/=]{28}/i;
+ if (base64Regex.test(atob(key)))
+ {
+ getConfiguration(atob(key), stellarAddress);
+ }
+ else
+ {
+ getConfiguration(atob(key),stellarAddress);
+ }
}
function getTrustlines(){
@@ -106,7 +115,7 @@ function getHolders(a=0){
function checkAddressForConfigurationVariable(stellarAddress) {
archingKaosLog("Checking configuration for "+ stellarAddress+ "...");
- archingKaosFetchJSON(getStellarConfigurationVariableURL(stellarAddress), renderConfigurationIPNSLinkAndProceed, stellarAddress);
+ archingKaosFetchJSON(getStellarConfigurationVariableURL(stellarAddress), renderConfigurationLinkAndProceed, stellarAddress);
progressPlaceholder().value++;
}
@@ -155,7 +164,17 @@ async function fetchNodeInfoFromClientWallet(stellarAddress){
makeElement(cnf, document.querySelector('#stellar-data-config'));
progressPlaceholder().max++;
progressPlaceholder().value++;
- getConfiguration(atob(json.value),stellarAddress);
+ key = json.value
+ regex= /[a-zA-Z0-9+\/=]{29}/
+ const base64Regex = /^[A-Z0-9+\/=]{28}/i;
+ if (base64Regex.test(atob(key)))
+ {
+ getConfiguration(atob(key), stellarAddress);
+ }
+ else
+ {
+ getConfiguration(atob(key),stellarAddress);
+ }
});
}
});
@@ -186,7 +205,7 @@ const retrievePublicKey = async () => {
return publicKey;
};
-function connect(){
+export function connect(){
// if ( stellar_connection_status === 1 ){
// showStellar();
// } else {