@canton-network/core-rpc-transport 1.12.0 → 1.12.1-backport.3

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/dist/index.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  let uuid = require("uuid");
3
3
  let _canton_network_core_types = require("@canton-network/core-types");
4
- //#region \0@oxc-project+runtime@0.142.0/helpers/esm/typeof.js
4
+ // \0@oxc-project+runtime@0.155.0/helpers/esm/typeof.js
5
5
  function _typeof(o) {
6
6
  "@babel/helpers - typeof";
7
7
  return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
@@ -10,8 +10,7 @@ function _typeof(o) {
10
10
  return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
11
11
  }, _typeof(o);
12
12
  }
13
- //#endregion
14
- //#region \0@oxc-project+runtime@0.142.0/helpers/esm/toPrimitive.js
13
+ // \0@oxc-project+runtime@0.155.0/helpers/esm/toPrimitive.js
15
14
  function toPrimitive(t, r) {
16
15
  if ("object" != _typeof(t) || !t) return t;
17
16
  var e = t[Symbol.toPrimitive];
@@ -22,14 +21,12 @@ function toPrimitive(t, r) {
22
21
  }
23
22
  return ("string" === r ? String : Number)(t);
24
23
  }
25
- //#endregion
26
- //#region \0@oxc-project+runtime@0.142.0/helpers/esm/toPropertyKey.js
24
+ // \0@oxc-project+runtime@0.155.0/helpers/esm/toPropertyKey.js
27
25
  function toPropertyKey(t) {
28
26
  var i = toPrimitive(t, "string");
29
27
  return "symbol" == _typeof(i) ? i : i + "";
30
28
  }
31
- //#endregion
32
- //#region \0@oxc-project+runtime@0.142.0/helpers/esm/defineProperty.js
29
+ // \0@oxc-project+runtime@0.155.0/helpers/esm/defineProperty.js
33
30
  function _defineProperty(e, r, t) {
34
31
  return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
35
32
  value: t,
@@ -38,8 +35,7 @@ function _defineProperty(e, r, t) {
38
35
  writable: !0
39
36
  }) : e[r] = t, e;
40
37
  }
41
- //#endregion
42
- //#region src/index.ts
38
+ // src/index.ts
43
39
  const jsonRpcRequest = (id, payload) => {
44
40
  return {
45
41
  jsonrpc: "2.0",
@@ -158,7 +154,6 @@ var HttpTransport = class {
158
154
  return parsed;
159
155
  }
160
156
  };
161
- //#endregion
162
157
  exports.HttpTransport = HttpTransport;
163
158
  exports.WindowTransport = WindowTransport;
164
159
  exports.jsonRpcRequest = jsonRpcRequest;
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":["isSpliceMessageEvent","WalletEvent","uuidv4","ErrorResponse","ResponsePayload"],"sources":["../src/index.ts"],"sourcesContent":["// Copyright (c) 2025-2026 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { v4 as uuidv4 } from 'uuid'\nimport {\n RequestPayload,\n ResponsePayload,\n JsonRpcRequest,\n SpliceMessage,\n WalletEvent,\n isSpliceMessageEvent,\n SuccessResponse,\n ErrorResponse,\n JsonRpcResponse,\n} from '@canton-network/core-types'\n\nexport const jsonRpcRequest = (\n id: string | number | null,\n payload: RequestPayload\n): JsonRpcRequest => {\n return {\n jsonrpc: '2.0',\n id, // id should be set based on the request context\n ...payload,\n }\n}\n\nexport const jsonRpcResponse = (\n id: string | number | null,\n payload: ResponsePayload\n): JsonRpcResponse => {\n return {\n jsonrpc: '2.0',\n id, // id should be set based on the request context\n ...payload,\n }\n}\n\nexport interface RpcTransport {\n submit: (payload: RequestPayload) => Promise<ResponsePayload>\n}\n\n/**\n * Handler for wallet-pushed JSON-RPC notifications (CIP-103 events such as\n * txChanged / accountsChanged / statusChanged / connected).\n */\nexport type NotificationHandler = (method: string, params?: unknown) => void\n\nexport type WindowTransportOptions = {\n /**\n * Optional routing key for browser-extension messaging. When set, extensions\n * should ignore messages that do not match their own identifier.\n */\n target?: string | undefined\n}\n\nexport class WindowTransport implements RpcTransport {\n private notificationHandlers = new Set<NotificationHandler>()\n private notificationListener: ((event: MessageEvent) => void) | undefined\n\n constructor(\n private win: Window,\n private options: WindowTransportOptions = {}\n ) {}\n\n /**\n * Subscribe to wallet-pushed JSON-RPC notifications: SPLICE_WALLET_REQUEST\n * frames with no `id` (JSON-RPC 2.0 §4.1). The window listener must be\n * always-on for the transport's lifetime — CIP-103 events arrive between\n * requests, where a per-request listener can never observe them.\n */\n onNotification = (handler: NotificationHandler): (() => void) => {\n this.notificationHandlers.add(handler)\n if (!this.notificationListener) {\n this.notificationListener = (event: MessageEvent) => {\n if (\n !isSpliceMessageEvent(event) ||\n event.data.type !== WalletEvent.SPLICE_WALLET_REQUEST\n ) {\n return\n }\n // Requests submitted by this transport always carry a uuid id,\n // so an id-less request can only be a wallet-originated\n // notification — this also keeps the dApp's own outgoing\n // frames (posted to the same window) out of the event path.\n if (event.data.request.id != null) {\n return\n }\n // Same gating as extension detection: a transport constructed\n // from an announced provider's routing key only accepts frames\n // stamped with that key, so multi-wallet pages do not\n // cross-deliver events between providers.\n if (\n this.options.target &&\n event.data.target !== this.options.target\n ) {\n return\n }\n const { method, params } = event.data.request\n this.notificationHandlers.forEach((h) => h(method, params))\n }\n this.win.addEventListener('message', this.notificationListener)\n }\n return () => {\n this.notificationHandlers.delete(handler)\n // Drop the DOM listener with the last subscriber so an abandoned\n // transport leaves nothing attached to the window; a later\n // subscribe re-installs it.\n if (\n this.notificationHandlers.size === 0 &&\n this.notificationListener\n ) {\n this.win.removeEventListener(\n 'message',\n this.notificationListener\n )\n this.notificationListener = undefined\n }\n }\n }\n\n submit = async (payload: RequestPayload) => {\n const message: SpliceMessage = {\n request: jsonRpcRequest(uuidv4(), payload),\n type: WalletEvent.SPLICE_WALLET_REQUEST,\n target: this.options.target,\n }\n\n this.win.postMessage(message, '*')\n\n return new Promise<SuccessResponse>((resolve, reject) => {\n const listener = (event: MessageEvent) => {\n if (\n !isSpliceMessageEvent(event) ||\n event.data.type !== WalletEvent.SPLICE_WALLET_RESPONSE ||\n event.data.response.id !== message.request.id\n ) {\n return\n }\n\n window.removeEventListener('message', listener)\n if ('error' in event.data.response) {\n reject(event.data.response.error)\n } else {\n resolve(event.data.response)\n }\n }\n\n window.addEventListener('message', listener)\n })\n }\n\n submitResponse = (id: string | number | null, payload: ResponsePayload) => {\n const message: SpliceMessage = {\n response: jsonRpcResponse(id, payload),\n type: WalletEvent.SPLICE_WALLET_RESPONSE,\n }\n this.win.postMessage(message, '*')\n }\n}\n\nexport class HttpTransport implements RpcTransport {\n constructor(\n private url: URL,\n private accessToken?: string\n ) {}\n\n protected async handleErrorResponse(response: Response): Promise<never> {\n const body = await response.text()\n\n // if the response uses the RPC error format, throw it as is\n let rpcError: unknown\n try {\n const parsedBody = JSON.parse(body)\n if (ErrorResponse.safeParse(parsedBody).success) {\n rpcError = parsedBody\n }\n } catch {\n // ignore JSON parse errors\n }\n if (rpcError !== undefined) {\n throw rpcError\n }\n\n throw {\n error: {\n code: response.status,\n message: response.statusText,\n data: body,\n },\n }\n }\n\n async submit(payload: RequestPayload): Promise<ResponsePayload> {\n const request: JsonRpcRequest = {\n jsonrpc: '2.0',\n method: payload.method,\n params: payload.params,\n id: uuidv4(),\n }\n\n const header = this.accessToken\n ? { Authorization: `Bearer ${this.accessToken}` }\n : undefined\n\n const response = await fetch(this.url.href, {\n method: 'POST',\n headers: {\n ...header,\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(request),\n })\n\n if (!response.ok) {\n return this.handleErrorResponse(response)\n }\n\n const json = await response.json()\n const parsed = ResponsePayload.parse(json)\n\n if ('error' in parsed) {\n throw parsed\n }\n\n return parsed\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,MAAa,kBACT,IACA,YACiB;CACjB,OAAO;EACH,SAAS;EACT;EACA,GAAG;CACP;AACJ;AAEA,MAAa,mBACT,IACA,YACkB;CAClB,OAAO;EAC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U,OAAO;EAChC,CAAC;EAED,IAAI,CAAC,SAAS,IACV,OAAO,KAAK,oBAAoB,QAAQ;EAG5C,MAAM,OAAO,MAAM,SAAS,KAAK;EACjC,MAAM,SAASE,2BAAAA,gBAAgB,MAAM,IAAI;EAEzC,IAAI,WAAW,QACX,MAAM;EAGV,OAAO;CACX;AACJ"}
1
+ {"version":3,"file":"index.cjs","names":["isSpliceMessageEvent","WalletEvent","uuidv4","ErrorResponse","ResponsePayload"],"sources":["../src/index.ts"],"sourcesContent":["// Copyright (c) 2025-2026 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { v4 as uuidv4 } from 'uuid'\nimport {\n RequestPayload,\n ResponsePayload,\n JsonRpcRequest,\n SpliceMessage,\n WalletEvent,\n isSpliceMessageEvent,\n SuccessResponse,\n ErrorResponse,\n JsonRpcResponse,\n} from '@canton-network/core-types'\n\nexport const jsonRpcRequest = (\n id: string | number | null,\n payload: RequestPayload\n): JsonRpcRequest => {\n return {\n jsonrpc: '2.0',\n id, // id should be set based on the request context\n ...payload,\n }\n}\n\nexport const jsonRpcResponse = (\n id: string | number | null,\n payload: ResponsePayload\n): JsonRpcResponse => {\n return {\n jsonrpc: '2.0',\n id, // id should be set based on the request context\n ...payload,\n }\n}\n\nexport interface RpcTransport {\n submit: (payload: RequestPayload) => Promise<ResponsePayload>\n}\n\n/**\n * Handler for wallet-pushed JSON-RPC notifications (CIP-103 events such as\n * txChanged / accountsChanged / statusChanged / connected).\n */\nexport type NotificationHandler = (method: string, params?: unknown) => void\n\nexport type WindowTransportOptions = {\n /**\n * Optional routing key for browser-extension messaging. When set, extensions\n * should ignore messages that do not match their own identifier.\n */\n target?: string | undefined\n}\n\nexport class WindowTransport implements RpcTransport {\n private notificationHandlers = new Set<NotificationHandler>()\n private notificationListener: ((event: MessageEvent) => void) | undefined\n\n constructor(\n private win: Window,\n private options: WindowTransportOptions = {}\n ) {}\n\n /**\n * Subscribe to wallet-pushed JSON-RPC notifications: SPLICE_WALLET_REQUEST\n * frames with no `id` (JSON-RPC 2.0 §4.1). The window listener must be\n * always-on for the transport's lifetime — CIP-103 events arrive between\n * requests, where a per-request listener can never observe them.\n */\n onNotification = (handler: NotificationHandler): (() => void) => {\n this.notificationHandlers.add(handler)\n if (!this.notificationListener) {\n this.notificationListener = (event: MessageEvent) => {\n if (\n !isSpliceMessageEvent(event) ||\n event.data.type !== WalletEvent.SPLICE_WALLET_REQUEST\n ) {\n return\n }\n // Requests submitted by this transport always carry a uuid id,\n // so an id-less request can only be a wallet-originated\n // notification — this also keeps the dApp's own outgoing\n // frames (posted to the same window) out of the event path.\n if (event.data.request.id != null) {\n return\n }\n // Same gating as extension detection: a transport constructed\n // from an announced provider's routing key only accepts frames\n // stamped with that key, so multi-wallet pages do not\n // cross-deliver events between providers.\n if (\n this.options.target &&\n event.data.target !== this.options.target\n ) {\n return\n }\n const { method, params } = event.data.request\n this.notificationHandlers.forEach((h) => h(method, params))\n }\n this.win.addEventListener('message', this.notificationListener)\n }\n return () => {\n this.notificationHandlers.delete(handler)\n // Drop the DOM listener with the last subscriber so an abandoned\n // transport leaves nothing attached to the window; a later\n // subscribe re-installs it.\n if (\n this.notificationHandlers.size === 0 &&\n this.notificationListener\n ) {\n this.win.removeEventListener(\n 'message',\n this.notificationListener\n )\n this.notificationListener = undefined\n }\n }\n }\n\n submit = async (payload: RequestPayload) => {\n const message: SpliceMessage = {\n request: jsonRpcRequest(uuidv4(), payload),\n type: WalletEvent.SPLICE_WALLET_REQUEST,\n target: this.options.target,\n }\n\n this.win.postMessage(message, '*')\n\n return new Promise<SuccessResponse>((resolve, reject) => {\n const listener = (event: MessageEvent) => {\n if (\n !isSpliceMessageEvent(event) ||\n event.data.type !== WalletEvent.SPLICE_WALLET_RESPONSE ||\n event.data.response.id !== message.request.id\n ) {\n return\n }\n\n window.removeEventListener('message', listener)\n if ('error' in event.data.response) {\n reject(event.data.response.error)\n } else {\n resolve(event.data.response)\n }\n }\n\n window.addEventListener('message', listener)\n })\n }\n\n submitResponse = (id: string | number | null, payload: ResponsePayload) => {\n const message: SpliceMessage = {\n response: jsonRpcResponse(id, payload),\n type: WalletEvent.SPLICE_WALLET_RESPONSE,\n }\n this.win.postMessage(message, '*')\n }\n}\n\nexport class HttpTransport implements RpcTransport {\n constructor(\n private url: URL,\n private accessToken?: string\n ) {}\n\n protected async handleErrorResponse(response: Response): Promise<never> {\n const body = await response.text()\n\n // if the response uses the RPC error format, throw it as is\n let rpcError: unknown\n try {\n const parsedBody = JSON.parse(body)\n if (ErrorResponse.safeParse(parsedBody).success) {\n rpcError = parsedBody\n }\n } catch {\n // ignore JSON parse errors\n }\n if (rpcError !== undefined) {\n throw rpcError\n }\n\n throw {\n error: {\n code: response.status,\n message: response.statusText,\n data: body,\n },\n }\n }\n\n async submit(payload: RequestPayload): Promise<ResponsePayload> {\n const request: JsonRpcRequest = {\n jsonrpc: '2.0',\n method: payload.method,\n params: payload.params,\n id: uuidv4(),\n }\n\n const header = this.accessToken\n ? { Authorization: `Bearer ${this.accessToken}` }\n : undefined\n\n const response = await fetch(this.url.href, {\n method: 'POST',\n headers: {\n ...header,\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(request),\n })\n\n if (!response.ok) {\n return this.handleErrorResponse(response)\n }\n\n const json = await response.json()\n const parsed = ResponsePayload.parse(json)\n\n if ('error' in parsed) {\n throw parsed\n }\n\n return parsed\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,MAAa,kBACT,IACA,YACiB;CACjB,OAAO;EACH,SAAS;EACT;EACA,GAAG;CACP;AACJ;AAEA,MAAa,mBACT,IACA,YACkB;CAClB,OAAO;EACH,SAAS;EACT;EACA,GAAG;CACP;AACJ;AAoBA,IAAa,kBAAb,MAAqD;CAIjD,YACI,KACA,UAA0C,CAAC,GAC7C;EAFU,KAAA,MAAA;EACA,KAAA,UAAA;EALJ,gBAAA,MAAA,w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AAI;EAEzC,IAAI,WAAW,QACX,MAAM;EAGV,OAAO;CACX;AACJ"}
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { v4 } from "uuid";
2
2
  import { ErrorResponse, ResponsePayload, WalletEvent, isSpliceMessageEvent } from "@canton-network/core-types";
3
- //#region \0@oxc-project+runtime@0.142.0/helpers/esm/typeof.js
3
+ // \0@oxc-project+runtime@0.155.0/helpers/esm/typeof.js
4
4
  function _typeof(o) {
5
5
  "@babel/helpers - typeof";
6
6
  return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
@@ -9,8 +9,7 @@ function _typeof(o) {
9
9
  return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
10
10
  }, _typeof(o);
11
11
  }
12
- //#endregion
13
- //#region \0@oxc-project+runtime@0.142.0/helpers/esm/toPrimitive.js
12
+ // \0@oxc-project+runtime@0.155.0/helpers/esm/toPrimitive.js
14
13
  function toPrimitive(t, r) {
15
14
  if ("object" != _typeof(t) || !t) return t;
16
15
  var e = t[Symbol.toPrimitive];
@@ -21,14 +20,12 @@ function toPrimitive(t, r) {
21
20
  }
22
21
  return ("string" === r ? String : Number)(t);
23
22
  }
24
- //#endregion
25
- //#region \0@oxc-project+runtime@0.142.0/helpers/esm/toPropertyKey.js
23
+ // \0@oxc-project+runtime@0.155.0/helpers/esm/toPropertyKey.js
26
24
  function toPropertyKey(t) {
27
25
  var i = toPrimitive(t, "string");
28
26
  return "symbol" == _typeof(i) ? i : i + "";
29
27
  }
30
- //#endregion
31
- //#region \0@oxc-project+runtime@0.142.0/helpers/esm/defineProperty.js
28
+ // \0@oxc-project+runtime@0.155.0/helpers/esm/defineProperty.js
32
29
  function _defineProperty(e, r, t) {
33
30
  return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
34
31
  value: t,
@@ -37,8 +34,7 @@ function _defineProperty(e, r, t) {
37
34
  writable: !0
38
35
  }) : e[r] = t, e;
39
36
  }
40
- //#endregion
41
- //#region src/index.ts
37
+ // src/index.ts
42
38
  const jsonRpcRequest = (id, payload) => {
43
39
  return {
44
40
  jsonrpc: "2.0",
@@ -157,7 +153,6 @@ var HttpTransport = class {
157
153
  return parsed;
158
154
  }
159
155
  };
160
- //#endregion
161
156
  export { HttpTransport, WindowTransport, jsonRpcRequest, jsonRpcResponse };
162
157
 
163
158
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["uuidv4"],"sources":["../src/index.ts"],"sourcesContent":["// Copyright (c) 2025-2026 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { v4 as uuidv4 } from 'uuid'\nimport {\n RequestPayload,\n ResponsePayload,\n JsonRpcRequest,\n SpliceMessage,\n WalletEvent,\n isSpliceMessageEvent,\n SuccessResponse,\n ErrorResponse,\n JsonRpcResponse,\n} from '@canton-network/core-types'\n\nexport const jsonRpcRequest = (\n id: string | number | null,\n payload: RequestPayload\n): JsonRpcRequest => {\n return {\n jsonrpc: '2.0',\n id, // id should be set based on the request context\n ...payload,\n }\n}\n\nexport const jsonRpcResponse = (\n id: string | number | null,\n payload: ResponsePayload\n): JsonRpcResponse => {\n return {\n jsonrpc: '2.0',\n id, // id should be set based on the request context\n ...payload,\n }\n}\n\nexport interface RpcTransport {\n submit: (payload: RequestPayload) => Promise<ResponsePayload>\n}\n\n/**\n * Handler for wallet-pushed JSON-RPC notifications (CIP-103 events such as\n * txChanged / accountsChanged / statusChanged / connected).\n */\nexport type NotificationHandler = (method: string, params?: unknown) => void\n\nexport type WindowTransportOptions = {\n /**\n * Optional routing key for browser-extension messaging. When set, extensions\n * should ignore messages that do not match their own identifier.\n */\n target?: string | undefined\n}\n\nexport class WindowTransport implements RpcTransport {\n private notificationHandlers = new Set<NotificationHandler>()\n private notificationListener: ((event: MessageEvent) => void) | undefined\n\n constructor(\n private win: Window,\n private options: WindowTransportOptions = {}\n ) {}\n\n /**\n * Subscribe to wallet-pushed JSON-RPC notifications: SPLICE_WALLET_REQUEST\n * frames with no `id` (JSON-RPC 2.0 §4.1). The window listener must be\n * always-on for the transport's lifetime — CIP-103 events arrive between\n * requests, where a per-request listener can never observe them.\n */\n onNotification = (handler: NotificationHandler): (() => void) => {\n this.notificationHandlers.add(handler)\n if (!this.notificationListener) {\n this.notificationListener = (event: MessageEvent) => {\n if (\n !isSpliceMessageEvent(event) ||\n event.data.type !== WalletEvent.SPLICE_WALLET_REQUEST\n ) {\n return\n }\n // Requests submitted by this transport always carry a uuid id,\n // so an id-less request can only be a wallet-originated\n // notification — this also keeps the dApp's own outgoing\n // frames (posted to the same window) out of the event path.\n if (event.data.request.id != null) {\n return\n }\n // Same gating as extension detection: a transport constructed\n // from an announced provider's routing key only accepts frames\n // stamped with that key, so multi-wallet pages do not\n // cross-deliver events between providers.\n if (\n this.options.target &&\n event.data.target !== this.options.target\n ) {\n return\n }\n const { method, params } = event.data.request\n this.notificationHandlers.forEach((h) => h(method, params))\n }\n this.win.addEventListener('message', this.notificationListener)\n }\n return () => {\n this.notificationHandlers.delete(handler)\n // Drop the DOM listener with the last subscriber so an abandoned\n // transport leaves nothing attached to the window; a later\n // subscribe re-installs it.\n if (\n this.notificationHandlers.size === 0 &&\n this.notificationListener\n ) {\n this.win.removeEventListener(\n 'message',\n this.notificationListener\n )\n this.notificationListener = undefined\n }\n }\n }\n\n submit = async (payload: RequestPayload) => {\n const message: SpliceMessage = {\n request: jsonRpcRequest(uuidv4(), payload),\n type: WalletEvent.SPLICE_WALLET_REQUEST,\n target: this.options.target,\n }\n\n this.win.postMessage(message, '*')\n\n return new Promise<SuccessResponse>((resolve, reject) => {\n const listener = (event: MessageEvent) => {\n if (\n !isSpliceMessageEvent(event) ||\n event.data.type !== WalletEvent.SPLICE_WALLET_RESPONSE ||\n event.data.response.id !== message.request.id\n ) {\n return\n }\n\n window.removeEventListener('message', listener)\n if ('error' in event.data.response) {\n reject(event.data.response.error)\n } else {\n resolve(event.data.response)\n }\n }\n\n window.addEventListener('message', listener)\n })\n }\n\n submitResponse = (id: string | number | null, payload: ResponsePayload) => {\n const message: SpliceMessage = {\n response: jsonRpcResponse(id, payload),\n type: WalletEvent.SPLICE_WALLET_RESPONSE,\n }\n this.win.postMessage(message, '*')\n }\n}\n\nexport class HttpTransport implements RpcTransport {\n constructor(\n private url: URL,\n private accessToken?: string\n ) {}\n\n protected async handleErrorResponse(response: Response): Promise<never> {\n const body = await response.text()\n\n // if the response uses the RPC error format, throw it as is\n let rpcError: unknown\n try {\n const parsedBody = JSON.parse(body)\n if (ErrorResponse.safeParse(parsedBody).success) {\n rpcError = parsedBody\n }\n } catch {\n // ignore JSON parse errors\n }\n if (rpcError !== undefined) {\n throw rpcError\n }\n\n throw {\n error: {\n code: response.status,\n message: response.statusText,\n data: body,\n },\n }\n }\n\n async submit(payload: RequestPayload): Promise<ResponsePayload> {\n const request: JsonRpcRequest = {\n jsonrpc: '2.0',\n method: payload.method,\n params: payload.params,\n id: uuidv4(),\n }\n\n const header = this.accessToken\n ? { Authorization: `Bearer ${this.accessToken}` }\n : undefined\n\n const response = await fetch(this.url.href, {\n method: 'POST',\n headers: {\n ...header,\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(request),\n })\n\n if (!response.ok) {\n return this.handleErrorResponse(response)\n }\n\n const json = await response.json()\n const parsed = ResponsePayload.parse(json)\n\n if ('error' in parsed) {\n throw parsed\n }\n\n return parsed\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,MAAa,kBACT,IACA,YACiB;CACjB,OAAO;EACH,SAAS;EACT;EACA,GAAG;CACP;AACJ;AAEA,MAAa,mBACT,IACA,YACkB;CAClB,OAAO;EACH,SAAS;EACT;EACA,GAAG;CACP;AACJ;AAoBA,IAAa,kBAAb,MAAqD;CAIjD,YACI,KACA,UAA0C,CAAC,GAC7C;EAFU,KAAA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"sources":["../src/index.ts"],"sourcesContent":["// Copyright (c) 2025-2026 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { v4 as uuidv4 } from 'uuid'\nimport {\n RequestPayload,\n ResponsePayload,\n JsonRpcRequest,\n SpliceMessage,\n WalletEvent,\n isSpliceMessageEvent,\n SuccessResponse,\n ErrorResponse,\n JsonRpcResponse,\n} from '@canton-network/core-types'\n\nexport const jsonRpcRequest = (\n id: string | number | null,\n payload: RequestPayload\n): JsonRpcRequest => {\n return {\n jsonrpc: '2.0',\n id, // id should be set based on the request context\n ...payload,\n }\n}\n\nexport const jsonRpcResponse = (\n id: string | number | null,\n payload: ResponsePayload\n): JsonRpcResponse => {\n return {\n jsonrpc: '2.0',\n id, // id should be set based on the request context\n ...payload,\n }\n}\n\nexport interface RpcTransport {\n submit: (payload: RequestPayload) => Promise<ResponsePayload>\n}\n\n/**\n * Handler for wallet-pushed JSON-RPC notifications (CIP-103 events such as\n * txChanged / accountsChanged / statusChanged / connected).\n */\nexport type NotificationHandler = (method: string, params?: unknown) => void\n\nexport type WindowTransportOptions = {\n /**\n * Optional routing key for browser-extension messaging. When set, extensions\n * should ignore messages that do not match their own identifier.\n */\n target?: string | undefined\n}\n\nexport class WindowTransport implements RpcTransport {\n private notificationHandlers = new Set<NotificationHandler>()\n private notificationListener: ((event: MessageEvent) => void) | undefined\n\n constructor(\n private win: Window,\n private options: WindowTransportOptions = {}\n ) {}\n\n /**\n * Subscribe to wallet-pushed JSON-RPC notifications: SPLICE_WALLET_REQUEST\n * frames with no `id` (JSON-RPC 2.0 §4.1). The window listener must be\n * always-on for the transport's lifetime — CIP-103 events arrive between\n * requests, where a per-request listener can never observe them.\n */\n onNotification = (handler: NotificationHandler): (() => void) => {\n this.notificationHandlers.add(handler)\n if (!this.notificationListener) {\n this.notificationListener = (event: MessageEvent) => {\n if (\n !isSpliceMessageEvent(event) ||\n event.data.type !== WalletEvent.SPLICE_WALLET_REQUEST\n ) {\n return\n }\n // Requests submitted by this transport always carry a uuid id,\n // so an id-less request can only be a wallet-originated\n // notification — this also keeps the dApp's own outgoing\n // frames (posted to the same window) out of the event path.\n if (event.data.request.id != null) {\n return\n }\n // Same gating as extension detection: a transport constructed\n // from an announced provider's routing key only accepts frames\n // stamped with that key, so multi-wallet pages do not\n // cross-deliver events between providers.\n if (\n this.options.target &&\n event.data.target !== this.options.target\n ) {\n return\n }\n const { method, params } = event.data.request\n this.notificationHandlers.forEach((h) => h(method, params))\n }\n this.win.addEventListener('message', this.notificationListener)\n }\n return () => {\n this.notificationHandlers.delete(handler)\n // Drop the DOM listener with the last subscriber so an abandoned\n // transport leaves nothing attached to the window; a later\n // subscribe re-installs it.\n if (\n this.notificationHandlers.size === 0 &&\n this.notificationListener\n ) {\n this.win.removeEventListener(\n 'message',\n this.notificationListener\n )\n this.notificationListener = undefined\n }\n }\n }\n\n submit = async (payload: RequestPayload) => {\n const message: SpliceMessage = {\n request: jsonRpcRequest(uuidv4(), payload),\n type: WalletEvent.SPLICE_WALLET_REQUEST,\n target: this.options.target,\n }\n\n this.win.postMessage(message, '*')\n\n return new Promise<SuccessResponse>((resolve, reject) => {\n const listener = (event: MessageEvent) => {\n if (\n !isSpliceMessageEvent(event) ||\n event.data.type !== WalletEvent.SPLICE_WALLET_RESPONSE ||\n event.data.response.id !== message.request.id\n ) {\n return\n }\n\n window.removeEventListener('message', listener)\n if ('error' in event.data.response) {\n reject(event.data.response.error)\n } else {\n resolve(event.data.response)\n }\n }\n\n window.addEventListener('message', listener)\n })\n }\n\n submitResponse = (id: string | number | null, payload: ResponsePayload) => {\n const message: SpliceMessage = {\n response: jsonRpcResponse(id, payload),\n type: WalletEvent.SPLICE_WALLET_RESPONSE,\n }\n this.win.postMessage(message, '*')\n }\n}\n\nexport class HttpTransport implements RpcTransport {\n constructor(\n private url: URL,\n private accessToken?: string\n ) {}\n\n protected async handleErrorResponse(response: Response): Promise<never> {\n const body = await response.text()\n\n // if the response uses the RPC error format, throw it as is\n let rpcError: unknown\n try {\n const parsedBody = JSON.parse(body)\n if (ErrorResponse.safeParse(parsedBody).success) {\n rpcError = parsedBody\n }\n } catch {\n // ignore JSON parse errors\n }\n if (rpcError !== undefined) {\n throw rpcError\n }\n\n throw {\n error: {\n code: response.status,\n message: response.statusText,\n data: body,\n },\n }\n }\n\n async submit(payload: RequestPayload): Promise<ResponsePayload> {\n const request: JsonRpcRequest = {\n jsonrpc: '2.0',\n method: payload.method,\n params: payload.params,\n id: uuidv4(),\n }\n\n const header = this.accessToken\n ? { Authorization: `Bearer ${this.accessToken}` }\n : undefined\n\n const response = await fetch(this.url.href, {\n method: 'POST',\n headers: {\n ...header,\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(request),\n })\n\n if (!response.ok) {\n return this.handleErrorResponse(response)\n }\n\n const json = await response.json()\n const parsed = ResponsePayload.parse(json)\n\n if ('error' in parsed) {\n throw parsed\n }\n\n return parsed\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,MAAa,kBACT,IACA,YACiB;CACjB,OAAO;EACH,SAAS;EACT;EACA,GAAG;CACP;AACJ;AAEA,MAAa,mBACT,IACA,YACkB;CAClB,OAAO;EACH,SAAS;EACT;EACA,GAAG;CACP;AACJ;AAoBA,IAAa,kBAAb,MAAqD;CAIjD,YACI,KACA,UAA0C,CAAC,GAC7C;EAFU,KAAA,MAAA;EACA,KAAA,UAAA;EALJ,gBAAA,MAAA,wCAAuB,IAAI,IAAyB,CAAA;EACpD,gBAAA,MAAA,wBAAA,KAAA,CAAA;;;;;;;;;GAaR;IAAkB,YAA+C;IAC7D,KAAK,qBAAqB,IAAI,OAAO;IACrC,IAAI,CAAC,KAAK,sBAAsB;KAC5B,KAAK,wBAAwB,UAAwB;MACjD,IACI,CAAC,qBAAqB,KAAK,KAC3B,MAAM,KAAK,SAAS,YAAY,uBAEhC;MAMJ,IAAI,MAAM,KAAK,QAAQ,M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KAAA,cAAA;CACT;CAEH,MAAgB,oBAAoB,UAAoC;EACpE,MAAM,OAAO,MAAM,SAAS,KAAK;EAGjC,IAAI;EACJ,IAAI;GACA,MAAM,aAAa,KAAK,MAAM,IAAI;GAClC,IAAI,cAAc,UAAU,UAAU,CAAC,CAAC,SACpC,WAAW;EAEnB,QAAQ,CAER;EACA,IAAI,aAAa,KAAA,GACb,MAAM;EAGV,MAAM,EACF,OAAO;GACH,MAAM,SAAS;GACf,SAAS,SAAS;GAClB,MAAM;EACV,EACJ;CACJ;CAEA,MAAM,OAAO,SAAmD;EAC5D,MAAM,UAA0B;GAC5B,SAAS;GACT,QAAQ,QAAQ;GAChB,QAAQ,QAAQ;GAChB,IAAIA,GAAO;EACf;EAEA,MAAM,SAAS,KAAK,cACd,EAAE,eAAe,UAAU,KAAK,cAAc,IAC9C,KAAA;EAEN,MAAM,WAAW,MAAM,MAAM,KAAK,IAAI,MAAM;GACxC,QAAQ;GACR,SAAS;IACL,GAAG;IACH,gBAAgB;GACpB;GACA,MAAM,KAAK,UAAU,OAAO;EAChC,CAAC;EAED,IAAI,CAAC,SAAS,IACV,OAAO,KAAK,oBAAoB,QAAQ;EAG5C,MAAM,OAAO,MAAM,SAAS,KAAK;EACjC,MAAM,SAAS,gBAAgB,MAAM,IAAI;EAEzC,IAAI,WAAW,QACX,MAAM;EAGV,OAAO;CACX;AACJ"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canton-network/core-rpc-transport",
3
- "version": "1.12.0",
3
+ "version": "1.12.1-backport.3",
4
4
  "type": "module",
5
5
  "description": "RPC transport implementations",
6
6
  "license": "Apache-2.0",
@@ -17,16 +17,16 @@
17
17
  }
18
18
  },
19
19
  "dependencies": {
20
- "@canton-network/core-types": "^1.12.0",
21
- "uuid": "^14.0.1"
20
+ "@canton-network/core-types": "^1.12.1-backport.3",
21
+ "uuid": "^14.0.3"
22
22
  },
23
23
  "devDependencies": {
24
- "@vitest/browser-playwright": "^4.1.10",
25
- "@vitest/coverage-v8": "^4.1.10",
24
+ "@vitest/browser-playwright": "^4.1.12",
25
+ "@vitest/coverage-v8": "^4.1.12",
26
26
  "playwright": "^1.61.1",
27
- "tsdown": "^0.22.9",
27
+ "tsdown": "^0.22.14",
28
28
  "typescript": "^5.9.3",
29
- "vitest": "^4.1.10"
29
+ "vitest": "^4.1.12"
30
30
  },
31
31
  "files": [
32
32
  "dist/**"