npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@cokeeps/travel-rule-sdk

v0.0.3

Published

Travel Rule SDK for VASPs to exchange required originator/beneficiary data securely and meet global compliance requirements.

Downloads

303

Readme

Travel Rule SDK

Travel Rule SDK for VASPs to exchange required originator/beneficiary data securely and meet global compliance requirements.

Features

  • IVMS101 Compliance - Supports the IVMS101 data model standard

Installation

npm install @cokeeps/travel-rule-sdk

Or using yarn/pnpm:

yarn add @cokeeps/travel-rule-sdk
pnpm add @cokeeps/travel-rule-sdk

Quick Start

import { createTravelSDK } from '@cokeeps/travel-rule-sdk';

// Initialize client
const client = createTravelSDK({
  endpoint: 'https://api.example.com',
  debug: true,
});

// Set VASP keys
const vaspKeys = {
  vasp_id: 'your-vasp-id',
  sig: { priv: { /* JWK */ }, pub: { /* JWK */ } },
  dpop: { priv: { /* JWK */ }, pub: { /* JWK */ } },
  enc: { priv: { /* JWK */ }, pub: { /* JWK */ } },
};

// Send a message
const response = await client.sendMessageWithAuth(vaspKeys, {
  ivms101Version: '1.0',
  messageId: 'msg-123',
  createdAt: new Date().toISOString(),
  transfer: {
    direction: 'OUTBOUND',
    asset: 'USDT',
    amount: '1000.00',
    network: 'TRC20',
    txHash: '0x...',
    originatingAddress: 'TWallet...',
    beneficiaryAddress: 'TWallet...',
  },
  originatingVasp: { vaspName: 'My VASP' },
  beneficiaryVasp: { vaspName: 'Partner VASP' },
  originator: {
    type: 'NATURAL',
    name: {
      nameIdentifier: [{
        primaryIdentifier: 'John',
        nameIdentifierType: 'LEGL',
      }],
    },
  },
  beneficiary: {
    type: 'NATURAL',
    name: {
      nameIdentifier: [{
        primaryIdentifier: 'Jane',
        nameIdentifierType: 'LEGL',
      }],
    },
  },
});

console.log('Message sent:', response.messageId);

// Retrieve a message
const message = await client.getMessageWithAuth(vaspKeys, response.messageId);
console.log('Retrieved message:', message);

Configuration

interface SDKConfig {
  endpoint: string;                    // Required: API endpoint URL
  timeout?: number;                     // Optional: Request timeout (default: 30000ms)
  headers?: Record<string, string>;    // Optional: Additional headers
  debug?: boolean;                      // Optional: Enable debug logging
  logger?: (message: string, data?: any) => void; // Optional: Custom logger
}

Authentication

The SDK supports automatic and manual authentication:

// Automatic
const token = await client.authenticate(vaspKeys);
const message = await client.getMessageWithAuth(vaspKeys, 'message-id');

// Manual
client.setVaspKeys(vaspKeys);
const token = await client.getAccessToken();
const message = await client.getMessage(token.access_token, 'message-id');

Error Handling

import { SDKError, ValidationError } from '@cokeeps/travel-rule-sdk';

try {
  await client.sendMessageWithAuth(vaspKeys, messageData);
} catch (error) {
  if (error instanceof ValidationError) {
    console.error('Validation error:', error.message, error.field);
  } else if (error instanceof SDKError) {
    console.error('SDK error:', error.message);
  }
}

API Methods

Authentication

  • authenticate(vaspKeys) - Authenticate and get access token
  • getAccessToken() - Get OAuth access token
  • getClientAssertion(client_id) - Generate client assertion JWT
  • getDpopProof(purpose, accessToken?, messageID?) - Generate DPoP proof

Messages

  • sendMessage(messageData, accessToken) - Send a message
  • sendMessageWithAuth(vaspKeys, messageData) - Send with auto-auth
  • getMessage(accessToken, messageID) - Retrieve a message
  • getMessageWithAuth(vaspKeys, messageID) - Get with auto-auth

Configuration

  • setVaspKeys(vaspKeys) - Set VASP keys
  • getVaspKeys() - Get current VASP keys
  • updateEndpoint(endpoint) - Update API endpoint
  • getEndpoint() - Get current endpoint

TypeScript Support

Full TypeScript support with exported types:

import type {
  SDKConfig,
  VaspKeys,
  MessageFormData,
  AccessTokenResponse,
  SendMessageResponse,
} from '@cokeeps/travel-rule-sdk';

Requirements

  • Node.js 18 or higher
  • TypeScript

Documentation

For comprehensive documentation, see here.

License

Travel Rule SDK is released under the MIT License.


Package: @cokeeps/travel-rule-sdk
Repository: GitHub