@megaeth-labs/wallet-sdk 0.1.22 → 0.1.23

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/README.md CHANGED
@@ -33,6 +33,8 @@
33
33
  - [Open Wallet UI](#open-wallet-ui)
34
34
  - [Deposit Funds](#deposit-funds)
35
35
  - [Event Handling](#event-handling)
36
+ - [Testing Locally](#testing-locally)
37
+ - [Publishing](#publishing)
36
38
 
37
39
  ## Install
38
40
 
@@ -454,4 +456,18 @@ mega.events.on('statusChange', ({ status, address }) => {
454
456
  // Stop listening
455
457
  const unsubscribe = mega.events.on('statusChange', handler);
456
458
  unsubscribe(); // Call to remove listener
457
- ```
459
+ ```
460
+
461
+ ## Testing Locally
462
+ - Link locally: `pnpm link`
463
+ - Run build with watch: `pnpm dev`
464
+ - In another project run: `pnpm link @megaeth-labs/wallet-sdk`
465
+ - Restart the other project dev server to ensure the link is working
466
+
467
+ **Caution:** A pnpm workspace file will be created in the other project. Make sure to remove this file and run `pnpm i` before committing otherwise CI will fail.
468
+
469
+ ## Publishing
470
+ - Create a PR
471
+ - Merge to `main`
472
+ - When ready, open GitHub and click Run Workflow on the `Publish to npm` job
473
+ https://github.com/megaeth-labs/wallet-sdk/actions/workflows/publish.yml
package/dist/index.cjs CHANGED
@@ -56,14 +56,17 @@ var WALLET_URL = "https://account.megaeth.com";
56
56
  var LOCAL_WALLET_URL = "http://localhost:4000";
57
57
  var LOCAL_HTTPS_WALLET_URL = "https://wallet.local:4000";
58
58
  var STAGING_WALLET_URL = "https://account-git-staging-mega-eth.vercel.app";
59
+ var SANDBOX_WALLET_URL = "https://account-sandbox.megaeth.com";
59
60
 
60
61
  // src/helpers.ts
61
62
  var getWalletUrl = (config) => {
62
63
  let origin = WALLET_URL;
63
- if (config.devMode) {
64
+ if (config.devLocal) {
64
65
  origin = config.devHTTPS ? LOCAL_HTTPS_WALLET_URL : LOCAL_WALLET_URL;
65
66
  } else if (config.staging) {
66
67
  origin = STAGING_WALLET_URL;
68
+ } else if (config.devMode) {
69
+ origin = SANDBOX_WALLET_URL;
67
70
  }
68
71
  const params = [
69
72
  `network=${config.network}`,
package/dist/index.d.cts CHANGED
@@ -7,6 +7,7 @@ interface Config {
7
7
  logging?: LogLevel;
8
8
  devMode?: boolean;
9
9
  devHTTPS?: boolean;
10
+ devLocal?: boolean;
10
11
  staging?: boolean;
11
12
  debug?: boolean;
12
13
  sponsorUrl?: string;
@@ -17,6 +18,7 @@ type ConnectionStatus = {
17
18
  status: 'connected' | 'disconnected' | 'cancelled';
18
19
  address?: `0x${string}`;
19
20
  network: Network;
21
+ megaName?: string;
20
22
  };
21
23
  interface TransferRequest {
22
24
  amount: string;
package/dist/index.d.ts CHANGED
@@ -7,6 +7,7 @@ interface Config {
7
7
  logging?: LogLevel;
8
8
  devMode?: boolean;
9
9
  devHTTPS?: boolean;
10
+ devLocal?: boolean;
10
11
  staging?: boolean;
11
12
  debug?: boolean;
12
13
  sponsorUrl?: string;
@@ -17,6 +18,7 @@ type ConnectionStatus = {
17
18
  status: 'connected' | 'disconnected' | 'cancelled';
18
19
  address?: `0x${string}`;
19
20
  network: Network;
21
+ megaName?: string;
20
22
  };
21
23
  interface TransferRequest {
22
24
  amount: string;
package/dist/index.js CHANGED
@@ -20,14 +20,17 @@ var WALLET_URL = "https://account.megaeth.com";
20
20
  var LOCAL_WALLET_URL = "http://localhost:4000";
21
21
  var LOCAL_HTTPS_WALLET_URL = "https://wallet.local:4000";
22
22
  var STAGING_WALLET_URL = "https://account-git-staging-mega-eth.vercel.app";
23
+ var SANDBOX_WALLET_URL = "https://account-sandbox.megaeth.com";
23
24
 
24
25
  // src/helpers.ts
25
26
  var getWalletUrl = (config) => {
26
27
  let origin = WALLET_URL;
27
- if (config.devMode) {
28
+ if (config.devLocal) {
28
29
  origin = config.devHTTPS ? LOCAL_HTTPS_WALLET_URL : LOCAL_WALLET_URL;
29
30
  } else if (config.staging) {
30
31
  origin = STAGING_WALLET_URL;
32
+ } else if (config.devMode) {
33
+ origin = SANDBOX_WALLET_URL;
31
34
  }
32
35
  const params = [
33
36
  `network=${config.network}`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@megaeth-labs/wallet-sdk",
3
- "version": "0.1.22",
3
+ "version": "0.1.23",
4
4
  "description": "MegaETH Wallet SDK for web applications",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -32,7 +32,7 @@
32
32
  "sideEffects": false,
33
33
  "publishConfig": {
34
34
  "registry": "https://registry.npmjs.org/",
35
- "access": "restricted"
35
+ "access": "public"
36
36
  },
37
37
  "dependencies": {
38
38
  "penpal": "7.0.6"