Skip to content

Commit

Permalink
Add Tangle project
Browse files Browse the repository at this point in the history
  • Loading branch information
yurixander committed Jan 20, 2025
1 parent c444de7 commit 87e43f6
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
1 change: 1 addition & 0 deletions projects/helper/chains.json
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@
"sx",
"syscoin",
"taiko",
"tTangle",
"tara",
"telos",
"tenet",
Expand Down
29 changes: 29 additions & 0 deletions projects/tangle/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@

const { post } = require('../helper/http')

const endpoint = 'https://rpc.tangle.tools'

async function fetch(method, params = []) {
const response = await post(endpoint, { jsonrpc: '2.0', id: 1, method, params })

console.log(response)

return response.result
}

async function tvl(api) {
// balances: totalIssuance()
const totalIssuance = await fetch('state_getStorage', ['0xc2261276cc9d1f8598ea4b6a74b15c2f57c875e4cff74148e4628f264b974c80'])

console.debug("Bal", BigInt(totalIssuance).toString())

api.add("TNT", BigInt(totalIssuance))
}

module.exports = {
timetravel: false,
methodology: 'counts the number of MINT tokens in the Club Bonding contract.',
tTangle: {
tvl
}
}

0 comments on commit 87e43f6

Please sign in to comment.