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

@figmentio/slate

v1.22.0

Published

Node.js library for interacting with Slate from Figment

Downloads

66

Readme

slate-node

Node client for Slate, initially for decoding transaction payloads

Usage

Decoding a transaction to validate inputs

The main decoding method is called using the decode method as follows

const slate = require('@figmentio/slate')

slate.decode('<network_code>', '<operation>', '<version>', '<transaction_type>', '<transaction_payload>')

Where (see list below for possible values for each field)

  • <network_code>: name of the network
  • <operation>: the operation the transaction is built to accomplish
  • <version>: the Slate API version number used to generate the transaction
  • <transaction_type>: the type of transaction being decoded
  • <transaction_payload>: the raw, unsigned transction payload returned by Slate

Using a Solana staking Flow and the createStakeAccountTransacion transaction type, you would use the following:

const slate = require('@figmentio/slate')

slate.decode('solana', 'staking', 'v1', 'createStakeAccountTransaction', 'transaction-payload-goes-here')

Available Networks, Operations, and Transaction Types

  • solana
    • staking
      • createStakeAccountTransaction
      • delegateTransaction
    • unstaking
      • deactivateTransaction
      • withdrawTransaction
    • transfer
      • transferTransaction
    • mergeStakeAccount
      • mergeTransaction
    • splitStakeAccount
      • splitTransaction
  • ethereum
    • staking
      • depositTransaction
  • polkadot
    • staking
      • bondingTransaction
      • nominationTransaction
    • unstaking
      • chillTransaction
      • unbondTransaction
      • withdrawTransaction
    • transfer
      • transferTransaction
    • addProxy
      • addProxyTransaction
    • removeProxy
      • removeProxyTransaction
  • near
    • staking
      • delegateTransaction
    • unstaking
      • undelegateTransaction
      • withdrawTransaction
    • transfer
      • transferTransaction
  • avalanche
    • staking
      • delegateTransaction
  • cosmos
    • claimRewards
      • withdrawTransaction
    • redelegate
      • redelegateTransaction
    • staking
      • delegateTransaction
    • transfer
      • transferTransaction
    • unstaking
      • undelegateTransaction
  • cardano
    • staking
      • registerTransaction
      • delegateTransaction
    • unstaking
      • deregisterTransaction
    • transfer
      • transferTransaction

Signing a transaction

This client can also be used to sign transaction payloads. This functionality can be called as follows where <signing_private_keys> is an array containing all the private keys required for signature and <transaction_payload> is the raw, unsigned transction payload returned by Slate.

const slate = require('@figmentio/slate')

await slate.sign('<network_code>', '<version>', '<transaction_payload>', `<signing_private_keys>`)

Versioning

We use semantic versioning to manage the version for this package.

Summary

Given a version number MAJOR.MINOR.PATCH, increment the:

  • MAJOR version when you make incompatible API changes
  • MINOR version when you add functionality in a backwards compatible manner
  • PATCH version when you make backwards compatible bug fixes

Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format.

Production release

To release slate-node to production we're packaging it through npmjs https://www.npmjs.com/package/@figmentio/slate

  • First go to the package.json file and bump up the version according to semversion best practices
  • go to Releases page on Github and click on "Draft a new release"
  • use the same version/tag from the package.json
  • the Release title should be the same as tag
  • add some bullet-points that would describe the most important features/changes included in the release
  • click "Publish release"

This will trigger an action to release the package to npmjs

Testing

Run the tests via:

yarn test