@monygroupcorp/micro-web3 1.3.2 → 1.3.3
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.
|
|
3
|
+
"version": "1.3.3",
|
|
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",
|
|
@@ -2,6 +2,7 @@ import { Component, h, render, eventBus } from '@monygroupcorp/microact';
|
|
|
2
2
|
import WalletModal from '../Wallet/WalletModal.js';
|
|
3
3
|
import { SettingsModal } from '../SettingsModal/SettingsModal.js';
|
|
4
4
|
import { ethers } from 'ethers';
|
|
5
|
+
import { walletIcons } from '../../assets/walletIcons.js';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* FloatingWalletButton component
|
|
@@ -224,7 +225,7 @@ export class FloatingWalletButton extends Component {
|
|
|
224
225
|
}
|
|
225
226
|
|
|
226
227
|
showWalletModal() {
|
|
227
|
-
// Get provider map
|
|
228
|
+
// Get provider map
|
|
228
229
|
const providerMap = {
|
|
229
230
|
rabby: () => window.ethereum?.isRabby ? window.ethereum : null,
|
|
230
231
|
rainbow: () => window.ethereum?.isRainbow ? window.ethereum : null,
|
|
@@ -232,13 +233,6 @@ export class FloatingWalletButton extends Component {
|
|
|
232
233
|
metamask: () => window.ethereum || null
|
|
233
234
|
};
|
|
234
235
|
|
|
235
|
-
const walletIcons = {
|
|
236
|
-
rabby: '/public/wallets/rabby.webp',
|
|
237
|
-
rainbow: '/public/wallets/rainbow.webp',
|
|
238
|
-
phantom: '/public/wallets/phantom.webp',
|
|
239
|
-
metamask: '/public/wallets/MetaMask.webp'
|
|
240
|
-
};
|
|
241
|
-
|
|
242
236
|
// Create WalletModal if not exists
|
|
243
237
|
if (!this.walletModal) {
|
|
244
238
|
if (!this.modalRoot) {
|
|
@@ -53,9 +53,9 @@ export class WalletModal extends Component {
|
|
|
53
53
|
'data-wallet': walletType,
|
|
54
54
|
onClick: () => this.handleWalletClick(walletType)
|
|
55
55
|
},
|
|
56
|
-
h('
|
|
57
|
-
|
|
58
|
-
|
|
56
|
+
h('span', {
|
|
57
|
+
className: 'wallet-icon',
|
|
58
|
+
ref: el => { if (el) el.innerHTML = this.props.walletIcons[walletType]; }
|
|
59
59
|
}),
|
|
60
60
|
h('span', null, walletType.charAt(0).toUpperCase() + walletType.slice(1))
|
|
61
61
|
)
|