forked from stellar/go
/
main.go
47 lines (40 loc) · 1.57 KB
/
main.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
package server
import (
"math/big"
"net/http"
"github.com/stellar/go/services/bifrost/bitcoin"
"github.com/stellar/go/services/bifrost/config"
"github.com/stellar/go/services/bifrost/database"
"github.com/stellar/go/services/bifrost/ethereum"
"github.com/stellar/go/services/bifrost/queue"
"github.com/stellar/go/services/bifrost/sse"
"github.com/stellar/go/services/bifrost/stellar"
"github.com/stellar/go/support/log"
)
// ProtocolVersion is the version of the protocol that Bifrost server and
// JS SDK use to communicate.
const ProtocolVersion int = 2
type Server struct {
BitcoinListener *bitcoin.Listener `inject:""`
BitcoinAddressGenerator *bitcoin.AddressGenerator `inject:""`
Config *config.Config `inject:""`
Database database.Database `inject:""`
EthereumListener *ethereum.Listener `inject:""`
EthereumAddressGenerator *ethereum.AddressGenerator `inject:""`
StellarAccountConfigurator *stellar.AccountConfigurator `inject:""`
TransactionsQueue queue.Queue `inject:""`
SSEServer sse.ServerInterface `inject:""`
MinimumValueBtc string
MinimumValueEth string
SignerPublicKey string
minimumValueSat int64
minimumValueWei *big.Int
httpServer *http.Server
log *log.Entry
}
type GenerateAddressResponse struct {
ProtocolVersion int `json:"protocol_version"`
Chain string `json:"chain"`
Address string `json:"address"`
Signer string `json:"signer"`
}