Merge branch 'master' into clink-types
This commit is contained in:
commit
e3cbae9af9
4 changed files with 44 additions and 26 deletions
51
package-lock.json
generated
51
package-lock.json
generated
|
|
@ -28,7 +28,7 @@
|
|||
"csv": "^6.3.8",
|
||||
"dotenv": "^16.4.5",
|
||||
"eccrypto": "^1.1.6",
|
||||
"express": "^4.21.1",
|
||||
"express": "^4.21.2",
|
||||
"globby": "^13.1.2",
|
||||
"grpc-tools": "^1.12.4",
|
||||
"jsonwebtoken": "^9.0.2",
|
||||
|
|
@ -38,14 +38,14 @@
|
|||
"reflect-metadata": "^0.2.2",
|
||||
"rimraf": "^3.0.2",
|
||||
"rxjs": "^7.5.5",
|
||||
"secp256k1": "^4.0.4",
|
||||
"secp256k1": "^5.0.1",
|
||||
"sqlite3": "^5.1.7",
|
||||
"ts-node": "^10.7.0",
|
||||
"ts-proto": "^1.131.2",
|
||||
"typeorm": "0.3.15",
|
||||
"typescript": "^5.5.4",
|
||||
"uuid": "^8.3.2",
|
||||
"websocket": "^1.0.34",
|
||||
"websocket": "^1.0.35",
|
||||
"websocket-polyfill": "^0.0.3",
|
||||
"why-is-node-running": "^3.2.0",
|
||||
"wrtc": "^0.4.7",
|
||||
|
|
@ -62,7 +62,7 @@
|
|||
"@types/node": "^16.11.10",
|
||||
"@types/node-fetch": "^2.6.3",
|
||||
"@types/uuid": "^8.3.4",
|
||||
"@types/websocket": "^1.0.6",
|
||||
"@types/websocket": "^1.0.10",
|
||||
"@types/ws": "^8.5.12",
|
||||
"nodemon": "^2.0.20",
|
||||
"ts-node": "10.7.0",
|
||||
|
|
@ -1023,10 +1023,11 @@
|
|||
"dev": true
|
||||
},
|
||||
"node_modules/@types/websocket": {
|
||||
"version": "1.0.6",
|
||||
"resolved": "https://registry.npmjs.org/@types/websocket/-/websocket-1.0.6.tgz",
|
||||
"integrity": "sha512-JXkliwz93B2cMWOI1ukElQBPN88vMg3CruvW4KVSKpflt3NyNCJImnhIuB/f97rG7kakqRJGFiwkA895Kn02Dg==",
|
||||
"version": "1.0.10",
|
||||
"resolved": "https://registry.npmjs.org/@types/websocket/-/websocket-1.0.10.tgz",
|
||||
"integrity": "sha512-svjGZvPB7EzuYS94cI7a+qhwgGU1y89wUgjT6E2wVUfmAGIvRfT7obBvRtnhXCSsoMdlG4gBFGE7MfkIXZLoww==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/node": "*"
|
||||
}
|
||||
|
|
@ -2811,9 +2812,10 @@
|
|||
}
|
||||
},
|
||||
"node_modules/express": {
|
||||
"version": "4.21.1",
|
||||
"resolved": "https://registry.npmjs.org/express/-/express-4.21.1.tgz",
|
||||
"integrity": "sha512-YSFlK1Ee0/GC8QaO91tHcDxJiE/X4FbpAyQWkxAvG6AXCuR65YzK8ua6D9hvi/TzUfZMpc+BwuM1IPw8fmQBiQ==",
|
||||
"version": "4.21.2",
|
||||
"resolved": "https://registry.npmjs.org/express/-/express-4.21.2.tgz",
|
||||
"integrity": "sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"accepts": "~1.3.8",
|
||||
"array-flatten": "1.1.1",
|
||||
|
|
@ -2834,7 +2836,7 @@
|
|||
"methods": "~1.1.2",
|
||||
"on-finished": "2.4.1",
|
||||
"parseurl": "~1.3.3",
|
||||
"path-to-regexp": "0.1.10",
|
||||
"path-to-regexp": "0.1.12",
|
||||
"proxy-addr": "~2.0.7",
|
||||
"qs": "6.13.0",
|
||||
"range-parser": "~1.2.1",
|
||||
|
|
@ -2849,6 +2851,10 @@
|
|||
},
|
||||
"engines": {
|
||||
"node": ">= 0.10.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/express"
|
||||
}
|
||||
},
|
||||
"node_modules/express/node_modules/encodeurl": {
|
||||
|
|
@ -4717,9 +4723,10 @@
|
|||
}
|
||||
},
|
||||
"node_modules/path-to-regexp": {
|
||||
"version": "0.1.10",
|
||||
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.10.tgz",
|
||||
"integrity": "sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w=="
|
||||
"version": "0.1.12",
|
||||
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz",
|
||||
"integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/path-type": {
|
||||
"version": "4.0.0",
|
||||
|
|
@ -5292,10 +5299,11 @@
|
|||
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
|
||||
},
|
||||
"node_modules/secp256k1": {
|
||||
"version": "4.0.4",
|
||||
"resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.4.tgz",
|
||||
"integrity": "sha512-6JfvwvjUOn8F/jUoBY2Q1v5WY5XS+rj8qSe0v8Y4ezH4InLgTEeOOPQsRll9OV429Pvo6BCHGavIyJfr3TAhsw==",
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-5.0.1.tgz",
|
||||
"integrity": "sha512-lDFs9AAIaWP9UCdtWrotXWWF9t8PWgQDcxqgAnpM9rMqxb3Oaq2J0thzPVSxBwdJgyQtkU/sYtFtbM1RSt/iYA==",
|
||||
"hasInstallScript": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"elliptic": "^6.5.7",
|
||||
"node-addon-api": "^5.0.0",
|
||||
|
|
@ -6549,13 +6557,14 @@
|
|||
"integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ=="
|
||||
},
|
||||
"node_modules/websocket": {
|
||||
"version": "1.0.34",
|
||||
"resolved": "https://registry.npmjs.org/websocket/-/websocket-1.0.34.tgz",
|
||||
"integrity": "sha512-PRDso2sGwF6kM75QykIesBijKSVceR6jL2G8NGYyq2XrItNC2P5/qL5XeR056GhA+Ly7JMFvJb9I312mJfmqnQ==",
|
||||
"version": "1.0.35",
|
||||
"resolved": "https://registry.npmjs.org/websocket/-/websocket-1.0.35.tgz",
|
||||
"integrity": "sha512-/REy6amwPZl44DDzvRCkaI1q1bIiQB0mEFQLUrhz3z2EK91cp3n72rAjUlrTP0zV22HJIUOVHQGPxhFRjxjt+Q==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"bufferutil": "^4.0.1",
|
||||
"debug": "^2.2.0",
|
||||
"es5-ext": "^0.10.50",
|
||||
"es5-ext": "^0.10.63",
|
||||
"typedarray-to-buffer": "^3.1.5",
|
||||
"utf-8-validate": "^5.0.2",
|
||||
"yaeti": "^0.0.6"
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@
|
|||
"csv": "^6.3.8",
|
||||
"dotenv": "^16.4.5",
|
||||
"eccrypto": "^1.1.6",
|
||||
"express": "^4.21.1",
|
||||
"express": "^4.21.2",
|
||||
"globby": "^13.1.2",
|
||||
"grpc-tools": "^1.12.4",
|
||||
"jsonwebtoken": "^9.0.2",
|
||||
|
|
@ -55,14 +55,14 @@
|
|||
"reflect-metadata": "^0.2.2",
|
||||
"rimraf": "^3.0.2",
|
||||
"rxjs": "^7.5.5",
|
||||
"secp256k1": "^4.0.4",
|
||||
"secp256k1": "^5.0.1",
|
||||
"sqlite3": "^5.1.7",
|
||||
"ts-node": "^10.7.0",
|
||||
"ts-proto": "^1.131.2",
|
||||
"typeorm": "0.3.15",
|
||||
"typescript": "^5.5.4",
|
||||
"uuid": "^8.3.2",
|
||||
"websocket": "^1.0.34",
|
||||
"websocket": "^1.0.35",
|
||||
"websocket-polyfill": "^0.0.3",
|
||||
"why-is-node-running": "^3.2.0",
|
||||
"wrtc": "^0.4.7",
|
||||
|
|
@ -79,7 +79,7 @@
|
|||
"@types/node": "^16.11.10",
|
||||
"@types/node-fetch": "^2.6.3",
|
||||
"@types/uuid": "^8.3.4",
|
||||
"@types/websocket": "^1.0.6",
|
||||
"@types/websocket": "^1.0.10",
|
||||
"@types/ws": "^8.5.12",
|
||||
"nodemon": "^2.0.20",
|
||||
"ts-node": "10.7.0",
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ const start = async () => {
|
|||
{ ...nostrSettings, apps, clients: [liquidityProviderInfo] },
|
||||
(e, p) => mainHandler.liquidityProvider.onEvent(e, p)
|
||||
)
|
||||
exitHandler(() => { Stop() })
|
||||
exitHandler(() => { Stop(); mainHandler.Stop() })
|
||||
log("starting server")
|
||||
mainHandler.attachNostrSend(Send)
|
||||
mainHandler.attachNostrProcessPing(Ping)
|
||||
|
|
|
|||
|
|
@ -191,6 +191,14 @@ export class OfferManager {
|
|||
if (!userOffer) {
|
||||
return this.HandleDefaultUserOffer(offerReq, appId, remote)
|
||||
}
|
||||
if (userOffer.app_user_id === userOffer.offer_id) {
|
||||
if (userOffer.price_sats !== 0 || userOffer.expected_data) {
|
||||
this.logger("default offer has custom price or expected data, resetting")
|
||||
await this.storage.offerStorage.UpdateUserOffer(userOffer.app_user_id, userOffer.offer_id, { price_sats: 0, expected_data: null })
|
||||
userOffer.price_sats = 0
|
||||
userOffer.expected_data = null
|
||||
}
|
||||
}
|
||||
let amt = userOffer.price_sats
|
||||
if (userOffer.price_sats === 0) {
|
||||
if (!amount || isNaN(amount) || amount < 10 || amount > remote) {
|
||||
|
|
@ -200,6 +208,7 @@ export class OfferManager {
|
|||
}
|
||||
const { passed, validated } = this.ValidateExpectedData(userOffer, offerReq.payer_data)
|
||||
if (!passed) {
|
||||
console.log("Invalid expected data", validated)
|
||||
return { success: false, code: 1, max: remote }
|
||||
}
|
||||
const res = await this.applicationManager.AddAppUserInvoice(appId, {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue