xlm-provider

0.0.3 • Public • Published

Lumen provider

Makes it easy to work with a bitcoin wallet.

Install

npm i --save xlm-provider

Include

var XlmProvider = require("xlm-provider").default;

or for ES-2015

import XlmProvider from 'xlm-provider'

Initialize

const xlmProvider = new XlmProvider('testnet'); // or mainnet

Usage

Create private key

const privateKey = xlmProvider.createPrivateKey();

Create private key from mnemonic

const privateKey = xlmProvider.createPrivateKeyFromMnemonic(mnemonic);
 
let mnemonic = 'absurd green cannon quarter call spray upper diet defense convince live assist'
or 
let mnemonic = xlmProvider.generateMnemonic()

Create public key

const publicKey = xlmProvider.createPublicKey(privateKey);

Get balance

const balance = xlmProvider.getBalance(publicKey);

Create transaction

xlmProvider.sendXLM(to, amount, privateKey).then(transaction=>{
    console.log(transaction);
});
to - address of the recipient
amount - amount in btc
privateKey - your private key

Package Sidebar

Install

npm i xlm-provider

Weekly Downloads

4

Version

0.0.3

License

ISC

Unpacked Size

7.79 kB

Total Files

3

Last publish

Collaborators

  • vlad88vlad