Skip to content

Commit 5b4b69c

Browse files
committed
Merge branch 'nextVersion'
2 parents 2ac28b1 + cad6fc5 commit 5b4b69c

17 files changed

+7772
-2383
lines changed

client/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@bsv/wallet-toolbox-client",
3-
"version": "1.1.8",
3+
"version": "1.1.9",
44
"description": "Client only Wallet Storage",
55
"main": "./out/src/index.client.js",
66
"types": "./out/src/index.client.d.ts",

docs/client.md

Lines changed: 3475 additions & 1171 deletions
Large diffs are not rendered by default.

docs/storage.md

Lines changed: 563 additions & 12 deletions
Large diffs are not rendered by default.

docs/wallet.md

Lines changed: 3475 additions & 1171 deletions
Large diffs are not rendered by default.

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@bsv/wallet-toolbox",
3-
"version": "1.1.8",
3+
"version": "1.1.9",
44
"description": "BRC100 conforming wallet, wallet storage and wallet signer components",
55
"main": "./out/src/index.js",
66
"types": "./out/src/index.d.ts",

src/sdk/StorageSyncReader.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import {
22
sdk,
33
TableCertificate,
44
TableCertificateField,
5+
TableCertificateX,
56
TableCommission,
67
TableOutput,
78
TableOutputBasket,
@@ -41,7 +42,7 @@ export interface StorageSyncReader {
4142
findCertificateFields(
4243
args: sdk.FindCertificateFieldsArgs
4344
): Promise<TableCertificateField[]>
44-
findCertificates(args: sdk.FindCertificatesArgs): Promise<TableCertificate[]>
45+
findCertificates(args: sdk.FindCertificatesArgs): Promise<TableCertificateX[]>
4546
findCommissions(args: sdk.FindCommissionsArgs): Promise<TableCommission[]>
4647
findOutputBaskets(
4748
args: sdk.FindOutputBasketsArgs

src/sdk/WalletStorage.interfaces.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export interface WalletStorage {
7373
args: InternalizeActionArgs
7474
): Promise<InternalizeActionResult>
7575

76-
findCertificates(args: sdk.FindCertificatesArgs): Promise<TableCertificate[]>
76+
findCertificates(args: sdk.FindCertificatesArgs): Promise<TableCertificateX[]>
7777
findOutputBaskets(
7878
args: sdk.FindOutputBasketsArgs
7979
): Promise<TableOutputBasket[]>
@@ -173,7 +173,7 @@ export interface WalletStorageReader {
173173
findCertificatesAuth(
174174
auth: sdk.AuthId,
175175
args: sdk.FindCertificatesArgs
176-
): Promise<TableCertificate[]>
176+
): Promise<TableCertificateX[]>
177177
findOutputBasketsAuth(
178178
auth: sdk.AuthId,
179179
args: sdk.FindOutputBasketsArgs

src/storage/StorageKnex.ts

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -799,7 +799,7 @@ export class StorageKnex
799799
override async findCertificatesAuth(
800800
auth: sdk.AuthId,
801801
args: sdk.FindCertificatesArgs
802-
): Promise<TableCertificate[]> {
802+
): Promise<TableCertificateX[]> {
803803
if (
804804
!auth.userId ||
805805
(args.partial.userId && args.partial.userId !== auth.userId)
@@ -840,10 +840,21 @@ export class StorageKnex
840840
}
841841
override async findCertificates(
842842
args: sdk.FindCertificatesArgs
843-
): Promise<TableCertificate[]> {
843+
): Promise<TableCertificateX[]> {
844844
const q = this.findCertificatesQuery(args)
845-
const r = await q
846-
return this.validateEntities(r, undefined, ['isDeleted'])
845+
let r: TableCertificateX[] = await q
846+
r = this.validateEntities(r, undefined, ['isDeleted'])
847+
if (args.includeFields) {
848+
for (const c of r) {
849+
c.fields = this.validateEntities(
850+
await this.findCertificateFields({
851+
partial: { certificateId: c.certificateId, userId: c.userId },
852+
trx: args.trx
853+
})
854+
)
855+
}
856+
}
857+
return r
847858
}
848859
override async findCommissions(
849860
args: sdk.FindCommissionsArgs

0 commit comments

Comments
 (0)