FaucetClient
open class FaucetClient : Disposable, AutoCloseable, FaucetClientInterface
Constructors
| FaucetClient | constructor(faucetUrl: String) Construct a new FaucetClient with the given faucet service URL. This FaucetClient expects that the service provides two endpoints: /v1/gas and /v1/status. As such, do not provide the request endpoint, just the top level service endpoint. |
Functions
| Name | Summary |
|---|---|
| close | @Synchronized open override fun close() |
| destroy | open override fun destroy() |
| request | open suspend override fun request(address: Address): String? Request gas from the faucet. Note that this will return the UUID of the request and not wait until the token is received. Use request_and_wait to wait for the token. |
| requestAndWait | open suspend override fun requestAndWait(address: Address): FaucetReceipt? Request gas from the faucet and wait until the request is completed and token is transferred. Returns FaucetReceipt if the request is successful, which contains the list of tokens transferred, and the transaction digest. |
| requestAndWaitForFinalized | open suspend override fun requestAndWaitForFinalized(address: Address, client: GraphQlClient): FaucetReceipt? Request gas from the faucet and wait until the request is completed and token is transferred and finalized on the ledger. Returns FaucetReceipt if the request is successful, which contains the list of tokens transferred, and the transaction digest. |
| requestStatus | open suspend override fun requestStatus(id: String): BatchSendStatus? Check the faucet request status. |
Companion object functions
| Name | Summary |
|---|---|
| newLocalnet | fun newLocalnet(): FaucetClient Create a new Faucet client connected to a localnet faucet. |