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:
- Create an account manager.
- Get Alice's account which was created in the first guide.
- Retrieve an address related to Alice's account.
- Request funds to the
FAUCET_URL
you defined in the.env
file.
- Rust
- Nodejs
- Python
- Java
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
wallet/bindings/nodejs/examples/33-request-funds.js
loading...
You can run the example by running the following command from the wallet/bindings/nodejs/examples/
folder:
node 33-request-funds.js
wallet/bindings/python/examples/request_funds.py
loading...
wallet/bindings/java/examples/src/RequestFundsFromFaucet.java
loading...
Expected Output
- Rust
- Nodejs
- Python
- Java
{
"address": "tst1qpllaj0pyveqfkwxmnngz2c488hfdtmfrj3wfkgxtk4gtyrax0jax7rgxyj",
"waitingRequests": 1
}
{"address":"rms1qzrux5tuhpfrc84gwau7ldg0xjvnkuheg3pnmjx94jrpah8rqqmuz3crlzm","waitingRequests":1}
balance before faucet request: 0
available account balance after faucet request: 1000000000
available account balance before faucet request: 0
available account balance after faucet request: 1000000000