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

solodex

v1.2.15

Published

JS/TS Library to integrate soloDEX mobile app into dApps

Downloads

62

Readme

SOLO DEX Signing SDK

This SDK facilitates developers to integrate SOLO DEX as a signing mechanism on their platforms.

NPM

Usage

This SDK works with events.

Starting a new connection

import SOLODEX from "solodex";

const soloDEX = new SOLODEX({
  sign_expiry: 300_000, // This is optional, by default it's set to 600,000 ms (10 minutes)
  api_key: $YOUR_API_KEY, // This is optional, go to Developer Dashboard in sologenic.org to generate an API Key
  custom_tx_delivery_endpoint, // This is optional, it will allow you to provide your own Tx Delivery if desired
});

const signingMeta = await soloDEX.signIn();

// To retrieve the push token
const token = soloDEX.token;

Properties of the returned object.

| Param | Type | Description | | :------------ | -------------: | -----------------------------------------------------------------------: | | identifier | string | uuid of the transaction to be signed | | expires_at | string | expiring time of the transaction to be signed | | refs | ConnectionRefs | | | refs.qr | string | URL for a QR Code that users can scan to start signing. | | refs.deeplink | string | Deeplink URL, to allow to sign from a browser used within the same phone | | tx | Transaction | The transaction to be signed |

Signing a Transaction

This methods submits a transaction to be signed via SOLODEX App. The signingMeta object looks exactly the same as described on the signIn method.

const signingMeta = await soloDEX.signTransaction(transaction);

setPushToken()

This method sets the push token on the initialized connection. The connection will handle the storage of the token once a signIn is created, but it won't persist the storage. That's why the token is provided to you to store and set in the future, if needed. The only parameter this method takes is the token. Returns nothing.

The token is used to automatically send a Push notification to the user app regarding the transaction to be signed.

If you already have a token, set it right after initializing the instance and you won't need to run the signIn method.

Events

The events return the identifier of the Transaction for the last action received from the SOLODEX app. With the exception of "signed" event, which returns data of the signed transaction

soloDEX.on("opened", (identifier) => {
  console.log(identifier); // 8b528257-eacd-4ab9-85c5-ed10d107f2db
});

soloDEX.on("pushed", (identifier) => {
  console.log(identifier); // 8b528257-eacd-4ab9-85c5-ed10d107f2db
});

soloDEX.on("resolved", (identifier) => {
  console.log(identifier); // 8b528257-eacd-4ab9-85c5-ed10d107f2db
});

soloDEX.on("cancelled", (identifier) => {
  console.log(identifier); // 8b528257-eacd-4ab9-85c5-ed10d107f2db
});

soloDEX.on("expired", (identifier) => {
  console.log(identifier); // 8b528257-eacd-4ab9-85c5-ed10d107f2db
});

soloDEX.on("signed", (identifier, data) => {
  console.log(identifier); // 8b528257-eacd-4ab9-85c5-ed10d107f2db

  const { signer, tx, push_token } = data;
  // Signer is the XRP Address of the user, TX the transaction signed
});

Response

| Param | Type | Description | | :-------------- | ----------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------: | | identifier | string | uuid of the transaction to be signed | | data.signer | string | XRP Address of the signer | | data.tx | Transaction | The transaction to be signed | | data.push_token | string | Token that needs to be passed to the signTransaction method in order to send a push notification to the phone whenever a new transaction needs to be signed |