@bsv/wallet-toolbox 1.7.9 → 1.7.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bsv/wallet-toolbox",
3
- "version": "1.7.9",
3
+ "version": "1.7.11",
4
4
  "description": "BRC100 conforming wallet, wallet storage and wallet signer components",
5
5
  "main": "./out/src/index.js",
6
6
  "types": "./out/src/index.d.ts",
@@ -272,9 +272,14 @@ export class StorageKnex extends StorageProvider implements WalletStorageProvide
272
272
 
273
273
  override async insertCertificate(certificate: TableCertificateX, trx?: TrxToken): Promise<number> {
274
274
  const e = await this.validateEntityForInsert(certificate, trx, undefined, ['isDeleted'])
275
+ if (e.certificateId === 0) delete e.certificateId
276
+
277
+ const logger = e.logger
278
+ if (e.logger) delete e.logger
279
+
275
280
  const fields = e.fields
276
281
  if (e.fields) delete e.fields
277
- if (e.certificateId === 0) delete e.certificateId
282
+
278
283
  const [id] = await this.toDb(trx)<TableCertificate>('certificates').insert(e)
279
284
  certificate.certificateId = id
280
285
 
@@ -49,21 +49,6 @@ export class StorageServer {
49
49
  }
50
50
 
51
51
  private setupRoutes(): void {
52
- this.app.use((req: Request, res: Response, next) => {
53
- // Silently 200 any POST to exactly the root that looks like a crawler probe
54
- if (
55
- req.method === 'POST' &&
56
- req.path === '/' &&
57
- (
58
- !req.headers['content-type']?.includes('application/json') ||
59
- req.headers['content-length'] === '0' ||
60
- (req.headers['content-length'] && Number(req.headers['content-length']) < 50)
61
- )
62
- ) {
63
- return res.status(200).json({ jsonrpc: '2.0', result: null, id: null })
64
- }
65
- next()
66
- })
67
52
 
68
53
  this.app.use(express.json({ limit: '30mb' }))
69
54