Ruby Frontend Architecture
Framework and Technology
Vue UI framework
ElementUI
Vuex
Vue router
Project setup
Compiles and hot-reloads for development
Compiles and minifies for production
Customize Configuration
How to Interact with the Vue Frontend
src/rubyClient.js
exports a JS objectrubyApp
, which provides all necessary APIs to interact with the contract:initRubyEthClient
: initialize a client to interact with a specific Ruby contract that has been deployed on a chain;rubyEthLogin
: retrieve contract status from the chain for a Ruby account secretrubyEthRegister
: register a Ruby account with a provided secretrubyEthDeposit
: deposit certain amount of native tokens on the Ruby contractrubyEthWithdraw
: withdraw a certain amount of native tokens from the Ruby contractrubyEthTransfer
: transfer a certain amount of Ruby tokens from one account to another
When the frontend project initializes, it imports
rubyClient
insrc/main.js
, creates a client instance throughinitRubyClient
, and stores it in a vue instance, so that the whole frontend can call the above APIs through$ruby
.
Last updated