sdk 0.3.0: stricter decode, packaging fixes, PR CI, doc corrections - #11
Merged
Conversation
SDK:
- fromDataSuffix returns null for non-Schema-0 tags and empty code
fields instead of letting custom-registry codes pass as canonical
- toDataSuffix rejects comma-joined code fields over 255 bytes (the
wire format's length byte) with a clear error
- drop the viem type import from the public API so the published
.d.ts works without the optional peer installed
- add a "default" export condition; ship LICENSE in the npm tarball
CI:
- new test-sdk workflow: typecheck + tests + build on PRs and main
- publish workflow: guard that the tag matches package.json version;
pin actions to commit SHAs
Docs:
- INDEXERS: length byte bounds the joined field (1-255, not 1-32),
truncation + schema guards in the pseudocode, DuneSQL varbinary
filter, corrected multi-code byte math and stale code examples
- BUILDERS: fix the SSR guidance ("use client" modules still run on
the server; derive in an event handler or effect), and present
hostname-derived and issued/custom codes as equally open paths
- remove personal headers from repo docs; add MIT LICENSE
Repo:
- move local-only tooling and context files out of version control
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Full-codebase review pass. Highlights:
SDK (
@celo/attribution-tags→ 0.3.0)fromDataSuffixnow returnsnullfor non-zero schema IDs (e.g. Schema 1 custom-registry tags) and for empty code fields, instead of returning codes that look canonical but aren't.toDataSuffixrejects comma-joined code fields over 255 bytes (the wire format's single length byte) with a clear error instead of an opaque internal throw..d.tsno longer imports fromviem, so TypeScript consumers who don't install the optional peer no longer get "Cannot find module 'viem'". viem clients still satisfy the new structuralTxClienttype.defaultexport condition (fixesrequire()/ default-condition resolvers) and shipLICENSEin the npm tarball.CI
test-sdk.yml: typecheck + tests + build on PRs and pushes tomain(previously tests only ran at publish time).publish-sdk.yml: fail if the pushed tag doesn't matchsdk/package.jsonversion; actions pinned to commit SHAs.Docs
"use client"modules still execute during SSR, so top-levelwindowaccess throws; the safe pattern is deriving in an event handler/effect. Hostname-derived and issued/custom codes are now presented as equally supported paths.LICENSE.Repo
CLAUDE.md,.claude/,.env.example) moved out of version control and gitignored.Verification
36/36 tests pass (incl. new schema-strictness and length-bound tests);
dist/index.d.tsconfirmed viem-free;npm pack --dry-runshows exactlydist/+ README + LICENSE; the canonicalbaseappconformance vector still matches; both linked mainnet example txs decode correctly through the stricter path.🤖 Generated with Claude Code