This repository was archived by the owner on Apr 2, 2024. It is now read-only.
generated from mrz1836/go-template
-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathinterface.go
54 lines (47 loc) · 1.41 KB
/
interface.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
package chainstate
import (
"context"
"net/http"
"time"
"github.com/BuxOrg/bux/utils"
"github.com/bitcoin-sv/go-broadcast-client/broadcast"
"github.com/tonicpow/go-minercraft/v2"
)
// HTTPInterface is the HTTP client interface
type HTTPInterface interface {
Do(req *http.Request) (*http.Response, error)
}
// ChainService is the chain related methods
type ChainService interface {
Broadcast(ctx context.Context, id, txHex string, timeout time.Duration) (string, error)
QueryTransaction(
ctx context.Context, id string, requiredIn RequiredIn, timeout time.Duration,
) (*TransactionInfo, error)
QueryTransactionFastest(
ctx context.Context, id string, requiredIn RequiredIn, timeout time.Duration,
) (*TransactionInfo, error)
}
// ProviderServices is the chainstate providers interface
type ProviderServices interface {
Minercraft() minercraft.ClientInterface
BroadcastClient() broadcast.Client
}
// HeaderService is header services interface
type HeaderService interface {
VerifyMerkleRoots(ctx context.Context, merkleRoots []MerkleRootConfirmationRequestItem) error
}
// ClientInterface is the chainstate client interface
type ClientInterface interface {
ChainService
ProviderServices
HeaderService
Close(ctx context.Context)
Debug(on bool)
DebugLog(text string)
HTTPClient() HTTPInterface
IsDebug() bool
IsNewRelicEnabled() bool
Network() Network
QueryTimeout() time.Duration
FeeUnit() *utils.FeeUnit
}