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:36

Properties

address

static address: "0x000100000000000000000000000000000FA00CE7";

The const address of the Faucet contract.

Static

Defined

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

Methods

withdrawTo()

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

Withdraws the specified value to the given address.

Parameters

ParameterTypeDefault valueDescription

address

Hex

undefined

The address to which the withdrawal should be made.

value?

bigint

1000000000000000000n

The value that should be withdrawn to the given address.

seqno?

number

undefined

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:50


withdrawToWithRetry()

withdrawToWithRetry(
address,
value?,
retries?): 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

1000000000000000000n

The value that should be withdrawn to the given address.

retries?

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:82