-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy pathclient.go
60 lines (52 loc) · 2.26 KB
/
client.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
56
57
58
59
60
package rpc
import (
"context"
"github.com/ten-protocol/go-ten/lib/gethfork/rpc"
)
// these are public RPC methods exposed by a TEN node
const (
BatchNumber = "ten_batchNumber"
ChainID = "ten_chainId"
GetBatchByHash = "ten_getBatchByHash"
GetBatchByNumber = "ten_getBatchByNumber"
GetCode = "ten_getCode"
GasPrice = "ten_gasPrice"
GetCrossChainProof = "ten_getCrossChainProof"
Health = "ten_health"
Config = "ten_config"
RPCKey = "ten_rpcKey"
StopHost = "test_stopHost"
SubscribeNamespace = "ten"
SubscriptionTypeLogs = "logs"
SubscriptionTypeNewHeads = "newHeads"
GetBatchByTx = "scan_getBatchByTx"
GetLatestRollupHeader = "scan_getLatestRollupHeader"
GetTotalTxCount = "scan_getTotalTransactionCount"
GetTotalTxsQuery = "scan_getTotalTransactionsQuery"
GetTotalContractCount = "scan_getTotalContractCount"
GetPublicTransactionData = "scan_getPublicTransactionData"
GetBatchListing = "scan_getBatchListing"
GetBlockListing = "scan_getBlockListing"
GetBatch = "scan_getBatch"
GetLatestBatch = "scan_getLatestBatch"
GetBatchByHeight = "scan_getBatchByHeight"
GetTransaction = "scan_getTransaction"
GetRollupListing = "scan_getRollupListing"
GetBatchListingNew = "scan_getBatchListingNew"
GetRollupByHash = "scan_getRollupByHash"
GetRollupBatches = "scan_getRollupBatches"
GetRollupBySeqNo = "scan_getRollupBySeqNo"
GetBatchTransactions = "scan_getBatchTransactions"
GetPersonalTransactions = "scan_getPersonalTransactions"
)
// Client is used by client applications to interact with the TEN node
type Client interface {
// Call executes the named method via RPC.
Call(result interface{}, method string, args ...interface{}) error
// CallContext If the context is canceled before the call has successfully returned, CallContext returns immediately.
CallContext(ctx context.Context, result interface{}, method string, args ...interface{}) error
// Subscribe creates a subscription to the Obscuro host.
Subscribe(ctx context.Context, namespace string, channel interface{}, args ...interface{}) (*rpc.ClientSubscription, error)
// Stop closes the client.
Stop()
}