@parity/product-deploy 0.10.1-dev.0 → 0.11.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.
- package/bin/bulletin-deploy +42 -10
- package/dist/auth-config.js +3 -3
- package/dist/bug-report.js +4 -4
- package/dist/{chunk-J63XPPZW.js → chunk-5LJPUNCB.js} +1 -1
- package/dist/chunk-7OVS6LIV.js +78 -0
- package/dist/{chunk-ZNZOAGMR.js → chunk-A43XBCGD.js} +122 -91
- package/dist/{chunk-VMQDFI4D.js → chunk-AUVTECEP.js} +6 -11
- package/dist/{chunk-QIMAKL3Z.js → chunk-C5RIKMTP.js} +1 -1
- package/dist/{chunk-LSZEHAFU.js → chunk-GF2QXG66.js} +1 -1
- package/dist/{chunk-FMUO4UBG.js → chunk-GRRZ4PUX.js} +2 -2
- package/dist/{chunk-NBBV3IS3.js → chunk-LXSTFGUA.js} +10 -5
- package/dist/{chunk-QGGISN4D.js → chunk-MDLFWWXZ.js} +1 -1
- package/dist/{chunk-4GDFP7XR.js → chunk-PDCSBS5T.js} +55 -10
- package/dist/{chunk-HX6BOXMG.js → chunk-TK4IZ73C.js} +14 -1
- package/dist/chunk-probe.js +3 -3
- package/dist/commands/login.js +22 -21
- package/dist/commands/logout.js +7 -7
- package/dist/commands/transfer.js +3 -3
- package/dist/commands/whoami.js +3 -3
- package/dist/deploy-actors.d.ts +84 -3
- package/dist/deploy-actors.js +12 -35
- package/dist/deploy.d.ts +30 -4
- package/dist/deploy.js +13 -9
- package/dist/dotns.d.ts +42 -2
- package/dist/dotns.js +3 -3
- package/dist/index.js +21 -17
- package/dist/manifest/publish.js +14 -10
- package/dist/memory-report.js +2 -2
- package/dist/merkle.js +13 -9
- package/dist/personhood/bootstrap.js +6 -6
- package/dist/personhood/people-client.js +3 -3
- package/dist/run-state.js +1 -1
- package/dist/sss-allowance-cache.js +4 -4
- package/dist/storage-signer.js +13 -9
- package/dist/suppress-localstorage-warning.d.ts +2 -0
- package/dist/suppress-localstorage-warning.js +7 -0
- package/dist/telemetry.d.ts +9 -1
- package/dist/telemetry.js +6 -2
- package/dist/version-check.js +3 -3
- package/package.json +6 -11
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
setDeploySentryTag,
|
|
12
12
|
truncateAddress,
|
|
13
13
|
withSpan
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-TK4IZ73C.js";
|
|
15
15
|
import {
|
|
16
16
|
validateContractAddresses
|
|
17
17
|
} from "./chunk-QRKI6MMK.js";
|
|
@@ -988,6 +988,11 @@ var DotNS = class {
|
|
|
988
988
|
_popSelfServe = null;
|
|
989
989
|
_registerStorageDeposit = MINIMUM_REGISTER_STORAGE_DEPOSIT;
|
|
990
990
|
_onPhoneSigningRequired = void 0;
|
|
991
|
+
_confirmPhoneReady = void 0;
|
|
992
|
+
/** Total phone-signature count for this DotNS session (drives the `total` field passed to confirmPhoneReady). */
|
|
993
|
+
_phoneSignatureTotal = 0;
|
|
994
|
+
/** Running attempt counter per label for re-sign detection. Reset at connect/disconnect. */
|
|
995
|
+
_phoneSignatureAttempts = /* @__PURE__ */ new Map();
|
|
991
996
|
// Test-only seam: consumed once by classifyAliasAccountState() then cleared.
|
|
992
997
|
// Mirrors the __setDeployRootSpanForTest / __setSentryForTest pattern.
|
|
993
998
|
_classifyOverrideForTest = null;
|
|
@@ -1038,6 +1043,9 @@ var DotNS = class {
|
|
|
1038
1043
|
if (options.onPhoneSigningRequired !== void 0) {
|
|
1039
1044
|
this._onPhoneSigningRequired = options.onPhoneSigningRequired;
|
|
1040
1045
|
}
|
|
1046
|
+
if (options.confirmPhoneReady !== void 0) {
|
|
1047
|
+
this._confirmPhoneReady = options.confirmPhoneReady;
|
|
1048
|
+
}
|
|
1041
1049
|
const rpc = options.rpc || process.env.DOTNS_RPC || this.assetHubEndpoints[0];
|
|
1042
1050
|
this.rpc = rpc;
|
|
1043
1051
|
this._usesExternalSigner = Boolean(options.signer && options.signerAddress);
|
|
@@ -1458,11 +1466,14 @@ var DotNS = class {
|
|
|
1458
1466
|
return decodeFunctionResult({ abi: contractAbi, functionName, data: rawData });
|
|
1459
1467
|
}
|
|
1460
1468
|
async contractTransaction(contractAddress, value, contractAbi, functionName, args = [], statusCallback = () => {
|
|
1461
|
-
}, { useNoncePolling, verifyEffect, feeAsset } = {}) {
|
|
1469
|
+
}, { useNoncePolling, verifyEffect, feeAsset, phoneLabel } = {}) {
|
|
1462
1470
|
this.ensureConnected();
|
|
1463
1471
|
if (!this.clientWrapper) throw new Error("contractTransaction: polkadot-api client not available");
|
|
1464
1472
|
const encodedCallData = encodeFunctionData({ abi: contractAbi, functionName, args });
|
|
1465
1473
|
const rpcs = this.rpc ? [this.rpc, ...this.assetHubEndpoints.filter((ep) => ep !== this.rpc)] : this.assetHubEndpoints;
|
|
1474
|
+
if (phoneLabel !== void 0) {
|
|
1475
|
+
await this._awaitPhoneReady(phoneLabel);
|
|
1476
|
+
}
|
|
1466
1477
|
return await withTimeout(
|
|
1467
1478
|
this.clientWrapper.submitTransaction(contractAddress, value, encodedCallData, this.substrateAddress, this.signer, statusCallback, { rpcs, useNoncePolling, functionName, args, contracts: this._contracts, verifyEffect, feeAsset }),
|
|
1468
1479
|
OPERATION_TIMEOUT_MS,
|
|
@@ -1735,8 +1746,7 @@ var DotNS = class {
|
|
|
1735
1746
|
};
|
|
1736
1747
|
console.log(`
|
|
1737
1748
|
Linking content...`);
|
|
1738
|
-
this.
|
|
1739
|
-
const txRes = await this.contractTransaction(this._contracts.DOTNS_CONTENT_RESOLVER, 0n, DOTNS_CONTENT_RESOLVER_ABI, "setContenthash", [node, contenthashHex], (s) => console.log(` ${s}`), { useNoncePolling: true, verifyEffect, feeAsset: opts.feeAsset });
|
|
1749
|
+
const txRes = await this.contractTransaction(this._contracts.DOTNS_CONTENT_RESOLVER, 0n, DOTNS_CONTENT_RESOLVER_ABI, "setContenthash", [node, contenthashHex], (s) => console.log(` ${s}`), { useNoncePolling: true, verifyEffect, feeAsset: opts.feeAsset, phoneLabel: "Link content" });
|
|
1740
1750
|
const finalOnChain = (await this.getContenthash(domainName) || "0x").toLowerCase();
|
|
1741
1751
|
if (finalOnChain !== expected) {
|
|
1742
1752
|
throw new Error(
|
|
@@ -1963,8 +1973,7 @@ var DotNS = class {
|
|
|
1963
1973
|
}
|
|
1964
1974
|
};
|
|
1965
1975
|
try {
|
|
1966
|
-
this.
|
|
1967
|
-
const txRes = await this.contractTransaction(publisher, 0n, PUBLISHER_ABI, "publish", [label], (s) => console.log(` ${s}`), { useNoncePolling: true, verifyEffect });
|
|
1976
|
+
const txRes = await this.contractTransaction(publisher, 0n, PUBLISHER_ABI, "publish", [label], (s) => console.log(` ${s}`), { useNoncePolling: true, verifyEffect, phoneLabel: "Publish to registry" });
|
|
1968
1977
|
const finalPublished = await withTimeout(
|
|
1969
1978
|
this.contractCall(publisher, PUBLISHER_ABI, "isPublished", [labelhash]),
|
|
1970
1979
|
3e4,
|
|
@@ -2108,8 +2117,7 @@ var DotNS = class {
|
|
|
2108
2117
|
this.ensureConnected();
|
|
2109
2118
|
console.log(`
|
|
2110
2119
|
Submitting commitment...`);
|
|
2111
|
-
this.
|
|
2112
|
-
const commitTxRes = await this.contractTransaction(this._contracts.DOTNS_REGISTRAR_CONTROLLER, 0n, DOTNS_REGISTRAR_CONTROLLER_ABI, "commit", [commitment], (s) => console.log(` ${s}`));
|
|
2120
|
+
const commitTxRes = await this.contractTransaction(this._contracts.DOTNS_REGISTRAR_CONTROLLER, 0n, DOTNS_REGISTRAR_CONTROLLER_ABI, "commit", [commitment], (s) => console.log(` ${s}`), { phoneLabel: "Commitment" });
|
|
2113
2121
|
logTxResolution(commitTxRes);
|
|
2114
2122
|
console.log(` Committed at: ${(/* @__PURE__ */ new Date()).toISOString()}`);
|
|
2115
2123
|
}
|
|
@@ -2202,8 +2210,7 @@ var DotNS = class {
|
|
|
2202
2210
|
setDeployAttribute("deploy.payment_wei", priceWei.toString());
|
|
2203
2211
|
console.log(` Oracle price: ${formatEther(priceWei)} PAS`);
|
|
2204
2212
|
console.log(` Paying: ${formatEther(bufferedPaymentWei)} PAS`);
|
|
2205
|
-
this.
|
|
2206
|
-
const registerTxRes = await this.contractTransaction(this._contracts.DOTNS_REGISTRAR_CONTROLLER, bufferedPaymentNative, DOTNS_REGISTRAR_CONTROLLER_ABI, "register", [registration], (s) => console.log(` ${s}`));
|
|
2213
|
+
const registerTxRes = await this.contractTransaction(this._contracts.DOTNS_REGISTRAR_CONTROLLER, bufferedPaymentNative, DOTNS_REGISTRAR_CONTROLLER_ABI, "register", [registration], (s) => console.log(` ${s}`), { phoneLabel: "Register" });
|
|
2207
2214
|
logTxResolution(registerTxRes);
|
|
2208
2215
|
if (registerTxRes.kind === TX_KIND_HASH) {
|
|
2209
2216
|
setDeployAttribute("deploy.register.tx", registerTxRes.hash);
|
|
@@ -2651,6 +2658,41 @@ var DotNS = class {
|
|
|
2651
2658
|
const envId = this._environmentId ?? "paseo-next-v2";
|
|
2652
2659
|
return runBootstrap({ mnemonic, environmentId: envId });
|
|
2653
2660
|
}
|
|
2661
|
+
/**
|
|
2662
|
+
* Set the expected total number of phone signatures for this DotNS session.
|
|
2663
|
+
* Called from deploy() at preflight after computePhoneSigningSteps so that
|
|
2664
|
+
* confirmPhoneReady receives the correct `total`.
|
|
2665
|
+
*/
|
|
2666
|
+
setPhoneSignatureTotal(total) {
|
|
2667
|
+
this._phoneSignatureTotal = total;
|
|
2668
|
+
}
|
|
2669
|
+
/**
|
|
2670
|
+
* Internal: await the human-ready gate then fire the "check your phone"
|
|
2671
|
+
* notification. Must be called OUTSIDE any withTimeout — the human wait is
|
|
2672
|
+
* unbounded and must never be inside the machine timeout.
|
|
2673
|
+
*
|
|
2674
|
+
* Behaviour:
|
|
2675
|
+
* - confirmPhoneReady provided → await it (counts re-signs via attempt map).
|
|
2676
|
+
* - not provided + non-TTY → fail fast (NonRetryableError).
|
|
2677
|
+
* - not provided + TTY → no-op (bin must have supplied the hook; if it did
|
|
2678
|
+
* not, the caller proceeds without a gate — backward-compat for library
|
|
2679
|
+
* consumers that supply neither hook nor TTY check).
|
|
2680
|
+
* After the gate resolves, fires onPhoneSigningRequired (the "check your
|
|
2681
|
+
* phone" notification) so the user knows the request is now being sent.
|
|
2682
|
+
*/
|
|
2683
|
+
async _awaitPhoneReady(label) {
|
|
2684
|
+
if (!this._usesExternalSigner) return;
|
|
2685
|
+
const attempt = (this._phoneSignatureAttempts.get(label) ?? 0) + 1;
|
|
2686
|
+
this._phoneSignatureAttempts.set(label, attempt);
|
|
2687
|
+
if (this._confirmPhoneReady) {
|
|
2688
|
+
await this._confirmPhoneReady({ label, attempt, total: this._phoneSignatureTotal });
|
|
2689
|
+
} else if (!(process.stdout.isTTY && process.stdin.isTTY)) {
|
|
2690
|
+
throw new NonRetryableError(
|
|
2691
|
+
"phone signer active but no confirmPhoneReady hook provided and not running in a TTY \u2014 re-run interactively or provide the confirmPhoneReady option"
|
|
2692
|
+
);
|
|
2693
|
+
}
|
|
2694
|
+
this._onPhoneSigningRequired?.(label);
|
|
2695
|
+
}
|
|
2654
2696
|
disconnect() {
|
|
2655
2697
|
if (this.client) {
|
|
2656
2698
|
this.client.destroy();
|
|
@@ -2660,6 +2702,9 @@ var DotNS = class {
|
|
|
2660
2702
|
}
|
|
2661
2703
|
this._usesExternalSigner = false;
|
|
2662
2704
|
this._onPhoneSigningRequired = void 0;
|
|
2705
|
+
this._confirmPhoneReady = void 0;
|
|
2706
|
+
this._phoneSignatureTotal = 0;
|
|
2707
|
+
this._phoneSignatureAttempts.clear();
|
|
2663
2708
|
}
|
|
2664
2709
|
};
|
|
2665
2710
|
var dotns = new DotNS();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
package_default,
|
|
3
3
|
writeRunState
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-AUVTECEP.js";
|
|
5
5
|
|
|
6
6
|
// src/memory-report.ts
|
|
7
7
|
import * as fs2 from "fs";
|
|
@@ -22,6 +22,17 @@ var PARITY_HOST_APPS = /* @__PURE__ */ new Set(["playground-cli"]);
|
|
|
22
22
|
function extractRepoSlug(url) {
|
|
23
23
|
return url.replace(/.*github\.com[:/]/, "").replace(/\.git$/, "");
|
|
24
24
|
}
|
|
25
|
+
var FALLBACK_ISSUE_REPO = "paritytech/bulletin-deploy";
|
|
26
|
+
function resolveIssueRepoSlug(repository) {
|
|
27
|
+
try {
|
|
28
|
+
const raw = typeof repository === "string" ? repository : repository?.url;
|
|
29
|
+
if (!raw || typeof raw !== "string") return FALLBACK_ISSUE_REPO;
|
|
30
|
+
const slug = extractRepoSlug(raw.trim());
|
|
31
|
+
if (/^[^/\s]+\/[^/\s]+$/.test(slug)) return slug;
|
|
32
|
+
} catch {
|
|
33
|
+
}
|
|
34
|
+
return FALLBACK_ISSUE_REPO;
|
|
35
|
+
}
|
|
25
36
|
function tryGitRemote() {
|
|
26
37
|
try {
|
|
27
38
|
return extractRepoSlug(execSync("git remote get-url origin", { encoding: "utf-8", stdio: ["pipe", "pipe", "pipe"] }).trim());
|
|
@@ -724,6 +735,8 @@ export {
|
|
|
724
735
|
maybeWriteMemoryReport,
|
|
725
736
|
sampleFromBytes,
|
|
726
737
|
VERSION,
|
|
738
|
+
extractRepoSlug,
|
|
739
|
+
resolveIssueRepoSlug,
|
|
727
740
|
isInternalContextFromSignals,
|
|
728
741
|
isInternalContext,
|
|
729
742
|
isTelemetryDisabled,
|
package/dist/chunk-probe.js
CHANGED
|
@@ -5,9 +5,9 @@ import {
|
|
|
5
5
|
_decodeStorageValue,
|
|
6
6
|
_resetProbeSession,
|
|
7
7
|
probeChunks
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-GF2QXG66.js";
|
|
9
|
+
import "./chunk-TK4IZ73C.js";
|
|
10
|
+
import "./chunk-AUVTECEP.js";
|
|
11
11
|
export {
|
|
12
12
|
ChainProbeCrossValidationError,
|
|
13
13
|
ChainProbeMetadataError,
|
package/dist/commands/login.js
CHANGED
|
@@ -1,23 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
startSpinner
|
|
3
3
|
} from "../chunk-J7CYVTAW.js";
|
|
4
|
-
import "../chunk-JQKKMUCT.js";
|
|
5
|
-
import {
|
|
6
|
-
BULLETIN_RESOURCE,
|
|
7
|
-
DEFAULT_RESOURCES,
|
|
8
|
-
createSlotAccountSigner,
|
|
9
|
-
requestResourceAllocation,
|
|
10
|
-
summarizeOutcomes
|
|
11
|
-
} from "../chunk-5FLTDWWP.js";
|
|
12
|
-
import {
|
|
13
|
-
renderLoginStatus
|
|
14
|
-
} from "../chunk-RIRDBSBG.js";
|
|
15
4
|
import {
|
|
16
5
|
waitForBulletinAuthorization
|
|
17
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-A43XBCGD.js";
|
|
18
7
|
import {
|
|
19
8
|
preflightSssAllowance
|
|
20
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-C5RIKMTP.js";
|
|
21
10
|
import {
|
|
22
11
|
statementSigningAccount
|
|
23
12
|
} from "../chunk-GRPLHUYC.js";
|
|
@@ -26,24 +15,36 @@ import "../chunk-IW3X2MJF.js";
|
|
|
26
15
|
import "../chunk-KOSF5FDO.js";
|
|
27
16
|
import "../chunk-J3NIXHZZ.js";
|
|
28
17
|
import "../chunk-S7EM5VMW.js";
|
|
18
|
+
import "../chunk-LXSTFGUA.js";
|
|
19
|
+
import "../chunk-5LJPUNCB.js";
|
|
20
|
+
import "../chunk-GF2QXG66.js";
|
|
21
|
+
import "../chunk-C2TS5MER.js";
|
|
22
|
+
import "../chunk-7OVS6LIV.js";
|
|
23
|
+
import "../chunk-JQKKMUCT.js";
|
|
24
|
+
import {
|
|
25
|
+
BULLETIN_RESOURCE,
|
|
26
|
+
DEFAULT_RESOURCES,
|
|
27
|
+
createSlotAccountSigner,
|
|
28
|
+
requestResourceAllocation,
|
|
29
|
+
summarizeOutcomes
|
|
30
|
+
} from "../chunk-5FLTDWWP.js";
|
|
31
|
+
import {
|
|
32
|
+
renderLoginStatus
|
|
33
|
+
} from "../chunk-RIRDBSBG.js";
|
|
29
34
|
import {
|
|
30
35
|
DOT_PRODUCT_ID,
|
|
31
36
|
getAuthClient,
|
|
32
37
|
getPeopleChainEndpoints,
|
|
33
38
|
resolveBulletinEndpoints
|
|
34
|
-
} from "../chunk-
|
|
35
|
-
import "../chunk-NBBV3IS3.js";
|
|
36
|
-
import "../chunk-J63XPPZW.js";
|
|
37
|
-
import "../chunk-LSZEHAFU.js";
|
|
38
|
-
import "../chunk-C2TS5MER.js";
|
|
39
|
+
} from "../chunk-MDLFWWXZ.js";
|
|
39
40
|
import {
|
|
40
41
|
CLI_NAME
|
|
41
42
|
} from "../chunk-TSPERKUS.js";
|
|
42
|
-
import "../chunk-
|
|
43
|
+
import "../chunk-PDCSBS5T.js";
|
|
43
44
|
import "../chunk-SI2ZUOYD.js";
|
|
44
45
|
import "../chunk-4IUTMHVB.js";
|
|
45
|
-
import "../chunk-
|
|
46
|
-
import "../chunk-
|
|
46
|
+
import "../chunk-TK4IZ73C.js";
|
|
47
|
+
import "../chunk-AUVTECEP.js";
|
|
47
48
|
import {
|
|
48
49
|
loadEnvironments
|
|
49
50
|
} from "../chunk-QRKI6MMK.js";
|
package/dist/commands/logout.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
+
import {
|
|
2
|
+
clearSssAllowanceCache
|
|
3
|
+
} from "../chunk-C5RIKMTP.js";
|
|
4
|
+
import "../chunk-GRPLHUYC.js";
|
|
1
5
|
import "../chunk-JQKKMUCT.js";
|
|
2
6
|
import "../chunk-5FLTDWWP.js";
|
|
3
7
|
import {
|
|
4
8
|
renderLogoutStatus
|
|
5
9
|
} from "../chunk-RIRDBSBG.js";
|
|
6
|
-
import {
|
|
7
|
-
clearSssAllowanceCache
|
|
8
|
-
} from "../chunk-QIMAKL3Z.js";
|
|
9
|
-
import "../chunk-GRPLHUYC.js";
|
|
10
10
|
import {
|
|
11
11
|
getAuthClient
|
|
12
|
-
} from "../chunk-
|
|
12
|
+
} from "../chunk-MDLFWWXZ.js";
|
|
13
13
|
import "../chunk-TSPERKUS.js";
|
|
14
|
-
import "../chunk-
|
|
15
|
-
import "../chunk-
|
|
14
|
+
import "../chunk-TK4IZ73C.js";
|
|
15
|
+
import "../chunk-AUVTECEP.js";
|
|
16
16
|
import "../chunk-QRKI6MMK.js";
|
|
17
17
|
import "../chunk-ZOC4GITL.js";
|
|
18
18
|
|
|
@@ -4,11 +4,11 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
DEFAULT_MNEMONIC,
|
|
6
6
|
DotNS
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-PDCSBS5T.js";
|
|
8
8
|
import "../chunk-SI2ZUOYD.js";
|
|
9
9
|
import "../chunk-4IUTMHVB.js";
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-
|
|
10
|
+
import "../chunk-TK4IZ73C.js";
|
|
11
|
+
import "../chunk-AUVTECEP.js";
|
|
12
12
|
import {
|
|
13
13
|
getPopSelfServeConfig,
|
|
14
14
|
loadEnvironments,
|
package/dist/commands/whoami.js
CHANGED
|
@@ -2,12 +2,12 @@ import {
|
|
|
2
2
|
STALE_SESSION_MESSAGE,
|
|
3
3
|
getAuthClient,
|
|
4
4
|
hasPersistedSession
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-MDLFWWXZ.js";
|
|
6
6
|
import {
|
|
7
7
|
CLI_NAME
|
|
8
8
|
} from "../chunk-TSPERKUS.js";
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
9
|
+
import "../chunk-TK4IZ73C.js";
|
|
10
|
+
import "../chunk-AUVTECEP.js";
|
|
11
11
|
import "../chunk-QRKI6MMK.js";
|
|
12
12
|
import "../chunk-ZOC4GITL.js";
|
|
13
13
|
|
package/dist/deploy-actors.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { A as AuthClient } from './auth-CA_YKtM2.js';
|
|
2
|
+
import { PolkadotSigner } from 'polkadot-api';
|
|
2
3
|
import { R as ResolvedSigner } from './signer-Duup0hgQ.js';
|
|
4
|
+
import { A as AllocatableResource } from './allocations-CEPeZr6T.js';
|
|
3
5
|
import '@parity/product-sdk-terminal';
|
|
4
|
-
import 'polkadot-api';
|
|
5
|
-
import './allocations-CEPeZr6T.js';
|
|
6
6
|
import '@parity/product-sdk-tx';
|
|
7
7
|
|
|
8
8
|
declare class MainnetDefaultWorkerError extends Error {
|
|
@@ -20,5 +20,86 @@ interface ResolveDeployActorsOptions {
|
|
|
20
20
|
sessionPresent: boolean;
|
|
21
21
|
}
|
|
22
22
|
declare function resolveDeployActors(authClient: AuthClient, { suri, transferEnabled, isTestnet, sessionPresent }: ResolveDeployActorsOptions): Promise<DeployActors>;
|
|
23
|
+
/**
|
|
24
|
+
* Result returned by resolveStorageSigner when a Bulletin slot signer was found.
|
|
25
|
+
*
|
|
26
|
+
* `owned` is true when the slot comes from the user's own session (cache-hit or
|
|
27
|
+
* freshly allocated via step-4 prompt). It is used by formatStorageSignerLine to
|
|
28
|
+
* distinguish "your allowance slot" (owned) from "allowance slot" (explicitly
|
|
29
|
+
* injected by a programmatic caller).
|
|
30
|
+
*/
|
|
31
|
+
interface StorageSignerResult {
|
|
32
|
+
signer: PolkadotSigner;
|
|
33
|
+
slotAddress: string;
|
|
34
|
+
/** true when the slot comes from the user's own session (not a pre-injected slot). */
|
|
35
|
+
owned: true;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Injectable dependencies for resolveStorageSigner.
|
|
39
|
+
* All fields are optional — defaults are used when not provided (deploy path).
|
|
40
|
+
* Injecting stubs lets unit tests drive every branch without a real adapter.
|
|
41
|
+
*/
|
|
42
|
+
interface StorageSignerDeps {
|
|
43
|
+
/**
|
|
44
|
+
* Calls adapter.allowance.getBulletinSigner(sessionId, productId).
|
|
45
|
+
* Returns an Ok/Err result (product-sdk shape).
|
|
46
|
+
*/
|
|
47
|
+
getBulletinSigner: (sessionId: string, productId: string, adapter: any) => Promise<{
|
|
48
|
+
isOk(): boolean;
|
|
49
|
+
isErr(): boolean;
|
|
50
|
+
value?: PolkadotSigner;
|
|
51
|
+
error?: {
|
|
52
|
+
reason: string;
|
|
53
|
+
};
|
|
54
|
+
}>;
|
|
55
|
+
/**
|
|
56
|
+
* Triggers a phone prompt to allocate the BulletInAllowance resource.
|
|
57
|
+
* Returns AllocationOutcome[] — one per resource in order.
|
|
58
|
+
*/
|
|
59
|
+
requestResourceAllocation: (userSession: any, adapter: any, resources: AllocatableResource[]) => Promise<{
|
|
60
|
+
tag: string;
|
|
61
|
+
value?: unknown;
|
|
62
|
+
}[]>;
|
|
63
|
+
/**
|
|
64
|
+
* Read the cached slot account signer written by requestResourceAllocation.
|
|
65
|
+
* Returns null on a miss (graceful fallback).
|
|
66
|
+
*/
|
|
67
|
+
createSlotAccountSigner?: (adapter: any, resource: AllocatableResource) => Promise<PolkadotSigner | null>;
|
|
68
|
+
/** Encode a public key as SS58. */
|
|
69
|
+
ss58Encode: (publicKey: Uint8Array) => string;
|
|
70
|
+
/**
|
|
71
|
+
* Called BEFORE requestResourceAllocation to print the user-facing prompt.
|
|
72
|
+
* Should print the "check your phone" warning so the user knows what's coming.
|
|
73
|
+
* Ctrl-C will interrupt the subsequent requestResourceAllocation call directly.
|
|
74
|
+
*/
|
|
75
|
+
promptBeforeAllocation: () => void;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Resolve a user-owned Bulletin slot signer from the active session.
|
|
79
|
+
*
|
|
80
|
+
* Implements steps 3–4 of the storage-signer precedence:
|
|
81
|
+
* 3. Cache-hit: adapter.allowance.getBulletinSigner(sessionId) → slot signer.
|
|
82
|
+
* 4. Cache-miss (NotAvailable / Rejected): prompt then requestResourceAllocation
|
|
83
|
+
* ([BulletInAllowance]) → newly-allocated slot signer.
|
|
84
|
+
* 5. Fall through: returns null → caller falls back to pool.
|
|
85
|
+
*
|
|
86
|
+
* Non-goals: explicit storageSigner / signer / mnemonic paths — those are handled
|
|
87
|
+
* upstream by selectStorageReconnect. This function only handles session-derived slots.
|
|
88
|
+
*
|
|
89
|
+
* Layer-3 isolation is preserved: when `session` is null (no session file on disk,
|
|
90
|
+
* no --suri), this function returns null immediately without touching the SSO stack.
|
|
91
|
+
*
|
|
92
|
+
* @param session The resolved session object from resolveDeployActors (or null when
|
|
93
|
+
* no session is present). Must have { userSession, adapter } shape.
|
|
94
|
+
* @param deps Injectable dependencies for testing. Production callers pass
|
|
95
|
+
* undefined to use the real auth functions.
|
|
96
|
+
* @returns A { signer, slotAddress, owned: true } result or null (→ pool).
|
|
97
|
+
*/
|
|
98
|
+
declare function resolveStorageSigner(session: {
|
|
99
|
+
userSession: {
|
|
100
|
+
id: string;
|
|
101
|
+
};
|
|
102
|
+
adapter: any;
|
|
103
|
+
} | null | undefined, deps: StorageSignerDeps): Promise<StorageSignerResult | null>;
|
|
23
104
|
|
|
24
|
-
export { type DeployActors, MainnetDefaultWorkerError, type ResolveDeployActorsOptions, resolveDeployActors };
|
|
105
|
+
export { type DeployActors, MainnetDefaultWorkerError, type ResolveDeployActorsOptions, type StorageSignerDeps, type StorageSignerResult, resolveDeployActors, resolveStorageSigner };
|
package/dist/deploy-actors.js
CHANGED
|
@@ -1,45 +1,22 @@
|
|
|
1
|
-
import "./chunk-JQKKMUCT.js";
|
|
2
1
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
MainnetDefaultWorkerError,
|
|
3
|
+
resolveDeployActors,
|
|
4
|
+
resolveStorageSigner
|
|
5
|
+
} from "./chunk-7OVS6LIV.js";
|
|
6
|
+
import "./chunk-JQKKMUCT.js";
|
|
7
|
+
import "./chunk-5FLTDWWP.js";
|
|
5
8
|
import "./chunk-RIRDBSBG.js";
|
|
9
|
+
import "./chunk-MDLFWWXZ.js";
|
|
6
10
|
import "./chunk-TSPERKUS.js";
|
|
7
|
-
import
|
|
8
|
-
DEFAULT_MNEMONIC
|
|
9
|
-
} from "./chunk-4GDFP7XR.js";
|
|
11
|
+
import "./chunk-PDCSBS5T.js";
|
|
10
12
|
import "./chunk-SI2ZUOYD.js";
|
|
11
13
|
import "./chunk-4IUTMHVB.js";
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-TK4IZ73C.js";
|
|
15
|
+
import "./chunk-AUVTECEP.js";
|
|
14
16
|
import "./chunk-QRKI6MMK.js";
|
|
15
17
|
import "./chunk-ZOC4GITL.js";
|
|
16
|
-
|
|
17
|
-
// src/deploy-actors.ts
|
|
18
|
-
var DEFAULT_WORKER_SURI = DEFAULT_MNEMONIC;
|
|
19
|
-
var MainnetDefaultWorkerError = class extends Error {
|
|
20
|
-
constructor() {
|
|
21
|
-
super(
|
|
22
|
-
"Refusing to default the deploy worker to Alice on a non-testnet environment. Pass --mnemonic <a funded, sufficiently-verified key> to do the transfer flow, or --no-transfer-to-signedin-user to sign directly with your mobile session."
|
|
23
|
-
);
|
|
24
|
-
this.name = "MainnetDefaultWorkerError";
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
async function resolveDeployActors(authClient, { suri, transferEnabled, isTestnet, sessionPresent }) {
|
|
28
|
-
if (sessionPresent && transferEnabled) {
|
|
29
|
-
if (!suri && !isTestnet) throw new MainnetDefaultWorkerError();
|
|
30
|
-
const worker2 = await resolveSigner(authClient, { suri: suri ?? DEFAULT_WORKER_SURI });
|
|
31
|
-
const handle = await authClient.getSessionSigner();
|
|
32
|
-
if (!handle) throw new Error("transfer mode active but no session resolved; pass --no-transfer-to-signedin-user.");
|
|
33
|
-
try {
|
|
34
|
-
return { worker: worker2, recipientH160: handle.addresses.productH160 };
|
|
35
|
-
} finally {
|
|
36
|
-
handle.destroy();
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
const worker = await resolveSigner(authClient, { suri });
|
|
40
|
-
return { worker };
|
|
41
|
-
}
|
|
42
18
|
export {
|
|
43
19
|
MainnetDefaultWorkerError,
|
|
44
|
-
resolveDeployActors
|
|
20
|
+
resolveDeployActors,
|
|
21
|
+
resolveStorageSigner
|
|
45
22
|
};
|
package/dist/deploy.d.ts
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import { WsEvent } from 'polkadot-api/ws';
|
|
2
2
|
import { CID } from 'multiformats/cid';
|
|
3
3
|
import { ManifestFileEntry } from './manifest.js';
|
|
4
|
+
import { PhoneSignatureStep } from './dotns.js';
|
|
4
5
|
import { PopSelfServeConfig } from './environments.js';
|
|
5
6
|
import { PolkadotSigner } from 'polkadot-api';
|
|
6
7
|
export { EXIT_CODE_NO_RETRY, NonRetryableError } from './errors.js';
|
|
8
|
+
import './personhood/bootstrap.js';
|
|
9
|
+
import './personhood/bind-personal-id.js';
|
|
10
|
+
import './personhood/claim-pgas.js';
|
|
11
|
+
import './personhood/bind-paid-alias.js';
|
|
12
|
+
import './personhood/chain-prereqs.js';
|
|
7
13
|
|
|
8
14
|
interface DeployResult {
|
|
9
15
|
domainName: string;
|
|
@@ -135,10 +141,11 @@ declare function shouldHandoverName(opts: {
|
|
|
135
141
|
}): boolean;
|
|
136
142
|
/**
|
|
137
143
|
* Produce the one-line storage-signer status printed at resolution time. Exported for unit testing.
|
|
138
|
-
*
|
|
139
|
-
*
|
|
144
|
+
* User-owned slot: " Storage signer: your allowance slot <ss58>" (owned=true)
|
|
145
|
+
* Explicit slot: " Storage signer: allowance slot <ss58>" (owned=false or omitted)
|
|
146
|
+
* Fallback: " Storage signer: pool fallback (<reason>)"
|
|
140
147
|
*/
|
|
141
|
-
declare function formatStorageSignerLine(slotAddress: string | null, failReason?: string): string;
|
|
148
|
+
declare function formatStorageSignerLine(slotAddress: string | null, failReason?: string, owned?: boolean): string;
|
|
142
149
|
declare function storeFile(contentBytes: Uint8Array, { client: existingClient, unsafeApi: existingApi, signer: existingSigner, hashCode, }?: ExistingProvider & {
|
|
143
150
|
hashCode?: number;
|
|
144
151
|
}): Promise<string>;
|
|
@@ -347,6 +354,25 @@ interface DeployOptions {
|
|
|
347
354
|
* CLI: --contract <KEY>=<0xADDRESS> (repeatable).
|
|
348
355
|
*/
|
|
349
356
|
contracts?: Record<string, string>;
|
|
357
|
+
/**
|
|
358
|
+
* Plan of phone signatures this deploy will need. Fired once, at preflight,
|
|
359
|
+
* BEFORE storage. Notification only; used by the CLI bin to print the
|
|
360
|
+
* "Have your phone ready" banner up front.
|
|
361
|
+
*/
|
|
362
|
+
onPhoneSignaturePlan?: (steps: PhoneSignatureStep[]) => void;
|
|
363
|
+
/**
|
|
364
|
+
* Human-ready gate. Awaited immediately BEFORE each phone signature request
|
|
365
|
+
* is sent. Resolve when the human is at their phone and ready; reject/throw
|
|
366
|
+
* to abort. The per-signature operation timeout starts only AFTER this
|
|
367
|
+
* resolves. `attempt` >= 2 means a re-sign.
|
|
368
|
+
* Absent + non-TTY → fail fast (NonRetryableError).
|
|
369
|
+
* Absent + TTY → CLI bin must supply the hook; core does not readline.
|
|
370
|
+
*/
|
|
371
|
+
confirmPhoneReady?: (ctx: {
|
|
372
|
+
label: string;
|
|
373
|
+
attempt: number;
|
|
374
|
+
total: number;
|
|
375
|
+
}) => Promise<void>;
|
|
350
376
|
}
|
|
351
377
|
declare function resolveDotnsConnectOptions(options: Pick<DeployOptions, "mnemonic" | "derivationPath" | "signer" | "signerAddress">, assetHubEndpoints?: string[], autoAccountMapping?: boolean, contracts?: Record<string, string>, nativeToEthRatio?: bigint, environmentId?: string, popSelfServe?: PopSelfServeConfig | null, registerStorageDeposit?: bigint): {
|
|
352
378
|
signer?: PolkadotSigner;
|
|
@@ -430,4 +456,4 @@ declare function computePhoneSigningSteps(dotnsPreflight: {
|
|
|
430
456
|
needsPopUpgrade: boolean;
|
|
431
457
|
} | null, publishNeeded: boolean): string[];
|
|
432
458
|
|
|
433
|
-
export { BLAKE2B_256_MULTIHASH_CODE, BULLETIN_ENDPOINTS, type BitswapErrorVariant, type BitswapProbeResult, CHUNK_MORTALITY_PERIOD, DEFAULT_BULLETIN_RPC, DEFAULT_POOL_SIZE, type DeployContent, type DeployOptions, type DeployResult, ENCRYPT_KEY_LEN, ENCRYPT_MAGIC, ENCRYPT_NONCE_LEN, ENCRYPT_PBKDF2_ITERATIONS, ENCRYPT_SALT_LEN, ENCRYPT_TAG_LEN, SHA256_MULTIHASH_CODE, type SizeDecision, type StoreDirectoryOptions, WS_HEARTBEAT_TIMEOUT_MS, __assignDenseNoncesForTest, __selectStorageProviderModeForTest, applyManifestFetchAttributes, assertSubdomainOwnerMatchesSigner, browserUrlFor, buildFilesMap, checkDeploySize, chooseSignerInput, chunk, computePhoneSigningSteps, computeStorageCid, createCID, deploy, deriveRootSigner, detectFramework, encodeContenthash, encryptContent, estimateUploadBytes, formatStorageSignerLine, friendlyChainError, hasIPFS, interpretBitswapResult, isBenignTeardownError, isConnectionError, isPhoneSignerActive, makeBulletinStatusHandler, merkleize, probeP2pRetrieval, resolveDotnsConnectOptions, resolveReproducibleTimestamp, retryBudgetExhausted, setWsHaltCallback, shouldHandoverName, storeChunkedContent, storeDirectory, storeDirectoryV2, storeFile, unpublish };
|
|
459
|
+
export { BLAKE2B_256_MULTIHASH_CODE, BULLETIN_ENDPOINTS, type BitswapErrorVariant, type BitswapProbeResult, CHUNK_MORTALITY_PERIOD, DEFAULT_BULLETIN_RPC, DEFAULT_POOL_SIZE, type DeployContent, type DeployOptions, type DeployResult, ENCRYPT_KEY_LEN, ENCRYPT_MAGIC, ENCRYPT_NONCE_LEN, ENCRYPT_PBKDF2_ITERATIONS, ENCRYPT_SALT_LEN, ENCRYPT_TAG_LEN, PhoneSignatureStep, SHA256_MULTIHASH_CODE, type SizeDecision, type StoreDirectoryOptions, WS_HEARTBEAT_TIMEOUT_MS, __assignDenseNoncesForTest, __selectStorageProviderModeForTest, applyManifestFetchAttributes, assertSubdomainOwnerMatchesSigner, browserUrlFor, buildFilesMap, checkDeploySize, chooseSignerInput, chunk, computePhoneSigningSteps, computeStorageCid, createCID, deploy, deriveRootSigner, detectFramework, encodeContenthash, encryptContent, estimateUploadBytes, formatStorageSignerLine, friendlyChainError, hasIPFS, interpretBitswapResult, isBenignTeardownError, isConnectionError, isPhoneSignerActive, makeBulletinStatusHandler, merkleize, probeP2pRetrieval, resolveDotnsConnectOptions, resolveReproducibleTimestamp, retryBudgetExhausted, setWsHaltCallback, shouldHandoverName, storeChunkedContent, storeDirectory, storeDirectoryV2, storeFile, unpublish };
|
package/dist/deploy.js
CHANGED
|
@@ -50,25 +50,29 @@ import {
|
|
|
50
50
|
storeDirectoryV2,
|
|
51
51
|
storeFile,
|
|
52
52
|
unpublish
|
|
53
|
-
} from "./chunk-
|
|
54
|
-
import "./chunk-
|
|
53
|
+
} from "./chunk-A43XBCGD.js";
|
|
54
|
+
import "./chunk-C5RIKMTP.js";
|
|
55
55
|
import "./chunk-GRPLHUYC.js";
|
|
56
56
|
import "./chunk-HOTQDYHD.js";
|
|
57
57
|
import "./chunk-IW3X2MJF.js";
|
|
58
58
|
import "./chunk-KOSF5FDO.js";
|
|
59
59
|
import "./chunk-J3NIXHZZ.js";
|
|
60
60
|
import "./chunk-S7EM5VMW.js";
|
|
61
|
-
import "./chunk-
|
|
62
|
-
import "./chunk-
|
|
63
|
-
import "./chunk-
|
|
64
|
-
import "./chunk-LSZEHAFU.js";
|
|
61
|
+
import "./chunk-LXSTFGUA.js";
|
|
62
|
+
import "./chunk-5LJPUNCB.js";
|
|
63
|
+
import "./chunk-GF2QXG66.js";
|
|
65
64
|
import "./chunk-C2TS5MER.js";
|
|
65
|
+
import "./chunk-7OVS6LIV.js";
|
|
66
|
+
import "./chunk-JQKKMUCT.js";
|
|
67
|
+
import "./chunk-5FLTDWWP.js";
|
|
68
|
+
import "./chunk-RIRDBSBG.js";
|
|
69
|
+
import "./chunk-MDLFWWXZ.js";
|
|
66
70
|
import "./chunk-TSPERKUS.js";
|
|
67
|
-
import "./chunk-
|
|
71
|
+
import "./chunk-PDCSBS5T.js";
|
|
68
72
|
import "./chunk-SI2ZUOYD.js";
|
|
69
73
|
import "./chunk-4IUTMHVB.js";
|
|
70
|
-
import "./chunk-
|
|
71
|
-
import "./chunk-
|
|
74
|
+
import "./chunk-TK4IZ73C.js";
|
|
75
|
+
import "./chunk-AUVTECEP.js";
|
|
72
76
|
import "./chunk-QRKI6MMK.js";
|
|
73
77
|
import {
|
|
74
78
|
EXIT_CODE_NO_RETRY,
|