Updating Track Contract tab to accomodate API changes
This commit is contained in:
parent
63467bbf82
commit
a51d48a191
27
index2.html
27
index2.html
@ -245,8 +245,8 @@
|
|||||||
//Show Top Contract in Home Page
|
//Show Top Contract in Home Page
|
||||||
getSmartContractInfo(topSmartContract.name,topSmartContract.floAddress);
|
getSmartContractInfo(topSmartContract.name,topSmartContract.floAddress);
|
||||||
|
|
||||||
function getSmartContractInfo(name,contractAddress){
|
function getSmartContractInfo(contractName,contractAddress){
|
||||||
fetch(`https://ranchimallflo.duckdns.org/api/v1.0/getsmartContractinfo?name=${name}&contractAddress=${contractAddress}`)
|
fetch(`https://ranchimallflo.duckdns.org/api/v1.0/getSmartContractInfo?contractName=${contractName}&contractAddress=${contractAddress}`)
|
||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
showSmartContractInfo(data);
|
showSmartContractInfo(data);
|
||||||
@ -263,7 +263,7 @@
|
|||||||
getSmartContractList();
|
getSmartContractList();
|
||||||
|
|
||||||
function getSmartContractList(){
|
function getSmartContractList(){
|
||||||
fetch('https://ranchimallflo.duckdns.org/api/v1.0/getsmartContractlist')
|
fetch('https://ranchimallflo.duckdns.org/api/v1.0/getSmartContractList')
|
||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
showSmartContractList(data);
|
showSmartContractList(data);
|
||||||
@ -299,8 +299,8 @@
|
|||||||
//Show Active Tokens in "Track Tokens" section
|
//Show Active Tokens in "Track Tokens" section
|
||||||
getTokenList();
|
getTokenList();
|
||||||
|
|
||||||
function getAllParticipants(name,address){
|
function getAllParticipants(contractName,contractAddress){
|
||||||
fetch(`https://ranchimallflo.duckdns.org/api/v1.0/getsmartContractparticipants?name=${name}&contractAddress=${address}`)
|
fetch(`https://ranchimallflo.duckdns.org/api/v1.0/getSmartContractParticipants?name=${contractName}&contractAddress=${contractAddress}`)
|
||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
console.log(data);
|
console.log(data);
|
||||||
@ -309,7 +309,7 @@
|
|||||||
|
|
||||||
|
|
||||||
function getTokenList(){
|
function getTokenList(){
|
||||||
fetch('https://ranchimallflo.duckdns.org/api/v1.0/gettokenlist')
|
fetch('https://ranchimallflo.duckdns.org/api/v1.0/getTokenList')
|
||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
showTokenList(data);
|
showTokenList(data);
|
||||||
@ -337,17 +337,15 @@
|
|||||||
console.log(contractForm['addressName'].value);
|
console.log(contractForm['addressName'].value);
|
||||||
|
|
||||||
if (contractForm['addressName'].value.slice(0,1) == 'F' && contractForm['addressName'].value.length == 34){
|
if (contractForm['addressName'].value.slice(0,1) == 'F' && contractForm['addressName'].value.length == 34){
|
||||||
//fetch('https://ranchimallflo.duckdns.org/api/v1.0/getparticipantdetails?floaddress='+contractForm["addressName"].value)
|
fetch('https://ranchimallflo.duckdns.org/api/v1.0/getParticipantDetails?floAddress='+contractForm['addressName'].value )
|
||||||
fetch('https://ranchimallflo.duckdns.org/api/v1.0/getparticipantdetails?floaddress='+contractForm['addressName'].value )
|
|
||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
|
|
||||||
showContractParticipantDetails(data);
|
showContractParticipantDetails(data);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
// Entered data is contract name
|
// Entered data is contract name
|
||||||
fetch(`https://ranchimallflo.duckdns.org/api/v1.0/getsmartContractlist?contractName=${contractForm["addressName"].value}`)
|
fetch(`https://ranchimallflo.duckdns.org/api/v1.0/getSmartContractList?contractName=${contractForm["addressName"].value}`)
|
||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
showContractNameDetails(data);
|
showContractNameDetails(data);
|
||||||
@ -367,18 +365,17 @@
|
|||||||
|
|
||||||
|
|
||||||
if (tokenForm['tokenName'].value.slice(0,1) == 'F' && tokenForm['tokenName'].value.length == 34){
|
if (tokenForm['tokenName'].value.slice(0,1) == 'F' && tokenForm['tokenName'].value.length == 34){
|
||||||
fetch(`https://ranchimallflo.duckdns.org/api/v1.0/gettokeninfo?floaddress=${tokenForm["tokenName"].value}`)
|
fetch(`https://ranchimallflo.duckdns.org/api/v1.0/getTokenInfo?floAddress=${tokenForm["tokenName"].value}`)
|
||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
|
|
||||||
|
|
||||||
showTokenAddressInfo(data);
|
showTokenAddressInfo(data);
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
// Entered data is contract name
|
// Entered data is contract name
|
||||||
fetch(`https://ranchimallflo.duckdns.org/api/v1.0/gettokeninfo?token=${tokenForm["tokenName"].value}`)
|
fetch(`https://ranchimallflo.duckdns.org/api/v1.0/getTokenInfo?token=${tokenForm["tokenName"].value}`)
|
||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
|
|
||||||
@ -455,7 +452,7 @@
|
|||||||
for (i = 0; i < data['participatedContracts'].length; i++) {
|
for (i = 0; i < data['participatedContracts'].length; i++) {
|
||||||
contractDetailColumn.innerHTML = contractDetailColumn.innerHTML + '<h4 class="column__text">Contract name: '+ data['participatedContracts'][i]['contractName'] +'</h4>' ;
|
contractDetailColumn.innerHTML = contractDetailColumn.innerHTML + '<h4 class="column__text">Contract name: '+ data['participatedContracts'][i]['contractName'] +'</h4>' ;
|
||||||
contractDetailColumn.innerHTML = contractDetailColumn.innerHTML + '<h4 class="column__text">Contract address: '+ data['participatedContracts'][i]['contractAddress'] +'</h4>' ;
|
contractDetailColumn.innerHTML = contractDetailColumn.innerHTML + '<h4 class="column__text">Contract address: '+ data['participatedContracts'][i]['contractAddress'] +'</h4>' ;
|
||||||
contractDetailColumn.innerHTML = contractDetailColumn.innerHTML + '<h4 class="column__text">Participant address: '+ data['address']+'</h4>' ;
|
contractDetailColumn.innerHTML = contractDetailColumn.innerHTML + '<h4 class="column__text">Participant address: '+ data['floAddress']+'</h4>' ;
|
||||||
contractDetailColumn.innerHTML = contractDetailColumn.innerHTML + '<h4 class="column__text">Token amount:'+ data['participatedContracts'][i]['tokenAmount'] +'</h4>' ;
|
contractDetailColumn.innerHTML = contractDetailColumn.innerHTML + '<h4 class="column__text">Token amount:'+ data['participatedContracts'][i]['tokenAmount'] +'</h4>' ;
|
||||||
contractDetailColumn.innerHTML = contractDetailColumn.innerHTML + '<h4 class="column__text">Transaction hash:'+ data['participatedContracts'][i]['transactionHash'] +'</h4><br>' ;
|
contractDetailColumn.innerHTML = contractDetailColumn.innerHTML + '<h4 class="column__text">Transaction hash:'+ data['participatedContracts'][i]['transactionHash'] +'</h4><br>' ;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user