@dfx.swiss/wallet 0.1.1-beta.0 → 0.1.1-beta.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 DFX
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -17,13 +17,14 @@ WalletConnect.
17
17
 
18
18
  ## Environments
19
19
 
20
- The app build selects the environment (`'prd'`, `'dev'` or `'loc'`). The WebAuthn RP ID, the DFX login message prefix
20
+ The app build selects the environment (`'prd'`, `'dev'`, `'stg'` or `'loc'`). The WebAuthn RP ID, the DFX login message prefix
21
21
  and the networks follow from it and are compiled-in constants:
22
22
 
23
23
  | Environment | RP ID | Login message prefix | Bitcoin | EVM chains | Spark |
24
24
  | ----------- | ------------------- | -------------------- | -------- | ---------- | ------- |
25
25
  | `prd` | `app.dfx.swiss` | none | mainnet | mainnets | mainnet |
26
26
  | `dev` | `dev.app.dfx.swiss` | `[dev]_` | testnet4 | testnets | mainnet |
27
+ | `stg` | `stg.app.dfx.swiss` | `[stg]_` | testnet4 | testnets | mainnet |
27
28
  | `loc` | `localhost` | `[loc]_` | testnet4 | testnets | mainnet |
28
29
 
29
30
  ```typescript
@@ -2,13 +2,13 @@
2
2
  * Deployment environment of the DFX app that hosts the wallet. It is compiled into the app build and never
3
3
  * taken from the server, the URL or user input: the RP ID and the login message prefix follow from it.
4
4
  */
5
- export type WalletEnv = 'prd' | 'dev' | 'loc';
5
+ export type WalletEnv = 'prd' | 'dev' | 'stg' | 'loc';
6
6
  export declare const WALLET_ENVS: readonly WalletEnv[];
7
7
  export declare function isWalletEnv(value: unknown): value is WalletEnv;
8
8
  /**
9
- * WebAuthn relying-party ID per environment. The RP ID is the app host, never the apex `dfx.swiss`. DEV is the
10
- * existing DEV Pages host `dev.app.dfx.swiss`, a subdomain of the production host: WebAuthn RP scope only
11
- * grows downward, so a DEV passkey (rpId `dev.app.dfx.swiss`) can never satisfy a PRD ceremony, which pins
9
+ * WebAuthn relying-party ID per environment. The RP ID is the app host, never the apex `dfx.swiss`. DEV and
10
+ * STG are the existing Pages hosts under `app.dfx.swiss`: WebAuthn RP scope only grows downward, so a
11
+ * passkey of `dev.app.dfx.swiss` or `stg.app.dfx.swiss` can never satisfy a PRD ceremony, which pins
12
12
  * `app.dfx.swiss`, and every ceremony always passes its own environment's RP ID. A passkey is bound to its
13
13
  * RP ID forever, so these values must never change for an existing environment.
14
14
  */
@@ -34,7 +34,7 @@ export interface WalletNetworks {
34
34
  }
35
35
  /**
36
36
  * Networks per environment, matching the chain list rule of the DFX API: PRD uses Bitcoin mainnet and EVM
37
- * mainnets only; DEV and LOC use Bitcoin testnet4 and EVM test chains only; Spark is mainnet everywhere.
37
+ * mainnets only; DEV, STG and LOC use Bitcoin testnet4 and EVM test chains only; Spark is mainnet everywhere.
38
38
  */
39
39
  export declare const WALLET_NETWORKS: Readonly<Record<WalletEnv, Readonly<WalletNetworks>>>;
40
40
  //# sourceMappingURL=environment.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["../../src/config/environment.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;AAE9C,eAAO,MAAM,WAAW,EAAE,SAAS,SAAS,EAAkD,CAAC;AAE/F,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,SAAS,CAE9D;AAED;;;;;;GAMG;AACH,eAAO,MAAM,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAIrD,CAAC;AAEH;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAIlE,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,UAAU,CAAC;AAEpD,sDAAsD;AACtD,MAAM,MAAM,YAAY,GAAG,SAAS,CAAC;AAErC,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,SAAS,CAAC;AAEnD,MAAM,WAAW,cAAc;IAC7B,2FAA2F;IAC3F,OAAO,EAAE,cAAc,CAAC;IACxB,sCAAsC;IACtC,KAAK,EAAE,YAAY,CAAC;IACpB,kEAAkE;IAClE,GAAG,EAAE,cAAc,CAAC;CACrB;AAED;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,MAAM,CAAC,SAAS,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAC,CAIhF,CAAC"}
1
+ {"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["../../src/config/environment.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;AAEtD,eAAO,MAAM,WAAW,EAAE,SAAS,SAAS,EAAyD,CAAC;AAEtG,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,SAAS,CAE9D;AAED;;;;;;GAMG;AACH,eAAO,MAAM,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAKrD,CAAC;AAEH;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAKlE,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,UAAU,CAAC;AAEpD,sDAAsD;AACtD,MAAM,MAAM,YAAY,GAAG,SAAS,CAAC;AAErC,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,SAAS,CAAC;AAEnD,MAAM,WAAW,cAAc;IAC7B,2FAA2F;IAC3F,OAAO,EAAE,cAAc,CAAC;IACxB,sCAAsC;IACtC,KAAK,EAAE,YAAY,CAAC;IACpB,kEAAkE;IAClE,GAAG,EAAE,cAAc,CAAC;CACrB;AAED;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,MAAM,CAAC,SAAS,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAC,CAKhF,CAAC"}
@@ -1,17 +1,18 @@
1
- export const WALLET_ENVS = Object.freeze(['prd', 'dev', 'loc']);
1
+ export const WALLET_ENVS = Object.freeze(['prd', 'dev', 'stg', 'loc']);
2
2
  export function isWalletEnv(value) {
3
3
  return typeof value === 'string' && WALLET_ENVS.includes(value);
4
4
  }
5
5
  /**
6
- * WebAuthn relying-party ID per environment. The RP ID is the app host, never the apex `dfx.swiss`. DEV is the
7
- * existing DEV Pages host `dev.app.dfx.swiss`, a subdomain of the production host: WebAuthn RP scope only
8
- * grows downward, so a DEV passkey (rpId `dev.app.dfx.swiss`) can never satisfy a PRD ceremony, which pins
6
+ * WebAuthn relying-party ID per environment. The RP ID is the app host, never the apex `dfx.swiss`. DEV and
7
+ * STG are the existing Pages hosts under `app.dfx.swiss`: WebAuthn RP scope only grows downward, so a
8
+ * passkey of `dev.app.dfx.swiss` or `stg.app.dfx.swiss` can never satisfy a PRD ceremony, which pins
9
9
  * `app.dfx.swiss`, and every ceremony always passes its own environment's RP ID. A passkey is bound to its
10
10
  * RP ID forever, so these values must never change for an existing environment.
11
11
  */
12
12
  export const RP_IDS = Object.freeze({
13
13
  prd: 'app.dfx.swiss',
14
14
  dev: 'dev.app.dfx.swiss',
15
+ stg: 'stg.app.dfx.swiss',
15
16
  loc: 'localhost',
16
17
  });
17
18
  /**
@@ -23,15 +24,17 @@ export const RP_IDS = Object.freeze({
23
24
  export const SIGN_MESSAGE_PREFIX = Object.freeze({
24
25
  prd: '',
25
26
  dev: '[dev]_',
27
+ stg: '[stg]_',
26
28
  loc: '[loc]_',
27
29
  });
28
30
  /**
29
31
  * Networks per environment, matching the chain list rule of the DFX API: PRD uses Bitcoin mainnet and EVM
30
- * mainnets only; DEV and LOC use Bitcoin testnet4 and EVM test chains only; Spark is mainnet everywhere.
32
+ * mainnets only; DEV, STG and LOC use Bitcoin testnet4 and EVM test chains only; Spark is mainnet everywhere.
31
33
  */
32
34
  export const WALLET_NETWORKS = Object.freeze({
33
35
  prd: Object.freeze({ bitcoin: 'mainnet', spark: 'mainnet', evm: 'mainnet' }),
34
36
  dev: Object.freeze({ bitcoin: 'testnet4', spark: 'mainnet', evm: 'testnet' }),
37
+ stg: Object.freeze({ bitcoin: 'testnet4', spark: 'mainnet', evm: 'testnet' }),
35
38
  loc: Object.freeze({ bitcoin: 'testnet4', spark: 'mainnet', evm: 'testnet' }),
36
39
  });
37
40
  //# sourceMappingURL=environment.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"environment.js","sourceRoot":"","sources":["../../src/config/environment.ts"],"names":[],"mappings":"AAMA,MAAM,CAAC,MAAM,WAAW,GAAyB,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE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AK,KAAK,QAAQ,IAAK,WAAiC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AACzF,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,MAAM,GAAwC,MAAM,CAAC,MAAM,CAAC;IACvE,GAAG,EAAE,eAAe;IACpB,GAAG,EAAE,mBAAmB;IACxB,GAAG,EAAE,mBAAmB;IACxB,GAAG,EAAE,WAAW;CACjB,CAAC,CAAC;AAEH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAwC,MAAM,CAAC,MAAM,CAAC;IACpF,GAAG,EAAE,EAAE;IACP,GAAG,EAAE,QAAQ;IACb,GAAG,EAAE,QAAQ;IACb,GAAG,EAAE,QAAQ;CACd,CAAC,CAAC;AAkBH;;;GAGG;AACH,MAAM,CAAC,MAAM,eAAe,GAA0D,MAAM,CAAC,MAAM,CAAC;IAClG,GAAG,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,SAAS,EAAE,CAAC;IAC5E,GAAG,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,SAAS,EAAE,CAAC;IAC7E,GAAG,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,SAAS,EAAE,CAAC;IAC7E,GAAG,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,SAAS,EAAE,CAAC;CAC9E,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@dfx.swiss/wallet",
4
- "version": "0.1.1-beta.0",
4
+ "version": "0.1.1-beta.1",
5
5
  "description": "Self-custodial passkey seed wallet core for the DFX.swiss app (Bitcoin, EVM, Spark)",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -28,7 +28,7 @@
28
28
  "pack": "npm pack"
29
29
  },
30
30
  "dependencies": {
31
- "@dfx.swiss/core": "^0.7.6-beta.0",
31
+ "@dfx.swiss/core": "^0.7.6-beta.1",
32
32
  "@noble/curves": "~1.9.1",
33
33
  "@noble/hashes": "~1.8.0",
34
34
  "@scure/base": "~1.2.5",
@@ -40,5 +40,6 @@
40
40
  "jest": "^29.7.0",
41
41
  "ts-jest": "^29.4.9",
42
42
  "typescript": "^5.7.0"
43
- }
43
+ },
44
+ "gitHead": "b7509bad0a076ece21bf2a68ba1a4e6711a9b8a5"
44
45
  }