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

@epicchain/epicvault-uri

v1.0.1

Published

The EpicVault-uri Module is a specialized component within the EpicVault ecosystem designed to manage.

Readme

EpicVault URI Parser

Overview

epicvault-uri is a robust package that provides a way to parse, validate, and generate URIs compliant with the XEP-9 standard for the EpicChain ecosystem. These URIs enable interoperability across dApps, wallets, and other blockchain-enabled platforms by supporting a structured and flexible URI schema.

While XEP-9 defines the standard for EpicChain, this package extends it by introducing a relaxed interpretation and additional features to accommodate modern blockchain use cases. With this package, developers can easily handle various intents, such as token transfers, voting, and other custom functionalities within the EpicChain ecosystem.

URI Schema

The URI format is:

epicchain:[?<usecase>-]<targetIdentifier>[?<key>=<value>]

Components:

  1. usecase (Optional): A prefix indicating the intent or action.
  2. targetIdentifier: The target address, key, or identifier for the intent.
  3. Query Parameters: Key-value pairs providing additional details for the action.

Supported Use Cases:

1. Token Transfer (Default Intent)

Token transfers are the default intent when no usecase is specified.

Format:

epicchain:[?pay-]<toAddress>?asset=<contractHash>&amount=<amount>
  • Parameters: | Parameter | Description | |---------------|--------------------------------------------| | toAddress | The recipient's EpicChain wallet address. | | contractHash | Token identifier (e.g., epicchain, epicpulse, or custom hash). | | amount | (Optional) The amount of the token to transfer. |

Example: To request 1 EpicPulse token to XjqCTDkSD1E7csjZZcRC82YAEv7hAckt3R:

epicchain:XjqCTDkSD1E7csjZZcRC82YAEv7hAckt3R?asset=epicpulse&amount=100000000

2. Voting Intent

Vote requests enable users to cast votes for specific candidates using their public keys.

Format:

epicchain:vote-<candidatePublicKey>
  • Parameters: | Parameter | Description | |---------------------|------------------------------------------------| | candidatePublicKey| The candidate's public key for the vote. |

Example: To vote for the candidate with public key 02028a99826edc0c97d18e22b6932373d908d323aa7f92656a77ec26e8861699ef:

epicchain:vote-02028a99826edc0c97d18e22b6932373d908d323aa7f92656a77ec26e8861699ef

Installation

Using npm:

Install the epicvault-uri package along with epicvault-core:

npm install @epicchain/epicvault-uri @epicchain/epicvault-core

Importing:

Use the package in your project:

const uri = require("@epicchain/epicvault-uri");

API Documentation

Parsing URIs

The parse method extracts intent and relevant details from a given EpicChain URI string, returning a structured intent object.

Syntax:

const intent = uri.parse("<epicchain-uri>");

Example:

const intent = uri.parse(
  "epicchain:XjqCTDkSD1E7csjZZcRC82YAEv7hAckt3R?asset=epicpulse&amount=100000000"
);

Output:

{
  intent: "pay",
  description: "Transfer 100000000 EpicPulse to XjqCTDkSD1E7csjZZcRC82YAEv7hAckt3R",
  contractCall: {
    scriptHash: "d2a4cff31913016155e38e474a2c06d08be276cf",
    operation: "transfer",
    args: [
      {
        type: "Hash160",
        value: "" // Sender address placeholder.
      },
      {
        type: "Hash160",
        value: "XjqCTDkSD1E7csjZZcRC82YAEv7hAckt3R"
      },
      {
        type: "Integer",
        value: "100000000"
      }
    ]
  }
}

Notes:

  • Assets like epicchain and epicpulse are automatically resolved to their respective script hashes.
  • The parser does not perform runtime validation (e.g., verifying address validity).

URI Creation Helpers

The package provides utility methods for quickly generating compliant URIs for common intents.

1. Creating a Payment URI

const payUri = uri.createPayUri(toAddress, asset, amount);

Parameters:

  • toAddress (String): Recipient's wallet address.
  • asset (String): Asset name or contract hash.
  • amount (Integer): Amount to transfer.

Example:

const payUri = uri.createPayUri("XjqCTDkSD1E7csjZZcRC82YAEv7hAckt3R", "epicpulse", 100000000);

Output:

epicchain:XjqCTDkSD1E7csjZZcRC82YAEv7hAckt3R?asset=epicpulse&amount=100000000

2. Creating a Vote URI

const voteUri = uri.createVoteUri(candidatePublicKey);

Parameters:

  • candidatePublicKey (String): Public key of the candidate to vote for.

Example:

const voteUri = uri.createVoteUri("02028a99826edc0c97d18e22b6932373d908d323aa7f92656a77ec26e8861699ef");

Output:

epicchain:vote-02028a99826edc0c97d18e22b6932373d908d323aa7f92656a77ec26e8861699ef

Advanced Usage

Validating Addresses

Though the package does not natively validate wallet addresses, it is recommended to use epicvault-core or a similar library to ensure address validity before performing operations.

Extending Use Cases

Developers can extend the package to handle custom intents by parsing URIs and implementing additional logic to process the intent object.


Examples

Parsing a Token Request URI

const uri = require("@epicchain/epicvault-uri");
const tokenUri = "epicchain:XjqCTDkSD1E7csjZZcRC82YAEv7hAckt3R?asset=epicpulse&amount=100000000";

const parsedIntent = uri.parse(tokenUri);
console.log(parsedIntent);

Generating a Payment Request

const uri = require("@epicchain/epicvault-uri");
const payUri = uri.createPayUri("XjqCTDkSD1E7csjZZcRC82YAEv7hAckt3R", "epicpulse", 100000000);

console.log(payUri);

Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository.
  2. Create a new branch for your feature or bugfix.
  3. Write tests for your changes.
  4. Submit a pull request.

License

This package is licensed under the MIT License. See the LICENSE file for details.


Resources