-
Contract account name.
Declaration
Swift
public private(set) var account: EosioName { get }
-
Contract action name.
Declaration
Swift
public private(set) var name: EosioName { get }
-
Authorization (actor and permission).
Declaration
Swift
public private(set) var authorization: [Authorization] { get }
-
Action data.
Declaration
Swift
public private(set) var data: [String : Any] { get }
-
Action return value.
Declaration
Swift
public internal(set) var returnValue: Any? { get }
-
Action data as a json string.
Declaration
Swift
public var dataJson: String? { get }
-
Action data in serialized form.
Declaration
Swift
public private(set) var dataSerialized: Data? { get }
-
Action data in serialized form as a hex string.
Declaration
Swift
public var dataHex: String? { get }
-
Is the action data serialized?
Declaration
Swift
public var isDataSerialized: Bool { get }
-
Add an Authorization.
Declaration
Swift
public func add(authorization auth: Authorization, at: Int? = nil)
Parameters
authorization
The Authorization to add.
at
An optional index at which to insert the Authorization. If not provided, the Authorization will be appended to the end of the authorization array.
-
Remove an Authorization.
Declaration
Swift
public func removeAuthorization(at: Int) -> Authorization?
Parameters
at
The position of the authorization to remove. index must be a valid index of the collection that is not equal to the collection’s end index
-
Init Action struct with strings and an Encodable struct for data. Strings will be used to init EosioNames.
Throws
If the strings are not valid EOSIO names or data cannot be encoded.Declaration
Swift
public convenience init(account: String, name: String, authorization: [Authorization], data: Encodable) throws
Parameters
account
Contract account name.
name
Contract action name.
authorization
Authorization (actor and permission).
data
Action data (codable struct).
-
Init Action struct with
EosioName
s and an Encodable struct for data.Throws
If the strings are not valid eosio names or data cannot be encoded.Declaration
Swift
public convenience init(account: EosioName, name: EosioName, authorization: [Authorization], data: Encodable) throws
Parameters
account
Contract account name.
name
Contract action name.
authorization
Authorization (actor and permission).
data
Action data (codable struct).
-
Init Action struct with strings and a Dictionary for data. Strings will be used to init EosioNames.
Throws
If the strings are not valid EOSIO names or data cannot be encoded.Declaration
Swift
public convenience init(account: String, name: String, authorization: [Authorization], data: [String : Any]) throws
Parameters
account
Contract account name.
name
Contract action name.
authorization
Authorization (actor and permission).
data
Dictionary.
-
Init Action struct with
EosioName
s and a Dictionary for data.Throws
If the strings are not valid eosio names or data cannot be encoded.Declaration
Swift
public init(account: EosioName, name: EosioName, authorization: [Authorization], data: [String : Any])
Parameters
account
Contract account name.
name
Contract action name.
authorization
Authorization (actor and permission).
data
Dictionary.
-
Init Action struct with strings and serialized data. Strings will be used to init EosioNames.
Throws
If the strings are not valid EOSIO names.Declaration
Swift
public convenience init(account: String, name: String, authorization: [Authorization], dataSerialized: Data) throws
Parameters
account
Contract account name.
name
Contract action name.
authorization
Authorization (actor and permission).
dataSerialized
Data in serialized form.
-
Init Action struct with
EosioName
s and serialized data.Declaration
Swift
public init(account: EosioName, name: EosioName, authorization: [Authorization], dataSerialized: Data)
Parameters
account
Contract account name.
name
Contract action name.
authorization
Authorization (actor and permission).
dataSerialized
Data in serialized form.
-
Init with decoder. The data property must be a hex string.
Throws
If the input cannot be decoded into a Action struct.Declaration
Swift
required public init(from decoder: Decoder) throws
Parameters
decoder
The decoder.
-
Encode this action using the Encodable protocol. Action data will be serialized.
Throws
If the action cannot be encoded.Declaration
Swift
public func encode(to encoder: Encoder) throws
Parameters
encoder
The encoder.
-
Return the action as a Dictionary. Action data will be unserialized.
Declaration
Swift
public var actionAsDictionary: [String : Any] { get }
-
Serialize the data from the
data
dictionary usingserializationProvider
and an ABI. Then set thedataSerialized
property.Throws
If the data cannot be serialized.Declaration
Swift
public func serializeData(abi: String, serializationProvider: EosioSerializationProviderProtocol) throws
Parameters
abi
The ABI as a json string.
serializationProvider
An
EosioSerializationProviderProtocol
conforming implementation for the transformation. -
Deserialize the data from the
dataSerialized
property usingserializationProvider
and an ABI. Then set thedata
dictionary.Throws
If the data cannot be deserialized.Declaration
Swift
public func deserializeData(abi: String, serializationProvider: EosioSerializationProviderProtocol) throws
Parameters
abi
The ABI as a json string.
serializationProvider
An
EosioSerializationProviderProtocol
conforming implementation for the transformation. -
Authorization struct for
See moreEosioTransaction.Action
.Declaration
Swift
public struct Authorization : Codable, Equatable