faucet.fund
Funds an account with an initial amount of tokens on Tempo's testnet.
Usage
example.ts
import { client } from './viem.config'
const hashes = await client.faucet.fund({
account: '0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef',
})
console.log('Transaction hashes:', hashes)
Transaction hashes: ['0x...', '0x...']Synchronous Usage
Use fundSync to wait for the transactions to be included on a block before returning:
import { client } from './viem.config'
const receipts = await client.faucet.fundSync({
account: '0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef',
})
console.log('Receipts:', receipts)
Receipts: [{ blockNumber: 123n, ... }, { blockNumber: 123n, ... }]Return Type
fund
type ReturnType = readonly Hash[]Returns an array of transaction hashes for the funding transactions.
fundSync
type ReturnType = readonly TransactionReceipt[]Returns an array of transaction receipts after the transactions are confirmed.
Parameters
account
- Type:
Account | Address
Account to fund with testnet tokens.
timeout (fundSync only)
- Type:
number - Default:
10000
Timeout in milliseconds to wait for transaction confirmation.