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
Feat/wallet get capabilities cache #4486
Conversation
capabilities: { | ||
...(sessionCapabilities || {}), | ||
[address]: capabilities, | ||
} as any, // by spec sessionProperties should be <string, string> but here are used as objects? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what do we do about this? The spec
is the EIP-5792 spec. I think we do something else maybe in our CAIP-25 spec? So maybe we just cover the "right" think in our wallet docs / wallet SDK?
We probably need to expand our namespace builder for this usecase
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
according to caip-25
spec the sessionProperties (scopeProperties) is <string, string>
@@ -1001,6 +1002,78 @@ describe("UniversalProvider", function () { | |||
expectedChainId, | |||
}); | |||
}); | |||
it("should cache `wallet_getCapabilities` request", async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you need a negative test here if not cached?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the first part of the test where the wallet receives the request covers the not cached part. If it was cached already the request wouldn't have been sent to the wallet
Description
Implemented
wallet_getCapabilities
caching inuniversal-provider
Type of change
How has this been tested?
tests
Checklist
Additional Information (Optional)
Please include any additional information that may be useful for the reviewer.