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?) -> UInt64
Parameters
string
String data to convert.
Return Value
A UInt64 value.
-
Convert ABIEOS UInt64 data to String value.
Declaration
Swift
public func string(name64: UInt64) -> String?
Parameters
name64
A 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 -> String
Parameters
json
The 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 -> String
Parameters
json
The 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 -> String
Parameters
contract
An optional String representing contract name for the serialize action lookup for this ABIEOS conversion.
name
An optional String representing an action name that is used in conjunction with contract (above) to derive the serialize type name.
type
An optional string representing the type name for the serialize action lookup for this serialize conversion.
json
The JSON data String to serialize to binary.
abi
A 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 -> String
Parameters
hex
The 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 -> String
Parameters
hex
The 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 -> String
Parameters
contract
An optional String representing contract name for the ABIEOS action lookup for this ABIEOS conversion.
name
An optional String representing an action name that is used in conjunction with contract (above) to derive the ABIEOS type name.
type
An optional string representing the type name for the ABIEOS action lookup for this ABIEOS conversion.
hex
The binary data String to deserialize to a JSON String.
abi
A String representation of the ABI to use for conversion.
Return Value
A String of JSON data.