Skip to content

Commit

Permalink
src/proxies.ts: Add typedoc example for DiamondProxyResolver.facets
Browse files Browse the repository at this point in the history
  • Loading branch information
shazow committed Oct 1, 2024
1 parent bb9f2c9 commit 3dc8f52
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/proxies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
* if (result.proxies.length > 0) console.log("Proxies detected:", result.proxies);
* // Note that some proxies can only be resolved relative to a selector, like DiamondProxy. These will need to be resolved manually via result.proxies.
* ```
*
* @example
* Resolve a DiamondProxy:
* ```ts
Expand All @@ -39,6 +40,13 @@
* const implementationAddress = await resolver.resolve(provider, address, selector);
* ```
*
* @example
* Get all facets and selectors for a DiamondProxy:
* ```ts
* // Let's say we have a result with a DiamondProxy in it, from the above example
* const diamondResolver = result.proxies[0] as DiamondProxyResolver;
* const facets = await diamondResolver.facets(provider, address); // All possible address -> selector[] mappings
* ```
*/
import type { StorageProvider, CallProvider } from "./providers.js";
import { addSlotOffset, readArray, joinSlot } from "./slots.js";
Expand Down

0 comments on commit 3dc8f52

Please sign in to comment.