diff --git a/public/logos/ledger.jpeg b/public/logos/ledger.jpeg new file mode 100644 index 00000000..46949821 Binary files /dev/null and b/public/logos/ledger.jpeg differ diff --git a/public/logos/ledger.webp b/public/logos/ledger.webp new file mode 100644 index 00000000..9c733a10 Binary files /dev/null and b/public/logos/ledger.webp differ diff --git a/src/layouts/components/ChainProfile.vue b/src/layouts/components/ChainProfile.vue index ac37ff08..28c3323f 100644 --- a/src/layouts/components/ChainProfile.vue +++ b/src/layouts/components/ChainProfile.vue @@ -85,6 +85,8 @@ function changeEndpoint(item: Endpoint) { Height: {{ baseStore.latest.block?.header.height }} + +
Account | @@ -186,11 +224,11 @@ async function addAddress(acc: AccountEntry) {
|
- + |
-
diff --git a/src/modules/wallet/utils.ts b/src/modules/wallet/utils.ts
index f096d9c3..88be608d 100644
--- a/src/modules/wallet/utils.ts
+++ b/src/modules/wallet/utils.ts
@@ -10,39 +10,42 @@ export interface AccountEntry {
endpoint?: string,
delegation?: Coin,
balances?: Coin[],
+ compatiable?: boolean,
+}
+
+export interface LocalKey {
+ cosmosAddress: string, hdPath: string
}
export function scanLocalKeys() {
- const connected = [] as {cosmosAddress: string, hdPath: string}[]
- for (let i = 0; i < localStorage.length; i++) {
- const key = localStorage.key(i)
- if (key?.startsWith("m/44")) {
- const wallet = JSON.parse(localStorage.getItem(key) || "")
- if (wallet) {
- connected.push(wallet)
- }
+ const connected = [] as LocalKey[]
+ for (let i = 0; i < localStorage.length; i++) {
+ const key = localStorage.key(i)
+ if (key?.startsWith("m/44")) {
+ const wallet = JSON.parse(localStorage.getItem(key) || "")
+ if (wallet) {
+ connected.push(wallet)
}
}
- return connected
}
+ return connected
+}
-
-export function scanCompatibleAccounts() {
- const dashboard = useDashboard()
- const available = [] as AccountEntry[]
- scanLocalKeys().forEach(wallet => {
- Object.values(dashboard.chains).forEach(chain => {
- if (wallet.hdPath.indexOf(chain.coinType) === 6) {
- const { data } = fromBech32(wallet.cosmosAddress)
- available.push({
- chainName: chain.chainName,
- logo: chain.logo,
- address: toBech32(chain.bech32Prefix, data),
- coinType: chain.coinType,
- endpoint: chain.endpoints.rest?.at(0)?.address
- })
- }
+export function scanCompatibleAccounts(keys: LocalKey[]) {
+ const dashboard = useDashboard()
+ const available = [] as AccountEntry[]
+ keys.forEach(wallet => {
+ Object.values(dashboard.chains).forEach(chain => {
+ const { data } = fromBech32(wallet.cosmosAddress)
+ available.push({
+ chainName: chain.chainName,
+ logo: chain.logo,
+ address: toBech32(chain.bech32Prefix, data),
+ coinType: chain.coinType,
+ compatiable: wallet.hdPath.indexOf(chain.coinType) > 0,
+ endpoint: chain.endpoints.rest?.at(0)?.address
})
})
- return available
- }
\ No newline at end of file
+ })
+ return available
+}
\ No newline at end of file
diff --git a/src/stores/useWalletStore.ts b/src/stores/useWalletStore.ts
index eebea3a1..17814896 100644
--- a/src/stores/useWalletStore.ts
+++ b/src/stores/useWalletStore.ts
@@ -17,7 +17,7 @@ export const useWalletStore = defineStore('walletStore', {
delegations: [] as Delegation[],
unbonding: [] as UnbondingResponses[],
rewards: {} as DelegatorRewards,
- walletIsConnected: {} as WalletConnected | null
+ walletIsConnected: {} as WalletConnected
};
},
getters: {
+
@@ -232,45 +270,56 @@ async function addAddress(acc: AccountEntry) {
|
---|