Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sapphire-viem-v2: ProxyObject throws error due to changed function signature #385

Closed
aefhm opened this issue Sep 9, 2024 · 0 comments · Fixed by #411
Closed

sapphire-viem-v2: ProxyObject throws error due to changed function signature #385

aefhm opened this issue Sep 9, 2024 · 0 comments · Fixed by #411
Assignees
Labels
client javascript Pull requests that update JavaScript code p:1 Priority: high

Comments

@aefhm
Copy link
Contributor

aefhm commented Sep 9, 2024

SUMMARY

Using Brave wallet on Brave browser with the Viem client results in JS/TypeScript error. This was first reported by 0x2fa during testing. https://github.com/0x2fa-org/0x2fa

ISSUE TYPE
  • Bug Report
STEPS TO REPRODUCE

Visit 0x2fa.com on Brave with default wallet selected of Brave wallet.

ACTUAL RESULTS

The way that the sapphire-client produces a Proxy object via wrapping the original Provider modifies the type.

return typeof value === 'function' ? value.bind(upstream) : value;

Apparently, running a local application without binding the context works.

Uncaught (in promise) TypeError: 'get' on proxy: property 'removeListener' is a read-only and non-configurable data property on the proxy target but the proxy did not return its actual value (expected 'function(e,t){var n,r,i,o,s;if(u(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n...<omitted>...s}' but got 'function () { [native code] }')
EXPECTED RESULTS

Brave wallet should work as a default on Brave browser.

@aefhm aefhm changed the title sapphire-viem-v2: ProxyObject throws error due to changed function sapphire-viem-v2: ProxyObject throws error due to changed function signature Sep 9, 2024
@aefhm aefhm added this to the integrations-viem-2.0.1 milestone Sep 9, 2024
@aefhm aefhm added p:1 Priority: high client javascript Pull requests that update JavaScript code labels Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client javascript Pull requests that update JavaScript code p:1 Priority: high
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants