Love the updates! Thank you so much for building this plugin!
Would it be possible to show the native tokenās balance of a wallet? Currently I only see the option to show an ERC-20 tokenās balance. (For example, ETH for Ethereum Mainnet.)
Yes, please check the Demo page, use the action āPay With Metamaskā you can choose token to send and the wallet to receive.
With the action āGet Balance of Tokenā you can check the balance of any token, you only need the token contract address.
You will get the token symbol in the state āToken symbolā and balance in āBalance of tokenā
It is a really powerful action.
Iāll write a documentation to clarify these things.
Yes, but you can send it to one address per transaction. Also, donāt forget that you will need the token X Contract Address.
For example, this is the USDT contract address on Binance Smart Chain
Contract
0x55d398326f99059fF775485246999027B3197955
I suppose that you know how all of this works, be careful, the contract is different from chain to chain, and never send funds directly to token contract!
So with your plugin, if I am the owner of a token, I can distribute different amounts of this token automatically to different addresses, as long as it is 1 per transaction.
You can send any amount of the selected token to 1 address in 1 transaction. Also it is semi automatically as you still need to confirm the transaction in your Metamask (a popup will open)
It is impossible to do it automatically without your wallet secret key, which is very insecure (never share your secret key)
See this action more a payment method for your site, a user can pay for something with Metamask, and using the plugin you can track the transaction status using it events and states.
āETH symbol as the token addressā even from this you can already see that this is wrong, the field accepts a token address not symbol, even if it is the native one.
You have to indicate the ETH address not symbol.
Will add an address checker to avoid error alerts.
But I assume there will be other plugin users that will do the same mistake, I think we can add an autodetect for native token so you can indicate the symbol.
If you are not familiar with these functions, in short, a user can approve spending his tokens for you (app owner) or a more complex contract.
Example:
Bob - user
Alice - App owner
Bob approved spending 100 USDT for Alice from his wallet.
Alice can then send up to 100 USDT from Bobās wallet, anytime anywhere.
This is a key function to use in a true DAPP. For example you can do a subscription type of payment or use it for a more complex contracts like a farming contract.
Hello. I want to buy this plugin but i donāt have any info how to install it, howto use it, etc.
This is standalone script that works on any website?
So
I will be able to download clean files and implement to my index.html?
Itās possible to put one contract address (not editable) in the field: wallet to receive (Pay with Chain native token). Thanks to this users will only have to choose amount of transfer.
Hello, please read carefully the plugin description, there are 2 demo pages and a documentation page. You can see the editor for those demo pages to see how everything works from the inside.
See the plugin description with all links here: https://bubble.io/plugin/web3āmetamask-1612784921335x464807902025875460
No, bubble doesnāt work with index.html files maybe you misunderstood something? Are you new to Bubble?
Yes, please refer to demo page to see how it can be done, thereās an example with this.
Iās sad! I have my own website and i wanted buy your plugin and put on my website and give users chance to buy my things with ether. If You decide create standalone version I will be happy to buy this.
BTW.
So Iām working now for my own code.
Can You tell me how can I changed the code to give user possibility to put his own value in Ether?
here is my code:
<!DOCTYPE html>
<html>
<head>
<script src="https://cdn.jsdelivr.net/npm/web3@latest/dist/web3.min.js"></script>
</head>
<body>
<div>
<button class="enableEthereumButton btn">Enable Ethereum</button>
<button class="sendEthButton btn">Send Eth</button>
<div id="status"></div>
</div>
<script type="text/javascript">
// Running on the page, in the browser
if (typeof window.ethereum !== 'undefined') {
console.log('MetaMask is installed!');
}
if (!ethereum || !ethereum.isMetaMask) {
throw new Error('Please install MetaMask.')
}
/*********************************************************/
/* Handle chain (network) and chainChanged, per EIP 1193 */
/*********************************************************/
// Do this:
ethereum.on('chainChanged', (chainId) => {
/* handle the chainId */
});
const ethereumButton = document.querySelector('.enableEthereumButton');
const sendEthButton = document.querySelector('.sendEthButton');
let accounts = [];
//Sending Ethereum to an address
sendEthButton.addEventListener('click', () => {
ethereum
.request({
method: 'eth_sendTransaction',
params: [
{
from: accounts[0],
to: '0x6714ff3f22f3a42Ae00b27311C6a779775A7cc3F',
value: '0x00',
gasPrice: '0x0000001F6EA08600',
gas: '0x0001ADB0',
},
],
})
.then((txHash) => console.log(txHash))
.catch((error) => console.error);
});
ethereumButton.addEventListener('click', () => {
getAccount();
});
async function getAccount() {
accounts = await ethereum.request({ method: 'eth_requestAccounts' });
}
</script>
</body>
</html>