bulletin-deploy 0.6.1 → 0.6.2-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -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,
|
package/dist/deploy.js
CHANGED
|
@@ -18,8 +18,8 @@ import {
|
|
|
18
18
|
storeChunkedContent,
|
|
19
19
|
storeDirectory,
|
|
20
20
|
storeFile
|
|
21
|
-
} from "./chunk-
|
|
22
|
-
import "./chunk-
|
|
21
|
+
} from "./chunk-TVC74Y6P.js";
|
|
22
|
+
import "./chunk-ZUKSPFW3.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
|
@@ -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
|
+
} from "./chunk-ZUKSPFW3.js";
|
|
22
23
|
import "./chunk-CWGI2QOL.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