Skip to main content

Vault

@centrifuge/sdk


@centrifuge/sdk / Vault

Class: Vault

Defined in: src/Vault.ts:19

Query and interact with a vault, which is the main entry point for investing and redeeming funds. A vault is the combination of a network, a pool, a tranche and an investment currency.

Extends​

  • Entity

Properties​

address​

address: `0x${string}`

Defined in: src/Vault.ts:30

The contract address of the vault.


chainId​

chainId: number

Defined in: src/Vault.ts:21


network​

network: PoolNetwork

Defined in: src/Vault.ts:34


pool​

pool: Pool

Defined in: src/Vault.ts:20


trancheId​

trancheId: string

Defined in: src/Vault.ts:35

Methods​

allowance()​

allowance(owner): Query<Currency>

Defined in: src/Vault.ts:84

Get the allowance of the investment currency for the CentrifugeRouter, which is the contract that moves funds into the vault on behalf of the investor.

Parameters​

owner​

string

The address of the owner

Returns​

Query<Currency>


cancelInvestOrder()​

cancelInvestOrder(): Transaction

Defined in: src/Vault.ts:320

Cancel an open investment order.

Returns​

Transaction


cancelRedeemOrder()​

cancelRedeemOrder(): Transaction

Defined in: src/Vault.ts:369

Cancel an open redemption order.

Returns​

Transaction


claim()​

claim(receiver?, controller?): Transaction

Defined in: src/Vault.ts:395

Claim any outstanding fund shares after an investment has gone through, or funds after an redemption has gone through.

Parameters​

receiver?​

string

The address that should receive the funds. If not provided, the investor's address is used.

controller?​

string

The address of the user that has invested. Allows someone else to claim on behalf of the user if the user has set the CentrifugeRouter as an operator on the vault. If not provided, the investor's address is used.

Returns​

Transaction


increaseInvestOrder()​

increaseInvestOrder(investAmount): Transaction

Defined in: src/Vault.ts:239

Place an order to invest funds in the vault. If an order exists, it will increase the amount.

Parameters​

investAmount​

NumberInput

The amount to invest in the vault

Returns​

Transaction


increaseRedeemOrder()​

increaseRedeemOrder(redeemAmount): Transaction

Defined in: src/Vault.ts:344

Place an order to redeem funds from the vault. If an order exists, it will increase the amount.

Parameters​

redeemAmount​

NumberInput

The amount of shares to redeem

Returns​

Transaction


investment()​

investment(investor): Query<{ claimableCancelInvestCurrency: Currency; claimableCancelRedeemShares: Token; claimableInvestCurrencyEquivalent: Currency; claimableInvestShares: Token; claimableRedeemCurrency: Currency; claimableRedeemSharesEquivalent: Token; hasPendingCancelInvestRequest: boolean; hasPendingCancelRedeemRequest: boolean; investmentCurrency: CurrencyMetadata; investmentCurrencyAllowance: Currency; investmentCurrencyBalance: Currency; isAllowedToInvest: boolean; pendingInvestCurrency: Currency; pendingRedeemShares: Token; shareBalance: Token; shareCurrency: CurrencyMetadata; }>

Defined in: src/Vault.ts:128

Get the details of the investment of an investor in the vault and any pending investments or redemptions.

Parameters​

investor​

string

The address of the investor

Returns​

Query<{ claimableCancelInvestCurrency: Currency; claimableCancelRedeemShares: Token; claimableInvestCurrencyEquivalent: Currency; claimableInvestShares: Token; claimableRedeemCurrency: Currency; claimableRedeemSharesEquivalent: Token; hasPendingCancelInvestRequest: boolean; hasPendingCancelRedeemRequest: boolean; investmentCurrency: CurrencyMetadata; investmentCurrencyAllowance: Currency; investmentCurrencyBalance: Currency; isAllowedToInvest: boolean; pendingInvestCurrency: Currency; pendingRedeemShares: Token; shareBalance: Token; shareCurrency: CurrencyMetadata; }>


investmentCurrency()​

investmentCurrency(): Query<CurrencyMetadata>

Defined in: src/Vault.ts:68

Get the details of the investment currency.

Returns​

Query<CurrencyMetadata>


shareCurrency()​

shareCurrency(): Query<CurrencyMetadata>

Defined in: src/Vault.ts:75

Get the details of the share token.

Returns​

Query<CurrencyMetadata>