You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Book now component accepts offer price and currency as params.
Network selector allows the user to select desired blockchain network (list of allowed networks must be configured via app config). When a user selects a network from the list the app must send special request to the Metamask wallet that changes the currently selected network.
Each network has its own set of crypto assets allowed for payments. Assets must be configured via app config.
The smart contract has two functions.
calc makes a calculation of the selected asset value and accepts the following arguments:
asset (asset Id listed in the smart contract)
booking price (fiat price)
pay makes crypto payment. Accepts the following arguments:
asset (asset Id listed in the smart contract)
booking price (fiat price)
guaranteeId (Simard Pay, obtained through the booking API) OR offerID (???)
asset value
expiration time (sec) if during the transaction this time will be reached the transaction will be reverted
When the user selected the network the asset the component must send a calculation request using the calc function. After the calculation is obtained the UI must demonstrate to the user the required asset value.
If the balance of the asset in the user’s wallet is not enough in the UI must be generated warning message.
If the balance of the asset is enough for payment in the UI must be shown a button for starting payment.
The transaction expiration time must be calculated according to the following rule: transaction expiration time must be less than the offer expiration time. The difference between these times must be enough for the completion of the booking procedure via the Glider API.
When the payment transaction is mined the bookingFinalization helper must send a request to the booking API for making the booking via the Glider API.
When booking via the booking API is finished in exchange should be returned a booking ID. This Id should be demonstrated to the user and saved to the local storage into myBookings persistent property.
flowchart
subgraph state[App state]
myBookings
end
state <--> useAppState
useAppState <--> bookingFinalization
Loading
The text was updated successfully, but these errors were encountered:
Book now (components)
The
Book now
component accepts offer price and currency as params.Network selector
allows the user to select desired blockchain network (list of allowed networks must be configured via app config). When a user selects a network from the list the app must send special request to the Metamask wallet that changes the currently selected network.Each
network
has its own set of cryptoassets
allowed for payments.Assets
must be configured via app config.The
smart contract
has two functions.calc
makes a calculation of the selected asset value and accepts the following arguments:pay
makes crypto payment. Accepts the following arguments:When the user selected the
network
theasset
the component must send a calculation request using thecalc
function. After the calculation is obtained the UI must demonstrate to the user the required asset value.When the payment transaction is mined the
bookingFinalization
helper must send a request to thebooking API
for making the booking via the Glider API.When booking via the
booking API
is finished in exchange should be returned abooking ID
. This Id should be demonstrated to the user and saved to the local storage intomyBookings
persistent property.The text was updated successfully, but these errors were encountered: