From 95177ba1c2a744baf79fb0fed0cb7fddc556bc88 Mon Sep 17 00:00:00 2001 From: nsjames Date: Wed, 20 Nov 2024 11:51:23 -0500 Subject: [PATCH 1/2] added eos-exsat-evm adapter --- projects/eos-exsat-evm/index.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 projects/eos-exsat-evm/index.js diff --git a/projects/eos-exsat-evm/index.js b/projects/eos-exsat-evm/index.js new file mode 100644 index 00000000000..bc02bc83338 --- /dev/null +++ b/projects/eos-exsat-evm/index.js @@ -0,0 +1,24 @@ +const { post } = require('../helper/http') + +async function tvl() { + return post('https://eos.greymass.com/v1/chain/get_table_rows', { + json: true, + code: "btc.xsat", + scope: "BTC", + table: "stat", + limit: "1", + reverse: false, + show_payer: false + }).then(response => { + return { + bitcoin: parseFloat(response.rows[0].supply.split(" ")[0]) + } + }) +} + +module.exports = { + methodology: `EOS ExSAT EVM TVL is achieved by querying the total available supply from the [btc.xsat] account. This supply fluctuates as users deposit and withdraw funds from the ExSAT EVM.`, + eos: { + tvl + }, +} From fc1685cfb0c3dcaaad5e8ec357bd8da30c305677 Mon Sep 17 00:00:00 2001 From: nsjames Date: Mon, 25 Nov 2024 11:23:49 -0500 Subject: [PATCH 2/2] use exsat bitcoin fetchers for eos --- projects/eos-exsat-evm/index.js | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/projects/eos-exsat-evm/index.js b/projects/eos-exsat-evm/index.js index bc02bc83338..a7c6baf02a5 100644 --- a/projects/eos-exsat-evm/index.js +++ b/projects/eos-exsat-evm/index.js @@ -1,23 +1,13 @@ const { post } = require('../helper/http') +const {sumTokens} = require("../helper/chain/bitcoin"); +const bitcoinBook = require("../helper/bitcoin-book"); async function tvl() { - return post('https://eos.greymass.com/v1/chain/get_table_rows', { - json: true, - code: "btc.xsat", - scope: "BTC", - table: "stat", - limit: "1", - reverse: false, - show_payer: false - }).then(response => { - return { - bitcoin: parseFloat(response.rows[0].supply.split(" ")[0]) - } - }) + return sumTokens({ owners: await bitcoinBook.exsatBridge() }); } module.exports = { - methodology: `EOS ExSAT EVM TVL is achieved by querying the total available supply from the [btc.xsat] account. This supply fluctuates as users deposit and withdraw funds from the ExSAT EVM.`, + methodology: `EOS ExSAT EVM TVL is achieved by querying the total balance held in custody addresses on the BTC network that are bridged to the EOS ExSAT EVM network.`, eos: { tvl },