hyperweb-io / hyperweb-io/cosmos-kit

[@cosmos-kit/cosmos-extension-metamask]Coin type 60 is forbidden

Open
#405 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
201
Forks
159
PR merge metrics
No merged PRs in 30d

Description

Hey team,
We are running into a situation when building a dapp with cosmos-kit react wallet on Injective chain
- @cosmos-kit/cosmos-extension-metamask
- @cosmos-kit/react

```ts

import { wallets as metaMaskWallets } from '@cosmos-kit/cosmos-extension-metamask';
import { wallets as keplrWallets } from '@cosmos-kit/keplr';

export const CosmosWalletProvider: FC = ({ children }) => {

return (

{children}

);
};
```
Keplr is working like a charm, but Metamask is not working as expected. There are two scenarios:

1. The wallet is successfully connected, but the "inj" address seems not correct. (different from the one showing in injective hub. See the video below):

https://github.com/cosmology-tech/cosmos-kit/assets/127958634/6bfdef5c-1d6f-4354-b5d9-f1b31504df73

2. The error `Coin type 60 is forbidden` is thrown when I try to use `client.signArbitrary`.

Screenshot 2024-02-21 at 19 24 02

Code:

```ts
const { client, status } = useWalletClient();
//...

{
if (client?.signArbitrary && client.getAccount) {
client.getAccount('injective-1').then((account) => {
// Along with the following 'arr', I also tried inj addr and eth hex addr. But still no luck
const arr = Buffer.from(
new Uint8Array(Object.values(account.pubkey)),
).toString('base64');
console.log({ addr: arr });
client?.signArbitrary?.('injective-1', arr, 'test');
});
}
}}
>
Sign with metamask

//...
```

Not sure if it is caused by INJ chain's being not supported (or even the `.signArbitrary` is not support using Metamask?).
Please point me out if I miss anything.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.