NAV
typescript

Welcome

Welcome to the Centrifuge SDK documentation. The Centrifuge SDK is a JavaScript client for interacting with the Centrifuge ecosystem. It provides a comprehensive, fully typed library to integrate investments and redemptions, generate financial reports, manage pools, and much more.

Installation

npm install @centrifuge/sdk viem

# or

yarn add @centrifuge/sdk viem

The SDK is available as an npm package. It it is built to run both client-side and server-side. The SDK uses viem under the hood and is required as a peer dependency.

Initialization

import { Centrifuge } from "@centrifuge/sdk";

const centrifuge = new Centrifuge();

The SDK can be initialized with or without a config object. If no config is provided, the SDK will use the default values.

Config

type Config = {
  environment: "mainnet" | "demo" | "dev";
  rpcUrls?: Record<number | string, string>;
  indexerUrl: string;
  ipfsUrl: string;
};

Mainnet

const centrifuge = new Centrifuge({
  environment: "mainnet",
  rpcUrls: {
    1: "https://mainnet.infura.io/v3/YOUR_INFURA_PROJECT_ID",
  },
  indexerUrl: "https://indexer.centrifuge.io",
  ipfsUrl: "https://ipfs.centrifuge.io",
});

Mainnet is the default environment if no config is provided. Any configurations can be overridden in the config object.

Demo

const centrifuge = new Centrifuge({
  environment: "demo",
});

By setting the environment to demo, the SDK will connect to Sepolia testnet.

SDK Overview

The Centrifuge SDK provides the following interfaces (more will be added soon):

Queries

try {
  const pool = await centrifuge.pools();
} catch (error) {
  console.error(error);
}
const subscription = centrifuge.pools().subscribe(
  (pool) => console.log(pool),
  (error) => console.error(error)
);
subscription.unsubscribe();

Queries return Promise-like Observables. They can be either awaited to get a single value, or subscribed to to get fresh data whenever on-chain data changes.

The returned results are either immutable values, or entities that can be further queried.

Query caching

const report1 = await pool.reports.balanceSheet();
const report2 = await pool.reports.balanceSheet(); // resolves immediately
const report3 = await pool.reports.balanceSheet({ groupBy: "month" }); // also resolves immediately as it doesn't need to fetch new data

sleep(5 * 60 * 1000);

const report4 = await pool.reports.balanceSheet(); // will wait for fresh data

The results of queries are cached and shared between observables. When subscribing to a query multiple times, the underlying observables that fetch data are only subscribed to once. Data remains cached for a few minutes and will be passed to new subscribers. This is particularly useful in user-facing applications as queries can sometimes lead to a cascade of 4 or 5 requests and can slow down an application.

const centrifuge = new Centrifuge({ cache: false }); // TODO NOT YET IMPLEMENTED

// ...

const investment1 = await vault.investment("0x...");

await vault.claim();

const investment2 = await vault.investment("0x..."); // will fetch again

In a script you may want to disable caching to ensure that data is always fresh.

Transactions

centrifuge.setSigner(signer);

To perform transactions, you need to set a signer on the centrifuge instance.

const pool = await centrifuge.pool("1");
try {
  const status = await pool.closeEpoch();
  console.log(status);
} catch (error) {
  console.error(error);
}
const pool = await centrifuge.pool("1");
const subscription = pool.closeEpoch().subscribe(
  (status) => console.log(pool),
  (error) => console.error(error),
  () => console.log("complete")
);

signer can be a EIP1193-compatible provider or a Viem Wallet Client or Local Account.

With this you can call transaction methods. Similar to queries they can be awaited to get their final result, or subscribed to get get status updates (see: OperationStatus).

Pools

Pools are collections of assets that can be financed.

const pool = await centrifuge.pool("<pool-id>");

Pools can be queried by their pool ID.

Tranches

Pools have a one or more tranches that can be invested into.

Vaults

Tranches can source investments from various EVM chains in various currencies, by deploying smart contracts to those EVM chains (like Ethereum and its L2 networks). The smart contracts that allows an investor to invest into a tranche with a specific currency are called Vaults. Investments done in a Vault are bridged to the chain where the pool lives and, if necessary, currency is swapped into the currency of the pool.

Networks

const poolNetworks = await pool.activeNetworks();

Vaults can only be deployed on networks where the pool itself is active. Active networks can be retrieved with the activeNetworks method on a Pool.

const poolNetwork = await pool.network(<chain-id>);
const isActive = await poolNetwork.isActive();

It's also possible to specifically query a network and see if the pool is active there.

Deployed Vaults

const poolNetwork = await pool.network(<chain-id>);
const vaults = await poolNetwork.vaults("<tranche-id>");

Which vaults exist for a tranche on a network can be queried from a PoolNetwork.

const poolNetwork = await pool.network(<chain-id>);
try {
  const vault = await poolNetwork.vault("<tranche-id>", "<currency-address>");
} catch {
  console.error("Vault not found");
}

Or query a specific vault for a tranche and investment currency address

Vault investments and redemptions

The Vaults can be queried for the investment details of an investor and can be interacted with to place invest/redeem orders, collect tokens.

Use investment to get the investment state for an investor.

const investment = await vault.investment("<invesor-address>");

Orders can be placed with increaseInvestOrder and increaseRedeemOrder.

const status = await vault.increaseInvestOrder(<invest amount>);

When an order has been fulfilled, tokens can be collected with claim.

const status = await vault.claim();

Reports

const pool = await centrifuge.pool("<pool-id>");
const balanceSheetReport = await pool.reports.balanceSheet();

Reports are generated from data from the Centrifuge API and are combined with pool metadata to provide a comprehensive view of the pool's financials.

Available reports are:

Report Filtering

Reports can be filtered using the ReportFilter type.

type GroupBy = "day" | "month" | "quarter" | "year";

const balanceSheetReport = await pool.reports.balanceSheet({
  from: "2024-01-01",
  to: "2024-01-31",
  groupBy: "month",
});

BigInt Wrappers

BigInt wrappers can be used to easily categorize and handle different types of numbers. When fetching data from the SDK any numerical data is returned as a BigInt Wrapper.

Type Decimals Description
Currency n A wrapper for currency values
Token n A wrapper for token values
Rate 27 Often used for Rates such as APR/APY
Price 18 Often used for EVM token prices with 18 decimals

Currency/Token

Both Currency and Token have the exact same methods and functionality. They are intended to make it easier to understand the data returned from the SDK. In the future their methods may differ.

const currency = new Currency(1000n, 6);
currency.toBigInt(); // 1000n
currency.toNumber(); // 0.001
currency.toString(); // '1000'
currency.toDecimal(); // 0.001

Takes a number and the decimals of the currency and returns an object that can be converted into different formats.

Currency.fromFloat()

const currency = Currency.fromFloat(1000, 6);
currency.toBigInt(); // 1_000_000_000n
currency.toNumber(); // 1000
currency.toString(); // '1000000000'
currency.toDecimal(); // 1000

The static method fromFloat can be used to create a Currency object from a floating point number.

Currency Arithmetic

const currency = new Currency(1000n, 6);
const currency2 = new Currency(2000n, 6);

const sum = currency.add(currency2);
const difference = currency.sub(currency2);
const product = currency.mul(currency2);
const quotient = currency.div(currency2);

Basic arithmetic operations are available on the Currency object. When an operation is performed on two Currency objects, the result is a new Currency object. The result will have the same decimals as the original Currency object.

Operations can also be performed by passing in a bigint. The result will still have the same decimals as the original Currency object and will be returned as a Currency object.

Currency Comparison

const currency = new Currency(1000n, 6);
const currency2 = new Currency(2000n, 6);
const isEqual = currency.equals(currency2);
const isGreaterThan = currency.greaterThan(currency2);
const isLessThan = currency.lessThan(currency2);

Just like arithmetic operations, comparison operations are available on the Currency object. When an operation is performed on two Currency objects, the result is a boolean.

Operations can also be performed by passing in a bigint. The result will still be a boolean.

Rate

Price

Reference

Class: Centrifuge

Defined in: src/Centrifuge.ts:72

Constructors

new Centrifuge()

new Centrifuge(config): Centrifuge

Defined in: src/Centrifuge.ts:97

Parameters
config

Partial<Config> = {}

Returns

Centrifuge

Accessors

chains

Get Signature

get chains(): number[]

Defined in: src/Centrifuge.ts:82

Returns

number[]


config

Get Signature

get config(): DerivedConfig

Defined in: src/Centrifuge.ts:74

Returns

DerivedConfig


signer

Get Signature

get signer(): null | Signer

Defined in: src/Centrifuge.ts:93

Returns

null | Signer

Methods

account()

account(address, chainId?): Query<Account>

Defined in: src/Centrifuge.ts:123

Parameters
address

string

chainId?

number

Returns

Query<Account>


balance()

balance(currency, owner, chainId?): Query<Currency>

Defined in: src/Centrifuge.ts:168

Get the balance of an ERC20 token for a given owner.

Parameters
currency

string

The token address

owner

string

The owner address

chainId?

number

The chain ID

Returns

Query<Currency>


currency()

currency(address, chainId?): Query<CurrencyMetadata>

Defined in: src/Centrifuge.ts:132

Get the metadata for an ERC20 token

Parameters
address

string

The token address

chainId?

number

The chain ID

Returns

Query<CurrencyMetadata>


getChainConfig()

getChainConfig(chainId?): Chain

Defined in: src/Centrifuge.ts:85

Parameters
chainId?

number

Returns

Chain


getClient()

getClient(chainId?): undefined | {}

Defined in: src/Centrifuge.ts:79

Parameters
chainId?

number

Returns

undefined | {}


pool()

pool(id, metadataHash?): Query<Pool>

Defined in: src/Centrifuge.ts:119

Parameters
id

string | number

metadataHash?

string

Returns

Query<Pool>


setSigner()

setSigner(signer): void

Defined in: src/Centrifuge.ts:90

Parameters
signer

null | Signer

Returns

void

Class: Currency

Defined in: src/utils/BigInt.ts:124

Extends

Constructors

new Currency()

new Currency(value, decimals): Currency

Defined in: src/utils/BigInt.ts:29

Parameters
value

bigint | Numeric

decimals

number = 27

Returns

Currency

Inherited from

DecimalWrapper.constructor

Properties

decimals

readonly decimals: number = 27

Defined in: src/utils/BigInt.ts:27

Inherited from

DecimalWrapper.decimals


value

protected value: bigint

Defined in: src/utils/BigInt.ts:3

Inherited from

DecimalWrapper.value


ZERO

static ZERO: Currency

Defined in: src/utils/BigInt.ts:129

Methods

add()

add(value): Currency

Defined in: src/utils/BigInt.ts:131

Parameters
value

bigint | Currency

Returns

Currency


div()

div(value): Currency

Defined in: src/utils/BigInt.ts:143

Parameters
value

bigint | Currency

Returns

Currency


eq()

eq<T>(value): boolean

Defined in: src/utils/BigInt.ts:115

Type Parameters

T

Parameters
value

bigint | T extends BigIntWrapper ? T<T> : never

Returns

boolean

Inherited from

DecimalWrapper.eq


gt()

gt<T>(value): boolean

Defined in: src/utils/BigInt.ts:105

Type Parameters

T

Parameters
value

bigint | T extends BigIntWrapper ? T<T> : never

Returns

boolean

Inherited from

DecimalWrapper.gt


gte()

gte<T>(value): boolean

Defined in: src/utils/BigInt.ts:110

Type Parameters

T

Parameters
value

bigint | T extends BigIntWrapper ? T<T> : never

Returns

boolean

Inherited from

DecimalWrapper.gte


isZero()

isZero(): boolean

Defined in: src/utils/BigInt.ts:119

Returns

boolean

Inherited from

DecimalWrapper.isZero


lt()

lt<T>(value): boolean

Defined in: src/utils/BigInt.ts:95

Type Parameters

T

Parameters
value

bigint | T extends BigIntWrapper ? T<T> : never

Returns

boolean

Inherited from

DecimalWrapper.lt


lte()

lte<T>(value): boolean

Defined in: src/utils/BigInt.ts:100

Type Parameters

T

Parameters
value

bigint | T extends BigIntWrapper ? T<T> : never

Returns

boolean

Inherited from

DecimalWrapper.lte


mul()

mul(value): Currency

Defined in: src/utils/BigInt.ts:139

Parameters
value

bigint | Currency | Price

Returns

Currency


sub()

sub(value): Currency

Defined in: src/utils/BigInt.ts:135

Parameters
value

bigint | Currency

Returns

Currency


toBigInt()

toBigInt(): bigint

Defined in: src/utils/BigInt.ts:21

Returns

bigint

Inherited from

DecimalWrapper.toBigInt


toDecimal()

toDecimal(): Decimal

Defined in: src/utils/BigInt.ts:43

Returns

Decimal

Inherited from

DecimalWrapper.toDecimal


toFloat()

toFloat(): number

Defined in: src/utils/BigInt.ts:47

Returns

number

Inherited from

DecimalWrapper.toFloat


toString()

toString(): string

Defined in: src/utils/BigInt.ts:17

Returns

string

Inherited from

DecimalWrapper.toString


fromFloat()

static fromFloat(num, decimals): Currency

Defined in: src/utils/BigInt.ts:125

Parameters
num

Numeric

decimals

number

Returns

Currency

Class: Pool

Defined in: src/Pool.ts:8

Extends

Properties

id

id: string

Defined in: src/Pool.ts:12


metadataHash?

optional metadataHash: string

Defined in: src/Pool.ts:13

Accessors

reports

Get Signature

get reports(): Reports

Defined in: src/Pool.ts:18

Returns

Reports

Methods

activeNetworks()

activeNetworks(): Query<PoolNetwork[]>

Defined in: src/Pool.ts:79

Get the networks where a pool is active. It doesn't mean that any vaults are deployed there necessarily.

Returns

Query<PoolNetwork[]>


metadata()

metadata(): Query<PoolMetadata> | Query<null>

Defined in: src/Pool.ts:22

Returns

Query<PoolMetadata> | Query<null>


network()

network(chainId): Query<PoolNetwork>

Defined in: src/Pool.ts:64

Get a specific network where a pool can potentially be deployed.

Parameters
chainId

number

Returns

Query<PoolNetwork>


networks()

networks(): Query<PoolNetwork[]>

Defined in: src/Pool.ts:51

Get all networks where a pool can potentially be deployed.

Returns

Query<PoolNetwork[]>


trancheIds()

trancheIds(): Query<string[]>

Defined in: src/Pool.ts:28

Returns

Query<string[]>


vault()

vault(chainId, trancheId, asset): Query<Vault>

Defined in: src/Pool.ts:100

Parameters
chainId

number

trancheId

string

asset

string

Returns

Query<Vault>

Class: PoolNetwork

Defined in: src/PoolNetwork.ts:16

Query and interact with a pool on a specific network.

Extends

Properties

chainId

chainId: number

Defined in: src/PoolNetwork.ts:21


pool

pool: Pool

Defined in: src/PoolNetwork.ts:20

Methods

canTrancheBeDeployed()

canTrancheBeDeployed(trancheId): Query<boolean>

Defined in: src/PoolNetwork.ts:269

Get whether a pool is active and the tranche token can be deployed.

Parameters
trancheId

string

The tranche ID

Returns

Query<boolean>


deployTranche()

deployTranche(trancheId): Transaction

Defined in: src/PoolNetwork.ts:306

Deploy a tranche token for the pool.

Parameters
trancheId

string

The tranche ID

Returns

Transaction


deployVault()

deployVault(trancheId, currencyAddress): Transaction

Defined in: src/PoolNetwork.ts:330

Deploy a vault for a specific tranche x currency combination.

Parameters
trancheId

string

The tranche ID

currencyAddress

string

The investment currency address

Returns

Transaction


isActive()

isActive(): Query<boolean>

Defined in: src/PoolNetwork.ts:232

Get whether the pool is active on this network. It's a prerequisite for deploying vaults, and doesn't indicate whether any vaults have been deployed.

Returns

Query<boolean>


shareCurrency()

shareCurrency(trancheId): Query<CurrencyMetadata>

Defined in: src/PoolNetwork.ts:143

Get the details of the share token.

Parameters
trancheId

string

The tranche ID

Returns

Query<CurrencyMetadata>


vault()

vault(trancheId, asset): Query<Vault>

Defined in: src/PoolNetwork.ts:215

Get a specific Vault for a given tranche and investment currency.

Parameters
trancheId

string

The tranche ID

asset

string

The investment currency address

Returns

Query<Vault>


vaults()

vaults(trancheId): Query<Vault[]>

Defined in: src/PoolNetwork.ts:154

Get the deployed Vaults for a given tranche. There may exist one Vault for each allowed investment currency. Vaults are used to submit/claim investments and redemptions.

Parameters
trancheId

string

The tranche ID

Returns

Query<Vault[]>


vaultsByTranche()

vaultsByTranche(): Query<Record<string, Vault>>

Defined in: src/PoolNetwork.ts:198

Get all Vaults for all tranches in the pool.

Returns

Query<Record<string, Vault>>

An object of tranche ID to Vault.

Class: Price

Defined in: src/utils/BigInt.ts:215

Extends

Constructors

new Price()

new Price(value): Price

Defined in: src/utils/BigInt.ts:218

Parameters
value

bigint | Numeric

Returns

Price

Overrides

DecimalWrapper.constructor

Properties

decimals

readonly decimals: number = 27

Defined in: src/utils/BigInt.ts:27

Inherited from

DecimalWrapper.decimals


value

protected value: bigint

Defined in: src/utils/BigInt.ts:3

Inherited from

DecimalWrapper.value


decimals

static decimals: number = 18

Defined in: src/utils/BigInt.ts:216

Methods

add()

add(value): Price

Defined in: src/utils/BigInt.ts:226

Parameters
value

bigint | Price

Returns

Price


div()

div(value): Price

Defined in: src/utils/BigInt.ts:238

Parameters
value

bigint | Price

Returns

Price


eq()

eq<T>(value): boolean

Defined in: src/utils/BigInt.ts:115

Type Parameters

T

Parameters
value

bigint | T extends BigIntWrapper ? T<T> : never

Returns

boolean

Inherited from

DecimalWrapper.eq


gt()

gt<T>(value): boolean

Defined in: src/utils/BigInt.ts:105

Type Parameters

T

Parameters
value

bigint | T extends BigIntWrapper ? T<T> : never

Returns

boolean

Inherited from

DecimalWrapper.gt


gte()

gte<T>(value): boolean

Defined in: src/utils/BigInt.ts:110

Type Parameters

T

Parameters
value

bigint | T extends BigIntWrapper ? T<T> : never

Returns

boolean

Inherited from

DecimalWrapper.gte


isZero()

isZero(): boolean

Defined in: src/utils/BigInt.ts:119

Returns

boolean

Inherited from

DecimalWrapper.isZero


lt()

lt<T>(value): boolean

Defined in: src/utils/BigInt.ts:95

Type Parameters

T

Parameters
value

bigint | T extends BigIntWrapper ? T<T> : never

Returns

boolean

Inherited from

DecimalWrapper.lt


lte()

lte<T>(value): boolean

Defined in: src/utils/BigInt.ts:100

Type Parameters

T

Parameters
value

bigint | T extends BigIntWrapper ? T<T> : never

Returns

boolean

Inherited from

DecimalWrapper.lte


mul()

mul(value): Price

Defined in: src/utils/BigInt.ts:234

Parameters
value

bigint | Price

Returns

Price


sub()

sub(value): Price

Defined in: src/utils/BigInt.ts:230

Parameters
value

bigint | Price

Returns

Price


toBigInt()

toBigInt(): bigint

Defined in: src/utils/BigInt.ts:21

Returns

bigint

Inherited from

DecimalWrapper.toBigInt


toDecimal()

toDecimal(): Decimal

Defined in: src/utils/BigInt.ts:43

Returns

Decimal

Inherited from

DecimalWrapper.toDecimal


toFloat()

toFloat(): number

Defined in: src/utils/BigInt.ts:47

Returns

number

Inherited from

DecimalWrapper.toFloat


toString()

toString(): string

Defined in: src/utils/BigInt.ts:17

Returns

string

Inherited from

DecimalWrapper.toString


fromFloat()

static fromFloat(number): Price

Defined in: src/utils/BigInt.ts:222

Parameters
number

Numeric

Returns

Price

Class: Reports

Defined in: src/Reports/index.ts:34

Extends

Properties

pool

pool: Pool

Defined in: src/Reports/index.ts:39

Methods

assetList()

assetList(filter?): Query<AssetListReport[]>

Defined in: src/Reports/index.ts:73

Parameters
filter?

AssetListReportFilter

Returns

Query<AssetListReport[]>


assetTransactions()

assetTransactions(filter?): Query<AssetTransactionReport[]>

Defined in: src/Reports/index.ts:61

Parameters
filter?

AssetTransactionReportFilter

Returns

Query<AssetTransactionReport[]>


balanceSheet()

balanceSheet(filter?): Query<BalanceSheetReport[]>

Defined in: src/Reports/index.ts:45

Parameters
filter?

ReportFilter

Returns

Query<BalanceSheetReport[]>


cashflow()

cashflow(filter?): Query<CashflowReport[]>

Defined in: src/Reports/index.ts:49

Parameters
filter?

ReportFilter

Returns

Query<CashflowReport[]>


feeTransactions()

feeTransactions(filter?): Query<FeeTransactionReport[]>

Defined in: src/Reports/index.ts:69

Parameters
filter?

FeeTransactionReportFilter

Returns

Query<FeeTransactionReport[]>


investorList()

investorList(filter?): Query<InvestorListReport[]>

Defined in: src/Reports/index.ts:77

Parameters
filter?

InvestorListReportFilter

Returns

Query<InvestorListReport[]>


investorTransactions()

investorTransactions(filter?): Query<InvestorTransactionsReport[]>

Defined in: src/Reports/index.ts:57

Parameters
filter?

InvestorTransactionsReportFilter

Returns

Query<InvestorTransactionsReport[]>


profitAndLoss()

profitAndLoss(filter?): Query<ProfitAndLossReport[]>

Defined in: src/Reports/index.ts:53

Parameters
filter?

ReportFilter

Returns

Query<ProfitAndLossReport[]>


tokenPrice()

tokenPrice(filter?): Query<TokenPriceReport[]>

Defined in: src/Reports/index.ts:65

Parameters
filter?

TokenPriceReportFilter

Returns

Query<TokenPriceReport[]>

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

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>

Type: AssetListReport

AssetListReport: AssetListReportBase & AssetListReportPublicCredit | AssetListReportPrivateCredit

Defined in: src/types/reports.ts:265

Type: AssetListReportBase

AssetListReportBase: object

Defined in: src/types/reports.ts:231

Type declaration

assetId

assetId: string

presentValue

presentValue: Currency | undefined

timestamp

timestamp: string

type

type: "assetList"

Type: AssetListReportFilter

AssetListReportFilter: object

Defined in: src/types/reports.ts:267

Type declaration

from?

optional from: string

status?

optional status: "ongoing" | "repaid" | "overdue" | "all"

to?

optional to: string

Type: AssetListReportPrivateCredit

AssetListReportPrivateCredit: object

Defined in: src/types/reports.ts:248

Type declaration

advanceRate

advanceRate: Rate | undefined

collateralValue

collateralValue: Currency | undefined

discountRate

discountRate: Rate | undefined

lossGivenDefault

lossGivenDefault: Rate | undefined

maturityDate

maturityDate: string | undefined

originationDate

originationDate: number | undefined

outstandingInterest

outstandingInterest: Currency | undefined

outstandingPrincipal

outstandingPrincipal: Currency | undefined

probabilityOfDefault

probabilityOfDefault: Rate | undefined

repaidInterest

repaidInterest: Currency | undefined

repaidPrincipal

repaidPrincipal: Currency | undefined

repaidUnscheduled

repaidUnscheduled: Currency | undefined

subtype

subtype: "privateCredit"

valuationMethod

valuationMethod: string | undefined

Type: AssetListReportPublicCredit

AssetListReportPublicCredit: object

Defined in: src/types/reports.ts:238

Type declaration

currentPrice

currentPrice: Price | undefined

faceValue

faceValue: Currency | undefined

maturityDate

maturityDate: string | undefined

outstandingQuantity

outstandingQuantity: Currency | undefined

realizedProfit

realizedProfit: Currency | undefined

subtype

subtype: "publicCredit"

unrealizedProfit

unrealizedProfit: Currency | undefined

Type: AssetTransactionReport

AssetTransactionReport: object

Defined in: src/types/reports.ts:167

Type declaration

amount

amount: Currency

assetId

assetId: string

epoch

epoch: string

timestamp

timestamp: string

transactionHash

transactionHash: string

transactionType

transactionType: AssetTransactionType

type

type: "assetTransactions"

Type: AssetTransactionReportFilter

AssetTransactionReportFilter: object

Defined in: src/types/reports.ts:177

Type declaration

assetId?

optional assetId: string

from?

optional from: string

to?

optional to: string

transactionType?

optional transactionType: "created" | "financed" | "repaid" | "priced" | "closed" | "cashTransfer" | "all"

Type: BalanceSheetReport

BalanceSheetReport: object

Defined in: src/types/reports.ts:36

Balance sheet type

Type declaration

accruedFees

accruedFees: Currency

assetValuation

assetValuation: Currency

netAssetValue

netAssetValue: Currency

offchainCash

offchainCash: Currency

onchainReserve

onchainReserve: Currency

timestamp

timestamp: string

totalCapital?

optional totalCapital: Currency

tranches?

optional tranches: object[]

type

type: "balanceSheet"

Type: CashflowReport

CashflowReport: CashflowReportPublicCredit | CashflowReportPrivateCredit

Defined in: src/types/reports.ts:89

Type: CashflowReportPrivateCredit

CashflowReportPrivateCredit: CashflowReportBase & object

Defined in: src/types/reports.ts:84

Type declaration

assetFinancing?

optional assetFinancing: Currency

subtype

subtype: "privateCredit"

Type: CashflowReportPublicCredit

CashflowReportPublicCredit: CashflowReportBase & object

Defined in: src/types/reports.ts:78

Type declaration

assetPurchases?

optional assetPurchases: Currency

realizedPL?

optional realizedPL: Currency

subtype

subtype: "publicCredit"

Type: Client

Client: PublicClient<any, Chain>

Defined in: src/types/index.ts:19

Type: Config

Config: object

Defined in: src/types/index.ts:3

Type declaration

environment

environment: "mainnet" | "demo" | "dev"

indexerUrl

indexerUrl: string

ipfsUrl

ipfsUrl: string

rpcUrls?

optional rpcUrls: Record<number | string, string>

Type: CurrencyMetadata

CurrencyMetadata: object

Defined in: src/config/lp.ts:43

Type declaration

address

address: HexString

chainId

chainId: number

decimals

decimals: number

name

name: string

supportsPermit

supportsPermit: boolean

symbol

symbol: string

Type: EIP1193ProviderLike

EIP1193ProviderLike: object

Defined in: src/types/transaction.ts:50

Type declaration

request()

Parameters
args

...any

Returns

Promise<any>

Type: FeeTransactionReport

FeeTransactionReport: object

Defined in: src/types/reports.ts:191

Type declaration

amount

amount: Currency

feeId

feeId: string

timestamp

timestamp: string

type

type: "feeTransactions"

Type: FeeTransactionReportFilter

FeeTransactionReportFilter: object

Defined in: src/types/reports.ts:198

Type declaration

from?

optional from: string

to?

optional to: string

transactionType?

optional transactionType: "directChargeMade" | "directChargeCanceled" | "accrued" | "paid" | "all"

Type: HexString

HexString: `0x${string}`

Defined in: src/types/index.ts:20

Type: InvestorListReport

InvestorListReport: object

Defined in: src/types/reports.ts:279

Type declaration

accountId

accountId: string

chainId

chainId: number | "centrifuge" | "all"

evmAddress?

optional evmAddress: string

pendingInvest

pendingInvest: Currency

pendingRedeem

pendingRedeem: Currency

poolPercentage

poolPercentage: Rate

position

position: Currency

type

type: "investorList"

Type: InvestorListReportFilter

InvestorListReportFilter: object

Defined in: src/types/reports.ts:290

Type declaration

address?

optional address: string

from?

optional from: string

network?

optional network: number | "centrifuge" | "all"

to?

optional to: string

trancheId?

optional trancheId: string

Type: InvestorTransactionsReport

InvestorTransactionsReport: object

Defined in: src/types/reports.ts:137

Type declaration

account

account: string

chainId

chainId: number | "centrifuge"

currencyAmount

currencyAmount: Currency

epoch

epoch: string

price

price: Price

timestamp

timestamp: string

trancheTokenAmount

trancheTokenAmount: Currency

trancheTokenId

trancheTokenId: string

transactionHash

transactionHash: string

transactionType

transactionType: SubqueryInvestorTransactionType

type

type: "investorTransactions"

Type: InvestorTransactionsReportFilter

InvestorTransactionsReportFilter: object

Defined in: src/types/reports.ts:151

Type declaration

address?

optional address: string

from?

optional from: string

network?

optional network: number | "centrifuge" | "all"

to?

optional to: string

tokenId?

optional tokenId: string

transactionType?

optional transactionType: "orders" | "executions" | "transfers" | "all"

Type: OperationConfirmedStatus

OperationConfirmedStatus: object

Defined in: src/types/transaction.ts:31

Type declaration

hash

hash: HexString

receipt

receipt: TransactionReceipt

title

title: string

type

type: "TransactionConfirmed"

Type: OperationPendingStatus

OperationPendingStatus: object

Defined in: src/types/transaction.ts:26

Type declaration

hash

hash: HexString

title

title: string

type

type: "TransactionPending"

Type: OperationSignedMessageStatus

OperationSignedMessageStatus: object

Defined in: src/types/transaction.ts:21

Type declaration

signed

signed: any

title

title: string

type

type: "SignedMessage"

Type: OperationSigningMessageStatus

OperationSigningMessageStatus: object

Defined in: src/types/transaction.ts:17

Type declaration

title

title: string

type

type: "SigningMessage"

Type: OperationSigningStatus

OperationSigningStatus: object

Defined in: src/types/transaction.ts:13

Type declaration

title

title: string

type

type: "SigningTransaction"

Type: OperationStatus

OperationStatus: OperationSigningStatus | OperationSigningMessageStatus | OperationSignedMessageStatus | OperationPendingStatus | OperationConfirmedStatus | OperationSwitchChainStatus

Defined in: src/types/transaction.ts:42

Type: OperationStatusType

OperationStatusType: "SwitchingChain" | "SigningTransaction" | "SigningMessage" | "SignedMessage" | "TransactionPending" | "TransactionConfirmed"

Defined in: src/types/transaction.ts:5

Type: OperationSwitchChainStatus

OperationSwitchChainStatus: object

Defined in: src/types/transaction.ts:37

Type declaration

chainId

chainId: number

type

type: "SwitchingChain"

Type: ProfitAndLossReport

ProfitAndLossReport: ProfitAndLossReportPublicCredit | ProfitAndLossReportPrivateCredit

Defined in: src/types/reports.ts:122

Type: ProfitAndLossReportPrivateCredit

ProfitAndLossReportPrivateCredit: ProfitAndLossReportBase & object

Defined in: src/types/reports.ts:116

Type declaration

assetWriteOffs

assetWriteOffs: Currency

interestAccrued

interestAccrued: Currency

subtype

subtype: "privateCredit"

Type: ProfitAndLossReportPublicCredit

ProfitAndLossReportPublicCredit: ProfitAndLossReportBase & object

Defined in: src/types/reports.ts:111

Type declaration

subtype

subtype: "publicCredit"

totalIncome

totalIncome: Currency

Type: Query

Query<T>: PromiseLike<T> & Observable<T> & object

Defined in: src/types/query.ts:15

Type declaration

toPromise()

toPromise: () => Promise<T>

Returns

Promise<T>

Type Parameters

T

Type: Signer

Signer: EIP1193ProviderLike | LocalAccount

Defined in: src/types/transaction.ts:53

Type: TokenPriceReport

TokenPriceReport: object

Defined in: src/types/reports.ts:211

Type declaration

timestamp

timestamp: string

tranches

tranches: object[]

type

type: "tokenPrice"

Type: TokenPriceReportFilter

TokenPriceReportFilter: object

Defined in: src/types/reports.ts:217

Type declaration

from?

optional from: string

groupBy?

optional groupBy: GroupBy

to?

optional to: string

Type: Transaction

Transaction: Query<OperationStatus>

Defined in: src/types/transaction.ts:64