types

package
v0.0.0-...-0eddcd5 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

README

Whaletrace b2b client - golang

Client examples

You can eventually transpile proto file to *.go file with protoc -I .. -I $GOPATH/src --go_out=plugins=grpc:./ ../types.proto

This will generate transpiled file into current directory. To adhere golang conventions and also to make these examples work, compiler should be able to find this file. Otherwise put it into your GOPATH directory ($GOPATH/src/types) and then just import it like import types.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_types_proto protoreflect.FileDescriptor

Functions

func RegisterTransactionServerServer

func RegisterTransactionServerServer(s *grpc.Server, srv TransactionServerServer)

Types

type CryptoSubscribeRequest

type CryptoSubscribeRequest struct {
	Type      string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` //Asset name (example:BTC,ETH,USDT)
	X         string `protobuf:"bytes,2,opt,name=_,proto3" json:"_,omitempty"`
	SizeLimit int64  `protobuf:"varint,5,opt,name=sizeLimit,proto3" json:"sizeLimit,omitempty"` //lower USD size limit of the returned transactions (min and default according membership)
	// contains filtered or unexported fields
}

* Represents data of request for crypto transactions of some type(Asset) with no additional filters

func (*CryptoSubscribeRequest) Descriptor deprecated

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

Deprecated: Use CryptoSubscribeRequest.ProtoReflect.Descriptor instead.

func (*CryptoSubscribeRequest) GetSizeLimit

func (x *CryptoSubscribeRequest) GetSizeLimit() int64

func (*CryptoSubscribeRequest) GetType

func (x *CryptoSubscribeRequest) GetType() string

func (*CryptoSubscribeRequest) GetX

func (x *CryptoSubscribeRequest) GetX() string

func (*CryptoSubscribeRequest) ProtoMessage

func (*CryptoSubscribeRequest) ProtoMessage()

func (*CryptoSubscribeRequest) ProtoReflect

func (x *CryptoSubscribeRequest) ProtoReflect() protoreflect.Message

func (*CryptoSubscribeRequest) Reset

func (x *CryptoSubscribeRequest) Reset()

func (*CryptoSubscribeRequest) String

func (x *CryptoSubscribeRequest) String() string

type CryptoTransactionRequest

type CryptoTransactionRequest struct {
	Type      string               `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`            //Asset name (example:BTC,ETH,USDT)
	From      *timestamp.Timestamp `protobuf:"bytes,2,opt,name=from,proto3" json:"from,omitempty"`            // Start of the time-frame in which the interested transactions occured
	To        *timestamp.Timestamp `protobuf:"bytes,3,opt,name=to,proto3" json:"to,omitempty"`                // End of the time-frame in which the interested transactions occured
	Count     int64                `protobuf:"varint,4,opt,name=count,proto3" json:"count,omitempty"`         //Number of transaction that should be returned (max 100, default 50 )
	SizeLimit int64                `protobuf:"varint,5,opt,name=sizeLimit,proto3" json:"sizeLimit,omitempty"` //lower USD size limit of the returned transactions (min and default according membership)
	// contains filtered or unexported fields
}

* Represents data of request for crypto transactions of some type(Asset) with additional filters

func (*CryptoTransactionRequest) Descriptor deprecated

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

Deprecated: Use CryptoTransactionRequest.ProtoReflect.Descriptor instead.

func (*CryptoTransactionRequest) GetCount

func (x *CryptoTransactionRequest) GetCount() int64

func (*CryptoTransactionRequest) GetFrom

func (*CryptoTransactionRequest) GetSizeLimit

func (x *CryptoTransactionRequest) GetSizeLimit() int64

func (*CryptoTransactionRequest) GetTo

func (*CryptoTransactionRequest) GetType

func (x *CryptoTransactionRequest) GetType() string

func (*CryptoTransactionRequest) ProtoMessage

func (*CryptoTransactionRequest) ProtoMessage()

func (*CryptoTransactionRequest) ProtoReflect

func (x *CryptoTransactionRequest) ProtoReflect() protoreflect.Message

func (*CryptoTransactionRequest) Reset

func (x *CryptoTransactionRequest) Reset()

func (*CryptoTransactionRequest) String

func (x *CryptoTransactionRequest) String() string

type Entity

type Entity struct {
	Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` //Address of the entity in the form of an hash
	Name    string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`       //Name of the entity or Wallet in case of unknown entity
	Type    string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"`       //Type of the entity (example: wallet,exchange,gambling)
	Url     string `protobuf:"bytes,4,opt,name=url,proto3" json:"url,omitempty"`         //(optional) url of the entity webpage
	// contains filtered or unexported fields
}

* Represents additional information about an entity thet receved/sent transaction

func (*Entity) Descriptor deprecated

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

Deprecated: Use Entity.ProtoReflect.Descriptor instead.

func (*Entity) GetAddress

func (x *Entity) GetAddress() string

func (*Entity) GetName

func (x *Entity) GetName() string

func (*Entity) GetType

func (x *Entity) GetType() string

func (*Entity) GetUrl

func (x *Entity) GetUrl() string

func (*Entity) ProtoMessage

func (*Entity) ProtoMessage()

func (*Entity) ProtoReflect

func (x *Entity) ProtoReflect() protoreflect.Message

func (*Entity) Reset

func (x *Entity) Reset()

func (*Entity) String

func (x *Entity) String() string

type Token

type Token struct {
	Name   string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`     //Name of the token (example: HuobiToken)
	Chain  string `protobuf:"bytes,2,opt,name=chain,proto3" json:"chain,omitempty"`   //Blockchain, on which the token has been tracker (example:ETH for ethereum blockchain)
	Symbol string `protobuf:"bytes,3,opt,name=symbol,proto3" json:"symbol,omitempty"` //Symbol used for the token on the blockchain (example: HT)
	Action string `protobuf:"bytes,4,opt,name=action,proto3" json:"action,omitempty"` //Action that has taken place, since with contracts we can track multiple actions (transfer|issue|redeem)
	// contains filtered or unexported fields
}

* Extends basic transaction data with information about token transaction

func (*Token) Descriptor deprecated

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

Deprecated: Use Token.ProtoReflect.Descriptor instead.

func (*Token) GetAction

func (x *Token) GetAction() string

func (*Token) GetChain

func (x *Token) GetChain() string

func (*Token) GetName

func (x *Token) GetName() string

func (*Token) GetSymbol

func (x *Token) GetSymbol() string

func (*Token) ProtoMessage

func (*Token) ProtoMessage()

func (*Token) ProtoReflect

func (x *Token) ProtoReflect() protoreflect.Message

func (*Token) Reset

func (x *Token) Reset()

func (*Token) String

func (x *Token) String() string

type Transaction

type Transaction struct {
	Hash    string               `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"`                         //ID(in a form of hash) of the trancasction, that can be used to look up the transaction
	From    *Entity              `protobuf:"bytes,3,opt,name=from,proto3" json:"from,omitempty"`                         // Sender information (empty in cas of issue token action)
	To      *Entity              `protobuf:"bytes,4,opt,name=to,proto3" json:"to,omitempty"`                             // Receiver information (empty in cas of redeem token action)
	Id      int32                `protobuf:"varint,5,opt,name=id,proto3" json:"id,omitempty"`                            //for unique trx identification
	Time    *timestamp.Timestamp `protobuf:"bytes,7,opt,name=time,proto3" json:"time,omitempty"`                         // Time of the acceptance of the transaction into the blockchain
	Asset   string               `protobuf:"bytes,9,opt,name=asset,proto3" json:"asset,omitempty"`                       // Asset of the transaction (example:BTC,ETH,USDT)
	Size    float64              `protobuf:"fixed64,10,opt,name=size,proto3" json:"size,omitempty"`                      //Size(value) of the transaction in its native asset
	USDSize float64              `protobuf:"fixed64,11,opt,name=USD_size,json=USDSize,proto3" json:"USD_size,omitempty"` //Size(value) of the transaction is USD
	Token   *Token               `protobuf:"bytes,12,opt,name=token,proto3" json:"token,omitempty"`                      // Additional info about the transaction in case it was contract execution
	// contains filtered or unexported fields
}

* Represents information about a transaction that occured

func (*Transaction) Descriptor deprecated

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

Deprecated: Use Transaction.ProtoReflect.Descriptor instead.

func (*Transaction) GetAsset

func (x *Transaction) GetAsset() string

func (*Transaction) GetFrom

func (x *Transaction) GetFrom() *Entity

func (*Transaction) GetHash

func (x *Transaction) GetHash() string

func (*Transaction) GetId

func (x *Transaction) GetId() int32

func (*Transaction) GetSize

func (x *Transaction) GetSize() float64

func (*Transaction) GetTime

func (x *Transaction) GetTime() *timestamp.Timestamp

func (*Transaction) GetTo

func (x *Transaction) GetTo() *Entity

func (*Transaction) GetToken

func (x *Transaction) GetToken() *Token

func (*Transaction) GetUSDSize

func (x *Transaction) GetUSDSize() float64

func (*Transaction) ProtoMessage

func (*Transaction) ProtoMessage()

func (*Transaction) ProtoReflect

func (x *Transaction) ProtoReflect() protoreflect.Message

func (*Transaction) Reset

func (x *Transaction) Reset()

func (*Transaction) String

func (x *Transaction) String() string

type TransactionServerClient

type TransactionServerClient interface {
	// Obtain top transaction from given time-frame of given asset as an rpc stream
	TopTransactions(ctx context.Context, in *CryptoTransactionRequest, opts ...grpc.CallOption) (TransactionServer_TopTransactionsClient, error)
	// Obtain historic transactions from given time-frame of given asset as an array
	HistoricTransactions(ctx context.Context, in *CryptoTransactionRequest, opts ...grpc.CallOption) (TransactionServer_HistoricTransactionsClient, error)
	//subscribe to the newest transactions of given asset
	SubscribeTransactions(ctx context.Context, in *CryptoSubscribeRequest, opts ...grpc.CallOption) (TransactionServer_SubscribeTransactionsClient, error)
}

TransactionServerClient is the client API for TransactionServer service.

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

type TransactionServerServer

type TransactionServerServer interface {
	// Obtain top transaction from given time-frame of given asset as an rpc stream
	TopTransactions(*CryptoTransactionRequest, TransactionServer_TopTransactionsServer) error
	// Obtain historic transactions from given time-frame of given asset as an array
	HistoricTransactions(*CryptoTransactionRequest, TransactionServer_HistoricTransactionsServer) error
	//subscribe to the newest transactions of given asset
	SubscribeTransactions(*CryptoSubscribeRequest, TransactionServer_SubscribeTransactionsServer) error
}

TransactionServerServer is the server API for TransactionServer service.

type TransactionServer_HistoricTransactionsClient

type TransactionServer_HistoricTransactionsClient interface {
	Recv() (*Transaction, error)
	grpc.ClientStream
}

type TransactionServer_HistoricTransactionsServer

type TransactionServer_HistoricTransactionsServer interface {
	Send(*Transaction) error
	grpc.ServerStream
}

type TransactionServer_SubscribeTransactionsClient

type TransactionServer_SubscribeTransactionsClient interface {
	Recv() (*Transaction, error)
	grpc.ClientStream
}

type TransactionServer_SubscribeTransactionsServer

type TransactionServer_SubscribeTransactionsServer interface {
	Send(*Transaction) error
	grpc.ServerStream
}

type TransactionServer_TopTransactionsClient

type TransactionServer_TopTransactionsClient interface {
	Recv() (*Transaction, error)
	grpc.ClientStream
}

type TransactionServer_TopTransactionsServer

type TransactionServer_TopTransactionsServer interface {
	Send(*Transaction) error
	grpc.ServerStream
}

type UnimplementedTransactionServerServer

type UnimplementedTransactionServerServer struct {
}

UnimplementedTransactionServerServer can be embedded to have forward compatible implementations.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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