Open TorstenStueber opened 1 week ago
Hey team! Please add your planning poker estimate with Zenhub @ebma @gianfra-t @Sharqiewicz
To be discussed: how identify the Asset Hub user and derive the memo for sep10 (https://github.com/pendulum-chain/vortex/pull/257)
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.
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).
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.
I am not familiar with the Talisman package. That works with every Polkadot wallet, not just with Talisman?
If I understand correctly, yes, it's our wagmi
for Polkadot on the Portal.
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.
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
OfframpingState
for the new flowsquidRouterApproveHash
,squidRouterSwapHash
,moonbeamXcmTransactionHash
will not be required but they are defined as optional anywaysquidRouterReceiverId
andsquidRouterReceiverHash
are determined inconstructInitialState
but we can keep this logic as we can use it to show a unique id to the user (https://github.com/pendulum-chain/vortex/issues/193)OfframpingState
that describes the type of flow (e.g.,"type": "evmMoonbeam" | "assetHub"
)assetHubXcm
and a handlerWeightLimit: Unlimited
subsidizePreSwap
squidRouterSwapHash
evm transaction from thependulumFundEphemeral
phase handlerprepareTransactions
phase handler proceed tosquidRouter
ifstate.type === "evmMoonbeam"
pendulumFundEphemeral
ifstate.type === "assetHub"
pendulumFundEphemeral
phase handler proceed toexecuteXCM
ifstate.type === "evmMoonbeam"
assetHubXcm
ifstate.type === "assetHub"
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:
prepareTransactions
squidRouter
pendulumFundEphemeral
executeXCM
subsidizePreSwap
the structure for the Asset Hub flow is:
prepareTransactions
pendulumFundEphemeral
assetHubXcm
subsidizePreSwap