@@ -42,13 +42,15 @@ first parameter and the Ethereum transaction hash as second parameter. The
42
42
` completed ` callback gets fired when the transaction is mined and returns the
43
43
reserved ticket object.
44
44
45
- #### ` claimTicket(ticketId, txHex, txHash, txIndex, merkleSibling, txBlockHash, success, completed, failure) `
45
+ #### `claimTicket(ticketId, txHex, txHash, txIndex, merkleSibling, txBlockHash,
46
+ feeWei, success, completed, failure)`
46
47
Claim a ticket with ID ` ticketId ` , with the signed BTC transaction hex ` txHex ` ,
47
48
the BTC transaction hash ` txHash ` , BTC transaction index ` txIndex ` , BTC merkle
48
- siblings ` merkleSibling ` and BTC block hash ` txBlockHash ` . The ` success `
49
- callback gets fired when the Ethereum transaction is sent and returns the
50
- Ethereum transaction hash. The ` completed ` callback gets fired when the
51
- transaction is mined and returns the ticket ID.
49
+ siblings ` merkleSibling ` and BTC block hash ` txBlockHash ` . ` feeWei ` can be
50
+ obtained by calling ` getFeeAmount(txBlockHash) ` and will be the transaction's
51
+ value if it's above zero. The ` success ` callback gets fired when the Ethereum
52
+ transaction is sent and returns the Ethereum transaction hash. The ` completed `
53
+ callback gets fired when the transaction is mined and returns the ticket ID.
52
54
53
55
#### ` cancelTicket(ticketId, success, failure) `
54
56
Cancel a ticket with ` ticketId ` , if the ticket is still reservable and by
@@ -120,10 +122,15 @@ Query the [btcrelay](https://github.com/ethereum/btcrelay) contract for its last
120
122
stored BTC block number. The ` success ` callback gets fired on a successful call
121
123
and returns the block number of the latest block.
122
124
123
- #### ` storeBlockHeader(blockHash, success, failure) `
125
+ #### ` getFeeAmount(blockHash, success, failure) `
126
+ Get the fee from [ btcrelay] ( https://github.com/ethereum/btcrelay ) to validate a
127
+ transaction in a given ` blockHash ` . The ` success ` callback gets fired on a
128
+ successful call and returns the fee amount in wei.
129
+
130
+ #### ` storeBlockWithFee(blockHash, feeWei, success, failure) `
124
131
Query the [ blockr] ( https://blockr.io ) API for the raw block data of a block
125
132
with hash ` blockHash ` , generate the BTC block header from that data, call the
126
- ` storeBlockHeader ` method of [ btcrelay] ( https://github.com/ethereum/btcrelay )
133
+ ` storeBlockWithFee ` method of [ btcrelay] ( https://github.com/ethereum/btcrelay )
127
134
and send an Ethereum transaction for that same method if successful, effectively
128
135
storing the block header. The ` success ` callback gets fired when the transaction
129
136
is mined and returns the BTC block number for which the block header was stored.
0 commit comments