Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@eosdt/client

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@eosdt/client

> TODO: description

  • 1.2.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

EOS Client

Main library for data fetching in EOSDT applications

Usage

  import Client from "@eosdt/client";
  import Provider from "@eosdt/transact-scatter";
  
  const networks = [{
    blockchain: "eos",
    protocol: "https",
    host: "nodeos.production.eosdt.com",
    port: 8443,
    chainId:
    "aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906",
  }];

  const client = new Client({ name: "eosdt", networks });

  (async () => {
      // You can fetch data from EOS blockchain prior to provider initialization
      const table = await client.rpc.get_table_rows({
        code: "eosdtorclize",
        scope: "eosdtorclize",
        table: "orarates",
        json: true,
        limit: 1000
      });
      
      console.log({ table }); // Token rates
      
      // To do transactions you must initialize transaction provider
      await client.init(Provider);

      if (!client.account) {
        await client.login(); // If you are not yet logged in then do it
      }

      // Now you can sign and broadcast transactions to EOS blockchain
      await client.rpc.transact({ actions: [{
        account: "eosdtsttoken",
        name: "transfer",
        authorization: [{ actor: "someeosacnt1", permission: "active" }],
        data: {
          to: "someeosacnt2",
          from: "someeosacnt1",
          quantity: "1.000000000 EOSDT", // always use full decimals for token  
          memo: "Transfer message"
        }
      }]}, { blocksBehind: 3, expireSeconds: 30 });

  })().catch((e) => console.error(e.stack));

FAQs

Package last updated on 14 Jan 2021

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc