forked from ByteJason/BTC-Script
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathspeed.js
More file actions
32 lines (25 loc) · 1021 Bytes
/
speed.js
File metadata and controls
32 lines (25 loc) · 1021 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
const bip32 = require('bip32');
const bip39 = require('bip39');
const ecc = require('tiny-secp256k1');
const bitcoin = require('bitcoinjs-lib');
const {ECPairFactory} = require('ecpair');
const {logger, isValidBitcoinAddress} = require("./utils/function");
const AddressDataClass = require("./utils/AddressData");
const Request = require("./utils/Request");
const ConfigClass = require("./utils/Config");
const readline = require('node:readline/promises');
bitcoin.initEccLib(ecc);
const config = new ConfigClass('./config.yaml');
const network = config.network;
const request = new Request(config);
const exchangeRate = 1e8;
// @apidoc: https://mempool.space/signet/docs/api/rest
// @apidoc: https://mempool.fractalbitcoin.io/zh/docs/api/rest
const toXOnly = (pubKey) => pubKey.length === 32 ? pubKey : pubKey.slice(1, 33);
function getKeyPairByPrivateKey(privateKey) {
return ECPairFactory(ecc).fromWIF(privateKey, network);
}
async function main() {
logger().warn("加速功能开发中...");
}
main();