New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

suoii

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

suoii

Blockbolt protocol

unpublished
latest
npmnpm
Version
1.23.0
Version published
Maintainers
1
Created
Source

BoltPay SDK Documentation

Introduction

The BoltPay SDK is a powerful tool that allows developers to interact with the BoltPay Protocol. This guide will walk you through the process of setting up and using the SDK to create transactions.

Prerequisites

Before you start, make sure you have installed the BoltPay SDK in your project:

Installation

You can easily install Voltsdk Wallet using npm:

Using npm:

npm i @boltpay/sui-wallet

Establishing a Connection

The first step is to establish a connection to the BoltPay network. The SDK provides three predefined connections: testnetConnection, devnetConnection, and mainnetConnection.

Here's how you can define a connection to the mainnet:

import { Connection, JsonRpcProvider } from "@boltpay/sui-client";

export const mainnetConnection = new JsonRpcProvider(
  new Connection({
    fullnode: "https://wallet-rpc.mainnet.sui.io/",
    faucet: "https://wallet-rpc.mainnet.sui.io/gas",
  })
);

Creating a Transaction

To create a transaction, you need to derive a key pair from a phrase, create a signer, and then use the signer to create the transaction.

Here's an example of how you can do this:

import { Ed25519Keypair, RawSigner, JsonRpcProvider } from "@boltpay/sui-client";

const handleTransaction = async () => {
    const merchant_id = 123;
    const merchantAddress = "MERCHANT_ADDRESS";
    const merchantAmount = 1
    const phrase = "YOUR_SEED_PHARSE";

    const details = {
        merchant_id: merchant_id,
        merchant_address: merchantAddress,
        merchant_amount: merchantAmount,
    };

    const keyPair = Ed25519Keypair.deriveKeypair(phrase, "m/44'/784'/0'/0'/0'");
    const provider: JsonRpcProvider = new JsonRpcProvider(testnetConnection);
    const signer: RawSigner = new RawSigner(keyPair, provider)

    const tx = createTransaction(signer, details);
    console.log(tx)
};

In this example, handleTransaction is an async function that creates a transaction when called. It first defines some details about the transaction, such as the merchant ID, address, and amount. It then derives a key pair from a phrase and uses this key pair to create a signer. Finally, it uses the signer to create the transaction and logs the transaction to the console.

Please replace testnetConnection with the appropriate connection (devnetConnection, mainnetConnection, etc.) based on your needs.

A powerful and flexible SDK for interacting with the BlockBolt Protocol Wallet. It is designed to work both on server-side (Node.js) and on the client-side (like React).

Keywords

SUI

FAQs

Package last updated on 22 Jun 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts