BifrostTitan / blazor-wasm-dapp-scaffold

A scaffolding project for Solana dApps built with Blazor WebAssembly.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

🏗 Solana App Scaffold

Scaffolding for a dApp built on Solana using Blazor WebAssembly and Solnet + solana-web3.js interoperability

Quickstart

git clone https://github.com/bmresearch/blazor-wasm-dapp-scaffold.git

cd blazor-wasm-dapp-scaffold

Environment

  1. Install net5
  2. Install npm

Before being able to run the project you will need to go inside the src/Client/JsLib folder and do the following:

npm install

npm run build

Overview

This project currently features a bare bones skeleton to easily bootstrap dApps for Solana built using Blazor Wasm.

The list of adapters that were targeted with this:

It is currently able to (with much hacking around and probably a lot of errors/exceptions being thrown):

  • request a connection from the wallet adapter
  • fetch the address of the wallet selected in the wallet adapter
  • request the wallet adapter to sign a transaction

What should be done:

  • writing a class in the src/Client/JsLib which abstracts the Wallet Adapters instead of using them directly and which allows us to plug in an event from C# which has a property with the JSInvokable attribute so it can be directly invoked from the JS
  • in the class mentioned previously some QoL abstractions should be made in order to make it easier to do the JS Interop calls, out of the adapters mentioned previously only the Phantom one has signMessage(message: Uint8Array), and the others have signTransaction(transaction: Transaction) which is the solana-web3.js Transaction object, some compromise should be done in order to make this easier:
    • only do one InvokeAsync<byte[]>("signMessage") where you pass the compiled message from the Solnet TransactionBuilder and it could check if the adapter has signMessage or if it needs to deserialize the compiled message into a transaction object before calling signTransaction

About

A scaffolding project for Solana dApps built with Blazor WebAssembly.

License:MIT License


Languages

Language:C# 41.5%Language:HTML 35.6%Language:TypeScript 13.9%Language:CSS 7.3%Language:JavaScript 1.7%