Skip to content

Commit

Permalink
Merge branch 'main' into riha/get-balance-by-chain-and-token
Browse files Browse the repository at this point in the history
  • Loading branch information
Rihyx authored Mar 19, 2024
2 parents 9a2efe9 + 201d603 commit 00ca37a
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/sdk-simple/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"license": "MIT",
"dependencies": {
"@moonbeam-network/xcm-config": "2.0.4",
"@moonbeam-network/xcm-sdk": "2.0.4",
"@moonbeam-network/xcm-sdk": "2.0.5",
"@moonbeam-network/xcm-utils": "2.0.1"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions packages/sdk/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @moonbeam-network/xcm-sdk

## 2.0.5

### Patch Changes

- [#218](https://github.com/moonbeam-foundation/xcm-sdk/pull/218) [`40ea2de16415e5e5fe340f9a7472680fd4e5ffaa`](https://github.com/moonbeam-foundation/xcm-sdk/commit/40ea2de16415e5e5fe340f9a7472680fd4e5ffaa) Thanks [@ekenigs](https://github.com/ekenigs)! - Fixed get decimals for HydraDX

## 2.0.4

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@moonbeam-network/xcm-sdk",
"version": "2.0.4",
"version": "2.0.5",
"description": "The Moonbeam XCM SDK enables developers to easily deposit and withdraw assets to Moonbeam/Moonriver from the relay chain and other parachains in the Polkadot/Kusama ecosystem",
"scripts": {
"build": "tsup",
Expand Down
2 changes: 2 additions & 0 deletions packages/sdk/src/polkadot/PolkadotService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ export class PolkadotService {
): Promise<{ symbol: string; decimals: number } | undefined> {
const fn =
this.api.query.assets?.metadata ||
this.api.query.assetRegistry?.assets ||
this.api.query.assetRegistry?.metadata ||
this.api.query.assetRegistry?.currencyMetadatas ||
this.api.query.assetRegistry?.assetMetadatas ||
Expand Down Expand Up @@ -136,6 +137,7 @@ export class PolkadotService {

async getAssetDecimals(asset: Asset): Promise<number> {
const metaId = this.chain.getMetadataAssetId(asset);

return (
this.chain.getAssetDecimals(asset) ||
(await this.getAssetDecimalsFromQuery(metaId)) ||
Expand Down

0 comments on commit 00ca37a

Please sign in to comment.