@bsv/wallet-toolbox 1.6.29 → 1.6.30

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.6.29",
3
+ "version": "1.6.30",
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",
@@ -1,5 +1,6 @@
1
1
  import { defaultHttpClient, HttpClient } from '@bsv/sdk'
2
2
  import { ChaintracksFetchApi } from '../Api/ChaintracksFetchApi'
3
+ import { wait } from '../../../../utility/utilityHelpers'
3
4
 
4
5
  /**
5
6
  * This class implements the ChaintracksFetchApi
@@ -34,11 +35,19 @@ export class ChaintracksFetch implements ChaintracksFetchApi {
34
35
  Accept: 'application/json'
35
36
  }
36
37
  }
37
- const response = await fetch(url, requestJsonOptions)
38
- if (!response.ok) {
39
- throw new Error(`Failed to fetch JSON from ${url}: ${response.statusText}`)
38
+ let json: R
39
+ for (let retry = 0; ; retry++) {
40
+ const response = await fetch(url, requestJsonOptions)
41
+ if (!response.ok) {
42
+ if (response.statusText === 'Too Many Requests' && retry < 3) {
43
+ await wait(1000 * (retry + 1))
44
+ continue
45
+ }
46
+ throw new Error(`Failed to fetch JSON from ${url}: ${response.statusText}`)
47
+ }
48
+ json = (await response.json()) as R
49
+ break;
40
50
  }
41
- const json = (await response.json()) as R
42
51
  return json
43
52
  }
44
53
 
@@ -73,6 +73,19 @@ export class KnexMigrations implements MigrationSource<string> {
73
73
  }
74
74
  }
75
75
 
76
+ migrations['2025-10-18-002 add proven_tx_reqs txid index'] = {
77
+ async up(knex) {
78
+ await knex.schema.alterTable('proven_tx_reqs', table => {
79
+ table.index('txid')
80
+ })
81
+ },
82
+ async down(knex) {
83
+ await knex.schema.alterTable('proven_tx_reqs', table => {
84
+ table.dropIndex('txid')
85
+ })
86
+ }
87
+ }
88
+
76
89
  migrations['2025-10-18-001 add transactions txid index'] = {
77
90
  async up(knex) {
78
91
  await knex.schema.alterTable('transactions', table => {
@@ -61,7 +61,8 @@ describe('KnexMigrations tests', () => {
61
61
  const latest = await KnexMigrations.latestMigration()
62
62
  await knex.migrate.latest(config)
63
63
  const version = await knex.migrate.currentVersion(config)
64
- expect(version).toBe(latest)
64
+
65
+ expect(version).toBe(latest.split('_')[0])
65
66
  }
66
67
  done1 = true
67
68
  })