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 🙏

© 2024 – Pkg Stats / Ryan Hefner

token-mesh

v0.0.2

Published

Instant, seamless, transparent flow of value across chains.

Downloads

3

Readme

Token-Mesh

token-mesh.com

The purpose of the mesh is to provide seamless flow of token value from one chain to another.

Other systems often use insecure, unreliable mechanisms to receive locking transactions and to output unlocking transactions. Each lock should correspond to exactly one unlock, and must take place in near real time.

The system should be able to handle the very tiniest amount of value possible, so swaps should take place between BSV and USDC on Solana, which can then be sent to any exchange that supports Solana.

It may also be ideal to issue a BSV token on Solana and have that become trade-able on the Solana-based decentralized exchange programs, then offer a swap directly from BSV native token to BSV on Solana.

All deposits shall be received directly via the Payment Protocol so that payments are exactly correct every time.

import { Swap, Lock, Unlock } from 'token-mesh'

import { loadWallet } from 'wallet-bot'

export async function main() {

  const wallet = await loadWallet()

  const swap: Swap = await Swap.Create({

    lock: {
      chain: 'BSV',
      currency: 'BSV'
    },

    unlock: {
      chain: 'SOL',
      currency: 'USDC',
      address: wallet.getAddress({ currency: 'USDC', chain: 'SOL' }),
      value: 0.001
    }
    
  })

  swap.on('lock.detected', (lock: Lock) => {

    console.log('valid lock transaction detected in the mempool', {
      satoshis: lock.value,
    })

  })

  // wallet.pay() should trigger 'lock.detected' event on the swap
  const result = await wallet.pay({ uri: swap.payment_request_uri })
 

  swap.on('lock.confirmed', (lock: Lock) => {

    console.log('lock confirmed, system will be sending coins soon')      

  })

  swap.on('unlock.detected', (unlock: Unlock) => {

    console.log('${unlock.value} ${unlock.currency} unlocked on ${unlock.chain}')

  })

  swap.on('unlock.confirmed', (unlock: Unlock) => {
  
  	console.log('Unlock confirmed, likely funds may be used soon on centralized exchanges')

  })

}

main()

With scrypt smart contracts and solana smart contracts the entire transaction can occur in blockchain escrow, where price negociations occur and all transaction data is embedded.

On bitcoin deposits shall be made to a contract that locks coins for a specified period of time, as wells as specifying the desired token unlocking script and value for the corresponding chain and currency. Before the locking script may be unlocked by its creator the swap service has an opportunity to provide the swap txid on solana into the bitcoin contract, releasing the funds to any address they choose. Only the token mesh public key may be used to provide the solana txid/signatures and unlock the satoshis contained in the contract.