ghost-keychain/packages/extension-base
Patricio e66446edc3
fix: derive raw vs extrinsic signing from the request channel (#1624)
The signing popup decided whether to show the message view or the
transaction view by inspecting fields on the payload (`data`,
`blockNumber`), while the background picks the signing behaviour from the
message channel the request arrived on. Those two are independent and the
payload comes from the dapp, so they can disagree.

`RequestSign` becomes a discriminated union on `channel`, set by the
background from the message type. Correlating the discriminant with the
payload type means consumers narrow through `isExtrinsicRequest` rather
than casting, so the display and the signing path can no longer drift
apart. `Tabs.extrinsicSign` also rejects a payload carrying a truthy
`data`, since that field has no meaning on that channel.

Also branches the signing render on the request rather than on decoded
state. Paging between two queued requests of different shapes could
otherwise commit one frame using the previous request's decoded payload.

Tests added under `signer channel` in `Extension.spec.ts`.
2026-07-31 12:11:11 -03:00
..
src fix: derive raw vs extrinsic signing from the request channel (#1624) 2026-07-31 12:11:11 -03:00
package.json [CI Skip] bump/beta 0.63.2-0-x 2026-07-30 18:24:37 +00:00
README.md fix: Make extension using Manifest V3 compatible with Firefox (#1388) 2024-07-11 19:33:16 -03:00
tsconfig.build.json Adjust tsconfig usage (w/ latest dev) (#1258) 2023-05-18 12:54:23 +03:00
tsconfig.spec.json Adjust tsconfig usage (w/ latest dev) (#1258) 2023-05-18 12:54:23 +03:00

@polkadot/extension-base

Functions, classes and other utilities used in @polkadot/extension. These include:

  • background script handlers,
  • message passing,
  • scripts injected inside pages.

They are primarily meant to be used in @polkadot/extension, and can be broken without any notice to cater for @polkadot/extension's needs.

They are exported here if you wish to use part of them in the development of your own extension. Don't forget to add process.env.EXTENSION_PREFIX to separate ports and stores from the current extension's ones.