EosioAbiProvider
public class EosioAbiProvider : EosioAbiProviderProtocol
Default implementation of the EosioAbiProviderProtocol
. For fetching and caching ABIs.
-
Initialize the ABI Provider.
Declaration
Swift
public init(rpcProvider: EosioRpcProviderProtocol)
Parameters
rpcProvider
The RPC provider, which this ABI provider will use to fetch ABIs.
-
Get all ABIs for the given accounts, keyed by account name.
Declaration
Swift
public func getAbis(chainId: String, accounts: [EosioName], completion: @escaping (EosioResult<[EosioName : Data], EosioError>) -> Void)
Parameters
chainId
The chain ID.
accounts
An array of account names as
EosioName
s.completion
Calls the completion with an
EosioResult
containing a map of ABIs as Data for all of the given accounts, keyed by the account name. An ABI for each account must be returned, otherwise anEosioResult.failure
type will be returned. -
Get the ABI as
Data
for the specified account name.Declaration
Swift
public func getAbi(chainId: String, account: EosioName, completion: @escaping (EosioResult<Data, EosioError>) -> Void)
Parameters
chainId
The chain ID.
account
The account name as an
EosioName
.completion
Calls the completion with an
EosioResult
containing the ABI as Data. AnEosioResult.failure
type will be returned if the specified ABI could not be found or decoded properly.