@parity/product-deploy 0.7.28-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.
- package/LICENSE +201 -0
- package/README.md +233 -0
- package/assets/environments.json +313 -0
- package/bin/bulletin-bootstrap +84 -0
- package/bin/bulletin-deploy +429 -0
- package/dist/bug-report.d.ts +29 -0
- package/dist/bug-report.js +27 -0
- package/dist/chunk-2VAUMZB2.js +284 -0
- package/dist/chunk-43HLT335.js +232 -0
- package/dist/chunk-5VZQ2KSU.js +231 -0
- package/dist/chunk-ADNBLFDP.js +225 -0
- package/dist/chunk-BMAEWZYV.js +24 -0
- package/dist/chunk-C2TS5MER.js +64 -0
- package/dist/chunk-DNXH4QTI.js +2336 -0
- package/dist/chunk-FZWJV5AD.js +231 -0
- package/dist/chunk-GZD2UFLR.js +8 -0
- package/dist/chunk-HOTQDYHD.js +219 -0
- package/dist/chunk-IDYGYIMH.js +207 -0
- package/dist/chunk-KHVTYIIX.js +146 -0
- package/dist/chunk-KJH2T5TQ.js +172 -0
- package/dist/chunk-KOSF5FDO.js +49 -0
- package/dist/chunk-LZJMVPYW.js +156 -0
- package/dist/chunk-MFTODIIT.js +725 -0
- package/dist/chunk-MMAZFJDG.js +91 -0
- package/dist/chunk-NF2FL4ZO.js +164 -0
- package/dist/chunk-OITUIM2E.js +524 -0
- package/dist/chunk-P6CHOMN3.js +2368 -0
- package/dist/chunk-QMYW3D6E.js +316 -0
- package/dist/chunk-QTZNULSH.js +185 -0
- package/dist/chunk-RI3ZLNPN.js +71 -0
- package/dist/chunk-S7EM5VMW.js +108 -0
- package/dist/chunk-T7EEVWNU.js +32 -0
- package/dist/chunk-UPWEOGLQ.js +37 -0
- package/dist/chunk-ZOC4GITL.js +13 -0
- package/dist/chunk-ZYVGHDMU.js +117 -0
- package/dist/chunk-probe.d.ts +37 -0
- package/dist/chunk-probe.js +18 -0
- package/dist/chunker.d.ts +8 -0
- package/dist/chunker.js +10 -0
- package/dist/deploy.d.ts +299 -0
- package/dist/deploy.js +96 -0
- package/dist/dotns.d.ts +506 -0
- package/dist/dotns.js +101 -0
- package/dist/environments.d.ts +104 -0
- package/dist/environments.js +23 -0
- package/dist/errors.d.ts +6 -0
- package/dist/errors.js +8 -0
- package/dist/gh-pages-mirror.d.ts +76 -0
- package/dist/gh-pages-mirror.js +30 -0
- package/dist/incremental-stats.d.ts +69 -0
- package/dist/incremental-stats.js +10 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.js +146 -0
- package/dist/manifest/byte-budget.d.ts +46 -0
- package/dist/manifest/byte-budget.js +14 -0
- package/dist/manifest/config-load.d.ts +36 -0
- package/dist/manifest/config-load.js +10 -0
- package/dist/manifest/publish.d.ts +54 -0
- package/dist/manifest/publish.js +23 -0
- package/dist/manifest/schema.d.ts +29 -0
- package/dist/manifest/schema.js +10 -0
- package/dist/manifest/types.d.ts +90 -0
- package/dist/manifest/types.js +6 -0
- package/dist/manifest-embed.d.ts +18 -0
- package/dist/manifest-embed.js +9 -0
- package/dist/manifest-fetch.d.ts +32 -0
- package/dist/manifest-fetch.js +21 -0
- package/dist/manifest-roundtrip.d.ts +15 -0
- package/dist/manifest-roundtrip.js +55 -0
- package/dist/manifest.d.ts +44 -0
- package/dist/manifest.js +20 -0
- package/dist/memory-report.d.ts +95 -0
- package/dist/memory-report.js +17 -0
- package/dist/merkle.d.ts +50 -0
- package/dist/merkle.js +33 -0
- package/dist/personhood/bind-paid-alias.d.ts +43 -0
- package/dist/personhood/bind-paid-alias.js +10 -0
- package/dist/personhood/bind-personal-id.d.ts +55 -0
- package/dist/personhood/bind-personal-id.js +12 -0
- package/dist/personhood/bootstrap.d.ts +85 -0
- package/dist/personhood/bootstrap.js +245 -0
- package/dist/personhood/claim-pgas.d.ts +61 -0
- package/dist/personhood/claim-pgas.js +12 -0
- package/dist/personhood/constants.d.ts +23 -0
- package/dist/personhood/constants.js +22 -0
- package/dist/personhood/encoding.d.ts +49 -0
- package/dist/personhood/encoding.js +24 -0
- package/dist/personhood/hashing.d.ts +4 -0
- package/dist/personhood/hashing.js +8 -0
- package/dist/personhood/member-key.d.ts +12 -0
- package/dist/personhood/member-key.js +10 -0
- package/dist/personhood/people-client.d.ts +14 -0
- package/dist/personhood/people-client.js +48 -0
- package/dist/personhood/reprove.d.ts +43 -0
- package/dist/personhood/reprove.js +225 -0
- package/dist/pool.d.ts +51 -0
- package/dist/pool.js +30 -0
- package/dist/run-state.d.ts +22 -0
- package/dist/run-state.js +20 -0
- package/dist/telemetry.d.ts +56 -0
- package/dist/telemetry.js +71 -0
- package/dist/version-check.d.ts +38 -0
- package/dist/version-check.js +30 -0
- package/docs/bootstrap.md +49 -0
- package/docs/e2e-bootstrap.md +154 -0
- package/docs/telemetry.md +62 -0
- package/docs/testing.md +44 -0
- package/package.json +82 -0
- package/tools/release-retry-wrapper.mjs +74 -0
package/dist/dotns.d.ts
ADDED
|
@@ -0,0 +1,506 @@
|
|
|
1
|
+
import { BootstrapResult } from './personhood/bootstrap.js';
|
|
2
|
+
import { PopSelfServeConfig } from './environments.js';
|
|
3
|
+
import { PolkadotSigner } from 'polkadot-api';
|
|
4
|
+
import './personhood/bind-personal-id.js';
|
|
5
|
+
import './personhood/claim-pgas.js';
|
|
6
|
+
import './personhood/bind-paid-alias.js';
|
|
7
|
+
|
|
8
|
+
interface DotNSConnectOptions {
|
|
9
|
+
rpc?: string;
|
|
10
|
+
keyUri?: string;
|
|
11
|
+
mnemonic?: string;
|
|
12
|
+
derivationPath?: string;
|
|
13
|
+
signer?: PolkadotSigner;
|
|
14
|
+
signerAddress?: string; /**
|
|
15
|
+
* Optional override for the Asset Hub RPC failover list. When provided, the
|
|
16
|
+
* primary RPC (this.rpc) is followed by these endpoints for retries. When
|
|
17
|
+
* omitted, the legacy hardcoded RPC_ENDPOINTS list (paseo) is used —
|
|
18
|
+
* preserves backwards-compatibility for external library consumers. The
|
|
19
|
+
* bulletin-deploy CLI passes the list resolved from environments.json so
|
|
20
|
+
* `--env <id>` drives both bulletin and asset-hub endpoints.
|
|
21
|
+
*/
|
|
22
|
+
assetHubEndpoints?: string[];
|
|
23
|
+
autoAccountMapping?: boolean;
|
|
24
|
+
nativeToEthRatio?: bigint;
|
|
25
|
+
contracts?: Record<string, string>;
|
|
26
|
+
/** Optional environment ID (e.g. "paseo-next-v2"). Used in shell command examples in error messages. */
|
|
27
|
+
environmentId?: string;
|
|
28
|
+
/** Optional PoP self-serve config resolved from environments.json. Gates state-aware and generic testnet guidance blocks. */
|
|
29
|
+
popSelfServe?: PopSelfServeConfig | null;
|
|
30
|
+
/** Optional override for the storage deposit required for a fresh TLD register(). Loaded from environments.json per-env. */
|
|
31
|
+
registerStorageDeposit?: bigint;
|
|
32
|
+
}
|
|
33
|
+
interface OwnershipResult {
|
|
34
|
+
owned: boolean;
|
|
35
|
+
owner: string | null;
|
|
36
|
+
}
|
|
37
|
+
declare const TX_KIND_HASH: "hash";
|
|
38
|
+
declare const TX_KIND_NONCE_ADVANCED: "nonce-advanced";
|
|
39
|
+
declare const ATTR_TX_RESOLUTION_KIND = "deploy.dotns.tx_resolution_kind";
|
|
40
|
+
type TxResolution = {
|
|
41
|
+
kind: typeof TX_KIND_HASH;
|
|
42
|
+
hash: string;
|
|
43
|
+
block?: {
|
|
44
|
+
hash: string;
|
|
45
|
+
number: number;
|
|
46
|
+
};
|
|
47
|
+
} | {
|
|
48
|
+
kind: typeof TX_KIND_NONCE_ADVANCED;
|
|
49
|
+
rpc: string;
|
|
50
|
+
};
|
|
51
|
+
interface PriceValidationResult {
|
|
52
|
+
priceWei: bigint;
|
|
53
|
+
requiredStatus: number;
|
|
54
|
+
userStatus: number;
|
|
55
|
+
message: string;
|
|
56
|
+
}
|
|
57
|
+
interface ParsedDomainName {
|
|
58
|
+
isSubdomain: boolean;
|
|
59
|
+
label: string;
|
|
60
|
+
sublabel: string | null;
|
|
61
|
+
parentLabel: string | null;
|
|
62
|
+
fullName: string;
|
|
63
|
+
}
|
|
64
|
+
interface DotnsPreflightResult {
|
|
65
|
+
label: string;
|
|
66
|
+
classification: {
|
|
67
|
+
status: number;
|
|
68
|
+
message: string;
|
|
69
|
+
};
|
|
70
|
+
userStatus: number;
|
|
71
|
+
trailingDigits: number;
|
|
72
|
+
baselength: number;
|
|
73
|
+
isAvailable: boolean;
|
|
74
|
+
existingOwner: string | null;
|
|
75
|
+
isBaseNameReserved: boolean;
|
|
76
|
+
reservationOwner: string | null;
|
|
77
|
+
isTestnet: boolean;
|
|
78
|
+
canProceed: boolean;
|
|
79
|
+
reason?: string;
|
|
80
|
+
plannedAction: "register" | "already-owned-by-us" | "abort";
|
|
81
|
+
needsPopUpgrade: boolean;
|
|
82
|
+
targetPopStatus?: number;
|
|
83
|
+
/** Free PAS balance of the DotNS signer at preflight time, in plancks (10 decimals). */
|
|
84
|
+
signerFreeBalance?: bigint;
|
|
85
|
+
/** Threshold the signer must clear; depends on plannedAction. */
|
|
86
|
+
feeFloor?: bigint;
|
|
87
|
+
/** Set when an auto-top-up was attempted on testnet; describes the source and amount. */
|
|
88
|
+
toppedUp?: {
|
|
89
|
+
source: "Alice" | "Bob";
|
|
90
|
+
transferred: bigint;
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
declare const MINIMUM_REGISTER_STORAGE_DEPOSIT = 2000000000000n;
|
|
94
|
+
declare function fmtPas(plancks: bigint): string;
|
|
95
|
+
type DotnsSuccessAction = Exclude<DotnsPreflightResult["plannedAction"], "abort">;
|
|
96
|
+
declare function feeFloorFor(plannedAction: DotnsSuccessAction, storageDeposit?: bigint): bigint;
|
|
97
|
+
declare const RPC_ENDPOINTS: string[];
|
|
98
|
+
declare const CONTRACTS: {
|
|
99
|
+
readonly DOTNS_REGISTRAR: "0x329aAA5b6bEa94E750b2dacBa74Bf41291E6c2BD";
|
|
100
|
+
readonly DOTNS_REGISTRAR_CONTROLLER: "0xd09e0F1c1E6CE8Cf40df929ef4FC778629573651";
|
|
101
|
+
readonly DOTNS_REGISTRY: "0x4Da0d37aBe96C06ab19963F31ca2DC0412057a6f";
|
|
102
|
+
readonly DOTNS_RESOLVER: "0x95645C7fD0fF38790647FE13F87Eb11c1DCc8514";
|
|
103
|
+
readonly DOTNS_CONTENT_RESOLVER: "0x7756DF72CBc7f062e7403cD59e45fBc78bed1cD7";
|
|
104
|
+
readonly DOTNS_REVERSE_RESOLVER: "0x95D57363B491CF743970c640fe419541386ac8BF";
|
|
105
|
+
readonly STORE_FACTORY: "0x030296782F4d3046B080BcB017f01837561D9702";
|
|
106
|
+
readonly POP_RULES: "0x4e8920B1E69d0cEA9b23CBFC87A17Ee6fE02d2d3";
|
|
107
|
+
};
|
|
108
|
+
declare const DECIMALS: bigint;
|
|
109
|
+
declare const NATIVE_TO_ETH_RATIO: bigint;
|
|
110
|
+
declare const CONNECTION_TIMEOUT_MS: number;
|
|
111
|
+
declare const OPERATION_TIMEOUT_MS: number;
|
|
112
|
+
declare const TX_TIMEOUT_MS: number;
|
|
113
|
+
declare const TX_CHAIN_TIME_BUDGET_MS: number;
|
|
114
|
+
declare const TX_WALL_CLOCK_CEILING_MS: number;
|
|
115
|
+
declare const WS_HEARTBEAT_TIMEOUT_MS: number;
|
|
116
|
+
declare const DOTNS_TX_MAX_ATTEMPTS: number;
|
|
117
|
+
declare function classifyTxRetryDecision(err: unknown): "retry" | "abort";
|
|
118
|
+
declare const DEFAULT_MNEMONIC: string;
|
|
119
|
+
declare function fetchNonce(rpc: string | string[], ss58Address: string): Promise<number>;
|
|
120
|
+
declare function verifyNonceAdvanced(endpoints: string[], ss58Address: string, originalNonce: number): Promise<{
|
|
121
|
+
advanced: true;
|
|
122
|
+
witnessRpc: string;
|
|
123
|
+
} | {
|
|
124
|
+
advanced: false;
|
|
125
|
+
}>;
|
|
126
|
+
declare const ProofOfPersonhoodStatus: {
|
|
127
|
+
readonly NoStatus: 0;
|
|
128
|
+
readonly ProofOfPersonhoodLite: 1;
|
|
129
|
+
readonly ProofOfPersonhoodFull: 2;
|
|
130
|
+
readonly Reserved: 3;
|
|
131
|
+
};
|
|
132
|
+
declare const PUBLISHER_ABI: readonly [{
|
|
133
|
+
readonly inputs: readonly [{
|
|
134
|
+
readonly name: "label";
|
|
135
|
+
readonly type: "string";
|
|
136
|
+
}];
|
|
137
|
+
readonly name: "publish";
|
|
138
|
+
readonly outputs: readonly [];
|
|
139
|
+
readonly stateMutability: "nonpayable";
|
|
140
|
+
readonly type: "function";
|
|
141
|
+
}, {
|
|
142
|
+
readonly inputs: readonly [{
|
|
143
|
+
readonly name: "label";
|
|
144
|
+
readonly type: "string";
|
|
145
|
+
}];
|
|
146
|
+
readonly name: "unpublish";
|
|
147
|
+
readonly outputs: readonly [];
|
|
148
|
+
readonly stateMutability: "nonpayable";
|
|
149
|
+
readonly type: "function";
|
|
150
|
+
}, {
|
|
151
|
+
readonly inputs: readonly [{
|
|
152
|
+
readonly name: "labelhash";
|
|
153
|
+
readonly type: "bytes32";
|
|
154
|
+
}];
|
|
155
|
+
readonly name: "isPublished";
|
|
156
|
+
readonly outputs: readonly [{
|
|
157
|
+
readonly name: "";
|
|
158
|
+
readonly type: "bool";
|
|
159
|
+
}];
|
|
160
|
+
readonly stateMutability: "view";
|
|
161
|
+
readonly type: "function";
|
|
162
|
+
}, {
|
|
163
|
+
readonly inputs: readonly [];
|
|
164
|
+
readonly name: "EmptyLabel";
|
|
165
|
+
readonly type: "error";
|
|
166
|
+
}, {
|
|
167
|
+
readonly inputs: readonly [];
|
|
168
|
+
readonly name: "NoPersonhood";
|
|
169
|
+
readonly type: "error";
|
|
170
|
+
}, {
|
|
171
|
+
readonly inputs: readonly [{
|
|
172
|
+
readonly name: "nextAllowedAt";
|
|
173
|
+
readonly type: "uint64";
|
|
174
|
+
}];
|
|
175
|
+
readonly name: "CooldownActive";
|
|
176
|
+
readonly type: "error";
|
|
177
|
+
}, {
|
|
178
|
+
readonly inputs: readonly [{
|
|
179
|
+
readonly name: "caller";
|
|
180
|
+
readonly type: "address";
|
|
181
|
+
}, {
|
|
182
|
+
readonly name: "tokenId";
|
|
183
|
+
readonly type: "uint256";
|
|
184
|
+
}];
|
|
185
|
+
readonly name: "NotOwner";
|
|
186
|
+
readonly type: "error";
|
|
187
|
+
}];
|
|
188
|
+
declare class PublisherNotSupportedError extends Error {
|
|
189
|
+
constructor(envName: string);
|
|
190
|
+
}
|
|
191
|
+
declare class ContractDryRunRevertError extends Error {
|
|
192
|
+
revertData: `0x${string}`;
|
|
193
|
+
revertFlags: bigint;
|
|
194
|
+
constructor(message: string, revertData: `0x${string}`, revertFlags: bigint);
|
|
195
|
+
}
|
|
196
|
+
declare function decodePublisherRevert(source: {
|
|
197
|
+
revertData?: `0x${string}`;
|
|
198
|
+
} | `0x${string}` | undefined | null): {
|
|
199
|
+
name: string;
|
|
200
|
+
args?: readonly unknown[];
|
|
201
|
+
} | null;
|
|
202
|
+
declare function convertToHexString(value: unknown): string;
|
|
203
|
+
declare function formatContractDryRunFailure(gasEstimate: {
|
|
204
|
+
revertData?: string;
|
|
205
|
+
revertFlags?: bigint;
|
|
206
|
+
gasConsumed?: {
|
|
207
|
+
referenceTime: bigint;
|
|
208
|
+
proofSize: bigint;
|
|
209
|
+
};
|
|
210
|
+
gasRequired?: {
|
|
211
|
+
referenceTime: bigint;
|
|
212
|
+
proofSize: bigint;
|
|
213
|
+
};
|
|
214
|
+
storageDeposit?: bigint;
|
|
215
|
+
}, context: {
|
|
216
|
+
contractAddress: string;
|
|
217
|
+
functionName?: string;
|
|
218
|
+
signerSubstrateAddress: string;
|
|
219
|
+
signerEvmAddress?: string;
|
|
220
|
+
value: bigint;
|
|
221
|
+
encodedData: string;
|
|
222
|
+
args?: unknown[];
|
|
223
|
+
contracts?: Record<string, string>;
|
|
224
|
+
}): string;
|
|
225
|
+
declare function __formatContractDryRunFailureForTest(gasEstimate: Parameters<typeof formatContractDryRunFailure>[0], context: Parameters<typeof formatContractDryRunFailure>[1]): string;
|
|
226
|
+
declare const DOT_NODE: `0x${string}`;
|
|
227
|
+
declare function convertWeiToNative(weiValue: bigint): bigint;
|
|
228
|
+
declare function computeDomainTokenId(label: string): bigint;
|
|
229
|
+
declare function countTrailingDigits(label: string): number;
|
|
230
|
+
declare function stripTrailingDigits(label: string): string;
|
|
231
|
+
declare function sanitizeDomainLabel(label: string): string;
|
|
232
|
+
declare function validateDomainLabel(label: string, opts?: {
|
|
233
|
+
checkReserved?: boolean;
|
|
234
|
+
}): string;
|
|
235
|
+
declare function isCommitmentMature(chainNowSeconds: number, commitTimestampSeconds: number, minimumAgeSeconds: number): boolean;
|
|
236
|
+
declare function isCommitmentTimingBarerevert(msg: string): boolean;
|
|
237
|
+
declare function classifyDotnsLabel(label: string): {
|
|
238
|
+
status: number;
|
|
239
|
+
message: string;
|
|
240
|
+
};
|
|
241
|
+
declare function canRegister(requiredStatus: number, userStatus: number, trailingDigits: number): boolean;
|
|
242
|
+
declare function parseDomainName(input: string): ParsedDomainName;
|
|
243
|
+
declare function parseProofOfPersonhoodStatus(status: string): number;
|
|
244
|
+
declare function popStatusName(status: number): string;
|
|
245
|
+
declare class ReviveClientWrapper {
|
|
246
|
+
static DRY_RUN_STORAGE_LIMIT: bigint;
|
|
247
|
+
static DRY_RUN_WEIGHT_LIMIT: {
|
|
248
|
+
ref_time: bigint;
|
|
249
|
+
proof_size: bigint;
|
|
250
|
+
};
|
|
251
|
+
client: any;
|
|
252
|
+
mappedAccounts: Set<string>;
|
|
253
|
+
constructor(client: any);
|
|
254
|
+
getEvmAddress(substrateAddress: string): Promise<string>;
|
|
255
|
+
performDryRunCall(originSubstrateAddress: string, contractAddress: string, value: bigint, encodedData: string): Promise<any>;
|
|
256
|
+
estimateGasForCall(originSubstrateAddress: string, contractAddress: string, value: bigint, encodedData: string): Promise<any>;
|
|
257
|
+
checkIfAccountMapped(substrateAddress: string): Promise<boolean>;
|
|
258
|
+
ensureAccountMapped(substrateAddress: string, signer: PolkadotSigner): Promise<void>;
|
|
259
|
+
signAndSubmitExtrinsic(extrinsic: any, signer: PolkadotSigner, statusCallback: (status: string) => void, opts?: {
|
|
260
|
+
nonceFallback?: {
|
|
261
|
+
rpcs: string[];
|
|
262
|
+
senderSS58: string;
|
|
263
|
+
expectedNonce: number;
|
|
264
|
+
};
|
|
265
|
+
verifyEffect?: () => Promise<boolean>;
|
|
266
|
+
}): Promise<TxResolution>;
|
|
267
|
+
signAndSubmitWithRetry(buildExtrinsic: () => any, signer: PolkadotSigner, statusCallback: (status: string) => void, label: string, opts?: {
|
|
268
|
+
nonceFallback?: {
|
|
269
|
+
rpcs: string[];
|
|
270
|
+
senderSS58: string;
|
|
271
|
+
expectedNonce: number;
|
|
272
|
+
};
|
|
273
|
+
verifyEffect?: () => Promise<boolean>;
|
|
274
|
+
}): Promise<TxResolution>;
|
|
275
|
+
private dryRunReviveCall;
|
|
276
|
+
submitTransaction(contractAddress: string, value: bigint, encodedData: string, signerSubstrateAddress: string, signer: PolkadotSigner, statusCallback: (status: string) => void, { rpcs, useNoncePolling, functionName, args, contracts, verifyEffect }: {
|
|
277
|
+
rpcs: string[];
|
|
278
|
+
useNoncePolling?: boolean;
|
|
279
|
+
functionName?: string;
|
|
280
|
+
args?: unknown[];
|
|
281
|
+
contracts?: Record<string, string>;
|
|
282
|
+
verifyEffect?: () => Promise<boolean>;
|
|
283
|
+
}): Promise<TxResolution>;
|
|
284
|
+
submitBatchedTransactions(calls: {
|
|
285
|
+
contractAddress: string;
|
|
286
|
+
value: bigint;
|
|
287
|
+
encodedData: string;
|
|
288
|
+
functionName?: string;
|
|
289
|
+
args?: unknown[];
|
|
290
|
+
}[], signerSubstrateAddress: string, signer: PolkadotSigner, statusCallback: (status: string) => void): Promise<TxResolution>;
|
|
291
|
+
}
|
|
292
|
+
type AliasAccountState = "not-bound" | "bound-likely-stale" | "wrong-context" | "bound-fresh";
|
|
293
|
+
interface AliasAccountClassification {
|
|
294
|
+
state: AliasAccountState;
|
|
295
|
+
storedContextHex?: string;
|
|
296
|
+
paid?: boolean;
|
|
297
|
+
revision?: number;
|
|
298
|
+
}
|
|
299
|
+
/**
|
|
300
|
+
* Format a user-facing remediation message for the "no personhood" preflight failure.
|
|
301
|
+
* Pure function — unit-testable without a chain connection.
|
|
302
|
+
*
|
|
303
|
+
* When popSelfServe.stateAwareGuidance is true, returns actionable advice based on alias state.
|
|
304
|
+
* Otherwise falls back to the generic "contact DotNS team" message.
|
|
305
|
+
*
|
|
306
|
+
* The environmentId parameter is forwarded for use in shell command examples (e.g.
|
|
307
|
+
* `--env paseo-next-v2`) so users can copy-paste the correct env id. It does NOT gate
|
|
308
|
+
* the state-aware branch — that is controlled by popSelfServe.stateAwareGuidance.
|
|
309
|
+
*/
|
|
310
|
+
declare function formatPersonhoodRemediation(state: AliasAccountClassification, popSelfServe: PopSelfServeConfig | null, environmentId: string | null): string;
|
|
311
|
+
/**
|
|
312
|
+
* Build a complete user-facing PoP shortfall reason string.
|
|
313
|
+
* Pure function — unit-testable without a chain connection.
|
|
314
|
+
*
|
|
315
|
+
* Composes:
|
|
316
|
+
* 1. Lead-in from the caller (`${label}.dot requires X, but signer is Y.`)
|
|
317
|
+
* 2. State-tailored guidance (when isTestnet && popSelfServe.stateAwareGuidance === true)
|
|
318
|
+
* — delegates to formatPersonhoodRemediation for state-specific text.
|
|
319
|
+
* — When aliasState is null on a stateAwareGuidance env, treated as "not-bound".
|
|
320
|
+
* 3. When isTestnet && popSelfServe != null but stateAwareGuidance is false/absent:
|
|
321
|
+
* the generic 3-step self-serve bootstrap block using the env's config URLs/label.
|
|
322
|
+
* 4. When isTestnet && popSelfServe == null: no testnet block (env opted out).
|
|
323
|
+
* 5. Always: the "Alternatives" block (NoStatus-compatible label + whitelist link).
|
|
324
|
+
*/
|
|
325
|
+
declare function formatPopShortfallReason(opts: {
|
|
326
|
+
label: string;
|
|
327
|
+
requiredName: string;
|
|
328
|
+
currentName: string;
|
|
329
|
+
isTestnet: boolean;
|
|
330
|
+
environmentId: string | null;
|
|
331
|
+
popSelfServe: PopSelfServeConfig | null;
|
|
332
|
+
aliasState: AliasAccountClassification | null;
|
|
333
|
+
exampleNoStatusLabel: string;
|
|
334
|
+
}): string;
|
|
335
|
+
declare class DotNS {
|
|
336
|
+
client: any | null;
|
|
337
|
+
clientWrapper: ReviveClientWrapper | null;
|
|
338
|
+
rpc: string | null;
|
|
339
|
+
substrateAddress: string | null;
|
|
340
|
+
evmAddress: string | null;
|
|
341
|
+
signer: PolkadotSigner | null;
|
|
342
|
+
connected: boolean;
|
|
343
|
+
assetHubEndpoints: string[];
|
|
344
|
+
private _usesExternalSigner;
|
|
345
|
+
private _localMnemonic;
|
|
346
|
+
private _contracts;
|
|
347
|
+
private _nativeToEthRatio;
|
|
348
|
+
private _environmentId;
|
|
349
|
+
private _popSelfServe;
|
|
350
|
+
private _registerStorageDeposit;
|
|
351
|
+
private _classifyOverrideForTest;
|
|
352
|
+
/** Test-only: inject a fixed classifyAliasAccountState return value for the next call. Consumed once. */
|
|
353
|
+
__setClassifyOverrideForTest(state: AliasAccountState): void;
|
|
354
|
+
private _userPopStatusOverrideForTest;
|
|
355
|
+
/** Test-only: inject a fixed getUserPopStatus return value for the next call. Consumed once. */
|
|
356
|
+
__setUserPopStatusForTest(status: number): void;
|
|
357
|
+
private _reproveFallbackForTest;
|
|
358
|
+
/** Test-only: register a fallback reprove result used only if the real reprove() throws "not strictly greater than stored". Consumed once. */
|
|
359
|
+
__setReproveFallbackForTest(result: {
|
|
360
|
+
oldRevision: number;
|
|
361
|
+
newRevision: number;
|
|
362
|
+
blockHash: string;
|
|
363
|
+
}): void;
|
|
364
|
+
constructor();
|
|
365
|
+
connect(options?: DotNSConnectOptions): Promise<this>;
|
|
366
|
+
ensureMappedAccountReady(autoAccountMapping?: boolean): Promise<void>;
|
|
367
|
+
ensureAutoMappedAccountReady(): Promise<void>;
|
|
368
|
+
ensureConnected(): void;
|
|
369
|
+
private _testnetCache;
|
|
370
|
+
isTestnet(): Promise<boolean>;
|
|
371
|
+
/**
|
|
372
|
+
* Classify the AliasAccounts state for a substrate address.
|
|
373
|
+
* Only called on paseo-next-v2 testnets inside the preflight's NoStatus branch.
|
|
374
|
+
* Returns "not-bound" if the chain is unreachable (safe fallback to generic advice).
|
|
375
|
+
*/
|
|
376
|
+
private classifyAliasAccountState;
|
|
377
|
+
readFreeBalance(ss58: string): Promise<bigint>;
|
|
378
|
+
attemptTestnetTopUp(recipientSs58: string, targetAmount: bigint): Promise<{
|
|
379
|
+
source: "Alice" | "Bob";
|
|
380
|
+
transferred: bigint;
|
|
381
|
+
} | null>;
|
|
382
|
+
private submitTransfer;
|
|
383
|
+
contractCall(contractAddress: string, contractAbi: readonly any[], functionName: string, args?: any[]): Promise<any>;
|
|
384
|
+
/**
|
|
385
|
+
* Like contractCall, but returns null when the chain replies with empty data
|
|
386
|
+
* ("0x"). Use this for view functions where an unset storage slot is a
|
|
387
|
+
* meaningful answer (e.g. resolver(node) for a name with no resolver,
|
|
388
|
+
* text records, optional ownership lookups). Use the strict contractCall
|
|
389
|
+
* for read paths that must always return a value.
|
|
390
|
+
*/
|
|
391
|
+
contractCallNullable(contractAddress: string, contractAbi: readonly any[], functionName: string, args?: any[]): Promise<any | null>;
|
|
392
|
+
contractTransaction(contractAddress: string, value: bigint, contractAbi: readonly any[], functionName: string, args?: any[], statusCallback?: (status: string) => void, { useNoncePolling, verifyEffect }?: {
|
|
393
|
+
useNoncePolling?: boolean;
|
|
394
|
+
verifyEffect?: () => Promise<boolean>;
|
|
395
|
+
}): Promise<TxResolution>;
|
|
396
|
+
checkOwnership(label: string, ownerAddress?: string | null): Promise<OwnershipResult>;
|
|
397
|
+
getUserPopStatus(ownerAddress?: string | null): Promise<number>;
|
|
398
|
+
checkSubdomainOwnership(sublabel: string, parentLabel: string): Promise<OwnershipResult>;
|
|
399
|
+
registerSubdomain(sublabel: string, parentLabel: string): Promise<{
|
|
400
|
+
sublabel: string;
|
|
401
|
+
parentLabel: string;
|
|
402
|
+
owner: string;
|
|
403
|
+
}>;
|
|
404
|
+
/**
|
|
405
|
+
* Submit multiple contract calls as a single atomic `Utility.batch_all`
|
|
406
|
+
* extrinsic.
|
|
407
|
+
*
|
|
408
|
+
* Each call is encoded as a `pallet-revive::call(...)` extrinsic and
|
|
409
|
+
* batched into one outer dispatch. The runtime executes them in
|
|
410
|
+
* sequence and rolls back the entire batch on any inner revert. Only
|
|
411
|
+
* the leading call is dry-run for gas — its weight is reused as the
|
|
412
|
+
* budget for every subsequent call, on the assumption sibling
|
|
413
|
+
* registry/resolver writes are similarly sized.
|
|
414
|
+
*/
|
|
415
|
+
private submitBatchedContractCalls;
|
|
416
|
+
setContenthash(domainName: string, contenthashHex: string): Promise<{
|
|
417
|
+
node: string;
|
|
418
|
+
}>;
|
|
419
|
+
/**
|
|
420
|
+
* Point a node's registered resolver at `DOTNS_CONTENT_RESOLVER` (RFC §Step 3.2).
|
|
421
|
+
*
|
|
422
|
+
* Hosts read text records via `IDotnsRegistry.resolver(node)`, so the
|
|
423
|
+
* registered slot must point at the content resolver for manifest text
|
|
424
|
+
* records to be discoverable. The pre-read is best-effort: pallet-revive
|
|
425
|
+
* returns `isOk=true` with empty data when a selector isn't in the
|
|
426
|
+
* deployed bytecode, which makes viem's decoder throw. Any decode failure
|
|
427
|
+
* is treated as "unset" and the write fires unconditionally. `setResolver`
|
|
428
|
+
* is idempotent against the same target, so registries that pre-date the
|
|
429
|
+
* `resolver(bytes32)` getter just pay one extra extrinsic per publish.
|
|
430
|
+
*/
|
|
431
|
+
ensureContentResolver(domainName: string): Promise<{
|
|
432
|
+
changed: boolean;
|
|
433
|
+
}>;
|
|
434
|
+
/** Read a text record off `DOTNS_CONTENT_RESOLVER`. Returns `""` when unset. */
|
|
435
|
+
getTextRecord(domainName: string, key: string): Promise<string>;
|
|
436
|
+
setTextRecord(domainName: string, key: string, value: string): Promise<{
|
|
437
|
+
value: string;
|
|
438
|
+
txHash: string;
|
|
439
|
+
}>;
|
|
440
|
+
setTextRecords(domainName: string, entries: {
|
|
441
|
+
key: string;
|
|
442
|
+
value: string;
|
|
443
|
+
}[]): Promise<{
|
|
444
|
+
txHash: string | null;
|
|
445
|
+
batched: boolean;
|
|
446
|
+
}>;
|
|
447
|
+
publishLabel(label: string): Promise<{
|
|
448
|
+
status: "published" | "already-published" | "cooldown-skipped";
|
|
449
|
+
txHash?: string;
|
|
450
|
+
}>;
|
|
451
|
+
unpublishLabel(label: string): Promise<{
|
|
452
|
+
status: "unpublished" | "already-unpublished";
|
|
453
|
+
txHash?: string;
|
|
454
|
+
}>;
|
|
455
|
+
getContenthash(domainName: string): Promise<string>;
|
|
456
|
+
classifyName(label: string): Promise<{
|
|
457
|
+
requiredStatus: number;
|
|
458
|
+
message: string;
|
|
459
|
+
}>;
|
|
460
|
+
ensureNotRegistered(label: string): Promise<void>;
|
|
461
|
+
generateCommitment(label: string, includeReverse?: boolean): Promise<{
|
|
462
|
+
commitment: any;
|
|
463
|
+
registration: any;
|
|
464
|
+
}>;
|
|
465
|
+
submitCommitment(commitment: any): Promise<void>;
|
|
466
|
+
waitForCommitmentAge(commitment: any): Promise<void>;
|
|
467
|
+
getPriceAndValidate(label: string): Promise<PriceValidationResult>;
|
|
468
|
+
finalizeRegistration(registration: any, priceWei: bigint): Promise<void>;
|
|
469
|
+
verifyOwnership(label: string): Promise<void>;
|
|
470
|
+
preflight(label: string): Promise<DotnsPreflightResult>;
|
|
471
|
+
private _preflightInternal;
|
|
472
|
+
private gateOnFeeBalance;
|
|
473
|
+
register(label: string, options?: DotNSConnectOptions & {
|
|
474
|
+
status?: string;
|
|
475
|
+
reverse?: boolean;
|
|
476
|
+
}): Promise<{
|
|
477
|
+
label: string;
|
|
478
|
+
owner: string;
|
|
479
|
+
}>;
|
|
480
|
+
/**
|
|
481
|
+
* Reprove a stale DotNS alias binding.
|
|
482
|
+
* Opens a People-chain client internally, builds the ring proof, and submits
|
|
483
|
+
* reprove_alias_account on AH. Use when the alias exists but the ring root
|
|
484
|
+
* has advanced past the stored revision.
|
|
485
|
+
*
|
|
486
|
+
* Requires a mnemonic — the DotNS instance must have been connected with one.
|
|
487
|
+
*/
|
|
488
|
+
reprove(mnemonic: string): Promise<{
|
|
489
|
+
oldRevision: number;
|
|
490
|
+
newRevision: number;
|
|
491
|
+
blockHash: string;
|
|
492
|
+
}>;
|
|
493
|
+
/**
|
|
494
|
+
* Run the personhood bootstrap flow for this DotNS signer.
|
|
495
|
+
* Idempotent: each step is gated on chain state being "still needs doing".
|
|
496
|
+
* Does NOT auto-run from preflight — call explicitly.
|
|
497
|
+
*
|
|
498
|
+
* Throws RecognizeRequiredError if the account hasn't been recognized by the
|
|
499
|
+
* personhood faucet (https://sudo.personhood.dev/personhood-faucet).
|
|
500
|
+
*/
|
|
501
|
+
bootstrap(mnemonic: string): Promise<BootstrapResult>;
|
|
502
|
+
disconnect(): void;
|
|
503
|
+
}
|
|
504
|
+
declare const dotns: DotNS;
|
|
505
|
+
|
|
506
|
+
export { ATTR_TX_RESOLUTION_KIND, type AliasAccountClassification, type AliasAccountState, CONNECTION_TIMEOUT_MS, CONTRACTS, ContractDryRunRevertError, DECIMALS, DEFAULT_MNEMONIC, DOTNS_TX_MAX_ATTEMPTS, DOT_NODE, DotNS, type DotNSConnectOptions, type DotnsPreflightResult, type DotnsSuccessAction, MINIMUM_REGISTER_STORAGE_DEPOSIT, NATIVE_TO_ETH_RATIO, OPERATION_TIMEOUT_MS, type OwnershipResult, PUBLISHER_ABI, type ParsedDomainName, type PriceValidationResult, ProofOfPersonhoodStatus, PublisherNotSupportedError, RPC_ENDPOINTS, TX_CHAIN_TIME_BUDGET_MS, TX_KIND_HASH, TX_KIND_NONCE_ADVANCED, TX_TIMEOUT_MS, TX_WALL_CLOCK_CEILING_MS, type TxResolution, WS_HEARTBEAT_TIMEOUT_MS, __formatContractDryRunFailureForTest, canRegister, classifyDotnsLabel, classifyTxRetryDecision, computeDomainTokenId, convertToHexString, convertWeiToNative, countTrailingDigits, decodePublisherRevert, dotns, feeFloorFor, fetchNonce, fmtPas, formatPersonhoodRemediation, formatPopShortfallReason, isCommitmentMature, isCommitmentTimingBarerevert, parseDomainName, parseProofOfPersonhoodStatus, popStatusName, sanitizeDomainLabel, stripTrailingDigits, validateDomainLabel, verifyNonceAdvanced };
|
package/dist/dotns.js
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ATTR_TX_RESOLUTION_KIND,
|
|
3
|
+
CONNECTION_TIMEOUT_MS,
|
|
4
|
+
CONTRACTS,
|
|
5
|
+
ContractDryRunRevertError,
|
|
6
|
+
DECIMALS,
|
|
7
|
+
DEFAULT_MNEMONIC,
|
|
8
|
+
DOTNS_TX_MAX_ATTEMPTS,
|
|
9
|
+
DOT_NODE,
|
|
10
|
+
DotNS,
|
|
11
|
+
MINIMUM_REGISTER_STORAGE_DEPOSIT,
|
|
12
|
+
NATIVE_TO_ETH_RATIO,
|
|
13
|
+
OPERATION_TIMEOUT_MS,
|
|
14
|
+
PUBLISHER_ABI,
|
|
15
|
+
ProofOfPersonhoodStatus,
|
|
16
|
+
PublisherNotSupportedError,
|
|
17
|
+
RPC_ENDPOINTS,
|
|
18
|
+
TX_CHAIN_TIME_BUDGET_MS,
|
|
19
|
+
TX_KIND_HASH,
|
|
20
|
+
TX_KIND_NONCE_ADVANCED,
|
|
21
|
+
TX_TIMEOUT_MS,
|
|
22
|
+
TX_WALL_CLOCK_CEILING_MS,
|
|
23
|
+
WS_HEARTBEAT_TIMEOUT_MS,
|
|
24
|
+
__formatContractDryRunFailureForTest,
|
|
25
|
+
canRegister,
|
|
26
|
+
classifyDotnsLabel,
|
|
27
|
+
classifyTxRetryDecision,
|
|
28
|
+
computeDomainTokenId,
|
|
29
|
+
convertToHexString,
|
|
30
|
+
convertWeiToNative,
|
|
31
|
+
countTrailingDigits,
|
|
32
|
+
decodePublisherRevert,
|
|
33
|
+
dotns,
|
|
34
|
+
feeFloorFor,
|
|
35
|
+
fetchNonce,
|
|
36
|
+
fmtPas,
|
|
37
|
+
formatPersonhoodRemediation,
|
|
38
|
+
formatPopShortfallReason,
|
|
39
|
+
isCommitmentMature,
|
|
40
|
+
isCommitmentTimingBarerevert,
|
|
41
|
+
parseDomainName,
|
|
42
|
+
parseProofOfPersonhoodStatus,
|
|
43
|
+
popStatusName,
|
|
44
|
+
sanitizeDomainLabel,
|
|
45
|
+
stripTrailingDigits,
|
|
46
|
+
validateDomainLabel,
|
|
47
|
+
verifyNonceAdvanced
|
|
48
|
+
} from "./chunk-DNXH4QTI.js";
|
|
49
|
+
import "./chunk-QMYW3D6E.js";
|
|
50
|
+
import "./chunk-MFTODIIT.js";
|
|
51
|
+
import "./chunk-KJH2T5TQ.js";
|
|
52
|
+
import "./chunk-OITUIM2E.js";
|
|
53
|
+
import "./chunk-ZOC4GITL.js";
|
|
54
|
+
export {
|
|
55
|
+
ATTR_TX_RESOLUTION_KIND,
|
|
56
|
+
CONNECTION_TIMEOUT_MS,
|
|
57
|
+
CONTRACTS,
|
|
58
|
+
ContractDryRunRevertError,
|
|
59
|
+
DECIMALS,
|
|
60
|
+
DEFAULT_MNEMONIC,
|
|
61
|
+
DOTNS_TX_MAX_ATTEMPTS,
|
|
62
|
+
DOT_NODE,
|
|
63
|
+
DotNS,
|
|
64
|
+
MINIMUM_REGISTER_STORAGE_DEPOSIT,
|
|
65
|
+
NATIVE_TO_ETH_RATIO,
|
|
66
|
+
OPERATION_TIMEOUT_MS,
|
|
67
|
+
PUBLISHER_ABI,
|
|
68
|
+
ProofOfPersonhoodStatus,
|
|
69
|
+
PublisherNotSupportedError,
|
|
70
|
+
RPC_ENDPOINTS,
|
|
71
|
+
TX_CHAIN_TIME_BUDGET_MS,
|
|
72
|
+
TX_KIND_HASH,
|
|
73
|
+
TX_KIND_NONCE_ADVANCED,
|
|
74
|
+
TX_TIMEOUT_MS,
|
|
75
|
+
TX_WALL_CLOCK_CEILING_MS,
|
|
76
|
+
WS_HEARTBEAT_TIMEOUT_MS,
|
|
77
|
+
__formatContractDryRunFailureForTest,
|
|
78
|
+
canRegister,
|
|
79
|
+
classifyDotnsLabel,
|
|
80
|
+
classifyTxRetryDecision,
|
|
81
|
+
computeDomainTokenId,
|
|
82
|
+
convertToHexString,
|
|
83
|
+
convertWeiToNative,
|
|
84
|
+
countTrailingDigits,
|
|
85
|
+
decodePublisherRevert,
|
|
86
|
+
dotns,
|
|
87
|
+
feeFloorFor,
|
|
88
|
+
fetchNonce,
|
|
89
|
+
fmtPas,
|
|
90
|
+
formatPersonhoodRemediation,
|
|
91
|
+
formatPopShortfallReason,
|
|
92
|
+
isCommitmentMature,
|
|
93
|
+
isCommitmentTimingBarerevert,
|
|
94
|
+
parseDomainName,
|
|
95
|
+
parseProofOfPersonhoodStatus,
|
|
96
|
+
popStatusName,
|
|
97
|
+
sanitizeDomainLabel,
|
|
98
|
+
stripTrailingDigits,
|
|
99
|
+
validateDomainLabel,
|
|
100
|
+
verifyNonceAdvanced
|
|
101
|
+
};
|