@mictonode/widget 0.3.16 → 0.3.18
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/.github/FUNDING.yml +3 -3
- package/.github/workflows/npm-publish.yml +34 -34
- package/.prettierrc.json +9 -9
- package/.vscode/extensions.json +3 -3
- package/LICENSE +674 -674
- package/README.md +41 -41
- package/dist/{main-d0e5d1e4.js → main-bbea3e54.js} +155 -153
- package/dist/ping-widget.js +2 -2
- package/dist/ping-widget.umd.cjs +18 -18
- package/dist/{query.lcd-3d4d3495.js → query.lcd-88036522.js} +1 -1
- package/dist/{query.rpc.Query-b7807c29.js → query.rpc.Query-3a2b14f8.js} +1 -1
- package/dist/{tx.rpc.msg-59c3408a.js → tx.rpc.msg-39f0b824.js} +1 -1
- package/example/.vscode/extensions.json +3 -3
- package/example/README.md +7 -7
- package/example/index.html +12 -12
- package/example/package.json +19 -19
- package/example/pnpm-lock.yaml +465 -465
- package/example/public/cdn.html +19 -19
- package/example/src/App.vue +73 -73
- package/example/src/main.js +4 -4
- package/example/vite.config.js +7 -7
- package/index.html +12 -12
- package/lib/components/ConnectWallet/index.vue +262 -262
- package/lib/components/TokenConvert/index.vue +1033 -1033
- package/lib/components/TokenConvert/tokens.ts +36 -36
- package/lib/components/TxDialog/index.vue +422 -422
- package/lib/components/TxDialog/messages/Delegate.vue +174 -174
- package/lib/components/TxDialog/messages/Deposit.vue +96 -96
- package/lib/components/TxDialog/messages/Redelegate.vue +160 -160
- package/lib/components/TxDialog/messages/Send.vue +142 -142
- package/lib/components/TxDialog/messages/Transfer.vue +248 -248
- package/lib/components/TxDialog/messages/Unbond.vue +103 -103
- package/lib/components/TxDialog/messages/Vote.vue +62 -62
- package/lib/components/TxDialog/messages/Withdraw.vue +55 -55
- package/lib/components/TxDialog/messages/WithdrawCommission.vue +74 -74
- package/lib/components/TxDialog/wasm/ClearAdmin.vue +55 -55
- package/lib/components/TxDialog/wasm/ExecuteContract.vue +98 -98
- package/lib/components/TxDialog/wasm/InstantiateContract.vue +108 -108
- package/lib/components/TxDialog/wasm/MigrateContract.vue +76 -76
- package/lib/components/TxDialog/wasm/MigrateContract2.vue +76 -76
- package/lib/components/TxDialog/wasm/StoreCode.vue +100 -100
- package/lib/components/TxDialog/wasm/UpdateAdmin.vue +74 -74
- package/lib/main.css +591 -7
- package/lib/main.ts +24 -23
- package/lib/utils/TokenUnitConverter.ts +44 -44
- package/lib/utils/format.ts +16 -16
- package/lib/utils/http.ts +154 -154
- package/lib/utils/type.ts +56 -56
- package/lib/wallet/EthermintMessageAdapter.ts +135 -135
- package/lib/wallet/UniClient.ts +144 -144
- package/lib/wallet/Wallet.ts +142 -142
- package/lib/wallet/wallets/KeplerWallet.ts +141 -141
- package/lib/wallet/wallets/LeapWallet.ts +141 -141
- package/lib/wallet/wallets/LedgerWallet.ts +202 -202
- package/lib/wallet/wallets/MetamaskSnapWallet.ts +105 -105
- package/lib/wallet/wallets/MetamaskWallet.ts +173 -173
- package/lib/wallet/wallets/OKXWallet.ts +202 -202
- package/lib/wallet/wallets/UnisatWallet.ts +198 -198
- package/package.json +5 -6
- package/postcss.config.js +6 -6
- package/src/App.vue +225 -225
- package/src/main.ts +7 -4
- package/src/styles/design-system.css +184 -0
- package/src/vite-env.d.ts +1 -1
- package/tailwind.config.js +158 -34
- package/tsconfig.json +25 -25
- package/tsconfig.node.json +10 -10
- package/vite.config.ts +62 -62
- package/vue-shim.d.ts +6 -6
package/src/App.vue
CHANGED
|
@@ -1,225 +1,225 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { onMounted, ref } from 'vue';
|
|
3
|
-
import pingWidget from '../lib/main';
|
|
4
|
-
import { ethToEthermint, ethermintToEth } from '../lib/utils/format';
|
|
5
|
-
|
|
6
|
-
// const sender = 'evmos13zl7c4ea60jt05hxhl2dp443r7zrlz4plc5m8z';
|
|
7
|
-
// const endpoint = 'https://api-cosmoshub-ia.cosmosia.notional.ventures'// 'https://rest.stargaze-apis.com';
|
|
8
|
-
// const endpoint = 'https://api.uni.junonetwork.io'
|
|
9
|
-
|
|
10
|
-
interface Config {
|
|
11
|
-
sender: string,
|
|
12
|
-
endpoint: string;
|
|
13
|
-
chainId: string;
|
|
14
|
-
hdPath: string;
|
|
15
|
-
chainName: string
|
|
16
|
-
params: string
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
// @ts-ignore
|
|
20
|
-
const EVMOS: Config = {
|
|
21
|
-
sender: 'evmos1ayp22xk4nwc9lhjh6tvdat2j2klnvvk29yx87m',
|
|
22
|
-
endpoint: 'https://rest.bd.evmos.org:1317',
|
|
23
|
-
chainId: 'evmos_9001-2',
|
|
24
|
-
hdPath: "m/44'/60/0'/0/0",
|
|
25
|
-
chainName: 'evmos',
|
|
26
|
-
params: JSON.stringify({
|
|
27
|
-
proposal_id: '1',
|
|
28
|
-
validator_address: "evmosvaloper1tdss4m3x7jy9mlepm2dwy8820l7uv6m2vx6z88",
|
|
29
|
-
chain_name: 'evmos',
|
|
30
|
-
contract: 'add',
|
|
31
|
-
fees: { amount: '6000000000000000', denom: '', },
|
|
32
|
-
})
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
// @ts-ignore
|
|
36
|
-
const JUNO: Config = {
|
|
37
|
-
sender: 'juno1m8mma95ta2zajqtmfp5c5y3wgeyqzcrcgcnv4a',
|
|
38
|
-
endpoint: 'https://juno-api.polkachu.com',
|
|
39
|
-
chainId: 'juno-1',
|
|
40
|
-
hdPath: "m/44'/118/0'/0/0",
|
|
41
|
-
chainName: 'juno',
|
|
42
|
-
params: JSON.stringify({
|
|
43
|
-
proposal_id: '1',
|
|
44
|
-
validator_address: "junovaloper1jxv0u20scum4trha72c7ltfgfqef6nscm9pmg2",
|
|
45
|
-
chain_name: 'juno',
|
|
46
|
-
contract: 'junovaloper1jxv0u20scum4trha72c7ltfgfqef6nscm9pmg2',
|
|
47
|
-
fees: {amount: '2000', denom: ''}
|
|
48
|
-
})
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
// @ts-ignore
|
|
52
|
-
const NEUTRON: Config = {
|
|
53
|
-
sender: 'neutron1m8mma95ta2zajqtmfp5c5y3wgeyqzcrc64e4gx',
|
|
54
|
-
endpoint: 'https://neutron-api.polkachu.com',
|
|
55
|
-
chainId: 'neutron-1',
|
|
56
|
-
hdPath: "m/44'/118/0'/0/0",
|
|
57
|
-
chainName: 'neutron',
|
|
58
|
-
params: JSON.stringify({
|
|
59
|
-
chain_name: 'neutron',
|
|
60
|
-
contract: 'neutron198sxsrjvt2v2lln2ajn82ks76k97mj72mtgl7309jehd0vy8rezs7e6c56',
|
|
61
|
-
fees: {amount: '2000', denom: ''}
|
|
62
|
-
})
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
// @ts-ignore
|
|
66
|
-
const COSMOS: Config = {
|
|
67
|
-
sender: 'cosmos1jxv0u20scum4trha72c7ltfgfqef6nscj25050',
|
|
68
|
-
endpoint: 'https://rest.cosmos.directory/cosmoshub',
|
|
69
|
-
chainId: 'cosmoshub-4',
|
|
70
|
-
hdPath: "m/44'/118/0'/0/0",
|
|
71
|
-
chainName: 'cosmos',
|
|
72
|
-
params: JSON.stringify({
|
|
73
|
-
proposal_id: '1',
|
|
74
|
-
validator_address: "cosmosvaloper1jxv0u20scum4trha72c7ltfgfqef6nsch7q6cu",
|
|
75
|
-
chain_name: 'cosmos',
|
|
76
|
-
contract: 'junovaloper1jxv0u20scum4trha72c7ltfgfqef6nscm9pmg2',
|
|
77
|
-
fees: {amount: '6000', denom: ''}
|
|
78
|
-
})
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
// @ts-ignore
|
|
82
|
-
const Archway: Config = {
|
|
83
|
-
sender: 'archway1jtdje5vq42sknl22r4wu9sahryu5wcrd3yd7z8',
|
|
84
|
-
endpoint: 'https://api.constantine.archway.tech',
|
|
85
|
-
chainId: 'constantine-3',
|
|
86
|
-
hdPath: "m/44'/118/0'/0/0",
|
|
87
|
-
chainName: 'archway',
|
|
88
|
-
params: JSON.stringify({
|
|
89
|
-
chain_name: 'archway',
|
|
90
|
-
contract: 'archway1tc7k4683zqn8krm3vq7ed5jd4l23c2h9kyswc75zpc8aeln6smqsz79j44',
|
|
91
|
-
fees: {amount: '2000', denom: ''}
|
|
92
|
-
})
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
// @ts-ignore
|
|
96
|
-
const btc: Config = {
|
|
97
|
-
sender: 'bc1qjdyxk9t90jxmeqpdwkn8cd7nj6cu7x3m688xlj',
|
|
98
|
-
endpoint: 'https://devnet-2-rest.side.one',
|
|
99
|
-
chainId: 'taproot-1', // side-testnet-1
|
|
100
|
-
hdPath: "m/44'/118/0'/0/0",
|
|
101
|
-
chainName: 'S2-testnet-2',
|
|
102
|
-
params: JSON.stringify({
|
|
103
|
-
// wallet: ['okex', 'unisat']
|
|
104
|
-
// proposal_id: '1',
|
|
105
|
-
// validator_address: "evmosvaloper1tdss4m3x7jy9mlepm2dwy8820l7uv6m2vx6z88",
|
|
106
|
-
// chain_name: 'evmos',
|
|
107
|
-
// contract: 'add',
|
|
108
|
-
// fees: {amount: '6000000000000000', denom: ''}
|
|
109
|
-
})
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
const conf = ref(JUNO)
|
|
114
|
-
// const conf = ref(btc)
|
|
115
|
-
|
|
116
|
-
const types = [
|
|
117
|
-
'send',
|
|
118
|
-
'delegate',
|
|
119
|
-
'vote',
|
|
120
|
-
'redelegate',
|
|
121
|
-
'unbond',
|
|
122
|
-
'transfer',
|
|
123
|
-
'deposit',
|
|
124
|
-
'withdraw',
|
|
125
|
-
'withdraw_commission',
|
|
126
|
-
'wasm_instantiate_contract',
|
|
127
|
-
'wasm_execute_contract',
|
|
128
|
-
'wasm_store_code',
|
|
129
|
-
'wasm_migrate_contract',
|
|
130
|
-
'wasm_update_admin',
|
|
131
|
-
'wasm_clear_admin',
|
|
132
|
-
];
|
|
133
|
-
const toOpen = ref('send');
|
|
134
|
-
|
|
135
|
-
const theme = ref('light');
|
|
136
|
-
const switchTheme = () => {
|
|
137
|
-
if (theme.value === 'light') {
|
|
138
|
-
theme.value = 'dark';
|
|
139
|
-
document.documentElement.classList.add('dark');
|
|
140
|
-
} else {
|
|
141
|
-
theme.value = 'light';
|
|
142
|
-
document.documentElement.classList.remove('dark');
|
|
143
|
-
}
|
|
144
|
-
document.documentElement.setAttribute('data-theme', theme.value);
|
|
145
|
-
};
|
|
146
|
-
|
|
147
|
-
onMounted(() => {
|
|
148
|
-
document.documentElement.classList.add('light');
|
|
149
|
-
document.documentElement.setAttribute('data-theme', 'light');
|
|
150
|
-
});
|
|
151
|
-
const walletStateChange = (res: any) => {
|
|
152
|
-
console.log(res, 'resres');
|
|
153
|
-
};
|
|
154
|
-
|
|
155
|
-
console.log("0x88BFec573Dd3E4b7d2E6BfD4D0D6B11F843F8aa1")
|
|
156
|
-
console.log(ethToEthermint("0x88BFec573Dd3E4b7d2E6BfD4D0D6B11F843F8aa1", "evmos"))
|
|
157
|
-
console.log(ethermintToEth("evmos13zl7c4ea60jt05hxhl2dp443r7zrlz4plc5m8z"))
|
|
158
|
-
|
|
159
|
-
</script>
|
|
160
|
-
|
|
161
|
-
<template>
|
|
162
|
-
<div class="bg-gray-50 dark:bg-
|
|
163
|
-
Ping Widget Version: {{ pingWidget?.version }}
|
|
164
|
-
|
|
165
|
-
<div class="btn
|
|
166
|
-
Theme: {{ theme }}
|
|
167
|
-
</div>
|
|
168
|
-
|
|
169
|
-
<div> </div>
|
|
170
|
-
<ping-connect-wallet
|
|
171
|
-
:chain-id="conf.chainId"
|
|
172
|
-
:hd-path="conf.hdPath"
|
|
173
|
-
@change="walletStateChange"
|
|
174
|
-
/>
|
|
175
|
-
|
|
176
|
-
<textarea v-model="conf.params" cols="80" rows="5"></textarea>
|
|
177
|
-
<div></div>
|
|
178
|
-
|
|
179
|
-
<select v-model="toOpen">
|
|
180
|
-
<option v-for="i in types">{{ i }}</option>
|
|
181
|
-
</select>
|
|
182
|
-
|
|
183
|
-
<br />
|
|
184
|
-
|
|
185
|
-
<label :for="toOpen" class="btn
|
|
186
|
-
<ping-tx-dialog
|
|
187
|
-
:type="toOpen"
|
|
188
|
-
:sender="conf.sender"
|
|
189
|
-
:registry-name="conf.chainName"
|
|
190
|
-
:endpoint="conf.endpoint"
|
|
191
|
-
:hd-path="conf.hdPath"
|
|
192
|
-
:params="conf.params"
|
|
193
|
-
></ping-tx-dialog>
|
|
194
|
-
|
|
195
|
-
<br />
|
|
196
|
-
// example:<br />
|
|
197
|
-
<label for="withdraw" class="btn
|
|
198
|
-
<ping-tx-dialog
|
|
199
|
-
type="withdraw"
|
|
200
|
-
:sender="conf.sender"
|
|
201
|
-
:endpoint="conf.endpoint"
|
|
202
|
-
:hd-path="conf.hdPath"
|
|
203
|
-
:params="conf.params"
|
|
204
|
-
></ping-tx-dialog>
|
|
205
|
-
|
|
206
|
-
<label for="store_code" class="btn
|
|
207
|
-
<ping-tx-dialog
|
|
208
|
-
type="store_code"
|
|
209
|
-
:sender="conf.sender"
|
|
210
|
-
:endpoint="conf.endpoint"
|
|
211
|
-
:registry-name="conf.chainName"
|
|
212
|
-
:hd-path="conf.hdPath"
|
|
213
|
-
:params="conf.params"
|
|
214
|
-
></ping-tx-dialog>
|
|
215
|
-
|
|
216
|
-
<label for="PingTokenConvert" class="btn
|
|
217
|
-
<ping-token-convert
|
|
218
|
-
:chain-name="conf.chainName"
|
|
219
|
-
:endpoint="conf.endpoint"
|
|
220
|
-
hd-path="m/44'/118/0'/0/0"
|
|
221
|
-
></ping-token-convert>
|
|
222
|
-
</div>
|
|
223
|
-
</template>
|
|
224
|
-
|
|
225
|
-
<style scoped></style>
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { onMounted, ref } from 'vue';
|
|
3
|
+
import pingWidget from '../lib/main';
|
|
4
|
+
import { ethToEthermint, ethermintToEth } from '../lib/utils/format';
|
|
5
|
+
|
|
6
|
+
// const sender = 'evmos13zl7c4ea60jt05hxhl2dp443r7zrlz4plc5m8z';
|
|
7
|
+
// const endpoint = 'https://api-cosmoshub-ia.cosmosia.notional.ventures'// 'https://rest.stargaze-apis.com';
|
|
8
|
+
// const endpoint = 'https://api.uni.junonetwork.io'
|
|
9
|
+
|
|
10
|
+
interface Config {
|
|
11
|
+
sender: string,
|
|
12
|
+
endpoint: string;
|
|
13
|
+
chainId: string;
|
|
14
|
+
hdPath: string;
|
|
15
|
+
chainName: string
|
|
16
|
+
params: string
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// @ts-ignore
|
|
20
|
+
const EVMOS: Config = {
|
|
21
|
+
sender: 'evmos1ayp22xk4nwc9lhjh6tvdat2j2klnvvk29yx87m',
|
|
22
|
+
endpoint: 'https://rest.bd.evmos.org:1317',
|
|
23
|
+
chainId: 'evmos_9001-2',
|
|
24
|
+
hdPath: "m/44'/60/0'/0/0",
|
|
25
|
+
chainName: 'evmos',
|
|
26
|
+
params: JSON.stringify({
|
|
27
|
+
proposal_id: '1',
|
|
28
|
+
validator_address: "evmosvaloper1tdss4m3x7jy9mlepm2dwy8820l7uv6m2vx6z88",
|
|
29
|
+
chain_name: 'evmos',
|
|
30
|
+
contract: 'add',
|
|
31
|
+
fees: { amount: '6000000000000000', denom: '', },
|
|
32
|
+
})
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// @ts-ignore
|
|
36
|
+
const JUNO: Config = {
|
|
37
|
+
sender: 'juno1m8mma95ta2zajqtmfp5c5y3wgeyqzcrcgcnv4a',
|
|
38
|
+
endpoint: 'https://juno-api.polkachu.com',
|
|
39
|
+
chainId: 'juno-1',
|
|
40
|
+
hdPath: "m/44'/118/0'/0/0",
|
|
41
|
+
chainName: 'juno',
|
|
42
|
+
params: JSON.stringify({
|
|
43
|
+
proposal_id: '1',
|
|
44
|
+
validator_address: "junovaloper1jxv0u20scum4trha72c7ltfgfqef6nscm9pmg2",
|
|
45
|
+
chain_name: 'juno',
|
|
46
|
+
contract: 'junovaloper1jxv0u20scum4trha72c7ltfgfqef6nscm9pmg2',
|
|
47
|
+
fees: {amount: '2000', denom: ''}
|
|
48
|
+
})
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// @ts-ignore
|
|
52
|
+
const NEUTRON: Config = {
|
|
53
|
+
sender: 'neutron1m8mma95ta2zajqtmfp5c5y3wgeyqzcrc64e4gx',
|
|
54
|
+
endpoint: 'https://neutron-api.polkachu.com',
|
|
55
|
+
chainId: 'neutron-1',
|
|
56
|
+
hdPath: "m/44'/118/0'/0/0",
|
|
57
|
+
chainName: 'neutron',
|
|
58
|
+
params: JSON.stringify({
|
|
59
|
+
chain_name: 'neutron',
|
|
60
|
+
contract: 'neutron198sxsrjvt2v2lln2ajn82ks76k97mj72mtgl7309jehd0vy8rezs7e6c56',
|
|
61
|
+
fees: {amount: '2000', denom: ''}
|
|
62
|
+
})
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// @ts-ignore
|
|
66
|
+
const COSMOS: Config = {
|
|
67
|
+
sender: 'cosmos1jxv0u20scum4trha72c7ltfgfqef6nscj25050',
|
|
68
|
+
endpoint: 'https://rest.cosmos.directory/cosmoshub',
|
|
69
|
+
chainId: 'cosmoshub-4',
|
|
70
|
+
hdPath: "m/44'/118/0'/0/0",
|
|
71
|
+
chainName: 'cosmos',
|
|
72
|
+
params: JSON.stringify({
|
|
73
|
+
proposal_id: '1',
|
|
74
|
+
validator_address: "cosmosvaloper1jxv0u20scum4trha72c7ltfgfqef6nsch7q6cu",
|
|
75
|
+
chain_name: 'cosmos',
|
|
76
|
+
contract: 'junovaloper1jxv0u20scum4trha72c7ltfgfqef6nscm9pmg2',
|
|
77
|
+
fees: {amount: '6000', denom: ''}
|
|
78
|
+
})
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// @ts-ignore
|
|
82
|
+
const Archway: Config = {
|
|
83
|
+
sender: 'archway1jtdje5vq42sknl22r4wu9sahryu5wcrd3yd7z8',
|
|
84
|
+
endpoint: 'https://api.constantine.archway.tech',
|
|
85
|
+
chainId: 'constantine-3',
|
|
86
|
+
hdPath: "m/44'/118/0'/0/0",
|
|
87
|
+
chainName: 'archway',
|
|
88
|
+
params: JSON.stringify({
|
|
89
|
+
chain_name: 'archway',
|
|
90
|
+
contract: 'archway1tc7k4683zqn8krm3vq7ed5jd4l23c2h9kyswc75zpc8aeln6smqsz79j44',
|
|
91
|
+
fees: {amount: '2000', denom: ''}
|
|
92
|
+
})
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// @ts-ignore
|
|
96
|
+
const btc: Config = {
|
|
97
|
+
sender: 'bc1qjdyxk9t90jxmeqpdwkn8cd7nj6cu7x3m688xlj',
|
|
98
|
+
endpoint: 'https://devnet-2-rest.side.one',
|
|
99
|
+
chainId: 'taproot-1', // side-testnet-1
|
|
100
|
+
hdPath: "m/44'/118/0'/0/0",
|
|
101
|
+
chainName: 'S2-testnet-2',
|
|
102
|
+
params: JSON.stringify({
|
|
103
|
+
// wallet: ['okex', 'unisat']
|
|
104
|
+
// proposal_id: '1',
|
|
105
|
+
// validator_address: "evmosvaloper1tdss4m3x7jy9mlepm2dwy8820l7uv6m2vx6z88",
|
|
106
|
+
// chain_name: 'evmos',
|
|
107
|
+
// contract: 'add',
|
|
108
|
+
// fees: {amount: '6000000000000000', denom: ''}
|
|
109
|
+
})
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
const conf = ref(JUNO)
|
|
114
|
+
// const conf = ref(btc)
|
|
115
|
+
|
|
116
|
+
const types = [
|
|
117
|
+
'send',
|
|
118
|
+
'delegate',
|
|
119
|
+
'vote',
|
|
120
|
+
'redelegate',
|
|
121
|
+
'unbond',
|
|
122
|
+
'transfer',
|
|
123
|
+
'deposit',
|
|
124
|
+
'withdraw',
|
|
125
|
+
'withdraw_commission',
|
|
126
|
+
'wasm_instantiate_contract',
|
|
127
|
+
'wasm_execute_contract',
|
|
128
|
+
'wasm_store_code',
|
|
129
|
+
'wasm_migrate_contract',
|
|
130
|
+
'wasm_update_admin',
|
|
131
|
+
'wasm_clear_admin',
|
|
132
|
+
];
|
|
133
|
+
const toOpen = ref('send');
|
|
134
|
+
|
|
135
|
+
const theme = ref('light');
|
|
136
|
+
const switchTheme = () => {
|
|
137
|
+
if (theme.value === 'light') {
|
|
138
|
+
theme.value = 'dark';
|
|
139
|
+
document.documentElement.classList.add('dark');
|
|
140
|
+
} else {
|
|
141
|
+
theme.value = 'light';
|
|
142
|
+
document.documentElement.classList.remove('dark');
|
|
143
|
+
}
|
|
144
|
+
document.documentElement.setAttribute('data-theme', theme.value);
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
onMounted(() => {
|
|
148
|
+
document.documentElement.classList.add('light');
|
|
149
|
+
document.documentElement.setAttribute('data-theme', 'light');
|
|
150
|
+
});
|
|
151
|
+
const walletStateChange = (res: any) => {
|
|
152
|
+
console.log(res, 'resres');
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
console.log("0x88BFec573Dd3E4b7d2E6BfD4D0D6B11F843F8aa1")
|
|
156
|
+
console.log(ethToEthermint("0x88BFec573Dd3E4b7d2E6BfD4D0D6B11F843F8aa1", "evmos"))
|
|
157
|
+
console.log(ethermintToEth("evmos13zl7c4ea60jt05hxhl2dp443r7zrlz4plc5m8z"))
|
|
158
|
+
|
|
159
|
+
</script>
|
|
160
|
+
|
|
161
|
+
<template>
|
|
162
|
+
<div class="bg-gray-50 dark:bg-surface dark:text-white min-h-[100vh]">
|
|
163
|
+
Ping Widget Version: {{ pingWidget?.version }}
|
|
164
|
+
|
|
165
|
+
<div class="btn btn-primary btn-sm normal-case" @click="switchTheme()">
|
|
166
|
+
Theme: {{ theme }}
|
|
167
|
+
</div>
|
|
168
|
+
|
|
169
|
+
<div> </div>
|
|
170
|
+
<ping-connect-wallet
|
|
171
|
+
:chain-id="conf.chainId"
|
|
172
|
+
:hd-path="conf.hdPath"
|
|
173
|
+
@change="walletStateChange"
|
|
174
|
+
/>
|
|
175
|
+
|
|
176
|
+
<textarea v-model="conf.params" cols="80" rows="5"></textarea>
|
|
177
|
+
<div></div>
|
|
178
|
+
|
|
179
|
+
<select v-model="toOpen">
|
|
180
|
+
<option v-for="i in types">{{ i }}</option>
|
|
181
|
+
</select>
|
|
182
|
+
|
|
183
|
+
<br />
|
|
184
|
+
|
|
185
|
+
<label :for="toOpen" class="btn btn-primary dark:text-white">{{ toOpen }}</label>
|
|
186
|
+
<ping-tx-dialog
|
|
187
|
+
:type="toOpen"
|
|
188
|
+
:sender="conf.sender"
|
|
189
|
+
:registry-name="conf.chainName"
|
|
190
|
+
:endpoint="conf.endpoint"
|
|
191
|
+
:hd-path="conf.hdPath"
|
|
192
|
+
:params="conf.params"
|
|
193
|
+
></ping-tx-dialog>
|
|
194
|
+
|
|
195
|
+
<br />
|
|
196
|
+
// example:<br />
|
|
197
|
+
<label for="withdraw" class="btn btn-primary dark:text-white">Withdraw</label>
|
|
198
|
+
<ping-tx-dialog
|
|
199
|
+
type="withdraw"
|
|
200
|
+
:sender="conf.sender"
|
|
201
|
+
:endpoint="conf.endpoint"
|
|
202
|
+
:hd-path="conf.hdPath"
|
|
203
|
+
:params="conf.params"
|
|
204
|
+
></ping-tx-dialog>
|
|
205
|
+
|
|
206
|
+
<label for="store_code" class="btn btn-primary dark:text-white">Store Code</label>
|
|
207
|
+
<ping-tx-dialog
|
|
208
|
+
type="store_code"
|
|
209
|
+
:sender="conf.sender"
|
|
210
|
+
:endpoint="conf.endpoint"
|
|
211
|
+
:registry-name="conf.chainName"
|
|
212
|
+
:hd-path="conf.hdPath"
|
|
213
|
+
:params="conf.params"
|
|
214
|
+
></ping-tx-dialog>
|
|
215
|
+
|
|
216
|
+
<label for="PingTokenConvert" class="btn btn-primary dark:text-white">Token Convert</label>
|
|
217
|
+
<ping-token-convert
|
|
218
|
+
:chain-name="conf.chainName"
|
|
219
|
+
:endpoint="conf.endpoint"
|
|
220
|
+
hd-path="m/44'/118/0'/0/0"
|
|
221
|
+
></ping-token-convert>
|
|
222
|
+
</div>
|
|
223
|
+
</template>
|
|
224
|
+
|
|
225
|
+
<style scoped></style>
|
package/src/main.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import { createApp } from 'vue'
|
|
2
|
-
import App from './App.vue'
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { createApp } from 'vue'
|
|
2
|
+
import App from './App.vue'
|
|
3
|
+
|
|
4
|
+
// Import MictoNode Design System (aligned with Explorer Phase 7)
|
|
5
|
+
import './styles/design-system.css'
|
|
6
|
+
|
|
7
|
+
createApp(App).mount('#app')
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MictoNode Widget Design System
|
|
3
|
+
* Aligned with Explorer Design System (Phase 7)
|
|
4
|
+
*
|
|
5
|
+
* Theme: "The Data Cathedral" - Premium Blockchain Explorer
|
|
6
|
+
*
|
|
7
|
+
* Color Philosophy:
|
|
8
|
+
* - LCH (Lightness, Chroma, Hue) for perceptual uniformity
|
|
9
|
+
* - 60-30-10 Rule: 60% neutral, 30% brand, 10% accent
|
|
10
|
+
* - Protected Palette: #0066ff (primary), #0f1419 (dark base)
|
|
11
|
+
*
|
|
12
|
+
* Token Structure:
|
|
13
|
+
* - Semantic naming (not color names)
|
|
14
|
+
* - Scale-based variants (50-950)
|
|
15
|
+
* - LCH values for precise color manipulation
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
:root {
|
|
19
|
+
/* ==========================================================================
|
|
20
|
+
LCH COLOR TOKENS
|
|
21
|
+
========================================================================== */
|
|
22
|
+
|
|
23
|
+
/* Primary Scale - Deep Blue (#0066ff base) */
|
|
24
|
+
--color-primary-50: lch(95% 15% 250deg);
|
|
25
|
+
--color-primary-100: lch(90% 20% 250deg);
|
|
26
|
+
--color-primary-200: lch(82% 30% 250deg);
|
|
27
|
+
--color-primary-300: lch(72% 45% 250deg);
|
|
28
|
+
--color-primary-400: lch(60% 60% 250deg);
|
|
29
|
+
--color-primary-500: lch(52% 70% 250deg); /* #0066ff equivalent */
|
|
30
|
+
--color-primary-600: lch(48% 75% 250deg);
|
|
31
|
+
--color-primary-700: lch(42% 70% 250deg);
|
|
32
|
+
--color-primary-800: lch(35% 60% 250deg);
|
|
33
|
+
--color-primary-900: lch(28% 50% 250deg);
|
|
34
|
+
--color-primary-950: lch(20% 35% 250deg);
|
|
35
|
+
|
|
36
|
+
/* Accent Scale - Teal/Cyan for modern feel */
|
|
37
|
+
--color-accent-50: lch(96% 10% 190deg);
|
|
38
|
+
--color-accent-100: lch(92% 15% 190deg);
|
|
39
|
+
--color-accent-200: lch(85% 25% 190deg);
|
|
40
|
+
--color-accent-300: lch(78% 40% 190deg);
|
|
41
|
+
--color-accent-400: lch(70% 55% 190deg);
|
|
42
|
+
--color-accent-500: lch(65% 65% 190deg);
|
|
43
|
+
--color-accent-600: lch(60% 70% 190deg);
|
|
44
|
+
--color-accent-700: lch(52% 65% 190deg);
|
|
45
|
+
--color-accent-800: lch(45% 55% 190deg);
|
|
46
|
+
--color-accent-900: lch(38% 45% 190deg);
|
|
47
|
+
--color-accent-950: lch(28% 30% 190deg);
|
|
48
|
+
|
|
49
|
+
/* Neutral Scale - Cool greys for "Data Cathedral" mood */
|
|
50
|
+
--color-neutral-50: lch(98% 2% 250deg);
|
|
51
|
+
--color-neutral-100: lch(95% 3% 250deg);
|
|
52
|
+
--color-neutral-200: lch(90% 4% 250deg);
|
|
53
|
+
--color-neutral-300: lch(80% 5% 250deg);
|
|
54
|
+
--color-neutral-400: lch(65% 6% 250deg);
|
|
55
|
+
--color-neutral-500: lch(50% 8% 250deg);
|
|
56
|
+
--color-neutral-600: lch(40% 10% 250deg);
|
|
57
|
+
--color-neutral-700: lch(30% 12% 250deg);
|
|
58
|
+
--color-neutral-800: lch(20% 10% 250deg);
|
|
59
|
+
--color-neutral-900: lch(12% 6% 250deg);
|
|
60
|
+
--color-neutral-950: lch(5% 2.4 256deg); /* Exact #0f1419 */
|
|
61
|
+
|
|
62
|
+
/* Semantic Colors */
|
|
63
|
+
--color-success: lch(65% 55% 145deg); /* #3fb68b equivalent */
|
|
64
|
+
--color-warning: lch(75% 60% 45deg); /* #f59e0b equivalent */
|
|
65
|
+
--color-error: lch(60% 65% 25deg); /* #ff5353 equivalent */
|
|
66
|
+
--color-info: lch(60% 70% 250deg); /* #0066ff equivalent */
|
|
67
|
+
|
|
68
|
+
/* ==========================================================================
|
|
69
|
+
SEMANTIC ALIAS TOKENS
|
|
70
|
+
Purpose-driven names that resolve to scale tokens above.
|
|
71
|
+
Use these in components for intent, not color.
|
|
72
|
+
========================================================================== */
|
|
73
|
+
|
|
74
|
+
/* Text */
|
|
75
|
+
--color-text-brand: var(--color-primary-500);
|
|
76
|
+
--color-text-muted: var(--color-neutral-400);
|
|
77
|
+
|
|
78
|
+
/* Surface (backgrounds) */
|
|
79
|
+
--color-surface: var(--color-neutral-50); /* Light mode main bg */
|
|
80
|
+
--color-surface-raised: var(--color-neutral-100); /* Card/panel bg */
|
|
81
|
+
--color-surface-overlay: var(--color-neutral-200); /* Modal/dropdown bg */
|
|
82
|
+
|
|
83
|
+
/* Borders */
|
|
84
|
+
--color-border-subtle: var(--color-neutral-200);
|
|
85
|
+
--color-border-default: var(--color-neutral-300);
|
|
86
|
+
|
|
87
|
+
/* Interactive */
|
|
88
|
+
--color-interactive: var(--color-primary-500);
|
|
89
|
+
--color-interactive-hover: var(--color-primary-600);
|
|
90
|
+
|
|
91
|
+
/* ==========================================================================
|
|
92
|
+
SPACING TOKENS (8-Point Grid)
|
|
93
|
+
========================================================================== */
|
|
94
|
+
--space-0: 0;
|
|
95
|
+
--space-1: 0.25rem; /* 4px */
|
|
96
|
+
--space-2: 0.5rem; /* 8px */
|
|
97
|
+
--space-3: 0.75rem; /* 12px */
|
|
98
|
+
--space-4: 1rem; /* 16px */
|
|
99
|
+
--space-5: 1.25rem; /* 20px */
|
|
100
|
+
--space-6: 1.5rem; /* 24px */
|
|
101
|
+
--space-8: 2rem; /* 32px */
|
|
102
|
+
--space-10: 2.5rem; /* 40px */
|
|
103
|
+
--space-12: 3rem; /* 48px */
|
|
104
|
+
--space-16: 4rem; /* 64px */
|
|
105
|
+
--space-20: 5rem; /* 80px */
|
|
106
|
+
--space-24: 6rem; /* 96px */
|
|
107
|
+
|
|
108
|
+
/* ==========================================================================
|
|
109
|
+
RADIUS TOKENS
|
|
110
|
+
========================================================================== */
|
|
111
|
+
--radius-none: 0;
|
|
112
|
+
--radius-sm: 0.25rem; /* 4px */
|
|
113
|
+
--radius-md: 0.5rem; /* 8px */
|
|
114
|
+
--radius-lg: 0.75rem; /* 12px */
|
|
115
|
+
--radius-xl: 1rem; /* 16px */
|
|
116
|
+
--radius-2xl: 1.5rem; /* 24px */
|
|
117
|
+
--radius-full: 9999px;
|
|
118
|
+
|
|
119
|
+
/* ==========================================================================
|
|
120
|
+
SHADOW TOKENS (Multi-layer for depth)
|
|
121
|
+
========================================================================== */
|
|
122
|
+
--shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
|
|
123
|
+
--shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07), 0 1px 3px rgba(0, 0, 0, 0.06);
|
|
124
|
+
--shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
|
|
125
|
+
--shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15), 0 8px 10px rgba(0, 0, 0, 0.1);
|
|
126
|
+
--shadow-2xl: 0 25px 50px rgba(0, 0, 0, 0.25);
|
|
127
|
+
--shadow-inner: inset 0 2px 4px rgba(0, 0, 0, 0.06);
|
|
128
|
+
--shadow-glow-primary: 0 0 20px lch(52% 70% 250deg / 0.3);
|
|
129
|
+
--shadow-glow-accent: 0 0 20px lch(65% 65% 190deg / 0.3);
|
|
130
|
+
|
|
131
|
+
/* ==========================================================================
|
|
132
|
+
Z-INDEX LAYERS
|
|
133
|
+
========================================================================== */
|
|
134
|
+
--z-base: 0;
|
|
135
|
+
--z-above: 10;
|
|
136
|
+
--z-dropdown: 100;
|
|
137
|
+
--z-sticky: 200;
|
|
138
|
+
--z-fixed: 300;
|
|
139
|
+
--z-modal-backdrop: 400;
|
|
140
|
+
--z-modal: 500;
|
|
141
|
+
--z-popover: 600;
|
|
142
|
+
--z-tooltip: 700;
|
|
143
|
+
|
|
144
|
+
/* ==========================================================================
|
|
145
|
+
TRANSITION TOKENS
|
|
146
|
+
========================================================================== */
|
|
147
|
+
--duration-fast: 150ms;
|
|
148
|
+
--duration-base: 200ms;
|
|
149
|
+
--duration-slow: 300ms;
|
|
150
|
+
--duration-slower: 500ms;
|
|
151
|
+
|
|
152
|
+
--ease-default: cubic-bezier(0.4, 0, 0.2, 1);
|
|
153
|
+
--ease-in: cubic-bezier(0.4, 0, 1, 1);
|
|
154
|
+
--ease-out: cubic-bezier(0, 0, 0.2, 1);
|
|
155
|
+
--ease-in-out: cubic-bezier(0.4, 0, 0.6, 1);
|
|
156
|
+
--ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1); /* Physics-based bounce */
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/* Dark Mode Overrides */
|
|
160
|
+
@media (prefers-color-scheme: dark) {
|
|
161
|
+
:root {
|
|
162
|
+
/* Adjust luminance for dark mode while preserving hue/chroma */
|
|
163
|
+
--color-primary-500: lch(60% 70% 250deg); /* Brighter for contrast */
|
|
164
|
+
--color-accent-500: lch(70% 65% 190deg);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/* Manual dark mode class support */
|
|
169
|
+
html.dark,
|
|
170
|
+
html[data-theme='dark'] {
|
|
171
|
+
--color-primary-500: lch(60% 70% 250deg);
|
|
172
|
+
--color-accent-500: lch(70% 65% 190deg);
|
|
173
|
+
|
|
174
|
+
/* Semantic alias dark overrides */
|
|
175
|
+
--color-text-brand: var(--color-primary-400); /* WCAG AA */
|
|
176
|
+
--color-text-muted: var(--color-neutral-400);
|
|
177
|
+
--color-surface: var(--color-neutral-950); /* #0f1419 */
|
|
178
|
+
--color-surface-raised: var(--color-neutral-900); /* Card bg */
|
|
179
|
+
--color-surface-overlay: var(--color-neutral-800); /* Modal bg */
|
|
180
|
+
--color-border-subtle: var(--color-neutral-800);
|
|
181
|
+
--color-border-default: var(--color-neutral-700);
|
|
182
|
+
--color-interactive: var(--color-primary-500);
|
|
183
|
+
--color-interactive-hover: var(--color-primary-400);
|
|
184
|
+
}
|
package/src/vite-env.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
/// <reference types="vite/client" />
|
|
1
|
+
/// <reference types="vite/client" />
|