Merge pull request #11 from Permissionless-Software-Foundation/ct-unstable

Working towards x402 production
This commit is contained in:
Chris Troutner
2025-12-21 16:34:26 -07:00
committed by GitHub
9 changed files with 624 additions and 319 deletions
+1
View File
@@ -25,6 +25,7 @@ PORT=5942
X402_ENABLED=true X402_ENABLED=true
SERVER_BCH_ADDRESS=bitcoincash:qqlrzp23w08434twmvr4fxw672whkjy0py26r63g3d SERVER_BCH_ADDRESS=bitcoincash:qqlrzp23w08434twmvr4fxw672whkjy0py26r63g3d
FACILITATOR_URL=http://localhost:4345/facilitator FACILITATOR_URL=http://localhost:4345/facilitator
X402_PRICE_SAT=200
# Basic Authentication required to access this API? # Basic Authentication required to access this API?
USE_BASIC_AUTH=true USE_BASIC_AUTH=true
+2 -2
View File
@@ -8,7 +8,7 @@ This is a REST API for communicating with Bitcoin Cash infrastructure. It replac
## x402-bch Payments ## x402-bch Payments
All REST endpoints exposed under the `/v6` prefix are protected by the [`x402-bch-express`](https://www.npmjs.com/package/x402-bch-express) middleware. Each API call requires a BCH payment authorization for **2000 satoshis**. The middleware advertises payment requirements via HTTP 402 responses and validates incoming `X-PAYMENT` headers with a configured Facilitator. All REST endpoints exposed under the `/v6` prefix are protected by the [`x402-bch-express`](https://www.npmjs.com/package/x402-bch-express) middleware. Each API call requires a BCH payment authorization for **200 satoshis**. The middleware advertises payment requirements via HTTP 402 responses and validates incoming `X-PAYMENT` headers with a configured Facilitator.
### Configuration ### Configuration
@@ -17,7 +17,7 @@ Environment variables control the payment flow:
- `X402_ENABLED` — set to `false` (case-insensitive) to disable the middleware. Defaults to enabled. - `X402_ENABLED` — set to `false` (case-insensitive) to disable the middleware. Defaults to enabled.
- `SERVER_BCH_ADDRESS` — BCH cash address that receives funding transactions. Defaults to `bitcoincash:qqlrzp23w08434twmvr4fxw672whkjy0py26r63g3d`. - `SERVER_BCH_ADDRESS` — BCH cash address that receives funding transactions. Defaults to `bitcoincash:qqlrzp23w08434twmvr4fxw672whkjy0py26r63g3d`.
- `FACILITATOR_URL` — Root URL of the facilitator service (e.g., `http://localhost:4345/facilitator`). - `FACILITATOR_URL` — Root URL of the facilitator service (e.g., `http://localhost:4345/facilitator`).
- `X402_PRICE_SAT` — Optional; override the satoshi price per call (defaults to `2000`). - `X402_PRICE_SAT` — Optional; override the satoshi price per call (defaults to `200`).
When `X402_ENABLED=false`, the server continues to operate without payment headers for local development or trusted deployments. When `X402_ENABLED=false`, the server continues to operate without payment headers for local development or trusted deployments.
+18 -1
View File
@@ -83,8 +83,10 @@ class Server {
// Apply x402 middleware based on configuration // Apply x402 middleware based on configuration
// Logic: // Logic:
// - If X402_ENABLED=false OR USE_BASIC_AUTH=false: Don't apply x402 (no rate limits)
// - If X402_ENABLED=true AND USE_BASIC_AUTH=true: Apply x402 conditionally (bypass if basic auth valid) // - If X402_ENABLED=true AND USE_BASIC_AUTH=true: Apply x402 conditionally (bypass if basic auth valid)
// - If X402_ENABLED=true AND USE_BASIC_AUTH=false: Apply x402 unconditionally (no basic auth bypass)
// - If X402_ENABLED=false AND USE_BASIC_AUTH=true: Require basic auth only
// - If X402_ENABLED=false AND USE_BASIC_AUTH=false: No access control
// Apply access control middleware based on configuration // Apply access control middleware based on configuration
if (x402Settings.enabled && basicAuthSettings.enabled) { if (x402Settings.enabled && basicAuthSettings.enabled) {
@@ -112,6 +114,21 @@ class Server {
} }
app.use(conditionalX402Middleware) app.use(conditionalX402Middleware)
} else if (x402Settings.enabled && !basicAuthSettings.enabled) {
// X402_ENABLED=true AND USE_BASIC_AUTH=false: Apply x402 unconditionally (no basic auth bypass)
const routes = buildX402Routes(this.config.apiPrefix)
const facilitatorOptions = x402Settings.facilitatorUrl
? { url: x402Settings.facilitatorUrl }
: undefined
wlogger.info(`x402 middleware enabled (basic auth disabled); enforcing ${x402Settings.priceSat} satoshis per request`)
// Apply x402 middleware unconditionally - no basic auth bypass
app.use(x402PaymentMiddleware(
x402Settings.serverAddress,
routes,
facilitatorOptions
))
} else if (basicAuthSettings.enabled && !x402Settings.enabled) { } else if (basicAuthSettings.enabled && !x402Settings.enabled) {
// USE_BASIC_AUTH=true AND X402_ENABLED=false: Require basic auth, reject unauthenticated requests // USE_BASIC_AUTH=true AND X402_ENABLED=false: Require basic auth, reject unauthenticated requests
wlogger.info('Basic auth enforcement enabled (x402 disabled)') wlogger.info('Basic auth enforcement enabled (x402 disabled)')
+591 -308
View File
@@ -9,12 +9,12 @@
"version": "7.0.0", "version": "7.0.0",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@psf/bch-js": "7.1.0", "@psf/bch-js": "7.1.2",
"axios": "1.7.7", "axios": "1.7.7",
"cors": "2.8.5", "cors": "2.8.5",
"dotenv": "16.3.1", "dotenv": "16.3.1",
"express": "5.1.0", "express": "5.1.0",
"minimal-slp-wallet": "7.0.1", "minimal-slp-wallet": "7.0.2",
"psffpp": "1.2.1", "psffpp": "1.2.1",
"slp-token-media": "1.2.10", "slp-token-media": "1.2.10",
"winston": "3.11.0", "winston": "3.11.0",
@@ -871,9 +871,9 @@
} }
}, },
"node_modules/@psf/bch-js": { "node_modules/@psf/bch-js": {
"version": "7.1.0", "version": "7.1.2",
"resolved": "https://registry.npmjs.org/@psf/bch-js/-/bch-js-7.1.0.tgz", "resolved": "https://registry.npmjs.org/@psf/bch-js/-/bch-js-7.1.2.tgz",
"integrity": "sha512-SEkkd7x4RJ5d7LOr1DrRC73ZCwWFKAvBUOvMt1icagCabWFNC2hX1YBqIKr7PQgwP9dRmce8c7y+2O1yrz1WxQ==", "integrity": "sha512-zMEy4x+N0F3xqZ+nR2nZYucI4DkOWrt/8gO0leOQrbYan9QPBsP6z5tOcIA01tFQsDWSP9errtWNrK5Avq2Pnw==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@chris.troutner/bip32-utils": "1.0.5", "@chris.troutner/bip32-utils": "1.0.5",
@@ -899,7 +899,7 @@
"slp-mdm": "0.0.7", "slp-mdm": "0.0.7",
"slp-parser": "0.0.4", "slp-parser": "0.0.4",
"wif": "2.0.6", "wif": "2.0.6",
"x402-bch-axios": "1.1.1" "x402-bch-axios": "1.1.2"
} }
}, },
"node_modules/@psf/bch-js/node_modules/axios": { "node_modules/@psf/bch-js/node_modules/axios": {
@@ -6464,18 +6464,595 @@
} }
}, },
"node_modules/minimal-slp-wallet": { "node_modules/minimal-slp-wallet": {
"version": "7.0.1", "version": "7.0.2",
"resolved": "https://registry.npmjs.org/minimal-slp-wallet/-/minimal-slp-wallet-7.0.1.tgz", "resolved": "https://registry.npmjs.org/minimal-slp-wallet/-/minimal-slp-wallet-7.0.2.tgz",
"integrity": "sha512-lMDyDXgMS60KCL9UXpLsFviPbDH+XhT4E3mI0gEsWWLuaXEzB5fw5YMas8svPudel19ciywVqHmFUb3XqTF13g==", "integrity": "sha512-H3H46VXXhvHF/1EKIaAVpBXevX5Bmt1SYqpfQFIcb7JSajXwwncQv7gmhf5Q9H3jtwdY43YWq2TFoeLUkI7E4g==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@chris.troutner/retry-queue": "1.0.11", "@chris.troutner/retry-queue": "1.0.11",
"@psf/bch-js": "7.1.0", "@psf/bch-js": "7.1.1",
"bch-consumer": "1.6.2", "bch-consumer": "1.6.2",
"bch-donation": "1.1.2", "bch-donation": "1.1.2",
"crypto-js": "4.0.0" "crypto-js": "4.0.0"
} }
}, },
"node_modules/minimal-slp-wallet/node_modules/@psf/bch-js": {
"version": "7.1.1",
"resolved": "https://registry.npmjs.org/@psf/bch-js/-/bch-js-7.1.1.tgz",
"integrity": "sha512-Wknq+q418Zb2Hmb6aDmxt/6VLrU81N+Iq9KP0KHGo1lFHeupJJonBkVt74R1ulry61F7MNRr39iDCTQsMM0ctg==",
"license": "MIT",
"dependencies": {
"@chris.troutner/bip32-utils": "1.0.5",
"@psf/bip21": "2.0.1",
"@psf/bitcoincashjs-lib": "4.0.3",
"@psf/coininfo": "4.0.0",
"axios": "1.13.2",
"bc-bip68": "1.0.5",
"bchaddrjs-slp": "0.2.14",
"bigi": "1.4.2",
"bignumber.js": "9.3.1",
"bip-schnorr": "0.6.7",
"bip38": "3.1.1",
"bip39": "3.1.0",
"bip66": "1.1.5",
"bitcoinjs-message": "2.2.0",
"bs58": "4.0.1",
"ecashaddrjs": "1.0.7",
"ini": "6.0.0",
"randombytes": "2.1.0",
"safe-buffer": "5.2.1",
"satoshi-bitcoin": "1.0.5",
"slp-mdm": "0.0.7",
"slp-parser": "0.0.4",
"wif": "2.0.6",
"x402-bch-axios": "1.1.1"
}
},
"node_modules/minimal-slp-wallet/node_modules/@types/node": {
"version": "11.11.6",
"resolved": "https://registry.npmjs.org/@types/node/-/node-11.11.6.tgz",
"integrity": "sha512-Exw4yUWMBXM3X+8oqzJNRqZSwUAaS4+7NdvHqQuFi/d+synz++xmX3QIf+BFqneW8N31R8Ky+sikfZUXq07ggQ==",
"license": "MIT"
},
"node_modules/minimal-slp-wallet/node_modules/apidoc": {
"version": "0.51.0",
"resolved": "https://registry.npmjs.org/apidoc/-/apidoc-0.51.0.tgz",
"integrity": "sha512-3P4srhm6NA+kE/YRM4qL5jESElpQQJL+Z8n7hyr4uC+1DSwGzmE6adXPVxuT/hpDyShrqmRlHk8hf40RSqEsNw==",
"license": "MIT",
"os": [
"darwin",
"freebsd",
"linux",
"openbsd",
"win32"
],
"dependencies": {
"bootstrap": "3.4.1",
"commander": "^8.3.0",
"diff-match-patch": "^1.0.5",
"esbuild-loader": "^2.16.0",
"expose-loader": "^3.1.0",
"fs-extra": "^10.0.0",
"glob": "^7.2.0",
"handlebars": "^4.7.7",
"iconv-lite": "^0.6.3",
"jquery": "^3.6.0",
"klaw-sync": "^6.0.0",
"lodash": "^4.17.21",
"markdown-it": "^12.2.0",
"nodemon": "^2.0.15",
"path-to-regexp": "^6.2.0",
"prismjs": "^1.25.0",
"semver": "^7.3.5",
"style-loader": "^3.3.1",
"url-parse": "^1.5.3",
"webpack": "^5.64.2",
"webpack-cli": "^4.9.1",
"winston": "^3.3.3"
},
"bin": {
"apidoc": "bin/apidoc"
},
"engines": {
"node": ">=14.0.0"
}
},
"node_modules/minimal-slp-wallet/node_modules/axios": {
"version": "1.13.2",
"resolved": "https://registry.npmjs.org/axios/-/axios-1.13.2.tgz",
"integrity": "sha512-VPk9ebNqPcy5lRGuSlKx752IlDatOjT9paPlm8A7yOuW2Fbvp4X3JznJtT4f0GzGLLiWE9W8onz51SqLYwzGaA==",
"license": "MIT",
"dependencies": {
"follow-redirects": "^1.15.6",
"form-data": "^4.0.4",
"proxy-from-env": "^1.1.0"
}
},
"node_modules/minimal-slp-wallet/node_modules/bchaddrjs-slp": {
"version": "0.2.14",
"resolved": "https://registry.npmjs.org/bchaddrjs-slp/-/bchaddrjs-slp-0.2.14.tgz",
"integrity": "sha512-4EdUV6Kwu2Ae8QyYtLAnHOUu0Zfl0w5wDPbeftiu3+fVr6ZyPmuVKlZtU2HERx76BOngZpGTf+suM3nuPJ0Tuw==",
"license": "MIT",
"dependencies": {
"bs58check": "^2.1.2",
"cashaddrjs-slp": "^0.2.12"
},
"engines": {
"node": ">= 6.0.0"
}
},
"node_modules/minimal-slp-wallet/node_modules/big.js": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/big.js/-/big.js-3.2.0.tgz",
"integrity": "sha512-+hN/Zh2D08Mx65pZ/4g5bsmNiZUuChDiQfTUQ7qJr4/kuopCr88xZsAXv6mBoZEsUI4OuGHlX59qE94K2mMW8Q==",
"license": "MIT",
"engines": {
"node": "*"
}
},
"node_modules/minimal-slp-wallet/node_modules/bignumber.js": {
"version": "9.3.1",
"resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.3.1.tgz",
"integrity": "sha512-Ko0uX15oIUS7wJ3Rb30Fs6SkVbLmPBAKdlm7q9+ak9bbIeFf0MwuBsQV6z7+X768/cHsfg+WlysDWJcmthjsjQ==",
"license": "MIT",
"engines": {
"node": "*"
}
},
"node_modules/minimal-slp-wallet/node_modules/bip-schnorr": {
"version": "0.6.7",
"resolved": "https://registry.npmjs.org/bip-schnorr/-/bip-schnorr-0.6.7.tgz",
"integrity": "sha512-Pf1o+whA52l7NC33CZY4eRtcB+dUCT54hKCF8mnw2349CG89LOXODHRWmUEcSSWzoi+Kjg1CtMmw6uV43tmJFA==",
"license": "MIT",
"dependencies": {
"bigi": "^1.4.2",
"ecurve": "^1.0.6",
"js-sha256": "^0.9.0",
"randombytes": "^2.1.0",
"safe-buffer": "^5.2.1"
},
"engines": {
"node": ">=8.0.0"
}
},
"node_modules/minimal-slp-wallet/node_modules/bip38": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/bip38/-/bip38-3.1.1.tgz",
"integrity": "sha512-d5AQWuXS95rdrEBnaKeZ9osMkvDR3QDULbAfoE7xRw0W8jfDrza9CsZwf+UhqjV6lbbfaWCrJIu5uObJlfo5Rw==",
"dependencies": {
"bigi": "^1.2.0",
"browserify-aes": "^1.0.1",
"bs58check": "<3.0.0",
"buffer-xor": "^1.0.2",
"create-hash": "^1.1.1",
"ecurve": "^1.0.0",
"safe-buffer": "~5.1.1",
"scryptsy": "^2.1.0"
}
},
"node_modules/minimal-slp-wallet/node_modules/bip38/node_modules/safe-buffer": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
"license": "MIT"
},
"node_modules/minimal-slp-wallet/node_modules/bip39": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/bip39/-/bip39-3.1.0.tgz",
"integrity": "sha512-c9kiwdk45Do5GL0vJMe7tS95VjCii65mYAH7DfWl3uW8AVzXKQVUm64i3hzVybBDMp9r7j9iNxR85+ul8MdN/A==",
"license": "ISC",
"dependencies": {
"@noble/hashes": "^1.2.0"
}
},
"node_modules/minimal-slp-wallet/node_modules/bitcoinjs-message": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/bitcoinjs-message/-/bitcoinjs-message-2.2.0.tgz",
"integrity": "sha512-103Wy3xg8Y9o+pdhGP4M3/mtQQuUWs6sPuOp1mYphSUoSMHjHTlkj32K4zxU8qMH0Ckv23emfkGlFWtoWZ7YFA==",
"license": "MIT",
"dependencies": {
"bech32": "^1.1.3",
"bs58check": "^2.1.2",
"buffer-equals": "^1.0.3",
"create-hash": "^1.1.2",
"secp256k1": "^3.0.1",
"varuint-bitcoin": "^1.0.1"
},
"engines": {
"node": ">=0.10"
}
},
"node_modules/minimal-slp-wallet/node_modules/chokidar": {
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz",
"integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==",
"license": "MIT",
"dependencies": {
"anymatch": "~3.1.2",
"braces": "~3.0.2",
"glob-parent": "~5.1.2",
"is-binary-path": "~2.1.0",
"is-glob": "~4.0.1",
"normalize-path": "~3.0.0",
"readdirp": "~3.6.0"
},
"engines": {
"node": ">= 8.10.0"
},
"funding": {
"url": "https://paulmillr.com/funding/"
},
"optionalDependencies": {
"fsevents": "~2.3.2"
}
},
"node_modules/minimal-slp-wallet/node_modules/commander": {
"version": "8.3.0",
"resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz",
"integrity": "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==",
"license": "MIT",
"engines": {
"node": ">= 12"
}
},
"node_modules/minimal-slp-wallet/node_modules/debug": {
"version": "3.2.7",
"resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz",
"integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==",
"license": "MIT",
"dependencies": {
"ms": "^2.1.1"
}
},
"node_modules/minimal-slp-wallet/node_modules/expose-loader": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/expose-loader/-/expose-loader-3.1.0.tgz",
"integrity": "sha512-2RExSo0yJiqP+xiUue13jQa2IHE8kLDzTI7b6kn+vUlBVvlzNSiLDzo4e5Pp5J039usvTUnxZ8sUOhv0Kg15NA==",
"license": "MIT",
"engines": {
"node": ">= 12.13.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/webpack"
},
"peerDependencies": {
"webpack": "^5.0.0"
}
},
"node_modules/minimal-slp-wallet/node_modules/fs-extra": {
"version": "10.1.0",
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz",
"integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==",
"license": "MIT",
"dependencies": {
"graceful-fs": "^4.2.0",
"jsonfile": "^6.0.1",
"universalify": "^2.0.0"
},
"engines": {
"node": ">=12"
}
},
"node_modules/minimal-slp-wallet/node_modules/glob-parent": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
"integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==",
"license": "ISC",
"dependencies": {
"is-glob": "^4.0.1"
},
"engines": {
"node": ">= 6"
}
},
"node_modules/minimal-slp-wallet/node_modules/has-flag": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
"integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==",
"license": "MIT",
"engines": {
"node": ">=4"
}
},
"node_modules/minimal-slp-wallet/node_modules/ini": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/ini/-/ini-6.0.0.tgz",
"integrity": "sha512-IBTdIkzZNOpqm7q3dRqJvMaldXjDHWkEDfrwGEQTs5eaQMWV+djAhR+wahyNNMAa+qpbDUhBMVt4ZKNwpPm7xQ==",
"license": "ISC",
"engines": {
"node": "^20.17.0 || >=22.9.0"
}
},
"node_modules/minimal-slp-wallet/node_modules/minimal-slp-wallet": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/minimal-slp-wallet/-/minimal-slp-wallet-6.1.0.tgz",
"integrity": "sha512-P24WzJu2kHg5aQtKkIVJ42Gu1dsYXWAc0z5MCmlinjDq11Bgy4ICBu73YxpNTB3TQwrWIIi2LJgsuQa/dqH50Q==",
"license": "MIT",
"dependencies": {
"@chris.troutner/retry-queue-commonjs": "1.0.8",
"@psf/bch-js": "6.8.1",
"apidoc": "0.51.0",
"bch-consumer": "1.6.2",
"bch-donation": "1.1.2",
"crypto-js": "4.0.0"
}
},
"node_modules/minimal-slp-wallet/node_modules/minimal-slp-wallet/node_modules/@psf/bch-js": {
"version": "6.8.1",
"resolved": "https://registry.npmjs.org/@psf/bch-js/-/bch-js-6.8.1.tgz",
"integrity": "sha512-xu5YT9L3OhdILwJUmkV7Pg/WZ3r2aA6jD7fr5WMvo0OJSzzBBbXGShIbQNZp9+Vv9BoeVLCMqpZoW1Fp7OLCbg==",
"license": "MIT",
"dependencies": {
"@chris.troutner/bip32-utils": "1.0.5",
"@psf/bip21": "2.0.1",
"@psf/bitcoincash-ops": "2.0.0",
"@psf/bitcoincashjs-lib": "4.0.3",
"@psf/coininfo": "4.0.0",
"axios": "0.26.1",
"bc-bip68": "1.0.5",
"bchaddrjs-slp": "0.2.5",
"bigi": "1.4.2",
"bignumber.js": "9.0.0",
"bip-schnorr": "0.3.0",
"bip38": "2.0.2",
"bip39": "3.0.2",
"bip66": "1.1.5",
"bitcoinjs-message": "2.0.0",
"bs58": "4.0.1",
"ecashaddrjs": "1.0.7",
"ini": "1.3.8",
"randombytes": "2.0.6",
"safe-buffer": "5.1.2",
"satoshi-bitcoin": "1.0.4",
"slp-mdm": "0.0.6",
"slp-parser": "0.0.4",
"wif": "2.0.6"
}
},
"node_modules/minimal-slp-wallet/node_modules/minimal-slp-wallet/node_modules/axios": {
"version": "0.26.1",
"resolved": "https://registry.npmjs.org/axios/-/axios-0.26.1.tgz",
"integrity": "sha512-fPwcX4EvnSHuInCMItEhAGnaSEXRBjtzh9fOtsE6E1G6p7vl7edEeZe11QHf18+6+9gR5PbKV/sGKNaD8YaMeA==",
"license": "MIT",
"dependencies": {
"follow-redirects": "^1.14.8"
}
},
"node_modules/minimal-slp-wallet/node_modules/minimal-slp-wallet/node_modules/bchaddrjs-slp": {
"version": "0.2.5",
"resolved": "https://registry.npmjs.org/bchaddrjs-slp/-/bchaddrjs-slp-0.2.5.tgz",
"integrity": "sha512-33flmPcqMFswerKu7477DSUNMVMQR3tHDk3lvbmsdkEva+TxVGGWWE/p5Lqx9M/8t3vkbe7fzmVhj4QhChcCyA==",
"license": "MIT",
"dependencies": {
"bs58check": "^2.1.2",
"cashaddrjs-slp": "^0.2.11"
},
"engines": {
"node": ">= 6.0.0"
}
},
"node_modules/minimal-slp-wallet/node_modules/minimal-slp-wallet/node_modules/bignumber.js": {
"version": "9.0.0",
"resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.0.0.tgz",
"integrity": "sha512-t/OYhhJ2SD+YGBQcjY8GzzDHEk9f3nerxjtfa6tlMXfe7frs/WozhvCNoGvpM0P3bNf3Gq5ZRMlGr5f3r4/N8A==",
"license": "MIT",
"engines": {
"node": "*"
}
},
"node_modules/minimal-slp-wallet/node_modules/minimal-slp-wallet/node_modules/bip-schnorr": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/bip-schnorr/-/bip-schnorr-0.3.0.tgz",
"integrity": "sha512-Sc1Hn2+1n+okPEW8G+JLjeaM12dsUOwr+oFlMDSKR9wYwNGMw0alskeBIHTmXxBxMZSWKhCW7PwKQVDyGmnaVg==",
"license": "MIT",
"dependencies": {
"ecurve": "^1.0.6",
"js-sha256": "^0.9.0",
"random-bytes": "^1.0.0",
"safe-buffer": "^5.0.1"
},
"engines": {
"node": ">=8.0.0"
}
},
"node_modules/minimal-slp-wallet/node_modules/minimal-slp-wallet/node_modules/bip38": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/bip38/-/bip38-2.0.2.tgz",
"integrity": "sha512-22KDak0RDyghFbR0Si7wyq9IgY423YzGYzWLpGeofH3DaolOQqjD3mNN08eFoubKlbyclOQKFwtONMv2SD9V3A==",
"dependencies": {
"bigi": "^1.2.0",
"browserify-aes": "^1.0.1",
"bs58check": "<3.0.0",
"buffer-xor": "^1.0.2",
"create-hash": "^1.1.1",
"ecurve": "^1.0.0",
"scryptsy": "^2.0.0"
}
},
"node_modules/minimal-slp-wallet/node_modules/minimal-slp-wallet/node_modules/bip39": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/bip39/-/bip39-3.0.2.tgz",
"integrity": "sha512-J4E1r2N0tUylTKt07ibXvhpT2c5pyAFgvuA5q1H9uDy6dEGpjV8jmymh3MTYJDLCNbIVClSB9FbND49I6N24MQ==",
"license": "ISC",
"dependencies": {
"@types/node": "11.11.6",
"create-hash": "^1.1.0",
"pbkdf2": "^3.0.9",
"randombytes": "^2.0.1"
}
},
"node_modules/minimal-slp-wallet/node_modules/minimal-slp-wallet/node_modules/bitcoinjs-message": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/bitcoinjs-message/-/bitcoinjs-message-2.0.0.tgz",
"integrity": "sha512-H5pJC7/eSqVjREiEOZ4jifX+7zXYP3Y28GIOIqg9hrgE7Vj8Eva9+HnVqnxwA1rJPOwZKuw0vo6k0UxgVc6q1A==",
"license": "MIT",
"dependencies": {
"bs58check": "^2.0.2",
"buffer-equals": "^1.0.3",
"create-hash": "^1.1.2",
"secp256k1": "^3.0.1",
"varuint-bitcoin": "^1.0.1"
},
"engines": {
"node": ">=0.10"
}
},
"node_modules/minimal-slp-wallet/node_modules/minimal-slp-wallet/node_modules/ini": {
"version": "1.3.8",
"resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz",
"integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==",
"license": "ISC"
},
"node_modules/minimal-slp-wallet/node_modules/minimal-slp-wallet/node_modules/randombytes": {
"version": "2.0.6",
"resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.0.6.tgz",
"integrity": "sha512-CIQ5OFxf4Jou6uOKe9t1AOgqpeU5fd70A8NPdHSGeYXqXsPe6peOwI0cUl88RWZ6sP1vPMV3avd/R6cZ5/sP1A==",
"license": "MIT",
"dependencies": {
"safe-buffer": "^5.1.0"
}
},
"node_modules/minimal-slp-wallet/node_modules/minimal-slp-wallet/node_modules/safe-buffer": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
"license": "MIT"
},
"node_modules/minimal-slp-wallet/node_modules/minimal-slp-wallet/node_modules/satoshi-bitcoin": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/satoshi-bitcoin/-/satoshi-bitcoin-1.0.4.tgz",
"integrity": "sha512-YuHOmw5wsz6wuHIQdsz5b2cgtuKtV/jEcZ4NGmWN5tM/gz5T9Q+DSuLlnuf5BP/jsQWgR0ofmY4f8Dm6JnqSug==",
"license": "MIT",
"dependencies": {
"big.js": "^3.1.3"
}
},
"node_modules/minimal-slp-wallet/node_modules/minimal-slp-wallet/node_modules/slp-mdm": {
"version": "0.0.6",
"resolved": "https://registry.npmjs.org/slp-mdm/-/slp-mdm-0.0.6.tgz",
"integrity": "sha512-fbjlIg/o8OtzgK2JydC6POJp3Qup/rLgy4yB5hoLgxWRlERyJyE29ScwS3r9TTwPxe12qK55pyivAdNOZZXL0A==",
"license": "MIT",
"dependencies": {
"bignumber.js": "^9.0.0"
}
},
"node_modules/minimal-slp-wallet/node_modules/nodemon": {
"version": "2.0.22",
"resolved": "https://registry.npmjs.org/nodemon/-/nodemon-2.0.22.tgz",
"integrity": "sha512-B8YqaKMmyuCO7BowF1Z1/mkPqLk6cs/l63Ojtd6otKjMx47Dq1utxfRxcavH1I7VSaL8n5BUaoutadnsX3AAVQ==",
"license": "MIT",
"dependencies": {
"chokidar": "^3.5.2",
"debug": "^3.2.7",
"ignore-by-default": "^1.0.1",
"minimatch": "^3.1.2",
"pstree.remy": "^1.1.8",
"semver": "^5.7.1",
"simple-update-notifier": "^1.0.7",
"supports-color": "^5.5.0",
"touch": "^3.1.0",
"undefsafe": "^2.0.5"
},
"bin": {
"nodemon": "bin/nodemon.js"
},
"engines": {
"node": ">=8.10.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/nodemon"
}
},
"node_modules/minimal-slp-wallet/node_modules/nodemon/node_modules/semver": {
"version": "5.7.2",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz",
"integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==",
"license": "ISC",
"bin": {
"semver": "bin/semver"
}
},
"node_modules/minimal-slp-wallet/node_modules/path-to-regexp": {
"version": "6.3.0",
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.3.0.tgz",
"integrity": "sha512-Yhpw4T9C6hPpgPeA28us07OJeqZ5EzQTkbfwuhsUg0c237RomFoETJgmp2sa3F/41gfLE6G5cqcYwznmeEeOlQ==",
"license": "MIT"
},
"node_modules/minimal-slp-wallet/node_modules/readdirp": {
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz",
"integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==",
"license": "MIT",
"dependencies": {
"picomatch": "^2.2.1"
},
"engines": {
"node": ">=8.10.0"
}
},
"node_modules/minimal-slp-wallet/node_modules/satoshi-bitcoin": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/satoshi-bitcoin/-/satoshi-bitcoin-1.0.5.tgz",
"integrity": "sha512-iCUOSe8yTOqetYcj/n4ziv0psqRMRZT4+YhcMrQIYpjnx3Pgn9uiTlaUItNMMB/0sldINEGkJvxwTW55OfrYPg==",
"license": "MIT",
"dependencies": {
"big.js": "^3.1.3"
}
},
"node_modules/minimal-slp-wallet/node_modules/simple-update-notifier": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-1.1.0.tgz",
"integrity": "sha512-VpsrsJSUcJEseSbMHkrsrAVSdvVS5I96Qo1QAQ4FxQ9wXFcB+pjj7FB7/us9+GcgfW4ziHtYMc1J0PLczb55mg==",
"license": "MIT",
"dependencies": {
"semver": "~7.0.0"
},
"engines": {
"node": ">=8.10.0"
}
},
"node_modules/minimal-slp-wallet/node_modules/simple-update-notifier/node_modules/semver": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.0.0.tgz",
"integrity": "sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A==",
"license": "ISC",
"bin": {
"semver": "bin/semver.js"
}
},
"node_modules/minimal-slp-wallet/node_modules/slp-mdm": {
"version": "0.0.7",
"resolved": "https://registry.npmjs.org/slp-mdm/-/slp-mdm-0.0.7.tgz",
"integrity": "sha512-XlnDS7y8fnEt9I5lw/GqcrDjTGw5vZon83xlliLyihz2EvjE135ubIBzq4bmjVOrM669G9A6bkqEp5Y1trPV3A==",
"license": "MIT",
"dependencies": {
"bignumber.js": "^9.0.0"
}
},
"node_modules/minimal-slp-wallet/node_modules/supports-color": {
"version": "5.5.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
"integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
"license": "MIT",
"dependencies": {
"has-flag": "^3.0.0"
},
"engines": {
"node": ">=4"
}
},
"node_modules/minimal-slp-wallet/node_modules/x402-bch-axios": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/x402-bch-axios/-/x402-bch-axios-1.1.1.tgz",
"integrity": "sha512-jQ0AyjAzvyTw7ejTTvUSIQiH8//wVn/SRwSgcJ3LeM38SJlJWpTMvvNpOpcjcZ+kFKOe4SsurOy/AcH7o+akjQ==",
"license": "MIT",
"dependencies": {
"@chris.troutner/retry-queue": "1.0.11",
"minimal-slp-wallet": "6.1.0"
}
},
"node_modules/minimalistic-assert": { "node_modules/minimalistic-assert": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz",
@@ -9999,307 +10576,13 @@
"license": "ISC" "license": "ISC"
}, },
"node_modules/x402-bch-axios": { "node_modules/x402-bch-axios": {
"version": "1.1.1", "version": "1.1.2",
"resolved": "https://registry.npmjs.org/x402-bch-axios/-/x402-bch-axios-1.1.1.tgz", "resolved": "https://registry.npmjs.org/x402-bch-axios/-/x402-bch-axios-1.1.2.tgz",
"integrity": "sha512-jQ0AyjAzvyTw7ejTTvUSIQiH8//wVn/SRwSgcJ3LeM38SJlJWpTMvvNpOpcjcZ+kFKOe4SsurOy/AcH7o+akjQ==", "integrity": "sha512-HG44zvQZJDHIjLN79ZCubFdMDpanhGJT+n5iyIyy6ni8S2bLDwKJeAyqhNMlTIPKjcZD9JLyyxU6iWtqxjUXOw==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@chris.troutner/retry-queue": "1.0.11", "@chris.troutner/retry-queue": "1.0.11",
"minimal-slp-wallet": "6.1.0" "minimal-slp-wallet": "7.0.2"
}
},
"node_modules/x402-bch-axios/node_modules/@psf/bch-js": {
"version": "6.8.1",
"resolved": "https://registry.npmjs.org/@psf/bch-js/-/bch-js-6.8.1.tgz",
"integrity": "sha512-xu5YT9L3OhdILwJUmkV7Pg/WZ3r2aA6jD7fr5WMvo0OJSzzBBbXGShIbQNZp9+Vv9BoeVLCMqpZoW1Fp7OLCbg==",
"license": "MIT",
"dependencies": {
"@chris.troutner/bip32-utils": "1.0.5",
"@psf/bip21": "2.0.1",
"@psf/bitcoincash-ops": "2.0.0",
"@psf/bitcoincashjs-lib": "4.0.3",
"@psf/coininfo": "4.0.0",
"axios": "0.26.1",
"bc-bip68": "1.0.5",
"bchaddrjs-slp": "0.2.5",
"bigi": "1.4.2",
"bignumber.js": "9.0.0",
"bip-schnorr": "0.3.0",
"bip38": "2.0.2",
"bip39": "3.0.2",
"bip66": "1.1.5",
"bitcoinjs-message": "2.0.0",
"bs58": "4.0.1",
"ecashaddrjs": "1.0.7",
"ini": "1.3.8",
"randombytes": "2.0.6",
"safe-buffer": "5.1.2",
"satoshi-bitcoin": "1.0.4",
"slp-mdm": "0.0.6",
"slp-parser": "0.0.4",
"wif": "2.0.6"
}
},
"node_modules/x402-bch-axios/node_modules/apidoc": {
"version": "0.51.0",
"resolved": "https://registry.npmjs.org/apidoc/-/apidoc-0.51.0.tgz",
"integrity": "sha512-3P4srhm6NA+kE/YRM4qL5jESElpQQJL+Z8n7hyr4uC+1DSwGzmE6adXPVxuT/hpDyShrqmRlHk8hf40RSqEsNw==",
"license": "MIT",
"os": [
"darwin",
"freebsd",
"linux",
"openbsd",
"win32"
],
"dependencies": {
"bootstrap": "3.4.1",
"commander": "^8.3.0",
"diff-match-patch": "^1.0.5",
"esbuild-loader": "^2.16.0",
"expose-loader": "^3.1.0",
"fs-extra": "^10.0.0",
"glob": "^7.2.0",
"handlebars": "^4.7.7",
"iconv-lite": "^0.6.3",
"jquery": "^3.6.0",
"klaw-sync": "^6.0.0",
"lodash": "^4.17.21",
"markdown-it": "^12.2.0",
"nodemon": "^2.0.15",
"path-to-regexp": "^6.2.0",
"prismjs": "^1.25.0",
"semver": "^7.3.5",
"style-loader": "^3.3.1",
"url-parse": "^1.5.3",
"webpack": "^5.64.2",
"webpack-cli": "^4.9.1",
"winston": "^3.3.3"
},
"bin": {
"apidoc": "bin/apidoc"
},
"engines": {
"node": ">=14.0.0"
}
},
"node_modules/x402-bch-axios/node_modules/axios": {
"version": "0.26.1",
"resolved": "https://registry.npmjs.org/axios/-/axios-0.26.1.tgz",
"integrity": "sha512-fPwcX4EvnSHuInCMItEhAGnaSEXRBjtzh9fOtsE6E1G6p7vl7edEeZe11QHf18+6+9gR5PbKV/sGKNaD8YaMeA==",
"license": "MIT",
"dependencies": {
"follow-redirects": "^1.14.8"
}
},
"node_modules/x402-bch-axios/node_modules/chokidar": {
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz",
"integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==",
"license": "MIT",
"dependencies": {
"anymatch": "~3.1.2",
"braces": "~3.0.2",
"glob-parent": "~5.1.2",
"is-binary-path": "~2.1.0",
"is-glob": "~4.0.1",
"normalize-path": "~3.0.0",
"readdirp": "~3.6.0"
},
"engines": {
"node": ">= 8.10.0"
},
"funding": {
"url": "https://paulmillr.com/funding/"
},
"optionalDependencies": {
"fsevents": "~2.3.2"
}
},
"node_modules/x402-bch-axios/node_modules/commander": {
"version": "8.3.0",
"resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz",
"integrity": "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==",
"license": "MIT",
"engines": {
"node": ">= 12"
}
},
"node_modules/x402-bch-axios/node_modules/debug": {
"version": "3.2.7",
"resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz",
"integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==",
"license": "MIT",
"dependencies": {
"ms": "^2.1.1"
}
},
"node_modules/x402-bch-axios/node_modules/expose-loader": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/expose-loader/-/expose-loader-3.1.0.tgz",
"integrity": "sha512-2RExSo0yJiqP+xiUue13jQa2IHE8kLDzTI7b6kn+vUlBVvlzNSiLDzo4e5Pp5J039usvTUnxZ8sUOhv0Kg15NA==",
"license": "MIT",
"engines": {
"node": ">= 12.13.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/webpack"
},
"peerDependencies": {
"webpack": "^5.0.0"
}
},
"node_modules/x402-bch-axios/node_modules/fs-extra": {
"version": "10.1.0",
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz",
"integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==",
"license": "MIT",
"dependencies": {
"graceful-fs": "^4.2.0",
"jsonfile": "^6.0.1",
"universalify": "^2.0.0"
},
"engines": {
"node": ">=12"
}
},
"node_modules/x402-bch-axios/node_modules/glob-parent": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
"integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==",
"license": "ISC",
"dependencies": {
"is-glob": "^4.0.1"
},
"engines": {
"node": ">= 6"
}
},
"node_modules/x402-bch-axios/node_modules/has-flag": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
"integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==",
"license": "MIT",
"engines": {
"node": ">=4"
}
},
"node_modules/x402-bch-axios/node_modules/minimal-slp-wallet": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/minimal-slp-wallet/-/minimal-slp-wallet-6.1.0.tgz",
"integrity": "sha512-P24WzJu2kHg5aQtKkIVJ42Gu1dsYXWAc0z5MCmlinjDq11Bgy4ICBu73YxpNTB3TQwrWIIi2LJgsuQa/dqH50Q==",
"license": "MIT",
"dependencies": {
"@chris.troutner/retry-queue-commonjs": "1.0.8",
"@psf/bch-js": "6.8.1",
"apidoc": "0.51.0",
"bch-consumer": "1.6.2",
"bch-donation": "1.1.2",
"crypto-js": "4.0.0"
}
},
"node_modules/x402-bch-axios/node_modules/nodemon": {
"version": "2.0.22",
"resolved": "https://registry.npmjs.org/nodemon/-/nodemon-2.0.22.tgz",
"integrity": "sha512-B8YqaKMmyuCO7BowF1Z1/mkPqLk6cs/l63Ojtd6otKjMx47Dq1utxfRxcavH1I7VSaL8n5BUaoutadnsX3AAVQ==",
"license": "MIT",
"dependencies": {
"chokidar": "^3.5.2",
"debug": "^3.2.7",
"ignore-by-default": "^1.0.1",
"minimatch": "^3.1.2",
"pstree.remy": "^1.1.8",
"semver": "^5.7.1",
"simple-update-notifier": "^1.0.7",
"supports-color": "^5.5.0",
"touch": "^3.1.0",
"undefsafe": "^2.0.5"
},
"bin": {
"nodemon": "bin/nodemon.js"
},
"engines": {
"node": ">=8.10.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/nodemon"
}
},
"node_modules/x402-bch-axios/node_modules/nodemon/node_modules/semver": {
"version": "5.7.2",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz",
"integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==",
"license": "ISC",
"bin": {
"semver": "bin/semver"
}
},
"node_modules/x402-bch-axios/node_modules/path-to-regexp": {
"version": "6.3.0",
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.3.0.tgz",
"integrity": "sha512-Yhpw4T9C6hPpgPeA28us07OJeqZ5EzQTkbfwuhsUg0c237RomFoETJgmp2sa3F/41gfLE6G5cqcYwznmeEeOlQ==",
"license": "MIT"
},
"node_modules/x402-bch-axios/node_modules/randombytes": {
"version": "2.0.6",
"resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.0.6.tgz",
"integrity": "sha512-CIQ5OFxf4Jou6uOKe9t1AOgqpeU5fd70A8NPdHSGeYXqXsPe6peOwI0cUl88RWZ6sP1vPMV3avd/R6cZ5/sP1A==",
"license": "MIT",
"dependencies": {
"safe-buffer": "^5.1.0"
}
},
"node_modules/x402-bch-axios/node_modules/readdirp": {
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz",
"integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==",
"license": "MIT",
"dependencies": {
"picomatch": "^2.2.1"
},
"engines": {
"node": ">=8.10.0"
}
},
"node_modules/x402-bch-axios/node_modules/safe-buffer": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
"license": "MIT"
},
"node_modules/x402-bch-axios/node_modules/simple-update-notifier": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-1.1.0.tgz",
"integrity": "sha512-VpsrsJSUcJEseSbMHkrsrAVSdvVS5I96Qo1QAQ4FxQ9wXFcB+pjj7FB7/us9+GcgfW4ziHtYMc1J0PLczb55mg==",
"license": "MIT",
"dependencies": {
"semver": "~7.0.0"
},
"engines": {
"node": ">=8.10.0"
}
},
"node_modules/x402-bch-axios/node_modules/simple-update-notifier/node_modules/semver": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.0.0.tgz",
"integrity": "sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A==",
"license": "ISC",
"bin": {
"semver": "bin/semver.js"
}
},
"node_modules/x402-bch-axios/node_modules/supports-color": {
"version": "5.5.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
"integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
"license": "MIT",
"dependencies": {
"has-flag": "^3.0.0"
},
"engines": {
"node": ">=4"
} }
}, },
"node_modules/x402-bch-express": { "node_modules/x402-bch-express": {
+2 -2
View File
@@ -15,12 +15,12 @@
"license": "MIT", "license": "MIT",
"description": "REST API proxy to Bitcoin Cash infrastructure", "description": "REST API proxy to Bitcoin Cash infrastructure",
"dependencies": { "dependencies": {
"@psf/bch-js": "7.1.0", "@psf/bch-js": "7.1.2",
"axios": "1.7.7", "axios": "1.7.7",
"cors": "2.8.5", "cors": "2.8.5",
"dotenv": "16.3.1", "dotenv": "16.3.1",
"express": "5.1.0", "express": "5.1.0",
"minimal-slp-wallet": "7.0.1", "minimal-slp-wallet": "7.0.2",
"psffpp": "1.2.1", "psffpp": "1.2.1",
"slp-token-media": "1.2.10", "slp-token-media": "1.2.10",
"winston": "3.11.0", "winston": "3.11.0",
@@ -9,10 +9,10 @@ RPC_PASSWORD=password
FULCRUM_API=http://172.17.0.1:3001/v1 FULCRUM_API=http://172.17.0.1:3001/v1
# SLP Indexer # SLP Indexer
SLP_INDEXER_API=http://localhost:5010 SLP_INDEXER_API=http://172.17.0.1:5010
# REST API URL for wallet operations # REST API URL for wallet operations
LOCAL_RESTURL=http://localhost:5942/v6 LOCAL_RESTURL=http://172.17.0.1:5942/v6
# END INFRASTRUCTURE SETUP # END INFRASTRUCTURE SETUP
@@ -25,6 +25,7 @@ PORT=5942
X402_ENABLED=true X402_ENABLED=true
SERVER_BCH_ADDRESS=bitcoincash:qqlrzp23w08434twmvr4fxw672whkjy0py26r63g3d SERVER_BCH_ADDRESS=bitcoincash:qqlrzp23w08434twmvr4fxw672whkjy0py26r63g3d
FACILITATOR_URL=http://localhost:4345/facilitator FACILITATOR_URL=http://localhost:4345/facilitator
X402_PRICE_SAT=200
# Basic Authentication required to access this API? # Basic Authentication required to access this API?
USE_BASIC_AUTH=true USE_BASIC_AUTH=true
+2 -2
View File
@@ -26,10 +26,10 @@ const normalizeBoolean = (value, defaultValue) => {
return defaultValue return defaultValue
} }
// By default, the price per API call is 2000 satoshis. // By default, the price per API call is 200 satoshis.
// But the user can override this value by setting the X402_PRICE_SAT environment variable. // But the user can override this value by setting the X402_PRICE_SAT environment variable.
const parsedPriceSat = Number(process.env.X402_PRICE_SAT) const parsedPriceSat = Number(process.env.X402_PRICE_SAT)
const priceSat = Number.isFinite(parsedPriceSat) && parsedPriceSat > 0 ? parsedPriceSat : 2000 const priceSat = Number.isFinite(parsedPriceSat) && parsedPriceSat > 0 ? parsedPriceSat : 200
const x402Defaults = { const x402Defaults = {
enabled: normalizeBoolean(process.env.X402_ENABLED, true), enabled: normalizeBoolean(process.env.X402_ENABLED, true),
+1 -1
View File
@@ -26,7 +26,7 @@ export function buildX402Routes (apiPrefix = '/v6') {
price: config.x402.priceSat, price: config.x402.priceSat,
network: NETWORK, network: NETWORK,
config: { config: {
description: `${DEFAULT_DESCRIPTION} (2000 satoshis)`, description: `${DEFAULT_DESCRIPTION} (${config.x402.priceSat} satoshis)`,
maxTimeoutSeconds: DEFAULT_TIMEOUT_SECONDS maxTimeoutSeconds: DEFAULT_TIMEOUT_SECONDS
} }
} }
+4 -1
View File
@@ -6,7 +6,10 @@ import wlogger from '../adapters/wlogger.js'
import BCHJS from '@psf/bch-js' import BCHJS from '@psf/bch-js'
import config from '../config/index.js' import config from '../config/index.js'
const bchjs = new BCHJS({ restURL: config.restURL }) const bchjs = new BCHJS({
restURL: config.restURL,
bearerToken: config.basicAuth.token
})
class FulcrumUseCases { class FulcrumUseCases {
constructor (localConfig = {}) { constructor (localConfig = {}) {