# pyre-strict
from dataclasses import dataclass
import typing
from starcoin import serde_types as st
from starcoin import bcs
[docs]@dataclass(frozen=True)
class AcceptTokenEvent:
token_code: "TokenCode"
[docs] def bcs_serialize(self) -> bytes:
return bcs.serialize(self, AcceptTokenEvent)
[docs] @staticmethod
def bcs_deserialize(input: bytes) -> 'AcceptTokenEvent':
v, buffer = bcs.deserialize(input, AcceptTokenEvent)
if buffer:
raise st.DeserializationError("Some input bytes were not read")
return v
[docs]@dataclass(frozen=True)
class AccessPath:
address: "AccountAddress"
path: "DataPath"
[docs] def bcs_serialize(self) -> bytes:
return bcs.serialize(self, AccessPath)
[docs] @staticmethod
def bcs_deserialize(input: bytes) -> 'AccessPath':
v, buffer = bcs.deserialize(input, AccessPath)
if buffer:
raise st.DeserializationError("Some input bytes were not read")
return v
[docs]@dataclass(frozen=True)
class AccountAddress:
value: typing.Tuple[st.uint8, st.uint8, st.uint8, st.uint8, st.uint8, st.uint8, st.uint8,
st.uint8, st.uint8, st.uint8, st.uint8, st.uint8, st.uint8, st.uint8, st.uint8, st.uint8]
[docs] def bcs_serialize(self) -> bytes:
return bcs.serialize(self, AccountAddress)
[docs] @staticmethod
def bcs_deserialize(input: bytes) -> 'AccountAddress':
v, buffer = bcs.deserialize(input, AccountAddress)
if buffer:
raise st.DeserializationError("Some input bytes were not read")
return v
[docs] @staticmethod
def from_hex(addr: str) -> 'AccountAddress':
"""Create an account address from bytes."""
return AccountAddress(tuple(st.uint8(x) for x in bytes.fromhex(addr)))
[docs]@dataclass(frozen=True)
class AccountResource:
authentication_key: bytes
withdrawal_capability: typing.Optional["WithdrawCapabilityResource"]
key_rotation_capability: typing.Optional["KeyRotationCapabilityResource"]
received_events: "EventHandle"
sent_events: "EventHandle"
accept_token_events: "EventHandle"
sequence_number: st.uint64
[docs] def bcs_serialize(self) -> bytes:
return bcs.serialize(self, AccountResource)
[docs] @staticmethod
def bcs_deserialize(input: bytes) -> 'AccountResource':
v, buffer = bcs.deserialize(input, AccountResource)
if buffer:
raise st.DeserializationError("Some input bytes were not read")
return v
[docs]@dataclass(frozen=True)
class BalanceResource:
token: st.uint128
[docs] def bcs_serialize(self) -> bytes:
return bcs.serialize(self, BalanceResource)
[docs] @staticmethod
def bcs_deserialize(input: bytes) -> 'BalanceResource':
v, buffer = bcs.deserialize(input, BalanceResource)
if buffer:
raise st.DeserializationError("Some input bytes were not read")
return v
[docs]@dataclass(frozen=True)
class BlockRewardEvent:
block_number: st.uint64
block_reward: st.uint128
gas_fees: st.uint128
miner: "AccountAddress"
[docs] def bcs_serialize(self) -> bytes:
return bcs.serialize(self, BlockRewardEvent)
[docs] @staticmethod
def bcs_deserialize(input: bytes) -> 'BlockRewardEvent':
v, buffer = bcs.deserialize(input, BlockRewardEvent)
if buffer:
raise st.DeserializationError("Some input bytes were not read")
return v
[docs]@dataclass(frozen=True)
class BurnEvent:
amount: st.uint128
token_code: "TokenCode"
[docs] def bcs_serialize(self) -> bytes:
return bcs.serialize(self, BurnEvent)
[docs] @staticmethod
def bcs_deserialize(input: bytes) -> 'BurnEvent':
v, buffer = bcs.deserialize(input, BurnEvent)
if buffer:
raise st.DeserializationError("Some input bytes were not read")
return v
[docs]@dataclass(frozen=True)
class ChainId:
value: st.uint8
[docs] def bcs_serialize(self) -> bytes:
return bcs.serialize(self, ChainId)
[docs] @staticmethod
def bcs_deserialize(input: bytes) -> 'ChainId':
v, buffer = bcs.deserialize(input, ChainId)
if buffer:
raise st.DeserializationError("Some input bytes were not read")
return v
[docs]@dataclass(frozen=True)
class ChangeSet:
write_set: "WriteSet"
events: typing.Sequence["ContractEvent"]
[docs] def bcs_serialize(self) -> bytes:
return bcs.serialize(self, ChangeSet)
[docs] @staticmethod
def bcs_deserialize(input: bytes) -> 'ChangeSet':
v, buffer = bcs.deserialize(input, ChangeSet)
if buffer:
raise st.DeserializationError("Some input bytes were not read")
return v
[docs]class ContractEvent:
VARIANTS = [] # type: typing.Sequence[typing.Type[ContractEvent]]
[docs] def bcs_serialize(self) -> bytes:
return bcs.serialize(self, ContractEvent)
[docs] @staticmethod
def bcs_deserialize(input: bytes) -> 'ContractEvent':
v, buffer = bcs.deserialize(input, ContractEvent)
if buffer:
raise st.DeserializationError("Some input bytes were not read")
return v
[docs]@dataclass(frozen=True)
class ContractEvent__V0(ContractEvent):
INDEX = 0 # type: int
value: "ContractEventV0"
ContractEvent.VARIANTS = [
ContractEvent__V0,
]
[docs]@dataclass(frozen=True)
class ContractEventV0:
key: "EventKey"
sequence_number: st.uint64
type_tag: "TypeTag"
event_data: bytes
[docs] def bcs_serialize(self) -> bytes:
return bcs.serialize(self, ContractEventV0)
[docs] @staticmethod
def bcs_deserialize(input: bytes) -> 'ContractEventV0':
v, buffer = bcs.deserialize(input, ContractEventV0)
if buffer:
raise st.DeserializationError("Some input bytes were not read")
return v
[docs]class DataPath:
VARIANTS = [] # type: typing.Sequence[typing.Type[DataPath]]
[docs] def bcs_serialize(self) -> bytes:
return bcs.serialize(self, DataPath)
[docs] @staticmethod
def bcs_deserialize(input: bytes) -> 'DataPath':
v, buffer = bcs.deserialize(input, DataPath)
if buffer:
raise st.DeserializationError("Some input bytes were not read")
return v
[docs]@dataclass(frozen=True)
class DataPath__Code(DataPath):
INDEX = 0 # type: int
value: "Identifier"
[docs]@dataclass(frozen=True)
class DataPath__Resource(DataPath):
INDEX = 1 # type: int
value: "StructTag"
DataPath.VARIANTS = [
DataPath__Code,
DataPath__Resource,
]
[docs]@dataclass(frozen=True)
class DepositEvent:
amount: st.uint128
token_code: "TokenCode"
metadata: typing.Sequence[st.uint8]
[docs] def bcs_serialize(self) -> bytes:
return bcs.serialize(self, DepositEvent)
[docs] @staticmethod
def bcs_deserialize(input: bytes) -> 'DepositEvent':
v, buffer = bcs.deserialize(input, DepositEvent)
if buffer:
raise st.DeserializationError("Some input bytes were not read")
return v
[docs]@dataclass(frozen=True)
class Ed25519PublicKey:
value: bytes
[docs] def bcs_serialize(self) -> bytes:
return bcs.serialize(self, Ed25519PublicKey)
[docs] @staticmethod
def bcs_deserialize(input: bytes) -> 'Ed25519PublicKey':
v, buffer = bcs.deserialize(input, Ed25519PublicKey)
if buffer:
raise st.DeserializationError("Some input bytes were not read")
return v
[docs]@dataclass(frozen=True)
class Ed25519Signature:
value: bytes
[docs] def bcs_serialize(self) -> bytes:
return bcs.serialize(self, Ed25519Signature)
[docs] @staticmethod
def bcs_deserialize(input: bytes) -> 'Ed25519Signature':
v, buffer = bcs.deserialize(input, Ed25519Signature)
if buffer:
raise st.DeserializationError("Some input bytes were not read")
return v
[docs]@dataclass(frozen=True)
class EventFilter:
from_block: typing.Optional[st.uint64]
to_block: typing.Optional[st.uint64]
event_keys: typing.Sequence["EventKey"]
limit: typing.Optional[st.uint64]
[docs] def bcs_serialize(self) -> bytes:
return bcs.serialize(self, EventFilter)
[docs] @staticmethod
def bcs_deserialize(input: bytes) -> 'EventFilter':
v, buffer = bcs.deserialize(input, EventFilter)
if buffer:
raise st.DeserializationError("Some input bytes were not read")
return v
[docs]@dataclass(frozen=True)
class EventHandle:
count: st.uint64
key: bytes
[docs] def bcs_serialize(self) -> bytes:
return bcs.serialize(self, EventHandle)
[docs] @staticmethod
def bcs_deserialize(input: bytes) -> 'EventHandle':
v, buffer = bcs.deserialize(input, EventHandle)
if buffer:
raise st.DeserializationError("Some input bytes were not read")
return v
[docs]@dataclass(frozen=True)
class EventKey:
salt: st.uint64
address: AccountAddress
[docs] def bcs_serialize(self) -> bytes:
return bcs.serialize(self, EventKey)
[docs] @staticmethod
def bcs_deserialize(input: bytes) -> 'EventKey':
v, buffer = bcs.deserialize(input, EventKey)
if buffer:
raise st.DeserializationError("Some input bytes were not read")
return v
GeneralMetadata.VARIANTS = [
GeneralMetadata__GeneralMetadataVersion0,
]
[docs]@dataclass(frozen=True)
class HashValue:
value: bytes
[docs] def bcs_serialize(self) -> bytes:
return bcs.serialize(self, HashValue)
[docs] @staticmethod
def bcs_deserialize(input: bytes) -> 'HashValue':
v, buffer = bcs.deserialize(input, HashValue)
if buffer:
raise st.DeserializationError("Some input bytes were not read")
return v
[docs]@dataclass(frozen=True)
class Identifier:
value: str
[docs] def bcs_serialize(self) -> bytes:
return bcs.serialize(self, Identifier)
[docs] @staticmethod
def bcs_deserialize(input: bytes) -> 'Identifier':
v, buffer = bcs.deserialize(input, Identifier)
if buffer:
raise st.DeserializationError("Some input bytes were not read")
return v
[docs]@dataclass(frozen=True)
class KeyRotationCapabilityResource:
account_address: "AccountAddress"
[docs] def bcs_serialize(self) -> bytes:
return bcs.serialize(self, KeyRotationCapabilityResource)
[docs] @staticmethod
def bcs_deserialize(input: bytes) -> 'KeyRotationCapabilityResource':
v, buffer = bcs.deserialize(input, KeyRotationCapabilityResource)
if buffer:
raise st.DeserializationError("Some input bytes were not read")
return v
[docs]class Kind:
VARIANTS = [] # type: typing.Sequence[typing.Type[Kind]]
[docs] def bcs_serialize(self) -> bytes:
return bcs.serialize(self, Kind)
[docs] @staticmethod
def bcs_deserialize(input: bytes) -> 'Kind':
v, buffer = bcs.deserialize(input, Kind)
if buffer:
raise st.DeserializationError("Some input bytes were not read")
return v
[docs]@dataclass(frozen=True)
class Kind__NewHeads(Kind):
INDEX = 0 # type: int
pass
[docs]@dataclass(frozen=True)
class Kind__Events(Kind):
INDEX = 1 # type: int
pass
[docs]@dataclass(frozen=True)
class Kind__NewPendingTransactions(Kind):
INDEX = 2 # type: int
pass
[docs]@dataclass(frozen=True)
class Kind__NewMintBlock(Kind):
INDEX = 3 # type: int
pass
Kind.VARIANTS = [
Kind__NewHeads,
Kind__Events,
Kind__NewPendingTransactions,
Kind__NewMintBlock,
]
Metadata.VARIANTS = [
Metadata__Undefined,
Metadata__GeneralMetadata,
Metadata__TravelRuleMetadata,
Metadata__UnstructuredBytesMetadata,
]
[docs]@dataclass(frozen=True)
class MintEvent:
amount: st.uint128
token_code: "TokenCode"
[docs] def bcs_serialize(self) -> bytes:
return bcs.serialize(self, MintEvent)
[docs] @staticmethod
def bcs_deserialize(input: bytes) -> 'MintEvent':
v, buffer = bcs.deserialize(input, MintEvent)
if buffer:
raise st.DeserializationError("Some input bytes were not read")
return v
[docs]@dataclass(frozen=True)
class Module:
code: bytes
[docs] def bcs_serialize(self) -> bytes:
return bcs.serialize(self, Module)
[docs] @staticmethod
def bcs_deserialize(input: bytes) -> 'Module':
v, buffer = bcs.deserialize(input, Module)
if buffer:
raise st.DeserializationError("Some input bytes were not read")
return v
[docs]@dataclass(frozen=True)
class ModuleId:
address: "AccountAddress"
name: "Identifier"
[docs] def bcs_serialize(self) -> bytes:
return bcs.serialize(self, ModuleId)
[docs] @staticmethod
def bcs_deserialize(input: bytes) -> 'ModuleId':
v, buffer = bcs.deserialize(input, ModuleId)
if buffer:
raise st.DeserializationError("Some input bytes were not read")
return v
[docs]@dataclass(frozen=True)
class MultiEd25519PublicKey:
value: bytes
[docs] def bcs_serialize(self) -> bytes:
return bcs.serialize(self, MultiEd25519PublicKey)
[docs] @staticmethod
def bcs_deserialize(input: bytes) -> 'MultiEd25519PublicKey':
v, buffer = bcs.deserialize(input, MultiEd25519PublicKey)
if buffer:
raise st.DeserializationError("Some input bytes were not read")
return v
[docs]@dataclass(frozen=True)
class MultiEd25519Signature:
value: bytes
[docs] def bcs_serialize(self) -> bytes:
return bcs.serialize(self, MultiEd25519Signature)
[docs] @staticmethod
def bcs_deserialize(input: bytes) -> 'MultiEd25519Signature':
v, buffer = bcs.deserialize(input, MultiEd25519Signature)
if buffer:
raise st.DeserializationError("Some input bytes were not read")
return v
[docs]@dataclass(frozen=True)
class NewBlockEvent:
number: st.uint64
author: "AccountAddress"
timestamp: st.uint64
uncles: st.uint64
[docs] def bcs_serialize(self) -> bytes:
return bcs.serialize(self, NewBlockEvent)
[docs] @staticmethod
def bcs_deserialize(input: bytes) -> 'NewBlockEvent':
v, buffer = bcs.deserialize(input, NewBlockEvent)
if buffer:
raise st.DeserializationError("Some input bytes were not read")
return v
[docs]@dataclass(frozen=True)
class Package:
package_address: "AccountAddress"
modules: typing.Sequence["Module"]
init_script: "Script"
[docs] def bcs_serialize(self) -> bytes:
return bcs.serialize(self, Package)
[docs] @staticmethod
def bcs_deserialize(input: bytes) -> 'Package':
v, buffer = bcs.deserialize(input, Package)
if buffer:
raise st.DeserializationError("Some input bytes were not read")
return v
[docs]@dataclass(frozen=True)
class ProposalCreatedEvent:
proposal_id: st.uint64
proposer: "AccountAddress"
[docs] def bcs_serialize(self) -> bytes:
return bcs.serialize(self, ProposalCreatedEvent)
[docs] @staticmethod
def bcs_deserialize(input: bytes) -> 'ProposalCreatedEvent':
v, buffer = bcs.deserialize(input, ProposalCreatedEvent)
if buffer:
raise st.DeserializationError("Some input bytes were not read")
return v
[docs]@dataclass(frozen=True)
class RawTransaction:
sender: "AccountAddress"
sequence_number: st.uint64
payload: "TransactionPayload"
max_gas_amount: st.uint64
gas_unit_price: st.uint64
gas_token_code: str
expiration_timestamp_secs: st.uint64
chain_id: "ChainId"
[docs] def bcs_serialize(self) -> bytes:
return bcs.serialize(self, RawTransaction)
[docs] @staticmethod
def bcs_deserialize(input: bytes) -> 'RawTransaction':
v, buffer = bcs.deserialize(input, RawTransaction)
if buffer:
raise st.DeserializationError("Some input bytes were not read")
return v
[docs]@dataclass(frozen=True)
class Script:
code: bytes
ty_args: typing.Sequence["TypeTag"]
args: typing.Sequence["TransactionArgument"]
[docs] def bcs_serialize(self) -> bytes:
return bcs.serialize(self, Script)
[docs] @staticmethod
def bcs_deserialize(input: bytes) -> 'Script':
v, buffer = bcs.deserialize(input, Script)
if buffer:
raise st.DeserializationError("Some input bytes were not read")
return v
[docs]@dataclass(frozen=True)
class ScriptFunction:
module: "ModuleId"
function: "Identifier"
ty_args: typing.Sequence["TypeTag"]
args: typing.Sequence["bytes"]
[docs] def bcs_serialize(self) -> bytes:
return bcs.serialize(self, ScriptFunction)
[docs] @staticmethod
def bcs_deserialize(input: bytes) -> 'ScriptFunction':
v, buffer = bcs.deserialize(input, ScriptFunction)
if buffer:
raise st.DeserializationError("Some input bytes were not read")
return v
[docs]@dataclass(frozen=True)
class SignedUserTransaction:
raw_txn: "RawTransaction"
authenticator: "TransactionAuthenticator"
[docs] def bcs_serialize(self) -> bytes:
return bcs.serialize(self, SignedUserTransaction)
[docs] @staticmethod
def bcs_deserialize(input: bytes) -> 'SignedUserTransaction':
v, buffer = bcs.deserialize(input, SignedUserTransaction)
if buffer:
raise st.DeserializationError("Some input bytes were not read")
return v
[docs]@dataclass(frozen=True)
class StructTag:
address: "AccountAddress"
module: "Identifier"
name: "Identifier"
type_params: typing.Sequence["TypeTag"]
[docs] def bcs_serialize(self) -> bytes:
return bcs.serialize(self, StructTag)
[docs] @staticmethod
def bcs_deserialize(input: bytes) -> 'StructTag':
v, buffer = bcs.deserialize(input, StructTag)
if buffer:
raise st.DeserializationError("Some input bytes were not read")
return v
[docs]@dataclass(frozen=True)
class TokenCode:
address: "AccountAddress"
module: str
name: str
[docs] def bcs_serialize(self) -> bytes:
return bcs.serialize(self, TokenCode)
[docs] @staticmethod
def bcs_deserialize(input: bytes) -> 'TokenCode':
v, buffer = bcs.deserialize(input, TokenCode)
if buffer:
raise st.DeserializationError("Some input bytes were not read")
return v
[docs]class Transaction:
VARIANTS = [] # type: typing.Sequence[typing.Type[Transaction]]
[docs] def bcs_serialize(self) -> bytes:
return bcs.serialize(self, Transaction)
[docs] @staticmethod
def bcs_deserialize(input: bytes) -> 'Transaction':
v, buffer = bcs.deserialize(input, Transaction)
if buffer:
raise st.DeserializationError("Some input bytes were not read")
return v
[docs]@dataclass(frozen=True)
class Transaction__UserTransaction(Transaction):
INDEX = 0 # type: int
value: "SignedUserTransaction"
Transaction.VARIANTS = [
Transaction__UserTransaction,
Transaction__BlockMetadata,
]
[docs]class TransactionArgument:
VARIANTS = [] # type: typing.Sequence[typing.Type[TransactionArgument]]
[docs] def bcs_serialize(self) -> bytes:
return bcs.serialize(self, TransactionArgument)
[docs] @staticmethod
def bcs_deserialize(input: bytes) -> 'TransactionArgument':
v, buffer = bcs.deserialize(input, TransactionArgument)
if buffer:
raise st.DeserializationError("Some input bytes were not read")
return v
[docs]@dataclass(frozen=True)
class TransactionArgument__U8(TransactionArgument):
INDEX = 0 # type: int
value: st.uint8
[docs]@dataclass(frozen=True)
class TransactionArgument__U64(TransactionArgument):
INDEX = 1 # type: int
value: st.uint64
[docs]@dataclass(frozen=True)
class TransactionArgument__U128(TransactionArgument):
INDEX = 2 # type: int
value: st.uint128
[docs]@dataclass(frozen=True)
class TransactionArgument__Address(TransactionArgument):
INDEX = 3 # type: int
value: "AccountAddress"
[docs]@dataclass(frozen=True)
class TransactionArgument__U8Vector(TransactionArgument):
INDEX = 4 # type: int
value: bytes
[docs]@dataclass(frozen=True)
class TransactionArgument__Bool(TransactionArgument):
INDEX = 5 # type: int
value: bool
TransactionArgument.VARIANTS = [
TransactionArgument__U8,
TransactionArgument__U64,
TransactionArgument__U128,
TransactionArgument__Address,
TransactionArgument__U8Vector,
TransactionArgument__Bool,
]
[docs]class TransactionAuthenticator:
VARIANTS = [] # type: typing.Sequence[typing.Type[TransactionAuthenticator]]
[docs] def bcs_serialize(self) -> bytes:
return bcs.serialize(self, TransactionAuthenticator)
[docs] @staticmethod
def bcs_deserialize(input: bytes) -> 'TransactionAuthenticator':
v, buffer = bcs.deserialize(input, TransactionAuthenticator)
if buffer:
raise st.DeserializationError("Some input bytes were not read")
return v
[docs]@dataclass(frozen=True)
class TransactionAuthenticator__Ed25519(TransactionAuthenticator):
INDEX = 0 # type: int
public_key: "Ed25519PublicKey"
signature: "Ed25519Signature"
[docs]@dataclass(frozen=True)
class TransactionAuthenticator__MultiEd25519(TransactionAuthenticator):
INDEX = 1 # type: int
public_key: "MultiEd25519PublicKey"
signature: "MultiEd25519Signature"
TransactionAuthenticator.VARIANTS = [
TransactionAuthenticator__Ed25519,
TransactionAuthenticator__MultiEd25519,
]
[docs]class TransactionPayload:
VARIANTS = [] # type: typing.Sequence[typing.Type[TransactionPayload]]
[docs] def bcs_serialize(self) -> bytes:
return bcs.serialize(self, TransactionPayload)
[docs] @staticmethod
def bcs_deserialize(input: bytes) -> 'TransactionPayload':
v, buffer = bcs.deserialize(input, TransactionPayload)
if buffer:
raise st.DeserializationError("Some input bytes were not read")
return v
[docs]@dataclass(frozen=True)
class TransactionPayload__Script(TransactionPayload):
INDEX = 0 # type: int
value: "Script"
[docs]@dataclass(frozen=True)
class TransactionPayload__Package(TransactionPayload):
INDEX = 1 # type: int
value: "Package"
[docs]@dataclass(frozen=True)
class TransactionPayload__ScriptFunction(TransactionPayload):
INDEX = 2 # type: int
value: "ScriptFunction"
TransactionPayload.VARIANTS = [
TransactionPayload__Script,
TransactionPayload__Package,
TransactionPayload__ScriptFunction,
]
TravelRuleMetadata.VARIANTS = [
TravelRuleMetadata__TravelRuleMetadataVersion0,
]
[docs]class TypeTag:
VARIANTS = [] # type: typing.Sequence[typing.Type[TypeTag]]
[docs] def bcs_serialize(self) -> bytes:
return bcs.serialize(self, TypeTag)
[docs] @staticmethod
def bcs_deserialize(input: bytes) -> 'TypeTag':
v, buffer = bcs.deserialize(input, TypeTag)
if buffer:
raise st.DeserializationError("Some input bytes were not read")
return v
[docs]@dataclass(frozen=True)
class TypeTag__Bool(TypeTag):
INDEX = 0 # type: int
pass
[docs]@dataclass(frozen=True)
class TypeTag__U8(TypeTag):
INDEX = 1 # type: int
pass
[docs]@dataclass(frozen=True)
class TypeTag__U64(TypeTag):
INDEX = 2 # type: int
pass
[docs]@dataclass(frozen=True)
class TypeTag__U128(TypeTag):
INDEX = 3 # type: int
pass
[docs]@dataclass(frozen=True)
class TypeTag__Address(TypeTag):
INDEX = 4 # type: int
pass
[docs]@dataclass(frozen=True)
class TypeTag__Signer(TypeTag):
INDEX = 5 # type: int
pass
[docs]@dataclass(frozen=True)
class TypeTag__Vector(TypeTag):
INDEX = 6 # type: int
value: "TypeTag"
[docs]@dataclass(frozen=True)
class TypeTag__Struct(TypeTag):
INDEX = 7 # type: int
value: "StructTag"
TypeTag.VARIANTS = [
TypeTag__Bool,
TypeTag__U8,
TypeTag__U64,
TypeTag__U128,
TypeTag__Address,
TypeTag__Signer,
TypeTag__Vector,
TypeTag__Struct,
]
[docs]@dataclass(frozen=True)
class VoteChangedEvent:
proposal_id: st.uint64
proposer: "AccountAddress"
voter: "AccountAddress"
agree: bool
vote: st.uint128
[docs] def bcs_serialize(self) -> bytes:
return bcs.serialize(self, VoteChangedEvent)
[docs] @staticmethod
def bcs_deserialize(input: bytes) -> 'VoteChangedEvent':
v, buffer = bcs.deserialize(input, VoteChangedEvent)
if buffer:
raise st.DeserializationError("Some input bytes were not read")
return v
[docs]@dataclass(frozen=True)
class WithdrawCapabilityResource:
account_address: "AccountAddress"
[docs] def bcs_serialize(self) -> bytes:
return bcs.serialize(self, WithdrawCapabilityResource)
[docs] @staticmethod
def bcs_deserialize(input: bytes) -> 'WithdrawCapabilityResource':
v, buffer = bcs.deserialize(input, WithdrawCapabilityResource)
if buffer:
raise st.DeserializationError("Some input bytes were not read")
return v
[docs]@dataclass(frozen=True)
class WithdrawEvent:
amount: st.uint128
token_code: "TokenCode"
metadata: typing.Sequence[st.uint8]
[docs] def bcs_serialize(self) -> bytes:
return bcs.serialize(self, WithdrawEvent)
[docs] @staticmethod
def bcs_deserialize(input: bytes) -> 'WithdrawEvent':
v, buffer = bcs.deserialize(input, WithdrawEvent)
if buffer:
raise st.DeserializationError("Some input bytes were not read")
return v
[docs]class WriteOp:
VARIANTS = [] # type: typing.Sequence[typing.Type[WriteOp]]
[docs] def bcs_serialize(self) -> bytes:
return bcs.serialize(self, WriteOp)
[docs] @staticmethod
def bcs_deserialize(input: bytes) -> 'WriteOp':
v, buffer = bcs.deserialize(input, WriteOp)
if buffer:
raise st.DeserializationError("Some input bytes were not read")
return v
[docs]@dataclass(frozen=True)
class WriteOp__Deletion(WriteOp):
INDEX = 0 # type: int
pass
[docs]@dataclass(frozen=True)
class WriteOp__Value(WriteOp):
INDEX = 1 # type: int
value: bytes
WriteOp.VARIANTS = [
WriteOp__Deletion,
WriteOp__Value,
]
[docs]@dataclass(frozen=True)
class WriteSet:
value: "WriteSetMut"
[docs] def bcs_serialize(self) -> bytes:
return bcs.serialize(self, WriteSet)
[docs] @staticmethod
def bcs_deserialize(input: bytes) -> 'WriteSet':
v, buffer = bcs.deserialize(input, WriteSet)
if buffer:
raise st.DeserializationError("Some input bytes were not read")
return v
[docs]@dataclass(frozen=True)
class WriteSetMut:
write_set: typing.Sequence[typing.Tuple["AccessPath", "WriteOp"]]
[docs] def bcs_serialize(self) -> bytes:
return bcs.serialize(self, WriteSetMut)
[docs] @staticmethod
def bcs_deserialize(input: bytes) -> 'WriteSetMut':
v, buffer = bcs.deserialize(input, WriteSetMut)
if buffer:
raise st.DeserializationError("Some input bytes were not read")
return v
[docs]class WriteSetPayload:
VARIANTS = [] # type: typing.Sequence[typing.Type[WriteSetPayload]]
[docs] def bcs_serialize(self) -> bytes:
return bcs.serialize(self, WriteSetPayload)
[docs] @staticmethod
def bcs_deserialize(input: bytes) -> 'WriteSetPayload':
v, buffer = bcs.deserialize(input, WriteSetPayload)
if buffer:
raise st.DeserializationError("Some input bytes were not read")
return v
[docs]@dataclass(frozen=True)
class WriteSetPayload__Direct(WriteSetPayload):
INDEX = 0 # type: int
value: "ChangeSet"
[docs]@dataclass(frozen=True)
class WriteSetPayload__Script(WriteSetPayload):
INDEX = 1 # type: int
execute_as: "AccountAddress"
script: "Script"
WriteSetPayload.VARIANTS = [
WriteSetPayload__Direct,
WriteSetPayload__Script,
]
[docs]@dataclass(frozen=True)
class SigningMessage:
value: bytes
[docs] def bcs_serialize(self) -> bytes:
return bcs.serialize(self, SigningMessage)
[docs] @staticmethod
def bcs_deserialize(input: bytes) -> 'SigningMessage':
v, buffer = bcs.deserialize(input, SigningMessage)
if buffer:
raise st.DeserializationError("Some input bytes were not read")
return v
[docs]@dataclass(frozen=True)
class SignedMessage:
account: AccountAddress
signing_message: SigningMessage
authenticator: TransactionAuthenticator
chain_id: ChainId
[docs] def bcs_serialize(self) -> bytes:
return bcs.serialize(self, SignedMessage)
[docs] @staticmethod
def bcs_deserialize(input: bytes) -> 'SignedMessage':
v, buffer = bcs.deserialize(input, SignedMessage)
if buffer:
raise st.DeserializationError("Some input bytes were not read")
return v