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

@gtcx/sdk

v0.1.0

Published

Official TypeScript SDK for GTCX Protocol

Readme

@gtcx/sdk

Official TypeScript SDK for GTCX Protocol.

npm version License: BSL 1.1

Installation

npm install @gtcx/sdk
# or
pnpm add @gtcx/sdk
# or
yarn add @gtcx/sdk

Quick Start

import { GTCXClient } from '@gtcx/sdk';

// Initialize client
const client = new GTCXClient({
  apiUrl: 'https://api.testnet.gtcx.io',
  networkId: 'gtcx:testnet',
  chainId: 'gtcx-testnet-1',
  apiKey: process.env.GTCX_API_KEY,
});

// Verify a TradePass credential
const credential = await client.tradepass.resolve('did:gtcx:tp_producer_001');
const verification = await client.tradepass.verify(credential);

console.log(`Valid: ${verification.valid}`);

Features

  • Full TypeScript Support: Complete type definitions with Zod runtime validation
  • All Protocol Components: TradePass, GCI, GeoTag, VaultMark, Settlement
  • Tree-Shakable: Import only what you need
  • Zero Dependencies: Only Zod for runtime validation

API Reference

GTCXClient

Main client for interacting with GTCX Protocol.

const client = new GTCXClient({
  apiUrl: string;      // API endpoint
  networkId: string;   // Network identifier
  chainId: string;     // Chain ID
  apiKey?: string;     // Optional API key
  timeout?: number;    // Request timeout (default: 30000ms)
});

TradePass

Digital identity and credential management.

// Resolve a DID to credential
const credential = await client.tradepass.resolve('did:gtcx:tp_...');

// Verify a credential
const result = await client.tradepass.verify(credential);

// Issue a new credential (requires issuer permissions)
const newCredential = await client.tradepass.issue({
  did: 'did:gtcx:tp_new_producer',
  name: 'Kwame Asante',
  role: 'producer',
  entityId: 'entity_001',
  jurisdiction: 'GH',
});

// Revoke a credential
await client.tradepass.revoke('did:gtcx:tp_...', 'License expired');

GCI (Global Compliance Index)

Compliance scoring and management.

// Get current score
const score = await client.gci.getScore('entity_001');
console.log(`Score: ${score.score}/100 (${score.tier})`);

// Get score history
const history = await client.gci.getHistory('entity_001', 30);

// Get improvement suggestions
const suggestions = await client.gci.getSuggestions('entity_001');

// Submit evidence for a factor
await client.gci.submitEvidence('entity_001', 'documentation', ['https://example.com/license.pdf']);

GeoTag

Location verification.

// Submit a location claim
const claim = await client.geotag.submit({
  type: 'extraction',
  location: {
    latitude: 6.6885,
    longitude: -1.6244,
    accuracy: 5,
    timestamp: new Date().toISOString(),
    source: 'gps',
  },
  claimant: 'did:gtcx:tp_producer_001',
  licenseId: 'GH-ML-2024-001234',
});

// Verify a claim
const verification = await client.geotag.verify(claim.id);
console.log(`Within boundary: ${verification.withinBoundary}`);

VaultMark

Custody tracking and management.

// Get custody status
const custody = await client.vaultmark.getCustody('lot:gh-ash-20260120-001');

// Get custody history
const history = await client.vaultmark.getHistory('lot:gh-ash-20260120-001');

// Transfer custody
const newCustody = await client.vaultmark.transfer(
  'lot:gh-ash-20260120-001',
  'did:gtcx:tp_vault_001'
);

// Transfer with escrow
const escrowCustody = await client.vaultmark.transfer(
  'lot:gh-ash-20260120-001',
  'did:gtcx:tp_buyer_001',
  {
    escrow: true,
    releaseConditions: ['payment_confirmed', 'inspection_passed'],
  }
);

// Split a lot
const [lot1, lot2] = await client.vaultmark.split('lot:gh-ash-20260120-001', [1.5, 1.0]);

// Merge lots
const mergedLot = await client.vaultmark.merge([
  'lot:gh-ash-20260120-001',
  'lot:gh-ash-20260120-002',
]);

Settlement

Payment-versus-Physical settlement.

// Create settlement
const settlement = await client.settlement.create({
  lotId: 'lot:gh-ash-20260120-001',
  buyer: 'did:gtcx:tp_buyer_001',
  seller: 'did:gtcx:tp_producer_001',
  amount: { value: 125000, currency: 'USD' },
  paymentMethod: 'escrow',
});

// Confirm payment
await client.settlement.confirmPayment(settlement.id, 'tx_proof_123');

// Confirm delivery
await client.settlement.confirmDelivery(settlement.id, 'delivery_proof_456');

// Dispute if needed
await client.settlement.dispute(settlement.id, 'Weight mismatch');

Types

All types are exported and can be used for type safety:

import type {
  TradePassCredential,
  TradePassDID,
  TradePassRole,
  GCIScore,
  GCITier,
  GCIFactor,
  GeoTagClaim,
  GeoLocation,
  CustodyRecord,
  CustodyEvent,
  Asset,
  Settlement,
} from '@gtcx/sdk';

Zod Schemas

Runtime validation schemas are also exported:

import {
  TradePassCredentialSchema,
  GCIScoreSchema,
  GeoTagClaimSchema,
  CustodyRecordSchema,
  SettlementSchema,
} from '@gtcx/sdk';

// Validate external data
const result = TradePassCredentialSchema.safeParse(externalData);
if (result.success) {
  // Type-safe credential
  const credential = result.data;
}

Error Handling

import { GTCXClient, GTCXError } from '@gtcx/sdk';

try {
  const credential = await client.tradepass.resolve('did:gtcx:tp_invalid');
} catch (error) {
  if (error instanceof GTCXError) {
    console.log(`Status: ${error.status}`);
    console.log(`Code: ${error.code}`);
    console.log(`Message: ${error.message}`);
  }
}

Networks

| Network | API URL | Description | | ------- | ----------------------------- | ------------------------------ | | Testnet | https://api.testnet.gtcx.io | Development and testing | | Ghana | https://api.ghana.gtcx.io | Ghana pilot network | | Mainnet | https://api.gtcx.io | Production (not yet available) |

License

BSL 1.1 - See LICENSE for details.

Converts to Apache 2.0 on January 1, 2030.

Links