From af350de19fadc918aee32e659a5d0684f6394b1c Mon Sep 17 00:00:00 2001 From: Kevin Ingersoll Date: Sun, 12 Nov 2023 11:08:33 +0300 Subject: [PATCH] docs: generate solidity params docs --- .../pages/store/reference/store-core.mdx | 37 ++++++++++++++++ next-docs/pages/store/reference/store.mdx | 43 +++++++++++++++++++ 2 files changed, 80 insertions(+) diff --git a/next-docs/pages/store/reference/store-core.mdx b/next-docs/pages/store/reference/store-core.mdx index bb9c8ba2db..421cbdc3dd 100644 --- a/next-docs/pages/store/reference/store-core.mdx +++ b/next-docs/pages/store/reference/store-core.mdx @@ -774,6 +774,16 @@ event Store_SetRecord( ); ``` +**Parameters** + +| Name | Type | Description | +| ---------------- | --------------- | ------------------------------------------------------- | +| `tableId` | `ResourceId` | The ID of the table where the record is set. | +| `keyTuple` | `bytes32[]` | An array representing the composite key for the record. | +| `staticData` | `bytes` | The static data of the record. | +| `encodedLengths` | `PackedCounter` | The encoded lengths of the dynamic data of the record. | +| `dynamicData` | `bytes` | The dynamic data of the record. | + ### Store_SpliceStaticData Emitted when static data in the store is spliced. @@ -785,6 +795,15 @@ so the total length of the data remains the same and no data is shifted._ event Store_SpliceStaticData(ResourceId indexed tableId, bytes32[] keyTuple, uint48 start, bytes data); ``` +**Parameters** + +| Name | Type | Description | +| ---------- | ------------ | --------------------------------------------------------------------- | +| `tableId` | `ResourceId` | The ID of the table where the data is spliced. | +| `keyTuple` | `bytes32[]` | An array representing the key for the record. | +| `start` | `uint48` | The start position in bytes for the splice operation. | +| `data` | `bytes` | The data to write to the static data of the record at the start byte. | + ### Store_SpliceDynamicData Emitted when dynamic data in the store is spliced. @@ -800,6 +819,17 @@ event Store_SpliceDynamicData( ); ``` +**Parameters** + +| Name | Type | Description | +| ---------------- | --------------- | ------------------------------------------------------------------------- | +| `tableId` | `ResourceId` | The ID of the table where the data is spliced. | +| `keyTuple` | `bytes32[]` | An array representing the composite key for the record. | +| `start` | `uint48` | The start position in bytes for the splice operation. | +| `deleteCount` | `uint40` | The number of bytes to delete in the splice operation. | +| `encodedLengths` | `PackedCounter` | The encoded lengths of the dynamic data of the record. | +| `data` | `bytes` | The data to insert into the dynamic data of the record at the start byte. | + ### Store_DeleteRecord Emitted when a record is deleted from the store. @@ -807,3 +837,10 @@ Emitted when a record is deleted from the store. ```solidity event Store_DeleteRecord(ResourceId indexed tableId, bytes32[] keyTuple); ``` + +**Parameters** + +| Name | Type | Description | +| ---------- | ------------ | ------------------------------------------------------- | +| `tableId` | `ResourceId` | The ID of the table where the record is deleted. | +| `keyTuple` | `bytes32[]` | An array representing the composite key for the record. | diff --git a/next-docs/pages/store/reference/store.mdx b/next-docs/pages/store/reference/store.mdx index 7f6b1db8ab..71551f45df 100644 --- a/next-docs/pages/store/reference/store.mdx +++ b/next-docs/pages/store/reference/store.mdx @@ -23,6 +23,16 @@ event Store_SetRecord( ); ``` +**Parameters** + +| Name | Type | Description | +| ---------------- | --------------- | ------------------------------------------------------- | +| `tableId` | `ResourceId` | The ID of the table where the record is set. | +| `keyTuple` | `bytes32[]` | An array representing the composite key for the record. | +| `staticData` | `bytes` | The static data of the record. | +| `encodedLengths` | `PackedCounter` | The encoded lengths of the dynamic data of the record. | +| `dynamicData` | `bytes` | The dynamic data of the record. | + ### Store_SpliceStaticData Emitted when static data in the store is spliced. @@ -34,6 +44,15 @@ so the total length of the data remains the same and no data is shifted._ event Store_SpliceStaticData(ResourceId indexed tableId, bytes32[] keyTuple, uint48 start, bytes data); ``` +**Parameters** + +| Name | Type | Description | +| ---------- | ------------ | --------------------------------------------------------------------- | +| `tableId` | `ResourceId` | The ID of the table where the data is spliced. | +| `keyTuple` | `bytes32[]` | An array representing the key for the record. | +| `start` | `uint48` | The start position in bytes for the splice operation. | +| `data` | `bytes` | The data to write to the static data of the record at the start byte. | + ### Store_SpliceDynamicData Emitted when dynamic data in the store is spliced. @@ -49,6 +68,17 @@ event Store_SpliceDynamicData( ); ``` +**Parameters** + +| Name | Type | Description | +| ---------------- | --------------- | ------------------------------------------------------------------------- | +| `tableId` | `ResourceId` | The ID of the table where the data is spliced. | +| `keyTuple` | `bytes32[]` | An array representing the composite key for the record. | +| `start` | `uint48` | The start position in bytes for the splice operation. | +| `deleteCount` | `uint40` | The number of bytes to delete in the splice operation. | +| `encodedLengths` | `PackedCounter` | The encoded lengths of the dynamic data of the record. | +| `data` | `bytes` | The data to insert into the dynamic data of the record at the start byte. | + ### Store_DeleteRecord Emitted when a record is deleted from the store. @@ -57,6 +87,13 @@ Emitted when a record is deleted from the store. event Store_DeleteRecord(ResourceId indexed tableId, bytes32[] keyTuple); ``` +**Parameters** + +| Name | Type | Description | +| ---------- | ------------ | ------------------------------------------------------- | +| `tableId` | `ResourceId` | The ID of the table where the record is deleted. | +| `keyTuple` | `bytes32[]` | An array representing the composite key for the record. | + ## IStoreErrors [Git Source](https://github.com/latticexyz/mud/blob/main/packages/store/src/IStoreErrors.sol) @@ -154,6 +191,12 @@ Emitted when the store is initialized. event HelloStore(bytes32 indexed storeVersion); ``` +**Parameters** + +| Name | Type | Description | +| -------------- | --------- | ---------------------------------- | +| `storeVersion` | `bytes32` | The version of the Store contract. | + ## IStoreRead [Git Source](https://github.com/latticexyz/mud/blob/main/packages/store/src/IStoreRead.sol)