pb

package
v0.0.0-...-97e514b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 24, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrNotFound = 404
)

Error codes for quick reference and lookups

Variables

View Source
var MessageCategory_name = map[int32]string{
	0: "LEDGER",
	1: "TRISADS",
	2: "TRISAP2P",
	3: "BLOCKCHAIN",
	4: "ERROR",
}
View Source
var MessageCategory_value = map[string]int32{
	"LEDGER":     0,
	"TRISADS":    1,
	"TRISAP2P":   2,
	"BLOCKCHAIN": 3,
	"ERROR":      4,
}
View Source
var RPC_name = map[int32]string{
	0: "NORPC",
	1: "TRANSFER",
	2: "ACCOUNT",
}
View Source
var RPC_value = map[string]int32{
	"NORPC":    0,
	"TRANSFER": 1,
	"ACCOUNT":  2,
}

Functions

func RegisterTRISADemoServer

func RegisterTRISADemoServer(s *grpc.Server, srv TRISADemoServer)

func RegisterTRISAIntegrationServer

func RegisterTRISAIntegrationServer(s *grpc.Server, srv TRISAIntegrationServer)

Types

type AccountReply

type AccountReply struct {
	Error                *Error         `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"`
	Name                 string         `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Email                string         `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"`
	WalletAddress        string         `protobuf:"bytes,4,opt,name=wallet_address,json=walletAddress,proto3" json:"wallet_address,omitempty"`
	Balance              float32        `protobuf:"fixed32,5,opt,name=balance,proto3" json:"balance,omitempty"`
	Completed            uint64         `protobuf:"varint,6,opt,name=completed,proto3" json:"completed,omitempty"`
	Pending              uint64         `protobuf:"varint,7,opt,name=pending,proto3" json:"pending,omitempty"`
	Transactions         []*Transaction `protobuf:"bytes,8,rep,name=transactions,proto3" json:"transactions,omitempty"`
	XXX_NoUnkeyedLiteral struct{}       `json:"-"`
	XXX_unrecognized     []byte         `json:"-"`
	XXX_sizecache        int32          `json:"-"`
}

Returns the account information and balance as well as transactions ordered from most to least recent. An error is returned if the account cannot be found.

func (*AccountReply) Descriptor

func (*AccountReply) Descriptor() ([]byte, []int)

func (*AccountReply) GetBalance

func (m *AccountReply) GetBalance() float32

func (*AccountReply) GetCompleted

func (m *AccountReply) GetCompleted() uint64

func (*AccountReply) GetEmail

func (m *AccountReply) GetEmail() string

func (*AccountReply) GetError

func (m *AccountReply) GetError() *Error

func (*AccountReply) GetName

func (m *AccountReply) GetName() string

func (*AccountReply) GetPending

func (m *AccountReply) GetPending() uint64

func (*AccountReply) GetTransactions

func (m *AccountReply) GetTransactions() []*Transaction

func (*AccountReply) GetWalletAddress

func (m *AccountReply) GetWalletAddress() string

func (*AccountReply) ProtoMessage

func (*AccountReply) ProtoMessage()

func (*AccountReply) Reset

func (m *AccountReply) Reset()

func (*AccountReply) String

func (m *AccountReply) String() string

func (*AccountReply) XXX_DiscardUnknown

func (m *AccountReply) XXX_DiscardUnknown()

func (*AccountReply) XXX_Marshal

func (m *AccountReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*AccountReply) XXX_Merge

func (m *AccountReply) XXX_Merge(src proto.Message)

func (*AccountReply) XXX_Size

func (m *AccountReply) XXX_Size() int

func (*AccountReply) XXX_Unmarshal

func (m *AccountReply) XXX_Unmarshal(b []byte) error

type AccountRequest

type AccountRequest struct {
	Account              string   `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"`
	NoTransactions       bool     `protobuf:"varint,2,opt,name=no_transactions,json=noTransactions,proto3" json:"no_transactions,omitempty"`
	Page                 uint32   `protobuf:"varint,3,opt,name=page,proto3" json:"page,omitempty"`
	PerPage              uint32   `protobuf:"varint,4,opt,name=per_page,json=perPage,proto3" json:"per_page,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Account request is used to fetch the status information of the account as well as all the transactions associated with the account (unless otherwise requested). TODO: implement transaction pagination.

func (*AccountRequest) Descriptor

func (*AccountRequest) Descriptor() ([]byte, []int)

func (*AccountRequest) GetAccount

func (m *AccountRequest) GetAccount() string

func (*AccountRequest) GetNoTransactions

func (m *AccountRequest) GetNoTransactions() bool

func (*AccountRequest) GetPage

func (m *AccountRequest) GetPage() uint32

func (*AccountRequest) GetPerPage

func (m *AccountRequest) GetPerPage() uint32

func (*AccountRequest) ProtoMessage

func (*AccountRequest) ProtoMessage()

func (*AccountRequest) Reset

func (m *AccountRequest) Reset()

func (*AccountRequest) String

func (m *AccountRequest) String() string

func (*AccountRequest) XXX_DiscardUnknown

func (m *AccountRequest) XXX_DiscardUnknown()

func (*AccountRequest) XXX_Marshal

func (m *AccountRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*AccountRequest) XXX_Merge

func (m *AccountRequest) XXX_Merge(src proto.Message)

func (*AccountRequest) XXX_Size

func (m *AccountRequest) XXX_Size() int

func (*AccountRequest) XXX_Unmarshal

func (m *AccountRequest) XXX_Unmarshal(b []byte) error

type Command

type Command struct {
	Type   RPC    `protobuf:"varint,1,opt,name=type,proto3,enum=pb.RPC" json:"type,omitempty"`
	Id     uint64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"`
	Client string `protobuf:"bytes,3,opt,name=client,proto3" json:"client,omitempty"`
	// only one of these fields can be set, and the field that is set should
	// match the RPC type described above.
	//
	// Types that are valid to be assigned to Request:
	//	*Command_Transfer
	//	*Command_Account
	Request              isCommand_Request `protobuf_oneof:"request"`
	XXX_NoUnkeyedLiteral struct{}          `json:"-"`
	XXX_unrecognized     []byte            `json:"-"`
	XXX_sizecache        int32             `json:"-"`
}

A wrapper for the TransferRequet and AccountRequest RPCs to be sent via streaming.

func (*Command) Descriptor

func (*Command) Descriptor() ([]byte, []int)

func (*Command) GetAccount

func (m *Command) GetAccount() *AccountRequest

func (*Command) GetClient

func (m *Command) GetClient() string

func (*Command) GetId

func (m *Command) GetId() uint64

func (*Command) GetRequest

func (m *Command) GetRequest() isCommand_Request

func (*Command) GetTransfer

func (m *Command) GetTransfer() *TransferRequest

func (*Command) GetType

func (m *Command) GetType() RPC

func (*Command) ProtoMessage

func (*Command) ProtoMessage()

func (*Command) Reset

func (m *Command) Reset()

func (*Command) String

func (m *Command) String() string

func (*Command) XXX_DiscardUnknown

func (m *Command) XXX_DiscardUnknown()

func (*Command) XXX_Marshal

func (m *Command) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Command) XXX_Merge

func (m *Command) XXX_Merge(src proto.Message)

func (*Command) XXX_OneofFuncs

func (*Command) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{})

XXX_OneofFuncs is for the internal use of the proto package.

func (*Command) XXX_Size

func (m *Command) XXX_Size() int

func (*Command) XXX_Unmarshal

func (m *Command) XXX_Unmarshal(b []byte) error

type Command_Account

type Command_Account struct {
	Account *AccountRequest `protobuf:"bytes,12,opt,name=account,proto3,oneof"`
}

type Command_Transfer

type Command_Transfer struct {
	Transfer *TransferRequest `protobuf:"bytes,11,opt,name=transfer,proto3,oneof"`
}

type Error

type Error struct {
	Code                 int32    `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`
	Message              string   `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Allows for standardized error handling for demo purposes.

func Errorf

func Errorf(code int32, format string, a ...interface{}) *Error

Errorf is a quick one liner to create error objects

func (*Error) Descriptor

func (*Error) Descriptor() ([]byte, []int)

func (*Error) Error

func (e *Error) Error() string

Error allows protocol buffer Error objects to implement the error interface.

func (*Error) GetCode

func (m *Error) GetCode() int32

func (*Error) GetMessage

func (m *Error) GetMessage() string

func (*Error) ProtoMessage

func (*Error) ProtoMessage()

func (*Error) Reset

func (m *Error) Reset()

func (*Error) String

func (m *Error) String() string

func (*Error) XXX_DiscardUnknown

func (m *Error) XXX_DiscardUnknown()

func (*Error) XXX_Marshal

func (m *Error) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Error) XXX_Merge

func (m *Error) XXX_Merge(src proto.Message)

func (*Error) XXX_Size

func (m *Error) XXX_Size() int

func (*Error) XXX_Unmarshal

func (m *Error) XXX_Unmarshal(b []byte) error

type Identity

type Identity struct {
	WalletAddress        string   `protobuf:"bytes,1,opt,name=wallet_address,json=walletAddress,proto3" json:"wallet_address,omitempty"`
	Email                string   `protobuf:"bytes,2,opt,name=email,proto3" json:"email,omitempty"`
	Ivms101              string   `protobuf:"bytes,3,opt,name=ivms101,proto3" json:"ivms101,omitempty"`
	Provider             string   `protobuf:"bytes,4,opt,name=provider,proto3" json:"provider,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Identity maps a wallet address, email, and VASP provider and is used to store originator and beneficiary data as well as the KYC information that is collected during the TRISA protocol exchange in JSON format.

func (*Identity) Descriptor

func (*Identity) Descriptor() ([]byte, []int)

func (*Identity) GetEmail

func (m *Identity) GetEmail() string

func (*Identity) GetIvms101

func (m *Identity) GetIvms101() string

func (*Identity) GetProvider

func (m *Identity) GetProvider() string

func (*Identity) GetWalletAddress

func (m *Identity) GetWalletAddress() string

func (*Identity) ProtoMessage

func (*Identity) ProtoMessage()

func (*Identity) Reset

func (m *Identity) Reset()

func (*Identity) String

func (m *Identity) String() string

func (*Identity) XXX_DiscardUnknown

func (m *Identity) XXX_DiscardUnknown()

func (*Identity) XXX_Marshal

func (m *Identity) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Identity) XXX_Merge

func (m *Identity) XXX_Merge(src proto.Message)

func (*Identity) XXX_Size

func (m *Identity) XXX_Size() int

func (*Identity) XXX_Unmarshal

func (m *Identity) XXX_Unmarshal(b []byte) error

type Message

type Message struct {
	Type      RPC             `protobuf:"varint,1,opt,name=type,proto3,enum=pb.RPC" json:"type,omitempty"`
	Id        uint64          `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"`
	Update    string          `protobuf:"bytes,3,opt,name=update,proto3" json:"update,omitempty"`
	Timestamp string          `protobuf:"bytes,4,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	Category  MessageCategory `protobuf:"varint,5,opt,name=category,proto3,enum=pb.MessageCategory" json:"category,omitempty"`
	// if type and id are greater than zero, one of these fields will be set, matching
	// the RPC type described above.
	//
	// Types that are valid to be assigned to Reply:
	//	*Message_Transfer
	//	*Message_Account
	Reply                isMessage_Reply `protobuf_oneof:"reply"`
	XXX_NoUnkeyedLiteral struct{}        `json:"-"`
	XXX_unrecognized     []byte          `json:"-"`
	XXX_sizecache        int32           `json:"-"`
}

Message is either a wrapper for a TransferReply or AccountReply RPCs or it is a live update message sent from the rVASP to show the communication interactions of the InterVASP protocol. If it is a wrapper, then type will be > 0 and the ID will match the id of the command request sent by the client. Otherwise both of these fields will be zero and the update string will be populated.

func (*Message) Descriptor

func (*Message) Descriptor() ([]byte, []int)

func (*Message) GetAccount

func (m *Message) GetAccount() *AccountReply

func (*Message) GetCategory

func (m *Message) GetCategory() MessageCategory

func (*Message) GetId

func (m *Message) GetId() uint64

func (*Message) GetReply

func (m *Message) GetReply() isMessage_Reply

func (*Message) GetTimestamp

func (m *Message) GetTimestamp() string

func (*Message) GetTransfer

func (m *Message) GetTransfer() *TransferReply

func (*Message) GetType

func (m *Message) GetType() RPC

func (*Message) GetUpdate

func (m *Message) GetUpdate() string

func (*Message) ProtoMessage

func (*Message) ProtoMessage()

func (*Message) Reset

func (m *Message) Reset()

func (*Message) String

func (m *Message) String() string

func (*Message) XXX_DiscardUnknown

func (m *Message) XXX_DiscardUnknown()

func (*Message) XXX_Marshal

func (m *Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Message) XXX_Merge

func (m *Message) XXX_Merge(src proto.Message)

func (*Message) XXX_OneofFuncs

func (*Message) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{})

XXX_OneofFuncs is for the internal use of the proto package.

func (*Message) XXX_Size

func (m *Message) XXX_Size() int

func (*Message) XXX_Unmarshal

func (m *Message) XXX_Unmarshal(b []byte) error

type MessageCategory

type MessageCategory int32

Specifies the category the message is related to for rVASP UI colorization

const (
	MessageCategory_LEDGER     MessageCategory = 0
	MessageCategory_TRISADS    MessageCategory = 1
	MessageCategory_TRISAP2P   MessageCategory = 2
	MessageCategory_BLOCKCHAIN MessageCategory = 3
	MessageCategory_ERROR      MessageCategory = 4
)

func (MessageCategory) EnumDescriptor

func (MessageCategory) EnumDescriptor() ([]byte, []int)

func (MessageCategory) String

func (x MessageCategory) String() string

type Message_Account

type Message_Account struct {
	Account *AccountReply `protobuf:"bytes,12,opt,name=account,proto3,oneof"`
}

type Message_Transfer

type Message_Transfer struct {
	Transfer *TransferReply `protobuf:"bytes,11,opt,name=transfer,proto3,oneof"`
}

type RPC

type RPC int32

Specifies the RPC the command is wrapping in the bidirectional stream.

const (
	RPC_NORPC    RPC = 0
	RPC_TRANSFER RPC = 1
	RPC_ACCOUNT  RPC = 2
)

func (RPC) EnumDescriptor

func (RPC) EnumDescriptor() ([]byte, []int)

func (RPC) String

func (x RPC) String() string

type TRISADemoClient

type TRISADemoClient interface {
	LiveUpdates(ctx context.Context, opts ...grpc.CallOption) (TRISADemo_LiveUpdatesClient, error)
}

TRISADemoClient is the client API for TRISADemo service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewTRISADemoClient

func NewTRISADemoClient(cc *grpc.ClientConn) TRISADemoClient

type TRISADemoServer

type TRISADemoServer interface {
	LiveUpdates(TRISADemo_LiveUpdatesServer) error
}

TRISADemoServer is the server API for TRISADemo service.

type TRISADemo_LiveUpdatesClient

type TRISADemo_LiveUpdatesClient interface {
	Send(*Command) error
	Recv() (*Message, error)
	grpc.ClientStream
}

type TRISADemo_LiveUpdatesServer

type TRISADemo_LiveUpdatesServer interface {
	Send(*Message) error
	Recv() (*Command, error)
	grpc.ServerStream
}

type TRISAIntegrationClient

type TRISAIntegrationClient interface {
	Transfer(ctx context.Context, in *TransferRequest, opts ...grpc.CallOption) (*TransferReply, error)
	AccountStatus(ctx context.Context, in *AccountRequest, opts ...grpc.CallOption) (*AccountReply, error)
}

TRISAIntegrationClient is the client API for TRISAIntegration service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewTRISAIntegrationClient

func NewTRISAIntegrationClient(cc *grpc.ClientConn) TRISAIntegrationClient

type TRISAIntegrationServer

type TRISAIntegrationServer interface {
	Transfer(context.Context, *TransferRequest) (*TransferReply, error)
	AccountStatus(context.Context, *AccountRequest) (*AccountReply, error)
}

TRISAIntegrationServer is the server API for TRISAIntegration service.

type Transaction

type Transaction struct {
	Account              string    `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"`
	Originator           *Identity `protobuf:"bytes,2,opt,name=originator,proto3" json:"originator,omitempty"`
	Beneficiary          *Identity `protobuf:"bytes,3,opt,name=beneficiary,proto3" json:"beneficiary,omitempty"`
	Amount               float32   `protobuf:"fixed32,4,opt,name=amount,proto3" json:"amount,omitempty"`
	Debit                bool      `protobuf:"varint,5,opt,name=debit,proto3" json:"debit,omitempty"`
	Completed            bool      `protobuf:"varint,6,opt,name=completed,proto3" json:"completed,omitempty"`
	Timestamp            string    `protobuf:"bytes,7,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	XXX_NoUnkeyedLiteral struct{}  `json:"-"`
	XXX_unrecognized     []byte    `json:"-"`
	XXX_sizecache        int32     `json:"-"`
}

Describes a simple transaction between an originator and beneficiary and includes identity information that was exchanged during the TRISA protocol.

func (*Transaction) Descriptor

func (*Transaction) Descriptor() ([]byte, []int)

func (*Transaction) GetAccount

func (m *Transaction) GetAccount() string

func (*Transaction) GetAmount

func (m *Transaction) GetAmount() float32

func (*Transaction) GetBeneficiary

func (m *Transaction) GetBeneficiary() *Identity

func (*Transaction) GetCompleted

func (m *Transaction) GetCompleted() bool

func (*Transaction) GetDebit

func (m *Transaction) GetDebit() bool

func (*Transaction) GetOriginator

func (m *Transaction) GetOriginator() *Identity

func (*Transaction) GetTimestamp

func (m *Transaction) GetTimestamp() string

func (*Transaction) ProtoMessage

func (*Transaction) ProtoMessage()

func (*Transaction) Reset

func (m *Transaction) Reset()

func (*Transaction) String

func (m *Transaction) String() string

func (*Transaction) XXX_DiscardUnknown

func (m *Transaction) XXX_DiscardUnknown()

func (*Transaction) XXX_Marshal

func (m *Transaction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Transaction) XXX_Merge

func (m *Transaction) XXX_Merge(src proto.Message)

func (*Transaction) XXX_Size

func (m *Transaction) XXX_Size() int

func (*Transaction) XXX_Unmarshal

func (m *Transaction) XXX_Unmarshal(b []byte) error

type TransferReply

type TransferReply struct {
	Error                *Error       `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"`
	Transaction          *Transaction `protobuf:"bytes,2,opt,name=transaction,proto3" json:"transaction,omitempty"`
	XXX_NoUnkeyedLiteral struct{}     `json:"-"`
	XXX_unrecognized     []byte       `json:"-"`
	XXX_sizecache        int32        `json:"-"`
}

The transfer reply will contain the details of the transaction initiated or completed or an error if there are insufficient funds or the account or beneficiary could not be looked up. Errors encountered during the TRISA protocol may also be returned.

func (*TransferReply) Descriptor

func (*TransferReply) Descriptor() ([]byte, []int)

func (*TransferReply) GetError

func (m *TransferReply) GetError() *Error

func (*TransferReply) GetTransaction

func (m *TransferReply) GetTransaction() *Transaction

func (*TransferReply) ProtoMessage

func (*TransferReply) ProtoMessage()

func (*TransferReply) Reset

func (m *TransferReply) Reset()

func (*TransferReply) String

func (m *TransferReply) String() string

func (*TransferReply) XXX_DiscardUnknown

func (m *TransferReply) XXX_DiscardUnknown()

func (*TransferReply) XXX_Marshal

func (m *TransferReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TransferReply) XXX_Merge

func (m *TransferReply) XXX_Merge(src proto.Message)

func (*TransferReply) XXX_Size

func (m *TransferReply) XXX_Size() int

func (*TransferReply) XXX_Unmarshal

func (m *TransferReply) XXX_Unmarshal(b []byte) error

type TransferRequest

type TransferRequest struct {
	Account              string   `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"`
	Beneficiary          string   `protobuf:"bytes,2,opt,name=beneficiary,proto3" json:"beneficiary,omitempty"`
	Amount               float32  `protobuf:"fixed32,3,opt,name=amount,proto3" json:"amount,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Initiates a transfer from the specified account to the specified wallet address or email address for a known wallet at some other rVASP.

func (*TransferRequest) Descriptor

func (*TransferRequest) Descriptor() ([]byte, []int)

func (*TransferRequest) GetAccount

func (m *TransferRequest) GetAccount() string

func (*TransferRequest) GetAmount

func (m *TransferRequest) GetAmount() float32

func (*TransferRequest) GetBeneficiary

func (m *TransferRequest) GetBeneficiary() string

func (*TransferRequest) ProtoMessage

func (*TransferRequest) ProtoMessage()

func (*TransferRequest) Reset

func (m *TransferRequest) Reset()

func (*TransferRequest) String

func (m *TransferRequest) String() string

func (*TransferRequest) XXX_DiscardUnknown

func (m *TransferRequest) XXX_DiscardUnknown()

func (*TransferRequest) XXX_Marshal

func (m *TransferRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TransferRequest) XXX_Merge

func (m *TransferRequest) XXX_Merge(src proto.Message)

func (*TransferRequest) XXX_Size

func (m *TransferRequest) XXX_Size() int

func (*TransferRequest) XXX_Unmarshal

func (m *TransferRequest) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL