mirror of
https://github.com/Permissionless-Software-Foundation/bch-js.git
synced 2026-09-22 00:52:01 -07:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b7e04522ce | ||
|
|
19f243428d | ||
|
|
16079c8d04 | ||
|
|
6743ca5fa9 | ||
|
|
ec046d3ef7 | ||
|
|
85405d8e70 | ||
|
|
1989b72b2a | ||
|
|
f1f2bf42d9 | ||
|
|
348a073714 |
Generated
+586
-458
File diff suppressed because it is too large
Load Diff
+3
-3
@@ -13,11 +13,11 @@
|
||||
"test": "export RESTURL=http://localhost:5942/v6 && c8 mocha --trace-warnings --unhandled-rejections=strict --timeout 30000 test/unit/",
|
||||
"test:integration": "npm run test:integration:local:noauth",
|
||||
"test:integration:fullstack:free": "export RESTURL=https://bch.fullstack.cash/v6 && mocha --timeout 60000 test/integration/",
|
||||
"test:integration:fullstack:x402": "export RESTURL=https://x402-bch.fullstack.cash/v6 && export BCHJSWIF=L1eYaneXDDXy8VDig4Arwe8wYHbhtsA5wuQvwsKwhaYeneoZuKG4 && mocha --timeout 30000 test/integration/",
|
||||
"test:integration:fullstack:x402": "export RESTURL=https://x402-bch.fullstack.cash/v6 && export BCHJSWIF=L1eYaneXDDXy8VDig4Arwe8wYHbhtsA5wuQvwsKwhaYeneoZuKG4 && mocha --timeout 120000 test/integration/",
|
||||
"test:integration:local:noauth": "export RESTURL=http://localhost:5942/v6 && mocha --timeout 30000 test/integration/",
|
||||
"test:integration:local:auth": "export RESTURL=http://192.168.1.115:5942/v6 && export BCHJSBEARERTOKEN=temp01 && mocha --timeout 30000 test/integration/",
|
||||
"test:integration:local:x402": "export RESTURL=http://localhost:5942/v6 && export BCHJSWIF=L1eYaneXDDXy8VDig4Arwe8wYHbhtsA5wuQvwsKwhaYeneoZuKG4 && mocha --timeout 1200000 test/integration/",
|
||||
"test:integration:decatur": "export RESTURL=http://192.168.2.127:5942/v6 && mocha --timeout 30000 test/integration/",
|
||||
"test:integration:x402": "export RESTURL=http://localhost:5942/v6 && export BCHJSWIF=L1eYaneXDDXy8VDig4Arwe8wYHbhtsA5wuQvwsKwhaYeneoZuKG4 && mocha --timeout 30000 test/integration/",
|
||||
"coverage": "nyc --reporter=html mocha --timeout 25000 test/unit/",
|
||||
"docs": "./node_modules/.bin/apidoc -i src/ -o docs && ./fix-docs-contrast.sh",
|
||||
"lint": "standard --env mocha --fix"
|
||||
@@ -52,7 +52,7 @@
|
||||
"slp-mdm": "0.0.7",
|
||||
"slp-parser": "0.0.4",
|
||||
"wif": "2.0.6",
|
||||
"x402-bch-axios": "1.1.1"
|
||||
"x402-bch-axios": "2.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"apidoc": "1.2.0",
|
||||
|
||||
+6
-3
@@ -86,7 +86,7 @@ class BCHJS {
|
||||
} else if (process.env.BCHJSWIF && process.env.BCHJSWIF !== '') {
|
||||
this.wif = process.env.BCHJSWIF
|
||||
}
|
||||
this.paymentAmountSats = (config && config.paymentAmountSats) || 2000 * 10
|
||||
this.paymentAmountSats = (config && config.paymentAmountSats) || 2000 * 5
|
||||
|
||||
// BCH server URL for x402 payments (separate from REST API server)
|
||||
// This is used when broadcasting payment transactions to the blockchain
|
||||
@@ -95,7 +95,7 @@ class BCHJS {
|
||||
} else if (process.env.BCHJSBCHSERVERURL && process.env.BCHJSBCHSERVERURL !== '') {
|
||||
this.bchServerURL = process.env.BCHJSBCHSERVERURL
|
||||
} else {
|
||||
this.bchServerURL = 'https://bch.fullstack.cash'
|
||||
this.bchServerURL = 'https://bch.fullstack.cash/v6/'
|
||||
}
|
||||
|
||||
const libConfig = {
|
||||
@@ -117,7 +117,10 @@ class BCHJS {
|
||||
axiosInstance = withPaymentInterceptor(
|
||||
axiosInstance,
|
||||
signer,
|
||||
{ bchServerURL: this.bchServerURL }
|
||||
{
|
||||
apiType: 'rest-api',
|
||||
bchServerURL: this.bchServerURL
|
||||
}
|
||||
)
|
||||
|
||||
libConfig.axios = axiosInstance
|
||||
|
||||
+2
-1
@@ -6,7 +6,8 @@ class DSProof {
|
||||
constructor (config) {
|
||||
this.restURL = config.restURL
|
||||
this.authToken = config.authToken
|
||||
this.axios = axios
|
||||
// Use the shared axios instance if provided, otherwise fall back to axios
|
||||
this.axios = config.axios || axios
|
||||
|
||||
this.axiosOptions = {
|
||||
headers: {
|
||||
|
||||
+5
-5
@@ -20,8 +20,8 @@ describe('#X402 Integration', () => {
|
||||
})
|
||||
|
||||
assert.strictEqual(bchjs.wif, '')
|
||||
assert.strictEqual(bchjs.paymentAmountSats, 20000)
|
||||
assert.strictEqual(bchjs.bchServerURL, 'https://bch.fullstack.cash')
|
||||
assert.strictEqual(bchjs.paymentAmountSats, 10000)
|
||||
assert.strictEqual(bchjs.bchServerURL, 'https://bch.fullstack.cash/v6/')
|
||||
})
|
||||
|
||||
it('should accept wif in config', () => {
|
||||
@@ -59,8 +59,8 @@ describe('#X402 Integration', () => {
|
||||
})
|
||||
|
||||
assert.strictEqual(bchjs.wif, '')
|
||||
assert.strictEqual(bchjs.paymentAmountSats, 20000)
|
||||
assert.strictEqual(bchjs.bchServerURL, 'https://bch.fullstack.cash')
|
||||
assert.strictEqual(bchjs.paymentAmountSats, 10000)
|
||||
assert.strictEqual(bchjs.bchServerURL, 'https://bch.fullstack.cash/v6/')
|
||||
})
|
||||
|
||||
it('should read WIF from BCHJSWIF environment variable', () => {
|
||||
@@ -168,7 +168,7 @@ describe('#X402 Integration', () => {
|
||||
})
|
||||
|
||||
assert.strictEqual(bchjs.restURL, customRestURL)
|
||||
assert.strictEqual(bchjs.bchServerURL, 'https://bch.fullstack.cash')
|
||||
assert.strictEqual(bchjs.bchServerURL, 'https://bch.fullstack.cash/v6/')
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user