Skip to content

Commit

Permalink
Merge pull request #644 from eco-stake/rebus-support
Browse files Browse the repository at this point in the history
Rebus support
  • Loading branch information
tombeynon authored Oct 13, 2022
2 parents 314d865 + e317bd3 commit d93c16d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/components/Coins.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import _ from 'lodash'
import { divide, bignumber, round } from 'mathjs'
import { divide, bignumber, round, format } from 'mathjs'

function Coins(props) {
const { asset, coins, fullPrecision, inBaseDenom, hideValue, className } = props
Expand All @@ -10,7 +10,7 @@ function Coins(props) {
if(inBaseDenom) return coins.amount

const prec = precision(coins, decimals)
return round(divide(bignumber(coins.amount), Math.pow(10, decimals)), prec).toLocaleString(undefined, { maximumFractionDigits: prec })
return format(round(divide(bignumber(coins.amount), Math.pow(10, decimals)), prec), {notation: 'fixed'}).toLocaleString(undefined, { maximumFractionDigits: prec })
}

function value(coins){
Expand Down
3 changes: 3 additions & 0 deletions src/networks.json
Original file line number Diff line number Diff line change
Expand Up @@ -248,5 +248,8 @@
"average": 0.025,
"high": 0.04
}
},
{
"name": "rebus"
}
]
3 changes: 1 addition & 2 deletions src/utils/Network.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,7 @@ class Network {
bech32PrefixConsPub: this.prefix + "valconspub"
},
currencies: [currency],
feeCurrencies: [currency],
gasPriceStep: this.gasPriceStep
feeCurrencies: [{...currency, gasPriceStep: this.gasPriceStep }]
}
if(this.data.keplrFeatures){
data.features = this.data.keplrFeatures
Expand Down
10 changes: 6 additions & 4 deletions src/utils/SigningClient.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -279,14 +279,14 @@ function SigningClient(network, signer) {
if (!accountFromSigner) {
throw new Error("Failed to retrieve account from signer");
}
const pubkey = accountFromSigner.pubkey;
const signerPubkey = accountFromSigner.pubkey;
return AuthInfo.encode({
signerInfos: [
{
publicKey: {
typeUrl: pubkeyTypeUrl(),
typeUrl: pubkeyTypeUrl(account.pub_key),
value: PubKey.encode({
key: pubkey,
key: signerPubkey,
}).finish(),
},
sequence: Long.fromNumber(sequence, true),
Expand All @@ -297,7 +297,9 @@ function SigningClient(network, signer) {
}).finish()
}

function pubkeyTypeUrl(){
function pubkeyTypeUrl(pub_key){
if(pub_key && pub_key['@type']) return pub_key['@type']

if(network.path === 'injective'){
return '/injective.crypto.v1beta1.ethsecp256k1.PubKey'
}
Expand Down

0 comments on commit d93c16d

Please sign in to comment.