Skip to content
This repository was archived by the owner on Dec 16, 2025. It is now read-only.
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .runtimeconfig.json

This file was deleted.

60 changes: 30 additions & 30 deletions chains/mainnet/bouncebit.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
{
"chain_name": "bouncebit",
"coingecko": "bouncebit",
"api":["https://us-central1-omakase-explorer.cloudfunctions.net/proxyToSentryBBApi"],
"rpc": ["https://us-central1-omakase-explorer.cloudfunctions.net/proxyToSentryBBRpc"],
"snapshot_provider": "",
"coin_type": 60,
"sdk_version": "0.46.10",
"addr_prefix": "bb",
"logo": "/logos/bouncebitRound.png",
"min_tx_fee": "4000000000000000",
"keplr_features": [
"ibc-transfer",
"ibc-go",
"eth-address-gen",
"eth-key-sign"
],
"assets": [
{
"base": "bit",
"symbol": "BB",
"exponent": 18,
"coingecko_id": "bouncebit",
"logo": "/logos/bouncebitRound.png",
"gasPriceStep": {
"average": 0.025,
"high": 0.03,
"low": 0.01
}
"chain_name": "bouncebit",
"coingecko": "bouncebit",
"api":["https://us-central1-omakase-explorer.cloudfunctions.net/proxyToSentryBBApi"],
"rpc": ["https://us-central1-omakase-explorer.cloudfunctions.net/proxyToSentryBBRpc"],
"snapshot_provider": "",
"coin_type": 60,
"sdk_version": "0.46.10",
"addr_prefix": "bb",
"logo": "/logos/bouncebitRound.png",
"min_tx_fee": "4000000000000000",
"keplr_features": [
"ibc-transfer",
"ibc-go",
"eth-address-gen",
"eth-key-sign"
],
"assets": [
{
"base": "bit",
"symbol": "BB",
"exponent": 18,
"coingecko_id": "bouncebit",
"logo": "/logos/bouncebitRound.png",
"gasPriceStep": {
"average": 0.025,
"high": 0.03,
"low": 0.01
}
]
}
}
]
}
60 changes: 30 additions & 30 deletions chains/mainnet/lava.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
{
"chain_name": "lava",
"coingecko": "lava",
"api":["https://us-central1-omakase-explorer.cloudfunctions.net/proxyToSentrylavaApi"],
"rpc": ["https://us-central1-omakase-explorer.cloudfunctions.net/proxyToSentrylavaRpc"],
"snapshot_provider": "",
"coin_type": 60,
"sdk_version": "0.46.10",
"addr_prefix": "lava",
"logo": "/logos/lavaRound.png",
"min_tx_fee": "4000000000000000",
"keplr_features": [
"ibc-transfer",
"ibc-go",
"eth-address-gen",
"eth-key-sign"
],
"assets": [
{
"base": "ulava",
"symbol": "LAVA",
"exponent": 6,
"coingecko_id": "lava-network",
"logo": "/logos/lavaRound.png",
"gasPriceStep": {
"average": 0.025,
"high": 0.03,
"low": 0.01
}
"chain_name": "lava",
"coingecko": "lava",
"api":["https://us-central1-omakase-explorer.cloudfunctions.net/proxyToSentrylavaApi"],
"rpc": ["https://us-central1-omakase-explorer.cloudfunctions.net/proxyToSentrylavaRpc"],
"snapshot_provider": "",
"coin_type": 60,
"sdk_version": "0.46.10",
"addr_prefix": "lava",
"logo": "/logos/lavaRound.png",
"min_tx_fee": "4000000000000000",
"keplr_features": [
"ibc-transfer",
"ibc-go",
"eth-address-gen",
"eth-key-sign"
],
"assets": [
{
"base": "ulava",
"symbol": "LAVA",
"exponent": 6,
"coingecko_id": "lava-network",
"logo": "/logos/lavaRound.png",
"gasPriceStep": {
"average": 0.025,
"high": 0.03,
"low": 0.01
}
]
}
}
]
}
2 changes: 1 addition & 1 deletion functions/common/createApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ function createApp(sentryUrlBase) {
return app;
}

module.exports = createApp;
module.exports = createApp;
8 changes: 2 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"md-editor-v3": "^2.8.1",
"numeral": "^2.0.6",
"osmojs": "^14.0.0-rc.0",
"ping-widget": "0xmakase/widget#dev",
"pinia": "^2.0.28",
"postcss": "^8.4.23",
"qrcode": "^1.5.3",
Expand All @@ -63,13 +64,8 @@
"@types/semver": "7.5.0",
"@vitejs/plugin-vue": "^4.0.0",
"@vue/tsconfig": "^0.1.3",
"eslint": "8.23.0",
"eslint-config-google": "^0.14.0",
"eslint-define-config": "1.3.0",
"eslint-plugin-prettier": "4.2.1",
"eslint-plugin-vue": "9.9.0",
"npm-run-all": "^4.1.5",
"prettier": "2.8.0",
"prettier": "^2.7.1",
"sass": "^1.58.0",
"shiki": "^1.0.0-beta.0",
"typescript": "~4.9.5",
Expand Down
57 changes: 44 additions & 13 deletions src/layouts/components/NavBarWallet.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
import { useBaseStore, useBlockchain, useWalletStore } from '@/stores';
import { Icon } from '@iconify/vue';
import { ref, computed } from 'vue';
// @ts-ignore NOTE: ここでimportが正しいのか要検討
import pingWidget from 'ping-widget/dist/ping-widget.js';

const walletStore = useWalletStore();
const chainStore = useBlockchain();
Expand Down Expand Up @@ -36,35 +38,60 @@ const tipMsg = computed(() => {

<template>
<div class="dropdown dropdown-hover dropdown-end">
<label tabindex="0" class="btn btn-sm btn-primary m-1 lowercase truncate !inline-flex text-xs md:!text-sm">
<label
tabindex="0"
class="btn btn-sm btn-primary m-1 lowercase truncate !inline-flex text-xs md:!text-sm"
>
<Icon icon="mdi:wallet" />
<span class="ml-1 hidden md:block">
{{ walletStore.shortAddress || 'Wallet' }}</span>
{{ walletStore.shortAddress || 'Wallet' }}</span
>
</label>
<div tabindex="0" class="dropdown-content menu shadow p-2 bg-base-100 rounded w-52 md:!w-64 overflow-auto">
<label v-if="!walletStore?.currentAddress" for="PingConnectWallet" class="btn btn-sm btn-primary">
<div
tabindex="0"
class="dropdown-content menu shadow p-2 bg-base-100 rounded w-52 md:!w-64 overflow-auto"
>
<label
v-if="!walletStore?.currentAddress"
for="PingConnectWallet"
class="btn btn-sm btn-primary"
>
<Icon icon="mdi:wallet" /><span class="ml-1 block">Connect Wallet</span>
</label>
<div class="px-2 mb-1 text-gray-500 dark:text-gray-400 font-semibold">
{{ walletStore.connectedWallet?.wallet }}
</div>
<div>
<a v-if="walletStore.currentAddress"
<a
v-if="walletStore.currentAddress"
class="block py-2 px-2 hover:bg-gray-100 dark:hover:bg-[#353f5a] rounded cursor-pointer"
style="overflow-wrap: anywhere" @click="copyAdress(walletStore.currentAddress)">
style="overflow-wrap: anywhere"
@click="copyAdress(walletStore.currentAddress)"
>
{{ walletStore.currentAddress }}
</a>
<div class="divider mt-1 mb-1"></div>
<RouterLink to="/wallet/accounts">
<div class="block py-2 px-2 hover:!bg-gray-100 rounded cursor-pointer">Accounts</div>
<div
class="block py-2 px-2 hover:!bg-gray-100 rounded cursor-pointer"
>
Accounts
</div>
</RouterLink>
<RouterLink to="/wallet/portfolio">
<div class="block py-2 px-2 hover:!bg-gray-100 rounded cursor-pointer">Portfolio</div>
<div
class="block py-2 px-2 hover:!bg-gray-100 rounded cursor-pointer"
>
Portfolio
</div>
</RouterLink>
<div v-if="walletStore.currentAddress" class="divider mt-1 mb-1"></div>
<a v-if="walletStore.currentAddress"
<a
v-if="walletStore.currentAddress"
class="block py-2 px-2 hover:bg-gray-100 dark:hover:bg-[#353f5a] rounded cursor-pointer"
@click="walletStore.disconnect()">Disconnect</a>
@click="walletStore.disconnect()"
>Disconnect</a
>
</div>
</div>
<div class="toast" v-show="showCopyToast === 1">
Expand All @@ -83,9 +110,13 @@ const tipMsg = computed(() => {
</div>
</div>
<Teleport to="body">
<ping-connect-wallet :chain-id="baseStore.currentChainId" :hd-path="chainStore.defaultHDPath"
:addr-prefix="chainStore.current?.bech32Prefix || 'cosmos'" @connect="walletStateChange"
@keplr-config="walletStore.suggestChain()" />
<ping-connect-wallet
:chain-id="baseStore.currentChainId"
:hd-path="chainStore.defaultHDPath"
:addr-prefix="chainStore.current?.bech32Prefix || 'cosmos'"
@connect="walletStateChange"
@keplr-config="walletStore.suggestChain()"
/>
</Teleport>
</template>

Expand Down
40 changes: 25 additions & 15 deletions src/stores/useBlockchain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {
import { useBlockModule } from '@/modules/[chain]/block/block';
import { DEFAULT } from '@/libs';
import { hexToRgb, rgbToHsl } from '@/libs/utils';
import { getAllowedFeaturesByWallet } from '@/utils/wallet';

export const useBlockchain = defineStore('blockchain', {
state: () => {
Expand All @@ -41,13 +42,13 @@ export const useBlockchain = defineStore('blockchain', {
},
getters: {
current(): ChainConfig | undefined {
const chain = this.dashboard.mainnetChains[this.chainName]
const chain = this.dashboard.mainnetChains[this.chainName];
if (chain === undefined) {
return this.dashboard.testnetChains[this.chainName]
}
return this.dashboard.testnetChains[this.chainName];
}
// update chain config with dynamic updated sdk version
const sdkversion = localStorage.getItem(`sdk_version_${this.chainName}`)
if(sdkversion && chain?.versions) {
const sdkversion = localStorage.getItem(`sdk_version_${this.chainName}`);
if (sdkversion && chain?.versions) {
chain.versions.cosmosSdk = sdkversion;
}
return chain;
Expand All @@ -70,11 +71,12 @@ export const useBlockchain = defineStore('blockchain', {
let currNavItem: VerticalNavItems = [];
const router = useRouter();
const routes = router?.getRoutes() || [];
const walletStore = useWalletStore();
if (this.current && routes) {
if (this.current?.themeColor) {
const { color } = hexToRgb(this.current?.themeColor);
const { h, s, l } = rgbToHsl(color);
const themeColor = h + ' ' + s + '% ' + l +'%';
const themeColor = h + ' ' + s + '% ' + l + '%';
document.body.style.setProperty('--p', `${themeColor}`);
// document.body.style.setProperty('--p', `${this.current?.themeColor}`);
} else {
Expand All @@ -89,6 +91,13 @@ export const useBlockchain = defineStore('blockchain', {
badgeClass: 'bg-error',
children: routes
.filter((x) => x.meta.i18n) // defined menu name
.filter((x) => {
const connectedWalletName = walletStore.wallet.wallet;
const allowedFeatures =
getAllowedFeaturesByWallet(connectedWalletName);
if (!allowedFeatures) return true;
return allowedFeatures.includes(String(x.meta.i18n));
})
.filter(
(x) =>
!this.current?.features ||
Expand Down Expand Up @@ -116,7 +125,7 @@ export const useBlockchain = defineStore('blockchain', {
to: { path: `/${ch.chainName || name}` },
icon: { image: ch.logo, size: '22' },
});
}
}
if (testch && this.dashboard.favoriteMap?.[name]) {
favNavItems.push({
title: testch.prettyName || testch.chainName || name,
Expand Down Expand Up @@ -164,7 +173,7 @@ export const useBlockchain = defineStore('blockchain', {
useBlockModule().initial();
},

randomEndpoint(chainName: string) : Endpoint | undefined {
randomEndpoint(chainName: string): Endpoint | undefined {
const end = localStorage.getItem(`endpoint-${chainName}`);
if (end) {
return JSON.parse(end);
Expand All @@ -173,14 +182,14 @@ export const useBlockchain = defineStore('blockchain', {
if (all) {
const rn = Math.random();
const endpoint = all[Math.floor(rn * all.length)];
return endpoint
return endpoint;
}
}
},

async randomSetupEndpoint() {
const endpoint = this.randomEndpoint(this.chainName)
if(endpoint) await this.setRestEndpoint(endpoint);
const endpoint = this.randomEndpoint(this.chainName);
if (endpoint) await this.setRestEndpoint(endpoint);
},

async setRestEndpoint(endpoint: Endpoint) {
Expand All @@ -194,14 +203,15 @@ export const useBlockchain = defineStore('blockchain', {
},
async setCurrent(name: string) {
// Ensure chains are loaded due to asynchronous calls.
if(this.dashboard.length === 0) {
if (this.dashboard.length === 0) {
await this.dashboard.initial();
}

// Find the case-sensitive name for the chainName, else simply use the parameter-value.
const caseSensitiveName =
Object.keys(this.dashboard.mainnetChains).find((x) => x.toLowerCase() === name.toLowerCase())
|| name;
const caseSensitiveName =
Object.keys(this.dashboard.mainnetChains).find(
(x) => x.toLowerCase() === name.toLowerCase()
) || name;

// Update chainName if needed
if (caseSensitiveName !== this.chainName) {
Expand Down
Loading