scrypt-ts
.contract_id
, representing the unique identifier of a deployed voting contract.const contract_id = { /** The deployment transaction id */ txId: "5f88721569a223b0d08795328fe45a60723d6a4e5522df743998634b68b9b617", /** The output index */ outputIndex: 0, };
and a utility function, byteString2utf8
, which converts ByteStrings to UTF-8 format (it converts the candidate name from bytestring to string UTF-8 format).
byteString2utf8(success.candidate)
WalletType
enum is declared, providing a structured representation of different wallet options which voter can easily choose from.enum WalletType { PANDA = "panda", TAAL = "taal", Sensilet = "sensilet", }
Modal
component introduces a way for users to connect their wallets.
It features a button to initiate the connection process and a popup offering multiple wallet choices (Panda, Taal and
Sensilet).const address = await signer.getDefaultAddress();
App
):useEffect
hook, it fetches voting contract information and sets up subscriptions for real-time updates.