github.com/keybase/client/go@v0.0.0-20241007131713-f10651d043c8/service/wallet.go (about) 1 // Copyright 2018 Keybase, Inc. All rights reserved. Use of 2 // this source code is governed by the included BSD license. 3 4 // RPC handlers for wallet operations 5 6 package service 7 8 import ( 9 "github.com/keybase/client/go/libkb" 10 "github.com/keybase/client/go/protocol/stellar1" 11 "github.com/keybase/client/go/stellar" 12 "github.com/keybase/client/go/stellar/stellarsvc" 13 "github.com/keybase/go-framed-msgpack-rpc/rpc" 14 ) 15 16 type walletHandler struct { 17 libkb.Contextified 18 *BaseHandler 19 *stellarsvc.Server 20 } 21 22 var _ stellar1.LocalInterface = (*walletHandler)(nil) 23 24 func newWalletHandler(xp rpc.Transporter, g *libkb.GlobalContext, walletState *stellar.WalletState) *walletHandler { 25 h := &walletHandler{ 26 Contextified: libkb.NewContextified(g), 27 BaseHandler: NewBaseHandler(g, xp), 28 } 29 30 h.Server = stellarsvc.New(g, h, walletState) 31 32 return h 33 } 34 35 func (h *walletHandler) SecretUI(g *libkb.GlobalContext, sessionID int) libkb.SecretUI { 36 return h.BaseHandler.getSecretUI(sessionID, g) 37 } 38 39 func (h *walletHandler) IdentifyUI(g *libkb.GlobalContext, sessionID int) libkb.IdentifyUI { 40 return h.NewRemoteIdentifyUI(sessionID, g) 41 } 42 43 func (h *walletHandler) StellarUI() stellar1.UiInterface { 44 return stellar1.UiClient{Cli: h.rpcClient()} 45 }