File tree Expand file tree Collapse file tree 2 files changed +36
-0
lines changed Expand file tree Collapse file tree 2 files changed +36
-0
lines changed Original file line number Diff line number Diff line change
1
+ const { sumTokens } = require ( "../helper/sumTokens.js" ) ;
2
+ const bitcoinAddressBook = require ( '../helper/bitcoin-book/index.js' ) ;
3
+
4
+ async function tvl ( api ) {
5
+ const owners = await bitcoinAddressBook . coffernetwork ( ) ;
6
+ return sumTokens ( { owners, api } )
7
+ }
8
+
9
+ module . exports = {
10
+ methodology : "TVL is fetched from Coffer Network Bitcoin Staking Protocol from native Bitcoin" ,
11
+ start : "2025-01-20" ,
12
+ isHeavyProtocol : true ,
13
+ bitcoin : {
14
+ tvl,
15
+ } ,
16
+ }
Original file line number Diff line number Diff line change @@ -91,6 +91,26 @@ module.exports = {
91
91
return txHash
92
92
}
93
93
} ,
94
+ coffernetwork : async ( ) => {
95
+
96
+ return getConfig ( 'coffer-network' , undefined , {
97
+ fetcher : async ( ) => {
98
+ throw new Error ( 'Coffer Network fetcher is not implemented' )
99
+ }
100
+ } )
101
+
102
+ function reserveBytes ( txHashTemp ) {
103
+ let txHash = ''
104
+ if ( txHashTemp . length % 2 === 1 ) {
105
+ txHashTemp = '0' + txHashTemp
106
+ }
107
+ txHashTemp = txHashTemp . split ( '' ) . reverse ( ) . join ( '' )
108
+ for ( let i = 0 ; i < txHashTemp . length - 1 ; i += 2 ) {
109
+ txHash += txHashTemp [ i + 1 ] + txHashTemp [ i ]
110
+ }
111
+ return txHash
112
+ }
113
+ } ,
94
114
95
115
lombard : async ( ) => {
96
116
const API_URL = 'https://mainnet.prod.lombard.finance/api/v1/addresses'
You can’t perform that action at this time.
0 commit comments