Skip to content

feat(ts): add @libid/relayer-client, moved from libid-org/relayer - #222

Draft
SupremaLex wants to merge 1 commit into
mainfrom
feat/relayer-client
Draft

SupremaLex wants to merge 1 commit into
mainfrom
feat/relayer-client

Conversation

@SupremaLex

Copy link
Copy Markdown
Member

Adds @libid/relayer-client, moved from libid-org/relayer, as a public workspace package at ts/packages/relayer-client. It drives the libID web-wallet relayer from a page or a server:

  • onboard creates and onboards a web wallet in one relayed transaction: create, link, bind privately, claim the handle's escrow, swap an approved token for ETH when the claim falls short, and repay the relayer. It can also add a second, limited session.
  • signIn signs a new key in to an existing wallet in one relayed transaction.
  • waitFor follows a request.
  • agentPolicy builds a limited session policy for an agent that tips handles.

Draft. @libid/contracts comes from the catalog, and 0.23.0 lacks the WebWallet exports: the wallet ABIs, calls.webWallet, operation lists and session policies. So typecheck, build, test:packages and 14 unit tests fail until the catalog moves to the release that carries libID-contracts#129 and #147. Against the libID-contracts fdbcc68 build, the package typechecks, builds and passes its 27 unit tests, and a packed consumer imports it.

  • Tests: the unit tests and the Base fork test (test:fork, needs anvil and BASE_RPC_URL; not in CI here) move with it. The e2e tests against the relayer's compose stack stay in libid-org/relayer, which will install the published package.
  • Package check: viem is the client's peer. check-packages.ts now asserts that the client is the only package that installs viem, so ceremony, ens, popup and ledger still install without it.
  • Release: listed in scripts/packages.ts. It needs a first npm publish and a trusted publisher before the next package release.

🤖 Generated with Claude Code

The TypeScript client of the libID relayer: onboard a web wallet in one
relayed transaction (create, link the identity, bind it privately, claim
the handle's escrow, swap an approved token for ETH when the claim falls
short, repay the relayer), sign a new key in to an existing wallet, wait
for a request, and build a limited agent session policy. Its unit tests
and the Base fork test (test:fork, needs anvil and BASE_RPC_URL; not run
by CI here) move with it.

It is a public workspace package shaped like @libid/ens: built by
build-package.ts, listed in scripts/packages.ts and in the packed
consumer check. viem is its peer; the consumer check now asserts the client is the only
package that installs it.

@libid/contracts comes from the workspace catalog. The client needs the
WebWallet code (wallet ABIs, call builders, operation lists, session
policies) that is in libID-contracts but not in the cataloged 0.23.0, so
the package does not typecheck or build until the catalog moves to the
release that carries it.

The end-to-end tests against the relayer's local stack stay in
libid-org/relayer.

Assisted-by: Claude Opus 5.5
Signed-off-by: SupremaLex <georglutsenko@gmail.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant