Skip to content

Commit

Permalink
1151 mayachain synth balances (#1152)
Browse files Browse the repository at this point in the history
* Mayachain synth assets bug fix

* Changeset version file
  • Loading branch information
0xp3gasus authored May 14, 2024
1 parent 582d682 commit dd3b45d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/late-pumpkins-arrive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@xchainjs/xchain-mayachain': patch
---

Get balance with synth assets bug fix
2 changes: 1 addition & 1 deletion packages/xchain-mayachain/__tests__/client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ describe('Mayachain client', () => {
})
it('Should get asset for denom', () => {
expect(client.assetFromDenom('cacao')).toEqual(AssetCacao)
expect(client.assetFromDenom('bnb/bnb')).toEqual(null)
expect(client.assetFromDenom('bnb/bnb')).toEqual({ chain: 'BNB', symbol: 'BNB', synth: true, ticker: 'BNB' })
})
it('should get asset decimals', async () => {
expect(client.getAssetDecimals(AssetCacao)).toBe(10)
Expand Down
4 changes: 2 additions & 2 deletions packages/xchain-mayachain/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
makeClientPath,
} from '@xchainjs/xchain-cosmos-sdk'
import { getSeed } from '@xchainjs/xchain-crypto'
import { Address, Asset, BaseAmount, eqAsset } from '@xchainjs/xchain-util'
import { Address, Asset, BaseAmount, assetFromString, eqAsset } from '@xchainjs/xchain-util'
import { encode, toWords } from 'bech32'
import BigNumber from 'bignumber.js'
import { fromSeed } from 'bip32'
Expand Down Expand Up @@ -214,7 +214,7 @@ export class Client extends CosmosSDKClient implements MayachainClient {
public assetFromDenom(denom: string): Asset | null {
if (denom === CACAO_DENOM) return AssetCacao
if (denom === MAYA_DENOM) return AssetMaya
return null
return assetFromString(denom.toUpperCase())
}

/**
Expand Down

0 comments on commit dd3b45d

Please sign in to comment.