Skip to content
This repository was archived by the owner on Apr 18, 2026. It is now read-only.

fix: make getLinkedAgw parameters optional#419

Merged
coffeexcoin merged 2 commits intoAbstract-Foundation:mainfrom
aproskill81:fix/get-linked-agw-optional-params
Apr 4, 2026
Merged

fix: make getLinkedAgw parameters optional#419
coffeexcoin merged 2 commits intoAbstract-Foundation:mainfrom
aproskill81:fix/get-linked-agw-optional-params

Conversation

@aproskill81
Copy link
Copy Markdown
Contributor

@aproskill81 aproskill81 commented Mar 25, 2026

The getLinkedAgw action already falls back to client.account?.address when no address is provided, but its signature still required a GetLinkedAgwParameters object.

This makes the second argument optional so consumers can call getLinkedAgw(client) directly, matching the existing behavior exposed through linkableWalletActions().getLinkedAgw() and reducing unnecessary boilerplate.

Changes

  • make parameters optional in getLinkedAgw
  • add a unit test covering direct action usage without parameters

Risk

Low. This is a small additive API improvement with no change to the existing fallback/error behavior.


PR-Codex overview

This PR focuses on tightening the typing of the getLinkedAgw function to allow clients with hoisted accounts to call it without parameters, while requiring an address for clients without hoisted accounts. It also includes updates to related interfaces and tests.

Detailed summary

  • Updated LinkablePublicActions and LinkableWalletActions to use GetLinkedAgwAction for getLinkedAgw.
  • Modified getLinkedAgw function signatures to support optional parameters.
  • Enhanced type definitions for GetLinkedAgwParameters to conditionally require address.
  • Added tests for getLinkedAgw to validate behavior with omitted parameters.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Mar 25, 2026

🦋 Changeset detected

Latest commit: b14cf57

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@abstract-foundation/agw-client Minor
@abstract-foundation/agw-react Patch
@abstract-foundation/agw-web Patch
@abstract-foundation/web3-react-agw Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@cursor
Copy link
Copy Markdown

cursor Bot commented Mar 25, 2026

PR Summary

Low Risk
Low risk: this only relaxes the getLinkedAgw call signature to allow omitting the params object and adds a unit test; runtime behavior and validation paths remain the same.

Overview
getLinkedAgw now defaults its parameters argument to {}, allowing consumers to call getLinkedAgw(client) and rely on the existing fallback to client.account?.address.

Adds a unit test that mocks readContract and verifies the no-parameters call uses the connected account and returns the linked AGW address.

Written by Cursor Bugbot for commit 791cb36. This will update automatically on new commits. Configure here.

@coffeexcoin coffeexcoin merged commit 88a2e4c into Abstract-Foundation:main Apr 4, 2026
4 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants