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

Creates a description for the multi-call feature #648

Merged
merged 2 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading