Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(onramp-kit): Monerium integration #372

Merged
merged 75 commits into from
May 11, 2023

Conversation

yagopv
Copy link
Member

@yagopv yagopv commented Mar 31, 2023

What it solves

Resolves #376

How this PR fixes it

We are creating a new pack allowing users to integrate the Safe with Monerium. An example integration can be explored here

We are implementing our common interface providing the following methods:

  • init(MoneriumPack) - Allow to initialize the kit with the MoneriumPack. We are going to provide the clientId and choose the Monerium environment to work with (sandbox or production)
  • open(MoneriumOpenOptions) - We are going to start the Monerium flow in 3 ways:
    • Redirecting to the Monerium website and let the user login and provide access to the resources
    • By providing an authCode in the open options to exchange and get access to the resources
    • By providing a refreshToken in the open options to authenticate and get access to the resources
  • subscribe(event, handler) / unsubscribe(event) - Once authenticated this methods allow the user to establish a socket connection with the Monerium servers and listen for order status changes
  • close() - To cleanup the connection with Monerium

How to test it

Use Cases

  1. Signin/Signup and link a 1/1 Safe. Should bind the Safe and autoexecute transactions as only the Web3Auth signer is required (Remember to send funds to the owner address as it will need them to autoexecute the txs)
  2. Signin/Signup and link a 2/X Safe. Should bind the Safe and propose the signMessage transaction. Other signers should go to the Safe to sign
  3. Send transactions (default to 1 EURe) between Monerium sandbox accounts and check they arrive. Same as 1) and 2) txs should autoexecute or require additional signers (In the Safe UI)

Read integration notes and attached videos to check how the example behaves

@yagopv yagopv requested a review from dasanra March 31, 2023 12:38
Base automatically changed from protocol-kit-split to development April 3, 2023 12:00
@dasanra dasanra linked an issue Apr 20, 2023 that may be closed by this pull request
5 tasks
@yagopv yagopv self-assigned this May 5, 2023
@yagopv yagopv requested a review from dasanra May 8, 2023 21:04
Comment on lines 82 to 93
const isMessagePending = pendingTransactions.results.some((tx) => {
if (
// @ts-expect-error - dataDecoded should have the method property
tx?.dataDecoded?.method === 'signMessage' &&
// @ts-expect-error - dataDecoded should have the parameters array
tx?.dataDecoded?.parameters[0]?.value === ethers.utils.hashMessage(message)
) {
return true
}

return false
})
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
const isMessagePending = pendingTransactions.results.some((tx) => {
if (
// @ts-expect-error - dataDecoded should have the method property
tx?.dataDecoded?.method === 'signMessage' &&
// @ts-expect-error - dataDecoded should have the parameters array
tx?.dataDecoded?.parameters[0]?.value === ethers.utils.hashMessage(message)
) {
return true
}
return false
})
const isMessagePending = pendingTransactions.results.some((tx) => (
// @ts-expect-error - dataDecoded should have the method property
tx?.dataDecoded?.method === 'signMessage' &&
// @ts-expect-error - dataDecoded should have the parameters array
tx?.dataDecoded?.parameters[0]?.value === ethers.utils.hashMessage(message)
))

@DaniSomoza DaniSomoza merged commit fb98dc5 into development May 11, 2023
12 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators May 11, 2023
@DaniSomoza DaniSomoza deleted the feat/monerium-integration branch May 11, 2023 16:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Monerium support
3 participants