Skip to main content

Request Funds

Once you have created your account, you can start using wallet.rs for value transactions. Since these examples target the testnet, you can request funds using the request_funds_from_faucet function.

Online Faucet

You can request test funds from the Shimmer Testnet Faucet.

Code Example

The following example will:

  1. Create an account manager.
  2. Get Alice's account which was created in the first guide.
  3. Retrieve an address related to Alice's account.
  4. Request funds to the FAUCET_URL you defined in the .env file.
Dotenv

This example uses dotenv, which is not safe for use in production environments.

wallet/examples/03_get_funds.rs
loading...

Run the example by running the following command:

cargo run --example get_funds --release

Expected Output

{
"address": "tst1qpllaj0pyveqfkwxmnngz2c488hfdtmfrj3wfkgxtk4gtyrax0jax7rgxyj",
"waitingRequests": 1
}