Skip to content

Conversation

@slycompiler
Copy link

When we tried do-swap with mayachain-amm for real asset in EVM chains, it failes swapping.
So, I added approveRouter in mayachain-amm test file, it works well

Thorian1te
Thorian1te previously approved these changes Feb 16, 2025
Copy link
Collaborator

@Thorian1te Thorian1te left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

left a comment

@Thorian1te Thorian1te dismissed their stale review February 16, 2025 23:28

build failed

* @param {Asset} asset to check
* @returns true if asset is ERC20, otherwise, false
*/
export const isProtocolERC20Asset = (asset: CompatibleAsset): asset is TokenAsset => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this function can be imported from the package
isProtocolERC20Asset no need to rewrite it here

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, mayachain-amm package not export this function

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

mayachain-amm package only export types and mayachain-amm files.
but isProtocolERC20Asset implement in ./utils file.
so to import this, we should export ./utils file

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay let me fix this

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Btw the swap flow is meant to be like this
Estimate swap => (in here it will check for approval via validateSwap() ) => asset needs approval ? call approve() : doSwap()

its all clearly laid out in the read me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants