contracts/handlers/vl-puffer-handler
Classes
VLPufferHandler
Defined in: contracts/handlers/vl-puffer-handler.ts:21
Handler for the vlPUFFER contract exposing methods to interact
with the contract.
Constructors
Constructor
new VLPufferHandler(
chain,walletClient,publicClient):VLPufferHandler
Defined in: contracts/handlers/vl-puffer-handler.ts:35
Create the handler for the vlPUFFER contract exposing methods to
interact with the contract.
Parameters
| Parameter | Type | Description |
|---|---|---|
chain | Chain | Chain to use for the client. |
walletClient | { } | The wallet client to use for wallet interactions. |
publicClient | { } | The public client to use for public interactions. |
Returns
Methods
allowance()
allowance(
owner,spender):Promise<bigint>
Defined in: contracts/handlers/vl-puffer-handler.ts:109
Get the allowance of the owner for the spender.
Parameters
| Parameter | Type | Description |
|---|---|---|
owner | `0x${string}` | The owner of the allowance. |
spender | `0x${string}` | The spender of the allowance. |
Returns
Promise<bigint>
The allowance.
approve()
approve(
spender,value):Promise<`0x${string}`>
Defined in: contracts/handlers/vl-puffer-handler.ts:316
Approve a spender to spend tokens.
Parameters
| Parameter | Type | Description |
|---|---|---|
spender | `0x${string}` | The spender address. |
value | bigint | The amount to approve. |
Returns
Promise<`0x${string}`>
The transaction.
balanceOf()
balanceOf(
account):Promise<bigint>
Defined in: contracts/handlers/vl-puffer-handler.ts:185
Get the balance for an address.
Parameters
| Parameter | Type | Description |
|---|---|---|
account | `0x${string}` | The address to get the balance of. |
Returns
Promise<bigint>
The balance.
checkpoints()
checkpoints(
account,pos):Promise<{_key:number;_value:bigint; }>
Defined in: contracts/handlers/vl-puffer-handler.ts:355
Get the checkpoints for an account at a specific position.
Parameters
| Parameter | Type | Description |
|---|---|---|
account | `0x${string}` | The account to get checkpoints for. |
pos | number | The position of the checkpoint. |
Returns
Promise<{ _key: number; _value: bigint; }>
The checkpoint.
createLock()
createLock(
amount,multiplier):Promise<`0x${string}`>
Defined in: contracts/handlers/vl-puffer-handler.ts:375
Create a lock with the specified amount and multiplier.
Parameters
| Parameter | Type | Description |
|---|---|---|
amount | bigint | The amount to lock. |
multiplier | bigint | The multiplier for the lock. |
Returns
Promise<`0x${string}`>
The transaction.