@atscaletech/libra-sdk
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published


Javascript SDK that can help developer easy to integrate web application with Libra payment in minutes.

WebsiteDocumentation

Lint Test

Installation

CDN

<script src="https://cdn.jsdelivr.net/npm/@atscaletech/libra-sdk@1.0.0/dist/libra-sdk.cjs.production.min.js"></script>

Package manager

nmp install @atscaletech/libra-sdk

or

yarn add @atscaletech/libra-sdk

Quick start

import { Libra } from 'libra-js';

const libra = new Libra({
  appName: 'Libra Example',
  rpc: 'wss://rpc.libra.atscale.xyz',
});

async function main() {
  const ALICE_ADDRESS = '5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY';
  const BOB_ADDRESS = '5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty';

  const account = await libra.walletConnection.getAccount(ALICE_ADDRESS);

  const { hash, status } = await libra.lrp.createPayment({
    payee: BOB_ADDRESS,
    amount: 1000,
    currencyId: 'Native',
    description: 'payment description',
    receipt: 'payment receipt'
  }, account);
}

Modules

License

Apache-2.0

Readme

Keywords

Package Sidebar

Install

npm i @atscaletech/libra-sdk

Weekly Downloads

4

Version

1.0.1

License

Apache-2.0

Unpacked Size

2.26 MB

Total Files

125

Last publish

Collaborators

  • alice_atscale