client

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2020 License: Apache-2.0, BSD-2-Clause Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OBJTYPE_BYTES        int32 = 0
	OBJTYPE_BYTES_ARRAY  int32 = 1
	OBJTYPE_INT          int32 = 2
	OBJTYPE_INT_ARRAY    int32 = 3
	OBJTYPE_MAP          int32 = 4
	OBJTYPE_MAP_ARRAY    int32 = 5
	OBJTYPE_STRING       int32 = 6
	OBJTYPE_STRING_ARRAY int32 = 7
)

Variables

This section is empty.

Functions

func GetBytes

func GetBytes(objId int32, keyId int32) []byte

func GetInt

func GetInt(objId int32, keyId int32) int64

func GetKeyId

func GetKeyId(key string) int32

func GetObjectId

func GetObjectId(objId int32, keyId int32, typeId int32) int32

func GetString

func GetString(objId int32, keyId int32) string

func KeyLength

func KeyLength() int32

func KeyLog

func KeyLog() int32

func KeyTrace

func KeyTrace() int32

func SetBytes

func SetBytes(objId int32, keyId int32, value []byte)

func SetInt

func SetInt(objId int32, keyId int32, value int64)

func SetString

func SetString(objId int32, keyId int32, value string)

Types

type BytesDecoder

type BytesDecoder struct {
	// contains filtered or unexported fields
}

func NewBytesDecoder

func NewBytesDecoder(data []byte) *BytesDecoder

func (*BytesDecoder) Bytes

func (d *BytesDecoder) Bytes() []byte

func (*BytesDecoder) Int

func (d *BytesDecoder) Int() int64

func (*BytesDecoder) String

func (d *BytesDecoder) String() string

type BytesEncoder

type BytesEncoder struct {
	// contains filtered or unexported fields
}

func NewBytesEncoder

func NewBytesEncoder() *BytesEncoder

func (*BytesEncoder) Bytes

func (e *BytesEncoder) Bytes(value []byte) *BytesEncoder

func (*BytesEncoder) Data

func (e *BytesEncoder) Data() []byte

func (*BytesEncoder) Int

func (e *BytesEncoder) Int(value int64) *BytesEncoder

func (*BytesEncoder) String

func (e *BytesEncoder) String(value string) *BytesEncoder

type ScAccount

type ScAccount struct {
	// contains filtered or unexported fields
}

func (ScAccount) Balance

func (ctx ScAccount) Balance(color string) int64

func (ScAccount) Colors

func (ctx ScAccount) Colors() ScImmutableStringArray

type ScContext

type ScContext struct {
	// contains filtered or unexported fields
}

func NewScContext

func NewScContext() ScContext

func (ScContext) Account

func (ctx ScContext) Account() ScAccount

func (ScContext) Contract

func (ctx ScContext) Contract() ScContract

func (ScContext) Error

func (ctx ScContext) Error() ScMutableString

func (ScContext) Event

func (ctx ScContext) Event(contract string, function string, delay int64) ScMutableMap

func (ScContext) EventWithCode

func (ctx ScContext) EventWithCode(contract string, code int64, delay int64) ScMutableMap

just for compatibility with old hardcoded SCs

func (ScContext) Log

func (ctx ScContext) Log(text string)

func (ScContext) Random

func (ctx ScContext) Random(max int64) int64

func (ScContext) Request

func (ctx ScContext) Request() ScRequest

func (ScContext) State

func (ctx ScContext) State() ScMutableMap

func (ScContext) TimestampedLog

func (ctx ScContext) TimestampedLog(key string) ScLog

func (ScContext) Trace

func (ctx ScContext) Trace(text string)

func (ScContext) Transfer

func (ctx ScContext) Transfer(address string, color string, amount int64)

func (ScContext) Utility

func (ctx ScContext) Utility() ScUtility

type ScContract

type ScContract struct {
	// contains filtered or unexported fields
}

func (ScContract) Address

func (ctx ScContract) Address() string

func (ScContract) Color

func (ctx ScContract) Color() string

func (ScContract) Description

func (ctx ScContract) Description() string

func (ScContract) Id

func (ctx ScContract) Id() string

func (ScContract) Name

func (ctx ScContract) Name() string

func (ScContract) Owner

func (ctx ScContract) Owner() string

type ScEvent

type ScEvent struct {
	// contains filtered or unexported fields
}

func (ScEvent) Code

func (ctx ScEvent) Code(code int64)

func (ScEvent) Contract

func (ctx ScEvent) Contract(contract string)

func (ScEvent) Delay

func (ctx ScEvent) Delay(delay int64)

func (ScEvent) Function

func (ctx ScEvent) Function(function string)

func (ScEvent) Params

func (ctx ScEvent) Params() ScMutableMap

type ScImmutableBytes

type ScImmutableBytes struct {
	// contains filtered or unexported fields
}

func (ScImmutableBytes) Value

func (o ScImmutableBytes) Value() []byte

type ScImmutableBytesArray

type ScImmutableBytesArray struct {
	// contains filtered or unexported fields
}

func (ScImmutableBytesArray) GetBytes

func (o ScImmutableBytesArray) GetBytes(index int32) ScImmutableBytes

func (ScImmutableBytesArray) Length

func (o ScImmutableBytesArray) Length() int32

type ScImmutableInt

type ScImmutableInt struct {
	// contains filtered or unexported fields
}

func (ScImmutableInt) Value

func (o ScImmutableInt) Value() int64

type ScImmutableIntArray

type ScImmutableIntArray struct {
	// contains filtered or unexported fields
}

func (ScImmutableIntArray) GetInt

func (o ScImmutableIntArray) GetInt(index int32) ScImmutableInt

func (ScImmutableIntArray) Length

func (o ScImmutableIntArray) Length() int32

type ScImmutableMap

type ScImmutableMap struct {
	// contains filtered or unexported fields
}

func (ScImmutableMap) GetBytes

func (o ScImmutableMap) GetBytes(key string) ScImmutableBytes

func (ScImmutableMap) GetBytesArray

func (o ScImmutableMap) GetBytesArray(key string) ScImmutableBytesArray

func (ScImmutableMap) GetInt

func (o ScImmutableMap) GetInt(key string) ScImmutableInt

func (ScImmutableMap) GetIntArray

func (o ScImmutableMap) GetIntArray(key string) ScImmutableIntArray

func (ScImmutableMap) GetMap

func (o ScImmutableMap) GetMap(key string) ScImmutableMap

func (ScImmutableMap) GetMaprray

func (o ScImmutableMap) GetMaprray(key string) ScImmutableMapArray

func (ScImmutableMap) GetString

func (o ScImmutableMap) GetString(key string) ScImmutableString

func (ScImmutableMap) GetStringArray

func (o ScImmutableMap) GetStringArray(key string) ScImmutableStringArray

type ScImmutableMapArray

type ScImmutableMapArray struct {
	// contains filtered or unexported fields
}

func (ScImmutableMapArray) GetMap

func (o ScImmutableMapArray) GetMap(index int32) ScImmutableMap

func (ScImmutableMapArray) Length

func (o ScImmutableMapArray) Length() int32

type ScImmutableString

type ScImmutableString struct {
	// contains filtered or unexported fields
}

func (ScImmutableString) Value

func (o ScImmutableString) Value() string

type ScImmutableStringArray

type ScImmutableStringArray struct {
	// contains filtered or unexported fields
}

func (ScImmutableStringArray) GetString

func (o ScImmutableStringArray) GetString(index int32) ScImmutableString

func (ScImmutableStringArray) Length

func (o ScImmutableStringArray) Length() int32

type ScLog

type ScLog struct {
	// contains filtered or unexported fields
}

func (ScLog) Append

func (ctx ScLog) Append(timestamp int64, data []byte)

func (ScLog) Length

func (ctx ScLog) Length() int32

type ScMutableBytes

type ScMutableBytes struct {
	// contains filtered or unexported fields
}

func (ScMutableBytes) SetValue

func (o ScMutableBytes) SetValue(value []byte)

func (ScMutableBytes) Value

func (o ScMutableBytes) Value() []byte

type ScMutableBytesArray

type ScMutableBytesArray struct {
	// contains filtered or unexported fields
}

func (ScMutableBytesArray) Clear

func (o ScMutableBytesArray) Clear()

func (ScMutableBytesArray) GetBytes

func (o ScMutableBytesArray) GetBytes(index int32) ScMutableBytes

func (ScMutableBytesArray) Immutable

func (ScMutableBytesArray) Length

func (o ScMutableBytesArray) Length() int32

type ScMutableInt

type ScMutableInt struct {
	// contains filtered or unexported fields
}

func (ScMutableInt) SetValue

func (o ScMutableInt) SetValue(value int64)

func (ScMutableInt) Value

func (o ScMutableInt) Value() int64

type ScMutableIntArray

type ScMutableIntArray struct {
	// contains filtered or unexported fields
}

func (ScMutableIntArray) Clear

func (o ScMutableIntArray) Clear()

func (ScMutableIntArray) GetInt

func (o ScMutableIntArray) GetInt(index int32) ScMutableInt

func (ScMutableIntArray) Immutable

func (o ScMutableIntArray) Immutable() ScImmutableIntArray

func (ScMutableIntArray) Length

func (o ScMutableIntArray) Length() int32

type ScMutableMap

type ScMutableMap struct {
	// contains filtered or unexported fields
}

func (ScMutableMap) Clear

func (o ScMutableMap) Clear()

func (ScMutableMap) GetBytes

func (o ScMutableMap) GetBytes(key string) ScMutableBytes

func (ScMutableMap) GetBytesArray

func (o ScMutableMap) GetBytesArray(key string) ScMutableBytesArray

func (ScMutableMap) GetInt

func (o ScMutableMap) GetInt(key string) ScMutableInt

func (ScMutableMap) GetIntArray

func (o ScMutableMap) GetIntArray(key string) ScMutableIntArray

func (ScMutableMap) GetMap

func (o ScMutableMap) GetMap(key string) ScMutableMap

func (ScMutableMap) GetMapArray

func (o ScMutableMap) GetMapArray(key string) ScMutableMapArray

func (ScMutableMap) GetString

func (o ScMutableMap) GetString(key string) ScMutableString

func (ScMutableMap) GetStringArray

func (o ScMutableMap) GetStringArray(key string) ScMutableStringArray

func (ScMutableMap) Immutable

func (o ScMutableMap) Immutable() ScImmutableMap

type ScMutableMapArray

type ScMutableMapArray struct {
	// contains filtered or unexported fields
}

func (ScMutableMapArray) Clear

func (o ScMutableMapArray) Clear()

func (ScMutableMapArray) GetMap

func (o ScMutableMapArray) GetMap(index int32) ScMutableMap

func (ScMutableMapArray) Immutable

func (o ScMutableMapArray) Immutable() ScImmutableMapArray

func (ScMutableMapArray) Length

func (o ScMutableMapArray) Length() int32

type ScMutableString

type ScMutableString struct {
	// contains filtered or unexported fields
}

func (ScMutableString) SetValue

func (o ScMutableString) SetValue(value string)

func (ScMutableString) Value

func (o ScMutableString) Value() string

type ScMutableStringArray

type ScMutableStringArray struct {
	// contains filtered or unexported fields
}

func (ScMutableStringArray) Clear

func (o ScMutableStringArray) Clear()

func (ScMutableStringArray) GetString

func (o ScMutableStringArray) GetString(index int32) ScMutableString

func (ScMutableStringArray) Immutable

func (ScMutableStringArray) Length

func (o ScMutableStringArray) Length() int32

type ScRequest

type ScRequest struct {
	// contains filtered or unexported fields
}

func (ScRequest) Address

func (ctx ScRequest) Address() string

func (ScRequest) Balance

func (ctx ScRequest) Balance(color string) int64

func (ScRequest) Colors

func (ctx ScRequest) Colors() ScImmutableStringArray

func (ScRequest) Hash

func (ctx ScRequest) Hash() string

func (ScRequest) Id

func (ctx ScRequest) Id() string

func (ScRequest) Params

func (ctx ScRequest) Params() ScImmutableMap

func (ScRequest) Timestamp

func (ctx ScRequest) Timestamp() int64

type ScTransfer

type ScTransfer struct {
	// contains filtered or unexported fields
}

func (ScTransfer) Address

func (ctx ScTransfer) Address(address string)

func (ScTransfer) Amount

func (ctx ScTransfer) Amount(amount int64)

func (ScTransfer) Color

func (ctx ScTransfer) Color(color string)

type ScUtility

type ScUtility struct {
	// contains filtered or unexported fields
}

func (ScUtility) Hash

func (ctx ScUtility) Hash(value string) string

Jump to

Keyboard shortcuts

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