You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

320 lines
12 KiB

2 months ago
// Code generated by protoc-gen-go-http. DO NOT EDIT.
// versions:
// - protoc-gen-go-http v2.7.3
// - protoc v5.27.1
// source: walletSystem/v1/wallet.proto
package v1
import (
context "context"
http "github.com/go-kratos/kratos/v2/transport/http"
binding "github.com/go-kratos/kratos/v2/transport/http/binding"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the kratos package it is being compiled against.
var _ = new(context.Context)
var _ = binding.EncodeURL
const _ = http.SupportPackageIsVersion1
const OperationWalletDeleteAddress = "/walletSystem.v1.Wallet/DeleteAddress"
const OperationWalletGenerateAddress = "/walletSystem.v1.Wallet/GenerateAddress"
const OperationWalletGetAllAddress = "/walletSystem.v1.Wallet/GetAllAddress"
const OperationWalletGetAllAddressAndPrivateKey = "/walletSystem.v1.Wallet/GetAllAddressAndPrivateKey"
const OperationWalletGetPrivateKeyByAddress = "/walletSystem.v1.Wallet/GetPrivateKeyByAddress"
const OperationWalletSignatureTrc20Grpc = "/walletSystem.v1.Wallet/SignatureTrc20Grpc"
const OperationWalletWalletApprove = "/walletSystem.v1.Wallet/WalletApprove"
type WalletHTTPServer interface {
// DeleteAddress DeleteAddress Clean all wallets
DeleteAddress(context.Context, *WalletRequest) (*WalletReply, error)
// GenerateAddress GenerateAddress Generate wallet address
GenerateAddress(context.Context, *GenerateAddressRequest) (*WalletReply, error)
// GetAllAddress GetAllAddress Check all wallet addresses
GetAllAddress(context.Context, *WalletRequest) (*WalletReply, error)
// GetAllAddressAndPrivateKey GetAllAddressAndPrivateKey Query all private keys
GetAllAddressAndPrivateKey(context.Context, *WalletRequest) (*WalletKeyReply, error)
// GetPrivateKeyByAddress GetPrivateKeyByAddress Query private key through wallet address
GetPrivateKeyByAddress(context.Context, *GetPrivateKeyByAddressRequest) (*WalletPKeysReply, error)
// SignatureTrc20Grpc SignatureTrc20Grpc GrpcTrc20 Wallet Signature
SignatureTrc20Grpc(context.Context, *SignatureTrc20Request) (*SignatureTrc20Reply, error)
// WalletApprove WalletApprove Wallet authorization
WalletApprove(context.Context, *WalletApproveRequest) (*WalletApproveReply, error)
}
func RegisterWalletHTTPServer(s *http.Server, srv WalletHTTPServer) {
r := s.Route("/")
r.POST("/wallet/generateAddress", _Wallet_GenerateAddress0_HTTP_Handler(srv))
r.POST("/wallet/signatureTrc20Grpc", _Wallet_SignatureTrc20Grpc0_HTTP_Handler(srv))
r.POST("/wallet/allAddress", _Wallet_GetAllAddress0_HTTP_Handler(srv))
r.POST("/wallet/allAddressAndPrivateKey", _Wallet_GetAllAddressAndPrivateKey0_HTTP_Handler(srv))
r.POST("/wallet/privateKeyByAddress", _Wallet_GetPrivateKeyByAddress0_HTTP_Handler(srv))
r.POST("/wallet/allDeleteAddress", _Wallet_DeleteAddress0_HTTP_Handler(srv))
r.POST("/wallet/walletApprove", _Wallet_WalletApprove0_HTTP_Handler(srv))
}
func _Wallet_GenerateAddress0_HTTP_Handler(srv WalletHTTPServer) func(ctx http.Context) error {
return func(ctx http.Context) error {
var in GenerateAddressRequest
if err := ctx.Bind(&in); err != nil {
return err
}
if err := ctx.BindQuery(&in); err != nil {
return err
}
http.SetOperation(ctx, OperationWalletGenerateAddress)
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.GenerateAddress(ctx, req.(*GenerateAddressRequest))
})
out, err := h(ctx, &in)
if err != nil {
return err
}
reply := out.(*WalletReply)
return ctx.Result(200, reply)
}
}
func _Wallet_SignatureTrc20Grpc0_HTTP_Handler(srv WalletHTTPServer) func(ctx http.Context) error {
return func(ctx http.Context) error {
var in SignatureTrc20Request
if err := ctx.Bind(&in); err != nil {
return err
}
if err := ctx.BindQuery(&in); err != nil {
return err
}
http.SetOperation(ctx, OperationWalletSignatureTrc20Grpc)
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.SignatureTrc20Grpc(ctx, req.(*SignatureTrc20Request))
})
out, err := h(ctx, &in)
if err != nil {
return err
}
reply := out.(*SignatureTrc20Reply)
return ctx.Result(200, reply)
}
}
func _Wallet_GetAllAddress0_HTTP_Handler(srv WalletHTTPServer) func(ctx http.Context) error {
return func(ctx http.Context) error {
var in WalletRequest
if err := ctx.Bind(&in); err != nil {
return err
}
if err := ctx.BindQuery(&in); err != nil {
return err
}
http.SetOperation(ctx, OperationWalletGetAllAddress)
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.GetAllAddress(ctx, req.(*WalletRequest))
})
out, err := h(ctx, &in)
if err != nil {
return err
}
reply := out.(*WalletReply)
return ctx.Result(200, reply)
}
}
func _Wallet_GetAllAddressAndPrivateKey0_HTTP_Handler(srv WalletHTTPServer) func(ctx http.Context) error {
return func(ctx http.Context) error {
var in WalletRequest
if err := ctx.Bind(&in); err != nil {
return err
}
if err := ctx.BindQuery(&in); err != nil {
return err
}
http.SetOperation(ctx, OperationWalletGetAllAddressAndPrivateKey)
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.GetAllAddressAndPrivateKey(ctx, req.(*WalletRequest))
})
out, err := h(ctx, &in)
if err != nil {
return err
}
reply := out.(*WalletKeyReply)
return ctx.Result(200, reply)
}
}
func _Wallet_GetPrivateKeyByAddress0_HTTP_Handler(srv WalletHTTPServer) func(ctx http.Context) error {
return func(ctx http.Context) error {
var in GetPrivateKeyByAddressRequest
if err := ctx.Bind(&in); err != nil {
return err
}
if err := ctx.BindQuery(&in); err != nil {
return err
}
http.SetOperation(ctx, OperationWalletGetPrivateKeyByAddress)
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.GetPrivateKeyByAddress(ctx, req.(*GetPrivateKeyByAddressRequest))
})
out, err := h(ctx, &in)
if err != nil {
return err
}
reply := out.(*WalletPKeysReply)
return ctx.Result(200, reply)
}
}
func _Wallet_DeleteAddress0_HTTP_Handler(srv WalletHTTPServer) func(ctx http.Context) error {
return func(ctx http.Context) error {
var in WalletRequest
if err := ctx.Bind(&in); err != nil {
return err
}
if err := ctx.BindQuery(&in); err != nil {
return err
}
http.SetOperation(ctx, OperationWalletDeleteAddress)
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.DeleteAddress(ctx, req.(*WalletRequest))
})
out, err := h(ctx, &in)
if err != nil {
return err
}
reply := out.(*WalletReply)
return ctx.Result(200, reply)
}
}
func _Wallet_WalletApprove0_HTTP_Handler(srv WalletHTTPServer) func(ctx http.Context) error {
return func(ctx http.Context) error {
var in WalletApproveRequest
if err := ctx.Bind(&in); err != nil {
return err
}
if err := ctx.BindQuery(&in); err != nil {
return err
}
http.SetOperation(ctx, OperationWalletWalletApprove)
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.WalletApprove(ctx, req.(*WalletApproveRequest))
})
out, err := h(ctx, &in)
if err != nil {
return err
}
reply := out.(*WalletApproveReply)
return ctx.Result(200, reply)
}
}
type WalletHTTPClient interface {
DeleteAddress(ctx context.Context, req *WalletRequest, opts ...http.CallOption) (rsp *WalletReply, err error)
GenerateAddress(ctx context.Context, req *GenerateAddressRequest, opts ...http.CallOption) (rsp *WalletReply, err error)
GetAllAddress(ctx context.Context, req *WalletRequest, opts ...http.CallOption) (rsp *WalletReply, err error)
GetAllAddressAndPrivateKey(ctx context.Context, req *WalletRequest, opts ...http.CallOption) (rsp *WalletKeyReply, err error)
GetPrivateKeyByAddress(ctx context.Context, req *GetPrivateKeyByAddressRequest, opts ...http.CallOption) (rsp *WalletPKeysReply, err error)
SignatureTrc20Grpc(ctx context.Context, req *SignatureTrc20Request, opts ...http.CallOption) (rsp *SignatureTrc20Reply, err error)
WalletApprove(ctx context.Context, req *WalletApproveRequest, opts ...http.CallOption) (rsp *WalletApproveReply, err error)
}
type WalletHTTPClientImpl struct {
cc *http.Client
}
func NewWalletHTTPClient(client *http.Client) WalletHTTPClient {
return &WalletHTTPClientImpl{client}
}
func (c *WalletHTTPClientImpl) DeleteAddress(ctx context.Context, in *WalletRequest, opts ...http.CallOption) (*WalletReply, error) {
var out WalletReply
pattern := "/wallet/allDeleteAddress"
path := binding.EncodeURL(pattern, in, false)
opts = append(opts, http.Operation(OperationWalletDeleteAddress))
opts = append(opts, http.PathTemplate(pattern))
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...)
if err != nil {
return nil, err
}
return &out, nil
}
func (c *WalletHTTPClientImpl) GenerateAddress(ctx context.Context, in *GenerateAddressRequest, opts ...http.CallOption) (*WalletReply, error) {
var out WalletReply
pattern := "/wallet/generateAddress"
path := binding.EncodeURL(pattern, in, false)
opts = append(opts, http.Operation(OperationWalletGenerateAddress))
opts = append(opts, http.PathTemplate(pattern))
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...)
if err != nil {
return nil, err
}
return &out, nil
}
func (c *WalletHTTPClientImpl) GetAllAddress(ctx context.Context, in *WalletRequest, opts ...http.CallOption) (*WalletReply, error) {
var out WalletReply
pattern := "/wallet/allAddress"
path := binding.EncodeURL(pattern, in, false)
opts = append(opts, http.Operation(OperationWalletGetAllAddress))
opts = append(opts, http.PathTemplate(pattern))
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...)
if err != nil {
return nil, err
}
return &out, nil
}
func (c *WalletHTTPClientImpl) GetAllAddressAndPrivateKey(ctx context.Context, in *WalletRequest, opts ...http.CallOption) (*WalletKeyReply, error) {
var out WalletKeyReply
pattern := "/wallet/allAddressAndPrivateKey"
path := binding.EncodeURL(pattern, in, false)
opts = append(opts, http.Operation(OperationWalletGetAllAddressAndPrivateKey))
opts = append(opts, http.PathTemplate(pattern))
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...)
if err != nil {
return nil, err
}
return &out, nil
}
func (c *WalletHTTPClientImpl) GetPrivateKeyByAddress(ctx context.Context, in *GetPrivateKeyByAddressRequest, opts ...http.CallOption) (*WalletPKeysReply, error) {
var out WalletPKeysReply
pattern := "/wallet/privateKeyByAddress"
path := binding.EncodeURL(pattern, in, false)
opts = append(opts, http.Operation(OperationWalletGetPrivateKeyByAddress))
opts = append(opts, http.PathTemplate(pattern))
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...)
if err != nil {
return nil, err
}
return &out, nil
}
func (c *WalletHTTPClientImpl) SignatureTrc20Grpc(ctx context.Context, in *SignatureTrc20Request, opts ...http.CallOption) (*SignatureTrc20Reply, error) {
var out SignatureTrc20Reply
pattern := "/wallet/signatureTrc20Grpc"
path := binding.EncodeURL(pattern, in, false)
opts = append(opts, http.Operation(OperationWalletSignatureTrc20Grpc))
opts = append(opts, http.PathTemplate(pattern))
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...)
if err != nil {
return nil, err
}
return &out, nil
}
func (c *WalletHTTPClientImpl) WalletApprove(ctx context.Context, in *WalletApproveRequest, opts ...http.CallOption) (*WalletApproveReply, error) {
var out WalletApproveReply
pattern := "/wallet/walletApprove"
path := binding.EncodeURL(pattern, in, false)
opts = append(opts, http.Operation(OperationWalletWalletApprove))
opts = append(opts, http.PathTemplate(pattern))
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...)
if err != nil {
return nil, err
}
return &out, nil
}