You can deploy it using remix.ethereum.org and save the smart contract address.
For your reference a sample contract has been deployed here:
0xCB8a3Ca479aa171aE895A5D2215A9115D261A566
Building the frontend
We will have a simple front end with some buttons to interact with the blockchain. Although Banana SDK provides you with a smart contract wallet you don't need worry about its deployment. Everything is handled by us in the SDK so you can just concentrate on building your Dapp.
Dev just need to call createWallet method which will inherently ask user for wallet name once username is provided wallet would be initialized for user and the method would return an instance of wallet.
Connecting Wallet
constconnectWallet=async () => {// checking does wallet name is cached in cookie constwalletName=bananaSdkInstance.getWalletName();// if cached we will use it if (walletName) {setIsLoading(true);// connect wallet with cached wallet nameconstwallet=awaitbananaSdkInstance.connectWallet(walletName);setWalletInstance(wallet);// extracting wallet address for display purposeconstaddress=awaitwallet.getAddress();setWalletAddress(address);setOutput("Wallet Address: "+ address);setIsLoading(false); } else {setIsLoading(false);alert("You don't have wallet created!"); } };
When the user wallet is created the wallet's public data is already cached into the user's cookie. The getWalletName function fetches the walletName from the cookie and once fetched we need to pass walletName into connectWallet which internally initializes and configures some wallet parameters and returns a wallet instance
Getting chainId is pretty straightforward forward devs just have to extract the signer from wallet once signer is extracted you can do getChainId to get the chainId of the current network.
Extracting the network is as easy as it looks dev just need to extract provider from wallet and from provider get network info using getNetwork method.
For making a transaction. you just need to create a transaction object. then extract signer from th wallet instance you received and just make transaction by passing txn object to the send transaction method.
PS: just make sure your wallet is funded before you make any transaction.
Signing a message is as simple as it looks. You just need to pass a message which you need to get signed once signed the method returns an object { messageSigned: "", signature: "" }