Documentation
¶
Index ¶
- Constants
- Variables
- func Base58Decode(s string) []byte
- func Base58Encode(b []byte) string
- func ChainIsValid(chainID string) bool
- func SeedIsValid(mySeed string) bool
- func SeedToKeyPair(mySeed string, index uint64) *cryptolib.KeyPair
- type Address
- type AgentID
- type ArgMap
- type Arguments
- type ChainID
- type ClientFunc
- type ClientView
- type Color
- type Decoder
- func (c Decoder) ToAddress(bytes []byte) Address
- func (c Decoder) ToAgentID(bytes []byte) AgentID
- func (c Decoder) ToBool(bytes []byte) bool
- func (c Decoder) ToBytes(bytes []byte) []byte
- func (c Decoder) ToChainID(bytes []byte) ChainID
- func (c Decoder) ToColor(bytes []byte) Color
- func (c Decoder) ToHash(bytes []byte) Hash
- func (c Decoder) ToHname(bytes []byte) Hname
- func (c Decoder) ToInt16(bytes []byte) int16
- func (c Decoder) ToInt32(bytes []byte) int32
- func (c Decoder) ToInt64(bytes []byte) int64
- func (c Decoder) ToInt8(bytes []byte) int8
- func (c Decoder) ToRequestID(bytes []byte) RequestID
- func (c Decoder) ToString(bytes []byte) string
- func (c Decoder) ToUint16(bytes []byte) uint16
- func (c Decoder) ToUint32(bytes []byte) uint32
- func (c Decoder) ToUint64(bytes []byte) uint64
- func (c Decoder) ToUint8(bytes []byte) uint8
- type Encoder
- func (c Encoder) FromAddress(value Address) []byte
- func (c Encoder) FromAgentID(value AgentID) []byte
- func (c Encoder) FromBool(value bool) []byte
- func (c Encoder) FromBytes(value []byte) []byte
- func (c Encoder) FromChainID(value ChainID) []byte
- func (c Encoder) FromColor(value Color) []byte
- func (c Encoder) FromHash(value Hash) []byte
- func (c Encoder) FromHname(value Hname) []byte
- func (c Encoder) FromInt16(value int16) []byte
- func (c Encoder) FromInt32(value int32) []byte
- func (c Encoder) FromInt64(value int64) []byte
- func (c Encoder) FromInt8(value int8) []byte
- func (c Encoder) FromRequestID(value RequestID) []byte
- func (c Encoder) FromString(value string) []byte
- func (c Encoder) FromUint16(value uint16) []byte
- func (c Encoder) FromUint32(value uint32) []byte
- func (c Encoder) FromUint64(value uint64) []byte
- func (c Encoder) FromUint8(value uint8) []byte
- type Event
- func (e *Event) Init(message []string)
- func (e *Event) NextAddress() Address
- func (e *Event) NextAgentID() AgentID
- func (e *Event) NextBool() bool
- func (e *Event) NextBytes() []byte
- func (e *Event) NextChainID() ChainID
- func (e *Event) NextColor() Color
- func (e *Event) NextHash() Hash
- func (e *Event) NextHname() Hname
- func (e *Event) NextInt16() int16
- func (e *Event) NextInt32() int32
- func (e *Event) NextInt64() int64
- func (e *Event) NextInt8() int8
- func (e *Event) NextRequestID() RequestID
- func (e *Event) NextString() string
- func (e *Event) NextUint16() uint16
- func (e *Event) NextUint32() uint32
- func (e *Event) NextUint64() uint64
- func (e *Event) NextUint8() uint8
- type Hash
- type Hname
- type IEventHandler
- type Request
- type RequestID
- type ResMap
- type Results
- type Service
- func (s *Service) AsClientFunc() ClientFunc
- func (s *Service) AsClientView() ClientView
- func (s *Service) CallView(viewName string, args ArgMap) (ResMap, error)
- func (s *Service) Init(svcClient *ServiceClient, chainID string, scHname uint32) (err error)
- func (s *Service) PostRequest(hFuncName uint32, args ArgMap, transfer *Transfer, keyPair *cryptolib.KeyPair, ...) Request
- func (s *Service) Register(handler IEventHandler)
- func (s *Service) ServiceContractName(contractName string)
- func (s *Service) SignRequests(keyPair *cryptolib.KeyPair)
- func (s *Service) Unegister(handler IEventHandler)
- func (s *Service) WaitRequest(req Request) error
- type ServiceClient
- type Transfer
Constants ¶
View Source
const ( TYPE_ADDRESS int32 = 1 TYPE_AGENT_ID int32 = 2 TYPE_BOOL int32 = 3 TYPE_BYTES int32 = 4 TYPE_CHAIN_ID int32 = 5 TYPE_COLOR int32 = 6 TYPE_HASH int32 = 7 TYPE_HNAME int32 = 8 TYPE_INT8 int32 = 9 TYPE_INT16 int32 = 10 TYPE_INT32 int32 = 11 TYPE_INT64 int32 = 12 TYPE_MAP int32 = 13 TYPE_REQUEST_ID int32 = 14 TYPE_STRING int32 = 15 COLOR_IOTA = "IOTA" COLOR_IOTA_BASE58 = "11111111111111111111111111111111" )
Variables ¶
View Source
var TypeSizes = [...]uint8{0, 33, 37, 1, 0, 33, 32, 32, 4, 1, 2, 4, 8, 0, 34, 0}
Functions ¶
func Base58Decode ¶
func Base58Encode ¶
func ChainIsValid ¶
func SeedIsValid ¶
Types ¶
type Arguments ¶
type Arguments struct {
Encoder
// contains filtered or unexported fields
}
The Arguments struct is used to gather all arguments for a smart contract function call and encode it into a deterministic byte array
type ClientFunc ¶
type ClientFunc struct {
// contains filtered or unexported fields
}
func (*ClientFunc) OnLedgerRequest ¶
func (f *ClientFunc) OnLedgerRequest(onLedger bool)
OnLedgerRequest can override the default off-ledger to on-ledger posting
func (*ClientFunc) Post ¶
func (f *ClientFunc) Post(hFuncName uint32, args *Arguments) Request
Post sends a request to the smart contract service You can wait for the request to complete by using the returned Request as parameter to Service.WaitRequest()
func (*ClientFunc) Sign ¶
func (f *ClientFunc) Sign(keyPair *cryptolib.KeyPair)
Sign optionally overrides the default keypair from the service
func (*ClientFunc) Transfer ¶
func (f *ClientFunc) Transfer(xfer *Transfer)
Transfer optionally indicates which tokens to transfer as part of the request The tokens are presumed to be available in the signing account on the chain
type ClientView ¶
type ClientView struct {
// contains filtered or unexported fields
}
func (*ClientView) Call ¶
func (v *ClientView) Call(viewName string, args *Arguments)
func (*ClientView) Error ¶
func (v *ClientView) Error() error
func (*ClientView) Results ¶
func (v *ClientView) Results() Results
type Encoder ¶
type Encoder struct{}
func (Encoder) FromAddress ¶
func (Encoder) FromAgentID ¶
func (Encoder) FromChainID ¶
func (Encoder) FromRequestID ¶
func (Encoder) FromString ¶
func (Encoder) FromUint16 ¶
func (Encoder) FromUint32 ¶
func (Encoder) FromUint64 ¶
type Event ¶
type Event struct {
Timestamp uint32
// contains filtered or unexported fields
}
func (*Event) NextAddress ¶
func (*Event) NextAgentID ¶
func (*Event) NextChainID ¶
func (*Event) NextRequestID ¶
func (*Event) NextString ¶
func (*Event) NextUint16 ¶
func (*Event) NextUint32 ¶
func (*Event) NextUint64 ¶
type IEventHandler ¶
type Results ¶
type Results struct {
Decoder
// contains filtered or unexported fields
}
The Results struct contains the results from a smart contract function call
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) AsClientFunc ¶
func (s *Service) AsClientFunc() ClientFunc
func (*Service) AsClientView ¶
func (s *Service) AsClientView() ClientView
func (*Service) Init ¶
func (s *Service) Init(svcClient *ServiceClient, chainID string, scHname uint32) (err error)
func (*Service) PostRequest ¶
func (*Service) Register ¶
func (s *Service) Register(handler IEventHandler)
func (*Service) ServiceContractName ¶
overrides default contract name
func (*Service) SignRequests ¶
func (*Service) Unegister ¶
func (s *Service) Unegister(handler IEventHandler)
func (*Service) WaitRequest ¶
type ServiceClient ¶
type ServiceClient struct {
// contains filtered or unexported fields
}
func DefaultServiceClient ¶
func DefaultServiceClient() *ServiceClient
func NewServiceClient ¶
func NewServiceClient(waspAPI, eventPort string) *ServiceClient
type Transfer ¶
type Transfer struct {
// contains filtered or unexported fields
}
func NewTransfer ¶
func NewTransfer() *Transfer
func TransferIotas ¶
func TransferTokens ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.