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

Supporting versioned transactions in WalletConnect #777

Merged
merged 11 commits into from
Jun 20, 2023

Conversation

jnwng
Copy link
Contributor

@jnwng jnwng commented May 12, 2023

depends on a full release of @jnwng/walletconnect-solana

by spec, WalletConnect v2 does not technically fully support versioned transactions.

however, since we can cast legacy transactions as deprecated Transactions, we can fulfill the spec and relay legacy transactions.

v0 transactions are not officially supported in that specification, but the addition of a serialized transaction parameter in WalletConnect/walletconnect-solana-adapter#9 means we can support v0 (and theoretically any future version) by serializing the transaction as a parameter, and allowing wallets to handle whether they support that particular version. this is much more flexible than the current format that requires hydration of all information prior to transmission to the network

@changeset-bot
Copy link

changeset-bot bot commented May 12, 2023

🦋 Changeset detected

Latest commit: 8ededf0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@solana/wallet-adapter-walletconnect Patch
@solana/wallet-adapter-wallets Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@jnwng jnwng changed the title Supporting versioned transactions Supporting versioned transactions in WalletConnect May 12, 2023
@socket-security
Copy link

socket-security bot commented May 12, 2023

👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

Next steps

Take a deeper look at the dependency

Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev.

Remove the package

If you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency.

Mark a package as acceptable risk

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of package-name@version specifiers. e.g. @SocketSecurity ignore foo@1.0.0 bar@* or ignore all packages with @SocketSecurity ignore-all

@jnwng
Copy link
Contributor Author

jnwng commented May 12, 2023

bumping this package because of the addition of the supportedTransactionVersions + the version bump in @jnwng/walletconnect-solana

@jnwng jnwng marked this pull request as ready for review May 12, 2023 00:30
@jordaaash
Copy link
Collaborator

This might be neither here nor there, but it feels like the WC2 spec for solana_signTransaction is unnecessarily brittle here. Why does it represent transactions with JSON fields instead of just encoded bytes? Serialization of the transaction shouldn't be a concern for the transmission layer, as it's just wiring it to a wallet, and this particular serialization format has no meaning outside of convention in web3.js.

Copy link
Collaborator

@jordaaash jordaaash left a comment

Choose a reason for hiding this comment

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

Just a few small things, looks like some of the changes are just related to testing.

packages/wallets/walletconnect/package.json Outdated Show resolved Hide resolved
packages/starter/example/next.config.js Outdated Show resolved Hide resolved
packages/wallets/walletconnect/package.json Outdated Show resolved Hide resolved
packages/wallets/walletconnect/package.json Outdated Show resolved Hide resolved
@jnwng jnwng force-pushed the jw/v0-transactions branch from 92cfd38 to 0efd8db Compare May 28, 2023 15:50
@jnwng jnwng requested a review from jordaaash May 28, 2023 15:56
Copy link
Collaborator

@jordaaash jordaaash left a comment

Choose a reason for hiding this comment

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

Looks good!

@lexer
Copy link

lexer commented Jun 5, 2023

Let's go! :)

@socket-security
Copy link

New and updated dependency changes detected. Learn more about Socket for GitHub ↗︎

Packages Version New capabilities Transitives1 Size Publisher
@walletconnect/types 🆕 2.7.7 None +2 572 kB gancho_walletconnect
@jnwng/walletconnect-solana ⬆️ 0.1.5...0.2.0 None +3/-10 507 kB jnwng

🚮 Removed packages: turbo@1.8.8

Footnotes

  1. https://docs.socket.dev

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.

3 participants