You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<!DOCTYPE html><htmllang="en"><head><metacharset="UTF-8"><title>SDK test in browser</title></head><body>
Open developer console
<scriptsrc="https://unpkg.com/@aeternity/aepp-sdk@13.2.0/dist/aepp-sdk.browser-script.js"></script><scripttype="text/javascript">const{ AeSdkAepp, Node, CompilerHttp, walletDetector, BrowserWindowMessageConnection }=Aeternity;constaeSdk=newAeSdkAepp({name: 'Simple æpp',nodes: [{name: 'testnet',instance: newNode('https://testnet.aeternity.io')},{name: 'mainnet',instance: newNode('https://mainnet.aeternity.io')},],onCompiler: newCompilerHttp('https://v7.compiler.aepps.com'),asynconNetworkChange({ networkId }){console.log('Network',networkId);const[{ name }]=(awaitthis.getNodesInPool()).filter((node)=>node.nodeNetworkId===networkId);this.selectNode(name);},});asyncfunctiondetectWallets(){constconnection=newBrowserWindowMessageConnection();returnnewPromise((resolve,reject)=>{conststopDetection=walletDetector(connection,async({ newWallet })=>{if(confirm(`Do you want to connect to wallet ${newWallet.info.name} with id ${newWallet.info.id}`)){stopDetection();resolve(newWallet.getConnection());}});});}(async()=>{console.log('Looking for a wallet');constconnection=awaitdetectWallets();constwalletInfo=awaitaeSdk.connectToWallet(connection);console.log('Connected to',walletInfo);const{address: { current }}=awaitaeSdk.subscribeAddress('subscribe','connected');console.log('Address',current);})();</script></body></html>
save the above to index.html
drag it into Chrome
ensure that it stuck after printing "Looking for a wallet", with Superhero Wallet installed
The text was updated successfully, but these errors were encountered:
index.html
The text was updated successfully, but these errors were encountered: