Interface: FaucetClientLike
Methods
request()
request(address, asyncOpts_?): Promise<string | undefined>;
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.
Parameters
address
asyncOpts_?
signal
AbortSignal
Returns
Promise<string | undefined>
requestAndWait()
requestAndWait(address, asyncOpts_?): Promise<FaucetReceipt | undefined>;
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. Returns FaucetError::Discarded if the
faucet discards the request.
Note that the faucet is heavily rate-limited, so calling repeatedly the faucet would likely result in a 429 code or 502 code.
If you intend to use the transferred tokens with the graphql client, consider using
request_and_wait_for_finalized instead to ensure the tokens are available in the indexer.
Parameters
address
asyncOpts_?
signal
AbortSignal
Returns
Promise<FaucetReceipt | undefined>
requestAndWaitForFinalized()
requestAndWaitForFinalized(
address,
client,
asyncOpts_?
): Promise<FaucetReceipt | undefined>;
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. Returns
FaucetError::Discarded if the faucet discards the request.
This is a convenience method that combines request_and_wait and waiting for the funding
transactions to be finalized using the provided GraphQL GraphQLClient.
Parameters
address
client
asyncOpts_?
signal
AbortSignal
Returns
Promise<FaucetReceipt | undefined>
requestStatus()
requestStatus(id, asyncOpts_?): Promise<
| FaucetBatchSendStatus
| undefined>;
Check the faucet request status.
Possible statuses are defined in: FaucetBatchSendStatusType
Returns an error without sending a request if id is empty or contains anything other than
ASCII letters, digits, -, {, } and :, which covers the UUID forms the faucet
accepts.
Parameters
id
string
asyncOpts_?
signal
AbortSignal
Returns
Promise<
| FaucetBatchSendStatus
| undefined>