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
I have the following inside a web component, it seems quite hard to get hyperscript to find the functions defined on the element. i only seem to be able to get it to find global functions
class WalletProvider extends HTMLElement {
...
...
this.innerHTML = `
<button id="connect-wallet-button" script="
on click
call connectWallet() <------------------- hyperscript cant find this
set my innerHTML to 'Connected'
catch err
set my innerHTML to 'Connect Wallet'
end
">Connect Wallet</button>
`;
this.querySelector("#connect-wallet-button").connectWallet =
this.connectWallet.bind(this);<------------------ i've also made sure to add the function to the button
...
...
async connectWallet() {
const resp = await this.wallet.connect();
const publicKey = resp.publicKey.toString();
console.log(`Connected phantom wallet, your public key is ${publicKey}`);
}
The text was updated successfully, but these errors were encountered:
I have the following inside a web component, it seems quite hard to get hyperscript to find the functions defined on the element. i only seem to be able to get it to find global functions
The text was updated successfully, but these errors were encountered: