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: WalletConnect integration, part 6, request #2029

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dianasavvatina
Copy link
Contributor

@dianasavvatina dianasavvatina commented Oct 23, 2024

Proposed changes

requests are supported. Tested:
- send tez
- delegate / UndelegationSignPage
- originate / call contract
- stake / unstake / finalize unstake
- increase paid storage (rejected as not supported by Umami)

Types of changes

  • Bugfix
  • New feature
  • Refactor
  • Breaking change
  • UI fix

Steps to reproduce

  1. connect dapp
  2. trigger request
  3. approve or reject it

Screenshots

  • transaction
image
  • stake
image
  • unstake
image
  • finalize unstake
image
  • undelegate
image
  • staking before delegation generates error
image
  • origination
image
  • contract call
image

Checklist

  • Tests that prove my fix is effective or that my feature works have been added
  • Documentation has been added (if appropriate)
  • Screenshots are added (if any UI changes have been made)
  • All TODOs have a corresponding task created (and the link is attached to it)

Copy link

vercel bot commented Oct 23, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
umami-embed-iframe ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 12, 2024 4:17pm
umami-embed-iframe-ghostnet ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 12, 2024 4:17pm
umami-v2-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 12, 2024 4:17pm
umami-v2-web-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 12, 2024 4:17pm

@dianasavvatina dianasavvatina changed the title feat: Add handling for WalletConnect request feat: WalletConnect integration, part 3, request Nov 11, 2024
@dianasavvatina dianasavvatina marked this pull request as ready for review November 12, 2024 11:58
requests are supported. Tested:
 - send tez
 - delegate / undelegate
 - originate / call contract
 - stake / unstake / finalize unstake
import { SuccessStep } from "../SuccessStep";
import { type CalculatedSignProps, type SdkSignPageProps } from "../utils";

export const useSignWithWalletConnect = ({
Copy link
Contributor

Choose a reason for hiding this comment

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

please align the file name with the function

return openWith(<SuccessStep hash={opHash} />);
},
error => ({
description: `Failed to confirm Beacon operation: ${error.message}`,
Copy link
Contributor

Choose a reason for hiding this comment

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

Beacon operation in WC handler?


case "tezos_send": {
if (!request.params.account) {
throw new Error("Missing account in request");
Copy link
Contributor

Choose a reason for hiding this comment

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

here and in other places we need to use CustomError class for the custom errors

if (!network) {
const response = formatJsonRpcError(id, getSdkError("INVALID_EVENT").message);
await walletKit.respondSessionRequest({ topic, response });
toast({ description: `Unsupported network: ${chainId}`, status: "error" });
Copy link
Contributor

Choose a reason for hiding this comment

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

basically we can throw an CustomError and it should be handled inside handleAsyncActionUnsafe

throw new Error(`Unsupported method ${request.method}`);
}
}
// error => ({
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need this comment?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants