AccessAPI
public final class AccessAPI : FlowAccessProtocol
extension Flow.AccessAPI: FlowAccessBlockProtocol
The network client for access API More detail can be found here: https://docs.onflow.org/access-api
-
Ping will return a successful response if the Access API is ready and available.
Declaration
Swift
public func ping() -> EventLoopFuture<Bool>Return Value
A future result in
Booltype -
Gets the latest block header.
Declaration
Swift
public func getLatestBlockHeader() -> EventLoopFuture<Flow.BlockHeader>Return Value
A future result in
Flow.BlockHeadertype -
Gets a block header by ID.
Warning
If the response has no block, it will return nilDeclaration
Swift
public func getBlockHeaderById(id: Flow.ID) -> EventLoopFuture<Flow.BlockHeader?>Parameters
idThe id for the block in
Flow.IDtype.Return Value
A future result in
Flow.BlockHeader?type -
Gets a block header by height.
Warning
If the response has no block, it will return nilDeclaration
Swift
public func getBlockHeaderByHeight(height: UInt64) -> EventLoopFuture<Flow.BlockHeader?>Parameters
heightThe height for the block in
UInt64type.Return Value
A future result in
Flow.BlockHeader?type -
GetLatestBlock gets the full payload of the latest sealed or unsealed block.
Parameters
sealedThe flag for the block is sealed or unsealed, default value is
true.Return Value
A future result in
Flow.Block?type -
Gets a full block by ID.
Warning
If the response has no block, it will return nilParameters
idThe id for the block.
Return Value
A future result in
Flow.Block?type -
Gets a full block by height.
Warning
If the response has no block, it will return nilParameters
heightThe height for the block in
UInt64type.Return Value
A future result in
Flow.Block?type -
Gets a collection by ID.
Warning
If the response has no collection, it will return nilDeclaration
Swift
public func getCollectionById(id: Flow.ID) -> EventLoopFuture<Flow.Collection?>Parameters
idThe id for the collection.
Return Value
A future result in
Flow.Collection?type -
Submit a signed transaction to the network.
Declaration
Swift
public func sendTransaction(transaction: Flow.Transaction) -> EventLoopFuture<Flow.ID>Parameters
transactionThe signed transaction in
Flow.Transactiontype.Return Value
A future result in
Flow.IDtype as transaction id. -
Get a transaction by ID.
Warning
If the response has no transaction, it will return nilDeclaration
Swift
public func getTransactionById(id: Flow.ID) -> EventLoopFuture<Flow.Transaction?>Parameters
idThe id for the transaction.
Return Value
A future result in
Flow.Transaction?type as transaction. -
Get a transaction result by ID.
Declaration
Swift
public func getTransactionResultById(id: Flow.ID) -> EventLoopFuture<Flow.TransactionResult>Parameters
idThe id for the transaction.
Return Value
A future result in
Flow.TransactionResulttype -
Get an account result at lastest block.
Warning
If the response has no account, it will return nilDeclaration
Parameters
addressThe address of account.
Return Value
A future result in
Flow.Account?type -
Get an account result by height.
Warning
If the response has no account, it will return nilDeclaration
Parameters
addressThe address of account.
heightThe height of flow block.
Return Value
A future result in
Flow.Account?type -
Executes a read-only Cadence script against the latest sealed execution state.
Declaration
Parameters
scriptThe script content cadence code.
argumentsThe arguments for the cadence code.
Return Value
A future result in
Flow.ScriptResponsetype -
Executes a ready-only Cadence script against the execution state at the block with the given ID.
Declaration
Parameters
scriptThe script content cadence code.
blockIdThe id of the block
argumentsThe arguments for the cadence code.
Return Value
A future result in
Flow.ScriptResponsetype -
Executes a ready-only Cadence script against the execution state at the block with the given block height.
Declaration
Parameters
scriptThe script content cadence code.
heightThe height of the block
argumentsThe arguments for the cadence code.
Return Value
A future result in
Flow.ScriptResponsetype -
Retrieves events emitted within the specified block range.
Declaration
Parameters
typeThe type of event.
rangeThe range of the block height
Return Value
A future result in
Flow.Event.Resulttype -
Retrieves events for the specified block IDs and event type.
Declaration
Parameters
typeThe type of event.
idsThe list of the block id
Return Value
A future result in
Flow.Event.Resulttype -
Retrieves the Flow network details
Return Value
A future result in
Flow.ChainIDtype -
Retrieves the latest sealed protocol state snapshot. Used by Flow nodes joining the network to bootstrap a space-efficient local state.
Return Value
A future result in
Flow.Snapshottype -
Undocumented
Declaration
Swift
public func ping(completion: @escaping Callback<Bool>) -
Undocumented
Declaration
Swift
public func getLatestBlockHeader(completion: @escaping Callback<Flow.BlockHeader>) -
Undocumented
Declaration
Swift
public func getBlockHeaderById(id: Flow.ID, completion: @escaping Callback<Flow.BlockHeader?>) -
Undocumented
Declaration
Swift
public func getBlockHeaderByHeight(height: UInt64, completion: @escaping Callback<Flow.BlockHeader?>) -
Undocumented
Declaration
-
Undocumented
Declaration
-
Undocumented
Declaration
Swift
public func getCollectionById(id: Flow.ID, completion: @escaping Callback<Flow.Collection?>) -
Undocumented
Declaration
Swift
public func sendTransaction(transaction: Flow.Transaction, completion: @escaping Callback<Flow.ID>) -
Undocumented
Declaration
Swift
public func getTransactionById(id: Flow.ID, completion: @escaping Callback<Flow.Transaction?>) -
Undocumented
Declaration
Swift
public func getTransactionResultById(id: Flow.ID, completion: @escaping Callback<Flow.TransactionResult>) -
Undocumented
Declaration
-
Undocumented
Declaration
-
Undocumented
Declaration
-
Undocumented
Declaration
-
Undocumented
-
Undocumented
Declaration
View on GitHub
AccessAPI Class Reference