I'm trying to execute code on the client side (not react, not node.js):
<script src="https://unpkg.com/@solana/web3.js@latest/lib/index.iife.js"></script>
<script>
...
Transaction.from(Buffer.from(tx, 'base64'));
...
</script>
But i get error: Buffer is not defined
I'm trying:
<script src="https://cdn.jsdelivr.net/npm/@solana/web3.js@latest/lib/index.iife.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/buffer@latest/index.min.js"></script>
<script>
...
Transaction.from(Buffer.from(tx, 'base64'));
...
</script>
But i get error: Buffer.from is not a function.
How to solve this problem? Is it even possible to do this without node.js?