Skip to main content

Class: Faucet

The Faucet is a special contract that is used to top up other contracts in the =nil; devnet.

Faucet

Constructors

new Faucet()

new Faucet(client): Faucet

Creates an instance of Faucet.

Parameters

ParameterTypeDescription

client

PublicClient

Returns

Faucet

Defined

@nilfoundation/niljs/src/contracts/Faucet/Faucet.ts:37

Properties

address

static address: "0x000100000000000000000000000000000FA00CE7";

The const address of the Faucet contract.

Static

Defined

@nilfoundation/niljs/src/contracts/Faucet/Faucet.ts:22

Methods

withdrawTo()

withdrawTo(
address,
value?,
seqno?): Promise<Uint8Array>

Withdraws the specified value to the given address.

Parameters

ParameterTypeDescription

address

Hex

The address to which the withdrawal should be made.

value?

bigint

The value that should be withdrawn to the given address.

seqno?

number

The sequence number of the withdrawal message.

Returns

Promise<Uint8Array>

The hash of the withdrawal message.

Deprecated

Async

Defined

@nilfoundation/niljs/src/contracts/Faucet/Faucet.ts:51


withdrawToWithRetry()

withdrawToWithRetry(
address,
value?,
retry?): Promise<any>

Withdraws the specified value to the given address with retries.

Parameters

ParameterTypeDefault valueDescription

address

Hex

undefined

The address to which the withdrawal should be made.

value?

bigint

...

The value that should be withdrawn to the given address.

retry?

number

5

How many times to retry the withdrawal in case of failure.

Returns

Promise<any>

The hash of the withdrawal message.

Async

Defined

@nilfoundation/niljs/src/contracts/Faucet/Faucet.ts:83