Merge pull request #8 from christroutner/unstable

fix(SLP): Passing API tokens to SLP library
This commit is contained in:
Chris Troutner
2020-02-25 09:31:58 -08:00
committed by GitHub
2 changed files with 7 additions and 1 deletions
+2 -1
View File
@@ -19,13 +19,14 @@ class SLP {
constructor(config) { constructor(config) {
const tmp = {} const tmp = {}
if (!config || !config.restURL) { if (!config || !config.restURL) {
tmp.restURL = `https://api.bchjs.cash/v3/` tmp.restURL = `https://api.fullstack.cash/v3/`
} else { } else {
tmp.restURL = config.restURL tmp.restURL = config.restURL
tmp.apiToken = config.apiToken tmp.apiToken = config.apiToken
} }
this.restURL = tmp.restURL this.restURL = tmp.restURL
this.apiToken = tmp.apiToken
this.Address = new Address(tmp) this.Address = new Address(tmp)
this.ECPair = ECPair this.ECPair = ECPair
+5
View File
@@ -17,6 +17,11 @@ util.inspect.defaultOptions = {
} }
describe(`#SLP`, () => { describe(`#SLP`, () => {
before(() => {
console.log(`bchjs.SLP.restURL: ${bchjs.SLP.restURL}`)
console.log(`bchjs.SLP.apiToken: ${bchjs.SLP.apiToken}`)
})
describe("#util", () => { describe("#util", () => {
describe("#list", () => { describe("#list", () => {
it(`should get information on the Spice token`, async () => { it(`should get information on the Spice token`, async () => {