Skip to main content

contracts/handlers/nucleus-accountant-handler

Classes

NucleusAccountantHandler

Defined in: lib/contracts/handlers/nucleus-accountant-handler.ts:18

Handler for the Accountant contract from nucleus.

Constructors

Constructor

new NucleusAccountantHandler(chain, walletClient, publicClient): NucleusAccountantHandler

Defined in: lib/contracts/handlers/nucleus-accountant-handler.ts:30

Create the handler for processing tokens.

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

NucleusAccountantHandler

Methods

getContract()

getContract(): object

Defined in: lib/contracts/handlers/nucleus-accountant-handler.ts:56

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.

getRate()

getRate(): Promise<bigint>

Defined in: lib/contracts/handlers/nucleus-accountant-handler.ts:96

Get the rate for the given token address.

Returns

Promise<bigint>

Rate for the given token address.

getRateInQuote()

getRateInQuote(quoteAddress): Promise<bigint>

Defined in: lib/contracts/handlers/nucleus-accountant-handler.ts:114

Get the rate from the given quote address.

Parameters
ParameterType
quoteAddress`0x${string}`
Returns

Promise<bigint>

Rate for the given quote address.

getRateInQuoteSafe()

getRateInQuoteSafe(quoteAddress): Promise<bigint>

Defined in: lib/contracts/handlers/nucleus-accountant-handler.ts:123

Get the rate from the given quote address for safe.

Parameters
ParameterType
quoteAddress`0x${string}`
Returns

Promise<bigint>

Rate for the given quote address for safe.

getRateSafe()

getRateSafe(): Promise<bigint>

Defined in: lib/contracts/handlers/nucleus-accountant-handler.ts:105

Get the rate for the given token address for safe.

Returns

Promise<bigint>

Rate for the given token address for safe.

rateProviderData()

rateProviderData(tokenAddress): Promise<{ isPeggedToBase: boolean; rateProvider: `0x${string}`; }>

Defined in: lib/contracts/handlers/nucleus-accountant-handler.ts:75

Get the rate provider data for the given token address.

Parameters
ParameterTypeDescription
tokenAddress`0x${string}`Address of the token.
Returns

Promise<{ isPeggedToBase: boolean; rateProvider: `0x${string}`; }>

Rate provider data for the given token address.

vault()

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

Defined in: lib/contracts/handlers/nucleus-accountant-handler.ts:87

Get the vault for the given token address.

Returns

Promise<`0x${string}`>

Vault for the given token address.

withToken()

withToken(token): NucleusAccountantHandler

Defined in: lib/contracts/handlers/nucleus-accountant-handler.ts:45

Set the UniFi token to use for executing transactions on the contract.

Parameters
ParameterTypeDescription
tokenUnifiTokenUniFi token to use for the handler.
Returns

NucleusAccountantHandler

The handler.