EosioAbieosSerializationProvider
public class EosioAbieosSerializationProvider : EosioSerializationProviderProtocol
Serialization provider implementation for EOSIO SDK for Swift using ABIEOS. Responsible for ABI-driven transaction and action serialization and deserialization between JSON and binary data representations.
-
Used to hold errors.
Declaration
Swift
public class Error : EosioError -
Getter to return error as a String.
Declaration
Swift
public var error: String? { get } -
Default init.
Declaration
Swift
required public init() -
Convert ABIEOS String data to UInt64 value.
Declaration
Swift
public func name64(string: String?) -> UInt64Parameters
stringString data to convert.
Return Value
A UInt64 value.
-
Convert ABIEOS UInt64 data to String value.
Declaration
Swift
public func string(name64: UInt64) -> String?Parameters
name64A UInt64 value to convert.
Return Value
A string value.
-
Convert JSON Transaction data representation to ABIEOS binary representation of Transaction data.
Throws
If the data cannot be serialized for any reason.Declaration
Swift
public func serializeTransaction(json: String) throws -> StringParameters
jsonThe JSON representation of Transaction data to serialize.
Return Value
A binary String of Transaction data.
-
Convert JSON ABI data representation to ABIEOS binary of data.
Throws
If the data cannot be serialized for any reason.Declaration
Swift
public func serializeAbi(json: String) throws -> StringParameters
jsonThe JSON data String to serialize.
Return Value
A String of binary data.
-
Calls ABIEOS to carry out JSON to binary conversion using ABIs.
Throws
If the data cannot be serialized for any reason.Declaration
Swift
public func serialize(contract: String?, name: String = "", type: String? = nil, json: String, abi: String) throws -> StringParameters
contractAn optional String representing contract name for the serialize action lookup for this ABIEOS conversion.
nameAn optional String representing an action name that is used in conjunction with contract (above) to derive the serialize type name.
typeAn optional string representing the type name for the serialize action lookup for this serialize conversion.
jsonThe JSON data String to serialize to binary.
abiA String representation of the ABI to use for conversion.
Return Value
A String of binary serialized data.
-
Converts a binary string of ABIEOS Transaction data to JSON string representation of Transaction data.
Throws
If the data cannot be deserialized for any reason.Declaration
Swift
public func deserializeTransaction(hex: String) throws -> StringParameters
hexThe binary Transaction data String to deserialize.
Return Value
A String of JSON Transaction data.
-
Converts a binary string of ABIEOS data to JSON string data.
Throws
If the data cannot be deserialized for any reason.Declaration
Swift
public func deserializeAbi(hex: String) throws -> StringParameters
hexThe binary data String to deserialize.
Return Value
A String of JSON data.
-
Calls ABIEOS to carry out binary to JSON conversion using ABIs.
Throws
If the data cannot be deserialized for any reason.Declaration
Swift
public func deserialize(contract: String?, name: String = "", type: String? = nil, hex: String, abi: String) throws -> StringParameters
contractAn optional String representing contract name for the ABIEOS action lookup for this ABIEOS conversion.
nameAn optional String representing an action name that is used in conjunction with contract (above) to derive the ABIEOS type name.
typeAn optional string representing the type name for the ABIEOS action lookup for this ABIEOS conversion.
hexThe binary data String to deserialize to a JSON String.
abiA String representation of the ABI to use for conversion.
Return Value
A String of JSON data.
View on GitHub
EosioAbieosSerializationProvider Class Reference