forked from keybase/client
/
wallet.go
45 lines (34 loc) · 1.2 KB
/
wallet.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
// Copyright 2018 Keybase, Inc. All rights reserved. Use of
// this source code is governed by the included BSD license.
// RPC handlers for wallet operations
package service
import (
"github.com/keybase/client/go/libkb"
"github.com/keybase/client/go/protocol/stellar1"
"github.com/keybase/client/go/stellar"
"github.com/keybase/client/go/stellar/stellarsvc"
"github.com/keybase/go-framed-msgpack-rpc/rpc"
)
type walletHandler struct {
libkb.Contextified
*BaseHandler
*stellarsvc.Server
}
var _ stellar1.LocalInterface = (*walletHandler)(nil)
func newWalletHandler(xp rpc.Transporter, g *libkb.GlobalContext, walletState *stellar.WalletState) *walletHandler {
h := &walletHandler{
Contextified: libkb.NewContextified(g),
BaseHandler: NewBaseHandler(g, xp),
}
h.Server = stellarsvc.New(g, h, walletState)
return h
}
func (h *walletHandler) SecretUI(g *libkb.GlobalContext, sessionID int) libkb.SecretUI {
return h.BaseHandler.getSecretUI(sessionID, g)
}
func (h *walletHandler) IdentifyUI(g *libkb.GlobalContext, sessionID int) libkb.IdentifyUI {
return h.NewRemoteIdentifyUI(sessionID, g)
}
func (h *walletHandler) StellarUI() stellar1.UiInterface {
return stellar1.UiClient{Cli: h.rpcClient()}
}