github.com/keybase/client/go@v0.0.0-20240309051027-028f7c731f8b/protocol/keybase1/btc.go (about) 1 // Auto-generated to Go types and interfaces using avdl-compiler v1.4.10 (https://github.com/keybase/node-avdl-compiler) 2 // Input file: avdl/keybase1/btc.avdl 3 4 package keybase1 5 6 import ( 7 "github.com/keybase/go-framed-msgpack-rpc/rpc" 8 context "golang.org/x/net/context" 9 "time" 10 ) 11 12 type RegisterBTCArg struct { 13 SessionID int `codec:"sessionID" json:"sessionID"` 14 Address string `codec:"address" json:"address"` 15 Force bool `codec:"force" json:"force"` 16 } 17 18 type BTCInterface interface { 19 RegisterBTC(context.Context, RegisterBTCArg) error 20 } 21 22 func BTCProtocol(i BTCInterface) rpc.Protocol { 23 return rpc.Protocol{ 24 Name: "keybase.1.BTC", 25 Methods: map[string]rpc.ServeHandlerDescription{ 26 "registerBTC": { 27 MakeArg: func() interface{} { 28 var ret [1]RegisterBTCArg 29 return &ret 30 }, 31 Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) { 32 typedArgs, ok := args.(*[1]RegisterBTCArg) 33 if !ok { 34 err = rpc.NewTypeError((*[1]RegisterBTCArg)(nil), args) 35 return 36 } 37 err = i.RegisterBTC(ctx, typedArgs[0]) 38 return 39 }, 40 }, 41 }, 42 } 43 } 44 45 type BTCClient struct { 46 Cli rpc.GenericClient 47 } 48 49 func (c BTCClient) RegisterBTC(ctx context.Context, __arg RegisterBTCArg) (err error) { 50 err = c.Cli.Call(ctx, "keybase.1.BTC.registerBTC", []interface{}{__arg}, nil, 0*time.Millisecond) 51 return 52 }