bulletin-deploy 0.6.2 → 0.6.3-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/dist/{chunk-OUE2NAOG.js → chunk-CGF56UPK.js} +1 -1
- package/dist/{chunk-3I7SHB4A.js → chunk-CXXIB7VK.js} +23 -14
- package/dist/{chunk-72ZGQO3T.js → chunk-XET7UFP2.js} +78 -20
- package/dist/deploy.d.ts +10 -2
- package/dist/deploy.js +5 -3
- package/dist/dotns.d.ts +2 -1
- package/dist/dotns.js +4 -2
- package/dist/index.js +3 -3
- package/dist/telemetry.js +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
captureWarning,
|
|
3
3
|
withSpan
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-CGF56UPK.js";
|
|
5
5
|
|
|
6
6
|
// src/dotns.ts
|
|
7
7
|
import crypto from "crypto";
|
|
@@ -43,6 +43,7 @@ var CONTRACTS = {
|
|
|
43
43
|
};
|
|
44
44
|
var DECIMALS = 12n;
|
|
45
45
|
var NATIVE_TO_ETH_RATIO = 1000000n;
|
|
46
|
+
var CONNECTION_TIMEOUT_MS = 3e4;
|
|
46
47
|
var OPERATION_TIMEOUT_MS = 3e5;
|
|
47
48
|
var TX_TIMEOUT_MS = 9e4;
|
|
48
49
|
var DEFAULT_MNEMONIC = "bottom drive obey lake curtain smoke basket hold race lonely fit walk";
|
|
@@ -401,10 +402,15 @@ var DotNS = class {
|
|
|
401
402
|
this.substrateAddress = account.address;
|
|
402
403
|
this.signer = getPolkadotSigner(account.publicKey, "Sr25519", async (input) => account.sign(input));
|
|
403
404
|
}
|
|
404
|
-
this.evmAddress = await
|
|
405
|
-
|
|
405
|
+
this.evmAddress = await withTimeout(
|
|
406
|
+
this.clientWrapper.getEvmAddress(this.substrateAddress),
|
|
407
|
+
CONNECTION_TIMEOUT_MS,
|
|
408
|
+
`Connect to ${rpc}`
|
|
409
|
+
);
|
|
406
410
|
console.log(` SS58 Address: ${this.substrateAddress}`);
|
|
407
411
|
console.log(` H160 Address: ${this.evmAddress}`);
|
|
412
|
+
await this.clientWrapper.ensureAccountMapped(this.substrateAddress, this.signer);
|
|
413
|
+
this.connected = true;
|
|
408
414
|
return this;
|
|
409
415
|
} catch (e) {
|
|
410
416
|
lastError = e;
|
|
@@ -612,10 +618,7 @@ var DotNS = class {
|
|
|
612
618
|
}
|
|
613
619
|
async register(label, options = {}) {
|
|
614
620
|
return withSpan("deploy.dotns.register", `2a. register ${label}.dot`, {}, async () => {
|
|
615
|
-
const
|
|
616
|
-
const isMainnet = this.rpc && MAINNET_RPC_PATTERNS.some((p) => this.rpc.includes(p));
|
|
617
|
-
const statusDefault = isMainnet ? "none" : "full";
|
|
618
|
-
const status = parseProofOfPersonhoodStatus(options.status || process.env.DOTNS_STATUS || statusDefault);
|
|
621
|
+
const explicitStatus = options.status || process.env.DOTNS_STATUS;
|
|
619
622
|
const reverse = options.reverse ?? (process.env.DOTNS_REVERSE ?? "false").toLowerCase() === "true";
|
|
620
623
|
if (!this.connected) await this.connect(options);
|
|
621
624
|
label = validateDomainLabel(label);
|
|
@@ -623,17 +626,22 @@ var DotNS = class {
|
|
|
623
626
|
this.classifyName(label),
|
|
624
627
|
this.ensureNotRegistered(label)
|
|
625
628
|
]);
|
|
626
|
-
await this.setUserPopStatus(status);
|
|
627
|
-
const userStatus = await this.getUserPopStatus();
|
|
628
629
|
const requiredStatus = classification.requiredStatus;
|
|
629
630
|
if (requiredStatus === ProofOfPersonhoodStatus.Reserved) {
|
|
630
631
|
throw new Error(classification.message);
|
|
631
632
|
}
|
|
632
|
-
if (requiredStatus
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
633
|
+
if (requiredStatus !== ProofOfPersonhoodStatus.NoStatus || explicitStatus) {
|
|
634
|
+
const targetStatus = explicitStatus ? parseProofOfPersonhoodStatus(explicitStatus) : requiredStatus;
|
|
635
|
+
if (targetStatus !== ProofOfPersonhoodStatus.NoStatus) {
|
|
636
|
+
await this.setUserPopStatus(targetStatus);
|
|
637
|
+
}
|
|
638
|
+
const userStatus = await this.getUserPopStatus();
|
|
639
|
+
if (requiredStatus === ProofOfPersonhoodStatus.ProofOfPersonhoodFull && userStatus !== ProofOfPersonhoodStatus.ProofOfPersonhoodFull) {
|
|
640
|
+
throw new Error("Requires Full Personhood verification. Set DOTNS_STATUS=full or use a domain with trailing digits (e.g. my-app00.dot)");
|
|
641
|
+
}
|
|
642
|
+
if (requiredStatus === ProofOfPersonhoodStatus.ProofOfPersonhoodLite && userStatus !== ProofOfPersonhoodStatus.ProofOfPersonhoodLite && userStatus !== ProofOfPersonhoodStatus.ProofOfPersonhoodFull) {
|
|
643
|
+
throw new Error("Requires Personhood Lite verification. Set DOTNS_STATUS=lite or DOTNS_STATUS=full");
|
|
644
|
+
}
|
|
637
645
|
}
|
|
638
646
|
const { commitment, registration } = await this.generateCommitment(label, reverse);
|
|
639
647
|
await withSpan("deploy.dotns.submit-commitment", "2a-i. submit-commitment", {}, () => this.submitCommitment(commitment));
|
|
@@ -662,6 +670,7 @@ export {
|
|
|
662
670
|
CONTRACTS,
|
|
663
671
|
DECIMALS,
|
|
664
672
|
NATIVE_TO_ETH_RATIO,
|
|
673
|
+
CONNECTION_TIMEOUT_MS,
|
|
665
674
|
OPERATION_TIMEOUT_MS,
|
|
666
675
|
TX_TIMEOUT_MS,
|
|
667
676
|
DEFAULT_MNEMONIC,
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
DotNS,
|
|
4
4
|
TX_TIMEOUT_MS,
|
|
5
5
|
fetchNonce
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-CXXIB7VK.js";
|
|
7
7
|
import {
|
|
8
8
|
derivePoolAccounts,
|
|
9
9
|
ensureAuthorized,
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
setDeployAttribute,
|
|
18
18
|
withDeploySpan,
|
|
19
19
|
withSpan
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-CGF56UPK.js";
|
|
21
21
|
|
|
22
22
|
// src/deploy.ts
|
|
23
23
|
import { Buffer } from "buffer";
|
|
@@ -279,6 +279,20 @@ var BULLETIN_RPC = DEFAULT_BULLETIN_RPC;
|
|
|
279
279
|
var POOL_SIZE = DEFAULT_POOL_SIZE;
|
|
280
280
|
var CHUNK_SIZE = 1 * 1024 * 1024;
|
|
281
281
|
var MAX_FILE_SIZE = 8 * 1024 * 1024;
|
|
282
|
+
var MAX_RECONNECTIONS = parseInt(process.env.BULLETIN_MAX_RECONNECTIONS ?? "1", 10);
|
|
283
|
+
var CHUNK_TIMEOUT_MS = 3e4;
|
|
284
|
+
function isConnectionError(error) {
|
|
285
|
+
const msg = error?.message || String(error);
|
|
286
|
+
return /heartbeat timeout|WS halt|Unable to connect/i.test(msg);
|
|
287
|
+
}
|
|
288
|
+
async function isConnectionDead(rpc, ss58) {
|
|
289
|
+
try {
|
|
290
|
+
await fetchNonce(rpc, ss58);
|
|
291
|
+
return false;
|
|
292
|
+
} catch {
|
|
293
|
+
return true;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
282
296
|
var CID_CONFIG = { version: 1, codec: 85, hashCode: 18, hashLength: 32 };
|
|
283
297
|
function getGitRemoteUrl() {
|
|
284
298
|
try {
|
|
@@ -401,7 +415,8 @@ async function getDirectProvider(mnemonic) {
|
|
|
401
415
|
setDeployAttribute("deploy.signer.address", ss58);
|
|
402
416
|
return { client, unsafeApi, signer, ss58 };
|
|
403
417
|
}
|
|
404
|
-
function watchTransaction(tx, signer, txOpts, onSuccess, { label = "transaction", rpc, senderSS58, expectedNonce } = {}) {
|
|
418
|
+
function watchTransaction(tx, signer, txOpts, onSuccess, { label = "transaction", rpc, senderSS58, expectedNonce, timeoutMs } = {}) {
|
|
419
|
+
const timeout = timeoutMs ?? TX_TIMEOUT_MS;
|
|
405
420
|
return new Promise((resolve2, reject) => {
|
|
406
421
|
let settled = false;
|
|
407
422
|
const settle = (fn) => (...args) => {
|
|
@@ -429,8 +444,8 @@ function watchTransaction(tx, signer, txOpts, onSuccess, { label = "transaction"
|
|
|
429
444
|
console.log(` ${label}: nonce check failed: ${e.message}`);
|
|
430
445
|
}
|
|
431
446
|
}
|
|
432
|
-
settle(reject)(new Error(`${label} timed out after ${
|
|
433
|
-
},
|
|
447
|
+
settle(reject)(new Error(`${label} timed out after ${timeout / 1e3}s waiting for block confirmation`));
|
|
448
|
+
}, timeout);
|
|
434
449
|
const sub = tx.signSubmitAndWatch(signer, txOpts).subscribe({
|
|
435
450
|
next: (event) => {
|
|
436
451
|
if (event.type === "txBestBlocksState") {
|
|
@@ -460,7 +475,7 @@ async function storeChunk(unsafeApi, signer, chunkBytes, nonce, ss58) {
|
|
|
460
475
|
return watchTransaction(tx, signer, txOpts, () => {
|
|
461
476
|
console.log(` CID: ${cid.toString()}`);
|
|
462
477
|
return { cid, len: chunkBytes.length };
|
|
463
|
-
}, { label: `chunk(nonce:${nonce})`, rpc: BULLETIN_RPC, senderSS58: ss58, expectedNonce: nonce });
|
|
478
|
+
}, { label: `chunk(nonce:${nonce})`, rpc: BULLETIN_RPC, senderSS58: ss58, expectedNonce: nonce, timeoutMs: CHUNK_TIMEOUT_MS });
|
|
464
479
|
}
|
|
465
480
|
async function storeFile(contentBytes, { client: existingClient, unsafeApi: existingApi, signer: existingSigner } = {}) {
|
|
466
481
|
console.log(`
|
|
@@ -496,12 +511,13 @@ async function storeFile(contentBytes, { client: existingClient, unsafeApi: exis
|
|
|
496
511
|
throw e;
|
|
497
512
|
}
|
|
498
513
|
}
|
|
499
|
-
async function storeChunkedContent(chunks, { client: existingClient, unsafeApi: existingApi, signer: existingSigner, ss58: existingSS58 } = {}) {
|
|
514
|
+
async function storeChunkedContent(chunks, { client: existingClient, unsafeApi: existingApi, signer: existingSigner, ss58: existingSS58, reconnect } = {}) {
|
|
500
515
|
console.log(`
|
|
501
516
|
Chunks: ${chunks.length}`);
|
|
502
517
|
const totalBytes = chunks.reduce((s, c) => s + c.length, 0);
|
|
503
518
|
console.log(` Total: ${(totalBytes / 1024).toFixed(2)} KB`);
|
|
504
519
|
let client, unsafeApi, signer, ss58;
|
|
520
|
+
let ownsClient = false;
|
|
505
521
|
if (existingClient) {
|
|
506
522
|
client = existingClient;
|
|
507
523
|
unsafeApi = existingApi;
|
|
@@ -513,6 +529,27 @@ async function storeChunkedContent(chunks, { client: existingClient, unsafeApi:
|
|
|
513
529
|
unsafeApi = provider.unsafeApi;
|
|
514
530
|
signer = provider.signer;
|
|
515
531
|
ss58 = provider.ss58;
|
|
532
|
+
ownsClient = true;
|
|
533
|
+
}
|
|
534
|
+
let reconnectionsUsed = 0;
|
|
535
|
+
async function doReconnect() {
|
|
536
|
+
if (!reconnect || reconnectionsUsed >= MAX_RECONNECTIONS) {
|
|
537
|
+
throw new Error(`Connection lost and max reconnections (${MAX_RECONNECTIONS}) exhausted`);
|
|
538
|
+
}
|
|
539
|
+
reconnectionsUsed++;
|
|
540
|
+
console.log(`
|
|
541
|
+
Connection lost, reconnecting to Bulletin (${reconnectionsUsed}/${MAX_RECONNECTIONS})...`);
|
|
542
|
+
captureWarning("WebSocket connection lost, reconnecting", { reconnection: reconnectionsUsed, maxReconnections: MAX_RECONNECTIONS });
|
|
543
|
+
try {
|
|
544
|
+
client.destroy();
|
|
545
|
+
} catch {
|
|
546
|
+
}
|
|
547
|
+
const fresh = await reconnect();
|
|
548
|
+
client = fresh.client;
|
|
549
|
+
unsafeApi = fresh.unsafeApi;
|
|
550
|
+
signer = fresh.signer;
|
|
551
|
+
ss58 = fresh.ss58;
|
|
552
|
+
ownsClient = true;
|
|
516
553
|
}
|
|
517
554
|
try {
|
|
518
555
|
let startNonce = await fetchNonce(BULLETIN_RPC, ss58);
|
|
@@ -523,10 +560,18 @@ async function storeChunkedContent(chunks, { client: existingClient, unsafeApi:
|
|
|
523
560
|
Submitting ${chunks.length} chunks in batches of ${BATCH_SIZE}...`);
|
|
524
561
|
const stored = new Array(chunks.length).fill(null);
|
|
525
562
|
for (let b = 0; b < chunks.length; b += BATCH_SIZE) {
|
|
526
|
-
const
|
|
527
|
-
const
|
|
528
|
-
|
|
563
|
+
const batchIndices = [];
|
|
564
|
+
const batchChunks = [];
|
|
565
|
+
for (let j = 0; j < BATCH_SIZE && b + j < chunks.length; j++) {
|
|
529
566
|
const i = b + j;
|
|
567
|
+
if (stored[i] === null) {
|
|
568
|
+
batchIndices.push(i);
|
|
569
|
+
batchChunks.push(chunks[i]);
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
if (batchIndices.length === 0) continue;
|
|
573
|
+
const batchPromises = batchChunks.map((chunkData, j) => {
|
|
574
|
+
const i = batchIndices[j];
|
|
530
575
|
const nonce = startNonce + i;
|
|
531
576
|
console.log(` [${i + 1}/${chunks.length}] ${(chunkData.length / 1024 / 1024).toFixed(2)} MB (nonce: ${nonce})`);
|
|
532
577
|
return storeChunk(unsafeApi, signer, chunkData, nonce, ss58);
|
|
@@ -535,7 +580,17 @@ async function storeChunkedContent(chunks, { client: existingClient, unsafeApi:
|
|
|
535
580
|
results.forEach((r, j) => {
|
|
536
581
|
if (r.status === "fulfilled") stored[batchIndices[j]] = r.value;
|
|
537
582
|
});
|
|
538
|
-
const failures = results.map((r, j) => r.status === "rejected" ? { index: batchIndices[j], chunkData:
|
|
583
|
+
const failures = results.map((r, j) => r.status === "rejected" ? { index: batchIndices[j], chunkData: batchChunks[j], error: r.reason } : null).filter(Boolean);
|
|
584
|
+
if (failures.length > 0 && reconnect && reconnectionsUsed < MAX_RECONNECTIONS) {
|
|
585
|
+
const knownConnectionError = failures.some((f) => isConnectionError(f.error));
|
|
586
|
+
const connectionDead = knownConnectionError || await isConnectionDead(BULLETIN_RPC, ss58);
|
|
587
|
+
if (connectionDead) {
|
|
588
|
+
await doReconnect();
|
|
589
|
+
startNonce = await fetchNonce(BULLETIN_RPC, ss58);
|
|
590
|
+
b -= BATCH_SIZE;
|
|
591
|
+
continue;
|
|
592
|
+
}
|
|
593
|
+
}
|
|
539
594
|
for (const fail of failures) {
|
|
540
595
|
captureWarning("Chunk upload failed, retrying", { chunkIndex: fail.index + 1, maxRetries: MAX_CHUNK_RETRIES, error: fail.error?.message?.slice(0, 200) });
|
|
541
596
|
let retried = false;
|
|
@@ -589,10 +644,10 @@ async function storeChunkedContent(chunks, { client: existingClient, unsafeApi:
|
|
|
589
644
|
`);
|
|
590
645
|
return rootCid.toString();
|
|
591
646
|
}, { label: "root-node", rpc: BULLETIN_RPC, senderSS58: ss58, expectedNonce: rootNonce });
|
|
592
|
-
if (
|
|
647
|
+
if (ownsClient) client.destroy();
|
|
593
648
|
return result;
|
|
594
649
|
} catch (e) {
|
|
595
|
-
if (
|
|
650
|
+
if (ownsClient) client.destroy();
|
|
596
651
|
throw e;
|
|
597
652
|
}
|
|
598
653
|
}
|
|
@@ -663,8 +718,10 @@ async function deploy(content, domainName = null, options = {}) {
|
|
|
663
718
|
if (typeof content === "string") console.log(` Build dir: ${path.resolve(content)}`);
|
|
664
719
|
if (options.password) console.log(` Encrypted: yes`);
|
|
665
720
|
let provider;
|
|
721
|
+
const reconnect = options.mnemonic ? () => getDirectProvider(options.mnemonic) : () => getProvider();
|
|
666
722
|
try {
|
|
667
|
-
provider =
|
|
723
|
+
provider = await reconnect();
|
|
724
|
+
const providerWithReconnect = { ...provider, reconnect };
|
|
668
725
|
console.log("\n" + "=".repeat(60));
|
|
669
726
|
console.log("Storage");
|
|
670
727
|
console.log("=".repeat(60));
|
|
@@ -689,7 +746,7 @@ async function deploy(content, domainName = null, options = {}) {
|
|
|
689
746
|
console.log(` Encrypted: ${(encrypted.length / 1024).toFixed(1)} KB`);
|
|
690
747
|
contentChunks = chunk(encrypted);
|
|
691
748
|
}
|
|
692
|
-
cid = await storeChunkedContent(contentChunks,
|
|
749
|
+
cid = await storeChunkedContent(contentChunks, providerWithReconnect);
|
|
693
750
|
} else if (typeof content === "string") {
|
|
694
751
|
const contentPath = path.resolve(content);
|
|
695
752
|
if (!fs.existsSync(contentPath)) throw new Error(`Path not found: ${contentPath}`);
|
|
@@ -698,7 +755,7 @@ async function deploy(content, domainName = null, options = {}) {
|
|
|
698
755
|
console.log(`
|
|
699
756
|
Mode: Directory`);
|
|
700
757
|
console.log(` Path: ${contentPath}`);
|
|
701
|
-
const dirResult = await storeDirectory(contentPath,
|
|
758
|
+
const dirResult = await storeDirectory(contentPath, providerWithReconnect, options.password);
|
|
702
759
|
cid = dirResult.storageCid;
|
|
703
760
|
ipfsCid = dirResult.ipfsCid;
|
|
704
761
|
} else {
|
|
@@ -713,9 +770,9 @@ async function deploy(content, domainName = null, options = {}) {
|
|
|
713
770
|
}
|
|
714
771
|
if (fileContent.length > MAX_FILE_SIZE) {
|
|
715
772
|
console.log(` Exceeds 8MB, chunking...`);
|
|
716
|
-
cid = await storeChunkedContent(chunk(fileContent),
|
|
773
|
+
cid = await storeChunkedContent(chunk(fileContent), providerWithReconnect);
|
|
717
774
|
} else {
|
|
718
|
-
cid = await storeFile(fileContent,
|
|
775
|
+
cid = await storeFile(fileContent, providerWithReconnect);
|
|
719
776
|
}
|
|
720
777
|
}
|
|
721
778
|
} else if (content instanceof Uint8Array) {
|
|
@@ -729,9 +786,9 @@ async function deploy(content, domainName = null, options = {}) {
|
|
|
729
786
|
}
|
|
730
787
|
if (bytesContent.length > MAX_FILE_SIZE) {
|
|
731
788
|
console.log(` Exceeds 8MB, chunking...`);
|
|
732
|
-
cid = await storeChunkedContent(chunk(bytesContent),
|
|
789
|
+
cid = await storeChunkedContent(chunk(bytesContent), providerWithReconnect);
|
|
733
790
|
} else {
|
|
734
|
-
cid = await storeFile(bytesContent,
|
|
791
|
+
cid = await storeFile(bytesContent, providerWithReconnect);
|
|
735
792
|
}
|
|
736
793
|
} else {
|
|
737
794
|
throw new Error("Invalid content: must be path, Uint8Array, or Array<Uint8Array>");
|
|
@@ -817,6 +874,7 @@ async function deploy(content, domainName = null, options = {}) {
|
|
|
817
874
|
export {
|
|
818
875
|
DEFAULT_BULLETIN_RPC,
|
|
819
876
|
DEFAULT_POOL_SIZE,
|
|
877
|
+
isConnectionError,
|
|
820
878
|
deriveRootSigner,
|
|
821
879
|
createCID,
|
|
822
880
|
encodeContenthash,
|
package/dist/deploy.d.ts
CHANGED
|
@@ -8,14 +8,22 @@ interface DeployResult {
|
|
|
8
8
|
ipfsCid?: string;
|
|
9
9
|
}
|
|
10
10
|
type DeployContent = string | Uint8Array | Uint8Array[];
|
|
11
|
+
interface ProviderResult {
|
|
12
|
+
client: any;
|
|
13
|
+
unsafeApi: any;
|
|
14
|
+
signer: PolkadotSigner;
|
|
15
|
+
ss58: string;
|
|
16
|
+
}
|
|
11
17
|
interface ExistingProvider {
|
|
12
18
|
client?: any;
|
|
13
19
|
unsafeApi?: any;
|
|
14
20
|
signer?: PolkadotSigner;
|
|
15
21
|
ss58?: string;
|
|
22
|
+
reconnect?: () => Promise<ProviderResult>;
|
|
16
23
|
}
|
|
17
24
|
declare const DEFAULT_BULLETIN_RPC = "wss://paseo-bulletin-rpc.polkadot.io";
|
|
18
25
|
declare const DEFAULT_POOL_SIZE = 10;
|
|
26
|
+
declare function isConnectionError(error: any): boolean;
|
|
19
27
|
declare function deriveRootSigner(mnemonic: string): {
|
|
20
28
|
signer: PolkadotSigner;
|
|
21
29
|
ss58: string;
|
|
@@ -30,7 +38,7 @@ declare const ENCRYPT_KEY_LEN = 32;
|
|
|
30
38
|
declare const ENCRYPT_PBKDF2_ITERATIONS = 100000;
|
|
31
39
|
declare function encryptContent(data: Uint8Array, password: string): Promise<Uint8Array>;
|
|
32
40
|
declare function storeFile(contentBytes: Uint8Array, { client: existingClient, unsafeApi: existingApi, signer: existingSigner }?: ExistingProvider): Promise<string>;
|
|
33
|
-
declare function storeChunkedContent(chunks: Uint8Array[], { client: existingClient, unsafeApi: existingApi, signer: existingSigner, ss58: existingSS58 }?: ExistingProvider): Promise<string>;
|
|
41
|
+
declare function storeChunkedContent(chunks: Uint8Array[], { client: existingClient, unsafeApi: existingApi, signer: existingSigner, ss58: existingSS58, reconnect }?: ExistingProvider): Promise<string>;
|
|
34
42
|
declare function chunk(data: Uint8Array, size?: number): Uint8Array[];
|
|
35
43
|
declare function hasIPFS(): boolean;
|
|
36
44
|
declare function merkleize(directoryPath: string, outputCarPath: string): Promise<{
|
|
@@ -54,4 +62,4 @@ interface DeployOptions {
|
|
|
54
62
|
}
|
|
55
63
|
declare function deploy(content: DeployContent, domainName?: string | null, options?: DeployOptions): Promise<DeployResult>;
|
|
56
64
|
|
|
57
|
-
export { 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, chunk, createCID, deploy, deriveRootSigner, encodeContenthash, encryptContent, hasIPFS, merkleize, storeChunkedContent, storeDirectory, storeFile };
|
|
65
|
+
export { 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, chunk, createCID, deploy, deriveRootSigner, encodeContenthash, encryptContent, hasIPFS, isConnectionError, merkleize, storeChunkedContent, storeDirectory, storeFile };
|
package/dist/deploy.js
CHANGED
|
@@ -14,14 +14,15 @@ import {
|
|
|
14
14
|
encodeContenthash,
|
|
15
15
|
encryptContent,
|
|
16
16
|
hasIPFS,
|
|
17
|
+
isConnectionError,
|
|
17
18
|
merkleize,
|
|
18
19
|
storeChunkedContent,
|
|
19
20
|
storeDirectory,
|
|
20
21
|
storeFile
|
|
21
|
-
} from "./chunk-
|
|
22
|
-
import "./chunk-
|
|
22
|
+
} from "./chunk-XET7UFP2.js";
|
|
23
|
+
import "./chunk-CXXIB7VK.js";
|
|
23
24
|
import "./chunk-AIHW2WLO.js";
|
|
24
|
-
import "./chunk-
|
|
25
|
+
import "./chunk-CGF56UPK.js";
|
|
25
26
|
import "./chunk-QGM4M3NI.js";
|
|
26
27
|
export {
|
|
27
28
|
DEFAULT_BULLETIN_RPC,
|
|
@@ -39,6 +40,7 @@ export {
|
|
|
39
40
|
encodeContenthash,
|
|
40
41
|
encryptContent,
|
|
41
42
|
hasIPFS,
|
|
43
|
+
isConnectionError,
|
|
42
44
|
merkleize,
|
|
43
45
|
storeChunkedContent,
|
|
44
46
|
storeDirectory,
|
package/dist/dotns.d.ts
CHANGED
|
@@ -30,6 +30,7 @@ declare const CONTRACTS: {
|
|
|
30
30
|
};
|
|
31
31
|
declare const DECIMALS: bigint;
|
|
32
32
|
declare const NATIVE_TO_ETH_RATIO: bigint;
|
|
33
|
+
declare const CONNECTION_TIMEOUT_MS: number;
|
|
33
34
|
declare const OPERATION_TIMEOUT_MS: number;
|
|
34
35
|
declare const TX_TIMEOUT_MS: number;
|
|
35
36
|
declare const DEFAULT_MNEMONIC: string;
|
|
@@ -115,4 +116,4 @@ declare class DotNS {
|
|
|
115
116
|
}
|
|
116
117
|
declare const dotns: DotNS;
|
|
117
118
|
|
|
118
|
-
export { CONTRACTS, DECIMALS, DEFAULT_MNEMONIC, DOT_NODE, DotNS, type DotNSConnectOptions, NATIVE_TO_ETH_RATIO, OPERATION_TIMEOUT_MS, type OwnershipResult, type PriceValidationResult, ProofOfPersonhoodStatus, RPC_ENDPOINTS, TX_TIMEOUT_MS, computeDomainTokenId, convertWeiToNative, countTrailingDigits, dotns, fetchNonce, parseProofOfPersonhoodStatus, sanitizeDomainLabel, stripTrailingDigits, validateDomainLabel };
|
|
119
|
+
export { CONNECTION_TIMEOUT_MS, CONTRACTS, DECIMALS, DEFAULT_MNEMONIC, DOT_NODE, DotNS, type DotNSConnectOptions, NATIVE_TO_ETH_RATIO, OPERATION_TIMEOUT_MS, type OwnershipResult, type PriceValidationResult, ProofOfPersonhoodStatus, RPC_ENDPOINTS, TX_TIMEOUT_MS, computeDomainTokenId, convertWeiToNative, countTrailingDigits, dotns, fetchNonce, parseProofOfPersonhoodStatus, sanitizeDomainLabel, stripTrailingDigits, validateDomainLabel };
|
package/dist/dotns.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
+
CONNECTION_TIMEOUT_MS,
|
|
2
3
|
CONTRACTS,
|
|
3
4
|
DECIMALS,
|
|
4
5
|
DEFAULT_MNEMONIC,
|
|
@@ -18,10 +19,11 @@ import {
|
|
|
18
19
|
sanitizeDomainLabel,
|
|
19
20
|
stripTrailingDigits,
|
|
20
21
|
validateDomainLabel
|
|
21
|
-
} from "./chunk-
|
|
22
|
-
import "./chunk-
|
|
22
|
+
} from "./chunk-CXXIB7VK.js";
|
|
23
|
+
import "./chunk-CGF56UPK.js";
|
|
23
24
|
import "./chunk-QGM4M3NI.js";
|
|
24
25
|
export {
|
|
26
|
+
CONNECTION_TIMEOUT_MS,
|
|
25
27
|
CONTRACTS,
|
|
26
28
|
DECIMALS,
|
|
27
29
|
DEFAULT_MNEMONIC,
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
deploy
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-XET7UFP2.js";
|
|
4
4
|
import {
|
|
5
5
|
DotNS
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-CXXIB7VK.js";
|
|
7
7
|
import {
|
|
8
8
|
bootstrapPool,
|
|
9
9
|
derivePoolAccounts,
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
fetchPoolAuthorizations,
|
|
12
12
|
selectAccount
|
|
13
13
|
} from "./chunk-AIHW2WLO.js";
|
|
14
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-CGF56UPK.js";
|
|
15
15
|
import "./chunk-QGM4M3NI.js";
|
|
16
16
|
export {
|
|
17
17
|
DotNS,
|
package/dist/telemetry.js
CHANGED