Skip to main content

contracts/handlers/validator-ticket-handler

Classes

ValidatorTicketHandler

Defined in: lib/contracts/handlers/validator-ticket-handler.ts:18

Handler for the ValidatorTicket contract exposing methods to interact with the contract.

Constructors

Constructor

new ValidatorTicketHandler(chain, walletClient, publicClient): ValidatorTicketHandler

Defined in: lib/contracts/handlers/validator-ticket-handler.ts:31

Create the handler for the ValidatorTicket contract exposing methods to interact with the contract.

Parameters
ParameterTypeDescription
chainChainChain to use for the client.
walletClient{ }The wallet client to use for wallet interactions.
publicClient{ }The public client to use for public interactions.
Returns

ValidatorTicketHandler

Methods

approve()

approve(spender, amount): Promise<`0x${string}`>

Defined in: lib/contracts/handlers/validator-ticket-handler.ts:120

Approve a spender to spend the validator ticket.

Parameters
ParameterTypeDescription
spender`0x${string}`The spender of the validator ticket.
amountbigintThe amount to approve.
Returns

Promise<`0x${string}`>

The transaction.

burn()

burn(amount): Promise<`0x${string}`>

Defined in: lib/contracts/handlers/validator-ticket-handler.ts:163

Burn validator tickets.

Parameters
ParameterTypeDescription
amountbigintThe amount to burn.
Returns

Promise<`0x${string}`>

The transaction.

getAllowance()

getAllowance(owner, spender): Promise<bigint>

Defined in: lib/contracts/handlers/validator-ticket-handler.ts:134

Get the allowance of the owner for the spender.

Parameters
ParameterTypeDescription
owner`0x${string}`The owner of the allowance.
spender`0x${string}`The spender of the allowance.
Returns

Promise<bigint>

The allowance.

getBalance()

getBalance(address): Promise<bigint>

Defined in: lib/contracts/handlers/validator-ticket-handler.ts:144

Get the balance for the address.

Parameters
ParameterTypeDescription
address`0x${string}`The address to get the balance of.
Returns

Promise<bigint>

The balance.

getContract()

getContract(): object

Defined in: lib/contracts/handlers/validator-ticket-handler.ts:44

Get the contract.

Returns

object

The viem contract.

getDecimals()

getDecimals(): Promise<number>

Defined in: lib/contracts/handlers/validator-ticket-handler.ts:298

Get the decimals of the token.

Returns

Promise<number>

The token decimals.

getDomainSeparator()

getDomainSeparator(): Promise<`0x${string}`>

Defined in: lib/contracts/handlers/validator-ticket-handler.ts:222

Get the domain separator for EIP-712 signatures.

Returns

Promise<`0x${string}`>

The domain separator.

getEip712Domain()

getEip712Domain(): Promise<readonly [`0x${string}`, string, string, bigint, `0x${string}`, `0x${string}`, readonly bigint[]]>

Defined in: lib/contracts/handlers/validator-ticket-handler.ts:271

Get the EIP-712 domain information.

Returns

Promise<readonly [`0x${string}`, string, string, bigint, `0x${string}`, `0x${string}`, readonly bigint[]]>

The EIP-712 domain information.

getGuardiansFeeRate()

getGuardiansFeeRate(): Promise<bigint>

Defined in: lib/contracts/handlers/validator-ticket-handler.ts:204

Get the guardians fee rate.

Returns

Promise<bigint>

The guardians fee rate.

getName()

getName(): Promise<string>

Defined in: lib/contracts/handlers/validator-ticket-handler.ts:280

Get the name of the token.

Returns

Promise<string>

The token name.

getNonce()

getNonce(owner): Promise<bigint>

Defined in: lib/contracts/handlers/validator-ticket-handler.ts:232

Get the nonce for an owner.

Parameters
ParameterTypeDescription
owner`0x${string}`The owner address.
Returns

Promise<bigint>

The nonce.

getProtocolFeeRate()

getProtocolFeeRate(): Promise<bigint>

Defined in: lib/contracts/handlers/validator-ticket-handler.ts:213

Get the protocol fee rate.

Returns

Promise<bigint>

The protocol fee rate.

getSymbol()

getSymbol(): Promise<string>

Defined in: lib/contracts/handlers/validator-ticket-handler.ts:289

Get the symbol of the token.

Returns

Promise<string>

The token symbol.

getTotalSupply()

getTotalSupply(): Promise<bigint>

Defined in: lib/contracts/handlers/validator-ticket-handler.ts:153

Get the total supply of the validator ticket.

Returns

Promise<bigint>

The total supply.

permit()

permit(owner, spender, value, deadline, v, r, s): Promise<`0x${string}`>

Defined in: lib/contracts/handlers/validator-ticket-handler.ts:248

Permit function for EIP-2612 approval.

Parameters
ParameterTypeDescription
owner`0x${string}`The owner address.
spender`0x${string}`The spender address.
valuebigintThe amount to approve.
deadlinebigintThe deadline for the permit.
vnumberThe v component of the signature.
r`0x${string}`The r component of the signature.
s`0x${string}`The s component of the signature.
Returns

Promise<`0x${string}`>

The transaction.

purchaseValidatorTicket()

purchaseValidatorTicket(recipient, payableAmount): Promise<`0x${string}`>

Defined in: lib/contracts/handlers/validator-ticket-handler.ts:63

Purchase validator ticket with ETH.

Parameters
ParameterTypeDescription
recipient`0x${string}`The recipient of the validator ticket.
payableAmountbigintThe amount of ETH to send with the transaction.
Returns

Promise<`0x${string}`>

The transaction.

purchaseValidatorTicketWithPufETH()

purchaseValidatorTicketWithPufETH(recipient, vtAmount): Promise<`0x${string}`>

Defined in: lib/contracts/handlers/validator-ticket-handler.ts:78

Purchase validator ticket with pufETH.

Parameters
ParameterTypeDescription
recipient`0x${string}`The recipient of the validator ticket.
vtAmountbigintThe amount of validator tickets to purchase.
Returns

Promise<`0x${string}`>

The transaction.

purchaseValidatorTicketWithPufETHAndPermit()

purchaseValidatorTicketWithPufETHAndPermit(recipient, vtAmount, permitData): Promise<`0x${string}`>

Defined in: lib/contracts/handlers/validator-ticket-handler.ts:99

Purchase validator ticket with pufETH and permit.

Parameters
ParameterTypeDescription
recipient`0x${string}`The recipient of the validator ticket.
vtAmountbigintThe amount of validator tickets to purchase.
permitDataPermitDataThe permit data for pufETH approval.
Returns

Promise<`0x${string}`>

The transaction.

transfer()

transfer(to, amount): Promise<`0x${string}`>

Defined in: lib/contracts/handlers/validator-ticket-handler.ts:177

Transfer validator tickets.

Parameters
ParameterTypeDescription
to`0x${string}`The recipient address.
amountbigintThe amount to transfer.
Returns

Promise<`0x${string}`>

The transaction.

transferFrom()

transferFrom(from, to, amount): Promise<`0x${string}`>

Defined in: lib/contracts/handlers/validator-ticket-handler.ts:192

Transfer validator tickets from another address.

Parameters
ParameterTypeDescription
from`0x${string}`The sender address.
to`0x${string}`The recipient address.
amountbigintThe amount to transfer.
Returns

Promise<`0x${string}`>

The transaction.