@monygroupcorp/micro-web3 1.3.1 → 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",
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wallet icons as inline SVG strings
|
|
3
|
+
* Monochrome outlined style - uses currentColor for easy theming
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export const walletIcons = {
|
|
7
|
+
metamask: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M12 20L7 16L4 4L10 10H14L20 4L17 16L12 20Z"/></svg>`,
|
|
8
|
+
|
|
9
|
+
rainbow: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><path d="M4 18A8 8 0 0 1 20 18"/><path d="M7 18A5 5 0 0 1 17 18"/><path d="M10 18A2 2 0 0 1 14 18"/></svg>`,
|
|
10
|
+
|
|
11
|
+
rabby: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><ellipse cx="12" cy="15" rx="6" ry="5"/><path d="M8 10C8 10 7 3 9 3C11 3 10 8 10 10"/><path d="M16 10C16 10 17 3 15 3C13 3 14 8 14 10"/></svg>`,
|
|
12
|
+
|
|
13
|
+
phantom: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M6 11C6 6.58 8.69 3 12 3C15.31 3 18 6.58 18 11V19C18 19 17 18 16 19C15 20 14 19 13 19C12 19 12 20 11 19C10 19 9 20 8 19C7 18 6 19 6 19V11Z"/></svg>`
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export default walletIcons;
|
|
@@ -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
|
)
|
package/src/index.js
CHANGED
|
@@ -6,6 +6,9 @@ import PriceService from './services/PriceService.js';
|
|
|
6
6
|
import * as IpfsService from './services/IpfsService.js';
|
|
7
7
|
import EventIndexer from './services/EventIndexer.js';
|
|
8
8
|
|
|
9
|
+
// Assets
|
|
10
|
+
import { walletIcons } from './assets/walletIcons.js';
|
|
11
|
+
|
|
9
12
|
// Storage adapters and settings
|
|
10
13
|
import { IndexedDBAdapter, MemoryAdapter, IndexerSettings } from './storage/index.js';
|
|
11
14
|
|
|
@@ -40,6 +43,9 @@ export {
|
|
|
40
43
|
MemoryAdapter,
|
|
41
44
|
IndexerSettings,
|
|
42
45
|
|
|
46
|
+
// Assets
|
|
47
|
+
walletIcons,
|
|
48
|
+
|
|
43
49
|
// UI Components
|
|
44
50
|
FloatingWalletButton,
|
|
45
51
|
WalletButton,
|