bulletin-deploy 0.15.2-rc.2 → 0.15.2

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 (55) hide show
  1. package/bin/bulletin-deploy +1 -5
  2. package/dist/auth-config.js +3 -3
  3. package/dist/bug-report.js +4 -4
  4. package/dist/chain-health.js +3 -3
  5. package/dist/{chunk-WDPZHQ47.js → chunk-2M65ETRD.js} +1 -1
  6. package/dist/{chunk-WIMRJK32.js → chunk-3THUTBHU.js} +8 -0
  7. package/dist/{chunk-ETL5WOOU.js → chunk-4T6LXSOJ.js} +1 -1
  8. package/dist/{chunk-QDK4KW7S.js → chunk-5HYWJO57.js} +2 -2
  9. package/dist/{chunk-3HKQCN5Y.js → chunk-CD2NN5LL.js} +1 -1
  10. package/dist/{chunk-7DQUTF5K.js → chunk-CRNBI46S.js} +3 -4
  11. package/dist/{chunk-NHYYNQSN.js → chunk-DN4FDSVM.js} +1 -1
  12. package/dist/{chunk-KIYZBXVI.js → chunk-EKBGOA24.js} +2 -2
  13. package/dist/{chunk-TULAHSR4.js → chunk-JZNSDAZM.js} +35 -97
  14. package/dist/{chunk-IJUKTHEP.js → chunk-KJVRJOKC.js} +48 -13
  15. package/dist/{chunk-VH4MENPE.js → chunk-KYBCFN3P.js} +1 -1
  16. package/dist/{chunk-WB6P374L.js → chunk-SJPSTDCN.js} +1 -1
  17. package/dist/{chunk-TUWXEZ2F.js → chunk-SNIF5BSD.js} +7 -4
  18. package/dist/{chunk-6AEIZMWM.js → chunk-X7QKYH3U.js} +43 -4
  19. package/dist/{chunk-5V6DL5OB.js → chunk-YXMWCUXP.js} +13 -1
  20. package/dist/{chunk-2CMBVGCM.js → chunk-ZPQO4PY2.js} +3 -3
  21. package/dist/chunk-probe.js +3 -3
  22. package/dist/commands/login.js +12 -13
  23. package/dist/commands/logout.js +4 -4
  24. package/dist/commands/transfer.js +5 -5
  25. package/dist/commands/whoami.js +3 -3
  26. package/dist/deploy-actors.js +7 -7
  27. package/dist/deploy.d.ts +4 -17
  28. package/dist/deploy.js +12 -13
  29. package/dist/dotns.js +5 -5
  30. package/dist/index.d.ts +1 -1
  31. package/dist/index.js +16 -17
  32. package/dist/manifest/byte-budget.js +1 -1
  33. package/dist/manifest/config-load.js +2 -2
  34. package/dist/manifest/publish.d.ts +1 -1
  35. package/dist/manifest/publish.js +14 -15
  36. package/dist/manifest/schema.d.ts +1 -1
  37. package/dist/manifest/schema.js +1 -1
  38. package/dist/manifest/types.d.ts +15 -4
  39. package/dist/memory-report.js +2 -2
  40. package/dist/merkle.js +12 -13
  41. package/dist/personhood/bootstrap.js +5 -5
  42. package/dist/personhood/people-client.js +5 -5
  43. package/dist/pool.d.ts +31 -3
  44. package/dist/pool.js +9 -1
  45. package/dist/run-state.js +1 -1
  46. package/dist/sss-allowance-cache.js +4 -4
  47. package/dist/storage-signer.d.ts +10 -7
  48. package/dist/storage-signer.js +12 -13
  49. package/dist/telemetry.d.ts +1 -1
  50. package/dist/telemetry.js +2 -2
  51. package/dist/version-check.js +3 -3
  52. package/package.json +2 -2
  53. package/dist/chunk-CGDOG7ZW.js +0 -224
  54. package/dist/gh-pages-mirror.d.ts +0 -78
  55. package/dist/gh-pages-mirror.js +0 -38
@@ -57,7 +57,6 @@ for (let i = 0; i < args.length; i++) {
57
57
  else if (args[i] === "--tag") { flags.tag = args[++i]; }
58
58
  else if (args[i] === "--config") { flags.config = args[++i]; }
59
59
  else if (args[i] === "--no-manifest" || args[i] === "--content-only") { flags.noManifest = true; }
60
- else if (args[i] === "--gh-pages-mirror") { flags.ghPagesMirror = true; }
61
60
  else if (args[i] === "--allow-large-deploy") { flags.allowLargeDeploy = true; }
62
61
  else if (args[i] === "--reproducible") { flags.reproducibleSource = "commit"; }
63
62
  else if (args[i].startsWith("--reproducible=")) { flags.reproducibleSource = args[i].slice("--reproducible=".length); }
@@ -305,14 +304,12 @@ Options:
305
304
  --config <path> Explicit path to a bulletin-deploy.config.ts (default: walk up from
306
305
  <build-dir> looking for bulletin-deploy.config.{ts,js,mjs}). When a
307
306
  config is found, deploy ALSO writes the manifest + executable text
308
- records on <domain> and its app/widget/worker subnames.
307
+ records on <domain> and its app/widget/funding/worker subnames.
309
308
  --no-manifest, --content-only
310
309
  Skip manifest publishing entirely, even when a
311
310
  bulletin-deploy.config.* is discoverable — plain content
312
311
  deploy (storage + root contenthash), same as having no
313
312
  config at all. Mutually exclusive with --publish.
314
- --gh-pages-mirror After deploy, push the CAR to the current repo's gh-pages branch
315
- at bulletin/<domain>.dot.car (opt-in; also set GH_PAGES_MIRROR=1)
316
313
  --publish After deploy, list <domain> in the on-chain Publisher
317
314
  registry (Publisher.publish). Only takes effect on envs
318
315
  with a deployed Publisher (currently: paseo-next-v2).
@@ -527,7 +524,6 @@ try {
527
524
  jsMerkle: flags.jsMerkle,
528
525
  inputCar: flags.inputCar,
529
526
  tag: flags.tag,
530
- ghPagesMirror: flags.ghPagesMirror,
531
527
  allowLargeDeploy: flags.allowLargeDeploy,
532
528
  reproducibleSource: flags.reproducibleSource,
533
529
  dumpCar: flags.dumpCar,
@@ -9,12 +9,12 @@ import {
9
9
  getPeopleChainEndpoints,
10
10
  hasPersistedSession,
11
11
  resolveBulletinEndpoints
12
- } from "./chunk-VH4MENPE.js";
12
+ } from "./chunk-KYBCFN3P.js";
13
13
  import "./chunk-TSPERKUS.js";
14
14
  import "./chunk-CL7GQYYK.js";
15
15
  import "./chunk-ZOC4GITL.js";
16
- import "./chunk-6AEIZMWM.js";
17
- import "./chunk-QDK4KW7S.js";
16
+ import "./chunk-X7QKYH3U.js";
17
+ import "./chunk-5HYWJO57.js";
18
18
  export {
19
19
  DOT_DAPP_ID,
20
20
  DOT_DERIVATION_INDEX,
@@ -10,10 +10,10 @@ import {
10
10
  offerBugReport,
11
11
  scrubSecrets,
12
12
  setDeployContext
13
- } from "./chunk-7DQUTF5K.js";
14
- import "./chunk-WDPZHQ47.js";
15
- import "./chunk-6AEIZMWM.js";
16
- import "./chunk-QDK4KW7S.js";
13
+ } from "./chunk-CRNBI46S.js";
14
+ import "./chunk-2M65ETRD.js";
15
+ import "./chunk-X7QKYH3U.js";
16
+ import "./chunk-5HYWJO57.js";
17
17
  export {
18
18
  buildCliFlagsSummary,
19
19
  buildLabels,
@@ -3,9 +3,9 @@ import {
3
3
  DEFAULT_WINDOW_BLOCKS,
4
4
  MAX_SPANS_PER_SAMPLER,
5
5
  endpointHost
6
- } from "./chunk-WB6P374L.js";
7
- import "./chunk-6AEIZMWM.js";
8
- import "./chunk-QDK4KW7S.js";
6
+ } from "./chunk-SJPSTDCN.js";
7
+ import "./chunk-X7QKYH3U.js";
8
+ import "./chunk-5HYWJO57.js";
9
9
  export {
10
10
  ChainHealthSampler,
11
11
  DEFAULT_WINDOW_BLOCKS,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-6AEIZMWM.js";
3
+ } from "./chunk-X7QKYH3U.js";
4
4
 
5
5
  // src/version-check.ts
6
6
  import { execSync, execFileSync } from "child_process";
@@ -53,6 +53,14 @@ function composePlaceholderExecutable(exec) {
53
53
  ...exec.description !== void 0 ? { description: exec.description } : {}
54
54
  };
55
55
  }
56
+ if (exec.kind === "funding") {
57
+ return {
58
+ $v: 1,
59
+ kind: "funding",
60
+ appVersion: exec.appVersion,
61
+ modes: exec.modes
62
+ };
63
+ }
56
64
  return {
57
65
  $v: 1,
58
66
  kind: "worker",
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-GRPLHUYC.js";
4
4
  import {
5
5
  DOT_DAPP_ID
6
- } from "./chunk-VH4MENPE.js";
6
+ } from "./chunk-KYBCFN3P.js";
7
7
 
8
8
  // src/sss-allowance-cache.ts
9
9
  import { mkdir, readFile, writeFile, unlink } from "fs/promises";
@@ -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.15.2-rc.2",
9
+ version: "0.15.2",
10
10
  private: false,
11
11
  repository: {
12
12
  type: "git",
@@ -52,7 +52,7 @@ var package_default = {
52
52
  "tools/verify-baked-dsn.mjs"
53
53
  ],
54
54
  scripts: {
55
- build: "tsup src/suppress-localstorage-warning.ts src/index.ts src/deploy.ts src/dotns.ts src/pool.ts src/telemetry.ts src/chain-health.ts src/memory-report.ts src/merkle.ts src/gh-pages-mirror.ts src/version-check.ts src/bug-report.ts src/run-state.ts src/environments.ts src/errors.ts src/manifest.ts src/chunk-probe.ts src/manifest-embed.ts src/manifest-fetch.ts src/manifest-roundtrip.ts src/incremental-stats.ts src/chunker.ts src/personhood/encoding.ts src/personhood/hashing.ts src/personhood/constants.ts src/personhood/member-key.ts src/personhood/people-client.ts src/personhood/proof-validity.ts src/personhood/reprove.ts src/personhood/bind-personal-id.ts src/personhood/claim-pgas.ts src/personhood/bind-paid-alias.ts src/personhood/bootstrap.ts src/personhood/chain-prereqs.ts src/manifest/types.ts src/manifest/schema.ts src/manifest/byte-budget.ts src/manifest/config-load.ts src/manifest/publish.ts src/auth/index.ts src/auth/vendor/index.ts src/auth/vendor/ui/index.ts src/auth-config.ts src/commands/login.ts src/commands/logout.ts src/commands/whoami.ts src/commands/transfer.ts src/storage-signer.ts src/spinner.ts src/sss-allowance.ts src/sss-allowance-cache.ts src/deploy-actors.ts --format esm --dts --clean --target node22",
55
+ build: "tsup src/suppress-localstorage-warning.ts src/index.ts src/deploy.ts src/dotns.ts src/pool.ts src/telemetry.ts src/chain-health.ts src/memory-report.ts src/merkle.ts src/version-check.ts src/bug-report.ts src/run-state.ts src/environments.ts src/errors.ts src/manifest.ts src/chunk-probe.ts src/manifest-embed.ts src/manifest-fetch.ts src/manifest-roundtrip.ts src/incremental-stats.ts src/chunker.ts src/personhood/encoding.ts src/personhood/hashing.ts src/personhood/constants.ts src/personhood/member-key.ts src/personhood/people-client.ts src/personhood/proof-validity.ts src/personhood/reprove.ts src/personhood/bind-personal-id.ts src/personhood/claim-pgas.ts src/personhood/bind-paid-alias.ts src/personhood/bootstrap.ts src/personhood/chain-prereqs.ts src/manifest/types.ts src/manifest/schema.ts src/manifest/byte-budget.ts src/manifest/config-load.ts src/manifest/publish.ts src/auth/index.ts src/auth/vendor/index.ts src/auth/vendor/ui/index.ts src/auth-config.ts src/commands/login.ts src/commands/logout.ts src/commands/whoami.ts src/commands/transfer.ts src/storage-signer.ts src/spinner.ts src/sss-allowance.ts src/sss-allowance-cache.ts src/deploy-actors.ts --format esm --dts --clean --target node22",
56
56
  "refresh-environments": "node scripts/refresh-environments.mjs",
57
57
  postinstall: "patch-package || true",
58
58
  prepare: "npm run build",
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  captureWarning
3
- } from "./chunk-6AEIZMWM.js";
3
+ } from "./chunk-X7QKYH3U.js";
4
4
 
5
5
  // src/chunk-probe.ts
6
6
  import { Twox128, Blake2128Concat, decAnyMetadata, unifyMetadata } from "@polkadot-api/substrate-bindings";
@@ -2,15 +2,15 @@ import {
2
2
  classifyErrorArea,
3
3
  isInteractive,
4
4
  promptYesNo
5
- } from "./chunk-WDPZHQ47.js";
5
+ } from "./chunk-2M65ETRD.js";
6
6
  import {
7
7
  VERSION,
8
8
  getCurrentSentryTraceId,
9
9
  resolveIssueRepoSlug
10
- } from "./chunk-6AEIZMWM.js";
10
+ } from "./chunk-X7QKYH3U.js";
11
11
  import {
12
12
  package_default
13
- } from "./chunk-QDK4KW7S.js";
13
+ } from "./chunk-5HYWJO57.js";
14
14
 
15
15
  // src/bug-report.ts
16
16
  import { execSync, execFileSync } from "child_process";
@@ -80,7 +80,6 @@ function scrubSecrets(text) {
80
80
  function buildCliFlagsSummary(flags) {
81
81
  const parts = [];
82
82
  if (flags.jsMerkle) parts.push("--js-merkle");
83
- if (flags.ghPagesMirror) parts.push("--gh-pages-mirror");
84
83
  if (flags.publish) parts.push("--publish");
85
84
  if (flags.unpublish) parts.push("--unpublish");
86
85
  if (flags.failOnPublishError) parts.push("--fail-on-publish-error");
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  validateProductConfig
3
- } from "./chunk-5V6DL5OB.js";
3
+ } from "./chunk-YXMWCUXP.js";
4
4
  import {
5
5
  NonRetryableError
6
6
  } from "./chunk-ZOC4GITL.js";
@@ -4,10 +4,10 @@ import {
4
4
  } from "./chunk-5FLTDWWP.js";
5
5
  import {
6
6
  DOT_PRODUCT_ID
7
- } from "./chunk-VH4MENPE.js";
7
+ } from "./chunk-KYBCFN3P.js";
8
8
  import {
9
9
  DEFAULT_MNEMONIC
10
- } from "./chunk-2CMBVGCM.js";
10
+ } from "./chunk-ZPQO4PY2.js";
11
11
 
12
12
  // src/deploy-actors.ts
13
13
  var DEFAULT_WORKER_SURI = DEFAULT_MNEMONIC;
@@ -1,14 +1,9 @@
1
1
  import {
2
2
  preflightSssAllowance
3
- } from "./chunk-ETL5WOOU.js";
3
+ } from "./chunk-4T6LXSOJ.js";
4
4
  import {
5
5
  statementSigningAccount
6
6
  } from "./chunk-GRPLHUYC.js";
7
- import {
8
- MirrorSkipped,
9
- mirrorToGitHubPages,
10
- pollMirrorFreshness
11
- } from "./chunk-CGDOG7ZW.js";
12
7
  import {
13
8
  computeStats,
14
9
  renderSummary,
@@ -31,18 +26,18 @@ import {
31
26
  } from "./chunk-S7EM5VMW.js";
32
27
  import {
33
28
  setDeployContext
34
- } from "./chunk-7DQUTF5K.js";
29
+ } from "./chunk-CRNBI46S.js";
35
30
  import {
36
31
  getBestBlockNumber,
37
32
  probeChunks,
38
33
  probeFinalityGap
39
- } from "./chunk-3HKQCN5Y.js";
34
+ } from "./chunk-CD2NN5LL.js";
40
35
  import {
41
36
  packSection
42
37
  } from "./chunk-C2TS5MER.js";
43
38
  import {
44
39
  resolveStorageSigner
45
- } from "./chunk-KIYZBXVI.js";
40
+ } from "./chunk-EKBGOA24.js";
46
41
  import {
47
42
  createSlotAccountSigner,
48
43
  requestResourceAllocation
@@ -51,7 +46,7 @@ import {
51
46
  STALE_SESSION_MESSAGE,
52
47
  getPeopleChainEndpoints,
53
48
  hasPersistedSession
54
- } from "./chunk-VH4MENPE.js";
49
+ } from "./chunk-KYBCFN3P.js";
55
50
  import {
56
51
  CLI_NAME
57
52
  } from "./chunk-TSPERKUS.js";
@@ -67,15 +62,16 @@ import {
67
62
  parseDomainName,
68
63
  popStatusName,
69
64
  verifyNonceAdvanced
70
- } from "./chunk-2CMBVGCM.js";
65
+ } from "./chunk-ZPQO4PY2.js";
71
66
  import {
72
67
  derivePoolAccounts,
73
68
  detectTestnet,
74
69
  ensureAuthorized,
75
70
  fetchPoolAuthorizations,
76
71
  isAuthorizationSufficient,
72
+ readAccountAuthorization,
77
73
  selectAccount
78
- } from "./chunk-IJUKTHEP.js";
74
+ } from "./chunk-KJVRJOKC.js";
79
75
  import {
80
76
  DEFAULT_ENV_ID,
81
77
  getPopSelfServeConfig,
@@ -87,7 +83,7 @@ import {
87
83
  } from "./chunk-ZOC4GITL.js";
88
84
  import {
89
85
  ChainHealthSampler
90
- } from "./chunk-WB6P374L.js";
86
+ } from "./chunk-SJPSTDCN.js";
91
87
  import {
92
88
  VERSION,
93
89
  captureWarning,
@@ -101,7 +97,7 @@ import {
101
97
  truncateAddress,
102
98
  withDeploySpan,
103
99
  withSpan
104
- } from "./chunk-6AEIZMWM.js";
100
+ } from "./chunk-X7QKYH3U.js";
105
101
 
106
102
  // src/merkle.ts
107
103
  import * as fs2 from "fs";
@@ -121,7 +117,7 @@ import * as path from "path";
121
117
  import { execSync } from "child_process";
122
118
  import { sha256 } from "@noble/hashes/sha256";
123
119
  import { blake2b } from "@noble/hashes/blake2b";
124
- import { createClient as createPolkadotClient2, Enum as Enum2 } from "polkadot-api";
120
+ import { createClient as createPolkadotClient2 } from "polkadot-api";
125
121
  import { getWsProvider as getWsProvider2, WsEvent } from "polkadot-api/ws";
126
122
  import { CID } from "multiformats/cid";
127
123
  import { create as createMultihash } from "multiformats/hashes/digest";
@@ -194,7 +190,7 @@ function fromHex(hexString) {
194
190
  // src/storage-signer.ts
195
191
  import { sr25519CreateDerive } from "@polkadot-labs/hdkd";
196
192
  import { sr25519, ss58Address } from "@polkadot-labs/hdkd-helpers";
197
- import { createClient as createPolkadotClient, Enum } from "polkadot-api";
193
+ import { createClient as createPolkadotClient } from "polkadot-api";
198
194
  import { getPolkadotSigner } from "polkadot-api/signer";
199
195
  import { getWsProvider } from "polkadot-api/ws";
200
196
  function sanitize(appId) {
@@ -336,7 +332,7 @@ async function waitForBulletinAuthorization(ss58, opts = {}) {
336
332
  return await pollUntilBulletinAuthorized(
337
333
  async () => {
338
334
  const [auth, block] = await Promise.all([
339
- unsafeApi.query.TransactionStorage.Authorizations.getValue(Enum("Account", ss58)),
335
+ readAccountAuthorization(unsafeApi, ss58),
340
336
  client.getFinalizedBlock()
341
337
  ]);
342
338
  return { auth, blockNumber: block.number };
@@ -378,18 +374,20 @@ async function getSlotSignerProvider(signer, ss58) {
378
374
  { heartbeatTimeout: WS_HEARTBEAT_TIMEOUT_MS, onStatusChanged: makeBulletinStatusHandler(primary) }
379
375
  ));
380
376
  const unsafeApi = client.getUnsafeApi();
381
- let auth;
382
- let currentBlock;
377
+ let auth = null;
378
+ let blockNumber = 0;
383
379
  try {
384
- [auth, currentBlock] = await Promise.all([
385
- unsafeApi.query.TransactionStorage.Authorizations.getValue(Enum("Account", ss58)),
380
+ const [readAuth, finalized] = await Promise.all([
381
+ readAccountAuthorization(unsafeApi, ss58),
386
382
  client.getFinalizedBlock()
387
383
  ]);
384
+ auth = readAuth;
385
+ blockNumber = finalized.number;
388
386
  } catch (e) {
389
387
  client.destroy();
390
388
  throw e;
391
389
  }
392
- const result = isBulletinAuthActive(auth, currentBlock.number);
390
+ const result = isBulletinAuthActive(auth, blockNumber);
393
391
  if (!result.active) {
394
392
  client.destroy();
395
393
  throw new BulletinSlotAuthError(result.reason, ss58, result.expiration);
@@ -599,15 +597,15 @@ async function getDirectProvider(mnemonic, derivationPath = "") {
599
597
  const { signer, ss58 } = deriveRootSigner(mnemonic, derivationPath);
600
598
  console.log(` Using direct signer: ${ss58}${derivationPath ? ` (path: ${derivationPath})` : ""}`);
601
599
  let [auth, currentBlock] = await Promise.all([
602
- unsafeApi.query.TransactionStorage.Authorizations.getValue(Enum2("Account", ss58)),
600
+ readAccountAuthorization(unsafeApi, ss58),
603
601
  client.getFinalizedBlock()
604
602
  ]);
605
603
  let now = currentBlock.number;
606
- if (!auth || Number(auth.expiration ?? 0) <= now) {
604
+ if (!isAuthorizationSufficient(auth, now)) {
607
605
  try {
608
606
  await ensureAuthorized(unsafeApi, ss58, "direct signer", { autoAuthorize: bulletinAutoAuthorize, authorizer: bulletinAuthorizer });
609
607
  [auth, currentBlock] = await Promise.all([
610
- unsafeApi.query.TransactionStorage.Authorizations.getValue(Enum2("Account", ss58)),
608
+ readAccountAuthorization(unsafeApi, ss58),
611
609
  client.getFinalizedBlock()
612
610
  ]);
613
611
  now = currentBlock.number;
@@ -616,7 +614,7 @@ async function getDirectProvider(mnemonic, derivationPath = "") {
616
614
  throw new NonRetryableError(`Account ${ss58} is not authorized for Bulletin storage and auto-authorization failed: ${e.message}`);
617
615
  }
618
616
  }
619
- console.log(` Authorization: expires at block ${Number(auth?.expiration ?? 0)} (current: ${now})`);
617
+ console.log(` Authorization: expires at block ${auth?.expiration ?? 0} (current: ${now})`);
620
618
  setDeployAttribute("deploy.signer.mode", "direct");
621
619
  setDeployAttribute("deploy.signer.address", truncateAddress(ss58));
622
620
  return { client, unsafeApi, signer, ss58 };
@@ -625,15 +623,15 @@ async function getSignerProvider(signer, ss58) {
625
623
  const { client, unsafeApi } = createBulletinClient();
626
624
  console.log(` Using external signer: ${ss58}`);
627
625
  let [auth, currentBlock] = await Promise.all([
628
- unsafeApi.query.TransactionStorage.Authorizations.getValue(Enum2("Account", ss58)),
626
+ readAccountAuthorization(unsafeApi, ss58),
629
627
  client.getFinalizedBlock()
630
628
  ]);
631
629
  let now = currentBlock.number;
632
- if (!auth || Number(auth.expiration ?? 0) <= now) {
630
+ if (!isAuthorizationSufficient(auth, now)) {
633
631
  try {
634
632
  await ensureAuthorized(unsafeApi, ss58, "external signer", { autoAuthorize: bulletinAutoAuthorize, authorizer: bulletinAuthorizer });
635
633
  [auth, currentBlock] = await Promise.all([
636
- unsafeApi.query.TransactionStorage.Authorizations.getValue(Enum2("Account", ss58)),
634
+ readAccountAuthorization(unsafeApi, ss58),
637
635
  client.getFinalizedBlock()
638
636
  ]);
639
637
  now = currentBlock.number;
@@ -642,7 +640,7 @@ async function getSignerProvider(signer, ss58) {
642
640
  throw new NonRetryableError(`Account ${ss58} is not authorized for Bulletin storage and auto-authorization failed: ${e.message}`);
643
641
  }
644
642
  }
645
- console.log(` Authorization: expires at block ${Number(auth?.expiration ?? 0)} (current: ${now})`);
643
+ console.log(` Authorization: expires at block ${auth?.expiration ?? 0} (current: ${now})`);
646
644
  setDeployAttribute("deploy.signer.mode", "external");
647
645
  setDeployAttribute("deploy.signer.address", truncateAddress(ss58));
648
646
  return { client, unsafeApi, signer, ss58 };
@@ -920,17 +918,17 @@ async function storeChunkedContent(chunks, { client: existingClient, unsafeApi:
920
918
  }
921
919
  }
922
920
  const readUploadAuthorization = () => Promise.all([
923
- unsafeApi.query.TransactionStorage.Authorizations.getValue(Enum2("Account", ss58)),
924
- unsafeApi.query.System.Number.getValue()
921
+ unsafeApi.query.System.Number.getValue(),
922
+ readAccountAuthorization(unsafeApi, ss58)
925
923
  ]);
926
- let uploadAuth;
927
- let currentBlockNum;
924
+ let uploadAuth = null;
925
+ let currentBlockNum = 0;
928
926
  try {
929
- [uploadAuth, currentBlockNum] = await readUploadAuthorization();
927
+ [currentBlockNum, uploadAuth] = await readUploadAuthorization();
930
928
  } catch (e) {
931
929
  if (existingClient && reconnect && isConnectionError(e)) {
932
930
  await refreshExistingClient("authorization preflight hit a stale chainHead");
933
- [uploadAuth, currentBlockNum] = await readUploadAuthorization();
931
+ [currentBlockNum, uploadAuth] = await readUploadAuthorization();
934
932
  } else {
935
933
  throw e;
936
934
  }
@@ -2286,7 +2284,6 @@ async function deploy(content, domainName = null, options = {}) {
2286
2284
  setDeployAttribute("deploy.transfer.enabled", options.transferTo ? "true" : "false");
2287
2285
  let cid;
2288
2286
  let ipfsCid;
2289
- let mirrorPromise = Promise.resolve(null);
2290
2287
  console.log("\n" + "=".repeat(60));
2291
2288
  console.log(`DEPLOYING TO TESTNET v${VERSION}`);
2292
2289
  console.log("=".repeat(60));
@@ -2443,18 +2440,6 @@ async function deploy(content, domainName = null, options = {}) {
2443
2440
  carChunks = chunk(carContent, CHUNK_SIZE);
2444
2441
  }
2445
2442
  }
2446
- const predictedStorageCid = computeStorageCid(carChunks);
2447
- if (options.ghPagesMirror) {
2448
- mirrorPromise = mirrorToGitHubPages({
2449
- domain: name,
2450
- carBytes: carContent,
2451
- cid: predictedStorageCid,
2452
- toolVersion: VERSION,
2453
- bulletinRpc: BULLETIN_ENDPOINTS[0],
2454
- encrypted: Boolean(options.password),
2455
- tld: envTld
2456
- }).catch((err) => err instanceof Error ? err : new Error(String(err)));
2457
- }
2458
2443
  cid = (await storeChunkedContent(carChunks, providerWithReconnect)).storageCid;
2459
2444
  } else if (process.env.IPFS_CID) {
2460
2445
  setDeployAttribute("deploy.content_type", "ipfsCid");
@@ -2503,20 +2488,7 @@ async function deploy(content, domainName = null, options = {}) {
2503
2488
  reproducibleSource: options.reproducibleSource,
2504
2489
  domain: name,
2505
2490
  gateway: envIpfs,
2506
- dumpCar: options.dumpCar,
2507
- onCarReady: (carBytes, predictedCid) => {
2508
- if (options.ghPagesMirror) {
2509
- mirrorPromise = mirrorToGitHubPages({
2510
- domain: name,
2511
- carBytes,
2512
- cid: predictedCid,
2513
- toolVersion: VERSION,
2514
- bulletinRpc: BULLETIN_ENDPOINTS[0],
2515
- encrypted: Boolean(options.password),
2516
- tld: envTld
2517
- }).catch((err) => err instanceof Error ? err : new Error(String(err)));
2518
- }
2519
- }
2491
+ dumpCar: options.dumpCar
2520
2492
  });
2521
2493
  cid = sCid;
2522
2494
  ipfsCid = iCid;
@@ -2690,40 +2662,6 @@ async function deploy(content, domainName = null, options = {}) {
2690
2662
  console.log(` P2P retrieval: \u26A0 not yet retrievable (${probe.errorVariant}, ${probe.durationMs}ms)`);
2691
2663
  }
2692
2664
  });
2693
- if (options.ghPagesMirror) {
2694
- console.log("\n" + "=".repeat(60));
2695
- console.log("Final checks");
2696
- console.log("=".repeat(60));
2697
- await withSpan("deploy.gh-pages-mirror", "4. gh-pages-mirror", { "deploy.domain": name }, async () => {
2698
- const mirror = await mirrorPromise;
2699
- if (mirror === null) {
2700
- console.log(" GitHub Pages mirror: skipped (only directory deploys produce a CAR suitable for mirroring).");
2701
- return;
2702
- }
2703
- if (mirror instanceof MirrorSkipped) {
2704
- console.log(` GitHub Pages mirror: skipped \u2014 ${mirror.message}`);
2705
- return;
2706
- }
2707
- if (mirror instanceof Error) {
2708
- console.log(` GitHub Pages mirror: failed (non-fatal) \u2014 ${mirror.message}`);
2709
- captureWarning("gh-pages mirror failed", { error: mirror.message.slice(0, 200) });
2710
- return;
2711
- }
2712
- console.log(` Mirror: ${mirror.url}`);
2713
- console.log(` Manifest: https://${mirror.owner}.github.io/${mirror.repo}/${mirror.manifestPath}`);
2714
- setDeployAttribute("deploy.gh_pages_url", mirror.url);
2715
- process.stdout.write(" Verifying Pages serves this deploy's CAR... ");
2716
- const freshness = await pollMirrorFreshness(mirror.url, cid, { timeoutMs: 3 * 60 * 1e3, intervalMs: 1e4 });
2717
- if (freshness.verified) {
2718
- console.log(`ok (${freshness.attempts} attempt${freshness.attempts === 1 ? "" : "s"}, ${(freshness.durationMs / 1e3).toFixed(0)}s).`);
2719
- setDeployAttribute("deploy.gh_pages_freshness_verified", "true");
2720
- } else {
2721
- console.log(`timed out.`);
2722
- console.log(` GitHub Pages last served cid=${freshness.lastCid ?? "n/a"} (expected ${cid}); it should catch up shortly. Non-fatal.`);
2723
- setDeployAttribute("deploy.gh_pages_freshness_verified", "false");
2724
- }
2725
- });
2726
- }
2727
2665
  console.log("\n" + "=".repeat(60));
2728
2666
  console.log("DEPLOYMENT COMPLETE!");
2729
2667
  console.log("=".repeat(60));
@@ -37,10 +37,43 @@ function derivePoolAccounts(poolSize = 10, mnemonic = DEV_PHRASE) {
37
37
  }
38
38
  return accounts;
39
39
  }
40
+ var ACCOUNT_AUTHORIZATION_FIELDS = [
41
+ "expires_at",
42
+ "bytes_allowance",
43
+ "bytes_used",
44
+ "bytes_permanent_used",
45
+ "transactions_allowance",
46
+ "transactions_used"
47
+ ];
48
+ async function readAccountAuthorization(api, address) {
49
+ const auth = await api.apis.BulletinTransactionStorageApi.account_authorization(address);
50
+ if (auth == null) return null;
51
+ const missing = ACCOUNT_AUTHORIZATION_FIELDS.filter((f) => auth[f] == null);
52
+ if (missing.length > 0) {
53
+ throw new Error(
54
+ `Bulletin returned an AccountAuthorization for ${address} without ${missing.join(", ")} \u2014 this chain's BulletinTransactionStorageApi does not match what bulletin-deploy reads. Upgrade bulletin-deploy.`
55
+ );
56
+ }
57
+ return {
58
+ expiration: Number(auth.expires_at),
59
+ transactionsAllowance: Number(auth.transactions_allowance),
60
+ transactionsUsed: Number(auth.transactions_used),
61
+ // u64: a decoder may hand back number or bigint; the quota arithmetic can't mix.
62
+ bytesAllowance: BigInt(auth.bytes_allowance),
63
+ bytesUsed: BigInt(auth.bytes_used),
64
+ bytesPermanentUsed: BigInt(auth.bytes_permanent_used)
65
+ };
66
+ }
67
+ function remainingRenewBytes(auth) {
68
+ const left = auth.bytesAllowance - auth.bytesPermanentUsed;
69
+ return left > 0n ? left : 0n;
70
+ }
71
+ function remainingTransactions(auth) {
72
+ const left = auth.transactionsAllowance - auth.transactionsUsed;
73
+ return left > 0 ? BigInt(left) : 0n;
74
+ }
40
75
  function isAuthorizationSufficient(auth, currentBlock) {
41
- if (auth === void 0) return false;
42
- if (Number(auth.expiration ?? 0) <= currentBlock) return false;
43
- return true;
76
+ return auth != null && auth.expiration > currentBlock;
44
77
  }
45
78
  function accountsNeedingAuthorization(auths, currentBlock) {
46
79
  return auths.filter((a) => !isAuthorizationSufficient(a, currentBlock));
@@ -70,17 +103,15 @@ async function fetchPoolAuthorizations(api, accounts) {
70
103
  const results = await Promise.all(
71
104
  accounts.map(async (account) => {
72
105
  try {
73
- const auth = await api.query.TransactionStorage.Authorizations.getValue(
74
- Enum("Account", account.address)
75
- );
106
+ const auth = await readAccountAuthorization(api, account.address);
76
107
  return {
77
108
  ...account,
78
- transactions: auth ? BigInt(auth.extent.transactions_allowance) - BigInt(auth.extent.transactions) : 0n,
79
- bytes: auth ? BigInt(auth.extent.bytes_allowance) - BigInt(auth.extent.bytes) : 0n,
80
- expiration: auth ? Number(auth.expiration) : 0
109
+ transactions: auth ? remainingTransactions(auth) : 0n,
110
+ renewBytes: auth ? remainingRenewBytes(auth) : 0n,
111
+ expiration: auth ? auth.expiration : 0
81
112
  };
82
113
  } catch {
83
- return { ...account, transactions: 0n, bytes: 0n, expiration: 0 };
114
+ return { ...account, transactions: 0n, renewBytes: 0n, expiration: 0 };
84
115
  }
85
116
  })
86
117
  );
@@ -119,7 +150,7 @@ function clampU32(n, name) {
119
150
  }
120
151
  async function ensureAuthorized(api, address, label, opts = {}) {
121
152
  const [auth, currentBlock] = await Promise.all([
122
- api.query.TransactionStorage.Authorizations.getValue(Enum("Account", address)),
153
+ readAccountAuthorization(api, address),
123
154
  api.query.System.Number.getValue()
124
155
  ]);
125
156
  if (isAuthorizationSufficient(auth, currentBlock)) return;
@@ -210,8 +241,8 @@ Asset Hub pre-fund complete: ${fundedCount}/${accounts.length} account(s) topped
210
241
  }
211
242
  function printAuthStatus(a, currentBlock) {
212
243
  if (isAuthorizationSufficient(a, currentBlock)) {
213
- const mb = (Number(a.bytes) / 1e6).toFixed(1);
214
- console.log(` [${a.index}] ${a.address} AUTHORIZED \u2014 ${a.transactions} txs / ${mb}MB remaining, expires @${a.expiration}`);
244
+ const mb = (Number(a.renewBytes) / 1e6).toFixed(1);
245
+ console.log(` [${a.index}] ${a.address} AUTHORIZED \u2014 ${a.transactions} txs left / ${mb}MB renew headroom, expires @${a.expiration}`);
215
246
  } else {
216
247
  console.log(` [${a.index}] ${a.address} NOT AUTHORIZED`);
217
248
  }
@@ -312,6 +343,10 @@ export {
312
343
  poolAccountDerivationPath,
313
344
  assetHubTopUpAmount,
314
345
  derivePoolAccounts,
346
+ ACCOUNT_AUTHORIZATION_FIELDS,
347
+ readAccountAuthorization,
348
+ remainingRenewBytes,
349
+ remainingTransactions,
315
350
  isAuthorizationSufficient,
316
351
  accountsNeedingAuthorization,
317
352
  BULLETIN_BLOCK_TIME_SECS,
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-CL7GQYYK.js";
7
7
  import {
8
8
  VERSION
9
- } from "./chunk-6AEIZMWM.js";
9
+ } from "./chunk-X7QKYH3U.js";
10
10
 
11
11
  // src/auth-config.ts
12
12
  import { existsSync, readdirSync } from "fs";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  emitIntervalSpan,
3
3
  setDeployAttribute
4
- } from "./chunk-6AEIZMWM.js";
4
+ } from "./chunk-X7QKYH3U.js";
5
5
 
6
6
  // src/chain-health.ts
7
7
  var DEFAULT_WINDOW_BLOCKS = 10;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  pessimisticSizePreflight
3
- } from "./chunk-WIMRJK32.js";
3
+ } from "./chunk-3THUTBHU.js";
4
4
  import {
5
5
  BLAKE2B_256_MULTIHASH_CODE,
6
6
  encodeContenthash,
@@ -9,13 +9,13 @@ import {
9
9
  setBulletinEndpoints,
10
10
  storeDirectory,
11
11
  storeFile
12
- } from "./chunk-TULAHSR4.js";
12
+ } from "./chunk-JZNSDAZM.js";
13
13
  import {
14
14
  DEFAULT_TLD,
15
15
  DotNS,
16
16
  TX_KIND_SKIPPED,
17
17
  stripTldSuffix
18
- } from "./chunk-2CMBVGCM.js";
18
+ } from "./chunk-ZPQO4PY2.js";
19
19
  import {
20
20
  DEFAULT_ENV_ID,
21
21
  getPopSelfServeConfig,
@@ -29,7 +29,7 @@ import {
29
29
  setDeployAttribute,
30
30
  withManifestSpan,
31
31
  withSpan
32
- } from "./chunk-6AEIZMWM.js";
32
+ } from "./chunk-X7QKYH3U.js";
33
33
 
34
34
  // src/manifest/publish.ts
35
35
  import * as fs from "fs/promises";
@@ -195,6 +195,9 @@ function composeExecutable(exec) {
195
195
  ...exec.description !== void 0 ? { description: exec.description } : {}
196
196
  };
197
197
  }
198
+ if (exec.kind === "funding") {
199
+ return { $v: 1, kind: "funding", appVersion: exec.appVersion, modes: exec.modes };
200
+ }
198
201
  return {
199
202
  $v: 1,
200
203
  kind: "worker",