mirror of
https://github.com/Permissionless-Software-Foundation/bch-js.git
synced 2026-09-21 16:51:59 -07:00
fix(script.js): Trying to satisfy ESM, linter, and minify packager at the same time
This commit is contained in:
@@ -534,8 +534,6 @@ class ElectrumX {
|
|||||||
*/
|
*/
|
||||||
async txData (txid) {
|
async txData (txid) {
|
||||||
try {
|
try {
|
||||||
console.log('bch-js txData() restURL: ', this.restURL)
|
|
||||||
|
|
||||||
// Handle single transaction.
|
// Handle single transaction.
|
||||||
if (typeof txid === 'string') {
|
if (typeof txid === 'string') {
|
||||||
const response = await this.axios.get(
|
const response = await this.axios.get(
|
||||||
|
|||||||
+10
-3
@@ -1,7 +1,14 @@
|
|||||||
|
import { readFileSync } from 'fs'
|
||||||
|
import { fileURLToPath } from 'url'
|
||||||
|
import { dirname, join } from 'path'
|
||||||
import Bitcoin from '@psf/bitcoincashjs-lib'
|
import Bitcoin from '@psf/bitcoincashjs-lib'
|
||||||
import { createRequire } from 'module'
|
|
||||||
const require = createRequire(import.meta.url)
|
// Import the bitcoincash-ops library using ESM methods that don't piss off
|
||||||
const opcodes = require('@psf/bitcoincash-ops')
|
// the standard linter.
|
||||||
|
const __dirname = dirname(fileURLToPath(import.meta.url))
|
||||||
|
const opcodes = JSON.parse(
|
||||||
|
readFileSync(join(__dirname, '../node_modules/@psf/bitcoincash-ops/index.json'), 'utf8')
|
||||||
|
)
|
||||||
|
|
||||||
class Script {
|
class Script {
|
||||||
constructor () {
|
constructor () {
|
||||||
|
|||||||
Reference in New Issue
Block a user