Skip to content

Commit

Permalink
revert change for getting decimals in destination fees, due to an err…
Browse files Browse the repository at this point in the history
…or (#157)

* revert change for getting decimals in destination fees, due to an error

* add changeset
  • Loading branch information
mmaurello authored Nov 2, 2023
1 parent 7337008 commit 7103bb0
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 14 deletions.
6 changes: 6 additions & 0 deletions .changeset/quiet-hotels-exist.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@moonbeam-network/xcm-config': patch
'@moonbeam-network/xcm-sdk': patch
---

Revert decimals change in destination fee
2 changes: 1 addition & 1 deletion packages/config/src/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ export const bifrostKusama = new Parachain({
name: 'Bifrost',
parachainId: 2001,
ss58Format: 6,
ws: 'wss://bifrost-rpc.liebi.com/ws',
ws: 'wss://us.bifrost-rpc.liebi.com/ws',
});

export const bifrostPolkadot = new Parachain({
Expand Down
8 changes: 4 additions & 4 deletions packages/config/src/configs/bifrostPolkadot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ export const bifrostPolkadotConfig = new ChainConfig({
balance: BalanceBuilder().substrate().tokens().accounts(),
destination: moonbeam,
destinationFee: {
amount: 0.01,
asset: vdot,
balance: BalanceBuilder().substrate().tokens().accounts(),
amount: 0.2,
asset: bnc,
balance: BalanceBuilder().substrate().system().account(),
},
extrinsic: ExtrinsicBuilder().xTokens().transfer(),
extrinsic: ExtrinsicBuilder().xTokens().transferMultiCurrencies(),
fee: {
asset: bnc,
balance: BalanceBuilder().substrate().system().account(),
Expand Down
11 changes: 2 additions & 9 deletions packages/sdk/src/getTransferData/getDestinationData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,12 @@ export interface GetFeeParams {
}

export async function getFee({
address,
config,
evmSigner,
polkadot,
}: GetFeeParams): Promise<AssetAmount> {
const { amount, asset } = config.source.config.destinationFee;
const decimals = await getDecimals({
address,
asset,
config: config.destination.config,
evmSigner,
polkadot,
});
// TODO we have to consider correctly here when an asset is ERC20 to get it from contract
const decimals = await polkadot.getAssetDecimals(asset);
const zeroAmount = AssetAmount.fromAsset(asset, {
amount: 0n,
decimals,
Expand Down

0 comments on commit 7103bb0

Please sign in to comment.