forked from proximax-storage/nem2-sdk-go
/
consts.go
90 lines (78 loc) · 2.31 KB
/
consts.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
// Copyright 2018 ProximaX Limited. All rights reserved.
// Use of this source code is governed by the Apache 2.0
// license that can be found in the LICENSE file.
package sdk
import "regexp"
// const routers path for methods AccountService
const (
mainAccountRoute = "account"
transactionsRoute = "transactions"
incomingTransactionsRoute = "transactions/incoming"
outgoingTransactionsRoute = "transactions/outgoing"
unconfirmedTransactionsRoute = "transactions/unconfirmed"
aggregateTransactionsRoute = "transactions/aggregateBondedTransactions"
multisigAccountInfoRoute = "multisig"
multisigAccountGraphInfoRoute = "multisig/graph"
)
// const routers path for methods NamespaceService
const (
pathNamespacesFromAccounts = "/account/namespaces"
pathNamespace = "/namespace/"
pathNamespacenames = "/namespace/names"
pathNamespacesFromAccount = "/account/%s/namespaces"
)
// const routers path for methods MosaicService
const (
pathMosaic = "/mosaic/"
pathMosaicNames = "/mosaic/names"
pathMosaicFromNamespace = "/namespace/%s/mosaics/"
)
// const routers path for methods BlockchainService
const (
pathBlockHeight = "/chain/height"
pathBlockByHeight = "/block/%s"
pathBlockScore = "/chain/score"
pathBlockGetTransaction = "/block/%s/transactions"
pathBlockInfo = "/blocks/%s/limit/%s"
pathBlockStorage = "/diagnostic/storage"
)
// const routers path for methods MosaicService
const (
pathNetwork = "/network"
)
// const routers path for methods TransactionService
const (
mainTransactionRoute = "transaction"
announceAggreagateRoute = "partial"
announceAggreagateCosignatureRoute = "cosignature"
transactionStatusRoute = "status"
transactionStatusesRoute = "statuses"
)
const tplNamespaceInfo = `"active": %v,
"index": %d,
"id": "%s",
"type": %d,
"depth": %d,
"levels": [
%v
],
"parentId": [
%v
],
"owner": "%v",
"ownerAddress": "%s",
"startHeight": [
%v
],
"endHeight": [
%v
]
}
`
type NamespaceType uint8
const (
Root NamespaceType = iota
Sub
)
// regValidNamespace check namespace on valid symbols
var regValidNamespace = regexp.MustCompile(`^[a-z0-9][a-z0-9-_]*$`)