rollback some bitcoin-core changes

This commit is contained in:
Ralph 2020-11-14 07:19:25 -05:00
parent f5c899aeb4
commit 7ec1826454
5 changed files with 36 additions and 39 deletions

View file

@ -15,8 +15,8 @@
}, },
"lbrycrd": { "lbrycrd": {
"port": 9245, "port": 9245,
"username": "lbry", "user": "lbry",
"password": "lbry" "pass": "lbry"
}, },
"sandboxchannel": "#369896313082478594" "sandboxchannel": "#369896313082478594"
} }

View file

@ -1,6 +1,6 @@
{ {
"dependencies": { "dependencies": {
"bitcoin-core": "^3.0.0", "bitcoin": "^3.0.1",
"chrono-node": "^2.1.9", "chrono-node": "^2.1.9",
"config": "^3.3.2", "config": "^3.3.2",
"discord.js": "^12.4.1", "discord.js": "^12.4.1",

View file

@ -1,10 +1,10 @@
import { LBRYCrdConfig } from '../typings'; import { LBRYCrdConfig } from '../typings';
import config from 'config'; import config from 'config';
import BitcoinClient = require('bitcoin-core'); const Bitcoin = require('bitcoin');
let spamchannel: string = config.get('sandboxchannel'); let spamchannel: string = config.get('sandboxchannel');
let lbrycrdConfig: LBRYCrdConfig = config.get('lbrycrd'); let lbrycrdConfig: LBRYCrdConfig = config.get('lbrycrd');
const lbry = new BitcoinClient(lbrycrdConfig); const lbry = new Bitcoin.Client(lbrycrdConfig);
const helpmsg = { const helpmsg = {
embed: { embed: {
description: description:
@ -132,16 +132,14 @@ function doHelp(message, helpmsg) {
} }
async function doBalance(message, tipper) { async function doBalance(message, tipper) {
try { lbry.getBalance(tipper, 1, function(err, balance) {
const balance = await lbry.getBalance({ if (err) {
account: tipper, console.error(err);
minconf: 1 message.reply('Error getting balance.').then(message => message.delete({timeout: 5000}));
}); } else {
message.reply(`You have *${balance}* LBC. This may not reflect recent balance changes. Please wait a couple minutes and try again.`); message.reply(`You have *${balance}* LBC. This may not reflect recent balance changes. Please wait a couple minutes and try again.`);
} catch (err) { }
console.error(err); });
message.reply('Error getting balance.').then(message => message.delete({timeout: 5000}));
}
} }
function doDeposit(message, tipper) { function doDeposit(message, tipper) {

View file

@ -13,6 +13,6 @@ export interface BotConfig {
export interface LBRYCrdConfig { export interface LBRYCrdConfig {
port: number; port: number;
username: string; user: string;
password: string; pass: string;
} }

View file

@ -26,11 +26,12 @@
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.7.tgz#8ea1e8f8eae2430cf440564b98c6dfce1ec5945d" resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.7.tgz#8ea1e8f8eae2430cf440564b98c6dfce1ec5945d"
integrity sha512-Zw1vhUSQZYw+7u5dAwNbIA9TuTotpzY/OF7sJM9FqPOF3SPjKnxrjoTktXDZgUjybf4cWVBP7O8wvKdSaGHweg== integrity sha512-Zw1vhUSQZYw+7u5dAwNbIA9TuTotpzY/OF7sJM9FqPOF3SPjKnxrjoTktXDZgUjybf4cWVBP7O8wvKdSaGHweg==
"@uphold/request-logger@^2.0.0": "@uphold/request-logger@^1.2.0":
version "2.0.0" version "1.2.0"
resolved "https://registry.yarnpkg.com/@uphold/request-logger/-/request-logger-2.0.0.tgz#c585c0bdb94210198945c6597e4fe23d6e63e084" resolved "https://registry.yarnpkg.com/@uphold/request-logger/-/request-logger-1.2.0.tgz#e406893711e3de0369553155075890bec064a073"
integrity sha1-xYXAvblCEBmJRcZZfk/iPW5j4IQ= integrity sha1-5AaJNxHj3gNpVTFVB1iQvsBkoHM=
dependencies: dependencies:
lodash.clonedeep "^4.5.0"
uuid "^3.0.1" uuid "^3.0.1"
abort-controller@^3.0.0: abort-controller@^3.0.0:
@ -89,24 +90,24 @@ bcrypt-pbkdf@^1.0.0:
dependencies: dependencies:
tweetnacl "^0.14.3" tweetnacl "^0.14.3"
bignumber.js@^4.0.0: bitcoin-core@1:
version "4.1.0" version "1.2.0"
resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-4.1.0.tgz#db6f14067c140bd46624815a7916c92d9b6c24b1" resolved "https://registry.yarnpkg.com/bitcoin-core/-/bitcoin-core-1.2.0.tgz#5c4d01e813582ea70f9d891c2e429bf429b5add6"
integrity sha512-eJzYkFYy9L4JzXsbymsFn3p54D+llV27oTQ+ziJG7WFRheJcNZilgVXMG0LoZtlQSKBsJdWtLFqOD0u+U0jZKA== integrity sha1-XE0B6BNYLqcPnYkcLkKb9Cm1rdY=
bitcoin-core@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/bitcoin-core/-/bitcoin-core-3.0.0.tgz#3ad59a16b6748d8b60937affae6c5f1df2db770d"
integrity sha512-fdh8V/5lxDXwbq6KUCd9PjbTDe1kPGFM1brSFByuzMb+VSArr1qF422qbAJvW0dLQSaRhVDb7WC+a602QM70FQ==
dependencies: dependencies:
"@uphold/request-logger" "^2.0.0" "@uphold/request-logger" "^1.2.0"
bluebird "^3.4.1"
debugnyan "^1.0.0" debugnyan "^1.0.0"
json-bigint "^0.2.0"
lodash "^4.0.0" lodash "^4.0.0"
request "^2.53.0" request "^2.53.0"
semver "^5.1.0" semver "^5.1.0"
standard-error "^1.1.0" standard-error "^1.1.0"
bluebird@^3.4.1:
version "3.7.2"
resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f"
integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==
brace-expansion@^1.1.7: brace-expansion@^1.1.7:
version "1.1.11" version "1.1.11"
resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd"
@ -390,13 +391,6 @@ jsbn@~0.1.0:
resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513"
integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM= integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM=
json-bigint@^0.2.0:
version "0.2.3"
resolved "https://registry.yarnpkg.com/json-bigint/-/json-bigint-0.2.3.tgz#118d7f6ff1d38659f19f94cf73e64a75a3f988a8"
integrity sha1-EY1/b/HThlnxn5TPc+ZKdaP5iKg=
dependencies:
bignumber.js "^4.0.0"
json-schema-traverse@^0.4.1: json-schema-traverse@^0.4.1:
version "0.4.1" version "0.4.1"
resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660"
@ -446,6 +440,11 @@ levn@~0.3.0:
prelude-ls "~1.1.2" prelude-ls "~1.1.2"
type-check "~0.3.2" type-check "~0.3.2"
lodash.clonedeep@^4.5.0:
version "4.5.0"
resolved "https://registry.yarnpkg.com/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz#e23f3f9c4f8fbdde872529c1071857a086e5ccef"
integrity sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=
lodash@^4.0.0: lodash@^4.0.0:
version "4.17.20" version "4.17.20"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52"