How to use the eosjs.Testnet function in eosjs

To help you get started, we’ve selected a few eosjs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github eosiosg / pomelo / Api.js View on Github external
console.log( this.accountPublicKey );
        let nodeAddress = 'http://52.77.224.13:8888';
        config = {
            keyProvider: this.accountPrivateKey, // WIF string or array of keys..
            httpEndpoint: nodeAddress,
//    mockTransactions: () => 'pass', // or 'fail'
//    transactionHeaders: (expireInSeconds, callback) => {
//      callback(null/*error*/, headers)
//    },
            expireInSeconds: 60,
            broadcast: true,
            debug: false,
            sign: true,
          chainId: '706a7ddd808de9fc2b8879904f3b392256c83104c1d544b38302cc07d9fca477',
        };
        this.eos = Eos.Testnet( config );
        console.log( this.eos );
    }
github eosiosg / pomelo / src / actions / EosAction.js View on Github external
export function GetEOS( accountPrivateKey ) {
    try {
    const Eos = require( 'eosjs' );
    const config = {
      keyProvider: accountPrivateKey, // WIF string or array of keys..
      httpEndpoint: nodeAddress,
      expireInSeconds: 60,
      broadcast: true,
      debug: false,
      sign: true,
      chainId: chainId,
    };
    let eos = Eos.Testnet( config );
    return eos;
  } catch ( error ) {
    return null;
  }
}
github eluzgin / eos-wallet-keychain / src / util / apiClient.js View on Github external
const configureClient = (target, opts = {}) => {
  if (!opts.keyProvider)
    throw new Error(`api client connection needs a keyProvider`);

  const eosNode = eos.Testnet({
    keyProvider: opts.keyProvider,
    httpEndpoint: apiEndpoint,
    debug: process.env.NODE_ENV !== "production",
    broadcast: false
  });

  return Object.assign(target, {
    keyProvider: opts.keyProvider,
    eos: eosNode
  });
};