Skip to content

Blockdaemon/demo-iv-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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 (examples include setup scripts to register a chain, create an account, and derive an address)
  • A API User key or Bearer JWT with Admin or MarketOps role
  • 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 contract deploy npm run evm:deploy Sign-only deploy; client broadcasts via RPC
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-chaincwp:create-accountcwp: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.

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

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages