sdk

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SerializeBody

func SerializeBody(payment *ExecutableDeployItem, session *ExecutableDeployItem) []byte

func SerializeHeader

func SerializeHeader(deployHeader *DeployHeader) []byte

Types

type AccountDeploy

type AccountDeploy struct {
	DeployHash   string `json:"deploy_hash"`
	Account      string `json:"account"`
	State        string `json:"state"`
	Cost         int    `json:"cost"`
	ErrorMessage string `json:"error_message"`
	BlockHash    string `json:"block_hash"`
}

type AccountDeploysResult

type AccountDeploysResult struct {
	Data      []AccountDeploy `json:"data"`
	PageCount int             `json:"page_count"`
	ItemCount int             `json:"item_count"`
	Pages     []Page          `json:"pages"`
}

type ActionThresholds

type ActionThresholds struct {
	Deployment    uint64 `json:"deployment"`
	KeyManagement uint64 `json:"key_management"`
}

type Approval

type Approval struct {
	Signer    keypair.PublicKey `json:"signer"`
	Signature keypair.Signature `json:"signature"`
}

type AssociatedKey

type AssociatedKey struct {
	AccountHash string `json:"account_hash"`
	Weight      uint64 `json:"weight"`
}

type AuctionState

type AuctionState struct {
	StateRootHash string          `json:"state_root_hash"`
	BlockHeight   uint64          `json:"block_height"`
	EraValidators []EraValidators `json:"era_validators"`
}

type BlockBody

type BlockBody struct {
	Proposer       string   `json:"proposer"`
	DeployHashes   []string `json:"deploy_hashes"`
	TransferHashes []string `json:"transfer_hashes"`
}

type BlockHeader

type BlockHeader struct {
	ParentHash      string    `json:"parent_hash"`
	StateRootHash   string    `json:"state_root_hash"`
	BodyHash        string    `json:"body_hash"`
	RandomBit       bool      `json:"random_bit"`
	AccumulatedSeed string    `json:"accumulated_seed"`
	Timestamp       time.Time `json:"timestamp"`
	EraID           int       `json:"era_id"`
	Height          int       `json:"height"`
	ProtocolVersion string    `json:"protocol_version"`
}

type BlockResponse

type BlockResponse struct {
	Hash   string      `json:"hash"`
	Header BlockHeader `json:"header"`
	Body   BlockBody   `json:"body"`
	Proofs []Proof     `json:"proofs"`
}

type BlockResult

type BlockResult struct {
	BlockHash   string   `json:"block_hash"`
	ParentHash  string   `json:"parent_hash"`
	TimeStamp   string   `json:"time_stamp"`
	Eraid       int      `json:"eraid"`
	Proposer    string   `json:"proposer"`
	State       string   `json:"state"`
	DeployCount int      `json:"deploy_count"`
	Height      uint64   `json:"height"`
	Deploys     []string `json:"deploys"`
}

type BlocksResult

type BlocksResult struct {
	Data      []BlockResult `json:"data"`
	PageCount int           `json:"page_count"`
	ItemCount int           `json:"item_count"`
	Pages     []Page        `json:"pages"`
}

type BoundContract

type BoundContract struct {
	ContractStruct Contract
	KeyPair        keypair.KeyPair
}

func (BoundContract) Deploy

func (b BoundContract) Deploy(args RuntimeArgs, paymentAmount big.Int, chainName string) *Deploy

type Contract

type Contract struct {
	SessionWasm []byte
	PaymentWasm []byte
}

func NewContract

func NewContract(sessionContractPath, paymentContractPath string) Contract

func (Contract) Deploy

func (c Contract) Deploy(args RuntimeArgs, paymentAmount big.Int, pubKey keypair.PublicKey, keyPair keypair.KeyPair, chainName string) *Deploy

type Deploy

type Deploy struct {
	Hash      Hash                  `json:"hash"`
	Header    *DeployHeader         `json:"header"`
	Payment   *ExecutableDeployItem `json:"payment"`
	Session   *ExecutableDeployItem `json:"session"`
	Approvals []Approval            `json:"approvals"`
}

func MakeDeploy

func MakeDeploy(deployParam *DeployParams, payment *ExecutableDeployItem, session *ExecutableDeployItem) *Deploy

func NewDeploy

func NewDeploy(hash []byte, header *DeployHeader, payment *ExecutableDeployItem, sessions *ExecutableDeployItem,
	approvals []Approval) *Deploy

func NewTransferToUniqAddress

func NewTransferToUniqAddress(source keypair.PublicKey, target UniqAddress, amount *big.Int, paymentAmount *big.Int, chainName string, sourcePurse string) *Deploy

func (*Deploy) AddArgToDeploy

func (deploy *Deploy) AddArgToDeploy(key string, value types.CLValue) error

func (*Deploy) IsStandardPayment

func (d *Deploy) IsStandardPayment() bool

func (*Deploy) IsTransfer

func (d *Deploy) IsTransfer() bool

func (*Deploy) SignDeploy

func (d *Deploy) SignDeploy(keys keypair.KeyPair)

func (*Deploy) ValidateDeploy

func (d *Deploy) ValidateDeploy() bool

type DeployHash

type DeployHash struct {
	BlockHash    string `json:"block_hash"`
	DeployHash   string `json:"deploy_hash"`
	State        string `json:"state"`
	Cost         int    `json:"cost"`
	ErrorMessage string `json:"error_message"`
}

type DeployHeader

type DeployHeader struct {
	Account      keypair.PublicKey `json:"account"`
	Timestamp    Timestamp         `json:"timestamp"`
	TTL          Duration          `json:"ttl"`
	GasPrice     uint64            `json:"gas_price"`
	BodyHash     Hash              `json:"body_hash"`
	Dependencies [][]byte          `json:"dependencies"`
	ChainName    string            `json:"chain_name"`
}

func NewDeployHeader

func NewDeployHeader(account keypair.PublicKey, timeStamp int64, ttl int64, gasPrice uint64,
	bodyHash []byte, dependencies [][]byte, chainName string) *DeployHeader

func (DeployHeader) ToBytes

func (d DeployHeader) ToBytes() []uint8

type DeployParams

type DeployParams struct {
	AccountPublicKey keypair.PublicKey
	ChainName        string
	GasPrice         uint64
	Ttl              int64
	Dependencies     [][]uint8
	Timestamp        int64
}

func NewDeployParams

func NewDeployParams(accountPublicKey keypair.PublicKey, chainName string, dependencies [][]uint8, timestamp int64) *DeployParams

type DeployRes

type DeployRes struct {
	DeployHash   string `json:"deploy_hash"`
	State        string `json:"state"`
	Cost         int    `json:"cost"`
	ErrorMessage string `json:"error_message"`
	Account      string `json:"account"`
	BlockHash    string `json:"block_hash"`
}

type DeployResult

type DeployResult struct {
	Deploy           JsonDeploy            `json:"deploy"`
	ExecutionResults []JsonExecutionResult `json:"execution_results"`
}

type Duration

type Duration time.Duration

func (Duration) MarshalJSON

func (d Duration) MarshalJSON() ([]byte, error)

func (*Duration) UnmarshalJSON

func (d *Duration) UnmarshalJSON(data []byte) error

type EraValidators

type EraValidators struct {
	EraId            int               `json:"era_id"`
	ValidatorWeights []ValidatorWeight `json:"validator_weights"`
}

type EventService

type EventService struct {
	Url string
}

func NewEventService

func NewEventService(url string) *EventService

func (EventService) GetAccountDeploy

func (e EventService) GetAccountDeploy(accountHex string, page int, limit int) (AccountDeploysResult, error)

func (EventService) GetBlockByHash

func (e EventService) GetBlockByHash(blockHash string) (BlockResult, error)

func (EventService) GetBlocks

func (e EventService) GetBlocks(page int, count int) (BlocksResult, error)

func (EventService) GetDeployByHash

func (e EventService) GetDeployByHash(deployHash string) (DeployResult, error)

func (EventService) GetResponseData

func (e EventService) GetResponseData(endpoint string) ([]byte, error)

func (EventService) GetTransfersByAccountHash

func (e EventService) GetTransfersByAccountHash(accountHash string) ([]TransferResult, error)

type ExecutableDeployItem

type ExecutableDeployItem struct {
	Type                          ExecutableDeployItemType
	ModuleBytes                   *ModuleBytes
	StoredContractByHash          *StoredContractByHash
	StoredContractByName          *StoredContractByName
	StoredVersionedContractByHash *StoredVersionedContractByHash
	StoredVersionedContractByName *StoredVersionedContractByName
	Transfer                      *Transfer
}

func NewModuleBytes

func NewModuleBytes(moduleBytes []byte, args RuntimeArgs) *ExecutableDeployItem

func NewStoredContractByHash

func NewStoredContractByHash(hash [32]byte, entryPoint string, args RuntimeArgs) *ExecutableDeployItem

func NewStoredContractByName

func NewStoredContractByName(name, entryPoint string, args RuntimeArgs) *ExecutableDeployItem

func NewStoredVersionedContractByHash

func NewStoredVersionedContractByHash(hash [32]byte, version uint32, entryPoint string, args RuntimeArgs) *ExecutableDeployItem

func NewStoredVersionedContractByHashWithoutVersion

func NewStoredVersionedContractByHashWithoutVersion(hash [32]byte, entryPoint string, args RuntimeArgs) *ExecutableDeployItem

func NewStoredVersionedContractByName

func NewStoredVersionedContractByName(name string, version uint32, entryPoint string, args RuntimeArgs) *ExecutableDeployItem

func NewStoredVersionedContractByNameWithoutVersion

func NewStoredVersionedContractByNameWithoutVersion(name string, entryPoint string, args RuntimeArgs) *ExecutableDeployItem

func NewTransfer

func NewTransfer(amount *big.Int, target *keypair.PublicKey, sourcePurse string, id uint64) *ExecutableDeployItem

func NewTransferWithoutId

func NewTransferWithoutId(amount *big.Int, target *keypair.PublicKey, sourcePurse string) *ExecutableDeployItem

func StandardPayment

func StandardPayment(amount *big.Int) *ExecutableDeployItem

func (ExecutableDeployItem) ArmForSwitch

func (e ExecutableDeployItem) ArmForSwitch(sw byte) (string, bool)

func (*ExecutableDeployItem) IsModuleBytes

func (e *ExecutableDeployItem) IsModuleBytes() bool

func (*ExecutableDeployItem) IsStoredContractByHash

func (e *ExecutableDeployItem) IsStoredContractByHash() bool

func (*ExecutableDeployItem) IsStoredContractByName

func (e *ExecutableDeployItem) IsStoredContractByName() bool

func (*ExecutableDeployItem) IsStoredVersionedContractByHash

func (e *ExecutableDeployItem) IsStoredVersionedContractByHash() bool

func (*ExecutableDeployItem) IsStoredVersionedContractByName

func (e *ExecutableDeployItem) IsStoredVersionedContractByName() bool

func (*ExecutableDeployItem) IsTransfer

func (e *ExecutableDeployItem) IsTransfer() bool

func (ExecutableDeployItem) MarshalJSON

func (e ExecutableDeployItem) MarshalJSON() ([]byte, error)

func (*ExecutableDeployItem) SetArg

func (e *ExecutableDeployItem) SetArg(key string, value types.CLValue) error

func (ExecutableDeployItem) SwitchFieldName

func (e ExecutableDeployItem) SwitchFieldName() string

func (*ExecutableDeployItem) ToBytes

func (e *ExecutableDeployItem) ToBytes() []byte

func (*ExecutableDeployItem) UnmarshalJSON

func (e *ExecutableDeployItem) UnmarshalJSON(data []byte) error

type ExecutableDeployItemType

type ExecutableDeployItemType byte
const (
	ExecutableDeployItemTypeModuleBytes ExecutableDeployItemType = iota
	ExecutableDeployItemTypeStoredContractByHash
	ExecutableDeployItemTypeStoredContractByName
	ExecutableDeployItemTypeStoredVersionedContractByHash
	ExecutableDeployItemTypeStoredVersionedContractByName
	ExecutableDeployItemTypeTransfer
)

type ExecutionResult

type ExecutionResult struct {
	Success      SuccessExecutionResult `json:"success"`
	ErrorMessage *string                `json:"error_message,omitempty"`
}

type FaucetContract

type FaucetContract struct{}

func (FaucetContract) MakeArgs

func (f FaucetContract) MakeArgs(accountHash string) RuntimeArgs

type Hash

type Hash []byte

func (Hash) MarshalJSON

func (h Hash) MarshalJSON() ([]byte, error)

func (*Hash) UnmarshalJSON

func (h *Hash) UnmarshalJSON(data []byte) error

type JsonAccount

type JsonAccount struct {
	AccountHash      string           `json:"account_hash"`
	NamedKeys        []NamedKey       `json:"named_keys"`
	MainPurse        string           `json:"main_purse"`
	AssociatedKeys   []AssociatedKey  `json:"associated_keys"`
	ActionThresholds ActionThresholds `json:"action_thresholds"`
}

type JsonApproval

type JsonApproval struct {
	Signer    string `json:"signer"`
	Signature string `json:"signature"`
}

type JsonCLValue

type JsonCLValue struct {
	Bytes  string      `json:"bytes"`
	CLType string      `json:"cl_type"`
	Parsed interface{} `json:"parsed"`
}

type JsonContractMetadata

type JsonContractMetadata struct {
	ContractPackageHash string `json:"contract_package_hash"`
	ContractWasmHash    string `json:"contract_wasm_hash"`
	ProtocolVersion     string `json:"protocol_version"`
}

type JsonDeploy

type JsonDeploy struct {
	Hash      string           `json:"hash"`
	Header    JsonDeployHeader `json:"header"`
	Approvals []JsonApproval   `json:"approvals"`
}

type JsonDeployHeader

type JsonDeployHeader struct {
	Account      string    `json:"account"`
	Timestamp    time.Time `json:"timestamp"`
	TTL          string    `json:"ttl"`
	GasPrice     int       `json:"gas_price"`
	BodyHash     string    `json:"body_hash"`
	Dependencies []string  `json:"dependencies"`
	ChainName    string    `json:"chain_name"`
}

type JsonDeployInfo

type JsonDeployInfo struct {
	DeployHash string   `json:"deploy_hash"`
	Transfers  []string `json:"transfers"`
	From       string   `json:"from"`
	Source     string   `json:"source"`
	Gas        string   `json:"gas"`
}

type JsonExecutionResult

type JsonExecutionResult struct {
	BlockHash string          `json:"block_hash"`
	Result    ExecutionResult `json:"result"`
}

type JsonPutDeployRes

type JsonPutDeployRes struct {
	Hash string `json:"deploy_hash"`
}

type ModuleBytes

type ModuleBytes struct {
	Tag         ExecutableDeployItemType
	ModuleBytes []byte
	Args        RuntimeArgs
}

func (ModuleBytes) MarshalJSON

func (m ModuleBytes) MarshalJSON() ([]byte, error)

func (ModuleBytes) ToBytes

func (m ModuleBytes) ToBytes() []byte

func (*ModuleBytes) UnmarshalModuleBytes

func (m *ModuleBytes) UnmarshalModuleBytes(tempMap map[string]interface{}) error

type NamedKey

type NamedKey struct {
	Name string `json:"name"`
	Key  string `json:"key"`
}

type Page

type Page struct {
	Number int    `json:"number"`
	Url    string `json:"url"`
}

type Peer

type Peer struct {
	NodeId  string `json:"node_id"`
	Address string `json:"address"`
}

type PeerResult

type PeerResult struct {
	Peers []Peer `json:"peers"`
}

type Proof

type Proof struct {
	PublicKey string `json:"public_key"`
	Signature string `json:"signature"`
}

type RpcClient

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

func NewRpcClient

func NewRpcClient(endpoint string) *RpcClient

func (*RpcClient) GetAccountBalance

func (c *RpcClient) GetAccountBalance(stateRootHash, balanceUref string) (big.Int, error)

func (*RpcClient) GetAccountBalanceByKeypair

func (c *RpcClient) GetAccountBalanceByKeypair(stateRootHash string, key keypair.KeyPair) (big.Int, error)

func (*RpcClient) GetAccountMainPurseURef

func (c *RpcClient) GetAccountMainPurseURef(accountHash string) string

func (*RpcClient) GetBlockByHash

func (c *RpcClient) GetBlockByHash(hash string) (BlockResponse, error)

func (*RpcClient) GetBlockByHeight

func (c *RpcClient) GetBlockByHeight(height uint64) (BlockResponse, error)

func (*RpcClient) GetBlockTransfersByHash

func (c *RpcClient) GetBlockTransfersByHash(blockHash string) ([]TransferResponse, error)

func (*RpcClient) GetBlockTransfersByHeight

func (c *RpcClient) GetBlockTransfersByHeight(height uint64) ([]TransferResponse, error)

func (*RpcClient) GetDeploy

func (c *RpcClient) GetDeploy(hash string) (DeployResult, error)

func (*RpcClient) GetLatestBlock

func (c *RpcClient) GetLatestBlock() (BlockResponse, error)

func (*RpcClient) GetLatestBlockTransfers

func (c *RpcClient) GetLatestBlockTransfers() ([]TransferResponse, error)

func (*RpcClient) GetPeers

func (c *RpcClient) GetPeers() (PeerResult, error)

func (*RpcClient) GetStateItem

func (c *RpcClient) GetStateItem(stateRootHash, key string, path []string) (StoredValue, error)

func (*RpcClient) GetStateRootHash

func (c *RpcClient) GetStateRootHash(stateRootHash string) (StateRootHashResult, error)

func (*RpcClient) GetStatus

func (c *RpcClient) GetStatus() (StatusResult, error)

func (*RpcClient) GetValidator

func (c *RpcClient) GetValidator() (ValidatorPesponse, error)

func (*RpcClient) PutDeploy

func (c *RpcClient) PutDeploy(deploy Deploy) (JsonPutDeployRes, error)

type RpcError

type RpcError struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

type RpcRequest

type RpcRequest struct {
	Version string      `json:"jsonrpc"`
	Id      string      `json:"id"`
	Method  string      `json:"method"`
	Params  interface{} `json:"params"`
}

type RpcResponse

type RpcResponse struct {
	Version string          `json:"jsonrpc"`
	Id      string          `json:"id"`
	Result  json.RawMessage `json:"result"`
	Error   *RpcError       `json:"error,omitempty"`
}

type RuntimeArgs

type RuntimeArgs struct {
	KeyOrder []string
	Args     map[string]Value
}

func NewRunTimeArgs

func NewRunTimeArgs(args map[string]Value, keyOrder []string) *RuntimeArgs

func ParseRuntimeArgs

func ParseRuntimeArgs(args []interface{}) (RuntimeArgs, error)

func (RuntimeArgs) FromMap

func (r RuntimeArgs) FromMap(args map[string]Value, keyOrder []string) *RuntimeArgs

func (RuntimeArgs) Insert

func (r RuntimeArgs) Insert(key string, value Value)

func (RuntimeArgs) ToBytes

func (r RuntimeArgs) ToBytes() []byte

func (RuntimeArgs) ToJSONInterface

func (r RuntimeArgs) ToJSONInterface() []interface{}

runtime args in deploy are encoded as an array of pairs "key" : "value"

type StateRootHashResult

type StateRootHashResult struct {
	StateRootHash string `json:"state_root_hash"`
}

type StatusResult

type StatusResult struct {
	LastAddedBlock BlockResponse `json:"last_added_block"`
	BuildVersion   string        `json:"build_version"`
}

type StoredContractByHash

type StoredContractByHash struct {
	Tag        ExecutableDeployItemType
	Hash       [32]byte
	Entrypoint string
	Args       RuntimeArgs
}

func (StoredContractByHash) MarshalJSON

func (s StoredContractByHash) MarshalJSON() ([]byte, error)

func (StoredContractByHash) ToBytes

func (s StoredContractByHash) ToBytes() []byte

func (*StoredContractByHash) UnmarshalStoredContractByHash

func (s *StoredContractByHash) UnmarshalStoredContractByHash(tempMap map[string]interface{}) error

type StoredContractByName

type StoredContractByName struct {
	Tag        ExecutableDeployItemType
	Name       string
	Entrypoint string
	Args       RuntimeArgs
}

func (StoredContractByName) MarshalJSON

func (s StoredContractByName) MarshalJSON() ([]byte, error)

func (StoredContractByName) ToBytes

func (s StoredContractByName) ToBytes() []byte

func (*StoredContractByName) UnmarshalStoredContractByName

func (s *StoredContractByName) UnmarshalStoredContractByName(tempMap map[string]interface{}) error

type StoredValue

type StoredValue struct {
	CLValue         *JsonCLValue          `json:"CLValue,omitempty"`
	Account         *JsonAccount          `json:"Account,omitempty"`
	Contract        *JsonContractMetadata `json:"Contract,omitempty"`
	ContractWASM    *string               `json:"ContractWASM,omitempty"`
	ContractPackage *string               `json:"ContractPackage,omitempty"`
	Transfer        *TransferResponse     `json:"Transfer,omitempty"`
	DeployInfo      *JsonDeployInfo       `json:"DeployInfo,omitempty"`
}

type StoredVersionedContractByHash

type StoredVersionedContractByHash struct {
	Tag        ExecutableDeployItemType
	Hash       [32]byte
	Version    *types.CLValue
	Entrypoint string
	Args       RuntimeArgs
}

func (StoredVersionedContractByHash) MarshalJSON

func (s StoredVersionedContractByHash) MarshalJSON() ([]byte, error)

func (StoredVersionedContractByHash) ToBytes

func (s StoredVersionedContractByHash) ToBytes() []byte

func (*StoredVersionedContractByHash) UnmarshalStoredVersionedContractByHash

func (s *StoredVersionedContractByHash) UnmarshalStoredVersionedContractByHash(tempMap map[string]interface{}) error

type StoredVersionedContractByName

type StoredVersionedContractByName struct {
	Tag        ExecutableDeployItemType
	Name       string
	Version    *types.CLValue
	Entrypoint string
	Args       RuntimeArgs
}

func (StoredVersionedContractByName) MarshalJSON

func (s StoredVersionedContractByName) MarshalJSON() ([]byte, error)

func (StoredVersionedContractByName) ToBytes

func (s StoredVersionedContractByName) ToBytes() []byte

func (*StoredVersionedContractByName) UnmarshalStoredVersionedContractByName

func (s *StoredVersionedContractByName) UnmarshalStoredVersionedContractByName(tempMap map[string]interface{}) error

type SuccessExecutionResult

type SuccessExecutionResult struct {
	Transfers []string `json:"transfers"`
	Cost      string   `json:"cost"`
}

type Timestamp

type Timestamp int64

func (Timestamp) MarshalJSON

func (t Timestamp) MarshalJSON() ([]byte, error)

func (*Timestamp) UnmarshalJSON

func (t *Timestamp) UnmarshalJSON(data []byte) error

type Transfer

type Transfer struct {
	Tag  ExecutableDeployItemType
	Args RuntimeArgs
}

func (Transfer) MarshalJSON

func (t Transfer) MarshalJSON() ([]byte, error)

func (Transfer) ToBytes

func (t Transfer) ToBytes() []byte

func (*Transfer) UnmarshalTransfer

func (t *Transfer) UnmarshalTransfer(tempMap map[string]interface{}) error

type TransferContract

type TransferContract struct{}

func (TransferContract) MakeArgs

func (t TransferContract) MakeArgs(accountHash string, amount big.Int) RuntimeArgs

type TransferResponse

type TransferResponse struct {
	ID         int64  `json:"id,omitempty"`
	DeployHash string `json:"deploy_hash"`
	From       string `json:"from"`
	To         string `json:"to"`
	Source     string `json:"source"`
	Target     string `json:"target"`
	Amount     string `json:"amount"`
	Gas        string `json:"gas"`
}

type TransferResult

type TransferResult struct {
	DeployHash  string `json:"deploy_hash"`
	SourcePurse string `json:"source_purse"`
	TargetPurse string `json:"target_purse"`
	Amount      string `json:"amount"`
	Id          string `json:"id"`
	FromAccount string `json:"from_account"`
	ToAccount   string `json:"to_account"`
}

type UniqAddress

type UniqAddress struct {
	PublicKey  *keypair.PublicKey
	TransferId uint64
}

type ValidatorPesponse

type ValidatorPesponse struct {
	Version      string `json:"jsonrpc"`
	AuctionState `json:"auction_state"`
}

type ValidatorWeight

type ValidatorWeight struct {
	PublicKey string `json:"public_key"`
	Weight    string `json:"weight"`
}

type Value

type Value struct {
	Tag         types.CLType
	IsOptional  bool
	StringBytes string
	Optional    *Value
	Map         *ValueMap
	List        *ValueList
}

func (Value) MarshalJSON

func (v Value) MarshalJSON() ([]byte, error)

func (Value) ToBytes

func (v Value) ToBytes() []uint8

type ValueList

type ValueList struct {
	ElementType types.CLType
}

type ValueMap

type ValueMap struct {
	KeyType   types.CLType
	ValueType types.CLType
}

Jump to

Keyboard shortcuts

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