@metamask/connect-multichain 0.8.0 → 0.10.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.
Files changed (58) hide show
  1. package/CHANGELOG.md +32 -1
  2. package/README.md +38 -25
  3. package/dist/browser/es/connect-multichain.d.mts +31 -8
  4. package/dist/browser/es/connect-multichain.mjs +87 -68
  5. package/dist/browser/es/connect-multichain.mjs.map +1 -1
  6. package/dist/browser/es/metafile-esm.json +1 -1
  7. package/dist/browser/iife/connect-multichain.d.ts +31 -8
  8. package/dist/browser/iife/connect-multichain.js +100 -84
  9. package/dist/browser/iife/connect-multichain.js.map +1 -1
  10. package/dist/browser/iife/metafile-iife.json +1 -1
  11. package/dist/browser/umd/connect-multichain.d.ts +31 -8
  12. package/dist/browser/umd/connect-multichain.js +87 -68
  13. package/dist/browser/umd/connect-multichain.js.map +1 -1
  14. package/dist/browser/umd/metafile-cjs.json +1 -1
  15. package/dist/node/cjs/connect-multichain.d.ts +31 -8
  16. package/dist/node/cjs/connect-multichain.js +87 -67
  17. package/dist/node/cjs/connect-multichain.js.map +1 -1
  18. package/dist/node/cjs/metafile-cjs.json +1 -1
  19. package/dist/node/es/connect-multichain.d.mts +31 -8
  20. package/dist/node/es/connect-multichain.mjs +87 -67
  21. package/dist/node/es/connect-multichain.mjs.map +1 -1
  22. package/dist/node/es/metafile-esm.json +1 -1
  23. package/dist/react-native/es/connect-multichain.d.mts +31 -8
  24. package/dist/react-native/es/connect-multichain.mjs +87 -67
  25. package/dist/react-native/es/connect-multichain.mjs.map +1 -1
  26. package/dist/react-native/es/metafile-esm.json +1 -1
  27. package/dist/src/domain/multichain/api/infura.d.ts +13 -1
  28. package/dist/src/domain/multichain/api/infura.d.ts.map +1 -1
  29. package/dist/src/domain/multichain/api/infura.js +17 -5
  30. package/dist/src/domain/multichain/api/infura.js.map +1 -1
  31. package/dist/src/domain/multichain/index.d.ts +1 -1
  32. package/dist/src/domain/multichain/index.d.ts.map +1 -1
  33. package/dist/src/domain/multichain/index.js +3 -3
  34. package/dist/src/domain/multichain/index.js.map +1 -1
  35. package/dist/src/domain/multichain/types.d.ts +12 -1
  36. package/dist/src/domain/multichain/types.d.ts.map +1 -1
  37. package/dist/src/multichain/index.d.ts.map +1 -1
  38. package/dist/src/multichain/index.js +24 -17
  39. package/dist/src/multichain/index.js.map +1 -1
  40. package/dist/src/multichain/rpc/requestRouter.d.ts +3 -2
  41. package/dist/src/multichain/rpc/requestRouter.d.ts.map +1 -1
  42. package/dist/src/multichain/rpc/requestRouter.js +14 -15
  43. package/dist/src/multichain/rpc/requestRouter.js.map +1 -1
  44. package/dist/src/multichain/transports/default/index.d.ts.map +1 -1
  45. package/dist/src/multichain/transports/default/index.js +7 -1
  46. package/dist/src/multichain/transports/default/index.js.map +1 -1
  47. package/dist/src/multichain/utils/analytics.d.ts +6 -6
  48. package/dist/src/multichain/utils/analytics.d.ts.map +1 -1
  49. package/dist/src/multichain/utils/analytics.js +8 -12
  50. package/dist/src/multichain/utils/analytics.js.map +1 -1
  51. package/dist/src/ui/ModalFactory.d.ts.map +1 -1
  52. package/dist/src/ui/ModalFactory.js +1 -3
  53. package/dist/src/ui/ModalFactory.js.map +1 -1
  54. package/dist/src/ui/modals/web/install.d.ts.map +1 -1
  55. package/dist/src/ui/modals/web/install.js +0 -1
  56. package/dist/src/ui/modals/web/install.js.map +1 -1
  57. package/dist/types/connect-multichain.d.ts +31 -8
  58. package/package.json +3 -3
@@ -16142,10 +16142,16 @@ var MetaMaskSDK = (() => {
16142
16142
  });
16143
16143
 
16144
16144
  // src/domain/multichain/api/infura.ts
16145
- function getInfuraRpcUrls(infuraAPIKey) {
16146
- return Object.keys(infuraRpcUrls).reduce((acc, key) => {
16147
- const typedKey = key;
16148
- acc[typedKey] = `${infuraRpcUrls[typedKey]}${infuraAPIKey}`;
16145
+ function getInfuraRpcUrls({
16146
+ infuraApiKey,
16147
+ caipChainIds
16148
+ }) {
16149
+ const keys = caipChainIds && caipChainIds.length > 0 ? caipChainIds : Object.keys(infuraRpcUrls);
16150
+ return keys.reduce((acc, key) => {
16151
+ const baseUrl = infuraRpcUrls[key];
16152
+ if (baseUrl) {
16153
+ acc[key] = `${baseUrl}${infuraApiKey}`;
16154
+ }
16149
16155
  return acc;
16150
16156
  }, {});
16151
16157
  }
@@ -16187,7 +16193,7 @@ var MetaMaskSDK = (() => {
16187
16193
  }
16188
16194
  /**
16189
16195
  * Merges the given options into the current instance options.
16190
- * Only the mergeable keys are updated (api.supportedNetworks, ui.*, mobile.*, transport.extensionId, debug).
16196
+ * Only the mergeable keys are updated (api.supportedNetworks, versions, ui.*, mobile.*, transport.extensionId, debug).
16191
16197
  * The main thing to note is that the value for `dapp` is not merged as it does not make sense for
16192
16198
  * subsequent calls to `createMultichainClient` to have a different `dapp` value.
16193
16199
  * Used when createMultichainClient is called with an existing singleton.
@@ -16195,22 +16201,23 @@ var MetaMaskSDK = (() => {
16195
16201
  * @param partial - Options to merge/overwrite onto the current instance
16196
16202
  */
16197
16203
  mergeOptions(partial) {
16198
- var _a4, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
16204
+ var _a4, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o;
16199
16205
  const opts = this.options;
16200
16206
  this.options = __spreadProps(__spreadValues({}, opts), {
16201
16207
  api: __spreadProps(__spreadValues({}, opts.api), {
16202
16208
  supportedNetworks: __spreadValues(__spreadValues({}, opts.api.supportedNetworks), (_b = (_a4 = partial.api) == null ? void 0 : _a4.supportedNetworks) != null ? _b : {})
16203
16209
  }),
16210
+ versions: __spreadValues(__spreadValues({}, opts.versions), (_c = partial.versions) != null ? _c : {}),
16204
16211
  ui: __spreadProps(__spreadValues({}, opts.ui), {
16205
- headless: (_d = (_c = partial.ui) == null ? void 0 : _c.headless) != null ? _d : opts.ui.headless,
16206
- preferExtension: (_f = (_e = partial.ui) == null ? void 0 : _e.preferExtension) != null ? _f : opts.ui.preferExtension,
16207
- showInstallModal: (_h = (_g = partial.ui) == null ? void 0 : _g.showInstallModal) != null ? _h : opts.ui.showInstallModal
16212
+ headless: (_e = (_d = partial.ui) == null ? void 0 : _d.headless) != null ? _e : opts.ui.headless,
16213
+ preferExtension: (_g = (_f = partial.ui) == null ? void 0 : _f.preferExtension) != null ? _g : opts.ui.preferExtension,
16214
+ showInstallModal: (_i = (_h = partial.ui) == null ? void 0 : _h.showInstallModal) != null ? _i : opts.ui.showInstallModal
16208
16215
  }),
16209
- mobile: __spreadValues(__spreadValues({}, opts.mobile), (_i = partial.mobile) != null ? _i : {}),
16210
- transport: __spreadProps(__spreadValues({}, (_j = opts.transport) != null ? _j : {}), {
16211
- extensionId: (_m = (_k = partial.transport) == null ? void 0 : _k.extensionId) != null ? _m : (_l = opts.transport) == null ? void 0 : _l.extensionId
16216
+ mobile: __spreadValues(__spreadValues({}, opts.mobile), (_j = partial.mobile) != null ? _j : {}),
16217
+ transport: __spreadProps(__spreadValues({}, (_k = opts.transport) != null ? _k : {}), {
16218
+ extensionId: (_n = (_l = partial.transport) == null ? void 0 : _l.extensionId) != null ? _n : (_m = opts.transport) == null ? void 0 : _m.extensionId
16212
16219
  }),
16213
- debug: (_n = partial.debug) != null ? _n : opts.debug
16220
+ debug: (_o = partial.debug) != null ? _o : opts.debug
16214
16221
  });
16215
16222
  }
16216
16223
  };
@@ -17048,35 +17055,30 @@ var MetaMaskSDK = (() => {
17048
17055
  }
17049
17056
  function getBaseAnalyticsProperties(options, storage) {
17050
17057
  return __async(this, null, function* () {
17051
- var _a4, _b;
17052
- const version = getVersion();
17058
+ var _a4;
17053
17059
  const dappId = getDappId(options.dapp);
17054
17060
  const platform = getPlatformType();
17055
17061
  const anonId = yield storage.getAnonId();
17056
- const integrationType = (_b = (_a4 = options.analytics) == null ? void 0 : _a4.integrationType) != null ? _b : "unknown" /* UNKNOWN */;
17057
17062
  return {
17058
- mmconnect_version: version,
17063
+ mmconnect_versions: (_a4 = options.versions) != null ? _a4 : {},
17059
17064
  dapp_id: dappId,
17060
17065
  platform,
17061
- integration_type: integrationType,
17062
17066
  anon_id: anonId
17063
17067
  };
17064
17068
  });
17065
17069
  }
17066
- function getWalletActionAnalyticsProperties(options, storage, invokeOptions) {
17070
+ function getWalletActionAnalyticsProperties(options, storage, invokeOptions, transportType) {
17067
17071
  return __async(this, null, function* () {
17068
- var _a4, _b;
17069
- const version = getVersion();
17072
+ var _a4;
17070
17073
  const dappId = getDappId(options.dapp);
17071
17074
  const anonId = yield storage.getAnonId();
17072
- const integrationType = (_b = (_a4 = options.analytics) == null ? void 0 : _a4.integrationType) != null ? _b : "unknown";
17073
17075
  return {
17074
- mmconnect_version: version,
17076
+ mmconnect_versions: (_a4 = options.versions) != null ? _a4 : {},
17075
17077
  dapp_id: dappId,
17076
17078
  method: invokeOptions.request.method,
17077
- integration_type: integrationType,
17078
17079
  caip_chain_id: invokeOptions.scope,
17079
- anon_id: anonId
17080
+ anon_id: anonId,
17081
+ transport_type: transportType
17080
17082
  };
17081
17083
  });
17082
17084
  }
@@ -31988,14 +31990,6 @@ var MetaMaskSDK = (() => {
31988
31990
  mm_install_modal: () => InstallModal,
31989
31991
  mm_otp_modal: () => OtpModal
31990
31992
  });
31991
- function SDKVersion({ version }) {
31992
- return h(
31993
- "div",
31994
- { class: "version-title" },
31995
- "SDK Version ",
31996
- version ? `v${version}` : `unknown`
31997
- );
31998
- }
31999
31993
  function getDefaultExportFromCjs(x) {
32000
31994
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
32001
31995
  }
@@ -33260,7 +33254,7 @@ ${new this._window.XMLSerializer().serializeToString(e3)}`;
33260
33254
  };
33261
33255
  foxSvg = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCAxNDIgMTM3Ij4KICA8cGF0aCBmaWxsPSIjRkY1QzE2IiBkPSJt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jIuNzM1di0xMi40NTNoMTYuMDNaIi8+CiAgPHBhdGggZmlsbD0iI0U3RUJGNiIgZD0ibTM5Ljc0MiAxMjIuNjYyIDIzLjAwNiAxMy43NTR2LTEyLjQ1M2wtMi4wNi03LjU0MS0yMC45NDYgNi4yNFptNjIuMDMxIDAtMjMuMDA3IDEzLjc1NHYtMTIuNDUzbDIuMDYtNy41NDEgMjAuOTQ3IDYuMjRaIi8+Cjwvc3ZnPgo=";
33262
33256
  SVG = foxSvg;
33263
- styleCss$1 = "@font-face{font-family:'Euclid Circular B';src:url('../assets/fonts/Euclid Circular B Regular.ttf') format('truetype');font-weight:400;font-style:normal;font-display:swap}.flexContainer{display:flex;justify-content:center;align-items:center;flex-direction:row}.flexItem11{flex:11;justify-content:center;align-items:center}.flexItem1{flex:1;justify-content:center;align-items:center}.button{margin-top:41.5px;margin-bottom:20px;width:100%;display:flex;flex-direction:row;justify-content:center;align-items:center;padding:12px 20px;background:#0376C9;border-radius:32px;color:white;border:0;font-size:14px;cursor:pointer}.backdrop{visibility:visible;position:fixed;top:0;left:0;right:0;bottom:0;width:100%;z-index:99998;background:rgba(0, 0, 0, 0.87);opacity:0.3}.modal{visibility:visible;position:fixed;left:50%;transform:translate(-50%, -50%);z-index:99999;background:white;padding:20px;border-radius:8px;top:50%;max-width:360px;width:460px;min-width:300px;box-shadow:rgba(0, 0, 0, 0.2) 0px 11px 15px -7px, rgba(0, 0, 0, 0.14) 0px 24px 38px 3px, rgba(0, 0, 0, 0.12) 0px 9px 46px 8px;-webkit-font-smoothing:antialiased}.sectionDivider{height:1px;background-color:#B7BBC866;margin-top:17px;margin-bottom:10px}.closeButtonContainer{position:absolute;right:15px;top:15px;padding:10px;user-select:none}.buttonText{margin-left:10px}.closeButton{color:#BBC0C5;cursor:pointer;user-select:none}.right{display:flex;align-items:center;justify-content:right}#sdk-mm-qrcode{margin-top:10px;margin-bottom:10px;display:flex;justify-content:center;align-items:center;border:none !important;outline:none !important;box-shadow:none !important}#sdk-mm-qrcode svg{width:100% !important;height:auto !important;border:none !important;outline:none !important;box-shadow:none !important;stroke:none !important;stroke-width:0 !important;background:transparent !important}*{font-family:'Euclid Circular B', sans-serif}.modalTitle{font-size:16px;font-weight:700;letter-spacing:0px;line-height:24px;color:#141618;margin-top:4px;text-align:center;user-select:none}.sectionTitle{text-align:center;font-size:14px;font-weight:500;margin-bottom:0px;margin-top:20px;font-weight:bold}.sectionDescription{text-align:center;font-size:14px;font-weight:400;margin-top:5px;color:#6A737D}.extensionButton{padding:15px 20px;margin-top:15px;margin-bottom:0px}.qrContainer{display:flex;justify-content:center;align-items:center;width:100%}.qrCode{margin:0 auto;display:flex;justify-content:center;align-items:center}.version-title{text-align:center;font-size:10px;font-weight:400;margin-top:5px;color:#6A737D}";
33257
+ styleCss$1 = "@font-face{font-family:'Euclid Circular B';src:url('../assets/fonts/Euclid Circular B Regular.ttf') format('truetype');font-weight:400;font-style:normal;font-display:swap}.flexContainer{display:flex;justify-content:center;align-items:center;flex-direction:row}.flexItem11{flex:11;justify-content:center;align-items:center}.flexItem1{flex:1;justify-content:center;align-items:center}.button{margin-top:41.5px;margin-bottom:20px;width:100%;display:flex;flex-direction:row;justify-content:center;align-items:center;padding:12px 20px;background:#0376C9;border-radius:32px;color:white;border:0;font-size:14px;cursor:pointer}.backdrop{visibility:visible;position:fixed;top:0;left:0;right:0;bottom:0;width:100%;z-index:99998;background:rgba(0, 0, 0, 0.87);opacity:0.3}.modal{visibility:visible;position:fixed;left:50%;transform:translate(-50%, -50%);z-index:99999;background:white;padding:20px;border-radius:8px;top:50%;max-width:360px;width:460px;min-width:300px;box-shadow:rgba(0, 0, 0, 0.2) 0px 11px 15px -7px, rgba(0, 0, 0, 0.14) 0px 24px 38px 3px, rgba(0, 0, 0, 0.12) 0px 9px 46px 8px;-webkit-font-smoothing:antialiased}.sectionDivider{height:1px;background-color:#B7BBC866;margin-top:17px;margin-bottom:10px}.closeButtonContainer{position:absolute;right:15px;top:15px;padding:10px;user-select:none}.buttonText{margin-left:10px}.closeButton{color:#BBC0C5;cursor:pointer;user-select:none}.right{display:flex;align-items:center;justify-content:right}#sdk-mm-qrcode{margin-top:10px;margin-bottom:10px;display:flex;justify-content:center;align-items:center;border:none !important;outline:none !important;box-shadow:none !important}#sdk-mm-qrcode svg{width:100% !important;height:auto !important;border:none !important;outline:none !important;box-shadow:none !important;stroke:none !important;stroke-width:0 !important;background:transparent !important}*{font-family:'Euclid Circular B', sans-serif}.modalTitle{font-size:16px;font-weight:700;letter-spacing:0px;line-height:24px;color:#141618;margin-top:4px;text-align:center;user-select:none}.sectionTitle{text-align:center;font-size:14px;font-weight:500;margin-bottom:0px;margin-top:20px;font-weight:bold}.sectionDescription{text-align:center;font-size:14px;font-weight:400;margin-top:5px;color:#6A737D}.extensionButton{padding:15px 20px;margin-top:15px;margin-bottom:0px}.qrContainer{display:flex;justify-content:center;align-items:center;width:100%}.qrCode{margin:0 auto;display:flex;justify-content:center;align-items:center}";
33264
33258
  MmInstallModalStyle0 = styleCss$1;
33265
33259
  InstallModal = class {
33266
33260
  constructor(hostRef) {
@@ -33271,7 +33265,6 @@ ${new this._window.XMLSerializer().serializeToString(e3)}`;
33271
33265
  this.updateExpiresIn = createEvent(this, "updateExpiresIn", 7);
33272
33266
  this.link = void 0;
33273
33267
  this.expiresIn = void 0;
33274
- this.sdkVersion = void 0;
33275
33268
  this.showInstallModal = void 0;
33276
33269
  this.translationsLoaded = false;
33277
33270
  this.onClose = this.onClose.bind(this);
@@ -33360,7 +33353,7 @@ ${new this._window.XMLSerializer().serializeToString(e3)}`;
33360
33353
  if (el)
33361
33354
  this.qrCodeContainer = el;
33362
33355
  } }))), h("div", { class: "sectionDivider" }), h("div", { class: "connectionSection" }, h("h3", { class: "sectionTitle" }, t("USE_EXTENSION")), h("p", { class: "sectionDescription" }, t("INSTALL_MODAL.INSTALL_META_MASK_EXTENSION_TEXT")), h("button", { class: "button extensionButton", onClick: () => this.onStartDesktopOnboardingHandler() }, h(InstallIcon$1, null), h("span", { class: "buttonText" }, t("INSTALL_MODAL.INSTALL_META_MASK_EXTENSION_BUTTON")))))
33363
- )), h(SDKVersion, { version: this.sdkVersion })));
33356
+ ))));
33364
33357
  }
33365
33358
  get el() {
33366
33359
  return getElement(this);
@@ -33373,7 +33366,7 @@ ${new this._window.XMLSerializer().serializeToString(e3)}`;
33373
33366
  }
33374
33367
  };
33375
33368
  InstallModal.style = MmInstallModalStyle0;
33376
- styleCss = "@font-face{font-family:'Euclid Circular B';src:url('../assets/fonts/Euclid Circular B Regular.ttf') format('truetype');font-weight:400;font-style:normal;font-display:swap}.flexContainer{display:flex;justify-content:center;align-items:center;flex-direction:row}.flexItem11{flex:11;justify-content:center;align-items:center}.flexItem1{flex:1;justify-content:center;align-items:center}.button{margin-top:41.5px;margin-bottom:20px;width:100%;display:flex;flex-direction:row;justify-content:center;align-items:center;padding:12px 20px;background:#0376C9;border-radius:32px;color:white;border:0;font-size:14px;cursor:pointer}.backdrop{visibility:visible;position:fixed;top:0;left:0;right:0;bottom:0;width:100%;z-index:99998;background:rgba(0, 0, 0, 0.87);opacity:0.3}.modal{visibility:visible;position:fixed;left:50%;transform:translate(-50%, -50%);z-index:99999;background:white;padding:20px;border-radius:8px;top:50%;max-width:360px;width:460px;min-width:300px;box-shadow:rgba(0, 0, 0, 0.2) 0px 11px 15px -7px, rgba(0, 0, 0, 0.14) 0px 24px 38px 3px, rgba(0, 0, 0, 0.12) 0px 9px 46px 8px;-webkit-font-smoothing:antialiased}.sectionDivider{height:1px;background-color:#B7BBC866;margin-top:17px;margin-bottom:10px}.closeButtonContainer{position:absolute;right:15px;top:15px;padding:10px;user-select:none}.buttonText{margin-left:10px}.closeButton{color:#BBC0C5;cursor:pointer;user-select:none}.right{display:flex;align-items:center;justify-content:right}#sdk-mm-qrcode{margin-top:10px;margin-bottom:10px;display:flex;justify-content:center;align-items:center;border:none !important;outline:none !important;box-shadow:none !important}#sdk-mm-qrcode svg{width:100% !important;height:auto !important;border:none !important;outline:none !important;box-shadow:none !important;stroke:none !important;stroke-width:0 !important;background:transparent !important}*{font-family:'Euclid Circular B', sans-serif}.modalTitle{font-size:16px;font-weight:700;letter-spacing:0px;line-height:24px;color:#141618;margin-top:4px;text-align:center;user-select:none}.sectionTitle{text-align:center;font-size:14px;font-weight:500;margin-bottom:0px;margin-top:20px;font-weight:bold}.sectionDescription{text-align:center;font-size:14px;font-weight:400;margin-top:5px;color:#6A737D}.extensionButton{padding:15px 20px;margin-top:15px;margin-bottom:0px}.qrContainer{display:flex;justify-content:center;align-items:center;width:100%}.qrCode{margin:0 auto;display:flex;justify-content:center;align-items:center}.version-title{text-align:center;font-size:10px;font-weight:400;margin-top:5px;color:#6A737D}";
33369
+ styleCss = "@font-face{font-family:'Euclid Circular B';src:url('../assets/fonts/Euclid Circular B Regular.ttf') format('truetype');font-weight:400;font-style:normal;font-display:swap}.flexContainer{display:flex;justify-content:center;align-items:center;flex-direction:row}.flexItem11{flex:11;justify-content:center;align-items:center}.flexItem1{flex:1;justify-content:center;align-items:center}.button{margin-top:41.5px;margin-bottom:20px;width:100%;display:flex;flex-direction:row;justify-content:center;align-items:center;padding:12px 20px;background:#0376C9;border-radius:32px;color:white;border:0;font-size:14px;cursor:pointer}.backdrop{visibility:visible;position:fixed;top:0;left:0;right:0;bottom:0;width:100%;z-index:99998;background:rgba(0, 0, 0, 0.87);opacity:0.3}.modal{visibility:visible;position:fixed;left:50%;transform:translate(-50%, -50%);z-index:99999;background:white;padding:20px;border-radius:8px;top:50%;max-width:360px;width:460px;min-width:300px;box-shadow:rgba(0, 0, 0, 0.2) 0px 11px 15px -7px, rgba(0, 0, 0, 0.14) 0px 24px 38px 3px, rgba(0, 0, 0, 0.12) 0px 9px 46px 8px;-webkit-font-smoothing:antialiased}.sectionDivider{height:1px;background-color:#B7BBC866;margin-top:17px;margin-bottom:10px}.closeButtonContainer{position:absolute;right:15px;top:15px;padding:10px;user-select:none}.buttonText{margin-left:10px}.closeButton{color:#BBC0C5;cursor:pointer;user-select:none}.right{display:flex;align-items:center;justify-content:right}#sdk-mm-qrcode{margin-top:10px;margin-bottom:10px;display:flex;justify-content:center;align-items:center;border:none !important;outline:none !important;box-shadow:none !important}#sdk-mm-qrcode svg{width:100% !important;height:auto !important;border:none !important;outline:none !important;box-shadow:none !important;stroke:none !important;stroke-width:0 !important;background:transparent !important}*{font-family:'Euclid Circular B', sans-serif}.modalTitle{font-size:16px;font-weight:700;letter-spacing:0px;line-height:24px;color:#141618;margin-top:4px;text-align:center;user-select:none}.sectionTitle{text-align:center;font-size:14px;font-weight:500;margin-bottom:0px;margin-top:20px;font-weight:bold}.sectionDescription{text-align:center;font-size:14px;font-weight:400;margin-top:5px;color:#6A737D}.extensionButton{padding:15px 20px;margin-top:15px;margin-bottom:0px}.qrContainer{display:flex;justify-content:center;align-items:center;width:100%}.qrCode{margin:0 auto;display:flex;justify-content:center;align-items:center}";
33377
33370
  MmOtpModalStyle0 = styleCss;
33378
33371
  OtpModal = class {
33379
33372
  constructor(hostRef) {
@@ -33382,7 +33375,6 @@ ${new this._window.XMLSerializer().serializeToString(e3)}`;
33382
33375
  this.disconnect = createEvent(this, "disconnect", 7);
33383
33376
  this.updateOTPCode = createEvent(this, "updateOTPCode", 7);
33384
33377
  this.displayOTP = void 0;
33385
- this.sdkVersion = void 0;
33386
33378
  this.otpCode = void 0;
33387
33379
  this.translationsLoaded = false;
33388
33380
  this.i18nInstance = new SimpleI18n();
@@ -33415,7 +33407,6 @@ ${new this._window.XMLSerializer().serializeToString(e3)}`;
33415
33407
  return null;
33416
33408
  }
33417
33409
  const displayOTP = (_a4 = this.displayOTP) !== null && _a4 !== void 0 ? _a4 : true;
33418
- const sdkVersion = this.sdkVersion;
33419
33410
  const t = (key) => this.i18nInstance.t(key);
33420
33411
  return h(WidgetWrapper, { className: "pending-modal" }, h("div", { class: "backdrop", onClick: () => this.onClose() }), h("div", { class: "modal" }, h("div", { class: "closeButtonContainer" }, h("div", { class: "right" }, h("span", { class: "closeButton", onClick: () => this.onClose() }, h(CloseButton$1, null)))), h("div", { class: "logoContainer" }, h(InstallIcon$1, null)), h("div", null, h("div", { class: "flexContainer", style: {
33421
33412
  flexDirection: "column",
@@ -33432,7 +33423,7 @@ ${new this._window.XMLSerializer().serializeToString(e3)}`;
33432
33423
  borderWidth: "1px",
33433
33424
  borderStyle: "solid",
33434
33425
  backgroundColor: "white"
33435
- }, onClick: () => this.onDisconnect() }, t("PENDING_MODAL.DISCONNECT")))), h(SDKVersion, { version: sdkVersion })));
33426
+ }, onClick: () => this.onDisconnect() }, t("PENDING_MODAL.DISCONNECT"))))));
33436
33427
  }
33437
33428
  get el() {
33438
33429
  return getElement(this);
@@ -34715,7 +34706,7 @@ ${new this._window.XMLSerializer().serializeToString(e3)}`;
34715
34706
  defineCustomElements = (win2, options) => __async(null, null, function* () {
34716
34707
  if (typeof window === "undefined") return void 0;
34717
34708
  yield globalScripts();
34718
- return bootstrapLazy([["mm-install-modal_2", [[1, "mm-install-modal", { "link": [1], "expiresIn": [2, "expires-in"], "sdkVersion": [1, "sdk-version"], "showInstallModal": [4, "show-install-modal"], "translationsLoaded": [32] }, null, { "link": ["updateLinkHandler"], "expiresIn": ["updateExpiresInHandler"] }], [1, "mm-otp-modal", { "displayOTP": [4, "display-o-t-p"], "sdkVersion": [1, "sdk-version"], "otpCode": [1, "otp-code"], "translationsLoaded": [32] }]]]], options);
34709
+ return bootstrapLazy([["mm-install-modal_2", [[1, "mm-install-modal", { "link": [1], "expiresIn": [2, "expires-in"], "showInstallModal": [4, "show-install-modal"], "translationsLoaded": [32] }, null, { "link": ["updateLinkHandler"], "expiresIn": ["updateExpiresInHandler"] }], [1, "mm-otp-modal", { "displayOTP": [4, "display-o-t-p"], "otpCode": [1, "otp-code"], "translationsLoaded": [32] }]]]], options);
34719
34710
  });
34720
34711
  }
34721
34712
  });
@@ -34875,7 +34866,6 @@ ${new this._window.XMLSerializer().serializeToString(e3)}`;
34875
34866
  "mm-install-modal"
34876
34867
  );
34877
34868
  modal.showInstallModal = options.showInstallModal;
34878
- modal.sdkVersion = options.sdkVersion;
34879
34869
  modal.addEventListener("close", (ev) => {
34880
34870
  const { detail } = ev;
34881
34871
  options.onClose(detail == null ? void 0 : detail.shouldTerminate);
@@ -35650,6 +35640,14 @@ ${new this._window.XMLSerializer().serializeToString(e3)}`;
35650
35640
  this.enabled = true;
35651
35641
  }
35652
35642
  setGlobalProperty(key, value) {
35643
+ if (key === "integration_types") {
35644
+ const existing = Array.isArray(this.properties.integration_types) ? this.properties.integration_types : [];
35645
+ const incoming = Array.isArray(value) ? value : [];
35646
+ this.properties.integration_types = [
35647
+ .../* @__PURE__ */ new Set([...existing, ...incoming])
35648
+ ];
35649
+ return;
35650
+ }
35653
35651
  this.properties[key] = value;
35654
35652
  }
35655
35653
  track(eventName, properties) {
@@ -36640,10 +36638,11 @@ ${new this._window.XMLSerializer().serializeToString(e3)}`;
36640
36638
  init_analytics();
36641
36639
  var _RequestRouter_instances, withAnalyticsTracking_fn, trackWalletActionRequested_fn, trackWalletActionSucceeded_fn, trackWalletActionFailed_fn, trackWalletActionRejected_fn;
36642
36640
  var RequestRouter = class {
36643
- constructor(transport, rpcClient, config) {
36641
+ constructor(transport, rpcClient, config, transportType) {
36644
36642
  this.transport = transport;
36645
36643
  this.rpcClient = rpcClient;
36646
36644
  this.config = config;
36645
+ this.transportType = transportType;
36647
36646
  __privateAdd(this, _RequestRouter_instances);
36648
36647
  }
36649
36648
  /**
@@ -36713,16 +36712,14 @@ ${new this._window.XMLSerializer().serializeToString(e3)}`;
36713
36712
  */
36714
36713
  handleWithRpcNode(options) {
36715
36714
  return __async(this, null, function* () {
36716
- return __privateMethod(this, _RequestRouter_instances, withAnalyticsTracking_fn).call(this, options, () => __async(this, null, function* () {
36717
- try {
36718
- return yield this.rpcClient.request(options);
36719
- } catch (error) {
36720
- if (error instanceof MissingRpcEndpointErr) {
36721
- return this.handleWithWallet(options);
36722
- }
36723
- throw error;
36715
+ try {
36716
+ return yield this.rpcClient.request(options);
36717
+ } catch (error) {
36718
+ if (error instanceof MissingRpcEndpointErr) {
36719
+ return this.handleWithWallet(options);
36724
36720
  }
36725
- }));
36721
+ throw error;
36722
+ }
36726
36723
  });
36727
36724
  }
36728
36725
  /**
@@ -36766,7 +36763,8 @@ ${new this._window.XMLSerializer().serializeToString(e3)}`;
36766
36763
  const props = yield getWalletActionAnalyticsProperties(
36767
36764
  this.config,
36768
36765
  this.config.storage,
36769
- options
36766
+ options,
36767
+ this.transportType
36770
36768
  );
36771
36769
  analytics.track("mmconnect_wallet_action_requested", props);
36772
36770
  });
@@ -36776,7 +36774,8 @@ ${new this._window.XMLSerializer().serializeToString(e3)}`;
36776
36774
  const props = yield getWalletActionAnalyticsProperties(
36777
36775
  this.config,
36778
36776
  this.config.storage,
36779
- options
36777
+ options,
36778
+ this.transportType
36780
36779
  );
36781
36780
  analytics.track("mmconnect_wallet_action_succeeded", props);
36782
36781
  });
@@ -36786,7 +36785,8 @@ ${new this._window.XMLSerializer().serializeToString(e3)}`;
36786
36785
  const props = yield getWalletActionAnalyticsProperties(
36787
36786
  this.config,
36788
36787
  this.config.storage,
36789
- options
36788
+ options,
36789
+ this.transportType
36790
36790
  );
36791
36791
  analytics.track("mmconnect_wallet_action_failed", props);
36792
36792
  });
@@ -36796,7 +36796,8 @@ ${new this._window.XMLSerializer().serializeToString(e3)}`;
36796
36796
  const props = yield getWalletActionAnalyticsProperties(
36797
36797
  this.config,
36798
36798
  this.config.storage,
36799
- options
36799
+ options,
36800
+ this.transportType
36800
36801
  );
36801
36802
  analytics.track("mmconnect_wallet_action_rejected", props);
36802
36803
  });
@@ -37038,7 +37039,9 @@ ${new this._window.XMLSerializer().serializeToString(e3)}`;
37038
37039
  init_fn = function() {
37039
37040
  return __async(this, null, function* () {
37040
37041
  __privateMethod(this, _DefaultTransport_instances, setupMessageListener_fn).call(this);
37041
- yield __privateGet(this, _transport).connect();
37042
+ if (!__privateGet(this, _transport).isConnected()) {
37043
+ yield __privateGet(this, _transport).connect();
37044
+ }
37042
37045
  });
37043
37046
  };
37044
37047
 
@@ -38304,16 +38307,21 @@ ${new this._window.XMLSerializer().serializeToString(e3)}`;
38304
38307
  constructor(options) {
38305
38308
  var _a4, _b, _c, _d, _e, _f;
38306
38309
  const withDappMetadata = setupDappMetadata(options);
38307
- const integrationType = (_b = (_a4 = options.analytics) == null ? void 0 : _a4.integrationType) != null ? _b : "direct";
38310
+ const integrationType = ((_a4 = options.analytics) == null ? void 0 : _a4.integrationType) || "direct";
38308
38311
  const allOptions = __spreadProps(__spreadValues({}, withDappMetadata), {
38309
38312
  ui: __spreadProps(__spreadValues({}, withDappMetadata.ui), {
38310
- preferExtension: (_c = withDappMetadata.ui.preferExtension) != null ? _c : true,
38311
- showInstallModal: (_d = withDappMetadata.ui.showInstallModal) != null ? _d : false,
38312
- headless: (_e = withDappMetadata.ui.headless) != null ? _e : false
38313
+ preferExtension: (_b = withDappMetadata.ui.preferExtension) != null ? _b : true,
38314
+ showInstallModal: (_c = withDappMetadata.ui.showInstallModal) != null ? _c : false,
38315
+ headless: (_d = withDappMetadata.ui.headless) != null ? _d : false
38313
38316
  }),
38314
- analytics: __spreadProps(__spreadValues({}, (_f = options.analytics) != null ? _f : {}), {
38317
+ analytics: __spreadProps(__spreadValues({}, (_e = options.analytics) != null ? _e : {}), {
38315
38318
  integrationType
38316
- })
38319
+ }),
38320
+ versions: __spreadValues({
38321
+ // typeof guard needed: Metro (React Native) bundles TS source directly,
38322
+ // bypassing the tsup build that substitutes __PACKAGE_VERSION__.
38323
+ "connect-multichain": false ? "unknown" : "0.10.0"
38324
+ }, (_f = options.versions) != null ? _f : {})
38317
38325
  });
38318
38326
  super(allOptions);
38319
38327
  __privateAdd(this, _MetaMaskConnectMultichain_instances);
@@ -38370,23 +38378,33 @@ ${new this._window.XMLSerializer().serializeToString(e3)}`;
38370
38378
  // Creates a singleton instance of MetaMaskConnectMultichain.
38371
38379
  // If the singleton already exists, it merges the incoming options with the
38372
38380
  // existing singleton options for the following keys: `api.supportedNetworks`,
38373
- // `ui.*`, `mobile.*`, `transport.extensionId`, `debug`. Take note that the
38374
- // value for `dapp` is not merged as it does not make sense for subsequent calls to
38375
- // `createMultichainClient` to have a different `dapp` value.
38381
+ // `versions`, `ui.*`, `mobile.*`, `transport.extensionId`, `debug`. Take note
38382
+ // that the value for `dapp` is not merged as it does not make sense for
38383
+ // subsequent calls to `createMultichainClient` to have a different `dapp` value.
38376
38384
  static create(options) {
38377
38385
  return __async(this, null, function* () {
38386
+ var _a4, _b;
38378
38387
  const globalObject = getGlobalObject();
38379
38388
  const existing = globalObject[SINGLETON_KEY];
38380
38389
  if (existing) {
38381
38390
  const instance2 = yield existing;
38382
38391
  instance2.mergeOptions(options);
38392
+ analytics.setGlobalProperty(
38393
+ "mmconnect_versions",
38394
+ (_a4 = instance2.options.versions) != null ? _a4 : {}
38395
+ );
38396
+ if ((_b = options.analytics) == null ? void 0 : _b.integrationType) {
38397
+ analytics.setGlobalProperty("integration_types", [
38398
+ options.analytics.integrationType
38399
+ ]);
38400
+ }
38383
38401
  if (options.debug) {
38384
38402
  enableDebug("metamask-sdk:*");
38385
38403
  }
38386
38404
  return instance2;
38387
38405
  }
38388
38406
  const instancePromise = (() => __async(null, null, function* () {
38389
- var _a4;
38407
+ var _a5;
38390
38408
  const instance2 = new _MetaMaskConnectMultichain(options);
38391
38409
  const isEnabled2 = yield isEnabled(
38392
38410
  "metamask-sdk:core",
@@ -38395,7 +38413,7 @@ ${new this._window.XMLSerializer().serializeToString(e3)}`;
38395
38413
  if (isEnabled2) {
38396
38414
  enableDebug("metamask-sdk:core");
38397
38415
  }
38398
- yield __privateMethod(_a4 = instance2, _MetaMaskConnectMultichain_instances, init_fn2).call(_a4);
38416
+ yield __privateMethod(_a5 = instance2, _MetaMaskConnectMultichain_instances, init_fn2).call(_a5);
38399
38417
  return instance2;
38400
38418
  }))();
38401
38419
  globalObject[SINGLETON_KEY] = instancePromise;
@@ -38523,7 +38541,12 @@ ${new this._window.XMLSerializer().serializeToString(e3)}`;
38523
38541
  return __async(this, null, function* () {
38524
38542
  const { transport, options } = this;
38525
38543
  const rpcClient = new RpcClient(options, __privateGet(this, _sdkInfo));
38526
- const requestRouter = new RequestRouter(transport, rpcClient, options);
38544
+ const requestRouter = new RequestRouter(
38545
+ transport,
38546
+ rpcClient,
38547
+ options,
38548
+ this.transportType
38549
+ );
38527
38550
  return requestRouter.invokeMethod(request2);
38528
38551
  });
38529
38552
  }
@@ -38576,24 +38599,28 @@ ${new this._window.XMLSerializer().serializeToString(e3)}`;
38576
38599
  _MetaMaskConnectMultichain_instances = new WeakSet();
38577
38600
  setupAnalytics_fn = function() {
38578
38601
  return __async(this, null, function* () {
38579
- var _a4;
38602
+ var _a4, _b;
38580
38603
  const platform = getPlatformType();
38581
38604
  const isBrowser = platform === "in-app-browser" /* MetaMaskMobileWebview */ || platform === "web-desktop" /* DesktopWeb */ || platform === "web-mobile" /* MobileWeb */;
38582
38605
  const isReactNative2 = platform === "react-native" /* ReactNative */;
38583
38606
  if (!isBrowser && !isReactNative2) {
38584
38607
  return;
38585
38608
  }
38586
- const version = getVersion();
38587
38609
  const dappId = getDappId(this.options.dapp);
38588
38610
  const anonId = yield this.storage.getAnonId();
38589
38611
  const { integrationType } = (_a4 = this.options.analytics) != null ? _a4 : {
38590
38612
  integrationType: ""
38591
38613
  };
38592
- analytics.setGlobalProperty("mmconnect_version", version);
38614
+ analytics.setGlobalProperty(
38615
+ "mmconnect_versions",
38616
+ (_b = this.options.versions) != null ? _b : {}
38617
+ );
38593
38618
  analytics.setGlobalProperty("dapp_id", dappId);
38594
38619
  analytics.setGlobalProperty("anon_id", anonId);
38595
38620
  analytics.setGlobalProperty("platform", platform);
38596
- analytics.setGlobalProperty("integration_type", integrationType);
38621
+ if (integrationType) {
38622
+ analytics.setGlobalProperty("integration_types", [integrationType]);
38623
+ }
38597
38624
  analytics.enable();
38598
38625
  });
38599
38626
  };
@@ -38680,15 +38707,6 @@ ${new this._window.XMLSerializer().serializeToString(e3)}`;
38680
38707
  try {
38681
38708
  yield __privateMethod(this, _MetaMaskConnectMultichain_instances, setupAnalytics_fn).call(this);
38682
38709
  yield __privateMethod(this, _MetaMaskConnectMultichain_instances, setupTransport_fn).call(this);
38683
- try {
38684
- const baseProps = yield getBaseAnalyticsProperties(
38685
- this.options,
38686
- this.storage
38687
- );
38688
- analytics.track("mmconnect_initialized", baseProps);
38689
- } catch (error) {
38690
- logger2("Error tracking initialized event", error);
38691
- }
38692
38710
  } catch (error) {
38693
38711
  yield this.storage.removeTransport();
38694
38712
  this.status = "pending";
@@ -39608,7 +39626,6 @@ ${new this._window.XMLSerializer().serializeToString(e3)}`;
39608
39626
  parentElement,
39609
39627
  showInstallModal,
39610
39628
  link: qrCodeLink,
39611
- sdkVersion: getVersion(),
39612
39629
  generateQRCode: (request2) => __async(this, null, function* () {
39613
39630
  var _a5;
39614
39631
  const newLink = this.createConnectionDeeplink(request2);
@@ -39634,7 +39651,6 @@ ${new this._window.XMLSerializer().serializeToString(e3)}`;
39634
39651
  const otpCode = yield createOTPCode();
39635
39652
  const modal = new this.options.OTPCodeModal({
39636
39653
  parentElement: container,
39637
- sdkVersion: getVersion(),
39638
39654
  otpCode,
39639
39655
  onClose: this.onCloseModal.bind(this),
39640
39656
  createOTPCode,