@canton-network/core-wallet-store-sql 0.7.0 → 0.9.0
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"002-drop-grpc-url.d.ts","sourceRoot":"","sources":["../../src/migrations/002-drop-grpc-url.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAA;AAEjC,wBAAsB,EAAE,CAAC,EAAE,EAAE,MAAM,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAQtD;AAED,wBAAsB,IAAI,CAAC,EAAE,EAAE,MAAM,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"002-drop-grpc-url.d.ts","sourceRoot":"","sources":["../../src/migrations/002-drop-grpc-url.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAA;AAEjC,wBAAsB,EAAE,CAAC,EAAE,EAAE,MAAM,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAQtD;AAED,wBAAsB,IAAI,CAAC,EAAE,EAAE,MAAM,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAOxD"}
|
|
@@ -11,6 +11,6 @@ export async function up(db) {
|
|
|
11
11
|
export async function down(db) {
|
|
12
12
|
await db.schema
|
|
13
13
|
.alterTable('networks')
|
|
14
|
-
.addColumn('ledger_api_admin_grpc_url', 'text', (col) => col.notNull())
|
|
14
|
+
.addColumn('ledger_api_admin_grpc_url', 'text', (col) => col.notNull().defaultTo(''))
|
|
15
15
|
.execute();
|
|
16
16
|
}
|
package/dist/store-sql.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store-sql.d.ts","sourceRoot":"","sources":["../src/store-sql.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAC7B,OAAO,EACH,WAAW,EAEX,SAAS,
|
|
1
|
+
{"version":3,"file":"store-sql.d.ts","sourceRoot":"","sources":["../src/store-sql.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAC7B,OAAO,EACH,WAAW,EAEX,SAAS,EAEZ,MAAM,kCAAkC,CAAA;AACzC,OAAO,EACH,KAAK,IAAI,SAAS,EAClB,MAAM,EACN,OAAO,EACP,OAAO,EACP,YAAY,EACZ,WAAW,EACX,OAAO,EACP,WAAW,EACd,MAAM,mCAAmC,CAAA;AAC1C,OAAO,EAAmB,MAAM,EAAiB,MAAM,QAAQ,CAAA;AAE/D,OAAO,EACH,EAAE,EAQL,MAAM,aAAa,CAAA;AAEpB,qBAAa,QAAS,YAAW,SAAS,EAAE,SAAS,CAAC,QAAQ,CAAC;IAIvD,OAAO,CAAC,EAAE;IACV,OAAO,CAAC,MAAM;IAJlB,WAAW,EAAE,WAAW,GAAG,SAAS,CAAA;gBAGxB,EAAE,EAAE,MAAM,CAAC,EAAE,CAAC,EACd,MAAM,EAAE,MAAM,EACtB,WAAW,CAAC,EAAE,WAAW;IAQ7B,eAAe,CAAC,OAAO,CAAC,EAAE,WAAW,GAAG,QAAQ;IAIhD,OAAO,CAAC,eAAe;IAMjB,UAAU,CAAC,MAAM,GAAE,YAAiB,GAAG,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IA2B7D,gBAAgB,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAK/C,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAwBjD,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAsCxC,UAAU,IAAI,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC;IAQ1C,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAc3C,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAS9B,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAW7C,iBAAiB,IAAI,OAAO,CAAC,OAAO,CAAC;IAkBrC,YAAY,IAAI,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAuBvC,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAqB9C,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAuB3C,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IA4B7C,cAAc,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAkBvD,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC;CAc5E;AAED,eAAO,MAAM,UAAU,GAAI,QAAQ,WAAW,eAqB7C,CAAA"}
|
package/dist/store-sql.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// Copyright (c) 2025 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import { assertConnected, } from '@canton-network/core-wallet-auth';
|
|
3
4
|
import { CamelCasePlugin, Kysely, SqliteDialect } from 'kysely';
|
|
4
5
|
import Database from 'better-sqlite3';
|
|
5
6
|
import { fromAuth, fromNetwork, fromTransaction, fromWallet, toNetwork, toTransaction, toWallet, } from './schema.js';
|
|
6
|
-
import { providerErrors } from '@canton-network/core-rpc-errors';
|
|
7
7
|
export class StoreSql {
|
|
8
8
|
db;
|
|
9
9
|
logger;
|
|
@@ -19,12 +19,7 @@ export class StoreSql {
|
|
|
19
19
|
return new StoreSql(this.db, this.logger, context);
|
|
20
20
|
}
|
|
21
21
|
assertConnected() {
|
|
22
|
-
|
|
23
|
-
throw providerErrors.unauthorized({
|
|
24
|
-
message: 'User is not connected',
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
return this.authContext.userId;
|
|
22
|
+
return assertConnected(this.authContext).userId;
|
|
28
23
|
}
|
|
29
24
|
// Wallet methods
|
|
30
25
|
async getWallets(filter = {}) {
|
|
@@ -77,6 +72,7 @@ export class StoreSql {
|
|
|
77
72
|
});
|
|
78
73
|
}
|
|
79
74
|
async addWallet(wallet) {
|
|
75
|
+
this.logger.info('Adding wallet');
|
|
80
76
|
const userId = this.assertConnected();
|
|
81
77
|
const wallets = await this.getWallets();
|
|
82
78
|
if (wallets.some((w) => w.partyId === wallet.partyId)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@canton-network/core-wallet-store-sql",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": "github:hyperledger-labs/splice-wallet-kernel",
|
|
6
6
|
"description": "SQL implementation of the Store API",
|
|
@@ -12,18 +12,19 @@
|
|
|
12
12
|
"scripts": {
|
|
13
13
|
"build": "tsc -b",
|
|
14
14
|
"dev": "tsc -b --watch",
|
|
15
|
+
"flatpack": "yarn pack --out \"$FLATPACK_OUTDIR\"",
|
|
15
16
|
"clean": "tsc -b --clean; rm -rf dist",
|
|
16
17
|
"test": "yarn node --experimental-vm-modules $(yarn bin jest)"
|
|
17
18
|
},
|
|
18
19
|
"dependencies": {
|
|
19
|
-
"@canton-network/core-ledger-client": "
|
|
20
|
-
"@canton-network/core-rpc-errors": "
|
|
21
|
-
"@canton-network/core-wallet-auth": "
|
|
22
|
-
"@canton-network/core-wallet-store": "
|
|
20
|
+
"@canton-network/core-ledger-client": "",
|
|
21
|
+
"@canton-network/core-rpc-errors": "",
|
|
22
|
+
"@canton-network/core-wallet-auth": "",
|
|
23
|
+
"@canton-network/core-wallet-store": "",
|
|
23
24
|
"better-sqlite3": "^12.2.0",
|
|
24
25
|
"commander": "^14.0.0",
|
|
25
26
|
"kysely": "^0.28.5",
|
|
26
|
-
"pino": "^
|
|
27
|
+
"pino": "^10.0.0",
|
|
27
28
|
"umzug": "^3.8.2",
|
|
28
29
|
"zod": "^3.25.64"
|
|
29
30
|
},
|