Skip to content

Commit

Permalink
Merge pull request #107 from KimlikDAO/kalan
Browse files Browse the repository at this point in the history
Ⓜ️  Kalan MINA miktarını göster (fix #106)
  • Loading branch information
oemerfurkan authored May 28, 2024
2 parents 11fb616 + 6c8efbe commit 7f54db2
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 25 deletions.
1 change: 1 addition & 0 deletions ana/kazan/birim.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import '/birim/blog/mina-berkeley/birim'
1 change: 1 addition & 0 deletions ana/sayfa.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import "/ana/hero/sergi/birim";
import "/birim/altdizin/birim";
import "/ana/kazan/birim";
import Cüzdan from "/birim/cüzdan/birim";
import "/birim/dil/birim";
import dom from "/lib/util/dom";
Expand Down
35 changes: 11 additions & 24 deletions birim/blog/mina-berkeley/birim.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,17 @@
import { AğBilgileri } from "/birim/ağlar/birim";
import jsonrpc from "/lib/api/jsonrpc";
import { ChainId } from "/lib/crosschain/chains";
import { address } from "/lib/ethereum/provider";
import dom from "/lib/util/dom";

/** @const {string} */
const DEV_FUND = "0x79883D9aCBc4aBac6d2d216693F66FcC5A0BcBC1".toLowerCase();
/** @const {string} */
const ODUL = "0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9"
/** @const {!Element} */
const RemainingBar = dom.adla("blmb");

/**
* USDT contract address on Arbitrum One.
*
* @const {string}
*/
const USDT_ARB = "0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9";
/** @const {!string} */
const zkAppAddress = "B62qnnFm3SEtrMgStoj4SRVxKSTERh8Ho3Y9jCCa8TvgBF1mqa97Sij";

jsonrpc.call("https://" + AğBilgileri[ChainId.xa4b1].rpcUrl, "eth_call", [
/** @type {!eth.Transaction} */({
to: USDT_ARB,
data: "0xdd62ed3e" + address(DEV_FUND) + address(ODUL)
}), "latest"
]).then((izin) => {
const kalan = parseInt(izin.slice(-36), 16);
RemainingBar.innerText = kalan;
RemainingBar.parentElement.previousElementSibling.style.width = kalan * 180 / 5000 + "px";
});
fetch("https://devnet.api.minaexplorer.com/accounts/" + zkAppAddress).then(
async (response) => {
const res = await response.json();
const kalan = parseInt(res.account.balance.total);
RemainingBar.innerHTML = kalan;
RemainingBar.parentElement.previousElementSibling.style.width =
(kalan * 180) / 5000 + "px";
}
);
2 changes: 1 addition & 1 deletion birim/cüzdan/birim.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import dom from "/lib/util/dom";
import { hexten } from "/lib/util/çevir";

/** @define {string} */
const VARSAYILAN_AĞ = "m:devnet";
const VARSAYILAN_AĞ = "0xa4b1";

/** @const {string} */
const KIMLIKDAO_IPFS_URL = "//ipfs.kimlikdao.org";
Expand Down

0 comments on commit 7f54db2

Please sign in to comment.