Skip to main content

contracts/handlers/vl-puffer-handler

Classes

VLPufferHandler

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

Constructors

new VLPufferHandler()

new VLPufferHandler(chain, walletClient, publicClient): VLPufferHandler

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

Parameters
ParameterTypeDescription
chainChainChain to use for the client.
walletClientobjectThe wallet client to use for wallet interactions.
publicClientobjectThe public client to use for public interactions.
Returns

VLPufferHandler

Source

lib/contracts/handlers/vl-puffer-handler.ts:35

Properties

PropertyModifierTypeDescription
chainprivateChainChain to use for the client.
erc20PermitHandlerprivateERC20PermitHandler-
publicClientprivateobjectThe public client to use for public interactions.
viemChainprivateChain-
walletClientprivateobjectThe wallet client to use for wallet interactions.

Methods

PUFFER()

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

Get the PUFFER token address.

Returns

Promise<`0x${string}`>

The PUFFER token address.

Source

lib/contracts/handlers/vl-puffer-handler.ts:70

allowance()

allowance(owner, spender): Promise<bigint>

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.

Source

lib/contracts/handlers/vl-puffer-handler.ts:109

approve()

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

Approve a spender to spend tokens.

Parameters
ParameterTypeDescription
spender`0x${string}`The spender address.
valuebigintThe amount to approve.
Returns

Promise<`0x${string}`>

The transaction.

Source

lib/contracts/handlers/vl-puffer-handler.ts:316

balanceOf()

balanceOf(account): Promise<bigint>

Get the balance for an address.

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

Promise<bigint>

The balance.

Source

lib/contracts/handlers/vl-puffer-handler.ts:185

checkpoints()

checkpoints(account, pos): Promise<object>

Get the checkpoints for an account at a specific position.

Parameters
ParameterTypeDescription
account`0x${string}`The account to get checkpoints for.
posnumberThe position of the checkpoint.
Returns

Promise<object>

The checkpoint.

_key

_key: number

_value

_value: bigint

Source

lib/contracts/handlers/vl-puffer-handler.ts:355

createLock()

createLock(amount, multiplier): Promise<`0x${string}`>

Create a lock with the specified amount and multiplier.

Parameters
ParameterTypeDescription
amountbigintThe amount to lock.
multiplierbigintThe multiplier for the lock.
Returns

Promise<`0x${string}`>

The transaction.

Source

lib/contracts/handlers/vl-puffer-handler.ts:375

createLockWithPermit()

createLockWithPermit(value, multiplier, permitData): Promise<`0x${string}`>

Create a lock with permit.

Parameters
ParameterTypeDescription
valuebigintThe amount to lock.
multiplierbigintThe multiplier for the lock.
permitDataPermitDataThe permit data.
Returns

Promise<`0x${string}`>

The transaction.

Source

lib/contracts/handlers/vl-puffer-handler.ts:390

decimals()

decimals(): Promise<number>

Get the decimals of the token.

Returns

Promise<number>

The decimals.

Source

lib/contracts/handlers/vl-puffer-handler.ts:79

delegate()

delegate(delegatee, isPreapproved): Promise<`0x${string}`>

Delegate votes to another address.

Parameters
ParameterTypeDescription
delegatee`0x${string}`The delegatee address.
isPreapprovedbooleanWhether the PUFFER token is preapproved or should use a permit signature.
Returns

Promise<`0x${string}`>

The transaction.

Source

lib/contracts/handlers/vl-puffer-handler.ts:258

delegateBySig()

delegateBySig(delegatee, nonce, expiry, v, r, s): Promise<`0x${string}`>

Delegate by signature.

Parameters
ParameterTypeDescription
delegatee`0x${string}`The delegatee address.
noncebigintThe nonce.
expirybigintThe expiry time.
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.

Source

lib/contracts/handlers/vl-puffer-handler.ts:220

delegatePreapproved()

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

Delegate votes to another address.

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

Promise<`0x${string}`>

The transaction.

Source

lib/contracts/handlers/vl-puffer-handler.ts:243

delegates()

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

Get the delegates for an account.

Parameters
ParameterTypeDescription
account`0x${string}`The account to get delegates for.
Returns

Promise<`0x${string}`>

The delegate address.

Source

lib/contracts/handlers/vl-puffer-handler.ts:89

getClock()

getClock(): Promise<number>

Get the current clock value.

Returns

Promise<number>

The clock value.

Source

lib/contracts/handlers/vl-puffer-handler.ts:438

getClockMode()

getClockMode(): Promise<string>

Get the clock mode.

Returns

Promise<string>

The clock mode.

Source

lib/contracts/handlers/vl-puffer-handler.ts:295

getContract()

getContract(): object

Get the contract.

Returns

object

The viem contract.

Source

lib/contracts/handlers/vl-puffer-handler.ts:53

getPastTotalSupply()

getPastTotalSupply(timepoint): Promise<bigint>

Get the past total supply at a specific timepoint.

Parameters
ParameterTypeDescription
timepointbigintThe timepoint to get the total supply for.
Returns

Promise<bigint>

The past total supply.

Source

lib/contracts/handlers/vl-puffer-handler.ts:175

getPastVotes()

getPastVotes(account, timepoint): Promise<bigint>

Get the past votes for an account at a specific timepoint.

Parameters
ParameterTypeDescription
account`0x${string}`The account to get past votes for.
timepointbigintThe timepoint to get votes for.
Returns

Promise<bigint>

The past votes.

Source

lib/contracts/handlers/vl-puffer-handler.ts:344

isPaused()

isPaused(): Promise<boolean>

Check if the contract is paused.

Returns

Promise<boolean>

True if paused, false otherwise.

Source

lib/contracts/handlers/vl-puffer-handler.ts:151

lock()

lock(value, multiplier, isPreapproved): Promise<`0x${string}`>

Create a lock with permit.

Parameters
ParameterTypeDescription
valuebigintThe amount to lock.
multiplierbigintThe multiplier for the lock.
isPreapprovedbooleanWhether the PUFFER token is preapproved.
Returns

Promise<`0x${string}`>

The transaction.

Source

lib/contracts/handlers/vl-puffer-handler.ts:412

lockInfos()

lockInfos(user): Promise<object>

Get the lock information for a user.

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

Promise<object>

The lock information.

pufferAmount

pufferAmount: bigint

unlockTime

unlockTime: bigint

Source

lib/contracts/handlers/vl-puffer-handler.ts:161

name()

name(): Promise<string>

Get the name of the token.

Returns

Promise<string>

The name.

Source

lib/contracts/handlers/vl-puffer-handler.ts:364

nonces()

nonces(owner): Promise<bigint>

Get the nonce for an owner.

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

Promise<bigint>

The nonce.

Source

lib/contracts/handlers/vl-puffer-handler.ts:195

numCheckpoints()

numCheckpoints(account): Promise<number>

Get the number of checkpoints for an account.

Parameters
ParameterTypeDescription
account`0x${string}`The account to get checkpoints for.
Returns

Promise<number>

The number of checkpoints.

Source

lib/contracts/handlers/vl-puffer-handler.ts:305

owner()

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

Get the owner of the contract.

Returns

Promise<`0x${string}`>

The owner address.

Source

lib/contracts/handlers/vl-puffer-handler.ts:98

reLock()

reLock(amount, multiplier): Promise<`0x${string}`>

Re-lock with the specified amount and multiplier.

Parameters
ParameterTypeDescription
amountbigintThe amount to re-lock.
multiplierbigintThe multiplier for the re-lock.
Returns

Promise<`0x${string}`>

The transaction.

Source

lib/contracts/handlers/vl-puffer-handler.ts:330

symbol()

symbol(): Promise<string>

Get the symbol of the token.

Returns

Promise<string>

The symbol.

Source

lib/contracts/handlers/vl-puffer-handler.ts:142

totalSupply()

totalSupply(): Promise<bigint>

Get the total supply of the token.

Returns

Promise<bigint>

The total supply.

Source

lib/contracts/handlers/vl-puffer-handler.ts:133

transfer()

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

Transfer tokens to another address.

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

Promise<`0x${string}`>

The transaction.

Source

lib/contracts/handlers/vl-puffer-handler.ts:283

transferFrom()

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

Transfer tokens from one address to another.

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

Promise<`0x${string}`>

The transaction.

Source

lib/contracts/handlers/vl-puffer-handler.ts:121

votes()

votes(account): Promise<bigint>

Get the votes for an account.

Parameters
ParameterTypeDescription
account`0x${string}`The account to get votes for.
Returns

Promise<bigint>

The votes.

Source

lib/contracts/handlers/vl-puffer-handler.ts:205

withdraw()

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

Withdraw tokens to a recipient.

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

Promise<`0x${string}`>

The transaction.

Source

lib/contracts/handlers/vl-puffer-handler.ts:448