npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

tigerchange.jssdk

v1.0.0

Published

tigerchange js sdk for dapp

Downloads

7

Readme

morewallet.js

https://www.npmjs.com/package/morewallet.js

more wallet dapp js sdk

中文版

Example

Complete Example

ES6

import mw from 'morewallet.js';

const dappName = "dappdemo";
const client = mw.getClient(dappName);

//Get APP Version Number
client.getAppVersion().then(version => {
  console.log(version);
}).catch(error => {
  console.error(error);
});

//Current Account Information
client.getAccount();

//If Open in Wallet App
client.openInApp();

//Check If Can Execute A Cretain Action
client.checkAction("eosio.token", "transfer");

//Submit Action
const buyramData = {
  payer: "demouser1111",
  receiver: "demouser1111",
  quantity: "10.0000 EOS"
};
const authorization = [{
  actor: "demouser1111",
  permission: "active"
}];
client.pushAction("eosio", "buyram", authorization, buyramData);

//Submit Action In Batch
const actions = [{
  account: "eosio",
  name: "buyram",
  authorization: [{
    actor: "demouser1111",
    permission: "active"
  }],
  data: {
    payer: "demouser1111",
    receiver: "demouser1111",
    quant: "10.0000 EOS"
  }
}, {
  account: "eosio",
  name: "delegatebw",
  authorization: [{
    actor: "demouser1111",
    permission: "active"
  }],
  data: {
    from: "demouser1111",
    receiver: "demouser1111",
    stake_net_quantity: "10.0000 EOS",
    stake_cpu_quantity: "5.0000 EOS",
    transfer: false
  }
}];

client.pushActions(actions);

//Transfer
client.transfer("eosio.token", "demouser1111", "100.0000 EOS", "hi");

//Get Balance
client.getCurrencyBalance("eosio.token", "EOS");

//Data Table
client.getTableRows({
  code: "eosio",
  scope: "eosio",
  table: "global"
});

//Use Private Key signed Text
client.signText("text");

UMD

  • Introduce script to page:
<script src="https://cdn.more.top/morewallet/1.0.5/morewallet.js.min.js"></script>
  • Use
<script>
  var dappName = "dappdemo"; //dapp name, shoud be the name field filled in wallet APP
  var client = MOREWALLET.getClient(dappName);
  client.getCurrencyBalance("eosio.token", "EOS");
</script>

Access

client.getAccount(account = "")

Parameter

  • account - the one want to check, no transfer means check current account

Check Account Information

Return Value

  • account_name - String account name
  • core_liquid_balance - String eos balance
  • ram_quota - Integer ram
  • net_weight - Integer bandwidth
  • cpu_weight - Integer CPU
  • permissions - Array authority information
  • total_resources - Object resources information
  • voter_info - Object voting information

Example

// async/await
const accountInfo = await client.getAccount();

// Promise
client.getAccount().then(accountInfo => {
    console.log(accountInfo);
}).catch(e => {
    console.error(e);
});

client.openInApp()

If Open in Wallet APP

Return Value

  • res - Boolean

Example

// async/await
const inApp = await client.openInApp()

// Promise
client.openInApp().then(inApp => {
    if (!inApp) {
        console.log("open in morewallet")
    }
})

client.getAppVersion()

Get APP Version Number

Return Value

  • version - String

client.checkAction(contract, action)

Check If Have Action Authority

Parameter

  • contract - contract account
  • action - action name

Return Value

  • res - Boolean

client.getCurrencyBalance(contract, symbol)

Get Balance of Appointed Token

Parameter

  • contract - contract account
  • symbol - symbol name

client.pushAction(contract, action, authorization, data)

Submit Action

Parameter

  • contract - contract account
  • action - action name
  • authorization - authority array
  • data - executive data

client.pushActions(actions)

Submit Action in Batch

Parameter

  • actions - action array

client.transfer(contract, to, quantity, memo)

Transfer

Parameter

  • contract - token contract
  • to - receiver
  • quantity - transfer amount
  • memo - transfer memo

client.getTableRows(params)

Get Data Table

Parameter

  • params - check information,refer to/chain/get_table_rows

client.signText(text)

Use Private Key Signed Text

Parameter

  • text - signed text

Return Value

  • signedText - String