diff --git a/examples/erc20_utxo/erc20.go b/examples/erc20_utxo/erc20.go index 5ea9ad3..95d4704 100644 --- a/examples/erc20_utxo/erc20.go +++ b/examples/erc20_utxo/erc20.go @@ -2,6 +2,7 @@ package erc20_utxo import ( "errors" + "math/big" "github.com/hyperledger-labs/cckit/examples/erc20_utxo/service/allowance" "github.com/hyperledger-labs/cckit/examples/erc20_utxo/service/config" @@ -15,7 +16,7 @@ var ( Name: `SomeToken`, Symbol: `@`, Decimals: 2, - TotalSupply: `10000000`, + TotalSupply: token.NewBigInt(big.NewInt(10000000)), } ) diff --git a/examples/erc20_utxo/erc20_test.go b/examples/erc20_utxo/erc20_test.go index 09c1d96..817bf85 100644 --- a/examples/erc20_utxo/erc20_test.go +++ b/examples/erc20_utxo/erc20_test.go @@ -2,6 +2,7 @@ package erc20_utxo_test import ( "encoding/base64" + "math/big" "testing" . "github.com/onsi/ginkgo" @@ -97,13 +98,13 @@ var _ = Describe(`ERC`, func() { &token.BalanceId{Address: user1Address, Symbol: erc20_utxo.Token.Symbol}), &token.Balance{}).(*token.Balance) - Expect(b.Amount).To(Equal(`0`)) + Expect(b.Amount).To(Equal(token.NewBigInt(big.NewInt(0)))) }) }) Context(`transfer`, func() { - var transferAmount = `100` + var transferAmount = token.NewBigInt(big.NewInt(100)) It(`Disallow to transfer balance by user with zero balance`, func() { expectcc.ResponseError( @@ -149,7 +150,7 @@ var _ = Describe(`ERC`, func() { Context(`Allowance`, func() { - var allowAmount = `50` + var allowAmount = token.NewBigInt(big.NewInt(50)) It(`Allow to approve amount by owner for spender even if balance is zero`, func() { a := expectcc.PayloadIs( diff --git a/examples/erc20_utxo/service/allowance/allowance.go b/examples/erc20_utxo/service/allowance/allowance.go index 7ec6ff3..ca62b6b 100644 --- a/examples/erc20_utxo/service/allowance/allowance.go +++ b/examples/erc20_utxo/service/allowance/allowance.go @@ -3,7 +3,6 @@ package allowance import ( "errors" "fmt" - "math/big" "github.com/hyperledger-labs/cckit/extensions/account" "github.com/hyperledger-labs/cckit/extensions/token" @@ -41,7 +40,7 @@ func (s *Service) GetAllowance(ctx router.Context, id *AllowanceId) (*Allowance, Spender: id.Spender, Symbol: id.Symbol, Group: id.Group, - Amount: ``, + Amount: nil, }, nil } return nil, fmt.Errorf(`get allowance: %w`, err) @@ -107,12 +106,12 @@ func (s *Service) TransferFrom(ctx router.Context, req *TransferFromRequest) (*T return nil, err } - reqAmount, err := token.IntVal(req.Amount) + reqAmount, err := req.Amount.BigInt() if err != nil { return nil, fmt.Errorf(`req amount: %w`, err) } - curAmount, err := token.IntVal(allowance.Amount) + curAmount, err := allowance.Amount.BigInt() if err != nil { return nil, fmt.Errorf(`cur amount: %w`, err) } @@ -121,7 +120,7 @@ func (s *Service) TransferFrom(ctx router.Context, req *TransferFromRequest) (*T req.Amount, allowance.Amount, ErrAllowanceInsufficient) } - allowance.Amount = new(big.Int).Sub(curAmount, reqAmount).String() + allowance.Amount = token.NewBigIntSub(curAmount, reqAmount) // sub from allowance if err := State(ctx).Put(allowance); err != nil { diff --git a/examples/erc20_utxo/service/allowance/allowance.pb.go b/examples/erc20_utxo/service/allowance/allowance.pb.go index ef92a8a..b066e7c 100644 --- a/examples/erc20_utxo/service/allowance/allowance.pb.go +++ b/examples/erc20_utxo/service/allowance/allowance.pb.go @@ -8,6 +8,7 @@ package allowance import ( context "context" + token "github.com/hyperledger-labs/cckit/extensions/token" _ "github.com/mwitkow/go-proto-validators" _ "google.golang.org/genproto/googleapis/api/annotations" grpc "google.golang.org/grpc" @@ -32,11 +33,11 @@ type ApproveRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` - Spender string `protobuf:"bytes,2,opt,name=spender,proto3" json:"spender,omitempty"` - Symbol string `protobuf:"bytes,3,opt,name=symbol,proto3" json:"symbol,omitempty"` - Group []string `protobuf:"bytes,4,rep,name=group,proto3" json:"group,omitempty"` - Amount string `protobuf:"bytes,5,opt,name=amount,proto3" json:"amount,omitempty"` + Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` + Spender string `protobuf:"bytes,2,opt,name=spender,proto3" json:"spender,omitempty"` + Symbol string `protobuf:"bytes,3,opt,name=symbol,proto3" json:"symbol,omitempty"` + Group []string `protobuf:"bytes,4,rep,name=group,proto3" json:"group,omitempty"` + Amount *token.BigInt `protobuf:"bytes,5,opt,name=amount,proto3" json:"amount,omitempty"` } func (x *ApproveRequest) Reset() { @@ -99,11 +100,11 @@ func (x *ApproveRequest) GetGroup() []string { return nil } -func (x *ApproveRequest) GetAmount() string { +func (x *ApproveRequest) GetAmount() *token.BigInt { if x != nil { return x.Amount } - return "" + return nil } type TransferFromRequest struct { @@ -111,11 +112,11 @@ type TransferFromRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` - Recipient string `protobuf:"bytes,2,opt,name=recipient,proto3" json:"recipient,omitempty"` - Symbol string `protobuf:"bytes,3,opt,name=symbol,proto3" json:"symbol,omitempty"` - Group []string `protobuf:"bytes,4,rep,name=group,proto3" json:"group,omitempty"` - Amount string `protobuf:"bytes,5,opt,name=amount,proto3" json:"amount,omitempty"` + Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` + Recipient string `protobuf:"bytes,2,opt,name=recipient,proto3" json:"recipient,omitempty"` + Symbol string `protobuf:"bytes,3,opt,name=symbol,proto3" json:"symbol,omitempty"` + Group []string `protobuf:"bytes,4,rep,name=group,proto3" json:"group,omitempty"` + Amount *token.BigInt `protobuf:"bytes,5,opt,name=amount,proto3" json:"amount,omitempty"` } func (x *TransferFromRequest) Reset() { @@ -178,11 +179,11 @@ func (x *TransferFromRequest) GetGroup() []string { return nil } -func (x *TransferFromRequest) GetAmount() string { +func (x *TransferFromRequest) GetAmount() *token.BigInt { if x != nil { return x.Amount } - return "" + return nil } type TransferFromResponse struct { @@ -190,11 +191,11 @@ type TransferFromResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` - Recipient string `protobuf:"bytes,2,opt,name=recipient,proto3" json:"recipient,omitempty"` - Symbol string `protobuf:"bytes,3,opt,name=symbol,proto3" json:"symbol,omitempty"` - Group []string `protobuf:"bytes,4,rep,name=group,proto3" json:"group,omitempty"` - Amount string `protobuf:"bytes,5,opt,name=amount,proto3" json:"amount,omitempty"` + Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` + Recipient string `protobuf:"bytes,2,opt,name=recipient,proto3" json:"recipient,omitempty"` + Symbol string `protobuf:"bytes,3,opt,name=symbol,proto3" json:"symbol,omitempty"` + Group []string `protobuf:"bytes,4,rep,name=group,proto3" json:"group,omitempty"` + Amount *token.BigInt `protobuf:"bytes,5,opt,name=amount,proto3" json:"amount,omitempty"` } func (x *TransferFromResponse) Reset() { @@ -257,11 +258,11 @@ func (x *TransferFromResponse) GetGroup() []string { return nil } -func (x *TransferFromResponse) GetAmount() string { +func (x *TransferFromResponse) GetAmount() *token.BigInt { if x != nil { return x.Amount } - return "" + return nil } // Id: Allowance identifier @@ -342,11 +343,11 @@ type Allowance struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` - Spender string `protobuf:"bytes,2,opt,name=spender,proto3" json:"spender,omitempty"` - Symbol string `protobuf:"bytes,3,opt,name=symbol,proto3" json:"symbol,omitempty"` - Group []string `protobuf:"bytes,4,rep,name=group,proto3" json:"group,omitempty"` - Amount string `protobuf:"bytes,5,opt,name=amount,proto3" json:"amount,omitempty"` + Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` + Spender string `protobuf:"bytes,2,opt,name=spender,proto3" json:"spender,omitempty"` + Symbol string `protobuf:"bytes,3,opt,name=symbol,proto3" json:"symbol,omitempty"` + Group []string `protobuf:"bytes,4,rep,name=group,proto3" json:"group,omitempty"` + Amount *token.BigInt `protobuf:"bytes,5,opt,name=amount,proto3" json:"amount,omitempty"` } func (x *Allowance) Reset() { @@ -409,11 +410,11 @@ func (x *Allowance) GetGroup() []string { return nil } -func (x *Allowance) GetAmount() string { +func (x *Allowance) GetAmount() *token.BigInt { if x != nil { return x.Amount } - return "" + return nil } type Operation struct { @@ -421,11 +422,11 @@ type Operation struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` - Spender string `protobuf:"bytes,2,opt,name=spender,proto3" json:"spender,omitempty"` - Symbol string `protobuf:"bytes,3,opt,name=symbol,proto3" json:"symbol,omitempty"` - Group []string `protobuf:"bytes,4,rep,name=group,proto3" json:"group,omitempty"` - Amount string `protobuf:"bytes,5,opt,name=amount,proto3" json:"amount,omitempty"` + Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` + Spender string `protobuf:"bytes,2,opt,name=spender,proto3" json:"spender,omitempty"` + Symbol string `protobuf:"bytes,3,opt,name=symbol,proto3" json:"symbol,omitempty"` + Group []string `protobuf:"bytes,4,rep,name=group,proto3" json:"group,omitempty"` + Amount *token.BigInt `protobuf:"bytes,5,opt,name=amount,proto3" json:"amount,omitempty"` } func (x *Operation) Reset() { @@ -488,11 +489,11 @@ func (x *Operation) GetGroup() []string { return nil } -func (x *Operation) GetAmount() string { +func (x *Operation) GetAmount() *token.BigInt { if x != nil { return x.Amount } - return "" + return nil } // List: @@ -549,11 +550,11 @@ type Approved struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` - Spender string `protobuf:"bytes,2,opt,name=spender,proto3" json:"spender,omitempty"` - Symbol string `protobuf:"bytes,3,opt,name=symbol,proto3" json:"symbol,omitempty"` - Group []string `protobuf:"bytes,4,rep,name=group,proto3" json:"group,omitempty"` - Amount string `protobuf:"bytes,5,opt,name=amount,proto3" json:"amount,omitempty"` + Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` + Spender string `protobuf:"bytes,2,opt,name=spender,proto3" json:"spender,omitempty"` + Symbol string `protobuf:"bytes,3,opt,name=symbol,proto3" json:"symbol,omitempty"` + Group []string `protobuf:"bytes,4,rep,name=group,proto3" json:"group,omitempty"` + Amount *token.BigInt `protobuf:"bytes,5,opt,name=amount,proto3" json:"amount,omitempty"` } func (x *Approved) Reset() { @@ -616,11 +617,11 @@ func (x *Approved) GetGroup() []string { return nil } -func (x *Approved) GetAmount() string { +func (x *Approved) GetAmount() *token.BigInt { if x != nil { return x.Amount } - return "" + return nil } // Event: TransferredFrom event is emitted when TransferFrom method has been invoked @@ -629,12 +630,12 @@ type TransferredFrom struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` - Spender string `protobuf:"bytes,2,opt,name=spender,proto3" json:"spender,omitempty"` - Recipient string `protobuf:"bytes,3,opt,name=recipient,proto3" json:"recipient,omitempty"` - Symbol string `protobuf:"bytes,4,opt,name=symbol,proto3" json:"symbol,omitempty"` - Group []string `protobuf:"bytes,5,rep,name=group,proto3" json:"group,omitempty"` - Amount string `protobuf:"bytes,6,opt,name=amount,proto3" json:"amount,omitempty"` + Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` + Spender string `protobuf:"bytes,2,opt,name=spender,proto3" json:"spender,omitempty"` + Recipient string `protobuf:"bytes,3,opt,name=recipient,proto3" json:"recipient,omitempty"` + Symbol string `protobuf:"bytes,4,opt,name=symbol,proto3" json:"symbol,omitempty"` + Group []string `protobuf:"bytes,5,rep,name=group,proto3" json:"group,omitempty"` + Amount *token.BigInt `protobuf:"bytes,6,opt,name=amount,proto3" json:"amount,omitempty"` } func (x *TransferredFrom) Reset() { @@ -704,11 +705,11 @@ func (x *TransferredFrom) GetGroup() []string { return nil } -func (x *TransferredFrom) GetAmount() string { +func (x *TransferredFrom) GetAmount() *token.BigInt { if x != nil { return x.Amount } - return "" + return nil } var File_erc20_utxo_service_allowance_allowance_proto protoreflect.FileDescriptor @@ -725,8 +726,46 @@ var file_erc20_utxo_service_allowance_allowance_proto_rawDesc = []byte{ 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2b, 0x6d, 0x77, 0x69, 0x74, 0x6b, 0x6f, 0x77, 0x2f, 0x67, 0x6f, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2d, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x2f, 0x76, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa6, 0x01, - 0x0a, 0x0e, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x13, 0x74, + 0x6f, 0x6b, 0x65, 0x6e, 0x2f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x22, 0xc6, 0x01, 0x0a, 0x0e, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe2, 0xdf, 0x1f, 0x02, 0x58, 0x01, 0x52, 0x05, 0x6f, 0x77, + 0x6e, 0x65, 0x72, 0x12, 0x20, 0x0a, 0x07, 0x73, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe2, 0xdf, 0x1f, 0x02, 0x58, 0x01, 0x52, 0x07, 0x73, 0x70, + 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x1e, 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe2, 0xdf, 0x1f, 0x02, 0x58, 0x01, 0x52, 0x06, 0x73, + 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x04, + 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x3e, 0x0a, 0x06, 0x61, + 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x63, + 0x6b, 0x69, 0x74, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, + 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x42, 0x69, 0x67, 0x49, 0x6e, 0x74, 0x42, 0x06, 0xe2, 0xdf, 0x1f, + 0x02, 0x58, 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xcf, 0x01, 0x0a, 0x13, + 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x46, 0x72, 0x6f, 0x6d, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x06, 0xe2, 0xdf, 0x1f, 0x02, 0x58, 0x01, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, + 0x72, 0x12, 0x24, 0x0a, 0x09, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe2, 0xdf, 0x1f, 0x02, 0x58, 0x01, 0x52, 0x09, 0x72, 0x65, + 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x1e, 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, + 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe2, 0xdf, 0x1f, 0x02, 0x58, 0x01, 0x52, + 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, + 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x3e, 0x0a, + 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, + 0x63, 0x63, 0x6b, 0x69, 0x74, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, + 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x42, 0x69, 0x67, 0x49, 0x6e, 0x74, 0x42, 0x06, 0xe2, + 0xdf, 0x1f, 0x02, 0x58, 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xb0, 0x01, + 0x0a, 0x14, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x46, 0x72, 0x6f, 0x6d, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x1c, 0x0a, 0x09, + 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x09, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x79, + 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, + 0x6f, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x04, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x36, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, + 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x63, 0x6b, 0x69, 0x74, + 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, + 0x6e, 0x2e, 0x42, 0x69, 0x67, 0x49, 0x6e, 0x74, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, + 0x22, 0x83, 0x01, 0x0a, 0x0b, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x61, 0x6e, 0x63, 0x65, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe2, 0xdf, 0x1f, 0x02, 0x58, 0x01, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x20, 0x0a, 0x07, 0x73, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, @@ -734,115 +773,93 @@ var file_erc20_utxo_service_allowance_allowance_proto_rawDesc = []byte{ 0x12, 0x1e, 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe2, 0xdf, 0x1f, 0x02, 0x58, 0x01, 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, - 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x1e, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe2, 0xdf, 0x1f, 0x02, 0x58, 0x01, 0x52, 0x06, - 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xaf, 0x01, 0x0a, 0x13, 0x54, 0x72, 0x61, 0x6e, 0x73, - 0x66, 0x65, 0x72, 0x46, 0x72, 0x6f, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, - 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe2, - 0xdf, 0x1f, 0x02, 0x58, 0x01, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x24, 0x0a, 0x09, - 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, - 0x06, 0xe2, 0xdf, 0x1f, 0x02, 0x58, 0x01, 0x52, 0x09, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, - 0x6e, 0x74, 0x12, 0x1e, 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x06, 0xe2, 0xdf, 0x1f, 0x02, 0x58, 0x01, 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, - 0x6f, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x04, 0x20, 0x03, 0x28, - 0x09, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x1e, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, - 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe2, 0xdf, 0x1f, 0x02, 0x58, 0x01, - 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x90, 0x01, 0x0a, 0x14, 0x54, 0x72, 0x61, - 0x6e, 0x73, 0x66, 0x65, 0x72, 0x46, 0x72, 0x6f, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x63, 0x69, 0x70, - 0x69, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x63, 0x69, - 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x14, 0x0a, - 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x67, 0x72, - 0x6f, 0x75, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x83, 0x01, 0x0a, 0x0b, - 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x61, 0x6e, 0x63, 0x65, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x05, 0x6f, - 0x77, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe2, 0xdf, 0x1f, 0x02, - 0x58, 0x01, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x20, 0x0a, 0x07, 0x73, 0x70, 0x65, - 0x6e, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe2, 0xdf, 0x1f, 0x02, - 0x58, 0x01, 0x52, 0x07, 0x73, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x1e, 0x0a, 0x06, 0x73, - 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe2, 0xdf, 0x1f, - 0x02, 0x58, 0x01, 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x67, - 0x72, 0x6f, 0x75, 0x70, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, - 0x70, 0x22, 0x81, 0x01, 0x0a, 0x09, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x61, 0x6e, 0x63, 0x65, 0x12, - 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x72, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, - 0x16, 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, - 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x16, 0x0a, - 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, - 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x81, 0x01, 0x0a, 0x09, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x70, 0x65, - 0x6e, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x70, 0x65, 0x6e, - 0x64, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x67, - 0x72, 0x6f, 0x75, 0x70, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, - 0x70, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x54, 0x0a, 0x0a, 0x41, 0x6c, 0x6c, - 0x6f, 0x77, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x46, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, - 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, - 0x73, 0x2e, 0x65, 0x72, 0x63, 0x32, 0x30, 0x5f, 0x75, 0x74, 0x78, 0x6f, 0x2e, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x2e, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x41, - 0x6c, 0x6c, 0x6f, 0x77, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x22, - 0x80, 0x01, 0x0a, 0x08, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x64, 0x12, 0x14, 0x0a, 0x05, - 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, - 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, - 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x79, - 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x04, 0x20, - 0x03, 0x28, 0x09, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, - 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, - 0x6e, 0x74, 0x22, 0xa5, 0x01, 0x0a, 0x0f, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x72, - 0x65, 0x64, 0x46, 0x72, 0x6f, 0x6d, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, - 0x73, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, - 0x70, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, - 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x63, 0x69, 0x70, - 0x69, 0x65, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x04, + 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x22, 0xa1, 0x01, 0x0a, 0x09, 0x41, 0x6c, 0x6c, 0x6f, 0x77, + 0x61, 0x6e, 0x63, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x70, + 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x70, 0x65, + 0x6e, 0x64, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x14, 0x0a, 0x05, - 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x67, 0x72, 0x6f, - 0x75, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x32, 0xfd, 0x03, 0x0a, 0x10, 0x41, - 0x6c, 0x6c, 0x6f, 0x77, 0x61, 0x6e, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, - 0xab, 0x01, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x61, 0x6e, 0x63, 0x65, - 0x12, 0x32, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2e, 0x65, 0x72, 0x63, 0x32, - 0x30, 0x5f, 0x75, 0x74, 0x78, 0x6f, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x61, - 0x6c, 0x6c, 0x6f, 0x77, 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x61, 0x6e, - 0x63, 0x65, 0x49, 0x64, 0x1a, 0x30, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2e, - 0x65, 0x72, 0x63, 0x32, 0x30, 0x5f, 0x75, 0x74, 0x78, 0x6f, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x2e, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x41, 0x6c, 0x6c, - 0x6f, 0x77, 0x61, 0x6e, 0x63, 0x65, 0x22, 0x35, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2f, 0x12, 0x2d, - 0x2f, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x61, 0x6e, 0x63, 0x65, 0x2f, 0x7b, 0x6f, 0x77, 0x6e, 0x65, - 0x72, 0x7d, 0x2f, 0x7b, 0x73, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x7d, 0x2f, 0x7b, 0x73, 0x79, - 0x6d, 0x62, 0x6f, 0x6c, 0x7d, 0x2f, 0x7b, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x7d, 0x12, 0x8e, 0x01, - 0x0a, 0x07, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x12, 0x35, 0x2e, 0x65, 0x78, 0x61, 0x6d, + 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x67, 0x72, 0x6f, + 0x75, 0x70, 0x12, 0x36, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x63, 0x6b, 0x69, 0x74, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, + 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x42, 0x69, 0x67, 0x49, + 0x6e, 0x74, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xa1, 0x01, 0x0a, 0x09, 0x4f, + 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, + 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x18, + 0x0a, 0x07, 0x73, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x73, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, + 0x6f, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, + 0x12, 0x14, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, + 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x36, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x63, 0x6b, 0x69, 0x74, 0x2e, 0x65, + 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, + 0x42, 0x69, 0x67, 0x49, 0x6e, 0x74, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x54, + 0x0a, 0x0a, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x46, 0x0a, 0x05, + 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x65, 0x78, + 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2e, 0x65, 0x72, 0x63, 0x32, 0x30, 0x5f, 0x75, 0x74, 0x78, + 0x6f, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x61, + 0x6e, 0x63, 0x65, 0x2e, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x05, 0x69, + 0x74, 0x65, 0x6d, 0x73, 0x22, 0xa0, 0x01, 0x0a, 0x08, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, + 0x64, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x70, 0x65, 0x6e, 0x64, + 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x70, 0x65, 0x6e, 0x64, 0x65, + 0x72, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x72, 0x6f, + 0x75, 0x70, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, + 0x36, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1e, 0x2e, 0x63, 0x63, 0x6b, 0x69, 0x74, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, + 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x42, 0x69, 0x67, 0x49, 0x6e, 0x74, 0x52, + 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xc5, 0x01, 0x0a, 0x0f, 0x54, 0x72, 0x61, 0x6e, + 0x73, 0x66, 0x65, 0x72, 0x72, 0x65, 0x64, 0x46, 0x72, 0x6f, 0x6d, 0x12, 0x14, 0x0a, 0x05, 0x6f, + 0x77, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, + 0x72, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x73, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x1c, 0x0a, 0x09, 0x72, + 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, + 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x79, 0x6d, + 0x62, 0x6f, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, + 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, + 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x36, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, + 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x63, 0x6b, 0x69, 0x74, 0x2e, + 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, + 0x2e, 0x42, 0x69, 0x67, 0x49, 0x6e, 0x74, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x32, + 0xfd, 0x03, 0x0a, 0x10, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x61, 0x6e, 0x63, 0x65, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x12, 0xab, 0x01, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x6f, + 0x77, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x32, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, + 0x2e, 0x65, 0x72, 0x63, 0x32, 0x30, 0x5f, 0x75, 0x74, 0x78, 0x6f, 0x2e, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x2e, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x41, 0x6c, + 0x6c, 0x6f, 0x77, 0x61, 0x6e, 0x63, 0x65, 0x49, 0x64, 0x1a, 0x30, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2e, 0x65, 0x72, 0x63, 0x32, 0x30, 0x5f, 0x75, 0x74, 0x78, 0x6f, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x61, 0x6e, 0x63, - 0x65, 0x2e, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x30, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2e, 0x65, 0x72, 0x63, 0x32, + 0x65, 0x2e, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x61, 0x6e, 0x63, 0x65, 0x22, 0x35, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x2f, 0x12, 0x2d, 0x2f, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x61, 0x6e, 0x63, 0x65, 0x2f, + 0x7b, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x7d, 0x2f, 0x7b, 0x73, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x72, + 0x7d, 0x2f, 0x7b, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x7d, 0x2f, 0x7b, 0x67, 0x72, 0x6f, 0x75, + 0x70, 0x7d, 0x12, 0x8e, 0x01, 0x0a, 0x07, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x12, 0x35, + 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2e, 0x65, 0x72, 0x63, 0x32, 0x30, 0x5f, + 0x75, 0x74, 0x78, 0x6f, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x61, 0x6c, 0x6c, + 0x6f, 0x77, 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, + 0x2e, 0x65, 0x72, 0x63, 0x32, 0x30, 0x5f, 0x75, 0x74, 0x78, 0x6f, 0x2e, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x2e, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x41, 0x6c, + 0x6c, 0x6f, 0x77, 0x61, 0x6e, 0x63, 0x65, 0x22, 0x1a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x14, 0x22, + 0x12, 0x2f, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x61, 0x6e, 0x63, 0x65, 0x2f, 0x61, 0x70, 0x70, 0x72, + 0x6f, 0x76, 0x65, 0x12, 0xa9, 0x01, 0x0a, 0x0c, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, + 0x46, 0x72, 0x6f, 0x6d, 0x12, 0x3a, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2e, + 0x65, 0x72, 0x63, 0x32, 0x30, 0x5f, 0x75, 0x74, 0x78, 0x6f, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x2e, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x54, 0x72, 0x61, + 0x6e, 0x73, 0x66, 0x65, 0x72, 0x46, 0x72, 0x6f, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x3b, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2e, 0x65, 0x72, 0x63, 0x32, 0x30, 0x5f, 0x75, 0x74, 0x78, 0x6f, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x61, - 0x6c, 0x6c, 0x6f, 0x77, 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x61, 0x6e, - 0x63, 0x65, 0x22, 0x1a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x14, 0x22, 0x12, 0x2f, 0x61, 0x6c, 0x6c, - 0x6f, 0x77, 0x61, 0x6e, 0x63, 0x65, 0x2f, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x12, 0xa9, - 0x01, 0x0a, 0x0c, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x46, 0x72, 0x6f, 0x6d, 0x12, - 0x3a, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2e, 0x65, 0x72, 0x63, 0x32, 0x30, - 0x5f, 0x75, 0x74, 0x78, 0x6f, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x61, 0x6c, - 0x6c, 0x6f, 0x77, 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, - 0x46, 0x72, 0x6f, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3b, 0x2e, 0x65, 0x78, - 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2e, 0x65, 0x72, 0x63, 0x32, 0x30, 0x5f, 0x75, 0x74, 0x78, - 0x6f, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x61, - 0x6e, 0x63, 0x65, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x46, 0x72, 0x6f, 0x6d, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x20, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1a, - 0x22, 0x18, 0x2f, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x61, 0x6e, 0x63, 0x65, 0x2f, 0x74, 0x72, 0x61, - 0x6e, 0x73, 0x66, 0x65, 0x72, 0x2d, 0x66, 0x72, 0x6f, 0x6d, 0x42, 0x49, 0x5a, 0x47, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x65, - 0x64, 0x67, 0x65, 0x72, 0x2d, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x63, 0x63, 0x6b, 0x69, 0x74, 0x2f, - 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2f, 0x65, 0x72, 0x63, 0x32, 0x30, 0x5f, 0x75, - 0x74, 0x78, 0x6f, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x61, 0x6c, 0x6c, 0x6f, - 0x77, 0x61, 0x6e, 0x63, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6c, 0x6c, 0x6f, 0x77, 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, + 0x72, 0x46, 0x72, 0x6f, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x20, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x22, 0x18, 0x2f, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x61, 0x6e, 0x63, + 0x65, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x2d, 0x66, 0x72, 0x6f, 0x6d, 0x42, + 0x49, 0x5a, 0x47, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x79, + 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2d, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x63, + 0x63, 0x6b, 0x69, 0x74, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2f, 0x65, 0x72, + 0x63, 0x32, 0x30, 0x5f, 0x75, 0x74, 0x78, 0x6f, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2f, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x61, 0x6e, 0x63, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( @@ -868,20 +885,28 @@ var file_erc20_utxo_service_allowance_allowance_proto_goTypes = []interface{}{ (*Allowances)(nil), // 6: examples.erc20_utxo.service.allowance.Allowances (*Approved)(nil), // 7: examples.erc20_utxo.service.allowance.Approved (*TransferredFrom)(nil), // 8: examples.erc20_utxo.service.allowance.TransferredFrom + (*token.BigInt)(nil), // 9: cckit.extensions.token.BigInt } var file_erc20_utxo_service_allowance_allowance_proto_depIdxs = []int32{ - 4, // 0: examples.erc20_utxo.service.allowance.Allowances.items:type_name -> examples.erc20_utxo.service.allowance.Allowance - 3, // 1: examples.erc20_utxo.service.allowance.AllowanceService.GetAllowance:input_type -> examples.erc20_utxo.service.allowance.AllowanceId - 0, // 2: examples.erc20_utxo.service.allowance.AllowanceService.Approve:input_type -> examples.erc20_utxo.service.allowance.ApproveRequest - 1, // 3: examples.erc20_utxo.service.allowance.AllowanceService.TransferFrom:input_type -> examples.erc20_utxo.service.allowance.TransferFromRequest - 4, // 4: examples.erc20_utxo.service.allowance.AllowanceService.GetAllowance:output_type -> examples.erc20_utxo.service.allowance.Allowance - 4, // 5: examples.erc20_utxo.service.allowance.AllowanceService.Approve:output_type -> examples.erc20_utxo.service.allowance.Allowance - 2, // 6: examples.erc20_utxo.service.allowance.AllowanceService.TransferFrom:output_type -> examples.erc20_utxo.service.allowance.TransferFromResponse - 4, // [4:7] is the sub-list for method output_type - 1, // [1:4] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name + 9, // 0: examples.erc20_utxo.service.allowance.ApproveRequest.amount:type_name -> cckit.extensions.token.BigInt + 9, // 1: examples.erc20_utxo.service.allowance.TransferFromRequest.amount:type_name -> cckit.extensions.token.BigInt + 9, // 2: examples.erc20_utxo.service.allowance.TransferFromResponse.amount:type_name -> cckit.extensions.token.BigInt + 9, // 3: examples.erc20_utxo.service.allowance.Allowance.amount:type_name -> cckit.extensions.token.BigInt + 9, // 4: examples.erc20_utxo.service.allowance.Operation.amount:type_name -> cckit.extensions.token.BigInt + 4, // 5: examples.erc20_utxo.service.allowance.Allowances.items:type_name -> examples.erc20_utxo.service.allowance.Allowance + 9, // 6: examples.erc20_utxo.service.allowance.Approved.amount:type_name -> cckit.extensions.token.BigInt + 9, // 7: examples.erc20_utxo.service.allowance.TransferredFrom.amount:type_name -> cckit.extensions.token.BigInt + 3, // 8: examples.erc20_utxo.service.allowance.AllowanceService.GetAllowance:input_type -> examples.erc20_utxo.service.allowance.AllowanceId + 0, // 9: examples.erc20_utxo.service.allowance.AllowanceService.Approve:input_type -> examples.erc20_utxo.service.allowance.ApproveRequest + 1, // 10: examples.erc20_utxo.service.allowance.AllowanceService.TransferFrom:input_type -> examples.erc20_utxo.service.allowance.TransferFromRequest + 4, // 11: examples.erc20_utxo.service.allowance.AllowanceService.GetAllowance:output_type -> examples.erc20_utxo.service.allowance.Allowance + 4, // 12: examples.erc20_utxo.service.allowance.AllowanceService.Approve:output_type -> examples.erc20_utxo.service.allowance.Allowance + 2, // 13: examples.erc20_utxo.service.allowance.AllowanceService.TransferFrom:output_type -> examples.erc20_utxo.service.allowance.TransferFromResponse + 11, // [11:14] is the sub-list for method output_type + 8, // [8:11] is the sub-list for method input_type + 8, // [8:8] is the sub-list for extension type_name + 8, // [8:8] is the sub-list for extension extendee + 0, // [0:8] is the sub-list for field type_name } func init() { file_erc20_utxo_service_allowance_allowance_proto_init() } diff --git a/examples/erc20_utxo/service/allowance/allowance.proto b/examples/erc20_utxo/service/allowance/allowance.proto index 3667333..3039b2f 100644 --- a/examples/erc20_utxo/service/allowance/allowance.proto +++ b/examples/erc20_utxo/service/allowance/allowance.proto @@ -7,6 +7,8 @@ import "google/api/annotations.proto"; import "google/protobuf/empty.proto"; import "mwitkow/go-proto-validators/validator.proto"; +import "token/balance.proto"; + service AllowanceService { // Returns the remaining number of tokens that spender will be allowed to spend on behalf of owner through transfersender. // This is zero by default. @@ -38,7 +40,7 @@ message ApproveRequest { string spender = 2 [(validator.field) = {string_not_empty : true}]; string symbol = 3 [(validator.field) = {string_not_empty : true}]; repeated string group = 4; - string amount = 5 [(validator.field) = {string_not_empty : true}]; + cckit.extensions.token.BigInt amount = 5 [(validator.field) = {string_not_empty : true}]; } message TransferFromRequest { @@ -46,7 +48,7 @@ message TransferFromRequest { string recipient = 2 [(validator.field) = {string_not_empty : true}]; string symbol = 3 [(validator.field) = {string_not_empty : true}]; repeated string group = 4; - string amount = 5 [(validator.field) = {string_not_empty : true}]; + cckit.extensions.token.BigInt amount = 5 [(validator.field) = {string_not_empty : true}]; } message TransferFromResponse { @@ -54,7 +56,7 @@ message TransferFromResponse { string recipient = 2; string symbol = 3 ; repeated string group = 4; - string amount = 5; + cckit.extensions.token.BigInt amount = 5; } // Id: Allowance identifier @@ -71,7 +73,7 @@ message Allowance { string spender = 2; string symbol = 3 ; repeated string group = 4; - string amount = 5; + cckit.extensions.token.BigInt amount = 5; } message Operation { @@ -79,7 +81,7 @@ message Operation { string spender = 2; string symbol = 3 ; repeated string group = 4; - string amount = 5; + cckit.extensions.token.BigInt amount = 5; } // List: @@ -93,7 +95,7 @@ message Approved { string spender = 2; string symbol = 3 ; repeated string group = 4; - string amount = 5; + cckit.extensions.token.BigInt amount = 5; } // Event: TransferredFrom event is emitted when TransferFrom method has been invoked @@ -103,5 +105,5 @@ message TransferredFrom { string recipient = 3; string symbol = 4 ; repeated string group = 5; - string amount = 6; + cckit.extensions.token.BigInt amount = 6; } \ No newline at end of file diff --git a/examples/erc20_utxo/service/allowance/allowance.swagger.json b/examples/erc20_utxo/service/allowance/allowance.swagger.json index ef6bc82..8937f55 100644 --- a/examples/erc20_utxo/service/allowance/allowance.swagger.json +++ b/examples/erc20_utxo/service/allowance/allowance.swagger.json @@ -132,7 +132,7 @@ } }, "amount": { - "type": "string" + "$ref": "#/definitions/tokenBigInt" } }, "title": "State: Allowance" @@ -156,7 +156,7 @@ } }, "amount": { - "type": "string" + "$ref": "#/definitions/tokenBigInt" } } }, @@ -192,6 +192,14 @@ } } } + }, + "tokenBigInt": { + "type": "object", + "properties": { + "data": { + "type": "string" + } + } } } } diff --git a/examples/erc20_utxo/service/allowance/allowance.validator.pb.go b/examples/erc20_utxo/service/allowance/allowance.validator.pb.go index 258794c..ebb5e16 100644 --- a/examples/erc20_utxo/service/allowance/allowance.validator.pb.go +++ b/examples/erc20_utxo/service/allowance/allowance.validator.pb.go @@ -6,6 +6,7 @@ package allowance import ( fmt "fmt" proto "github.com/golang/protobuf/proto" + _ "github.com/hyperledger-labs/cckit/extensions/token" _ "github.com/mwitkow/go-proto-validators" github_com_mwitkow_go_proto_validators "github.com/mwitkow/go-proto-validators" _ "google.golang.org/genproto/googleapis/api/annotations" @@ -28,8 +29,10 @@ func (this *ApproveRequest) Validate() error { if this.Symbol == "" { return github_com_mwitkow_go_proto_validators.FieldError("Symbol", fmt.Errorf(`value '%v' must not be an empty string`, this.Symbol)) } - if this.Amount == "" { - return github_com_mwitkow_go_proto_validators.FieldError("Amount", fmt.Errorf(`value '%v' must not be an empty string`, this.Amount)) + if this.Amount != nil { + if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Amount); err != nil { + return github_com_mwitkow_go_proto_validators.FieldError("Amount", err) + } } return nil } @@ -43,12 +46,19 @@ func (this *TransferFromRequest) Validate() error { if this.Symbol == "" { return github_com_mwitkow_go_proto_validators.FieldError("Symbol", fmt.Errorf(`value '%v' must not be an empty string`, this.Symbol)) } - if this.Amount == "" { - return github_com_mwitkow_go_proto_validators.FieldError("Amount", fmt.Errorf(`value '%v' must not be an empty string`, this.Amount)) + if this.Amount != nil { + if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Amount); err != nil { + return github_com_mwitkow_go_proto_validators.FieldError("Amount", err) + } } return nil } func (this *TransferFromResponse) Validate() error { + if this.Amount != nil { + if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Amount); err != nil { + return github_com_mwitkow_go_proto_validators.FieldError("Amount", err) + } + } return nil } func (this *AllowanceId) Validate() error { @@ -64,9 +74,19 @@ func (this *AllowanceId) Validate() error { return nil } func (this *Allowance) Validate() error { + if this.Amount != nil { + if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Amount); err != nil { + return github_com_mwitkow_go_proto_validators.FieldError("Amount", err) + } + } return nil } func (this *Operation) Validate() error { + if this.Amount != nil { + if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Amount); err != nil { + return github_com_mwitkow_go_proto_validators.FieldError("Amount", err) + } + } return nil } func (this *Allowances) Validate() error { @@ -80,8 +100,18 @@ func (this *Allowances) Validate() error { return nil } func (this *Approved) Validate() error { + if this.Amount != nil { + if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Amount); err != nil { + return github_com_mwitkow_go_proto_validators.FieldError("Amount", err) + } + } return nil } func (this *TransferredFrom) Validate() error { + if this.Amount != nil { + if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Amount); err != nil { + return github_com_mwitkow_go_proto_validators.FieldError("Amount", err) + } + } return nil } diff --git a/examples/erc20_utxo/service/config/config.pb.go b/examples/erc20_utxo/service/config/config.pb.go index 55bda66..0271bf1 100644 --- a/examples/erc20_utxo/service/config/config.pb.go +++ b/examples/erc20_utxo/service/config/config.pb.go @@ -8,6 +8,7 @@ package config import ( context "context" + token "github.com/hyperledger-labs/cckit/extensions/token" _ "google.golang.org/genproto/googleapis/api/annotations" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" @@ -172,7 +173,7 @@ type TotalSupplyResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - TotalSupply string `protobuf:"bytes,1,opt,name=total_supply,json=totalSupply,proto3" json:"total_supply,omitempty"` + TotalSupply *token.BigInt `protobuf:"bytes,1,opt,name=total_supply,json=totalSupply,proto3" json:"total_supply,omitempty"` } func (x *TotalSupplyResponse) Reset() { @@ -207,11 +208,11 @@ func (*TotalSupplyResponse) Descriptor() ([]byte, []int) { return file_erc20_utxo_service_config_config_proto_rawDescGZIP(), []int{3} } -func (x *TotalSupplyResponse) GetTotalSupply() string { +func (x *TotalSupplyResponse) GetTotalSupply() *token.BigInt { if x != nil { return x.TotalSupply } - return "" + return nil } var File_erc20_utxo_service_config_config_proto protoreflect.FileDescriptor @@ -225,54 +226,57 @@ var file_erc20_utxo_service_config_config_proto_rawDesc = []byte{ 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, - 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x22, 0x0a, 0x0c, 0x4e, 0x61, 0x6d, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x28, 0x0a, 0x0e, 0x53, - 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, - 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, - 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x22, 0x2e, 0x0a, 0x10, 0x44, 0x65, 0x63, 0x69, 0x6d, 0x61, 0x6c, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x65, 0x63, - 0x69, 0x6d, 0x61, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x64, 0x65, 0x63, - 0x69, 0x6d, 0x61, 0x6c, 0x73, 0x22, 0x38, 0x0a, 0x13, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x75, - 0x70, 0x70, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x21, 0x0a, 0x0c, - 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0b, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x32, - 0xdf, 0x03, 0x0a, 0x0d, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x12, 0x68, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, - 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x30, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2e, - 0x65, 0x72, 0x63, 0x32, 0x30, 0x5f, 0x75, 0x74, 0x78, 0x6f, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x13, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0d, 0x12, 0x0b, - 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2f, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x6e, 0x0a, 0x09, 0x47, - 0x65, 0x74, 0x53, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x13, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2f, 0x62, + 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x22, 0x0a, 0x0c, + 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x22, 0x28, 0x0a, 0x0e, 0x53, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x22, 0x2e, 0x0a, 0x10, 0x44, 0x65, + 0x63, 0x69, 0x6d, 0x61, 0x6c, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1a, + 0x0a, 0x08, 0x64, 0x65, 0x63, 0x69, 0x6d, 0x61, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x08, 0x64, 0x65, 0x63, 0x69, 0x6d, 0x61, 0x6c, 0x73, 0x22, 0x58, 0x0a, 0x13, 0x54, 0x6f, + 0x74, 0x61, 0x6c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x41, 0x0a, 0x0c, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x75, 0x70, 0x70, 0x6c, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x63, 0x6b, 0x69, 0x74, 0x2e, + 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, + 0x2e, 0x42, 0x69, 0x67, 0x49, 0x6e, 0x74, 0x52, 0x0b, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x75, + 0x70, 0x70, 0x6c, 0x79, 0x32, 0xdf, 0x03, 0x0a, 0x0d, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x68, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x4e, 0x61, 0x6d, + 0x65, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x30, 0x2e, 0x65, 0x78, 0x61, 0x6d, + 0x70, 0x6c, 0x65, 0x73, 0x2e, 0x65, 0x72, 0x63, 0x32, 0x30, 0x5f, 0x75, 0x74, 0x78, 0x6f, 0x2e, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x4e, + 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x13, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x0d, 0x12, 0x0b, 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2f, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x6e, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x53, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x16, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x32, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, + 0x2e, 0x65, 0x72, 0x63, 0x32, 0x30, 0x5f, 0x75, 0x74, 0x78, 0x6f, 0x2e, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x53, 0x79, 0x6d, 0x62, 0x6f, + 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x15, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x0f, 0x12, 0x0d, 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2f, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, + 0x12, 0x74, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x44, 0x65, 0x63, 0x69, 0x6d, 0x61, 0x6c, 0x73, 0x12, + 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x34, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, + 0x65, 0x73, 0x2e, 0x65, 0x72, 0x63, 0x32, 0x30, 0x5f, 0x75, 0x74, 0x78, 0x6f, 0x2e, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x44, 0x65, 0x63, + 0x69, 0x6d, 0x61, 0x6c, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x17, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x11, 0x12, 0x0f, 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2f, 0x64, 0x65, + 0x63, 0x69, 0x6d, 0x61, 0x6c, 0x73, 0x12, 0x7e, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x54, 0x6f, 0x74, + 0x61, 0x6c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, - 0x1a, 0x32, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2e, 0x65, 0x72, 0x63, 0x32, + 0x1a, 0x37, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2e, 0x65, 0x72, 0x63, 0x32, 0x30, 0x5f, 0x75, 0x74, 0x78, 0x6f, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x63, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x53, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x15, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0f, 0x12, 0x0d, 0x2f, 0x74, - 0x6f, 0x6b, 0x65, 0x6e, 0x2f, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x74, 0x0a, 0x0b, 0x47, - 0x65, 0x74, 0x44, 0x65, 0x63, 0x69, 0x6d, 0x61, 0x6c, 0x73, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, - 0x74, 0x79, 0x1a, 0x34, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2e, 0x65, 0x72, - 0x63, 0x32, 0x30, 0x5f, 0x75, 0x74, 0x78, 0x6f, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x44, 0x65, 0x63, 0x69, 0x6d, 0x61, 0x6c, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x17, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x11, - 0x12, 0x0f, 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2f, 0x64, 0x65, 0x63, 0x69, 0x6d, 0x61, 0x6c, - 0x73, 0x12, 0x7e, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x75, 0x70, - 0x70, 0x6c, 0x79, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x37, 0x2e, 0x65, 0x78, - 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2e, 0x65, 0x72, 0x63, 0x32, 0x30, 0x5f, 0x75, 0x74, 0x78, - 0x6f, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x2e, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x12, 0x13, 0x2f, 0x74, - 0x6f, 0x6b, 0x65, 0x6e, 0x2f, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x2d, 0x73, 0x75, 0x70, 0x70, 0x6c, - 0x79, 0x42, 0x46, 0x5a, 0x44, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2d, 0x6c, 0x61, 0x62, 0x73, - 0x2f, 0x63, 0x63, 0x6b, 0x69, 0x74, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2f, - 0x65, 0x72, 0x63, 0x32, 0x30, 0x5f, 0x75, 0x74, 0x78, 0x6f, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x75, 0x70, 0x70, 0x6c, + 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x15, 0x12, 0x13, 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2f, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x2d, + 0x73, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x42, 0x46, 0x5a, 0x44, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, + 0x2d, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x63, 0x63, 0x6b, 0x69, 0x74, 0x2f, 0x65, 0x78, 0x61, 0x6d, + 0x70, 0x6c, 0x65, 0x73, 0x2f, 0x65, 0x72, 0x63, 0x32, 0x30, 0x5f, 0x75, 0x74, 0x78, 0x6f, 0x2f, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -293,22 +297,24 @@ var file_erc20_utxo_service_config_config_proto_goTypes = []interface{}{ (*SymbolResponse)(nil), // 1: examples.erc20_utxo.service.config.SymbolResponse (*DecimalsResponse)(nil), // 2: examples.erc20_utxo.service.config.DecimalsResponse (*TotalSupplyResponse)(nil), // 3: examples.erc20_utxo.service.config.TotalSupplyResponse - (*emptypb.Empty)(nil), // 4: google.protobuf.Empty + (*token.BigInt)(nil), // 4: cckit.extensions.token.BigInt + (*emptypb.Empty)(nil), // 5: google.protobuf.Empty } var file_erc20_utxo_service_config_config_proto_depIdxs = []int32{ - 4, // 0: examples.erc20_utxo.service.config.ConfigService.GetName:input_type -> google.protobuf.Empty - 4, // 1: examples.erc20_utxo.service.config.ConfigService.GetSymbol:input_type -> google.protobuf.Empty - 4, // 2: examples.erc20_utxo.service.config.ConfigService.GetDecimals:input_type -> google.protobuf.Empty - 4, // 3: examples.erc20_utxo.service.config.ConfigService.GetTotalSupply:input_type -> google.protobuf.Empty - 0, // 4: examples.erc20_utxo.service.config.ConfigService.GetName:output_type -> examples.erc20_utxo.service.config.NameResponse - 1, // 5: examples.erc20_utxo.service.config.ConfigService.GetSymbol:output_type -> examples.erc20_utxo.service.config.SymbolResponse - 2, // 6: examples.erc20_utxo.service.config.ConfigService.GetDecimals:output_type -> examples.erc20_utxo.service.config.DecimalsResponse - 3, // 7: examples.erc20_utxo.service.config.ConfigService.GetTotalSupply:output_type -> examples.erc20_utxo.service.config.TotalSupplyResponse - 4, // [4:8] is the sub-list for method output_type - 0, // [0:4] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name + 4, // 0: examples.erc20_utxo.service.config.TotalSupplyResponse.total_supply:type_name -> cckit.extensions.token.BigInt + 5, // 1: examples.erc20_utxo.service.config.ConfigService.GetName:input_type -> google.protobuf.Empty + 5, // 2: examples.erc20_utxo.service.config.ConfigService.GetSymbol:input_type -> google.protobuf.Empty + 5, // 3: examples.erc20_utxo.service.config.ConfigService.GetDecimals:input_type -> google.protobuf.Empty + 5, // 4: examples.erc20_utxo.service.config.ConfigService.GetTotalSupply:input_type -> google.protobuf.Empty + 0, // 5: examples.erc20_utxo.service.config.ConfigService.GetName:output_type -> examples.erc20_utxo.service.config.NameResponse + 1, // 6: examples.erc20_utxo.service.config.ConfigService.GetSymbol:output_type -> examples.erc20_utxo.service.config.SymbolResponse + 2, // 7: examples.erc20_utxo.service.config.ConfigService.GetDecimals:output_type -> examples.erc20_utxo.service.config.DecimalsResponse + 3, // 8: examples.erc20_utxo.service.config.ConfigService.GetTotalSupply:output_type -> examples.erc20_utxo.service.config.TotalSupplyResponse + 5, // [5:9] is the sub-list for method output_type + 1, // [1:5] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name } func init() { file_erc20_utxo_service_config_config_proto_init() } diff --git a/examples/erc20_utxo/service/config/config.proto b/examples/erc20_utxo/service/config/config.proto index 4bb7bf1..212eaf4 100644 --- a/examples/erc20_utxo/service/config/config.proto +++ b/examples/erc20_utxo/service/config/config.proto @@ -6,6 +6,8 @@ package examples.erc20_utxo.service.config; import "google/api/annotations.proto"; import "google/protobuf/empty.proto"; +import "token/balance.proto"; + // ERC-20 Config getters service ConfigService { @@ -52,5 +54,5 @@ message DecimalsResponse { } message TotalSupplyResponse { - string total_supply = 1; + cckit.extensions.token.BigInt total_supply = 1; } \ No newline at end of file diff --git a/examples/erc20_utxo/service/config/config.swagger.json b/examples/erc20_utxo/service/config/config.swagger.json index ea832de..1fbb151 100644 --- a/examples/erc20_utxo/service/config/config.swagger.json +++ b/examples/erc20_utxo/service/config/config.swagger.json @@ -134,7 +134,7 @@ "type": "object", "properties": { "total_supply": { - "type": "string" + "$ref": "#/definitions/tokenBigInt" } } }, @@ -170,6 +170,14 @@ } } } + }, + "tokenBigInt": { + "type": "object", + "properties": { + "data": { + "type": "string" + } + } } } } diff --git a/examples/erc20_utxo/service/config/config.validator.pb.go b/examples/erc20_utxo/service/config/config.validator.pb.go index 9c118bd..eca8c39 100644 --- a/examples/erc20_utxo/service/config/config.validator.pb.go +++ b/examples/erc20_utxo/service/config/config.validator.pb.go @@ -6,6 +6,8 @@ package config import ( fmt "fmt" proto "github.com/golang/protobuf/proto" + _ "github.com/hyperledger-labs/cckit/extensions/token" + github_com_mwitkow_go_proto_validators "github.com/mwitkow/go-proto-validators" _ "google.golang.org/genproto/googleapis/api/annotations" _ "google.golang.org/protobuf/types/known/emptypb" math "math" @@ -26,5 +28,10 @@ func (this *DecimalsResponse) Validate() error { return nil } func (this *TotalSupplyResponse) Validate() error { + if this.TotalSupply != nil { + if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.TotalSupply); err != nil { + return github_com_mwitkow_go_proto_validators.FieldError("TotalSupply", err) + } + } return nil } diff --git a/extensions/token/balance.pb.go b/extensions/token/balance.pb.go index 4c2a416..ac215d2 100644 --- a/extensions/token/balance.pb.go +++ b/extensions/token/balance.pb.go @@ -82,6 +82,53 @@ func (OperationType) EnumDescriptor() ([]byte, []int) { return file_token_balance_proto_rawDescGZIP(), []int{0} } +type BigInt struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Data string `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` +} + +func (x *BigInt) Reset() { + *x = BigInt{} + if protoimpl.UnsafeEnabled { + mi := &file_token_balance_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BigInt) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BigInt) ProtoMessage() {} + +func (x *BigInt) ProtoReflect() protoreflect.Message { + mi := &file_token_balance_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BigInt.ProtoReflect.Descriptor instead. +func (*BigInt) Descriptor() ([]byte, []int) { + return file_token_balance_proto_rawDescGZIP(), []int{0} +} + +func (x *BigInt) GetData() string { + if x != nil { + return x.Data + } + return "" +} + type TransferRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -90,14 +137,14 @@ type TransferRequest struct { Recipient string `protobuf:"bytes,1,opt,name=recipient,proto3" json:"recipient,omitempty"` Symbol string `protobuf:"bytes,2,opt,name=symbol,proto3" json:"symbol,omitempty"` Group []string `protobuf:"bytes,3,rep,name=group,proto3" json:"group,omitempty"` - Amount string `protobuf:"bytes,4,opt,name=amount,proto3" json:"amount,omitempty"` + Amount *BigInt `protobuf:"bytes,4,opt,name=amount,proto3" json:"amount,omitempty"` Meta []*AddMetaRequest `protobuf:"bytes,5,rep,name=meta,proto3" json:"meta,omitempty"` } func (x *TransferRequest) Reset() { *x = TransferRequest{} if protoimpl.UnsafeEnabled { - mi := &file_token_balance_proto_msgTypes[0] + mi := &file_token_balance_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -110,7 +157,7 @@ func (x *TransferRequest) String() string { func (*TransferRequest) ProtoMessage() {} func (x *TransferRequest) ProtoReflect() protoreflect.Message { - mi := &file_token_balance_proto_msgTypes[0] + mi := &file_token_balance_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -123,7 +170,7 @@ func (x *TransferRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use TransferRequest.ProtoReflect.Descriptor instead. func (*TransferRequest) Descriptor() ([]byte, []int) { - return file_token_balance_proto_rawDescGZIP(), []int{0} + return file_token_balance_proto_rawDescGZIP(), []int{1} } func (x *TransferRequest) GetRecipient() string { @@ -147,11 +194,11 @@ func (x *TransferRequest) GetGroup() []string { return nil } -func (x *TransferRequest) GetAmount() string { +func (x *TransferRequest) GetAmount() *BigInt { if x != nil { return x.Amount } - return "" + return nil } func (x *TransferRequest) GetMeta() []*AddMetaRequest { @@ -170,14 +217,14 @@ type TransferResponse struct { Recipient string `protobuf:"bytes,2,opt,name=recipient,proto3" json:"recipient,omitempty"` Symbol string `protobuf:"bytes,3,opt,name=symbol,proto3" json:"symbol,omitempty"` Group []string `protobuf:"bytes,4,rep,name=group,proto3" json:"group,omitempty"` - Amount string `protobuf:"bytes,5,opt,name=amount,proto3" json:"amount,omitempty"` + Amount *BigInt `protobuf:"bytes,5,opt,name=amount,proto3" json:"amount,omitempty"` Meta []*Meta `protobuf:"bytes,6,rep,name=meta,proto3" json:"meta,omitempty"` } func (x *TransferResponse) Reset() { *x = TransferResponse{} if protoimpl.UnsafeEnabled { - mi := &file_token_balance_proto_msgTypes[1] + mi := &file_token_balance_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -190,7 +237,7 @@ func (x *TransferResponse) String() string { func (*TransferResponse) ProtoMessage() {} func (x *TransferResponse) ProtoReflect() protoreflect.Message { - mi := &file_token_balance_proto_msgTypes[1] + mi := &file_token_balance_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -203,7 +250,7 @@ func (x *TransferResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use TransferResponse.ProtoReflect.Descriptor instead. func (*TransferResponse) Descriptor() ([]byte, []int) { - return file_token_balance_proto_rawDescGZIP(), []int{1} + return file_token_balance_proto_rawDescGZIP(), []int{2} } func (x *TransferResponse) GetSender() string { @@ -234,11 +281,11 @@ func (x *TransferResponse) GetGroup() []string { return nil } -func (x *TransferResponse) GetAmount() string { +func (x *TransferResponse) GetAmount() *BigInt { if x != nil { return x.Amount } - return "" + return nil } func (x *TransferResponse) GetMeta() []*Meta { @@ -259,7 +306,7 @@ type TransferBatchRequest struct { func (x *TransferBatchRequest) Reset() { *x = TransferBatchRequest{} if protoimpl.UnsafeEnabled { - mi := &file_token_balance_proto_msgTypes[2] + mi := &file_token_balance_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -272,7 +319,7 @@ func (x *TransferBatchRequest) String() string { func (*TransferBatchRequest) ProtoMessage() {} func (x *TransferBatchRequest) ProtoReflect() protoreflect.Message { - mi := &file_token_balance_proto_msgTypes[2] + mi := &file_token_balance_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -285,7 +332,7 @@ func (x *TransferBatchRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use TransferBatchRequest.ProtoReflect.Descriptor instead. func (*TransferBatchRequest) Descriptor() ([]byte, []int) { - return file_token_balance_proto_rawDescGZIP(), []int{2} + return file_token_balance_proto_rawDescGZIP(), []int{3} } func (x *TransferBatchRequest) GetTransfers() []*TransferRequest { @@ -306,7 +353,7 @@ type TransferBatchResponse struct { func (x *TransferBatchResponse) Reset() { *x = TransferBatchResponse{} if protoimpl.UnsafeEnabled { - mi := &file_token_balance_proto_msgTypes[3] + mi := &file_token_balance_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -319,7 +366,7 @@ func (x *TransferBatchResponse) String() string { func (*TransferBatchResponse) ProtoMessage() {} func (x *TransferBatchResponse) ProtoReflect() protoreflect.Message { - mi := &file_token_balance_proto_msgTypes[3] + mi := &file_token_balance_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -332,7 +379,7 @@ func (x *TransferBatchResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use TransferBatchResponse.ProtoReflect.Descriptor instead. func (*TransferBatchResponse) Descriptor() ([]byte, []int) { - return file_token_balance_proto_rawDescGZIP(), []int{3} + return file_token_balance_proto_rawDescGZIP(), []int{4} } func (x *TransferBatchResponse) GetTransfers() []*TransferResponse { @@ -356,7 +403,7 @@ type BalanceId struct { func (x *BalanceId) Reset() { *x = BalanceId{} if protoimpl.UnsafeEnabled { - mi := &file_token_balance_proto_msgTypes[4] + mi := &file_token_balance_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -369,7 +416,7 @@ func (x *BalanceId) String() string { func (*BalanceId) ProtoMessage() {} func (x *BalanceId) ProtoReflect() protoreflect.Message { - mi := &file_token_balance_proto_msgTypes[4] + mi := &file_token_balance_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -382,7 +429,7 @@ func (x *BalanceId) ProtoReflect() protoreflect.Message { // Deprecated: Use BalanceId.ProtoReflect.Descriptor instead. func (*BalanceId) Descriptor() ([]byte, []int) { - return file_token_balance_proto_rawDescGZIP(), []int{4} + return file_token_balance_proto_rawDescGZIP(), []int{5} } func (x *BalanceId) GetSymbol() string { @@ -419,13 +466,13 @@ type Balance struct { // account address Address string `protobuf:"bytes,3,opt,name=address,proto3" json:"address,omitempty"` // Balance amount - Amount string `protobuf:"bytes,4,opt,name=amount,proto3" json:"amount,omitempty"` + Amount *BigInt `protobuf:"bytes,4,opt,name=amount,proto3" json:"amount,omitempty"` } func (x *Balance) Reset() { *x = Balance{} if protoimpl.UnsafeEnabled { - mi := &file_token_balance_proto_msgTypes[5] + mi := &file_token_balance_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -438,7 +485,7 @@ func (x *Balance) String() string { func (*Balance) ProtoMessage() {} func (x *Balance) ProtoReflect() protoreflect.Message { - mi := &file_token_balance_proto_msgTypes[5] + mi := &file_token_balance_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -451,7 +498,7 @@ func (x *Balance) ProtoReflect() protoreflect.Message { // Deprecated: Use Balance.ProtoReflect.Descriptor instead. func (*Balance) Descriptor() ([]byte, []int) { - return file_token_balance_proto_rawDescGZIP(), []int{5} + return file_token_balance_proto_rawDescGZIP(), []int{6} } func (x *Balance) GetSymbol() string { @@ -475,11 +522,11 @@ func (x *Balance) GetAddress() string { return "" } -func (x *Balance) GetAmount() string { +func (x *Balance) GetAmount() *BigInt { if x != nil { return x.Amount } - return "" + return nil } // List: balances @@ -494,7 +541,7 @@ type Balances struct { func (x *Balances) Reset() { *x = Balances{} if protoimpl.UnsafeEnabled { - mi := &file_token_balance_proto_msgTypes[6] + mi := &file_token_balance_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -507,7 +554,7 @@ func (x *Balances) String() string { func (*Balances) ProtoMessage() {} func (x *Balances) ProtoReflect() protoreflect.Message { - mi := &file_token_balance_proto_msgTypes[6] + mi := &file_token_balance_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -520,7 +567,7 @@ func (x *Balances) ProtoReflect() protoreflect.Message { // Deprecated: Use Balances.ProtoReflect.Descriptor instead. func (*Balances) Descriptor() ([]byte, []int) { - return file_token_balance_proto_rawDescGZIP(), []int{6} + return file_token_balance_proto_rawDescGZIP(), []int{7} } func (x *Balances) GetItems() []*Balance { @@ -539,14 +586,14 @@ type Operation struct { Recipient string `protobuf:"bytes,2,opt,name=recipient,proto3" json:"recipient,omitempty"` Symbol string `protobuf:"bytes,3,opt,name=symbol,proto3" json:"symbol,omitempty"` Group []string `protobuf:"bytes,4,rep,name=group,proto3" json:"group,omitempty"` - Amount string `protobuf:"bytes,5,opt,name=amount,proto3" json:"amount,omitempty"` - Type OperationType `protobuf:"varint,6,opt,name=type,proto3,enum=extensions.token.OperationType" json:"type,omitempty"` + Amount *BigInt `protobuf:"bytes,5,opt,name=amount,proto3" json:"amount,omitempty"` + Type OperationType `protobuf:"varint,6,opt,name=type,proto3,enum=cckit.extensions.token.OperationType" json:"type,omitempty"` } func (x *Operation) Reset() { *x = Operation{} if protoimpl.UnsafeEnabled { - mi := &file_token_balance_proto_msgTypes[7] + mi := &file_token_balance_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -559,7 +606,7 @@ func (x *Operation) String() string { func (*Operation) ProtoMessage() {} func (x *Operation) ProtoReflect() protoreflect.Message { - mi := &file_token_balance_proto_msgTypes[7] + mi := &file_token_balance_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -572,7 +619,7 @@ func (x *Operation) ProtoReflect() protoreflect.Message { // Deprecated: Use Operation.ProtoReflect.Descriptor instead. func (*Operation) Descriptor() ([]byte, []int) { - return file_token_balance_proto_rawDescGZIP(), []int{7} + return file_token_balance_proto_rawDescGZIP(), []int{8} } func (x *Operation) GetSender() string { @@ -603,11 +650,11 @@ func (x *Operation) GetGroup() []string { return nil } -func (x *Operation) GetAmount() string { +func (x *Operation) GetAmount() *BigInt { if x != nil { return x.Amount } - return "" + return nil } func (x *Operation) GetType() OperationType { @@ -626,14 +673,14 @@ type TransferOperation struct { Recipient string `protobuf:"bytes,2,opt,name=recipient,proto3" json:"recipient,omitempty"` Symbol string `protobuf:"bytes,3,opt,name=symbol,proto3" json:"symbol,omitempty"` Group []string `protobuf:"bytes,4,rep,name=group,proto3" json:"group,omitempty"` - Amount string `protobuf:"bytes,5,opt,name=amount,proto3" json:"amount,omitempty"` + Amount *BigInt `protobuf:"bytes,5,opt,name=amount,proto3" json:"amount,omitempty"` Meta []*AddMetaRequest `protobuf:"bytes,6,rep,name=meta,proto3" json:"meta,omitempty"` } func (x *TransferOperation) Reset() { *x = TransferOperation{} if protoimpl.UnsafeEnabled { - mi := &file_token_balance_proto_msgTypes[8] + mi := &file_token_balance_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -646,7 +693,7 @@ func (x *TransferOperation) String() string { func (*TransferOperation) ProtoMessage() {} func (x *TransferOperation) ProtoReflect() protoreflect.Message { - mi := &file_token_balance_proto_msgTypes[8] + mi := &file_token_balance_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -659,7 +706,7 @@ func (x *TransferOperation) ProtoReflect() protoreflect.Message { // Deprecated: Use TransferOperation.ProtoReflect.Descriptor instead. func (*TransferOperation) Descriptor() ([]byte, []int) { - return file_token_balance_proto_rawDescGZIP(), []int{8} + return file_token_balance_proto_rawDescGZIP(), []int{9} } func (x *TransferOperation) GetSender() string { @@ -690,11 +737,11 @@ func (x *TransferOperation) GetGroup() []string { return nil } -func (x *TransferOperation) GetAmount() string { +func (x *TransferOperation) GetAmount() *BigInt { if x != nil { return x.Amount } - return "" + return nil } func (x *TransferOperation) GetMeta() []*AddMetaRequest { @@ -712,14 +759,14 @@ type BalanceOperation struct { Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` Symbol string `protobuf:"bytes,2,opt,name=symbol,proto3" json:"symbol,omitempty"` Group []string `protobuf:"bytes,3,rep,name=group,proto3" json:"group,omitempty"` - Amount string `protobuf:"bytes,4,opt,name=amount,proto3" json:"amount,omitempty"` + Amount *BigInt `protobuf:"bytes,4,opt,name=amount,proto3" json:"amount,omitempty"` Meta []*AddMetaRequest `protobuf:"bytes,5,rep,name=meta,proto3" json:"meta,omitempty"` } func (x *BalanceOperation) Reset() { *x = BalanceOperation{} if protoimpl.UnsafeEnabled { - mi := &file_token_balance_proto_msgTypes[9] + mi := &file_token_balance_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -732,7 +779,7 @@ func (x *BalanceOperation) String() string { func (*BalanceOperation) ProtoMessage() {} func (x *BalanceOperation) ProtoReflect() protoreflect.Message { - mi := &file_token_balance_proto_msgTypes[9] + mi := &file_token_balance_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -745,7 +792,7 @@ func (x *BalanceOperation) ProtoReflect() protoreflect.Message { // Deprecated: Use BalanceOperation.ProtoReflect.Descriptor instead. func (*BalanceOperation) Descriptor() ([]byte, []int) { - return file_token_balance_proto_rawDescGZIP(), []int{9} + return file_token_balance_proto_rawDescGZIP(), []int{10} } func (x *BalanceOperation) GetAddress() string { @@ -769,11 +816,11 @@ func (x *BalanceOperation) GetGroup() []string { return nil } -func (x *BalanceOperation) GetAmount() string { +func (x *BalanceOperation) GetAmount() *BigInt { if x != nil { return x.Amount } - return "" + return nil } func (x *BalanceOperation) GetMeta() []*AddMetaRequest { @@ -793,14 +840,14 @@ type Transferred struct { Recipient string `protobuf:"bytes,2,opt,name=recipient,proto3" json:"recipient,omitempty"` Symbol string `protobuf:"bytes,3,opt,name=symbol,proto3" json:"symbol,omitempty"` Group []string `protobuf:"bytes,4,rep,name=group,proto3" json:"group,omitempty"` - Amount string `protobuf:"bytes,5,opt,name=amount,proto3" json:"amount,omitempty"` + Amount *BigInt `protobuf:"bytes,5,opt,name=amount,proto3" json:"amount,omitempty"` Meta []*Meta `protobuf:"bytes,6,rep,name=meta,proto3" json:"meta,omitempty"` } func (x *Transferred) Reset() { *x = Transferred{} if protoimpl.UnsafeEnabled { - mi := &file_token_balance_proto_msgTypes[10] + mi := &file_token_balance_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -813,7 +860,7 @@ func (x *Transferred) String() string { func (*Transferred) ProtoMessage() {} func (x *Transferred) ProtoReflect() protoreflect.Message { - mi := &file_token_balance_proto_msgTypes[10] + mi := &file_token_balance_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -826,7 +873,7 @@ func (x *Transferred) ProtoReflect() protoreflect.Message { // Deprecated: Use Transferred.ProtoReflect.Descriptor instead. func (*Transferred) Descriptor() ([]byte, []int) { - return file_token_balance_proto_rawDescGZIP(), []int{10} + return file_token_balance_proto_rawDescGZIP(), []int{11} } func (x *Transferred) GetSender() string { @@ -857,11 +904,11 @@ func (x *Transferred) GetGroup() []string { return nil } -func (x *Transferred) GetAmount() string { +func (x *Transferred) GetAmount() *BigInt { if x != nil { return x.Amount } - return "" + return nil } func (x *Transferred) GetMeta() []*Meta { @@ -883,7 +930,7 @@ type TransferredBatch struct { func (x *TransferredBatch) Reset() { *x = TransferredBatch{} if protoimpl.UnsafeEnabled { - mi := &file_token_balance_proto_msgTypes[11] + mi := &file_token_balance_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -896,7 +943,7 @@ func (x *TransferredBatch) String() string { func (*TransferredBatch) ProtoMessage() {} func (x *TransferredBatch) ProtoReflect() protoreflect.Message { - mi := &file_token_balance_proto_msgTypes[11] + mi := &file_token_balance_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -909,7 +956,7 @@ func (x *TransferredBatch) ProtoReflect() protoreflect.Message { // Deprecated: Use TransferredBatch.ProtoReflect.Descriptor instead. func (*TransferredBatch) Descriptor() ([]byte, []int) { - return file_token_balance_proto_rawDescGZIP(), []int{11} + return file_token_balance_proto_rawDescGZIP(), []int{12} } func (x *TransferredBatch) GetTransfers() []*Transferred { @@ -931,7 +978,7 @@ type AddMetaRequest struct { func (x *AddMetaRequest) Reset() { *x = AddMetaRequest{} if protoimpl.UnsafeEnabled { - mi := &file_token_balance_proto_msgTypes[12] + mi := &file_token_balance_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -944,7 +991,7 @@ func (x *AddMetaRequest) String() string { func (*AddMetaRequest) ProtoMessage() {} func (x *AddMetaRequest) ProtoReflect() protoreflect.Message { - mi := &file_token_balance_proto_msgTypes[12] + mi := &file_token_balance_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -957,7 +1004,7 @@ func (x *AddMetaRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use AddMetaRequest.ProtoReflect.Descriptor instead. func (*AddMetaRequest) Descriptor() ([]byte, []int) { - return file_token_balance_proto_rawDescGZIP(), []int{12} + return file_token_balance_proto_rawDescGZIP(), []int{13} } func (x *AddMetaRequest) GetKey() string { @@ -986,7 +1033,7 @@ type Meta struct { func (x *Meta) Reset() { *x = Meta{} if protoimpl.UnsafeEnabled { - mi := &file_token_balance_proto_msgTypes[13] + mi := &file_token_balance_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -999,7 +1046,7 @@ func (x *Meta) String() string { func (*Meta) ProtoMessage() {} func (x *Meta) ProtoReflect() protoreflect.Message { - mi := &file_token_balance_proto_msgTypes[13] + mi := &file_token_balance_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1012,7 +1059,7 @@ func (x *Meta) ProtoReflect() protoreflect.Message { // Deprecated: Use Meta.ProtoReflect.Descriptor instead. func (*Meta) Descriptor() ([]byte, []int) { - return file_token_balance_proto_rawDescGZIP(), []int{13} + return file_token_balance_proto_rawDescGZIP(), []int{14} } func (x *Meta) GetKey() string { @@ -1044,7 +1091,7 @@ type UTXOId struct { func (x *UTXOId) Reset() { *x = UTXOId{} if protoimpl.UnsafeEnabled { - mi := &file_token_balance_proto_msgTypes[14] + mi := &file_token_balance_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1057,7 +1104,7 @@ func (x *UTXOId) String() string { func (*UTXOId) ProtoMessage() {} func (x *UTXOId) ProtoReflect() protoreflect.Message { - mi := &file_token_balance_proto_msgTypes[14] + mi := &file_token_balance_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1070,7 +1117,7 @@ func (x *UTXOId) ProtoReflect() protoreflect.Message { // Deprecated: Use UTXOId.ProtoReflect.Descriptor instead. func (*UTXOId) Descriptor() ([]byte, []int) { - return file_token_balance_proto_rawDescGZIP(), []int{14} + return file_token_balance_proto_rawDescGZIP(), []int{15} } func (x *UTXOId) GetSymbol() string { @@ -1111,7 +1158,7 @@ type UTXO struct { Group string `protobuf:"bytes,2,opt,name=group,proto3" json:"group,omitempty"` // Token groups, joined Address string `protobuf:"bytes,3,opt,name=address,proto3" json:"address,omitempty"` // account address TxId string `protobuf:"bytes,4,opt,name=tx_id,json=txId,proto3" json:"tx_id,omitempty"` // Transaction Id - Amount string `protobuf:"bytes,6,opt,name=amount,proto3" json:"amount,omitempty"` // amount + Amount *BigInt `protobuf:"bytes,6,opt,name=amount,proto3" json:"amount,omitempty"` // amount Locked bool `protobuf:"varint,7,opt,name=locked,proto3" json:"locked,omitempty"` Meta []*Meta `protobuf:"bytes,8,rep,name=meta,proto3" json:"meta,omitempty"` // meta } @@ -1119,7 +1166,7 @@ type UTXO struct { func (x *UTXO) Reset() { *x = UTXO{} if protoimpl.UnsafeEnabled { - mi := &file_token_balance_proto_msgTypes[15] + mi := &file_token_balance_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1132,7 +1179,7 @@ func (x *UTXO) String() string { func (*UTXO) ProtoMessage() {} func (x *UTXO) ProtoReflect() protoreflect.Message { - mi := &file_token_balance_proto_msgTypes[15] + mi := &file_token_balance_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1145,7 +1192,7 @@ func (x *UTXO) ProtoReflect() protoreflect.Message { // Deprecated: Use UTXO.ProtoReflect.Descriptor instead. func (*UTXO) Descriptor() ([]byte, []int) { - return file_token_balance_proto_rawDescGZIP(), []int{15} + return file_token_balance_proto_rawDescGZIP(), []int{16} } func (x *UTXO) GetSymbol() string { @@ -1176,11 +1223,11 @@ func (x *UTXO) GetTxId() string { return "" } -func (x *UTXO) GetAmount() string { +func (x *UTXO) GetAmount() *BigInt { if x != nil { return x.Amount } - return "" + return nil } func (x *UTXO) GetLocked() bool { @@ -1208,7 +1255,7 @@ type UTXOs struct { func (x *UTXOs) Reset() { *x = UTXOs{} if protoimpl.UnsafeEnabled { - mi := &file_token_balance_proto_msgTypes[16] + mi := &file_token_balance_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1221,7 +1268,7 @@ func (x *UTXOs) String() string { func (*UTXOs) ProtoMessage() {} func (x *UTXOs) ProtoReflect() protoreflect.Message { - mi := &file_token_balance_proto_msgTypes[16] + mi := &file_token_balance_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1234,7 +1281,7 @@ func (x *UTXOs) ProtoReflect() protoreflect.Message { // Deprecated: Use UTXOs.ProtoReflect.Descriptor instead. func (*UTXOs) Descriptor() ([]byte, []int) { - return file_token_balance_proto_rawDescGZIP(), []int{16} + return file_token_balance_proto_rawDescGZIP(), []int{17} } func (x *UTXOs) GetItems() []*UTXO { @@ -1248,194 +1295,220 @@ var File_token_balance_proto protoreflect.FileDescriptor var file_token_balance_proto_rawDesc = []byte{ 0x0a, 0x13, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, - 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, - 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x1a, 0x2b, 0x6d, 0x77, 0x69, 0x74, 0x6b, 0x6f, 0x77, 0x2f, 0x67, 0x6f, 0x2d, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2d, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x2f, - 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, - 0xc3, 0x01, 0x0a, 0x0f, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x09, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe2, 0xdf, 0x1f, 0x02, 0x58, 0x01, 0x52, 0x09, - 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x1e, 0x0a, 0x06, 0x73, 0x79, 0x6d, - 0x62, 0x6f, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe2, 0xdf, 0x1f, 0x02, 0x58, - 0x01, 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x72, 0x6f, - 0x75, 0x70, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, - 0x1e, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, - 0x06, 0xe2, 0xdf, 0x1f, 0x02, 0x58, 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, - 0x34, 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, - 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, - 0x2e, 0x41, 0x64, 0x64, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, - 0x04, 0x6d, 0x65, 0x74, 0x61, 0x22, 0xba, 0x01, 0x0a, 0x10, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, - 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x16, 0x63, 0x63, 0x6b, 0x69, 0x74, 0x2e, 0x65, 0x78, 0x74, + 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x1a, 0x1c, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, + 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2b, 0x6d, 0x77, 0x69, 0x74, 0x6b, 0x6f, + 0x77, 0x2f, 0x67, 0x6f, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2d, 0x76, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x6f, 0x72, 0x73, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x1c, 0x0a, 0x06, 0x42, 0x69, 0x67, 0x49, 0x6e, 0x74, 0x12, + 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, + 0x61, 0x74, 0x61, 0x22, 0xe9, 0x01, 0x0a, 0x0f, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x09, 0x72, 0x65, 0x63, 0x69, 0x70, + 0x69, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe2, 0xdf, 0x1f, 0x02, + 0x58, 0x01, 0x52, 0x09, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x1e, 0x0a, + 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe2, + 0xdf, 0x1f, 0x02, 0x58, 0x01, 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x14, 0x0a, + 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x67, 0x72, + 0x6f, 0x75, 0x70, 0x12, 0x3e, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x63, 0x6b, 0x69, 0x74, 0x2e, 0x65, 0x78, 0x74, 0x65, + 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x42, 0x69, 0x67, + 0x49, 0x6e, 0x74, 0x42, 0x06, 0xe2, 0xdf, 0x1f, 0x02, 0x58, 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, + 0x75, 0x6e, 0x74, 0x12, 0x3a, 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x05, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x63, 0x6b, 0x69, 0x74, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, + 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x41, 0x64, 0x64, 0x4d, 0x65, + 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x22, + 0xe0, 0x01, 0x0a, 0x10, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x1c, 0x0a, 0x09, + 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x09, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x79, + 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, + 0x6f, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x04, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x36, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, + 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x63, 0x6b, 0x69, 0x74, + 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, + 0x6e, 0x2e, 0x42, 0x69, 0x67, 0x49, 0x6e, 0x74, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, + 0x12, 0x30, 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, + 0x2e, 0x63, 0x63, 0x6b, 0x69, 0x74, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, + 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x04, 0x6d, 0x65, + 0x74, 0x61, 0x22, 0x65, 0x0a, 0x14, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x42, 0x61, + 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x4d, 0x0a, 0x09, 0x74, 0x72, + 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, + 0x63, 0x63, 0x6b, 0x69, 0x74, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, + 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x06, 0xe2, 0xdf, 0x1f, 0x02, 0x60, 0x01, 0x52, 0x09, + 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x73, 0x22, 0x5f, 0x0a, 0x15, 0x54, 0x72, 0x61, + 0x6e, 0x73, 0x66, 0x65, 0x72, 0x42, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x46, 0x0a, 0x09, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x63, 0x63, 0x6b, 0x69, 0x74, 0x2e, 0x65, 0x78, + 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x54, + 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, + 0x09, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x73, 0x22, 0x53, 0x0a, 0x09, 0x42, 0x61, + 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, + 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, + 0x14, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, + 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, + 0x89, 0x01, 0x0a, 0x07, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, + 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x79, 0x6d, + 0x62, 0x6f, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x02, 0x20, 0x03, + 0x28, 0x09, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x12, 0x36, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x63, 0x6b, 0x69, 0x74, 0x2e, 0x65, 0x78, 0x74, 0x65, + 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x42, 0x69, 0x67, + 0x49, 0x6e, 0x74, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x41, 0x0a, 0x08, 0x42, + 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x35, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x63, 0x63, 0x6b, 0x69, 0x74, 0x2e, 0x65, + 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, + 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x22, 0xe2, + 0x01, 0x0a, 0x09, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, + 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x65, + 0x6e, 0x64, 0x65, 0x72, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, + 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x72, + 0x6f, 0x75, 0x70, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, + 0x12, 0x36, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1e, 0x2e, 0x63, 0x63, 0x6b, 0x69, 0x74, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, + 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x42, 0x69, 0x67, 0x49, 0x6e, 0x74, + 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x39, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x25, 0x2e, 0x63, 0x63, 0x6b, 0x69, 0x74, 0x2e, 0x65, + 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, + 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, + 0x79, 0x70, 0x65, 0x22, 0x8b, 0x02, 0x0a, 0x11, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, + 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x0a, 0x06, 0x73, 0x65, 0x6e, + 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe2, 0xdf, 0x1f, 0x02, 0x58, + 0x01, 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x24, 0x0a, 0x09, 0x72, 0x65, 0x63, + 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe2, 0xdf, + 0x1f, 0x02, 0x58, 0x01, 0x52, 0x09, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, + 0x1e, 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x06, 0xe2, 0xdf, 0x1f, 0x02, 0x58, 0x01, 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, + 0x14, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, + 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x3e, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x63, 0x6b, 0x69, 0x74, 0x2e, 0x65, 0x78, + 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x42, + 0x69, 0x67, 0x49, 0x6e, 0x74, 0x42, 0x06, 0xe2, 0xdf, 0x1f, 0x02, 0x58, 0x01, 0x52, 0x06, 0x61, + 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x3a, 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x06, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x63, 0x6b, 0x69, 0x74, 0x2e, 0x65, 0x78, 0x74, 0x65, + 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x41, 0x64, 0x64, + 0x4d, 0x65, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x04, 0x6d, 0x65, 0x74, + 0x61, 0x22, 0xe6, 0x01, 0x0a, 0x10, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x4f, 0x70, 0x65, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x20, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe2, 0xdf, 0x1f, 0x02, 0x58, 0x01, 0x52, + 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1e, 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, + 0x6f, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe2, 0xdf, 0x1f, 0x02, 0x58, 0x01, + 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, + 0x70, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x3e, + 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, + 0x2e, 0x63, 0x63, 0x6b, 0x69, 0x74, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, + 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x42, 0x69, 0x67, 0x49, 0x6e, 0x74, 0x42, 0x06, + 0xe2, 0xdf, 0x1f, 0x02, 0x58, 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x3a, + 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, + 0x63, 0x6b, 0x69, 0x74, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, + 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x41, 0x64, 0x64, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x52, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x22, 0xdb, 0x01, 0x0a, 0x0b, 0x54, + 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x72, 0x65, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, - 0x70, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x16, - 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, - 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2a, 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x06, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, - 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x04, 0x6d, 0x65, - 0x74, 0x61, 0x22, 0x5f, 0x0a, 0x14, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x42, 0x61, - 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x47, 0x0a, 0x09, 0x74, 0x72, - 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, - 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, - 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x42, 0x06, 0xe2, 0xdf, 0x1f, 0x02, 0x60, 0x01, 0x52, 0x09, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, - 0x65, 0x72, 0x73, 0x22, 0x59, 0x0a, 0x15, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x42, - 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x09, + 0x70, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x36, + 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, + 0x2e, 0x63, 0x63, 0x6b, 0x69, 0x74, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, + 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x42, 0x69, 0x67, 0x49, 0x6e, 0x74, 0x52, 0x06, + 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x30, 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x06, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x63, 0x63, 0x6b, 0x69, 0x74, 0x2e, 0x65, 0x78, 0x74, + 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x4d, 0x65, + 0x74, 0x61, 0x52, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x22, 0x55, 0x0a, 0x10, 0x54, 0x72, 0x61, 0x6e, + 0x73, 0x66, 0x65, 0x72, 0x72, 0x65, 0x64, 0x42, 0x61, 0x74, 0x63, 0x68, 0x12, 0x41, 0x0a, 0x09, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x22, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, - 0x65, 0x6e, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x52, 0x09, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x73, 0x22, 0x53, - 0x0a, 0x09, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, - 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x79, 0x6d, - 0x62, 0x6f, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x03, 0x20, 0x03, - 0x28, 0x09, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x22, 0x69, 0x0a, 0x07, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x16, - 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, - 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, - 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x18, 0x0a, 0x07, - 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x3b, - 0x0a, 0x08, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x2f, 0x0a, 0x05, 0x69, 0x74, - 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x65, 0x78, 0x74, 0x65, + 0x23, 0x2e, 0x63, 0x63, 0x6b, 0x69, 0x74, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, + 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, + 0x72, 0x72, 0x65, 0x64, 0x52, 0x09, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x73, 0x22, + 0x48, 0x0a, 0x0e, 0x41, 0x64, 0x64, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x18, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, + 0xe2, 0xdf, 0x1f, 0x02, 0x58, 0x01, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x1c, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe2, 0xdf, 0x1f, 0x02, + 0x58, 0x01, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x2e, 0x0a, 0x04, 0x4d, 0x65, 0x74, + 0x61, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, + 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x65, 0x0a, 0x06, 0x55, 0x54, 0x58, + 0x4f, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x67, + 0x72, 0x6f, 0x75, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, + 0x70, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x13, 0x0a, 0x05, 0x74, + 0x78, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x78, 0x49, 0x64, + 0x22, 0xe5, 0x01, 0x0a, 0x04, 0x55, 0x54, 0x58, 0x4f, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x79, 0x6d, + 0x62, 0x6f, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, + 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x12, 0x13, 0x0a, 0x05, 0x74, 0x78, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x74, 0x78, 0x49, 0x64, 0x12, 0x36, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x63, 0x6b, 0x69, 0x74, 0x2e, 0x65, + 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, + 0x42, 0x69, 0x67, 0x49, 0x6e, 0x74, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x16, + 0x0a, 0x06, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, + 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x12, 0x30, 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x08, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x63, 0x63, 0x6b, 0x69, 0x74, 0x2e, 0x65, 0x78, 0x74, + 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x4d, 0x65, + 0x74, 0x61, 0x52, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x22, 0x3b, 0x0a, 0x05, 0x55, 0x54, 0x58, 0x4f, + 0x73, 0x12, 0x32, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x1c, 0x2e, 0x63, 0x63, 0x6b, 0x69, 0x74, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, + 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x55, 0x54, 0x58, 0x4f, 0x52, 0x05, + 0x69, 0x74, 0x65, 0x6d, 0x73, 0x2a, 0x7a, 0x0a, 0x0d, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x15, 0x0a, 0x11, 0x4f, 0x50, 0x45, 0x52, 0x41, 0x54, + 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x16, 0x0a, + 0x12, 0x4f, 0x50, 0x45, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x54, 0x52, 0x41, 0x4e, 0x53, + 0x46, 0x45, 0x52, 0x10, 0x01, 0x12, 0x12, 0x0a, 0x0e, 0x4f, 0x50, 0x45, 0x52, 0x41, 0x54, 0x49, + 0x4f, 0x4e, 0x5f, 0x4d, 0x49, 0x4e, 0x54, 0x10, 0x02, 0x12, 0x12, 0x0a, 0x0e, 0x4f, 0x50, 0x45, + 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x42, 0x55, 0x52, 0x4e, 0x10, 0x03, 0x12, 0x12, 0x0a, + 0x0e, 0x4f, 0x50, 0x45, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4c, 0x4f, 0x43, 0x4b, 0x10, + 0x04, 0x32, 0xa2, 0x04, 0x0a, 0x0e, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x12, 0x84, 0x01, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x42, 0x61, 0x6c, 0x61, + 0x6e, 0x63, 0x65, 0x12, 0x21, 0x2e, 0x63, 0x63, 0x6b, 0x69, 0x74, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x42, 0x61, 0x6c, - 0x61, 0x6e, 0x63, 0x65, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x22, 0xbc, 0x01, 0x0a, 0x09, - 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x6e, - 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, - 0x72, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, - 0x16, 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, - 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x16, 0x0a, - 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, - 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x33, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, - 0x01, 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, - 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0xe5, 0x01, 0x0a, 0x11, 0x54, - 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x12, 0x1e, 0x0a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x06, 0xe2, 0xdf, 0x1f, 0x02, 0x58, 0x01, 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, - 0x12, 0x24, 0x0a, 0x09, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x06, 0xe2, 0xdf, 0x1f, 0x02, 0x58, 0x01, 0x52, 0x09, 0x72, 0x65, 0x63, - 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x1e, 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe2, 0xdf, 0x1f, 0x02, 0x58, 0x01, 0x52, 0x06, - 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, - 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x1e, 0x0a, 0x06, - 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe2, 0xdf, - 0x1f, 0x02, 0x58, 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x34, 0x0a, 0x04, - 0x6d, 0x65, 0x74, 0x61, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x65, 0x78, 0x74, - 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x41, 0x64, - 0x64, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x04, 0x6d, 0x65, - 0x74, 0x61, 0x22, 0xc0, 0x01, 0x0a, 0x10, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x4f, 0x70, - 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x20, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe2, 0xdf, 0x1f, 0x02, 0x58, 0x01, - 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1e, 0x0a, 0x06, 0x73, 0x79, 0x6d, - 0x62, 0x6f, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe2, 0xdf, 0x1f, 0x02, 0x58, - 0x01, 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x72, 0x6f, - 0x75, 0x70, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, - 0x1e, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, - 0x06, 0xe2, 0xdf, 0x1f, 0x02, 0x58, 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, - 0x34, 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, - 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, - 0x2e, 0x41, 0x64, 0x64, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, - 0x04, 0x6d, 0x65, 0x74, 0x61, 0x22, 0xb5, 0x01, 0x0a, 0x0b, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, - 0x65, 0x72, 0x72, 0x65, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x1c, 0x0a, - 0x09, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x09, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, - 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x79, 0x6d, - 0x62, 0x6f, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x04, 0x20, 0x03, - 0x28, 0x09, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, - 0x75, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, - 0x74, 0x12, 0x2a, 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x16, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, - 0x65, 0x6e, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x22, 0x4f, 0x0a, - 0x10, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x72, 0x65, 0x64, 0x42, 0x61, 0x74, 0x63, - 0x68, 0x12, 0x3b, 0x0a, 0x09, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x73, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, - 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, - 0x72, 0x65, 0x64, 0x52, 0x09, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x73, 0x22, 0x48, - 0x0a, 0x0e, 0x41, 0x64, 0x64, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x18, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe2, - 0xdf, 0x1f, 0x02, 0x58, 0x01, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x1c, 0x0a, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe2, 0xdf, 0x1f, 0x02, 0x58, - 0x01, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x2e, 0x0a, 0x04, 0x4d, 0x65, 0x74, 0x61, - 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, - 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x65, 0x0a, 0x06, 0x55, 0x54, 0x58, 0x4f, - 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x72, - 0x6f, 0x75, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, - 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x13, 0x0a, 0x05, 0x74, 0x78, - 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x78, 0x49, 0x64, 0x22, - 0xbf, 0x01, 0x0a, 0x04, 0x55, 0x54, 0x58, 0x4f, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, - 0x6f, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, - 0x12, 0x14, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x12, 0x13, 0x0a, 0x05, 0x74, 0x78, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x74, 0x78, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x16, 0x0a, - 0x06, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x6c, - 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x12, 0x2a, 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x08, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, - 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x04, 0x6d, 0x65, 0x74, - 0x61, 0x22, 0x35, 0x0a, 0x05, 0x55, 0x54, 0x58, 0x4f, 0x73, 0x12, 0x2c, 0x0a, 0x05, 0x69, 0x74, - 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x65, 0x78, 0x74, 0x65, - 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x55, 0x54, 0x58, - 0x4f, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x2a, 0x7a, 0x0a, 0x0d, 0x4f, 0x70, 0x65, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x15, 0x0a, 0x11, 0x4f, 0x50, 0x45, - 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, - 0x12, 0x16, 0x0a, 0x12, 0x4f, 0x50, 0x45, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x54, 0x52, - 0x41, 0x4e, 0x53, 0x46, 0x45, 0x52, 0x10, 0x01, 0x12, 0x12, 0x0a, 0x0e, 0x4f, 0x50, 0x45, 0x52, - 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4d, 0x49, 0x4e, 0x54, 0x10, 0x02, 0x12, 0x12, 0x0a, 0x0e, - 0x4f, 0x50, 0x45, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x42, 0x55, 0x52, 0x4e, 0x10, 0x03, - 0x12, 0x12, 0x0a, 0x0e, 0x4f, 0x50, 0x45, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4c, 0x4f, - 0x43, 0x4b, 0x10, 0x04, 0x32, 0xf1, 0x03, 0x0a, 0x0e, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x78, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x42, 0x61, - 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x1b, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, - 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, - 0x49, 0x64, 0x1a, 0x19, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, - 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x22, 0x32, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x2c, 0x12, 0x2a, 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2f, 0x62, 0x61, - 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2f, 0x7b, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x7d, 0x2f, - 0x7b, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x7d, 0x2f, 0x7b, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x7d, 0x12, 0x71, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, - 0x73, 0x12, 0x1b, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, - 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x49, 0x64, 0x1a, 0x1a, - 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, - 0x6e, 0x2e, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x22, 0x28, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x22, 0x12, 0x20, 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2f, 0x62, 0x61, 0x6c, 0x61, 0x6e, - 0x63, 0x65, 0x73, 0x2f, 0x7b, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x7d, 0x2f, 0x7b, 0x67, 0x72, - 0x6f, 0x75, 0x70, 0x7d, 0x12, 0x6d, 0x0a, 0x08, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, - 0x12, 0x21, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, - 0x6b, 0x65, 0x6e, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, - 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x14, 0x22, - 0x0f, 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, - 0x3a, 0x01, 0x2a, 0x12, 0x82, 0x01, 0x0a, 0x0d, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, - 0x42, 0x61, 0x74, 0x63, 0x68, 0x12, 0x26, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, + 0x61, 0x6e, 0x63, 0x65, 0x49, 0x64, 0x1a, 0x1f, 0x2e, 0x63, 0x63, 0x6b, 0x69, 0x74, 0x2e, 0x65, + 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, + 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x22, 0x32, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2c, 0x12, + 0x2a, 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, + 0x2f, 0x7b, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x7d, 0x2f, 0x7b, 0x67, 0x72, 0x6f, 0x75, 0x70, + 0x7d, 0x2f, 0x7b, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x7d, 0x12, 0x7d, 0x0a, 0x0c, 0x4c, + 0x69, 0x73, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x21, 0x2e, 0x63, 0x63, + 0x6b, 0x69, 0x74, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, + 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x49, 0x64, 0x1a, 0x20, + 0x2e, 0x63, 0x63, 0x6b, 0x69, 0x74, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, + 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, + 0x22, 0x28, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x12, 0x20, 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, + 0x2f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2f, 0x7b, 0x73, 0x79, 0x6d, 0x62, 0x6f, + 0x6c, 0x7d, 0x2f, 0x7b, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x7d, 0x12, 0x79, 0x0a, 0x08, 0x54, 0x72, + 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x12, 0x27, 0x2e, 0x63, 0x63, 0x6b, 0x69, 0x74, 0x2e, 0x65, + 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, + 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x28, 0x2e, 0x63, 0x63, 0x6b, 0x69, 0x74, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, - 0x72, 0x42, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, + 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1a, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x14, 0x22, 0x0f, 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, + 0x65, 0x72, 0x3a, 0x01, 0x2a, 0x12, 0x8e, 0x01, 0x0a, 0x0d, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, + 0x65, 0x72, 0x42, 0x61, 0x74, 0x63, 0x68, 0x12, 0x2c, 0x2e, 0x63, 0x63, 0x6b, 0x69, 0x74, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x42, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x20, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x22, 0x15, - 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x2d, - 0x62, 0x61, 0x74, 0x63, 0x68, 0x3a, 0x01, 0x2a, 0x42, 0x34, 0x5a, 0x32, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, 0x67, - 0x65, 0x72, 0x2d, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x63, 0x63, 0x6b, 0x69, 0x74, 0x2f, 0x65, 0x78, - 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x63, 0x63, 0x6b, 0x69, 0x74, 0x2e, 0x65, 0x78, + 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x54, + 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x42, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x20, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x22, 0x15, 0x2f, 0x74, + 0x6f, 0x6b, 0x65, 0x6e, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x2d, 0x62, 0x61, + 0x74, 0x63, 0x68, 0x3a, 0x01, 0x2a, 0x42, 0x34, 0x5a, 0x32, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, + 0x2d, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x63, 0x63, 0x6b, 0x69, 0x74, 0x2f, 0x65, 0x78, 0x74, 0x65, + 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1451,53 +1524,62 @@ func file_token_balance_proto_rawDescGZIP() []byte { } var file_token_balance_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_token_balance_proto_msgTypes = make([]protoimpl.MessageInfo, 17) +var file_token_balance_proto_msgTypes = make([]protoimpl.MessageInfo, 18) var file_token_balance_proto_goTypes = []interface{}{ - (OperationType)(0), // 0: extensions.token.OperationType - (*TransferRequest)(nil), // 1: extensions.token.TransferRequest - (*TransferResponse)(nil), // 2: extensions.token.TransferResponse - (*TransferBatchRequest)(nil), // 3: extensions.token.TransferBatchRequest - (*TransferBatchResponse)(nil), // 4: extensions.token.TransferBatchResponse - (*BalanceId)(nil), // 5: extensions.token.BalanceId - (*Balance)(nil), // 6: extensions.token.Balance - (*Balances)(nil), // 7: extensions.token.Balances - (*Operation)(nil), // 8: extensions.token.Operation - (*TransferOperation)(nil), // 9: extensions.token.TransferOperation - (*BalanceOperation)(nil), // 10: extensions.token.BalanceOperation - (*Transferred)(nil), // 11: extensions.token.Transferred - (*TransferredBatch)(nil), // 12: extensions.token.TransferredBatch - (*AddMetaRequest)(nil), // 13: extensions.token.AddMetaRequest - (*Meta)(nil), // 14: extensions.token.Meta - (*UTXOId)(nil), // 15: extensions.token.UTXOId - (*UTXO)(nil), // 16: extensions.token.UTXO - (*UTXOs)(nil), // 17: extensions.token.UTXOs + (OperationType)(0), // 0: cckit.extensions.token.OperationType + (*BigInt)(nil), // 1: cckit.extensions.token.BigInt + (*TransferRequest)(nil), // 2: cckit.extensions.token.TransferRequest + (*TransferResponse)(nil), // 3: cckit.extensions.token.TransferResponse + (*TransferBatchRequest)(nil), // 4: cckit.extensions.token.TransferBatchRequest + (*TransferBatchResponse)(nil), // 5: cckit.extensions.token.TransferBatchResponse + (*BalanceId)(nil), // 6: cckit.extensions.token.BalanceId + (*Balance)(nil), // 7: cckit.extensions.token.Balance + (*Balances)(nil), // 8: cckit.extensions.token.Balances + (*Operation)(nil), // 9: cckit.extensions.token.Operation + (*TransferOperation)(nil), // 10: cckit.extensions.token.TransferOperation + (*BalanceOperation)(nil), // 11: cckit.extensions.token.BalanceOperation + (*Transferred)(nil), // 12: cckit.extensions.token.Transferred + (*TransferredBatch)(nil), // 13: cckit.extensions.token.TransferredBatch + (*AddMetaRequest)(nil), // 14: cckit.extensions.token.AddMetaRequest + (*Meta)(nil), // 15: cckit.extensions.token.Meta + (*UTXOId)(nil), // 16: cckit.extensions.token.UTXOId + (*UTXO)(nil), // 17: cckit.extensions.token.UTXO + (*UTXOs)(nil), // 18: cckit.extensions.token.UTXOs } var file_token_balance_proto_depIdxs = []int32{ - 13, // 0: extensions.token.TransferRequest.meta:type_name -> extensions.token.AddMetaRequest - 14, // 1: extensions.token.TransferResponse.meta:type_name -> extensions.token.Meta - 1, // 2: extensions.token.TransferBatchRequest.transfers:type_name -> extensions.token.TransferRequest - 2, // 3: extensions.token.TransferBatchResponse.transfers:type_name -> extensions.token.TransferResponse - 6, // 4: extensions.token.Balances.items:type_name -> extensions.token.Balance - 0, // 5: extensions.token.Operation.type:type_name -> extensions.token.OperationType - 13, // 6: extensions.token.TransferOperation.meta:type_name -> extensions.token.AddMetaRequest - 13, // 7: extensions.token.BalanceOperation.meta:type_name -> extensions.token.AddMetaRequest - 14, // 8: extensions.token.Transferred.meta:type_name -> extensions.token.Meta - 11, // 9: extensions.token.TransferredBatch.transfers:type_name -> extensions.token.Transferred - 14, // 10: extensions.token.UTXO.meta:type_name -> extensions.token.Meta - 16, // 11: extensions.token.UTXOs.items:type_name -> extensions.token.UTXO - 5, // 12: extensions.token.BalanceService.GetBalance:input_type -> extensions.token.BalanceId - 5, // 13: extensions.token.BalanceService.ListBalances:input_type -> extensions.token.BalanceId - 1, // 14: extensions.token.BalanceService.Transfer:input_type -> extensions.token.TransferRequest - 3, // 15: extensions.token.BalanceService.TransferBatch:input_type -> extensions.token.TransferBatchRequest - 6, // 16: extensions.token.BalanceService.GetBalance:output_type -> extensions.token.Balance - 7, // 17: extensions.token.BalanceService.ListBalances:output_type -> extensions.token.Balances - 2, // 18: extensions.token.BalanceService.Transfer:output_type -> extensions.token.TransferResponse - 4, // 19: extensions.token.BalanceService.TransferBatch:output_type -> extensions.token.TransferBatchResponse - 16, // [16:20] is the sub-list for method output_type - 12, // [12:16] is the sub-list for method input_type - 12, // [12:12] is the sub-list for extension type_name - 12, // [12:12] is the sub-list for extension extendee - 0, // [0:12] is the sub-list for field type_name + 1, // 0: cckit.extensions.token.TransferRequest.amount:type_name -> cckit.extensions.token.BigInt + 14, // 1: cckit.extensions.token.TransferRequest.meta:type_name -> cckit.extensions.token.AddMetaRequest + 1, // 2: cckit.extensions.token.TransferResponse.amount:type_name -> cckit.extensions.token.BigInt + 15, // 3: cckit.extensions.token.TransferResponse.meta:type_name -> cckit.extensions.token.Meta + 2, // 4: cckit.extensions.token.TransferBatchRequest.transfers:type_name -> cckit.extensions.token.TransferRequest + 3, // 5: cckit.extensions.token.TransferBatchResponse.transfers:type_name -> cckit.extensions.token.TransferResponse + 1, // 6: cckit.extensions.token.Balance.amount:type_name -> cckit.extensions.token.BigInt + 7, // 7: cckit.extensions.token.Balances.items:type_name -> cckit.extensions.token.Balance + 1, // 8: cckit.extensions.token.Operation.amount:type_name -> cckit.extensions.token.BigInt + 0, // 9: cckit.extensions.token.Operation.type:type_name -> cckit.extensions.token.OperationType + 1, // 10: cckit.extensions.token.TransferOperation.amount:type_name -> cckit.extensions.token.BigInt + 14, // 11: cckit.extensions.token.TransferOperation.meta:type_name -> cckit.extensions.token.AddMetaRequest + 1, // 12: cckit.extensions.token.BalanceOperation.amount:type_name -> cckit.extensions.token.BigInt + 14, // 13: cckit.extensions.token.BalanceOperation.meta:type_name -> cckit.extensions.token.AddMetaRequest + 1, // 14: cckit.extensions.token.Transferred.amount:type_name -> cckit.extensions.token.BigInt + 15, // 15: cckit.extensions.token.Transferred.meta:type_name -> cckit.extensions.token.Meta + 12, // 16: cckit.extensions.token.TransferredBatch.transfers:type_name -> cckit.extensions.token.Transferred + 1, // 17: cckit.extensions.token.UTXO.amount:type_name -> cckit.extensions.token.BigInt + 15, // 18: cckit.extensions.token.UTXO.meta:type_name -> cckit.extensions.token.Meta + 17, // 19: cckit.extensions.token.UTXOs.items:type_name -> cckit.extensions.token.UTXO + 6, // 20: cckit.extensions.token.BalanceService.GetBalance:input_type -> cckit.extensions.token.BalanceId + 6, // 21: cckit.extensions.token.BalanceService.ListBalances:input_type -> cckit.extensions.token.BalanceId + 2, // 22: cckit.extensions.token.BalanceService.Transfer:input_type -> cckit.extensions.token.TransferRequest + 4, // 23: cckit.extensions.token.BalanceService.TransferBatch:input_type -> cckit.extensions.token.TransferBatchRequest + 7, // 24: cckit.extensions.token.BalanceService.GetBalance:output_type -> cckit.extensions.token.Balance + 8, // 25: cckit.extensions.token.BalanceService.ListBalances:output_type -> cckit.extensions.token.Balances + 3, // 26: cckit.extensions.token.BalanceService.Transfer:output_type -> cckit.extensions.token.TransferResponse + 5, // 27: cckit.extensions.token.BalanceService.TransferBatch:output_type -> cckit.extensions.token.TransferBatchResponse + 24, // [24:28] is the sub-list for method output_type + 20, // [20:24] is the sub-list for method input_type + 20, // [20:20] is the sub-list for extension type_name + 20, // [20:20] is the sub-list for extension extendee + 0, // [0:20] is the sub-list for field type_name } func init() { file_token_balance_proto_init() } @@ -1507,7 +1589,7 @@ func file_token_balance_proto_init() { } if !protoimpl.UnsafeEnabled { file_token_balance_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TransferRequest); i { + switch v := v.(*BigInt); i { case 0: return &v.state case 1: @@ -1519,7 +1601,7 @@ func file_token_balance_proto_init() { } } file_token_balance_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TransferResponse); i { + switch v := v.(*TransferRequest); i { case 0: return &v.state case 1: @@ -1531,7 +1613,7 @@ func file_token_balance_proto_init() { } } file_token_balance_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TransferBatchRequest); i { + switch v := v.(*TransferResponse); i { case 0: return &v.state case 1: @@ -1543,7 +1625,7 @@ func file_token_balance_proto_init() { } } file_token_balance_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TransferBatchResponse); i { + switch v := v.(*TransferBatchRequest); i { case 0: return &v.state case 1: @@ -1555,7 +1637,7 @@ func file_token_balance_proto_init() { } } file_token_balance_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BalanceId); i { + switch v := v.(*TransferBatchResponse); i { case 0: return &v.state case 1: @@ -1567,7 +1649,7 @@ func file_token_balance_proto_init() { } } file_token_balance_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Balance); i { + switch v := v.(*BalanceId); i { case 0: return &v.state case 1: @@ -1579,7 +1661,7 @@ func file_token_balance_proto_init() { } } file_token_balance_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Balances); i { + switch v := v.(*Balance); i { case 0: return &v.state case 1: @@ -1591,7 +1673,7 @@ func file_token_balance_proto_init() { } } file_token_balance_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Operation); i { + switch v := v.(*Balances); i { case 0: return &v.state case 1: @@ -1603,7 +1685,7 @@ func file_token_balance_proto_init() { } } file_token_balance_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TransferOperation); i { + switch v := v.(*Operation); i { case 0: return &v.state case 1: @@ -1615,7 +1697,7 @@ func file_token_balance_proto_init() { } } file_token_balance_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BalanceOperation); i { + switch v := v.(*TransferOperation); i { case 0: return &v.state case 1: @@ -1627,7 +1709,7 @@ func file_token_balance_proto_init() { } } file_token_balance_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Transferred); i { + switch v := v.(*BalanceOperation); i { case 0: return &v.state case 1: @@ -1639,7 +1721,7 @@ func file_token_balance_proto_init() { } } file_token_balance_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TransferredBatch); i { + switch v := v.(*Transferred); i { case 0: return &v.state case 1: @@ -1651,7 +1733,7 @@ func file_token_balance_proto_init() { } } file_token_balance_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AddMetaRequest); i { + switch v := v.(*TransferredBatch); i { case 0: return &v.state case 1: @@ -1663,7 +1745,7 @@ func file_token_balance_proto_init() { } } file_token_balance_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Meta); i { + switch v := v.(*AddMetaRequest); i { case 0: return &v.state case 1: @@ -1675,7 +1757,7 @@ func file_token_balance_proto_init() { } } file_token_balance_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UTXOId); i { + switch v := v.(*Meta); i { case 0: return &v.state case 1: @@ -1687,7 +1769,7 @@ func file_token_balance_proto_init() { } } file_token_balance_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UTXO); i { + switch v := v.(*UTXOId); i { case 0: return &v.state case 1: @@ -1699,6 +1781,18 @@ func file_token_balance_proto_init() { } } file_token_balance_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UTXO); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_token_balance_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UTXOs); i { case 0: return &v.state @@ -1717,7 +1811,7 @@ func file_token_balance_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_token_balance_proto_rawDesc, NumEnums: 1, - NumMessages: 17, + NumMessages: 18, NumExtensions: 0, NumServices: 1, }, @@ -1763,7 +1857,7 @@ func NewBalanceServiceClient(cc grpc.ClientConnInterface) BalanceServiceClient { func (c *balanceServiceClient) GetBalance(ctx context.Context, in *BalanceId, opts ...grpc.CallOption) (*Balance, error) { out := new(Balance) - err := c.cc.Invoke(ctx, "/extensions.token.BalanceService/GetBalance", in, out, opts...) + err := c.cc.Invoke(ctx, "/cckit.extensions.token.BalanceService/GetBalance", in, out, opts...) if err != nil { return nil, err } @@ -1772,7 +1866,7 @@ func (c *balanceServiceClient) GetBalance(ctx context.Context, in *BalanceId, op func (c *balanceServiceClient) ListBalances(ctx context.Context, in *BalanceId, opts ...grpc.CallOption) (*Balances, error) { out := new(Balances) - err := c.cc.Invoke(ctx, "/extensions.token.BalanceService/ListBalances", in, out, opts...) + err := c.cc.Invoke(ctx, "/cckit.extensions.token.BalanceService/ListBalances", in, out, opts...) if err != nil { return nil, err } @@ -1781,7 +1875,7 @@ func (c *balanceServiceClient) ListBalances(ctx context.Context, in *BalanceId, func (c *balanceServiceClient) Transfer(ctx context.Context, in *TransferRequest, opts ...grpc.CallOption) (*TransferResponse, error) { out := new(TransferResponse) - err := c.cc.Invoke(ctx, "/extensions.token.BalanceService/Transfer", in, out, opts...) + err := c.cc.Invoke(ctx, "/cckit.extensions.token.BalanceService/Transfer", in, out, opts...) if err != nil { return nil, err } @@ -1790,7 +1884,7 @@ func (c *balanceServiceClient) Transfer(ctx context.Context, in *TransferRequest func (c *balanceServiceClient) TransferBatch(ctx context.Context, in *TransferBatchRequest, opts ...grpc.CallOption) (*TransferBatchResponse, error) { out := new(TransferBatchResponse) - err := c.cc.Invoke(ctx, "/extensions.token.BalanceService/TransferBatch", in, out, opts...) + err := c.cc.Invoke(ctx, "/cckit.extensions.token.BalanceService/TransferBatch", in, out, opts...) if err != nil { return nil, err } @@ -1839,7 +1933,7 @@ func _BalanceService_GetBalance_Handler(srv interface{}, ctx context.Context, de } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/extensions.token.BalanceService/GetBalance", + FullMethod: "/cckit.extensions.token.BalanceService/GetBalance", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(BalanceServiceServer).GetBalance(ctx, req.(*BalanceId)) @@ -1857,7 +1951,7 @@ func _BalanceService_ListBalances_Handler(srv interface{}, ctx context.Context, } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/extensions.token.BalanceService/ListBalances", + FullMethod: "/cckit.extensions.token.BalanceService/ListBalances", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(BalanceServiceServer).ListBalances(ctx, req.(*BalanceId)) @@ -1875,7 +1969,7 @@ func _BalanceService_Transfer_Handler(srv interface{}, ctx context.Context, dec } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/extensions.token.BalanceService/Transfer", + FullMethod: "/cckit.extensions.token.BalanceService/Transfer", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(BalanceServiceServer).Transfer(ctx, req.(*TransferRequest)) @@ -1893,7 +1987,7 @@ func _BalanceService_TransferBatch_Handler(srv interface{}, ctx context.Context, } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/extensions.token.BalanceService/TransferBatch", + FullMethod: "/cckit.extensions.token.BalanceService/TransferBatch", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(BalanceServiceServer).TransferBatch(ctx, req.(*TransferBatchRequest)) @@ -1902,7 +1996,7 @@ func _BalanceService_TransferBatch_Handler(srv interface{}, ctx context.Context, } var _BalanceService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "extensions.token.BalanceService", + ServiceName: "cckit.extensions.token.BalanceService", HandlerType: (*BalanceServiceServer)(nil), Methods: []grpc.MethodDesc{ { diff --git a/extensions/token/balance.proto b/extensions/token/balance.proto index 29f8dfe..0e19f09 100644 --- a/extensions/token/balance.proto +++ b/extensions/token/balance.proto @@ -2,7 +2,7 @@ syntax = "proto3"; option go_package = "github.com/hyperledger-labs/cckit/extensions/token"; -package extensions.token; +package cckit.extensions.token; import "google/api/annotations.proto"; import "google/protobuf/empty.proto"; @@ -41,11 +41,15 @@ service BalanceService { } } +message BigInt { + string data = 1; +} + message TransferRequest { string recipient = 1 [(validator.field) = {string_not_empty : true}]; string symbol = 2 [(validator.field) = {string_not_empty : true}]; repeated string group = 3; - string amount = 4 [(validator.field) = {string_not_empty : true}]; + BigInt amount = 4 [(validator.field) = {string_not_empty : true}]; repeated AddMetaRequest meta = 5; } @@ -54,7 +58,7 @@ message TransferResponse { string recipient = 2; string symbol = 3; repeated string group = 4; - string amount = 5; + BigInt amount = 5; repeated Meta meta = 6; } @@ -83,7 +87,7 @@ message Balance { // account address string address = 3; // Balance amount - string amount = 4; + BigInt amount = 4; } // List: balances @@ -104,7 +108,7 @@ message Operation { string recipient = 2; string symbol = 3; repeated string group = 4; - string amount = 5; + BigInt amount = 5; OperationType type = 6; } @@ -113,7 +117,7 @@ message TransferOperation { string recipient = 2 [(validator.field) = {string_not_empty : true}]; string symbol = 3 [(validator.field) = {string_not_empty : true}]; repeated string group = 4; - string amount = 5 [(validator.field) = {string_not_empty : true}]; + BigInt amount = 5 [(validator.field) = {string_not_empty : true}]; repeated AddMetaRequest meta = 6; } @@ -121,7 +125,7 @@ message BalanceOperation { string address = 1 [(validator.field) = {string_not_empty : true}]; string symbol = 2 [(validator.field) = {string_not_empty : true}]; repeated string group = 3; - string amount = 4 [(validator.field) = {string_not_empty : true}]; + BigInt amount = 4 [(validator.field) = {string_not_empty : true}]; repeated AddMetaRequest meta = 5; } @@ -131,7 +135,7 @@ message Transferred { string recipient = 2; string symbol = 3; repeated string group = 4; - string amount = 5; + BigInt amount = 5; repeated Meta meta = 6; } @@ -164,7 +168,7 @@ message UTXO { string group = 2; // Token groups, joined string address = 3; // account address string tx_id = 4; // Transaction Id - string amount = 6; // amount + BigInt amount = 6; // amount bool locked = 7; repeated Meta meta = 8; // meta } diff --git a/extensions/token/balance.swagger.json b/extensions/token/balance.swagger.json index 3a7b85e..fb4f55e 100644 --- a/extensions/token/balance.swagger.json +++ b/extensions/token/balance.swagger.json @@ -236,7 +236,7 @@ "title": "account address" }, "amount": { - "type": "string", + "$ref": "#/definitions/tokenBigInt", "title": "Balance amount" } }, @@ -254,6 +254,14 @@ }, "title": "List: balances" }, + "tokenBigInt": { + "type": "object", + "properties": { + "data": { + "type": "string" + } + } + }, "tokenMeta": { "type": "object", "properties": { @@ -303,7 +311,7 @@ } }, "amount": { - "type": "string" + "$ref": "#/definitions/tokenBigInt" }, "meta": { "type": "array", @@ -332,7 +340,7 @@ } }, "amount": { - "type": "string" + "$ref": "#/definitions/tokenBigInt" }, "meta": { "type": "array", diff --git a/extensions/token/balance.validator.pb.go b/extensions/token/balance.validator.pb.go index 46ec41c..bc04054 100644 --- a/extensions/token/balance.validator.pb.go +++ b/extensions/token/balance.validator.pb.go @@ -18,6 +18,9 @@ var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf +func (this *BigInt) Validate() error { + return nil +} func (this *TransferRequest) Validate() error { if this.Recipient == "" { return github_com_mwitkow_go_proto_validators.FieldError("Recipient", fmt.Errorf(`value '%v' must not be an empty string`, this.Recipient)) @@ -25,8 +28,10 @@ func (this *TransferRequest) Validate() error { if this.Symbol == "" { return github_com_mwitkow_go_proto_validators.FieldError("Symbol", fmt.Errorf(`value '%v' must not be an empty string`, this.Symbol)) } - if this.Amount == "" { - return github_com_mwitkow_go_proto_validators.FieldError("Amount", fmt.Errorf(`value '%v' must not be an empty string`, this.Amount)) + if this.Amount != nil { + if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Amount); err != nil { + return github_com_mwitkow_go_proto_validators.FieldError("Amount", err) + } } for _, item := range this.Meta { if item != nil { @@ -38,6 +43,11 @@ func (this *TransferRequest) Validate() error { return nil } func (this *TransferResponse) Validate() error { + if this.Amount != nil { + if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Amount); err != nil { + return github_com_mwitkow_go_proto_validators.FieldError("Amount", err) + } + } for _, item := range this.Meta { if item != nil { if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil { @@ -74,6 +84,11 @@ func (this *BalanceId) Validate() error { return nil } func (this *Balance) Validate() error { + if this.Amount != nil { + if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Amount); err != nil { + return github_com_mwitkow_go_proto_validators.FieldError("Amount", err) + } + } return nil } func (this *Balances) Validate() error { @@ -87,6 +102,11 @@ func (this *Balances) Validate() error { return nil } func (this *Operation) Validate() error { + if this.Amount != nil { + if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Amount); err != nil { + return github_com_mwitkow_go_proto_validators.FieldError("Amount", err) + } + } return nil } func (this *TransferOperation) Validate() error { @@ -99,8 +119,10 @@ func (this *TransferOperation) Validate() error { if this.Symbol == "" { return github_com_mwitkow_go_proto_validators.FieldError("Symbol", fmt.Errorf(`value '%v' must not be an empty string`, this.Symbol)) } - if this.Amount == "" { - return github_com_mwitkow_go_proto_validators.FieldError("Amount", fmt.Errorf(`value '%v' must not be an empty string`, this.Amount)) + if this.Amount != nil { + if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Amount); err != nil { + return github_com_mwitkow_go_proto_validators.FieldError("Amount", err) + } } for _, item := range this.Meta { if item != nil { @@ -118,8 +140,10 @@ func (this *BalanceOperation) Validate() error { if this.Symbol == "" { return github_com_mwitkow_go_proto_validators.FieldError("Symbol", fmt.Errorf(`value '%v' must not be an empty string`, this.Symbol)) } - if this.Amount == "" { - return github_com_mwitkow_go_proto_validators.FieldError("Amount", fmt.Errorf(`value '%v' must not be an empty string`, this.Amount)) + if this.Amount != nil { + if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Amount); err != nil { + return github_com_mwitkow_go_proto_validators.FieldError("Amount", err) + } } for _, item := range this.Meta { if item != nil { @@ -131,6 +155,11 @@ func (this *BalanceOperation) Validate() error { return nil } func (this *Transferred) Validate() error { + if this.Amount != nil { + if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Amount); err != nil { + return github_com_mwitkow_go_proto_validators.FieldError("Amount", err) + } + } for _, item := range this.Meta { if item != nil { if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil { @@ -166,6 +195,11 @@ func (this *UTXOId) Validate() error { return nil } func (this *UTXO) Validate() error { + if this.Amount != nil { + if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Amount); err != nil { + return github_com_mwitkow_go_proto_validators.FieldError("Amount", err) + } + } for _, item := range this.Meta { if item != nil { if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil { diff --git a/extensions/token/balance_account.go b/extensions/token/balance_account.go index f6582ed..7e66a30 100644 --- a/extensions/token/balance_account.go +++ b/extensions/token/balance_account.go @@ -30,7 +30,7 @@ func (s *AccountStore) Get(ctx router.Context, id *BalanceId) (*Balance, error) Address: id.Address, Symbol: id.Symbol, Group: id.Group, - Amount: big.NewInt(0).String(), + Amount: NewBigInt(big.NewInt(0)), }, nil } return nil, err @@ -141,11 +141,20 @@ func (s *AccountStore) add(ctx router.Context, op *BalanceOperation) (*Balance, return nil, err } + curBalanceAmount, err := balance.Amount.BigInt() + if err != nil { + return nil, fmt.Errorf(`parse cur balance: %w`, err) + } + + toAdd, err := op.Amount.BigInt() + if err != nil { + return nil, fmt.Errorf(`parse amnount to add: %w`, err) + } newBalance := &Balance{ Address: op.Address, Symbol: op.Symbol, Group: op.Group, - Amount: balance.Amount + op.Amount, + Amount: NewBigIntSum(curBalanceAmount, toAdd), } if err = State(ctx).Put(newBalance); err != nil { @@ -160,23 +169,23 @@ func (s *AccountStore) sub(ctx router.Context, op *BalanceOperation) (*Balance, return nil, err } - if balance.Amount < op.Amount { - return nil, fmt.Errorf(`subtract from=%s: %w`, op.Address, ErrAmountInsuficcient) - } - - balAmount, err := IntVal(balance.Amount) + balAmount, err := balance.Amount.BigInt() if err != nil { return nil, err } - opAmount, err := IntVal(op.Amount) + opAmount, err := op.Amount.BigInt() if err != nil { return nil, err } + + if balAmount.Cmp(opAmount) == -1 { + return nil, fmt.Errorf(`subtract from=%s: %w`, op.Address, ErrAmountInsuficcient) + } newBalance := &Balance{ Address: op.Address, Symbol: op.Symbol, Group: op.Group, - Amount: balAmount.Sub(balAmount, opAmount).String(), + Amount: NewBigIntSub(balAmount, opAmount), } if err = State(ctx).Put(newBalance); err != nil { diff --git a/extensions/token/balance_utxo.go b/extensions/token/balance_utxo.go index daa8c55..efd5380 100644 --- a/extensions/token/balance_utxo.go +++ b/extensions/token/balance_utxo.go @@ -45,7 +45,7 @@ func (u *UTXOStore) Get(ctx router.Context, balanceId *BalanceId) (*Balance, err amount := big.NewInt(0) for _, u := range outputs { - uAmount, err := IntVal(u.Amount) + uAmount, err := u.Amount.BigInt() if err != nil { return nil, err } @@ -59,7 +59,7 @@ func (u *UTXOStore) Get(ctx router.Context, balanceId *BalanceId) (*Balance, err Address: balanceId.Address, Symbol: balanceId.Symbol, Group: balanceId.Group, - Amount: amount.String(), + Amount: NewBigInt(amount), } return balance, nil @@ -77,7 +77,7 @@ func (u *UTXOStore) GetLocked(ctx router.Context, balanceId *BalanceId) (*Balanc amount := big.NewInt(0) for _, u := range outputs { if u.Locked { - uAmount, err := IntVal(u.Amount) + uAmount, err := u.Amount.BigInt() if err != nil { return nil, err } @@ -92,7 +92,7 @@ func (u *UTXOStore) GetLocked(ctx router.Context, balanceId *BalanceId) (*Balanc Symbol: balanceId.Symbol, Group: balanceId.Group, Address: balanceId.Address, - Amount: amount.String(), + Amount: NewBigInt(amount), } return balance, nil @@ -126,7 +126,7 @@ func (u *UTXOStore) Transfer(ctx router.Context, transfer *TransferOperation) er return err } - transferAmount, err := IntVal(transfer.Amount) + transferAmount, err := transfer.Amount.BigInt() if err != nil { return err } @@ -157,7 +157,7 @@ func (u *UTXOStore) Transfer(ctx router.Context, transfer *TransferOperation) er Group: strings.Join(transfer.Group, `,`), Address: transfer.Sender, TxId: txID, - Amount: amount.String(), + Amount: NewBigInt(amount), Locked: false, } if err := State(ctx).Insert(senderChangeOutput); err != nil { @@ -214,7 +214,7 @@ func (u *UTXOStore) TransferBatch(ctx router.Context, transfers []*TransferOpera return ErrRecipientDuplicate } recipients[transfer.Recipient] = nil - transferAmount, err := IntVal(transfer.Amount) + transferAmount, err := transfer.Amount.BigInt() if err != nil { return err } @@ -266,7 +266,7 @@ func (u *UTXOStore) TransferBatch(ctx router.Context, transfers []*TransferOpera Group: strings.Join(group, `,`), Address: sender, TxId: txID, - Amount: amount.String(), + Amount: NewBigInt(amount), Locked: false, } if err := State(ctx).Insert(senderChangeOutput); err != nil { @@ -303,7 +303,7 @@ func (u *UTXOStore) Lock(ctx router.Context, op *BalanceOperation) (*LockId, err return nil, err } - opAmount, err := IntVal(op.Amount) + opAmount, err := op.Amount.BigInt() if err != nil { return nil, err } @@ -339,7 +339,7 @@ func (u *UTXOStore) Lock(ctx router.Context, op *BalanceOperation) (*LockId, err Group: strings.Join(op.Group, `,`), Address: op.Address, TxId: ctx.Stub().GetTxID() + ".1", - Amount: changeAmount.String(), + Amount: NewBigInt(changeAmount), Locked: false, } if err := State(ctx).Insert(senderChangeOutput); err != nil { @@ -443,7 +443,7 @@ func selectOutputsForAmount(outputs []*UTXO, amount *big.Int, locked bool) ([]*U for _, o := range outputs { if (!locked && !o.Locked) || (locked && o.Locked) { selectedOutputs = append(selectedOutputs, o) - oAmount, err := IntVal(o.Amount) + oAmount, err := o.Amount.BigInt() if err != nil { return nil, new(big.Int), err } @@ -482,7 +482,7 @@ func burn(ctx router.Context, burn *BalanceOperation, locked bool) error { return err } - burnAmount, err := IntVal(burn.Amount) + burnAmount, err := burn.Amount.BigInt() if err != nil { return err } @@ -504,7 +504,7 @@ func burn(ctx router.Context, burn *BalanceOperation, locked bool) error { Group: strings.Join(burn.Group, `,`), Address: burn.Address, TxId: ctx.Stub().GetTxID(), - Amount: changeAmount.String(), + Amount: NewBigInt(changeAmount), Locked: locked, } if err := State(ctx).Insert(senderChangeOutput); err != nil { @@ -561,7 +561,7 @@ func setLock(ctx router.Context, op *BalanceOperation, locked bool) error { Symbol: op.Symbol, Group: strings.Join(op.Group, `,`), TxId: ctx.Stub().GetTxID(), - Amount: changeAmount.String(), + Amount: changeNewBigInt(amount) Locked: !locked, } if err := State(ctx).Insert(senderChangeOutput); err != nil { diff --git a/extensions/token/balance_utxo_test.go b/extensions/token/balance_utxo_test.go index dbfa384..e896712 100644 --- a/extensions/token/balance_utxo_test.go +++ b/extensions/token/balance_utxo_test.go @@ -2,7 +2,6 @@ package token_test import ( "encoding/base64" - "fmt" "math/big" "testing" @@ -63,32 +62,32 @@ func NewWallet(cc *testcc.TxHandler, ctx router.Context, store *token.UTXOStore, } } -func (w *Wallet) ExpectBalance(amount string) { +func (w *Wallet) ExpectBalance(amount *big.Int) { b, err := w.store.Get(w.ctx, &token.BalanceId{ Address: w.address, Symbol: w.symbol, }) Expect(err).NotTo(HaveOccurred()) - Expect(b.Amount).To(Equal(amount)) + Expect(b.Amount).To(Equal(token.NewBigInt(amount))) } -func (w *Wallet) ExpectMint(amount string) { +func (w *Wallet) ExpectMint(amount *big.Int) { w.cc.Tx(func() { err := w.store.Mint(w.ctx, &token.BalanceOperation{ Address: w.address, Symbol: w.symbol, - Amount: amount, + Amount: token.NewBigInt(amount), }) Expect(err).NotTo(HaveOccurred()) }) } -func (w *Wallet) ExpectBurn(amount string) { +func (w *Wallet) ExpectBurn(amount *big.Int) { w.cc.Tx(func() { err := w.store.Burn(w.ctx, &token.BalanceOperation{ Address: w.address, Symbol: w.symbol, - Amount: amount, + Amount: token.NewBigInt(amount), }) Expect(err).NotTo(HaveOccurred()) }) @@ -115,13 +114,13 @@ func (w *Wallet) ExpectLockAll() { }) } -func (w *Wallet) ExpectTransfer(recipient string, amount string) { +func (w *Wallet) ExpectTransfer(recipient string, amount *big.Int) { w.cc.Tx(func() { err := w.store.Transfer(w.ctx, &token.TransferOperation{ Sender: w.address, Recipient: recipient, Symbol: w.symbol, - Amount: amount, + Amount: token.NewBigInt(amount), }) Expect(err).NotTo(HaveOccurred()) }) @@ -136,24 +135,24 @@ func (w *Wallet) ExpectTransferLock(recipient string, amount string) { }) } -func (w *Wallet) ExpectNotTransfer(recipient string, amount string) { +func (w *Wallet) ExpectNotTransfer(recipient string, amount *big.Int) { w.cc.Tx(func() { err := w.store.Transfer(w.ctx, &token.TransferOperation{ Sender: w.address, Recipient: recipient, Symbol: w.symbol, - Amount: amount, + Amount: token.NewBigInt(amount), }) Expect(err).To(HaveOccurred()) }) } -func (w *Wallet) ExpectLock(amount string) { +func (w *Wallet) ExpectLock(amount *big.Int) { w.cc.Tx(func() { lockId, err := w.store.Lock(w.ctx, &token.BalanceOperation{ Address: w.address, Symbol: w.symbol, - Amount: amount, + Amount: token.NewBigInt(amount), }) Expect(err).NotTo(HaveOccurred()) Expect(lockId.Address).To(Equal(w.address)) @@ -170,19 +169,19 @@ func (w *Wallet) ExpectUnlock() { }) } -func (w *Wallet) ExpectLockedBalance(amount string) { +func (w *Wallet) ExpectLockedBalance(amount *big.Int) { b, err := w.store.GetLocked(w.ctx, &token.BalanceId{ Symbol: w.symbol, Address: w.address, }) Expect(err).NotTo(HaveOccurred()) - Expect(b.Amount).To(Equal(amount)) + Expect(b.Amount).To(Equal(token.NewBigInt(amount))) } type transfer struct { recipient string - amount string + amount *big.Int } func (w *Wallet) ExpectTransferBatch(transfers []*transfer) { @@ -194,7 +193,7 @@ func (w *Wallet) ExpectTransferBatch(transfers []*transfer) { Sender: w.address, Recipient: t.recipient, Symbol: w.symbol, - Amount: t.amount, + Amount: token.NewBigInt(t.amount), }) } w.cc.Tx(func() { @@ -221,108 +220,104 @@ var _ = Describe(`UTXO store`, func() { user1Wallet := NewWallet(cc, ctx, utxo, user1Address, Symbol) user2Wallet := NewWallet(cc, ctx, utxo, user2Address, Symbol) - fmt.Println("ownerAddress", ownerAddress) - fmt.Println("user1Address", user1Address) - fmt.Println("user2Address", user2Address) - It(`allow to get empty balance`, func() { - ownerWallet.ExpectBalance(Int0.String()) + ownerWallet.ExpectBalance(Int0) }) It(`allow to mint balance`, func() { - ownerWallet.ExpectMint(TotalSupply.String()) - ownerWallet.ExpectBalance(TotalSupply.String()) + ownerWallet.ExpectMint(TotalSupply) + ownerWallet.ExpectBalance(TotalSupply) ownerWallet.ExpectOutputsNum(1) }) It(`allow to mint balance once more time`, func() { - ownerWallet.ExpectMint(TotalSupply.String()) - ownerWallet.ExpectBalance(TotalSupplyX2.String()) + ownerWallet.ExpectMint(TotalSupply) + ownerWallet.ExpectBalance(TotalSupplyX2) ownerWallet.ExpectOutputsNum(2) }) It(`allow to partially transfer balance`, func() { - ownerWallet.ExpectTransfer(user1Address, Int100.String()) - ownerWallet.ExpectBalance(new(big.Int).Sub(TotalSupplyX2, Int100).String()) + ownerWallet.ExpectTransfer(user1Address, Int100) + ownerWallet.ExpectBalance(new(big.Int).Sub(TotalSupplyX2, Int100)) ownerWallet.ExpectOutputsNum(2) - user1Wallet.ExpectBalance(big.NewInt(100).String()) + user1Wallet.ExpectBalance(big.NewInt(100)) user1Wallet.ExpectOutputsNum(1) }) It(`allow to return all amount back`, func() { - user1Wallet.ExpectTransfer(ownerAddress, Int100.String()) - ownerWallet.ExpectBalance(TotalSupplyX2.String()) + user1Wallet.ExpectTransfer(ownerAddress, Int100) + ownerWallet.ExpectBalance(TotalSupplyX2) ownerWallet.ExpectOutputsNum(3) - user1Wallet.ExpectBalance(Int0.String()) + user1Wallet.ExpectBalance(Int0) user1Wallet.ExpectOutputsNum(0) }) It(`allow to burn`, func() { - ownerWallet.ExpectBurn(TotalSupply.String()) - ownerWallet.ExpectBalance(TotalSupply.String()) + ownerWallet.ExpectBurn(TotalSupply) + ownerWallet.ExpectBalance(TotalSupply) //ownerWallet.ExpectOutputsNum(2) }) It(`allow to transfer batch`, func() { ownerWallet.ExpectTransferBatch([]*transfer{ - {recipient: user1Address, amount: Int100.String()}, - {recipient: user2Address, amount: Int200.String()}, + {recipient: user1Address, amount: Int100}, + {recipient: user2Address, amount: Int200}, }) - ownerWallet.ExpectBalance(new(big.Int).Sub(TotalSupply, Int300).String()) // must be equal TotalSupply - 100 - 200 - user1Wallet.ExpectBalance(Int100.String()) - user2Wallet.ExpectBalance(Int200.String()) + ownerWallet.ExpectBalance(new(big.Int).Sub(TotalSupply, Int300)) // must be equal TotalSupply - 100 - 200 + user1Wallet.ExpectBalance(Int100) + user2Wallet.ExpectBalance(Int200) //ownerWallet.ExpectOutputsNum(2) }) It(`allow to lock`, func() { - user1Wallet.ExpectLock(Int50.String()) - user1Wallet.ExpectLockedBalance(Int50.String()) + user1Wallet.ExpectLock(Int50) + user1Wallet.ExpectLockedBalance(Int50) }) It(`disallow to transfer locked balance`, func() { - user1Wallet.ExpectNotTransfer(ownerAddress, Int100.String()) + user1Wallet.ExpectNotTransfer(ownerAddress, Int100) }) It(`allow to unlock`, func() { user1Wallet.ExpectUnlock() - user1Wallet.ExpectBalance(Int100.String()) - user1Wallet.ExpectLockedBalance(Int0.String()) + user1Wallet.ExpectBalance(Int100) + user1Wallet.ExpectLockedBalance(Int0) }) It(`allow to burn locked`, func() { - user2Wallet.ExpectLock(Int50.String()) + user2Wallet.ExpectLock(Int50) user2Wallet.ExpectBurnLock() - user2Wallet.ExpectLockedBalance(Int0.String()) - user2Wallet.ExpectBalance(Int150.String()) + user2Wallet.ExpectLockedBalance(Int0) + user2Wallet.ExpectBalance(Int150) }) It(`allow to burn all locked`, func() { - user1Wallet.ExpectLock(Int50.String()) - user2Wallet.ExpectLock(Int50.String()) + user1Wallet.ExpectLock(Int50) + user2Wallet.ExpectLock(Int50) user2Wallet.ExpectBurnAllLock() - user1Wallet.ExpectLockedBalance(Int0.String()) - user2Wallet.ExpectLockedBalance(Int0.String()) - user1Wallet.ExpectBalance(Int50.String()) - user2Wallet.ExpectBalance(Int100.String()) + user1Wallet.ExpectLockedBalance(Int0) + user2Wallet.ExpectLockedBalance(Int0) + user1Wallet.ExpectBalance(Int50) + user2Wallet.ExpectBalance(Int100) }) It(`allow to transfer locked token`, func() { - ownerWallet.ExpectLock(Int100.String()) + ownerWallet.ExpectLock(Int100) ownerWallet.ExpectTransferLock(user2Address, Int100.String()) - ownerWallet.ExpectLockedBalance(Int0.String()) - user2Wallet.ExpectLockedBalance(Int100.String()) + ownerWallet.ExpectLockedBalance(Int0) + user2Wallet.ExpectLockedBalance(Int100) }) It(`allow to lock all`, func() { ownerWallet.ExpectLockAll() - ownerWallet.ExpectLockedBalance(Int600.String()) - ownerWallet.ExpectBalance(Int600.String()) - user1Wallet.ExpectLockedBalance(Int50.String()) - user1Wallet.ExpectBalance(Int50.String()) - user2Wallet.ExpectLockedBalance(Int200.String()) - user2Wallet.ExpectBalance(Int200.String()) + ownerWallet.ExpectLockedBalance(Int600) + ownerWallet.ExpectBalance(Int600) + user1Wallet.ExpectLockedBalance(Int50) + user1Wallet.ExpectBalance(Int50) + user2Wallet.ExpectLockedBalance(Int200) + user2Wallet.ExpectBalance(Int200) }) }) diff --git a/extensions/token/bigint.go b/extensions/token/bigint.go index feb761d..6aacc84 100644 --- a/extensions/token/bigint.go +++ b/extensions/token/bigint.go @@ -1,16 +1,76 @@ package token import ( + "encoding/json" "errors" "math/big" + "strings" + + "github.com/golang/protobuf/jsonpb" ) var ErrConvertStringInt = errors.New("failed to convert string to big int") -func IntVal(x string) (*big.Int, error) { - X, ok := new(big.Int).SetString(x, 10) +func (x *BigInt) BigInt() (*big.Int, error) { + bigInt, ok := new(big.Int).SetString(x.Data, 10) if !ok { return nil, ErrConvertStringInt } - return X, nil + return bigInt, nil +} + +// MarshalJSON collapse field json representation to string from Data field +func (x *BigInt) MarshalJSON() ([]byte, error) { + return []byte(strings.Join([]string{`"`, x.GetData(), `"`}, ``)), nil +} + +func (x *BigInt) MarshalJSONPB(_ *jsonpb.Marshaler) ([]byte, error) { + return x.MarshalJSON() +} + +type bigIntUnmarshal struct { + Data string +} + +// UnmarshalJSON supports short ( {"amount: "12345"}) and full {"amount: { "data" : "12345" }} BigInt json representation +func (x *BigInt) UnmarshalJSON(data []byte) error { + str := string(data) + strLen := len(str) + + if str[0:1] == `{` && str[strLen-1:strLen] == `}` { + obj := new(bigIntUnmarshal) + if err := json.Unmarshal(data, obj); err != nil { + return err + } + x.Data = obj.Data + return nil + } + x.Data = str[1 : strLen-1] // remove quotes + return nil +} + +func (x *BigInt) UnmarshalJSONPB(_ *jsonpb.Unmarshaler, data []byte) error { + return x.UnmarshalJSON(data) +} + +func NewBigInt(val *big.Int) *BigInt { + return &BigInt{ + Data: val.String(), + } +} + +func BigIntSum(a, b *big.Int) *big.Int { + return new(big.Int).Add(a, b) +} + +func NewBigIntSum(a, b *big.Int) *BigInt { + return NewBigInt(BigIntSum(a, b)) +} + +func BigIntSub(a, b *big.Int) *big.Int { + return new(big.Int).Sub(a, b) +} + +func NewBigIntSub(a, b *big.Int) *BigInt { + return NewBigInt(BigIntSub(a, b)) } diff --git a/extensions/token/bigint_test.go b/extensions/token/bigint_test.go new file mode 100644 index 0000000..9e49768 --- /dev/null +++ b/extensions/token/bigint_test.go @@ -0,0 +1,48 @@ +package token_test + +import ( + . "github.com/onsi/ginkgo" + . "github.com/onsi/gomega" + + "github.com/hyperledger-labs/cckit/extensions/token" + "github.com/hyperledger-labs/cckit/serialize" +) + +var ( + utxo1 = &token.UTXO{ + Symbol: "a", + Group: "b", + Address: "c", + TxId: "d", + Amount: &token.BigInt{ + Data: `12345`, + }, + } + + utxo1JSON = []byte(`{"symbol":"a","group":"b","address":"c","tx_id":"d","amount":"12345"}`) + utxo1JSON_WithBigIntObj = []byte(`{"symbol":"a","group":"b","address":"c","tx_id":"d","amount": { "data" : "12345" }}`) +) +var _ = Describe(`Bigint`, func() { + + It(`allow to serialize to json`, func() { + + json, err := serialize.PreferJSONSerializer.ToBytesFrom(utxo1) + Expect(err).NotTo(HaveOccurred()) + + Expect(json).To(Equal(utxo1JSON)) + }) + + It(`allow to deserialize from json (short version)`, func() { + obj, err := serialize.PreferJSONSerializer.FromBytesTo(utxo1JSON, &token.UTXO{}) + Expect(err).NotTo(HaveOccurred()) + + Expect(obj.(*token.UTXO).String()).To(Equal(utxo1.String())) + }) + + It(`allow to deserialize from json (full version)`, func() { + obj, err := serialize.PreferJSONSerializer.FromBytesTo(utxo1JSON_WithBigIntObj, &token.UTXO{}) + Expect(err).NotTo(HaveOccurred()) + + Expect(obj.(*token.UTXO).String()).To(Equal(utxo1.String())) + }) +}) diff --git a/extensions/token/token.go b/extensions/token/token.go index b4e12f1..04b53e7 100644 --- a/extensions/token/token.go +++ b/extensions/token/token.go @@ -171,7 +171,7 @@ func (s *TokenService) CreateTokenGroup(ctx router.Context, req *CreateTokenGrou Symbol: req.Symbol, Group: req.Group, Name: req.Name, - TotalSupply: ``, + TotalSupply: nil, } for _, m := range req.Meta { diff --git a/extensions/token/token.pb.go b/extensions/token/token.pb.go index dc75c3e..ec241ec 100644 --- a/extensions/token/token.pb.go +++ b/extensions/token/token.pb.go @@ -85,7 +85,7 @@ type CreateTokenTypeRequest struct { Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Decimals uint32 `protobuf:"varint,3,opt,name=decimals,proto3" json:"decimals,omitempty"` // from 0 to 8 GroupType TokenGroupType `protobuf:"varint,4,opt,name=group_type,json=groupType,proto3,enum=extensions.token.TokenGroupType" json:"group_type,omitempty"` - TotalSupply string `protobuf:"bytes,5,opt,name=total_supply,json=totalSupply,proto3" json:"total_supply,omitempty"` // big.Int + TotalSupply *BigInt `protobuf:"bytes,5,opt,name=total_supply,json=totalSupply,proto3" json:"total_supply,omitempty"` // big.Int Meta []*TokenMetaRequest `protobuf:"bytes,6,rep,name=meta,proto3" json:"meta,omitempty"` } @@ -149,11 +149,11 @@ func (x *CreateTokenTypeRequest) GetGroupType() TokenGroupType { return TokenGroupType_OPTIONAL } -func (x *CreateTokenTypeRequest) GetTotalSupply() string { +func (x *CreateTokenTypeRequest) GetTotalSupply() *BigInt { if x != nil { return x.TotalSupply } - return "" + return nil } func (x *CreateTokenTypeRequest) GetMeta() []*TokenMetaRequest { @@ -242,7 +242,7 @@ type CreateTokenGroupRequest struct { Symbol string `protobuf:"bytes,1,opt,name=symbol,proto3" json:"symbol,omitempty"` Group []string `protobuf:"bytes,2,rep,name=group,proto3" json:"group,omitempty"` Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` - TotalSupply string `protobuf:"bytes,4,opt,name=total_supply,json=totalSupply,proto3" json:"total_supply,omitempty"` // big.Int + TotalSupply *BigInt `protobuf:"bytes,4,opt,name=total_supply,json=totalSupply,proto3" json:"total_supply,omitempty"` // big.Int Meta []*TokenMetaRequest `protobuf:"bytes,5,rep,name=meta,proto3" json:"meta,omitempty"` } @@ -299,11 +299,11 @@ func (x *CreateTokenGroupRequest) GetName() string { return "" } -func (x *CreateTokenGroupRequest) GetTotalSupply() string { +func (x *CreateTokenGroupRequest) GetTotalSupply() *BigInt { if x != nil { return x.TotalSupply } - return "" + return nil } func (x *CreateTokenGroupRequest) GetMeta() []*TokenMetaRequest { @@ -488,7 +488,7 @@ type TokenType struct { Symbol string `protobuf:"bytes,1,opt,name=symbol,proto3" json:"symbol,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Decimals uint32 `protobuf:"varint,3,opt,name=decimals,proto3" json:"decimals,omitempty"` - TotalSupply string `protobuf:"bytes,4,opt,name=total_supply,json=totalSupply,proto3" json:"total_supply,omitempty"` + TotalSupply *BigInt `protobuf:"bytes,4,opt,name=total_supply,json=totalSupply,proto3" json:"total_supply,omitempty"` GroupType TokenGroupType `protobuf:"varint,5,opt,name=group_type,json=groupType,proto3,enum=extensions.token.TokenGroupType" json:"group_type,omitempty"` Meta []*TokenMeta `protobuf:"bytes,6,rep,name=meta,proto3" json:"meta,omitempty"` } @@ -546,11 +546,11 @@ func (x *TokenType) GetDecimals() uint32 { return 0 } -func (x *TokenType) GetTotalSupply() string { +func (x *TokenType) GetTotalSupply() *BigInt { if x != nil { return x.TotalSupply } - return "" + return nil } func (x *TokenType) GetGroupType() TokenGroupType { @@ -678,7 +678,7 @@ type TokenGroup struct { Symbol string `protobuf:"bytes,1,opt,name=symbol,proto3" json:"symbol,omitempty"` Group []string `protobuf:"bytes,2,rep,name=group,proto3" json:"group,omitempty"` Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` - TotalSupply string `protobuf:"bytes,4,opt,name=total_supply,json=totalSupply,proto3" json:"total_supply,omitempty"` + TotalSupply *BigInt `protobuf:"bytes,4,opt,name=total_supply,json=totalSupply,proto3" json:"total_supply,omitempty"` Meta []*TokenMeta `protobuf:"bytes,5,rep,name=meta,proto3" json:"meta,omitempty"` } @@ -735,11 +735,11 @@ func (x *TokenGroup) GetName() string { return "" } -func (x *TokenGroup) GetTotalSupply() string { +func (x *TokenGroup) GetTotalSupply() *BigInt { if x != nil { return x.TotalSupply } - return "" + return nil } func (x *TokenGroup) GetMeta() []*TokenMeta { @@ -1090,226 +1090,236 @@ var file_token_token_proto_rawDesc = []byte{ 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2b, 0x6d, 0x77, 0x69, 0x74, 0x6b, 0x6f, 0x77, 0x2f, 0x67, 0x6f, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2d, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x2f, 0x76, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9d, 0x02, - 0x0a, 0x16, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x54, 0x79, 0x70, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1e, 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, - 0x6f, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe2, 0xdf, 0x1f, 0x02, 0x58, 0x01, - 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x1a, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe2, 0xdf, 0x1f, 0x02, 0x58, 0x01, 0x52, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x22, 0x0a, 0x08, 0x64, 0x65, 0x63, 0x69, 0x6d, 0x61, 0x6c, 0x73, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x42, 0x06, 0xe2, 0xdf, 0x1f, 0x02, 0x18, 0x09, 0x52, 0x08, - 0x64, 0x65, 0x63, 0x69, 0x6d, 0x61, 0x6c, 0x73, 0x12, 0x48, 0x0a, 0x0a, 0x67, 0x72, 0x6f, 0x75, - 0x70, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x65, - 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, - 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x54, 0x79, 0x70, 0x65, 0x42, 0x07, - 0xe2, 0xdf, 0x1f, 0x03, 0x88, 0x01, 0x01, 0x52, 0x09, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x54, 0x79, - 0x70, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x75, 0x70, 0x70, - 0x6c, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x53, - 0x75, 0x70, 0x70, 0x6c, 0x79, 0x12, 0x36, 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x06, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, - 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x4d, 0x65, 0x74, 0x61, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x22, 0xaf, 0x01, - 0x0a, 0x16, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x54, 0x79, 0x70, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1e, 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, - 0x6f, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe2, 0xdf, 0x1f, 0x02, 0x58, 0x01, - 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x1a, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe2, 0xdf, 0x1f, 0x02, 0x58, 0x01, 0x52, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x75, - 0x70, 0x70, 0x6c, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x74, 0x6f, 0x74, 0x61, - 0x6c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x12, 0x36, 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, - 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, - 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x4d, 0x65, - 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x22, - 0xce, 0x01, 0x0a, 0x17, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x47, - 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1e, 0x0a, 0x06, 0x73, - 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe2, 0xdf, 0x1f, - 0x02, 0x58, 0x01, 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x1c, 0x0a, 0x05, 0x67, - 0x72, 0x6f, 0x75, 0x70, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x42, 0x06, 0xe2, 0xdf, 0x1f, 0x02, - 0x60, 0x01, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x1a, 0x0a, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe2, 0xdf, 0x1f, 0x02, 0x58, 0x01, 0x52, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x73, - 0x75, 0x70, 0x70, 0x6c, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x74, 0x6f, 0x74, - 0x61, 0x6c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x12, 0x36, 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, - 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, - 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x4d, - 0x65, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x04, 0x6d, 0x65, 0x74, 0x61, - 0x22, 0xa8, 0x01, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x3e, 0x0a, 0x0d, 0x64, - 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, - 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x49, 0x64, 0x52, 0x0c, 0x64, - 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x2d, 0x0a, 0x13, 0x6d, - 0x61, 0x78, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x5f, 0x6e, - 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x10, 0x6d, 0x61, 0x78, 0x54, 0x6f, 0x6b, - 0x65, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x73, 0x4e, 0x75, 0x6d, 0x12, 0x2f, 0x0a, 0x14, 0x6d, 0x61, - 0x78, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x5f, 0x6e, - 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x11, 0x6d, 0x61, 0x78, 0x54, 0x6f, 0x6b, - 0x65, 0x6e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x4e, 0x75, 0x6d, 0x22, 0x3f, 0x0a, 0x07, 0x54, - 0x6f, 0x6b, 0x65, 0x6e, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe2, 0xdf, 0x1f, 0x02, 0x58, 0x01, 0x52, 0x06, - 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, - 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x22, 0x25, 0x0a, 0x0b, - 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, - 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x79, 0x6d, - 0x62, 0x6f, 0x6c, 0x22, 0xe8, 0x01, 0x0a, 0x09, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x54, 0x79, 0x70, - 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, - 0x08, 0x64, 0x65, 0x63, 0x69, 0x6d, 0x61, 0x6c, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x08, 0x64, 0x65, 0x63, 0x69, 0x6d, 0x61, 0x6c, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x74, 0x6f, 0x74, - 0x61, 0x6c, 0x5f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0b, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x12, 0x3f, 0x0a, 0x0a, - 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, - 0x32, 0x20, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, - 0x6b, 0x65, 0x6e, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x54, 0x79, - 0x70, 0x65, 0x52, 0x09, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x54, 0x79, 0x70, 0x65, 0x12, 0x2f, 0x0a, - 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x65, 0x78, - 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x54, - 0x6f, 0x6b, 0x65, 0x6e, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x22, 0x3f, - 0x0a, 0x0a, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x73, 0x12, 0x31, 0x0a, 0x05, - 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x65, 0x78, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x13, 0x74, + 0x6f, 0x6b, 0x65, 0x6e, 0x2f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x22, 0xbd, 0x02, 0x0a, 0x16, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x6f, 0x6b, + 0x65, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1e, 0x0a, + 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe2, + 0xdf, 0x1f, 0x02, 0x58, 0x01, 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x1a, 0x0a, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe2, 0xdf, 0x1f, + 0x02, 0x58, 0x01, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x22, 0x0a, 0x08, 0x64, 0x65, 0x63, + 0x69, 0x6d, 0x61, 0x6c, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x42, 0x06, 0xe2, 0xdf, 0x1f, + 0x02, 0x18, 0x09, 0x52, 0x08, 0x64, 0x65, 0x63, 0x69, 0x6d, 0x61, 0x6c, 0x73, 0x12, 0x48, 0x0a, + 0x0a, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x20, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, + 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x54, + 0x79, 0x70, 0x65, 0x42, 0x07, 0xe2, 0xdf, 0x1f, 0x03, 0x88, 0x01, 0x01, 0x52, 0x09, 0x67, 0x72, + 0x6f, 0x75, 0x70, 0x54, 0x79, 0x70, 0x65, 0x12, 0x41, 0x0a, 0x0c, 0x74, 0x6f, 0x74, 0x61, 0x6c, + 0x5f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, + 0x63, 0x63, 0x6b, 0x69, 0x74, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, + 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x42, 0x69, 0x67, 0x49, 0x6e, 0x74, 0x52, 0x0b, 0x74, + 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x12, 0x36, 0x0a, 0x04, 0x6d, 0x65, + 0x74, 0x61, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, + 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x54, 0x6f, 0x6b, 0x65, + 0x6e, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x04, 0x6d, 0x65, + 0x74, 0x61, 0x22, 0xaf, 0x01, 0x0a, 0x16, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x6f, 0x6b, + 0x65, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1e, 0x0a, + 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe2, + 0xdf, 0x1f, 0x02, 0x58, 0x01, 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x1a, 0x0a, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe2, 0xdf, 0x1f, + 0x02, 0x58, 0x01, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x74, 0x6f, 0x74, + 0x61, 0x6c, 0x5f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0b, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x12, 0x36, 0x0a, 0x04, + 0x6d, 0x65, 0x74, 0x61, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x78, 0x74, + 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x54, 0x6f, + 0x6b, 0x65, 0x6e, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x04, + 0x6d, 0x65, 0x74, 0x61, 0x22, 0xee, 0x01, 0x0a, 0x17, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, + 0x6f, 0x6b, 0x65, 0x6e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x1e, 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x06, 0xe2, 0xdf, 0x1f, 0x02, 0x58, 0x01, 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, + 0x12, 0x1c, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x42, + 0x06, 0xe2, 0xdf, 0x1f, 0x02, 0x60, 0x01, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x1a, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe2, 0xdf, + 0x1f, 0x02, 0x58, 0x01, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x41, 0x0a, 0x0c, 0x74, 0x6f, + 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1e, 0x2e, 0x63, 0x63, 0x6b, 0x69, 0x74, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, + 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x42, 0x69, 0x67, 0x49, 0x6e, 0x74, + 0x52, 0x0b, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x12, 0x36, 0x0a, + 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x54, - 0x6f, 0x6b, 0x65, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x05, 0x74, 0x79, 0x70, 0x65, 0x73, 0x22, - 0x3c, 0x0a, 0x0c, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x12, - 0x16, 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, - 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x22, 0xa2, 0x01, - 0x0a, 0x0a, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x16, 0x0a, 0x06, - 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x79, - 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x02, 0x20, - 0x03, 0x28, 0x09, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x21, + 0x6f, 0x6b, 0x65, 0x6e, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, + 0x04, 0x6d, 0x65, 0x74, 0x61, 0x22, 0xa8, 0x01, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x12, 0x3e, 0x0a, 0x0d, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x74, 0x6f, 0x6b, 0x65, + 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, + 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, + 0x49, 0x64, 0x52, 0x0c, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, + 0x12, 0x2d, 0x0a, 0x13, 0x6d, 0x61, 0x78, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x10, 0x6d, + 0x61, 0x78, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x73, 0x4e, 0x75, 0x6d, 0x12, + 0x2f, 0x0a, 0x14, 0x6d, 0x61, 0x78, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x67, 0x72, 0x6f, + 0x75, 0x70, 0x73, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x11, 0x6d, + 0x61, 0x78, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x4e, 0x75, 0x6d, + 0x22, 0x3f, 0x0a, 0x07, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x06, 0x73, + 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe2, 0xdf, 0x1f, + 0x02, 0x58, 0x01, 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x67, + 0x72, 0x6f, 0x75, 0x70, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, + 0x70, 0x22, 0x25, 0x0a, 0x0b, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x49, 0x64, + 0x12, 0x16, 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x22, 0x88, 0x02, 0x0a, 0x09, 0x54, 0x6f, 0x6b, + 0x65, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x12, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x65, 0x63, 0x69, 0x6d, 0x61, 0x6c, 0x73, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x64, 0x65, 0x63, 0x69, 0x6d, 0x61, 0x6c, 0x73, 0x12, 0x41, 0x0a, 0x0c, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x75, 0x70, 0x70, 0x6c, - 0x79, 0x12, 0x2f, 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x1b, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, - 0x65, 0x6e, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x04, 0x6d, 0x65, - 0x74, 0x61, 0x22, 0x43, 0x0a, 0x0b, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x47, 0x72, 0x6f, 0x75, 0x70, - 0x73, 0x12, 0x34, 0x0a, 0x06, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x1c, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, - 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, - 0x06, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x22, 0x4a, 0x0a, 0x10, 0x54, 0x6f, 0x6b, 0x65, 0x6e, - 0x4d, 0x65, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x03, 0x6b, - 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe2, 0xdf, 0x1f, 0x02, 0x58, 0x01, - 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x1c, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe2, 0xdf, 0x1f, 0x02, 0x58, 0x01, 0x52, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x22, 0x33, 0x0a, 0x09, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x4d, 0x65, 0x74, 0x61, - 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, - 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x6c, 0x0a, 0x05, 0x54, 0x6f, 0x6b, 0x65, - 0x6e, 0x12, 0x2f, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1b, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, - 0x65, 0x6e, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, - 0x70, 0x65, 0x12, 0x32, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1c, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, - 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, - 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x22, 0x3e, 0x0a, 0x10, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x54, - 0x79, 0x70, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x79, - 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, - 0x6f, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x55, 0x0a, 0x11, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x47, - 0x72, 0x6f, 0x75, 0x70, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, - 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x79, 0x6d, - 0x62, 0x6f, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x02, 0x20, 0x03, - 0x28, 0x09, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x2a, 0x3d, 0x0a, - 0x0e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x54, 0x79, 0x70, 0x65, 0x12, - 0x0c, 0x0a, 0x08, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x41, 0x4c, 0x10, 0x00, 0x12, 0x0c, 0x0a, - 0x08, 0x52, 0x45, 0x51, 0x55, 0x49, 0x52, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0f, 0x0a, 0x0b, 0x4e, - 0x4f, 0x54, 0x5f, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x45, 0x44, 0x10, 0x03, 0x32, 0xa0, 0x0b, 0x0a, - 0x0c, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x54, 0x0a, - 0x09, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, - 0x74, 0x79, 0x1a, 0x18, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, - 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0x15, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x0f, 0x12, 0x0d, 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x12, 0x59, 0x0a, 0x09, 0x53, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x12, 0x18, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, - 0x6b, 0x65, 0x6e, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x1a, 0x18, 0x2e, 0x65, 0x78, 0x74, - 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x22, 0x18, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x12, 0x1a, 0x0d, 0x2f, 0x74, - 0x6f, 0x6b, 0x65, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x3a, 0x01, 0x2a, 0x12, 0x66, - 0x0a, 0x08, 0x47, 0x65, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x19, 0x2e, 0x65, 0x78, 0x74, - 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x54, 0x6f, - 0x6b, 0x65, 0x6e, 0x49, 0x64, 0x1a, 0x17, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, - 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x26, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x12, 0x1e, 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2f, 0x74, - 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x2f, 0x7b, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x7d, 0x2f, 0x7b, - 0x67, 0x72, 0x6f, 0x75, 0x70, 0x7d, 0x12, 0x5a, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x44, 0x65, 0x66, - 0x61, 0x75, 0x6c, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, - 0x79, 0x1a, 0x17, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, - 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x16, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x10, 0x12, 0x0e, 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2f, 0x64, 0x65, 0x66, 0x61, 0x75, - 0x6c, 0x74, 0x12, 0x71, 0x0a, 0x0f, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x6f, 0x6b, 0x65, - 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x28, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, - 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, - 0x6f, 0x6b, 0x65, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x1b, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, - 0x65, 0x6e, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x22, 0x17, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x11, 0x22, 0x0c, 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2f, 0x74, 0x79, 0x70, - 0x65, 0x73, 0x3a, 0x01, 0x2a, 0x12, 0x69, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x54, 0x6f, 0x6b, 0x65, - 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1d, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, - 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x54, 0x79, - 0x70, 0x65, 0x49, 0x64, 0x1a, 0x1b, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x63, 0x6b, 0x69, 0x74, 0x2e, 0x65, 0x78, 0x74, + 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x42, 0x69, + 0x67, 0x49, 0x6e, 0x74, 0x52, 0x0b, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x75, 0x70, 0x70, 0x6c, + 0x79, 0x12, 0x3f, 0x0a, 0x0a, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, + 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x47, 0x72, + 0x6f, 0x75, 0x70, 0x54, 0x79, 0x70, 0x65, 0x52, 0x09, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x54, 0x79, + 0x70, 0x65, 0x12, 0x2f, 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x1b, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, + 0x6b, 0x65, 0x6e, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x04, 0x6d, + 0x65, 0x74, 0x61, 0x22, 0x3f, 0x0a, 0x0a, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x54, 0x79, 0x70, 0x65, + 0x73, 0x12, 0x31, 0x0a, 0x05, 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x1b, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, + 0x6b, 0x65, 0x6e, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x05, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x22, 0x3c, 0x0a, 0x0c, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x47, 0x72, 0x6f, + 0x75, 0x70, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x14, 0x0a, 0x05, + 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x67, 0x72, 0x6f, + 0x75, 0x70, 0x22, 0xc2, 0x01, 0x0a, 0x0a, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x47, 0x72, 0x6f, 0x75, + 0x70, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x72, 0x6f, + 0x75, 0x70, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, + 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x12, 0x41, 0x0a, 0x0c, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x75, 0x70, + 0x70, 0x6c, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x63, 0x6b, 0x69, + 0x74, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, + 0x65, 0x6e, 0x2e, 0x42, 0x69, 0x67, 0x49, 0x6e, 0x74, 0x52, 0x0b, 0x74, 0x6f, 0x74, 0x61, 0x6c, + 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x12, 0x2f, 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x05, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, + 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x4d, 0x65, 0x74, + 0x61, 0x52, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x22, 0x43, 0x0a, 0x0b, 0x54, 0x6f, 0x6b, 0x65, 0x6e, + 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x12, 0x34, 0x0a, 0x06, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, + 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x47, + 0x72, 0x6f, 0x75, 0x70, 0x52, 0x06, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x22, 0x4a, 0x0a, 0x10, + 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x18, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe2, + 0xdf, 0x1f, 0x02, 0x58, 0x01, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x1c, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe2, 0xdf, 0x1f, 0x02, 0x58, + 0x01, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x33, 0x0a, 0x09, 0x54, 0x6f, 0x6b, 0x65, + 0x6e, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x6c, 0x0a, + 0x05, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x2f, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x54, 0x79, 0x70, - 0x65, 0x22, 0x1d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x17, 0x12, 0x15, 0x2f, 0x74, 0x6f, 0x6b, 0x65, - 0x6e, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x7b, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x7d, - 0x12, 0x5c, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x54, 0x79, 0x70, - 0x65, 0x73, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x1c, 0x2e, 0x65, 0x78, 0x74, + 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x32, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, + 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x47, + 0x72, 0x6f, 0x75, 0x70, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x22, 0x3e, 0x0a, 0x10, 0x54, + 0x6f, 0x6b, 0x65, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x12, + 0x16, 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x55, 0x0a, 0x11, 0x54, + 0x6f, 0x6b, 0x65, 0x6e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, + 0x12, 0x16, 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, + 0x70, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x12, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x2a, 0x3d, 0x0a, 0x0e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x47, 0x72, 0x6f, 0x75, 0x70, + 0x54, 0x79, 0x70, 0x65, 0x12, 0x0c, 0x0a, 0x08, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x41, 0x4c, + 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x52, 0x45, 0x51, 0x55, 0x49, 0x52, 0x45, 0x44, 0x10, 0x01, + 0x12, 0x0f, 0x0a, 0x0b, 0x4e, 0x4f, 0x54, 0x5f, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x45, 0x44, 0x10, + 0x03, 0x32, 0xa0, 0x0b, 0x0a, 0x0c, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x12, 0x54, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, + 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x18, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, + 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x22, 0x15, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0f, 0x12, 0x0d, 0x2f, 0x74, 0x6f, 0x6b, 0x65, + 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x59, 0x0a, 0x09, 0x53, 0x65, 0x74, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x18, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, + 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x1a, + 0x18, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, + 0x65, 0x6e, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0x18, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x12, 0x1a, 0x0d, 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x3a, 0x01, 0x2a, 0x12, 0x66, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, + 0x19, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, + 0x65, 0x6e, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x49, 0x64, 0x1a, 0x17, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x54, 0x6f, - 0x6b, 0x65, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x73, 0x22, 0x14, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0e, - 0x12, 0x0c, 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x12, 0x7a, - 0x0a, 0x0f, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x54, 0x79, 0x70, - 0x65, 0x12, 0x28, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, - 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, - 0x54, 0x79, 0x70, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x65, 0x78, - 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x54, - 0x6f, 0x6b, 0x65, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x22, 0x20, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1a, - 0x1a, 0x15, 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x7b, - 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x7d, 0x3a, 0x01, 0x2a, 0x12, 0x6c, 0x0a, 0x0f, 0x44, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1d, 0x2e, - 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, - 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x49, 0x64, 0x1a, 0x1b, 0x2e, 0x65, - 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, - 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x22, 0x1d, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x17, 0x2a, 0x15, 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, - 0x7b, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x7d, 0x12, 0x74, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x54, - 0x6f, 0x6b, 0x65, 0x6e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x12, 0x1d, 0x2e, 0x65, 0x78, 0x74, + 0x6b, 0x65, 0x6e, 0x22, 0x26, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x12, 0x1e, 0x2f, 0x74, 0x6f, + 0x6b, 0x65, 0x6e, 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x2f, 0x7b, 0x73, 0x79, 0x6d, 0x62, + 0x6f, 0x6c, 0x7d, 0x2f, 0x7b, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x7d, 0x12, 0x5a, 0x0a, 0x0f, 0x47, + 0x65, 0x74, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x16, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x17, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, + 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, + 0x16, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x10, 0x12, 0x0e, 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2f, + 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x71, 0x0a, 0x0f, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x28, 0x2e, 0x65, 0x78, 0x74, + 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, + 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x54, 0x79, 0x70, + 0x65, 0x22, 0x17, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x11, 0x22, 0x0c, 0x2f, 0x74, 0x6f, 0x6b, 0x65, + 0x6e, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x3a, 0x01, 0x2a, 0x12, 0x69, 0x0a, 0x0c, 0x47, 0x65, + 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1d, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x54, 0x6f, - 0x6b, 0x65, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x49, 0x64, 0x1a, 0x1d, 0x2e, 0x65, 0x78, 0x74, 0x65, + 0x6b, 0x65, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x49, 0x64, 0x1a, 0x1b, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x54, 0x6f, 0x6b, - 0x65, 0x6e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x22, 0x24, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1e, - 0x12, 0x1c, 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x7b, - 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x7d, 0x2f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x12, 0x84, - 0x01, 0x0a, 0x10, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x47, 0x72, - 0x6f, 0x75, 0x70, 0x12, 0x29, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, - 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x6f, 0x6b, - 0x65, 0x6e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, + 0x65, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x22, 0x1d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x17, 0x12, 0x15, + 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x7b, 0x73, 0x79, + 0x6d, 0x62, 0x6f, 0x6c, 0x7d, 0x12, 0x5c, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x6f, 0x6b, + 0x65, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x73, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, + 0x1c, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, + 0x65, 0x6e, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x73, 0x22, 0x14, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x0e, 0x12, 0x0c, 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2f, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x12, 0x7a, 0x0a, 0x0f, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x6f, 0x6b, + 0x65, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x28, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, + 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x1b, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, + 0x6b, 0x65, 0x6e, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x22, 0x20, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x1a, 0x15, 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2f, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x2f, 0x7b, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x7d, 0x3a, 0x01, 0x2a, 0x12, + 0x6c, 0x0a, 0x0f, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x54, 0x79, + 0x70, 0x65, 0x12, 0x1d, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, + 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x49, + 0x64, 0x1a, 0x1b, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, + 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x22, 0x1d, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x17, 0x2a, 0x15, 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2f, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x2f, 0x7b, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x7d, 0x12, 0x74, 0x0a, + 0x0e, 0x47, 0x65, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x12, + 0x1d, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, + 0x65, 0x6e, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x49, 0x64, 0x1a, 0x1d, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, - 0x6e, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x22, 0x27, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x21, 0x22, 0x1c, 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2f, 0x74, 0x79, 0x70, - 0x65, 0x73, 0x2f, 0x7b, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x7d, 0x2f, 0x67, 0x72, 0x6f, 0x75, - 0x70, 0x73, 0x3a, 0x01, 0x2a, 0x12, 0x7c, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x54, 0x6f, 0x6b, 0x65, - 0x6e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x1e, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, - 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x47, - 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x1a, 0x1c, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, - 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x47, - 0x72, 0x6f, 0x75, 0x70, 0x22, 0x2d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x12, 0x25, 0x2f, 0x74, - 0x6f, 0x6b, 0x65, 0x6e, 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x2f, 0x7b, 0x73, 0x79, 0x6d, - 0x62, 0x6f, 0x6c, 0x7d, 0x2f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x2f, 0x7b, 0x67, 0x72, 0x6f, - 0x75, 0x70, 0x7d, 0x12, 0x7a, 0x0a, 0x10, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x6f, 0x6b, - 0x65, 0x6e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x1e, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, - 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, - 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x1a, 0x17, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, - 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, - 0x22, 0x2d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x2a, 0x25, 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, - 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x2f, 0x7b, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x7d, - 0x2f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x2f, 0x7b, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x7d, 0x42, - 0x34, 0x5a, 0x32, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x79, - 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2d, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x63, - 0x63, 0x6b, 0x69, 0x74, 0x2f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, - 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6e, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x22, 0x24, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x1e, 0x12, 0x1c, 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2f, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x2f, 0x7b, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x7d, 0x2f, 0x67, 0x72, 0x6f, + 0x75, 0x70, 0x73, 0x12, 0x84, 0x01, 0x0a, 0x10, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x6f, + 0x6b, 0x65, 0x6e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x29, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, + 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, + 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x47, 0x72, 0x6f, 0x75, + 0x70, 0x22, 0x27, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x21, 0x22, 0x1c, 0x2f, 0x74, 0x6f, 0x6b, 0x65, + 0x6e, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x7b, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x7d, + 0x2f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x3a, 0x01, 0x2a, 0x12, 0x7c, 0x0a, 0x0d, 0x47, 0x65, + 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x1e, 0x2e, 0x65, 0x78, + 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x54, + 0x6f, 0x6b, 0x65, 0x6e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x1a, 0x1c, 0x2e, 0x65, 0x78, + 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x54, + 0x6f, 0x6b, 0x65, 0x6e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x22, 0x2d, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x27, 0x12, 0x25, 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, + 0x2f, 0x7b, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x7d, 0x2f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, + 0x2f, 0x7b, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x7d, 0x12, 0x7a, 0x0a, 0x10, 0x44, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x1e, 0x2e, 0x65, + 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, + 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x1a, 0x17, 0x2e, 0x65, + 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, + 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x2d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x2a, 0x25, 0x2f, + 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x2f, 0x7b, 0x73, 0x79, + 0x6d, 0x62, 0x6f, 0x6c, 0x7d, 0x2f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x2f, 0x7b, 0x67, 0x72, + 0x6f, 0x75, 0x70, 0x7d, 0x42, 0x34, 0x5a, 0x32, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2d, 0x6c, + 0x61, 0x62, 0x73, 0x2f, 0x63, 0x63, 0x6b, 0x69, 0x74, 0x2f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, + 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( @@ -1344,52 +1354,57 @@ var file_token_token_proto_goTypes = []interface{}{ (*Token)(nil), // 14: extensions.token.Token (*TokenTypeCreated)(nil), // 15: extensions.token.TokenTypeCreated (*TokenGroupCreated)(nil), // 16: extensions.token.TokenGroupCreated - (*emptypb.Empty)(nil), // 17: google.protobuf.Empty + (*BigInt)(nil), // 17: cckit.extensions.token.BigInt + (*emptypb.Empty)(nil), // 18: google.protobuf.Empty } var file_token_token_proto_depIdxs = []int32{ 0, // 0: extensions.token.CreateTokenTypeRequest.group_type:type_name -> extensions.token.TokenGroupType - 12, // 1: extensions.token.CreateTokenTypeRequest.meta:type_name -> extensions.token.TokenMetaRequest - 12, // 2: extensions.token.UpdateTokenTypeRequest.meta:type_name -> extensions.token.TokenMetaRequest - 12, // 3: extensions.token.CreateTokenGroupRequest.meta:type_name -> extensions.token.TokenMetaRequest - 5, // 4: extensions.token.Config.default_token:type_name -> extensions.token.TokenId - 0, // 5: extensions.token.TokenType.group_type:type_name -> extensions.token.TokenGroupType - 13, // 6: extensions.token.TokenType.meta:type_name -> extensions.token.TokenMeta - 7, // 7: extensions.token.TokenTypes.types:type_name -> extensions.token.TokenType - 13, // 8: extensions.token.TokenGroup.meta:type_name -> extensions.token.TokenMeta - 10, // 9: extensions.token.TokenGroups.groups:type_name -> extensions.token.TokenGroup - 7, // 10: extensions.token.Token.type:type_name -> extensions.token.TokenType - 10, // 11: extensions.token.Token.group:type_name -> extensions.token.TokenGroup - 17, // 12: extensions.token.TokenService.GetConfig:input_type -> google.protobuf.Empty - 4, // 13: extensions.token.TokenService.SetConfig:input_type -> extensions.token.Config - 5, // 14: extensions.token.TokenService.GetToken:input_type -> extensions.token.TokenId - 17, // 15: extensions.token.TokenService.GetDefaultToken:input_type -> google.protobuf.Empty - 1, // 16: extensions.token.TokenService.CreateTokenType:input_type -> extensions.token.CreateTokenTypeRequest - 6, // 17: extensions.token.TokenService.GetTokenType:input_type -> extensions.token.TokenTypeId - 17, // 18: extensions.token.TokenService.ListTokenTypes:input_type -> google.protobuf.Empty - 2, // 19: extensions.token.TokenService.UpdateTokenType:input_type -> extensions.token.UpdateTokenTypeRequest - 6, // 20: extensions.token.TokenService.DeleteTokenType:input_type -> extensions.token.TokenTypeId - 6, // 21: extensions.token.TokenService.GetTokenGroups:input_type -> extensions.token.TokenTypeId - 3, // 22: extensions.token.TokenService.CreateTokenGroup:input_type -> extensions.token.CreateTokenGroupRequest - 9, // 23: extensions.token.TokenService.GetTokenGroup:input_type -> extensions.token.TokenGroupId - 9, // 24: extensions.token.TokenService.DeleteTokenGroup:input_type -> extensions.token.TokenGroupId - 4, // 25: extensions.token.TokenService.GetConfig:output_type -> extensions.token.Config - 4, // 26: extensions.token.TokenService.SetConfig:output_type -> extensions.token.Config - 14, // 27: extensions.token.TokenService.GetToken:output_type -> extensions.token.Token - 14, // 28: extensions.token.TokenService.GetDefaultToken:output_type -> extensions.token.Token - 7, // 29: extensions.token.TokenService.CreateTokenType:output_type -> extensions.token.TokenType - 7, // 30: extensions.token.TokenService.GetTokenType:output_type -> extensions.token.TokenType - 8, // 31: extensions.token.TokenService.ListTokenTypes:output_type -> extensions.token.TokenTypes - 7, // 32: extensions.token.TokenService.UpdateTokenType:output_type -> extensions.token.TokenType - 7, // 33: extensions.token.TokenService.DeleteTokenType:output_type -> extensions.token.TokenType - 11, // 34: extensions.token.TokenService.GetTokenGroups:output_type -> extensions.token.TokenGroups - 10, // 35: extensions.token.TokenService.CreateTokenGroup:output_type -> extensions.token.TokenGroup - 10, // 36: extensions.token.TokenService.GetTokenGroup:output_type -> extensions.token.TokenGroup - 14, // 37: extensions.token.TokenService.DeleteTokenGroup:output_type -> extensions.token.Token - 25, // [25:38] is the sub-list for method output_type - 12, // [12:25] is the sub-list for method input_type - 12, // [12:12] is the sub-list for extension type_name - 12, // [12:12] is the sub-list for extension extendee - 0, // [0:12] is the sub-list for field type_name + 17, // 1: extensions.token.CreateTokenTypeRequest.total_supply:type_name -> cckit.extensions.token.BigInt + 12, // 2: extensions.token.CreateTokenTypeRequest.meta:type_name -> extensions.token.TokenMetaRequest + 12, // 3: extensions.token.UpdateTokenTypeRequest.meta:type_name -> extensions.token.TokenMetaRequest + 17, // 4: extensions.token.CreateTokenGroupRequest.total_supply:type_name -> cckit.extensions.token.BigInt + 12, // 5: extensions.token.CreateTokenGroupRequest.meta:type_name -> extensions.token.TokenMetaRequest + 5, // 6: extensions.token.Config.default_token:type_name -> extensions.token.TokenId + 17, // 7: extensions.token.TokenType.total_supply:type_name -> cckit.extensions.token.BigInt + 0, // 8: extensions.token.TokenType.group_type:type_name -> extensions.token.TokenGroupType + 13, // 9: extensions.token.TokenType.meta:type_name -> extensions.token.TokenMeta + 7, // 10: extensions.token.TokenTypes.types:type_name -> extensions.token.TokenType + 17, // 11: extensions.token.TokenGroup.total_supply:type_name -> cckit.extensions.token.BigInt + 13, // 12: extensions.token.TokenGroup.meta:type_name -> extensions.token.TokenMeta + 10, // 13: extensions.token.TokenGroups.groups:type_name -> extensions.token.TokenGroup + 7, // 14: extensions.token.Token.type:type_name -> extensions.token.TokenType + 10, // 15: extensions.token.Token.group:type_name -> extensions.token.TokenGroup + 18, // 16: extensions.token.TokenService.GetConfig:input_type -> google.protobuf.Empty + 4, // 17: extensions.token.TokenService.SetConfig:input_type -> extensions.token.Config + 5, // 18: extensions.token.TokenService.GetToken:input_type -> extensions.token.TokenId + 18, // 19: extensions.token.TokenService.GetDefaultToken:input_type -> google.protobuf.Empty + 1, // 20: extensions.token.TokenService.CreateTokenType:input_type -> extensions.token.CreateTokenTypeRequest + 6, // 21: extensions.token.TokenService.GetTokenType:input_type -> extensions.token.TokenTypeId + 18, // 22: extensions.token.TokenService.ListTokenTypes:input_type -> google.protobuf.Empty + 2, // 23: extensions.token.TokenService.UpdateTokenType:input_type -> extensions.token.UpdateTokenTypeRequest + 6, // 24: extensions.token.TokenService.DeleteTokenType:input_type -> extensions.token.TokenTypeId + 6, // 25: extensions.token.TokenService.GetTokenGroups:input_type -> extensions.token.TokenTypeId + 3, // 26: extensions.token.TokenService.CreateTokenGroup:input_type -> extensions.token.CreateTokenGroupRequest + 9, // 27: extensions.token.TokenService.GetTokenGroup:input_type -> extensions.token.TokenGroupId + 9, // 28: extensions.token.TokenService.DeleteTokenGroup:input_type -> extensions.token.TokenGroupId + 4, // 29: extensions.token.TokenService.GetConfig:output_type -> extensions.token.Config + 4, // 30: extensions.token.TokenService.SetConfig:output_type -> extensions.token.Config + 14, // 31: extensions.token.TokenService.GetToken:output_type -> extensions.token.Token + 14, // 32: extensions.token.TokenService.GetDefaultToken:output_type -> extensions.token.Token + 7, // 33: extensions.token.TokenService.CreateTokenType:output_type -> extensions.token.TokenType + 7, // 34: extensions.token.TokenService.GetTokenType:output_type -> extensions.token.TokenType + 8, // 35: extensions.token.TokenService.ListTokenTypes:output_type -> extensions.token.TokenTypes + 7, // 36: extensions.token.TokenService.UpdateTokenType:output_type -> extensions.token.TokenType + 7, // 37: extensions.token.TokenService.DeleteTokenType:output_type -> extensions.token.TokenType + 11, // 38: extensions.token.TokenService.GetTokenGroups:output_type -> extensions.token.TokenGroups + 10, // 39: extensions.token.TokenService.CreateTokenGroup:output_type -> extensions.token.TokenGroup + 10, // 40: extensions.token.TokenService.GetTokenGroup:output_type -> extensions.token.TokenGroup + 14, // 41: extensions.token.TokenService.DeleteTokenGroup:output_type -> extensions.token.Token + 29, // [29:42] is the sub-list for method output_type + 16, // [16:29] is the sub-list for method input_type + 16, // [16:16] is the sub-list for extension type_name + 16, // [16:16] is the sub-list for extension extendee + 0, // [0:16] is the sub-list for field type_name } func init() { file_token_token_proto_init() } @@ -1397,6 +1412,7 @@ func file_token_token_proto_init() { if File_token_token_proto != nil { return } + file_token_balance_proto_init() if !protoimpl.UnsafeEnabled { file_token_token_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreateTokenTypeRequest); i { diff --git a/extensions/token/token.proto b/extensions/token/token.proto index 11f1416..ed98af9 100644 --- a/extensions/token/token.proto +++ b/extensions/token/token.proto @@ -8,6 +8,7 @@ import "google/api/annotations.proto"; import "google/protobuf/empty.proto"; import "mwitkow/go-proto-validators/validator.proto"; +import "token/balance.proto"; service TokenService { @@ -99,7 +100,7 @@ message CreateTokenTypeRequest { string name = 2 [(validator.field) = {string_not_empty : true}]; uint32 decimals = 3 [(validator.field) = {int_lt: 9}]; // from 0 to 8 TokenGroupType group_type = 4 [(validator.field) = {is_in_enum : true}];; - string total_supply = 5; // big.Int + cckit.extensions.token.BigInt total_supply = 5; // big.Int repeated TokenMetaRequest meta = 6; } @@ -114,7 +115,7 @@ message CreateTokenGroupRequest { string symbol = 1 [(validator.field) = {string_not_empty : true}]; repeated string group = 2 [(validator.field) = {repeated_count_min : 1}]; string name = 3 [(validator.field) = {string_not_empty : true}]; - string total_supply = 4; // big.Int + cckit.extensions.token.BigInt total_supply = 4; // big.Int repeated TokenMetaRequest meta = 5; } @@ -139,7 +140,7 @@ message TokenType { string symbol = 1; string name = 2; uint32 decimals = 3; - string total_supply = 4; + cckit.extensions.token.BigInt total_supply = 4; TokenGroupType group_type = 5; repeated TokenMeta meta = 6; } @@ -158,7 +159,7 @@ message TokenGroup { string symbol = 1; repeated string group = 2; string name = 3; - string total_supply = 4; + cckit.extensions.token.BigInt total_supply = 4; repeated TokenMeta meta = 5; } diff --git a/extensions/token/token.swagger.json b/extensions/token/token.swagger.json index cd38459..5f07768 100644 --- a/extensions/token/token.swagger.json +++ b/extensions/token/token.swagger.json @@ -453,6 +453,14 @@ } } }, + "tokenBigInt": { + "type": "object", + "properties": { + "data": { + "type": "string" + } + } + }, "tokenConfig": { "type": "object", "properties": { @@ -485,7 +493,7 @@ "type": "string" }, "total_supply": { - "type": "string" + "$ref": "#/definitions/tokenBigInt" }, "meta": { "type": "array", @@ -512,7 +520,7 @@ "$ref": "#/definitions/tokenTokenGroupType" }, "total_supply": { - "type": "string" + "$ref": "#/definitions/tokenBigInt" }, "meta": { "type": "array", @@ -549,7 +557,7 @@ "type": "string" }, "total_supply": { - "type": "string" + "$ref": "#/definitions/tokenBigInt" }, "meta": { "type": "array", @@ -630,7 +638,7 @@ "format": "int64" }, "total_supply": { - "type": "string" + "$ref": "#/definitions/tokenBigInt" }, "group_type": { "$ref": "#/definitions/tokenTokenGroupType" diff --git a/extensions/token/token.validator.pb.go b/extensions/token/token.validator.pb.go index 6367dc4..282f715 100644 --- a/extensions/token/token.validator.pb.go +++ b/extensions/token/token.validator.pb.go @@ -31,6 +31,11 @@ func (this *CreateTokenTypeRequest) Validate() error { if _, ok := TokenGroupType_name[int32(this.GroupType)]; !ok { return github_com_mwitkow_go_proto_validators.FieldError("GroupType", fmt.Errorf(`value '%v' must be a valid TokenGroupType field`, this.GroupType)) } + if this.TotalSupply != nil { + if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.TotalSupply); err != nil { + return github_com_mwitkow_go_proto_validators.FieldError("TotalSupply", err) + } + } for _, item := range this.Meta { if item != nil { if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil { @@ -66,6 +71,11 @@ func (this *CreateTokenGroupRequest) Validate() error { if this.Name == "" { return github_com_mwitkow_go_proto_validators.FieldError("Name", fmt.Errorf(`value '%v' must not be an empty string`, this.Name)) } + if this.TotalSupply != nil { + if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.TotalSupply); err != nil { + return github_com_mwitkow_go_proto_validators.FieldError("TotalSupply", err) + } + } for _, item := range this.Meta { if item != nil { if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil { @@ -93,6 +103,11 @@ func (this *TokenTypeId) Validate() error { return nil } func (this *TokenType) Validate() error { + if this.TotalSupply != nil { + if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.TotalSupply); err != nil { + return github_com_mwitkow_go_proto_validators.FieldError("TotalSupply", err) + } + } for _, item := range this.Meta { if item != nil { if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil { @@ -116,6 +131,11 @@ func (this *TokenGroupId) Validate() error { return nil } func (this *TokenGroup) Validate() error { + if this.TotalSupply != nil { + if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.TotalSupply); err != nil { + return github_com_mwitkow_go_proto_validators.FieldError("TotalSupply", err) + } + } for _, item := range this.Meta { if item != nil { if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {