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

[Web][UMA-1123] WalletConnect reports unsupported method correctly #2380

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions packages/core/src/beaconUtils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { type PartialTezosOperation, TezosOperationType } from "@airgap/beacon-wallet";
import { isValidImplicitPkh, parseImplicitPkh, parsePkh } from "@umami/tezos";
import { CustomError } from "@umami/utils";
import { WalletConnectError, WcErrorCode } from "@umami/utils";

import { type ImplicitAccount } from "./Account";
import { type ImplicitOperations } from "./AccountOperations";
Expand All @@ -19,7 +19,7 @@ export const toAccountOperations = (
signer: ImplicitAccount
): ImplicitOperations => {
if (operationDetails.length === 0) {
throw new CustomError("Empty operation details!");
throw new WalletConnectError("Empty operation details!", WcErrorCode.INVALID_PARAMS, null);
}

const operations = operationDetails.map(operation =>
Expand Down Expand Up @@ -106,6 +106,10 @@ export const partialOperationToOperation = (
};
}
default:
throw new CustomError(`Unsupported operation kind: ${partialOperation.kind}`);
throw new WalletConnectError(
`Unsupported operation kind: ${partialOperation.kind}`,
WcErrorCode.METHOD_UNSUPPORTED,
null
);
}
};
Loading