Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function init(payload) {
const { blocksLogFilePath, streamNodes } = payload;
filePath = blocksLogFilePath;
steemNode = streamNodes[0]; // eslint-disable-line
steemClient = process.env.NODE_ENV === 'test' ? new dsteem.Client('https://testnet.steemitdev.com', { addressPrefix: 'TST', chainId: '46d82ab7d8db682eb1959aed0ada039a6d49afa1602491f93dde9cac3e8e6c32' }) : new dsteem.Client(steemNode);
}
import { Client, PrivateKey } from 'dsteem';
import { accounts } from '../../configuration';
//define network parameters
let opts = {};
opts.addressPrefix = 'STX';
opts.chainId =
'79276aea5d4877d9a25892eaa01b0adf019d3e5cb12a97478df3298ccdd01673';
//connect to a steem node, testnet in this case
const client = new Client('https://testnet.steem.vc', opts);
// const dsteem = require('dsteem');
// let opts = {};
// //define network parameters
// opts.addressPrefix = 'STM';
// opts.chainId =
// '0000000000000000000000000000000000000000000000000000000000000000';
// //connect to a steem node, production in this case
// const client = new dsteem.Client('https://api.steemit.com');
//create witness list function
window.createList = async () => {
//get list limit
const limit = document.getElementById('limit').value;
const witnessdata = await client.database.getState('witnesses');
function startup() {
// Load the settings from the config file
loadConfig();
// Connect to the specified RPC node
rpc_node = config.rpc_nodes ? config.rpc_nodes[0] : (config.rpc_node ? config.rpc_node : 'https://api.steemit.com');
client = new dsteem.Client(rpc_node);
utils.log("* START - Version: " + version + " *");
utils.log("Connected to: " + rpc_node);
if(config.backup_mode)
utils.log('*** RUNNING IN BACKUP MODE ***');
// Load Steem global variables
utils.updateSteemVariables(client);
// If the API is enabled, start the web server
if(config.api && config.api.enabled) {
var express = require('express');
var app = express();
var port = process.env.PORT || config.api.port
servers.forEach((server) => {
try {
const client = new Client(server);
client.database.getDynamicGlobalProperties().then((props) => {
let servers = Object.assign({}, this.state.servers);
servers[server.replace('wss', 'https')] = props.time;
this.setState({servers});
});
} catch(e) {
console.log(e)
}
})
}
const dsteem = require('dsteem');
let opts = {};
//connect to production server
opts.addressPrefix = 'STM';
opts.chainId =
'0000000000000000000000000000000000000000000000000000000000000000';
//connect to server which is connected to the network/production
const client = new dsteem.Client('https://api.steemit.com');
//submitAcc function from html input
const max = 5;
window.submitAcc = async () => {
const accSearch = document.getElementById('username').value;
const _account = await client.database.call('get_withdraw_routes', [
accSearch,
]);
console.log(`_account:`, _account);
let info = '';
let sum = 0;
if (_account.length > 0) {
for (var i = 0; i < _account.length; i++) {
info += `${_account[i].to_account} - ${_account[i].percent /
100}%<br>`;
const dsteem = require('dsteem');
let opts = {};
//connect to production server
opts.addressPrefix = 'STM';
opts.chainId =
'0000000000000000000000000000000000000000000000000000000000000000';
//connect to server which is connected to the network/production
const client = new dsteem.Client('https://api.steemit.com');
//submitAcc function from html input
const max = 5;
window.submitAcc = async () => {
const accSearch = document.getElementById('username').value;
const _account = await client.database.call('get_accounts', [[accSearch]]);
console.log(`_account:`, _account);
const name = _account[0].name;
const steem_balance = _account[0].balance;
const balance = `Available Steem balance for ${name}: ${steem_balance}<br>`;
document.getElementById('accBalance').innerHTML = balance;
document.getElementById('steem').value = steem_balance;
const receiver = document.getElementById('receiver').value;
document.getElementById('sc').style.display = 'block';
const dsteem = require('dsteem');
let opts = {};
//connect to production server
opts.addressPrefix = 'STM';
opts.chainId =
'0000000000000000000000000000000000000000000000000000000000000000';
//connect to server which is connected to the network/production
const client = new dsteem.Client('https://api.steemit.com');
//submitAcc function from html input
const max = 5;
window.searchAcc = async () => {
const accSearch = document.getElementById('username').value;
let avail = 'Account is NOT available to register';
if (accSearch.length > 2) {
const _account = await client.database.call('get_accounts', [
[accSearch],
]);
console.log(`_account:`, _account, accSearch.length);
if (_account.length == 0) {
avail = 'Account is available to register';
}
}
const dsteem = require('dsteem');
let opts = {};
//connect to production server
opts.addressPrefix = 'STM';
opts.chainId =
'0000000000000000000000000000000000000000000000000000000000000000';
//connect to server which is connected to the network/production
const client = new dsteem.Client('https://api.steemit.com');
//submitAcc function from html input
const max = 5;
window.submitAcc = async () => {
const accSearch = document.getElementById('username').value;
const _account = await client.database.call('get_accounts', [[accSearch]]);
console.log(`_account:`, _account);
const name = _account[0].name;
const avail =
parseFloat(_account[0].vesting_shares) -
(parseFloat(_account[0].to_withdraw) -
parseFloat(_account[0].withdrawn)) /
1e6 -
parseFloat(_account[0].delegated_vesting_shares);
return address => {
rawClient = new Client(address, CLIENT_OPTIONS);
};
}
getClient = async () => {
const server = await AsyncStorage.getItem('server');
if (server === null || server === undefined || server === '') {
client = new Client('https://api.steemit.com');
} else {
client = new Client(`${server}`);
}
};