@bsv/wallet-toolbox 1.1.50 → 1.1.51
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/docs/client.md +26 -14
- package/docs/wallet.md +26 -14
- package/out/src/sdk/validationHelpers.d.ts +9 -4
- package/out/src/sdk/validationHelpers.d.ts.map +1 -1
- package/out/src/sdk/validationHelpers.js +4 -4
- package/out/src/sdk/validationHelpers.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/Wallet/support/janitor.man.test.js +1 -1
- package/out/tsconfig.all.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/sdk/validationHelpers.ts +14 -8
- package/src/storage/schema/KnexMigrations.ts +13 -0
- package/test/Wallet/support/janitor.man.test.ts +1 -1
package/package.json
CHANGED
|
@@ -260,11 +260,17 @@ export function isHexString(s: string): boolean {
|
|
|
260
260
|
return true
|
|
261
261
|
}
|
|
262
262
|
|
|
263
|
+
/**
|
|
264
|
+
* @typedef {string & { minLength: 5, maxLength: 2000 }} DescriptionString5to2000Bytes
|
|
265
|
+
* A string used for descriptions, with a length between 5 and 2000 characters.
|
|
266
|
+
*/
|
|
267
|
+
export type DescriptionString5to2000Bytes = string
|
|
268
|
+
|
|
263
269
|
export interface ValidWalletSignerArgs {}
|
|
264
270
|
|
|
265
271
|
export interface ValidCreateActionInput {
|
|
266
272
|
outpoint: OutPoint
|
|
267
|
-
inputDescription:
|
|
273
|
+
inputDescription: DescriptionString5to2000Bytes
|
|
268
274
|
sequenceNumber: PositiveIntegerOrZero
|
|
269
275
|
unlockingScript?: HexString
|
|
270
276
|
unlockingScriptLength: PositiveInteger
|
|
@@ -295,7 +301,7 @@ export function validateCreateActionInput(
|
|
|
295
301
|
i.inputDescription,
|
|
296
302
|
'inputDescription',
|
|
297
303
|
5,
|
|
298
|
-
|
|
304
|
+
2000
|
|
299
305
|
),
|
|
300
306
|
unlockingScript,
|
|
301
307
|
unlockingScriptLength,
|
|
@@ -307,7 +313,7 @@ export function validateCreateActionInput(
|
|
|
307
313
|
export interface ValidCreateActionOutput {
|
|
308
314
|
lockingScript: HexString
|
|
309
315
|
satoshis: SatoshiValue
|
|
310
|
-
outputDescription:
|
|
316
|
+
outputDescription: DescriptionString5to2000Bytes
|
|
311
317
|
basket?: BasketStringUnder300Bytes
|
|
312
318
|
customInstructions?: string
|
|
313
319
|
tags: BasketStringUnder300Bytes[]
|
|
@@ -323,7 +329,7 @@ export function validateCreateActionOutput(
|
|
|
323
329
|
o.outputDescription,
|
|
324
330
|
'outputDescription',
|
|
325
331
|
5,
|
|
326
|
-
|
|
332
|
+
2000
|
|
327
333
|
),
|
|
328
334
|
basket: validateOptionalBasket(o.basket),
|
|
329
335
|
customInstructions: o.customInstructions,
|
|
@@ -394,7 +400,7 @@ export interface ValidProcessActionArgs extends ValidWalletSignerArgs {
|
|
|
394
400
|
}
|
|
395
401
|
|
|
396
402
|
export interface ValidCreateActionArgs extends ValidProcessActionArgs {
|
|
397
|
-
description:
|
|
403
|
+
description: DescriptionString5to2000Bytes
|
|
398
404
|
inputBEEF?: BEEF
|
|
399
405
|
inputs: sdk.ValidCreateActionInput[]
|
|
400
406
|
outputs: sdk.ValidCreateActionOutput[]
|
|
@@ -425,7 +431,7 @@ export function validateCreateActionArgs(
|
|
|
425
431
|
args: CreateActionArgs
|
|
426
432
|
): ValidCreateActionArgs {
|
|
427
433
|
const vargs: ValidCreateActionArgs = {
|
|
428
|
-
description: validateStringLength(args.description, 'description', 5,
|
|
434
|
+
description: validateStringLength(args.description, 'description', 5, 2000),
|
|
429
435
|
inputBEEF: args.inputBEEF,
|
|
430
436
|
inputs: defaultEmpty(args.inputs).map(i => validateCreateActionInput(i)),
|
|
431
437
|
outputs: defaultEmpty(args.outputs).map(o => validateCreateActionOutput(o)),
|
|
@@ -590,7 +596,7 @@ export function validateInternalizeOutput(
|
|
|
590
596
|
export interface ValidInternalizeActionArgs extends ValidWalletSignerArgs {
|
|
591
597
|
tx: AtomicBEEF
|
|
592
598
|
outputs: InternalizeOutput[]
|
|
593
|
-
description:
|
|
599
|
+
description: DescriptionString5to2000Bytes
|
|
594
600
|
labels: LabelStringUnder300Bytes[]
|
|
595
601
|
seekPermission: BooleanDefaultTrue
|
|
596
602
|
}
|
|
@@ -611,7 +617,7 @@ export function validateInternalizeActionArgs(
|
|
|
611
617
|
const vargs: ValidInternalizeActionArgs = {
|
|
612
618
|
tx: args.tx,
|
|
613
619
|
outputs: args.outputs.map(o => validateInternalizeOutput(o)),
|
|
614
|
-
description: validateStringLength(args.description, 'description', 5,
|
|
620
|
+
description: validateStringLength(args.description, 'description', 5, 2000),
|
|
615
621
|
labels: (args.labels || []).map(t => validateLabel(t)),
|
|
616
622
|
seekPermission: defaultTrue(args.seekPermission)
|
|
617
623
|
}
|
|
@@ -91,6 +91,19 @@ export class KnexMigrations implements MigrationSource<string> {
|
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
+
migrations['2025-03-03-001 descriptions to 2000'] = {
|
|
95
|
+
async up(knex) {
|
|
96
|
+
await knex.schema.alterTable('transactions', table => {
|
|
97
|
+
table.string('description', 2048).alter()
|
|
98
|
+
})
|
|
99
|
+
await knex.schema.alterTable('outputs', table => {
|
|
100
|
+
table.string('outputDescription', 2048).alter()
|
|
101
|
+
table.string('spendingDescription', 2048).alter()
|
|
102
|
+
})
|
|
103
|
+
},
|
|
104
|
+
async down(knex) {}
|
|
105
|
+
}
|
|
106
|
+
|
|
94
107
|
migrations['2025-03-01-001 reset req history'] = {
|
|
95
108
|
async up(knex) {
|
|
96
109
|
const storage = new StorageKnex({
|
|
@@ -20,7 +20,7 @@ describe('janitor tests', () => {
|
|
|
20
20
|
const services = new Services(env.chain)
|
|
21
21
|
|
|
22
22
|
const identityKey =
|
|
23
|
-
'
|
|
23
|
+
'0304985aa632dde471d3bf1ffb030d0af253fe65f5d186bb4cf878ca0fbee54c1c'
|
|
24
24
|
const { invalidSpendableOutputs: notUtxos } = await confirmSpendableOutputs(
|
|
25
25
|
storage,
|
|
26
26
|
services,
|