Compare commits
No commits in common. "master" and "dev" have entirely different histories.
32
.github/workflows/repopush.yml
vendored
32
.github/workflows/repopush.yml
vendored
@ -1,32 +0,0 @@
|
||||
name: Workflow push to Dappbundle
|
||||
on: [push]
|
||||
jobs:
|
||||
build:
|
||||
name: Build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Executing remote command
|
||||
uses: appleboy/ssh-action@v1.0.0
|
||||
with:
|
||||
host: ${{ secrets.R_HOST }}
|
||||
username: ${{ secrets.P_USERNAME }}
|
||||
password: ${{ secrets.P_PASSWORD }}
|
||||
port: ${{ secrets.SSH_PORT }}
|
||||
script: |
|
||||
if [ -d "${{ secrets.DEPLOYMENT_LOCATION}}/dappbundle" ]; then
|
||||
echo "Folder exists. Skipping Git clone."
|
||||
else
|
||||
echo "Folder does not exist. Cloning repository..."
|
||||
cd ${{ secrets.DEPLOYMENT_LOCATION}}/ && git clone https://github.com/ranchimall/dappbundle.git
|
||||
fi
|
||||
|
||||
if [ -d "${{ secrets.DEPLOYMENT_LOCATION}}/dappbundle/${{ github.event.repository.name }}" ]; then
|
||||
echo "Repository exists. Remove folder "
|
||||
rm -r "${{ secrets.DEPLOYMENT_LOCATION}}/dappbundle/${{ github.event.repository.name }}"
|
||||
fi
|
||||
|
||||
echo "Cloning repository..."
|
||||
cd ${{ secrets.DEPLOYMENT_LOCATION}}/dappbundle && git clone https://github.com/ranchimall/${{ github.event.repository.name }}
|
||||
|
||||
cd "${{ secrets.DEPLOYMENT_LOCATION}}/dappbundle/${{ github.event.repository.name }}" && rm -rf .gitattributes .git .github .gitignore
|
||||
cd ${{ secrets.DEPLOYMENT_LOCATION}}/dappbundle/ && git add . && git commit -m "Workflow updating files of ${{ github.event.repository.name }}" && git push "https://saketongit:${{ secrets.RM_ACCESS_TOKEN }}@github.com/ranchimall/dappbundle.git"
|
||||
55
README.md
55
README.md
@ -1,76 +1,73 @@
|
||||
# FLO Wallet
|
||||
RanchiMall FLO Web Wallet
|
||||
# FLO_webWallet
|
||||
FLO Web Wallet
|
||||
|
||||
These are client-side scripts that can generate FLO addresses, send FLO transactions to the blockchain and monitor FLO data from the blockchain
|
||||
These are client side scripts that can generate FLO addresses, send FLO transactions to the blockchain and monitor FLO data from the blockchain
|
||||
|
||||
NOTE: Use respective file for mainnet and testnet
|
||||
|
||||
### Live URL for FLO Wallet:
|
||||
*https://ranchimall.github.io/flowallet/*
|
||||
NOTE : Use respective file for mainnet and testnet
|
||||
|
||||
## Instructions to use
|
||||
|
||||
Note: Web wallet uses IndedxedDB for storing data, which means data is stored in the respective browser you used to open web wallet. Data stored by one browser can't be accessed by other browsers.
|
||||
Note : Web wallet uses IndedxedDB for storing data, which means data is stored in respective browser you used to open web wallet.Data stored by one browser can't be accessed by other browser.
|
||||
|
||||
There are 4 pages in this web app :
|
||||
----------------------
|
||||
|
||||
### Monitor FLO Data
|
||||
|
||||
This app allows users to view the transactions done by the given address/es.
|
||||
This apge allows user to view the transactions done by the given address/es.
|
||||
1. Click/Tap on the '+' floating button at bottom-right hand side, which opens a popup window.
|
||||
|
||||
2. Enter the FLO address that you want to monitor, You can also specify a label for that address which will be displayed as a name for that address. If you left the label field empty, the default label will be 'Unknown'.
|
||||
2. Enter the FLO address that you want to monitor, You can also specify a label to that address which will be displayed as name for that address.If you left label field empty, the default label will be 'Unknown'.
|
||||
|
||||
3. Click/Tap on 'Ok' and the address you added will be displayed on the monitoring page as a card. This address is also added to your local database. Once you add an address/label pair, It will stay there until you clear data(Option available on Settings page).
|
||||
3. Click/Tap on 'Ok' and the address you added will be displayed on monitoring page as a card.This address is also added to your local database.Once you add an address/label pair, It will stay there untill you clear data(Option available in Settings page).
|
||||
|
||||
4. When you hover the mouse pointer on a monitoring card, three dots will appear. clicking on this allows the user to edit or remove that address from the monitoring list.(On mobile devices this option is always visible)
|
||||
4. When you hover mouse pointer on a monitoring card, three dots will appear. clicking on this allows user to edit or remove that address from monitoring list.(On mobile devices this option is always visible)
|
||||
|
||||
5. To see transactions done by any address, click/Tap on the respective address card. It will open a follow-up window, which displays transactions in the message format. consisting of data sent/received to/from, date of transaction, and FLO data. Arrows on the message body indicate the direction of the transaction i.e. Data is sent or received. On the top of the window, we have the option to go back to the monitoring page or refresh the transaction history.
|
||||
5. To see transactions done by any address, click/Tap on respective address card.It will open an follow up window, which displays transactions in messege format. consisting of data sent/received to/from, date of transaction and FLO data. Arrows on messege body indicate direction of transaction i.e. Data is sent or received.On the top of window we have option to go back to monitoring page or refresh the transaction history.
|
||||
|
||||
### Send FLO Data
|
||||
|
||||
This page allows users to send FLO data and transactions to the blockchain. To send any data you have to check your balance first, to make sure you have enough balance as each transaction requires 0.0005 FLOs to be valid.
|
||||
This page allows user to send FLO data and transactions to the blockchain.To send any data you have to check your balance first, to make sure you have enough balance as each transaction requires 0.0005 FLOs to be valid.
|
||||
|
||||
1. Enter the sender's address
|
||||
2. Click check balance.
|
||||
3. Balance of the respective address will be displayed
|
||||
4. Enter the Receiver's address
|
||||
5. Enter the amount
|
||||
5. Enter amount
|
||||
6. Enter FLO data (if required)
|
||||
7. Click Send
|
||||
8. Enter the private key for the address in the prompt
|
||||
9. The transaction will be sent to the blockchain and returns the txid (returns error if any).
|
||||
|
||||
Note: Transaction fee is set to 0.0005
|
||||
Note : Transcation fee is set to 0.0005
|
||||
|
||||
### FLO address generation/recovery page
|
||||
This page can be used to generate or recover FLO addresses and private key pairs. This page has two buttons
|
||||
#### generate a new address
|
||||
As the name implies this button when clicked/tapped generates a new FLO address and private key pair. Also, there is a one-click/tap option that allows the user to copy the FLO address or private key.
|
||||
This page can be used to generate or recover FLO address and private key pairs.This page has two buttons
|
||||
#### generate new address
|
||||
As the name implies this button when clicked/tapped generates new FLO address and private key pair.Also there is an one click/tap option that allows user to copy FLO address or private key.
|
||||
|
||||
#### Recover FLO address
|
||||
This button when click/tapped opens a popup, which prompts the user to enter private key associated with the FLO address that has to be recovered. Once the correct private key is entered corresponding FLO address is displayed again.
|
||||
#### recover FLO address
|
||||
This button when click/tapped opens a popup, which prompts user to enter private key associated with the FLO address that has to be recovered. Once correct private key is entered corresponding FLO address is displayed again.
|
||||
|
||||
Note: Do not share your private key with anyone and keep it safe. Once lost a private key can't be recovered.
|
||||
Note : Do not share your private key with anyone and keep it safe. Once lost a private key can't be recovered.
|
||||
|
||||
### Settings page
|
||||
|
||||
This page contains settings and information about Webapp.
|
||||
This page contains settings and information about webapp.
|
||||
|
||||
#### Dark mode setting
|
||||
|
||||
This section allows the user to set a color scheme (light/dark) with two options, either automatic or manual.
|
||||
1. Automatic - If this toggle is turned on, Dark mode is enabled automatically from 6 pm to 6 am (Custom timing will be added in future versions).
|
||||
This section allows user to set color scheme (light/dark) with two options, either automatic or manual.
|
||||
1. Automatic - If this toggle is turned on, Dark mode is enabled automatically from 6pm to 6am(Custom timing will be added in future versions).
|
||||
|
||||
2. Manual - Turning this toggle on/off changes the color scheme and stays in that mode unless changed by the user again.
|
||||
2. Manual - Turning this toggle on/off changes color scheme and stayes in that mode unless changed by user again.
|
||||
|
||||
#### CLear all local data
|
||||
|
||||
This option clears all the data stored in IndexedDB databases from the browser. This is the same as clearing browser data and cache. After deleting data, it may take more time to load transactions as they are now fetched again from the blockchain. Also, you have to add addresses to start monitoring again.
|
||||
This option clears all the data stored in IndexedDB databases from browser. This is same as clearing browser data and cache.After deleting data, it may take more time to load transactions as they are now fetched again from blockchain. Also you have to add addresses to start monitoring again.
|
||||
|
||||
#### About
|
||||
This section contains information about the version and underlying technologies.
|
||||
This section contains information about version and underlying technologies.
|
||||
|
||||
|
||||
Note: For reducing API calls and processing time, monitored data are stored in the local browser. While monitoring the same address, the data from the browser database (IndexedDB) is used and only the new transactions are obtained using API.
|
||||
Note : For reducing API calls and processing time , monitored data are stored in local browser. While monitoring the same address, the data from browser database (IndexedDB) is used and only the new transactions are obtained using API.
|
||||
|
||||
108
css/main.css
108
css/main.css
@ -16,7 +16,7 @@ body {
|
||||
|
||||
body {
|
||||
--accent-color: #256eff;
|
||||
--text-color: 34, 34, 34;
|
||||
--text-color: 20, 20, 20;
|
||||
--background-color: 240, 240, 240;
|
||||
--foreground-color: 250, 250, 250;
|
||||
--danger-color: rgb(255, 75, 75);
|
||||
@ -25,6 +25,7 @@ body {
|
||||
scrollbar-gutter: stable;
|
||||
color: rgba(var(--text-color), 1);
|
||||
background-color: rgba(var(--background-color), 1);
|
||||
transition: background-color 0.3s;
|
||||
--dark-red: #d40e1e;
|
||||
--red: #f50000;
|
||||
--kinda-pink: #e40273;
|
||||
@ -607,6 +608,7 @@ h3 {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
background-color: rgba(var(--foreground-color), 1);
|
||||
transition: background-color 0.3s;
|
||||
}
|
||||
|
||||
#pages_container {
|
||||
@ -645,7 +647,10 @@ h3 {
|
||||
border-radius: 0.3rem;
|
||||
text-align: center;
|
||||
}
|
||||
.nav-item .icon, .nav-item__title {
|
||||
.nav-item .icon {
|
||||
transition: transform 0.2s;
|
||||
}
|
||||
.nav-item__title {
|
||||
transition: opacity 0.2s, transform 0.2s;
|
||||
}
|
||||
.nav-item--active {
|
||||
@ -664,17 +669,12 @@ h3 {
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
::view-transition {
|
||||
transition: 0.3s;
|
||||
}
|
||||
|
||||
#fix_invalid_button {
|
||||
margin-bottom: 1rem !important;
|
||||
}
|
||||
|
||||
.password-field label {
|
||||
display: flex;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.password-field label input:checked ~ .visible {
|
||||
display: none;
|
||||
@ -754,16 +754,6 @@ h3 {
|
||||
position: relative;
|
||||
height: 100%;
|
||||
}
|
||||
#search sm-chips,
|
||||
#search #pagination_wrapper {
|
||||
background-color: rgba(var(--text-color), 0.06);
|
||||
border-radius: 0.7rem;
|
||||
padding: 0.3rem;
|
||||
}
|
||||
#search .pagination__item:not(.pagination__item--active) {
|
||||
background-color: rgba(var(--text-color), 0.06);
|
||||
color: rgba(var(--text-color), 1);
|
||||
}
|
||||
|
||||
#queried_flo_address h4 {
|
||||
font-size: 1.1rem;
|
||||
@ -805,9 +795,6 @@ h3 {
|
||||
color: rgba(var(--text-color), 0.9);
|
||||
font-weight: 500;
|
||||
}
|
||||
.transaction__receiver:hover {
|
||||
color: var(--accent-color);
|
||||
}
|
||||
.transaction__amount {
|
||||
font-weight: 700;
|
||||
}
|
||||
@ -990,7 +977,7 @@ h3 {
|
||||
|
||||
#transaction_result {
|
||||
display: grid;
|
||||
gap: 1.5rem;
|
||||
gap: 0.5rem;
|
||||
height: max(40vh, 24rem);
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
@ -1004,7 +991,7 @@ h3 {
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
}
|
||||
#transaction_result > .icon {
|
||||
#transaction_result .icon {
|
||||
justify-self: center;
|
||||
height: 4rem;
|
||||
width: 4rem;
|
||||
@ -1013,21 +1000,18 @@ h3 {
|
||||
-webkit-animation: popup 1s;
|
||||
animation: popup 1s;
|
||||
}
|
||||
#transaction_result > .icon--success {
|
||||
#transaction_result .icon--success {
|
||||
fill: rgba(var(--background-color), 1);
|
||||
padding: 1rem;
|
||||
background-color: #0bbe56;
|
||||
}
|
||||
#transaction_result > .icon--failed {
|
||||
#transaction_result .icon--failed {
|
||||
background-color: rgba(var(--text-color), 0.03);
|
||||
fill: var(--danger-color);
|
||||
}
|
||||
#transaction_result sm-copy {
|
||||
font-size: 0.8rem;
|
||||
}
|
||||
#transaction_result #transaction_link {
|
||||
justify-self: center;
|
||||
}
|
||||
|
||||
@-webkit-keyframes popup {
|
||||
0% {
|
||||
@ -1074,14 +1058,23 @@ h3 {
|
||||
padding-bottom: 4rem;
|
||||
}
|
||||
|
||||
#pagination_wrapper:empty {
|
||||
display: none !important;
|
||||
#pagination_wrapper {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
margin: 0 auto;
|
||||
padding: 0.5rem;
|
||||
background-color: rgba(var(--foreground-color), 1);
|
||||
z-index: 5;
|
||||
border-radius: 0.7rem;
|
||||
box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.2);
|
||||
margin: 0.5rem;
|
||||
}
|
||||
|
||||
.pagination__item {
|
||||
display: flex;
|
||||
padding: 0.2rem 0.5rem;
|
||||
border-radius: 0.5rem;
|
||||
border-radius: 0.3rem;
|
||||
}
|
||||
.pagination__item--active {
|
||||
background-color: var(--accent-color);
|
||||
@ -1254,6 +1247,15 @@ legend,
|
||||
transform: translateY(100%);
|
||||
opacity: 0;
|
||||
}
|
||||
#pagination_wrapper {
|
||||
margin: 0;
|
||||
margin-bottom: 4.8rem;
|
||||
left: 50%;
|
||||
right: auto;
|
||||
transform: translateX(-50%);
|
||||
width: calc(100vw - 2rem);
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
}
|
||||
@media screen and (min-width: 40rem) {
|
||||
sm-popup {
|
||||
@ -1280,38 +1282,6 @@ legend,
|
||||
#pages_container {
|
||||
grid-area: main;
|
||||
}
|
||||
::view-transition-old(pages-container) {
|
||||
-webkit-animation: slide-out-right 0.3s;
|
||||
animation: slide-out-right 0.3s;
|
||||
}
|
||||
@-webkit-keyframes slide-out-right {
|
||||
to {
|
||||
opacity: 0;
|
||||
transform: translateX(1rem);
|
||||
}
|
||||
}
|
||||
@keyframes slide-out-right {
|
||||
to {
|
||||
opacity: 0;
|
||||
transform: translateX(1rem);
|
||||
}
|
||||
}
|
||||
::view-transition-new(pages-container) {
|
||||
-webkit-animation: slide-in-right 0.3s;
|
||||
animation: slide-in-right 0.3s;
|
||||
}
|
||||
@-webkit-keyframes slide-in-right {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translateX(-1rem);
|
||||
}
|
||||
}
|
||||
@keyframes slide-in-right {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translateX(-1rem);
|
||||
}
|
||||
}
|
||||
.page {
|
||||
padding: 0 1.5rem;
|
||||
}
|
||||
@ -1373,6 +1343,11 @@ legend,
|
||||
margin: auto;
|
||||
width: min(36rem, 100%);
|
||||
}
|
||||
#smart_contract_creation_form::part(form).split-layout {
|
||||
grid-template-columns: 1fr 1.5fr;
|
||||
align-items: flex-start;
|
||||
width: min(50rem, 100%);
|
||||
}
|
||||
.payee-address-wrapper {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 8rem 3rem;
|
||||
@ -1433,13 +1408,4 @@ legend,
|
||||
}
|
||||
.hidden {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion) {
|
||||
::view-transition-group(*),
|
||||
::view-transition-old(*),
|
||||
::view-transition-new(*) {
|
||||
-webkit-animation: none !important;
|
||||
animation: none !important;
|
||||
}
|
||||
}
|
||||
2
css/main.min.css
vendored
2
css/main.min.css
vendored
File diff suppressed because one or more lines are too long
@ -16,7 +16,7 @@ body {
|
||||
|
||||
body {
|
||||
--accent-color: #256eff;
|
||||
--text-color: 34, 34, 34;
|
||||
--text-color: 20, 20, 20;
|
||||
--background-color: 240, 240, 240;
|
||||
--foreground-color: 250, 250, 250;
|
||||
--danger-color: rgb(255, 75, 75);
|
||||
@ -25,6 +25,7 @@ body {
|
||||
scrollbar-gutter: stable;
|
||||
color: rgba(var(--text-color), 1);
|
||||
background-color: rgba(var(--background-color), 1);
|
||||
transition: background-color 0.3s;
|
||||
// Accent colors
|
||||
--dark-red: #d40e1e;
|
||||
--red: #f50000;
|
||||
@ -579,11 +580,13 @@ h3 {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
background-color: rgba(var(--foreground-color), 1);
|
||||
transition: background-color 0.3s;
|
||||
}
|
||||
#pages_container {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
#main_navbar {
|
||||
display: flex;
|
||||
background: rgba(var(--text-color), 0.03);
|
||||
@ -613,7 +616,9 @@ h3 {
|
||||
font-size: 0.7rem;
|
||||
border-radius: 0.3rem;
|
||||
text-align: center;
|
||||
.icon,
|
||||
.icon {
|
||||
transition: transform 0.2s;
|
||||
}
|
||||
&__title {
|
||||
transition: opacity 0.2s, transform 0.2s;
|
||||
}
|
||||
@ -631,12 +636,8 @@ h3 {
|
||||
background: var(--accent-color);
|
||||
border-radius: 1rem 1rem 0 0;
|
||||
z-index: 1;
|
||||
// view-transition-name: indicator;
|
||||
}
|
||||
}
|
||||
::view-transition {
|
||||
transition: 0.3s;
|
||||
}
|
||||
|
||||
#fix_invalid_button {
|
||||
margin-bottom: 1rem !important;
|
||||
@ -645,7 +646,6 @@ h3 {
|
||||
.password-field {
|
||||
label {
|
||||
display: flex;
|
||||
flex-shrink: 0;
|
||||
input:checked ~ .visible {
|
||||
display: none;
|
||||
}
|
||||
@ -720,18 +720,6 @@ h3 {
|
||||
#search {
|
||||
position: relative;
|
||||
height: 100%;
|
||||
sm-chips,
|
||||
#pagination_wrapper {
|
||||
background-color: rgba(var(--text-color), 0.06);
|
||||
border-radius: 0.7rem;
|
||||
padding: 0.3rem;
|
||||
}
|
||||
.pagination__item {
|
||||
&:not(.pagination__item--active) {
|
||||
background-color: rgba(var(--text-color), 0.06);
|
||||
color: rgba(var(--text-color), 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
#queried_flo_address {
|
||||
h4 {
|
||||
@ -772,9 +760,6 @@ h3 {
|
||||
margin-left: 0.5rem;
|
||||
color: rgba(var(--text-color), 0.9);
|
||||
font-weight: 500;
|
||||
&:hover {
|
||||
color: var(--accent-color);
|
||||
}
|
||||
}
|
||||
&__amount {
|
||||
font-weight: 700;
|
||||
@ -959,7 +944,7 @@ h3 {
|
||||
}
|
||||
#transaction_result {
|
||||
display: grid;
|
||||
gap: 1.5rem;
|
||||
gap: 0.5rem;
|
||||
height: max(40vh, 24rem);
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
@ -972,7 +957,7 @@ h3 {
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
}
|
||||
& > .icon {
|
||||
.icon {
|
||||
justify-self: center;
|
||||
height: 4rem;
|
||||
width: 4rem;
|
||||
@ -992,9 +977,6 @@ h3 {
|
||||
sm-copy {
|
||||
font-size: 0.8rem;
|
||||
}
|
||||
#transaction_link {
|
||||
justify-self: center;
|
||||
}
|
||||
}
|
||||
@keyframes popup {
|
||||
0% {
|
||||
@ -1021,14 +1003,21 @@ h3 {
|
||||
padding-bottom: 4rem;
|
||||
}
|
||||
#pagination_wrapper {
|
||||
&:empty {
|
||||
display: none !important;
|
||||
}
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
margin: 0 auto;
|
||||
padding: 0.5rem;
|
||||
background-color: rgba(var(--foreground-color), 1);
|
||||
z-index: 5;
|
||||
border-radius: 0.7rem;
|
||||
box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.2);
|
||||
margin: 0.5rem;
|
||||
}
|
||||
.pagination__item {
|
||||
display: flex;
|
||||
padding: 0.2rem 0.5rem;
|
||||
border-radius: 0.5rem;
|
||||
border-radius: 0.3rem;
|
||||
&--active {
|
||||
background-color: var(--accent-color);
|
||||
color: rgba(var(--background-color), 1);
|
||||
@ -1202,6 +1191,15 @@ legend,
|
||||
}
|
||||
}
|
||||
}
|
||||
#pagination_wrapper {
|
||||
margin: 0;
|
||||
margin-bottom: 4.8rem;
|
||||
left: 50%;
|
||||
right: auto;
|
||||
transform: translateX(-50%);
|
||||
width: calc(100vw - 2rem);
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
}
|
||||
@media screen and (min-width: 40rem) {
|
||||
sm-popup {
|
||||
@ -1230,24 +1228,6 @@ legend,
|
||||
#pages_container {
|
||||
grid-area: main;
|
||||
}
|
||||
::view-transition-old(pages-container) {
|
||||
animation: slide-out-right 0.3s;
|
||||
}
|
||||
@keyframes slide-out-right {
|
||||
to {
|
||||
opacity: 0;
|
||||
transform: translateX(1rem);
|
||||
}
|
||||
}
|
||||
::view-transition-new(pages-container) {
|
||||
animation: slide-in-right 0.3s;
|
||||
}
|
||||
@keyframes slide-in-right {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translateX(-1rem);
|
||||
}
|
||||
}
|
||||
.page {
|
||||
padding: 0 1.5rem;
|
||||
}
|
||||
@ -1310,6 +1290,11 @@ legend,
|
||||
gap: 1.5rem;
|
||||
margin: auto;
|
||||
width: min(36rem, 100%);
|
||||
&.split-layout {
|
||||
grid-template-columns: 1fr 1.5fr;
|
||||
align-items: flex-start;
|
||||
width: min(50rem, 100%);
|
||||
}
|
||||
}
|
||||
.payee-address-wrapper {
|
||||
display: grid;
|
||||
@ -1378,10 +1363,3 @@ legend,
|
||||
.hidden {
|
||||
display: none !important;
|
||||
}
|
||||
@media (prefers-reduced-motion) {
|
||||
::view-transition-group(*),
|
||||
::view-transition-old(*),
|
||||
::view-transition-new(*) {
|
||||
animation: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
1163
index.html
1163
index.html
File diff suppressed because it is too large
Load Diff
3353
index.min.html
3353
index.min.html
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
1
scripts/components.min.js
vendored
1
scripts/components.min.js
vendored
File diff suppressed because one or more lines are too long
@ -49,80 +49,63 @@
|
||||
}
|
||||
|
||||
function formatTx(address, tx) {
|
||||
const result = {
|
||||
time: tx.time,
|
||||
block: tx.blockheight,
|
||||
blockhash: tx.blockhash,
|
||||
txid: tx.txid,
|
||||
floData: tx.floData,
|
||||
confirmations: tx.confirmations
|
||||
};
|
||||
|
||||
// ---- Receivers (outputs) ----
|
||||
const receivers = {};
|
||||
for (const vout of tx.vout || []) {
|
||||
const outAddrs =
|
||||
(vout.addresses && vout.addresses.length ? vout.addresses :
|
||||
vout.scriptPubKey && vout.scriptPubKey.addresses ? vout.scriptPubKey.addresses : null);
|
||||
if (outAddrs && outAddrs.length) {
|
||||
const id = outAddrs[0];
|
||||
receivers[id] = (receivers[id] || 0) + Number(vout.value || 0);
|
||||
let result = {
|
||||
time: tx.time,
|
||||
block: tx.blockheight,
|
||||
blockhash: tx.blockhash,
|
||||
txid: tx.txid,
|
||||
floData: tx.floData,
|
||||
confirmations: tx.confirmations
|
||||
}
|
||||
}
|
||||
result.receivers = receivers;
|
||||
|
||||
// ---- Coinbase vs normal ----
|
||||
const isCoinbase = !!(tx.vin && tx.vin[0] && tx.vin[0].coinbase);
|
||||
//format receivers
|
||||
let receivers = {};
|
||||
for (let vout of tx.vout) {
|
||||
if (vout.scriptPubKey.isAddress) {
|
||||
let id = vout.scriptPubKey.addresses[0];
|
||||
if (id in receivers)
|
||||
receivers[id] += vout.value;
|
||||
else receivers[id] = vout.value;
|
||||
}
|
||||
}
|
||||
result.receivers = receivers;
|
||||
//format senders (or mined)
|
||||
if (!tx.vin[0].isAddress) { //mined (ie, coinbase)
|
||||
let coinbase = tx.vin[0].coinbase;
|
||||
result.mine = coinbase;
|
||||
result.mined = { [coinbase]: tx.valueOut }
|
||||
} else {
|
||||
result.sender = tx.vin[0].addresses[0];
|
||||
result.receiver = tx.vout[0].scriptPubKey.addresses[0];
|
||||
result.fees = tx.fees;
|
||||
let senders = {};
|
||||
for (let vin of tx.vin) {
|
||||
if (vin.isAddress) {
|
||||
let id = vin.addresses[0];
|
||||
if (id in senders)
|
||||
senders[id] += vin.value;
|
||||
else senders[id] = vin.value;
|
||||
}
|
||||
}
|
||||
result.senders = senders;
|
||||
|
||||
//remove change amounts
|
||||
for (let id in senders) {
|
||||
if (id in receivers) {
|
||||
if (senders[id] > receivers[id]) {
|
||||
senders[id] -= receivers[id];
|
||||
delete receivers[id];
|
||||
} else if (senders[id] < receivers[id]) { //&& id != address
|
||||
receivers[id] -= senders[id];
|
||||
delete senders[id];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (isCoinbase) {
|
||||
const coinbase = tx.vin[0].coinbase; // string
|
||||
result.mine = coinbase;
|
||||
result.mined = { [coinbase]: Number(tx.valueOut || 0) };
|
||||
return result;
|
||||
}
|
||||
|
||||
// ---- Normal tx: senders, fees, first-party heuristics ----
|
||||
result.fees = tx.fees;
|
||||
|
||||
const firstInAddr = (tx.vin && tx.vin[0] && tx.vin[0].addresses && tx.vin[0].addresses[0]) || undefined;
|
||||
const firstOutAddrs =
|
||||
(tx.vout && tx.vout[0] &&
|
||||
((tx.vout[0].addresses && tx.vout[0].addresses[0]) ||
|
||||
(tx.vout[0].scriptPubKey && tx.vout[0].scriptPubKey.addresses && tx.vout[0].scriptPubKey.addresses[0]))) || undefined;
|
||||
if (firstInAddr) result.sender = firstInAddr;
|
||||
if (firstOutAddrs) result.receiver = firstOutAddrs;
|
||||
|
||||
const senders = {};
|
||||
for (const vin of tx.vin || []) {
|
||||
const inAddrs = vin.addresses;
|
||||
if (inAddrs && inAddrs.length) {
|
||||
const id = inAddrs[0];
|
||||
senders[id] = (senders[id] || 0) + Number(vin.value || 0);
|
||||
}
|
||||
}
|
||||
result.senders = senders;
|
||||
|
||||
// ---- Remove change (net flow) ----
|
||||
for (const id of Object.keys(senders)) {
|
||||
if (receivers[id] != null) {
|
||||
if (senders[id] > receivers[id]) {
|
||||
senders[id] -= receivers[id];
|
||||
delete receivers[id];
|
||||
} else if (senders[id] < receivers[id]) {
|
||||
receivers[id] -= senders[id];
|
||||
delete senders[id];
|
||||
} else {
|
||||
// equal -> cancel both
|
||||
delete senders[id];
|
||||
delete receivers[id];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
floWebWallet.listTransactions = function (address, page_options = {}) {
|
||||
return new Promise((resolve, reject) => {
|
||||
let options = {};
|
||||
@ -158,4 +141,4 @@
|
||||
})
|
||||
}
|
||||
|
||||
})(window.floWebWallet = {});
|
||||
})(window.floWebWallet = {});
|
||||
@ -1,4 +1,4 @@
|
||||
(function (EXPORTS) { //floBlockchainAPI v3.1.4
|
||||
(function (EXPORTS) { //floBlockchainAPI v3.0.1b
|
||||
/* FLO Blockchain Operator to send/receive data from blockchain using API calls via FLO Blockbook*/
|
||||
'use strict';
|
||||
const floBlockchainAPI = EXPORTS;
|
||||
@ -7,36 +7,17 @@
|
||||
blockchain: floGlobals.blockchain,
|
||||
apiURL: {
|
||||
FLO: ['https://blockbook.ranchimall.net/'],
|
||||
FLO_TEST: ['https://blockbook-testnet.ranchimall.net/']
|
||||
FLO_TEST: []
|
||||
},
|
||||
sendAmt: 0.00001,
|
||||
fee: 0.00001,
|
||||
minChangeAmt: 0.00001,
|
||||
sendAmt: 0.0003,
|
||||
fee: 0.0002,
|
||||
minChangeAmt: 0.0002,
|
||||
receiverID: floGlobals.adminID
|
||||
};
|
||||
|
||||
const SATOSHI_IN_BTC = 1e8;
|
||||
const isUndefined = val => typeof val === 'undefined';
|
||||
|
||||
const checkIfTor = floBlockchainAPI.checkIfTor = () => {
|
||||
return fetch('https://check.torproject.org/api/ip')
|
||||
.then(res => res.json())
|
||||
.then(res => {
|
||||
return res.IsTor
|
||||
}).catch(e => {
|
||||
console.error(e)
|
||||
return false
|
||||
})
|
||||
}
|
||||
let isTor = false;
|
||||
checkIfTor().then(result => {
|
||||
isTor = result
|
||||
if (isTor) {
|
||||
DEFAULT.apiURL.FLO.push('http://xge4kejxl6xs4cad3u3a7dnw7idndlkn3vmyo33t3a4ctk566y65eoad.onion/')
|
||||
DEFAULT.apiURL.FLO_TEST.push('http://fdjrsde2qhfecvx6fkgmcidwkp34bdek7jo4y2fpqatrhzxtxkk6f4ad.onion/')
|
||||
}
|
||||
});
|
||||
|
||||
const util = floBlockchainAPI.util = {};
|
||||
|
||||
util.Sat_to_FLO = value => parseFloat((value / SATOSHI_IN_BTC).toFixed(8));
|
||||
@ -1060,4 +1041,4 @@
|
||||
})
|
||||
}
|
||||
|
||||
})('object' === typeof module ? module.exports : window.floBlockchainAPI = {});
|
||||
})('object' === typeof module ? module.exports : window.floBlockchainAPI = {});
|
||||
1
scripts/floBlockchainAPI.min.js
vendored
1
scripts/floBlockchainAPI.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
scripts/floTokenAPI.min.js
vendored
1
scripts/floTokenAPI.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user