@seams/wallet 0.21.0 → 0.23.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 (129) hide show
  1. package/THIRD_PARTY_NOTICES.md +5 -2
  2. package/dist/.build-inputs.sha256 +1 -1
  3. package/dist/esm/core/signingEngine/uiConfirm/ui/preact/TransactionReceipt.js +107 -43
  4. package/dist/esm/core/signingEngine/uiConfirm/ui/preact/mountConfirmationSurface.js +1 -1
  5. package/dist/esm/core/signingEngine/uiConfirm/ui/transaction-receipt.js +36 -6
  6. package/dist/esm/core/ui/messages.js +9 -14
  7. package/dist/esm/externalNear/actions.js +26 -0
  8. package/dist/esm/externalNear/boundary.js +53 -0
  9. package/dist/esm/externalNear/controller.js +187 -0
  10. package/dist/esm/externalNear/hot.js +40 -0
  11. package/dist/esm/externalNear/index.js +3 -0
  12. package/dist/esm/externalNear/intear.js +109 -0
  13. package/dist/esm/externalNear/intearPopup.js +83 -0
  14. package/dist/esm/externalNear/meteor.js +121 -0
  15. package/dist/esm/externalNear/meteorRequest.js +117 -0
  16. package/dist/esm/externalNear/types.js +17 -0
  17. package/dist/esm/externalNear/wallets.js +33 -0
  18. package/dist/esm/node_modules/borsh/lib/esm/buffer.js +67 -0
  19. package/dist/esm/node_modules/borsh/lib/esm/deserialize.js +94 -0
  20. package/dist/esm/node_modules/borsh/lib/esm/index.js +13 -0
  21. package/dist/esm/node_modules/borsh/lib/esm/serialize.js +127 -0
  22. package/dist/esm/node_modules/borsh/lib/esm/types.js +19 -0
  23. package/dist/esm/node_modules/borsh/lib/esm/utils.js +104 -0
  24. package/dist/esm/plugins/plugin-utils.js +2 -5
  25. package/dist/esm/react/components/AccountMenuButton/ProfileDropdown.js +23 -9
  26. package/dist/esm/react/components/AccountMenuButton/TransactionSettingsSection.css +376 -84
  27. package/dist/esm/react/components/AccountMenuButton/TransactionSettingsSection.js +87 -167
  28. package/dist/esm/react/components/AccountMenuButton/WalletRegionSection.js +11 -9
  29. package/dist/esm/react/components/AccountMenuButton/WalletSettingsLayout.css +76 -74
  30. package/dist/esm/react/components/AccountMenuButton/WalletSettingsLayout.js +23 -22
  31. package/dist/esm/react/components/AccountMenuButton/Web3AuthProfileButton.css +1 -5
  32. package/dist/esm/react/components/AccountMenuButton/icons/MapPinIcon.js +12 -0
  33. package/dist/esm/react/components/AccountMenuButton/index.js +2 -1
  34. package/dist/esm/react/externalNear.css +90 -0
  35. package/dist/esm/react/externalNear.js +104 -0
  36. package/dist/esm/react/styles/styles.css +452 -162
  37. package/dist/{public/sdk/ConfirmationDrawer-B7RCp58z.js → esm/sdk/ConfirmationDrawer-Ck33ZmU-.js} +1 -1
  38. package/dist/esm/sdk/adapters-CgJpSAxH.js +2 -0
  39. package/dist/esm/sdk/appearance-token-vars-BA3KQyEE.js +2 -0
  40. package/dist/esm/sdk/{export-viewer-host-CVdpEuY6.js → export-viewer-host-C9n-62Pi.js} +1 -1
  41. package/dist/esm/sdk/{exportKeypairOperation-gVCqLrDl.js → exportKeypairOperation-Du9HKB8f.js} +1 -1
  42. package/dist/esm/sdk/host-C5KYWEcs.js +1 -0
  43. package/dist/esm/sdk/{localOnly-TXaYAZj-.js → localOnly-CvFSZFUy.js} +1 -1
  44. package/dist/esm/sdk/{mountExportPrivateKeySurface-DUnKOBQr.js → mountExportPrivateKeySurface-DdJHWwqY.js} +1 -1
  45. package/dist/esm/sdk/{mountRecoveryCodeBackupSurface-MGTl6FhG.js → mountRecoveryCodeBackupSurface-D3QFgMGE.js} +1 -1
  46. package/dist/{public/sdk/pendingWalletRecoveryCodeBackup-DWeemdJv.js → esm/sdk/pendingWalletRecoveryCodeBackup-LbstFwcY.js} +1 -1
  47. package/dist/esm/sdk/{registration-DVX_lnP7.js → registration-CIxJvbTo.js} +1 -1
  48. package/dist/esm/sdk/{registration-DeCUrUR9.js → registration-CeOmKyCG.js} +1 -1
  49. package/dist/{public/sdk/runtime-auth-BAGyfscG.js → esm/sdk/runtime-auth-C0V-5znH.js} +1 -1
  50. package/dist/{public/sdk/runtime-device-link-DKkMLVor.js → esm/sdk/runtime-device-link-B1jpHQSF.js} +1 -1
  51. package/dist/{public/sdk/runtime-ecdsa-tempo-0TAVH1xg.js → esm/sdk/runtime-ecdsa-tempo-CDSZ3pxS.js} +1 -1
  52. package/dist/esm/sdk/{runtime-email-otp-DoHa8Hif.js → runtime-email-otp-DXuxFOjL.js} +1 -1
  53. package/dist/esm/sdk/{runtime-export-CAt17IFH.js → runtime-export-Ba12ChDI.js} +1 -1
  54. package/dist/esm/sdk/{runtime-near-BQX9Jk9Z.js → runtime-near-DRrdWzmr.js} +1 -1
  55. package/dist/esm/sdk/{runtime-preferences-BuKTIpv6.js → runtime-preferences-BWyhRaBA.js} +1 -1
  56. package/dist/esm/sdk/{runtime-recovery-DyxJKKNw.js → runtime-recovery-DlJlaZlf.js} +1 -1
  57. package/dist/esm/sdk/{runtime-recovery-codes-CWmt0FDB.js → runtime-recovery-codes-CuqYWqK7.js} +1 -1
  58. package/dist/esm/sdk/{shared-BVps1f3F.js → shared-B95wnpoD.js} +1 -1
  59. package/dist/esm/sdk/transaction-activity-CpDMkSPm.js +1 -0
  60. package/dist/esm/sdk/tx-confirm-ui.js +186 -71
  61. package/dist/esm/sdk/wallet-iframe-host-ecdsa.js +1 -1
  62. package/dist/esm/sdk/wallet-iframe-host-full.js +1 -1
  63. package/dist/esm/sdk/wallet-iframe-host-near.js +1 -1
  64. package/dist/esm/sdk/wallet-iframe-host-runtime.js +1 -1
  65. package/dist/esm/sdk/wallet-ui.css +1 -1
  66. package/dist/{public/sdk/walletRecoveryAdminProof-CIoLawfC.js → esm/sdk/walletRecoveryAdminProof-CtH8_lph.js} +1 -1
  67. package/dist/public/headers.manifest.json +1 -1
  68. package/dist/{esm/sdk/ConfirmationDrawer-B7RCp58z.js → public/sdk/ConfirmationDrawer-Ck33ZmU-.js} +1 -1
  69. package/dist/public/sdk/adapters-CgJpSAxH.js +2 -0
  70. package/dist/public/sdk/appearance-token-vars-BA3KQyEE.js +2 -0
  71. package/dist/public/sdk/{export-viewer-host-CVdpEuY6.js → export-viewer-host-C9n-62Pi.js} +1 -1
  72. package/dist/public/sdk/{exportKeypairOperation-gVCqLrDl.js → exportKeypairOperation-Du9HKB8f.js} +1 -1
  73. package/dist/public/sdk/host-C5KYWEcs.js +1 -0
  74. package/dist/public/sdk/{localOnly-TXaYAZj-.js → localOnly-CvFSZFUy.js} +1 -1
  75. package/dist/public/sdk/{mountExportPrivateKeySurface-DUnKOBQr.js → mountExportPrivateKeySurface-DdJHWwqY.js} +1 -1
  76. package/dist/public/sdk/{mountRecoveryCodeBackupSurface-MGTl6FhG.js → mountRecoveryCodeBackupSurface-D3QFgMGE.js} +1 -1
  77. package/dist/{esm/sdk/pendingWalletRecoveryCodeBackup-DWeemdJv.js → public/sdk/pendingWalletRecoveryCodeBackup-LbstFwcY.js} +1 -1
  78. package/dist/public/sdk/{registration-DVX_lnP7.js → registration-CIxJvbTo.js} +1 -1
  79. package/dist/public/sdk/{registration-DeCUrUR9.js → registration-CeOmKyCG.js} +1 -1
  80. package/dist/{esm/sdk/runtime-auth-BAGyfscG.js → public/sdk/runtime-auth-C0V-5znH.js} +1 -1
  81. package/dist/{esm/sdk/runtime-device-link-DKkMLVor.js → public/sdk/runtime-device-link-B1jpHQSF.js} +1 -1
  82. package/dist/{esm/sdk/runtime-ecdsa-tempo-0TAVH1xg.js → public/sdk/runtime-ecdsa-tempo-CDSZ3pxS.js} +1 -1
  83. package/dist/public/sdk/{runtime-email-otp-DoHa8Hif.js → runtime-email-otp-DXuxFOjL.js} +1 -1
  84. package/dist/public/sdk/{runtime-export-CAt17IFH.js → runtime-export-Ba12ChDI.js} +1 -1
  85. package/dist/public/sdk/{runtime-near-BQX9Jk9Z.js → runtime-near-DRrdWzmr.js} +1 -1
  86. package/dist/public/sdk/{runtime-preferences-BuKTIpv6.js → runtime-preferences-BWyhRaBA.js} +1 -1
  87. package/dist/public/sdk/{runtime-recovery-DyxJKKNw.js → runtime-recovery-DlJlaZlf.js} +1 -1
  88. package/dist/public/sdk/{runtime-recovery-codes-CWmt0FDB.js → runtime-recovery-codes-CuqYWqK7.js} +1 -1
  89. package/dist/public/sdk/{shared-BVps1f3F.js → shared-B95wnpoD.js} +1 -1
  90. package/dist/public/sdk/transaction-activity-CpDMkSPm.js +1 -0
  91. package/dist/public/sdk/tx-confirm-ui.js +186 -71
  92. package/dist/public/sdk/wallet-iframe-host-ecdsa.js +1 -1
  93. package/dist/public/sdk/wallet-iframe-host-full.js +1 -1
  94. package/dist/public/sdk/wallet-iframe-host-near.js +1 -1
  95. package/dist/public/sdk/wallet-iframe-host-runtime.js +1 -1
  96. package/dist/public/sdk/wallet-ui.css +1 -1
  97. package/dist/{esm/sdk/walletRecoveryAdminProof-CIoLawfC.js → public/sdk/walletRecoveryAdminProof-CtH8_lph.js} +1 -1
  98. package/dist/public/wallet-assets.manifest.json +50 -51
  99. package/dist/public/wallet-service/index.html +4 -4
  100. package/dist/types/wallet/src/SeamsWeb/walletIframe/host/auth-menu/controller.d.ts +2 -0
  101. package/dist/types/wallet/src/core/signingEngine/uiConfirm/ui/transaction-activity.d.ts +2 -2
  102. package/dist/types/wallet/src/core/signingEngine/uiConfirm/ui/transaction-receipt.d.ts +25 -6
  103. package/dist/types/wallet/src/core/ui/messages.d.ts +1 -1
  104. package/dist/types/wallet/src/externalNear/actions.d.ts +20 -0
  105. package/dist/types/wallet/src/externalNear/boundary.d.ts +7 -0
  106. package/dist/types/wallet/src/externalNear/controller.d.ts +23 -0
  107. package/dist/types/wallet/src/externalNear/hot.d.ts +13 -0
  108. package/dist/types/wallet/src/externalNear/index.d.ts +4 -0
  109. package/dist/types/wallet/src/externalNear/intear.d.ts +12 -0
  110. package/dist/types/wallet/src/externalNear/intearPopup.d.ts +25 -0
  111. package/dist/types/wallet/src/externalNear/meteor.d.ts +16 -0
  112. package/dist/types/wallet/src/externalNear/meteorRequest.d.ts +29 -0
  113. package/dist/types/wallet/src/externalNear/types.d.ts +67 -0
  114. package/dist/types/wallet/src/externalNear/wallets.d.ts +4 -0
  115. package/dist/types/wallet/src/plugins/plugin-utils.d.ts +1 -1
  116. package/dist/types/wallet/src/react/components/AccountMenuButton/icons/MapPinIcon.d.ts +2 -0
  117. package/dist/types/wallet/src/react/externalNear.d.ts +26 -0
  118. package/package.json +18 -1
  119. package/dist/esm/plugins/SeamsWeb/walletIframe/sanitization.js +0 -18
  120. package/dist/esm/react/components/AccountMenuButton/SegmentedControl.js +0 -77
  121. package/dist/esm/sdk/adapters-La60hveX.js +0 -2
  122. package/dist/esm/sdk/appearance-token-vars-Bu6YUWmf.js +0 -2
  123. package/dist/esm/sdk/host-Bz7mRJPZ.js +0 -1
  124. package/dist/esm/sdk/transaction-activity-D5f-Yn9t.js +0 -1
  125. package/dist/public/sdk/adapters-La60hveX.js +0 -2
  126. package/dist/public/sdk/appearance-token-vars-Bu6YUWmf.js +0 -2
  127. package/dist/public/sdk/host-Bz7mRJPZ.js +0 -1
  128. package/dist/public/sdk/transaction-activity-D5f-Yn9t.js +0 -1
  129. package/dist/types/wallet/src/react/components/AccountMenuButton/SegmentedControl.d.ts +0 -25
@@ -5,7 +5,7 @@ distributed Seams Wallet SDK, server runtime, Wasm, strict Workers, and CLI.
5
5
  Dependency license expressions come from their package metadata. Packaged
6
6
  license and notice wording is reproduced below with normalized whitespace.
7
7
 
8
- Inventory: 450 dependency records (41 npm, 409 Cargo).
8
+ Inventory: 451 dependency records (42 npm, 409 Cargo).
9
9
 
10
10
  ## Dependency inventory
11
11
 
@@ -446,6 +446,7 @@ Inventory: 450 dependency records (41 npm, 409 Cargo).
446
446
  | npm | abitype | 1.2.3 | MIT | awkweb.eth <t@wevm.dev>; jxom.eth <j@wevm.dev> |
447
447
  | npm | asn1js | 3.0.7 | BSD-3-Clause | Ryan Hurst rmh@unmitigatedrisk.com; Yury Strozhevsky yury@strozhevsky.com |
448
448
  | npm | base-x | 5.0.1 | MIT | Daniel Cousens |
449
+ | npm | borsh | 1.0.0 | Apache-2.0 | Near Inc |
449
450
  | npm | bs58 | 6.0.0 | MIT | |
450
451
  | npm | eventemitter3 | 5.0.1 | MIT | Arnout Kazemier |
451
452
  | npm | idb | 8.0.3 | ISC | Jake Archibald |
@@ -2767,7 +2768,7 @@ Applies to:
2767
2768
 
2768
2769
  ### 23f18e03dc49df91
2769
2770
 
2770
- Packaged as: LICENSE, LICENSE-MIT
2771
+ Packaged as: LICENSE, LICENSE-MIT, LICENSE-MIT.txt
2771
2772
 
2772
2773
  Applies to:
2773
2774
 
@@ -2837,6 +2838,7 @@ Applies to:
2837
2838
  - cargo:zmij@1.0.21
2838
2839
  - cargo:zmij@1.0.23
2839
2840
  - npm:@near-js/types@2.4.0
2841
+ - npm:borsh@1.0.0
2840
2842
 
2841
2843
  Permission is hereby granted, free of charge, to any
2842
2844
  person obtaining a copy of this software and associated
@@ -7353,6 +7355,7 @@ Applies to:
7353
7355
  - cargo:borsh@1.6.1
7354
7356
  - cargo:borsh@1.8.0
7355
7357
  - cargo:borsh@1.8.1
7358
+ - npm:borsh@1.0.0
7356
7359
 
7357
7360
  Apache License
7358
7361
  Version 2.0, January 2004
@@ -1 +1 @@
1
- 30350f07c50b9a4d643fd64c4b936f107eb267955a5f2c78561529108cbdabc5
1
+ 1338f3f6f35ca0a9209fea6d25a3fa10bac28bba32ba928546abfac7a06b84a3
@@ -1,10 +1,10 @@
1
1
  import { walletDisplayText, walletText } from "../../../../ui/messages.js";
2
- import { WalletLocaleContext, WalletText } from "./WalletLocale.js";
2
+ import { WalletLocaleContext, WalletText, useWalletLocale } from "./WalletLocale.js";
3
3
  import { announceClampedSurfaceResize } from "../confirm-surface-resize.js";
4
4
  import { confirmationDocumentStyles } from "./confirmation-styles.js";
5
5
  import { ReviewDisclosure } from "./ReviewDisclosure.js";
6
6
  import { CopyReviewValue, ReviewAmount, ReviewIcon, ReviewMiddleTruncated, WalletReceiptFooter, reviewNetwork, reviewRecipient } from "./TransactionReview.js";
7
- import { receiptCompletedStages, receiptDescription, receiptHeading, receiptIsPending } from "../transaction-receipt.js";
7
+ import { receiptCompletedStages, receiptDescription, receiptHeading, receiptIsComplete, receiptIsPending, receiptTitle } from "../transaction-receipt.js";
8
8
  import { Component, createRef } from "preact";
9
9
  import { Fragment as Fragment$1, jsx, jsxs } from "preact/jsx-runtime";
10
10
  //#region src/core/signingEngine/uiConfirm/ui/preact/TransactionReceipt.tsx
@@ -23,12 +23,12 @@ var TransactionReceipt = class extends Component {
23
23
  this.props.receipt.onView("expanded");
24
24
  };
25
25
  close = () => {
26
- if (receiptIsPending(this.props.receipt.state)) this.minimize();
26
+ if (receiptIsPending(this.props.receipt)) this.minimize();
27
27
  else this.props.receipt.onDismiss();
28
28
  };
29
29
  componentDidUpdate(previous) {
30
30
  const { receipt } = this.props;
31
- if (receipt.view === "expanded" && previous.receipt.view === "expanded" && receipt.state.kind === "confirmed" && previous.receipt.state.kind !== "confirmed") this.revealExplorerLink();
31
+ if (receipt.view === "expanded" && previous.receipt.view === "expanded" && receipt.subject === "transaction" && receipt.state.kind === "confirmed" && previous.receipt.state.kind !== "confirmed") this.revealExplorerLink();
32
32
  }
33
33
  componentWillUnmount() {
34
34
  this.releaseExplorerRow();
@@ -85,12 +85,13 @@ var TransactionReceipt = class extends Component {
85
85
  }
86
86
  render() {
87
87
  const { receipt, data } = this.props;
88
- const heading = receiptHeading(receipt.state);
89
- const complete = receipt.state.kind === "confirmed" || receipt.state.kind === "signed";
90
- const pending = receiptIsPending(receipt.state);
91
- const completedStages = receiptCompletedStages(receipt.state);
88
+ const heading = receiptHeading(receipt);
89
+ const complete = receiptIsComplete(receipt);
90
+ const pending = receiptIsPending(receipt);
91
+ const completedStages = receiptCompletedStages(receipt);
92
92
  const recipient = reviewRecipient(data.model);
93
- const explorerHref = receipt.state.kind === "confirmed" && receipt.state.hash ? transactionExplorerHref(data.model, this.props.explorers, receipt.state.hash) : null;
93
+ const transaction = receipt.subject === "transaction" ? receipt.state : null;
94
+ const explorerHref = transaction?.kind === "confirmed" && transaction.hash ? transactionExplorerHref(data.model, this.props.explorers, transaction.hash) : null;
94
95
  if (receipt.view === "toast") return /* @__PURE__ */ jsxs("div", {
95
96
  class: "seams-transaction-toast",
96
97
  "data-completed-stages": completedStages,
@@ -141,7 +142,7 @@ var TransactionReceipt = class extends Component {
141
142
  children: [
142
143
  /* @__PURE__ */ jsxs("div", {
143
144
  class: "seams-review-toolbar",
144
- children: [/* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx(WalletText, { message: "Transaction receipt" }) }), /* @__PURE__ */ jsx("button", {
145
+ children: [/* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx(WalletText, { copy: receiptTitle(receipt) }) }), /* @__PURE__ */ jsx("button", {
145
146
  type: "button",
146
147
  "aria-label": walletText(this.context, "Minimize transaction"),
147
148
  onClick: this.minimize,
@@ -157,7 +158,7 @@ var TransactionReceipt = class extends Component {
157
158
  }), /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("h2", {
158
159
  role: "status",
159
160
  children: /* @__PURE__ */ jsx(WalletText, { copy: heading })
160
- }), /* @__PURE__ */ jsx("p", { children: /* @__PURE__ */ jsx(WalletText, { copy: receiptDescription(receipt.state) }) })] })]
161
+ }), /* @__PURE__ */ jsx("p", { children: /* @__PURE__ */ jsx(WalletText, { copy: receiptDescription(receipt) }) })] })]
161
162
  }),
162
163
  /* @__PURE__ */ jsx(ReviewAmount, {
163
164
  model: data.model,
@@ -183,39 +184,13 @@ var TransactionReceipt = class extends Component {
183
184
  data.model.totals.feeSymbol
184
185
  ] })] })
185
186
  }),
186
- /* @__PURE__ */ jsxs("div", {
187
- class: "seams-receipt-steps",
188
- "aria-label": walletText(this.context, "Transaction progress"),
189
- children: [
190
- /* @__PURE__ */ jsx(ReceiptStep, {
191
- stage: "signing",
192
- label: walletText(this.context, "Signed"),
193
- activeLabel: "Signing",
194
- complete: completedStages >= 1,
195
- active: receipt.state.kind === "signing"
196
- }),
197
- /* @__PURE__ */ jsx(ReceiptStep, {
198
- stage: "broadcast",
199
- label: walletText(this.context, "Broadcast"),
200
- activeLabel: "Broadcasting",
201
- complete: completedStages >= 2,
202
- active: receipt.state.kind === "broadcasting"
203
- }),
204
- /* @__PURE__ */ jsx(ReceiptStep, {
205
- stage: "confirming",
206
- label: walletDisplayText(this.context, receipt.state.kind === "reverted" ? "Reverted" : "Confirmed"),
207
- activeLabel: "Confirming",
208
- complete: completedStages === 3,
209
- active: receipt.state.kind === "submitted"
210
- })
211
- ]
212
- }),
187
+ transaction ? /* @__PURE__ */ jsx(ReceiptSteps, { state: transaction }) : receipt.subject === "message" && /* @__PURE__ */ jsx(MessageReceiptSteps, { state: receipt.state }),
213
188
  /* @__PURE__ */ jsx(ReviewDisclosure, {
214
189
  label: walletText(this.context, "Receipt details"),
215
190
  children: /* @__PURE__ */ jsxs("dl", {
216
191
  class: "seams-review-fields",
217
192
  children: [
218
- data.model?.signerAccount && /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("dt", { children: /* @__PURE__ */ jsx(WalletText, { message: "From" }) }), /* @__PURE__ */ jsx("dd", {
193
+ transaction && data.model?.signerAccount && /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("dt", { children: /* @__PURE__ */ jsx(WalletText, { message: "From" }) }), /* @__PURE__ */ jsx("dd", {
219
194
  class: "seams-review-recipient",
220
195
  children: /* @__PURE__ */ jsx(CopyReviewValue, {
221
196
  value: data.model.signerAccount,
@@ -231,10 +206,11 @@ var TransactionReceipt = class extends Component {
231
206
  label: walletDisplayText(this.context, `Copy recipient address ${recipient}`)
232
207
  })
233
208
  })] }),
234
- receipt.state.hash && /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("dt", { children: /* @__PURE__ */ jsx(WalletText, { message: "Transaction" }) }), /* @__PURE__ */ jsxs("dd", { children: [/* @__PURE__ */ jsx(ReviewMiddleTruncated, {
235
- value: receipt.state.hash,
209
+ transaction?.hash && /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("dt", { children: /* @__PURE__ */ jsx(WalletText, { message: "Transaction" }) }), /* @__PURE__ */ jsxs("dd", { children: [/* @__PURE__ */ jsx(ReviewMiddleTruncated, {
210
+ value: transaction.hash,
236
211
  class: "seams-review-hash"
237
- }), /* @__PURE__ */ jsx(CopyReviewValue, { value: receipt.state.hash })] })] }),
212
+ }), /* @__PURE__ */ jsx(CopyReviewValue, { value: transaction.hash })] })] }),
213
+ receipt.subject === "message" && /* @__PURE__ */ jsx(MessageReceiptFields, { model: data.model }),
238
214
  /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("dt", { children: /* @__PURE__ */ jsx(WalletText, { message: "Status" }) }), /* @__PURE__ */ jsx("dd", { children: /* @__PURE__ */ jsx(WalletText, { copy: heading }) })] })
239
215
  ]
240
216
  })
@@ -243,7 +219,7 @@ var TransactionReceipt = class extends Component {
243
219
  type: "button",
244
220
  class: "seams-receipt-primary",
245
221
  onClick: this.close,
246
- children: receiptIsPending(receipt.state) ? /* @__PURE__ */ jsx(WalletText, { message: "Continue in background" }) : /* @__PURE__ */ jsx(WalletText, { message: "Done" })
222
+ children: pending ? /* @__PURE__ */ jsx(WalletText, { message: "Continue in background" }) : /* @__PURE__ */ jsx(WalletText, { message: "Done" })
247
223
  }),
248
224
  explorerHref && /* @__PURE__ */ jsx("div", {
249
225
  id: this.explorerRowId,
@@ -289,6 +265,94 @@ function transactionExplorerHref(model, explorers, hash) {
289
265
  function assertNeverDisplayChain(chain) {
290
266
  throw new Error(`Unexpected display chain: ${String(chain)}`);
291
267
  }
268
+ function ReceiptSteps({ state }) {
269
+ const locale = useWalletLocale();
270
+ const completedStages = receiptCompletedStages({
271
+ subject: "transaction",
272
+ state
273
+ });
274
+ return /* @__PURE__ */ jsxs("div", {
275
+ class: "seams-receipt-steps",
276
+ "aria-label": walletText(locale, "Transaction progress"),
277
+ children: [
278
+ /* @__PURE__ */ jsx(ReceiptStep, {
279
+ stage: "signing",
280
+ label: walletText(locale, "Signed"),
281
+ activeLabel: "Signing",
282
+ complete: completedStages >= 1,
283
+ active: state.kind === "signing"
284
+ }),
285
+ /* @__PURE__ */ jsx(ReceiptStep, {
286
+ stage: "broadcast",
287
+ label: walletText(locale, "Broadcast"),
288
+ activeLabel: "Broadcasting",
289
+ complete: completedStages >= 2,
290
+ active: state.kind === "broadcasting"
291
+ }),
292
+ /* @__PURE__ */ jsx(ReceiptStep, {
293
+ stage: "confirming",
294
+ label: walletDisplayText(locale, state.kind === "reverted" ? "Reverted" : "Confirmed"),
295
+ activeLabel: "Confirming",
296
+ complete: completedStages === 3,
297
+ active: state.kind === "submitted"
298
+ })
299
+ ]
300
+ });
301
+ }
302
+ /**
303
+ * A message signature has one stage. It keeps the transaction's three tracks, so
304
+ * the receipt has the same height, and fills them all once signed. Only the first
305
+ * track has a label: there is no broadcast or confirmation.
306
+ */
307
+ function MessageReceiptSteps({ state }) {
308
+ const locale = useWalletLocale();
309
+ const complete = state.kind === "signed";
310
+ const active = state.kind === "signing";
311
+ return /* @__PURE__ */ jsxs("div", {
312
+ class: "seams-receipt-steps",
313
+ "aria-label": walletText(locale, "Transaction progress"),
314
+ children: [
315
+ /* @__PURE__ */ jsx(ReceiptStep, {
316
+ stage: "signing",
317
+ label: walletText(locale, "Signed"),
318
+ activeLabel: "Signing",
319
+ complete,
320
+ active
321
+ }),
322
+ /* @__PURE__ */ jsx(ReceiptStep, {
323
+ stage: "signed",
324
+ label: "",
325
+ activeLabel: "",
326
+ complete,
327
+ active: false
328
+ }),
329
+ /* @__PURE__ */ jsx(ReceiptStep, {
330
+ stage: "signed",
331
+ label: "",
332
+ activeLabel: "",
333
+ complete,
334
+ active: false
335
+ })
336
+ ]
337
+ });
338
+ }
339
+ /** The signed message's own fields: signer, recipient and message text. */
340
+ function MessageReceiptFields({ model }) {
341
+ const locale = useWalletLocale();
342
+ const operation = model?.operations.length === 1 ? model.operations[0] : null;
343
+ if (operation?.kind !== "near.message") return null;
344
+ return /* @__PURE__ */ jsx(Fragment$1, { children: operation.fields?.map((field) => /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("dt", { children: /* @__PURE__ */ jsx(WalletText, { copy: field.label }) }), field.renderAs === "file-content" ? /* @__PURE__ */ jsxs("dd", { children: [/* @__PURE__ */ jsx("span", {
345
+ class: "seams-receipt-message",
346
+ children: field.value
347
+ }), /* @__PURE__ */ jsx(CopyReviewValue, { value: field.copyValue ?? field.value })] }) : /* @__PURE__ */ jsx("dd", {
348
+ class: "seams-review-recipient",
349
+ children: /* @__PURE__ */ jsx(CopyReviewValue, {
350
+ value: field.copyValue ?? field.value,
351
+ address: true,
352
+ label: walletDisplayText(locale, `Copy ${field.label.toLowerCase()} address ${field.value}`)
353
+ })
354
+ })] }, field.label)) });
355
+ }
292
356
  function ReceiptStep(props) {
293
357
  const state = props.complete ? "complete" : props.active ? "active" : "waiting";
294
358
  return /* @__PURE__ */ jsxs("span", {
@@ -191,7 +191,7 @@ var MountedConfirmationSurface = class {
191
191
  cancel = () => {
192
192
  if (this.state.kind !== "mounted") return;
193
193
  if (this.receipt) {
194
- if (receiptIsPending(this.receipt.state)) this.receipt.onView("toast");
194
+ if (receiptIsPending(this.receipt)) this.receipt.onView("toast");
195
195
  else this.receipt.onDismiss();
196
196
  return;
197
197
  }
@@ -1,8 +1,15 @@
1
1
  //#region src/core/signingEngine/uiConfirm/ui/transaction-receipt.ts
2
- function receiptIsPending(state) {
3
- return state.kind === "signing" || state.kind === "broadcasting" || state.kind === "submitted";
2
+ function receiptIsPending(receipt) {
3
+ const { kind } = receipt.state;
4
+ return kind === "signing" || kind === "broadcasting" || kind === "submitted";
4
5
  }
5
- function receiptCompletedStages(state) {
6
+ function receiptIsComplete(receipt) {
7
+ return receipt.state.kind === "confirmed" || receipt.state.kind === "signed";
8
+ }
9
+ /** A message signature has one stage, so its toast fills at once when signed. */
10
+ function receiptCompletedStages(receipt) {
11
+ if (receipt.subject === "message") return receipt.state.kind === "signed" ? 3 : 0;
12
+ const { state } = receipt;
6
13
  switch (state.kind) {
7
14
  case "signing": return 0;
8
15
  case "signed":
@@ -15,7 +22,12 @@ function receiptCompletedStages(state) {
15
22
  default: return assertNever(state);
16
23
  }
17
24
  }
18
- function receiptHeading(state) {
25
+ function receiptTitle(receipt) {
26
+ return receipt.subject === "message" ? "Message signature" : "Transaction receipt";
27
+ }
28
+ function receiptHeading(receipt) {
29
+ if (receipt.subject === "message") return messageHeading(receipt.state);
30
+ const { state } = receipt;
19
31
  switch (state.kind) {
20
32
  case "signing": return "Signing transaction";
21
33
  case "signed": return "Signature ready";
@@ -28,7 +40,9 @@ function receiptHeading(state) {
28
40
  default: return assertNever(state);
29
41
  }
30
42
  }
31
- function receiptDescription(state) {
43
+ function receiptDescription(receipt) {
44
+ if (receipt.subject === "message") return messageDescription(receipt.state);
45
+ const { state } = receipt;
32
46
  switch (state.kind) {
33
47
  case "signing": return "Preparing your signed transaction.";
34
48
  case "signed": return "Signature created, ready to broadcast.";
@@ -41,10 +55,26 @@ function receiptDescription(state) {
41
55
  default: return assertNever(state);
42
56
  }
43
57
  }
58
+ function messageHeading(state) {
59
+ switch (state.kind) {
60
+ case "signing": return "Signing message";
61
+ case "signed": return "Message signed";
62
+ case "failed": return "Signature failed";
63
+ default: return assertNever(state);
64
+ }
65
+ }
66
+ function messageDescription(state) {
67
+ switch (state.kind) {
68
+ case "signing": return "Preparing your message signature.";
69
+ case "signed": return "Signed off-chain. Nothing was sent to the network.";
70
+ case "failed": return state.message;
71
+ default: return assertNever(state);
72
+ }
73
+ }
44
74
  function assertNever(value) {
45
75
  throw new Error(`Unexpected transaction receipt state: ${String(value)}`);
46
76
  }
47
77
  //#endregion
48
- export { receiptCompletedStages, receiptDescription, receiptHeading, receiptIsPending };
78
+ export { receiptCompletedStages, receiptDescription, receiptHeading, receiptIsComplete, receiptIsPending, receiptTitle };
49
79
 
50
80
  //# sourceMappingURL=transaction-receipt.js.map
@@ -113,27 +113,18 @@ const walletMessages = [
113
113
  ["Yes, remove", "削除する"],
114
114
  ["Removing…", "削除中…"],
115
115
  ["Review appearance", "確認画面の表示"],
116
+ ["Review before signing", "署名前に確認"],
117
+ ["Show the transaction details, then click Continue to sign.", "トランザクションの詳細を表示し、「続ける」をクリックして署名します。"],
118
+ ["Passkey authentication starts as soon as the details appear.", "詳細が表示されると同時にパスキー認証を開始します。"],
119
+ ["On phones, in Safari and for Email OTP sign-in, the wallet always waits for Continue.", "スマートフォン、Safari、メールOTPでのサインインでは、常に「続ける」のクリックを待ちます。"],
116
120
  ["Choose where transaction details appear before signing.", "署名前にトランザクションの詳細を表示する場所を選択してください。"],
117
- ["Confirmation step", "確認操作"],
118
- ["Choose Modal or Drawer to configure the confirmation step.", "確認操作を設定するには、モーダルまたはドロワーを選択してください。"],
119
- ["Choose whether to click Continue before authentication starts.", "認証開始前に「続ける」をクリックするか選択してください。"],
120
- ["Confirmer UI", "確認画面"],
121
- ["Confirmation Options", "確認オプション"],
122
- ["skip click", "クリックを省略"],
123
- ["require click", "クリックが必要"],
124
121
  ["none", "表示なし"],
125
122
  ["modal", "モーダル"],
126
123
  ["drawer", "ドロワー"],
127
- ["No review", "確認画面なし"],
128
- ["Start authentication without showing a review panel.", "確認画面を表示せずに認証を開始します。"],
129
124
  ["Modal", "モーダル"],
130
125
  ["Review the transaction in a centered dialog.", "画面中央のダイアログでトランザクションを確認します。"],
131
126
  ["Drawer", "ドロワー"],
132
127
  ["Review the transaction in a slide-out panel.", "スライド式パネルでトランザクションを確認します。"],
133
- ["Start automatically", "自動で開始"],
134
- ["Begin authentication as soon as the review opens.", "確認画面を開くと同時に認証を開始します。"],
135
- ["Click to continue", "クリックして続ける"],
136
- ["Review the details, then click Continue to start authentication.", "詳細を確認し、「続ける」をクリックして認証を開始します。"],
137
128
  ["Unable to refresh your wallet. Try again.", "ウォレットを更新できません。もう一度お試しください。"],
138
129
  ["Key export is unavailable for this wallet.", "このウォレットでは鍵をエクスポートできません。"],
139
130
  ["NEAR signer provisioning is still in progress. Try again shortly.", "NEAR 署名機能を準備中です。しばらくしてからもう一度お試しください。"],
@@ -176,7 +167,6 @@ const walletMessages = [
176
167
  ["Reveal with passkey", "パスキーで表示"],
177
168
  ["View on explorer", "エクスプローラーで表示"],
178
169
  ["This wallet", "このウォレット"],
179
- ["Addresses", "アドレス"],
180
170
  ["Security & devices", "セキュリティとデバイス"],
181
171
  ["Close wallet settings", "ウォレット設定を閉じる"],
182
172
  ["Wallet account", "ウォレットアカウント"],
@@ -213,6 +203,11 @@ const walletMessages = [
213
203
  ["Confirmation unavailable", "承認状態を取得できません"],
214
204
  ["Preparing your signed transaction.", "署名済みトランザクションを準備中です。"],
215
205
  ["Signature created, ready to broadcast.", "署名を作成しました。送信する準備ができました。"],
206
+ ["Signing message", "メッセージに署名中"],
207
+ ["Message signed", "メッセージに署名しました"],
208
+ ["Signature failed", "署名に失敗しました"],
209
+ ["Preparing your message signature.", "メッセージへの署名を準備中です。"],
210
+ ["Signed off-chain. Nothing was sent to the network.", "オフチェーンで署名しました。ネットワークには何も送信していません。"],
216
211
  ["Submitting your signed transaction to the network.", "署名済みトランザクションをネットワークに送信中です。"],
217
212
  ["Submitted to the network. Waiting for the receipt.", "ネットワークに送信しました。レシートを待機中です。"],
218
213
  ["The network confirmed your transaction.", "ネットワークがトランザクションを承認しました。"],
@@ -0,0 +1,26 @@
1
+ import { ActionType, toActionArgsWasm } from "../shared-ts/src/near/actions.js";
2
+ //#region src/externalNear/actions.ts
3
+ /** Wallet Selector's JSON action format, shared by HOT and Intear. */
4
+ function externalNearAction(action) {
5
+ const normalized = toActionArgsWasm(action);
6
+ switch (normalized.action_type) {
7
+ case ActionType.Transfer: return {
8
+ type: "Transfer",
9
+ params: { deposit: normalized.deposit }
10
+ };
11
+ case ActionType.FunctionCall: return {
12
+ type: "FunctionCall",
13
+ params: {
14
+ methodName: normalized.method_name,
15
+ args: JSON.parse(normalized.args),
16
+ gas: normalized.gas,
17
+ deposit: normalized.deposit
18
+ }
19
+ };
20
+ default: throw new Error("Unsupported external NEAR action.");
21
+ }
22
+ }
23
+ //#endregion
24
+ export { externalNearAction };
25
+
26
+ //# sourceMappingURL=actions.js.map
@@ -0,0 +1,53 @@
1
+ import { isPlainObject } from "../shared-ts/src/utils/validation.js";
2
+ import { isValidAccountId } from "../shared-ts/src/utils/near.js";
3
+ import { ActionType, toActionArgsWasm } from "../shared-ts/src/near/actions.js";
4
+ import bs58 from "bs58";
5
+ //#region src/externalNear/boundary.ts
6
+ function parseAccounts(raw) {
7
+ if (!Array.isArray(raw) || raw.length === 0) throw new Error("The wallet has no connected accounts.");
8
+ const accounts = [];
9
+ for (const account of raw) {
10
+ if (!isValidAccountId(account)) throw new Error("The wallet returned an invalid account.");
11
+ accounts.push(account);
12
+ }
13
+ return Object.freeze(accounts);
14
+ }
15
+ function validateTransaction(input) {
16
+ if (!isValidAccountId(input.receiverId) || input.actions.length === 0) throw new Error("Provide a receiver and at least one action.");
17
+ for (const action of input.actions) {
18
+ const normalized = toActionArgsWasm(action);
19
+ if (normalized.action_type !== ActionType.FunctionCall && normalized.action_type !== ActionType.Transfer) throw new Error("External NEAR supports function calls and transfers.");
20
+ if (!/^\d+$/.test(normalized.deposit)) throw new Error("Deposit must be an unsigned integer.");
21
+ if (normalized.action_type === ActionType.FunctionCall && (!/^\d+$/.test(normalized.gas) || BigInt(normalized.gas) === 0n || !normalized.method_name)) throw new Error("Provide a method and positive gas amount.");
22
+ }
23
+ return structuredClone(input);
24
+ }
25
+ function parseSubmission(raw, connection) {
26
+ if (!Array.isArray(raw) || raw.length !== 1) throw new Error("Missing transaction outcome.");
27
+ const outcome = raw[0];
28
+ if (!isPlainObject(outcome) || !isPlainObject(outcome.transaction)) throw new Error("Invalid transaction outcome.");
29
+ const { hash, signer_id } = outcome.transaction;
30
+ if (typeof hash !== "string" || bs58.decode(hash).length !== 32 || signer_id !== connection.accountId) throw new Error("Transaction identity does not match the request.");
31
+ return Object.freeze({
32
+ hash,
33
+ accountId: connection.accountId,
34
+ network: connection.network
35
+ });
36
+ }
37
+ function executionStatus(raw, submission) {
38
+ if (!isPlainObject(raw) || !isPlainObject(raw.result)) return "unresolved";
39
+ const result = raw.result;
40
+ if (!isPlainObject(result.transaction) || result.transaction.hash !== submission.hash || result.transaction.signer_id !== submission.accountId || result.final_execution_status !== "FINAL") return "unresolved";
41
+ if (!isPlainObject(result.status)) return "unresolved";
42
+ if ("Failure" in result.status) return "failed";
43
+ if (!("SuccessValue" in result.status) || !Array.isArray(result.receipts_outcome)) return "unresolved";
44
+ for (const receipt of result.receipts_outcome) {
45
+ if (!isPlainObject(receipt) || !isPlainObject(receipt.outcome) || !isPlainObject(receipt.outcome.status)) return "unresolved";
46
+ if ("Failure" in receipt.outcome.status) return "failed";
47
+ }
48
+ return "confirmed";
49
+ }
50
+ //#endregion
51
+ export { executionStatus, parseAccounts, parseSubmission, validateTransaction };
52
+
53
+ //# sourceMappingURL=boundary.js.map