Skip to content

Latest commit

 

History

25 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Institutional Vault - CWP Example Scripts

TypeScript examples demonstrating programmatic use of the Institutional Vault Core Wallet Platform (CWP) API.

Prerequisites

  • Node.js >= 18
  • An Institutional Vault instance with API User key or Bearer JWT
  • For Canton examples: participant JSON Ledger API access with OAuth client credentials

Quick start

cp .env-example .env       # fill in your Vault URL + credentials
npm install                # install dependencies
npm run generate           # generate TypeScript SDKs from OpenAPI specs (required)
npm run evm:transfer       # run the ERC-20 transfer example

Examples

Script Command Description
Register custom chain npm run cwp:register-chain Register a customer EVM chain + native asset
Create account npm run cwp:create-account Create a named account under a master key
Get address npm run cwp:get-address Derive an address for an account (feeds later scripts)
EVM ERC-20 transfer npm run evm:transfer Send ERC-20 tokens via EVM.Data calldata
EVM ERC-20 mint npm run evm:mint Mint ERC-20 tokens via EVM.Data calldata
EVM ERC-7943 deploy npm run evm:deploy Compile and deploy an OpenZeppelin ERC-7943 token
EVM ERC-7943 admin npm run evm:deposit-token Allow-list, mint, freeze, force-transfer, and pause
Canton CC transfer npm run canton:transfer Prepare, sign, execute Canton Amulet transfer
Canton create external party npm run canton:create-externalparty Create an Ed25519 external party on a Canton participant

Setup order for a new custom chain: cwp:register-chain → cwp:create-account → cwp:get-address (then copy IV_SOURCE_ADDRESS into .env for EVM examples).

Each example has a companion doc in [docs/](docs/) describing required env vars, policy posture, and success criteria.

For the ERC-7943 walkthrough, run evm:deploy, copy the printed contract address to IV_TOKEN_CONTRACT_ADDRESS, then run evm:deposit-token. The contract starts from the OpenZeppelin Stablecoin wizard and adds the ERC-7943 ERC20uRWA extension.

OpenAPI specs

File Contents
openapi/openapi.yaml IV and CWP API spec
openapi/canton-gateway-signing-interface.yaml Canton Signing API (/api/cwp/canton)

These specs are pinned to a specific Vault release. To refresh, download from your running instance's /swagger.html endpoint, then run npm run generate and npm run typecheck to verify compatibility.

Other language SDKs

The OpenAPI specs work with any code generator. Examples for non-TypeScript:

# Java (requires openapi-generator CLI)
openapi-generator generate -i openapi/openapi.yaml -g java -o ./iv-sdk-java

# Go (requires oapi-codegen)
mkdir -p ./iv-sdk-go
oapi-codegen -package client -generate types,client -o ./iv-sdk-go/iv-client.gen.go openapi/openapi.yaml

Links

About

Institutional Vault Client SDK examples

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages