Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
lib
 
 
 
 
 
 
 
 
 
 
 
 

westwallet-js-api

npm

westwallet-js-api is a WestWallet Public API wrapper for JavaScript programming language. Use it for building payment solutions.

Installing

Install from npm:

npm install westwallet-api

Create withdrawal example

// Sending 0.1 ETH to 0x57689002367b407f031f1BB5Ef2923F103015A32
const westwallet = require('westwallet-api');
const westwalletErrors = westwallet.WestWalletAPIErrors;

let client = new westwallet.WestWalletAPI(
    "your_public_key",
    "your_private_key"
);
client.createWithdrawal("ETH", "0.1", "0x57689002367b407f031f1BB5Ef2923F103015A32")
.then((data) => {
    console.log(data);
}).catch((error) => {
    if (error instanceof westwalletErrors.InsufficientFundsError) {
        console.log("Insufficient funds");
    } else if (error instanceof westwalletErrors.BadAddressError) {
        console.log("Bad address regex");
    } else {
        console.log(error);
    }
});

Generate address example

const westwallet = require('westwallet-api');
const westwalletErrors = westwallet.WestWalletAPIErrors;

let client = new westwallet.WestWalletAPI(
    "your_public_key",
    "your_private_key"
);
client.generateAddress("BTC").then((data) => {
    console.log(data);
}).catch((error) => {
    if (error instanceof westwalletErrors.CurrencyNotFoundError) {
        console.log("No such currency");
    }
});

Documentation

Other languages

Releases

No releases published

Packages

No packages published