Skip to content

faucet.fund

Funds an account with an initial amount of tokens on Tempo's testnet.

Usage

example.ts
import { Actions } from 'tempo.ts/wagmi'
import { config } from './wagmi.config'
 
const hashes = await Actions.faucet.fund(config, {
  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 { Actions } from 'tempo.ts/wagmi'
import { config } from './wagmi.config'
 
const receipts = await Actions.faucet.fundSync(config, {
  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.