-
Notifications
You must be signed in to change notification settings - Fork 196
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into authcall/protocol-parser-go
- Loading branch information
Showing
152 changed files
with
3,770 additions
and
907 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
"@latticexyz/block-logs-stream": minor | ||
"@latticexyz/store-sync": minor | ||
--- | ||
|
||
- Replace `blockEventsToStorage` with `blockLogsToStorage` that exposes a `storeOperations` callback to perform database writes from store operations. This helps encapsulates database adapters into a single wrapper/instance of `blockLogsToStorage` and allows for wrapping a block of store operations in a database transaction. | ||
- Add `toBlock` option to `groupLogsByBlockNumber` and remove `blockHash` from results. This helps track the last block number for a given set of logs when used in the context of RxJS streams. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@latticexyz/schema-type": minor | ||
--- | ||
|
||
add type narrowing `isStaticAbiType` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
{ | ||
"mode": "pre", | ||
"tag": "next", | ||
"initialVersions": { | ||
"@latticexyz/block-logs-stream": "1.42.0", | ||
"@latticexyz/cli": "1.42.0", | ||
"@latticexyz/common": "1.42.0", | ||
"@latticexyz/config": "1.42.0", | ||
"create-mud": "1.42.0", | ||
"@latticexyz/dev-tools": "1.42.0", | ||
"@latticexyz/ecs-browser": "1.42.0", | ||
"@latticexyz/gas-report": "1.42.0", | ||
"@latticexyz/network": "1.42.0", | ||
"@latticexyz/noise": "1.42.0", | ||
"@latticexyz/phaserx": "1.42.0", | ||
"@latticexyz/protocol-parser": "1.42.0", | ||
"@latticexyz/react": "1.42.0", | ||
"@latticexyz/recs": "1.42.0", | ||
"@latticexyz/schema-type": "1.42.0", | ||
"@latticexyz/services": "1.42.0", | ||
"@latticexyz/solecs": "1.42.0", | ||
"solhint-config-mud": "1.42.0", | ||
"solhint-plugin-mud": "1.42.0", | ||
"@latticexyz/std-client": "1.42.0", | ||
"@latticexyz/std-contracts": "1.42.0", | ||
"@latticexyz/store": "1.42.0", | ||
"@latticexyz/store-cache": "1.42.0", | ||
"@latticexyz/store-sync": "1.42.0", | ||
"@latticexyz/utils": "1.42.0", | ||
"@latticexyz/world": "1.42.0" | ||
}, | ||
"changesets": [ | ||
"eighty-tigers-argue", | ||
"fast-ears-hug", | ||
"itchy-kids-relax", | ||
"many-phones-study", | ||
"modern-bikes-build", | ||
"nasty-waves-divide", | ||
"nice-pandas-knock", | ||
"olive-parrots-move", | ||
"perfect-mangos-cry", | ||
"quick-numbers-flash", | ||
"rare-planes-draw", | ||
"selfish-cycles-retire", | ||
"soft-boxes-smile", | ||
"spotty-sheep-warn", | ||
"stale-cooks-reflect", | ||
"strange-candles-shout", | ||
"strange-ducks-float", | ||
"thin-buses-reply", | ||
"tricky-frogs-beam" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
"@latticexyz/store-sync": minor | ||
--- | ||
|
||
`blockLogsToStorage(sqliteStorage(...))` converts block logs to SQLite operations. You can use it like: | ||
|
||
```ts | ||
import { drizzle } from "drizzle-orm/better-sqlite3"; | ||
import Database from "better-sqlite3"; | ||
import { BaseSQLiteDatabase } from "drizzle-orm/sqlite-core"; | ||
import { createPublicClient } from "viem"; | ||
import { blockLogsToStorage } from "@latticexyz/store-sync"; | ||
import { sqliteStorage } from "@latticexyz/store-sync/sqlite"; | ||
|
||
const database = drizzle(new Database('store.db')) as any as BaseSQLiteDatabase<"sync", void>; | ||
const publicClient = createPublicClient({ ... }); | ||
|
||
blockLogs$ | ||
.pipe( | ||
concatMap(blockLogsToStorage(sqliteStorage({ database, publicClient }))), | ||
tap(({ blockNumber, operations }) => { | ||
console.log("stored", operations.length, "operations for block", blockNumber); | ||
}) | ||
) | ||
.subscribe(); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
"@latticexyz/block-logs-stream": patch | ||
"@latticexyz/cli": patch | ||
"@latticexyz/common": patch | ||
"@latticexyz/dev-tools": patch | ||
"@latticexyz/network": patch | ||
"@latticexyz/protocol-parser": patch | ||
"@latticexyz/schema-type": patch | ||
"@latticexyz/std-client": patch | ||
"@latticexyz/store-cache": patch | ||
"@latticexyz/store-sync": patch | ||
"@latticexyz/store": patch | ||
create-mud: patch | ||
--- | ||
|
||
- bump to viem 1.3.0 and abitype 0.9.3 | ||
- move `@wagmi/chains` imports to `viem/chains` | ||
- refine a few types |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
"@latticexyz/common": minor | ||
--- | ||
|
||
`TableId.toHex()` now truncates name/namespace to 16 bytes each, to properly fit into a `bytes32` hex string. | ||
|
||
Also adds a few utils we'll need in the indexer: | ||
|
||
- `bigIntMin` is similar to `Math.min` but for `bigint`s | ||
- `bigIntMax` is similar to `Math.max` but for `bigint`s | ||
- `bigIntSort` for sorting an array of `bigint`s | ||
- `chunk` to split an array into chunks | ||
- `wait` returns a `Promise` that resolves after specified number of milliseconds |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
"@latticexyz/cli": patch | ||
"@latticexyz/recs": patch | ||
"@latticexyz/std-client": patch | ||
--- | ||
|
||
Update RECS components with v2 key/value schemas. This helps with encoding/decoding composite keys and strong types for keys/values. | ||
|
||
This may break if you were previously dependent on `component.id`, `component.metadata.componentId`, or `component.metadata.tableId`: | ||
|
||
- `component.id` is now the on-chain `bytes32` hex representation of the table ID | ||
- `component.metadata.componentName` is the table name (e.g. `Position`) | ||
- `component.metadata.tableName` is the namespaced table name (e.g. `myworld:Position`) | ||
- `component.metadata.keySchema` is an object with key names and their corresponding ABI types | ||
- `component.metadata.valueSchema` is an object with field names and their corresponding ABI types |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
18 | ||
18.16.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 24 additions & 17 deletions
41
e2e/packages/client-vanilla/src/mud/contractComponents.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import { MUDChain, latticeTestnet } from "@latticexyz/common/chains"; | ||
import { foundry } from "@wagmi/chains"; | ||
import { foundry } from "viem/chains"; | ||
|
||
// If you are deploying to chains other than anvil or Lattice testnet, add them here | ||
export const supportedChains: MUDChain[] = [foundry, latticeTestnet]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.