@latticexyz/abi-ts
Advanced tools
Changelog
Version 2.2.6
Release date: Thu Sep 19 2024
feat(stash): release package to npm (#3184) (@latticexyz/stash)
Added @latticexyz/stash
package, a TypeScript client state library optimized for the MUD Store data model.
It uses the MUD store config to define local tables, which support writing, reading and subscribing to table updates.
It comes with a query engine optimized for "ECS-style" queries (similar to @latticexyz/recs
) but with native support for composite keys.
You can find usage examples in the @latticexyz/stash
README.md.
This package is experimental and will have breaking changes while we refine its APIs and implementation. All of its exports are temporarily under @latticexyz/stash/internal
until we consider it stable.
fix(cli): improve performance of linked library resolution during deployment (#3197) (@latticexyz/cli)
Significantly improved the deployment performance for large projects with public libraries by implementing a more efficient algorithm to resolve public libraries during deployment. The local deployment time on a large reference project was reduced from over 10 minutes to 4 seconds.
feat(store-sync): add syncToStash util (#3192) (@latticexyz/store-sync)
Added a syncToStash
util to hydrate a stash
client store from MUD contract state. This is currently exported from @latticexyz/store-sync/internal
while Stash package is unstable/experimental.
import { createClient, http } from "viem";
import { anvil } from "viem/chains";
import { createStash } from "@latticexyz/stash/internal";
import { syncToStash } from "@latticexyz/store-sync/internal";
import config from "../mud.config";
const client = createClient({
chain: anvil,
transport: http(),
});
const address = "0x...";
const stash = createStash(config);
const sync = await syncToStash({ stash, client, address });
Changelog
Version 2.2.5
Release date: Thu Sep 19 2024
fix(explorer): various fixes (#3195) (@latticexyz/explorer)
Refactored observer
initialization to reuse bridge iframes with the same url
.
fix(explorer): various fixes (#3195) (@latticexyz/explorer)
Fixed favicon paths and fixed a few issues where we were incorrectly redirecting based on the chain name or ID.
fix(explorer): various fixes (#3195) (@latticexyz/explorer)
Fixed an issue where the observer
Viem client decorator required an empty object arg when no options are used.
-client.extend(observer({}));
+client.extend(observer());
Changelog
Version 2.2.4
Release date: Wed Sep 18 2024
feat(explorer): anvil connector, connect external wallets (#3164) (@latticexyz/explorer)
World Explorer now supports connecting external wallets.
fix(common): use latest block tag in nonce manager (#3180) (@latticexyz/common)
To reset an account's nonce, the nonce manager uses the eth_getTransactionCount
RPC method,
which returns the number of transactions sent from the account.
When using the pending
block tag, this includes transactions in the mempool that have not been included in a block yet.
If an account submits a transaction with a nonce higher than the next valid nonce, this transaction will stay in the mempool until the nonce gap is closed and the transactions nonce is the next valid nonce.
This means if an account has gapped transactions "stuck in the mempool", the eth_getTransactionCount
method with pending
block tag can't be used to get the next valid nonce
(since it includes the number of transactions stuck in the mempool).
Since the nonce manager only resets the nonce on reload or in case of a nonce error, using the latest
block tag by default is the safer choice to be able to recover from nonce gaps.
Note that this change may reveal more "transaction underpriced" errors than before. These errors will now be retried automatically and should go through after the next block is mined.
feat: bump wevm packages (#3178) (@latticexyz/block-logs-stream, @latticexyz/cli, @latticexyz/common, @latticexyz/config, @latticexyz/dev-tools, @latticexyz/explorer, @latticexyz/faucet, @latticexyz/protocol-parser, @latticexyz/schema-type, @latticexyz/stash, @latticexyz/store-indexer, @latticexyz/store-sync, @latticexyz/store, @latticexyz/world, create-mud)
Bumped viem, wagmi, and abitype packages to their latest release.
MUD projects using these packages should do the same to ensure no type errors due to mismatched versions:
pnpm recursive up viem@2.21.6 wagmi@2.12.11 @wagmi/core@2.13.5 abitype@1.0.6
feat(cli): register namespace labels (#3172) (@latticexyz/cli)
Along with table and system labels, the MUD deployer now registers namespace labels. Additionally, labels will only be registered if they differ from the underlying resource name.
feat(explorer): active chain as dynamic param (#3181) (@latticexyz/explorer)
Added ability to connect World Explorer to Redstone and Garnet chains. The active chain is now passed as a dynamic route parameter.
feat(explorer): write observer (#3169) (@latticexyz/explorer)
World Explorer package now exports an observer
Viem decorator that can be used to get visibility into contract writes initiated from your app. You can watch these writes stream in on the new "Observe" tab of the World Explorer.
import { createClient, publicActions, walletActions } from "viem";
import { observer } from "@latticexyz/explorer/observer";
const client = createClient({ ... })
.extend(publicActions)
.extend(walletActions)
.extend(observer());
By default, the observer
action assumes the World Explorer is running at http://localhost:13690
, but this can be customized with the explorerUrl
option.
observer({
explorerUrl: "http://localhost:4444",
});
If you want to measure the timing of transaction-to-state-change, you can also pass in a waitForStateChange
function that takes a transaction hash and returns a partial TransactionReceipt
with blockNumber
, status
, and transactionHash
. This mirrors the waitForTransaction
function signature returned by syncTo...
helper in @latticexyz/store-sync
.
observer({
async waitForStateChange(hash) {
return await waitForTransaction(hash);
},
});
fix(world): resolve module config (#3193) (@latticexyz/world)
Added a config resolver to add default values for modules
in the world config.
feat(store-sync): add util to fetch snapshot from indexer with SQL API (#2996) (@latticexyz/protocol-parser, @latticexyz/store-sync)
Added store-sync
helper libraries to interact with the indexer's experimental SQL API endpoint. Documentation is available at https://mud.dev/indexer/sql.