Crate z4_types

Source

Macros§

json
Construct a serde_json::Value from a JSON literal.

Structs§

H160
Fixed-size uninterpreted hash type with 20 bytes (160 bits) size.
HandleResult
The result when after handling the message or task.
MethodValues
method & multiple values for Param, compatible with jsonrpc
NetworkConfig
Network config informato, use EIP-3085
NetworkCurrency
Network native currency config
PeerId
peer’s network id.
Player
Standard player from chain & pozk

Enums§

Error
Z4 error
Network
Network types
TaskMessage
Task message type
Value
Represents any valid JSON value.

Constants§

DEFAULT_NETWORK
Default network
PLAYER_BYTES_LEN
Player bytes length
ROOM_MARKET_ABI
SIMPLE_GAME_ABI
TOKEN_ABI
Z4_ROOM_MARKET_GROUP
Z4 init room id/tdn group id

Traits§

Handler
Handle message received from players
Param
Serialize & deserialize for params
Task
Timer tasks when game room started

Functions§

address_hex
Convert address to hex string
address_to_peer
convert address to peer
env_value
Get value from env and parse it to T
env_values
Get value array from env and parse it to T
generate_keypair
Generate engine used keypair for player
handle_tasks
Handle and listening tasks
hex_address
Convert hex string to address
merge_json
Merge two values
peer_to_address
convert peer to address
sign
Sign for zk-friendly
simple_game_result
Helper for generate simple game result, for ranking
verify
Verify for zk-friendly

Type Aliases§

Address
GameId
Game id = Address
PublicKey
Type PublicKey
Result
Z4 main Result with Z4 error
RoomId
Room id = u64
SecretKey
Type SecretKey
Tasks
Type helper for tasks