Skip to content
This repository has been archived by the owner on Aug 16, 2024. It is now read-only.

wallet-connectors: WalletConnect: Use "lower" camelCase format for transaction type #42

Merged
merged 6 commits into from
Aug 7, 2023

Conversation

bisgardo
Copy link
Contributor

@bisgardo bisgardo commented Jul 5, 2023

This apparently is the standard style used for these strings. This is achieved by using the new function getTransactionKindString in @concordium/common-sdk@9.0.0. We use a yarn resolution to override the version specified by @concordium/browser-wallet-api-helpers (Concordium/concordium-browser-wallet#324 suggests reducing this dependency to a "peer dependency").

This doesn't change anything in the Android wallet as it doesn't read the field but just assumes that it's an update transaction. The iOS implementation reads the field and supports both formats for backwards compatibility with projects using old versions of @concordium/wallet-connectors. The Android implementation must do the same when it starts supporting other transaction types.

Resolves CBW-1145.

…ansaction type

This apparently is the standard style used for these strings. We have to bypass TypeScript type checking in order to convert the `AccountTransactionType` enum to `TransactionKindString` (which is assumed to use the canonical naming) as it cannot infer that the two enums use the same keys (I suppose we should add a test in @concordium/common-sdk to ensure that it stays that way).

This doesn't change anything in the Android wallet as it doesn't read the field but just assumes that it's an `update` transaction. The iOS implementation reads the field and will support both formats for backwards compatibility with projects using old versions of @concordium/wallet-connectors. The Android implementation must do the same when it starts supporting other transaction types.
@bisgardo
Copy link
Contributor Author

bisgardo commented Jul 6, 2023

SDK fix: Concordium/concordium-node-sdk-js#220. Will use this instead once released.

@bisgardo bisgardo marked this pull request as draft July 6, 2023 22:02
This required setting a resolution for overruling the SDK version dependended on by the BW API.
@bisgardo
Copy link
Contributor Author

bisgardo commented Aug 1, 2023

SDK fix: Concordium/concordium-node-sdk-js#220. Will use this instead once released.

Done.

@bisgardo bisgardo marked this pull request as ready for review August 1, 2023 09:46
@bisgardo
Copy link
Contributor Author

bisgardo commented Aug 7, 2023

Ping @shjortConcordium @orhoj.

@bisgardo bisgardo merged commit 9a13ae0 into main Aug 7, 2023
1 check passed
@bisgardo bisgardo deleted the walletconnect/fix-transaction-type-format branch August 7, 2023 09:02
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.

2 participants