@canton-network/wallet-gateway-remote 0.9.1 → 0.9.2

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.
@@ -4,9 +4,9 @@ export declare const kernelInfoSchema: z.ZodObject<{
4
4
  clientType: z.ZodUnion<readonly [z.ZodLiteral<"browser">, z.ZodLiteral<"desktop">, z.ZodLiteral<"mobile">, z.ZodLiteral<"remote">]>;
5
5
  }, z.core.$strip>;
6
6
  export declare const serverConfigSchema: z.ZodObject<{
7
- host: z.ZodString;
8
- port: z.ZodNumber;
9
- tls: z.ZodBoolean;
7
+ host: z.ZodDefault<z.ZodString>;
8
+ port: z.ZodDefault<z.ZodNumber>;
9
+ tls: z.ZodDefault<z.ZodBoolean>;
10
10
  dappPath: z.ZodDefault<z.ZodString>;
11
11
  userPath: z.ZodDefault<z.ZodString>;
12
12
  allowedOrigins: z.ZodDefault<z.ZodUnion<readonly [z.ZodLiteral<"*">, z.ZodArray<z.ZodString>]>>;
@@ -16,14 +16,14 @@ export declare const configSchema: z.ZodObject<{
16
16
  id: z.ZodString;
17
17
  clientType: z.ZodUnion<readonly [z.ZodLiteral<"browser">, z.ZodLiteral<"desktop">, z.ZodLiteral<"mobile">, z.ZodLiteral<"remote">]>;
18
18
  }, z.core.$strip>;
19
- server: z.ZodObject<{
20
- host: z.ZodString;
21
- port: z.ZodNumber;
22
- tls: z.ZodBoolean;
19
+ server: z.ZodPipe<z.ZodTransform<{}, unknown>, z.ZodObject<{
20
+ host: z.ZodDefault<z.ZodString>;
21
+ port: z.ZodDefault<z.ZodNumber>;
22
+ tls: z.ZodDefault<z.ZodBoolean>;
23
23
  dappPath: z.ZodDefault<z.ZodString>;
24
24
  userPath: z.ZodDefault<z.ZodString>;
25
25
  allowedOrigins: z.ZodDefault<z.ZodUnion<readonly [z.ZodLiteral<"*">, z.ZodArray<z.ZodString>]>>;
26
- }, z.core.$strip>;
26
+ }, z.core.$strip>>;
27
27
  store: z.ZodObject<{
28
28
  connection: z.ZodDiscriminatedUnion<[z.ZodObject<{
29
29
  type: z.ZodLiteral<"memory">;
@@ -13,16 +13,16 @@ export const kernelInfoSchema = z.object({
13
13
  ]),
14
14
  });
15
15
  export const serverConfigSchema = z.object({
16
- host: z.string(),
17
- port: z.number(),
18
- tls: z.boolean(),
16
+ host: z.string().default('localhost'),
17
+ port: z.number().default(3030),
18
+ tls: z.boolean().default(false),
19
19
  dappPath: z.string().default('/api/v0/dapp'),
20
20
  userPath: z.string().default('/api/v0/user'),
21
21
  allowedOrigins: z.union([z.literal('*'), z.array(z.string())]).default('*'),
22
22
  });
23
23
  export const configSchema = z.object({
24
24
  kernel: kernelInfoSchema,
25
- server: serverConfigSchema,
25
+ server: z.preprocess((val) => val ?? {}, serverConfigSchema),
26
26
  store: storeConfigSchema,
27
27
  signingStore: signingStoreConfigSchema,
28
28
  });
@@ -1 +1 @@
1
- {"version":3,"file":"ConfigUtils.d.ts","sourceRoot":"","sources":["../../src/config/ConfigUtils.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAgB,YAAY,EAAE,MAAM,aAAa,CAAA;AAEhE,qBAAa,WAAW;IACpB,MAAM,CAAC,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;CAoDlD;AAgDD,eAAO,MAAM,gBAAgB,GACzB,cAAc,YAAY,KAC3B;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAOpC,CAAA"}
1
+ {"version":3,"file":"ConfigUtils.d.ts","sourceRoot":"","sources":["../../src/config/ConfigUtils.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAgB,YAAY,EAAE,MAAM,aAAa,CAAA;AAEhE,qBAAa,WAAW;IACpB,MAAM,CAAC,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;CAoDlD;AAgDD,eAAO,MAAM,gBAAgB,GACzB,cAAc,YAAY,KAC3B;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAUpC,CAAA"}
@@ -72,8 +72,10 @@ function validateNetworkAuthMethods(config) {
72
72
  }
73
73
  export const deriveKernelUrls = (serverConfig) => {
74
74
  const protocol = serverConfig.tls ? 'https' : 'http';
75
- const dappUrl = `${protocol}://${serverConfig.host}:${serverConfig.port}${serverConfig.dappPath}`;
75
+ // Convert 0.0.0.0 to localhost for URL generation since browsers can't use 0.0.0.0
76
+ const urlHost = serverConfig.host === '0.0.0.0' ? 'localhost' : serverConfig.host;
77
+ const dappUrl = `${protocol}://${urlHost}:${serverConfig.port}${serverConfig.dappPath}`;
76
78
  // userUrl is the base URL for the web frontend (no path)
77
- const userUrl = `${protocol}://${serverConfig.host}:${serverConfig.port}`;
79
+ const userUrl = `${protocol}://${urlHost}:${serverConfig.port}`;
78
80
  return { dappUrl, userUrl };
79
81
  };
@@ -9,7 +9,7 @@ declare const _default: {
9
9
  tls: false;
10
10
  dappPath: string;
11
11
  userPath: string;
12
- allowedOrigins: string[];
12
+ allowedOrigins: "*";
13
13
  };
14
14
  signingStore: {
15
15
  connection: {
@@ -11,7 +11,7 @@ export default {
11
11
  tls: false,
12
12
  dappPath: '/api/v0/dapp',
13
13
  userPath: '/api/v0/user',
14
- allowedOrigins: ['http://localhost:8080'],
14
+ allowedOrigins: '*',
15
15
  },
16
16
  signingStore: {
17
17
  connection: {
package/dist/index.d.ts CHANGED
@@ -3,7 +3,7 @@ declare const options: {
3
3
  config: string;
4
4
  configSchema: boolean;
5
5
  configExample: boolean;
6
- port: string | true;
6
+ port?: string | true;
7
7
  logFormat: "json" | "pretty";
8
8
  };
9
9
  export type CliOptions = typeof options;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAiEA,QAAA,MAAM,OAAO;;;;;;CAAiB,CAAA;AAE9B,MAAM,MAAM,UAAU,GAAG,OAAO,OAAO,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AA2DA,QAAA,MAAM,OAAO;;;;;;CAAiB,CAAA;AAE9B,MAAM,MAAM,UAAU,GAAG,OAAO,OAAO,CAAA"}
package/dist/index.js CHANGED
@@ -5,24 +5,19 @@ import { Option, Command } from '@commander-js/extra-typings';
5
5
  import { initialize } from './init.js';
6
6
  import { createCLI } from '@canton-network/core-wallet-store-sql';
7
7
  import { ConfigUtils } from './config/ConfigUtils.js';
8
- import { readFileSync } from 'fs';
9
- import { join, dirname } from 'path';
10
- import { fileURLToPath } from 'url';
11
8
  import pino from 'pino';
12
9
  import z from 'zod';
13
10
  import { configSchema } from './config/Config.js';
14
11
  import exampleConfig from './example-config.js';
15
- const __filename = fileURLToPath(import.meta.url);
16
- const __dirname = dirname(__filename);
17
- const pkg = JSON.parse(readFileSync(join(__dirname, '../package.json'), 'utf8'));
12
+ import { GATEWAY_VERSION } from './version.js';
18
13
  const program = new Command()
19
14
  .name('wallet-gateway')
20
- .version(pkg.version)
15
+ .version(GATEWAY_VERSION)
21
16
  .description('Run a remotely hosted Wallet Gateway')
22
17
  .option('-c, --config <path>', 'set config path', './config.json')
23
18
  .option('--config-schema', 'output the config schema and exit', false)
24
19
  .option('--config-example', 'output an example config and exit', false)
25
- .option('-p, --port [port]', 'set port', '3030')
20
+ .option('-p, --port [port]', 'set port (overrides config)')
26
21
  .addOption(new Option('-f, --log-format <format>', 'set log format')
27
22
  .choices(['json', 'pretty'])
28
23
  .default('pretty'))
@@ -1 +1 @@
1
- {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../src/init.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAsB7B,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AA2GvC,wBAAsB,UAAU,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,iBAwGhE"}
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../src/init.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAsB7B,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AA4GvC,wBAAsB,UAAU,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,iBAqIhE"}
package/dist/init.js CHANGED
@@ -18,6 +18,7 @@ import { rpcRateLimit } from './middleware/rateLimit.js';
18
18
  import { deriveKernelUrls } from './config/ConfigUtils.js';
19
19
  import { existsSync, readFileSync } from 'fs';
20
20
  import path from 'path';
21
+ import { GATEWAY_VERSION } from './version.js';
21
22
  let isReady = false;
22
23
  class NotificationService {
23
24
  constructor(logger) {
@@ -95,9 +96,16 @@ export async function initialize(opts, logger) {
95
96
  const host = config.server.host;
96
97
  const protocol = config.server.tls ? 'https' : 'http';
97
98
  const app = express();
98
- const server = app.listen(port, host, () => {
99
- logger.info(`Remote Wallet Gateway starting on ${protocol}://${host}:${port}`);
100
- });
99
+ // Don't pass 'localhost' or '0.0.0.0' to listen() - let express default to 0.0.0.0
100
+ // This ensures Docker compatibility while keeping localhost as the default for URLs
101
+ const useDefaultListenHost = ['0.0.0.0', 'localhost', '127.0.0.1'].includes(host);
102
+ const server = useDefaultListenHost
103
+ ? app.listen(port, () => {
104
+ logger.info(`Remote Wallet Gateway starting on ${protocol}://${host}:${port} (bound to 0.0.0.0:${port})`);
105
+ })
106
+ : app.listen(port, host, () => {
107
+ logger.info(`Remote Wallet Gateway starting on ${protocol}://${host}:${port}`);
108
+ });
101
109
  app.use('/healthz', rpcRateLimit, (_req, res) => res.status(200).send('OK'));
102
110
  app.use('/readyz', rpcRateLimit, (_req, res) => {
103
111
  if (isReady) {
@@ -144,6 +152,16 @@ export async function initialize(opts, logger) {
144
152
  port, // Use the actual port we're listening on
145
153
  };
146
154
  const { dappUrl, userUrl } = deriveKernelUrls(serverConfigWithOverride);
155
+ logger.info({
156
+ host: serverConfigWithOverride.host,
157
+ port: serverConfigWithOverride.port,
158
+ tls: serverConfigWithOverride.tls,
159
+ dappPath: serverConfigWithOverride.dappPath,
160
+ userPath: serverConfigWithOverride.userPath,
161
+ allowedOrigins: serverConfigWithOverride.allowedOrigins,
162
+ dappUrl,
163
+ userUrl,
164
+ }, 'Server configuration');
147
165
  const kernelInfo = config.kernel;
148
166
  // register dapp API handlers
149
167
  dapp(config.server.dappPath, app, logger, server, kernelInfo, dappUrl, userUrl, config.server, notificationService, authService, store);
@@ -152,5 +170,5 @@ export async function initialize(opts, logger) {
152
170
  // register web handler
153
171
  web(app, server, config.server.userPath);
154
172
  isReady = true;
155
- logger.info('Wallet Gateway initialization complete');
173
+ logger.info(`Wallet Gateway (version: ${GATEWAY_VERSION}) initialization complete`);
156
174
  }
@@ -0,0 +1,2 @@
1
+ export declare const GATEWAY_VERSION: any;
2
+ //# sourceMappingURL=version.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,eAAe,KAAc,CAAA"}
@@ -0,0 +1,9 @@
1
+ // Copyright (c) 2025 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ import { readFileSync } from 'node:fs';
4
+ import { dirname, join } from 'node:path';
5
+ import { fileURLToPath } from 'node:url';
6
+ const __filename = fileURLToPath(import.meta.url);
7
+ const __dirname = dirname(__filename);
8
+ const pkg = JSON.parse(readFileSync(join(__dirname, '../package.json'), 'utf8'));
9
+ export const GATEWAY_VERSION = pkg.version;
@@ -0,0 +1,29 @@
1
+ import{c as _,s as k,w as S,x as E,a as j,i as ee,t as te}from"./index-DyLgNi-5.js";import{r as f}from"./state-Ck_F88ae.js";var se=Object.create,T=Object.defineProperty,ie=Object.getOwnPropertyDescriptor,H=(s,e)=>(e=Symbol[s])?e:Symbol.for("Symbol."+s),v=s=>{throw TypeError(s)},ne=(s,e,t)=>e in s?T(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,F=(s,e)=>T(s,"name",{value:e,configurable:!0}),re=s=>[,,,se(s?.[H("metadata")]??null)],J=["class","method","getter","setter","accessor","field","value","get","set"],I=s=>s!==void 0&&typeof s!="function"?v("Function expected"):s,ae=(s,e,t,o,n)=>({kind:J[s],name:e,metadata:o,addInitializer:r=>t._?v("Already initialized"):n.push(I(r||null))}),oe=(s,e)=>ne(e,H("metadata"),s[3]),h=(s,e,t,o)=>{for(var n=0,r=s[e>>1],u=r&&r.length;n<u;n++)e&1?r[n].call(t):o=r[n].call(t,o);return o},g=(s,e,t,o,n,r)=>{var u,d,W,y,C,i=e&7,A=!!(e&8),w=!!(e&16),$=i>3?s.length+1:i?A?1:2:0,x=J[i+5],V=i>3&&(s[$-1]=[]),Z=s[$]||(s[$]=[]),l=i&&(!w&&!A&&(n=n.prototype),i<5&&(i>3||!w)&&ie(i<4?n:{get[t](){return G(this,r)},set[t](c){return B(this,r,c)}},t));i?w&&i<4&&F(r,(i>2?"set ":i>1?"get ":"")+t):F(n,t);for(var N=o.length-1;N>=0;N--)y=ae(i,t,W={},s[3],Z),i&&(y.static=A,y.private=w,C=y.access={has:w?c=>ce(n,c):c=>t in c},i^3&&(C.get=w?c=>(i^1?G:de)(c,n,i^4?r:l.get):c=>c[t]),i>2&&(C.set=w?(c,b)=>B(c,n,b,i^4?r:l.set):(c,b)=>c[t]=b)),d=(0,o[N])(i?i<4?w?r:l[x]:i>4?void 0:{get:l.get,set:l.set}:n,y),W._=1,i^4||d===void 0?I(d)&&(i>4?V.unshift(d):i?w?r=d:l[x]=d:n=d):typeof d!="object"||d===null?v("Object expected"):(I(u=d.get)&&(l.get=u),I(u=d.set)&&(l.set=u),I(u=d.init)&&V.unshift(u));return i||oe(s,n),l&&T(n,t,l),w?i^4?r:l:n},D=(s,e,t)=>e.has(s)||v("Cannot "+t),ce=(s,e)=>Object(e)!==e?v('Cannot use the "in" operator on this value'):s.has(e),G=(s,e,t)=>(D(s,e,"read from private field"),t?t.call(s):e.get(s)),m=(s,e,t)=>e.has(s)?v("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(s):e.set(s,t),B=(s,e,t,o)=>(D(s,e,"write to private field"),o?o.call(s,t):e.set(s,t),t),de=(s,e,t)=>(D(s,e,"access private method"),t),K,L,Q,R,X,z,Y,a,M,P,U,q,O;Y=[te("user-ui-settings")];class p extends(z=ee,X=[f()],R=[f()],Q=[f()],L=[f()],K=[f()],z){constructor(){super(...arguments),m(this,M,h(a,8,this,[])),h(a,11,this),m(this,P,h(a,12,this,[])),h(a,15,this),m(this,U,h(a,16,this,[])),h(a,19,this),m(this,q,h(a,20,this,null)),h(a,23,this),m(this,O,h(a,24,this)),h(a,27,this),this.handleNetworkSubmit=async e=>{e.preventDefault();const t=this.toApiAuth(e.network.auth),o=e.network.adminAuth?this.toApiAuth(e.network.adminAuth):{method:"client_credentials",audience:"",scope:"",clientId:"",clientSecret:""},n={id:e.network.id,name:e.network.name,description:e.network.description,identityProviderId:e.network.identityProviderId,...e.network.synchronizerId&&{synchronizerId:e.network.synchronizerId},ledgerApi:e.network.ledgerApi.baseUrl,auth:t,adminAuth:o};try{await(await _(k.accessToken.get())).request("addNetwork",{network:n}),await this.listNetworks()}catch(r){S(r)}},this.handleIdpSubmit=async e=>{console.log(e);try{await(await _(k.accessToken.get())).request("addIdp",{idp:e.idp}),await this.listIdps()}catch(t){S(t)}},this.handleIdpDelete=async e=>{console.log(e);try{await(await _(k.accessToken.get())).request("removeIdp",{identityProviderId:e.idp.id}),await this.listIdps()}catch(t){S(t)}}}async connectedCallback(){super.connectedCallback(),this.client=await _(k.accessToken.get()),this.listNetworks(),this.listSessions(),this.listIdps();const e=await fetch("/.well-known/wallet-gateway-version").then(t=>t.json()).then(t=>t.version);this.gatewayVersion=e?`v${e}`:"unknown_version"}async listNetworks(){const t=await(await _(k.accessToken.get())).request("listNetworks");this.networks=t.networks}async listSessions(){const t=await(await _(k.accessToken.get())).request("listSessions");this.sessions=t.sessions}async listIdps(){const t=await(await _(k.accessToken.get())).request("listIdps");this.idps=t.idps}toApiAuth(e){return{method:e.method,audience:e.audience??"",scope:e.scope??"",clientId:e.clientId??"",issuer:e.issuer??"",clientSecret:e.clientSecret??""}}async handleNetworkDelete(e){if(confirm(`Delete network "${e.network.name}"?`))try{const t={networkName:e.network.id};await(await _(k.accessToken.get())).request("removeNetwork",t),await this.listNetworks()}catch(t){S(t)}}render(){if(!this.client)return E``;const e=this.client;return E`
2
+ <div>
3
+ <h1>Wallet Gateway (${this.gatewayVersion})</h1>
4
+ </div>
5
+ <wg-sessions .sessions=${this.sessions}></wg-sessions>
6
+
7
+ <wg-wallets-sync .client=${e}></wg-wallets-sync>
8
+ <wg-networks
9
+ .networks=${this.networks}
10
+ .activeSessions=${this.sessions}
11
+ @network-edit-save=${this.handleNetworkSubmit}
12
+ @delete=${this.handleNetworkDelete}
13
+ ></wg-networks>
14
+ <wg-idps
15
+ .idps=${this.idps}
16
+ .activeSessions=${this.sessions}
17
+ @delete=${this.handleIdpDelete}
18
+ @idp-add=${this.handleIdpSubmit}
19
+ ></wg-idps>
20
+ `}}a=re(z);M=new WeakMap;P=new WeakMap;U=new WeakMap;q=new WeakMap;O=new WeakMap;g(a,4,"networks",X,p,M);g(a,4,"sessions",R,p,P);g(a,4,"idps",Q,p,U);g(a,4,"client",L,p,q);g(a,4,"gatewayVersion",K,p,O);p=g(a,0,"UserUiSettings",Y,p);p.styles=j`
21
+ :host {
22
+ display: block;
23
+ box-sizing: border-box;
24
+ padding: 0rem;
25
+ max-width: 900px;
26
+ margin: 0 auto;
27
+ font-family: var(--wg-theme-font-family, Arial, sans-serif);
28
+ }
29
+ `;h(a,1,p);
@@ -3,7 +3,7 @@
3
3
  <head>
4
4
  <meta charset="UTF-8" />
5
5
  <title>Wallet Kernel - Settings</title>
6
- <script type="module" crossorigin src="/assets/settings-DOn2WYJx.js"></script>
6
+ <script type="module" crossorigin src="/assets/settings-DTCtvDW7.js"></script>
7
7
  <link rel="modulepreload" crossorigin href="/assets/index-DyLgNi-5.js">
8
8
  <link rel="modulepreload" crossorigin href="/assets/state-Ck_F88ae.js">
9
9
  <link rel="stylesheet" crossorigin href="/assets/index-CgbJtyud.css">
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/web/server.ts"],"names":[],"mappings":"AAGA,OAAO,OAAO,MAAM,SAAS,CAAA;AAC7B,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAK7B,eAAO,MAAM,GAAG,GAAI,KAAK,OAAO,CAAC,OAAO,EAAE,QAAQ,MAAM,EAAE,UAAU,MAAM,oBAuDzE,CAAA"}
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/web/server.ts"],"names":[],"mappings":"AAGA,OAAO,OAAO,MAAM,SAAS,CAAA;AAC7B,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAM7B,eAAO,MAAM,GAAG,GAAI,KAAK,OAAO,CAAC,OAAO,EAAE,QAAQ,MAAM,EAAE,UAAU,MAAM,oBA4DzE,CAAA"}
@@ -4,6 +4,7 @@ import express from 'express';
4
4
  import path, { dirname } from 'path';
5
5
  import { fileURLToPath } from 'url';
6
6
  import ViteExpress from 'vite-express';
7
+ import { GATEWAY_VERSION } from '../version.js';
7
8
  export const web = (app, server, userPath) => {
8
9
  // Expose userPath via well-known configuration endpoint
9
10
  app.get('/.well-known/wallet-gateway-config', (_req, res) => {
@@ -17,6 +18,10 @@ export const web = (app, server, userPath) => {
17
18
  // Serve static files from the package build in production
18
19
  app.use(express.static(path.resolve(dirname(fileURLToPath(import.meta.url)), '../../dist/web/frontend')));
19
20
  }
21
+ // Expose gateway version via well-known endpoint
22
+ app.get('/.well-known/wallet-gateway-version', (_req, res) => {
23
+ res.json({ version: GATEWAY_VERSION });
24
+ });
20
25
  // Middleware to ensure all paths end with a trailing slash
21
26
  // This is useful for static file serving and routing consistency
22
27
  app.use((req, res, next) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canton-network/wallet-gateway-remote",
3
- "version": "0.9.1",
3
+ "version": "0.9.2",
4
4
  "description": "A server-side Wallet Gateway implementation over HTTP",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -32,21 +32,21 @@
32
32
  "access": "public"
33
33
  },
34
34
  "dependencies": {
35
- "@canton-network/core-ledger-client": "^0.20.2",
36
- "@canton-network/core-rpc-errors": "^0.10.2",
37
- "@canton-network/core-signing-fireblocks": "^0.14.0",
38
- "@canton-network/core-signing-internal": "^0.14.1",
39
- "@canton-network/core-signing-lib": "^0.16.0",
40
- "@canton-network/core-signing-participant": "^0.14.1",
41
- "@canton-network/core-signing-store-sql": "^0.15.1",
42
- "@canton-network/core-tx-visualizer": "^0.14.1",
43
- "@canton-network/core-types": "^0.13.2",
44
- "@canton-network/core-wallet-auth": "^0.14.2",
45
- "@canton-network/core-wallet-dapp-rpc-client": "^0.15.2",
46
- "@canton-network/core-wallet-store": "^0.15.0",
47
- "@canton-network/core-wallet-store-sql": "^0.15.1",
48
- "@canton-network/core-wallet-ui-components": "^0.15.1",
49
- "@canton-network/core-wallet-user-rpc-client": "^0.15.2",
35
+ "@canton-network/core-ledger-client": "^0.20.3",
36
+ "@canton-network/core-rpc-errors": "^0.10.3",
37
+ "@canton-network/core-signing-fireblocks": "^0.14.1",
38
+ "@canton-network/core-signing-internal": "^0.14.2",
39
+ "@canton-network/core-signing-lib": "^0.16.1",
40
+ "@canton-network/core-signing-participant": "^0.14.2",
41
+ "@canton-network/core-signing-store-sql": "^0.15.2",
42
+ "@canton-network/core-tx-visualizer": "^0.14.2",
43
+ "@canton-network/core-types": "^0.13.3",
44
+ "@canton-network/core-wallet-auth": "^0.14.3",
45
+ "@canton-network/core-wallet-dapp-rpc-client": "^0.15.3",
46
+ "@canton-network/core-wallet-store": "^0.15.1",
47
+ "@canton-network/core-wallet-store-sql": "^0.15.2",
48
+ "@canton-network/core-wallet-ui-components": "^0.15.2",
49
+ "@canton-network/core-wallet-user-rpc-client": "^0.15.3",
50
50
  "@commander-js/extra-typings": "^14.0.0",
51
51
  "commander": "^14.0.2",
52
52
  "cors": "^2.8.5",
@@ -63,7 +63,7 @@
63
63
  "zod": "^4.1.13"
64
64
  },
65
65
  "devDependencies": {
66
- "@canton-network/core-wallet-store-inmemory": "^0.16.1",
66
+ "@canton-network/core-wallet-store-inmemory": "^0.16.2",
67
67
  "@jest/globals": "^30.2.0",
68
68
  "@swc/core": "^1.15.3",
69
69
  "@swc/jest": "^0.2.39",
@@ -1,26 +0,0 @@
1
- import{c as u,s as _,w as m,x as E,a as Y,i as Z,t as j}from"./index-DyLgNi-5.js";import{r as I}from"./state-Ck_F88ae.js";var ee=Object.create,T=Object.defineProperty,te=Object.getOwnPropertyDescriptor,H=(s,e)=>(e=Symbol[s])?e:Symbol.for("Symbol."+s),v=s=>{throw TypeError(s)},se=(s,e,t)=>e in s?T(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,F=(s,e)=>T(s,"name",{value:e,configurable:!0}),ie=s=>[,,,ee(s?.[H("metadata")]??null)],J=["class","method","getter","setter","accessor","field","value","get","set"],y=s=>s!==void 0&&typeof s!="function"?v("Function expected"):s,ne=(s,e,t,o,n)=>({kind:J[s],name:e,metadata:o,addInitializer:r=>t._?v("Already initialized"):n.push(y(r||null))}),re=(s,e)=>se(e,H("metadata"),s[3]),w=(s,e,t,o)=>{for(var n=0,r=s[e>>1],p=r&&r.length;n<p;n++)e&1?r[n].call(t):o=r[n].call(t,o);return o},f=(s,e,t,o,n,r)=>{var p,d,O,g,C,i=e&7,A=!!(e&8),h=!!(e&16),N=i>3?s.length+1:i?A?1:2:0,x=J[i+5],W=i>3&&(s[N-1]=[]),X=s[N]||(s[N]=[]),l=i&&(!h&&!A&&(n=n.prototype),i<5&&(i>3||!h)&&te(i<4?n:{get[t](){return G(this,r)},set[t](c){return B(this,r,c)}},t));i?h&&i<4&&F(r,(i>2?"set ":i>1?"get ":"")+t):F(n,t);for(var $=o.length-1;$>=0;$--)g=ne(i,t,O={},s[3],X),i&&(g.static=A,g.private=h,C=g.access={has:h?c=>ae(n,c):c=>t in c},i^3&&(C.get=h?c=>(i^1?G:oe)(c,n,i^4?r:l.get):c=>c[t]),i>2&&(C.set=h?(c,b)=>B(c,n,b,i^4?r:l.set):(c,b)=>c[t]=b)),d=(0,o[$])(i?i<4?h?r:l[x]:i>4?void 0:{get:l.get,set:l.set}:n,g),O._=1,i^4||d===void 0?y(d)&&(i>4?W.unshift(d):i?h?r=d:l[x]=d:n=d):typeof d!="object"||d===null?v("Object expected"):(y(p=d.get)&&(l.get=p),y(p=d.set)&&(l.set=p),y(p=d.init)&&W.unshift(p));return i||re(s,n),l&&T(n,t,l),h?i^4?r:l:n},D=(s,e,t)=>e.has(s)||v("Cannot "+t),ae=(s,e)=>Object(e)!==e?v('Cannot use the "in" operator on this value'):s.has(e),G=(s,e,t)=>(D(s,e,"read from private field"),t?t.call(s):e.get(s)),S=(s,e,t)=>e.has(s)?v("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(s):e.set(s,t),B=(s,e,t,o)=>(D(s,e,"write to private field"),o?o.call(s,t):e.set(s,t),t),oe=(s,e,t)=>(D(s,e,"access private method"),t),K,L,Q,R,z,V,a,P,U,q,M;V=[j("user-ui-settings")];class k extends(z=Z,R=[I()],Q=[I()],L=[I()],K=[I()],z){constructor(){super(...arguments),S(this,P,w(a,8,this,[])),w(a,11,this),S(this,U,w(a,12,this,[])),w(a,15,this),S(this,q,w(a,16,this,[])),w(a,19,this),S(this,M,w(a,20,this,null)),w(a,23,this),this.handleNetworkSubmit=async e=>{e.preventDefault();const t=this.toApiAuth(e.network.auth),o=e.network.adminAuth?this.toApiAuth(e.network.adminAuth):{method:"client_credentials",audience:"",scope:"",clientId:"",clientSecret:""},n={id:e.network.id,name:e.network.name,description:e.network.description,identityProviderId:e.network.identityProviderId,...e.network.synchronizerId&&{synchronizerId:e.network.synchronizerId},ledgerApi:e.network.ledgerApi.baseUrl,auth:t,adminAuth:o};try{await(await u(_.accessToken.get())).request("addNetwork",{network:n}),await this.listNetworks()}catch(r){m(r)}},this.handleIdpSubmit=async e=>{console.log(e);try{await(await u(_.accessToken.get())).request("addIdp",{idp:e.idp}),await this.listIdps()}catch(t){m(t)}},this.handleIdpDelete=async e=>{console.log(e);try{await(await u(_.accessToken.get())).request("removeIdp",{identityProviderId:e.idp.id}),await this.listIdps()}catch(t){m(t)}}}async connectedCallback(){super.connectedCallback(),this.client=await u(_.accessToken.get()),this.listNetworks(),this.listSessions(),this.listIdps()}async listNetworks(){const t=await(await u(_.accessToken.get())).request("listNetworks");this.networks=t.networks}async listSessions(){const t=await(await u(_.accessToken.get())).request("listSessions");this.sessions=t.sessions}async listIdps(){const t=await(await u(_.accessToken.get())).request("listIdps");this.idps=t.idps}toApiAuth(e){return{method:e.method,audience:e.audience??"",scope:e.scope??"",clientId:e.clientId??"",issuer:e.issuer??"",clientSecret:e.clientSecret??""}}async handleNetworkDelete(e){if(confirm(`Delete network "${e.network.name}"?`))try{const t={networkName:e.network.id};await(await u(_.accessToken.get())).request("removeNetwork",t),await this.listNetworks()}catch(t){m(t)}}render(){if(!this.client)return E``;const e=this.client;return E`
2
- <wg-sessions .sessions=${this.sessions}></wg-sessions>
3
-
4
- <wg-wallets-sync .client=${e}></wg-wallets-sync>
5
- <wg-networks
6
- .networks=${this.networks}
7
- .activeSessions=${this.sessions}
8
- @network-edit-save=${this.handleNetworkSubmit}
9
- @delete=${this.handleNetworkDelete}
10
- ></wg-networks>
11
- <wg-idps
12
- .idps=${this.idps}
13
- .activeSessions=${this.sessions}
14
- @delete=${this.handleIdpDelete}
15
- @idp-add=${this.handleIdpSubmit}
16
- ></wg-idps>
17
- `}}a=ie(z);P=new WeakMap;U=new WeakMap;q=new WeakMap;M=new WeakMap;f(a,4,"networks",R,k,P);f(a,4,"sessions",Q,k,U);f(a,4,"idps",L,k,q);f(a,4,"client",K,k,M);k=f(a,0,"UserUiSettings",V,k);k.styles=Y`
18
- :host {
19
- display: block;
20
- box-sizing: border-box;
21
- padding: 0rem;
22
- max-width: 900px;
23
- margin: 0 auto;
24
- font-family: var(--wg-theme-font-family, Arial, sans-serif);
25
- }
26
- `;w(a,1,k);