-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Avoid checking `ethBridge.bridgePaused` status when it's Deposit * Explicitly using assetId to check if it's CPAY * Move BRIDGE / PEG contract addresses to `constants.ts` * Add default timeout value to be `1000` instead of zero * Use `sellAsset` extrinsic to allow fluctuating the receiving token * Update Slippage value and message to match with the `sellAsset` extrinsic * Add >= and <= symbols in front of Slippage * Update messaging around Slippage * Ensure clearing the interval before rejecting error
- Loading branch information
1 parent
32a41cf
commit 2d4771e
Showing
14 changed files
with
85 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { CENNZAsset } from "@/types"; | ||
import { Api } from "@cennznet/api"; | ||
import { SubmittableExtrinsic } from "@cennznet/api/types"; | ||
import { Balance } from "@/utils"; | ||
|
||
// TODO: Need test | ||
export default function getSellAssetExtrinsic( | ||
api: Api, | ||
exchangeAssetId: CENNZAsset["assetId"], | ||
exchangeAssetValue: Balance, | ||
receiveAssetId: CENNZAsset["assetId"], | ||
receivedAssetValue: Balance, | ||
slippage: number | ||
): SubmittableExtrinsic<"promise"> { | ||
return api.tx.cennzx.sellAsset( | ||
null, | ||
exchangeAssetId, | ||
receiveAssetId, | ||
exchangeAssetValue.toFixed(0), | ||
receivedAssetValue.decrease(slippage).toFixed(0) | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters