Skip to content
This repository was archived by the owner on Dec 17, 2024. It is now read-only.

MUWPay/multitoken-payment-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Multitoken payment demo:

  • This is the demo package implementation of the workflow for muwpay, to allow users with multiple tokens (from single wallet) to be able to swap across aggregators, and able to fetch the token in final denomination , and then transfer and gets the finality of the transaction.

Packages used

Workflow:

  1. We get the Quotation of the potential multi token paths by considering parallel executions of the token address .

  2. Then based on the potential route path returned by the Lifi, we will then

  • Create the smartAccount of the user.
  • Using the smartAccount's sendBatchTransfer to do batch approval for spending of the tokens to the spender address(ie the intermediate exchange address that want to spend the user tokens for the swap and then transfer if the exchange is successful, or to fetch the result ).
  • Also for the cross-chain bridge transfers: based on the nature of bridge (whether user will have to claim the transaction and pay the fees), we can also create the encoded transaction that will be signed by the wallet address and then delegated to the relayer.
    • And then based on the actual execution status is passed, we then can execute the transaction without affecting the UX workflow and switches of the transaction.
  1. Now once the token approval for all the intermediate adddress for the given amount is done, we will then run the execution, here unlike the previous operations you will not have to

Running the script:

  1. Adding the .env parameters (as defined in the .env.example).

  2. run the command as follows:

$ ts-node scripts/test_priv_key.ts

About

script for demonstrating the basic multitoken swap transaction.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors