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

@syeedalireza/auction-escrow-web3

v1.0.1

Published

Professional reverse auction package

Downloads

16

Readme

@syeedalireza/auction-escrow-web3

A clean TypeScript wrapper around blockchain smart contracts to handle escrow flows in decentralized e-commerce reverse auctions.

Features

  • Web3 Integration: Uses ethers.js to interact with EVM-compatible blockchains.
  • Hexagonal Architecture: Clean separation of concerns using the Ports and Adapters pattern.
  • Type Safety: Fully typed interactions with the smart contract.

Installation

npm install @syeedalireza/auction-escrow-web3 ethers

Usage

import { EscrowAdapter, EscrowState } from '@syeedalireza/auction-escrow-web3';

// Initialize the adapter
const escrow = new EscrowAdapter({
  contractAddress: '0xYourContractAddress',
  rpcUrl: 'https://mainnet.infura.io/v3/YOUR_PROJECT_ID',
  privateKey: '0xYourPrivateKey' // Optional: Only required for write operations
});

async function run() {
  const auctionId = 'auction-123';
  const sellerAddress = '0xSellerAddress';

  // 1. Create an escrow (Buyer locks funds)
  const createTx = await escrow.createEscrow(auctionId, sellerAddress);
  console.log('Escrow created:', createTx);

  // 2. Deposit funds
  const depositTx = await escrow.depositFunds(auctionId, '1000000000000000000'); // 1 ETH in Wei
  console.log('Funds deposited:', depositTx);

  // 3. Check status
  const details = await escrow.getEscrowDetails(auctionId);
  console.log('Escrow State:', EscrowState[details.state]);

  // 4. Release funds to seller (after service delivery)
  const releaseTx = await escrow.releaseFunds(auctionId);
  console.log('Funds released:', releaseTx);
}

API

EscrowAdapter

Constructor

new EscrowAdapter(config: EscrowConfig)

  • config.contractAddress: The deployed smart contract address.
  • config.rpcUrl: The RPC endpoint (e.g., Infura, Alchemy).
  • config.privateKey: (Optional) Private key for signing transactions. Required for state-changing methods.

Methods

  • createEscrow(auctionId: string, seller: string): Promise<string>: Initializes the escrow. Returns transaction hash.
  • depositFunds(auctionId: string, amountInWei: string): Promise<string>: Locks funds in the contract.
  • releaseFunds(auctionId: string): Promise<string>: Releases funds to the seller.
  • refundBuyer(auctionId: string): Promise<string>: Refunds the buyer (if conditions aren't met).
  • getEscrowDetails(auctionId: string): Promise<EscrowDetails>: Fetches current state of the escrow.

Types

enum EscrowState {
  AWAITING_DEPOSIT = 0,
  FUNDED = 1,
  RELEASED = 2,
  REFUNDED = 3
}

interface EscrowDetails {
  buyer: string;
  seller: string;
  amount: string;
  state: EscrowState;
}