Agoric web-wallet integration #7322
-
I've been attempting to connect Agoric's web wallet to a react app and I'd like to have a better understanding of the steps and components involved. I understand it could be a lot to document properly, but would be great if we could capture some helpful links, examples, and other practical information around this topic here while we wait for official documentation. Here are the main topics I want to learn more about:
I've been using dapp-psm as the main example to learn about the integration, not sure if dapp-inter or any other dapps would be preferable or more up to date? Any and all comments, tips, examples, or other resources are welcomed, thanks in advance |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The dapp renders the DappWalletBridge component from @agoric/web-components. That component serves an iframe with the location of
The dapp doesn't actually read anything from the wallet bridge, other than And also, this stuff only works with smart-wallet-enabled dapps, such as psm and vaults. It's not compatible with It's definitely still a work in progress, and we're exploring ways to remove the need for two different sites. |
Beta Was this translation helpful? Give feedback.
The dapp renders the DappWalletBridge component from @agoric/web-components. That component serves an iframe with the location of
bridgeUrl
(e.g. https://wallet.agoric.app/wallet/bridge.html, or whatever the dapp specifies). That iframe can then communicate with both the dapp through window.postMessage , and the wallet UI through local storage (sincebridgeUrl
is meant to be the same origin as your desired wallet UI), hence bridging the dapp and wallet ui together.dapp-psm
is still a good example to follow, and works pretty much the same asdapp-inter
. You can seerequestDappConnection
in the file I linked above. That's what prompts the wallet UI to present the dapp approval modal. Once …