Skip to content

Commit

Permalink
fix btc client
Browse files Browse the repository at this point in the history
  • Loading branch information
Ali Chaddad committed Aug 22, 2023
1 parent 421fadb commit 2f38643
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions web3gw/client/btc/btc.v
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ pub fn (mut c BtcClient) load(params Load) !string {
}

// Get the public address of the loaded btc secret
pub fn (mut s StellarClient) address() !string {
return s.client.send_json_rpc[[]string, string]('btc.Address', []string{}, stellar.default_timeout)!
pub fn (mut s BtcClient) address() !string {
return s.client.send_json_rpc[[]string, string]('btc.Address', []string{}, btc.default_timeout)!
}

// Sends the passed amount to the given address with a comment if provided and returns the hash of the transaction
Expand Down Expand Up @@ -58,6 +58,11 @@ pub fn (mut c BtcClient) get_block_hash(block_height i64) !string {
return c.client.send_json_rpc[[]i64, string]('btc.GetBlockHash', [block_height], btc.default_timeout)!
}

// Returns the block count.
pub fn (mut c BtcClient) get_block_count() !i64 {
return c.client.send_json_rpc[[]string, i64]('btc.GetBlockCount', []string{}, btc.default_timeout)!
}

// Returns block statistics given the hash of that block.
pub fn (mut c BtcClient) get_block_stats(hash string) !GetBlockStatsResult {
return c.client.send_json_rpc[[]string, GetBlockStatsResult]('btc.GetBlockStats',
Expand Down

0 comments on commit 2f38643

Please sign in to comment.