-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
interface.go
42 lines (37 loc) · 1.48 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
package minercraft
import (
"context"
"time"
)
// QuoteService is the MinerCraft quote related requests
type QuoteService interface {
BestQuote(ctx context.Context, feeCategory, feeType string) (*FeeQuoteResponse, error)
FastestQuote(ctx context.Context, timeout time.Duration) (*FeeQuoteResponse, error)
FeeQuote(ctx context.Context, miner *Miner) (*FeeQuoteResponse, error)
PolicyQuote(ctx context.Context, miner *Miner) (*PolicyQuoteResponse, error)
}
// MinerService is the MinerCraft miner related methods
type MinerService interface {
AddMiner(miner Miner, apis []API) error
MinerByID(minerID string) *Miner
MinerByName(name string) *Miner
Miners() []*Miner
MinerAPIsByMinerID(minerID string) *MinerAPIs
MinerAPIByMinerID(minerID string, apiType APIType) (*API, error)
MinerUpdateToken(name, token string, apiType APIType)
RemoveMiner(miner *Miner) bool
}
// TransactionService is the MinerCraft transaction related methods
type TransactionService interface {
QueryTransaction(ctx context.Context, miner *Miner, txID string, opts ...QueryTransactionOptFunc) (*QueryTransactionResponse, error)
SubmitTransaction(ctx context.Context, miner *Miner, tx *Transaction) (*SubmitTransactionResponse, error)
SubmitTransactions(ctx context.Context, miner *Miner, txs []Transaction) (*SubmitTransactionsResponse, error)
}
// ClientInterface is the MinerCraft client interface
type ClientInterface interface {
MinerService
QuoteService
TransactionService
UserAgent() string
APIType() APIType
}