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: Convert Beacon types to ParamsWithKind #3035

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dianasavvatina
Copy link
Contributor

This update introduces function convertToPartialParamsWithKind to convert Beacon types, as defined in TZIP-10 and aligned with Tezos RPC, into ParamsWithKind.

The "Partial" in the function name indicates that the dApp may not have all the necessary information for a full request. As such, the dApp sends PartialTezosOperation, expecting the wallet to fill in the missing data.

Beacon types are integral to the WalletConnect interface for Tezos. In a typical flow, a dApp creates and sends a Beacon type, which the wallet then receives. The wallet usually needs to convert this data into the Taquito format and adjust parameters such as source or fee.

Given the frequency of this operation, the new function will streamline the process, making it more efficient. This function is already being used in the wallet prototype for WalletConnect.

Testing:

npm run lint
npm test

--------------------------|---------|----------|---------|---------|------------------------------
File                      | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
--------------------------|---------|----------|---------|---------|------------------------------
All files                 |   53.06 |    92.07 |   46.42 |   51.74 |
 beacon-types.ts          |     100 |      100 |     100 |     100 |
 errors.ts                |     100 |      100 |     100 |     100 |
 taquito-beacon-wallet.ts |   40.51 |    65.21 |      40 |   38.39 | 56-70,77-201,246-270,285-289
 version.ts               |     100 |      100 |     100 |     100 |
--------------------------|---------|----------|---------|---------|------------------------------

Test Suites: 2 passed, 2 total
Tests:       43 passed, 43 total

Depends on "fix: adding export for SmartRollupExecuteOutboxMessageParams" #3031

  • Your code builds cleanly without any errors or warnings
  • You have run the linter against the changes
  • You have added unit tests (if relevant/appropriate)
  • You have added integration tests (if relevant/appropriate)
  • All public methods or types have TypeDoc coverage with a complete description, and ideally an @example
  • You have added or updated corresponding documentation
  • If relevant, you have written a first draft summary describing the change for inclusion in Release Notes.

In this PR, please also make sure:

  • You have linked this PR to the issue by putting closes #TICKETNUMBER in the description box (when applicable)
  • You have added a concise description on your changes

Release Note Draft Snippet

If relevant, please write a summary of your change that will be suitable for
inclusion in the Release Notes for the next Taquito release.

Introduced a function convertToPartialParamsWithKind to convert Beacon types, PartialTezosOperation, as defined in TZIP-10 and aligned with Tezos RPC, into ParamsWithKind.

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.

1 participant