Skip to content

Developer Documentation

Build applications that integrate with Stratos Vault.


Overview

Stratos Vault enables developers to build Dock Apps - applications that run within the wallet interface with access to user assets and signing capabilities.

┌─────────────────────────────────────────────────────────────────┐
│                       Stratos Vault                              │
│  ┌───────────────────────────────────────────────────────────┐  │
│  │                     Wallet Interface                       │  │
│  │  ┌─────────────────────────────────────────────────────┐  │  │
│  │  │                    Your App                          │  │  │
│  │  │                    (iframe)                          │  │  │
│  │  │                                                      │  │  │
│  │  │   ┌──────────────────────────────────────────────┐  │  │  │
│  │  │   │           Stratos Wallet SDK                  │  │  │  │
│  │  │   │                                               │  │  │  │
│  │  │   │  • User authentication                       │  │  │  │
│  │  │   │  • Asset balances                            │  │  │  │
│  │  │   │  • Transaction signing                       │  │  │  │
│  │  │   │  • Canton contract operations                │  │  │  │
│  │  │   └──────────────────────────────────────────────┘  │  │  │
│  │  └─────────────────────────────────────────────────────┘  │  │
│  └───────────────────────────────────────────────────────────┘  │
└─────────────────────────────────────────────────────────────────┘

What You Can Build

DeFi Applications

  • Token swaps (Jupiter, Uniswap integrations)
  • Lending and borrowing
  • Liquidity provision
  • Yield farming interfaces

Payment Solutions

  • Point-of-sale systems
  • Invoice payments
  • Subscription billing
  • Cross-border transfers

Asset Management

  • Portfolio dashboards
  • Multi-sig treasury tools
  • Investment interfaces
  • Reporting and analytics

Canton Applications

  • Regulated token operations
  • Compliant DeFi protocols
  • Enterprise workflows
  • Cross-institution settlements

The SDK

The Stratos Wallet SDK (@stratos/wallet-sdk) provides a TypeScript API for wallet integration:

typescript
import { getSDK } from '@stratos/wallet-sdk';

const sdk = getSDK();

// Connect to wallet
const { user, addresses } = await sdk.connect();

// Get asset balances
const assets = await sdk.getAssets();

// Send a transaction
await sdk.sendEVMTransaction({
  transaction: {
    to: '0x...',
    value: '0x...',
    chainId: 1,
  }
});

// Work with Canton contracts
const contracts = await sdk.cantonQuery({
  templateId: 'pkg#Module:Template',
});

Quick Start

1. Create Your App

bash
npm create vite@latest my-dock-app -- --template react-ts
cd my-dock-app
npm install @stratos/wallet-sdk

2. Connect to Wallet

typescript
import { getSDK } from '@stratos/wallet-sdk';

const sdk = getSDK();

async function init() {
  const { connected, user } = await sdk.connect();

  if (connected && user) {
    console.log('Welcome,', user.username);
    const assets = await sdk.getAssets();
    console.log('Assets:', assets);
  }
}

3. Deploy Your App

bash
npm run build
npx wrangler pages deploy dist

4. Add to Wallet

Admin adds your app URL to the Dock Apps section in the wallet admin panel.


SDK Capabilities

Authentication

MethodDescription
connect()Connect to wallet, get user info
getUser()Get current authenticated user
isConnected()Check connection status

Assets & Balances

MethodDescription
getAssets()Get all assets with balances
getBalance(symbol)Get specific asset balance
getAddresses()Get user's chain addresses

Transactions

MethodDescription
sendEVMTransaction()Sign and send EVM transaction
signEVMTransaction()Sign without broadcasting
signTypedData()Sign EIP-712 typed data
transfer()Canton token transfer

Canton Operations

MethodDescription
cantonQuery()Query contracts by template
cantonCreate()Create new contract
cantonExercise()Exercise contract choice
getTransferOffers()Get pending transfers

Events

EventDescription
assetsChangedAsset balances updated
userChangedUser logged in/out
transactionsChangedNew transactions

Canton Integration

For apps using Canton Network smart contracts:

Distribute Your Package

Implement /api/package endpoint:

typescript
export const onRequestGet = async () => {
  return Response.json({
    name: 'My Protocol',
    packageId: 'abc123...',
    darUrl: '/api/package/download',
    templates: ['Module:Template'],
  });
};

Work with Contracts

typescript
// Query contracts
const positions = await sdk.cantonQuery({
  templateId: 'pkg#DeFi:Position',
  filter: { owner: user.partyId },
});

// Create contract
await sdk.cantonCreate({
  templateId: 'pkg#DeFi:Order',
  payload: {
    trader: user.partyId,
    amount: '100.0',
  },
});

// Exercise choice
await sdk.cantonExercise({
  contractId: position.contractId,
  templateId: 'pkg#DeFi:Position',
  choice: 'Withdraw',
  argument: { amount: '50.0' },
});

Documentation

ResourceDescription
SDK ReferenceComplete API documentation
Transactions GuideMulti-chain transaction signing
Canton ContractsWorking with Daml contracts

Requirements

Technical Requirements

  • Modern JavaScript framework (React, Vue, Svelte, etc.)
  • TypeScript recommended
  • Must be deployable as static site or Cloudflare Pages

Security Requirements

  • HTTPS only
  • No server-side key storage
  • All signing via SDK methods
  • Validate all user inputs

User Experience

  • Handle connection states gracefully
  • Show loading states during transactions
  • Display clear error messages
  • Refresh data after transactions

Support

  • SDK Issues: GitHub repository issues
  • Integration Help: Contact developer support
  • Enterprise: Dedicated integration support available

Next Steps

Enterprise-grade multi-chain wallet infrastructure.