@unifold/ui-react 0.1.51 → 0.1.52

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/dist/index.d.mts CHANGED
@@ -93,7 +93,8 @@ interface EthereumProvider {
93
93
  params?: unknown[];
94
94
  }): Promise<unknown>;
95
95
  on(event: string, callback: (...args: unknown[]) => void): void;
96
- removeListener(event: string, callback: (...args: unknown[]) => void): void;
96
+ off?(event: string, callback: (...args: unknown[]) => void): void;
97
+ removeListener?(event: string, callback: (...args: unknown[]) => void): void;
97
98
  }
98
99
 
99
100
  /** Quick amount chips on the browser wallet "Enter amount" step */
@@ -126,7 +127,8 @@ interface EvmWalletProvider {
126
127
  params?: unknown[];
127
128
  }): Promise<unknown>;
128
129
  on(event: string, callback: (...args: unknown[]) => void): void;
129
- removeListener(event: string, callback: (...args: unknown[]) => void): void;
130
+ off?(event: string, callback: (...args: unknown[]) => void): void;
131
+ removeListener?(event: string, callback: (...args: unknown[]) => void): void;
130
132
  }
131
133
 
132
134
  type DepositModalInitialScreen = "main" | "transfer" | "card" | "tracker";
package/dist/index.d.ts CHANGED
@@ -93,7 +93,8 @@ interface EthereumProvider {
93
93
  params?: unknown[];
94
94
  }): Promise<unknown>;
95
95
  on(event: string, callback: (...args: unknown[]) => void): void;
96
- removeListener(event: string, callback: (...args: unknown[]) => void): void;
96
+ off?(event: string, callback: (...args: unknown[]) => void): void;
97
+ removeListener?(event: string, callback: (...args: unknown[]) => void): void;
97
98
  }
98
99
 
99
100
  /** Quick amount chips on the browser wallet "Enter amount" step */
@@ -126,7 +127,8 @@ interface EvmWalletProvider {
126
127
  params?: unknown[];
127
128
  }): Promise<unknown>;
128
129
  on(event: string, callback: (...args: unknown[]) => void): void;
129
- removeListener(event: string, callback: (...args: unknown[]) => void): void;
130
+ off?(event: string, callback: (...args: unknown[]) => void): void;
131
+ removeListener?(event: string, callback: (...args: unknown[]) => void): void;
130
132
  }
131
133
 
132
134
  type DepositModalInitialScreen = "main" | "transfer" | "card" | "tracker";
package/dist/index.js CHANGED
@@ -6658,8 +6658,11 @@ function BrowserWalletButton({
6658
6658
  solanaProvider.off("accountChanged", handleAccountsChanged);
6659
6659
  }
6660
6660
  for (const provider of ethProviders) {
6661
- provider.removeListener("accountsChanged", handleEthAccountsChanged);
6662
- provider.removeListener("chainChanged", handleAccountsChanged);
6661
+ const off = provider.off?.bind(provider) ?? provider.removeListener?.bind(provider);
6662
+ if (off) {
6663
+ off("accountsChanged", handleEthAccountsChanged);
6664
+ off("chainChanged", handleAccountsChanged);
6665
+ }
6663
6666
  }
6664
6667
  };
6665
6668
  }, [chainType, eip6963ProviderCount]);
package/dist/index.mjs CHANGED
@@ -6586,8 +6586,11 @@ function BrowserWalletButton({
6586
6586
  solanaProvider.off("accountChanged", handleAccountsChanged);
6587
6587
  }
6588
6588
  for (const provider of ethProviders) {
6589
- provider.removeListener("accountsChanged", handleEthAccountsChanged);
6590
- provider.removeListener("chainChanged", handleAccountsChanged);
6589
+ const off = provider.off?.bind(provider) ?? provider.removeListener?.bind(provider);
6590
+ if (off) {
6591
+ off("accountsChanged", handleEthAccountsChanged);
6592
+ off("chainChanged", handleAccountsChanged);
6593
+ }
6591
6594
  }
6592
6595
  };
6593
6596
  }, [chainType, eip6963ProviderCount]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unifold/ui-react",
3
- "version": "0.1.51",
3
+ "version": "0.1.52",
4
4
  "description": "Unifold UI React - Deposit and onramp components for React applications",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -34,7 +34,7 @@
34
34
  "lucide-react": "^0.454.0",
35
35
  "qr-code-styling": "^1.6.0-rc.1",
36
36
  "tailwind-merge": "^2.0.0",
37
- "@unifold/core": "0.1.51"
37
+ "@unifold/core": "0.1.52"
38
38
  },
39
39
  "devDependencies": {
40
40
  "@solana/web3.js": "^1.87.0",