Readonly
premiaGets the balance of assets for a specific owner in a vault.
The address of the vault.
The address of the owner.
A promise that resolves to a bigint representing the balance of assets for the specified owner in the specified vault.
Gets the balance of shares for a specific owner in a vault.
The address of the vault.
The address of the owner.
A promise that resolves to a bigint representing the balance of shares for the specified owner in the specified vault.
Cancels a quote stream for a given parameter set.
The vault assets for which to cancel quote streams on.
Whether the vault is a call vault.
Whether the quote is a buy quote.
A promise that resolves when the quote stream has been cancelled.
Converts a given amount of shares to assets for a specific vault.
The address of the vault.
The amount of shares to be converted.
A promise that resolves to a bigint representing the equivalent assets for the specified amount of shares in the specified vault.
Converts a given amount of assets to shares for a specific vault.
The address of the vault.
The amount of assets to be converted.
A promise that resolves to a bigint representing the equivalent shares for the specified amount of assets in the specified vault.
Deposits specified assets into a vault from the receiver's address.
Will throw an error if the ERC4626 contract is not found for the provided vault address, or if the transaction fails to be sent.
The address of the vault into which the assets are to be deposited.
An object containing deposit parameters.
The amount of assets to be deposited into the vault.
The address of the receiver whose assets will be deposited and shares will be received.
A promise that resolves to a transaction response. This contains details of the transaction such as block number, transaction hash, etc.
Encodes the deposit parameters into a transaction that can be broadcasted to the provider network.
Will throw an error if the ERC4626 contract is not found for the provided vault address.
The address of the vault where assets will be deposited.
An object containing the parameters for the deposit operation.
The amount of assets to be deposited.
The address of the receiver whose assets will be deposited and shares will be received.
A promise that resolves to a contract transaction for the deposit operation.
Encodes a transaction for redeeming shares from a vault.
encodeRedeem
The address of the vault.
An object containing the parameters for redeeming shares.
The address of the owner of the shares.
The address to receive the redeemed assets.
The number of shares to redeem.
A promise that resolves to a ContractTransaction that represents the encoded transaction for redeeming the shares.
Encodes the trade parameters into a contract transaction that can be broadcasted to the provider network.
Will throw an error if the vault contract is not found for the provided vault address.
The address of the vault.
An object containing key trade options.
A boolean flag indicating whether the trade is a buy (true) or sell (false).
The unique identifier for the liquidity pool involved in the trade.
The maximum premium that the trader is willing to pay for the trade.
Optional
referrer?: string(Optional) The address of the referrer. If not provided, the referrer will default to a zero address.
The number of contracts to be bought or sold.
A promise that resolves to an encoded contract transaction. This transaction can be signed and broadcasted to the provider network.
Encodes the withdrawal parameters into a transaction that can be broadcasted to the provider network.
Will throw an error if the ERC4626 contract is not found for the provided vault address.
The address of the vault from which assets will be withdrawn.
An object containing the parameters for the withdrawal operation.
The amount of assets to be withdrawn.
The address of the current owner of the assets.
The address of the receiver who will get the withdrawn assets.
A promise that resolves to a contract transaction for the withdrawal operation.
Retrieves information for all vaults.
This function is cached, meaning that if it is called multiple times within a daily period, it will only perform the operation once and then return the cached result for subsequent calls.
A promise that resolves to an array of VaultExtended objects, each containing information about a vault.
Retrieves the quote for a specified trade operation in a specific vault.
Will throw an error if the vault contract is not found for the provided vault address.
The address of the vault where the quote will be retrieved from.
The identifier for the pool from which the contracts are to be bought or sold.
The number of contracts to be bought or sold.
A boolean indicating whether this operation is a buy (true) or sell (false).
The address of the user who would perform the trade.
A promise that resolves to a quote for the proposed trade operation.
Retrieves information for a specific vault using its address.
This function is cached, meaning that if it is called multiple times within a daily period, it will only perform the operation once and then return the cached result for subsequent calls.
The address of the vault for which information should be retrieved.
A promise that resolves to a VaultExtended object, containing information about the vault at the specified address.
Retrieves extended information for a specific vault using its address.
This function is cached, meaning that if it is called multiple times within a one minute period, it will only perform the operation once and then return the cached result for subsequent calls.
The address of the vault for which extended information should be retrieved.
A promise that resolves to a VaultExtended object, containing detailed information about the vault at the specified address.
Retrieves the vault position for a specific owner and pool.
This function is cached, meaning that if it is called multiple times within a one-minute period, it will only perform the operation once and then return the cached result for subsequent calls.
The address of an owner with shares in the vault.
The address of the vault.
A promise that resolves to a VaultPosition object containing details about the owner's position in the specified vault.
Retrieves the extended vault position for a specific owner and pool.
This function is cached, meaning that if it is called multiple times within a one-minute period, it will only perform the operation once and then return the cached result for subsequent calls.
The address of an owner with shares in the vault.
The address of the vault.
A promise that resolves to a VaultPositionExtended object containing extended details about the owner's position in the specified vault.
Retrieves the vault positions for a specific owner.
This function is cached, meaning that if it is called multiple times within a one-minute period, it will only perform the operation once and then return the cached result for subsequent calls.
The address of an owner with shares in the vault.
A promise that resolves to an array of VaultPositionExtended objects, each containing detailed information about a vault position associated with the given owner.
Retrieves extended information for all vaults associated with a given token address.
This function is cached, meaning that if it is called multiple times within a daily period, it will only perform the operation once and then return the cached result for subsequent calls.
The base token address for which vaults should be retrieved.
A promise that resolves to an array of Vault objects, each containing information about a vault associated with the given base address.
Retrieves information for all vaults associated with a given token address.
This function is cached, meaning that if it is called multiple times within a one minute period, it will only perform the operation once and then return the cached result for subsequent calls.
The base token address for which vaults should be retrieved.
A promise that resolves to an array of VaultExtended objects, each containing detailed information about a vault associated with the given base address.
Retrieves extended information for all vaults associated with a given token.
This function is cached, meaning that if it is called multiple times within a one minute period, it will only perform the operation once and then return the cached result for subsequent calls.
The token for which vaults should be retrieved.
Optional parameter that indicates whether the token is a quote token. Default is false.
A promise that resolves to an array of VaultExtended objects, each containing detailed information about a vault associated with the given token.
Retrieves information for all vaults associated with a given token.
This function is cached, meaning that if it is called multiple times within a daily period, it will only perform the operation once and then return the cached result for subsequent calls.
The token for which vaults should be retrieved.
Optional parameter that indicates whether the token is a quote token. Default is false.
A promise that resolves to an array of Vault objects, each containing information about a vault associated with the given token.
Gets the maximum amount of shares that can be redeemed by a particular owner from a specified vault.
The address of the vault.
The address of the owner.
A promise that resolves to a bigint representing the maximum amount of shares that can be redeemed by the owner from the vault.
Gets the maximum amount that can be withdrawn from a specified vault by a particular owner.
The address of the vault.
The address of the owner.
A promise that resolves to a bigint representing the maximum amount that can be withdrawn by the owner from the vault.
Previews the amount of assets that would be received for a given amount of shares from a specific vault.
previewRedeem
The address of the vault.
The amount of shares for which to preview the redemption.
A promise that resolves to a bigint representing the amount of assets that would be received for the given shares amount.
Previews the amount of shares that would be withdrawn for a given amount of assets from a specific vault.
previewWithdraw
The address of the vault.
The amount of assets for which to preview the withdrawal.
A promise that resolves to a bigint representing the amount of shares that would be withdrawn for the given assets amount.
Returns the best vault quote for a given pool.
The address of the pool to stream quotes for.
The size of the quote to stream.
Whether the quote is a buy quote.
Optional
minimumSize: BigNumberishThe minimum size of the quote to stream. Only quotes with a size greater than or equal to this will be emitted.
Optional
referrer: stringThe referrer address to use for the quote.
Optional
maxSlippagePercent: BigNumberishThe maximum slippage percent to use for the quote.
A promise that resolves to the best quote for the given pool.
Redeems shares from a vault and sends the resulting assets to the specified receiver.
redeem
The address of the vault.
An object containing the parameters for redeeming shares.
The address of the owner of the shares.
The address to receive the redeemed assets.
The number of shares to redeem.
A promise that resolves to a ContractTransactionResponse which contains information about the transaction that redeemed the shares.
Opens a stream, which will emit a quote every time the best vault quote changes.
The options object.
Whether the quote is a buy quote.
Optional
minimumThe minimum size of the quote to stream. Only quotes with a size greater than or equal to this will be emitted.
The address of the pool to stream quotes for.
The size of the quote to stream.
The callback to call when a new quote is emitted.
A promise that resolves when the quote stream has been started.
Performs a trade operation in a specific vault on behalf of a user.
Will throw an error if the vault contract is not found for the provided vault address, or if the transaction fails to be sent.
The address of the vault where the trade operation will occur.
An object containing trade parameters.
A boolean indicating whether this operation is a buy (true) or sell (false).
The unique identifier for the liquidity pool involved in the trade.
The maximum premium that the trader is willing to pay for the trade.
Optional
referrer?: string(Optional) The address of the user who referred this trade.
The number of contracts to be bought or sold.
A promise that resolves to a transaction response. This contains details of the transaction such as block number, transaction hash, etc.
Withdraws specified assets from a vault and sends them to a receiver's address.
Will throw an error if the ERC4626 contract is not found for the provided vault address, or if the transaction fails to be sent.
The address of the vault from which the assets are to be withdrawn.
An object containing withdrawal parameters.
The amount of assets to be withdrawn from the vault.
The address of the owner initiating the withdrawal. This should be the signer of the transaction.
The address of the receiver to which the withdrawn assets will be sent.
A promise that resolves to a transaction response. This contains details of the transaction such as block number, transaction hash etc.
Generated using TypeDoc
Construct a new BaseAPI object.