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

xrpl-hooks-api-assembly-script

v0.2.9

Published

XRPL hooks API exports that you can import into your XRPL hooks project written in AssemblyScript.

Downloads

5

Readme

XRPL Hooks API for AssemblyScript

XRPL hooks API exports that you can import into your hooks project written in AssemblyScript.

While this is currently working, please understand this repo is currently a work in progress. It's likely to be broken for versions prior to 1.0.0. Thanks for your patience. Contact info below if you're having trouble.

Background

This was created based on the work done by RichardAH. He has done some great work for XRPL hooks in C and I wanted to try writing my XRPL Hooks in AssemblyScript.

The contents of this lib are based on the headers he created that represent the XRPL Hooks API.

Of course the folks at XRPL-Labs an many other developers in the #XrpCommunity were a super help too!

XRPL Hooks Docs

  • Getting setup to use hooks in your local development environment.
  • Learn more about XRPL hooks.
  • Learn more about the API that these declarations provide access to.
  • Learn more about the GUARD (_g) function passed from the XRPL to your compiled binary here.

Usage

  1. Pull the library into your project.

    # From a terminal in the root of your project
    npm i xrpl-hooks-api-assembly-script -D
  2. import the declarations you want to use into your source code.

    # assembly/index.ts
    import { _g as GUARD } from '../node_modules/xrpl-hooks-api-assembly-script/dist'
  3. Use the new declaration in your hook or cback functions.

    # assembly/index.ts
    export function hook(reserved: i64): i64 {
       GUARD(1,1)
       // Unreached code.
       return 42
    }

Compiler Options

In the scripts section of your package.json using these compiler options are currently working when importing these declarations.

"scripts": {
    ...
    "asbuild:untouched": "asc assembly/index.ts --target debug -O3 --noAssert --runtime minimal -b build/untouched.wasm -t build/untouched.wat -d build/untouched.d.ts",
    "asbuild:optimized": "asc assembly/index.ts --target release  -O3 --noAssert --runtime minimal -b build/optimized.wasm -t build/optimized.wat -d build/optimized.d.ts",
    "asbuild": "npm run asbuild:untouched && npm run asbuild:optimized",
    ...
  }

Contribute

If you want to help out simply fork this repo, make your changes, and submit a PR.

Once your branch is merged to master a new release will be cut and a distribution will be pushed to npmjs.com.

If you just want to share what you found without a PR hit me up on Twitter.

Contact

  • https://twitter.com/jfgrissom