* refactor(dapp-v2): `ethereum-api.xyz` to `rpc.walletconnect.com` * refactor(with-ethers): `ethereum-api.xyz` -> `rpc.walletconnect.com` * refactor(with-web3js): `ethereum-api.xyz` -> `rpc.walletconnect.com` * refactor(cosmos-provider): `ethereum-api.xyz` -> `rpc.walletconnect.com` * refactor(apis): replace remaining `blockchain-api.xyz` calls with assets * chore: add leftover assets for test chains
30 lines
840 B
TypeScript
30 lines
840 B
TypeScript
import { JsonRpcRequest } from "@walletconnect/jsonrpc-utils";
|
|
|
|
import { NamespaceMetadata, ChainMetadata, ChainRequestRender } from "../helpers";
|
|
|
|
export const CosmosMetadata: NamespaceMetadata = {
|
|
"cosmoshub-4": {
|
|
logo: "/assets/" + "cosmos:cosmoshub-4.png",
|
|
rgb: "27, 31, 53",
|
|
},
|
|
};
|
|
|
|
export function getChainMetadata(chainId: string): ChainMetadata {
|
|
const reference = chainId.split(":")[1];
|
|
const metadata = CosmosMetadata[reference];
|
|
if (typeof metadata === "undefined") {
|
|
throw new Error(`No chain metadata found for chainId: ${chainId}`);
|
|
}
|
|
return metadata;
|
|
}
|
|
|
|
export function getChainRequestRender(request: JsonRpcRequest): ChainRequestRender[] {
|
|
return [
|
|
{ label: "Method", value: request.method },
|
|
{
|
|
label: "params",
|
|
value: JSON.stringify(request.params, null, "\t"),
|
|
},
|
|
];
|
|
}
|