@monygroupcorp/micro-web3 1.3.4 → 1.3.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@monygroupcorp/micro-web3",
3
- "version": "1.3.4",
3
+ "version": "1.3.6",
4
4
  "description": "A lean, reusable Web3 toolkit with components for wallet connection, IPFS, and common Web3 UI patterns.",
5
5
  "main": "dist/micro-web3.cjs",
6
6
  "module": "dist/micro-web3.esm.js",
@@ -1,6 +1,7 @@
1
1
  import { Component, h, render } from '@monygroupcorp/microact';
2
2
  import { FloatingWalletButton } from '../FloatingWalletButton/FloatingWalletButton.js';
3
3
  import WalletModal from '../Wallet/WalletModal.js';
4
+ import { walletIcons } from '../../assets/walletIcons.js';
4
5
 
5
6
  class WalletButtonModal extends WalletModal {
6
7
  handleWalletOptionClick(walletType) {
@@ -39,9 +40,9 @@ class WalletButtonModal extends WalletModal {
39
40
  className: 'wallet-option',
40
41
  onClick: () => this.handleWalletOptionClick(walletType)
41
42
  },
42
- h('img', {
43
- src: this.props.walletIcons[walletType],
44
- alt: walletType
43
+ h('span', {
44
+ className: 'wallet-icon',
45
+ ref: el => { if (el) el.innerHTML = this.props.walletIcons[walletType]; }
45
46
  }),
46
47
  h('span', null, walletType.charAt(0).toUpperCase() + walletType.slice(1))
47
48
  )
@@ -69,14 +70,7 @@ export class WalletButton extends FloatingWalletButton {
69
70
  metamask: () => window.ethereum || null,
70
71
  };
71
72
 
72
- const walletIcons =
73
- this.walletService?.walletIcons ||
74
- {
75
- rabby: '/public/wallets/rabby.webp',
76
- rainbow: '/public/wallets/rainbow.webp',
77
- phantom: '/public/wallets/phantom.webp',
78
- metamask: '/public/wallets/MetaMask.webp',
79
- };
73
+ const icons = this.walletService?.walletIcons || walletIcons;
80
74
 
81
75
  if (!this.walletModal) {
82
76
  if (!this.modalRoot) {
@@ -86,7 +80,7 @@ export class WalletButton extends FloatingWalletButton {
86
80
 
87
81
  render(h(WalletButtonModal, {
88
82
  providerMap,
89
- walletIcons,
83
+ walletIcons: icons,
90
84
  onWalletSelected: async (walletType) => {
91
85
  await this.handleWalletSelection(walletType);
92
86
  },
@@ -1,4 +1,5 @@
1
1
  import { ethers } from 'ethers';
2
+ import { walletIcons } from '../assets/walletIcons.js';
2
3
 
3
4
  /**
4
5
  * WalletService - Handles wallet connection, detection, and interactions
@@ -44,13 +45,8 @@ class WalletService {
44
45
  }
45
46
  };
46
47
 
47
- // Wallet icons mapping
48
- this.walletIcons = {
49
- rabby: '/public/wallets/rabby.webp',
50
- rainbow: '/public/wallets/rainbow.webp',
51
- phantom: '/public/wallets/phantom.webp',
52
- metamask: '/public/wallets/MetaMask.webp',
53
- };
48
+ // Wallet icons mapping (inline SVGs)
49
+ this.walletIcons = walletIcons;
54
50
 
55
51
  // We'll set up event listeners after a wallet is selected, not in constructor
56
52
  }