Skip to content
This repository was archived by the owner on Apr 23, 2025. It is now read-only.

Commit 4a2c7b3

Browse files
authored
Merge pull request #38 from Scaffold-Stark/docs/update-based-on-new-parser
docs: update based on new parser
2 parents 026790d + e8686fd commit 4a2c7b3

File tree

2 files changed

+25
-10
lines changed

2 files changed

+25
-10
lines changed

docs/hooks/useScaffoldMultiWriteContract.md

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,21 @@ This example sends multiple transactions to the specified smart contracts to cal
2828
## Usage Example
2929

3030
```tsx
31+
const { sendAsync } = useScaffoldMultiWriteContract({
32+
calls: [
33+
{
34+
contractName: "YourContract1",
35+
functionName: "setGreeting",
36+
args: ["Hello"],
37+
},
38+
{
39+
contractName: "YourContract2",
40+
functionName: "setCounter",
41+
args: [42],
42+
},
43+
],
44+
});
45+
3146
<button
3247
className="btn btn-primary"
3348
onClick={async () => {
@@ -39,17 +54,17 @@ This example sends multiple transactions to the specified smart contracts to cal
3954
}}
4055
>
4156
Send Transactions
42-
</button>
57+
</button>;
4358
```
4459

4560
This example demonstrates how to use the `sendAsync`function to send multiple transactions to the specified smart contracts, calling the functions with the arguments passed in calls.
4661

4762
## Configuration
4863

49-
| Parameter | Type | Description |
50-
| :--------------------- | :------------------- | :---------------------------------------------------------------------------------------------------------------------------- |
51-
| **calls** | `Calldata[]` | Array of configuration objects for the contract calls. Each object should contain `contractName`, `functionName`, and `args`. |
52-
| **options** (optional) | `InvocationsDetails` | Additional options for the transactions. |
64+
| Parameter | Type | Description |
65+
| :--------------------- | :------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
66+
| **calls** | `Calldata[]` | Array of configuration objects for the contract calls. Each object should contain `contractName`, `functionName`, and `args`. For special datatypes such as `enums`, you can pass in enum types from `starknet.js` |
67+
| **options** (optional) | `InvocationsDetails` | Additional options for the transactions. |
5368

5469
## Call Object Configuration
5570

docs/hooks/useScaffoldWriteContract.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ In this example, the updateGreeting function of the YourContract is called with
4040

4141
## Configuration
4242

43-
| Parameter | Type | Description |
44-
| :------------------ | :---------- | :--------------------------------------------------------------------------------------------------------------- |
45-
| **contractName** | `string` | Name of the contract to write to. |
46-
| **functionName** | `string` | Name of the function to call. |
47-
| **args** (optional) | `unknown[]` | Array of arguments to pass to the function (if any). Types are inferred from the contract's function parameters. |
43+
| Parameter | Type | Description |
44+
| :------------------ | :---------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
45+
| **contractName** | `string` | Name of the contract to write to. |
46+
| **functionName** | `string` | Name of the function to call. |
47+
| **args** (optional) | `unknown[]` | Array of arguments to pass to the function (if any). Types are inferred from the contract's function parameters. For special datatypes such as `enums`, you can pass in enum types from `starknet.js` |
4848

4949
## Return Values
5050

0 commit comments

Comments
 (0)