mirror of
https://github.com/Permissionless-Software-Foundation/bch-js.git
synced 2026-09-21 16:51:59 -07:00
fix(x402): Adding default server for x402 payments
This commit is contained in:
+10
-1
@@ -87,7 +87,16 @@ class BCHJS {
|
|||||||
this.wif = process.env.BCHJSWIF
|
this.wif = process.env.BCHJSWIF
|
||||||
}
|
}
|
||||||
this.paymentAmountSats = (config && config.paymentAmountSats) || 2000 * 10
|
this.paymentAmountSats = (config && config.paymentAmountSats) || 2000 * 10
|
||||||
this.bchServerURL = (config && config.bchServerURL) || 'https://free-bch.fullstack.cash'
|
|
||||||
|
// BCH server URL for x402 payments (separate from REST API server)
|
||||||
|
// This is used when broadcasting payment transactions to the blockchain
|
||||||
|
if (config && config.bchServerURL && config.bchServerURL !== '') {
|
||||||
|
this.bchServerURL = config.bchServerURL
|
||||||
|
} else if (process.env.BCHJSBCHSERVERURL && process.env.BCHJSBCHSERVERURL !== '') {
|
||||||
|
this.bchServerURL = process.env.BCHJSBCHSERVERURL
|
||||||
|
} else {
|
||||||
|
this.bchServerURL = 'https://bch.fullstack.cash'
|
||||||
|
}
|
||||||
|
|
||||||
const libConfig = {
|
const libConfig = {
|
||||||
restURL: this.restURL,
|
restURL: this.restURL,
|
||||||
|
|||||||
Reference in New Issue
Block a user