Skip to content

SNIP-36 - helper for creation of signed transaction#1603

Open
PhilippeR26 wants to merge 5 commits intostarknet-io:developfrom
PhilippeR26:buildExecute
Open

SNIP-36 - helper for creation of signed transaction#1603
PhilippeR26 wants to merge 5 commits intostarknet-io:developfrom
PhilippeR26:buildExecute

Conversation

@PhilippeR26
Copy link
Copy Markdown
Collaborator

Motivation and Resolution

In the frame of SNIP-36, proof are generated by an off-line sequencer backend. A RPC.INVOKE_TXN_V3 signed transaction has to be sent to this backend.
Today, Account.execute is generating this RPC.INVOKE_TXN_V3 internally and send it to the node, but we don't have a method to provide these data to users.
This PR is adding a such method.

Usage related changes

  • Added a new Account.getSignedTransaction() method. Parameters are 100% the same than Account.execute(). Example:
const myCall = myTestContract.populate("Say_HelloPhil126",  { messages: "0x123" });
const tx3: INVOKE_TXN_V3 = await account0.getSignedTransaction(myCall);

Then tx3 can be sent to the backend, to generate the proof.

  • Added a new RpcProvider.invokeSignedTx(). This method is not necessary in the frame of SNIP-36, but it's consistent to have in Starknet.js both a method to create a signed Tx and a method to consume it. Example:
const res = await account0.provider.channel.invokeSignedTx(tx3);
const txR3 = await account0.provider.waitForTransaction(res.transaction_hash);

Development related changes

As 90% of code of Account.execute() is common with Account.getSignedTransaction(), this common part has been written is a new prepareInvoke() function.

Checklist:

  • Performed a self-review of the code
  • Rebased to the last commit of the target branch (or merged it into my branch)
  • Documented the changes in code (API docs will be generated automatically)
  • Updated the tests
  • All tests are passing

@PhilippeR26 PhilippeR26 requested a review from tabaktoni April 8, 2026 17:45
@tabaktoni
Copy link
Copy Markdown
Member

@copilot resolve the merge conflicts in this pull request

@PhilippeR26 PhilippeR26 changed the base branch from beta to develop April 27, 2026 08:24
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.

2 participants