Skip to content

Commit

Permalink
Creates a description for the multi-call feature (#648)
Browse files Browse the repository at this point in the history
* description of the multi call feature

* Improves description
  • Loading branch information
thiagodeev authored Dec 18, 2024
1 parent 8ecf779 commit 1bd1947
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ To run an example:
R: See [deployContractUDC](./deployContractUDC/main.go).
1. How to send an invoke transaction?
R: See [simpleInvoke](./simpleInvoke/main.go).
1. How to make multiple function calls in the same transaction?
R: See [simpleInvoke](./simpleInvoke/main.go), line 92.
1. How to get the transaction status?
R: See [simpleInvoke](./simpleInvoke/main.go), line 131.
1. How to deploy an ERC20 token?
Expand All @@ -38,4 +40,3 @@ To run an example:
R: See [simpleCall](./simpleCall/main.go).
1. How to sign and verify a typed data?
R: See [typedData](./typedData/main.go).

4 changes: 4 additions & 0 deletions examples/simpleInvoke/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ func main() {
}

// Building the Calldata with the help of FmtCalldata where we pass in the FnCall struct along with the Cairo version
//
// note: in Starknet, you can execute multiple function calls in the same transaction, even if they are from different contracts.
// To do this in Starknet.go, just group all the function calls in the same slice and pass it to FmtCalldata
// e.g. : InvokeTx.Calldata, err = accnt.FmtCalldata([]rpc.FunctionCall{funcCall, anotherFuncCall, yetAnotherFuncCallFromDifferentContract})
InvokeTx.Calldata, err = accnt.FmtCalldata([]rpc.FunctionCall{FnCall})
if err != nil {
panic(err)
Expand Down

0 comments on commit 1bd1947

Please sign in to comment.