Skip to content

improve transaction builder interface, MeshTxBuilderV2 #809

@Temasar1

Description

@Temasar1

Describe the feature you'd like

Improve the MeshTxBuilder using the typescript auto complete feature also abstract some unused and unnecessary methods from the txBuilder
example

  -   .spendingPlutusScriptV3()

wrap this in a MeshTxBuilderV2 into something like

  txBuilder.spendPlutusV3(txHash, index)

and typescript can help auto complete the methods basically associated with spending plutus sctipt
same as this

-     .txInInlineDatumPresent()

Is your feature request related to a problem? Please describe.

it is difficult and unclear to navigate ways around the current transaction API interface, filled with some functions, parameters that devs shoud not be concerened about most times, devs might not care about these functions and sometimes omit it in the transaction building which might lead to endless debugging especially for beginners

Describe the solution you'd like

wrap and abstract the current MeshTxBuilder to a stricted typed API interface that auto complete specifically to the plutus script purpose either for Spend,Mint,withdraw,vote or propose also hide the additional optional param for redeemer or datum type of JSON,CBOR,Mesh

example:

tx.spendPlutusV2(mockHash, 0)
      .redeemerJson({ action: "spend" })
      .script("112233")
      .datumJson({ data: "foo" })
      .txOut(
        "addr_test1vzuwvztxzv3j4a2wvy7xntry2a8y869svj4a7y7qy2wvywqzcqxny",
        [],
      );

until after completing it returns the whole txbodyBuilder methods

Additional context

No response

Would you be willing to implement it?

  • Yes, I will implement it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions