From 3a4273eacabd49e9d76bd4150b191beaa43b8003 Mon Sep 17 00:00:00 2001 From: SamvelRaja Sakthivel Date: Fri, 22 Sep 2023 12:34:00 +0530 Subject: [PATCH 1/8] Lint fixes --- .github/workflows/publish-packages.yml | 4 +-- .yarnrc.yml | 2 +- packages/cosmos-snap-provider/README.md | 1 - .../src/cosmjs-offline-signer.ts | 4 +-- packages/cosmos-snap-provider/src/snap.ts | 32 +++++++++++-------- packages/cosmos-snap-provider/src/types.ts | 6 ++-- packages/snap/README.md | 2 +- packages/snap/src/helpers/parser.ts | 1 - 8 files changed, 27 insertions(+), 25 deletions(-) diff --git a/.github/workflows/publish-packages.yml b/.github/workflows/publish-packages.yml index 605e50d..85ae673 100644 --- a/.github/workflows/publish-packages.yml +++ b/.github/workflows/publish-packages.yml @@ -41,7 +41,7 @@ jobs: env: GH_TOKEN: ${{secrets.NODE_AUTH_TOKEN}} NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} - + publish-gitHub-registry: runs-on: ubuntu-latest env: @@ -63,7 +63,7 @@ jobs: run: yarn env: GH_TOKEN: ${{secrets.NODE_AUTH_TOKEN}} - + - name: 🏗️ Build Library run: yarn build:provider && yarn publish:provider env: diff --git a/.yarnrc.yml b/.yarnrc.yml index f60439d..4d91cc2 100644 --- a/.yarnrc.yml +++ b/.yarnrc.yml @@ -4,4 +4,4 @@ plugins: - path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs spec: '@yarnpkg/plugin-workspace-tools' -yarnPath: .yarn/releases/yarn-3.2.1.cjs \ No newline at end of file +yarnPath: .yarn/releases/yarn-3.2.1.cjs diff --git a/packages/cosmos-snap-provider/README.md b/packages/cosmos-snap-provider/README.md index 65e7ed7..11348b1 100644 --- a/packages/cosmos-snap-provider/README.md +++ b/packages/cosmos-snap-provider/README.md @@ -2,5 +2,4 @@ The **`cosmos-snap-provider`** is specifically designed for seamless integration of the Leap Cosmos Snap with the [CosmJS](https://github.com/cosmos/cosmjs) client. - [Integration Guide](https://docs.leapwallet.io/cosmos/leap-metamask-snap/integrating-snaps/cosmos-snap-provider) diff --git a/packages/cosmos-snap-provider/src/cosmjs-offline-signer.ts b/packages/cosmos-snap-provider/src/cosmjs-offline-signer.ts index 80896f1..38c7e92 100644 --- a/packages/cosmos-snap-provider/src/cosmjs-offline-signer.ts +++ b/packages/cosmos-snap-provider/src/cosmjs-offline-signer.ts @@ -64,7 +64,7 @@ export class CosmjsOfflineSigner implements OfflineDirectSigner { this.chainId, signerAddress, signDoc, - options + options, ) as unknown as Promise; } } @@ -95,7 +95,7 @@ export async function signArbitrary( const { signDoc } = getADR36SignDoc(signer, data); const result = await requestSignAmino(chainId, signer, signDoc, { isADR36: true, - preferNoSetFee: true + preferNoSetFee: true, }); return result.signature; } diff --git a/packages/cosmos-snap-provider/src/snap.ts b/packages/cosmos-snap-provider/src/snap.ts index e5545cb..b3059a8 100644 --- a/packages/cosmos-snap-provider/src/snap.ts +++ b/packages/cosmos-snap-provider/src/snap.ts @@ -6,7 +6,14 @@ import Long from 'long'; import { defaultSnapOrigin } from './config'; import Chains from './constants/chainInfo'; import { getGasPriceForChainName } from './helper/gas'; -import { ChainInfo, GetSnapsResponse, SignAminoOptions, Snap, StdSignDoc, SuggestChainOptions } from './types'; +import { + ChainInfo, + GetSnapsResponse, + SignAminoOptions, + Snap, + StdSignDoc, + SuggestChainOptions, +} from './types'; /** * The fool proof version of getting the ethereum provider suggested by @@ -165,10 +172,7 @@ export const requestSignAmino = async ( signDoc: StdSignDoc, options?: SignAminoOptions, ) => { - - const { - isADR36 = false - } = options || {}; + const { isADR36 = false } = options || {}; if (chainId !== signDoc.chain_id) { throw new Error('Chain ID does not match signer chain ID'); @@ -177,9 +181,7 @@ export const requestSignAmino = async ( const chain = Chains[chainId as keyof typeof Chains]; // Override gasPrice if (!options?.preferNoSetFee && chain && chain.denom) { - const gasPriceFromRegistry = await getGasPriceForChainName( - chain.chainName, - ); + const gasPriceFromRegistry = await getGasPriceForChainName(chain.chainName); const gas: any = 'gasLimit' in signDoc.fee ? signDoc.fee.gasLimit : signDoc.fee.gas; if (gasPriceFromRegistry) { @@ -224,20 +226,22 @@ export const isLocalSnap = (snapId: string) => snapId.startsWith('local:'); export const suggestChain = async ( chainInfo: ChainInfo, - options: SuggestChainOptions + options: SuggestChainOptions, ): Promise<{ message: string; chainInfo: ChainInfo }> => { - - if(options && options.force) { + if (options && options.force) { return await sendReqToSnap('suggestChain', { chainInfo, }); } - const supportedChains = await sendReqToSnap('getSupportedChains', {}) || {}; + const supportedChains = (await sendReqToSnap('getSupportedChains', {})) || {}; if (supportedChains[chainInfo.chainId]) { - return Promise.resolve({ message: 'Chain already added successfully', chainInfo }); + return Promise.resolve({ + message: 'Chain already added successfully', + chainInfo, + }); } - + return await sendReqToSnap('suggestChain', { chainInfo, }); diff --git a/packages/cosmos-snap-provider/src/types.ts b/packages/cosmos-snap-provider/src/types.ts index 36d9cc2..d3b130c 100644 --- a/packages/cosmos-snap-provider/src/types.ts +++ b/packages/cosmos-snap-provider/src/types.ts @@ -7,7 +7,7 @@ export type Snap = { permissionName: string; id: string; version: string; - initialPermissions: Record; + initialPermissions: Record; }; export type Bech32Config = { @@ -100,5 +100,5 @@ export type StdSignDoc = { export type ProviderLong = Long; export type SuggestChainOptions = { - force?: boolean -} + force?: boolean; +}; diff --git a/packages/snap/README.md b/packages/snap/README.md index ace04d4..f2a89b6 100644 --- a/packages/snap/README.md +++ b/packages/snap/README.md @@ -4,4 +4,4 @@ This Snap facilitates signing of Cosmos transactions for chains associated with > Recommendation: If you're accustomed to using [CosmJS](https://github.com/cosmos/cosmjs) and the OfflineSigner, consider leveraging our cosmos-snap-provider. It streamlines the necessary tasks with minimal code alterations. -[Integration docs](https://docs.leapwallet.io/cosmos/leap-metamask-snap/integrating-snaps/metamask-cosmos-snap) \ No newline at end of file +[Integration docs](https://docs.leapwallet.io/cosmos/leap-metamask-snap/integrating-snaps/metamask-cosmos-snap) diff --git a/packages/snap/src/helpers/parser.ts b/packages/snap/src/helpers/parser.ts index c73ddc9..17f345f 100644 --- a/packages/snap/src/helpers/parser.ts +++ b/packages/snap/src/helpers/parser.ts @@ -17,7 +17,6 @@ import * as base64js from 'base64-js'; import BigNumber from 'bignumber.js'; import DENOMS from '../constants/denoms'; -import { base64 } from '@metamask/utils'; const messageParser = new MessageParser(); From 179367a448e9b56ea1fae6bddbec90d27fc1b595 Mon Sep 17 00:00:00 2001 From: tomas-dora Date: Fri, 6 Oct 2023 17:13:39 +0800 Subject: [PATCH 2/8] doravota --- .../cosmos-snap-provider/src/constants/chainInfo.ts | 12 ++++++++++++ packages/snap/src/constants/chainInfo.ts | 10 ++++++++++ 2 files changed, 22 insertions(+) diff --git a/packages/cosmos-snap-provider/src/constants/chainInfo.ts b/packages/cosmos-snap-provider/src/constants/chainInfo.ts index f8c42c8..24c9e82 100644 --- a/packages/cosmos-snap-provider/src/constants/chainInfo.ts +++ b/packages/cosmos-snap-provider/src/constants/chainInfo.ts @@ -1151,6 +1151,18 @@ const Chains = { denom: 'uvdl', decimals: 6, }, + 'vota-ash': { + chainId: 'vota-ash', + chainName: 'doravota', + bech32Config: { + bech32PrefixAccAddr: 'dora', + }, + bip44: { + coinType: 118, + }, + denom: 'peaka', + decimals: 18, + }, }; export default Chains; diff --git a/packages/snap/src/constants/chainInfo.ts b/packages/snap/src/constants/chainInfo.ts index 00097c2..c705cfd 100644 --- a/packages/snap/src/constants/chainInfo.ts +++ b/packages/snap/src/constants/chainInfo.ts @@ -969,6 +969,16 @@ const Chains = { coinType: 370, }, }, + 'vota-ash': { + chainId: 'vota-ash', + chainName: 'doravota', + bech32Config: { + bech32PrefixAccAddr: 'dora', + }, + bip44: { + coinType: 118, + }, + }, }; export default Chains; From 6e56241ee84e5aacfe7273e1f31ff5c5fac6db30 Mon Sep 17 00:00:00 2001 From: hard-nett Date: Wed, 11 Oct 2023 19:57:15 -0400 Subject: [PATCH 3/8] remove chronicnetwork, add terpnetwork support --- packages/cosmos-snap-provider/package.json | 2 +- .../src/constants/chainInfo.ts | 24 +++++++------- packages/snap/package.json | 2 +- packages/snap/src/constants/chainInfo.ts | 4 +-- packages/snap/src/constants/denoms.ts | 32 +++++++++---------- 5 files changed, 32 insertions(+), 32 deletions(-) diff --git a/packages/cosmos-snap-provider/package.json b/packages/cosmos-snap-provider/package.json index 2bf25cc..f7dc4ec 100644 --- a/packages/cosmos-snap-provider/package.json +++ b/packages/cosmos-snap-provider/package.json @@ -1,6 +1,6 @@ { "name": "@leapwallet/cosmos-snap-provider", - "version": "0.1.24", + "version": "0.1.25", "repository": { "url": "git@github.com:leapwallet/cosmos-metamask-snap.git" }, diff --git a/packages/cosmos-snap-provider/src/constants/chainInfo.ts b/packages/cosmos-snap-provider/src/constants/chainInfo.ts index f8c42c8..a4a9664 100644 --- a/packages/cosmos-snap-provider/src/constants/chainInfo.ts +++ b/packages/cosmos-snap-provider/src/constants/chainInfo.ts @@ -191,18 +191,6 @@ const Chains = { denom: 'ncheq', decimals: 9, }, - 'morocco-1': { - chainId: 'morocco-1', - chainName: 'chronicnetwork', - bech32Config: { - bech32PrefixAccAddr: 'chronic', - }, - bip44: { - coinType: 118, - }, - denom: 'ucht', - decimals: 6, - }, 'comdex-1': { chainId: 'comdex-1', chainName: 'comdex', @@ -311,6 +299,18 @@ const Chains = { denom: 'udec', decimals: 6, }, + 'morocco-1': { + chainId: 'morocco-1', + chainName: 'terpnetwork', + bech32Config: { + bech32PrefixAccAddr: 'terp', + }, + bip44: { + coinType: 118, + }, + denom: 'uterp', + decimals: 6, + }, 'desmos-mainnet': { chainId: 'desmos-mainnet', chainName: 'desmos', diff --git a/packages/snap/package.json b/packages/snap/package.json index 01744cc..f8f9be5 100644 --- a/packages/snap/package.json +++ b/packages/snap/package.json @@ -1,6 +1,6 @@ { "name": "@leapwallet/metamask-cosmos-snap", - "version": "0.1.16", + "version": "0.1.17", "description": "Securely manage keys, connect to Cosmos dapps, and sign transactions.", "repository": { "type": "git", diff --git a/packages/snap/src/constants/chainInfo.ts b/packages/snap/src/constants/chainInfo.ts index 00097c2..1cb01de 100644 --- a/packages/snap/src/constants/chainInfo.ts +++ b/packages/snap/src/constants/chainInfo.ts @@ -161,9 +161,9 @@ const Chains = { }, 'morocco-1': { chainId: 'morocco-1', - chainName: 'chronicnetwork', + chainName: 'terpnetwork', bech32Config: { - bech32PrefixAccAddr: 'chronic', + bech32PrefixAccAddr: 'terp', }, bip44: { coinType: 118, diff --git a/packages/snap/src/constants/denoms.ts b/packages/snap/src/constants/denoms.ts index 4f8cd6c..25fce6a 100644 --- a/packages/snap/src/constants/denoms.ts +++ b/packages/snap/src/constants/denoms.ts @@ -386,27 +386,27 @@ const DENOMS = { icon: 'https://assets.leapwallet.io/huahua.png', chain: 'chihuahua', }, - ucht: { - name: 'Chronic Token', + uterp: { + name: 'Terp Token', description: - 'The CHT coin is the governance token within the Chronic Chain network, aimed to serve the entire cannabis community through its payment network, supply chain and trust network.', - coinDenom: 'CHT', - coinMinimalDenom: 'ucht', + 'Terp Token (TERP) is the Terp Networks native utility token, used as the primary means to govern & secure the blockchain.', + coinDenom: 'TERP', + coinMinimalDenom: 'uterp', coinDecimals: 6, - coinGeckoId: 'cht', - icon: 'https://assets.leapwallet.io/cht.png', - chain: 'chronicnetwork', + coinGeckoId: null, + icon: 'https://assets.leapwallet.io/terp.png', + chain: 'terpnetwork', }, - ucgas: { - name: 'Chronic Gas', + uthiol: { + name: 'Thiol Gas Token', description: - 'The CGAS coin is the transactional token within the Chronic Chain network, aimed to serve the entire cannabis community through its payment network, supply chain and trust network.', - coinDenom: 'CGAS', - coinMinimalDenom: 'ucgas', + 'Thiol Gas Token (Thiols) is the Terp Networks native utility token, used as the primary means to govern, secure the blockchain & incentivize participants', + coinDenom: 'TERP', + coinMinimalDenom: 'uthiol', coinDecimals: 6, - coinGeckoId: 'cgas', - icon: 'https://assets.leapwallet.io/cgas.png', - chain: 'chronicnetwork', + coinGeckoId: null, + icon: 'https://assets.leapwallet.io/thiol.png', + chain: 'terpnetwork', }, ucmdx: { name: 'Comdex', From 6d69c30e4b32ca76b3d1338aa13bfd4f23578568 Mon Sep 17 00:00:00 2001 From: baryon2 Date: Wed, 18 Oct 2023 18:22:25 +0530 Subject: [PATCH 4/8] Add enable extra entropy flag in signAmino --- packages/cosmos-snap-provider/src/cosmjs-offline-signer.ts | 2 ++ packages/cosmos-snap-provider/src/snap.ts | 3 ++- packages/cosmos-snap-provider/src/types.ts | 1 + packages/snap/src/index.ts | 7 ++++++- 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/packages/cosmos-snap-provider/src/cosmjs-offline-signer.ts b/packages/cosmos-snap-provider/src/cosmjs-offline-signer.ts index 38c7e92..7ce05d9 100644 --- a/packages/cosmos-snap-provider/src/cosmjs-offline-signer.ts +++ b/packages/cosmos-snap-provider/src/cosmjs-offline-signer.ts @@ -91,11 +91,13 @@ export async function signArbitrary( chainId: string, signer: string, data: string, + signOptions?: { enableExtraEntropy?: boolean }, ) { const { signDoc } = getADR36SignDoc(signer, data); const result = await requestSignAmino(chainId, signer, signDoc, { isADR36: true, preferNoSetFee: true, + enableExtraEntropy: signOptions?.enableExtraEntropy, }); return result.signature; } diff --git a/packages/cosmos-snap-provider/src/snap.ts b/packages/cosmos-snap-provider/src/snap.ts index f2b5b1b..f088e8f 100644 --- a/packages/cosmos-snap-provider/src/snap.ts +++ b/packages/cosmos-snap-provider/src/snap.ts @@ -172,7 +172,7 @@ export const requestSignAmino = async ( signDoc: StdSignDoc, options?: SignAminoOptions, ) => { - const { isADR36 = false } = options || {}; + const { isADR36 = false, enableExtraEntropy = false } = options || {}; if (!isADR36 && chainId !== signDoc.chain_id) { throw new Error('Chain ID does not match signer chain ID'); @@ -203,6 +203,7 @@ export const requestSignAmino = async ( signerAddress, signDoc, isADR36, + enableExtraEntropy, })) as AminoSignResponse; return signResponse; diff --git a/packages/cosmos-snap-provider/src/types.ts b/packages/cosmos-snap-provider/src/types.ts index d3b130c..964d385 100644 --- a/packages/cosmos-snap-provider/src/types.ts +++ b/packages/cosmos-snap-provider/src/types.ts @@ -78,6 +78,7 @@ export type ChainInfo = { export type SignAminoOptions = { preferNoSetFee?: boolean; isADR36?: boolean; + enableExtraEntropy?: boolean; }; export type StdFee = { diff --git a/packages/snap/src/index.ts b/packages/snap/src/index.ts index 5559dba..63696b2 100644 --- a/packages/snap/src/index.ts +++ b/packages/snap/src/index.ts @@ -19,6 +19,7 @@ export type RequestParams = { readonly signDoc: T; readonly signerAddress: string; readonly isADR36?: boolean; + readonly enableExtraEntropy?: boolean; readonly chainId?: string; }; @@ -128,7 +129,11 @@ export const onRpcRequest: OnRpcRequestHandler = async ({ const signResponse = await wallet.signAmino( signerAddress, sortedSignDoc, - { extraEntropy: !params.isADR36 }, + { + extraEntropy: !params.enableExtraEntropy + ? false + : params.enableExtraEntropy, + }, ); return signResponse; } From ba2ec2156545c77891f8cc34076f1eaf3841cad8 Mon Sep 17 00:00:00 2001 From: SamvelRaja Sakthivel Date: Tue, 31 Oct 2023 18:15:49 +0530 Subject: [PATCH 5/8] Added DyDx --- .../cosmos-snap-provider/src/constants/chainInfo.ts | 11 +++++++++++ .../cosmos-snap-provider/src/cosmjs-offline-signer.ts | 1 + packages/snap/snap.manifest.json | 4 ++-- packages/snap/src/constants/chainInfo.ts | 10 ++++++++++ packages/snap/src/constants/denoms.ts | 8 ++++++++ packages/snap/src/index.ts | 1 + 6 files changed, 33 insertions(+), 2 deletions(-) diff --git a/packages/cosmos-snap-provider/src/constants/chainInfo.ts b/packages/cosmos-snap-provider/src/constants/chainInfo.ts index 7da0545..e7075ef 100644 --- a/packages/cosmos-snap-provider/src/constants/chainInfo.ts +++ b/packages/cosmos-snap-provider/src/constants/chainInfo.ts @@ -335,6 +335,17 @@ const Chains = { denom: 'udig', decimals: 6, }, + dydx: { + chainId: 'dydx-mainnet-1', + bech32Config: { + bech32PrefixAccAddr: 'empower', + }, + bip44: { + coinType: 118, + }, + denom: 'DYDX', + decimals: 18, + }, 'dyson-mainnet-01': { chainId: 'dyson-mainnet-01', chainName: 'dyson', diff --git a/packages/cosmos-snap-provider/src/cosmjs-offline-signer.ts b/packages/cosmos-snap-provider/src/cosmjs-offline-signer.ts index 7ce05d9..eaf1ed3 100644 --- a/packages/cosmos-snap-provider/src/cosmjs-offline-signer.ts +++ b/packages/cosmos-snap-provider/src/cosmjs-offline-signer.ts @@ -1,5 +1,6 @@ /* eslint jsdoc/match-description: 0 */ // --> OFF /* eslint require-atomic-updates: 0 */ // --> OFF +/* eslint jsdoc/require-param: 0 */ // --> OFF import { SignDoc } from 'cosmjs-types/cosmos/tx/v1beta1/tx'; import { AccountData, AminoSignResponse } from '@cosmjs/amino'; diff --git a/packages/snap/snap.manifest.json b/packages/snap/snap.manifest.json index e32eded..c19e211 100644 --- a/packages/snap/snap.manifest.json +++ b/packages/snap/snap.manifest.json @@ -1,5 +1,5 @@ { - "version": "0.1.16", + "version": "0.1.17", "description": "Securely manage keys, connect to Cosmos dapps, and sign transactions.", "proposedName": "Leap Cosmos Wallet", "repository": { @@ -7,7 +7,7 @@ "url": "https://github.com/leapwallet/cosmos-metamask-snap.git" }, "source": { - "shasum": "diCk3Ht/3Fhbn089viNkY9N6dr41wCMm1KR0wJhLzm0=", + "shasum": "lWW/qaiR+zDY8QteJP15nD70OtOBmhzM+sWv0x5Es/w=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/snap/src/constants/chainInfo.ts b/packages/snap/src/constants/chainInfo.ts index 8decf27..641ff3d 100644 --- a/packages/snap/src/constants/chainInfo.ts +++ b/packages/snap/src/constants/chainInfo.ts @@ -279,6 +279,16 @@ const Chains = { coinType: 118, }, }, + dydx: { + chainId: 'dydx-mainnet-1', + chainName: 'dYdX Protocol', + bech32Config: { + bech32PrefixAccAddr: 'dydx', + }, + bip44: { + coinType: '118', + }, + }, 'dyson-mainnet-01': { chainId: 'dyson-mainnet-01', chainName: 'dyson', diff --git a/packages/snap/src/constants/denoms.ts b/packages/snap/src/constants/denoms.ts index 25fce6a..9650e3d 100644 --- a/packages/snap/src/constants/denoms.ts +++ b/packages/snap/src/constants/denoms.ts @@ -1,4 +1,12 @@ const DENOMS = { + adydx: { + coinDenom: 'DYDX', + coinDecimals: 18, + coinMinimalDenom: 'adydx', + icon: 'https://assets.leapwallet.io/dydx.png', + chain: 'dydx', + coinGeckoId: 'dydx', + }, umpwr: { coinDenom: 'MPWR', coinMinimalDenom: 'umpwr', diff --git a/packages/snap/src/index.ts b/packages/snap/src/index.ts index 63696b2..7773162 100644 --- a/packages/snap/src/index.ts +++ b/packages/snap/src/index.ts @@ -1,3 +1,4 @@ +/* eslint no-negated-condition: 0 */ // --> OFF import { AminoMsg, StdFee } from '@cosmjs/amino'; import { OnRpcRequestHandler } from '@metamask/snaps-types'; import { panel } from '@metamask/snaps-ui'; From 005bab34bbfd38d27ec4cffba0a3da4dd5d3264a Mon Sep 17 00:00:00 2001 From: SamvelRaja Sakthivel Date: Tue, 31 Oct 2023 18:45:53 +0530 Subject: [PATCH 6/8] Added celestia --- .../src/constants/chainInfo.ts | 12 ++++++++++++ packages/snap/snap.manifest.json | 2 +- packages/snap/src/constants/chainInfo.ts | 10 ++++++++++ packages/snap/src/constants/denoms.ts | 17 ++++++++--------- 4 files changed, 31 insertions(+), 10 deletions(-) diff --git a/packages/cosmos-snap-provider/src/constants/chainInfo.ts b/packages/cosmos-snap-provider/src/constants/chainInfo.ts index e7075ef..a2ec202 100644 --- a/packages/cosmos-snap-provider/src/constants/chainInfo.ts +++ b/packages/cosmos-snap-provider/src/constants/chainInfo.ts @@ -179,6 +179,18 @@ const Chains = { denom: 'uc4e', decimals: 6, }, + celestia: { + chainId: 'celestia', + chainName: 'Celestia', + bech32Config: { + bech32PrefixAccAddr: 'celestia', + }, + bip44: { + coinType: 118, + }, + denom: 'utia', + decimals: 6, + }, 'cheqd-mainnet-1': { chainId: 'cheqd-mainnet-1', chainName: 'cheqd', diff --git a/packages/snap/snap.manifest.json b/packages/snap/snap.manifest.json index c19e211..3bfc9d1 100644 --- a/packages/snap/snap.manifest.json +++ b/packages/snap/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/leapwallet/cosmos-metamask-snap.git" }, "source": { - "shasum": "lWW/qaiR+zDY8QteJP15nD70OtOBmhzM+sWv0x5Es/w=", + "shasum": "CLwZocaUEbDErtQAsybaudZDJq65a8AwlEFgkGUpmAQ=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/snap/src/constants/chainInfo.ts b/packages/snap/src/constants/chainInfo.ts index 641ff3d..1f57055 100644 --- a/packages/snap/src/constants/chainInfo.ts +++ b/packages/snap/src/constants/chainInfo.ts @@ -149,6 +149,16 @@ const Chains = { coinType: 4444, }, }, + celestia: { + chainId: 'celestia', + chainName: 'Celestia', + bech32Config: { + bech32PrefixAccAddr: 'celestia', + }, + bip44: { + coinType: 118, + }, + }, 'cheqd-mainnet-1': { chainId: 'cheqd-mainnet-1', chainName: 'cheqd', diff --git a/packages/snap/src/constants/denoms.ts b/packages/snap/src/constants/denoms.ts index 9650e3d..288ebfa 100644 --- a/packages/snap/src/constants/denoms.ts +++ b/packages/snap/src/constants/denoms.ts @@ -7,6 +7,14 @@ const DENOMS = { chain: 'dydx', coinGeckoId: 'dydx', }, + utia: { + coinDenom: 'TIA', + coinDecimals: 6, + coinMinimalDenom: 'utia', + icon: 'https://assets.leapwallet.io/filled-celestia.svg', + chain: 'celestia', + coinGeckoId: '', + }, umpwr: { coinDenom: 'MPWR', coinMinimalDenom: 'umpwr', @@ -1845,15 +1853,6 @@ const DENOMS = { chain: 'planq', coinGeckoId: 'planq', }, - utia: { - name: 'Celestia', - coinDenom: 'TIA', - coinMinimalDenom: 'utia', - coinDecimals: 6, - icon: 'https://assets.leapwallet.io/celestia.png', - chain: 'celestiatestnet', - coinGeckoId: '', - }, juno168ctmpyppk90d34p3jjy658zf5a5l3w8wk35wht6ccqj4mr0yv8s4j5awr: { name: 'Neta', description: 'The native token cw20 for Neta on Juno Chain', From bb8f7c57975cbe6fb44c1a36a660338470e419c0 Mon Sep 17 00:00:00 2001 From: SamvelRaja Sakthivel Date: Tue, 31 Oct 2023 18:49:20 +0530 Subject: [PATCH 7/8] Fixed chain name issue in dydx --- packages/cosmos-snap-provider/src/constants/chainInfo.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/cosmos-snap-provider/src/constants/chainInfo.ts b/packages/cosmos-snap-provider/src/constants/chainInfo.ts index a2ec202..2d58f04 100644 --- a/packages/cosmos-snap-provider/src/constants/chainInfo.ts +++ b/packages/cosmos-snap-provider/src/constants/chainInfo.ts @@ -349,6 +349,7 @@ const Chains = { }, dydx: { chainId: 'dydx-mainnet-1', + chainName: 'dYdX Protocol', bech32Config: { bech32PrefixAccAddr: 'empower', }, From 479b6d3876c149474dafa3045994b22c69f245cc Mon Sep 17 00:00:00 2001 From: SamvelRaja Sakthivel Date: Tue, 31 Oct 2023 19:09:56 +0530 Subject: [PATCH 8/8] Fixed bech32prefix address --- packages/cosmos-snap-provider/src/constants/chainInfo.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/cosmos-snap-provider/src/constants/chainInfo.ts b/packages/cosmos-snap-provider/src/constants/chainInfo.ts index 2d58f04..6de70bf 100644 --- a/packages/cosmos-snap-provider/src/constants/chainInfo.ts +++ b/packages/cosmos-snap-provider/src/constants/chainInfo.ts @@ -351,7 +351,7 @@ const Chains = { chainId: 'dydx-mainnet-1', chainName: 'dYdX Protocol', bech32Config: { - bech32PrefixAccAddr: 'empower', + bech32PrefixAccAddr: 'dydx', }, bip44: { coinType: 118,