Skip to content

faucet.fund

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

Usage

ts
import {  } from 'wagmi/tempo'
import {  } from './config'

const  = await ..(, {
  : '0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef',
})

.('Transaction hashes:', )
Transaction hashes: ['0x...', '0x...']
ts
import { createConfig, http } from 'wagmi'
import { tempoTestnet } from 'wagmi/chains'
import { KeyManager, webAuthn } from 'wagmi/tempo'

export const config = createConfig({
  connectors: [
    webAuthn({
      keyManager: KeyManager.localStorage(),
    }),
  ],
  chains: [tempoTestnet],
  multiInjectedProviderDiscovery: false,
  transports: {
    [tempoTestnet.id]: http(),
  },
})

Synchronous Usage

Use fundSync to wait for the transactions to be included on a block before returning:

ts
import {  } from 'wagmi/tempo'

const  = await ..(, {
  : '0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef',
})

.('Receipts:', )
Receipts: [{ blockNumber: 123n, ... }, { blockNumber: 123n, ... }]

Return Type

fund

ts
type ReturnType = readonly Hash[]

Returns an array of transaction hashes for the funding transactions.

fundSync

ts
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.

Viem

Released under the MIT License.