From ba2ec2156545c77891f8cc34076f1eaf3841cad8 Mon Sep 17 00:00:00 2001 From: SamvelRaja Sakthivel Date: Tue, 31 Oct 2023 18:15:49 +0530 Subject: [PATCH 1/4] 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 2/4] 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 3/4] 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 4/4] 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,