1
- const sdk = require ( '@defillama/sdk' )
2
1
const axios = require ( "axios" )
3
- const { function_view } = require ( '../helper/chain/aptos' )
4
-
5
- const FIABTC_ETHEREUM = '0x22F0E0a4c97ff43546dad16d43Ef854C773F0e08'
6
- const FIABTC_BSC = '0xafB253A80CEb3d1a5eeF3994C0d1C92c2f027524'
7
- const FIABTC_SEI = '0x60C230c38aF6d86b0277a98a1CAeAA345a7B061F'
8
- const FIABTC_ARBITRUM = '0x60C230c38aF6d86b0277a98a1CAeAA345a7B061F'
9
- const FIABTC_BASE = '0x60C230c38aF6d86b0277a98a1CAeAA345a7B061F'
10
- const FIABTC_ZKSYNC = '0x60C230c38aF6d86b0277a98a1CAeAA345a7B061F'
11
- const FIABTC_POLYGON = '0x60C230c38aF6d86b0277a98a1CAeAA345a7B061F'
12
- const FIABTC_UNICHAIN = '0x60C230c38aF6d86b0277a98a1CAeAA345a7B061F'
13
- const FIABTC_PLUME = '0x60C230c38aF6d86b0277a98a1CAeAA345a7B061F'
14
- const FIABTC_APTOS = '0x75de592a7e62e6224d13763c392190fda8635ebb79c798a5e9dd0840102f3f93'
15
-
16
- const ethereum_tvl = async ( api ) => {
17
- const supply = await api . call ( { abi : 'erc20:totalSupply' , target : FIABTC_ETHEREUM } )
18
- api . add ( FIABTC_ETHEREUM , supply )
19
- }
20
-
21
- const bsc_tvl = async ( api ) => {
22
- const supply = await api . call ( { abi : 'erc20:totalSupply' , target : FIABTC_BSC } )
23
- api . add ( FIABTC_BSC , supply )
24
- }
25
-
26
- const sei_tvl = async ( api ) => {
27
- const supply = await api . call ( { abi : 'erc20:totalSupply' , target : FIABTC_SEI } )
28
- api . add ( FIABTC_SEI , supply )
29
- }
30
-
31
- const arbitrum_tvl = async ( api ) => {
32
- const supply = await api . call ( { abi : 'erc20:totalSupply' , target : FIABTC_ARBITRUM } )
33
- api . add ( FIABTC_ARBITRUM , supply )
34
- }
35
-
36
- const base_tvl = async ( api ) => {
37
- const supply = await api . call ( { abi : 'erc20:totalSupply' , target : FIABTC_BASE } )
38
- api . add ( FIABTC_BASE , supply )
39
- }
40
-
41
- const zksync_tvl = async ( api ) => {
42
- const supply = await api . call ( { abi : 'erc20:totalSupply' , target : FIABTC_ZKSYNC } )
43
- api . add ( FIABTC_ZKSYNC , supply )
44
- }
45
-
46
- const polygon_tvl = async ( api ) => {
47
- const supply = await api . call ( { abi : 'erc20:totalSupply' , target : FIABTC_POLYGON } )
48
- api . add ( FIABTC_POLYGON , supply )
49
- }
50
-
51
- const unichain_tvl = async ( api ) => {
52
- const supply = await api . call ( { abi : 'erc20:totalSupply' , target : FIABTC_UNICHAIN } )
53
- api . add ( FIABTC_UNICHAIN , supply )
54
- }
55
-
56
- const plume_tvl = async ( api ) => {
57
- const supply = await api . call ( { abi : 'erc20:totalSupply' , target : FIABTC_PLUME } )
58
- api . add ( FIABTC_PLUME , supply )
59
- }
60
-
61
- const aptos_tvl = async ( api ) => {
62
- const response = ( await axios . post ( 'https://fullnode.mainnet.aptoslabs.com/v1/view' , { "function" : "0x1::fungible_asset::supply" , "type_arguments" : [ "0x1::fungible_asset::Metadata" ] , arguments : [ FIABTC_APTOS ] } ) ) . data
63
- const supply = response [ 0 ] . vec [ 0 ]
64
- const btcAmount = parseInt ( supply ) / 1e8
65
- api . addCGToken ( 'bitcoin' , btcAmount )
66
- }
67
2
68
3
const btc_locked = async ( api ) => {
69
4
const response = ( await axios . post ( 'https://bridge-api.fiammachain.io' , { "jsonrpc" : "2.0" , "id" : 1 , "method" : "frontend_queryBridgeTVL" , "params" : { } } ) ) . data
@@ -75,35 +10,5 @@ module.exports = {
75
10
methodology : "Fiamma BTC TVL represents the total amount of Bitcoin bridged across all chains through the Fiamma Bridge, a trust‑minimized bridge built on the BitVM2 protocol." ,
76
11
bitcoin : {
77
12
tvl : btc_locked ,
78
- } ,
79
- ethereum : {
80
- tvl : ethereum_tvl ,
81
- } ,
82
- bsc : {
83
- tvl : bsc_tvl ,
84
- } ,
85
- sei : {
86
- tvl : sei_tvl ,
87
- } ,
88
- arbitrum : {
89
- tvl : arbitrum_tvl ,
90
- } ,
91
- base : {
92
- tvl : base_tvl ,
93
- } ,
94
- era : {
95
- tvl : zksync_tvl ,
96
- } ,
97
- polygon : {
98
- tvl : polygon_tvl ,
99
- } ,
100
- unichain : {
101
- tvl : unichain_tvl ,
102
- } ,
103
- plume : {
104
- tvl : plume_tvl ,
105
- } ,
106
- aptos : {
107
- tvl : aptos_tvl ,
108
- } ,
13
+ }
109
14
} ;
0 commit comments