diff --git a/gnoland/website/static/js/wallet.js b/gnoland/website/static/js/wallet.js index b327d4d4f0d..ba467681eb0 100644 --- a/gnoland/website/static/js/wallet.js +++ b/gnoland/website/static/js/wallet.js @@ -30,7 +30,11 @@ walletFn.createSignDoc = function(account, msg, chainId, gas) { }; walletFn.keplr.signAndBroadcast = function(sender, msg) { - return window.keplr.enable(chainId).then(function () { + return window.keplr.experimentalSuggestChain(walletFn.geTestnetKeplrConfig()) + .then(function () { + return window.keplr.enable(chainId); + }) + .then(function () { return walletFn.getAccount(sender); }) .then(function(account) { @@ -46,6 +50,37 @@ walletFn.keplr.signAndBroadcast = function(sender, msg) { }); }; +walletFn.geTestnetKeplrConfig = function() { + const addressPrefix = "g"; + const gnoToken = { + coinDenom: "GNOT", + coinMinimalDenom: "gnot", + coinDecimals: 6, + // coinGeckoId: "" + }; + + return { + chainId: chainId, + chainName: "GNO Testnet", + rpc: 'http://gno.land:36657', + rest: 'https://lcd.gno.tools', + bech32Config: { + bech32PrefixAccAddr: `${addressPrefix}`, + bech32PrefixAccPub: `${addressPrefix}pub`, + bech32PrefixValAddr: `${addressPrefix}valoper`, + bech32PrefixValPub: `${addressPrefix}valoperpub`, + bech32PrefixConsAddr: `${addressPrefix}valcons`, + bech32PrefixConsPub: `${addressPrefix}valconspub`, + }, + currencies: [gnoToken], + feeCurrencies: [gnoToken], + stakeCurrency: gnoToken, + bip44: { coinType: 118 }, + // custom feature for GNO chains. + features: ["gno"] + }; +}; + walletFn.makeStdTx = function(content, signature) { const feeAmount = content.fee.amount;