Skip to content

feat(contracts): implement guild owner lookup#65

Merged
Lakes41 merged 1 commit into
Adamantine-guild:mainfrom
h1065153539-create:feat/guild-owner-lookup
Jun 21, 2026
Merged

feat(contracts): implement guild owner lookup#65
Lakes41 merged 1 commit into
Adamantine-guild:mainfrom
h1065153539-create:feat/guild-owner-lookup

Conversation

@h1065153539-create

Copy link
Copy Markdown
Contributor

Summary

/claim #12

Implements ContractClient.getGuildOwner so SDK users can fetch guild ownership from the configured contract instead of receiving NOT_IMPLEMENTED.

Changes

  • Adds a typed GuildOwnerParams contract method input.
  • Validates guildId, rpcUrl, and contract address before making network calls.
  • Encodes supported guild IDs as bytes32 and sends an eth_call to getGuildOwner(bytes32).
  • Decodes and validates the returned owner address.
  • Surfaces clear SDK errors for missing config, RPC failures, and malformed RPC responses.
  • Documents usage in README, SDK guide, and API reference.

Testing

  • npm.cmd run typecheck - passed
  • npm.cmd run test:run - passed, 101 tests
  • npm.cmd run build - passed
  • npm.cmd run test:smoke - passed ESM/CJS/type smoke checks
  • npm.cmd run lint - exited 0 with existing repository warnings only
  • git diff --check - passed

Security / compatibility notes

  • The implementation uses standard JSON-RPC eth_call only; it does not sign transactions or mutate chain state.
  • No secrets, private keys, API keys, or wallet credentials are logged or added.
  • Existing contract stubs for token balance and role requirements keep their current behavior.

- rebase guild owner lookup onto current main
- resolve RPC and contract settings through getChainConfig
- support per-call chain and contract overrides
- preserve chain-aware config tests with owner lookup coverage
@h1065153539-create h1065153539-create force-pushed the feat/guild-owner-lookup branch from 00452c0 to 4647fa2 Compare June 20, 2026 23:23
@h1065153539-create

Copy link
Copy Markdown
Contributor Author

Refreshed this PR at 4647fa2 on top of current main (�fa3297) after the chain-aware contract config landed.

What changed in the refresh:

  • Kept getGuildOwner, but now resolves
    pcUrl / contractAddress through getChainConfig(params.chainId).
  • Added optional per-call chainId support while preserving per-call contractAddress overrides.
  • Kept the newly merged chain config tests passing alongside guild-owner lookup coverage.

Validation run locally:

pm run test:run -- tests/contracts.test.ts tests/client.test.ts -> 26 tests passed

pm run typecheck -> passed

pm run build -> passed

PR status after refresh: mergeable clean.

@Lakes41 Lakes41 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Splendid implementation

@Lakes41 Lakes41 merged commit 4997217 into Adamantine-guild:main Jun 21, 2026
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.

2 participants