- Added missing type exports to package root to prevent issues with TypeScript not being able to infer types when using the SDK in a project that has
declarationenabled.
This release tracks the arkiv-reth engine and rewrites most of the SDK surface. Every entity write, every attribute and every event changed shape - expect to touch code that used 0.7.x.
- Attribute type system, exported from
@arkiv-network/sdk/attr. Attribute values are now tagged:str,i32,u64,u256,dec,addr,key,bytes32,bool. A bareboolean,number,bigintorstringis still accepted where the type is unambiguous.deccarries fixed-point decimals without precision loss, so numeric ordering and range queries work on non-integers - Entity module, exported from
@arkiv-network/sdk/entity: expiries (Expiry,Lifetime,resolveExpiry,toBlocks), creation flags (encodeCreationFlags,decodeCreationFlags), key derivation (predictEntityKey,randomSalt) and the protocol bounds behind them patchEntity()on the wallet client - sets and unsets individual attributes and replacespayload/contentType, leaving everything it does not name untouchedpredictEntityKeys()on the public client - returns the{ key, salt }pairs an account's next creates will be given, so a batch can reference an entity it is about to mintgetEntityNonce()on the public client - the account's entity-minting noncewatchEntityEvents()on the public client, with typed handlers foronEntityCreated,onEntityPatched,onExpiryExtended,onOwnershipTransferredandonEntityDeleted, plusonEventfor all of them. Each event carries the block, transaction and log index it came from- Creation flags on
createEntity():readonlyandpermissionlessExtension, fixed at creation for the entity's life - Explicit
saltoncreateEntity(). It defaults to 128 random bits; pass0nfor a key derived from owner and nonce alone, which anyone can compute in advance ExpirationTime.atBlock(),ExpirationTime.atDate()andExpirationTime.permanent()for absolute deadlines, each able to carry an{ atLeast }floor- New selectable entity fields:
createdAt,updatedAt,expiresAt,creationFlagsandattributeSchema.attributesalso takes a map of names to fetch only those:select({ key: true, attributes: { projectId: true } }) - Query results are async iterable -
for await (const entity of client.select({ key: true }).where(...))walks every page - Expression combinators exported from
@arkiv-network/sdk/query:and,or,not,eq,ne,gt,gte,lt,lte,exists,startsWith,hasTypeandrender.client.query()accepts anExpressionas well as a raw string - Cheesecake testnet
- Engine reverts are decoded into messages that name the actual problem instead of printing the raw error args
- Breaking: attributes are an object keyed by name (
{ category: 'docs', level: i32(10) }), not an array of{ key, value }pairs. - Breaking:
expiresInis nowexpiresoncreateEntity(),extendEntity()and every batch operation, and takes anExpirybuilt withExpirationTime. TheExpirationTime.from*helpers return anExpiryinstead of a number of seconds - Breaking: entity metadata fields were renamed:
createdAtBlockiscreatedAt,lastModifiedAtBlockisupdatedAtandexpiresAtBlockisexpiresAt.transactionIndexInBlockandoperationIndexInTransactionare gone - Breaking:
getEntity()returns aFullEntitywith every field populated - Breaking:
QueryOptionsnow takesselect(a selection) andlimit, replacingincludeDataandresultsPerPage. Page size is capped at 200 - Breaking:
mutateEntities()is nowexecuteBatch(). It takespatcheswhere it tookupdates, and gainedownershipChanges.MutateEntitiesParametersandMutateEntitiesReturnTypeareExecuteBatchParametersandExecuteBatchReturnType - Breaking:
QueryResult.next()returns the next page as a newQueryResultinstead of mutating the current one ownerandcreatorare returned as checksummed addresses- Error types match the new operations:
InvalidExpiryError,InvalidValueError,InvalidAttributeNameError,ConflictingMutationError,EmptyPatchError,TooManyAttributesError,InvalidCreationFlagsError,InvalidSaltError,QueryError $expiresAtis au64system attribute
- Breaking:
updateEntity(). UsepatchEntity(), which changes only what it names, or delete and recreate for a full replacement - Breaking:
buildQuery()andQueryBuilder, along withwithAttributes()/withMetadata()/withPayload(). Useselect() - Breaking:
subscribeEntityEvents(). UsewatchEntityEvents() - Breaking:
orderByon the query builder, theorderByquery option and theasc/deschelpers, deprecated in 0.7.0. Sort the fetched entities in JavaScript - Breaking: the Kaolin and Braga testnets. Use Cheesecake
- Breaking:
InvalidExpirationError,InvalidAttributeError,InvalidAttributeKeyError,DuplicateAttributeErrorandNoCursorOrLimitError
select()API on the public client for building queries that fetch only the fields you need. The result type is inferred from the selection- Query builder predicates (
and,or) now accept varargs in addition to the array syntax - Invalid inputs are now rejected client-side with descriptive errors instead of failing during RPC communication
- Breaking:
viemis now a peer dependency and must be installed alongside the SDK (npm install @arkiv-network/sdk viem). The SDK no longer re-exports viem's internals (http,privateKeyToAccount,Hex, etc.) - Relaxed the TypeScript peer dependency to
>=5.0.0and made it optional
orderByon the query builder, theorderByquery option, and theasc/deschelpers. Server-side ordering is not supported by the network, so these have no effect - sort the fetched entities in JavaScript instead.
- Type mismatch in getBlockTiming #62
- Braga testnet
- Creator field in query requests and results
- When using TTL as odd number, mutating entities fails #28
- All numeric values are now represented as Hex for RPC communication (#19)
chainFromName- utility function allowing to get a predefined chain by its name, convenient to get chain based on env variable (#12)QueryOptionsforquery(rawQuery: string)public client's function allowing to setup what will be returned and more things like pagination- Results for
query(...)function with raw query now returns not only entities but also cursor and block number
- Replaced
debugmodule dependency with custom logger implementation that works in both Node.js and browser environments without bundler configuration issues - Consolidated error classes exported from main index:
EntityMutationError,NoMoreResultsError,NoCursorOrLimitError,NoEntityFoundError
- Fixed browser compatibility issue with
debugmodule causing "exports is not defined" errors in browser environments - Improved error handling for reverted transactions when using MetaMask as transport - now throws more descriptive errors (#16)
- Fix error while using value=0 with numeric attributes