pendulum-chain / vortex

https://app.vortexfinance.co/
1 stars 1 forks source link

Add Asset Hub Flow #283

Open TorstenStueber opened 1 week ago

TorstenStueber commented 1 week ago

For offramping Asset Hub USDC, we need to implement a new flow structure that starts with the Asset Hub.

Different flow structures will also imply that other parts of the code are more generic, e.g., the OfframpingState type.

Proposal

Note

The new flow structure is not explicitly defined in the file src/services/offrampingFlow.ts but implicitly defined by the successor phase returned in every phase handler.

Whereas the initial structure of the evm-moonbeam flow is:

the structure for the Asset Hub flow is:

TorstenStueber commented 1 week ago

Hey team! Please add your planning poker estimate with Zenhub @ebma @gianfra-t @Sharqiewicz

TorstenStueber commented 1 week ago

To be discussed: how identify the Asset Hub user and derive the memo for sep10 (https://github.com/pendulum-chain/vortex/pull/257)

ebma commented 1 week ago

We can use the same function @gianfra-t implemented for the EVM accounts and just pass the Polkadot address. We need to make sure that we pass the addresses using the same ss58 encoding and we don't mix it up ending with different memos for the same account.

TorstenStueber commented 1 week ago

That makes sense, but I also meant the signing part. Do Polkadot wallets also have a standardized API to sign arbitrary messages? (I guess so, this happens on Polkassembly for example).

gianfra-t commented 1 week ago

I think so, we will use also the talisman package as in the portal right? In the only example of the package they show a message sign.

TorstenStueber commented 1 week ago

I am not familiar with the Talisman package. That works with every Polkadot wallet, not just with Talisman?

gianfra-t commented 1 week ago

If I understand correctly, yes, it's our wagmi for Polkadot on the Portal.

ebma commented 1 week ago

Polkadot.js supports signing arbitrary messages, see the docs here. As we can't do const alice = keyring.addFromUri('//Alice'); but instead need to access the signer from the wallet, we can use talisman for that. But this is quite straightforward so once #271 is added and a polkadot signer is available, it's just a simple function call.