-
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
authorizationThe Authorization to add.
atAn 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
atThe 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) throwsParameters
accountContract account name.
nameContract action name.
authorizationAuthorization (actor and permission).
dataAction data (codable struct).
-
Init Action struct with
EosioNames 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) throwsParameters
accountContract account name.
nameContract action name.
authorizationAuthorization (actor and permission).
dataAction 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]) throwsParameters
accountContract account name.
nameContract action name.
authorizationAuthorization (actor and permission).
dataDictionary.
-
Init Action struct with
EosioNames 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
accountContract account name.
nameContract action name.
authorizationAuthorization (actor and permission).
dataDictionary.
-
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) throwsParameters
accountContract account name.
nameContract action name.
authorizationAuthorization (actor and permission).
dataSerializedData in serialized form.
-
Init Action struct with
EosioNames and serialized data.Declaration
Swift
public init(account: EosioName, name: EosioName, authorization: [Authorization], dataSerialized: Data)Parameters
accountContract account name.
nameContract action name.
authorizationAuthorization (actor and permission).
dataSerializedData 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) throwsParameters
decoderThe 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) throwsParameters
encoderThe 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
datadictionary usingserializationProviderand an ABI. Then set thedataSerializedproperty.Throws
If the data cannot be serialized.Declaration
Swift
public func serializeData(abi: String, serializationProvider: EosioSerializationProviderProtocol) throwsParameters
abiThe ABI as a json string.
serializationProviderAn
EosioSerializationProviderProtocolconforming implementation for the transformation. -
Deserialize the data from the
dataSerializedproperty usingserializationProviderand an ABI. Then set thedatadictionary.Throws
If the data cannot be deserialized.Declaration
Swift
public func deserializeData(abi: String, serializationProvider: EosioSerializationProviderProtocol) throwsParameters
abiThe ABI as a json string.
serializationProviderAn
EosioSerializationProviderProtocolconforming implementation for the transformation. -
Authorization struct for
See moreEosioTransaction.Action.Declaration
Swift
public struct Authorization : Codable, Equatable
View on GitHub
Action Class Reference