-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## Changes - Added chaininfo for leap & keplr - Adjusted `cosmosStore.connect` to add chain and handle error/rejections #### Docs for wallets in regards to this change. - [Keplr](https://docs.keplr.app/api/suggest-chain.html) - [Leap](https://docs.leapwallet.io/cosmos/for-dapps-connect-to-leap/suggest-chain-add-leap-to-a-non-native-chain)
- Loading branch information
Showing
3 changed files
with
135 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
import type { ChainInfo as KeplrChainInfo } from "@keplr-wallet/types" | ||
import type { ChainInfo as LeapChainInfo } from "@leapwallet/types" | ||
|
||
//This exist according to docs | ||
interface LeapExtendedInfo extends LeapChainInfo { | ||
theme: { | ||
primaryColor: string | ||
gradient: string | ||
} | ||
image: string | ||
} | ||
|
||
//todo handle this for main-net | ||
export const keplrChainInfo: KeplrChainInfo = { | ||
chainId: "union-testnet-8", | ||
chainName: "uniontestnet", | ||
rest: "https://api.testnet.bonlulu.uno", | ||
rpc: "https://rpc.testnet.bonlulu.uno", | ||
bip44: { | ||
coinType: 118 | ||
}, | ||
bech32Config: { | ||
bech32PrefixAccAddr: "union", | ||
bech32PrefixAccPub: "unionpub", | ||
bech32PrefixValAddr: "unionvaloper", | ||
bech32PrefixValPub: "unionvaloperpub", | ||
bech32PrefixConsAddr: "unionvalcons", | ||
bech32PrefixConsPub: "unionvalconspub" | ||
}, | ||
currencies: [ | ||
{ | ||
coinDenom: "UNO", | ||
coinMinimalDenom: "muno", | ||
coinDecimals: 6, | ||
coinGeckoId: "cosmos" | ||
} | ||
], | ||
feeCurrencies: [ | ||
{ | ||
coinDenom: "UNO", | ||
coinMinimalDenom: "muno", | ||
coinDecimals: 6, | ||
coinGeckoId: "union", | ||
gasPriceStep: { | ||
low: 0.0025, | ||
average: 0.025, | ||
high: 0.04 | ||
} | ||
} | ||
], | ||
stakeCurrency: { | ||
coinDenom: "UNO", | ||
coinMinimalDenom: "muno", | ||
coinDecimals: 6, | ||
coinGeckoId: "union" | ||
} | ||
} | ||
|
||
//todo handle this for main-net | ||
export const leapChainInfo: LeapExtendedInfo = { | ||
chainId: "union-testnet-8", | ||
chainName: "uniontestnet", | ||
rest: "https://api.testnet.bonlulu.uno", | ||
rpc: "https://rpc.testnet.bonlulu.uno", | ||
bip44: { | ||
coinType: 118 | ||
}, | ||
bech32Config: { | ||
bech32PrefixAccAddr: "union", | ||
bech32PrefixAccPub: "unionpub", | ||
bech32PrefixValAddr: "unionvaloper", | ||
bech32PrefixValPub: "unionvaloperpub", | ||
bech32PrefixConsAddr: "unionvalcons", | ||
bech32PrefixConsPub: "unionvalconspub" | ||
}, | ||
currencies: [ | ||
{ | ||
coinDenom: "UNO", | ||
coinMinimalDenom: "muno", | ||
coinDecimals: 6, | ||
coinGeckoId: "cosmos" | ||
} | ||
], | ||
feeCurrencies: [ | ||
{ | ||
coinDenom: "UNO", | ||
coinMinimalDenom: "muno", | ||
coinDecimals: 6, | ||
coinGeckoId: "union" | ||
} | ||
], | ||
gasPriceStep: { | ||
low: 0.0025, | ||
average: 0.025, | ||
high: 0.04 | ||
}, | ||
stakeCurrency: { | ||
coinDenom: "UNO", | ||
coinMinimalDenom: "muno", | ||
coinDecimals: 6, | ||
coinGeckoId: "union" | ||
}, | ||
theme: { | ||
primaryColor: "#fff", | ||
gradient: "linear-gradient(180deg, rgba(255, 255, 255, 0.32) 0%, rgba(255, 255, 255, 0) 100%)" | ||
}, | ||
image: | ||
"https://raw.githubusercontent.com/cosmos/chain-registry/master/testnets/uniontestnet/images/union.png" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters