Faucet
Devnet, Testnet, and local networks include faucets that mint IOTA. You can use the IOTA TypeScript SDK to call a network's faucet and provide IOTA to the address you provide.
To request IOTA from a faucet, import the requestIotaFromFaucetV0
function from the
@iota/iota-sdk/faucet
package to your project.
import { getFaucetHost, requestIotaFromFaucetV0 } from '@iota/iota-sdk/faucet';
Use requestIotaFromFaucetV0
in your TypeScript code to request IOTA from the network's faucet.
await requestIotaFromFaucetV0({
host: getFaucetHost('testnet'),
recipient: <RECIPIENT_ADDRESS>,
});
info
Faucets on Devnet and Testnet are rate limited. If you run the script too many times, you surpass the limit and must wait to successfully run it again.