-
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.
- Loading branch information
1 parent
0a230b4
commit 0c20796
Showing
17 changed files
with
167 additions
and
10 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,36 @@ | ||
{ | ||
"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/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/utils": "1.42.0", | ||
"@latticexyz/world": "1.42.0" | ||
}, | ||
"changesets": [ | ||
"fast-ears-hug", | ||
"many-phones-study", | ||
"nasty-waves-divide", | ||
"strange-candles-shout" | ||
] | ||
} |
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,48 @@ | ||
# @latticexyz/block-logs-stream | ||
|
||
## 1.43.0-next.0 | ||
|
||
### Minor Changes | ||
|
||
- [#1070](https://github.com/latticexyz/mud/pull/1070) [`72b80697`](https://github.com/latticexyz/mud/commit/72b806979db6eb2880772193898351d657b94f75) Thanks [@holic](https://github.com/holic)! - Add block logs stream package | ||
|
||
```ts | ||
import { filter, map, mergeMap } from "rxjs"; | ||
import { createPublicClient, parseAbi } from "viem"; | ||
import { | ||
createBlockStream, | ||
isNonPendingBlock, | ||
groupLogsByBlockNumber, | ||
blockRangeToLogs, | ||
} from "@latticexyz/block-logs-stream"; | ||
|
||
const publicClient = createPublicClient({ | ||
// your viem public client config here | ||
}); | ||
|
||
const latestBlock$ = await createBlockStream({ publicClient, blockTag: "latest" }); | ||
|
||
const latestBlockNumber$ = latestBlock$.pipe( | ||
filter(isNonPendingBlock), | ||
map((block) => block.number) | ||
); | ||
|
||
latestBlockNumber$ | ||
.pipe( | ||
map((latestBlockNumber) => ({ startBlock: 0n, endBlock: latestBlockNumber })), | ||
blockRangeToLogs({ | ||
publicClient, | ||
address, | ||
events: parseAbi([ | ||
"event StoreDeleteRecord(bytes32 table, bytes32[] key)", | ||
"event StoreSetField(bytes32 table, bytes32[] key, uint8 schemaIndex, bytes data)", | ||
"event StoreSetRecord(bytes32 table, bytes32[] key, bytes data)", | ||
"event StoreEphemeralRecord(bytes32 table, bytes32[] key, bytes data)", | ||
]), | ||
}), | ||
mergeMap(({ logs }) => from(groupLogsByBlockNumber(logs))) | ||
) | ||
.subscribe((block) => { | ||
console.log("got events for block", block); | ||
}); | ||
``` |
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
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# @latticexyz/dev-tools | ||
|
||
## 1.42.1-next.0 | ||
|
||
### Patch Changes | ||
|
||
- Updated dependencies []: | ||
- @latticexyz/network@1.42.1-next.0 | ||
- @latticexyz/std-client@1.42.1-next.0 |
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
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
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# @latticexyz/protocol-parser | ||
|
||
## 1.43.0-next.0 | ||
|
||
### Minor Changes | ||
|
||
- [#1100](https://github.com/latticexyz/mud/pull/1100) [`b98e5180`](https://github.com/latticexyz/mud/commit/b98e51808aaa29f922ac215cf666cf6049e692d6) Thanks [@alvrs](https://github.com/alvrs)! - feat: add abiTypesToSchema, a util to turn a list of abi types into a Schema by separating static and dynamic types | ||
|
||
- [#1111](https://github.com/latticexyz/mud/pull/1111) [`ca50fef8`](https://github.com/latticexyz/mud/commit/ca50fef8108422a121d03571fb4679060bd4891a) Thanks [@alvrs](https://github.com/alvrs)! - feat: add `encodeKeyTuple`, a util to encode key tuples in Typescript (equivalent to key tuple encoding in Solidity and inverse of `decodeKeyTuple`). | ||
Example: | ||
|
||
```ts | ||
encodeKeyTuple({ staticFields: ["uint256", "int32", "bytes16", "address", "bool", "int8"], dynamicFields: [] }, [ | ||
42n, | ||
-42, | ||
"0x12340000000000000000000000000000", | ||
"0xFFfFfFffFFfffFFfFFfFFFFFffFFFffffFfFFFfF", | ||
true, | ||
3, | ||
]); | ||
// [ | ||
// "0x000000000000000000000000000000000000000000000000000000000000002a", | ||
// "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd6", | ||
// "0x1234000000000000000000000000000000000000000000000000000000000000", | ||
// "0x000000000000000000000000ffffffffffffffffffffffffffffffffffffffff", | ||
// "0x0000000000000000000000000000000000000000000000000000000000000001", | ||
// "0x0000000000000000000000000000000000000000000000000000000000000003", | ||
// ] | ||
``` |
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
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
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