Skip to content

Commit

Permalink
fix: remove any from rpc
Browse files Browse the repository at this point in the history
[only @mangata-finance/sdk]
  • Loading branch information
devdanco committed Nov 22, 2023
1 parent 88458d7 commit d4111d6
Show file tree
Hide file tree
Showing 12 changed files with 16 additions and 20 deletions.
10 changes: 5 additions & 5 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion packages/sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"@polkadot/types": "10.9.1"
},
"devDependencies": {
"@mangata-finance/types": "2.0.1-feature-3rdparty-rewards-merge.12"
"@mangata-finance/types": "2.0.1-feature-3rdparty-rewards-merge.13"
},
"dependencies": {
"@mangata-finance/type-definitions": "2.0.1-feature-3rdparty-rewards-merge.0",
Expand Down
6 changes: 1 addition & 5 deletions packages/sdk/src/methods/rpc/calculateBuyPrice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ export const calculateBuyPrice = async (
});
const api = await instancePromise;
const { inputReserve, outputReserve, amount } = args;
const price = await (api.rpc as any).xyk.calculate_buy_price(
inputReserve,
outputReserve,
amount
);
const price = await api.rpc.xyk.calculate_buy_price(inputReserve, outputReserve, amount)
return new BN(price);
};
2 changes: 1 addition & 1 deletion packages/sdk/src/methods/rpc/calculateBuyPriceId.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const calculateBuyPriceId = async (
amount: amount.toString()
});
const api = await instancePromise;
const price = await (api.rpc as any).xyk.calculate_buy_price_id(
const price = await api.rpc.xyk.calculate_buy_price_id(
soldTokenId,
boughtTokenId,
amount
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/src/methods/rpc/calculateRewardsAmount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const calculateRewardsAmount = async (
});
const api = await instancePromise;
const { address, liquidityTokenId } = args;
const rewards = await (api.rpc as any).xyk.calculate_rewards_amount(
const rewards = await api.rpc.xyk.calculate_rewards_amount(
address,
liquidityTokenId
);
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/src/methods/rpc/calculateSellPrice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const calculateSellPrice = async (
});
const api = await instancePromise;
const { inputReserve, outputReserve, amount } = args;
const price = await (api.rpc as any).xyk.calculate_sell_price(
const price = await api.rpc.xyk.calculate_sell_price(
inputReserve,
outputReserve,
amount
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/src/methods/rpc/calculateSellPriceId.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const calculateSellPriceId = async (
amount: amount.toString()
});
const api = await instancePromise;
const price = await (api.rpc as any).xyk.calculate_sell_price_id(
const price = await api.rpc.xyk.calculate_sell_price_id(
soldTokenId,
boughtTokenId,
amount
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/src/methods/rpc/getBurnAmount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const getBurnAmount = async (
});
const api = await instancePromise;
const { firstTokenId, secondTokenId, amount } = args;
const result = await (api.rpc as any).xyk.get_burn_amount(
const result = await api.rpc.xyk.get_burn_amount(
firstTokenId,
secondTokenId,
amount
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const getLiquidityTokensForTrading = async (
) => {
logger.info("getLiquidityTokensForTrading");
const api = await instancePromise;
const lpTokens = await (api.rpc as any).xyk.get_liq_tokens_for_trading()
const lpTokens = await api.rpc.xyk.get_liq_tokens_for_trading()
const lpTokensForTrading: string[] = lpTokens.map((item: any) => item.toString());
return lpTokensForTrading
};
2 changes: 1 addition & 1 deletion packages/sdk/src/methods/rpc/getTradeableTokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const getTradeableTokens = async (
) => {
logger.info("getTradeableTokens");
const api = await instancePromise;
const tokens = await (api.rpc as any).xyk.get_tradeable_tokens()
const tokens = await api.rpc.xyk.get_tradeable_tokens()
const tradeableTokens: TradeAbleTokens[] = tokens.map((item: any) => ({
tokenId: item.tokenId.toString(),
decimals: parseInt(item.decimals, 10),
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/src/methods/rpc/isBuyAssetLockFree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const isBuyAssetLockFree = async (
amount: amount.toString()
});
const api = await instancePromise;
const result = await (api.rpc as any).xyk.is_buy_asset_lock_free(
const result = await api.rpc.xyk.is_buy_asset_lock_free(
tokenIds,
amount
);
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/src/methods/rpc/isSellAssetLockFree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const isSellAssetLockFree = async (
amount: amount.toString()
});
const api = await instancePromise;
const result = await (api.rpc as any).xyk.is_sell_asset_lock_free(
const result = await api.rpc.xyk.is_sell_asset_lock_free(
tokenIds,
amount
);
Expand Down

0 comments on commit d4111d6

Please sign in to comment.