Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

json rpc for swap tokens takes u128 as argument #909

Open
nuel77 opened this issue Feb 5, 2024 · 0 comments
Open

json rpc for swap tokens takes u128 as argument #909

nuel77 opened this issue Feb 5, 2024 · 0 comments
Assignees
Labels
bug Something isn't working un-confirmed Issue is not confirmed by Polkadex team

Comments

@nuel77
Copy link
Member

nuel77 commented Feb 5, 2024

Both the below methods takes u128 as type for the amount.

pub trait PolkadexSwapRpcApi<BlockHash> {
	#[method(name = "tx_quotePriceExactTokensForTokens")]
	async fn quote_price_exact_tokens_for_tokens(
		&self,
		asset_id1: String,
		asset_id2: String,
		amount: u128,
		include_fee: bool,
	) -> RpcResult<Option<u128>>;

	#[method(name = "tx_quotePriceTokensForExactTokens")]
	async fn quote_price_tokens_for_exact_tokens(
		&self,
		asset_id1: String,
		asset_id2: String,
		amount: u128,
		include_fee: bool,
	) -> RpcResult<Option<u128>>;
}

Since this in ecoded as json rpc, u128 can fail deserialization for very large numbers as this is not supported in json.

@nuel77 nuel77 added bug Something isn't working un-confirmed Issue is not confirmed by Polkadex team labels Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working un-confirmed Issue is not confirmed by Polkadex team
Projects
None yet
Development

No branches or pull requests

2 participants