EosioSerializationProviderProtocol
public protocol EosioSerializationProviderProtocol
The protocol to which serialization provider implementations must conform. Serialization providers are responsible for ABI-driven transaction and action serialization and deserialization between JSON and binary data representations.
-
Used to hold errors.
Declaration
Swift
var error: String? { get } -
Initializer for the
EosioSerializationProviderProtocol.Declaration
Swift
init() -
The method signature for general serialization requests to conforming serialization providers. Carries out JSON to binary conversion using ABIs.
Throws
If the data cannot be serialized for any reason.Declaration
Swift
func serialize(contract: String?, name: String, type: String?, json: String, abi: String) throws -> StringParameters
contractAn optional
Stringrepresenting contract name for the serialize action lookup for this conversion.nameAn optional
Stringrepresenting an action name that is used in conjunction with contract (above) to derive the serialize type name.typeAn optional
Stringrepresenting the type name for the action lookup for this serialize conversion.jsonThe JSON data
Stringto serialize to binary.abiA
Stringrepresentation of the ABI to use for conversion.Return Value
A
Stringof binary serialized data. -
The method signature for general deserialization requests to conforming serialization providers. Carries out binary to JSON conversion using ABIs.
Throws
If the data cannot be deserialized for any reason.Declaration
Swift
func deserialize(contract: String?, name: String, type: String?, hex: String, abi: String) throws -> StringParameters
contractAn optional
Stringrepresenting contract name for the deserialize action lookup for this conversion.nameAn optional
Stringrepresenting an action name that is used in conjunction with contract (above) to derive the deserialize type name.typeAn optional
Stringrepresenting the type name for the action lookup for this deserialize conversion.hexThe binary data
Stringto deserialize to a JSON String.abiA
Stringrepresentation of the ABI to use for conversion.Return Value
A
Stringof JSON data. -
The method signature for transaction serialization requests to conforming serialization providers. Convert JSON Transaction data representation to binary
Stringrepresentation of Transaction data.Throws
If the data cannot be serialized for any reason.Declaration
Swift
func serializeTransaction(json: String) throws -> StringParameters
jsonThe JSON representation of Transaction data to serialize.
Return Value
A binary
Stringrepresentation of Transaction data. -
The method signature for transaction deserialization requests to conforming serialization providers. Converts a binary
Stringrepresentation of Transaction data to JSONStringof Transaction data.Throws
If the data cannot be deserialized for any reason.Declaration
Swift
func deserializeTransaction(hex: String) throws -> StringParameters
hexThe binary Transaction data
Stringto deserialize.Return Value
A
Stringof JSON Transaction data. -
The method signature for ABI serialization requests to conforming serialization providers. Convert JSON ABI to a
Stringbinary representation of data.Throws
If the data cannot be serialized for any reason.Declaration
Swift
func serializeAbi(json: String) throws -> StringParameters
jsonThe JSON data
Stringto serialize.Return Value
A
Stringrepresentation of binary data. -
The method signature for ABI deserialization requests to conforming serialization providers. Converts a binary
Stringhex representation of an ABI to a JSONString.Throws
If the data cannot be deserialized for any reason.Declaration
Swift
func deserializeAbi(hex: String) throws -> StringParameters
hexThe binary data
Stringto deserialize.Return Value
A
Stringof JSON data.
View on GitHub
EosioSerializationProviderProtocol Protocol Reference