bulletin-deploy 0.20.0 → 0.21.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.
- package/dist/auth/index.d.ts +4 -2
- package/dist/auth/index.js +6 -3
- package/dist/auth/vendor/allocations.d.ts +7 -40
- package/dist/auth/vendor/allocations.js +1 -1
- package/dist/auth/vendor/auth.d.ts +7 -4
- package/dist/auth/vendor/auth.js +3 -3
- package/dist/auth/vendor/index.d.ts +4 -3
- package/dist/auth/vendor/index.js +5 -3
- package/dist/auth/vendor/sessionSigner.d.ts +19 -22
- package/dist/auth/vendor/sessionSigner.js +5 -1
- package/dist/auth/vendor/signer.d.ts +1 -0
- package/dist/auth/vendor/types.d.ts +2 -1
- package/dist/auth/vendor/ui/index.d.ts +1 -0
- package/dist/auth/vendor/ui/status.d.ts +1 -0
- package/dist/auth-config.d.ts +10 -12
- package/dist/auth-config.js +5 -5
- package/dist/bug-report.js +4 -4
- package/dist/chain-health.js +3 -3
- package/dist/{chunk-7SXO544V.js → chunk-355BT3NW.js} +5 -6
- package/dist/{chunk-YLLTQM5Z.js → chunk-4FIMYLWV.js} +2 -2
- package/dist/{chunk-3BSPX4JN.js → chunk-7QQZ57E6.js} +5 -4
- package/dist/{chunk-26ZYMWSC.js → chunk-BDUL42WH.js} +1 -1
- package/dist/{chunk-IHC2QG2L.js → chunk-CQA3JPYX.js} +3 -3
- package/dist/{chunk-QBHUCTVT.js → chunk-E77HESGN.js} +2 -2
- package/dist/{chunk-EBYWI7FI.js → chunk-EWQ2QZ44.js} +20 -19
- package/dist/{chunk-IF3SANQR.js → chunk-GL7JKE7O.js} +19 -6
- package/dist/{chunk-LRRFXOLE.js → chunk-GLLLSFMA.js} +3 -3
- package/dist/chunk-IMCDXJ4G.js +66 -0
- package/dist/{chunk-YIVCOJAB.js → chunk-IOLWREZB.js} +5 -5
- package/dist/{chunk-DHHHYZTR.js → chunk-K57H4IRT.js} +1 -1
- package/dist/{chunk-BXDMEOLH.js → chunk-KOLWOUWP.js} +1 -1
- package/dist/{chunk-DT6ABL3J.js → chunk-LPG3QSOM.js} +10 -8
- package/dist/{chunk-GRPLHUYC.js → chunk-MRZL4IXT.js} +21 -19
- package/dist/{chunk-G7EH3XIW.js → chunk-PN5JKONF.js} +48 -28
- package/dist/{chunk-MTXFJTX6.js → chunk-UPENVZ7J.js} +1 -1
- package/dist/{chunk-6GHDPDZN.js → chunk-WYZUDE6I.js} +2 -2
- package/dist/chunk-probe.js +3 -3
- package/dist/commands/login.d.ts +1 -0
- package/dist/commands/login.js +25 -26
- package/dist/commands/logout.d.ts +1 -0
- package/dist/commands/logout.js +10 -10
- package/dist/commands/transfer.js +6 -6
- package/dist/commands/whoami.d.ts +1 -0
- package/dist/commands/whoami.js +5 -3
- package/dist/deploy-actors.d.ts +6 -4
- package/dist/deploy-actors.js +10 -11
- package/dist/deploy.js +17 -17
- package/dist/dotns.js +6 -6
- package/dist/index.js +18 -18
- package/dist/manifest/publish.js +18 -18
- package/dist/memory-report.js +2 -2
- package/dist/merkle.js +17 -17
- package/dist/personhood/bootstrap.js +6 -6
- package/dist/personhood/constants.d.ts +2 -2
- package/dist/personhood/people-client.js +6 -6
- package/dist/pool.js +5 -5
- package/dist/run-state.js +1 -1
- package/dist/sss-allowance-cache.js +5 -5
- package/dist/sss-allowance.d.ts +8 -1
- package/dist/sss-allowance.js +3 -1
- package/dist/storage-signer.js +17 -17
- package/dist/telemetry.js +2 -2
- package/dist/version-check.js +3 -3
- package/dist/ws.js +4 -4
- package/package.json +5 -4
- package/dist/chunk-S6CPT2TU.js +0 -94
package/dist/auth/index.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
export { AuthClient, ConnectResult, LoginHandle, LoginStatus, LogoutHandle, LogoutStatus, SessionAddresses, SessionHandle, createAuthClient } from './vendor/auth.js';
|
|
2
|
-
export {
|
|
2
|
+
export { SESSION_EXPIRED_MESSAGE } from './vendor/sessionSigner.js';
|
|
3
3
|
export { ResolvedSigner, SignerNotAvailableError, resolveSigner } from './vendor/signer.js';
|
|
4
|
-
export {
|
|
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';
|
package/dist/auth/index.js
CHANGED
|
@@ -10,15 +10,17 @@ import {
|
|
|
10
10
|
import "../chunk-NJKXXDDK.js";
|
|
11
11
|
import {
|
|
12
12
|
createAuthClient
|
|
13
|
-
} from "../chunk-
|
|
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-
|
|
21
|
-
import
|
|
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 (`{
|
|
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
|
-
* (`{
|
|
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
|
|
78
|
+
export { type AllocationOutcome, type AllocationSummary, BULLETIN_RESOURCE, DEFAULT_RESOURCES, type ResourceTag, createSlotAccountSigner, requestResourceAllocation, summarizeOutcomes };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { TerminalAdapter, UserSession } from '@parity/product-sdk-terminal';
|
|
2
2
|
import { PolkadotSigner } from 'polkadot-api';
|
|
3
|
-
import {
|
|
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
|
|
14
|
-
*
|
|
15
|
-
*
|
|
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;
|
package/dist/auth/vendor/auth.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createAuthClient
|
|
3
|
-
} from "../../chunk-
|
|
4
|
-
import "../../chunk-
|
|
5
|
-
import "../../chunk-
|
|
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 {
|
|
2
|
+
export { SESSION_EXPIRED_MESSAGE, createSessionSigner, deriveProductPublicKey } from './sessionSigner.js';
|
|
3
3
|
export { ResolvedSigner, SignerNotAvailableError, SignerOptions, SignerSource, parseDevAccountName, resolveSigner } from './signer.js';
|
|
4
|
-
export {
|
|
4
|
+
export { AllocationOutcome, AllocationSummary, BULLETIN_RESOURCE, DEFAULT_RESOURCES, ResourceTag, createSlotAccountSigner, requestResourceAllocation, summarizeOutcomes } from './allocations.js';
|
|
5
5
|
export { AuthConfig } from './types.js';
|
|
6
|
-
|
|
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-
|
|
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-
|
|
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-
|
|
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
|
-
*
|
|
6
|
+
* Session-backed `PolkadotSigner` for a product account, built on
|
|
7
|
+
* product-sdk-terminal's `createSessionSignerForAccount`.
|
|
12
8
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
*
|
|
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(
|
|
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 {
|
|
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-
|
|
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
|
-
/**
|
|
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;
|
package/dist/auth-config.d.ts
CHANGED
|
@@ -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
|
-
/**
|
|
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.
|
|
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,
|
|
73
|
+
export { DOT_DAPP_ID, DOT_DERIVATION_INDEX, DOT_HOST_NAME, STALE_SESSION_DEPLOY_MESSAGE, STALE_SESSION_MESSAGE, buildAuthConfig, getAuthClient, getPeopleChainEndpoints, hasPersistedSession, readNetworkSuffix, resolveBulletinEndpoints };
|
package/dist/auth-config.js
CHANGED
|
@@ -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-
|
|
13
|
+
} from "./chunk-GL7JKE7O.js";
|
|
14
14
|
import "./chunk-3NR3T7US.js";
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-4FIMYLWV.js";
|
|
16
|
+
import "./chunk-7QQZ57E6.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
|
};
|
package/dist/bug-report.js
CHANGED
|
@@ -10,10 +10,10 @@ import {
|
|
|
10
10
|
offerBugReport,
|
|
11
11
|
scrubSecrets,
|
|
12
12
|
setDeployContext
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
13
|
+
} from "./chunk-GLLLSFMA.js";
|
|
14
|
+
import "./chunk-KOLWOUWP.js";
|
|
15
|
+
import "./chunk-4FIMYLWV.js";
|
|
16
|
+
import "./chunk-7QQZ57E6.js";
|
|
17
17
|
import "./chunk-SH2LG52Z.js";
|
|
18
18
|
export {
|
|
19
19
|
buildCliFlagsSummary,
|
package/dist/chain-health.js
CHANGED
|
@@ -3,9 +3,9 @@ import {
|
|
|
3
3
|
DEFAULT_WINDOW_BLOCKS,
|
|
4
4
|
MAX_SPANS_PER_SAMPLER,
|
|
5
5
|
endpointHost
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-UPENVZ7J.js";
|
|
7
|
+
import "./chunk-4FIMYLWV.js";
|
|
8
|
+
import "./chunk-7QQZ57E6.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
|
-
|
|
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 {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
package_default,
|
|
3
3
|
writeRunState
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-7QQZ57E6.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.
|
|
9
|
+
version: "0.21.0",
|
|
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.
|
|
73
|
-
"@parity/product-sdk-terminal": "^0.
|
|
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.
|
|
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"
|
|
@@ -19,13 +19,13 @@ import {
|
|
|
19
19
|
setBulletinEndpoints,
|
|
20
20
|
storeDirectory,
|
|
21
21
|
storeFile
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-EWQ2QZ44.js";
|
|
23
23
|
import {
|
|
24
24
|
DEFAULT_TLD,
|
|
25
25
|
DotNS,
|
|
26
26
|
parseDomainName,
|
|
27
27
|
stripTldSuffix
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-IOLWREZB.js";
|
|
29
29
|
import {
|
|
30
30
|
DEFAULT_ENV_ID,
|
|
31
31
|
getPopSelfServeConfig,
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
setDeployAttribute,
|
|
37
37
|
withManifestSpan,
|
|
38
38
|
withSpan
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-4FIMYLWV.js";
|
|
40
40
|
import {
|
|
41
41
|
NonRetryableError
|
|
42
42
|
} from "./chunk-SH2LG52Z.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
checkSSSAllowance
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-MRZL4IXT.js";
|
|
4
4
|
import {
|
|
5
5
|
DOT_DAPP_ID
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-GL7JKE7O.js";
|
|
7
7
|
|
|
8
8
|
// src/sss-allowance-cache.ts
|
|
9
9
|
import { mkdir, readFile, writeFile, unlink } from "fs/promises";
|