forked from maran/electrum-sync-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.go
More file actions
110 lines (97 loc) · 2.54 KB
/
Copy pathtypes.go
File metadata and controls
110 lines (97 loc) · 2.54 KB
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
package main
import (
"fmt"
)
type DbOpts struct {
DbPath string
Host string
User string
Dbname string
DbType string
Password string
}
//SQL Object for wallet
type Wallet struct {
Id int `sql:"index" json:"id"`
XpubId string `json:"xpubId"`
WalletId string `json:walletId`
Xpubs string `json:xpubs`
WalletType string `json:walletType`
WalletName string `json:walletName`
}
type WalletsResponse struct {
Walltes []Wallet `json: "wallets"`
}
type GetWalletRequest struct{
XpubId string `json:"xpubId"`
}
type WalletRequest struct {
XpubId string `json:xpubId`
WalletId string `json:walletId`
Xpubs string `json:xpubs`
WalletType string `json:walletType`
WalletName string `json:walletName`
}
//SQL Object for tx
type Transaction struct {
Id int `sql:"index" json:"id"`
WalletId string `json:walletId`
TxHash string `json:txHash`
Tx string `json:tx`
}
type TxResponse struct {
Transactions []Transaction `json: "transactions"`
}
type TxRequest struct {
WalletId string `json:walletId`
TxHash string `json:txHash`
Tx string `json:tx`
}
type TxDelRequest struct {
WalletId string `json:walletId`
TxHash string `json:txHash`
}
type TxRbfRequest struct {
WalletId string `json:walletId`
TxHash string `json:txHash`
Tx string `json:tx`
TxHashOld string `json:txHashOld`
}
// SQL Object
type Label struct {
Id int `sql:"index" json:"id"`
ExternalId string `json:"externalId"`
EncryptedLabel string `json:"encryptedLabel"`
Nonce int `json:"nonce"`
WalletId string `json:"walletId"`
}
// Rest response
type LabelsResponse struct {
Nonce int `json:"nonce"`
Labels []Label `json:"labels"`
}
// Rest request
type LabelRequest struct {
EncryptedLabel string `json:"encryptedLabel"`
ExternalId string `json:"externalId"`
WalletId string `json:"walletId"`
WalletNonce int `json:"walletNonce"`
}
func (self LabelRequest) String() string {
return fmt.Sprintf(`
Request information:
encryptedLabel: %s
externalId: %s
walletId: %s
walletNonce: %d
`, self.EncryptedLabel, self.ExternalId, self.WalletId, self.WalletNonce)
}
type LabelsRequest struct {
WalletNonce int `json:"walletNonce"`
WalletId string `json:"walletId"`
Labels []BatchLabel `json:"labels"`
}
type BatchLabel struct {
EncryptedLabel string `json:"encryptedLabel"`
ExternalId string `json:"externalId"`
}