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

demo-warss

v1.5.9

Published

The BoltPay SDK for the Sui Wallet App offers a highly beneficial and smoothly integrated feature set for Sui chain transactions. It provides a user-friendly and secure way for users to execute payments. The key features of this SDK include QR code scanni

Downloads

39

Readme

BlockBolt Payment

The BoltPay SDK for the Sui Wallet App offers a highly beneficial and smoothly integrated feature set for Sui chain transactions. It provides a user-friendly and secure way for users to execute payments. The key features of this SDK include QR code scanning and payment request interpretation, allowing users to confirm payments effortlessly within their Sui wallet app. By handling transactions on the Sui chain, the BoltPay SDK ensures safe and reliable delivery of payments to the merchant's wallet.

Installation

  • Compatible with Node.js and React-based applications.
  • Requires the @blockbolt/sui-wallet and @mysten/sui.js libraries for full functionality.

Install the SDK via npm:

npm install @blockbolt/sui-wallet
    ##
yarn add @blockbolt/sui-wallet  
    ##
pnpm install @blockbolt/sui-wallet

Prerequisites

You will need mysten js library to run the sdk

Install the SDK via npm, yarn or pnpm:

npm install @mysten/sui.js
    ##
yarn add @mysten/sui.js  
    ##
pnpm install @mysten/sui.js    

Usage The SDK provides two main functions: createEcomTx for generic E-commerce transactions and createWoComTx for WooCommerce-specific transactions.

Importing the SDK

import { Ed25519Keypair } from '@mysten/sui.js/keypairs/ed25519';
import { createEcomTx, createWoComTx, Ed25519Keypair } from '@blockbolt/sui-wallet';

Important Note on the Demo Example for createEcomTx & createWoComTx:

In the provided example for the createEcomTx & createWoComTx function, the code snippet demonstrates how a transaction can be created and executed. It's important to understand that the part of the code dealing with the Ed25519Keypair is included solely for demonstration purposes.

Wallet providers must use their secure method have to pass the signer. The signer is passed to the createEcomTx or createWoComTx function to initiate the transaction securely. This approach ensures that the transaction process adheres to security best practices, maintaining the integrity and safety of the transaction on the Sui chain.

E-commerce Transactions (createEcomTx)

  • unique_id: A unique, random numerical identifier for each transaction.
  • merchantName: The merchant's name for identifying the payment recipient.
  • amount: The value to be transferred in the transaction.
  • receiverAddress: The merchant's Sui wallet address for receiving the payment.

For demo purpose only

const phrase = "your seed phrase"; // Securely retrieve the seed phrase
const keyPair = Ed25519Keypair.deriveKeypair(phrase, "m/44'/784'/0'/0'/0'");

Example Usage

const response = await createEcomTx({
    signer: keyPair, // here you can either pass the walle signer or for test you can use like above example
    unique_id: randomId, // Replace with a unique identifier
    name: Merchant Name,  // Replace with the merchant name
    amount: Price,      // Replace with the transaction amount
    receiverAddress: Merchant Address, // Replace with the merchant's address
    networkType: "testnet" // "testnet", "devnet", or "mainnet"
});

WooCommerce Transactions (createWoComTx)

  • unique_id: A unique, random numerical identifier for each transaction.
  • merchantName: The merchant's name for identifying the payment recipient.
  • amount: The value to be transferred in the transaction.
  • receiverAddress: The merchant's Sui wallet address for receiving the payment.

For demo purpose only

const phrase = "your seed phrase"; // Securely retrieve the seed phrase
const keyPair = Ed25519Keypair.deriveKeypair(phrase, "m/44'/784'/0'/0'/0'");

Example Usage

const responseWoCom = await createWoComTx({
    signer: keyPair, // here you can either pass the walle signer or for test you can use like above example
    unique_id: randomId, // Replace with a unique identifier
    name: Merchant Name,  // Replace with the merchant name
    amount: Price,      // Replace with the transaction amount
    receiverAddress: Merchant Address, // Replace with the merchant's address
    networkType: "testnet" // "testnet", "devnet", or "mainnet"
});

Best Practices

Security: Avoid hardcoding sensitive information like seed phrases. Always retrieve them from a secure and encrypted source. Key Management: Especially in client-side applications, use pre-derived signer objects for enhanced security. Additional Information Make sure to replace placeholders in the code examples with actual data from your application.