Skip to main content

contracts/handlers/nucleus-boring-vault-handler

Classes

NucleusBoringVaultHandler

Handler for the BoringVault contract for a given token exposing methods to interact with the contract.

Constructors

new NucleusBoringVaultHandler()

new NucleusBoringVaultHandler(chain, walletClient, publicClient): NucleusBoringVaultHandler

Create the handler for processing UniFi tokens.

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

NucleusBoringVaultHandler

Source

lib/contracts/handlers/nucleus-boring-vault-handler.ts:41

Properties

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

Methods

approve()

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

Approve transaction for the spender to spend the owner's tokens.

Parameters
ParameterTypeDescription
walletAddress`0x${string}`Address of the caller of the transaction.
spenderAddress`0x${string}`Address of the spender.
valuebigintValue to approve for the spender.
Returns

Promise<`0x${string}`>

Hash of the transaction.

Source

lib/contracts/handlers/nucleus-boring-vault-handler.ts:115

balanceOf()

balanceOf(walletAddress): Promise<bigint>

Check the token balance of the wallet.

Parameters
ParameterTypeDescription
walletAddress`0x${string}`Wallet address to check the balance of.
Returns

Promise<bigint>

Token balance in wei.

Source

lib/contracts/handlers/nucleus-boring-vault-handler.ts:94

getAllowance()

getAllowance(owner, spender): Promise<bigint>

Get the allowance for the given owner and spender.

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

Promise<bigint>

Allowance for the given owner and spender.

Source

lib/contracts/handlers/nucleus-boring-vault-handler.ts:75

getContract()

getContract(): object

Get the contract. This is a method because the typings are complex and lost when trying to make it a member.

Returns

object

The viem contract.

Source

lib/contracts/handlers/nucleus-boring-vault-handler.ts:55

getTotalSupply()

getTotalSupply(): Promise<bigint>

Get the total supply of the token.

Returns

Promise<bigint>

Total supply of the token.

Source

lib/contracts/handlers/nucleus-boring-vault-handler.ts:84

permit()

permit(params): object

Get permit to be able to use the token.

Parameters
ParameterTypeDescription
paramsPermitParamsPermit parameters.
Returns

object

transact: () => Promise<Address> - Used to make the transaction with the given value.

estimate: () => Promise<bigint> - Gas estimate of the transaction.

estimate()

estimate: () => Promise<bigint>

Returns

Promise<bigint>

transact()

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

Returns

Promise<`0x${string}`>

Source

lib/contracts/handlers/nucleus-boring-vault-handler.ts:203

totalSupply()

totalSupply(): Promise<bigint>

Get the total supply of the token.

Returns

Promise<bigint>

Total supply of the token.

Source

lib/contracts/handlers/nucleus-boring-vault-handler.ts:103

transfer()

transfer(walletAddress, toAddress, value): object

Transfer tokens from the owner's wallet to the given address.

Parameters
ParameterTypeDescription
walletAddress`0x${string}`Address of the owner's wallet.
toAddress`0x${string}`Address to transfer the tokens to.
valuebigintValue to transfer.
Returns

object

transact: () => Promise<Address> - Used to make the transaction with the given value.

estimate: () => Promise<bigint> - Gas estimate of the transaction.

estimate()

estimate: () => Promise<bigint>

Returns

Promise<bigint>

transact()

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

Returns

Promise<`0x${string}`>

Source

lib/contracts/handlers/nucleus-boring-vault-handler.ts:138

transferFrom()

transferFrom(walletAddress, fromAddress, toAddress, value): object

Transfer tokens from the given address to another address.

Parameters
ParameterTypeDescription
walletAddress`0x${string}`Address of the caller of the transaction.
fromAddress`0x${string}`Address to transfer the tokens from.
toAddress`0x${string}`Address to transfer the tokens to.
valuebigintValue to transfer.
Returns

object

transact: () => Promise<Address> - Used to make the transaction with the given value.

estimate: () => Promise<bigint> - Gas estimate of the transaction.

estimate()

estimate: () => Promise<bigint>

Returns

Promise<bigint>

transact()

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

Returns

Promise<`0x${string}`>

Source

lib/contracts/handlers/nucleus-boring-vault-handler.ts:165

Type Aliases

PermitParams

PermitParams: object

Type declaration

account

account: Address

deadline

deadline: bigint

owner

owner: Address

r

r: Address

s

s: Address

spender

spender: Address

v

v: number

value

value: bigint

Source

lib/contracts/handlers/nucleus-boring-vault-handler.ts:14