Skip to content

Commit

Permalink
Merge pull request #8 from eco-stake/leap-suggest-chain
Browse files Browse the repository at this point in the history
Enable Leap suggestChain support
  • Loading branch information
tombeynon authored Apr 17, 2023
2 parents 58ba66f + bbcc960 commit af3e18f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 23 deletions.
24 changes: 2 additions & 22 deletions src/utils/LeapSignerProvider.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,9 @@ export default class LeapSignerProvider extends SignerProvider {
key = 'leap'
label = 'Leap Wallet'
keychangeEvent = 'leap_keystorechange'
suggestChainSupport = false
suggestChainSupport = true

enable(network){
this.setOptions({
sign: { preferNoSetFee: true }
})
return super.enable(network)
}

setOptions(options){
return _.merge(this.provider.defaultOptions, options)
}

getOptions(){
return this.provider.defaultOptions
}

handleEnableError(network, error){
switch (error?.message) {
case `Invalid chain id`:
throw new Error(`${network.prettyName} (${network.chainId}) is not supported`)
default:
super.handleEnableError(network, error)
}
}
}
}
2 changes: 1 addition & 1 deletion src/utils/SigningClient.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ function SigningClient(network, signer) {

async function signAndBroadcastWithoutBalanceCheck(address, msgs, gas, memo, gasPrice) {
let defaultOptions
if(signer.keplr.defaultOptions){
if(signer.keplr?.defaultOptions){
_.merge(signer.keplr.defaultOptions, { sign: { disableBalanceCheck: true } })
}
try {
Expand Down

0 comments on commit af3e18f

Please sign in to comment.