Skip to content

Instantly share code, notes, and snippets.

View bonustrack's full-sized avatar

Less bonustrack

View GitHub Profile
@bonustrack
bonustrack / account.json
Last active September 25, 2016 07:45
Steem Script: An Open JSON Standard for Trusted Workflows
{
"version": "0.0.1",
"dns": {"records":[["@","CNAME","steem.io"]]}},
"profile": {
"name": "Ned Scott",
"email": "[email protected]",
"birthday": "12/31/1999",
"gender": "male",
"about": "CEO and Co-founder at Steemit",
"first_name": "Ned",
@bonustrack
bonustrack / user.json
Last active September 13, 2016 11:10
Busy DB
{
"name": "fabien",
"last_account_update": "2016-09-11T21:50:36",
"reputation": "1728661538333",
"balance": "0.000 STEEM",
"vesting_shares": "5220822.727069 VEST",
"sbd_balance" : "0.000 SBD"
}

Keybase proof

I hereby claim:

  • I am adcpm on github.
  • I am bonustrack (https://keybase.io/bonustrack) on keybase.
  • I have a public key whose fingerprint is 161A EB18 0A30 19E9 4AE7 8CE8 4C27 FBDF 5B0F EE36

To claim this, I am signing this object:

> /usr/local/bin/npm ls
[email protected] /Users/fabien/WebstormProjects/steem
├─┬ [email protected]
│ ├─┬ [email protected]
│ │ ├─┬ [email protected]
│ │ │ └── [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ ├── [email protected]

Keybase proof

I hereby claim:

  • I am bonustrack on github.
  • I am bonustrack (https://keybase.io/bonustrack) on keybase.
  • I have a public key whose fingerprint is 161A EB18 0A30 19E9 4AE7 8CE8 4C27 FBDF 5B0F EE36

To claim this, I am signing this object:

/*jslint node: true */
"use strict";
var crypto = require('crypto');
var async = require('async');
var db = require('./db.js');
var conf = require('./conf.js');
var _ = require('lodash');
var storage = require('./storage.js');
var eventBus = require('./event_bus.js');
@bonustrack
bonustrack / secretHash.js
Last active April 23, 2019 20:16
Generate secret hash for SteemConnect application
const crypto = require('crypto');
const secret = 'random string';
const secretHash = crypto.createHash('sha256').update(secret).digest('hex');
console.log('Secret hash', secretHash);
const crypto = require('crypto');
const Mnemonic = require('bitcore-mnemonic');
const { publicKeyCreate } = require('secp256k1');
const objectHash = require('@obyte/ocore/object_hash');
const { Client } = require('obyte/lib');
const { sign } = require('obyte/lib/internal');
const { fromWif, toWif } = require('obyte/lib/utils');
// Settings
const fs = require('fs');
const { getAddress } = require('ethers/utils');
const subgraphResult = require('./poolTokens.json');
const { mainnet } = require('./deployed.json');
const trustwalletImgs = require('./trustwallet.json');
const tokens = [];
const deployedTokens = mainnet.tokens.map(token => token.address.toLowerCase());
const tokensIds = [];
const { verifyMessage } = require('@ethersproject/wallet');
async function verify(signedMessage, sig, address, type) {
const message = JSON.parse(JSON.stringify(signedMessage));
if (type === 'author') {
delete message.authors[0].sig;
delete message.relayers;
}
if (type === 'relayer') delete message.relayers[0].sig;
const recovered = await verifyMessage(JSON.stringify(message), sig);