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

SPIKE: Review WalletAPI design to see how we could support additional operations #2639

Closed
Innkst opened this issue Sep 6, 2023 · 8 comments
Assignees
Milestone

Comments

@Innkst
Copy link
Contributor

Innkst commented Sep 6, 2023

What are the goals of the research?
Our users have been asking about more operations to be supported by Wallet API.
We see more users asking for more operations within the last three months.
Some of them are already supported by Beacon SDK (reveal, proposal, ballot). The other ones are not at the moment (add smart rollup, transfer ticket).

Based on a quick previous review, Wallet API supports multisig via instantiation of Wallet API using a smart contract address. That limits us since other operations need to use implicit account addresses to execute them.

Acceptance criteria:

  1. Review the current design and its limitations for supporting new Wallet API operations:
  2. Suggest new design options and discuss them with the team to finalize the decision
    • Include discussion on which operations are easier to do vs. harder if it makes any difference
    • Double-check if Beacon SDK supports adding my smart rollup and transfer ticket by the time we work on this issue
    • Provide high-level estimation to support each of the operations
  3. Document research results and work with PM on adding implementation user story (need to discuss which operations to start with and which ones are easier to do.

OUT OF SCOPE:
Implementation

@Innkst Innkst added this to the v18.1 milestone Sep 6, 2023
@hui-an-yang
Copy link
Collaborator

New info is with abstracted account (proof of event) in wallet, might want to evaluate the value and tradeoff for walletAPI to support more operations

@CapTake
Copy link

CapTake commented Jan 20, 2024

Please add method to send tickets from implicit account to other implicit account or contract using a Taquito wallet API, currently it seems not possible. It does work with in memory signer though.

@CapTake
Copy link

CapTake commented Jan 21, 2024

consider this simple contract:

type proxy_to = {
    ticket: ticket<string>,
    to_: address,
}

@entry
const main = (p: proxy_to, _: unit): [list<operation>, unit] => {
    let { ticket, to_ } = p;
    const contract: contract<ticket<string>> = Option.value_exn("Bad receiver", Tezos.get_contract_opt(to_));
    return [
        list([Tezos.transaction(ticket, Tezos.get_amount(), contract)]),
        []
    ]
}

Is there a way to call it with current wallet API in Taquito? Maybe there is a workaround to somehow forge operation manually?

@hui-an-yang
Copy link
Collaborator

Hello @CapTake

Yes current walletAPI support making contract calls, pseudo code will look like below

    let contract = await Tezos.wallet.at('KT1...')
    let op = await contract.methodsObject.default({ticket: 'ticket', to_: 'to'}).send();
    await op.confirmation()
    console.log(op.operationResults)

@CapTake
Copy link

CapTake commented Jan 23, 2024

Hello @CapTake

Yes current walletAPI support making contract calls, pseudo code will look like below

    let contract = await Tezos.wallet.at('KT1...')
    let op = await contract.methodsObject.default({ticket: 'ticket', to_: 'to'}).send();
    await op.confirmation()
    console.log(op.operationResults)

This example doesn't work for me, sorry. And it is unclear what ticket in particular does it sends. Because there is no reference to the actual ticket In the code, ticketer and ticket content are not referenced. Maybe I misunderstood it? Can you please make a more "complete" example?

@hui-an-yang
Copy link
Collaborator

Would be great if you can provide the Michelson code or contract address on testnets that we'll know better how to construct the entrypoint parameter to make this contract call.

@CapTake
Copy link

CapTake commented Jan 25, 2024

Would be great if you can provide the Michelson code or contract address on testnets that we'll know better how to construct the entrypoint parameter to make this contract call.

{ parameter (pair (ticket %ticket (pair string bytes)) (address %to_)) ;
  storage unit ;
  code { CAR ;
         UNPAIR ;
         SWAP ;
         CONTRACT (ticket (pair string bytes)) ;
         PUSH string "Bad receiver address" ;
         SWAP ;
         IF_NONE { FAILWITH } { SWAP ; DROP } ;
         UNIT ;
         NIL operation ;
         DIG 2 ;
         AMOUNT ;
         DIG 4 ;
         TRANSFER_TOKENS ;
         CONS ;
         PAIR } }

Here is the code. And ticket content is: pair string bytes

@hui-an-yang hui-an-yang modified the milestones: v19.1, v20+ Mar 7, 2024
@dsawali dsawali modified the milestones: v20+, 20.1 Jun 4, 2024
@ac10n ac10n moved this to To do in Taquito Dev Jun 21, 2024
@dsawali dsawali moved this from To do to In progress in Taquito Dev Jun 21, 2024
@dsawali dsawali self-assigned this Jun 21, 2024
@dsawali dsawali moved this from In progress to Done in Taquito Dev Jun 27, 2024
@hui-an-yang hui-an-yang moved this from Done to To do in Taquito Dev Oct 2, 2024
@hui-an-yang hui-an-yang modified the milestones: 20.1, 21, v21, v20.1 Oct 2, 2024
@hui-an-yang hui-an-yang removed this from Taquito Dev Oct 4, 2024
@github-project-automation github-project-automation bot moved this to Needs triage in Taquito Triage Oct 4, 2024
@hui-an-yang hui-an-yang moved this from To do to In progress in Taquito Dev Nov 7, 2024
@hui-an-yang hui-an-yang modified the milestones: v20.1, NEXT Nov 7, 2024
@hui-an-yang
Copy link
Collaborator

close after issue #3079, #3080, #3081 are created

@github-project-automation github-project-automation bot moved this from In progress to Done in Taquito Dev Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

4 participants