Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ For testing purposes, you can connect to testnet instead by setting environment:
const poolId = new PoolId(1);
const pool = await centrifuge.pool(poolId);
const scId = ShareClassId.from(poolId, 1);
const chainId = 11155111; // Ethereum Sepolia
const centrifugeId = 1; // Centrifuge network ID

const poolNetworks = await pool.activeNetworks();

const poolNetwork = poolNetworks.filter(
(activeNetwork) => activeNetwork.chainId === chainId
(activeNetwork) => activeNetwork.centrifugeId === centrifugeId
);

await poolNetwork.deployMerkleProofManager();
Expand All @@ -57,15 +57,15 @@ Retrieve the deployed Merkle Proof Manager and set it as a BalanceSheet manager:

```typescript
const merkleProofManager = await poolNetwork.merkleProofManager();
await poolNetwork.updateBalanceSheetManagers([{ chainId, address: merkleProofManager.address, canManage: true }]),
await poolNetwork.updateBalanceSheetManagers([{ centrifugeId, address: merkleProofManager.address, canManage: true }]),
```

## 4. Setup policies

Policies define specific contract methods that strategists are authorized to execute for managing pool assets. The Merkle Proof Manager controls access to balance sheet functions and enables whitelisting of strategists, allowing them to perform approved operations securely:

```typescript
const addresses = await centrifuge._protocolAddresses(chainId);
const addresses = await centrifuge._protocolAddresses(centrifugeId);
const strategist = "0xStrategistAddress";

const vaultDepositPolicy = {
Expand Down
6 changes: 3 additions & 3 deletions docs/developer/centrifuge-sdk/invest-into-a-vault/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,17 @@ If you’re using a private key or server-side setup, you can also provide a [Vi
## 3. Get a pool and vault

Each pool can contain multiple share classes and each share class can have multiple vaults issuing tokens against an deposit asset.
You need the pool ID, share class ID, chain ID, and asset address.
You need the pool ID, share class ID, centrifuge ID, and asset address.

```typescript
// Get a pool by ID
const poolId = new PoolId(1);
const pool = await centrifuge.pool(poolId);
const scId = ShareClassId.from(poolId, 1);
const assetId = AssetId.from(centId, 1);
const chainId = 11155111; // Ethereum Sepolia
const centrifugeId = 1; // Centrifuge network ID
// Get a vault
const vault = await pool.vault(chainId, scId, assetId);
const vault = await pool.vault(centrifugeId, scId, assetId);
```

## 4. Deposit into the vault
Expand Down
8 changes: 4 additions & 4 deletions docs/developer/centrifuge-sdk/query-data-of-a-pool/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,15 @@ console.log(metadata);
## 5. Query a vault

Each pool can contain multiple tokens and each token can have multiple vaults.
You can query a single vault using pool ID, token ID, chain ID, and asset address:
You can query a single vault using pool ID, token ID, centrifuge ID, and asset address:

```typescript
// Get tokenId based on previously defined poolId
const tokenId = ShareClassId.from(poolId, 1);
const assetId = AssetId.from(centId, 1);
const chainId = 11155111; // Ethereum Sepolia
const centrifugeId = 1; // Centrifuge network ID
// Get a vault
const vault = await pool.vault(chainId, tokenId, assetId);
const vault = await pool.vault(centrifugeId, tokenId, assetId);
```

or if you do not know token ID and asset ID you can do:
Expand All @@ -97,7 +97,7 @@ const vaults = await poolNetwork.vaults(tokenId);

// OR

const vaults = await shareClass.vaults(chainId);
const vaults = await shareClass.vaults(centrifugeId);

// OR if we do have asset address

Expand Down