🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

trip-wallet

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

trip-wallet

Trip wallet SDK for JavaScript

latest
Source
npmnpm
Version
0.1.17
Version published
Maintainers
1
Created
Source

Trip Wallet SDK for JavaScript

Install

yarn add trip-wallet
Or
npm install trip-wallet

Usage

import Wallet from 'trip-wallet';

let wallet = Wallet('eth');
wallet.generate();
wallet.setProvider('http://host:port');

// async/await
let balance = await wallet.getBalance(wallet.address);

// Promise
wallet.getBalance(wallet.address).then(res => {
    balance = res;
}, err => {

});

API

wallet

  • Attributes
    • privateKey: String (hex string)
    • publicKey: String (hex string)
    • address: String (hex string)
    • currency: String
    • transactionObject
      • contract: Object
      • methodName: String
      • arguments: Array[]
      • privateKey: String (hex string)
      • from: String (hex string)
      • to: String (hex string)
      • value: Number | String | BigNumber
      • gasLimit: Number | String | BigNumber
      • gasPrice: Number | String | BigNumber
      • data: String
      • none: Number
  • Methods
    • generate([currency]): Object
    • import(key [, type] [, currency]): Object
      • type: 'privateKey', 'keystore', 'mnemonicPhrase', 'readonly'
      • key: String
      • currency: String
    • setProvider(host)
    • getBalance(addressHexString): Promise
    • getTokenBalance(addressHexString, contractAddress): Promise
    • getTransaction(transactionHash): Promise
    • contract(abi, address): Object
    • estimateGas(transactionObject): Promise
    • gasPrice(): Promise
    • sendTransaction(transactionObject): Promise

eth-util

  • toWei(num, unit)
  • fromWei(num, unit)
  • toBigNumber
  • toBuffer
  • toHex
  • verifyPrivateKey
  • decodeAbi
  • encodeAbi
  • signTransaction

Keywords

blockchain

FAQs

Package last updated on 22 Nov 2018

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