bulletin-deploy 0.6.1-rc.0 → 0.6.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/cdm.json CHANGED
@@ -13,8 +13,8 @@
13
13
  "contracts": {
14
14
  "acc2c3b5e912b762": {
15
15
  "@example/playground-registry": {
16
- "version": 3,
17
- "address": "0xF8304E5C17769A53E012f39c6990cC8a7AaBC6A5",
16
+ "version": 5,
17
+ "address": "0x150dCe6077E4546151919bF1d202419fe1131d9b",
18
18
  "abi": [
19
19
  {
20
20
  "type": "constructor",
@@ -37,6 +37,66 @@
37
37
  "outputs": [],
38
38
  "stateMutability": "nonpayable"
39
39
  },
40
+ {
41
+ "type": "function",
42
+ "name": "unpublish",
43
+ "inputs": [
44
+ {
45
+ "name": "domain",
46
+ "type": "string"
47
+ }
48
+ ],
49
+ "outputs": [],
50
+ "stateMutability": "nonpayable"
51
+ },
52
+ {
53
+ "type": "function",
54
+ "name": "rateApp",
55
+ "inputs": [
56
+ {
57
+ "name": "domain",
58
+ "type": "string"
59
+ },
60
+ {
61
+ "name": "rating",
62
+ "type": "uint8"
63
+ },
64
+ {
65
+ "name": "comment_uri",
66
+ "type": "string"
67
+ }
68
+ ],
69
+ "outputs": [],
70
+ "stateMutability": "nonpayable"
71
+ },
72
+ {
73
+ "type": "function",
74
+ "name": "removeRating",
75
+ "inputs": [
76
+ {
77
+ "name": "domain",
78
+ "type": "string"
79
+ },
80
+ {
81
+ "name": "reviewer",
82
+ "type": "address"
83
+ }
84
+ ],
85
+ "outputs": [],
86
+ "stateMutability": "nonpayable"
87
+ },
88
+ {
89
+ "type": "function",
90
+ "name": "getContextId",
91
+ "inputs": [],
92
+ "outputs": [
93
+ {
94
+ "name": "",
95
+ "type": "bytes32"
96
+ }
97
+ ],
98
+ "stateMutability": "view"
99
+ },
40
100
  {
41
101
  "type": "function",
42
102
  "name": "getAppCount",
@@ -104,6 +164,18 @@
104
164
  ],
105
165
  "stateMutability": "view"
106
166
  },
167
+ {
168
+ "type": "function",
169
+ "name": "getSudo",
170
+ "inputs": [],
171
+ "outputs": [
172
+ {
173
+ "name": "",
174
+ "type": "address"
175
+ }
176
+ ],
177
+ "stateMutability": "view"
178
+ },
107
179
  {
108
180
  "type": "function",
109
181
  "name": "getMetadataUri",
@@ -149,7 +221,7 @@
149
221
  "stateMutability": "view"
150
222
  }
151
223
  ],
152
- "metadataCid": "bafk2bzacebkch7cuoi77j5vkrkoplax4urywwga7ijamtd3pntv7xjgabhtgs"
224
+ "metadataCid": "bafk2bzaceaic2pcafqerskl6qxrhh7kylyqysnblynku4znebh4uinkbvihgg"
153
225
  }
154
226
  }
155
227
  }
@@ -381,8 +381,6 @@ var DotNS = class {
381
381
  }
382
382
  async connect(options = {}) {
383
383
  const endpoints = options.rpc ? [options.rpc] : process.env.DOTNS_RPC ? [process.env.DOTNS_RPC] : RPC_ENDPOINTS;
384
- const source = options.keyUri || options.mnemonic || process.env.DOTNS_KEY_URI || process.env.DOTNS_MNEMONIC || process.env.MNEMONIC || DEFAULT_MNEMONIC;
385
- const isKeyUri = Boolean(options.keyUri || process.env.DOTNS_KEY_URI);
386
384
  let lastError;
387
385
  for (const rpc of endpoints) {
388
386
  try {
@@ -391,12 +389,19 @@ var DotNS = class {
391
389
  this.client = createClient(getWsProvider(rpc));
392
390
  const unsafeApi = this.client.getUnsafeApi();
393
391
  this.clientWrapper = new ReviveClientWrapper(unsafeApi);
394
- await cryptoWaitReady();
395
- const keyring = new Keyring({ type: "sr25519" });
396
- const account = isKeyUri ? keyring.addFromUri(source) : keyring.addFromMnemonic(source);
397
- this.substrateAddress = account.address;
392
+ if (options.signer && options.signerAddress) {
393
+ this.signer = options.signer;
394
+ this.substrateAddress = options.signerAddress;
395
+ } else {
396
+ const source = options.keyUri || options.mnemonic || process.env.DOTNS_KEY_URI || process.env.DOTNS_MNEMONIC || process.env.MNEMONIC || DEFAULT_MNEMONIC;
397
+ const isKeyUri = Boolean(options.keyUri || process.env.DOTNS_KEY_URI);
398
+ await cryptoWaitReady();
399
+ const keyring = new Keyring({ type: "sr25519" });
400
+ const account = isKeyUri ? keyring.addFromUri(source) : keyring.addFromMnemonic(source);
401
+ this.substrateAddress = account.address;
402
+ this.signer = getPolkadotSigner(account.publicKey, "Sr25519", async (input) => account.sign(input));
403
+ }
398
404
  this.evmAddress = await this.clientWrapper.getEvmAddress(this.substrateAddress);
399
- this.signer = getPolkadotSigner(account.publicKey, "Sr25519", async (input) => account.sign(input));
400
405
  this.connected = true;
401
406
  console.log(` SS58 Address: ${this.substrateAddress}`);
402
407
  console.log(` H160 Address: ${this.evmAddress}`);
@@ -3,7 +3,7 @@ import {
3
3
  DotNS,
4
4
  TX_TIMEOUT_MS,
5
5
  fetchNonce
6
- } from "./chunk-7U3PCQJA.js";
6
+ } from "./chunk-5Q26TR27.js";
7
7
  import {
8
8
  derivePoolAccounts,
9
9
  ensureAuthorized,
@@ -514,7 +514,9 @@ async function deploy(content, domainName = null, options = {}) {
514
514
  console.log("=".repeat(60));
515
515
  await withSpan("deploy.dotns", "2. dotns", { "deploy.domain": name }, async () => {
516
516
  const dotns = new DotNS();
517
- await dotns.connect(options.mnemonic ? { mnemonic: options.mnemonic } : {});
517
+ await dotns.connect(
518
+ options.signer && options.signerAddress ? { signer: options.signer, signerAddress: options.signerAddress } : options.mnemonic ? { mnemonic: options.mnemonic } : {}
519
+ );
518
520
  const { owned, owner } = await dotns.checkOwnership(name);
519
521
  if (owned) {
520
522
  console.log(` Status: Already owned`);
@@ -547,7 +549,7 @@ async function deploy(content, domainName = null, options = {}) {
547
549
  const metadataCid = await storeFile(metadataBytes, provider);
548
550
  console.log(` Metadata CID: ${metadataCid}`);
549
551
  const cdmJson = JSON.parse(fs.readFileSync(CDM_JSON_PATH, "utf-8"));
550
- const { signer, origin } = getRegistrySigner(options.mnemonic);
552
+ const { signer, origin } = options.signer && options.signerAddress ? { signer: options.signer, origin: options.signerAddress } : getRegistrySigner(options.mnemonic);
551
553
  console.log(` Publishing to registry as ${origin}...`);
552
554
  const MAX_REGISTRY_RETRIES = 3;
553
555
  for (let attempt = 1; attempt <= MAX_REGISTRY_RETRIES; attempt++) {
package/dist/deploy.d.ts CHANGED
@@ -44,6 +44,10 @@ declare function storeDirectory(directoryPath: string, provider?: ExistingProvid
44
44
  interface DeployOptions {
45
45
  playground?: boolean;
46
46
  mnemonic?: string;
47
+ /** Pre-built signer — skips mnemonic derivation. Use for QR/mobile signing. */
48
+ signer?: PolkadotSigner;
49
+ /** SS58 address for the signer (required when signer is provided). */
50
+ signerAddress?: string;
47
51
  rpc?: string;
48
52
  poolSize?: number;
49
53
  password?: string;
package/dist/deploy.js CHANGED
@@ -18,8 +18,8 @@ import {
18
18
  storeChunkedContent,
19
19
  storeDirectory,
20
20
  storeFile
21
- } from "./chunk-UDW7HUCD.js";
22
- import "./chunk-7U3PCQJA.js";
21
+ } from "./chunk-MMJR6Z2H.js";
22
+ import "./chunk-5Q26TR27.js";
23
23
  import "./chunk-AIHW2WLO.js";
24
24
  import "./chunk-CWGI2QOL.js";
25
25
  import "./chunk-QGM4M3NI.js";
package/dist/dotns.d.ts CHANGED
@@ -4,6 +4,8 @@ interface DotNSConnectOptions {
4
4
  rpc?: string;
5
5
  keyUri?: string;
6
6
  mnemonic?: string;
7
+ signer?: PolkadotSigner;
8
+ signerAddress?: string;
7
9
  }
8
10
  interface OwnershipResult {
9
11
  owned: boolean;
package/dist/dotns.js CHANGED
@@ -18,7 +18,7 @@ import {
18
18
  sanitizeDomainLabel,
19
19
  stripTrailingDigits,
20
20
  validateDomainLabel
21
- } from "./chunk-7U3PCQJA.js";
21
+ } from "./chunk-5Q26TR27.js";
22
22
  import "./chunk-CWGI2QOL.js";
23
23
  import "./chunk-QGM4M3NI.js";
24
24
  export {
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  deploy
3
- } from "./chunk-UDW7HUCD.js";
3
+ } from "./chunk-MMJR6Z2H.js";
4
4
  import {
5
5
  DotNS
6
- } from "./chunk-7U3PCQJA.js";
6
+ } from "./chunk-5Q26TR27.js";
7
7
  import {
8
8
  bootstrapPool,
9
9
  derivePoolAccounts,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bulletin-deploy",
3
- "version": "0.6.1-rc.0",
3
+ "version": "0.6.1",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",