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 Testnet Faucet.
Example Code
- Rust
- Typescript (Node.js)
- Python
- Instantiate a
Wallet, get Alice'sAccountwhich was created in the first guide and sync it. - Get all the
AccountAddressrelated to theAccountby calling theAccount.addresses()function.
- Request funds to the
FAUCET_URLyou defined in the.envfile by calling theClient::utils::request_funds_from_faucetfunction.
The following example will:
- Instantiate a
Wallet, get Alice'sAccountwhich was created in the first guide and sync it. - Retrieve the first address related to Alice's account by calling the
Account.addresses()function.
- Request funds to the
FAUCET_URLyou defined in the.envfile by calling theClient.requestFundsFromFaucetfunction.
- Instantiate a
Wallet, get Alice'sAccountwhich was created in the first guide and sync it. - Get all the
Addressesrelated to theAccountby calling theAccount.addresses()function, and then select the first one.
- Request funds to the
FAUCET_URLyou defined in the.envfile by calling theClient.request_funds_from_faucetfunction.
Expected Output
rms1qpjt6zr7rfvl27le5xjcv0qhr90l92wtm6eu6v6jhtgvrjp7mwufq6nqxn8
{"address":"rms1qpjt6zr7rfvl27le5xjcv0qhr90l92wtm6eu6v6jhtgvrjp7mwufq6nqxn8","waitingRequests":11}
Full Example Code
- Rust
- Typescript (Node.js)
- Python
sdk/examples/how_tos/simple_transaction/request_funds.rs
loading...
bindings/nodejs/examples/how_tos/simple_transaction/request-funds.ts
loading...
bindings/python/examples/how_tos/simple_transaction/request_funds.py
loading...