Skip to content

Commit

Permalink
update network & xcm fees (#1373)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikita-Polyakov authored Apr 1, 2024
1 parent 205d12a commit 136ffd8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/consts/sub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,13 +160,13 @@ export const SUB_TRANSFER_FEES: SubNetworksFees = {
},
[SubNetworkId.Kusama]: {
KSM: {
[BridgeTxDirection.Outgoing]: '92003956',
[BridgeTxDirection.Outgoing]: '78327426',
[BridgeTxDirection.Incoming]: '0',
},
},
[SubNetworkId.Polkadot]: {
DOT: {
[BridgeTxDirection.Outgoing]: '21062795',
[BridgeTxDirection.Outgoing]: '19978738',
[BridgeTxDirection.Incoming]: '0',
},
},
Expand Down
10 changes: 5 additions & 5 deletions src/utils/bridge/sub/classes/adapters/relaychain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ export class RelaychainAdapter extends SubAdapter {
switch (this.subNetwork) {
case SubNetworkId.Rococo:
// Hardcoded value for Rococo - 0.000125 ROC
return '125810197';
return new FPNumber(0.000125, asset.externalDecimals).toCodecString();
case SubNetworkId.Kusama:
// Hardcoded value for Kusama - 0.0007 KSM
return '700000000';
// Hardcoded value for Kusama - 0.002 KSM
return new FPNumber(0.002, asset.externalDecimals).toCodecString();
case SubNetworkId.Polkadot:
// Hardcoded value for Polkadot - 0.01836 DOT
return '183600000';
// Hardcoded value for Polkadot - 0.02236 DOT
return new FPNumber(0.02236, asset.externalDecimals).toCodecString();
default:
return '0';
}
Expand Down
11 changes: 9 additions & 2 deletions src/utils/bridge/sub/classes/history.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,14 @@ class SubBridgeHistory extends SubNetworksConnector {
}

public async updateAccountHistory(
network: SubNetwork,
address: string,
inProgressIds: Record<string, boolean>,
assetDataByAddress: (address?: Nullable<string>) => Nullable<RegisteredAccountAsset>,
updateCallback?: FnWithoutArgs | AsyncFnWithoutArgs
): Promise<void> {
try {
const transactions = await subBridgeApi.getUserTransactions(address, this.network.subNetwork);
const transactions = await subBridgeApi.getUserTransactions(address, network);

if (!transactions.length) return;

Expand Down Expand Up @@ -573,7 +574,13 @@ export const updateSubBridgeHistory =
await subBridgeHistory.clearHistory(networkSelected as SubNetwork, inProgressIds, updateCallback);
}

await subBridgeHistory.updateAccountHistory(address, inProgressIds, assetDataByAddress, updateCallback);
await subBridgeHistory.updateAccountHistory(
networkSelected as SubNetwork,
address,
inProgressIds,
assetDataByAddress,
updateCallback
);
} catch (error) {
console.error(error);
}
Expand Down

0 comments on commit 136ffd8

Please sign in to comment.