forked from fairbank-io/electrum
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeprecated.go
55 lines (50 loc) · 1.71 KB
/
deprecated.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package electrum
import "context"
// UTXOAddress will synchronously run a 'blockchain.utxo.get_address' operation
// https://electrumx.readthedocs.io/en/latest/protocol-methods.html#blockchain.utxo.get_address
//
// Deprecated: Since protocol 1.0
// https://electrumx.readthedocs.io/en/latest/protocol-changes.html#deprecated-methods
func (c *Client) UTXOAddress(utxo string) (string, error) {
return "", ErrDeprecatedMethod
}
// BlockChunk will synchronously run a 'blockchain.block.get_chunk' operation
// https://electrumx.readthedocs.io/en/latest/protocol-methods.html#blockchain.block.get_chunk
//
// Deprecated: Since protocol 1.2
// https://electrumx.readthedocs.io/en/latest/protocol-changes.html#version-1-2
func (c *Client) BlockChunk(index int) (interface{}, error) {
return nil, ErrDeprecatedMethod
}
// NotifyBlockNums will setup a subscription for the method 'blockchain.numblocks.subscribe'
// https://electrumx.readthedocs.io/en/latest/protocol-methods.html#blockchain.numblocks.subscribe
//
// Deprecated: Since protocol 1.0
// https://electrumx.readthedocs.io/en/latest/protocol-changes.html#deprecated-methods
func (c *Client) NotifyBlockNums(ctx context.Context) (<-chan int, error) {
return nil, ErrDeprecatedMethod
/*
nums := make(chan int)
sub := &subscription{
ctx: ctx,
method: "blockchain.numblocks.subscribe",
messages: make(chan *response),
handler: func(m *response) {
if m.Result != nil {
nums <- int(m.Result.(float64))
return
}
if m.Params != nil {
for _, v := range m.Params.([]interface{}) {
nums <- int(v.(float64))
}
}
},
}
if err := c.startSubscription(sub); err != nil {
close(nums)
return nil, err
}
return nums, nil
*/
}