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

@greyw0rks/vault-escrow

v1.0.2

Published

JavaScript SDK for the VaultSTX trustless milestone escrow protocol on Stacks

Downloads

6,005

Readme

@greyw0rks/vault-escrow

JavaScript SDK for the VaultSTX trustless milestone escrow protocol on Stacks.

npm version License: MIT

Install

npm install @greyw0rks/vault-escrow

Requires @stacks/transactions and @stacks/network as peer dependencies.

Overview

VaultSTX is a trustless milestone-based escrow protocol on Stacks. Clients lock STX, release it per milestone, and disputes are resolved by an on-chain arbitrator — no multisig, no off-chain coordination.

Deployed on Stacks Mainnet:

| Contract | Address | |---|---| | vaultstx-factory | SP1SY1E599GN04XRD2DQBKV7E62HYBJR2CT9S5QKK.vaultstx-factory | | vaultstx-escrow | SP1SY1E599GN04XRD2DQBKV7E62HYBJR2CT9S5QKK.vaultstx-escrow | | vaultstx-dispute | SP1SY1E599GN04XRD2DQBKV7E62HYBJR2CT9S5QKK.vaultstx-dispute |

Usage

Create an escrow

import { buildCreateEscrow } from '@greyw0rks/vault-escrow';
import { makeContractCall, broadcastTransaction } from '@stacks/transactions';

const txOptions = {
  ...buildCreateEscrow({
    provider: 'SP2...provider-address',
    totalAmount: 10_000_000n, // 10 STX in microSTX
    numMilestones: 3,
    description: 'Website redesign project',
  }),
  senderKey: privateKey,
  network,
};
const tx = await makeContractCall(txOptions);
await broadcastTransaction({ transaction: tx, network });

Read an escrow

import { getEscrow, getMilestone, getEscrowBalance, getNextEscrowId } from '@greyw0rks/vault-escrow';

const total = await getNextEscrowId();       // total escrows created
const escrow = await getEscrow(1);           // fetch escrow #1
const milestone = await getMilestone(1, 0);  // first milestone of escrow #1
const balance = await getEscrowBalance(1);   // locked STX in microSTX

Approve and release a milestone

import { buildApproveMilestone, buildReleaseMilestone } from '@greyw0rks/vault-escrow';

// Client approves milestone completion
const approve = buildApproveMilestone(1, 0); // escrowId=1, milestoneIndex=0

// Release payment to provider
const release = buildReleaseMilestone(1, 0);

Open and resolve a dispute

import { buildOpenDispute, buildResolveDispute, hasOpenDispute } from '@greyw0rks/vault-escrow/dispute';

const disputed = await hasOpenDispute(1);

const open = buildOpenDispute({
  escrowId: 1,
  client: 'SP1...client',
  provider: 'SP2...provider',
  disputedAmount: 5_000_000n,
  clientClaim: 3_000_000n,
  providerClaim: 2_000_000n,
  reason: 'Milestone deliverable not met',
});

// Arbitrator resolves
const resolve = buildResolveDispute({
  disputeId: 1,
  clientAward: 3_000_000n,
  providerAward: 2_000_000n,
  notes: 'Partial work completed',
});

API

Factory (@greyw0rks/vault-escrow)

| Function | Description | |---|---| | getEscrow(id, network?) | Fetch an escrow by ID | | getMilestone(escrowId, index, network?) | Fetch a milestone | | getEscrowBalance(id, network?) | Locked STX balance | | getTotalVolume(network?) | Cumulative STX escrowed | | getNextEscrowId(network?) | Total escrows created | | buildCreateEscrow(params) | Create a new escrow | | buildSetMilestone(params) | Define a milestone | | buildApproveMilestone(id, index) | Mark milestone complete | | buildReleaseMilestone(id, index) | Release milestone payment | | buildCancelEscrow(id) | Cancel an escrow |

Dispute (@greyw0rks/vault-escrow/dispute)

| Function | Description | |---|---| | getDispute(id, network?) | Fetch a dispute by ID | | getDisputeByEscrow(escrowId, network?) | Find dispute for an escrow | | hasOpenDispute(escrowId, network?) | Check for open dispute | | getTotalDisputes(network?) | Total disputes filed | | buildOpenDispute(params) | Open a dispute | | buildResolveDispute(params) | Resolve (arbitrator only) | | buildWithdrawDispute(id) | Withdraw an open dispute |

Constants

import { ESCROW_STATES, DISPUTE_STATES, FACTORY_LIMITS, ERROR_CODES } from '@greyw0rks/vault-escrow';

ESCROW_STATES.ACTIVE    // 1
ESCROW_STATES.COMPLETED // 2
ESCROW_STATES.CANCELLED // 3
ESCROW_STATES.DISPUTED  // 4

DISPUTE_STATES.OPEN     // 1
DISPUTE_STATES.RESOLVED // 2

FACTORY_LIMITS.MAX_MILESTONES      // 10
FACTORY_LIMITS.MAX_ESCROWS_PER_USER // 50

Links

License

MIT