Skip to main content

Request Funds

Once you have created your account, you can start using the IOTA SDK 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.

Example Code

  1. Instantiate a Wallet, get Alice's Account which was created in the first guide and sync it.
  2. Get all the AccountAddress related to the Account by calling the Account.addresses() function.
sdk/examples/how_tos/simple_transaction/request_funds.rs
loading...
  1. Request funds to the FAUCET_URL you defined in the .env file by calling the Client::utils::request_funds_from_faucet function.
sdk/examples/how_tos/simple_transaction/request_funds.rs
loading...

Expected Output

rms1qpjt6zr7rfvl27le5xjcv0qhr90l92wtm6eu6v6jhtgvrjp7mwufq6nqxn8
{"address":"rms1qpjt6zr7rfvl27le5xjcv0qhr90l92wtm6eu6v6jhtgvrjp7mwufq6nqxn8","waitingRequests":11}

Full Example Code

sdk/examples/how_tos/simple_transaction/request_funds.rs
loading...