@dotdm/env 1.0.5 → 1.0.6-dev.1779335670

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.
@@ -1,14 +1,14 @@
1
1
  // src/registry.ts
2
- var PASEO_V2_REGISTRY_ADDRESS = "0x5c7b23d386ff622c7f7a4e7a95d5c7a67b10a00d";
3
- var PREVIEW_NET_REGISTRY_ADDRESS = "0x5c7b23d386ff622c7f7a4e7a95d5c7a67b10a00d";
4
- function getRegistryAddress(name) {
2
+ var PASEO_V2_REGISTRY_ADDRESS = "0xa7ae171c78f06c248a9b2556c793aa1df5c9173a";
3
+ var PREVIEW_NET_REGISTRY_ADDRESS = "0xa7ae171c78f06c248a9b2556c793aa1df5c9173a";
4
+ function getRegistryAddress(name = "paseo") {
5
5
  if (name === "paseo" || name === "paseo-next-v2" || name === "paseo-v2") {
6
6
  return PASEO_V2_REGISTRY_ADDRESS;
7
7
  }
8
8
  if (name === "preview-net" || name === "previewnet") {
9
9
  return PREVIEW_NET_REGISTRY_ADDRESS;
10
10
  }
11
- return void 0;
11
+ return PASEO_V2_REGISTRY_ADDRESS;
12
12
  }
13
13
 
14
14
  export {
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { ProductSdkEnvironment } from './registry.js';
2
2
  export { getRegistryAddress } from './registry.js';
3
- export { DEFAULT_NODE_URL, REGISTRY_ADDRESS } from '@dotdm/utils';
3
+ export { DEFAULT_NODE_URL } from '@dotdm/utils';
4
4
  import * as polkadot_api from 'polkadot-api';
5
5
  import { PolkadotClient, TypedApi } from 'polkadot-api';
6
6
  import { polkadot_asset_hub } from '@parity/product-sdk-descriptors/polkadot-asset-hub';
@@ -28,17 +28,17 @@ declare const KNOWN_CHAINS: {
28
28
  readonly assethubUrl: "wss://polkadot-asset-hub-rpc.polkadot.io";
29
29
  readonly bulletinUrl: "wss://polkadot-bulletin-rpc.polkadot.io";
30
30
  readonly ipfsGatewayUrl: "https://polkadot-bulletin-rpc.polkadot.io/ipfs";
31
- readonly registryAddress: "0xae344f7f0f91d3a2176032af2990abcc7606c7d4";
31
+ readonly registryAddress: string;
32
32
  };
33
33
  readonly paseo: {
34
34
  readonly assethubUrl: "wss://paseo-asset-hub-next-rpc.polkadot.io";
35
35
  readonly bulletinUrl: "wss://paseo-bulletin-next-rpc.polkadot.io";
36
36
  readonly ipfsGatewayUrl: "https://paseo-bulletin-next-ipfs.polkadot.io/ipfs";
37
- readonly registryAddress: string | undefined;
37
+ readonly registryAddress: string;
38
38
  readonly productSdkEnvironment: "paseo";
39
39
  readonly faucets: readonly [{
40
40
  readonly label: "Asset Hub";
41
- readonly url: "https://faucet.polkadot.io/";
41
+ readonly url: "https://faucet.polkadot.io/?parachain=1500";
42
42
  }, {
43
43
  readonly label: "Bulletin";
44
44
  readonly url: "https://paritytech.github.io/polkadot-bulletin-chain/authorizations?tab=faucet";
@@ -46,16 +46,16 @@ declare const KNOWN_CHAINS: {
46
46
  };
47
47
  readonly "preview-net": {
48
48
  readonly assethubUrl: "wss://previewnet.substrate.dev/asset-hub";
49
- readonly bulletinUrl: "wss://paseo-bulletin-next-rpc.polkadot.io";
50
- readonly ipfsGatewayUrl: "https://paseo-bulletin-next-ipfs.polkadot.io/ipfs";
51
- readonly registryAddress: string | undefined;
49
+ readonly bulletinUrl: "wss://previewnet.substrate.dev/bulletin";
50
+ readonly ipfsGatewayUrl: "https://previewnet.substrate.dev/ipfs";
51
+ readonly registryAddress: string;
52
52
  readonly productSdkEnvironment: "previewnet";
53
53
  };
54
54
  readonly local: {
55
55
  readonly assethubUrl: "ws://127.0.0.1:10020";
56
56
  readonly bulletinUrl: "ws://127.0.0.1:10030";
57
57
  readonly ipfsGatewayUrl: "http://127.0.0.1:8283/ipfs";
58
- readonly registryAddress: "0xae344f7f0f91d3a2176032af2990abcc7606c7d4";
58
+ readonly registryAddress: string;
59
59
  };
60
60
  };
61
61
  type KnownChainName = keyof typeof KNOWN_CHAINS;
@@ -74,9 +74,7 @@ type CdmBulletinApi = TypedApi<CdmBulletinDescriptor>;
74
74
  *
75
75
  * Uses `@parity/product-sdk-descriptors` for the chain descriptors so the
76
76
  * resulting `TypedApi` types line up natively with `ContractDeployer`,
77
- * `MetadataPublisher`, and the product-sdk batch/bulletin helpers. TEMPORARY_PATCH! Preview-net
78
- * currently uses its own Asset Hub descriptor and Paseo's Bulletin descriptor
79
- * because CDM stores preview-net metadata on Paseo Bulletin.
77
+ * `MetadataPublisher`, and the product-sdk batch/bulletin helpers.
80
78
  */
81
79
  type CdmChainClient = {
82
80
  assetHub: CdmDeployAssetHubApi;
package/dist/index.js CHANGED
@@ -1,18 +1,19 @@
1
1
  import {
2
2
  getRegistryAddress
3
- } from "./chunk-YHBXRANR.js";
3
+ } from "./chunk-3LTEJCST.js";
4
4
 
5
5
  // src/known_chains.ts
6
6
  import { BULLETIN_RPCS } from "@parity/product-sdk-host";
7
- import { REGISTRY_ADDRESS } from "@dotdm/utils";
8
7
  var PASEO_ASSET_HUB_URL = "wss://paseo-asset-hub-next-rpc.polkadot.io";
8
+ var PREVIEW_NET_ASSET_HUB_URL = "wss://previewnet.substrate.dev/asset-hub";
9
9
  var PASEO_IPFS_GATEWAY_URL = "https://paseo-bulletin-next-ipfs.polkadot.io/ipfs";
10
+ var PREVIEW_NET_IPFS_GATEWAY_URL = "https://previewnet.substrate.dev/ipfs";
10
11
  var KNOWN_CHAINS = {
11
12
  polkadot: {
12
13
  assethubUrl: "wss://polkadot-asset-hub-rpc.polkadot.io",
13
14
  bulletinUrl: "wss://polkadot-bulletin-rpc.polkadot.io",
14
15
  ipfsGatewayUrl: "https://polkadot-bulletin-rpc.polkadot.io/ipfs",
15
- registryAddress: REGISTRY_ADDRESS
16
+ registryAddress: getRegistryAddress("polkadot")
16
17
  },
17
18
  paseo: {
18
19
  assethubUrl: PASEO_ASSET_HUB_URL,
@@ -21,7 +22,7 @@ var KNOWN_CHAINS = {
21
22
  registryAddress: getRegistryAddress("paseo"),
22
23
  productSdkEnvironment: "paseo",
23
24
  faucets: [
24
- { label: "Asset Hub", url: "https://faucet.polkadot.io/" },
25
+ { label: "Asset Hub", url: "https://faucet.polkadot.io/?parachain=1500" },
25
26
  {
26
27
  label: "Bulletin",
27
28
  url: "https://paritytech.github.io/polkadot-bulletin-chain/authorizations?tab=faucet"
@@ -29,11 +30,9 @@ var KNOWN_CHAINS = {
29
30
  ]
30
31
  },
31
32
  "preview-net": {
32
- assethubUrl: "wss://previewnet.substrate.dev/asset-hub",
33
- // TEMPORARY_PATCH! Preview-net's IPFS gateway does not currently serve Bulletin CIDs,
34
- // so CDM stores preview-net metadata on Paseo Bulletin for now.
35
- bulletinUrl: BULLETIN_RPCS.paseo[0],
36
- ipfsGatewayUrl: PASEO_IPFS_GATEWAY_URL,
33
+ assethubUrl: PREVIEW_NET_ASSET_HUB_URL,
34
+ bulletinUrl: BULLETIN_RPCS.previewnet[0],
35
+ ipfsGatewayUrl: PREVIEW_NET_IPFS_GATEWAY_URL,
37
36
  registryAddress: getRegistryAddress("preview-net"),
38
37
  productSdkEnvironment: "previewnet"
39
38
  },
@@ -41,7 +40,7 @@ var KNOWN_CHAINS = {
41
40
  assethubUrl: "ws://127.0.0.1:10020",
42
41
  bulletinUrl: "ws://127.0.0.1:10030",
43
42
  ipfsGatewayUrl: "http://127.0.0.1:8283/ipfs",
44
- registryAddress: REGISTRY_ADDRESS
43
+ registryAddress: getRegistryAddress("local")
45
44
  }
46
45
  };
47
46
  function normalizeChainName(name) {
@@ -67,7 +66,7 @@ function getChainPreset(name) {
67
66
  }
68
67
 
69
68
  // src/index.ts
70
- import { DEFAULT_NODE_URL, REGISTRY_ADDRESS as REGISTRY_ADDRESS2 } from "@dotdm/utils";
69
+ import { DEFAULT_NODE_URL } from "@dotdm/utils";
71
70
 
72
71
  // src/connection.ts
73
72
  import {
@@ -78,9 +77,10 @@ import { polkadot_asset_hub } from "@parity/product-sdk-descriptors/polkadot-ass
78
77
  import { paseo_asset_hub } from "@parity/product-sdk-descriptors/paseo-asset-hub";
79
78
  import { previewnet_asset_hub } from "@parity/product-sdk-descriptors/previewnet-asset-hub";
80
79
  import { paseo_bulletin } from "@parity/product-sdk-descriptors/paseo-bulletin";
80
+ import { previewnet_bulletin } from "@parity/product-sdk-descriptors/previewnet-bulletin";
81
81
  var DEPLOY_CHAIN_DESCRIPTORS = {
82
82
  paseo: { assetHub: paseo_asset_hub, bulletin: paseo_bulletin },
83
- "preview-net": { assetHub: previewnet_asset_hub, bulletin: paseo_bulletin },
83
+ "preview-net": { assetHub: previewnet_asset_hub, bulletin: previewnet_bulletin },
84
84
  local: { assetHub: paseo_asset_hub, bulletin: paseo_bulletin }
85
85
  };
86
86
  var ASSET_HUB_DESCRIPTORS = {
@@ -159,6 +159,15 @@ function createDirectChainClient(chains, rpcs) {
159
159
  }
160
160
  };
161
161
  }
162
+ if (import.meta.vitest) {
163
+ const { test, expect } = import.meta.vitest;
164
+ test("preview-net deploy connections use previewnet descriptors", () => {
165
+ const descriptors = resolveDeployDescriptors("preview-net");
166
+ expect(descriptors.assetHub).toBe(previewnet_asset_hub);
167
+ expect(descriptors.bulletin).toBe(previewnet_bulletin);
168
+ expect(descriptors.bulletin).not.toBe(paseo_bulletin);
169
+ });
170
+ }
162
171
 
163
172
  // src/signer.ts
164
173
  import { getPolkadotSigner } from "polkadot-api/signer";
@@ -191,7 +200,6 @@ function prepareSignerFromSuri(suri) {
191
200
  }
192
201
  export {
193
202
  DEFAULT_NODE_URL,
194
- REGISTRY_ADDRESS2 as REGISTRY_ADDRESS,
195
203
  connectIpfsGateway,
196
204
  createCdmAssetHubClient,
197
205
  createCdmChainClient,
@@ -1,4 +1,4 @@
1
1
  type ProductSdkEnvironment = "paseo" | "previewnet";
2
- declare function getRegistryAddress(name: string): string | undefined;
2
+ declare function getRegistryAddress(name?: string): string;
3
3
 
4
4
  export { type ProductSdkEnvironment, getRegistryAddress };
package/dist/registry.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getRegistryAddress
3
- } from "./chunk-YHBXRANR.js";
3
+ } from "./chunk-3LTEJCST.js";
4
4
  export {
5
5
  getRegistryAddress
6
6
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dotdm/env",
3
- "version": "1.0.5",
3
+ "version": "1.0.6-dev.1779335670",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -27,7 +27,7 @@
27
27
  "@polkadot-labs/hdkd-helpers": "^0.0.27",
28
28
  "polkadot-api": "^2.1.2",
29
29
  "smoldot": "^2.0.40",
30
- "@dotdm/utils": "0.3.1"
30
+ "@dotdm/utils": "0.3.2-dev.1779335670"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@types/node": "^24.10.1",