From 2211213414ccbf585c370d0a4f4f8f7cc5161b60 Mon Sep 17 00:00:00 2001 From: SamvelRaja Sakthivel Date: Tue, 5 Sep 2023 12:22:51 +0530 Subject: [PATCH 1/2] Fixed Type issue on suggest chain --- packages/cosmos-snap-provider/package.json | 2 +- packages/cosmos-snap-provider/src/types.ts | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/cosmos-snap-provider/package.json b/packages/cosmos-snap-provider/package.json index f7ffba1..cfb9e04 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.15", + "version": "0.1.16", "repository": { "url": "git@github.com:leapwallet/cosmos-metamask-snap.git" }, diff --git a/packages/cosmos-snap-provider/src/types.ts b/packages/cosmos-snap-provider/src/types.ts index b1a2645..f320b2b 100644 --- a/packages/cosmos-snap-provider/src/types.ts +++ b/packages/cosmos-snap-provider/src/types.ts @@ -11,11 +11,11 @@ export type Snap = { export type Bech32Config = { readonly bech32PrefixAccAddr: string; - readonly bech32PrefixAccPub: string; - readonly bech32PrefixValAddr: string; - readonly bech32PrefixValPub: string; - readonly bech32PrefixConsAddr: string; - readonly bech32PrefixConsPub: string; + readonly bech32PrefixAccPub?: string; + readonly bech32PrefixValAddr?: string; + readonly bech32PrefixValPub?: string; + readonly bech32PrefixConsAddr?: string; + readonly bech32PrefixConsPub?: string; }; type GasPriceStep = { @@ -64,14 +64,14 @@ export type ChainInfo = { }; readonly bech32Config: Bech32Config; - readonly currencies: AppCurrency[]; + readonly currencies?: AppCurrency[]; /** * This indicates which coin or token can be used for fee to send transaction. * You can get actual currency information from Currencies. */ - readonly feeCurrencies: FeeCurrency[]; + readonly feeCurrencies?: FeeCurrency[]; - image: string; + image?: string; }; export type SignAminoOptions = { From e27dca356e66c56d5b3fe49d1873b8709af6d29f Mon Sep 17 00:00:00 2001 From: SamvelRaja Sakthivel Date: Tue, 5 Sep 2023 13:18:29 +0530 Subject: [PATCH 2/2] Added feeCurrencies as mandatory --- packages/cosmos-snap-provider/README.md | 13 +++++++++++++ packages/cosmos-snap-provider/src/types.ts | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/packages/cosmos-snap-provider/README.md b/packages/cosmos-snap-provider/README.md index c9870e4..6cf05ee 100644 --- a/packages/cosmos-snap-provider/README.md +++ b/packages/cosmos-snap-provider/README.md @@ -62,6 +62,19 @@ await suggestChain({ bip44: { coinType: 990, }, + feeCurrencies: [ + { + coinDenom: "ucore", + coinMinimalDenom: "ucore", + coinDecimals: 6, + coinGeckoId: "coreum", + gasPriceStep: { + low: 0.0625, + average: 0.5, + high: 62.5, + }, + }, + ], }); ``` diff --git a/packages/cosmos-snap-provider/src/types.ts b/packages/cosmos-snap-provider/src/types.ts index f320b2b..58b0e5d 100644 --- a/packages/cosmos-snap-provider/src/types.ts +++ b/packages/cosmos-snap-provider/src/types.ts @@ -69,7 +69,7 @@ export type ChainInfo = { * This indicates which coin or token can be used for fee to send transaction. * You can get actual currency information from Currencies. */ - readonly feeCurrencies?: FeeCurrency[]; + readonly feeCurrencies: FeeCurrency[]; image?: string; };