github.com/keybase/client/go@v0.0.0-20240309051027-028f7c731f8b/protocol/keybase1/cryptocurrency.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/cryptocurrency.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 RegisterAddressRes struct {
    13  	Type   string `codec:"type" json:"type"`
    14  	Family string `codec:"family" json:"family"`
    15  }
    16  
    17  func (o RegisterAddressRes) DeepCopy() RegisterAddressRes {
    18  	return RegisterAddressRes{
    19  		Type:   o.Type,
    20  		Family: o.Family,
    21  	}
    22  }
    23  
    24  type RegisterAddressArg struct {
    25  	SessionID    int         `codec:"sessionID" json:"sessionID"`
    26  	Address      string      `codec:"address" json:"address"`
    27  	Force        bool        `codec:"force" json:"force"`
    28  	WantedFamily string      `codec:"wantedFamily" json:"wantedFamily"`
    29  	SigVersion   *SigVersion `codec:"sigVersion,omitempty" json:"sigVersion,omitempty"`
    30  }
    31  
    32  type CryptocurrencyInterface interface {
    33  	RegisterAddress(context.Context, RegisterAddressArg) (RegisterAddressRes, error)
    34  }
    35  
    36  func CryptocurrencyProtocol(i CryptocurrencyInterface) rpc.Protocol {
    37  	return rpc.Protocol{
    38  		Name: "keybase.1.cryptocurrency",
    39  		Methods: map[string]rpc.ServeHandlerDescription{
    40  			"registerAddress": {
    41  				MakeArg: func() interface{} {
    42  					var ret [1]RegisterAddressArg
    43  					return &ret
    44  				},
    45  				Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) {
    46  					typedArgs, ok := args.(*[1]RegisterAddressArg)
    47  					if !ok {
    48  						err = rpc.NewTypeError((*[1]RegisterAddressArg)(nil), args)
    49  						return
    50  					}
    51  					ret, err = i.RegisterAddress(ctx, typedArgs[0])
    52  					return
    53  				},
    54  			},
    55  		},
    56  	}
    57  }
    58  
    59  type CryptocurrencyClient struct {
    60  	Cli rpc.GenericClient
    61  }
    62  
    63  func (c CryptocurrencyClient) RegisterAddress(ctx context.Context, __arg RegisterAddressArg) (res RegisterAddressRes, err error) {
    64  	err = c.Cli.Call(ctx, "keybase.1.cryptocurrency.registerAddress", []interface{}{__arg}, &res, 0*time.Millisecond)
    65  	return
    66  }