diff --git a/pkg/internal/grpc/payment.go b/pkg/internal/grpc/payment.go index f3c7811..b567c71 100644 --- a/pkg/internal/grpc/payment.go +++ b/pkg/internal/grpc/payment.go @@ -50,7 +50,7 @@ func (v *Server) MakeTransaction(ctx context.Context, request *proto.MakeTransac } } - transaction, err := services.MakeTransaction(request.GetAmount(), request.GetRemark(), payerWallet, payeeWallet) + transaction, err := services.MakeTransaction(request.GetAmount(), request.GetRemark(), request.GetCurrency(), payerWallet, payeeWallet) if err != nil { return nil, status.Errorf(codes.Internal, err.Error()) } @@ -77,7 +77,7 @@ func (v *Server) MakeTransactionWithAccount(ctx context.Context, request *proto. } } - transaction, err := services.MakeTransaction(request.GetAmount(), request.GetRemark(), payerWallet, payeeWallet) + transaction, err := services.MakeTransaction(request.GetAmount(), request.GetRemark(), request.GetCurrency(), payerWallet, payeeWallet) if err != nil { return nil, status.Errorf(codes.Internal, err.Error()) } diff --git a/pkg/internal/models/order.go b/pkg/internal/models/order.go index 4e0ac81..dd6fd48 100644 --- a/pkg/internal/models/order.go +++ b/pkg/internal/models/order.go @@ -24,4 +24,5 @@ type Order struct { Transaction *Transaction `json:"transaction"` TransactionID *uint `json:"transaction_id"` ClientID *uint `json:"client_id"` + Currency string `json:"currency"` } diff --git a/pkg/internal/models/transaction.go b/pkg/internal/models/transaction.go index 7d03faa..36bdef6 100644 --- a/pkg/internal/models/transaction.go +++ b/pkg/internal/models/transaction.go @@ -10,12 +10,13 @@ import ( type Transaction struct { cruda.BaseModel - Remark string `json:"remark"` // The usage of this transaction - Amount decimal.Decimal `json:"amount" type:"decimal(30,2);"` - Payer *Wallet `json:"payer" foreignKey:"PayerID"` // Who give the money - Payee *Wallet `json:"payee" foreignKey:"PayeeID"` // Who get the money - PayerID *uint `json:"payer_id"` // Leave this field as nil means pay from the system - PayeeID *uint `json:"payee_id"` // Leave this field as nil means pay to the system + Remark string `json:"remark"` // The usage of this transaction + Amount decimal.Decimal `json:"amount" type:"decimal(30,2);"` + Currency string `json:"currency" gorm:"default:'normal'"` + Payer *Wallet `json:"payer" foreignKey:"PayerID"` // Who give the money + Payee *Wallet `json:"payee" foreignKey:"PayeeID"` // Who get the money + PayerID *uint `json:"payer_id"` // Leave this field as nil means pay from the system + PayeeID *uint `json:"payee_id"` // Leave this field as nil means pay to the system } func (v *Transaction) ToTransactionInfo() *proto.TransactionInfo { diff --git a/pkg/internal/models/wallet.go b/pkg/internal/models/wallet.go index b8866e2..c2fe255 100644 --- a/pkg/internal/models/wallet.go +++ b/pkg/internal/models/wallet.go @@ -9,9 +9,10 @@ import ( type Wallet struct { cruda.BaseModel - Balance decimal.Decimal `json:"balance" sql:"type:decimal(30,2);"` - Password string `json:"password"` - AccountID uint `json:"account_id"` + Balance decimal.Decimal `json:"balance" sql:"type:decimal(30,2);"` + GoldenBalance decimal.Decimal `json:"golden_balance" sql:"type:decimal(30,2);"` + Password string `json:"password"` + AccountID uint `json:"account_id"` } func (v *Wallet) ToWalletInfo() *proto.WalletInfo { diff --git a/pkg/internal/server/api/order_api.go b/pkg/internal/server/api/order_api.go index e9cdcf6..af64b43 100644 --- a/pkg/internal/server/api/order_api.go +++ b/pkg/internal/server/api/order_api.go @@ -11,6 +11,7 @@ import ( "git.solsynth.dev/hypernet/wallet/pkg/internal/server/exts" "git.solsynth.dev/hypernet/wallet/pkg/internal/services" "github.com/gofiber/fiber/v2" + "github.com/samber/lo" "github.com/shopspring/decimal" "golang.org/x/crypto/bcrypt" ) @@ -34,12 +35,17 @@ func createOrder(c *fiber.Ctx) error { Amount float64 `json:"amount" validate:"required"` PayeeID *uint `json:"payee_id"` PayerID *uint `json:"payer_id"` + Currency string `json:"currency" validate:"required"` } if err := exts.BindAndValidate(c, &data); err != nil { return err } + if !lo.Contains([]string{"normal", "golden"}, data.Currency) { + return fiber.NewError(fiber.StatusBadRequest, "invalid currency") + } + // Validating client client, err := authkit.GetThirdClientByAlias(gap.Nx, data.ClientID, &data.ClientSecret) if err != nil { @@ -50,6 +56,7 @@ func createOrder(c *fiber.Ctx) error { Status: models.OrderStatusPending, Remark: data.Remark, Amount: decimal.NewFromFloat(data.Amount), + Currency: data.Currency, ClientID: &client.ID, } @@ -126,7 +133,7 @@ func payOrder(c *fiber.Ctx) error { } } - if tran, err := services.MakeTransaction(order.Amount.InexactFloat64(), order.Remark, payer, payee); err != nil { + if tran, err := services.MakeTransaction(order.Amount.InexactFloat64(), order.Remark, order.Currency, payer, payee); err != nil { return fiber.NewError(fiber.StatusPaymentRequired, err.Error()) } else { if err := database.C.Model(&order).Updates(&models.Order{ @@ -137,6 +144,7 @@ func payOrder(c *fiber.Ctx) error { _, _ = services.MakeTransaction( order.Amount.InexactFloat64(), fmt.Sprintf("%s - #%d Refund", order.Remark, order.ID), + order.Currency, payee, payer, ) diff --git a/pkg/internal/server/api/transaction_api.go b/pkg/internal/server/api/transaction_api.go index dc79452..c96aac2 100644 --- a/pkg/internal/server/api/transaction_api.go +++ b/pkg/internal/server/api/transaction_api.go @@ -11,6 +11,7 @@ import ( "git.solsynth.dev/hypernet/wallet/pkg/internal/server/exts" "git.solsynth.dev/hypernet/wallet/pkg/internal/services" "github.com/gofiber/fiber/v2" + "github.com/samber/lo" ) func listTransaction(c *fiber.Ctx) error { @@ -77,12 +78,17 @@ func makeTransaction(c *fiber.Ctx) error { Amount float64 `json:"amount" validate:"required"` PayeeID *uint `json:"payee_id"` PayerID *uint `json:"payer_id"` + Currency string `json:"currency" validate:"required"` } if err := exts.BindAndValidate(c, &data); err != nil { return err } + if !lo.Contains([]string{"normal", "golden"}, data.Currency) { + return fiber.NewError(fiber.StatusBadRequest, "invalid currency") + } + // Validating client client, err := authkit.GetThirdClientByAlias(gap.Nx, data.ClientID, &data.ClientSecret) if err != nil { @@ -110,7 +116,7 @@ func makeTransaction(c *fiber.Ctx) error { return fiber.NewError(fiber.StatusBadRequest, "payee and payer cannot be both blank") } - tran, err := services.MakeTransaction(data.Amount, data.Remark, payer, payee) + tran, err := services.MakeTransaction(data.Amount, data.Remark, data.Currency, payer, payee) if err != nil { return fiber.NewError(fiber.StatusBadRequest, err.Error()) } diff --git a/pkg/internal/services/payment.go b/pkg/internal/services/payment.go index 43ae026..f65ab90 100644 --- a/pkg/internal/services/payment.go +++ b/pkg/internal/services/payment.go @@ -12,13 +12,14 @@ import ( "github.com/shopspring/decimal" ) -func MakeTransaction(amount float64, remark string, payer, payee *models.Wallet) (models.Transaction, error) { +func MakeTransaction(amount float64, remark, currency string, payer, payee *models.Wallet) (models.Transaction, error) { // Round amount to keep 2 decimal places amount = math.Round(amount*100) / 100 transaction := models.Transaction{ - Amount: decimal.NewFromFloat(amount), - Remark: remark, + Amount: decimal.NewFromFloat(amount), + Remark: remark, + Currency: currency, } if payer != nil { if payer.Balance.LessThan(transaction.Amount) { @@ -38,7 +39,12 @@ func MakeTransaction(amount float64, remark string, payer, payee *models.Wallet) } if payer != nil { - payer.Balance = payer.Balance.Sub(transaction.Amount) + switch currency { + case "golden": + payer.GoldenBalance = payer.GoldenBalance.Sub(transaction.Amount) + default: + payer.Balance = payer.Balance.Sub(transaction.Amount) + } if err := tx.Model(payer). Updates(&models.Wallet{Balance: payer.Balance}).Error; err != nil { tx.Rollback() @@ -46,7 +52,12 @@ func MakeTransaction(amount float64, remark string, payer, payee *models.Wallet) } } if payee != nil { - payee.Balance = payee.Balance.Add(transaction.Amount) + switch currency { + case "golden": + payee.GoldenBalance = payee.GoldenBalance.Add(transaction.Amount) + default: + payee.Balance = payee.Balance.Add(transaction.Amount) + } if err := tx.Model(payee). Updates(&models.Wallet{Balance: payee.Balance}).Error; err != nil { tx.Rollback() @@ -63,10 +74,18 @@ func MakeTransaction(amount float64, remark string, payer, payee *models.Wallet) Subtitle: transaction.Remark, Body: fmt.Sprintf("%.2f SRC removed from your wallet. Your new balance is %.2f", amount, payer.Balance.InexactFloat64()), Metadata: map[string]any{ - "id": transaction.ID, - "amount": amount, - "balance": payer.Balance.InexactFloat64(), - "remark": transaction.Remark, + "id": transaction.ID, + "amount": amount, + "balance": (func() float64 { + switch currency { + case "golden": + return payer.GoldenBalance.InexactFloat64() + default: + return payer.Balance.InexactFloat64() + } + })(), + "remark": transaction.Remark, + "currency": currency, }, Priority: 0, }) @@ -78,10 +97,18 @@ func MakeTransaction(amount float64, remark string, payer, payee *models.Wallet) Subtitle: transaction.Remark, Body: fmt.Sprintf("%.2f SRC added to your wallet. Your new balance is %.2f", amount, payee.Balance.InexactFloat64()), Metadata: map[string]any{ - "id": transaction.ID, - "amount": amount, - "balance": payee.Balance.InexactFloat64(), - "remark": transaction.Remark, + "id": transaction.ID, + "amount": amount, + "balance": (func() float64 { + switch currency { + case "golden": + return payee.GoldenBalance.InexactFloat64() + default: + return payee.Balance.InexactFloat64() + } + })(), + "remark": transaction.Remark, + "currency": currency, }, Priority: 0, }) diff --git a/pkg/proto/payment.pb.go b/pkg/proto/payment.pb.go index b9d8c37..777bc5f 100644 --- a/pkg/proto/payment.pb.go +++ b/pkg/proto/payment.pb.go @@ -25,9 +25,10 @@ type WalletInfo struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Balance float64 `protobuf:"fixed64,2,opt,name=balance,proto3" json:"balance,omitempty"` - AccountId uint64 `protobuf:"varint,3,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"` + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Balance float64 `protobuf:"fixed64,2,opt,name=balance,proto3" json:"balance,omitempty"` + GoldenBalance float64 `protobuf:"fixed64,3,opt,name=golden_balance,json=goldenBalance,proto3" json:"golden_balance,omitempty"` + AccountId uint64 `protobuf:"varint,4,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"` } func (x *WalletInfo) Reset() { @@ -74,6 +75,13 @@ func (x *WalletInfo) GetBalance() float64 { return 0 } +func (x *WalletInfo) GetGoldenBalance() float64 { + if x != nil { + return x.GoldenBalance + } + return 0 +} + func (x *WalletInfo) GetAccountId() uint64 { if x != nil { return x.AccountId @@ -86,11 +94,12 @@ type TransactionInfo struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - PayerId *uint64 `protobuf:"varint,2,opt,name=payer_id,json=payerId,proto3,oneof" json:"payer_id,omitempty"` - PayeeId *uint64 `protobuf:"varint,3,opt,name=payee_id,json=payeeId,proto3,oneof" json:"payee_id,omitempty"` - Amount float64 `protobuf:"fixed64,4,opt,name=amount,proto3" json:"amount,omitempty"` - Remark string `protobuf:"bytes,5,opt,name=remark,proto3" json:"remark,omitempty"` + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + PayerId *uint64 `protobuf:"varint,2,opt,name=payer_id,json=payerId,proto3,oneof" json:"payer_id,omitempty"` + PayeeId *uint64 `protobuf:"varint,3,opt,name=payee_id,json=payeeId,proto3,oneof" json:"payee_id,omitempty"` + Amount float64 `protobuf:"fixed64,4,opt,name=amount,proto3" json:"amount,omitempty"` + Remark string `protobuf:"bytes,5,opt,name=remark,proto3" json:"remark,omitempty"` + Currency string `protobuf:"bytes,6,opt,name=currency,proto3" json:"currency,omitempty"` } func (x *TransactionInfo) Reset() { @@ -158,6 +167,13 @@ func (x *TransactionInfo) GetRemark() string { return "" } +func (x *TransactionInfo) GetCurrency() string { + if x != nil { + return x.Currency + } + return "" +} + type GetWalletRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -343,10 +359,11 @@ type MakeTransactionRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - PayerId *uint64 `protobuf:"varint,1,opt,name=payer_id,json=payerId,proto3,oneof" json:"payer_id,omitempty"` - PayeeId *uint64 `protobuf:"varint,2,opt,name=payee_id,json=payeeId,proto3,oneof" json:"payee_id,omitempty"` - Amount float64 `protobuf:"fixed64,3,opt,name=amount,proto3" json:"amount,omitempty"` - Remark string `protobuf:"bytes,4,opt,name=remark,proto3" json:"remark,omitempty"` + PayerId *uint64 `protobuf:"varint,1,opt,name=payer_id,json=payerId,proto3,oneof" json:"payer_id,omitempty"` + PayeeId *uint64 `protobuf:"varint,2,opt,name=payee_id,json=payeeId,proto3,oneof" json:"payee_id,omitempty"` + Amount float64 `protobuf:"fixed64,3,opt,name=amount,proto3" json:"amount,omitempty"` + Remark string `protobuf:"bytes,4,opt,name=remark,proto3" json:"remark,omitempty"` + Currency string `protobuf:"bytes,5,opt,name=currency,proto3" json:"currency,omitempty"` } func (x *MakeTransactionRequest) Reset() { @@ -407,6 +424,13 @@ func (x *MakeTransactionRequest) GetRemark() string { return "" } +func (x *MakeTransactionRequest) GetCurrency() string { + if x != nil { + return x.Currency + } + return "" +} + type MakeTransactionResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -461,6 +485,7 @@ type MakeTransactionWithAccountRequest struct { PayeeAccountId *uint64 `protobuf:"varint,2,opt,name=payee_account_id,json=payeeAccountId,proto3,oneof" json:"payee_account_id,omitempty"` Amount float64 `protobuf:"fixed64,3,opt,name=amount,proto3" json:"amount,omitempty"` Remark string `protobuf:"bytes,4,opt,name=remark,proto3" json:"remark,omitempty"` + Currency string `protobuf:"bytes,5,opt,name=currency,proto3" json:"currency,omitempty"` } func (x *MakeTransactionWithAccountRequest) Reset() { @@ -521,94 +546,109 @@ func (x *MakeTransactionWithAccountRequest) GetRemark() string { return "" } +func (x *MakeTransactionWithAccountRequest) GetCurrency() string { + if x != nil { + return x.Currency + } + return "" +} + var File_payment_proto protoreflect.FileDescriptor var file_payment_proto_rawDesc = []byte{ 0x0a, 0x0d, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, - 0x05, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x55, 0x0a, 0x0a, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, + 0x05, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x7c, 0x0a, 0x0a, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x1d, - 0x0a, 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x22, 0xab, 0x01, - 0x0a, 0x0f, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, - 0x6f, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, - 0x64, 0x12, 0x1e, 0x0a, 0x08, 0x70, 0x61, 0x79, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x04, 0x48, 0x00, 0x52, 0x07, 0x70, 0x61, 0x79, 0x65, 0x72, 0x49, 0x64, 0x88, 0x01, - 0x01, 0x12, 0x1e, 0x0a, 0x08, 0x70, 0x61, 0x79, 0x65, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x04, 0x48, 0x01, 0x52, 0x07, 0x70, 0x61, 0x79, 0x65, 0x65, 0x49, 0x64, 0x88, 0x01, - 0x01, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x6d, - 0x61, 0x72, 0x6b, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x6d, 0x61, 0x72, - 0x6b, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x70, 0x61, 0x79, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x42, 0x0b, - 0x0a, 0x09, 0x5f, 0x70, 0x61, 0x79, 0x65, 0x65, 0x5f, 0x69, 0x64, 0x22, 0x31, 0x0a, 0x10, 0x47, - 0x65, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x1d, 0x0a, 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x04, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x22, 0x3e, - 0x0a, 0x11, 0x47, 0x65, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x29, 0x0a, 0x06, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x57, 0x61, 0x6c, 0x6c, - 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x06, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x22, 0x27, - 0x0a, 0x15, 0x47, 0x65, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x22, 0x52, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x54, 0x72, - 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x38, 0x0a, 0x0b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x54, - 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0b, - 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xa2, 0x01, 0x0a, 0x16, - 0x4d, 0x61, 0x6b, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1e, 0x0a, 0x08, 0x70, 0x61, 0x79, 0x65, 0x72, 0x5f, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x48, 0x00, 0x52, 0x07, 0x70, 0x61, 0x79, 0x65, - 0x72, 0x49, 0x64, 0x88, 0x01, 0x01, 0x12, 0x1e, 0x0a, 0x08, 0x70, 0x61, 0x79, 0x65, 0x65, 0x5f, - 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x48, 0x01, 0x52, 0x07, 0x70, 0x61, 0x79, 0x65, - 0x65, 0x49, 0x64, 0x88, 0x01, 0x01, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x16, - 0x0a, 0x06, 0x72, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, - 0x72, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x70, 0x61, 0x79, 0x65, 0x72, - 0x5f, 0x69, 0x64, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x70, 0x61, 0x79, 0x65, 0x65, 0x5f, 0x69, 0x64, - 0x22, 0x53, 0x0a, 0x17, 0x4d, 0x61, 0x6b, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, 0x0b, 0x74, - 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xdb, 0x01, 0x0a, 0x21, 0x4d, 0x61, 0x6b, 0x65, 0x54, 0x72, - 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x57, 0x69, 0x74, 0x68, 0x41, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2d, 0x0a, 0x10, 0x70, - 0x61, 0x79, 0x65, 0x72, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x04, 0x48, 0x00, 0x52, 0x0e, 0x70, 0x61, 0x79, 0x65, 0x72, 0x41, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x88, 0x01, 0x01, 0x12, 0x2d, 0x0a, 0x10, 0x70, 0x61, - 0x79, 0x65, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x04, 0x48, 0x01, 0x52, 0x0e, 0x70, 0x61, 0x79, 0x65, 0x65, 0x41, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x88, 0x01, 0x01, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, + 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x25, + 0x0a, 0x0e, 0x67, 0x6f, 0x6c, 0x64, 0x65, 0x6e, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0d, 0x67, 0x6f, 0x6c, 0x64, 0x65, 0x6e, 0x42, 0x61, + 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x49, 0x64, 0x22, 0xc7, 0x01, 0x0a, 0x0f, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x08, 0x70, 0x61, 0x79, 0x65, + 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x48, 0x00, 0x52, 0x07, 0x70, 0x61, + 0x79, 0x65, 0x72, 0x49, 0x64, 0x88, 0x01, 0x01, 0x12, 0x1e, 0x0a, 0x08, 0x70, 0x61, 0x79, 0x65, + 0x65, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x48, 0x01, 0x52, 0x07, 0x70, 0x61, + 0x79, 0x65, 0x65, 0x49, 0x64, 0x88, 0x01, 0x01, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, + 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, + 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x72, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x75, 0x72, 0x72, + 0x65, 0x6e, 0x63, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x75, 0x72, 0x72, + 0x65, 0x6e, 0x63, 0x79, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x70, 0x61, 0x79, 0x65, 0x72, 0x5f, 0x69, + 0x64, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x70, 0x61, 0x79, 0x65, 0x65, 0x5f, 0x69, 0x64, 0x22, 0x31, + 0x0a, 0x10, 0x47, 0x65, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, + 0x64, 0x22, 0x3e, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x29, 0x0a, 0x06, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x57, + 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x06, 0x77, 0x61, 0x6c, 0x6c, 0x65, + 0x74, 0x22, 0x27, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x22, 0x52, 0x0a, 0x16, 0x47, 0x65, + 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, 0x0b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, + 0x6f, 0x52, 0x0b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xbe, + 0x01, 0x0a, 0x16, 0x4d, 0x61, 0x6b, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1e, 0x0a, 0x08, 0x70, 0x61, 0x79, + 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x48, 0x00, 0x52, 0x07, 0x70, + 0x61, 0x79, 0x65, 0x72, 0x49, 0x64, 0x88, 0x01, 0x01, 0x12, 0x1e, 0x0a, 0x08, 0x70, 0x61, 0x79, + 0x65, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x48, 0x01, 0x52, 0x07, 0x70, + 0x61, 0x79, 0x65, 0x65, 0x49, 0x64, 0x88, 0x01, 0x01, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x72, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x42, 0x13, 0x0a, 0x11, 0x5f, 0x70, 0x61, - 0x79, 0x65, 0x72, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x42, 0x13, - 0x0a, 0x11, 0x5f, 0x70, 0x61, 0x79, 0x65, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x5f, 0x69, 0x64, 0x32, 0xd1, 0x02, 0x0a, 0x0e, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x40, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x57, 0x61, 0x6c, - 0x6c, 0x65, 0x74, 0x12, 0x17, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x65, 0x74, 0x57, - 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x65, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4f, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x54, - 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2e, 0x47, 0x65, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4a, 0x0a, 0x0f, 0x4d, 0x61, 0x6b, - 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4d, 0x61, 0x6b, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, - 0x6e, 0x66, 0x6f, 0x22, 0x00, 0x12, 0x60, 0x0a, 0x1a, 0x4d, 0x61, 0x6b, 0x65, 0x54, 0x72, 0x61, + 0x09, 0x52, 0x06, 0x72, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x75, 0x72, + 0x72, 0x65, 0x6e, 0x63, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x75, 0x72, + 0x72, 0x65, 0x6e, 0x63, 0x79, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x70, 0x61, 0x79, 0x65, 0x72, 0x5f, + 0x69, 0x64, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x70, 0x61, 0x79, 0x65, 0x65, 0x5f, 0x69, 0x64, 0x22, + 0x53, 0x0a, 0x17, 0x4d, 0x61, 0x6b, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, 0x0b, 0x74, 0x72, + 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xf7, 0x01, 0x0a, 0x21, 0x4d, 0x61, 0x6b, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x57, 0x69, 0x74, 0x68, 0x41, 0x63, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x12, 0x28, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4d, 0x61, 0x6b, 0x65, - 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x57, 0x69, 0x74, 0x68, 0x41, - 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x00, 0x42, 0x09, 0x5a, 0x07, 0x2e, 0x3b, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2d, 0x0a, 0x10, 0x70, 0x61, + 0x79, 0x65, 0x72, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x04, 0x48, 0x00, 0x52, 0x0e, 0x70, 0x61, 0x79, 0x65, 0x72, 0x41, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x88, 0x01, 0x01, 0x12, 0x2d, 0x0a, 0x10, 0x70, 0x61, 0x79, + 0x65, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x04, 0x48, 0x01, 0x52, 0x0e, 0x70, 0x61, 0x79, 0x65, 0x65, 0x41, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x49, 0x64, 0x88, 0x01, 0x01, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, + 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, + 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x72, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x75, 0x72, 0x72, + 0x65, 0x6e, 0x63, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x75, 0x72, 0x72, + 0x65, 0x6e, 0x63, 0x79, 0x42, 0x13, 0x0a, 0x11, 0x5f, 0x70, 0x61, 0x79, 0x65, 0x72, 0x5f, 0x61, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x42, 0x13, 0x0a, 0x11, 0x5f, 0x70, 0x61, + 0x79, 0x65, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x32, 0xd1, + 0x02, 0x0a, 0x0e, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x12, 0x40, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x12, 0x17, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x65, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x47, 0x65, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x00, 0x12, 0x4f, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x65, + 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x65, 0x74, 0x54, + 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x00, 0x12, 0x4a, 0x0a, 0x0f, 0x4d, 0x61, 0x6b, 0x65, 0x54, 0x72, 0x61, 0x6e, + 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x4d, 0x61, 0x6b, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x54, + 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x00, + 0x12, 0x60, 0x0a, 0x1a, 0x4d, 0x61, 0x6b, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x57, 0x69, 0x74, 0x68, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x28, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4d, 0x61, 0x6b, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, + 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x57, 0x69, 0x74, 0x68, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, + 0x22, 0x00, 0x42, 0x09, 0x5a, 0x07, 0x2e, 0x3b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/pkg/proto/payment.proto b/pkg/proto/payment.proto index b71509f..83b8f3d 100644 --- a/pkg/proto/payment.proto +++ b/pkg/proto/payment.proto @@ -14,7 +14,8 @@ service PaymentService { message WalletInfo { uint64 id = 1; double balance = 2; - uint64 account_id = 3; + double golden_balance = 3; + uint64 account_id = 4; } message TransactionInfo { @@ -23,6 +24,7 @@ message TransactionInfo { optional uint64 payee_id = 3; double amount = 4; string remark = 5; + string currency = 6; } message GetWalletRequest { @@ -46,6 +48,7 @@ message MakeTransactionRequest { optional uint64 payee_id = 2; double amount = 3; string remark = 4; + string currency = 5; } message MakeTransactionResponse { @@ -57,4 +60,5 @@ message MakeTransactionWithAccountRequest { optional uint64 payee_account_id = 2; double amount = 3; string remark = 4; + string currency = 5; }