bulletin-deploy 0.20.0 → 0.21.0-rc.1

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 (66) hide show
  1. package/dist/auth/index.d.ts +4 -2
  2. package/dist/auth/index.js +6 -3
  3. package/dist/auth/vendor/allocations.d.ts +7 -40
  4. package/dist/auth/vendor/allocations.js +1 -1
  5. package/dist/auth/vendor/auth.d.ts +7 -4
  6. package/dist/auth/vendor/auth.js +3 -3
  7. package/dist/auth/vendor/index.d.ts +4 -3
  8. package/dist/auth/vendor/index.js +5 -3
  9. package/dist/auth/vendor/sessionSigner.d.ts +19 -22
  10. package/dist/auth/vendor/sessionSigner.js +5 -1
  11. package/dist/auth/vendor/signer.d.ts +1 -0
  12. package/dist/auth/vendor/types.d.ts +2 -1
  13. package/dist/auth/vendor/ui/index.d.ts +1 -0
  14. package/dist/auth/vendor/ui/status.d.ts +1 -0
  15. package/dist/auth-config.d.ts +10 -12
  16. package/dist/auth-config.js +5 -5
  17. package/dist/bug-report.js +4 -4
  18. package/dist/chain-health.js +3 -3
  19. package/dist/{chunk-7SXO544V.js → chunk-355BT3NW.js} +5 -6
  20. package/dist/{chunk-YIVCOJAB.js → chunk-4V6RDRA7.js} +5 -5
  21. package/dist/{chunk-26ZYMWSC.js → chunk-D2SK57BT.js} +1 -1
  22. package/dist/{chunk-YLLTQM5Z.js → chunk-DWPIGPYK.js} +2 -2
  23. package/dist/{chunk-3BSPX4JN.js → chunk-EM25CMOW.js} +5 -4
  24. package/dist/chunk-IMCDXJ4G.js +66 -0
  25. package/dist/{chunk-IHC2QG2L.js → chunk-IRQH5LMX.js} +3 -3
  26. package/dist/{chunk-GRPLHUYC.js → chunk-MRZL4IXT.js} +21 -19
  27. package/dist/{chunk-6GHDPDZN.js → chunk-NS52FHFA.js} +2 -2
  28. package/dist/{chunk-G7EH3XIW.js → chunk-PN5JKONF.js} +48 -28
  29. package/dist/{chunk-DHHHYZTR.js → chunk-PRPZFI4I.js} +1 -1
  30. package/dist/{chunk-QBHUCTVT.js → chunk-QDWW6V3C.js} +2 -2
  31. package/dist/{chunk-DT6ABL3J.js → chunk-SCEGFVXO.js} +10 -8
  32. package/dist/{chunk-BXDMEOLH.js → chunk-ULNOCDRA.js} +1 -1
  33. package/dist/{chunk-EBYWI7FI.js → chunk-VQUA4MCW.js} +20 -19
  34. package/dist/{chunk-IF3SANQR.js → chunk-WQEISP4B.js} +19 -6
  35. package/dist/{chunk-LRRFXOLE.js → chunk-XZP7P6B7.js} +3 -3
  36. package/dist/{chunk-MTXFJTX6.js → chunk-Z3BNELYY.js} +1 -1
  37. package/dist/chunk-probe.js +3 -3
  38. package/dist/commands/login.d.ts +1 -0
  39. package/dist/commands/login.js +25 -26
  40. package/dist/commands/logout.d.ts +1 -0
  41. package/dist/commands/logout.js +10 -10
  42. package/dist/commands/transfer.js +6 -6
  43. package/dist/commands/whoami.d.ts +1 -0
  44. package/dist/commands/whoami.js +5 -3
  45. package/dist/deploy-actors.d.ts +6 -4
  46. package/dist/deploy-actors.js +10 -11
  47. package/dist/deploy.js +17 -17
  48. package/dist/dotns.js +6 -6
  49. package/dist/index.js +18 -18
  50. package/dist/manifest/publish.js +18 -18
  51. package/dist/memory-report.js +2 -2
  52. package/dist/merkle.js +17 -17
  53. package/dist/personhood/bootstrap.js +6 -6
  54. package/dist/personhood/constants.d.ts +2 -2
  55. package/dist/personhood/people-client.js +6 -6
  56. package/dist/pool.js +5 -5
  57. package/dist/run-state.js +1 -1
  58. package/dist/sss-allowance-cache.js +5 -5
  59. package/dist/sss-allowance.d.ts +8 -1
  60. package/dist/sss-allowance.js +3 -1
  61. package/dist/storage-signer.js +17 -17
  62. package/dist/telemetry.js +2 -2
  63. package/dist/version-check.js +3 -3
  64. package/dist/ws.js +4 -4
  65. package/package.json +5 -4
  66. package/dist/chunk-S6CPT2TU.js +0 -94
@@ -1,8 +1,10 @@
1
1
  export { AuthClient, ConnectResult, LoginHandle, LoginStatus, LogoutHandle, LogoutStatus, SessionAddresses, SessionHandle, createAuthClient } from './vendor/auth.js';
2
- export { renderQrCode } from '@parity/product-sdk-terminal';
2
+ export { SESSION_EXPIRED_MESSAGE } from './vendor/sessionSigner.js';
3
3
  export { ResolvedSigner, SignerNotAvailableError, resolveSigner } from './vendor/signer.js';
4
- export { AllocatableResource, AllocationOutcome, AllocationSummary, BULLETIN_RESOURCE, DEFAULT_RESOURCES, createSlotAccountSigner, requestResourceAllocation, summarizeOutcomes } from './vendor/allocations.js';
4
+ export { AllocationOutcome, AllocationSummary, BULLETIN_RESOURCE, DEFAULT_RESOURCES, createSlotAccountSigner, requestResourceAllocation, summarizeOutcomes } from './vendor/allocations.js';
5
5
  export { AuthConfig } from './vendor/types.js';
6
+ export { renderQrCode } from '@parity/product-sdk-terminal';
6
7
  export { renderLoginStatus, renderLogoutStatus } from './vendor/ui/status.js';
8
+ export { AllocatableResource } from '@parity/product-sdk-terminal/host';
7
9
  import 'polkadot-api';
8
10
  import '@parity/product-sdk-tx';
@@ -10,15 +10,17 @@ import {
10
10
  import "../chunk-NJKXXDDK.js";
11
11
  import {
12
12
  createAuthClient
13
- } from "../chunk-G7EH3XIW.js";
13
+ } from "../chunk-PN5JKONF.js";
14
14
  import {
15
15
  BULLETIN_RESOURCE,
16
16
  DEFAULT_RESOURCES,
17
17
  createSlotAccountSigner,
18
18
  requestResourceAllocation,
19
19
  summarizeOutcomes
20
- } from "../chunk-7SXO544V.js";
21
- import "../chunk-S6CPT2TU.js";
20
+ } from "../chunk-355BT3NW.js";
21
+ import {
22
+ SESSION_EXPIRED_MESSAGE
23
+ } from "../chunk-IMCDXJ4G.js";
22
24
  import {
23
25
  SignerNotAvailableError,
24
26
  resolveSigner
@@ -28,6 +30,7 @@ import "../chunk-DNXE3Q5D.js";
28
30
  export {
29
31
  BULLETIN_RESOURCE,
30
32
  DEFAULT_RESOURCES,
33
+ SESSION_EXPIRED_MESSAGE,
31
34
  SignerNotAvailableError,
32
35
  createAuthClient,
33
36
  createSlotAccountSigner,
@@ -1,40 +1,8 @@
1
1
  import * as polkadot_api from 'polkadot-api';
2
2
  import { TerminalAdapter, UserSession } from '@parity/product-sdk-terminal';
3
+ import { AllocatableResource, OnExistingAllowancePolicy } from '@parity/product-sdk-terminal/host';
4
+ export { AllocatableResource, OnExistingAllowancePolicy } from '@parity/product-sdk-terminal/host';
3
5
 
4
- /**
5
- * Structural mirror of host-papp's `ApAllocatableResource` codec type. We
6
- * declare it locally because host-papp's package root doesn't re-export the
7
- * codec types yet — when it does (and product-sdk-terminal threads them
8
- * through) this can be replaced with a direct import.
9
- *
10
- * StatementStoreAllowance — write to the SSS (host_chat, allowance ring).
11
- * BulletInAllowance — write to Bulletin (TransactionStorage.store).
12
- * SmartContractAllowance — PGAS sponsoring for Revive contract calls.
13
- * The `value` is the derivation index of the
14
- * product account (0 for the default account).
15
- * AutoSigning — surrender the product-account signing key to
16
- * the host so it can sign on the user's behalf
17
- * without per-call prompts. Not used today.
18
- *
19
- * NOTE: host-api v0.8 renamed this variant to 'BulletinAllowance', but the
20
- * SSO resource-allocation codec (host-papp, which this path reaches via
21
- * product-sdk-terminal) retains the old 'BulletInAllowance' spelling as of
22
- * host-papp 0.8.5 / terminal 0.3.1. Ours must match the SSO codec — the
23
- * _SDK_COMPAT_PIN below fails the build if the SDK's spelling ever changes.
24
- */
25
- type AllocatableResource = {
26
- tag: "StatementStoreAllowance";
27
- value: undefined;
28
- } | {
29
- tag: "BulletInAllowance";
30
- value: undefined;
31
- } | {
32
- tag: "SmartContractAllowance";
33
- value: number;
34
- } | {
35
- tag: "AutoSigning";
36
- value: undefined;
37
- };
38
6
  /**
39
7
  * Outcome of one allocation. We don't read the inner `Allocated` payload
40
8
  * (allowance slot keys, derivation secrets) — the host stores them and uses
@@ -53,7 +21,6 @@ type AllocationOutcome = {
53
21
  };
54
22
  /** Tag-only view, handy for downstream code that doesn't care about payloads. */
55
23
  type ResourceTag = AllocatableResource["tag"];
56
- type OnExistingAllowancePolicy = "Ignore" | "Increase";
57
24
  /**
58
25
  * Default mobile-granted resource set for a CLI product account: write access
59
26
  * to the statement store + Bulletin, plus PGAS sponsoring for the default
@@ -70,7 +37,7 @@ declare const BULLETIN_RESOURCE: AllocatableResource;
70
37
  * Send a `host_request_resource_allocation` request over the user's active
71
38
  * session. The host (mobile wallet) prompts the user to approve and returns
72
39
  * one outcome per requested resource in order. Granted key material is cached
73
- * to disk by the terminal facet (`{appId}_AllowanceKeys.json`) so subsequent
40
+ * to disk by the terminal facet (`{productId}_AllowanceKeys.json`) so subsequent
74
41
  * calls (and the storage-signer reader) find it without a second wallet prompt.
75
42
  *
76
43
  * Throws on transport-level failures (Statement Store unreachable, encryption
@@ -81,7 +48,7 @@ declare const BULLETIN_RESOURCE: AllocatableResource;
81
48
  * allocate a new slot. Auto-pick would give "Increase" when all slot-table
82
49
  * resources are already cached, which re-prompts the user unnecessarily.
83
50
  */
84
- declare function requestResourceAllocation(session: UserSession, adapter: TerminalAdapter, resources?: AllocatableResource[], onExisting?: OnExistingAllowancePolicy): Promise<AllocationOutcome[]>;
51
+ declare function requestResourceAllocation(session: UserSession, adapter: TerminalAdapter, productId: string, resources?: AllocatableResource[], onExisting?: OnExistingAllowancePolicy): Promise<AllocationOutcome[]>;
85
52
  interface AllocationSummary {
86
53
  granted: AllocatableResource[];
87
54
  rejected: AllocatableResource[];
@@ -94,7 +61,7 @@ interface AllocationSummary {
94
61
  declare function summarizeOutcomes(outcomes: AllocationOutcome[], resources: AllocatableResource[]): AllocationSummary;
95
62
  /**
96
63
  * Read a previously allocated slot signer from the terminal cache
97
- * (`{appId}_AllowanceKeys.json`) written by `requestResourceAllocation`.
64
+ * (`{productId}_AllowanceKeys.json`) written by `requestResourceAllocation`.
98
65
  *
99
66
  * Returns `null` on a cache miss — never triggers a phone prompt. Use this
100
67
  * instead of `adapter.allowance.getBulletinSigner()` when the allocation has
@@ -106,6 +73,6 @@ declare function summarizeOutcomes(outcomes: AllocationOutcome[], resources: All
106
73
  * to BulletInAllowance). Returns `null` for BulletInAllowance when no cached
107
74
  * entry exists.
108
75
  */
109
- declare function createSlotAccountSigner(adapter: TerminalAdapter, resource: AllocatableResource): Promise<polkadot_api.PolkadotSigner | null>;
76
+ declare function createSlotAccountSigner(adapter: TerminalAdapter, resource: AllocatableResource, productId: string): Promise<polkadot_api.PolkadotSigner | null>;
110
77
 
111
- export { type AllocatableResource, type AllocationOutcome, type AllocationSummary, BULLETIN_RESOURCE, DEFAULT_RESOURCES, type OnExistingAllowancePolicy, type ResourceTag, createSlotAccountSigner, requestResourceAllocation, summarizeOutcomes };
78
+ export { type AllocationOutcome, type AllocationSummary, BULLETIN_RESOURCE, DEFAULT_RESOURCES, type ResourceTag, createSlotAccountSigner, requestResourceAllocation, summarizeOutcomes };
@@ -4,7 +4,7 @@ import {
4
4
  createSlotAccountSigner,
5
5
  requestResourceAllocation,
6
6
  summarizeOutcomes
7
- } from "../../chunk-7SXO544V.js";
7
+ } from "../../chunk-355BT3NW.js";
8
8
  export {
9
9
  BULLETIN_RESOURCE,
10
10
  DEFAULT_RESOURCES,
@@ -1,7 +1,8 @@
1
1
  import { TerminalAdapter, UserSession } from '@parity/product-sdk-terminal';
2
2
  import { PolkadotSigner } from 'polkadot-api';
3
- import { AllocatableResource, OnExistingAllowancePolicy, AllocationOutcome } from './allocations.js';
3
+ import { AllocationOutcome } from './allocations.js';
4
4
  import { AuthConfig } from './types.js';
5
+ import { AllocatableResource, OnExistingAllowancePolicy } from '@parity/product-sdk-terminal/host';
5
6
 
6
7
  /**
7
8
  * The three addresses we surface from a paired session.
@@ -10,9 +11,9 @@ import { AuthConfig } from './types.js';
10
11
  * the mobile app sent over the SSO handshake (bare-mnemonic sr25519 root on
11
12
  * current mobile builds). Keyed by `Resources.Consumers` on the People
12
13
  * parachain, so it's the right input for `lookupUsername`.
13
- * - `productAddress` — SS58 of the product account derived via
14
- * `product/{productId}/{index}` from `rootAccountId`. This is what actually
15
- * signs on-chain transactions from the CLI.
14
+ * - `productAddress`: SS58 of the RFC-0022 product account
15
+ * `//product//{productId}/{index}`. This is what actually signs on-chain
16
+ * transactions from the CLI.
16
17
  * - `productH160` — the same product pubkey as a 20-byte EVM address (Revive /
17
18
  * contracts view). Derived from the SAME pubkey as `productAddress`.
18
19
  */
@@ -61,6 +62,8 @@ interface LoginHandle {
61
62
  interface SessionHandle {
62
63
  address: string;
63
64
  addresses: SessionAddresses;
65
+ /** Product id the account, signer and allowances are scoped to. */
66
+ productId: string;
64
67
  signer: PolkadotSigner;
65
68
  userSession: UserSession;
66
69
  adapter: TerminalAdapter;
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  createAuthClient
3
- } from "../../chunk-G7EH3XIW.js";
4
- import "../../chunk-7SXO544V.js";
5
- import "../../chunk-S6CPT2TU.js";
3
+ } from "../../chunk-PN5JKONF.js";
4
+ import "../../chunk-355BT3NW.js";
5
+ import "../../chunk-IMCDXJ4G.js";
6
6
  import "../../chunk-SH2LG52Z.js";
7
7
  import "../../chunk-DNXE3Q5D.js";
8
8
  export {
@@ -1,8 +1,9 @@
1
1
  export { AuthClient, ConnectResult, LoginHandle, LoginStatus, LogoutHandle, LogoutStatus, SessionAddresses, SessionHandle, createAuthClient } from './auth.js';
2
- export { INCOMPLETE_SESSION_MESSAGE, ProductAccountRef, createSessionSigner, deriveProductPublicKey, sessionRootPublicKey } from './sessionSigner.js';
2
+ export { SESSION_EXPIRED_MESSAGE, createSessionSigner, deriveProductPublicKey } from './sessionSigner.js';
3
3
  export { ResolvedSigner, SignerNotAvailableError, SignerOptions, SignerSource, parseDevAccountName, resolveSigner } from './signer.js';
4
- export { AllocatableResource, AllocationOutcome, AllocationSummary, BULLETIN_RESOURCE, DEFAULT_RESOURCES, OnExistingAllowancePolicy, ResourceTag, createSlotAccountSigner, requestResourceAllocation, summarizeOutcomes } from './allocations.js';
4
+ export { AllocationOutcome, AllocationSummary, BULLETIN_RESOURCE, DEFAULT_RESOURCES, ResourceTag, createSlotAccountSigner, requestResourceAllocation, summarizeOutcomes } from './allocations.js';
5
5
  export { AuthConfig } from './types.js';
6
- import '@parity/product-sdk-terminal';
6
+ export { AllocatableResource, OnExistingAllowancePolicy } from '@parity/product-sdk-terminal/host';
7
+ export { INCOMPLETE_SESSION_MESSAGE, ProductAccountRef, sessionRootPublicKey } from '@parity/product-sdk-terminal';
7
8
  import 'polkadot-api';
8
9
  import '@parity/product-sdk-tx';
@@ -1,20 +1,21 @@
1
1
  import "../../chunk-NJKXXDDK.js";
2
2
  import {
3
3
  createAuthClient
4
- } from "../../chunk-G7EH3XIW.js";
4
+ } from "../../chunk-PN5JKONF.js";
5
5
  import {
6
6
  BULLETIN_RESOURCE,
7
7
  DEFAULT_RESOURCES,
8
8
  createSlotAccountSigner,
9
9
  requestResourceAllocation,
10
10
  summarizeOutcomes
11
- } from "../../chunk-7SXO544V.js";
11
+ } from "../../chunk-355BT3NW.js";
12
12
  import {
13
13
  INCOMPLETE_SESSION_MESSAGE,
14
+ SESSION_EXPIRED_MESSAGE,
14
15
  createSessionSigner,
15
16
  deriveProductPublicKey,
16
17
  sessionRootPublicKey
17
- } from "../../chunk-S6CPT2TU.js";
18
+ } from "../../chunk-IMCDXJ4G.js";
18
19
  import {
19
20
  SignerNotAvailableError,
20
21
  parseDevAccountName,
@@ -26,6 +27,7 @@ export {
26
27
  BULLETIN_RESOURCE,
27
28
  DEFAULT_RESOURCES,
28
29
  INCOMPLETE_SESSION_MESSAGE,
30
+ SESSION_EXPIRED_MESSAGE,
29
31
  SignerNotAvailableError,
30
32
  createAuthClient,
31
33
  createSessionSigner,
@@ -1,28 +1,25 @@
1
- import { UserSession } from '@parity/product-sdk-terminal';
1
+ import { UserSession, ProductAccountRef, ProductSubtreeOptions } from '@parity/product-sdk-terminal';
2
+ export { INCOMPLETE_SESSION_MESSAGE, ProductAccountRef, sessionRootPublicKey } from '@parity/product-sdk-terminal';
2
3
  import { PolkadotSigner } from 'polkadot-api';
3
4
 
4
- interface ProductAccountRef {
5
- productId: string;
6
- derivationIndex: number;
7
- }
8
- declare const INCOMPLETE_SESSION_MESSAGE = "Stored login session is missing the root account public key. Run \"logout\" and then \"login\" to pair again.";
9
- declare function sessionRootPublicKey(session: UserSession): Uint8Array;
10
5
  /**
11
- * Soft-derive the product account public key off a wallet root.
6
+ * Session-backed `PolkadotSigner` for a product account, built on
7
+ * product-sdk-terminal's `createSessionSignerForAccount`.
12
8
  *
13
- * This is the single source of truth for product-account math. Both
14
- * `createSessionSigner` (which builds the signer used to actually sign
15
- * on-chain) and `deriveSessionAddresses` (which builds the display triple)
16
- * go through here so a future change to derivation params can't silently
17
- * desync the signer from what we print.
18
- *
19
- * sr25519 soft derivation is composable on public keys alone, so deriving
20
- * from `rootAccountId` locally produces the SAME public key the mobile
21
- * derives privately via `mnemonic + "/product/...{idx}"`. Algorithm parity
22
- * with mobile/desktop is locked by the frozen vectors in
23
- * `@parity/product-sdk-keys`'s `product-account.test.ts`.
9
+ * RFC-0022 puts the product account at `//product//{productId}/{index}`. The
10
+ * first two junctions are hard, so the key cannot be derived from the session's
11
+ * root public key: the SDK asks the phone for the `//product//{productId}`
12
+ * subtree key once and caches it in `{appId}_ProductSubtrees.json`.
13
+ */
14
+
15
+ declare const SESSION_EXPIRED_MESSAGE: string;
16
+ /** A healthy phone answers in 3-30s; host-papp's own deadline is 240s. */
17
+ declare const SUBTREE_TIMEOUT_MS = 60000;
18
+ /**
19
+ * The product account public key for `ref`. Reaches the phone only when the
20
+ * subtree key is not cached yet, which is normally once, right after pairing.
24
21
  */
25
- declare function deriveProductPublicKey(rootAccountId: Uint8Array, ref: ProductAccountRef): Uint8Array;
26
- declare function createSessionSigner(session: UserSession, ref: ProductAccountRef): PolkadotSigner;
22
+ declare function deriveProductPublicKey(session: UserSession, ref: ProductAccountRef, options?: ProductSubtreeOptions): Promise<Uint8Array>;
23
+ declare function createSessionSigner(session: UserSession, ref: ProductAccountRef, options?: ProductSubtreeOptions): Promise<PolkadotSigner>;
27
24
 
28
- export { INCOMPLETE_SESSION_MESSAGE, type ProductAccountRef, createSessionSigner, deriveProductPublicKey, sessionRootPublicKey };
25
+ export { SESSION_EXPIRED_MESSAGE, SUBTREE_TIMEOUT_MS, createSessionSigner, deriveProductPublicKey };
@@ -1,13 +1,17 @@
1
1
  import {
2
2
  INCOMPLETE_SESSION_MESSAGE,
3
+ SESSION_EXPIRED_MESSAGE,
4
+ SUBTREE_TIMEOUT_MS,
3
5
  createSessionSigner,
4
6
  deriveProductPublicKey,
5
7
  sessionRootPublicKey
6
- } from "../../chunk-S6CPT2TU.js";
8
+ } from "../../chunk-IMCDXJ4G.js";
7
9
  import "../../chunk-SH2LG52Z.js";
8
10
  import "../../chunk-DNXE3Q5D.js";
9
11
  export {
10
12
  INCOMPLETE_SESSION_MESSAGE,
13
+ SESSION_EXPIRED_MESSAGE,
14
+ SUBTREE_TIMEOUT_MS,
11
15
  createSessionSigner,
12
16
  deriveProductPublicKey,
13
17
  sessionRootPublicKey
@@ -3,6 +3,7 @@ import { PolkadotSigner } from 'polkadot-api';
3
3
  import { SessionHandle, SessionAddresses, AuthClient } from './auth.js';
4
4
  import '@parity/product-sdk-terminal';
5
5
  import './allocations.js';
6
+ import '@parity/product-sdk-terminal/host';
6
7
  import './types.js';
7
8
 
8
9
  type SignerSource = "dev" | "session";
@@ -10,7 +10,8 @@ interface AuthConfig {
10
10
  * (`~/.polkadot-apps/${dappId}_*`) and the SSO pairing — each product
11
11
  * gets its own, independently-revocable session. */
12
12
  dappId: string;
13
- /** Product id used to derive the product account (`/product/{productId}/{index}`). */
13
+ /** RFC-0022 product id `${dappId}.<network suffix>`; the account is `//product//{productId}/{index}`.
14
+ * Logout relies on this shape to clear `${dappId}.*` files. */
14
15
  productId: string;
15
16
  /** Derivation index of the product account (0 = default). */
16
17
  derivationIndex: number;
@@ -3,4 +3,5 @@ export { renderLoginStatus, renderLogoutStatus } from './status.js';
3
3
  import '../auth.js';
4
4
  import 'polkadot-api';
5
5
  import '../allocations.js';
6
+ import '@parity/product-sdk-terminal/host';
6
7
  import '../types.js';
@@ -2,6 +2,7 @@ import '@parity/product-sdk-terminal';
2
2
  import { LoginStatus, LogoutStatus } from '../auth.js';
3
3
  import 'polkadot-api';
4
4
  import '../allocations.js';
5
+ import '@parity/product-sdk-terminal/host';
5
6
  import '../types.js';
6
7
 
7
8
  /**
@@ -4,20 +4,13 @@ import { EnvironmentsDoc } from './environments.js';
4
4
  import '@parity/product-sdk-terminal';
5
5
  import 'polkadot-api';
6
6
  import './auth/vendor/allocations.js';
7
+ import '@parity/product-sdk-terminal/host';
7
8
 
8
- /** dApp identity: scopes the SSO session namespace + terminal allowance cache on disk
9
- * and the wallet pairing product. Aligned to the app's dedicated id "polkadot-app-deploy". */
9
+ /** Scopes the SSO session files on disk and prefixes the per-env product ids. */
10
10
  declare const DOT_DAPP_ID = "polkadot-app-deploy";
11
- /** Product id used for product-account derivation (`/product/{productId}/{index}`).
12
- * UNIFIED with DOT_DAPP_ID (#885): the wallet funds PGAS to product/{appId}/{index},
13
- * so deriving the signer/owner under the same id lands the account where PGAS sits —
14
- * one account is owner + AH signer + PGAS-funded. Requires a fresh re-pairing so the
15
- * Bulletin/statement allowance is also claimed under this id (verify the wallet serves
16
- * "polkadot-app-deploy"; that's the open mobile-side question). */
17
- declare const DOT_PRODUCT_ID = "polkadot-app-deploy";
18
11
  /** Derivation index (0 = default product account). */
19
12
  declare const DOT_DERIVATION_INDEX = 0;
20
- /** Wallet-facing app name shown on the Sign-In screen. Aligned to the unified identity. */
13
+ /** Wallet-facing app name shown on the Sign-In screen. */
21
14
  declare const DOT_HOST_NAME = "polkadot-app-deploy";
22
15
  /**
23
16
  * Shown when a persisted session file exists but the V2 codec cannot decode it —
@@ -46,7 +39,7 @@ declare function hasPersistedSession(): boolean;
46
39
  * `createAuthClient` needs. Throws with a clear message if the people chain or
47
40
  * its endpoint for `envId` is absent.
48
41
  */
49
- declare function buildAuthConfig(doc: EnvironmentsDoc, envId: string): AuthConfig;
42
+ declare function buildAuthConfig(doc: EnvironmentsDoc, envId: string, networkSuffix?: string | null): AuthConfig;
50
43
  /**
51
44
  * Resolve the Bulletin chain WS endpoint(s) for an environment from the
52
45
  * environments doc. Mirrors buildAuthConfig's people-chain resolution.
@@ -66,10 +59,15 @@ declare function resolveBulletinEndpoints(doc: EnvironmentsDoc, envId: string):
66
59
  * Used by the SSS allowance preflight check — no SSO deps loaded.
67
60
  */
68
61
  declare function getPeopleChainEndpoints(envId: string): Promise<string[]>;
62
+ /**
63
+ * The People chain's `NetworkSuffix`, which the phone checks the product id
64
+ * against. Null when the chain has none or the read fails.
65
+ */
66
+ declare function readNetworkSuffix(peopleEndpoints: string[]): Promise<string | null>;
69
67
  /**
70
68
  * Lazily create an auth client for the given environment. Imports the facade
71
69
  * only when called so the SSO deps don't load in headless/mnemonic paths.
72
70
  */
73
71
  declare function getAuthClient(envId: string): Promise<AuthClient>;
74
72
 
75
- export { DOT_DAPP_ID, DOT_DERIVATION_INDEX, DOT_HOST_NAME, DOT_PRODUCT_ID, STALE_SESSION_DEPLOY_MESSAGE, STALE_SESSION_MESSAGE, buildAuthConfig, getAuthClient, getPeopleChainEndpoints, hasPersistedSession, resolveBulletinEndpoints };
73
+ export { DOT_DAPP_ID, DOT_DERIVATION_INDEX, DOT_HOST_NAME, STALE_SESSION_DEPLOY_MESSAGE, STALE_SESSION_MESSAGE, buildAuthConfig, getAuthClient, getPeopleChainEndpoints, hasPersistedSession, readNetworkSuffix, resolveBulletinEndpoints };
@@ -2,30 +2,30 @@ import {
2
2
  DOT_DAPP_ID,
3
3
  DOT_DERIVATION_INDEX,
4
4
  DOT_HOST_NAME,
5
- DOT_PRODUCT_ID,
6
5
  STALE_SESSION_DEPLOY_MESSAGE,
7
6
  STALE_SESSION_MESSAGE,
8
7
  buildAuthConfig,
9
8
  getAuthClient,
10
9
  getPeopleChainEndpoints,
11
10
  hasPersistedSession,
11
+ readNetworkSuffix,
12
12
  resolveBulletinEndpoints
13
- } from "./chunk-IF3SANQR.js";
13
+ } from "./chunk-WQEISP4B.js";
14
14
  import "./chunk-3NR3T7US.js";
15
- import "./chunk-YLLTQM5Z.js";
16
- import "./chunk-3BSPX4JN.js";
15
+ import "./chunk-DWPIGPYK.js";
16
+ import "./chunk-EM25CMOW.js";
17
17
  import "./chunk-SH2LG52Z.js";
18
18
  import "./chunk-DNXE3Q5D.js";
19
19
  export {
20
20
  DOT_DAPP_ID,
21
21
  DOT_DERIVATION_INDEX,
22
22
  DOT_HOST_NAME,
23
- DOT_PRODUCT_ID,
24
23
  STALE_SESSION_DEPLOY_MESSAGE,
25
24
  STALE_SESSION_MESSAGE,
26
25
  buildAuthConfig,
27
26
  getAuthClient,
28
27
  getPeopleChainEndpoints,
29
28
  hasPersistedSession,
29
+ readNetworkSuffix,
30
30
  resolveBulletinEndpoints
31
31
  };
@@ -10,10 +10,10 @@ import {
10
10
  offerBugReport,
11
11
  scrubSecrets,
12
12
  setDeployContext
13
- } from "./chunk-LRRFXOLE.js";
14
- import "./chunk-BXDMEOLH.js";
15
- import "./chunk-YLLTQM5Z.js";
16
- import "./chunk-3BSPX4JN.js";
13
+ } from "./chunk-XZP7P6B7.js";
14
+ import "./chunk-ULNOCDRA.js";
15
+ import "./chunk-DWPIGPYK.js";
16
+ import "./chunk-EM25CMOW.js";
17
17
  import "./chunk-SH2LG52Z.js";
18
18
  export {
19
19
  buildCliFlagsSummary,
@@ -3,9 +3,9 @@ import {
3
3
  DEFAULT_WINDOW_BLOCKS,
4
4
  MAX_SPANS_PER_SAMPLER,
5
5
  endpointHost
6
- } from "./chunk-MTXFJTX6.js";
7
- import "./chunk-YLLTQM5Z.js";
8
- import "./chunk-3BSPX4JN.js";
6
+ } from "./chunk-Z3BNELYY.js";
7
+ import "./chunk-DWPIGPYK.js";
8
+ import "./chunk-EM25CMOW.js";
9
9
  import "./chunk-SH2LG52Z.js";
10
10
  export {
11
11
  ChainHealthSampler,
@@ -6,12 +6,11 @@ import {
6
6
  var DEFAULT_RESOURCES = [
7
7
  { tag: "BulletInAllowance", value: void 0 },
8
8
  { tag: "StatementStoreAllowance", value: void 0 },
9
- // derivation index 0 = the default product account.
10
- { tag: "SmartContractAllowance", value: 0 }
9
+ { tag: "SmartContractAllowance", value: { tag: "Index", value: 0 } }
11
10
  ];
12
11
  var BULLETIN_RESOURCE = { tag: "BulletInAllowance", value: void 0 };
13
- async function requestResourceAllocation(session, adapter, resources = DEFAULT_RESOURCES, onExisting = "Ignore") {
14
- const outcomes = await terminalRequestResourceAllocation(session, adapter, resources, { onExisting });
12
+ async function requestResourceAllocation(session, adapter, productId, resources = DEFAULT_RESOURCES, onExisting = "Ignore") {
13
+ const outcomes = await terminalRequestResourceAllocation(session, adapter, resources, { onExisting, productId });
15
14
  return outcomes;
16
15
  }
17
16
  function summarizeOutcomes(outcomes, resources) {
@@ -27,8 +26,8 @@ function summarizeOutcomes(outcomes, resources) {
27
26
  });
28
27
  return { granted, rejected, unavailable };
29
28
  }
30
- async function createSlotAccountSigner(adapter, resource) {
31
- return terminalCreateSlotAccountSigner(adapter, resource);
29
+ async function createSlotAccountSigner(adapter, resource, productId) {
30
+ return terminalCreateSlotAccountSigner(adapter, resource, productId);
32
31
  }
33
32
 
34
33
  export {
@@ -8,11 +8,11 @@ import {
8
8
  import {
9
9
  isTestnetSpecName,
10
10
  testnetFromNetworkField
11
- } from "./chunk-26ZYMWSC.js";
11
+ } from "./chunk-D2SK57BT.js";
12
12
  import {
13
13
  getWsProvider,
14
14
  parseRpcFrame
15
- } from "./chunk-6GHDPDZN.js";
15
+ } from "./chunk-NS52FHFA.js";
16
16
  import {
17
17
  HIGHEST_VERIFIED_DOTNS_RELEASE,
18
18
  POP_CONTROLLER_PROBE_ABI,
@@ -27,7 +27,7 @@ import {
27
27
  } from "./chunk-3NR3T7US.js";
28
28
  import {
29
29
  ChainHealthSampler
30
- } from "./chunk-MTXFJTX6.js";
30
+ } from "./chunk-Z3BNELYY.js";
31
31
  import {
32
32
  captureWarning,
33
33
  markCodePath,
@@ -35,13 +35,13 @@ import {
35
35
  setDeploySentryTag,
36
36
  truncateAddress,
37
37
  withSpan
38
- } from "./chunk-YLLTQM5Z.js";
38
+ } from "./chunk-DWPIGPYK.js";
39
39
  import {
40
40
  FALLBACK_MAX_COMMITMENT_AGE_SECONDS,
41
41
  clearCommitmentRecord,
42
42
  loadCommitmentRecord,
43
43
  writeCommitmentRecord
44
- } from "./chunk-3BSPX4JN.js";
44
+ } from "./chunk-EM25CMOW.js";
45
45
  import {
46
46
  NonRetryableError
47
47
  } from "./chunk-SH2LG52Z.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getWsProvider
3
- } from "./chunk-6GHDPDZN.js";
3
+ } from "./chunk-NS52FHFA.js";
4
4
 
5
5
  // src/pool.ts
6
6
  import { sr25519CreateDerive } from "@polkadot-labs/hdkd";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  package_default,
3
3
  writeRunState
4
- } from "./chunk-3BSPX4JN.js";
4
+ } from "./chunk-EM25CMOW.js";
5
5
  import {
6
6
  FALLBACK_CONFIG_ORIGIN,
7
7
  SHIPPED_CONFIG_ORIGIN
@@ -537,7 +537,7 @@ var ERROR_KIND_RULES = [
537
537
  // `unknown` with the message ending `"type": "AncientBirth`.
538
538
  [/AncientBirth/i, "chain.extrinsic_expired"],
539
539
  [/Bulletin quota exhausted/i, "chain.quota_exhausted"],
540
- [/Mobile signing (?:failed|rejected).*message too big/i, "signer.message_too_large"],
540
+ [/Mobile (?:transaction )?signing (?:failed|rejected).*message too big/i, "signer.message_too_large"],
541
541
  [/^INVARIANT FAILED:/i, "tool.invariant"]
542
542
  ];
543
543
  var INVALID_TRANSACTION_VARIANT_KIND = {
@@ -6,7 +6,7 @@ import * as path from "path";
6
6
  // package.json
7
7
  var package_default = {
8
8
  name: "bulletin-deploy",
9
- version: "0.20.0",
9
+ version: "0.21.0-rc.1",
10
10
  private: false,
11
11
  repository: {
12
12
  type: "git",
@@ -53,6 +53,7 @@ var package_default = {
53
53
  ],
54
54
  scripts: {
55
55
  build: "tsup",
56
+ typecheck: "tsc --noEmit -p .",
56
57
  "refresh-environments": "node scripts/refresh-environments.mjs",
57
58
  postinstall: "patch-package || true",
58
59
  prepare: "npm run build",
@@ -69,8 +70,8 @@ var package_default = {
69
70
  "@ipld/dag-pb": "^4.1.3",
70
71
  "@noble/hashes": "^1.7.2",
71
72
  "@parity/product-sdk-address": "^0.1.1",
72
- "@parity/product-sdk-keys": "^0.3.8",
73
- "@parity/product-sdk-terminal": "^0.5.1",
73
+ "@parity/product-sdk-keys": "^0.4.1",
74
+ "@parity/product-sdk-terminal": "^0.10.1",
74
75
  "@parity/product-sdk-tx": "^0.2.12",
75
76
  "@polkadot-api/metadata-builders": "^0.14.2",
76
77
  "@polkadot-api/substrate-bindings": "^0.20.2",
@@ -84,7 +85,7 @@ var package_default = {
84
85
  jiti: "^2.4.2",
85
86
  multiformats: "^13.4.1",
86
87
  "patch-package": "^8.0.1",
87
- "polkadot-api": "^2.1.3",
88
+ "polkadot-api": "^2.1.8",
88
89
  verifiablejs: "1.3.0-beta.4",
89
90
  viem: "^2.55.10",
90
91
  ws: "^8.21.0"