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
Bool
type -
Gets the latest block header.
Declaration
Swift
public func getLatestBlockHeader() -> EventLoopFuture<Flow.BlockHeader>
Return Value
A future result in
Flow.BlockHeader
type -
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
id
The id for the block in
Flow.ID
type.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
height
The height for the block in
UInt64
type.Return Value
A future result in
Flow.BlockHeader?
type -
GetLatestBlock gets the full payload of the latest sealed or unsealed block.
Parameters
sealed
The 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
id
The 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
height
The height for the block in
UInt64
type.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
id
The 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
transaction
The signed transaction in
Flow.Transaction
type.Return Value
A future result in
Flow.ID
type 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
id
The 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
id
The id for the transaction.
Return Value
A future result in
Flow.TransactionResult
type -
Get an account result at lastest block.
Warning
If the response has no account, it will return nilDeclaration
Parameters
address
The 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
address
The address of account.
height
The 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
script
The script content cadence code.
arguments
The arguments for the cadence code.
Return Value
A future result in
Flow.ScriptResponse
type -
Executes a ready-only Cadence script against the execution state at the block with the given ID.
Declaration
Parameters
script
The script content cadence code.
blockId
The id of the block
arguments
The arguments for the cadence code.
Return Value
A future result in
Flow.ScriptResponse
type -
Executes a ready-only Cadence script against the execution state at the block with the given block height.
Declaration
Parameters
script
The script content cadence code.
height
The height of the block
arguments
The arguments for the cadence code.
Return Value
A future result in
Flow.ScriptResponse
type -
Retrieves events emitted within the specified block range.
Declaration
Parameters
type
The type of event.
range
The range of the block height
Return Value
A future result in
Flow.Event.Result
type -
Retrieves events for the specified block IDs and event type.
Declaration
Parameters
type
The type of event.
ids
The list of the block id
Return Value
A future result in
Flow.Event.Result
type -
Retrieves the Flow network details
Return Value
A future result in
Flow.ChainID
type -
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.Snapshot
type -
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