@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/CHANGELOG.md +5 -1
- package/mobile/out/src/services/chaintracker/chaintracks/util/ChaintracksFetch.d.ts.map +1 -1
- package/mobile/out/src/services/chaintracker/chaintracks/util/ChaintracksFetch.js +13 -4
- package/mobile/out/src/services/chaintracker/chaintracks/util/ChaintracksFetch.js.map +1 -1
- package/mobile/package-lock.json +2 -2
- package/mobile/package.json +1 -1
- package/out/src/services/chaintracker/chaintracks/util/ChaintracksFetch.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/util/ChaintracksFetch.js +13 -4
- package/out/src/services/chaintracker/chaintracks/util/ChaintracksFetch.js.map +1 -1
- package/out/src/storage/schema/KnexMigrations.d.ts.map +1 -1
- package/out/src/storage/schema/KnexMigrations.js +12 -0
- package/out/src/storage/schema/KnexMigrations.js.map +1 -1
- package/out/test/storage/KnexMigrations.test.js +1 -1
- package/out/test/storage/KnexMigrations.test.js.map +1 -1
- package/out/tsconfig.all.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/services/chaintracker/chaintracks/util/ChaintracksFetch.ts +13 -4
- package/src/storage/schema/KnexMigrations.ts +13 -0
- package/test/storage/KnexMigrations.test.ts +2 -1
package/package.json
CHANGED
|
@@ -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
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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
|
-
|
|
64
|
+
|
|
65
|
+
expect(version).toBe(latest.split('_')[0])
|
|
65
66
|
}
|
|
66
67
|
done1 = true
|
|
67
68
|
})
|