mirror of
https://github.com/Permissionless-Software-Foundation/bch-js.git
synced 2026-09-21 16:51:59 -07:00
feat(ESM): Converted code base to ESM format, away from CommonJS
This commit is contained in:
@@ -7,13 +7,13 @@
|
||||
of an e2e test to be properly tested.
|
||||
*/
|
||||
|
||||
const chai = require('chai')
|
||||
const assert = chai.assert
|
||||
const BCHJS = require('../../src/bch-js')
|
||||
const bchjs = new BCHJS()
|
||||
import chai from 'chai'
|
||||
import BCHJS from '../../src/bch-js.js'
|
||||
|
||||
// Inspect utility used for debugging.
|
||||
const util = require('util')
|
||||
import util from 'util'
|
||||
const assert = chai.assert
|
||||
const bchjs = new BCHJS()
|
||||
util.inspect.defaultOptions = {
|
||||
showHidden: true,
|
||||
colors: true,
|
||||
|
||||
@@ -4,10 +4,11 @@
|
||||
*/
|
||||
|
||||
// Global npm libraries
|
||||
const assert = require('chai').assert
|
||||
import chai from 'chai'
|
||||
|
||||
// Local libraries
|
||||
const BCHJS = require('../../../../src/bch-js')
|
||||
import BCHJS from '../../../../src/bch-js.js'
|
||||
const { assert } = chai
|
||||
let bchjs
|
||||
|
||||
describe('#psf-slp-indexer', () => {
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
TODO
|
||||
*/
|
||||
|
||||
const chai = require('chai')
|
||||
const assert = chai.assert
|
||||
const BCHJS = require('../../../../src/bch-js')
|
||||
const bchjs = new BCHJS({ restURL: process.env.RESTURL })
|
||||
import chai from 'chai'
|
||||
import BCHJS from '../../../../src/bch-js.js'
|
||||
|
||||
// Inspect utility used for debugging.
|
||||
const util = require('util')
|
||||
import util from 'util'
|
||||
const assert = chai.assert
|
||||
const bchjs = new BCHJS({ restURL: process.env.RESTURL })
|
||||
util.inspect.defaultOptions = {
|
||||
showHidden: true,
|
||||
colors: true,
|
||||
|
||||
@@ -2,9 +2,10 @@
|
||||
Integration tests for the utxo.js library.
|
||||
*/
|
||||
|
||||
const assert = require('chai').assert
|
||||
import chai from 'chai'
|
||||
|
||||
const BCHJS = require('../../../../src/bch-js')
|
||||
import BCHJS from '../../../../src/bch-js.js'
|
||||
const { assert } = chai
|
||||
const bchjs = new BCHJS()
|
||||
|
||||
describe('#UTXO', () => {
|
||||
|
||||
@@ -2,9 +2,10 @@
|
||||
Integration tests for bchjs dsproof library.
|
||||
*/
|
||||
|
||||
const assert = require('chai').assert
|
||||
import chai from 'chai'
|
||||
|
||||
const BCHJS = require('../../../../src/bch-js')
|
||||
import BCHJS from '../../../../src/bch-js.js'
|
||||
const { assert } = chai
|
||||
const bchjs = new BCHJS()
|
||||
|
||||
describe('#DSProof', () => {
|
||||
|
||||
@@ -4,10 +4,11 @@
|
||||
*/
|
||||
|
||||
// Global npm libraries
|
||||
const assert = require('chai').assert
|
||||
import chai from 'chai'
|
||||
|
||||
// Local libraries
|
||||
const BCHJS = require('../../../../src/bch-js')
|
||||
import BCHJS from '../../../../src/bch-js.js'
|
||||
const { assert } = chai
|
||||
let bchjs
|
||||
|
||||
describe('#psf-slp-indexer', () => {
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
TODO
|
||||
*/
|
||||
|
||||
const chai = require('chai')
|
||||
const assert = chai.assert
|
||||
const BCHJS = require('../../../../src/bch-js')
|
||||
const bchjs = new BCHJS()
|
||||
import chai from 'chai'
|
||||
import BCHJS from '../../../../src/bch-js.js'
|
||||
|
||||
// Inspect utility used for debugging.
|
||||
const util = require('util')
|
||||
import util from 'util'
|
||||
const assert = chai.assert
|
||||
const bchjs = new BCHJS()
|
||||
util.inspect.defaultOptions = {
|
||||
showHidden: true,
|
||||
colors: true,
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
These tests are specific to the ABC chain.
|
||||
*/
|
||||
|
||||
const chai = require('chai')
|
||||
const assert = chai.assert
|
||||
import chai from 'chai'
|
||||
|
||||
const BCHJS = require('../../../../src/bch-js')
|
||||
let bchjs
|
||||
import BCHJS from '../../../../src/bch-js.js'
|
||||
|
||||
// Inspect utility used for debugging.
|
||||
const util = require('util')
|
||||
import util from 'util'
|
||||
const assert = chai.assert
|
||||
let bchjs
|
||||
util.inspect.defaultOptions = {
|
||||
showHidden: true,
|
||||
colors: true,
|
||||
|
||||
@@ -2,8 +2,9 @@
|
||||
Integration tests for the transaction.js library.
|
||||
*/
|
||||
|
||||
const assert = require('chai').assert
|
||||
const BCHJS = require('../../../../src/bch-js')
|
||||
import chai from 'chai'
|
||||
import BCHJS from '../../../../src/bch-js.js'
|
||||
const { assert } = chai
|
||||
const bchjs = new BCHJS()
|
||||
|
||||
describe('#Transaction', () => {
|
||||
|
||||
@@ -3,13 +3,13 @@
|
||||
rest.bitcoin.com.
|
||||
*/
|
||||
|
||||
const chai = require('chai')
|
||||
const assert = chai.assert
|
||||
const BCHJS = require('../../../../src/bch-js')
|
||||
const bchjs = new BCHJS()
|
||||
import chai from 'chai'
|
||||
import BCHJS from '../../../../src/bch-js.js'
|
||||
|
||||
// Inspect utility used for debugging.
|
||||
const util = require('util')
|
||||
import util from 'util'
|
||||
const assert = chai.assert
|
||||
const bchjs = new BCHJS()
|
||||
util.inspect.defaultOptions = {
|
||||
showHidden: true,
|
||||
colors: true,
|
||||
|
||||
@@ -2,9 +2,10 @@
|
||||
Integration tests for the utxo.js library.
|
||||
*/
|
||||
|
||||
const assert = require('chai').assert
|
||||
import chai from 'chai'
|
||||
|
||||
const BCHJS = require('../../../../src/bch-js')
|
||||
import BCHJS from '../../../../src/bch-js.js'
|
||||
const { assert } = chai
|
||||
const bchjs = new BCHJS()
|
||||
// const bchjs = new BCHJS({ restURL: 'http://192.168.2.129:3000/v5/' })
|
||||
|
||||
|
||||
@@ -7,20 +7,20 @@
|
||||
of an e2e test to be properly tested.
|
||||
*/
|
||||
|
||||
const chai = require('chai')
|
||||
import chai from 'chai'
|
||||
// if (process.env.RESTURL) RESTURL = process.env.RESTURL
|
||||
|
||||
import BCHJS from '../../../../src/bch-js.js'
|
||||
|
||||
// Inspect utility used for debugging.
|
||||
import util from 'util'
|
||||
const assert = chai.assert
|
||||
|
||||
const RESTURL = process.env.RESTURL
|
||||
? process.env.RESTURL
|
||||
: 'https://testnet3.fullstack.cash/v5/'
|
||||
// if (process.env.RESTURL) RESTURL = process.env.RESTURL
|
||||
|
||||
const BCHJS = require('../../../../src/bch-js')
|
||||
// const bchjs = new BCHJS({ restURL: `https://testnet.bchjs.cash/v5/` })
|
||||
const bchjs = new BCHJS({ restURL: RESTURL, apiToken: process.env.BCHJSTOKEN })
|
||||
|
||||
// Inspect utility used for debugging.
|
||||
const util = require('util')
|
||||
util.inspect.defaultOptions = {
|
||||
showHidden: true,
|
||||
colors: true,
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
Integration tests for bchjs control library.
|
||||
*/
|
||||
|
||||
const chai = require('chai')
|
||||
import chai from 'chai'
|
||||
|
||||
import BCHJS from '../../../../src/bch-js.js'
|
||||
const assert = chai.assert
|
||||
|
||||
const RESTURL = process.env.RESTURL
|
||||
? process.env.RESTURL
|
||||
: 'https://testnet3.fullstack.cash/v5/'
|
||||
|
||||
const BCHJS = require('../../../../src/bch-js')
|
||||
const bchjs = new BCHJS({ restURL: RESTURL, apiToken: process.env.BCHJSTOKEN })
|
||||
|
||||
describe('#control', () => {
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
const chai = require('chai')
|
||||
import chai from 'chai'
|
||||
import sinon from 'sinon'
|
||||
import util from 'util'
|
||||
|
||||
import BCHJS from '../../../../src/bch-js.js'
|
||||
const assert = chai.assert
|
||||
const sinon = require('sinon')
|
||||
const util = require('util')
|
||||
|
||||
const RESTURL = process.env.RESTURL
|
||||
? process.env.RESTURL
|
||||
: 'https://testnet3.fullstack.cash/v5/'
|
||||
|
||||
const BCHJS = require('../../../../src/bch-js')
|
||||
const bchjs = new BCHJS({ restURL: RESTURL, apiToken: process.env.BCHJSTOKEN })
|
||||
|
||||
describe('#ElectrumX', () => {
|
||||
|
||||
@@ -5,20 +5,20 @@
|
||||
TODO
|
||||
*/
|
||||
|
||||
const chai = require('chai')
|
||||
import chai from 'chai'
|
||||
// if (process.env.RESTURL) RESTURL = process.env.RESTURL
|
||||
|
||||
import BCHJS from '../../../../src/bch-js.js'
|
||||
|
||||
// Inspect utility used for debugging.
|
||||
import util from 'util'
|
||||
const assert = chai.assert
|
||||
|
||||
const RESTURL = process.env.RESTURL
|
||||
? process.env.RESTURL
|
||||
: 'https://testnet3.fullstack.cash/v5/'
|
||||
// if (process.env.RESTURL) RESTURL = process.env.RESTURL
|
||||
|
||||
const BCHJS = require('../../../../src/bch-js')
|
||||
// const bchjs = new BCHJS({ restURL: `https://testnet.bchjs.cash/v5/` })
|
||||
const bchjs = new BCHJS({ restURL: RESTURL, apiToken: process.env.BCHJSTOKEN })
|
||||
|
||||
// Inspect utility used for debugging.
|
||||
const util = require('util')
|
||||
util.inspect.defaultOptions = {
|
||||
showHidden: true,
|
||||
colors: true,
|
||||
|
||||
@@ -2,20 +2,20 @@
|
||||
Integration tests for the bchjs covering SLP tokens.
|
||||
*/
|
||||
|
||||
const chai = require('chai')
|
||||
import chai from 'chai'
|
||||
// if (process.env.RESTURL) RESTURL = process.env.RESTURL
|
||||
|
||||
import BCHJS from '../../../../src/bch-js.js'
|
||||
|
||||
// Inspect utility used for debugging.
|
||||
import util from 'util'
|
||||
const assert = chai.assert
|
||||
|
||||
const RESTURL = process.env.RESTURL
|
||||
? process.env.RESTURL
|
||||
: 'https://testnet3.fullstack.cash/v5/'
|
||||
// if (process.env.RESTURL) RESTURL = process.env.RESTURL
|
||||
|
||||
const BCHJS = require('../../../../src/bch-js')
|
||||
// const bchjs = new BCHJS({ restURL: `https://testnet.bchjs.cash/v5/` })
|
||||
const bchjs = new BCHJS({ restURL: RESTURL, apiToken: process.env.BCHJSTOKEN })
|
||||
|
||||
// Inspect utility used for debugging.
|
||||
const util = require('util')
|
||||
util.inspect.defaultOptions = {
|
||||
showHidden: true,
|
||||
colors: true,
|
||||
|
||||
@@ -3,20 +3,20 @@
|
||||
rest.bitcoin.com.
|
||||
*/
|
||||
|
||||
const chai = require('chai')
|
||||
import chai from 'chai'
|
||||
// if (process.env.RESTURL) RESTURL = process.env.RESTURL
|
||||
|
||||
import BCHJS from '../../../../src/bch-js.js'
|
||||
|
||||
// Inspect utility used for debugging.
|
||||
import util from 'util'
|
||||
const assert = chai.assert
|
||||
|
||||
const RESTURL = process.env.RESTURL
|
||||
? process.env.RESTURL
|
||||
: 'https://testnet3.fullstack.cash/v5/'
|
||||
// if (process.env.RESTURL) RESTURL = process.env.RESTURL
|
||||
|
||||
const BCHJS = require('../../../../src/bch-js')
|
||||
// const bchjs = new BCHJS({ restURL: `https://testnet.bchjs.cash/v5/` })
|
||||
const bchjs = new BCHJS({ restURL: RESTURL, apiToken: process.env.BCHJSTOKEN })
|
||||
|
||||
// Inspect utility used for debugging.
|
||||
const util = require('util')
|
||||
util.inspect.defaultOptions = {
|
||||
showHidden: true,
|
||||
colors: true,
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
Integration tests for bchjs control library.
|
||||
*/
|
||||
|
||||
const chai = require('chai')
|
||||
import chai from 'chai'
|
||||
import BCHJS from '../../src/bch-js.js'
|
||||
const assert = chai.assert
|
||||
const BCHJS = require('../../src/bch-js')
|
||||
const bchjs = new BCHJS()
|
||||
|
||||
describe('#control', () => {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
const chai = require('chai')
|
||||
const assert = chai.assert
|
||||
const sinon = require('sinon')
|
||||
import chai from 'chai'
|
||||
import sinon from 'sinon'
|
||||
|
||||
const BCHJS = require('../../src/bch-js')
|
||||
import BCHJS from '../../src/bch-js.js'
|
||||
const assert = chai.assert
|
||||
const bchjs = new BCHJS()
|
||||
|
||||
describe('#ElectrumX', () => {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
const assert = require('chai').assert
|
||||
const BCHJS = require('../../src/bch-js')
|
||||
import chai from 'chai'
|
||||
import BCHJS from '../../src/bch-js.js'
|
||||
const { assert } = chai
|
||||
const bchjs = new BCHJS()
|
||||
|
||||
describe('#price', () => {
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
TODO
|
||||
*/
|
||||
|
||||
const chai = require('chai')
|
||||
const assert = chai.assert
|
||||
const BCHJS = require('../../src/bch-js')
|
||||
const bchjs = new BCHJS()
|
||||
import chai from 'chai'
|
||||
import BCHJS from '../../src/bch-js.js'
|
||||
|
||||
// Inspect utility used for debugging.
|
||||
const util = require('util')
|
||||
import util from 'util'
|
||||
const assert = chai.assert
|
||||
const bchjs = new BCHJS()
|
||||
util.inspect.defaultOptions = {
|
||||
showHidden: true,
|
||||
colors: true,
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
Integration tests for the bchjs covering SLP tokens.
|
||||
*/
|
||||
|
||||
const chai = require('chai')
|
||||
const assert = chai.assert
|
||||
import chai from 'chai'
|
||||
|
||||
const BCHJS = require('../../src/bch-js')
|
||||
let bchjs
|
||||
import BCHJS from '../../src/bch-js.js'
|
||||
|
||||
// Inspect utility used for debugging.
|
||||
const util = require('util')
|
||||
import util from 'util'
|
||||
const assert = chai.assert
|
||||
let bchjs
|
||||
util.inspect.defaultOptions = {
|
||||
showHidden: true,
|
||||
colors: true,
|
||||
|
||||
@@ -2,8 +2,9 @@
|
||||
Integration tests for the transaction.js library.
|
||||
*/
|
||||
|
||||
const assert = require('chai').assert
|
||||
const BCHJS = require('../../src/bch-js')
|
||||
import chai from 'chai'
|
||||
import BCHJS from '../../src/bch-js.js'
|
||||
const { assert } = chai
|
||||
const bchjs = new BCHJS()
|
||||
|
||||
describe('#Transaction', () => {
|
||||
|
||||
Reference in New Issue
Block a user