-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwallet-assets.html
More file actions
145 lines (134 loc) · 4.43 KB
/
wallet-assets.html
File metadata and controls
145 lines (134 loc) · 4.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Rayls Network | Wallet Setup</title>
<style>
body {
font-family: system-ui, -apple-system, sans-serif;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
min-height: 100vh;
margin: 0;
background-color: #121212;
color: #ffffff;
}
.container {
text-align: center;
padding: 40px;
background-color: #1e1e1e;
border-radius: 12px;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
max-width: 450px;
width: 90%;
}
.logo-header { margin-bottom: 20px; }
p { color: #a0a0a0; line-height: 1.5; margin-bottom: 25px; font-size: 14px; }
.btn-main {
background-color: #ffffff;
color: #000000;
border: none;
padding: 16px 24px;
border-radius: 8px;
cursor: pointer;
font-size: 16px;
font-weight: 700;
width: 100%;
display: flex;
align-items: center;
justify-content: center;
gap: 12px;
transition: opacity 0.2s;
}
.btn-main:hover { opacity: 0.9; }
.add-token-btn {
background-color: #2a2a2a;
color: white;
border: 1px solid #444;
padding: 12px 20px;
border-radius: 8px;
cursor: pointer;
font-size: 15px;
font-weight: 600;
display: flex;
align-items: center;
gap: 12px;
width: 100%;
justify-content: center;
transition: border-color 0.2s;
}
.add-token-btn:hover { border-color: #F6851B; }
.btn-icon { width: 24px; height: 24px; border-radius: 50%; object-fit: contain; }
.divider { height: 1px; background: #333; margin: 30px 0; }
h3 { font-size: 16px; margin-bottom: 15px; color: #eee; }
</style>
</head>
<body>
<div class="container">
<div class="logo-header">
<img src="https://raylsnetwork.github.io/brand-assets/rls-icon.svg" width="60" alt="Rayls">
</div>
<h2>Rayls Network Setup</h2>
<p>Connect to the Rayls Mainnet. USDr is the native gas token and will appear in your assets automatically once connected.</p>
<button class="btn-main" onclick="addNetwork()">
<img src="https://raylsnetwork.github.io/brand-assets/USDr3.svg" class="btn-icon" alt="USDr">
Connect to Rayls Mainnet
</button>
<div class="divider"></div>
<h3>Network Assets</h3>
<button class="add-token-btn" onclick="addToken('0x07e17E17e17E17e17e17e17E17E17E17E17e17EA', 'RLS', 18, 'https://raylsnetwork.github.io/brand-assets/rls-icon.svg')">
<img src="https://raylsnetwork.github.io/brand-assets/rls-icon.svg" class="btn-icon">
Add $RLS Token
</button>
</div>
<script>
async function addNetwork() {
if (window.ethereum) {
try {
await window.ethereum.request({
method: 'wallet_addEthereumChain',
params: [{
chainId: '0x11cfd',
chainName: 'Rayls Mainnet',
nativeCurrency: {
name: 'USDr',
symbol: 'USDr',
decimals: 18
},
rpcUrls: ['https://mainnet-rpc.rayls.com/'],
blockExplorerUrls: ['https://mainnet-explorer.rayls.com/'],
/* Providing the USDr logo here is the best way to get
MetaMask to associate the icon with the native token.
*/
iconUrls: ['https://raylsnetwork.github.io/brand-assets/USDr3.svg']
}]
});
alert('Rayls Mainnet added!');
} catch (error) {
alert('Error: ' + error.message);
}
} else {
alert('MetaMask is not installed.');
}
}
async function addToken(address, symbol, decimals, image) {
if (window.ethereum) {
try {
await window.ethereum.request({
method: 'wallet_watchAsset',
params: {
type: 'ERC20',
options: { address, symbol, decimals, image }
}
});
} catch (error) {
alert('Error: ' + error.message);
}
}
}
</script>
</body>
</html>