diff --git a/exchangemarket/docs/css/main.css b/exchangemarket/docs/css/main.css
index 69bc0d7..641d1f7 100644
--- a/exchangemarket/docs/css/main.css
+++ b/exchangemarket/docs/css/main.css
@@ -27,7 +27,6 @@ body {
scrollbar-gutter: stable;
color: rgba(var(--text-color), 1);
background-color: rgba(var(--background-color), 1);
- transition: background-color 0.3s;
}
body[data-theme=dark] {
@@ -737,7 +736,6 @@ sm-checkbox {
padding: 1rem 0;
border-radius: 0.5rem;
font-weight: 400;
- transition: background-color 0.3s;
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
@@ -871,7 +869,6 @@ sm-checkbox {
top: 0;
background-color: rgba(var(--background-color), 1);
z-index: 2;
- transition: background-color 0.3s;
}
.list__item {
@@ -1577,7 +1574,6 @@ sm-checkbox {
flex: 0;
flex-direction: row;
border-radius: 0.5rem;
- transition: background-color 0.3s;
}
.main_navbar__item .icon {
margin-bottom: 0;
diff --git a/exchangemarket/docs/css/main.min.css b/exchangemarket/docs/css/main.min.css
index abdbeb1..164d090 100644
--- a/exchangemarket/docs/css/main.min.css
+++ b/exchangemarket/docs/css/main.min.css
@@ -1 +1 @@
-*{padding:0;margin:0;box-sizing:border-box;font-family:"Roboto",sans-serif}:root{font-size:clamp(1rem,1.2vmax,1.2rem)}html,body{height:100%;scroll-behavior:smooth}body{--accent-color: #516beb;--text-color: 20, 20, 20;--foreground-color: 252, 253, 255;--background-color: 241, 243, 248;--danger-color: rgb(255, 75, 75);--green: #1cad59;--yellow: #bd7200;scrollbar-width:thin;scrollbar-gutter:stable;color:rgba(var(--text-color), 1);background-color:rgba(var(--background-color), 1);transition:background-color .3s}body[data-theme=dark]{--accent-color: #a4b3ff;--text-color: 220, 220, 220;--foreground-color: 27, 28, 29;--background-color: 21, 22, 22;--danger-color: rgb(255, 106, 106);--green: #00e676;--yellow: #ffeb3b}body[data-theme=dark] sm-popup::part(popup){background-color:rgba(var(--foreground-color), 1)}p,strong{font-size:.9rem;max-width:70ch;line-height:1.7;color:rgba(var(--text-color), 0.8)}p:not(:last-of-type),strong:not(:last-of-type){margin-bottom:1.5rem}a:where([class]){color:inherit;text-decoration:none}a:where([class]):focus-visible{box-shadow:0 0 0 .1rem rgba(var(--text-color), 1) inset}a{text-decoration:none;color:var(--accent-color)}a:focus-visible{box-shadow:0 0 0 .1rem rgba(var(--text-color), 1) inset}fieldset{border:none;padding:0;margin:0}button,.button{-webkit-user-select:none;-moz-user-select:none;user-select:none;position:relative;display:inline-flex;border:none;background-color:rgba(0,0,0,0);overflow:hidden;color:inherit;-webkit-tap-highlight-color:rgba(0,0,0,0);align-items:center;font-size:inherit;font-weight:500;white-space:nowrap;padding:.8rem;border-radius:.3rem;justify-content:center;flex-shrink:0}button:focus-visible,.button:focus-visible{outline:var(--accent-color) solid medium}button:not(:disabled),.button:not(:disabled){cursor:pointer}.button{background-color:rgba(var(--text-color), 0.02);border:solid thin rgba(var(--text-color), 0.06)}.button--primary{color:rgba(var(--background-color), 1);background-color:var(--accent-color)}.button--primary .icon{fill:rgba(var(--background-color), 1)}.button--colored{color:var(--accent-color)}.button--colored .icon{fill:var(--accent-color)}.button--danger{background-color:rgba(255,115,115,.062745098);color:var(--danger-color)}.button--danger .icon{fill:var(--danger-color)}.button--small{padding:.4rem .6rem}.button--outlined{border:solid rgba(var(--text-color), 0.3) .1rem;background-color:rgba(var(--foreground-color), 1)}.button--transparent{background-color:rgba(0,0,0,0)}button:disabled{opacity:.4;cursor:not-allowed;filter:saturate(0)}.cta{text-transform:uppercase;font-size:.8rem;font-weight:700;letter-spacing:.05em;padding:.8rem 1rem}a:-webkit-any-link:focus-visible{outline:rgba(var(--text-color), 1) .1rem solid}a:-moz-any-link:focus-visible{outline:rgba(var(--text-color), 1) .1rem solid}a:any-link:focus-visible{outline:rgba(var(--text-color), 1) .1rem solid}input{accent-color:var(--accent-color)}sm-input{font-size:.9rem;--border-radius: 0.3rem}sm-form{--gap: 1rem}sm-copy{font-size:.9rem}ul{list-style:none}.hidden{display:none !important}.overflow-ellipsis{width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.wrap-around{overflow-wrap:break-word;word-wrap:break-word;-ms-word-break:break-all;word-break:break-word;-webkit-hyphens:auto;hyphens:auto}.sticky{position:-webkit-sticky;position:sticky;top:0;z-index:1}.full-bleed{grid-column:1/4}.uppercase{text-transform:uppercase}.capitalize{text-transform:capitalize}.flex{display:flex}.flex-1{flex:1}.flex-wrap{flex-wrap:wrap}.flex-direction-column{flex-direction:column}.grid{display:grid}.grid-3{grid-template-columns:1fr auto auto}.flow-column{grid-auto-flow:column}.gap-0-3{gap:.3rem}.gap-0-5{gap:.5rem}.gap-1{gap:1rem}.gap-1-5{gap:1.5rem}.gap-2{gap:2rem}.gap-3{gap:3rem}.text-align-right{text-align:right}.align-start{align-items:flex-start}.align-center{align-items:center}.text-center{text-align:center}.justify-start{justify-content:start}.justify-center{justify-content:center}.justify-right{margin-left:auto}.align-self-center{align-self:center}.justify-self-center{justify-self:center}.justify-self-start{justify-self:start}.justify-self-end{justify-self:end}.space-between{justify-content:space-between}.w-100{width:100%}.interact{position:relative;overflow:hidden;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0)}.ripple{height:8rem;width:8rem;position:absolute;border-radius:50%;transform:scale(0);background:radial-gradient(circle, rgba(var(--text-color), 0.3) 0%, rgba(0, 0, 0, 0) 50%);pointer-events:none}.icon{width:1.2rem;height:1.2rem;fill:rgba(var(--text-color), 0.8)}.margin-right-0-5{margin-right:.5rem}.margin-right-auto{margin-right:auto}.margin-left-0-5{margin-left:.5rem}.margin-left-auto{margin-left:auto}.icon-only{padding:.5rem;aspect-ratio:1/1;background-color:rgba(0,0,0,0)}.icon-button{padding:.6rem;border-radius:.8rem;background-color:var(--accent-color--light);height:-webkit-max-content;height:-moz-max-content;height:max-content}.icon-button .icon{fill:var(--accent-color)}.empty-state{display:grid;text-align:center;justify-items:center;width:100%;max-width:none;padding:1.5rem}.empty-state__icon{height:3rem;width:3rem;padding:.6rem;border-radius:1rem;background-color:rgba(var(--text-color), 0.06);margin-bottom:1rem}.observe-empty-state:empty{display:none !important}.observe-empty-state:not(:empty)+.empty-state{display:none !important}#confirmation_popup,#prompt_popup{flex-direction:column}#confirmation_popup h4,#prompt_popup h4{font-size:1.2rem;margin-bottom:1rem}#confirmation_popup .flex,#prompt_popup .flex{margin-top:1rem}#prompt_message{margin-bottom:1.5rem}.popup__header{display:grid;gap:.5rem;width:100%;padding:0 1.5rem;align-items:center;justify-items:flex-start}.popup__header__close{padding:.5rem;margin-left:-0.5rem}#main_page{padding:1.5rem}#main_page>section:nth-of-type(1){align-content:flex-start}details:not(:last-of-type){border-bottom:thin solid rgba(var(--text-color), 0.3)}details summary{display:flex;justify-content:space-between;-webkit-user-select:none;-moz-user-select:none;user-select:none;cursor:pointer;padding:1rem 0}details .icon{flex-shrink:0}details[open]{padding-bottom:1rem}details[open] summary .icon{transform:rotate(180deg)}sm-chips{--gap: 0;background-color:rgba(var(--text-color), 0.06);border-radius:.2rem}sm-chip{position:relative;font-size:.9rem;--border-radius: 0.5rem;--padding: 0.5rem 0.8rem;--background: rgba(var(--text-color), 0.06);-webkit-user-select:none;-moz-user-select:none;user-select:none;font-weight:500}sm-chip[selected]{--background: var(--accent-color);color:rgba(var(--background-color), 1)}sm-chip:first-of-type{--border-radius: 0.3rem 0 0 0.3rem}sm-chip:last-of-type{--border-radius: 0 0.3rem 0.3rem 0}sm-checkbox{--height: 1rem;--width: 1rem;-webkit-tap-highlight-color:rgba(0,0,0,0)}.warning{background-color:khaki;color:rgba(0,0,0,.7);padding:1rem;border-radius:.5rem;line-height:1.5}.tip{border-radius:1.5rem;background-color:rgba(var(--text-color), 0.06);padding:.3rem .8rem;font-size:.85rem}.tip .icon{fill:var(--accent-color);flex-shrink:0}.tooltip{display:flex;position:relative;z-index:8;cursor:pointer}.tooltip .banner{position:absolute;right:0;top:100%;width:min(20rem,100vw - 1rem);display:none;font-size:.9rem;background-color:rgba(var(--foreground-color), 1);padding:1rem;border-radius:.5rem;box-shadow:0 .2rem .5rem rgba(0,0,0,.1);border:solid thin rgba(var(--text-color), 0.2)}.tooltip:hover .banner{display:block}.page-layout{display:grid;grid-template-columns:1.5rem minmax(0, 1fr) 1.5rem}.page-layout>*{grid-column:2/3}.page{height:100%}.mobile-page{align-items:flex-start}#loading .rm-logo{height:3rem;width:3rem;padding:.8rem;background-color:rgba(var(--text-color), 0.06);border-radius:5rem;justify-self:center}#landing{grid-template-rows:auto 1fr}#landing header{padding:1.5rem 0}#landing>.grid{align-content:flex-start;text-align:center;gap:1rem}#sign_up{grid-template-rows:auto 1fr;align-items:center}#sign_up section{margin-top:-6rem;justify-self:center;width:min(24rem,100%)}#sign_up header{padding:1.5rem 0}#sign_up .h2{margin-bottom:.5rem}#sign_up h5{font-weight:500;color:rgba(var(--text-color), 0.8)}#sign_up .warning{margin-top:2rem}.loader-button-wrapper{display:grid;text-align:center}.loader-button-wrapper>*{grid-area:1/1/2/2}.loader-button-wrapper button{z-index:1}.loader-button-wrapper sm-spinner{justify-self:center;align-self:center}#home{height:100%;display:flex;flex-direction:column;align-items:flex-start;align-content:flex-start}#login_section{display:flex;width:100%}#login_form__priv_key{margin-top:1rem}#flo_id_warning{padding-bottom:1.5rem}#flo_id_warning .icon{height:3rem;width:3rem;padding:.8rem;overflow:visible;background-color:#ffc107;border-radius:3rem;fill:rgba(0,0,0,.8)}#main_header{display:flex;flex-wrap:wrap;gap:1rem;padding:1rem 1.5rem;width:100%;align-items:center}.app-brand{display:flex;gap:.3rem;align-items:center}.app-brand .icon{height:1.7rem;width:1.7rem}.app-name__company{font-size:.8rem;font-weight:500;color:rgba(var(--text-color), 0.8)}#user_popup_button{background-color:rgba(var(--text-color), 0.06);border-radius:2rem;font-size:.8rem}#main_navbar{width:100%}.main_navbar__item{display:flex;flex-direction:column;align-items:center;flex:1;padding:.5rem 0}.main_navbar__item .item__title,.main_navbar__item .icon{transition:transform .3s cubic-bezier(0.175, 0.885, 0.32, 1.275),opacity .3s}.main_navbar__item .item__title{color:rgba(var(--text-color), 0.8);font-size:.8rem;font-weight:500}.main_navbar__item .icon{height:1.2rem;margin-bottom:.3rem}.main_navbar__item--active .item__title{color:var(--accent-color)}.main_navbar__item--active .icon{fill:var(--accent-color)}#pages_container{display:flex;flex:1;width:100%;height:100%;justify-content:center;overflow-y:auto}#pages_container>*{padding:0 1.5rem;min-width:min(26rem,100%)}.listed-asset{position:relative;gap:.5rem;padding:1rem 0;border-radius:.5rem;font-weight:400;transition:background-color .3s;-webkit-user-select:none;-moz-user-select:none;user-select:none;color:inherit;grid-template-columns:auto 1fr auto auto;grid-template-areas:"icon name rate right-arrow" "icon name countdown right-arrow"}.listed-asset__icon{grid-area:icon;padding:.5rem;border-radius:1rem;display:flex;background-color:var(--accent-color)}.listed-asset__icon .icon{height:1.2rem;width:1.2rem;fill:rgba(var(--background-color), 1)}.listed-asset__name{grid-area:name;margin-left:.3rem}.listed-asset__rate{grid-area:rate}.listed-asset__countdown{display:flex;align-items:center;grid-area:countdown;justify-self:flex-end;font-size:.8rem;color:var(--accent-color)}.listed-asset__countdown .icon{margin-left:.3rem;overflow:visible;stroke-width:3;fill:none}.listed-asset__countdown .icon .path-a{stroke:var(--accent-color);stroke-dashoffset:var(--path-length, 0);stroke-dasharray:63}.listed-asset__countdown .icon .path-b{stroke:rgba(var(--text-color), 0.2)}.listed-asset__right-arrow{grid-area:right-arrow;background-color:rgba(var(--text-color), 0.1);border-radius:1rem;padding:.1rem;margin-left:.3rem}.quantity-selector .button{flex:1;padding:.5rem .6rem;margin-left:.5rem}#quantity_selector_tip::first-letter{text-transform:uppercase}#quantity_type,#portfolio_quantity_type{font-size:.8rem;padding-right:.5rem;border-right:thin solid rgba(var(--text-color), 0.3);margin-right:auto;color:rgba(var(--text-color), 0.8);line-height:1.5;font-weight:500;min-width:8ch}#exchange_wrapper{display:flex;flex-direction:column;height:100%}#asset_page{position:relative;display:flex;flex-direction:column;height:100%;align-items:flex-start}#asset_page_wrapper{display:flex;flex-direction:column;height:100%;width:100%}#trade_form{height:100%}#trade_form::part(form){display:flex;flex-direction:column;gap:0}#trade_form>*{margin-bottom:1rem}#trade_form>:last-child{margin-top:auto}#my_orders,#market{width:min(46rem,100%);height:-webkit-max-content;height:-moz-max-content;height:max-content}#my_orders{grid-template-rows:auto 1fr}.orders_section__header{min-height:2.8rem;position:-webkit-sticky;position:sticky;top:0;background-color:rgba(var(--background-color), 1);z-index:2;transition:background-color .3s}.list__item{padding:.5rem 0;display:grid}.order-card{position:relative;outline:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;align-items:center;gap:.5rem;grid-template-columns:-webkit-min-content 1fr auto;grid-template-columns:min-content 1fr auto;border-radius:.5rem;grid-template-areas:"checkbox quantity quantity time" "checkbox price amount cancel"}.order-card>.grid:nth-of-type(2){grid-area:price}.order-card>.grid:nth-of-type(3){grid-area:amount}.order-card__type{font-size:.9rem;font-weight:500;margin-bottom:.3rem}.order-card[data-type=buy] .order-card__type{color:var(--green)}.order-card[data-type=sell] .order-card__type{color:var(--danger-color)}.order-card--selected{background-color:rgba(var(--text-color), 0.08)}.order-card--selected .cancel-order{visibility:hidden;pointer-events:none}.order-card sm-checkbox{grid-area:checkbox;cursor:pointer;margin-right:.5rem}.order-card__quantity,.order-card__price{font-size:.9rem;color:rgba(var(--text-color), 0.9)}.order-card__time{grid-area:time;font-size:.8rem;color:rgba(var(--text-color), 0.8)}.order-card .cancel-order{grid-area:cancel;color:var(--danger-color)}.order-card .cancel-order .icon{fill:var(--danger-color)}.cancel-order{align-items:center;padding:.4rem .6rem}.cancel-order span{margin-left:.3rem}.completed-trade,.transaction-card,.live-order{gap:0 1rem}.completed-trade__type,.transaction-card__type,.live-order__type{font-size:.9rem;font-weight:500;margin-bottom:.3rem}.completed-trade[data-type=Bought] .completed-trade__type,.completed-trade--buy .completed-trade__type,.completed-trade[data-type=Bought] .transaction-card__type,.completed-trade--buy .transaction-card__type,.completed-trade[data-type=Bought] .live-order__type,.completed-trade--buy .live-order__type,.transaction-card[data-type=Bought] .completed-trade__type,.transaction-card--buy .completed-trade__type,.transaction-card[data-type=Bought] .transaction-card__type,.transaction-card--buy .transaction-card__type,.transaction-card[data-type=Bought] .live-order__type,.transaction-card--buy .live-order__type,.live-order[data-type=Bought] .completed-trade__type,.live-order--buy .completed-trade__type,.live-order[data-type=Bought] .transaction-card__type,.live-order--buy .transaction-card__type,.live-order[data-type=Bought] .live-order__type,.live-order--buy .live-order__type{color:var(--green)}.completed-trade[data-type=Sold] .completed-trade__type,.completed-trade--sell .completed-trade__type,.completed-trade[data-type=Sold] .transaction-card__type,.completed-trade--sell .transaction-card__type,.completed-trade[data-type=Sold] .live-order__type,.completed-trade--sell .live-order__type,.transaction-card[data-type=Sold] .completed-trade__type,.transaction-card--sell .completed-trade__type,.transaction-card[data-type=Sold] .transaction-card__type,.transaction-card--sell .transaction-card__type,.transaction-card[data-type=Sold] .live-order__type,.transaction-card--sell .live-order__type,.live-order[data-type=Sold] .completed-trade__type,.live-order--sell .completed-trade__type,.live-order[data-type=Sold] .transaction-card__type,.live-order--sell .transaction-card__type,.live-order[data-type=Sold] .live-order__type,.live-order--sell .live-order__type{color:var(--danger-color)}.completed-trade__total,.transaction-card__total,.live-order__total{font-weight:700;font-size:.9rem;color:rgba(var(--text-color), 0.8)}.completed-trade__quantity,.completed-trade__price,.transaction-card__quantity,.transaction-card__price,.live-order__quantity,.live-order__price{font-size:.9rem;color:rgba(var(--text-color), 0.9)}.completed-trade__time,.transaction-card__time,.live-order__time{font-size:.8rem;color:rgba(var(--text-color), 0.8)}.completed-trade .more-info,.transaction-card .more-info,.live-order .more-info{flex-shrink:0;padding:.3rem}.transaction-card{content-visibility:auto;contain-intrinsic-size:2.5rem;grid-template-columns:repeat(3, 1fr) 2rem}.completed-trade{display:grid;gap:.5rem;grid-template-columns:1fr 1fr;background-color:rgba(var(--text-color), 0.03);border-radius:.5rem;padding:1rem;margin-bottom:.5rem}#market_asset_rates{display:grid;gap:.5rem}#market_asset_rates .listed-asset{padding:1rem;background-color:rgba(var(--text-color), 0.03)}#market_orders_wrapper .list__header{font-size:.8rem;font-weight:500}#market_orders_wrapper .list__header div{padding:.5rem 0}#market_orders_wrapper .list__header{margin-bottom:.5rem;grid-template-columns:repeat(3, 1fr) 2rem}.live-order{display:grid;gap:1rem;padding:1rem;border-radius:.5rem;background-color:rgba(var(--text-color), 0.03)}.live-order:not(:last-of-type){margin-bottom:.5rem}.live-order[data-type=buy]{background-color:rgba(0,250,154,.062745098)}.live-order[data-type=sell]{background-color:rgba(226,19,81,.062745098)}#portfolio{display:grid;gap:1.5rem;grid-template-columns:minmax(0, 1fr);align-content:flex-start;width:min(32rem,100%)}.label{font-size:.8rem;color:rgba(var(--text-color), 0.8);margin-bottom:.2rem}#my_assets{gap:.5rem;margin-top:.5rem;padding-bottom:1.5rem;border:none}.balance-card{display:grid;align-items:center;gap:0 .5rem;padding:1rem;padding-left:.6rem;border-radius:.3rem;color:inherit;background-color:rgba(var(--text-color), 0.03)}.balance-card.is-locked{grid-template-columns:auto 1fr auto}.balance-card.is-locked .balance-card__icon{grid-row:span 2}.balance-card.is-locked .balance-card__right-arrow{grid-area:1/3/3/4}.balance-card.is-locked .balance-card__amount-wrapper{grid-area:2/2/3/3}.balance-card:not(.is-locked){grid-template-columns:auto 1fr auto auto}.balance-card:not(.is-locked) .balance-card__right-arrow{grid-area:1/4/2/5}.balance-card__icon{display:flex;align-content:center;justify-content:center;margin:0 .5rem;border-radius:.8rem;align-self:flex-start;background-color:var(--accent-color--light)}.balance-card__icon .icon{height:1.3rem;width:1.3rem;fill:var(--accent-color)}.balance-card__token{font-size:.9rem;font-weight:500}.balance-card__amount-wrapper{margin-top:.5rem;grid-column:3/-1;gap:.3rem 1rem;grid-template-columns:1fr 1fr}.balance-card__amount-wrapper>:nth-child(even){text-align:right}.balance-card__right-arrow{background-color:rgba(var(--text-color), 0.1);border-radius:1rem;padding:.1rem;fill:var(--accent-color)}#history{padding-top:0 !important;width:min(36rem,100%)}#history .sticky{margin-left:-0.7rem;padding:1rem 0;background-color:rgba(var(--background-color), 1)}#exchange_history{margin-top:.5rem}.history-entry{display:grid;grid-template-columns:auto 1fr auto;gap:.5rem 1rem;align-items:center;margin-bottom:2rem}.history-entry[data-status=SUCCESS] .history-entry__status .icon{fill:var(--green)}.history-entry[data-status=PENDING] .history-entry__status .icon,.history-entry[data-status=WAITING_CONFIRMATION] .history-entry__status .icon{fill:var(--yellow)}.history-entry__status{display:flex;align-items:center;justify-content:center;grid-row:1/3;width:2.5rem;height:2.5rem;background-color:rgba(var(--text-color), 0.03);border-radius:2rem}.history-entry__token-action{font-weight:500}.history-entry__amount{font-weight:500;text-align:right}.history-entry[data-type=deposit] .history-entry__amount:not(:empty){color:var(--green)}.history-entry[data-type=deposit] .history-entry__amount:not(:empty)::before{content:"+ "}.history-entry[data-type=withdraw] .history-entry__amount:not(:empty)::before{content:"- "}.history-entry__time{font-size:.8rem;color:rgba(var(--text-color), 0.8)}.history-entry__txid{font-weight:500;font-size:.9rem;text-align:right}#portfolio_asset_page .sticky{margin-top:-1.5rem;margin-left:-0.7rem;padding:1rem 0;background-color:rgba(var(--background-color), 1)}#portfolio_asset__history{margin-top:1rem}#portfolio_cards_wrapper{display:grid;gap:.5rem;grid-template-columns:repeat(auto-fit, minmax(12rem, 1fr))}.personal-asset-balance{align-content:flex-start;padding:1rem;border-radius:.5rem;color:rgba(0,0,0,.8);width:100%}.personal-asset-balance:not(:last-of-type){margin-right:.5rem}.personal-asset-balance:nth-of-type(1){background:url("bg-art2.svg") no-repeat bottom right,#c2ffd7;background-size:contain}.personal-asset-balance:nth-of-type(1) .icon{background-color:rgba(102,255,156,.5)}.personal-asset-balance:nth-of-type(1) .button{border:solid thin rgba(102,255,156,.5)}.personal-asset-balance:nth-of-type(2){background:url("back.svg") no-repeat top right,#fcffa8;background-size:contain}.personal-asset-balance:nth-of-type(2) .icon{background-color:rgba(255,234,0,.5)}.personal-asset-balance>.flex{margin-bottom:.3rem}.personal-asset-balance>.flex .icon{height:2rem;width:2rem;padding:.4rem;border-radius:.3rem;fill:rgba(0,0,0,.8);margin-right:.5rem}.personal-asset-balance .button{display:flex;align-items:center;margin-top:.5rem;padding-right:.8rem;justify-self:flex-start;border-radius:1rem;background-color:rgba(var(--foreground-color), 1);color:rgba(var(--text-color), 1);transition:box-shadow .3s}.personal-asset-balance .button .icon{height:1rem;background-color:rgba(0,0,0,0);margin-right:.3rem}.personal-asset-balance .button:hover{box-shadow:0 .3rem .5rem rgba(0,0,0,.16)}#personal_rupee_balance span:first-of-type,#personal_flo_balance span:first-of-type{font-size:1.5rem}#personal_rupee_balance span:last-of-type,#personal_flo_balance span:last-of-type{font-size:.9rem}#portfolio_result{justify-content:center;text-align:center}#portfolio_result__icon{display:flex;padding:1rem;border-radius:50%;background-color:rgba(var(--text-color), 0.06);justify-self:center;-webkit-animation:pop-up .3s forwards cubic-bezier(0.175, 0.885, 0.32, 1.275);animation:pop-up .3s forwards cubic-bezier(0.175, 0.885, 0.32, 1.275)}#portfolio_result__icon .icon{height:2rem;width:2rem}.icon--success{fill:var(--green)}.icon--failure,.icon--error{fill:var(--danger-color)}@-webkit-keyframes pop-up{from{transform:translateY(3rem) scale(0.5);opacity:0}to{transform:translateY(0) scale(1);opacity:1}}@keyframes pop-up{from{transform:translateY(3rem) scale(0.5);opacity:0}to{transform:translateY(0) scale(1);opacity:1}}#portfolio_result__cta{padding:1.5rem 1rem;border-radius:.5rem;background-color:rgba(var(--text-color), 0.06)}.stateful-result{overflow:hidden;position:absolute;display:flex;justify-content:center;align-items:center;height:100%;width:100%;left:0}.stateful-result>*{position:absolute}.stateful-result--success .result__background{background-color:var(--green)}.stateful-result--failure .result__background{background-color:var(--danger-color)}.stateful-result .icon-wrapper{-webkit-animation:pop .4s forwards cubic-bezier(0.175, 0.885, 0.32, 1.275);animation:pop .4s forwards cubic-bezier(0.175, 0.885, 0.32, 1.275)}.stateful-result .icon{height:1.5rem;width:1.5rem;fill:rgba(var(--background-color), 1)}.stateful-result span{font-weight:500;color:rgba(var(--background-color), 1)}.stateful-result .result__background{-webkit-animation:ripple-reveal 1s forwards cubic-bezier(0.175, 0.885, 0.32, 1.275);animation:ripple-reveal 1s forwards cubic-bezier(0.175, 0.885, 0.32, 1.275)}.result__background{border-radius:.3rem;height:100%;width:100%;-webkit-clip-path:circle(10%);clip-path:circle(10%)}@-webkit-keyframes pop{from{opacity:0;transform:translateY(2rem)}to{opacity:1;transform:translateY(0)}}@keyframes pop{from{opacity:0;transform:translateY(2rem)}to{opacity:1;transform:translateY(0)}}@-webkit-keyframes ripple-reveal{to{-webkit-clip-path:circle(100%);clip-path:circle(100%)}}@keyframes ripple-reveal{to{-webkit-clip-path:circle(100%);clip-path:circle(100%)}}#help{width:min(60ch,100%);margin-bottom:3rem;align-content:flex-start}#help ul{list-style:initial;display:grid;gap:1rem}#help ul li{margin-left:1rem;padding-left:.5rem;font-size:.9rem}@media screen and (max-width: 40rem)and (any-hover: none){.cancel-order span{display:none !important}}@media screen and (max-width: 40rem){.empty-state{align-self:center}#user_popup_button{width:100%}.main_navbar__item--active .item__title{transform:translateY(100%);opacity:0}.main_navbar__item--active .icon{transform:translateY(50%) scale(1.2)}#asset_list_wrapper{padding:0 1.5rem}.listed-asset{border-radius:0;border-bottom:solid thin rgba(var(--text-color), 0.1)}#exchange{margin:0;padding:0}#login_section{padding:0 1.5rem}#login_form{margin-top:3rem}#asset_page__header{display:flex;padding:1rem 1.5rem .5rem .8rem}#chart_header{padding:0 1.5rem .5rem 1.5rem}#trade_form{padding:0 1.5rem}#price_chart_container{flex:1}#asset_page__footer button{display:flex;flex-direction:column;align-items:center;flex:1;padding:.5rem 0;color:rgba(var(--text-color), 0.8);font-size:.8rem;font-weight:500}#asset_page__footer button .icon{height:1.2rem;margin-bottom:.3rem;margin-right:.3rem}#asset_page__footer button.active{color:var(--accent-color)}#asset_page__footer button.active .icon{fill:var(--accent-color)}.hide-on-mobile{display:none !important}}@media screen and (min-width: 40rem){sm-popup{--width: 24rem}.popup__header{grid-column:1/-1;padding:1rem 1.5rem 0 1.5rem}#confirmation_popup{--width: 24rem}.page-layout{grid-template-columns:1fr 90vw 1fr}.mobile-page{align-self:flex-start;padding:2rem;border-radius:.5rem;background-color:rgba(var(--foreground-color), 1)}.hide-on-desktop{display:none !important}#home{display:grid;grid-template-columns:auto 1fr;grid-template-rows:auto 1fr;grid-template-areas:"header header" "nav pages"}#main_header{grid-area:header}#user_popup_button{justify-self:flex-end}#main_navbar{grid-area:nav;flex-direction:column;height:100%;padding-left:.5rem}.main_navbar__item{padding:1.5rem 2rem 1.5rem 1rem;width:100%;flex:0;flex-direction:row;border-radius:.5rem;transition:background-color .3s}.main_navbar__item .icon{margin-bottom:0;margin-right:.5rem}.main_navbar__item .item__title{font-size:.9rem}.main_navbar__item--active{background-color:rgba(var(--text-color), 0.06)}#pages_container{grid-area:pages}#pages_container>*{margin:0 1.5rem;padding:2rem}#login_section{width:24rem}.is-signed-in #exchange{display:flex;width:100%}.is-signed-in #exchange_wrapper{display:grid;width:100%;height:100%;gap:1.5rem;grid-template-columns:17rem minmax(0, 1fr);align-items:flex-start}#price_history_chart{height:20rem}#asset_list_wrapper{grid-row:1/3}.listed-asset{padding:1rem}.listed-asset--active{opacity:1;background-color:rgba(var(--text-color), 0.06)}.listed-asset--active::before{content:"";position:absolute;width:.25rem;border-radius:0 .2rem .2rem 0;height:2rem;background-color:var(--accent-color)}.order-card{grid-template-columns:auto 1fr 1fr 1fr auto;grid-template-areas:"checkbox quantity price amount time cancel"}.orders_section__header{background-color:rgba(var(--foreground-color), 1)}#history .sticky,#portfolio_asset_page .sticky{background-color:rgba(var(--foreground-color), 1)}}@media screen and (max-width: 80rem)and (min-width: 40rem){.main_navbar__item{padding:1.5rem 1rem}.main_navbar__item .icon{margin-right:0}.main_navbar__item .item__title{display:none !important}}@media screen and (min-width: 52rem){body:not(.is-signed-in) #market{gap:2rem;width:100%;grid-template-columns:18rem 1fr}.completed-trade{grid-template-columns:1fr 1fr 1fr 8rem;grid-template-areas:"quantity price amount info"}.completed-trade .quantity-block{grid-area:quantity}.completed-trade .price-block{grid-area:price}.completed-trade .amount-block{grid-area:amount}.completed-trade .info-block{grid-area:info}}@media screen and (min-width: 64rem){#home{grid-template-columns:auto 1fr}#asset_page_wrapper{display:grid;gap:1.5rem;grid-template-columns:minmax(0, 1fr) 20rem}}@media screen and (min-width: 72rem){.page-layout{grid-template-columns:1fr 80vw 1fr}}@media screen and (min-width: 120rem){.page-layout{grid-template-columns:1fr 70vw 1fr}}@media(any-hover: hover){::-webkit-scrollbar{width:.5rem;height:.5rem}::-webkit-scrollbar-thumb{background:rgba(var(--text-color), 0.3);border-radius:1rem}::-webkit-scrollbar-thumb:hover{background:rgba(var(--text-color), 0.5)}.order-card .cancel-order{justify-self:flex-end;overflow:hidden}.order-card .cancel-order .icon,.order-card .cancel-order span{transition:opacity .3s,transform .3s}.order-card .cancel-order .icon{transform:translateX(100%)}.order-card .cancel-order span{transform:translateX(100%);opacity:0}.order-card:hover .cancel-order .icon,.order-card:focus-within .cancel-order .icon{opacity:1}.order-card .cancel-order:hover .icon,.order-card .cancel-order:hover span{opacity:1;transform:translateX(0)}}
\ No newline at end of file
+*{padding:0;margin:0;box-sizing:border-box;font-family:"Roboto",sans-serif}:root{font-size:clamp(1rem,1.2vmax,1.2rem)}html,body{height:100%;scroll-behavior:smooth}body{--accent-color: #516beb;--text-color: 20, 20, 20;--foreground-color: 252, 253, 255;--background-color: 241, 243, 248;--danger-color: rgb(255, 75, 75);--green: #1cad59;--yellow: #bd7200;scrollbar-width:thin;scrollbar-gutter:stable;color:rgba(var(--text-color), 1);background-color:rgba(var(--background-color), 1)}body[data-theme=dark]{--accent-color: #a4b3ff;--text-color: 220, 220, 220;--foreground-color: 27, 28, 29;--background-color: 21, 22, 22;--danger-color: rgb(255, 106, 106);--green: #00e676;--yellow: #ffeb3b}body[data-theme=dark] sm-popup::part(popup){background-color:rgba(var(--foreground-color), 1)}p,strong{font-size:.9rem;max-width:70ch;line-height:1.7;color:rgba(var(--text-color), 0.8)}p:not(:last-of-type),strong:not(:last-of-type){margin-bottom:1.5rem}a:where([class]){color:inherit;text-decoration:none}a:where([class]):focus-visible{box-shadow:0 0 0 .1rem rgba(var(--text-color), 1) inset}a{text-decoration:none;color:var(--accent-color)}a:focus-visible{box-shadow:0 0 0 .1rem rgba(var(--text-color), 1) inset}fieldset{border:none;padding:0;margin:0}button,.button{-webkit-user-select:none;-moz-user-select:none;user-select:none;position:relative;display:inline-flex;border:none;background-color:rgba(0,0,0,0);overflow:hidden;color:inherit;-webkit-tap-highlight-color:rgba(0,0,0,0);align-items:center;font-size:inherit;font-weight:500;white-space:nowrap;padding:.8rem;border-radius:.3rem;justify-content:center;flex-shrink:0}button:focus-visible,.button:focus-visible{outline:var(--accent-color) solid medium}button:not(:disabled),.button:not(:disabled){cursor:pointer}.button{background-color:rgba(var(--text-color), 0.02);border:solid thin rgba(var(--text-color), 0.06)}.button--primary{color:rgba(var(--background-color), 1);background-color:var(--accent-color)}.button--primary .icon{fill:rgba(var(--background-color), 1)}.button--colored{color:var(--accent-color)}.button--colored .icon{fill:var(--accent-color)}.button--danger{background-color:rgba(255,115,115,.062745098);color:var(--danger-color)}.button--danger .icon{fill:var(--danger-color)}.button--small{padding:.4rem .6rem}.button--outlined{border:solid rgba(var(--text-color), 0.3) .1rem;background-color:rgba(var(--foreground-color), 1)}.button--transparent{background-color:rgba(0,0,0,0)}button:disabled{opacity:.4;cursor:not-allowed;filter:saturate(0)}.cta{text-transform:uppercase;font-size:.8rem;font-weight:700;letter-spacing:.05em;padding:.8rem 1rem}a:-webkit-any-link:focus-visible{outline:rgba(var(--text-color), 1) .1rem solid}a:-moz-any-link:focus-visible{outline:rgba(var(--text-color), 1) .1rem solid}a:any-link:focus-visible{outline:rgba(var(--text-color), 1) .1rem solid}input{accent-color:var(--accent-color)}sm-input{font-size:.9rem;--border-radius: 0.3rem}sm-form{--gap: 1rem}sm-copy{font-size:.9rem}ul{list-style:none}.hidden{display:none !important}.overflow-ellipsis{width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.wrap-around{overflow-wrap:break-word;word-wrap:break-word;-ms-word-break:break-all;word-break:break-word;-webkit-hyphens:auto;hyphens:auto}.sticky{position:-webkit-sticky;position:sticky;top:0;z-index:1}.full-bleed{grid-column:1/4}.uppercase{text-transform:uppercase}.capitalize{text-transform:capitalize}.flex{display:flex}.flex-1{flex:1}.flex-wrap{flex-wrap:wrap}.flex-direction-column{flex-direction:column}.grid{display:grid}.grid-3{grid-template-columns:1fr auto auto}.flow-column{grid-auto-flow:column}.gap-0-3{gap:.3rem}.gap-0-5{gap:.5rem}.gap-1{gap:1rem}.gap-1-5{gap:1.5rem}.gap-2{gap:2rem}.gap-3{gap:3rem}.text-align-right{text-align:right}.align-start{align-items:flex-start}.align-center{align-items:center}.text-center{text-align:center}.justify-start{justify-content:start}.justify-center{justify-content:center}.justify-right{margin-left:auto}.align-self-center{align-self:center}.justify-self-center{justify-self:center}.justify-self-start{justify-self:start}.justify-self-end{justify-self:end}.space-between{justify-content:space-between}.w-100{width:100%}.interact{position:relative;overflow:hidden;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0)}.ripple{height:8rem;width:8rem;position:absolute;border-radius:50%;transform:scale(0);background:radial-gradient(circle, rgba(var(--text-color), 0.3) 0%, rgba(0, 0, 0, 0) 50%);pointer-events:none}.icon{width:1.2rem;height:1.2rem;fill:rgba(var(--text-color), 0.8)}.margin-right-0-5{margin-right:.5rem}.margin-right-auto{margin-right:auto}.margin-left-0-5{margin-left:.5rem}.margin-left-auto{margin-left:auto}.icon-only{padding:.5rem;aspect-ratio:1/1;background-color:rgba(0,0,0,0)}.icon-button{padding:.6rem;border-radius:.8rem;background-color:var(--accent-color--light);height:-webkit-max-content;height:-moz-max-content;height:max-content}.icon-button .icon{fill:var(--accent-color)}.empty-state{display:grid;text-align:center;justify-items:center;width:100%;max-width:none;padding:1.5rem}.empty-state__icon{height:3rem;width:3rem;padding:.6rem;border-radius:1rem;background-color:rgba(var(--text-color), 0.06);margin-bottom:1rem}.observe-empty-state:empty{display:none !important}.observe-empty-state:not(:empty)+.empty-state{display:none !important}#confirmation_popup,#prompt_popup{flex-direction:column}#confirmation_popup h4,#prompt_popup h4{font-size:1.2rem;margin-bottom:1rem}#confirmation_popup .flex,#prompt_popup .flex{margin-top:1rem}#prompt_message{margin-bottom:1.5rem}.popup__header{display:grid;gap:.5rem;width:100%;padding:0 1.5rem;align-items:center;justify-items:flex-start}.popup__header__close{padding:.5rem;margin-left:-0.5rem}#main_page{padding:1.5rem}#main_page>section:nth-of-type(1){align-content:flex-start}details:not(:last-of-type){border-bottom:thin solid rgba(var(--text-color), 0.3)}details summary{display:flex;justify-content:space-between;-webkit-user-select:none;-moz-user-select:none;user-select:none;cursor:pointer;padding:1rem 0}details .icon{flex-shrink:0}details[open]{padding-bottom:1rem}details[open] summary .icon{transform:rotate(180deg)}sm-chips{--gap: 0;background-color:rgba(var(--text-color), 0.06);border-radius:.2rem}sm-chip{position:relative;font-size:.9rem;--border-radius: 0.5rem;--padding: 0.5rem 0.8rem;--background: rgba(var(--text-color), 0.06);-webkit-user-select:none;-moz-user-select:none;user-select:none;font-weight:500}sm-chip[selected]{--background: var(--accent-color);color:rgba(var(--background-color), 1)}sm-chip:first-of-type{--border-radius: 0.3rem 0 0 0.3rem}sm-chip:last-of-type{--border-radius: 0 0.3rem 0.3rem 0}sm-checkbox{--height: 1rem;--width: 1rem;-webkit-tap-highlight-color:rgba(0,0,0,0)}.warning{background-color:khaki;color:rgba(0,0,0,.7);padding:1rem;border-radius:.5rem;line-height:1.5}.tip{border-radius:1.5rem;background-color:rgba(var(--text-color), 0.06);padding:.3rem .8rem;font-size:.85rem}.tip .icon{fill:var(--accent-color);flex-shrink:0}.tooltip{display:flex;position:relative;z-index:8;cursor:pointer}.tooltip .banner{position:absolute;right:0;top:100%;width:min(20rem,100vw - 1rem);display:none;font-size:.9rem;background-color:rgba(var(--foreground-color), 1);padding:1rem;border-radius:.5rem;box-shadow:0 .2rem .5rem rgba(0,0,0,.1);border:solid thin rgba(var(--text-color), 0.2)}.tooltip:hover .banner{display:block}.page-layout{display:grid;grid-template-columns:1.5rem minmax(0, 1fr) 1.5rem}.page-layout>*{grid-column:2/3}.page{height:100%}.mobile-page{align-items:flex-start}#loading .rm-logo{height:3rem;width:3rem;padding:.8rem;background-color:rgba(var(--text-color), 0.06);border-radius:5rem;justify-self:center}#landing{grid-template-rows:auto 1fr}#landing header{padding:1.5rem 0}#landing>.grid{align-content:flex-start;text-align:center;gap:1rem}#sign_up{grid-template-rows:auto 1fr;align-items:center}#sign_up section{margin-top:-6rem;justify-self:center;width:min(24rem,100%)}#sign_up header{padding:1.5rem 0}#sign_up .h2{margin-bottom:.5rem}#sign_up h5{font-weight:500;color:rgba(var(--text-color), 0.8)}#sign_up .warning{margin-top:2rem}.loader-button-wrapper{display:grid;text-align:center}.loader-button-wrapper>*{grid-area:1/1/2/2}.loader-button-wrapper button{z-index:1}.loader-button-wrapper sm-spinner{justify-self:center;align-self:center}#home{height:100%;display:flex;flex-direction:column;align-items:flex-start;align-content:flex-start}#login_section{display:flex;width:100%}#login_form__priv_key{margin-top:1rem}#flo_id_warning{padding-bottom:1.5rem}#flo_id_warning .icon{height:3rem;width:3rem;padding:.8rem;overflow:visible;background-color:#ffc107;border-radius:3rem;fill:rgba(0,0,0,.8)}#main_header{display:flex;flex-wrap:wrap;gap:1rem;padding:1rem 1.5rem;width:100%;align-items:center}.app-brand{display:flex;gap:.3rem;align-items:center}.app-brand .icon{height:1.7rem;width:1.7rem}.app-name__company{font-size:.8rem;font-weight:500;color:rgba(var(--text-color), 0.8)}#user_popup_button{background-color:rgba(var(--text-color), 0.06);border-radius:2rem;font-size:.8rem}#main_navbar{width:100%}.main_navbar__item{display:flex;flex-direction:column;align-items:center;flex:1;padding:.5rem 0}.main_navbar__item .item__title,.main_navbar__item .icon{transition:transform .3s cubic-bezier(0.175, 0.885, 0.32, 1.275),opacity .3s}.main_navbar__item .item__title{color:rgba(var(--text-color), 0.8);font-size:.8rem;font-weight:500}.main_navbar__item .icon{height:1.2rem;margin-bottom:.3rem}.main_navbar__item--active .item__title{color:var(--accent-color)}.main_navbar__item--active .icon{fill:var(--accent-color)}#pages_container{display:flex;flex:1;width:100%;height:100%;justify-content:center;overflow-y:auto}#pages_container>*{padding:0 1.5rem;min-width:min(26rem,100%)}.listed-asset{position:relative;gap:.5rem;padding:1rem 0;border-radius:.5rem;font-weight:400;-webkit-user-select:none;-moz-user-select:none;user-select:none;color:inherit;grid-template-columns:auto 1fr auto auto;grid-template-areas:"icon name rate right-arrow" "icon name countdown right-arrow"}.listed-asset__icon{grid-area:icon;padding:.5rem;border-radius:1rem;display:flex;background-color:var(--accent-color)}.listed-asset__icon .icon{height:1.2rem;width:1.2rem;fill:rgba(var(--background-color), 1)}.listed-asset__name{grid-area:name;margin-left:.3rem}.listed-asset__rate{grid-area:rate}.listed-asset__countdown{display:flex;align-items:center;grid-area:countdown;justify-self:flex-end;font-size:.8rem;color:var(--accent-color)}.listed-asset__countdown .icon{margin-left:.3rem;overflow:visible;stroke-width:3;fill:none}.listed-asset__countdown .icon .path-a{stroke:var(--accent-color);stroke-dashoffset:var(--path-length, 0);stroke-dasharray:63}.listed-asset__countdown .icon .path-b{stroke:rgba(var(--text-color), 0.2)}.listed-asset__right-arrow{grid-area:right-arrow;background-color:rgba(var(--text-color), 0.1);border-radius:1rem;padding:.1rem;margin-left:.3rem}.quantity-selector .button{flex:1;padding:.5rem .6rem;margin-left:.5rem}#quantity_selector_tip::first-letter{text-transform:uppercase}#quantity_type,#portfolio_quantity_type{font-size:.8rem;padding-right:.5rem;border-right:thin solid rgba(var(--text-color), 0.3);margin-right:auto;color:rgba(var(--text-color), 0.8);line-height:1.5;font-weight:500;min-width:8ch}#exchange_wrapper{display:flex;flex-direction:column;height:100%}#asset_page{position:relative;display:flex;flex-direction:column;height:100%;align-items:flex-start}#asset_page_wrapper{display:flex;flex-direction:column;height:100%;width:100%}#trade_form{height:100%}#trade_form::part(form){display:flex;flex-direction:column;gap:0}#trade_form>*{margin-bottom:1rem}#trade_form>:last-child{margin-top:auto}#my_orders,#market{width:min(46rem,100%);height:-webkit-max-content;height:-moz-max-content;height:max-content}#my_orders{grid-template-rows:auto 1fr}.orders_section__header{min-height:2.8rem;position:-webkit-sticky;position:sticky;top:0;background-color:rgba(var(--background-color), 1);z-index:2}.list__item{padding:.5rem 0;display:grid}.order-card{position:relative;outline:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;align-items:center;gap:.5rem;grid-template-columns:-webkit-min-content 1fr auto;grid-template-columns:min-content 1fr auto;border-radius:.5rem;grid-template-areas:"checkbox quantity quantity time" "checkbox price amount cancel"}.order-card>.grid:nth-of-type(2){grid-area:price}.order-card>.grid:nth-of-type(3){grid-area:amount}.order-card__type{font-size:.9rem;font-weight:500;margin-bottom:.3rem}.order-card[data-type=buy] .order-card__type{color:var(--green)}.order-card[data-type=sell] .order-card__type{color:var(--danger-color)}.order-card--selected{background-color:rgba(var(--text-color), 0.08)}.order-card--selected .cancel-order{visibility:hidden;pointer-events:none}.order-card sm-checkbox{grid-area:checkbox;cursor:pointer;margin-right:.5rem}.order-card__quantity,.order-card__price{font-size:.9rem;color:rgba(var(--text-color), 0.9)}.order-card__time{grid-area:time;font-size:.8rem;color:rgba(var(--text-color), 0.8)}.order-card .cancel-order{grid-area:cancel;color:var(--danger-color)}.order-card .cancel-order .icon{fill:var(--danger-color)}.cancel-order{align-items:center;padding:.4rem .6rem}.cancel-order span{margin-left:.3rem}.completed-trade,.transaction-card,.live-order{gap:0 1rem}.completed-trade__type,.transaction-card__type,.live-order__type{font-size:.9rem;font-weight:500;margin-bottom:.3rem}.completed-trade[data-type=Bought] .completed-trade__type,.completed-trade--buy .completed-trade__type,.completed-trade[data-type=Bought] .transaction-card__type,.completed-trade--buy .transaction-card__type,.completed-trade[data-type=Bought] .live-order__type,.completed-trade--buy .live-order__type,.transaction-card[data-type=Bought] .completed-trade__type,.transaction-card--buy .completed-trade__type,.transaction-card[data-type=Bought] .transaction-card__type,.transaction-card--buy .transaction-card__type,.transaction-card[data-type=Bought] .live-order__type,.transaction-card--buy .live-order__type,.live-order[data-type=Bought] .completed-trade__type,.live-order--buy .completed-trade__type,.live-order[data-type=Bought] .transaction-card__type,.live-order--buy .transaction-card__type,.live-order[data-type=Bought] .live-order__type,.live-order--buy .live-order__type{color:var(--green)}.completed-trade[data-type=Sold] .completed-trade__type,.completed-trade--sell .completed-trade__type,.completed-trade[data-type=Sold] .transaction-card__type,.completed-trade--sell .transaction-card__type,.completed-trade[data-type=Sold] .live-order__type,.completed-trade--sell .live-order__type,.transaction-card[data-type=Sold] .completed-trade__type,.transaction-card--sell .completed-trade__type,.transaction-card[data-type=Sold] .transaction-card__type,.transaction-card--sell .transaction-card__type,.transaction-card[data-type=Sold] .live-order__type,.transaction-card--sell .live-order__type,.live-order[data-type=Sold] .completed-trade__type,.live-order--sell .completed-trade__type,.live-order[data-type=Sold] .transaction-card__type,.live-order--sell .transaction-card__type,.live-order[data-type=Sold] .live-order__type,.live-order--sell .live-order__type{color:var(--danger-color)}.completed-trade__total,.transaction-card__total,.live-order__total{font-weight:700;font-size:.9rem;color:rgba(var(--text-color), 0.8)}.completed-trade__quantity,.completed-trade__price,.transaction-card__quantity,.transaction-card__price,.live-order__quantity,.live-order__price{font-size:.9rem;color:rgba(var(--text-color), 0.9)}.completed-trade__time,.transaction-card__time,.live-order__time{font-size:.8rem;color:rgba(var(--text-color), 0.8)}.completed-trade .more-info,.transaction-card .more-info,.live-order .more-info{flex-shrink:0;padding:.3rem}.transaction-card{content-visibility:auto;contain-intrinsic-size:2.5rem;grid-template-columns:repeat(3, 1fr) 2rem}.completed-trade{display:grid;gap:.5rem;grid-template-columns:1fr 1fr;background-color:rgba(var(--text-color), 0.03);border-radius:.5rem;padding:1rem;margin-bottom:.5rem}#market_asset_rates{display:grid;gap:.5rem}#market_asset_rates .listed-asset{padding:1rem;background-color:rgba(var(--text-color), 0.03)}#market_orders_wrapper .list__header{font-size:.8rem;font-weight:500}#market_orders_wrapper .list__header div{padding:.5rem 0}#market_orders_wrapper .list__header{margin-bottom:.5rem;grid-template-columns:repeat(3, 1fr) 2rem}.live-order{display:grid;gap:1rem;padding:1rem;border-radius:.5rem;background-color:rgba(var(--text-color), 0.03)}.live-order:not(:last-of-type){margin-bottom:.5rem}.live-order[data-type=buy]{background-color:rgba(0,250,154,.062745098)}.live-order[data-type=sell]{background-color:rgba(226,19,81,.062745098)}#portfolio{display:grid;gap:1.5rem;grid-template-columns:minmax(0, 1fr);align-content:flex-start;width:min(32rem,100%)}.label{font-size:.8rem;color:rgba(var(--text-color), 0.8);margin-bottom:.2rem}#my_assets{gap:.5rem;margin-top:.5rem;padding-bottom:1.5rem;border:none}.balance-card{display:grid;align-items:center;gap:0 .5rem;padding:1rem;padding-left:.6rem;border-radius:.3rem;color:inherit;background-color:rgba(var(--text-color), 0.03)}.balance-card.is-locked{grid-template-columns:auto 1fr auto}.balance-card.is-locked .balance-card__icon{grid-row:span 2}.balance-card.is-locked .balance-card__right-arrow{grid-area:1/3/3/4}.balance-card.is-locked .balance-card__amount-wrapper{grid-area:2/2/3/3}.balance-card:not(.is-locked){grid-template-columns:auto 1fr auto auto}.balance-card:not(.is-locked) .balance-card__right-arrow{grid-area:1/4/2/5}.balance-card__icon{display:flex;align-content:center;justify-content:center;margin:0 .5rem;border-radius:.8rem;align-self:flex-start;background-color:var(--accent-color--light)}.balance-card__icon .icon{height:1.3rem;width:1.3rem;fill:var(--accent-color)}.balance-card__token{font-size:.9rem;font-weight:500}.balance-card__amount-wrapper{margin-top:.5rem;grid-column:3/-1;gap:.3rem 1rem;grid-template-columns:1fr 1fr}.balance-card__amount-wrapper>:nth-child(even){text-align:right}.balance-card__right-arrow{background-color:rgba(var(--text-color), 0.1);border-radius:1rem;padding:.1rem;fill:var(--accent-color)}#history{padding-top:0 !important;width:min(36rem,100%)}#history .sticky{margin-left:-0.7rem;padding:1rem 0;background-color:rgba(var(--background-color), 1)}#exchange_history{margin-top:.5rem}.history-entry{display:grid;grid-template-columns:auto 1fr auto;gap:.5rem 1rem;align-items:center;margin-bottom:2rem}.history-entry[data-status=SUCCESS] .history-entry__status .icon{fill:var(--green)}.history-entry[data-status=PENDING] .history-entry__status .icon,.history-entry[data-status=WAITING_CONFIRMATION] .history-entry__status .icon{fill:var(--yellow)}.history-entry__status{display:flex;align-items:center;justify-content:center;grid-row:1/3;width:2.5rem;height:2.5rem;background-color:rgba(var(--text-color), 0.03);border-radius:2rem}.history-entry__token-action{font-weight:500}.history-entry__amount{font-weight:500;text-align:right}.history-entry[data-type=deposit] .history-entry__amount:not(:empty){color:var(--green)}.history-entry[data-type=deposit] .history-entry__amount:not(:empty)::before{content:"+ "}.history-entry[data-type=withdraw] .history-entry__amount:not(:empty)::before{content:"- "}.history-entry__time{font-size:.8rem;color:rgba(var(--text-color), 0.8)}.history-entry__txid{font-weight:500;font-size:.9rem;text-align:right}#portfolio_asset_page .sticky{margin-top:-1.5rem;margin-left:-0.7rem;padding:1rem 0;background-color:rgba(var(--background-color), 1)}#portfolio_asset__history{margin-top:1rem}#portfolio_cards_wrapper{display:grid;gap:.5rem;grid-template-columns:repeat(auto-fit, minmax(12rem, 1fr))}.personal-asset-balance{align-content:flex-start;padding:1rem;border-radius:.5rem;color:rgba(0,0,0,.8);width:100%}.personal-asset-balance:not(:last-of-type){margin-right:.5rem}.personal-asset-balance:nth-of-type(1){background:url("bg-art2.svg") no-repeat bottom right,#c2ffd7;background-size:contain}.personal-asset-balance:nth-of-type(1) .icon{background-color:rgba(102,255,156,.5)}.personal-asset-balance:nth-of-type(1) .button{border:solid thin rgba(102,255,156,.5)}.personal-asset-balance:nth-of-type(2){background:url("back.svg") no-repeat top right,#fcffa8;background-size:contain}.personal-asset-balance:nth-of-type(2) .icon{background-color:rgba(255,234,0,.5)}.personal-asset-balance>.flex{margin-bottom:.3rem}.personal-asset-balance>.flex .icon{height:2rem;width:2rem;padding:.4rem;border-radius:.3rem;fill:rgba(0,0,0,.8);margin-right:.5rem}.personal-asset-balance .button{display:flex;align-items:center;margin-top:.5rem;padding-right:.8rem;justify-self:flex-start;border-radius:1rem;background-color:rgba(var(--foreground-color), 1);color:rgba(var(--text-color), 1);transition:box-shadow .3s}.personal-asset-balance .button .icon{height:1rem;background-color:rgba(0,0,0,0);margin-right:.3rem}.personal-asset-balance .button:hover{box-shadow:0 .3rem .5rem rgba(0,0,0,.16)}#personal_rupee_balance span:first-of-type,#personal_flo_balance span:first-of-type{font-size:1.5rem}#personal_rupee_balance span:last-of-type,#personal_flo_balance span:last-of-type{font-size:.9rem}#portfolio_result{justify-content:center;text-align:center}#portfolio_result__icon{display:flex;padding:1rem;border-radius:50%;background-color:rgba(var(--text-color), 0.06);justify-self:center;-webkit-animation:pop-up .3s forwards cubic-bezier(0.175, 0.885, 0.32, 1.275);animation:pop-up .3s forwards cubic-bezier(0.175, 0.885, 0.32, 1.275)}#portfolio_result__icon .icon{height:2rem;width:2rem}.icon--success{fill:var(--green)}.icon--failure,.icon--error{fill:var(--danger-color)}@-webkit-keyframes pop-up{from{transform:translateY(3rem) scale(0.5);opacity:0}to{transform:translateY(0) scale(1);opacity:1}}@keyframes pop-up{from{transform:translateY(3rem) scale(0.5);opacity:0}to{transform:translateY(0) scale(1);opacity:1}}#portfolio_result__cta{padding:1.5rem 1rem;border-radius:.5rem;background-color:rgba(var(--text-color), 0.06)}.stateful-result{overflow:hidden;position:absolute;display:flex;justify-content:center;align-items:center;height:100%;width:100%;left:0}.stateful-result>*{position:absolute}.stateful-result--success .result__background{background-color:var(--green)}.stateful-result--failure .result__background{background-color:var(--danger-color)}.stateful-result .icon-wrapper{-webkit-animation:pop .4s forwards cubic-bezier(0.175, 0.885, 0.32, 1.275);animation:pop .4s forwards cubic-bezier(0.175, 0.885, 0.32, 1.275)}.stateful-result .icon{height:1.5rem;width:1.5rem;fill:rgba(var(--background-color), 1)}.stateful-result span{font-weight:500;color:rgba(var(--background-color), 1)}.stateful-result .result__background{-webkit-animation:ripple-reveal 1s forwards cubic-bezier(0.175, 0.885, 0.32, 1.275);animation:ripple-reveal 1s forwards cubic-bezier(0.175, 0.885, 0.32, 1.275)}.result__background{border-radius:.3rem;height:100%;width:100%;-webkit-clip-path:circle(10%);clip-path:circle(10%)}@-webkit-keyframes pop{from{opacity:0;transform:translateY(2rem)}to{opacity:1;transform:translateY(0)}}@keyframes pop{from{opacity:0;transform:translateY(2rem)}to{opacity:1;transform:translateY(0)}}@-webkit-keyframes ripple-reveal{to{-webkit-clip-path:circle(100%);clip-path:circle(100%)}}@keyframes ripple-reveal{to{-webkit-clip-path:circle(100%);clip-path:circle(100%)}}#help{width:min(60ch,100%);margin-bottom:3rem;align-content:flex-start}#help ul{list-style:initial;display:grid;gap:1rem}#help ul li{margin-left:1rem;padding-left:.5rem;font-size:.9rem}@media screen and (max-width: 40rem)and (any-hover: none){.cancel-order span{display:none !important}}@media screen and (max-width: 40rem){.empty-state{align-self:center}#user_popup_button{width:100%}.main_navbar__item--active .item__title{transform:translateY(100%);opacity:0}.main_navbar__item--active .icon{transform:translateY(50%) scale(1.2)}#asset_list_wrapper{padding:0 1.5rem}.listed-asset{border-radius:0;border-bottom:solid thin rgba(var(--text-color), 0.1)}#exchange{margin:0;padding:0}#login_section{padding:0 1.5rem}#login_form{margin-top:3rem}#asset_page__header{display:flex;padding:1rem 1.5rem .5rem .8rem}#chart_header{padding:0 1.5rem .5rem 1.5rem}#trade_form{padding:0 1.5rem}#price_chart_container{flex:1}#asset_page__footer button{display:flex;flex-direction:column;align-items:center;flex:1;padding:.5rem 0;color:rgba(var(--text-color), 0.8);font-size:.8rem;font-weight:500}#asset_page__footer button .icon{height:1.2rem;margin-bottom:.3rem;margin-right:.3rem}#asset_page__footer button.active{color:var(--accent-color)}#asset_page__footer button.active .icon{fill:var(--accent-color)}.hide-on-mobile{display:none !important}}@media screen and (min-width: 40rem){sm-popup{--width: 24rem}.popup__header{grid-column:1/-1;padding:1rem 1.5rem 0 1.5rem}#confirmation_popup{--width: 24rem}.page-layout{grid-template-columns:1fr 90vw 1fr}.mobile-page{align-self:flex-start;padding:2rem;border-radius:.5rem;background-color:rgba(var(--foreground-color), 1)}.hide-on-desktop{display:none !important}#home{display:grid;grid-template-columns:auto 1fr;grid-template-rows:auto 1fr;grid-template-areas:"header header" "nav pages"}#main_header{grid-area:header}#user_popup_button{justify-self:flex-end}#main_navbar{grid-area:nav;flex-direction:column;height:100%;padding-left:.5rem}.main_navbar__item{padding:1.5rem 2rem 1.5rem 1rem;width:100%;flex:0;flex-direction:row;border-radius:.5rem}.main_navbar__item .icon{margin-bottom:0;margin-right:.5rem}.main_navbar__item .item__title{font-size:.9rem}.main_navbar__item--active{background-color:rgba(var(--text-color), 0.06)}#pages_container{grid-area:pages}#pages_container>*{margin:0 1.5rem;padding:2rem}#login_section{width:24rem}.is-signed-in #exchange{display:flex;width:100%}.is-signed-in #exchange_wrapper{display:grid;width:100%;height:100%;gap:1.5rem;grid-template-columns:17rem minmax(0, 1fr);align-items:flex-start}#price_history_chart{height:20rem}#asset_list_wrapper{grid-row:1/3}.listed-asset{padding:1rem}.listed-asset--active{opacity:1;background-color:rgba(var(--text-color), 0.06)}.listed-asset--active::before{content:"";position:absolute;width:.25rem;border-radius:0 .2rem .2rem 0;height:2rem;background-color:var(--accent-color)}.order-card{grid-template-columns:auto 1fr 1fr 1fr auto;grid-template-areas:"checkbox quantity price amount time cancel"}.orders_section__header{background-color:rgba(var(--foreground-color), 1)}#history .sticky,#portfolio_asset_page .sticky{background-color:rgba(var(--foreground-color), 1)}}@media screen and (max-width: 80rem)and (min-width: 40rem){.main_navbar__item{padding:1.5rem 1rem}.main_navbar__item .icon{margin-right:0}.main_navbar__item .item__title{display:none !important}}@media screen and (min-width: 52rem){body:not(.is-signed-in) #market{gap:2rem;width:100%;grid-template-columns:18rem 1fr}.completed-trade{grid-template-columns:1fr 1fr 1fr 8rem;grid-template-areas:"quantity price amount info"}.completed-trade .quantity-block{grid-area:quantity}.completed-trade .price-block{grid-area:price}.completed-trade .amount-block{grid-area:amount}.completed-trade .info-block{grid-area:info}}@media screen and (min-width: 64rem){#home{grid-template-columns:auto 1fr}#asset_page_wrapper{display:grid;gap:1.5rem;grid-template-columns:minmax(0, 1fr) 20rem}}@media screen and (min-width: 72rem){.page-layout{grid-template-columns:1fr 80vw 1fr}}@media screen and (min-width: 120rem){.page-layout{grid-template-columns:1fr 70vw 1fr}}@media(any-hover: hover){::-webkit-scrollbar{width:.5rem;height:.5rem}::-webkit-scrollbar-thumb{background:rgba(var(--text-color), 0.3);border-radius:1rem}::-webkit-scrollbar-thumb:hover{background:rgba(var(--text-color), 0.5)}.order-card .cancel-order{justify-self:flex-end;overflow:hidden}.order-card .cancel-order .icon,.order-card .cancel-order span{transition:opacity .3s,transform .3s}.order-card .cancel-order .icon{transform:translateX(100%)}.order-card .cancel-order span{transform:translateX(100%);opacity:0}.order-card:hover .cancel-order .icon,.order-card:focus-within .cancel-order .icon{opacity:1}.order-card .cancel-order:hover .icon,.order-card .cancel-order:hover span{opacity:1;transform:translateX(0)}}
\ No newline at end of file
diff --git a/exchangemarket/docs/css/main.scss b/exchangemarket/docs/css/main.scss
index d9a8de2..5215fb7 100644
--- a/exchangemarket/docs/css/main.scss
+++ b/exchangemarket/docs/css/main.scss
@@ -27,7 +27,6 @@ body {
scrollbar-gutter: stable;
color: rgba(var(--text-color), 1);
background-color: rgba(var(--background-color), 1);
- transition: background-color 0.3s;
}
body[data-theme="dark"] {
@@ -38,6 +37,7 @@ body[data-theme="dark"] {
--danger-color: rgb(255, 106, 106);
--green: #00e676;
--yellow: #ffeb3b;
+
sm-popup::part(popup) {
background-color: rgba(var(--foreground-color), 1);
}
@@ -67,15 +67,18 @@ a:where([class]) {
a {
text-decoration: none;
color: var(--accent-color);
+
&:focus-visible {
box-shadow: 0 0 0 0.1rem rgba(var(--text-color), 1) inset;
}
}
+
fieldset {
border: none;
padding: 0;
margin: 0;
}
+
button,
.button {
user-select: none;
@@ -94,6 +97,7 @@ button,
border-radius: 0.3rem;
justify-content: center;
flex-shrink: 0;
+
&:focus-visible {
outline: var(--accent-color) solid medium;
}
@@ -106,6 +110,7 @@ button,
.button {
background-color: rgba(var(--text-color), 0.02);
border: solid thin rgba(var(--text-color), 0.06);
+
&--primary {
color: rgba(var(--background-color), 1);
background-color: var(--accent-color);
@@ -114,15 +119,19 @@ button,
fill: rgba(var(--background-color), 1);
}
}
+
&--colored {
color: var(--accent-color);
+
.icon {
fill: var(--accent-color);
}
}
+
&--danger {
background-color: #ff737310;
color: var(--danger-color);
+
.icon {
fill: var(--danger-color);
}
@@ -136,10 +145,12 @@ button,
border: solid rgba(var(--text-color), 0.3) 0.1rem;
background-color: rgba(var(--foreground-color), 1);
}
+
&--transparent {
background-color: transparent;
}
}
+
button:disabled {
opacity: 0.4;
cursor: not-allowed;
@@ -157,19 +168,24 @@ button:disabled {
a:any-link:focus-visible {
outline: rgba(var(--text-color), 1) 0.1rem solid;
}
+
input {
accent-color: var(--accent-color);
}
+
sm-input {
font-size: 0.9rem;
--border-radius: 0.3rem;
}
+
sm-form {
--gap: 1rem;
}
+
sm-copy {
font-size: 0.9rem;
}
+
ul {
list-style: none;
}
@@ -217,12 +233,15 @@ ul {
.flex {
display: flex;
}
+
.flex-1 {
flex: 1;
}
+
.flex-wrap {
flex-wrap: wrap;
}
+
.flex-direction-column {
flex-direction: column;
}
@@ -242,6 +261,7 @@ ul {
.gap-0-3 {
gap: 0.3rem;
}
+
.gap-0-5 {
gap: 0.5rem;
}
@@ -320,17 +340,16 @@ ul {
cursor: pointer;
-webkit-tap-highlight-color: transparent;
}
+
.ripple {
height: 8rem;
width: 8rem;
position: absolute;
border-radius: 50%;
transform: scale(0);
- background: radial-gradient(
- circle,
- rgba(var(--text-color), 0.3) 0%,
- rgba(0, 0, 0, 0) 50%
- );
+ background: radial-gradient(circle,
+ rgba(var(--text-color), 0.3) 0%,
+ rgba(0, 0, 0, 0) 50%);
pointer-events: none;
}
@@ -343,15 +362,19 @@ ul {
.margin-right-0-5 {
margin-right: 0.5rem;
}
+
.margin-right-auto {
margin-right: auto;
}
+
.margin-left-0-5 {
margin-left: 0.5rem;
}
+
.margin-left-auto {
margin-left: auto;
}
+
.icon-only {
padding: 0.5rem;
aspect-ratio: 1/1;
@@ -363,10 +386,12 @@ ul {
border-radius: 0.8rem;
background-color: var(--accent-color--light);
height: max-content;
+
.icon {
fill: var(--accent-color);
}
}
+
.empty-state {
display: grid;
text-align: center;
@@ -374,6 +399,7 @@ ul {
width: 100%;
max-width: none;
padding: 1.5rem;
+
&__icon {
height: 3rem;
width: 3rem;
@@ -388,12 +414,14 @@ ul {
display: none !important;
}
-.observe-empty-state:not(:empty) + .empty-state {
+.observe-empty-state:not(:empty)+.empty-state {
display: none !important;
}
+
#confirmation_popup,
#prompt_popup {
flex-direction: column;
+
h4 {
font-size: 1.2rem;
margin-bottom: 1rem;
@@ -403,9 +431,11 @@ ul {
margin-top: 1rem;
}
}
+
#prompt_message {
margin-bottom: 1.5rem;
}
+
.popup__header {
display: grid;
gap: 0.5rem;
@@ -423,14 +453,16 @@ ul {
#main_page {
padding: 1.5rem;
- & > section:nth-of-type(1) {
+ &>section:nth-of-type(1) {
align-content: flex-start;
}
}
+
details {
&:not(:last-of-type) {
border-bottom: thin solid rgba(var(--text-color), 0.3);
}
+
summary {
display: flex;
justify-content: space-between;
@@ -438,11 +470,14 @@ details {
cursor: pointer;
padding: 1rem 0;
}
+
.icon {
flex-shrink: 0;
}
+
&[open] {
padding-bottom: 1rem;
+
summary {
.icon {
transform: rotate(180deg);
@@ -450,6 +485,7 @@ details {
}
}
}
+
sm-chips {
--gap: 0;
background-color: rgba(var(--text-color), 0.06);
@@ -464,22 +500,27 @@ sm-chip {
--background: rgba(var(--text-color), 0.06);
user-select: none;
font-weight: 500;
+
&[selected] {
--background: var(--accent-color);
color: rgba(var(--background-color), 1);
}
+
&:first-of-type {
--border-radius: 0.3rem 0 0 0.3rem;
}
+
&:last-of-type {
--border-radius: 0 0.3rem 0.3rem 0;
}
}
+
sm-checkbox {
--height: 1rem;
--width: 1rem;
-webkit-tap-highlight-color: transparent;
}
+
.warning {
background-color: khaki;
color: rgba(0, 0, 0, 0.7);
@@ -487,21 +528,25 @@ sm-checkbox {
border-radius: 0.5rem;
line-height: 1.5;
}
+
.tip {
border-radius: 1.5rem;
background-color: rgba(var(--text-color), 0.06);
padding: 0.3rem 0.8rem;
font-size: 0.85rem;
+
.icon {
fill: var(--accent-color);
flex-shrink: 0;
}
}
+
.tooltip {
display: flex;
position: relative;
z-index: 8;
cursor: pointer;
+
.banner {
position: absolute;
right: 0;
@@ -515,23 +560,29 @@ sm-checkbox {
box-shadow: 0 0.2rem 0.5rem rgba(0, 0, 0, 0.1);
border: solid thin rgba(var(--text-color), 0.2);
}
+
&:hover .banner {
display: block;
}
}
+
.page-layout {
display: grid;
grid-template-columns: 1.5rem minmax(0, 1fr) 1.5rem;
- & > * {
+
+ &>* {
grid-column: 2/3;
}
}
+
.page {
height: 100%;
}
+
.mobile-page {
align-items: flex-start;
}
+
#loading {
.rm-logo {
height: 3rem;
@@ -542,12 +593,15 @@ sm-checkbox {
justify-self: center;
}
}
+
#landing {
grid-template-rows: auto 1fr;
+
header {
padding: 1.5rem 0;
}
- & > .grid {
+
+ &>.grid {
align-content: flex-start;
text-align: center;
gap: 1rem;
@@ -557,39 +611,49 @@ sm-checkbox {
#sign_up {
grid-template-rows: auto 1fr;
align-items: center;
+
section {
margin-top: -6rem;
justify-self: center;
width: min(24rem, 100%);
}
+
header {
padding: 1.5rem 0;
}
+
.h2 {
margin-bottom: 0.5rem;
}
+
h5 {
font-weight: 500;
color: rgba(var(--text-color), 0.8);
}
+
.warning {
margin-top: 2rem;
}
}
+
.loader-button-wrapper {
display: grid;
text-align: center;
- & > * {
+
+ &>* {
grid-area: 1/1/2/2;
}
+
button {
z-index: 1;
}
+
sm-spinner {
justify-self: center;
align-self: center;
}
}
+
#home {
height: 100%;
display: flex;
@@ -597,15 +661,19 @@ sm-checkbox {
align-items: flex-start;
align-content: flex-start;
}
+
#login_section {
display: flex;
width: 100%;
}
+
#login_form__priv_key {
margin-top: 1rem;
}
+
#flo_id_warning {
padding-bottom: 1.5rem;
+
.icon {
height: 3rem;
width: 3rem;
@@ -625,59 +693,71 @@ sm-checkbox {
width: 100%;
align-items: center;
}
-.app-brand{
+
+.app-brand {
display: flex;
gap: 0.3rem;
align-items: center;
- .icon{
+
+ .icon {
height: 1.7rem;
width: 1.7rem;
}
}
-.app-name{
- &__company{
+
+.app-name {
+ &__company {
font-size: 0.8rem;
font-weight: 500;
color: rgba(var(--text-color), 0.8);
}
}
+
#user_popup_button {
background-color: rgba(var(--text-color), 0.06);
border-radius: 2rem;
font-size: 0.8rem;
}
+
#main_navbar {
width: 100%;
}
+
.main_navbar__item {
display: flex;
flex-direction: column;
align-items: center;
flex: 1;
padding: 0.5rem 0;
+
.item__title,
.icon {
transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275),
opacity 0.3s;
}
+
.item__title {
color: rgba(var(--text-color), 0.8);
font-size: 0.8rem;
font-weight: 500;
}
+
.icon {
height: 1.2rem;
margin-bottom: 0.3rem;
}
+
&--active {
.item__title {
color: var(--accent-color);
}
+
.icon {
fill: var(--accent-color);
}
}
}
+
#pages_container {
display: flex;
flex: 1;
@@ -685,41 +765,48 @@ sm-checkbox {
height: 100%;
justify-content: center;
overflow-y: auto;
- & > * {
+
+ &>* {
padding: 0 1.5rem;
min-width: min(26rem, 100%);
}
}
+
.listed-asset {
position: relative;
gap: 0.5rem;
padding: 1rem 0;
border-radius: 0.5rem;
font-weight: 400;
- transition: background-color 0.3s;
+
user-select: none;
color: inherit;
grid-template-columns: auto 1fr auto auto;
grid-template-areas: "icon name rate right-arrow" "icon name countdown right-arrow";
+
&__icon {
grid-area: icon;
padding: 0.5rem;
border-radius: 1rem;
display: flex;
background-color: var(--accent-color);
+
.icon {
height: 1.2rem;
width: 1.2rem;
fill: rgba(var(--background-color), 1);
}
}
+
&__name {
grid-area: name;
margin-left: 0.3rem;
}
+
&__rate {
grid-area: rate;
}
+
&__countdown {
display: flex;
align-items: center;
@@ -727,21 +814,25 @@ sm-checkbox {
justify-self: flex-end;
font-size: 0.8rem;
color: var(--accent-color);
+
.icon {
margin-left: 0.3rem;
overflow: visible;
stroke-width: 3;
fill: none;
+
.path-a {
stroke: var(--accent-color);
stroke-dashoffset: var(--path-length, 0);
stroke-dasharray: 63;
}
+
.path-b {
stroke: rgba(var(--text-color), 0.2);
}
}
}
+
&__right-arrow {
grid-area: right-arrow;
background-color: rgba(var(--text-color), 0.1);
@@ -750,6 +841,7 @@ sm-checkbox {
margin-left: 0.3rem;
}
}
+
.quantity-selector {
.button {
flex: 1;
@@ -757,6 +849,7 @@ sm-checkbox {
margin-left: 0.5rem;
}
}
+
#quantity_selector_tip {
&::first-letter {
text-transform: uppercase;
@@ -774,11 +867,13 @@ sm-checkbox {
font-weight: 500;
min-width: 8ch;
}
+
#exchange_wrapper {
display: flex;
flex-direction: column;
height: 100%;
}
+
#asset_page {
position: relative;
display: flex;
@@ -786,47 +881,55 @@ sm-checkbox {
height: 100%;
align-items: flex-start;
}
+
#asset_page_wrapper {
display: flex;
flex-direction: column;
height: 100%;
width: 100%;
}
+
#trade_form {
height: 100%;
+
&::part(form) {
display: flex;
flex-direction: column;
gap: 0;
}
- & > * {
+
+ &>* {
margin-bottom: 1rem;
}
- & > :last-child {
+
+ &> :last-child {
margin-top: auto;
}
}
+
#my_orders,
#market {
width: min(46rem, 100%);
height: max-content;
}
+
#my_orders {
grid-template-rows: auto 1fr;
}
+
.orders_section__header {
min-height: 2.8rem;
position: sticky;
top: 0;
background-color: rgba(var(--background-color), 1);
z-index: 2;
- transition: background-color 0.3s;
}
.list__item {
padding: 0.5rem 0;
display: grid;
}
+
.order-card {
position: relative;
outline: none;
@@ -836,14 +939,17 @@ sm-checkbox {
grid-template-columns: min-content 1fr auto;
border-radius: 0.5rem;
grid-template-areas: "checkbox quantity quantity time" "checkbox price amount cancel";
- & > .grid {
+
+ &>.grid {
&:nth-of-type(2) {
grid-area: price;
}
+
&:nth-of-type(3) {
grid-area: amount;
}
}
+
&__type {
font-size: 0.9rem;
font-weight: 500;
@@ -857,18 +963,22 @@ sm-checkbox {
&[data-type="sell"] &__type {
color: var(--danger-color);
}
+
&--selected {
background-color: rgba(var(--text-color), 0.08);
+
.cancel-order {
visibility: hidden;
pointer-events: none;
}
}
+
sm-checkbox {
grid-area: checkbox;
cursor: pointer;
margin-right: 0.5rem;
}
+
&__quantity,
&__price {
font-size: 0.9rem;
@@ -880,62 +990,76 @@ sm-checkbox {
font-size: 0.8rem;
color: rgba(var(--text-color), 0.8);
}
+
.cancel-order {
grid-area: cancel;
color: var(--danger-color);
+
.icon {
fill: var(--danger-color);
}
}
}
+
.cancel-order {
align-items: center;
padding: 0.4rem 0.6rem;
+
span {
margin-left: 0.3rem;
}
}
+
.completed-trade,
.transaction-card,
.live-order {
gap: 0 1rem;
+
&__type {
font-size: 0.9rem;
font-weight: 500;
margin-bottom: 0.3rem;
}
+
&[data-type="Bought"] &__type,
&--buy &__type {
color: var(--green);
}
+
&[data-type="Sold"] &__type,
&--sell &__type {
color: var(--danger-color);
}
+
&__total {
font-weight: 700;
font-size: 0.9rem;
color: rgba(var(--text-color), 0.8);
}
+
&__quantity,
&__price {
font-size: 0.9rem;
color: rgba(var(--text-color), 0.9);
}
+
&__time {
font-size: 0.8rem;
color: rgba(var(--text-color), 0.8);
}
+
.more-info {
flex-shrink: 0;
padding: 0.3rem;
}
}
+
.transaction-card {
content-visibility: auto;
contain-intrinsic-size: 2.5rem;
grid-template-columns: repeat(3, 1fr) 2rem;
}
+
.completed-trade {
display: grid;
gap: 0.5rem;
@@ -945,43 +1069,53 @@ sm-checkbox {
padding: 1rem;
margin-bottom: 0.5rem;
}
+
#market_asset_rates {
display: grid;
gap: 0.5rem;
+
.listed-asset {
padding: 1rem;
background-color: rgba(var(--text-color), 0.03);
}
}
+
#market_orders_wrapper {
.list__header {
font-size: 0.8rem;
font-weight: 500;
+
div {
padding: 0.5rem 0;
}
}
+
.list__header {
margin-bottom: 0.5rem;
grid-template-columns: repeat(3, 1fr) 2rem;
}
}
+
.live-order {
display: grid;
gap: 1rem;
padding: 1rem;
border-radius: 0.5rem;
background-color: rgba(var(--text-color), 0.03);
+
&:not(:last-of-type) {
margin-bottom: 0.5rem;
}
+
&[data-type="buy"] {
background-color: #00fa9a10;
}
+
&[data-type="sell"] {
background-color: #e2135110;
}
}
+
#portfolio {
display: grid;
gap: 1.5rem;
@@ -989,17 +1123,20 @@ sm-checkbox {
align-content: flex-start;
width: min(32rem, 100%);
}
+
.label {
font-size: 0.8rem;
color: rgba(var(--text-color), 0.8);
margin-bottom: 0.2rem;
}
+
#my_assets {
gap: 0.5rem;
margin-top: 0.5rem;
padding-bottom: 1.5rem;
border: none;
}
+
.balance-card {
display: grid;
align-items: center;
@@ -1009,24 +1146,31 @@ sm-checkbox {
border-radius: 0.3rem;
color: inherit;
background-color: rgba(var(--text-color), 0.03);
+
&.is-locked {
grid-template-columns: auto 1fr auto;
+
.balance-card__icon {
grid-row: span 2;
}
+
.balance-card__right-arrow {
grid-area: 1/3/3/4;
}
+
.balance-card__amount-wrapper {
grid-area: 2/2/3/3;
}
}
+
&:not(.is-locked) {
grid-template-columns: auto 1fr auto auto;
+
.balance-card__right-arrow {
grid-area: 1/4/2/5;
}
}
+
&__icon {
display: flex;
align-content: center;
@@ -1035,25 +1179,30 @@ sm-checkbox {
border-radius: 0.8rem;
align-self: flex-start;
background-color: var(--accent-color--light);
+
.icon {
height: 1.3rem;
width: 1.3rem;
fill: var(--accent-color);
}
}
+
&__token {
font-size: 0.9rem;
font-weight: 500;
}
+
&__amount-wrapper {
margin-top: 0.5rem;
grid-column: 3/ -1;
gap: 0.3rem 1rem;
grid-template-columns: 1fr 1fr;
- & > :nth-child(even) {
+
+ &> :nth-child(even) {
text-align: right;
}
}
+
&__right-arrow {
background-color: rgba(var(--text-color), 0.1);
border-radius: 1rem;
@@ -1061,24 +1210,29 @@ sm-checkbox {
fill: var(--accent-color);
}
}
+
#history {
padding-top: 0 !important;
width: min(36rem, 100%);
+
.sticky {
margin-left: -0.7rem;
padding: 1rem 0;
background-color: rgba(var(--background-color), 1);
}
}
+
#exchange_history {
margin-top: 0.5rem;
}
+
.history-entry {
display: grid;
grid-template-columns: auto 1fr auto;
gap: 0.5rem 1rem;
align-items: center;
margin-bottom: 2rem;
+
&[data-status="SUCCESS"] {
.history-entry__status {
.icon {
@@ -1086,6 +1240,7 @@ sm-checkbox {
}
}
}
+
&[data-status="PENDING"],
&[data-status="WAITING_CONFIRMATION"] {
.history-entry__status {
@@ -1094,6 +1249,7 @@ sm-checkbox {
}
}
}
+
&__status {
display: flex;
align-items: center;
@@ -1104,21 +1260,26 @@ sm-checkbox {
background-color: rgba(var(--text-color), 0.03);
border-radius: 2rem;
}
+
&__token-action {
font-weight: 500;
}
+
&__amount {
font-weight: 500;
text-align: right;
}
+
&[data-type="deposit"] {
.history-entry__amount:not(:empty) {
color: var(--green);
+
&::before {
content: "+ ";
}
}
}
+
&[data-type="withdraw"] {
.history-entry__amount:not(:empty) {
&::before {
@@ -1126,16 +1287,19 @@ sm-checkbox {
}
}
}
+
&__time {
font-size: 0.8rem;
color: rgba(var(--text-color), 0.8);
}
+
&__txid {
font-weight: 500;
font-size: 0.9rem;
text-align: right;
}
}
+
#portfolio_asset_page {
.sticky {
margin-top: -1.5rem;
@@ -1144,44 +1308,55 @@ sm-checkbox {
background-color: rgba(var(--background-color), 1);
}
}
-#portfolio_asset__actions {
-}
+
+#portfolio_asset__actions {}
+
#portfolio_asset__history {
margin-top: 1rem;
}
+
#portfolio_cards_wrapper {
display: grid;
gap: 0.5rem;
grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
}
+
.personal-asset-balance {
align-content: flex-start;
padding: 1rem;
border-radius: 0.5rem;
color: rgba(0, 0, 0, 0.8);
width: 100%;
+
&:not(:last-of-type) {
margin-right: 0.5rem;
}
+
&:nth-of-type(1) {
background: url("bg-art2.svg") no-repeat bottom right, hsl(141, 100%, 88%);
background-size: contain;
+
.icon {
background-color: hsla(141, 100%, 70%, 0.5);
}
+
.button {
border: solid thin hsla(141, 100%, 70%, 0.5);
}
}
+
&:nth-of-type(2) {
background: url("back.svg") no-repeat top right, hsl(62, 100%, 83%);
background-size: contain;
+
.icon {
background-color: hsla(55, 100%, 50%, 0.5);
}
}
- & > .flex {
+
+ &>.flex {
margin-bottom: 0.3rem;
+
.icon {
height: 2rem;
width: 2rem;
@@ -1191,6 +1366,7 @@ sm-checkbox {
margin-right: 0.5rem;
}
}
+
.button {
display: flex;
align-items: center;
@@ -1201,28 +1377,34 @@ sm-checkbox {
background-color: rgba(var(--foreground-color), 1);
color: rgba(var(--text-color), 1);
transition: box-shadow 0.3s;
+
.icon {
height: 1rem;
background-color: transparent;
margin-right: 0.3rem;
}
+
&:hover {
box-shadow: 0 0.3rem 0.5rem rgba(0 0 0/ 0.16);
}
}
}
+
#personal_rupee_balance,
#personal_flo_balance {
span:first-of-type {
font-size: 1.5rem;
}
+
span:last-of-type {
font-size: 0.9rem;
}
}
+
#portfolio_result {
justify-content: center;
text-align: center;
+
&__icon {
display: flex;
padding: 1rem;
@@ -1230,34 +1412,41 @@ sm-checkbox {
background-color: rgba(var(--text-color), 0.06);
justify-self: center;
animation: pop-up 0.3s forwards cubic-bezier(0.175, 0.885, 0.32, 1.275);
+
.icon {
height: 2rem;
width: 2rem;
}
}
}
+
.icon--success {
fill: var(--green);
}
+
.icon--failure,
.icon--error {
fill: var(--danger-color);
}
+
@keyframes pop-up {
from {
transform: translateY(3rem) scale(0.5);
opacity: 0;
}
+
to {
transform: translateY(0) scale(1);
opacity: 1;
}
}
+
#portfolio_result__cta {
padding: 1.5rem 1rem;
border-radius: 0.5rem;
background-color: rgba(var(--text-color), 0.06);
}
+
.stateful-result {
overflow: hidden;
position: absolute;
@@ -1267,51 +1456,62 @@ sm-checkbox {
height: 100%;
width: 100%;
left: 0;
- & > * {
+
+ &>* {
position: absolute;
}
+
&--success {
.result__background {
background-color: var(--green);
}
}
+
&--failure {
.result__background {
background-color: var(--danger-color);
}
}
+
.icon-wrapper {
animation: pop 0.4s forwards cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
+
.icon {
height: 1.5rem;
width: 1.5rem;
fill: rgba(var(--background-color), 1);
}
+
span {
font-weight: 500;
color: rgba(var(--background-color), 1);
}
+
.result__background {
animation: ripple-reveal 1s forwards cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
}
+
.result__background {
border-radius: 0.3rem;
height: 100%;
width: 100%;
clip-path: circle(10%);
}
+
@keyframes pop {
from {
opacity: 0;
transform: translateY(2rem);
}
+
to {
opacity: 1;
transform: translateY(0);
}
}
+
@keyframes ripple-reveal {
to {
clip-path: circle(100%);
@@ -1322,10 +1522,12 @@ sm-checkbox {
width: min(60ch, 100%);
margin-bottom: 3rem;
align-content: flex-start;
+
ul {
list-style: initial;
display: grid;
gap: 1rem;
+
li {
margin-left: 1rem;
padding-left: 0.5rem;
@@ -1341,52 +1543,66 @@ sm-checkbox {
}
}
}
+
@media screen and (max-width: 40rem) {
.empty-state {
align-self: center;
}
+
#user_popup_button {
width: 100%;
}
+
.main_navbar__item--active {
.item__title {
transform: translateY(100%);
opacity: 0;
}
+
.icon {
transform: translateY(50%) scale(1.2);
}
}
+
#asset_list_wrapper {
padding: 0 1.5rem;
}
+
.listed-asset {
border-radius: 0;
border-bottom: solid thin rgba(var(--text-color), 0.1);
}
+
#exchange {
margin: 0;
padding: 0;
}
+
#login_section {
padding: 0 1.5rem;
}
+
#login_form {
margin-top: 3rem;
}
+
#asset_page__header {
display: flex;
padding: 1rem 1.5rem 0.5rem 0.8rem;
}
+
#chart_header {
padding: 0 1.5rem 0.5rem 1.5rem;
}
+
#trade_form {
padding: 0 1.5rem;
}
+
#price_chart_container {
flex: 1;
}
+
#asset_page__footer {
button {
display: flex;
@@ -1397,97 +1613,119 @@ sm-checkbox {
color: rgba(var(--text-color), 0.8);
font-size: 0.8rem;
font-weight: 500;
+
.icon {
height: 1.2rem;
margin-bottom: 0.3rem;
margin-right: 0.3rem;
}
+
&.active {
color: var(--accent-color);
+
.icon {
fill: var(--accent-color);
}
}
}
}
+
.hide-on-mobile {
display: none !important;
}
}
+
@media screen and (min-width: 40rem) {
sm-popup {
--width: 24rem;
}
+
.popup__header {
grid-column: 1/-1;
padding: 1rem 1.5rem 0 1.5rem;
}
+
#confirmation_popup {
--width: 24rem;
}
+
.page-layout {
grid-template-columns: 1fr 90vw 1fr;
}
+
.mobile-page {
align-self: flex-start;
padding: 2rem;
border-radius: 0.5rem;
background-color: rgba(var(--foreground-color), 1);
}
+
.hide-on-desktop {
display: none !important;
}
+
#home {
display: grid;
grid-template-columns: auto 1fr;
grid-template-rows: auto 1fr;
grid-template-areas: "header header" "nav pages";
}
+
#main_header {
grid-area: header;
}
+
#user_popup_button {
justify-self: flex-end;
}
+
#main_navbar {
grid-area: nav;
flex-direction: column;
height: 100%;
padding-left: 0.5rem;
}
+
.main_navbar__item {
padding: 1.5rem 2rem 1.5rem 1rem;
width: 100%;
flex: 0;
flex-direction: row;
border-radius: 0.5rem;
- transition: background-color 0.3s;
+
.icon {
margin-bottom: 0;
margin-right: 0.5rem;
}
+
.item__title {
font-size: 0.9rem;
}
+
&--active {
background-color: rgba(var(--text-color), 0.06);
}
}
+
#pages_container {
grid-area: pages;
- & > * {
+
+ &>* {
margin: 0 1.5rem;
padding: 2rem;
}
}
+
#login_section {
width: 24rem;
}
+
.is-signed-in {
#exchange {
display: flex;
width: 100%;
}
+
#exchange_wrapper {
display: grid;
width: 100%;
@@ -1497,17 +1735,22 @@ sm-checkbox {
align-items: flex-start;
}
}
+
#price_history_chart {
height: 20rem;
}
+
#asset_list_wrapper {
grid-row: 1/3;
}
+
.listed-asset {
padding: 1rem;
+
&--active {
opacity: 1;
background-color: rgba(var(--text-color), 0.06);
+
&::before {
content: "";
position: absolute;
@@ -1518,13 +1761,16 @@ sm-checkbox {
}
}
}
+
.order-card {
grid-template-columns: auto 1fr 1fr 1fr auto;
grid-template-areas: "checkbox quantity price amount time cancel";
}
+
.orders_section__header {
background-color: rgba(var(--foreground-color), 1);
}
+
#history,
#portfolio_asset_page {
.sticky {
@@ -1532,17 +1778,21 @@ sm-checkbox {
}
}
}
+
@media screen and (max-width: 80rem) and (min-width: 40rem) {
.main_navbar__item {
padding: 1.5rem 1rem;
+
.icon {
margin-right: 0;
}
+
.item__title {
display: none !important;
}
}
}
+
@media screen and (min-width: 52rem) {
body:not(.is-signed-in) {
#market {
@@ -1551,43 +1801,53 @@ sm-checkbox {
grid-template-columns: 18rem 1fr;
}
}
+
.completed-trade {
grid-template-columns: 1fr 1fr 1fr 8rem;
grid-template-areas: "quantity price amount info";
+
.quantity-block {
grid-area: quantity;
}
+
.price-block {
grid-area: price;
}
+
.amount-block {
grid-area: amount;
}
+
.info-block {
grid-area: info;
}
}
}
+
@media screen and (min-width: 64rem) {
#home {
grid-template-columns: auto 1fr;
}
+
#asset_page_wrapper {
display: grid;
gap: 1.5rem;
grid-template-columns: minmax(0, 1fr) 20rem;
}
}
+
@media screen and (min-width: 72rem) {
.page-layout {
grid-template-columns: 1fr 80vw 1fr;
}
}
+
@media screen and (min-width: 120rem) {
.page-layout {
grid-template-columns: 1fr 70vw 1fr;
}
}
+
@media (any-hover: hover) {
::-webkit-scrollbar {
width: 0.5rem;
@@ -1602,22 +1862,27 @@ sm-checkbox {
background: rgba(var(--text-color), 0.5);
}
}
+
.order-card {
.cancel-order {
justify-self: flex-end;
overflow: hidden;
+
.icon,
span {
transition: opacity 0.3s, transform 0.3s;
}
+
.icon {
transform: translateX(100%);
}
+
span {
transform: translateX(100%);
opacity: 0;
}
}
+
&:hover,
&:focus-within {
.cancel-order {
@@ -1626,7 +1891,9 @@ sm-checkbox {
}
}
}
+
.cancel-order:hover {
+
.icon,
span {
opacity: 1;
@@ -1634,4 +1901,4 @@ sm-checkbox {
}
}
}
-}
+}
\ No newline at end of file
diff --git a/exchangemarket/docs/scripts/components.js b/exchangemarket/docs/scripts/components.js
index 41e0714..d36d566 100644
--- a/exchangemarket/docs/scripts/components.js
+++ b/exchangemarket/docs/scripts/components.js
@@ -8,7 +8,7 @@ const smInput = document.createElement("template"); smInput.innerHTML = '
`, customElements.define("sm-popup", class extends HTMLElement { constructor() { super(), this.attachShadow({ mode: "open" }).append(smPopup.content.cloneNode(!0)), this.allowClosing = !1, this.isOpen = !1, this.offset = 0, this.touchStartY = 0, this.touchEndY = 0, this.touchStartTime = 0, this.touchEndTime = 0, this.touchEndAnimation = void 0, this.focusable, this.autoFocus, this.mutationObserver, this.popupContainer = this.shadowRoot.querySelector(".popup-container"), this.backdrop = this.shadowRoot.querySelector(".backdrop"), this.dialogBox = this.shadowRoot.querySelector(".popup"), this.popupBodySlot = this.shadowRoot.querySelector(".popup-body slot"), this.popupHeader = this.shadowRoot.querySelector(".popup-top"), this.resumeScrolling = this.resumeScrolling.bind(this), this.setStateOpen = this.setStateOpen.bind(this), this.show = this.show.bind(this), this.hide = this.hide.bind(this), this.handleTouchStart = this.handleTouchStart.bind(this), this.handleTouchMove = this.handleTouchMove.bind(this), this.handleTouchEnd = this.handleTouchEnd.bind(this), this.detectFocus = this.detectFocus.bind(this), this.handleSoftDismiss = this.handleSoftDismiss.bind(this) } static get observedAttributes() { return ["open"] } get open() { return this.isOpen } animateTo(t, e, i) { let s = t.animate(e, { ...i, fill: "both" }); return s.finished.then(() => { s.commitStyles(), s.cancel() }), s } resumeScrolling() { let t = document.body.style.top; window.scrollTo(0, -1 * parseInt(t || "0")), document.body.style.overflow = "", document.body.style.top = "initial" } setStateOpen() { if (!this.isOpen || this.offset) { let t = window.innerWidth > 640 ? "scale(1.1)" : `translateY(${this.offset ? `${this.offset}px` : "100%"})`; this.animateTo(this.dialogBox, [{ opacity: this.offset ? 1 : 0, transform: t }, { opacity: 1, transform: "none" },], { duration: 300, easing: "ease" }) } } show(t = {}) { let { pinned: e = !1, payload: i } = t; if (this.isOpen) return; let s = { duration: 300, easing: "ease" }; return this.payload = i, popupStack.push({ popup: this, permission: e }), popupStack.items.length > 1 && this.animateTo(popupStack.items[popupStack.items.length - 2].popup.shadowRoot.querySelector(".popup"), [{ transform: "none" }, { transform: window.innerWidth > 640 ? "scale(0.95)" : "translateY(-1.5rem)" },], s), this.popupContainer.classList.remove("hide"), this.offset || (this.backdrop.animate([{ opacity: 0 }, { opacity: 1 },], s).onfinish = () => { this.resolveOpen(this.payload) }, this.dispatchEvent(new CustomEvent("popupopened", { bubbles: !0, composed: !0, detail: { payload: this.payload } })), document.body.style.overflow = "hidden", document.body.style.top = `-${window.scrollY}px`), this.setStateOpen(), this.pinned = e, this.isOpen = !0, setTimeout(() => { let t = this.autoFocus || this.focusable?.[0] || this.dialogBox; t && (t.tagName.includes("-") ? t.focusIn() : t.focus()) }, 0), this.hasAttribute("open") || (this.setAttribute("open", ""), this.addEventListener("keydown", this.detectFocus), this.resizeObserver.observe(this), this.mutationObserver.observe(this, { attributes: !0, childList: !0, subtree: !0 }), this.popupHeader.addEventListener("touchstart", this.handleTouchStart, { passive: !0 }), this.backdrop.addEventListener("mousedown", this.handleSoftDismiss)), { opened: new Promise(t => { this.resolveOpen = t }), closed: new Promise(t => { this.resolveClose = t }) } } hide(t = {}) { let { payload: e } = t, i = { duration: 150, easing: "ease" }; this.backdrop.animate([{ opacity: 1 }, { opacity: 0 }], i), this.animateTo(this.dialogBox, [{ opacity: 1, transform: window.innerWidth > 640 ? "none" : `translateY(${this.offset ? `${this.offset}px` : "0"})` }, { opacity: 0, transform: window.innerWidth > 640 ? "scale(1.1)" : "translateY(100%)" },], i).finished.finally(() => { this.popupContainer.classList.add("hide"), this.dialogBox.style = "", this.removeAttribute("open"), this.forms.length && this.forms.forEach(t => t.reset()), this.dispatchEvent(new CustomEvent("popupclosed", { bubbles: !0, composed: !0, detail: { payload: e || this.payload } })), this.resolveClose(e || this.payload), this.isOpen = !1 }), popupStack.pop(), popupStack.items.length ? this.animateTo(popupStack.items[popupStack.items.length - 1].popup.shadowRoot.querySelector(".popup"), [{ transform: window.innerWidth > 640 ? "scale(0.95)" : "translateY(-1.5rem)" }, { transform: "none" },], i) : this.resumeScrolling(), this.resizeObserver.disconnect(), this.mutationObserver.disconnect(), this.removeEventListener("keydown", this.detectFocus), this.popupHeader.removeEventListener("touchstart", this.handleTouchStart, { passive: !0 }), this.backdrop.removeEventListener("mousedown", this.handleSoftDismiss) } handleTouchStart(t) { this.offset = 0, this.popupHeader.addEventListener("touchmove", this.handleTouchMove, { passive: !0 }), this.popupHeader.addEventListener("touchend", this.handleTouchEnd, { passive: !0 }), this.touchStartY = t.changedTouches[0].clientY, this.touchStartTime = t.timeStamp } handleTouchMove(t) { this.touchStartY < t.changedTouches[0].clientY && (this.offset = t.changedTouches[0].clientY - this.touchStartY, this.touchEndAnimation = window.requestAnimationFrame(() => { this.dialogBox.style.transform = `translateY(${this.offset}px)` })) } handleTouchEnd(t) { if (this.touchEndTime = t.timeStamp, cancelAnimationFrame(this.touchEndAnimation), this.touchEndY = t.changedTouches[0].clientY, this.threshold = .3 * this.dialogBox.getBoundingClientRect().height, this.touchEndTime - this.touchStartTime > 200) { if (this.touchEndY - this.touchStartY > this.threshold) { if (this.pinned) { this.setStateOpen(); return } this.hide() } else this.setStateOpen() } else if (this.touchEndY > this.touchStartY) { if (this.pinned) { this.setStateOpen(); return } this.hide() } this.popupHeader.removeEventListener("touchmove", this.handleTouchMove, { passive: !0 }), this.popupHeader.removeEventListener("touchend", this.handleTouchEnd, { passive: !0 }) } detectFocus(t) { if ("Tab" === t.key) { let e = this.focusable[this.focusable.length - 1], i = this.focusable[0]; t.shiftKey && document.activeElement === i ? (t.preventDefault(), e.tagName.includes("SM-") ? e.focusIn() : e.focus()) : t.shiftKey || document.activeElement !== e || (t.preventDefault(), i.tagName.includes("SM-") ? i.focusIn() : i.focus()) } } updateFocusableList() { this.focusable = this.querySelectorAll('sm-button:not([disabled]), button:not([disabled]), [href], sm-input, input:not([readonly]), sm-select, select, sm-checkbox, sm-textarea, textarea, [tabindex]:not([tabindex="-1"])'), this.autoFocus = this.querySelector("[autofocus]") } handleSoftDismiss() { this.pinned ? this.dialogBox.animate([{ transform: "translateX(-1rem)" }, { transform: "translateX(1rem)" }, { transform: "translateX(-0.5rem)" }, { transform: "translateX(0.5rem)" }, { transform: "translateX(0)" },], { duration: 300, easing: "ease" }) : this.hide() } debounce(t, e) { let i = null; return (...s) => { window.clearTimeout(i), i = window.setTimeout(() => { t.apply(null, s) }, e) } } connectedCallback() { this.popupBodySlot.addEventListener("slotchange", this.debounce(() => { this.forms = this.querySelectorAll("sm-form"), this.updateFocusableList() }, 0)), this.resizeObserver = new ResizeObserver(t => { for (let e of t) if (e.contentBoxSize) { let i = Array.isArray(e.contentBoxSize) ? e.contentBoxSize[0] : e.contentBoxSize; this.threshold = .3 * i.blockSize.height } else this.threshold = .3 * e.contentRect.height }), this.mutationObserver = new MutationObserver(t => { this.updateFocusableList() }) } disconnectedCallback() { this.resizeObserver.disconnect(), this.mutationObserver.disconnect(), this.removeEventListener("keydown", this.detectFocus), this.popupHeader.removeEventListener("touchstart", this.handleTouchStart, { passive: !0 }), this.backdrop.removeEventListener("mousedown", this.handleSoftDismiss) } attributeChangedCallback(t) { "open" === t && this.hasAttribute("open") && this.show() } });
const spinner = document.createElement("template"); spinner.innerHTML = ''; class SpinnerLoader extends HTMLElement { constructor() { super(), this.attachShadow({ mode: "open" }).append(spinner.content.cloneNode(!0)) } } window.customElements.define("sm-spinner", SpinnerLoader);
-const themeToggle = document.createElement("template"); themeToggle.innerHTML = ' '; class ThemeToggle extends HTMLElement { constructor() { super(), this.attachShadow({ mode: "open" }).append(themeToggle.content.cloneNode(!0)), this.isChecked = !1, this.hasTheme = "light", this.toggleState = this.toggleState.bind(this), this.fireEvent = this.fireEvent.bind(this), this.handleThemeChange = this.handleThemeChange.bind(this) } static get observedAttributes() { return ["checked"] } daylight() { this.hasTheme = "light", document.body.dataset.theme = "light", this.setAttribute("aria-checked", "false") } nightlight() { this.hasTheme = "dark", document.body.dataset.theme = "dark", this.setAttribute("aria-checked", "true") } toggleState() { this.toggleAttribute("checked"), this.fireEvent() } handleKeyDown(e) { " " === e.key && this.toggleState() } handleThemeChange(e) { e.detail.theme !== this.hasTheme && ("dark" === e.detail.theme ? this.setAttribute("checked", "") : this.removeAttribute("checked")) } fireEvent() { this.dispatchEvent(new CustomEvent("themechange", { bubbles: !0, composed: !0, detail: { theme: this.hasTheme } })) } connectedCallback() { this.setAttribute("role", "switch"), this.setAttribute("aria-label", "theme toggle"), "dark" === localStorage.getItem(`${window.location.hostname}-theme`) ? (this.nightlight(), this.setAttribute("checked", "")) : "light" === localStorage.getItem(`${window.location.hostname}-theme`) ? (this.daylight(), this.removeAttribute("checked")) : window.matchMedia("(prefers-color-scheme: dark)").matches ? (this.nightlight(), this.setAttribute("checked", "")) : (this.daylight(), this.removeAttribute("checked")), this.addEventListener("click", this.toggleState), this.addEventListener("keydown", this.handleKeyDown), document.addEventListener("themechange", this.handleThemeChange) } disconnectedCallback() { this.removeEventListener("click", this.toggleState), this.removeEventListener("keydown", this.handleKeyDown), document.removeEventListener("themechange", this.handleThemeChange) } attributeChangedCallback(e, t, n) { "checked" === e && (this.hasAttribute("checked") ? (this.nightlight(), localStorage.setItem(`${window.location.hostname}-theme`, "dark")) : (this.daylight(), localStorage.setItem(`${window.location.hostname}-theme`, "light"))) } } window.customElements.define("theme-toggle", ThemeToggle);
+const themeToggle = document.createElement("template"); themeToggle.innerHTML = ' '; class ThemeToggle extends HTMLElement { constructor() { super(), this.attachShadow({ mode: "open" }).append(themeToggle.content.cloneNode(!0)), this.isChecked = !1, this.hasTheme = "light", this.toggleState = this.toggleState.bind(this), this.fireEvent = this.fireEvent.bind(this), this.handleThemeChange = this.handleThemeChange.bind(this) } static get observedAttributes() { return ["checked"] } daylight() { this.hasTheme = "light", document.body.dataset.theme = "light", this.setAttribute("aria-checked", "false") } nightlight() { this.hasTheme = "dark", document.body.dataset.theme = "dark", this.setAttribute("aria-checked", "true") } toggleState() { if (!document.startViewTransition) return this.toggleAttribute("checked"), void this.fireEvent(); document.startViewTransition(() => { this.toggleAttribute("checked"), this.fireEvent() }) } handleKeyDown(e) { " " === e.key && this.toggleState() } handleThemeChange(e) { e.detail.theme !== this.hasTheme && ("dark" === e.detail.theme ? this.setAttribute("checked", "") : this.removeAttribute("checked")) } fireEvent() { this.dispatchEvent(new CustomEvent("themechange", { bubbles: !0, composed: !0, detail: { theme: this.hasTheme } })) } connectedCallback() { this.setAttribute("role", "switch"), this.setAttribute("aria-label", "theme toggle"), "dark" === localStorage.getItem(`${window.location.hostname}-theme`) ? (this.nightlight(), this.setAttribute("checked", "")) : "light" === localStorage.getItem(`${window.location.hostname}-theme`) ? (this.daylight(), this.removeAttribute("checked")) : window.matchMedia("(prefers-color-scheme: dark)").matches ? (this.nightlight(), this.setAttribute("checked", "")) : (this.daylight(), this.removeAttribute("checked")), this.addEventListener("click", this.toggleState), this.addEventListener("keydown", this.handleKeyDown), document.addEventListener("themechange", this.handleThemeChange) } disconnectedCallback() { this.removeEventListener("click", this.toggleState), this.removeEventListener("keydown", this.handleKeyDown), document.removeEventListener("themechange", this.handleThemeChange) } attributeChangedCallback(e, t, n) { "checked" === e && (this.hasAttribute("checked") ? (this.nightlight(), localStorage.setItem(`${window.location.hostname}-theme`, "dark")) : (this.daylight(), localStorage.setItem(`${window.location.hostname}-theme`, "light"))) } } window.customElements.define("theme-toggle", ThemeToggle);
const slideButton = document.createElement('template')
slideButton.innerHTML = `
diff --git a/exchangemarket/docs/scripts/components.min.js b/exchangemarket/docs/scripts/components.min.js
new file mode 100644
index 0000000..ea98e4c
--- /dev/null
+++ b/exchangemarket/docs/scripts/components.min.js
@@ -0,0 +1 @@
+const smCheckbox=document.createElement("template");smCheckbox.innerHTML='',customElements.define("sm-checkbox",class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}).append(smCheckbox.content.cloneNode(!0)),this.defaultState,this.checkbox=this.shadowRoot.querySelector(".checkbox"),this.reset=this.reset.bind(this),this.dispatch=this.dispatch.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleClick=this.handleClick.bind(this)}static get observedAttributes(){return["value","disabled","checked"]}get disabled(){return this.hasAttribute("disabled")}set disabled(e){e?this.setAttribute("disabled",""):this.removeAttribute("disabled")}get checked(){return this.hasAttribute("checked")}set checked(e){e?this.setAttribute("checked",""):this.removeAttribute("checked")}set value(e){this.setAttribute("value",e)}get value(){return this.getAttribute("value")}focusIn(){this.focus()}reset(){this.value=this.defaultState}dispatch(){this.dispatchEvent(new CustomEvent("change",{bubbles:!0,composed:!0}))}handleKeyDown(e){" "===e.key&&(e.preventDefault(),this.toggleAttribute("checked"))}handleClick(e){this.toggleAttribute("checked")}connectedCallback(){this.hasAttribute("disabled")||this.setAttribute("tabindex","0"),this.setAttribute("role","checkbox"),this.defaultState=this.hasAttribute("checked"),this.hasAttribute("checked")||this.setAttribute("aria-checked","false"),this.addEventListener("keydown",this.handleKeyDown),this.addEventListener("click",this.handleClick)}attributeChangedCallback(e,t,n){t!==n&&("checked"===e?(this.setAttribute("aria-checked",this.hasAttribute("checked")),this.dispatch()):"disabled"===e&&(this.hasAttribute("disabled")?this.removeAttribute("tabindex"):this.setAttribute("tabindex","0")))}disconnectedCallback(){this.removeEventListener("keydown",this.handleKeyDown),this.removeEventListener("change",this.handleClick)}});const smChips=document.createElement("template");smChips.innerHTML='',customElements.define("sm-chips",class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}).append(smChips.content.cloneNode(!0)),this.chipsWrapper=this.shadowRoot.querySelector(".sm-chips"),this.coverLeft=this.shadowRoot.querySelector(".cover--left"),this.coverRight=this.shadowRoot.querySelector(".cover--right"),this.navButtonLeft=this.shadowRoot.querySelector(".nav-button--left"),this.navButtonRight=this.shadowRoot.querySelector(".nav-button--right"),this.slottedOptions=void 0,this._value=void 0,this.scrollDistance=0,this.assignedElements=[],this.scrollLeft=this.scrollLeft.bind(this),this.scrollRight=this.scrollRight.bind(this),this.fireEvent=this.fireEvent.bind(this),this.setSelectedOption=this.setSelectedOption.bind(this)}get value(){return this._value}set value(t){this.setSelectedOption(t)}scrollLeft(){this.chipsWrapper.scrollBy({left:-this.scrollDistance,behavior:"smooth"})}scrollRight(){this.chipsWrapper.scrollBy({left:this.scrollDistance,behavior:"smooth"})}setSelectedOption(t){this._value!==t&&(this._value=t,this.assignedElements.forEach((e=>{e.value==t?(e.setAttribute("selected",""),e.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})):e.removeAttribute("selected")})))}fireEvent(){this.dispatchEvent(new CustomEvent("change",{bubbles:!0,composed:!0,detail:{value:this._value}}))}connectedCallback(){this.setAttribute("role","listbox");const t=this.shadowRoot.querySelector("slot");t.addEventListener("slotchange",(e=>{clearTimeout(this.slotChangeTimeout),this.slotChangeTimeout=setTimeout((()=>{n.disconnect(),i.disconnect(),this.assignedElements=t.assignedElements(),this.assignedElements.forEach((t=>{t.hasAttribute("selected")&&(this._value=t.value)})),this.hasAttribute("multiline")||(this.assignedElements.length>0?(n.observe(this.assignedElements[0]),i.observe(this.assignedElements[this.assignedElements.length-1])):(this.navButtonLeft.classList.add("hide"),this.navButtonRight.classList.add("hide"),this.coverLeft.classList.add("hide"),this.coverRight.classList.add("hide"),n.disconnect(),i.disconnect()))}),100)}));const e=new ResizeObserver((t=>{t.forEach((t=>{if(t.contentBoxSize){const e=Array.isArray(t.contentBoxSize)?t.contentBoxSize[0]:t.contentBoxSize;this.scrollDistance=.6*e.inlineSize}else this.scrollDistance=.6*t.contentRect.width}))}));e.observe(this),this.chipsWrapper.addEventListener("option-clicked",(t=>{this._value!==t.target.value&&(this.setSelectedOption(t.target.value),this.fireEvent())}));const n=new IntersectionObserver((t=>{t.forEach((t=>{t.isIntersecting?(this.navButtonLeft.classList.add("hide"),this.coverLeft.classList.add("hide")):(this.navButtonLeft.classList.remove("hide"),this.coverLeft.classList.remove("hide"))}))}),{threshold:.9,root:this}),i=new IntersectionObserver((t=>{t.forEach((t=>{t.isIntersecting?(this.navButtonRight.classList.add("hide"),this.coverRight.classList.add("hide")):(this.navButtonRight.classList.remove("hide"),this.coverRight.classList.remove("hide"))}))}),{threshold:.9,root:this});this.navButtonLeft.addEventListener("click",this.scrollLeft),this.navButtonRight.addEventListener("click",this.scrollRight)}disconnectedCallback(){this.navButtonLeft.removeEventListener("click",this.scrollLeft),this.navButtonRight.removeEventListener("click",this.scrollRight)}});const smChip=document.createElement("template");smChip.innerHTML=' ',customElements.define("sm-chip",class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}).append(smChip.content.cloneNode(!0)),this._value=void 0,this.radioButton=this.shadowRoot.querySelector("input"),this.fireEvent=this.fireEvent.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this)}get value(){return this._value}fireEvent(){this.dispatchEvent(new CustomEvent("option-clicked",{bubbles:!0,composed:!0,detail:{value:this._value}}))}handleKeyDown(t){"Enter"!==t.key&&"Space"!==t.key||this.fireEvent()}connectedCallback(){this.setAttribute("role","option"),this.setAttribute("tabindex","0"),this._value=this.getAttribute("value"),this.addEventListener("click",this.fireEvent),this.addEventListener("keydown",this.handleKeyDown)}disconnectedCallback(){this.removeEventListener("click",this.fireEvent),this.removeEventListener("keydown",this.handleKeyDown)}});const smCopy=document.createElement("template");smCopy.innerHTML='',customElements.define("sm-copy",class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}).append(smCopy.content.cloneNode(!0)),this.copyContent=this.shadowRoot.querySelector(".copy-content"),this.copyButton=this.shadowRoot.querySelector(".copy-button"),this.copy=this.copy.bind(this)}static get observedAttributes(){return["value"]}set value(t){this.setAttribute("value",t)}get value(){return this.getAttribute("value")}fireEvent(){this.dispatchEvent(new CustomEvent("copy",{composed:!0,bubbles:!0,cancelable:!0}))}copy(){navigator.clipboard.writeText(this.copyContent.textContent).then((t=>this.fireEvent())).catch((t=>console.error(t)))}connectedCallback(){this.copyButton.addEventListener("click",this.copy)}attributeChangedCallback(t,n,o){"value"===t&&(this.copyContent.textContent=o)}disconnectedCallback(){this.copyButton.removeEventListener("click",this.copy)}});const smForm=document.createElement("template");smForm.innerHTML=' ',customElements.define("sm-form",class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}).append(smForm.content.cloneNode(!0)),this.form=this.shadowRoot.querySelector("form"),this.invalidFields=!1,this.skipSubmit=!1,this.isFormValid=!1,this.supportedElements=new Set(["INPUT","SM-INPUT","SM-TEXTAREA","SM-CHECKBOX","TAGS-INPUT","FILE-INPUT","SM-SWITCH","SM-RADIO"]),this.debounce=this.debounce.bind(this),this._checkValidity=this._checkValidity.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.reset=this.reset.bind(this),this.elementsChanged=this.elementsChanged.bind(this)}static get observedAttributes(){return["skip-submit"]}get validity(){return this.isFormValid}debounce(t,e){let i=null;return(...s)=>{window.clearTimeout(i),i=window.setTimeout((()=>{t.apply(null,s)}),e)}}_checkValidity(){this.submitButton&&(this.invalidFields=this._requiredElements.filter((([t,e])=>e?!t.isValid:!t.checkValidity())),this.isFormValid=0===this.invalidFields.length,this.skipSubmit||(this.submitButton.disabled=!this.isFormValid),this.isFormValid?this.dispatchEvent(new CustomEvent("valid",{bubbles:!0,composed:!0})):this.dispatchEvent(new CustomEvent("invalid",{bubbles:!0,composed:!0})))}handleKeydown(t){if("Enter"===t.key&&t.target.tagName.includes("INPUT"))if(this.invalidFields.length)for(let[e,i]of this._requiredElements){if(i?!e.isValid:!e.checkValidity()){(e?.shadowRoot?.lastElementChild||e).animate([{transform:"translateX(-1rem)"},{transform:"translateX(1rem)"},{transform:"translateX(-0.5rem)"},{transform:"translateX(0.5rem)"},{transform:"translateX(0)"}],{duration:300,easing:"ease"}),i?e.focusIn():e.focus();break}}else this.submitButton&&this.submitButton.click(),this.dispatchEvent(new CustomEvent("submit",{bubbles:!0,composed:!0}))}reset(){this.formElements.forEach((([t,e])=>{e?t.reset():t.value=""}))}elementsChanged(){this.formElements=[...this.querySelectorAll("input, sm-input, sm-textarea, sm-checkbox, tags-input, file-input, sm-switch, sm-radio")].map((t=>[t,t.tagName.includes("-")])),this._requiredElements=this.formElements.filter((([t])=>t.hasAttribute("required"))),this.submitButton=this.querySelector('[variant="primary"], [type="submit"]'),this.resetButton=this.querySelector('[type="reset"]'),this.resetButton&&this.resetButton.addEventListener("click",this.reset),this._checkValidity()}connectedCallback(){let t=this.debounce(this.elementsChanged,100);this.shadowRoot.querySelector("slot").addEventListener("slotchange",t),this.addEventListener("input",this.debounce(this._checkValidity,100)),this.addEventListener("keydown",this.debounce(this.handleKeydown,100)),this.mutationObserver=new MutationObserver((e=>{e.forEach((e=>{("childList"===e.type&&[...e.addedNodes].some((t=>this.supportedElements.has(t.tagName)))||[...e.removedNodes].some((t=>this.supportedElements.has(t.tagName))))&&t()}))})),this.mutationObserver.observe(this,{childList:!0,subtree:!0})}attributeChangedCallback(t,e,i){"skip-submit"===t&&(this.skipSubmit=null!==i)}disconnectedCallback(){this.removeEventListener("input",this.debounce(this._checkValidity,100)),this.removeEventListener("keydown",this.debounce(this.handleKeydown,100)),this.mutationObserver.disconnect()}});const smInput=document.createElement("template");smInput.innerHTML=' ',customElements.define("sm-input",class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}).append(smInput.content.cloneNode(!0)),this.inputParent=this.shadowRoot.querySelector(".input"),this.input=this.shadowRoot.querySelector("input"),this.clearBtn=this.shadowRoot.querySelector(".clear"),this.label=this.shadowRoot.querySelector(".label"),this.feedbackText=this.shadowRoot.querySelector(".feedback-text"),this.outerContainer=this.shadowRoot.querySelector(".outer-container"),this.optionList=this.shadowRoot.querySelector(".datalist"),this._helperText="",this._errorText="",this.isRequired=!1,this.datalist=[],this.validationFunction=void 0,this.reflectedAttributes=["value","required","disabled","type","inputmode","readonly","min","max","pattern","minlength","maxlength","step","list","autocomplete"],this.reset=this.reset.bind(this),this.clear=this.clear.bind(this),this.focusIn=this.focusIn.bind(this),this.focusOut=this.focusOut.bind(this),this.fireEvent=this.fireEvent.bind(this),this.checkInput=this.checkInput.bind(this),this.allowOnlyNum=this.allowOnlyNum.bind(this),this.handleOptionClick=this.handleOptionClick.bind(this),this.handleInputNavigation=this.handleInputNavigation.bind(this),this.handleDatalistNavigation=this.handleDatalistNavigation.bind(this),this.handleFocus=this.handleFocus.bind(this),this.handleBlur=this.handleBlur.bind(this)}static get observedAttributes(){return["value","placeholder","required","disabled","type","inputmode","readonly","min","max","pattern","minlength","maxlength","step","helper-text","error-text","list"]}get value(){return this.input.value}set value(t){t!==this.input.value&&(this.input.value=t,this.checkInput())}get placeholder(){return this.getAttribute("placeholder")}set placeholder(t){this.setAttribute("placeholder",t)}get type(){return this.getAttribute("type")}set type(t){this.setAttribute("type",t)}get validity(){return this.input.validity}get disabled(){return this.hasAttribute("disabled")}set disabled(t){t?this.inputParent.classList.add("disabled"):this.inputParent.classList.remove("disabled")}get readOnly(){return this.hasAttribute("readonly")}set readOnly(t){t?this.setAttribute("readonly",""):this.removeAttribute("readonly")}set customValidation(t){this.validationFunction=t}set errorText(t){this._errorText=t}set helperText(t){this._helperText=t}get isValid(){if(""!==this.input.value){const t=this.input.checkValidity();let e=!0;return this.validationFunction&&(e=Boolean(this.validationFunction(this.input.value))),t&&e?(this.feedbackText.classList.remove("error"),this.feedbackText.classList.add("success"),this.feedbackText.textContent=""):this._errorText&&(this.feedbackText.classList.add("error"),this.feedbackText.classList.remove("success"),this.feedbackText.innerHTML=` ${this._errorText}`),t&&e}}reset(){this.value=""}clear(){this.value="",this.input.focus(),this.fireEvent()}focusIn(){this.input.focus()}focusOut(){this.input.blur()}fireEvent(){let t=new Event("input",{bubbles:!0,cancelable:!0,composed:!0});this.dispatchEvent(t)}searchDatalist(t){const e=this.datalist.filter((e=>e.toLowerCase().includes(t.toLowerCase())));if(e.sort(((e,n)=>e.toLowerCase().indexOf(t.toLowerCase())-n.toLowerCase().indexOf(t.toLowerCase()))),e.length){if(this.optionList.children.length>e.length){const t=this.optionList.children.length-e.length;for(let e=0;e{if(this.optionList.children[e])this.optionList.children[e].textContent=t;else{const e=document.createElement("li");e.textContent=t,e.classList.add("datalist-item"),e.setAttribute("tabindex","0"),this.optionList.appendChild(e)}})),this.optionList.classList.remove("hidden")}else this.optionList.classList.add("hidden")}checkInput(t){this.hasAttribute("readonly")||(""!==this.input.value?this.clearBtn.classList.remove("hidden"):this.clearBtn.classList.add("hidden")),this.hasAttribute("placeholder")&&""!==this.getAttribute("placeholder").trim()&&(""!==this.input.value?(this.animate?this.inputParent.classList.add("animate-placeholder"):this.label.classList.add("hidden"),this.datalist.length&&(this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout((()=>{this.searchDatalist(this.input.value.trim())}),100))):(this.animate?this.inputParent.classList.remove("animate-placeholder"):this.label.classList.remove("hidden"),this.feedbackText.textContent="",this.datalist.length&&(this.optionList.innerHTML="",this.optionList.classList.add("hidden"))))}allowOnlyNum(t){1===t.key.length&&(("."!==t.key||!t.target.value.includes(".")&&0!==t.target.value.length)&&["0","1","2","3","4","5","6","7","8","9","."].includes(t.key)||t.preventDefault())}handleOptionClick(t){this.input.value=t.target.textContent,this.optionList.classList.add("hidden"),this.input.focus()}handleInputNavigation(t){"ArrowDown"===t.key?(t.preventDefault(),this.optionList.children.length&&this.optionList.children[0].focus()):"ArrowUp"===t.key&&(t.preventDefault(),this.optionList.children.length&&this.optionList.children[this.optionList.children.length-1].focus())}handleDatalistNavigation(t){"ArrowUp"===t.key?(t.preventDefault(),this.shadowRoot.activeElement.previousElementSibling?this.shadowRoot.activeElement.previousElementSibling.focus():this.input.focus()):"ArrowDown"===t.key?(t.preventDefault(),this.shadowRoot.activeElement.nextElementSibling?this.shadowRoot.activeElement.nextElementSibling.focus():this.input.focus()):"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),this.input.value=t.target.textContent,this.optionList.classList.add("hidden"),this.input.focus())}handleFocus(t){this.datalist.length&&this.searchDatalist(this.input.value.trim())}handleBlur(t){this.datalist.length&&this.optionList.classList.add("hidden")}connectedCallback(){this.animate=this.hasAttribute("animate"),this.setAttribute("role","textbox"),this.input.addEventListener("input",this.checkInput),this.clearBtn.addEventListener("click",this.clear),this.datalist.length&&(this.optionList.addEventListener("click",this.handleOptionClick),this.input.addEventListener("keydown",this.handleInputNavigation),this.optionList.addEventListener("keydown",this.handleDatalistNavigation)),this.input.addEventListener("focusin",this.handleFocus),this.addEventListener("focusout",this.handleBlur)}attributeChangedCallback(t,e,n){e!==n&&(this.reflectedAttributes.includes(t)&&(this.hasAttribute(t)?this.input.setAttribute(t,this.getAttribute(t)?this.getAttribute(t):""):this.input.removeAttribute(t)),"placeholder"===t?(this.label.textContent=n,this.setAttribute("aria-label",n)):this.hasAttribute("value")?this.checkInput():"type"===t?this.hasAttribute("type")&&"number"===this.getAttribute("type")?(this.input.setAttribute("inputmode","decimal"),this.input.addEventListener("keydown",this.allowOnlyNum)):this.input.removeEventListener("keydown",this.allowOnlyNum):"helper-text"===t?this._helperText=this.getAttribute("helper-text"):"error-text"===t?this._errorText=this.getAttribute("error-text"):"required"===t?(this.isRequired=this.hasAttribute("required"),this.isRequired?this.setAttribute("aria-required","true"):this.setAttribute("aria-required","false")):"readonly"===t?this.hasAttribute("readonly")?this.inputParent.classList.add("readonly"):this.inputParent.classList.remove("readonly"):"disabled"===t?this.hasAttribute("disabled")?this.inputParent.classList.add("disabled"):this.inputParent.classList.remove("disabled"):"list"===t&&this.hasAttribute("list")&&""!==this.getAttribute("list").trim()&&(this.datalist=this.getAttribute("list").split(",")))}disconnectedCallback(){this.input.removeEventListener("input",this.checkInput),this.clearBtn.removeEventListener("click",this.clear),this.input.removeEventListener("keydown",this.allowOnlyNum),this.optionList.removeEventListener("click",this.handleOptionClick),this.input.removeEventListener("keydown",this.handleInputNavigation),this.optionList.removeEventListener("keydown",this.handleDatalistNavigation),this.input.removeEventListener("focusin",this.handleFocus),this.removeEventListener("focusout",this.handleBlur)}});const smNotifications=document.createElement("template");smNotifications.innerHTML=' ',customElements.define("sm-notifications",class extends HTMLElement{constructor(){super(),this.shadow=this.attachShadow({mode:"open"}).append(smNotifications.content.cloneNode(!0)),this.notificationPanel=this.shadowRoot.querySelector(".notification-panel"),this.animationOptions={duration:300,fill:"forwards",easing:"cubic-bezier(0.175, 0.885, 0.32, 1.275)"},this.push=this.push.bind(this),this.createNotification=this.createNotification.bind(this),this.removeNotification=this.removeNotification.bind(this),this.clearAll=this.clearAll.bind(this),this.remove=this.remove.bind(this),this.handlePointerMove=this.handlePointerMove.bind(this),this.startX=0,this.currentX=0,this.endX=0,this.swipeDistance=0,this.swipeDirection="",this.swipeThreshold=0,this.startTime=0,this.swipeTime=0,this.swipeTimeThreshold=200,this.currentTarget=null,this.mediaQuery=window.matchMedia("(min-width: 640px)"),this.handleOrientationChange=this.handleOrientationChange.bind(this),this.isLandscape=!1}randString(n){let t="";const i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";for(let e=0;e${e} `,o&&(a+=` `),i&&(r.classList.add("pinned"),a+=' '),r.innerHTML=a,r}push(n,t={}){const i=this.createNotification(n,t);return this.isLandscape?this.notificationPanel.append(i):this.notificationPanel.prepend(i),this.notificationPanel.animate([{transform:`translateY(${this.isLandscape?"":"-"}${i.clientHeight}px)`},{transform:"none"}],this.animationOptions),i.animate([{transform:"translateY(-1rem)",opacity:"0"},{transform:"none",opacity:"1"}],this.animationOptions).onfinish=n=>{n.target.commitStyles(),n.target.cancel()},i.querySelector(".action")&&i.querySelector(".action").addEventListener("click",t.action.callback),i.id}removeNotification(n,t="left"){if(!n)return;const i="left"===t?"-":"+";n.animate([{transform:this.currentX?`translateX(${this.currentX}px)`:"none",opacity:"1"},{transform:`translateX(calc(${i}${Math.abs(this.currentX)}px ${i} 1rem))`,opacity:"0"}],this.animationOptions).onfinish=()=>{n.remove()}}remove(n){const t=this.notificationPanel.querySelector(`#${n}`);t&&this.removeNotification(t)}clearAll(){Array.from(this.notificationPanel.children).forEach((n=>{this.removeNotification(n)}))}handlePointerMove(n){this.currentX=n.clientX-this.startX,this.currentTarget.style.transform=`translateX(${this.currentX}px)`}handleOrientationChange(n){this.isLandscape=n.matches,n.matches}connectedCallback(){this.handleOrientationChange(this.mediaQuery),this.mediaQuery.addEventListener("change",this.handleOrientationChange),this.notificationPanel.addEventListener("pointerdown",(n=>{n.target.closest(".close")?this.removeNotification(n.target.closest(".notification")):n.target.closest(".notification")&&(this.swipeThreshold=n.target.closest(".notification").getBoundingClientRect().width/2,this.currentTarget=n.target.closest(".notification"),this.currentTarget.setPointerCapture(n.pointerId),this.startTime=Date.now(),this.startX=n.clientX,this.startY=n.clientY,this.notificationPanel.addEventListener("pointermove",this.handlePointerMove))})),this.notificationPanel.addEventListener("pointerup",(n=>{this.endX=n.clientX,this.endY=n.clientY,this.swipeDistance=Math.abs(this.endX-this.startX),this.swipeTime=Date.now()-this.startTime,this.endX>this.startX?this.swipeDirection="right":this.swipeDirection="left",this.swipeTime50&&this.removeNotification(this.currentTarget,this.swipeDirection):this.swipeDistance>this.swipeThreshold?this.removeNotification(this.currentTarget,this.swipeDirection):this.currentTarget.animate([{transform:`translateX(${this.currentX}px)`},{transform:"none"}],this.animationOptions).onfinish=n=>{n.target.commitStyles(),n.target.cancel()},this.notificationPanel.removeEventListener("pointermove",this.handlePointerMove),this.notificationPanel.releasePointerCapture(n.pointerId),this.currentX=0}));new MutationObserver((n=>{n.forEach((n=>{"childList"===n.type&&n.addedNodes.length&&!n.addedNodes[0].classList.contains("pinned")&&setTimeout((()=>{this.removeNotification(n.addedNodes[0])}),5e3)}))})).observe(this.notificationPanel,{childList:!0})}disconnectedCallback(){mediaQueryList.removeEventListener("change",handleOrientationChange)}});class Stack{constructor(){this.items=[]}push(t){this.items.push(t)}pop(){return 0==this.items.length?"Underflow":this.items.pop()}peek(){return this.items[this.items.length-1]}}const popupStack=new Stack,smPopup=document.createElement("template");smPopup.innerHTML=' ',customElements.define("sm-popup",class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}).append(smPopup.content.cloneNode(!0)),this.allowClosing=!1,this.isOpen=!1,this.offset=0,this.touchStartY=0,this.touchEndY=0,this.touchStartTime=0,this.touchEndTime=0,this.touchEndAnimation=void 0,this.focusable,this.autoFocus,this.mutationObserver,this.popupContainer=this.shadowRoot.querySelector(".popup-container"),this.backdrop=this.shadowRoot.querySelector(".backdrop"),this.dialogBox=this.shadowRoot.querySelector(".popup"),this.popupBodySlot=this.shadowRoot.querySelector(".popup-body slot"),this.popupHeader=this.shadowRoot.querySelector(".popup-top"),this.resumeScrolling=this.resumeScrolling.bind(this),this.setStateOpen=this.setStateOpen.bind(this),this.show=this.show.bind(this),this.hide=this.hide.bind(this),this.handleTouchStart=this.handleTouchStart.bind(this),this.handleTouchMove=this.handleTouchMove.bind(this),this.handleTouchEnd=this.handleTouchEnd.bind(this),this.detectFocus=this.detectFocus.bind(this),this.handleSoftDismiss=this.handleSoftDismiss.bind(this)}static get observedAttributes(){return["open"]}get open(){return this.isOpen}animateTo(t,e,i){let s=t.animate(e,{...i,fill:"both"});return s.finished.then((()=>{s.commitStyles(),s.cancel()})),s}resumeScrolling(){let t=document.body.style.top;window.scrollTo(0,-1*parseInt(t||"0")),document.body.style.overflow="",document.body.style.top="initial"}setStateOpen(){if(!this.isOpen||this.offset){let t=window.innerWidth>640?"scale(1.1)":`translateY(${this.offset?`${this.offset}px`:"100%"})`;this.animateTo(this.dialogBox,[{opacity:this.offset?1:0,transform:t},{opacity:1,transform:"none"}],{duration:300,easing:"ease"})}}show(t={}){let{pinned:e=!1,payload:i}=t;if(this.isOpen)return;let s={duration:300,easing:"ease"};return this.payload=i,popupStack.push({popup:this,permission:e}),popupStack.items.length>1&&this.animateTo(popupStack.items[popupStack.items.length-2].popup.shadowRoot.querySelector(".popup"),[{transform:"none"},{transform:window.innerWidth>640?"scale(0.95)":"translateY(-1.5rem)"}],s),this.popupContainer.classList.remove("hide"),this.offset||(this.backdrop.animate([{opacity:0},{opacity:1}],s).onfinish=()=>{this.resolveOpen(this.payload)},this.dispatchEvent(new CustomEvent("popupopened",{bubbles:!0,composed:!0,detail:{payload:this.payload}})),document.body.style.overflow="hidden",document.body.style.top=`-${window.scrollY}px`),this.setStateOpen(),this.pinned=e,this.isOpen=!0,setTimeout((()=>{let t=this.autoFocus||this.focusable?.[0]||this.dialogBox;t&&(t.tagName.includes("-")?t.focusIn():t.focus())}),0),this.hasAttribute("open")||(this.setAttribute("open",""),this.addEventListener("keydown",this.detectFocus),this.resizeObserver.observe(this),this.mutationObserver.observe(this,{attributes:!0,childList:!0,subtree:!0}),this.popupHeader.addEventListener("touchstart",this.handleTouchStart,{passive:!0}),this.backdrop.addEventListener("mousedown",this.handleSoftDismiss)),{opened:new Promise((t=>{this.resolveOpen=t})),closed:new Promise((t=>{this.resolveClose=t}))}}hide(t={}){let{payload:e}=t,i={duration:150,easing:"ease"};this.backdrop.animate([{opacity:1},{opacity:0}],i),this.animateTo(this.dialogBox,[{opacity:1,transform:window.innerWidth>640?"none":`translateY(${this.offset?`${this.offset}px`:"0"})`},{opacity:0,transform:window.innerWidth>640?"scale(1.1)":"translateY(100%)"}],i).finished.finally((()=>{this.popupContainer.classList.add("hide"),this.dialogBox.style="",this.removeAttribute("open"),this.forms.length&&this.forms.forEach((t=>t.reset())),this.dispatchEvent(new CustomEvent("popupclosed",{bubbles:!0,composed:!0,detail:{payload:e||this.payload}})),this.resolveClose(e||this.payload),this.isOpen=!1})),popupStack.pop(),popupStack.items.length?this.animateTo(popupStack.items[popupStack.items.length-1].popup.shadowRoot.querySelector(".popup"),[{transform:window.innerWidth>640?"scale(0.95)":"translateY(-1.5rem)"},{transform:"none"}],i):this.resumeScrolling(),this.resizeObserver.disconnect(),this.mutationObserver.disconnect(),this.removeEventListener("keydown",this.detectFocus),this.popupHeader.removeEventListener("touchstart",this.handleTouchStart,{passive:!0}),this.backdrop.removeEventListener("mousedown",this.handleSoftDismiss)}handleTouchStart(t){this.offset=0,this.popupHeader.addEventListener("touchmove",this.handleTouchMove,{passive:!0}),this.popupHeader.addEventListener("touchend",this.handleTouchEnd,{passive:!0}),this.touchStartY=t.changedTouches[0].clientY,this.touchStartTime=t.timeStamp}handleTouchMove(t){this.touchStartY{this.dialogBox.style.transform=`translateY(${this.offset}px)`})))}handleTouchEnd(t){if(this.touchEndTime=t.timeStamp,cancelAnimationFrame(this.touchEndAnimation),this.touchEndY=t.changedTouches[0].clientY,this.threshold=.3*this.dialogBox.getBoundingClientRect().height,this.touchEndTime-this.touchStartTime>200)if(this.touchEndY-this.touchStartY>this.threshold){if(this.pinned)return void this.setStateOpen();this.hide()}else this.setStateOpen();else if(this.touchEndY>this.touchStartY){if(this.pinned)return void this.setStateOpen();this.hide()}this.popupHeader.removeEventListener("touchmove",this.handleTouchMove,{passive:!0}),this.popupHeader.removeEventListener("touchend",this.handleTouchEnd,{passive:!0})}detectFocus(t){if("Tab"===t.key){let e=this.focusable[this.focusable.length-1],i=this.focusable[0];t.shiftKey&&document.activeElement===i?(t.preventDefault(),e.tagName.includes("SM-")?e.focusIn():e.focus()):t.shiftKey||document.activeElement!==e||(t.preventDefault(),i.tagName.includes("SM-")?i.focusIn():i.focus())}}updateFocusableList(){this.focusable=this.querySelectorAll('sm-button:not([disabled]), button:not([disabled]), [href], sm-input, input:not([readonly]), sm-select, select, sm-checkbox, sm-textarea, textarea, [tabindex]:not([tabindex="-1"])'),this.autoFocus=this.querySelector("[autofocus]")}handleSoftDismiss(){this.pinned?this.dialogBox.animate([{transform:"translateX(-1rem)"},{transform:"translateX(1rem)"},{transform:"translateX(-0.5rem)"},{transform:"translateX(0.5rem)"},{transform:"translateX(0)"}],{duration:300,easing:"ease"}):this.hide()}debounce(t,e){let i=null;return(...s)=>{window.clearTimeout(i),i=window.setTimeout((()=>{t.apply(null,s)}),e)}}connectedCallback(){this.popupBodySlot.addEventListener("slotchange",this.debounce((()=>{this.forms=this.querySelectorAll("sm-form"),this.updateFocusableList()}),0)),this.resizeObserver=new ResizeObserver((t=>{for(let e of t)if(e.contentBoxSize){let i=Array.isArray(e.contentBoxSize)?e.contentBoxSize[0]:e.contentBoxSize;this.threshold=.3*i.blockSize.height}else this.threshold=.3*e.contentRect.height})),this.mutationObserver=new MutationObserver((t=>{this.updateFocusableList()}))}disconnectedCallback(){this.resizeObserver.disconnect(),this.mutationObserver.disconnect(),this.removeEventListener("keydown",this.detectFocus),this.popupHeader.removeEventListener("touchstart",this.handleTouchStart,{passive:!0}),this.backdrop.removeEventListener("mousedown",this.handleSoftDismiss)}attributeChangedCallback(t){"open"===t&&this.hasAttribute("open")&&this.show()}});const spinner=document.createElement("template");spinner.innerHTML='';class SpinnerLoader extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}).append(spinner.content.cloneNode(!0))}}window.customElements.define("sm-spinner",SpinnerLoader);const themeToggle=document.createElement("template");themeToggle.innerHTML=' ';class ThemeToggle extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}).append(themeToggle.content.cloneNode(!0)),this.isChecked=!1,this.hasTheme="light",this.toggleState=this.toggleState.bind(this),this.fireEvent=this.fireEvent.bind(this),this.handleThemeChange=this.handleThemeChange.bind(this)}static get observedAttributes(){return["checked"]}daylight(){this.hasTheme="light",document.body.dataset.theme="light",this.setAttribute("aria-checked","false")}nightlight(){this.hasTheme="dark",document.body.dataset.theme="dark",this.setAttribute("aria-checked","true")}toggleState(){if(!document.startViewTransition)return this.toggleAttribute("checked"),void this.fireEvent();document.startViewTransition((()=>{this.toggleAttribute("checked"),this.fireEvent()}))}handleKeyDown(e){" "===e.key&&this.toggleState()}handleThemeChange(e){e.detail.theme!==this.hasTheme&&("dark"===e.detail.theme?this.setAttribute("checked",""):this.removeAttribute("checked"))}fireEvent(){this.dispatchEvent(new CustomEvent("themechange",{bubbles:!0,composed:!0,detail:{theme:this.hasTheme}}))}connectedCallback(){this.setAttribute("role","switch"),this.setAttribute("aria-label","theme toggle"),"dark"===localStorage.getItem(`${window.location.hostname}-theme`)?(this.nightlight(),this.setAttribute("checked","")):"light"===localStorage.getItem(`${window.location.hostname}-theme`)?(this.daylight(),this.removeAttribute("checked")):window.matchMedia("(prefers-color-scheme: dark)").matches?(this.nightlight(),this.setAttribute("checked","")):(this.daylight(),this.removeAttribute("checked")),this.addEventListener("click",this.toggleState),this.addEventListener("keydown",this.handleKeyDown),document.addEventListener("themechange",this.handleThemeChange)}disconnectedCallback(){this.removeEventListener("click",this.toggleState),this.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("themechange",this.handleThemeChange)}attributeChangedCallback(e,t,n){"checked"===e&&(this.hasAttribute("checked")?(this.nightlight(),localStorage.setItem(`${window.location.hostname}-theme`,"dark")):(this.daylight(),localStorage.setItem(`${window.location.hostname}-theme`,"light")))}}window.customElements.define("theme-toggle",ThemeToggle);const slideButton=document.createElement("template");slideButton.innerHTML='\n \n \n';class SlideButton extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}).append(slideButton.content.cloneNode(!0)),this.handleTouchStart=this.handleTouchStart.bind(this),this.handleTouchMove=this.handleTouchMove.bind(this),this.handleTouchEnd=this.handleTouchEnd.bind(this),this.reset=this.reset.bind(this),this.fireEvent=this.fireEvent.bind(this),this.thumb=this.shadowRoot.querySelector(".slide-thumb"),this.startX=0,this.threshold=0,this.bound=0}get disabled(){return this.hasAttribute("disabled")}set disabled(value){value?this.setAttribute("disabled",""):this.removeAttribute("disabled")}reset(){this.thumb.setAttribute("style","transform: translateX(0)")}fireEvent(){this.dispatchEvent(new CustomEvent("confirmed",{bubbles:!0,composed:!0}))}handleTouchStart(e){this.thumb.classList.remove("transition");const thumbDimensions=this.thumb.getBoundingClientRect(),buttonDimensions=this.getBoundingClientRect();this.bound=buttonDimensions.width-thumbDimensions.width,this.startX=e.clientX,this.threshold=this.bound/2,this.thumb.setPointerCapture(e.pointerId),this.thumb.addEventListener("pointermove",this.handleTouchMove),this.thumb.addEventListener("pointerup",this.handleTouchEnd)}handleTouchMove(e){requestAnimationFrame((()=>{this.thumb.setAttribute("style",`transform: translateX(${Math.max(0,Math.min(this.bound,e.clientX-this.startX))}px)`)}))}handleTouchEnd(e){this.thumb.classList.add("transition"),e.clientX>this.threshold?(this.fireEvent(),this.thumb.setAttribute("style",`transform: translateX(${this.bound}px)`)):this.reset(),this.thumb.releasePointerCapture(e.pointerId),this.thumb.removeEventListener("pointermove",this.handleTouchMove),this.thumb.removeEventListener("pointerup",this.handleTouchEnd)}connectedCallback(){this.thumb.addEventListener("pointerdown",this.handleTouchStart)}disconnectedCallback(){this.thumb.removeEventListener("pointerdown",this.handleTouchStart)}}window.customElements.define("slide-button",SlideButton);const lineLoader=document.createElement("template");lineLoader.innerHTML='\n\n\n';class LineLoader extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}).append(lineLoader.content.cloneNode(!0))}}window.customElements.define("line-loader",LineLoader);
\ No newline at end of file
diff --git a/exchangemarket/docs/scripts/floBlockchainAPI.js b/exchangemarket/docs/scripts/floBlockchainAPI.js
index 00cc8d3..4cc37ac 100644
--- a/exchangemarket/docs/scripts/floBlockchainAPI.js
+++ b/exchangemarket/docs/scripts/floBlockchainAPI.js
@@ -1,4 +1,4 @@
-(function (EXPORTS) { //floBlockchainAPI v3.1.2
+(function (EXPORTS) { //floBlockchainAPI v3.1.3
/* FLO Blockchain Operator to send/receive data from blockchain using API calls via FLO Blockbook*/
'use strict';
const floBlockchainAPI = EXPORTS;
@@ -32,8 +32,8 @@
checkIfTor().then(result => {
isTor = result
if (isTor) {
- DEFAULT.apiURL.FLO.push('http://vl7ni6byqx7rbub5hypxtod5dbfeuhoj5r5exuyl44pspqh2gasjj4qd.onion:9166/')
- DEFAULT.apiURL.FLO_TEST.push('http://omwkzk6bd6zuragdqsrhdyzgxzre7yx4vzrou4vzftintzc2dmagp6qd.onion:15017/')
+ DEFAULT.apiURL.FLO.push('http://kvrddx6heo47rbbt77etxg6litckacbgos3nv5z7vc23ol2kjjeq72id.onion/')
+ // DEFAULT.apiURL.FLO_TEST.push('http://omwkzk6bd6zuragdqsrhdyzgxzre7yx4vzrou4vzftintzc2dmagp6qd.onion:15017/')
}
});
diff --git a/exchangemarket/docs/scripts/floBlockchainAPI.min.js b/exchangemarket/docs/scripts/floBlockchainAPI.min.js
index de18684..fc5674b 100644
--- a/exchangemarket/docs/scripts/floBlockchainAPI.min.js
+++ b/exchangemarket/docs/scripts/floBlockchainAPI.min.js
@@ -1 +1 @@
-!function(EXPORTS){"use strict";const floBlockchainAPI="object"===typeof module?module.exports:window.floBlockchainAPI={},DEFAULT={blockchain:floGlobals.blockchain,apiURL:{FLO:["https://blockbook.ranchimall.net/"],FLO_TEST:["https://blockbook-testnet.ranchimall.net/"]},sendAmt:3e-4,fee:2e-4,minChangeAmt:2e-4,receiverID:floGlobals.adminID},isUndefined=val=>void 0===val,torExitNodes=new Set(["185.241.208.232","194.26.192.64","171.25.193.25","80.67.167.81","192.42.116.187","198.98.51.189","89.58.26.216","109.70.100.4","149.56.22.133","5.45.102.93","178.17.174.14","192.42.116.196","185.220.101.4","45.141.215.62","94.102.51.15","192.42.116.213","107.189.28.166","185.241.208.243","45.141.215.80","193.26.115.61","192.42.116.175","149.56.44.47","107.189.13.91","87.118.116.103","178.17.171.102","185.243.218.110","192.42.116.208","89.58.41.156","2.58.56.43","104.192.1.138","45.95.169.184","107.189.8.56","176.58.121.177","185.220.101.31","45.141.215.200","109.70.100.1","185.244.192.175","185.129.61.2","144.172.118.41","192.42.116.184","45.151.167.10","185.220.101.27","91.203.144.194","45.141.215.88","179.43.182.232","185.220.101.5","109.70.100.2","107.189.14.4","94.16.116.81","185.220.101.8","185.220.101.12","88.80.20.86","23.154.177.15","45.141.215.56","5.42.66.6","23.129.64.225","104.244.75.74","45.95.169.228","37.187.5.192","45.141.215.169","109.70.100.66","45.79.144.222","185.227.68.78","179.43.159.199","2.57.122.246","192.42.116.201","185.220.102.248","195.176.3.23","45.138.16.42","216.73.159.75","185.165.169.239","23.129.64.213","109.70.100.6","45.80.158.27","45.138.16.240","178.20.55.16","192.42.116.173","51.15.249.160","192.42.116.200","185.220.102.254","45.141.215.63","193.218.118.151","192.42.116.211","185.100.85.24","185.195.71.12","107.189.8.181","193.189.100.199","109.70.100.69","185.100.87.250","31.220.93.201","89.236.112.100","45.141.215.90","185.35.202.222","109.70.100.65","95.142.161.63","192.42.116.181","192.42.116.23","194.26.192.77","193.189.100.198","180.150.226.99","23.129.64.227","107.189.4.23","45.141.215.235","185.220.102.252","109.70.100.67","185.220.100.255","185.220.101.21","185.100.85.22","128.31.0.13","46.182.21.248","192.42.116.174","185.241.208.115","185.220.101.1","192.42.116.202","45.141.215.97","185.243.218.204","78.142.18.219","192.42.116.192","190.120.229.98","192.42.116.177","45.138.16.113","192.42.116.212","185.220.101.3","45.138.16.222","5.42.80.232","87.118.122.51","107.189.11.166","185.220.102.245","185.220.102.251","46.182.21.250","5.255.103.235","185.243.218.89","185.193.52.180","185.220.101.24","2.57.122.215","45.15.157.177","185.220.100.253","37.48.120.64","204.8.156.142","192.42.116.179","185.220.100.240","185.241.208.236","185.195.71.244","193.105.134.155","51.15.59.15","185.100.85.23","45.151.167.11","82.197.182.161","192.42.116.191","27.255.75.198","171.25.193.79","45.95.169.255","45.138.16.230","107.189.29.103","163.172.213.212","95.143.193.125","23.154.177.7","185.220.101.23","195.176.3.24","107.189.1.9","192.42.116.182","23.137.249.240","192.42.116.189","23.129.64.146","45.138.16.107","107.189.5.121","107.189.30.236","94.16.121.91","109.70.100.70","185.254.196.141","194.15.112.133","192.42.116.180","173.249.57.253","185.220.102.250","185.100.85.25","185.220.101.13","185.220.101.25","192.42.116.199","23.154.177.2","107.189.31.232","45.141.215.81","192.42.116.220","185.67.82.114","45.141.215.114","185.243.218.61","107.189.13.184","107.189.10.141","104.244.79.61","185.106.94.195","176.126.253.190","23.154.177.22","192.42.116.210","185.220.102.249","23.184.48.127","192.42.116.218","91.208.75.4","192.42.116.178","178.175.148.209","208.109.36.224","23.137.251.61","94.142.241.194","162.251.5.152","23.154.177.4","45.138.16.76","45.9.150.103","213.252.140.118","185.243.218.95","45.134.225.36","109.70.100.5","185.243.218.202","185.220.101.19","192.42.116.176","109.70.100.71","45.151.167.13","185.220.102.4","185.220.102.7","104.244.79.50","178.17.174.198","199.195.249.214","66.146.193.33","107.189.8.238","139.99.8.57","45.141.215.95","192.42.116.219","114.199.75.111","185.220.100.242","5.42.80.234","173.237.206.68","139.99.172.11","23.129.64.143","80.241.60.207","192.42.116.194","45.95.169.226","185.220.102.8","109.70.100.3","179.43.159.200","192.42.116.217","185.220.101.6","198.98.50.199","185.100.87.192","193.189.100.202","163.172.45.102","185.220.101.0","107.189.8.133","185.129.61.6","104.244.78.233","192.42.116.15","192.42.116.195","45.141.215.110","193.189.100.203","77.48.28.237","104.244.79.232","193.26.115.43","199.195.250.165","190.211.254.97","45.141.215.61","185.220.101.17","192.42.116.203","185.220.102.247","91.132.144.59","185.141.147.129","23.129.64.149","185.183.157.214","95.211.244.28","192.42.116.188","188.214.104.21","192.42.116.186","192.42.116.197","107.189.13.247","212.73.134.204","185.235.146.29","188.68.49.235","92.205.237.227","23.154.177.12","199.195.253.180","171.25.193.234","185.241.208.71","96.66.15.152","94.16.121.226","204.85.191.9","91.210.59.57","5.255.115.42","185.220.103.113","216.239.90.19","77.91.87.79","192.42.116.216","23.154.177.23","192.42.116.198","173.255.255.215","144.217.80.80","107.189.10.175","45.95.169.227","103.251.167.20","185.220.101.30","5.255.125.196","198.98.48.192","185.220.102.242","23.154.177.18","185.86.148.90","185.142.239.49","185.220.101.2","5.255.100.219","107.189.5.7","199.195.251.119","185.220.101.10","92.246.84.133","66.220.242.222","184.105.48.40","23.129.64.133","185.130.44.108","192.42.116.20","185.181.61.115","192.42.116.19","149.202.79.129","146.59.35.38","23.154.177.20","185.191.204.254","23.154.177.3","185.233.100.23","23.154.177.19","45.92.1.74","107.189.31.225","89.58.18.10","138.59.18.110","185.246.188.73","192.42.116.221","104.244.77.192","192.42.116.214","178.170.37.11","188.68.41.191","192.42.116.183","185.220.103.115","178.175.135.7","209.141.51.30","141.98.11.62","171.25.193.235","23.137.249.143","179.43.159.197","192.99.168.180","185.220.101.11","185.243.218.41","89.234.157.254","47.243.74.136","107.189.28.199","185.129.61.9","185.220.101.28","185.220.101.29","5.255.99.5","179.43.182.58","185.129.61.3","23.129.64.135","107.189.30.69","51.15.227.109","185.207.107.216","185.129.61.129","185.100.87.41","23.129.64.145","179.43.159.201","23.129.64.224","192.42.116.28","93.99.104.194","185.244.192.184","45.95.169.223","104.244.73.43","185.56.83.83","87.120.254.48","185.185.170.27","195.88.74.206","107.174.138.172","109.70.100.68","23.129.64.139","94.230.208.147","77.91.85.147","77.81.247.72","2.58.56.220","185.220.103.7","149.202.79.101","5.255.104.202","178.175.148.195","83.96.213.63","185.100.87.174","79.137.195.103","185.220.101.20","107.189.3.11","185.220.101.22","185.220.101.7","217.12.221.131","179.43.159.196","45.95.169.230","107.189.1.160","208.109.215.188","171.25.193.78","204.194.29.4","104.244.77.80","162.247.72.199","89.58.52.25","192.42.116.209","217.146.2.41","185.220.103.117","23.154.177.10","91.208.75.3","94.230.208.148","95.128.43.164","171.25.193.20","102.130.113.9","91.92.109.43","107.189.7.144","185.220.102.240","5.255.124.150","198.98.60.158","185.227.134.106","193.233.233.221","71.19.144.106","185.84.31.254","23.129.64.132","62.171.137.169","193.189.100.196","185.220.101.18","107.189.12.3","91.208.75.178","193.35.18.49","185.246.188.74","45.132.246.245","209.141.55.26","198.98.48.20","185.129.61.1","108.61.189.136","185.220.102.243","107.189.1.96","185.100.87.136","213.95.149.22","23.129.64.217","192.42.116.185","5.45.104.176","192.42.116.193","23.154.177.16","198.98.49.203","171.25.193.77","91.208.75.153","162.247.74.216","179.43.159.194","54.36.108.162","198.98.48.33","188.68.52.231","185.220.100.252","205.185.124.193","104.244.73.190","185.100.87.139","23.154.177.25","77.105.146.42","79.137.202.92","51.38.81.135","87.118.116.90","23.129.64.134","185.246.188.67","185.129.62.62","185.220.100.241","82.221.131.71","209.141.59.116","194.195.120.132","185.207.107.130","178.218.144.99","172.104.243.155","93.99.104.128","87.118.122.30","185.100.87.253","51.195.91.124","104.192.3.74","185.252.232.218","23.129.64.141","5.196.95.34","185.220.102.6","23.184.48.128","193.239.232.102","185.220.101.16","91.203.145.116","185.129.61.4","23.129.64.147","37.228.129.63","45.151.167.12","93.95.228.205","185.220.102.244","209.141.54.203","93.95.230.165","94.142.244.16","162.247.72.192","185.146.232.234","81.16.33.42","107.189.30.86","51.81.222.62","23.154.177.5","77.220.196.253","72.167.47.69","185.220.101.26","104.219.236.100","192.42.116.204","185.246.128.161","200.122.181.2","199.195.253.247","109.201.133.100","142.44.234.69","89.147.110.202","89.185.85.140","104.244.79.44","5.2.79.179","23.129.64.130","104.244.78.187","23.154.177.13","5.255.97.221","92.205.129.119","80.82.78.14","23.154.177.8","51.38.113.118","45.61.184.205","107.189.31.134","185.220.103.114","179.48.251.188","135.125.205.25","198.98.54.49","193.189.100.205","185.220.102.253","45.79.50.161","202.69.76.36","79.137.198.213","46.166.139.111","5.255.111.64","51.89.138.51","216.73.159.101","166.70.207.2","96.27.198.133","194.15.115.212","46.234.47.105","146.59.35.246","23.137.248.100","185.220.102.241","107.189.14.43","212.95.50.77","128.127.180.156","80.67.172.162","185.129.61.5","185.129.61.10","23.129.64.214","185.220.100.254","160.119.249.240","185.243.218.46","185.220.102.246","104.244.74.97","23.129.64.228","23.129.64.218","185.220.100.243","54.36.101.21","5.255.99.124","107.189.13.253","130.149.80.199","171.25.193.80","144.24.197.112","199.195.251.78","23.129.64.223","195.80.151.30","185.7.33.146","107.189.4.12","45.95.169.229","107.189.6.124","46.38.255.27","107.189.8.226","143.42.199.223","103.251.167.10","185.34.33.2","5.255.98.23","74.82.47.194","194.163.157.49","192.42.116.215","185.220.101.14","194.15.113.118","89.147.108.62","185.220.101.15","185.42.170.203","23.154.177.6","162.247.74.27","199.195.253.124","193.189.100.201","62.182.84.146","191.101.217.24","23.129.64.229","85.93.218.204","178.17.174.164","205.185.117.149","193.218.118.133","23.154.177.21","5.255.101.10","82.221.131.5","193.189.100.204","103.196.37.111","103.109.101.105","192.42.116.18","23.129.64.226","107.189.13.251","45.56.81.190","192.42.116.13","107.189.11.111","198.46.166.157","185.220.103.119","54.38.183.101","77.68.20.217","185.220.101.36","103.236.201.88","162.247.74.213","185.129.61.8","89.147.110.154","45.95.169.225","141.239.149.94","82.221.128.191","72.14.179.10","46.232.251.191","23.129.64.215","162.247.74.7","23.154.177.14","89.147.109.226","193.41.226.117","89.147.108.209","23.129.64.137","93.123.12.112","185.14.97.37","103.163.218.11","23.129.64.131","23.129.64.142","23.137.249.185","89.58.41.251","185.220.101.9","202.182.99.129","205.185.119.35","193.189.100.194","204.85.191.8","185.56.171.94","23.129.64.144","102.130.127.117","192.42.116.24","179.43.159.198","185.38.175.133","185.220.101.39","193.168.143.129","5.255.127.222","95.211.210.103","185.220.103.116","23.129.64.211","23.129.64.220","185.113.128.30","151.80.148.159","192.99.149.111","23.129.64.210","37.228.129.128","91.208.75.239","185.220.103.120","185.165.171.84","193.105.134.150","209.141.46.203","209.141.50.178","104.244.74.23","45.95.169.224","23.129.64.140","176.118.193.33","204.85.191.7","104.244.73.193","162.247.74.204","91.208.75.156","205.185.116.34","125.212.241.131","5.2.72.110","179.43.159.195","185.154.110.142","91.206.26.26","45.79.177.21","23.154.177.9","193.189.100.197","46.165.243.36","107.189.2.108","23.154.177.17","23.129.64.148","5.45.98.162","5.255.101.131","23.129.64.136","107.189.31.33","185.82.219.109","104.244.73.136","185.129.61.7","5.255.115.58","23.154.177.24","165.73.242.163","193.189.100.200","192.46.227.185","5.196.8.113","77.91.86.95","85.209.176.103","23.137.249.8","5.255.98.151","23.129.64.221","23.129.64.219","23.129.64.216","185.243.218.35","104.244.77.208","94.228.169.70","51.75.64.23","176.58.100.98","23.154.177.11","23.129.64.138","143.42.110.237","94.16.112.22","144.172.118.4","185.130.47.58","185.154.110.17","104.244.72.132","5.2.79.190","23.129.64.212","109.169.33.163","5.2.67.226","109.69.67.17","108.181.27.205","5.255.103.190","107.189.14.106","5.255.99.147","193.189.100.206","193.218.118.182","185.181.61.142","23.129.64.222","193.35.18.77","185.100.86.128","91.203.5.118","83.97.20.77","45.138.16.203","2.57.122.58","185.181.61.18","195.176.3.19","195.176.3.20","198.58.107.53","138.128.222.68","118.163.74.160","185.241.208.54","38.97.116.244","104.244.77.79","103.253.24.18","185.225.69.203","162.247.74.206","79.124.8.241","91.203.5.115","144.172.118.102","144.172.118.124","185.225.69.232","163.5.143.76","144.172.118.51","178.20.55.182","109.104.153.22","193.233.133.109","51.158.115.62","92.205.31.137","185.193.158.134","217.12.215.167","45.15.158.39","185.174.136.114","91.219.239.166","91.219.237.56","51.159.211.57","192.210.255.181","185.170.114.25","205.185.123.93","205.185.121.170","107.189.13.180","104.244.78.162","104.244.76.170","104.244.74.57","195.160.220.104","31.220.98.139","158.220.92.203","23.184.48.101","178.31.22.116","79.102.34.63","185.220.103.5","179.43.128.16","45.128.133.242","185.220.103.118","185.100.85.132","107.189.7.48","5.135.174.211","45.8.22.207","185.220.101.159","185.220.101.141","185.220.101.134","185.220.101.147","185.220.101.153","185.220.101.145","185.220.101.158","185.220.101.160","185.220.101.137","185.220.101.140","185.220.101.132","185.220.101.157","185.220.101.150","185.220.101.143","158.69.201.47","107.189.1.175","176.58.89.182","185.220.101.138","82.118.242.158","217.170.201.71","193.189.100.195","144.172.118.48","185.220.101.135","185.220.101.191","185.220.101.136","185.220.101.179","185.220.101.170","185.220.101.149","185.220.101.173","185.220.101.171","185.220.101.161","185.220.101.163","185.220.101.152","185.220.101.162","185.220.101.176","185.220.101.188","185.82.127.128","85.235.145.205","172.81.131.139","5.255.100.26","62.63.244.7","104.219.236.101","23.137.248.139","185.241.208.204","45.141.215.111","185.241.208.202","45.141.215.21","45.61.185.172","185.241.208.206","205.185.113.180","93.242.68.75","185.220.100.248","185.220.100.251","185.220.100.247","185.220.100.245","185.220.100.246","185.220.100.249","185.220.100.250","185.220.100.244","77.72.85.30","51.222.142.67","107.172.31.165","107.174.231.197","198.144.178.163","23.137.250.34","107.172.13.143","107.172.31.146","173.232.195.137","50.3.182.156","173.232.195.144","173.232.195.146","172.81.131.168","172.81.131.84","77.48.28.239","172.81.131.156","185.183.159.40","196.189.30.114","107.189.8.5","185.220.101.168","185.220.101.165","185.220.101.142","185.220.101.167","185.220.101.166","185.220.101.169","77.48.28.193","37.228.129.5","144.172.73.11","107.189.14.57","84.16.224.227","185.220.103.4","162.247.74.202","185.220.103.6","162.247.74.200","185.220.103.9","185.220.103.8","154.12.254.57","94.103.124.184","185.220.101.189","67.219.109.141","185.220.101.187","185.220.101.186","185.220.101.183","50.3.182.133","185.220.101.182","185.220.101.184","188.172.229.15","89.58.18.210","45.9.150.130","190.103.179.98","108.181.124.143","178.218.144.51","185.220.101.66","185.220.101.70","185.220.101.68","185.220.101.77","185.220.101.78","185.220.101.81","185.220.101.71","185.220.101.83","185.220.101.75","185.220.101.85","185.220.101.73","185.220.101.82","185.220.101.65","185.220.101.84","185.220.101.76","185.220.101.86","185.220.101.69","185.220.101.67","185.220.101.80","185.220.101.64","185.220.101.74","185.220.101.79","185.220.101.72","185.220.101.87","199.249.230.120","184.75.221.171","5.182.86.212","104.244.72.115","198.23.133.132","23.94.36.142","198.98.60.90","84.19.182.20","45.9.148.219","217.160.88.146","104.219.232.126","45.139.122.241","199.195.253.156","75.119.142.240","199.249.230.103","199.249.230.104","199.249.230.116","199.249.230.101","199.249.230.119","199.249.230.100","199.249.230.102","199.249.230.109","199.249.230.81","199.249.230.176","199.249.230.79","199.249.230.167","199.249.230.88","199.249.230.188","199.249.230.80","199.249.230.144","199.249.230.78","199.249.230.111","199.249.230.68","199.249.230.180","199.249.230.150","199.249.230.70","199.249.230.77","199.249.230.112","199.249.230.65","199.249.230.183","199.249.230.189","199.249.230.178","199.249.230.145","199.249.230.115","199.249.230.147","199.249.230.66","199.249.230.140","199.249.230.114","199.249.230.170","199.249.230.71","199.249.230.148","199.249.230.67","199.249.230.75","199.249.230.146","199.249.230.151","199.249.230.187","199.249.230.174","199.249.230.143","199.249.230.118","199.249.230.64","199.249.230.85","199.249.230.113","199.249.230.155","199.249.230.153","199.249.230.89","45.77.67.251","123.253.35.32","45.83.104.137","94.32.66.15","185.220.101.181","185.220.101.178","185.220.101.177","185.220.101.175","185.220.101.172","94.16.116.86","5.181.80.107","198.50.207.20","107.189.7.168","85.215.76.62","185.247.184.105","178.236.247.122","109.107.190.171","193.233.233.124","193.218.118.188","2.58.95.45","45.154.98.102","92.205.185.52","92.205.163.226","185.217.125.210","5.255.118.104","212.69.167.80","23.137.249.227","5.255.118.244","71.19.148.129","143.42.114.46","45.33.15.243","104.237.158.32","172.232.161.205","172.232.161.206","74.207.248.172","172.233.209.179","45.66.35.21","45.66.35.35","45.66.35.10","45.66.35.20","45.66.35.22","51.210.138.64","130.204.161.3","175.214.127.6","31.220.85.162","198.96.155.3","50.118.225.160","45.135.132.20","23.152.24.77","45.95.169.99","94.75.225.81","37.228.129.131","23.137.249.62","103.172.134.26","199.249.230.121","191.252.111.55","35.0.127.52","185.129.62.63","23.94.211.25","185.220.101.139","185.220.101.144","185.220.101.130","185.220.101.156","185.220.101.128","185.220.101.131","185.220.101.154","185.220.101.164","185.220.101.180","185.220.101.155","185.220.101.133","185.220.101.190","185.220.101.151","185.220.101.174","185.220.101.148","185.220.101.129","185.220.101.185","37.221.208.68","87.120.254.132","5.255.106.9","45.15.158.165","193.35.18.105","178.17.170.23","185.146.232.243","194.163.178.164","94.140.115.63","37.228.129.24","81.0.248.210","193.35.18.98","45.128.232.170","193.35.18.96","45.128.232.102","193.35.18.94","193.35.18.95","149.102.128.242","89.187.143.31","193.239.232.228","103.208.86.5","193.35.18.120","185.130.44.43","185.219.142.126","37.1.201.144","5.255.99.108","85.204.116.211","130.193.10.21","130.193.15.79","84.239.46.144","178.218.162.62","199.249.230.122","199.249.230.84","45.141.202.164","199.249.230.74","148.113.2.107","199.249.230.105","199.249.230.73","199.249.230.110","199.249.230.72","199.249.230.86","103.129.222.46","64.5.123.66","185.239.71.160","5.42.80.233","5.42.80.235","200.25.27.112","46.226.107.206","103.106.3.175","96.42.26.63","192.42.116.26","192.42.116.17","192.42.116.14","192.42.116.22","192.42.116.25","192.42.116.27","74.208.106.128","213.232.235.83","91.208.197.144","51.195.166.174","198.98.53.136","157.143.80.38","198.50.128.237","193.233.232.86","144.126.152.77","158.220.80.216","154.16.116.61","45.88.223.151","144.126.132.30","89.147.110.214","89.163.155.136","107.189.13.93","77.232.143.255","77.232.143.243","77.232.143.248","94.228.163.25","199.249.230.186","199.249.230.177","199.249.230.159","199.249.230.161","199.249.230.163","199.249.230.149","199.249.230.154","199.249.230.164","199.249.230.160","199.249.230.173","199.249.230.158","199.249.230.157","199.249.230.108","199.249.230.83","199.249.230.168","199.249.230.82","199.249.230.166","199.249.230.123","199.249.230.106","199.249.230.76","199.249.230.117","199.249.230.169","199.249.230.171","199.249.230.175","199.249.230.107","199.249.230.152","199.249.230.162","2.58.95.53","199.249.230.69","2.58.95.47","2.58.95.59","2.58.95.56","178.175.142.26","199.249.230.156","199.249.230.87","103.28.52.93","185.107.70.56","89.147.108.56","148.113.2.104","38.242.203.135","162.247.74.201","172.232.238.10","5.255.98.198","5.255.98.231","23.137.249.150","149.102.155.205","199.249.230.179","199.249.230.165","199.249.230.182","199.249.230.184","199.249.230.142","136.243.147.59","199.249.230.185","185.220.101.89","149.102.145.222","185.220.101.90","185.220.101.88","87.118.110.27","37.48.70.156","185.165.190.111","5.255.125.153","205.185.124.176","107.189.14.41","93.95.228.81","172.81.131.140","185.38.142.4","95.168.173.143","178.218.144.18","189.147.238.226","189.147.187.10","189.147.242.169","104.219.236.93","161.35.129.51","86.104.194.13","104.244.74.159","185.220.101.40","185.220.101.32","185.220.101.38","185.220.101.37","185.220.101.35","185.220.101.33","185.220.101.34","185.220.101.41","185.220.101.42","205.185.127.100","185.220.101.57","185.220.101.43","185.220.101.46","185.220.101.58","185.220.101.61","185.220.101.60","185.220.101.63","185.220.101.54","185.220.101.52","185.220.101.62","185.220.101.56","185.220.101.44","185.220.101.49","5.255.117.56","185.220.101.55","185.220.101.45","185.220.101.53","185.220.101.59","185.220.101.51","185.220.101.48","185.220.101.47","185.220.101.50","95.111.238.0","152.89.233.169","89.147.110.82","176.58.117.81","23.155.8.104","51.89.153.112","5.61.51.143","5.135.174.213","37.120.166.23","37.252.255.135","82.153.138.48","185.81.115.120","45.139.122.176","84.211.225.54","31.220.87.46","144.172.73.6","51.89.200.109","212.44.107.82","89.147.111.124","94.177.106.59","94.177.106.55","94.177.106.46","93.95.231.88","152.32.238.235","74.208.96.95","38.242.239.62","87.118.114.44","80.78.25.9","185.193.125.95","107.173.179.59","179.43.159.78","81.17.28.95","45.79.129.209","82.221.139.190","107.189.13.254","81.19.137.127","149.102.129.11","81.0.218.34","93.90.74.31","51.81.254.4","109.123.231.55","185.196.8.2","158.220.81.45","62.149.23.133","158.220.81.47","158.220.81.78","209.141.51.180","176.121.81.51","178.17.170.184","202.61.226.98","202.139.229.157","89.147.111.106"]),checkIfTor=floBlockchainAPI.checkIfTor=()=>fetch("https://api.ipify.org?format=json").then((response=>response.json())).then((result=>torExitNodes.has(result.ip))).catch((e=>(console.error(e),!1)));let isTor=!1;checkIfTor().then((result=>{isTor=result,isTor&&(DEFAULT.apiURL.FLO.push("http://vl7ni6byqx7rbub5hypxtod5dbfeuhoj5r5exuyl44pspqh2gasjj4qd.onion:9166/"),DEFAULT.apiURL.FLO_TEST.push("http://omwkzk6bd6zuragdqsrhdyzgxzre7yx4vzrou4vzftintzc2dmagp6qd.onion:15017/"))}));const util=floBlockchainAPI.util={};util.Sat_to_FLO=value=>parseFloat((value/1e8).toFixed(8)),util.FLO_to_Sat=value=>parseInt(1e8*value),util.toFixed=value=>parseFloat(value.toFixed(8)),Object.defineProperties(floBlockchainAPI,{sendAmt:{get:()=>DEFAULT.sendAmt,set:amt=>isNaN(amt)?null:DEFAULT.sendAmt=amt},fee:{get:()=>DEFAULT.fee,set:fee=>isNaN(fee)?null:DEFAULT.fee=fee},defaultReceiver:{get:()=>DEFAULT.receiverID,set:floID=>DEFAULT.receiverID=floID},blockchain:{get:()=>DEFAULT.blockchain}}),floGlobals.sendAmt&&(floBlockchainAPI.sendAmt=floGlobals.sendAmt),floGlobals.fee&&(floBlockchainAPI.fee=floGlobals.fee),Object.defineProperties(floGlobals,{sendAmt:{get:()=>DEFAULT.sendAmt,set:amt=>isNaN(amt)?null:DEFAULT.sendAmt=amt},fee:{get:()=>DEFAULT.fee,set:fee=>isNaN(fee)?null:DEFAULT.fee=fee}});const allServerList=new Set(floGlobals.apiURL&&floGlobals.apiURL[DEFAULT.blockchain]?floGlobals.apiURL[DEFAULT.blockchain]:DEFAULT.apiURL[DEFAULT.blockchain]);var serverList=Array.from(allServerList),curPos=floCrypto.randInt(0,serverList.length-1);function fetch_retry(apicall,rm_node){return new Promise(((resolve,reject)=>{let i=serverList.indexOf(rm_node);-1!=i&&serverList.splice(i,1),curPos=floCrypto.randInt(0,serverList.length-1),fetch_api(apicall,!1).then((result=>resolve(result))).catch((error=>reject(error)))}))}function fetch_api(apicall,ic=!0){return new Promise(((resolve,reject)=>{if(0===serverList.length)ic?(serverList=Array.from(allServerList),curPos=floCrypto.randInt(0,serverList.length-1),fetch_api(apicall,!1).then((result=>resolve(result))).catch((error=>reject(error)))):reject("No FLO blockbook server working");else{let serverURL=serverList[curPos];fetch(serverURL+apicall).then((response=>{response.ok?response.json().then((data=>resolve(data))):fetch_retry(apicall,serverURL).then((result=>resolve(result))).catch((error=>reject(error)))})).catch((error=>{fetch_retry(apicall,serverURL).then((result=>resolve(result))).catch((error=>reject(error)))}))}}))}Object.defineProperties(floBlockchainAPI,{serverList:{get:()=>Array.from(serverList)},current_server:{get:()=>serverList[curPos]}});const promisedAPI=floBlockchainAPI.promisedAPI=floBlockchainAPI.fetch=function(apicall,query_params=void 0){return new Promise(((resolve,reject)=>{isUndefined(query_params)||(apicall+="?"+new URLSearchParams(JSON.parse(JSON.stringify(query_params))).toString()),fetch_api(apicall).then((result=>resolve(result))).catch((error=>reject(error)))}))},getBalance=floBlockchainAPI.getBalance=function(addr){return new Promise(((resolve,reject)=>{promisedAPI(`api/address/${addr}`,{details:"basic"}).then((result=>resolve(result.balance))).catch((error=>reject(error)))}))};const getUTXOs=address=>new Promise(((resolve,reject)=>{promisedAPI(`api/utxo/${address}`,{confirmed:!0}).then((utxos=>{let scriptPubKey=function(address){var tx=bitjs.transaction();tx.addoutput(address,0);let outputBuffer=tx.outputs.pop().script;return Crypto.util.bytesToHex(outputBuffer)}(address);utxos.forEach((u=>u.scriptPubKey=scriptPubKey)),resolve(utxos)})).catch((error=>reject(error)))})),createTx=function(senderAddr,receiverAddr,sendAmt,floData="",strict_utxo=!0){return new Promise(((resolve,reject)=>floCrypto.validateASCII(floData)?floCrypto.validateFloID(senderAddr,!0)?floCrypto.validateFloID(receiverAddr)?"number"!=typeof sendAmt||sendAmt<=0?reject(`Invalid sendAmt : ${sendAmt}`):void getBalance(senderAddr).then((balance=>{var fee=DEFAULT.fee;if(balance{for(var trx=bitjs.transaction(),utxoAmt=0,i=utxos.length-1;i>=0&&utxoAmtDEFAULT.minChangeAmt&&trx.addoutput(senderAddr,change),trx.addflodata(floData.replace(/\n/g," ")),resolve(trx)}})).catch((error=>reject(error)))})).catch((error=>reject(error))):reject(`Invalid address : ${receiverAddr}`):reject(`Invalid address : ${senderAddr}`):reject("Invalid FLO_Data: only printable ASCII characters are allowed")))};floBlockchainAPI.createTx=function(senderAddr,receiverAddr,sendAmt,floData="",strict_utxo=!0){return new Promise(((resolve,reject)=>{createTx(senderAddr,receiverAddr,sendAmt,floData,strict_utxo).then((trx=>resolve(trx.serialize()))).catch((error=>reject(error)))}))};const sendTx=floBlockchainAPI.sendTx=function(senderAddr,receiverAddr,sendAmt,privKey,floData="",strict_utxo=!0){return new Promise(((resolve,reject)=>floCrypto.validateFloID(senderAddr,!0)?privKey.length<1||!floCrypto.verifyPrivKey(privKey,senderAddr)?reject("Invalid Private key!"):void createTx(senderAddr,receiverAddr,sendAmt,floData,strict_utxo).then((trx=>{var signedTxHash=trx.sign(privKey,1);broadcastTx(signedTxHash).then((txid=>resolve(txid))).catch((error=>reject(error)))})).catch((error=>reject(error))):reject(`Invalid address : ${senderAddr}`)))};floBlockchainAPI.writeData=function(senderAddr,data,privKey,receiverAddr=DEFAULT.receiverID,options={}){let strict_utxo=!1!==options.strict_utxo,sendAmt=isNaN(options.sendAmt)?DEFAULT.sendAmt:options.sendAmt;return new Promise(((resolve,reject)=>{"string"!=typeof data&&(data=JSON.stringify(data)),sendTx(senderAddr,receiverAddr,sendAmt,privKey,data,strict_utxo).then((txid=>resolve(txid))).catch((error=>reject(error)))}))},floBlockchainAPI.mergeUTXOs=function(floID,privKey,floData=""){return new Promise(((resolve,reject)=>{if(!floCrypto.validateFloID(floID,!0))return reject("Invalid floID");if(!floCrypto.verifyPrivKey(privKey,floID))return reject("Invalid Private Key");if(!floCrypto.validateASCII(floData))return reject("Invalid FLO_Data: only printable ASCII characters are allowed");var trx=bitjs.transaction(),utxoAmt=0,fee=DEFAULT.fee;getUTXOs(floID).then((utxos=>{for(var i=utxos.length-1;i>=0;i--)utxos[i].confirmations&&(trx.addinput(utxos[i].txid,utxos[i].vout,utxos[i].scriptPubKey),utxoAmt+=utxos[i].amount);trx.addoutput(floID,utxoAmt-fee),trx.addflodata(floData.replace(/\n/g," "));var signedTxHash=trx.sign(privKey,1);broadcastTx(signedTxHash).then((txid=>resolve(txid))).catch((error=>reject(error)))})).catch((error=>reject(error)))}))},floBlockchainAPI.splitUTXOs=function(floID,privKey,count,floData=""){return new Promise(((resolve,reject)=>{if(!floCrypto.validateFloID(floID,!0))return reject("Invalid floID");if(!floCrypto.verifyPrivKey(privKey,floID))return reject("Invalid Private Key");if(!floCrypto.validateASCII(floData))return reject("Invalid FLO_Data: only printable ASCII characters are allowed");var fee=DEFAULT.fee,splitAmt=DEFAULT.sendAmt+fee,totalAmt=splitAmt*count;getBalance(floID).then((balance=>{var fee=DEFAULT.fee;if(balance{var trx=bitjs.transaction(),utxoAmt=0;for(let i=utxos.length-1;i>=0&&utxoAmtDEFAULT.minChangeAmt&&trx.addoutput(floID,change),trx.addflodata(floData.replace(/\n/g," "));var signedTxHash=trx.sign(privKey,1);broadcastTx(signedTxHash).then((txid=>resolve(txid))).catch((error=>reject(error)))}})).catch((error=>reject(error)))})).catch((error=>reject(error)))}))},floBlockchainAPI.writeDataMultiple=function(senderPrivKeys,data,receivers=[DEFAULT.receiverID],options={}){return new Promise(((resolve,reject)=>{if(!Array.isArray(senderPrivKeys))return reject("Invalid senderPrivKeys: SenderPrivKeys must be Array");if(!1===options.preserveRatio){let tmp={},amount=DEFAULT.sendAmt*receivers.length/senderPrivKeys.length;senderPrivKeys.forEach((key=>tmp[key]=amount)),senderPrivKeys=tmp}if(!Array.isArray(receivers))return reject("Invalid receivers: Receivers must be Array");{let tmp={},amount=options.sendAmt||DEFAULT.sendAmt;receivers.forEach((floID=>tmp[floID]=amount)),receivers=tmp}"string"!=typeof data&&(data=JSON.stringify(data)),sendTxMultiple(senderPrivKeys,receivers,data).then((txid=>resolve(txid))).catch((error=>reject(error)))}))};const sendTxMultiple=floBlockchainAPI.sendTxMultiple=function(senderPrivKeys,receivers,floData=""){return new Promise(((resolve,reject)=>{if(!floCrypto.validateASCII(floData))return reject("Invalid FLO_Data: only printable ASCII characters are allowed");let preserveRatio,senders={};try{let invalids={InvalidSenderPrivKeys:[],InvalidSenderAmountFor:[],InvalidReceiverIDs:[],InvalidReceiveAmountFor:[]},inputVal=0,outputVal=0;if(Array.isArray(senderPrivKeys))senderPrivKeys.forEach((key=>{try{if(key){let floID=floCrypto.getFloID(key);senders[floID]={wif:key}}else invalids.InvalidSenderPrivKeys.push(key)}catch(error){invalids.InvalidSenderPrivKeys.push(key)}})),preserveRatio=!0;else{for(let key in senderPrivKeys)try{if(key){"number"!=typeof senderPrivKeys[key]||senderPrivKeys[key]<=0?invalids.InvalidSenderAmountFor.push(key):inputVal+=senderPrivKeys[key];let floID=floCrypto.getFloID(key);senders[floID]={wif:key,coins:senderPrivKeys[key]}}else invalids.InvalidSenderPrivKeys.push(key)}catch(error){invalids.InvalidSenderPrivKeys.push(key)}preserveRatio=!1}for(let floID in receivers)floCrypto.validateFloID(floID)||invalids.InvalidReceiverIDs.push(floID),"number"!=typeof receivers[floID]||receivers[floID]<=0?invalids.InvalidReceiveAmountFor.push(floID):outputVal+=receivers[floID];for(let i in invalids)invalids[i].length||delete invalids[i];if(Object.keys(invalids).length)return reject(invalids);if(!preserveRatio&&inputVal!=outputVal)return reject(`Input Amount (${inputVal}) not equal to Output Amount (${outputVal})`)}catch(error){return reject(error)}let promises=[];for(let floID in senders)promises.push(getBalance(floID));Promise.all(promises).then((results=>{let totalBalance=0,totalFee=DEFAULT.fee,balance={};if(!preserveRatio)var dividedFee=totalFee/Object.keys(senders).length;let insufficient=[];for(let floID in senders)balance[floID]=parseFloat(results.shift()),(isNaN(balance[floID])||preserveRatio&&balance[floID]<=totalFee||!preserveRatio&&balance[floID]{var trx=bitjs.transaction();for(let floID in senders){let sendAmt,utxos=results.shift();if(preserveRatio){let ratio=balance[floID]/totalBalance;sendAmt=totalSendAmt*ratio}else sendAmt=senders[floID].coins+dividedFee;let utxoAmt=0;for(let i=utxos.length-1;i>=0&&utxoAmt0&&trx.addoutput(floID,change)}for(let floID in receivers)trx.addoutput(floID,receivers[floID]);trx.addflodata(floData.replace(/\n/g," "));for(let floID in senders)trx.sign(senders[floID].wif,1);var signedTxHash=trx.serialize();broadcastTx(signedTxHash).then((txid=>resolve(txid))).catch((error=>reject(error)))})).catch((error=>reject(error)))})).catch((error=>reject(error)))}))},createMultisigTx=function(redeemScript,receivers,amounts,floData="",strict_utxo=!0){return new Promise(((resolve,reject)=>{var multisig=floCrypto.decodeRedeemScript(redeemScript);if(!multisig)return reject("Invalid redeemScript");var senderAddr=multisig.address;if(!floCrypto.validateFloID(senderAddr))return reject(`Invalid multisig : ${senderAddr}`);if(!floCrypto.validateASCII(floData))return reject("Invalid FLO_Data: only printable ASCII characters are allowed");Array.isArray(receivers)||(receivers=[receivers]);for(let r of receivers)if(!floCrypto.validateFloID(r))return reject(`Invalid address : ${r}`);if(Array.isArray(amounts)||(amounts=[amounts]),amounts.length!=receivers.length)return reject("Receivers and amounts have different length");var sendAmt=0;for(let a of amounts){if("number"!=typeof a||a<=0)return reject(`Invalid amount : ${a}`);sendAmt+=a}getBalance(senderAddr).then((balance=>{var fee=DEFAULT.fee;if(balance{for(var trx=bitjs.transaction(),utxoAmt=0,i=utxos.length-1;i>=0&&utxoAmtDEFAULT.minChangeAmt&&trx.addoutput(senderAddr,change),trx.addflodata(floData.replace(/\n/g," ")),resolve(trx)}})).catch((error=>reject(error)))})).catch((error=>reject(error)))}))};floBlockchainAPI.createMultisigTx=function(redeemScript,receivers,amounts,floData="",strict_utxo=!0){return new Promise(((resolve,reject)=>{createMultisigTx(redeemScript,receivers,amounts,floData,strict_utxo).then((trx=>resolve(trx.serialize()))).catch((error=>reject(error)))}))};const sendMultisigTx=floBlockchainAPI.sendMultisigTx=function(redeemScript,privateKeys,receivers,amounts,floData="",strict_utxo=!0){return new Promise(((resolve,reject)=>{var multisig=floCrypto.decodeRedeemScript(redeemScript);if(!multisig)return reject("Invalid redeemScript");if(privateKeys.length{for(let pk of privateKeys)trx.sign(pk,1);var signedTxHash=trx.serialize();broadcastTx(signedTxHash).then((txid=>resolve(txid))).catch((error=>reject(error)))})).catch((error=>reject(error)))}))};function deserializeTx(tx){if("string"==typeof tx||Array.isArray(tx))try{tx=bitjs.transaction(tx)}catch{throw"Invalid transaction hex"}else if("object"!=typeof tx||"function"!=typeof tx.sign)throw"Invalid transaction object";return tx}floBlockchainAPI.writeMultisigData=function(redeemScript,data,privatekeys,receiverAddr=DEFAULT.receiverID,options={}){let strict_utxo=!1!==options.strict_utxo,sendAmt=isNaN(options.sendAmt)?DEFAULT.sendAmt:options.sendAmt;return new Promise(((resolve,reject)=>{if(!floCrypto.validateFloID(receiverAddr))return reject(`Invalid receiver: ${receiverAddr}`);sendMultisigTx(redeemScript,privatekeys,receiverAddr,sendAmt,data,strict_utxo).then((txid=>resolve(txid))).catch((error=>reject(error)))}))},floBlockchainAPI.signTx=function(tx,privateKey,sighashtype=1){if(!floCrypto.getFloID(privateKey))throw"Invalid Private key";return(tx=deserializeTx(tx)).sign(privateKey,sighashtype)};const checkSigned=floBlockchainAPI.checkSigned=function(tx,bool=!0){tx=deserializeTx(tx);let n=[];for(let i=0;ix.t)throw"signaturesRequired is more than publicKeys";x.s!0!==x)).length:n};floBlockchainAPI.checkIfSameTx=function(tx1,tx2){if(tx1=deserializeTx(tx1),tx2=deserializeTx(tx2),tx1.inputs.length!==tx2.inputs.length||tx1.outputs.length!==tx2.outputs.length)return!1;if(tx1.floData!==tx2.floData)return!1;for(let i=0;inew Promise(((resolve,reject)=>{promisedAPI(`api/tx/${txid}`).then((result=>resolve(result.vout[i]))).catch((error=>reject(error)))}));function getOutputAddress(outscript){var bytes,version;switch(outscript[0]){case 118:bytes=outscript.slice(3,outscript.length-2),version=bitjs.pub;break;case 169:bytes=outscript.slice(2,outscript.length-1),version=bitjs.multisig;break;default:return}bytes.unshift(version);var checksum=Crypto.SHA256(Crypto.SHA256(bytes,{asBytes:!0}),{asBytes:!0}).slice(0,4);return bitjs.Base58.encode(bytes.concat(checksum))}floBlockchainAPI.parseTransaction=function(tx){return new Promise(((resolve,reject)=>{tx=deserializeTx(tx);let result={},promises=[];for(let i=0;i{result.inputs=inputs.map((inp=>Object({address:inp.scriptPubKey.addresses[0],value:parseFloat(inp.value)})));let signed=checkSigned(tx,!1);result.inputs.forEach(((inp,i)=>inp.signed=signed[i])),result.outputs=tx.outputs.map((out=>Object({address:getOutputAddress(out.script),value:util.Sat_to_FLO(out.value)}))),result.total_input=parseFloat(result.inputs.reduce(((a,inp)=>a+inp.value),0).toFixed(8)),result.total_output=parseFloat(result.outputs.reduce(((a,out)=>a+out.value),0).toFixed(8)),result.fee=parseFloat((result.total_input-result.total_output).toFixed(8)),result.floData=tx.floData,resolve(result)})).catch((error=>reject(error)))}))};const broadcastTx=floBlockchainAPI.broadcastTx=function(signedTxHash){return new Promise(((resolve,reject)=>{if(signedTxHash.length<1)return reject("Empty Transaction Data");promisedAPI("/api/sendtx/"+signedTxHash).then((response=>resolve(response.result))).catch((error=>reject(error)))}))},getTx=floBlockchainAPI.getTx=function(txid){return new Promise(((resolve,reject)=>{promisedAPI(`api/tx/${txid}`).then((response=>resolve(response))).catch((error=>reject(error)))}))},waitForConfirmation=floBlockchainAPI.waitForConfirmation=function(txid,max_retry=-1,retry_timeout=20){return new Promise(((resolve,reject)=>{setTimeout((function(){getTx(txid).then((tx=>tx?tx.confirmations?resolve(tx):0===max_retry?reject("Waiting timeout: tx still not confirmed"):void waitForConfirmation(txid,max_retry=max_retry<0?-1:max_retry-1,retry_timeout).then((result=>resolve(result))).catch((error=>reject(error))):reject("Transaction not found"))).catch((error=>reject(error)))}),1e3*retry_timeout)}))},readTxs=floBlockchainAPI.readTxs=function(addr,options={}){return new Promise(((resolve,reject)=>{let query_params={details:"txs"};!isUndefined(options.page)&&Number.isInteger(options.page)&&(query_params.page=options.page),!isUndefined(options.pageSize)&&Number.isInteger(options.pageSize)&&(query_params.pageSize=options.pageSize),options.confirmed&&(query_params.confirmed=!0),promisedAPI(`api/address/${addr}`,query_params).then((response=>{Array.isArray(response.txs)||(response.txs=[]),resolve(response)})).catch((error=>reject(error)))}))};function readAllTxs_oldSupport(addr,options,ignoreOld=0,cacheTotal=0){return new Promise(((resolve,reject)=>{readTxs(addr,options).then((response=>{cacheTotal+=response.txs.length;let n_remaining=response.txApperances-cacheTotal;if(n_remainingresolve(response.txs.concat(result)))).catch((error=>reject(error))))})).catch((error=>reject(error)))}))}function readAllTxs_new(addr,options,lastItem){return new Promise(((resolve,reject)=>{readTxs(addr,options).then((response=>{let i=response.txs.findIndex((t=>t.txid===lastItem));-1!=i?resolve(response.txs.slice(0,i)):response.page==response.totalPages?resolve(response.txs):(options.page=response.page+1,readAllTxs_new(addr,options,lastItem).then((result=>resolve(response.txs.concat(result)))).catch((error=>reject(error))))})).catch((error=>reject(error)))}))}const readAllTxs=floBlockchainAPI.readAllTxs=function(addr,options={}){return new Promise(((resolve,reject)=>{Number.isInteger(options.ignoreOld)?readAllTxs_oldSupport(addr,options,options.ignoreOld).then((txs=>{let last_tx=txs.find((t=>t.confirmations>0)),new_lastItem=last_tx?last_tx.txid:options.ignoreOld;resolve({lastItem:new_lastItem,items:txs})})).catch((error=>reject(error))):readAllTxs_new(addr,options,options.after).then((txs=>{let last_tx=txs.find((t=>t.confirmations>0)),new_lastItem=last_tx?last_tx.txid:options.after;resolve({lastItem:new_lastItem,items:txs})})).catch((error=>reject(error)))}))};floBlockchainAPI.readData=function(addr,options={}){return new Promise(((resolve,reject)=>{let query_options={};query_options.confirmed=!!isUndefined(options.confirmed)||options.confirmed,isUndefined(options.after)?isUndefined(options.ignoreOld)||(query_options.ignoreOld=options.ignoreOld):query_options.after=options.after,readAllTxs(addr,query_options).then((response=>{"string"==typeof options.senders&&(options.senders=[options.senders]),"string"==typeof options.receivers&&(options.receivers=[options.receivers]);const filteredData=response.items.filter((tx=>{if(!tx.confirmations)return!1;if(options.sentOnly&&!tx.vin.some((vin=>vin.addresses[0]===addr)))return!1;if(Array.isArray(options.senders)&&!tx.vin.some((vin=>options.senders.includes(vin.addresses[0]))))return!1;if(options.receivedOnly&&!tx.vout.some((vout=>vout.scriptPubKey.addresses[0]===addr)))return!1;if(Array.isArray(options.receivers)&&!tx.vout.some((vout=>options.receivers.includes(vout.scriptPubKey.addresses[0]))))return!1;if(options.pattern)try{let jsonContent=JSON.parse(tx.floData);if(!Object.keys(jsonContent).includes(options.pattern))return!1}catch{return!1}return!(options.filter&&!options.filter(tx.floData))})).map((tx=>options.tx?{txid:tx.txid,time:tx.time,blockheight:tx.blockheight,senders:new Set(tx.vin.map((v=>v.addresses[0]))),receivers:new Set(tx.vout.map((v=>v.scriptPubKey.addresses[0]))),data:tx.floData}:tx.floData)),result={lastItem:response.lastItem};options.tx?result.items=filteredData:result.data=filteredData,resolve(result)})).catch((error=>reject(error)))}))};const getLatestData=floBlockchainAPI.getLatestData=function(addr,caseFn,options={}){return new Promise(((resolve,reject)=>{let new_lastItem,query_options={};query_options.confirmed=!!isUndefined(options.confirmed)||options.confirmed,isUndefined(options.page)||(query_options.page=options.page),readTxs(addr,query_options).then((response=>{if(!new_lastItem){let last_tx=response.items.find((t=>t.confirmations>0));last_tx&&(new_lastItem=last_tx.txid)}"string"==typeof options.senders&&(options.senders=[options.senders]),"string"==typeof options.receivers&&(options.receivers=[options.receivers]);let i_after=response.txs.findIndex((t=>t.txid===options.after));-1!=i_after&&response.items.splice(i_after);var item=response.items.find((tx=>!!tx.confirmations&&(!(options.sentOnly&&!tx.vin.some((vin=>vin.addresses[0]===addr)))&&(!(Array.isArray(options.senders)&&!tx.vin.some((vin=>options.senders.includes(vin.addresses[0]))))&&(!(options.receivedOnly&&!tx.vout.some((vout=>vout.scriptPubKey.addresses[0]===addr)))&&(!(Array.isArray(options.receivers)&&!tx.vout.some((vout=>options.receivers.includes(vout.scriptPubKey.addresses[0]))))&&!!caseFn(tx.floData)))))));if(!isUndefined(item)){const result={lastItem:new_lastItem||item.txid};return options.tx?result.item={txid:item.txid,time:item.time,blockheight:item.blockheight,senders:new Set(item.vin.map((v=>v.addresses[0]))),receivers:new Set(item.vout.map((v=>v.scriptPubKey.addresses[0]))),data:item.floData}:result.data=item.floData,resolve(result)}response.page==response.totalPages||-1!=i_after?resolve({lastItem:new_lastItem||options.after}):(options.page=response.page+1,getLatestData(addr,caseFn,options).then((result=>resolve(result))).catch((error=>reject(error))))})).catch((error=>reject(error)))}))}}();
\ No newline at end of file
+!function(EXPORTS){"use strict";const floBlockchainAPI="object"===typeof module?module.exports:window.floBlockchainAPI={},DEFAULT={blockchain:floGlobals.blockchain,apiURL:{FLO:["https://blockbook.ranchimall.net/"],FLO_TEST:["https://blockbook-testnet.ranchimall.net/"]},sendAmt:3e-4,fee:2e-4,minChangeAmt:2e-4,receiverID:floGlobals.adminID},isUndefined=val=>void 0===val,torExitNodes=new Set(["185.241.208.232","194.26.192.64","171.25.193.25","80.67.167.81","192.42.116.187","198.98.51.189","89.58.26.216","109.70.100.4","149.56.22.133","5.45.102.93","178.17.174.14","192.42.116.196","185.220.101.4","45.141.215.62","94.102.51.15","192.42.116.213","107.189.28.166","185.241.208.243","45.141.215.80","193.26.115.61","192.42.116.175","149.56.44.47","107.189.13.91","87.118.116.103","178.17.171.102","185.243.218.110","192.42.116.208","89.58.41.156","2.58.56.43","104.192.1.138","45.95.169.184","107.189.8.56","176.58.121.177","185.220.101.31","45.141.215.200","109.70.100.1","185.244.192.175","185.129.61.2","144.172.118.41","192.42.116.184","45.151.167.10","185.220.101.27","91.203.144.194","45.141.215.88","179.43.182.232","185.220.101.5","109.70.100.2","107.189.14.4","94.16.116.81","185.220.101.8","185.220.101.12","88.80.20.86","23.154.177.15","45.141.215.56","5.42.66.6","23.129.64.225","104.244.75.74","45.95.169.228","37.187.5.192","45.141.215.169","109.70.100.66","45.79.144.222","185.227.68.78","179.43.159.199","2.57.122.246","192.42.116.201","185.220.102.248","195.176.3.23","45.138.16.42","216.73.159.75","185.165.169.239","23.129.64.213","109.70.100.6","45.80.158.27","45.138.16.240","178.20.55.16","192.42.116.173","51.15.249.160","192.42.116.200","185.220.102.254","45.141.215.63","193.218.118.151","192.42.116.211","185.100.85.24","185.195.71.12","107.189.8.181","193.189.100.199","109.70.100.69","185.100.87.250","31.220.93.201","89.236.112.100","45.141.215.90","185.35.202.222","109.70.100.65","95.142.161.63","192.42.116.181","192.42.116.23","194.26.192.77","193.189.100.198","180.150.226.99","23.129.64.227","107.189.4.23","45.141.215.235","185.220.102.252","109.70.100.67","185.220.100.255","185.220.101.21","185.100.85.22","128.31.0.13","46.182.21.248","192.42.116.174","185.241.208.115","185.220.101.1","192.42.116.202","45.141.215.97","185.243.218.204","78.142.18.219","192.42.116.192","190.120.229.98","192.42.116.177","45.138.16.113","192.42.116.212","185.220.101.3","45.138.16.222","5.42.80.232","87.118.122.51","107.189.11.166","185.220.102.245","185.220.102.251","46.182.21.250","5.255.103.235","185.243.218.89","185.193.52.180","185.220.101.24","2.57.122.215","45.15.157.177","185.220.100.253","37.48.120.64","204.8.156.142","192.42.116.179","185.220.100.240","185.241.208.236","185.195.71.244","193.105.134.155","51.15.59.15","185.100.85.23","45.151.167.11","82.197.182.161","192.42.116.191","27.255.75.198","171.25.193.79","45.95.169.255","45.138.16.230","107.189.29.103","163.172.213.212","95.143.193.125","23.154.177.7","185.220.101.23","195.176.3.24","107.189.1.9","192.42.116.182","23.137.249.240","192.42.116.189","23.129.64.146","45.138.16.107","107.189.5.121","107.189.30.236","94.16.121.91","109.70.100.70","185.254.196.141","194.15.112.133","192.42.116.180","173.249.57.253","185.220.102.250","185.100.85.25","185.220.101.13","185.220.101.25","192.42.116.199","23.154.177.2","107.189.31.232","45.141.215.81","192.42.116.220","185.67.82.114","45.141.215.114","185.243.218.61","107.189.13.184","107.189.10.141","104.244.79.61","185.106.94.195","176.126.253.190","23.154.177.22","192.42.116.210","185.220.102.249","23.184.48.127","192.42.116.218","91.208.75.4","192.42.116.178","178.175.148.209","208.109.36.224","23.137.251.61","94.142.241.194","162.251.5.152","23.154.177.4","45.138.16.76","45.9.150.103","213.252.140.118","185.243.218.95","45.134.225.36","109.70.100.5","185.243.218.202","185.220.101.19","192.42.116.176","109.70.100.71","45.151.167.13","185.220.102.4","185.220.102.7","104.244.79.50","178.17.174.198","199.195.249.214","66.146.193.33","107.189.8.238","139.99.8.57","45.141.215.95","192.42.116.219","114.199.75.111","185.220.100.242","5.42.80.234","173.237.206.68","139.99.172.11","23.129.64.143","80.241.60.207","192.42.116.194","45.95.169.226","185.220.102.8","109.70.100.3","179.43.159.200","192.42.116.217","185.220.101.6","198.98.50.199","185.100.87.192","193.189.100.202","163.172.45.102","185.220.101.0","107.189.8.133","185.129.61.6","104.244.78.233","192.42.116.15","192.42.116.195","45.141.215.110","193.189.100.203","77.48.28.237","104.244.79.232","193.26.115.43","199.195.250.165","190.211.254.97","45.141.215.61","185.220.101.17","192.42.116.203","185.220.102.247","91.132.144.59","185.141.147.129","23.129.64.149","185.183.157.214","95.211.244.28","192.42.116.188","188.214.104.21","192.42.116.186","192.42.116.197","107.189.13.247","212.73.134.204","185.235.146.29","188.68.49.235","92.205.237.227","23.154.177.12","199.195.253.180","171.25.193.234","185.241.208.71","96.66.15.152","94.16.121.226","204.85.191.9","91.210.59.57","5.255.115.42","185.220.103.113","216.239.90.19","77.91.87.79","192.42.116.216","23.154.177.23","192.42.116.198","173.255.255.215","144.217.80.80","107.189.10.175","45.95.169.227","103.251.167.20","185.220.101.30","5.255.125.196","198.98.48.192","185.220.102.242","23.154.177.18","185.86.148.90","185.142.239.49","185.220.101.2","5.255.100.219","107.189.5.7","199.195.251.119","185.220.101.10","92.246.84.133","66.220.242.222","184.105.48.40","23.129.64.133","185.130.44.108","192.42.116.20","185.181.61.115","192.42.116.19","149.202.79.129","146.59.35.38","23.154.177.20","185.191.204.254","23.154.177.3","185.233.100.23","23.154.177.19","45.92.1.74","107.189.31.225","89.58.18.10","138.59.18.110","185.246.188.73","192.42.116.221","104.244.77.192","192.42.116.214","178.170.37.11","188.68.41.191","192.42.116.183","185.220.103.115","178.175.135.7","209.141.51.30","141.98.11.62","171.25.193.235","23.137.249.143","179.43.159.197","192.99.168.180","185.220.101.11","185.243.218.41","89.234.157.254","47.243.74.136","107.189.28.199","185.129.61.9","185.220.101.28","185.220.101.29","5.255.99.5","179.43.182.58","185.129.61.3","23.129.64.135","107.189.30.69","51.15.227.109","185.207.107.216","185.129.61.129","185.100.87.41","23.129.64.145","179.43.159.201","23.129.64.224","192.42.116.28","93.99.104.194","185.244.192.184","45.95.169.223","104.244.73.43","185.56.83.83","87.120.254.48","185.185.170.27","195.88.74.206","107.174.138.172","109.70.100.68","23.129.64.139","94.230.208.147","77.91.85.147","77.81.247.72","2.58.56.220","185.220.103.7","149.202.79.101","5.255.104.202","178.175.148.195","83.96.213.63","185.100.87.174","79.137.195.103","185.220.101.20","107.189.3.11","185.220.101.22","185.220.101.7","217.12.221.131","179.43.159.196","45.95.169.230","107.189.1.160","208.109.215.188","171.25.193.78","204.194.29.4","104.244.77.80","162.247.72.199","89.58.52.25","192.42.116.209","217.146.2.41","185.220.103.117","23.154.177.10","91.208.75.3","94.230.208.148","95.128.43.164","171.25.193.20","102.130.113.9","91.92.109.43","107.189.7.144","185.220.102.240","5.255.124.150","198.98.60.158","185.227.134.106","193.233.233.221","71.19.144.106","185.84.31.254","23.129.64.132","62.171.137.169","193.189.100.196","185.220.101.18","107.189.12.3","91.208.75.178","193.35.18.49","185.246.188.74","45.132.246.245","209.141.55.26","198.98.48.20","185.129.61.1","108.61.189.136","185.220.102.243","107.189.1.96","185.100.87.136","213.95.149.22","23.129.64.217","192.42.116.185","5.45.104.176","192.42.116.193","23.154.177.16","198.98.49.203","171.25.193.77","91.208.75.153","162.247.74.216","179.43.159.194","54.36.108.162","198.98.48.33","188.68.52.231","185.220.100.252","205.185.124.193","104.244.73.190","185.100.87.139","23.154.177.25","77.105.146.42","79.137.202.92","51.38.81.135","87.118.116.90","23.129.64.134","185.246.188.67","185.129.62.62","185.220.100.241","82.221.131.71","209.141.59.116","194.195.120.132","185.207.107.130","178.218.144.99","172.104.243.155","93.99.104.128","87.118.122.30","185.100.87.253","51.195.91.124","104.192.3.74","185.252.232.218","23.129.64.141","5.196.95.34","185.220.102.6","23.184.48.128","193.239.232.102","185.220.101.16","91.203.145.116","185.129.61.4","23.129.64.147","37.228.129.63","45.151.167.12","93.95.228.205","185.220.102.244","209.141.54.203","93.95.230.165","94.142.244.16","162.247.72.192","185.146.232.234","81.16.33.42","107.189.30.86","51.81.222.62","23.154.177.5","77.220.196.253","72.167.47.69","185.220.101.26","104.219.236.100","192.42.116.204","185.246.128.161","200.122.181.2","199.195.253.247","109.201.133.100","142.44.234.69","89.147.110.202","89.185.85.140","104.244.79.44","5.2.79.179","23.129.64.130","104.244.78.187","23.154.177.13","5.255.97.221","92.205.129.119","80.82.78.14","23.154.177.8","51.38.113.118","45.61.184.205","107.189.31.134","185.220.103.114","179.48.251.188","135.125.205.25","198.98.54.49","193.189.100.205","185.220.102.253","45.79.50.161","202.69.76.36","79.137.198.213","46.166.139.111","5.255.111.64","51.89.138.51","216.73.159.101","166.70.207.2","96.27.198.133","194.15.115.212","46.234.47.105","146.59.35.246","23.137.248.100","185.220.102.241","107.189.14.43","212.95.50.77","128.127.180.156","80.67.172.162","185.129.61.5","185.129.61.10","23.129.64.214","185.220.100.254","160.119.249.240","185.243.218.46","185.220.102.246","104.244.74.97","23.129.64.228","23.129.64.218","185.220.100.243","54.36.101.21","5.255.99.124","107.189.13.253","130.149.80.199","171.25.193.80","144.24.197.112","199.195.251.78","23.129.64.223","195.80.151.30","185.7.33.146","107.189.4.12","45.95.169.229","107.189.6.124","46.38.255.27","107.189.8.226","143.42.199.223","103.251.167.10","185.34.33.2","5.255.98.23","74.82.47.194","194.163.157.49","192.42.116.215","185.220.101.14","194.15.113.118","89.147.108.62","185.220.101.15","185.42.170.203","23.154.177.6","162.247.74.27","199.195.253.124","193.189.100.201","62.182.84.146","191.101.217.24","23.129.64.229","85.93.218.204","178.17.174.164","205.185.117.149","193.218.118.133","23.154.177.21","5.255.101.10","82.221.131.5","193.189.100.204","103.196.37.111","103.109.101.105","192.42.116.18","23.129.64.226","107.189.13.251","45.56.81.190","192.42.116.13","107.189.11.111","198.46.166.157","185.220.103.119","54.38.183.101","77.68.20.217","185.220.101.36","103.236.201.88","162.247.74.213","185.129.61.8","89.147.110.154","45.95.169.225","141.239.149.94","82.221.128.191","72.14.179.10","46.232.251.191","23.129.64.215","162.247.74.7","23.154.177.14","89.147.109.226","193.41.226.117","89.147.108.209","23.129.64.137","93.123.12.112","185.14.97.37","103.163.218.11","23.129.64.131","23.129.64.142","23.137.249.185","89.58.41.251","185.220.101.9","202.182.99.129","205.185.119.35","193.189.100.194","204.85.191.8","185.56.171.94","23.129.64.144","102.130.127.117","192.42.116.24","179.43.159.198","185.38.175.133","185.220.101.39","193.168.143.129","5.255.127.222","95.211.210.103","185.220.103.116","23.129.64.211","23.129.64.220","185.113.128.30","151.80.148.159","192.99.149.111","23.129.64.210","37.228.129.128","91.208.75.239","185.220.103.120","185.165.171.84","193.105.134.150","209.141.46.203","209.141.50.178","104.244.74.23","45.95.169.224","23.129.64.140","176.118.193.33","204.85.191.7","104.244.73.193","162.247.74.204","91.208.75.156","205.185.116.34","125.212.241.131","5.2.72.110","179.43.159.195","185.154.110.142","91.206.26.26","45.79.177.21","23.154.177.9","193.189.100.197","46.165.243.36","107.189.2.108","23.154.177.17","23.129.64.148","5.45.98.162","5.255.101.131","23.129.64.136","107.189.31.33","185.82.219.109","104.244.73.136","185.129.61.7","5.255.115.58","23.154.177.24","165.73.242.163","193.189.100.200","192.46.227.185","5.196.8.113","77.91.86.95","85.209.176.103","23.137.249.8","5.255.98.151","23.129.64.221","23.129.64.219","23.129.64.216","185.243.218.35","104.244.77.208","94.228.169.70","51.75.64.23","176.58.100.98","23.154.177.11","23.129.64.138","143.42.110.237","94.16.112.22","144.172.118.4","185.130.47.58","185.154.110.17","104.244.72.132","5.2.79.190","23.129.64.212","109.169.33.163","5.2.67.226","109.69.67.17","108.181.27.205","5.255.103.190","107.189.14.106","5.255.99.147","193.189.100.206","193.218.118.182","185.181.61.142","23.129.64.222","193.35.18.77","185.100.86.128","91.203.5.118","83.97.20.77","45.138.16.203","2.57.122.58","185.181.61.18","195.176.3.19","195.176.3.20","198.58.107.53","138.128.222.68","118.163.74.160","185.241.208.54","38.97.116.244","104.244.77.79","103.253.24.18","185.225.69.203","162.247.74.206","79.124.8.241","91.203.5.115","144.172.118.102","144.172.118.124","185.225.69.232","163.5.143.76","144.172.118.51","178.20.55.182","109.104.153.22","193.233.133.109","51.158.115.62","92.205.31.137","185.193.158.134","217.12.215.167","45.15.158.39","185.174.136.114","91.219.239.166","91.219.237.56","51.159.211.57","192.210.255.181","185.170.114.25","205.185.123.93","205.185.121.170","107.189.13.180","104.244.78.162","104.244.76.170","104.244.74.57","195.160.220.104","31.220.98.139","158.220.92.203","23.184.48.101","178.31.22.116","79.102.34.63","185.220.103.5","179.43.128.16","45.128.133.242","185.220.103.118","185.100.85.132","107.189.7.48","5.135.174.211","45.8.22.207","185.220.101.159","185.220.101.141","185.220.101.134","185.220.101.147","185.220.101.153","185.220.101.145","185.220.101.158","185.220.101.160","185.220.101.137","185.220.101.140","185.220.101.132","185.220.101.157","185.220.101.150","185.220.101.143","158.69.201.47","107.189.1.175","176.58.89.182","185.220.101.138","82.118.242.158","217.170.201.71","193.189.100.195","144.172.118.48","185.220.101.135","185.220.101.191","185.220.101.136","185.220.101.179","185.220.101.170","185.220.101.149","185.220.101.173","185.220.101.171","185.220.101.161","185.220.101.163","185.220.101.152","185.220.101.162","185.220.101.176","185.220.101.188","185.82.127.128","85.235.145.205","172.81.131.139","5.255.100.26","62.63.244.7","104.219.236.101","23.137.248.139","185.241.208.204","45.141.215.111","185.241.208.202","45.141.215.21","45.61.185.172","185.241.208.206","205.185.113.180","93.242.68.75","185.220.100.248","185.220.100.251","185.220.100.247","185.220.100.245","185.220.100.246","185.220.100.249","185.220.100.250","185.220.100.244","77.72.85.30","51.222.142.67","107.172.31.165","107.174.231.197","198.144.178.163","23.137.250.34","107.172.13.143","107.172.31.146","173.232.195.137","50.3.182.156","173.232.195.144","173.232.195.146","172.81.131.168","172.81.131.84","77.48.28.239","172.81.131.156","185.183.159.40","196.189.30.114","107.189.8.5","185.220.101.168","185.220.101.165","185.220.101.142","185.220.101.167","185.220.101.166","185.220.101.169","77.48.28.193","37.228.129.5","144.172.73.11","107.189.14.57","84.16.224.227","185.220.103.4","162.247.74.202","185.220.103.6","162.247.74.200","185.220.103.9","185.220.103.8","154.12.254.57","94.103.124.184","185.220.101.189","67.219.109.141","185.220.101.187","185.220.101.186","185.220.101.183","50.3.182.133","185.220.101.182","185.220.101.184","188.172.229.15","89.58.18.210","45.9.150.130","190.103.179.98","108.181.124.143","178.218.144.51","185.220.101.66","185.220.101.70","185.220.101.68","185.220.101.77","185.220.101.78","185.220.101.81","185.220.101.71","185.220.101.83","185.220.101.75","185.220.101.85","185.220.101.73","185.220.101.82","185.220.101.65","185.220.101.84","185.220.101.76","185.220.101.86","185.220.101.69","185.220.101.67","185.220.101.80","185.220.101.64","185.220.101.74","185.220.101.79","185.220.101.72","185.220.101.87","199.249.230.120","184.75.221.171","5.182.86.212","104.244.72.115","198.23.133.132","23.94.36.142","198.98.60.90","84.19.182.20","45.9.148.219","217.160.88.146","104.219.232.126","45.139.122.241","199.195.253.156","75.119.142.240","199.249.230.103","199.249.230.104","199.249.230.116","199.249.230.101","199.249.230.119","199.249.230.100","199.249.230.102","199.249.230.109","199.249.230.81","199.249.230.176","199.249.230.79","199.249.230.167","199.249.230.88","199.249.230.188","199.249.230.80","199.249.230.144","199.249.230.78","199.249.230.111","199.249.230.68","199.249.230.180","199.249.230.150","199.249.230.70","199.249.230.77","199.249.230.112","199.249.230.65","199.249.230.183","199.249.230.189","199.249.230.178","199.249.230.145","199.249.230.115","199.249.230.147","199.249.230.66","199.249.230.140","199.249.230.114","199.249.230.170","199.249.230.71","199.249.230.148","199.249.230.67","199.249.230.75","199.249.230.146","199.249.230.151","199.249.230.187","199.249.230.174","199.249.230.143","199.249.230.118","199.249.230.64","199.249.230.85","199.249.230.113","199.249.230.155","199.249.230.153","199.249.230.89","45.77.67.251","123.253.35.32","45.83.104.137","94.32.66.15","185.220.101.181","185.220.101.178","185.220.101.177","185.220.101.175","185.220.101.172","94.16.116.86","5.181.80.107","198.50.207.20","107.189.7.168","85.215.76.62","185.247.184.105","178.236.247.122","109.107.190.171","193.233.233.124","193.218.118.188","2.58.95.45","45.154.98.102","92.205.185.52","92.205.163.226","185.217.125.210","5.255.118.104","212.69.167.80","23.137.249.227","5.255.118.244","71.19.148.129","143.42.114.46","45.33.15.243","104.237.158.32","172.232.161.205","172.232.161.206","74.207.248.172","172.233.209.179","45.66.35.21","45.66.35.35","45.66.35.10","45.66.35.20","45.66.35.22","51.210.138.64","130.204.161.3","175.214.127.6","31.220.85.162","198.96.155.3","50.118.225.160","45.135.132.20","23.152.24.77","45.95.169.99","94.75.225.81","37.228.129.131","23.137.249.62","103.172.134.26","199.249.230.121","191.252.111.55","35.0.127.52","185.129.62.63","23.94.211.25","185.220.101.139","185.220.101.144","185.220.101.130","185.220.101.156","185.220.101.128","185.220.101.131","185.220.101.154","185.220.101.164","185.220.101.180","185.220.101.155","185.220.101.133","185.220.101.190","185.220.101.151","185.220.101.174","185.220.101.148","185.220.101.129","185.220.101.185","37.221.208.68","87.120.254.132","5.255.106.9","45.15.158.165","193.35.18.105","178.17.170.23","185.146.232.243","194.163.178.164","94.140.115.63","37.228.129.24","81.0.248.210","193.35.18.98","45.128.232.170","193.35.18.96","45.128.232.102","193.35.18.94","193.35.18.95","149.102.128.242","89.187.143.31","193.239.232.228","103.208.86.5","193.35.18.120","185.130.44.43","185.219.142.126","37.1.201.144","5.255.99.108","85.204.116.211","130.193.10.21","130.193.15.79","84.239.46.144","178.218.162.62","199.249.230.122","199.249.230.84","45.141.202.164","199.249.230.74","148.113.2.107","199.249.230.105","199.249.230.73","199.249.230.110","199.249.230.72","199.249.230.86","103.129.222.46","64.5.123.66","185.239.71.160","5.42.80.233","5.42.80.235","200.25.27.112","46.226.107.206","103.106.3.175","96.42.26.63","192.42.116.26","192.42.116.17","192.42.116.14","192.42.116.22","192.42.116.25","192.42.116.27","74.208.106.128","213.232.235.83","91.208.197.144","51.195.166.174","198.98.53.136","157.143.80.38","198.50.128.237","193.233.232.86","144.126.152.77","158.220.80.216","154.16.116.61","45.88.223.151","144.126.132.30","89.147.110.214","89.163.155.136","107.189.13.93","77.232.143.255","77.232.143.243","77.232.143.248","94.228.163.25","199.249.230.186","199.249.230.177","199.249.230.159","199.249.230.161","199.249.230.163","199.249.230.149","199.249.230.154","199.249.230.164","199.249.230.160","199.249.230.173","199.249.230.158","199.249.230.157","199.249.230.108","199.249.230.83","199.249.230.168","199.249.230.82","199.249.230.166","199.249.230.123","199.249.230.106","199.249.230.76","199.249.230.117","199.249.230.169","199.249.230.171","199.249.230.175","199.249.230.107","199.249.230.152","199.249.230.162","2.58.95.53","199.249.230.69","2.58.95.47","2.58.95.59","2.58.95.56","178.175.142.26","199.249.230.156","199.249.230.87","103.28.52.93","185.107.70.56","89.147.108.56","148.113.2.104","38.242.203.135","162.247.74.201","172.232.238.10","5.255.98.198","5.255.98.231","23.137.249.150","149.102.155.205","199.249.230.179","199.249.230.165","199.249.230.182","199.249.230.184","199.249.230.142","136.243.147.59","199.249.230.185","185.220.101.89","149.102.145.222","185.220.101.90","185.220.101.88","87.118.110.27","37.48.70.156","185.165.190.111","5.255.125.153","205.185.124.176","107.189.14.41","93.95.228.81","172.81.131.140","185.38.142.4","95.168.173.143","178.218.144.18","189.147.238.226","189.147.187.10","189.147.242.169","104.219.236.93","161.35.129.51","86.104.194.13","104.244.74.159","185.220.101.40","185.220.101.32","185.220.101.38","185.220.101.37","185.220.101.35","185.220.101.33","185.220.101.34","185.220.101.41","185.220.101.42","205.185.127.100","185.220.101.57","185.220.101.43","185.220.101.46","185.220.101.58","185.220.101.61","185.220.101.60","185.220.101.63","185.220.101.54","185.220.101.52","185.220.101.62","185.220.101.56","185.220.101.44","185.220.101.49","5.255.117.56","185.220.101.55","185.220.101.45","185.220.101.53","185.220.101.59","185.220.101.51","185.220.101.48","185.220.101.47","185.220.101.50","95.111.238.0","152.89.233.169","89.147.110.82","176.58.117.81","23.155.8.104","51.89.153.112","5.61.51.143","5.135.174.213","37.120.166.23","37.252.255.135","82.153.138.48","185.81.115.120","45.139.122.176","84.211.225.54","31.220.87.46","144.172.73.6","51.89.200.109","212.44.107.82","89.147.111.124","94.177.106.59","94.177.106.55","94.177.106.46","93.95.231.88","152.32.238.235","74.208.96.95","38.242.239.62","87.118.114.44","80.78.25.9","185.193.125.95","107.173.179.59","179.43.159.78","81.17.28.95","45.79.129.209","82.221.139.190","107.189.13.254","81.19.137.127","149.102.129.11","81.0.218.34","93.90.74.31","51.81.254.4","109.123.231.55","185.196.8.2","158.220.81.45","62.149.23.133","158.220.81.47","158.220.81.78","209.141.51.180","176.121.81.51","178.17.170.184","202.61.226.98","202.139.229.157","89.147.111.106"]),checkIfTor=floBlockchainAPI.checkIfTor=()=>fetch("https://api.ipify.org?format=json").then((response=>response.json())).then((result=>torExitNodes.has(result.ip))).catch((e=>(console.error(e),!1)));let isTor=!1;checkIfTor().then((result=>{isTor=result,isTor&&DEFAULT.apiURL.FLO.push("http://kvrddx6heo47rbbt77etxg6litckacbgos3nv5z7vc23ol2kjjeq72id.onion/")}));const util=floBlockchainAPI.util={};util.Sat_to_FLO=value=>parseFloat((value/1e8).toFixed(8)),util.FLO_to_Sat=value=>parseInt(1e8*value),util.toFixed=value=>parseFloat(value.toFixed(8)),Object.defineProperties(floBlockchainAPI,{sendAmt:{get:()=>DEFAULT.sendAmt,set:amt=>isNaN(amt)?null:DEFAULT.sendAmt=amt},fee:{get:()=>DEFAULT.fee,set:fee=>isNaN(fee)?null:DEFAULT.fee=fee},defaultReceiver:{get:()=>DEFAULT.receiverID,set:floID=>DEFAULT.receiverID=floID},blockchain:{get:()=>DEFAULT.blockchain}}),floGlobals.sendAmt&&(floBlockchainAPI.sendAmt=floGlobals.sendAmt),floGlobals.fee&&(floBlockchainAPI.fee=floGlobals.fee),Object.defineProperties(floGlobals,{sendAmt:{get:()=>DEFAULT.sendAmt,set:amt=>isNaN(amt)?null:DEFAULT.sendAmt=amt},fee:{get:()=>DEFAULT.fee,set:fee=>isNaN(fee)?null:DEFAULT.fee=fee}});const allServerList=new Set(floGlobals.apiURL&&floGlobals.apiURL[DEFAULT.blockchain]?floGlobals.apiURL[DEFAULT.blockchain]:DEFAULT.apiURL[DEFAULT.blockchain]);var serverList=Array.from(allServerList),curPos=floCrypto.randInt(0,serverList.length-1);function fetch_retry(apicall,rm_node){return new Promise(((resolve,reject)=>{let i=serverList.indexOf(rm_node);-1!=i&&serverList.splice(i,1),curPos=floCrypto.randInt(0,serverList.length-1),fetch_api(apicall,!1).then((result=>resolve(result))).catch((error=>reject(error)))}))}function fetch_api(apicall,ic=!0){return new Promise(((resolve,reject)=>{if(0===serverList.length)ic?(serverList=Array.from(allServerList),curPos=floCrypto.randInt(0,serverList.length-1),fetch_api(apicall,!1).then((result=>resolve(result))).catch((error=>reject(error)))):reject("No FLO blockbook server working");else{let serverURL=serverList[curPos];fetch(serverURL+apicall).then((response=>{response.ok?response.json().then((data=>resolve(data))):fetch_retry(apicall,serverURL).then((result=>resolve(result))).catch((error=>reject(error)))})).catch((error=>{fetch_retry(apicall,serverURL).then((result=>resolve(result))).catch((error=>reject(error)))}))}}))}Object.defineProperties(floBlockchainAPI,{serverList:{get:()=>Array.from(serverList)},current_server:{get:()=>serverList[curPos]}});const promisedAPI=floBlockchainAPI.promisedAPI=floBlockchainAPI.fetch=function(apicall,query_params=void 0){return new Promise(((resolve,reject)=>{isUndefined(query_params)||(apicall+="?"+new URLSearchParams(JSON.parse(JSON.stringify(query_params))).toString()),fetch_api(apicall).then((result=>resolve(result))).catch((error=>reject(error)))}))},getBalance=floBlockchainAPI.getBalance=function(addr){return new Promise(((resolve,reject)=>{promisedAPI(`api/address/${addr}`,{details:"basic"}).then((result=>resolve(result.balance))).catch((error=>reject(error)))}))};const getUTXOs=address=>new Promise(((resolve,reject)=>{promisedAPI(`api/utxo/${address}`,{confirmed:!0}).then((utxos=>{let scriptPubKey=function(address){var tx=bitjs.transaction();tx.addoutput(address,0);let outputBuffer=tx.outputs.pop().script;return Crypto.util.bytesToHex(outputBuffer)}(address);utxos.forEach((u=>u.scriptPubKey=scriptPubKey)),resolve(utxos)})).catch((error=>reject(error)))})),createTx=function(senderAddr,receiverAddr,sendAmt,floData="",strict_utxo=!0){return new Promise(((resolve,reject)=>floCrypto.validateASCII(floData)?floCrypto.validateFloID(senderAddr,!0)?floCrypto.validateFloID(receiverAddr)?"number"!=typeof sendAmt||sendAmt<=0?reject(`Invalid sendAmt : ${sendAmt}`):void getBalance(senderAddr).then((balance=>{var fee=DEFAULT.fee;if(balance{for(var trx=bitjs.transaction(),utxoAmt=0,i=utxos.length-1;i>=0&&utxoAmtDEFAULT.minChangeAmt&&trx.addoutput(senderAddr,change),trx.addflodata(floData.replace(/\n/g," ")),resolve(trx)}})).catch((error=>reject(error)))})).catch((error=>reject(error))):reject(`Invalid address : ${receiverAddr}`):reject(`Invalid address : ${senderAddr}`):reject("Invalid FLO_Data: only printable ASCII characters are allowed")))};floBlockchainAPI.createTx=function(senderAddr,receiverAddr,sendAmt,floData="",strict_utxo=!0){return new Promise(((resolve,reject)=>{createTx(senderAddr,receiverAddr,sendAmt,floData,strict_utxo).then((trx=>resolve(trx.serialize()))).catch((error=>reject(error)))}))};const sendTx=floBlockchainAPI.sendTx=function(senderAddr,receiverAddr,sendAmt,privKey,floData="",strict_utxo=!0){return new Promise(((resolve,reject)=>floCrypto.validateFloID(senderAddr,!0)?privKey.length<1||!floCrypto.verifyPrivKey(privKey,senderAddr)?reject("Invalid Private key!"):void createTx(senderAddr,receiverAddr,sendAmt,floData,strict_utxo).then((trx=>{var signedTxHash=trx.sign(privKey,1);broadcastTx(signedTxHash).then((txid=>resolve(txid))).catch((error=>reject(error)))})).catch((error=>reject(error))):reject(`Invalid address : ${senderAddr}`)))};floBlockchainAPI.writeData=function(senderAddr,data,privKey,receiverAddr=DEFAULT.receiverID,options={}){let strict_utxo=!1!==options.strict_utxo,sendAmt=isNaN(options.sendAmt)?DEFAULT.sendAmt:options.sendAmt;return new Promise(((resolve,reject)=>{"string"!=typeof data&&(data=JSON.stringify(data)),sendTx(senderAddr,receiverAddr,sendAmt,privKey,data,strict_utxo).then((txid=>resolve(txid))).catch((error=>reject(error)))}))},floBlockchainAPI.mergeUTXOs=function(floID,privKey,floData=""){return new Promise(((resolve,reject)=>{if(!floCrypto.validateFloID(floID,!0))return reject("Invalid floID");if(!floCrypto.verifyPrivKey(privKey,floID))return reject("Invalid Private Key");if(!floCrypto.validateASCII(floData))return reject("Invalid FLO_Data: only printable ASCII characters are allowed");var trx=bitjs.transaction(),utxoAmt=0,fee=DEFAULT.fee;getUTXOs(floID).then((utxos=>{for(var i=utxos.length-1;i>=0;i--)utxos[i].confirmations&&(trx.addinput(utxos[i].txid,utxos[i].vout,utxos[i].scriptPubKey),utxoAmt+=utxos[i].amount);trx.addoutput(floID,utxoAmt-fee),trx.addflodata(floData.replace(/\n/g," "));var signedTxHash=trx.sign(privKey,1);broadcastTx(signedTxHash).then((txid=>resolve(txid))).catch((error=>reject(error)))})).catch((error=>reject(error)))}))},floBlockchainAPI.splitUTXOs=function(floID,privKey,count,floData=""){return new Promise(((resolve,reject)=>{if(!floCrypto.validateFloID(floID,!0))return reject("Invalid floID");if(!floCrypto.verifyPrivKey(privKey,floID))return reject("Invalid Private Key");if(!floCrypto.validateASCII(floData))return reject("Invalid FLO_Data: only printable ASCII characters are allowed");var fee=DEFAULT.fee,splitAmt=DEFAULT.sendAmt+fee,totalAmt=splitAmt*count;getBalance(floID).then((balance=>{var fee=DEFAULT.fee;if(balance{var trx=bitjs.transaction(),utxoAmt=0;for(let i=utxos.length-1;i>=0&&utxoAmtDEFAULT.minChangeAmt&&trx.addoutput(floID,change),trx.addflodata(floData.replace(/\n/g," "));var signedTxHash=trx.sign(privKey,1);broadcastTx(signedTxHash).then((txid=>resolve(txid))).catch((error=>reject(error)))}})).catch((error=>reject(error)))})).catch((error=>reject(error)))}))},floBlockchainAPI.writeDataMultiple=function(senderPrivKeys,data,receivers=[DEFAULT.receiverID],options={}){return new Promise(((resolve,reject)=>{if(!Array.isArray(senderPrivKeys))return reject("Invalid senderPrivKeys: SenderPrivKeys must be Array");if(!1===options.preserveRatio){let tmp={},amount=DEFAULT.sendAmt*receivers.length/senderPrivKeys.length;senderPrivKeys.forEach((key=>tmp[key]=amount)),senderPrivKeys=tmp}if(!Array.isArray(receivers))return reject("Invalid receivers: Receivers must be Array");{let tmp={},amount=options.sendAmt||DEFAULT.sendAmt;receivers.forEach((floID=>tmp[floID]=amount)),receivers=tmp}"string"!=typeof data&&(data=JSON.stringify(data)),sendTxMultiple(senderPrivKeys,receivers,data).then((txid=>resolve(txid))).catch((error=>reject(error)))}))};const sendTxMultiple=floBlockchainAPI.sendTxMultiple=function(senderPrivKeys,receivers,floData=""){return new Promise(((resolve,reject)=>{if(!floCrypto.validateASCII(floData))return reject("Invalid FLO_Data: only printable ASCII characters are allowed");let preserveRatio,senders={};try{let invalids={InvalidSenderPrivKeys:[],InvalidSenderAmountFor:[],InvalidReceiverIDs:[],InvalidReceiveAmountFor:[]},inputVal=0,outputVal=0;if(Array.isArray(senderPrivKeys))senderPrivKeys.forEach((key=>{try{if(key){let floID=floCrypto.getFloID(key);senders[floID]={wif:key}}else invalids.InvalidSenderPrivKeys.push(key)}catch(error){invalids.InvalidSenderPrivKeys.push(key)}})),preserveRatio=!0;else{for(let key in senderPrivKeys)try{if(key){"number"!=typeof senderPrivKeys[key]||senderPrivKeys[key]<=0?invalids.InvalidSenderAmountFor.push(key):inputVal+=senderPrivKeys[key];let floID=floCrypto.getFloID(key);senders[floID]={wif:key,coins:senderPrivKeys[key]}}else invalids.InvalidSenderPrivKeys.push(key)}catch(error){invalids.InvalidSenderPrivKeys.push(key)}preserveRatio=!1}for(let floID in receivers)floCrypto.validateFloID(floID)||invalids.InvalidReceiverIDs.push(floID),"number"!=typeof receivers[floID]||receivers[floID]<=0?invalids.InvalidReceiveAmountFor.push(floID):outputVal+=receivers[floID];for(let i in invalids)invalids[i].length||delete invalids[i];if(Object.keys(invalids).length)return reject(invalids);if(!preserveRatio&&inputVal!=outputVal)return reject(`Input Amount (${inputVal}) not equal to Output Amount (${outputVal})`)}catch(error){return reject(error)}let promises=[];for(let floID in senders)promises.push(getBalance(floID));Promise.all(promises).then((results=>{let totalBalance=0,totalFee=DEFAULT.fee,balance={};if(!preserveRatio)var dividedFee=totalFee/Object.keys(senders).length;let insufficient=[];for(let floID in senders)balance[floID]=parseFloat(results.shift()),(isNaN(balance[floID])||preserveRatio&&balance[floID]<=totalFee||!preserveRatio&&balance[floID]{var trx=bitjs.transaction();for(let floID in senders){let sendAmt,utxos=results.shift();if(preserveRatio){let ratio=balance[floID]/totalBalance;sendAmt=totalSendAmt*ratio}else sendAmt=senders[floID].coins+dividedFee;let utxoAmt=0;for(let i=utxos.length-1;i>=0&&utxoAmt0&&trx.addoutput(floID,change)}for(let floID in receivers)trx.addoutput(floID,receivers[floID]);trx.addflodata(floData.replace(/\n/g," "));for(let floID in senders)trx.sign(senders[floID].wif,1);var signedTxHash=trx.serialize();broadcastTx(signedTxHash).then((txid=>resolve(txid))).catch((error=>reject(error)))})).catch((error=>reject(error)))})).catch((error=>reject(error)))}))},createMultisigTx=function(redeemScript,receivers,amounts,floData="",strict_utxo=!0){return new Promise(((resolve,reject)=>{var multisig=floCrypto.decodeRedeemScript(redeemScript);if(!multisig)return reject("Invalid redeemScript");var senderAddr=multisig.address;if(!floCrypto.validateFloID(senderAddr))return reject(`Invalid multisig : ${senderAddr}`);if(!floCrypto.validateASCII(floData))return reject("Invalid FLO_Data: only printable ASCII characters are allowed");Array.isArray(receivers)||(receivers=[receivers]);for(let r of receivers)if(!floCrypto.validateFloID(r))return reject(`Invalid address : ${r}`);if(Array.isArray(amounts)||(amounts=[amounts]),amounts.length!=receivers.length)return reject("Receivers and amounts have different length");var sendAmt=0;for(let a of amounts){if("number"!=typeof a||a<=0)return reject(`Invalid amount : ${a}`);sendAmt+=a}getBalance(senderAddr).then((balance=>{var fee=DEFAULT.fee;if(balance{for(var trx=bitjs.transaction(),utxoAmt=0,i=utxos.length-1;i>=0&&utxoAmtDEFAULT.minChangeAmt&&trx.addoutput(senderAddr,change),trx.addflodata(floData.replace(/\n/g," ")),resolve(trx)}})).catch((error=>reject(error)))})).catch((error=>reject(error)))}))};floBlockchainAPI.createMultisigTx=function(redeemScript,receivers,amounts,floData="",strict_utxo=!0){return new Promise(((resolve,reject)=>{createMultisigTx(redeemScript,receivers,amounts,floData,strict_utxo).then((trx=>resolve(trx.serialize()))).catch((error=>reject(error)))}))};const sendMultisigTx=floBlockchainAPI.sendMultisigTx=function(redeemScript,privateKeys,receivers,amounts,floData="",strict_utxo=!0){return new Promise(((resolve,reject)=>{var multisig=floCrypto.decodeRedeemScript(redeemScript);if(!multisig)return reject("Invalid redeemScript");if(privateKeys.length{for(let pk of privateKeys)trx.sign(pk,1);var signedTxHash=trx.serialize();broadcastTx(signedTxHash).then((txid=>resolve(txid))).catch((error=>reject(error)))})).catch((error=>reject(error)))}))};function deserializeTx(tx){if("string"==typeof tx||Array.isArray(tx))try{tx=bitjs.transaction(tx)}catch{throw"Invalid transaction hex"}else if("object"!=typeof tx||"function"!=typeof tx.sign)throw"Invalid transaction object";return tx}floBlockchainAPI.writeMultisigData=function(redeemScript,data,privatekeys,receiverAddr=DEFAULT.receiverID,options={}){let strict_utxo=!1!==options.strict_utxo,sendAmt=isNaN(options.sendAmt)?DEFAULT.sendAmt:options.sendAmt;return new Promise(((resolve,reject)=>{if(!floCrypto.validateFloID(receiverAddr))return reject(`Invalid receiver: ${receiverAddr}`);sendMultisigTx(redeemScript,privatekeys,receiverAddr,sendAmt,data,strict_utxo).then((txid=>resolve(txid))).catch((error=>reject(error)))}))},floBlockchainAPI.signTx=function(tx,privateKey,sighashtype=1){if(!floCrypto.getFloID(privateKey))throw"Invalid Private key";return(tx=deserializeTx(tx)).sign(privateKey,sighashtype)};const checkSigned=floBlockchainAPI.checkSigned=function(tx,bool=!0){tx=deserializeTx(tx);let n=[];for(let i=0;ix.t)throw"signaturesRequired is more than publicKeys";x.s!0!==x)).length:n};floBlockchainAPI.checkIfSameTx=function(tx1,tx2){if(tx1=deserializeTx(tx1),tx2=deserializeTx(tx2),tx1.inputs.length!==tx2.inputs.length||tx1.outputs.length!==tx2.outputs.length)return!1;if(tx1.floData!==tx2.floData)return!1;for(let i=0;inew Promise(((resolve,reject)=>{promisedAPI(`api/tx/${txid}`).then((result=>resolve(result.vout[i]))).catch((error=>reject(error)))}));function getOutputAddress(outscript){var bytes,version;switch(outscript[0]){case 118:bytes=outscript.slice(3,outscript.length-2),version=bitjs.pub;break;case 169:bytes=outscript.slice(2,outscript.length-1),version=bitjs.multisig;break;default:return}bytes.unshift(version);var checksum=Crypto.SHA256(Crypto.SHA256(bytes,{asBytes:!0}),{asBytes:!0}).slice(0,4);return bitjs.Base58.encode(bytes.concat(checksum))}floBlockchainAPI.parseTransaction=function(tx){return new Promise(((resolve,reject)=>{tx=deserializeTx(tx);let result={},promises=[];for(let i=0;i{result.inputs=inputs.map((inp=>Object({address:inp.scriptPubKey.addresses[0],value:parseFloat(inp.value)})));let signed=checkSigned(tx,!1);result.inputs.forEach(((inp,i)=>inp.signed=signed[i])),result.outputs=tx.outputs.map((out=>Object({address:getOutputAddress(out.script),value:util.Sat_to_FLO(out.value)}))),result.total_input=parseFloat(result.inputs.reduce(((a,inp)=>a+inp.value),0).toFixed(8)),result.total_output=parseFloat(result.outputs.reduce(((a,out)=>a+out.value),0).toFixed(8)),result.fee=parseFloat((result.total_input-result.total_output).toFixed(8)),result.floData=tx.floData,resolve(result)})).catch((error=>reject(error)))}))};const broadcastTx=floBlockchainAPI.broadcastTx=function(signedTxHash){return new Promise(((resolve,reject)=>{if(signedTxHash.length<1)return reject("Empty Transaction Data");promisedAPI("/api/sendtx/"+signedTxHash).then((response=>resolve(response.result))).catch((error=>reject(error)))}))},getTx=floBlockchainAPI.getTx=function(txid){return new Promise(((resolve,reject)=>{promisedAPI(`api/tx/${txid}`).then((response=>resolve(response))).catch((error=>reject(error)))}))},waitForConfirmation=floBlockchainAPI.waitForConfirmation=function(txid,max_retry=-1,retry_timeout=20){return new Promise(((resolve,reject)=>{setTimeout((function(){getTx(txid).then((tx=>tx?tx.confirmations?resolve(tx):0===max_retry?reject("Waiting timeout: tx still not confirmed"):void waitForConfirmation(txid,max_retry=max_retry<0?-1:max_retry-1,retry_timeout).then((result=>resolve(result))).catch((error=>reject(error))):reject("Transaction not found"))).catch((error=>reject(error)))}),1e3*retry_timeout)}))},readTxs=floBlockchainAPI.readTxs=function(addr,options={}){return new Promise(((resolve,reject)=>{let query_params={details:"txs"};!isUndefined(options.page)&&Number.isInteger(options.page)&&(query_params.page=options.page),!isUndefined(options.pageSize)&&Number.isInteger(options.pageSize)&&(query_params.pageSize=options.pageSize),options.confirmed&&(query_params.confirmed=!0),promisedAPI(`api/address/${addr}`,query_params).then((response=>{Array.isArray(response.txs)||(response.txs=[]),resolve(response)})).catch((error=>reject(error)))}))};function readAllTxs_oldSupport(addr,options,ignoreOld=0,cacheTotal=0){return new Promise(((resolve,reject)=>{readTxs(addr,options).then((response=>{cacheTotal+=response.txs.length;let n_remaining=response.txApperances-cacheTotal;if(n_remainingresolve(response.txs.concat(result)))).catch((error=>reject(error))))})).catch((error=>reject(error)))}))}function readAllTxs_new(addr,options,lastItem){return new Promise(((resolve,reject)=>{readTxs(addr,options).then((response=>{let i=response.txs.findIndex((t=>t.txid===lastItem));-1!=i?resolve(response.txs.slice(0,i)):response.page==response.totalPages?resolve(response.txs):(options.page=response.page+1,readAllTxs_new(addr,options,lastItem).then((result=>resolve(response.txs.concat(result)))).catch((error=>reject(error))))})).catch((error=>reject(error)))}))}const readAllTxs=floBlockchainAPI.readAllTxs=function(addr,options={}){return new Promise(((resolve,reject)=>{Number.isInteger(options.ignoreOld)?readAllTxs_oldSupport(addr,options,options.ignoreOld).then((txs=>{let last_tx=txs.find((t=>t.confirmations>0)),new_lastItem=last_tx?last_tx.txid:options.ignoreOld;resolve({lastItem:new_lastItem,items:txs})})).catch((error=>reject(error))):readAllTxs_new(addr,options,options.after).then((txs=>{let last_tx=txs.find((t=>t.confirmations>0)),new_lastItem=last_tx?last_tx.txid:options.after;resolve({lastItem:new_lastItem,items:txs})})).catch((error=>reject(error)))}))};floBlockchainAPI.readData=function(addr,options={}){return new Promise(((resolve,reject)=>{let query_options={};query_options.confirmed=!!isUndefined(options.confirmed)||options.confirmed,isUndefined(options.after)?isUndefined(options.ignoreOld)||(query_options.ignoreOld=options.ignoreOld):query_options.after=options.after,readAllTxs(addr,query_options).then((response=>{"string"==typeof options.senders&&(options.senders=[options.senders]),"string"==typeof options.receivers&&(options.receivers=[options.receivers]);const filteredData=response.items.filter((tx=>{if(!tx.confirmations)return!1;if(options.sentOnly&&!tx.vin.some((vin=>vin.addresses[0]===addr)))return!1;if(Array.isArray(options.senders)&&!tx.vin.some((vin=>options.senders.includes(vin.addresses[0]))))return!1;if(options.receivedOnly&&!tx.vout.some((vout=>vout.scriptPubKey.addresses[0]===addr)))return!1;if(Array.isArray(options.receivers)&&!tx.vout.some((vout=>options.receivers.includes(vout.scriptPubKey.addresses[0]))))return!1;if(options.pattern)try{let jsonContent=JSON.parse(tx.floData);if(!Object.keys(jsonContent).includes(options.pattern))return!1}catch{return!1}return!(options.filter&&!options.filter(tx.floData))})).map((tx=>options.tx?{txid:tx.txid,time:tx.time,blockheight:tx.blockheight,senders:new Set(tx.vin.map((v=>v.addresses[0]))),receivers:new Set(tx.vout.map((v=>v.scriptPubKey.addresses[0]))),data:tx.floData}:tx.floData)),result={lastItem:response.lastItem};options.tx?result.items=filteredData:result.data=filteredData,resolve(result)})).catch((error=>reject(error)))}))};const getLatestData=floBlockchainAPI.getLatestData=function(addr,caseFn,options={}){return new Promise(((resolve,reject)=>{let new_lastItem,query_options={};query_options.confirmed=!!isUndefined(options.confirmed)||options.confirmed,isUndefined(options.page)||(query_options.page=options.page),readTxs(addr,query_options).then((response=>{if(!new_lastItem){let last_tx=response.items.find((t=>t.confirmations>0));last_tx&&(new_lastItem=last_tx.txid)}"string"==typeof options.senders&&(options.senders=[options.senders]),"string"==typeof options.receivers&&(options.receivers=[options.receivers]);let i_after=response.txs.findIndex((t=>t.txid===options.after));-1!=i_after&&response.items.splice(i_after);var item=response.items.find((tx=>!!tx.confirmations&&(!(options.sentOnly&&!tx.vin.some((vin=>vin.addresses[0]===addr)))&&(!(Array.isArray(options.senders)&&!tx.vin.some((vin=>options.senders.includes(vin.addresses[0]))))&&(!(options.receivedOnly&&!tx.vout.some((vout=>vout.scriptPubKey.addresses[0]===addr)))&&(!(Array.isArray(options.receivers)&&!tx.vout.some((vout=>options.receivers.includes(vout.scriptPubKey.addresses[0]))))&&!!caseFn(tx.floData)))))));if(!isUndefined(item)){const result={lastItem:new_lastItem||item.txid};return options.tx?result.item={txid:item.txid,time:item.time,blockheight:item.blockheight,senders:new Set(item.vin.map((v=>v.addresses[0]))),receivers:new Set(item.vout.map((v=>v.scriptPubKey.addresses[0]))),data:item.floData}:result.data=item.floData,resolve(result)}response.page==response.totalPages||-1!=i_after?resolve({lastItem:new_lastItem||options.after}):(options.page=response.page+1,getLatestData(addr,caseFn,options).then((result=>resolve(result))).catch((error=>reject(error))))})).catch((error=>reject(error)))}))}}();
\ No newline at end of file
diff --git a/exchangemarket/docs/scripts/floTokenAPI.js b/exchangemarket/docs/scripts/floTokenAPI.js
index 2456b88..dd4eee6 100644
--- a/exchangemarket/docs/scripts/floTokenAPI.js
+++ b/exchangemarket/docs/scripts/floTokenAPI.js
@@ -1,16 +1,34 @@
-(function (EXPORTS) { //floTokenAPI v1.0.4a
+(function (EXPORTS) { //floTokenAPI v1.2.0
/* Token Operator to send/receive tokens via blockchain using API calls*/
'use strict';
const tokenAPI = EXPORTS;
const DEFAULT = {
- apiURL: floGlobals.tokenURL || "https://ranchimallflo.duckdns.org/",
+ apiURL: [floGlobals.tokenURL || "https://ranchimallflo.ranchimall.net/"],
currency: floGlobals.currency || "rupee"
}
+ const torExitNodes = new Set(["185.241.208.232", "194.26.192.64", "171.25.193.25", "80.67.167.81", "192.42.116.187", "198.98.51.189", "89.58.26.216", "109.70.100.4", "149.56.22.133", "5.45.102.93", "178.17.174.14", "192.42.116.196", "185.220.101.4", "45.141.215.62", "94.102.51.15", "192.42.116.213", "107.189.28.166", "185.241.208.243", "45.141.215.80", "193.26.115.61", "192.42.116.175", "149.56.44.47", "107.189.13.91", "87.118.116.103", "178.17.171.102", "185.243.218.110", "192.42.116.208", "89.58.41.156", "2.58.56.43", "104.192.1.138", "45.95.169.184", "107.189.8.56", "176.58.121.177", "185.220.101.31", "45.141.215.200", "109.70.100.1", "185.244.192.175", "185.129.61.2", "144.172.118.41", "192.42.116.184", "45.151.167.10", "185.220.101.27", "91.203.144.194", "45.141.215.88", "179.43.182.232", "185.220.101.5", "109.70.100.2", "107.189.14.4", "94.16.116.81", "185.220.101.8", "185.220.101.12", "88.80.20.86", "23.154.177.15", "45.141.215.56", "5.42.66.6", "23.129.64.225", "104.244.75.74", "45.95.169.228", "37.187.5.192", "45.141.215.169", "109.70.100.66", "45.79.144.222", "185.227.68.78", "179.43.159.199", "2.57.122.246", "192.42.116.201", "185.220.102.248", "195.176.3.23", "45.138.16.42", "216.73.159.75", "185.165.169.239", "23.129.64.213", "109.70.100.6", "45.80.158.27", "45.138.16.240", "178.20.55.16", "192.42.116.173", "51.15.249.160", "192.42.116.200", "185.220.102.254", "45.141.215.63", "193.218.118.151", "192.42.116.211", "185.100.85.24", "185.195.71.12", "107.189.8.181", "193.189.100.199", "109.70.100.69", "185.100.87.250", "31.220.93.201", "89.236.112.100", "45.141.215.90", "185.35.202.222", "109.70.100.65", "95.142.161.63", "192.42.116.181", "192.42.116.23", "194.26.192.77", "193.189.100.198", "180.150.226.99", "23.129.64.227", "107.189.4.23", "45.141.215.235", "185.220.102.252", "109.70.100.67", "185.220.100.255", "185.220.101.21", "185.100.85.22", "128.31.0.13", "46.182.21.248", "192.42.116.174", "185.241.208.115", "185.220.101.1", "192.42.116.202", "45.141.215.97", "185.243.218.204", "78.142.18.219", "192.42.116.192", "190.120.229.98", "192.42.116.177", "45.138.16.113", "192.42.116.212", "185.220.101.3", "45.138.16.222", "5.42.80.232", "87.118.122.51", "107.189.11.166", "185.220.102.245", "185.220.102.251", "46.182.21.250", "5.255.103.235", "185.243.218.89", "185.193.52.180", "185.220.101.24", "2.57.122.215", "45.15.157.177", "185.220.100.253", "37.48.120.64", "204.8.156.142", "192.42.116.179", "185.220.100.240", "185.241.208.236", "185.195.71.244", "193.105.134.155", "51.15.59.15", "185.100.85.23", "45.151.167.11", "82.197.182.161", "192.42.116.191", "27.255.75.198", "171.25.193.79", "45.95.169.255", "45.138.16.230", "107.189.29.103", "163.172.213.212", "95.143.193.125", "23.154.177.7", "185.220.101.23", "195.176.3.24", "107.189.1.9", "192.42.116.182", "23.137.249.240", "192.42.116.189", "23.129.64.146", "45.138.16.107", "107.189.5.121", "107.189.30.236", "94.16.121.91", "109.70.100.70", "185.254.196.141", "194.15.112.133", "192.42.116.180", "173.249.57.253", "185.220.102.250", "185.100.85.25", "185.220.101.13", "185.220.101.25", "192.42.116.199", "23.154.177.2", "107.189.31.232", "45.141.215.81", "192.42.116.220", "185.67.82.114", "45.141.215.114", "185.243.218.61", "107.189.13.184", "107.189.10.141", "104.244.79.61", "185.106.94.195", "176.126.253.190", "23.154.177.22", "192.42.116.210", "185.220.102.249", "23.184.48.127", "192.42.116.218", "91.208.75.4", "192.42.116.178", "178.175.148.209", "208.109.36.224", "23.137.251.61", "94.142.241.194", "162.251.5.152", "23.154.177.4", "45.138.16.76", "45.9.150.103", "213.252.140.118", "185.243.218.95", "45.134.225.36", "109.70.100.5", "185.243.218.202", "185.220.101.19", "192.42.116.176", "109.70.100.71", "45.151.167.13", "185.220.102.4", "185.220.102.7", "104.244.79.50", "178.17.174.198", "199.195.249.214", "66.146.193.33", "107.189.8.238", "139.99.8.57", "45.141.215.95", "192.42.116.219", "114.199.75.111", "185.220.100.242", "5.42.80.234", "173.237.206.68", "139.99.172.11", "23.129.64.143", "80.241.60.207", "192.42.116.194", "45.95.169.226", "185.220.102.8", "109.70.100.3", "179.43.159.200", "192.42.116.217", "185.220.101.6", "198.98.50.199", "185.100.87.192", "193.189.100.202", "163.172.45.102", "185.220.101.0", "107.189.8.133", "185.129.61.6", "104.244.78.233", "192.42.116.15", "192.42.116.195", "45.141.215.110", "193.189.100.203", "77.48.28.237", "104.244.79.232", "193.26.115.43", "199.195.250.165", "190.211.254.97", "45.141.215.61", "185.220.101.17", "192.42.116.203", "185.220.102.247", "91.132.144.59", "185.141.147.129", "23.129.64.149", "185.183.157.214", "95.211.244.28", "192.42.116.188", "188.214.104.21", "192.42.116.186", "192.42.116.197", "107.189.13.247", "212.73.134.204", "185.235.146.29", "188.68.49.235", "92.205.237.227", "23.154.177.12", "199.195.253.180", "171.25.193.234", "185.241.208.71", "96.66.15.152", "94.16.121.226", "204.85.191.9", "91.210.59.57", "5.255.115.42", "185.220.103.113", "216.239.90.19", "77.91.87.79", "192.42.116.216", "23.154.177.23", "192.42.116.198", "173.255.255.215", "144.217.80.80", "107.189.10.175", "45.95.169.227", "103.251.167.20", "185.220.101.30", "5.255.125.196", "198.98.48.192", "185.220.102.242", "23.154.177.18", "185.86.148.90", "185.142.239.49", "185.220.101.2", "5.255.100.219", "107.189.5.7", "199.195.251.119", "185.220.101.10", "92.246.84.133", "66.220.242.222", "184.105.48.40", "23.129.64.133", "185.130.44.108", "192.42.116.20", "185.181.61.115", "192.42.116.19", "149.202.79.129", "146.59.35.38", "23.154.177.20", "185.191.204.254", "23.154.177.3", "185.233.100.23", "23.154.177.19", "45.92.1.74", "107.189.31.225", "89.58.18.10", "138.59.18.110", "185.246.188.73", "192.42.116.221", "104.244.77.192", "192.42.116.214", "178.170.37.11", "188.68.41.191", "192.42.116.183", "185.220.103.115", "178.175.135.7", "209.141.51.30", "141.98.11.62", "171.25.193.235", "23.137.249.143", "179.43.159.197", "192.99.168.180", "185.220.101.11", "185.243.218.41", "89.234.157.254", "47.243.74.136", "107.189.28.199", "185.129.61.9", "185.220.101.28", "185.220.101.29", "5.255.99.5", "179.43.182.58", "185.129.61.3", "23.129.64.135", "107.189.30.69", "51.15.227.109", "185.207.107.216", "185.129.61.129", "185.100.87.41", "23.129.64.145", "179.43.159.201", "23.129.64.224", "192.42.116.28", "93.99.104.194", "185.244.192.184", "45.95.169.223", "104.244.73.43", "185.56.83.83", "87.120.254.48", "185.185.170.27", "195.88.74.206", "107.174.138.172", "109.70.100.68", "23.129.64.139", "94.230.208.147", "77.91.85.147", "77.81.247.72", "2.58.56.220", "185.220.103.7", "149.202.79.101", "5.255.104.202", "178.175.148.195", "83.96.213.63", "185.100.87.174", "79.137.195.103", "185.220.101.20", "107.189.3.11", "185.220.101.22", "185.220.101.7", "217.12.221.131", "179.43.159.196", "45.95.169.230", "107.189.1.160", "208.109.215.188", "171.25.193.78", "204.194.29.4", "104.244.77.80", "162.247.72.199", "89.58.52.25", "192.42.116.209", "217.146.2.41", "185.220.103.117", "23.154.177.10", "91.208.75.3", "94.230.208.148", "95.128.43.164", "171.25.193.20", "102.130.113.9", "91.92.109.43", "107.189.7.144", "185.220.102.240", "5.255.124.150", "198.98.60.158", "185.227.134.106", "193.233.233.221", "71.19.144.106", "185.84.31.254", "23.129.64.132", "62.171.137.169", "193.189.100.196", "185.220.101.18", "107.189.12.3", "91.208.75.178", "193.35.18.49", "185.246.188.74", "45.132.246.245", "209.141.55.26", "198.98.48.20", "185.129.61.1", "108.61.189.136", "185.220.102.243", "107.189.1.96", "185.100.87.136", "213.95.149.22", "23.129.64.217", "192.42.116.185", "5.45.104.176", "192.42.116.193", "23.154.177.16", "198.98.49.203", "171.25.193.77", "91.208.75.153", "162.247.74.216", "179.43.159.194", "54.36.108.162", "198.98.48.33", "188.68.52.231", "185.220.100.252", "205.185.124.193", "104.244.73.190", "185.100.87.139", "23.154.177.25", "77.105.146.42", "79.137.202.92", "51.38.81.135", "87.118.116.90", "23.129.64.134", "185.246.188.67", "185.129.62.62", "185.220.100.241", "82.221.131.71", "209.141.59.116", "194.195.120.132", "185.207.107.130", "178.218.144.99", "172.104.243.155", "93.99.104.128", "87.118.122.30", "185.100.87.253", "51.195.91.124", "104.192.3.74", "185.252.232.218", "23.129.64.141", "5.196.95.34", "185.220.102.6", "23.184.48.128", "193.239.232.102", "185.220.101.16", "91.203.145.116", "185.129.61.4", "23.129.64.147", "37.228.129.63", "45.151.167.12", "93.95.228.205", "185.220.102.244", "209.141.54.203", "93.95.230.165", "94.142.244.16", "162.247.72.192", "185.146.232.234", "81.16.33.42", "107.189.30.86", "51.81.222.62", "23.154.177.5", "77.220.196.253", "72.167.47.69", "185.220.101.26", "104.219.236.100", "192.42.116.204", "185.246.128.161", "200.122.181.2", "199.195.253.247", "109.201.133.100", "142.44.234.69", "89.147.110.202", "89.185.85.140", "104.244.79.44", "5.2.79.179", "23.129.64.130", "104.244.78.187", "23.154.177.13", "5.255.97.221", "92.205.129.119", "80.82.78.14", "23.154.177.8", "51.38.113.118", "45.61.184.205", "107.189.31.134", "185.220.103.114", "179.48.251.188", "135.125.205.25", "198.98.54.49", "193.189.100.205", "185.220.102.253", "45.79.50.161", "202.69.76.36", "79.137.198.213", "46.166.139.111", "5.255.111.64", "51.89.138.51", "216.73.159.101", "166.70.207.2", "96.27.198.133", "194.15.115.212", "46.234.47.105", "146.59.35.246", "23.137.248.100", "185.220.102.241", "107.189.14.43", "212.95.50.77", "128.127.180.156", "80.67.172.162", "185.129.61.5", "185.129.61.10", "23.129.64.214", "185.220.100.254", "160.119.249.240", "185.243.218.46", "185.220.102.246", "104.244.74.97", "23.129.64.228", "23.129.64.218", "185.220.100.243", "54.36.101.21", "5.255.99.124", "107.189.13.253", "130.149.80.199", "171.25.193.80", "144.24.197.112", "199.195.251.78", "23.129.64.223", "195.80.151.30", "185.7.33.146", "107.189.4.12", "45.95.169.229", "107.189.6.124", "46.38.255.27", "107.189.8.226", "143.42.199.223", "103.251.167.10", "185.34.33.2", "5.255.98.23", "74.82.47.194", "194.163.157.49", "192.42.116.215", "185.220.101.14", "194.15.113.118", "89.147.108.62", "185.220.101.15", "185.42.170.203", "23.154.177.6", "162.247.74.27", "199.195.253.124", "193.189.100.201", "62.182.84.146", "191.101.217.24", "23.129.64.229", "85.93.218.204", "178.17.174.164", "205.185.117.149", "193.218.118.133", "23.154.177.21", "5.255.101.10", "82.221.131.5", "193.189.100.204", "103.196.37.111", "103.109.101.105", "192.42.116.18", "23.129.64.226", "107.189.13.251", "45.56.81.190", "192.42.116.13", "107.189.11.111", "198.46.166.157", "185.220.103.119", "54.38.183.101", "77.68.20.217", "185.220.101.36", "103.236.201.88", "162.247.74.213", "185.129.61.8", "89.147.110.154", "45.95.169.225", "141.239.149.94", "82.221.128.191", "72.14.179.10", "46.232.251.191", "23.129.64.215", "162.247.74.7", "23.154.177.14", "89.147.109.226", "193.41.226.117", "89.147.108.209", "23.129.64.137", "93.123.12.112", "185.14.97.37", "103.163.218.11", "23.129.64.131", "23.129.64.142", "23.137.249.185", "89.58.41.251", "185.220.101.9", "202.182.99.129", "205.185.119.35", "193.189.100.194", "204.85.191.8", "185.56.171.94", "23.129.64.144", "102.130.127.117", "192.42.116.24", "179.43.159.198", "185.38.175.133", "185.220.101.39", "193.168.143.129", "5.255.127.222", "95.211.210.103", "185.220.103.116", "23.129.64.211", "23.129.64.220", "185.113.128.30", "151.80.148.159", "192.99.149.111", "23.129.64.210", "37.228.129.128", "91.208.75.239", "185.220.103.120", "185.165.171.84", "193.105.134.150", "209.141.46.203", "209.141.50.178", "104.244.74.23", "45.95.169.224", "23.129.64.140", "176.118.193.33", "204.85.191.7", "104.244.73.193", "162.247.74.204", "91.208.75.156", "205.185.116.34", "125.212.241.131", "5.2.72.110", "179.43.159.195", "185.154.110.142", "91.206.26.26", "45.79.177.21", "23.154.177.9", "193.189.100.197", "46.165.243.36", "107.189.2.108", "23.154.177.17", "23.129.64.148", "5.45.98.162", "5.255.101.131", "23.129.64.136", "107.189.31.33", "185.82.219.109", "104.244.73.136", "185.129.61.7", "5.255.115.58", "23.154.177.24", "165.73.242.163", "193.189.100.200", "192.46.227.185", "5.196.8.113", "77.91.86.95", "85.209.176.103", "23.137.249.8", "5.255.98.151", "23.129.64.221", "23.129.64.219", "23.129.64.216", "185.243.218.35", "104.244.77.208", "94.228.169.70", "51.75.64.23", "176.58.100.98", "23.154.177.11", "23.129.64.138", "143.42.110.237", "94.16.112.22", "144.172.118.4", "185.130.47.58", "185.154.110.17", "104.244.72.132", "5.2.79.190", "23.129.64.212", "109.169.33.163", "5.2.67.226", "109.69.67.17", "108.181.27.205", "5.255.103.190", "107.189.14.106", "5.255.99.147", "193.189.100.206", "193.218.118.182", "185.181.61.142", "23.129.64.222", "193.35.18.77", "185.100.86.128", "91.203.5.118", "83.97.20.77", "45.138.16.203", "2.57.122.58", "185.181.61.18", "195.176.3.19", "195.176.3.20", "198.58.107.53", "138.128.222.68", "118.163.74.160", "185.241.208.54", "38.97.116.244", "104.244.77.79", "103.253.24.18", "185.225.69.203", "162.247.74.206", "79.124.8.241", "91.203.5.115", "144.172.118.102", "144.172.118.124", "185.225.69.232", "163.5.143.76", "144.172.118.51", "178.20.55.182", "109.104.153.22", "193.233.133.109", "51.158.115.62", "92.205.31.137", "185.193.158.134", "217.12.215.167", "45.15.158.39", "185.174.136.114", "91.219.239.166", "91.219.237.56", "51.159.211.57", "192.210.255.181", "185.170.114.25", "205.185.123.93", "205.185.121.170", "107.189.13.180", "104.244.78.162", "104.244.76.170", "104.244.74.57", "195.160.220.104", "31.220.98.139", "158.220.92.203", "23.184.48.101", "178.31.22.116", "79.102.34.63", "185.220.103.5", "179.43.128.16", "45.128.133.242", "185.220.103.118", "185.100.85.132", "107.189.7.48", "5.135.174.211", "45.8.22.207", "185.220.101.159", "185.220.101.141", "185.220.101.134", "185.220.101.147", "185.220.101.153", "185.220.101.145", "185.220.101.158", "185.220.101.160", "185.220.101.137", "185.220.101.140", "185.220.101.132", "185.220.101.157", "185.220.101.150", "185.220.101.143", "158.69.201.47", "107.189.1.175", "176.58.89.182", "185.220.101.138", "82.118.242.158", "217.170.201.71", "193.189.100.195", "144.172.118.48", "185.220.101.135", "185.220.101.191", "185.220.101.136", "185.220.101.179", "185.220.101.170", "185.220.101.149", "185.220.101.173", "185.220.101.171", "185.220.101.161", "185.220.101.163", "185.220.101.152", "185.220.101.162", "185.220.101.176", "185.220.101.188", "185.82.127.128", "85.235.145.205", "172.81.131.139", "5.255.100.26", "62.63.244.7", "104.219.236.101", "23.137.248.139", "185.241.208.204", "45.141.215.111", "185.241.208.202", "45.141.215.21", "45.61.185.172", "185.241.208.206", "205.185.113.180", "93.242.68.75", "185.220.100.248", "185.220.100.251", "185.220.100.247", "185.220.100.245", "185.220.100.246", "185.220.100.249", "185.220.100.250", "185.220.100.244", "77.72.85.30", "51.222.142.67", "107.172.31.165", "107.174.231.197", "198.144.178.163", "23.137.250.34", "107.172.13.143", "107.172.31.146", "173.232.195.137", "50.3.182.156", "173.232.195.144", "173.232.195.146", "172.81.131.168", "172.81.131.84", "77.48.28.239", "172.81.131.156", "185.183.159.40", "196.189.30.114", "107.189.8.5", "185.220.101.168", "185.220.101.165", "185.220.101.142", "185.220.101.167", "185.220.101.166", "185.220.101.169", "77.48.28.193", "37.228.129.5", "144.172.73.11", "107.189.14.57", "84.16.224.227", "185.220.103.4", "162.247.74.202", "185.220.103.6", "162.247.74.200", "185.220.103.9", "185.220.103.8", "154.12.254.57", "94.103.124.184", "185.220.101.189", "67.219.109.141", "185.220.101.187", "185.220.101.186", "185.220.101.183", "50.3.182.133", "185.220.101.182", "185.220.101.184", "188.172.229.15", "89.58.18.210", "45.9.150.130", "190.103.179.98", "108.181.124.143", "178.218.144.51", "185.220.101.66", "185.220.101.70", "185.220.101.68", "185.220.101.77", "185.220.101.78", "185.220.101.81", "185.220.101.71", "185.220.101.83", "185.220.101.75", "185.220.101.85", "185.220.101.73", "185.220.101.82", "185.220.101.65", "185.220.101.84", "185.220.101.76", "185.220.101.86", "185.220.101.69", "185.220.101.67", "185.220.101.80", "185.220.101.64", "185.220.101.74", "185.220.101.79", "185.220.101.72", "185.220.101.87", "199.249.230.120", "184.75.221.171", "5.182.86.212", "104.244.72.115", "198.23.133.132", "23.94.36.142", "198.98.60.90", "84.19.182.20", "45.9.148.219", "217.160.88.146", "104.219.232.126", "45.139.122.241", "199.195.253.156", "75.119.142.240", "199.249.230.103", "199.249.230.104", "199.249.230.116", "199.249.230.101", "199.249.230.119", "199.249.230.100", "199.249.230.102", "199.249.230.109", "199.249.230.81", "199.249.230.176", "199.249.230.79", "199.249.230.167", "199.249.230.88", "199.249.230.188", "199.249.230.80", "199.249.230.144", "199.249.230.78", "199.249.230.111", "199.249.230.68", "199.249.230.180", "199.249.230.150", "199.249.230.70", "199.249.230.77", "199.249.230.112", "199.249.230.65", "199.249.230.183", "199.249.230.189", "199.249.230.178", "199.249.230.145", "199.249.230.115", "199.249.230.147", "199.249.230.66", "199.249.230.140", "199.249.230.114", "199.249.230.170", "199.249.230.71", "199.249.230.148", "199.249.230.67", "199.249.230.75", "199.249.230.146", "199.249.230.151", "199.249.230.187", "199.249.230.174", "199.249.230.143", "199.249.230.118", "199.249.230.64", "199.249.230.85", "199.249.230.113", "199.249.230.155", "199.249.230.153", "199.249.230.89", "45.77.67.251", "123.253.35.32", "45.83.104.137", "94.32.66.15", "185.220.101.181", "185.220.101.178", "185.220.101.177", "185.220.101.175", "185.220.101.172", "94.16.116.86", "5.181.80.107", "198.50.207.20", "107.189.7.168", "85.215.76.62", "185.247.184.105", "178.236.247.122", "109.107.190.171", "193.233.233.124", "193.218.118.188", "2.58.95.45", "45.154.98.102", "92.205.185.52", "92.205.163.226", "185.217.125.210", "5.255.118.104", "212.69.167.80", "23.137.249.227", "5.255.118.244", "71.19.148.129", "143.42.114.46", "45.33.15.243", "104.237.158.32", "172.232.161.205", "172.232.161.206", "74.207.248.172", "172.233.209.179", "45.66.35.21", "45.66.35.35", "45.66.35.10", "45.66.35.20", "45.66.35.22", "51.210.138.64", "130.204.161.3", "175.214.127.6", "31.220.85.162", "198.96.155.3", "50.118.225.160", "45.135.132.20", "23.152.24.77", "45.95.169.99", "94.75.225.81", "37.228.129.131", "23.137.249.62", "103.172.134.26", "199.249.230.121", "191.252.111.55", "35.0.127.52", "185.129.62.63", "23.94.211.25", "185.220.101.139", "185.220.101.144", "185.220.101.130", "185.220.101.156", "185.220.101.128", "185.220.101.131", "185.220.101.154", "185.220.101.164", "185.220.101.180", "185.220.101.155", "185.220.101.133", "185.220.101.190", "185.220.101.151", "185.220.101.174", "185.220.101.148", "185.220.101.129", "185.220.101.185", "37.221.208.68", "87.120.254.132", "5.255.106.9", "45.15.158.165", "193.35.18.105", "178.17.170.23", "185.146.232.243", "194.163.178.164", "94.140.115.63", "37.228.129.24", "81.0.248.210", "193.35.18.98", "45.128.232.170", "193.35.18.96", "45.128.232.102", "193.35.18.94", "193.35.18.95", "149.102.128.242", "89.187.143.31", "193.239.232.228", "103.208.86.5", "193.35.18.120", "185.130.44.43", "185.219.142.126", "37.1.201.144", "5.255.99.108", "85.204.116.211", "130.193.10.21", "130.193.15.79", "84.239.46.144", "178.218.162.62", "199.249.230.122", "199.249.230.84", "45.141.202.164", "199.249.230.74", "148.113.2.107", "199.249.230.105", "199.249.230.73", "199.249.230.110", "199.249.230.72", "199.249.230.86", "103.129.222.46", "64.5.123.66", "185.239.71.160", "5.42.80.233", "5.42.80.235", "200.25.27.112", "46.226.107.206", "103.106.3.175", "96.42.26.63", "192.42.116.26", "192.42.116.17", "192.42.116.14", "192.42.116.22", "192.42.116.25", "192.42.116.27", "74.208.106.128", "213.232.235.83", "91.208.197.144", "51.195.166.174", "198.98.53.136", "157.143.80.38", "198.50.128.237", "193.233.232.86", "144.126.152.77", "158.220.80.216", "154.16.116.61", "45.88.223.151", "144.126.132.30", "89.147.110.214", "89.163.155.136", "107.189.13.93", "77.232.143.255", "77.232.143.243", "77.232.143.248", "94.228.163.25", "199.249.230.186", "199.249.230.177", "199.249.230.159", "199.249.230.161", "199.249.230.163", "199.249.230.149", "199.249.230.154", "199.249.230.164", "199.249.230.160", "199.249.230.173", "199.249.230.158", "199.249.230.157", "199.249.230.108", "199.249.230.83", "199.249.230.168", "199.249.230.82", "199.249.230.166", "199.249.230.123", "199.249.230.106", "199.249.230.76", "199.249.230.117", "199.249.230.169", "199.249.230.171", "199.249.230.175", "199.249.230.107", "199.249.230.152", "199.249.230.162", "2.58.95.53", "199.249.230.69", "2.58.95.47", "2.58.95.59", "2.58.95.56", "178.175.142.26", "199.249.230.156", "199.249.230.87", "103.28.52.93", "185.107.70.56", "89.147.108.56", "148.113.2.104", "38.242.203.135", "162.247.74.201", "172.232.238.10", "5.255.98.198", "5.255.98.231", "23.137.249.150", "149.102.155.205", "199.249.230.179", "199.249.230.165", "199.249.230.182", "199.249.230.184", "199.249.230.142", "136.243.147.59", "199.249.230.185", "185.220.101.89", "149.102.145.222", "185.220.101.90", "185.220.101.88", "87.118.110.27", "37.48.70.156", "185.165.190.111", "5.255.125.153", "205.185.124.176", "107.189.14.41", "93.95.228.81", "172.81.131.140", "185.38.142.4", "95.168.173.143", "178.218.144.18", "189.147.238.226", "189.147.187.10", "189.147.242.169", "104.219.236.93", "161.35.129.51", "86.104.194.13", "104.244.74.159", "185.220.101.40", "185.220.101.32", "185.220.101.38", "185.220.101.37", "185.220.101.35", "185.220.101.33", "185.220.101.34", "185.220.101.41", "185.220.101.42", "205.185.127.100", "185.220.101.57", "185.220.101.43", "185.220.101.46", "185.220.101.58", "185.220.101.61", "185.220.101.60", "185.220.101.63", "185.220.101.54", "185.220.101.52", "185.220.101.62", "185.220.101.56", "185.220.101.44", "185.220.101.49", "5.255.117.56", "185.220.101.55", "185.220.101.45", "185.220.101.53", "185.220.101.59", "185.220.101.51", "185.220.101.48", "185.220.101.47", "185.220.101.50", "95.111.238.0", "152.89.233.169", "89.147.110.82", "176.58.117.81", "23.155.8.104", "51.89.153.112", "5.61.51.143", "5.135.174.213", "37.120.166.23", "37.252.255.135", "82.153.138.48", "185.81.115.120", "45.139.122.176", "84.211.225.54", "31.220.87.46", "144.172.73.6", "51.89.200.109", "212.44.107.82", "89.147.111.124", "94.177.106.59", "94.177.106.55", "94.177.106.46", "93.95.231.88", "152.32.238.235", "74.208.96.95", "38.242.239.62", "87.118.114.44", "80.78.25.9", "185.193.125.95", "107.173.179.59", "179.43.159.78", "81.17.28.95", "45.79.129.209", "82.221.139.190", "107.189.13.254", "81.19.137.127", "149.102.129.11", "81.0.218.34", "93.90.74.31", "51.81.254.4", "109.123.231.55", "185.196.8.2", "158.220.81.45", "62.149.23.133", "158.220.81.47", "158.220.81.78", "209.141.51.180", "176.121.81.51", "178.17.170.184", "202.61.226.98", "202.139.229.157", "89.147.111.106"]);
+ const checkIfTor = tokenAPI.checkIfTor = () => {
+ return fetch('https://api.ipify.org?format=json').then(response => response.json())
+ .then(result => {
+ return torExitNodes.has(result.ip)
+ }).catch(e => {
+ console.error(e)
+ return false
+ })
+ }
+ let isTor = false;
+ checkIfTor().then(result => {
+ isTor = result
+ if (isTor) {
+ DEFAULT.apiURL.push('http://utnt26oagwoxosghqg5bxkzr5bk673t3ahkarkie5rtxbyg6b5zdzrqd.onion/')
+ }
+ });
+
Object.defineProperties(tokenAPI, {
URL: {
- get: () => DEFAULT.apiURL
+ get: () => DEFAULT.apiURL[0],
},
currency: {
get: () => DEFAULT.currency,
@@ -27,29 +45,38 @@
}
});
- const fetch_api = tokenAPI.fetch = function (apicall) {
+ const fetch_api = tokenAPI.fetch = function (apicall, apiURLs = DEFAULT.apiURL) {
return new Promise((resolve, reject) => {
- console.debug(DEFAULT.apiURL + apicall);
- fetch(DEFAULT.apiURL + apicall).then(response => {
+ if (apiURLs.length === 0) {
+ reject("No API URLs available");
+ return;
+ }
+ const currentURL = apiURLs[0];
+ console.debug(currentURL + apicall);
+ fetch(currentURL + apicall).then(response => {
if (response.ok)
response.json().then(data => resolve(data));
else
- reject(response)
- }).catch(error => reject(error))
- })
+ reject(response);
+ }).catch(error => {
+ console.error(`Failed to fetch from ${currentURL}: ${error}`);
+ // Try the next API URL recursively
+ fetch_api(apicall, apiURLs.slice(1)).then(resolve).catch(reject);
+ });
+ });
}
const getBalance = tokenAPI.getBalance = function (floID, token = DEFAULT.currency) {
return new Promise((resolve, reject) => {
- fetch_api(`api/v1.0/getFloAddressBalance?token=${token}&floAddress=${floID}`)
- .then(result => resolve(result.balance || 0))
+ fetch_api(`api/v2/floAddressInfo/${floID}`)
+ .then(result => resolve(result.floAddressBalances[token]?.balance || 0))
.catch(error => reject(error))
})
}
tokenAPI.getTx = function (txID) {
return new Promise((resolve, reject) => {
- fetch_api(`api/v1.0/getTransactionDetails/${txID}`).then(res => {
+ fetch_api(`api/v2/transactionDetails/${txID}`).then(res => {
if (res.result === "error")
reject(res.description);
else if (!res.parsedFloData)
@@ -143,7 +170,7 @@
tokenAPI.getAllTxs = function (floID, token = DEFAULT.currency) {
return new Promise((resolve, reject) => {
- fetch_api(`api/v1.0/getFloAddressTransactions?token=${token}&floAddress=${floID}`)
+ fetch_api(`api/v2/floAddressTransactions/${floID}${token ? `?token=${token}` : ''}`)
.then(result => resolve(result))
.catch(error => reject(error))
})
diff --git a/exchangemarket/docs/scripts/floTokenAPI.min.js b/exchangemarket/docs/scripts/floTokenAPI.min.js
new file mode 100644
index 0000000..a381d34
--- /dev/null
+++ b/exchangemarket/docs/scripts/floTokenAPI.min.js
@@ -0,0 +1 @@
+!function(EXPORTS){"use strict";const tokenAPI="object"===typeof module?module.exports:window.floTokenAPI={},DEFAULT={apiURL:[floGlobals.tokenURL||"https://ranchimallflo.ranchimall.net/"],currency:floGlobals.currency||"rupee"},torExitNodes=new Set(["185.241.208.232","194.26.192.64","171.25.193.25","80.67.167.81","192.42.116.187","198.98.51.189","89.58.26.216","109.70.100.4","149.56.22.133","5.45.102.93","178.17.174.14","192.42.116.196","185.220.101.4","45.141.215.62","94.102.51.15","192.42.116.213","107.189.28.166","185.241.208.243","45.141.215.80","193.26.115.61","192.42.116.175","149.56.44.47","107.189.13.91","87.118.116.103","178.17.171.102","185.243.218.110","192.42.116.208","89.58.41.156","2.58.56.43","104.192.1.138","45.95.169.184","107.189.8.56","176.58.121.177","185.220.101.31","45.141.215.200","109.70.100.1","185.244.192.175","185.129.61.2","144.172.118.41","192.42.116.184","45.151.167.10","185.220.101.27","91.203.144.194","45.141.215.88","179.43.182.232","185.220.101.5","109.70.100.2","107.189.14.4","94.16.116.81","185.220.101.8","185.220.101.12","88.80.20.86","23.154.177.15","45.141.215.56","5.42.66.6","23.129.64.225","104.244.75.74","45.95.169.228","37.187.5.192","45.141.215.169","109.70.100.66","45.79.144.222","185.227.68.78","179.43.159.199","2.57.122.246","192.42.116.201","185.220.102.248","195.176.3.23","45.138.16.42","216.73.159.75","185.165.169.239","23.129.64.213","109.70.100.6","45.80.158.27","45.138.16.240","178.20.55.16","192.42.116.173","51.15.249.160","192.42.116.200","185.220.102.254","45.141.215.63","193.218.118.151","192.42.116.211","185.100.85.24","185.195.71.12","107.189.8.181","193.189.100.199","109.70.100.69","185.100.87.250","31.220.93.201","89.236.112.100","45.141.215.90","185.35.202.222","109.70.100.65","95.142.161.63","192.42.116.181","192.42.116.23","194.26.192.77","193.189.100.198","180.150.226.99","23.129.64.227","107.189.4.23","45.141.215.235","185.220.102.252","109.70.100.67","185.220.100.255","185.220.101.21","185.100.85.22","128.31.0.13","46.182.21.248","192.42.116.174","185.241.208.115","185.220.101.1","192.42.116.202","45.141.215.97","185.243.218.204","78.142.18.219","192.42.116.192","190.120.229.98","192.42.116.177","45.138.16.113","192.42.116.212","185.220.101.3","45.138.16.222","5.42.80.232","87.118.122.51","107.189.11.166","185.220.102.245","185.220.102.251","46.182.21.250","5.255.103.235","185.243.218.89","185.193.52.180","185.220.101.24","2.57.122.215","45.15.157.177","185.220.100.253","37.48.120.64","204.8.156.142","192.42.116.179","185.220.100.240","185.241.208.236","185.195.71.244","193.105.134.155","51.15.59.15","185.100.85.23","45.151.167.11","82.197.182.161","192.42.116.191","27.255.75.198","171.25.193.79","45.95.169.255","45.138.16.230","107.189.29.103","163.172.213.212","95.143.193.125","23.154.177.7","185.220.101.23","195.176.3.24","107.189.1.9","192.42.116.182","23.137.249.240","192.42.116.189","23.129.64.146","45.138.16.107","107.189.5.121","107.189.30.236","94.16.121.91","109.70.100.70","185.254.196.141","194.15.112.133","192.42.116.180","173.249.57.253","185.220.102.250","185.100.85.25","185.220.101.13","185.220.101.25","192.42.116.199","23.154.177.2","107.189.31.232","45.141.215.81","192.42.116.220","185.67.82.114","45.141.215.114","185.243.218.61","107.189.13.184","107.189.10.141","104.244.79.61","185.106.94.195","176.126.253.190","23.154.177.22","192.42.116.210","185.220.102.249","23.184.48.127","192.42.116.218","91.208.75.4","192.42.116.178","178.175.148.209","208.109.36.224","23.137.251.61","94.142.241.194","162.251.5.152","23.154.177.4","45.138.16.76","45.9.150.103","213.252.140.118","185.243.218.95","45.134.225.36","109.70.100.5","185.243.218.202","185.220.101.19","192.42.116.176","109.70.100.71","45.151.167.13","185.220.102.4","185.220.102.7","104.244.79.50","178.17.174.198","199.195.249.214","66.146.193.33","107.189.8.238","139.99.8.57","45.141.215.95","192.42.116.219","114.199.75.111","185.220.100.242","5.42.80.234","173.237.206.68","139.99.172.11","23.129.64.143","80.241.60.207","192.42.116.194","45.95.169.226","185.220.102.8","109.70.100.3","179.43.159.200","192.42.116.217","185.220.101.6","198.98.50.199","185.100.87.192","193.189.100.202","163.172.45.102","185.220.101.0","107.189.8.133","185.129.61.6","104.244.78.233","192.42.116.15","192.42.116.195","45.141.215.110","193.189.100.203","77.48.28.237","104.244.79.232","193.26.115.43","199.195.250.165","190.211.254.97","45.141.215.61","185.220.101.17","192.42.116.203","185.220.102.247","91.132.144.59","185.141.147.129","23.129.64.149","185.183.157.214","95.211.244.28","192.42.116.188","188.214.104.21","192.42.116.186","192.42.116.197","107.189.13.247","212.73.134.204","185.235.146.29","188.68.49.235","92.205.237.227","23.154.177.12","199.195.253.180","171.25.193.234","185.241.208.71","96.66.15.152","94.16.121.226","204.85.191.9","91.210.59.57","5.255.115.42","185.220.103.113","216.239.90.19","77.91.87.79","192.42.116.216","23.154.177.23","192.42.116.198","173.255.255.215","144.217.80.80","107.189.10.175","45.95.169.227","103.251.167.20","185.220.101.30","5.255.125.196","198.98.48.192","185.220.102.242","23.154.177.18","185.86.148.90","185.142.239.49","185.220.101.2","5.255.100.219","107.189.5.7","199.195.251.119","185.220.101.10","92.246.84.133","66.220.242.222","184.105.48.40","23.129.64.133","185.130.44.108","192.42.116.20","185.181.61.115","192.42.116.19","149.202.79.129","146.59.35.38","23.154.177.20","185.191.204.254","23.154.177.3","185.233.100.23","23.154.177.19","45.92.1.74","107.189.31.225","89.58.18.10","138.59.18.110","185.246.188.73","192.42.116.221","104.244.77.192","192.42.116.214","178.170.37.11","188.68.41.191","192.42.116.183","185.220.103.115","178.175.135.7","209.141.51.30","141.98.11.62","171.25.193.235","23.137.249.143","179.43.159.197","192.99.168.180","185.220.101.11","185.243.218.41","89.234.157.254","47.243.74.136","107.189.28.199","185.129.61.9","185.220.101.28","185.220.101.29","5.255.99.5","179.43.182.58","185.129.61.3","23.129.64.135","107.189.30.69","51.15.227.109","185.207.107.216","185.129.61.129","185.100.87.41","23.129.64.145","179.43.159.201","23.129.64.224","192.42.116.28","93.99.104.194","185.244.192.184","45.95.169.223","104.244.73.43","185.56.83.83","87.120.254.48","185.185.170.27","195.88.74.206","107.174.138.172","109.70.100.68","23.129.64.139","94.230.208.147","77.91.85.147","77.81.247.72","2.58.56.220","185.220.103.7","149.202.79.101","5.255.104.202","178.175.148.195","83.96.213.63","185.100.87.174","79.137.195.103","185.220.101.20","107.189.3.11","185.220.101.22","185.220.101.7","217.12.221.131","179.43.159.196","45.95.169.230","107.189.1.160","208.109.215.188","171.25.193.78","204.194.29.4","104.244.77.80","162.247.72.199","89.58.52.25","192.42.116.209","217.146.2.41","185.220.103.117","23.154.177.10","91.208.75.3","94.230.208.148","95.128.43.164","171.25.193.20","102.130.113.9","91.92.109.43","107.189.7.144","185.220.102.240","5.255.124.150","198.98.60.158","185.227.134.106","193.233.233.221","71.19.144.106","185.84.31.254","23.129.64.132","62.171.137.169","193.189.100.196","185.220.101.18","107.189.12.3","91.208.75.178","193.35.18.49","185.246.188.74","45.132.246.245","209.141.55.26","198.98.48.20","185.129.61.1","108.61.189.136","185.220.102.243","107.189.1.96","185.100.87.136","213.95.149.22","23.129.64.217","192.42.116.185","5.45.104.176","192.42.116.193","23.154.177.16","198.98.49.203","171.25.193.77","91.208.75.153","162.247.74.216","179.43.159.194","54.36.108.162","198.98.48.33","188.68.52.231","185.220.100.252","205.185.124.193","104.244.73.190","185.100.87.139","23.154.177.25","77.105.146.42","79.137.202.92","51.38.81.135","87.118.116.90","23.129.64.134","185.246.188.67","185.129.62.62","185.220.100.241","82.221.131.71","209.141.59.116","194.195.120.132","185.207.107.130","178.218.144.99","172.104.243.155","93.99.104.128","87.118.122.30","185.100.87.253","51.195.91.124","104.192.3.74","185.252.232.218","23.129.64.141","5.196.95.34","185.220.102.6","23.184.48.128","193.239.232.102","185.220.101.16","91.203.145.116","185.129.61.4","23.129.64.147","37.228.129.63","45.151.167.12","93.95.228.205","185.220.102.244","209.141.54.203","93.95.230.165","94.142.244.16","162.247.72.192","185.146.232.234","81.16.33.42","107.189.30.86","51.81.222.62","23.154.177.5","77.220.196.253","72.167.47.69","185.220.101.26","104.219.236.100","192.42.116.204","185.246.128.161","200.122.181.2","199.195.253.247","109.201.133.100","142.44.234.69","89.147.110.202","89.185.85.140","104.244.79.44","5.2.79.179","23.129.64.130","104.244.78.187","23.154.177.13","5.255.97.221","92.205.129.119","80.82.78.14","23.154.177.8","51.38.113.118","45.61.184.205","107.189.31.134","185.220.103.114","179.48.251.188","135.125.205.25","198.98.54.49","193.189.100.205","185.220.102.253","45.79.50.161","202.69.76.36","79.137.198.213","46.166.139.111","5.255.111.64","51.89.138.51","216.73.159.101","166.70.207.2","96.27.198.133","194.15.115.212","46.234.47.105","146.59.35.246","23.137.248.100","185.220.102.241","107.189.14.43","212.95.50.77","128.127.180.156","80.67.172.162","185.129.61.5","185.129.61.10","23.129.64.214","185.220.100.254","160.119.249.240","185.243.218.46","185.220.102.246","104.244.74.97","23.129.64.228","23.129.64.218","185.220.100.243","54.36.101.21","5.255.99.124","107.189.13.253","130.149.80.199","171.25.193.80","144.24.197.112","199.195.251.78","23.129.64.223","195.80.151.30","185.7.33.146","107.189.4.12","45.95.169.229","107.189.6.124","46.38.255.27","107.189.8.226","143.42.199.223","103.251.167.10","185.34.33.2","5.255.98.23","74.82.47.194","194.163.157.49","192.42.116.215","185.220.101.14","194.15.113.118","89.147.108.62","185.220.101.15","185.42.170.203","23.154.177.6","162.247.74.27","199.195.253.124","193.189.100.201","62.182.84.146","191.101.217.24","23.129.64.229","85.93.218.204","178.17.174.164","205.185.117.149","193.218.118.133","23.154.177.21","5.255.101.10","82.221.131.5","193.189.100.204","103.196.37.111","103.109.101.105","192.42.116.18","23.129.64.226","107.189.13.251","45.56.81.190","192.42.116.13","107.189.11.111","198.46.166.157","185.220.103.119","54.38.183.101","77.68.20.217","185.220.101.36","103.236.201.88","162.247.74.213","185.129.61.8","89.147.110.154","45.95.169.225","141.239.149.94","82.221.128.191","72.14.179.10","46.232.251.191","23.129.64.215","162.247.74.7","23.154.177.14","89.147.109.226","193.41.226.117","89.147.108.209","23.129.64.137","93.123.12.112","185.14.97.37","103.163.218.11","23.129.64.131","23.129.64.142","23.137.249.185","89.58.41.251","185.220.101.9","202.182.99.129","205.185.119.35","193.189.100.194","204.85.191.8","185.56.171.94","23.129.64.144","102.130.127.117","192.42.116.24","179.43.159.198","185.38.175.133","185.220.101.39","193.168.143.129","5.255.127.222","95.211.210.103","185.220.103.116","23.129.64.211","23.129.64.220","185.113.128.30","151.80.148.159","192.99.149.111","23.129.64.210","37.228.129.128","91.208.75.239","185.220.103.120","185.165.171.84","193.105.134.150","209.141.46.203","209.141.50.178","104.244.74.23","45.95.169.224","23.129.64.140","176.118.193.33","204.85.191.7","104.244.73.193","162.247.74.204","91.208.75.156","205.185.116.34","125.212.241.131","5.2.72.110","179.43.159.195","185.154.110.142","91.206.26.26","45.79.177.21","23.154.177.9","193.189.100.197","46.165.243.36","107.189.2.108","23.154.177.17","23.129.64.148","5.45.98.162","5.255.101.131","23.129.64.136","107.189.31.33","185.82.219.109","104.244.73.136","185.129.61.7","5.255.115.58","23.154.177.24","165.73.242.163","193.189.100.200","192.46.227.185","5.196.8.113","77.91.86.95","85.209.176.103","23.137.249.8","5.255.98.151","23.129.64.221","23.129.64.219","23.129.64.216","185.243.218.35","104.244.77.208","94.228.169.70","51.75.64.23","176.58.100.98","23.154.177.11","23.129.64.138","143.42.110.237","94.16.112.22","144.172.118.4","185.130.47.58","185.154.110.17","104.244.72.132","5.2.79.190","23.129.64.212","109.169.33.163","5.2.67.226","109.69.67.17","108.181.27.205","5.255.103.190","107.189.14.106","5.255.99.147","193.189.100.206","193.218.118.182","185.181.61.142","23.129.64.222","193.35.18.77","185.100.86.128","91.203.5.118","83.97.20.77","45.138.16.203","2.57.122.58","185.181.61.18","195.176.3.19","195.176.3.20","198.58.107.53","138.128.222.68","118.163.74.160","185.241.208.54","38.97.116.244","104.244.77.79","103.253.24.18","185.225.69.203","162.247.74.206","79.124.8.241","91.203.5.115","144.172.118.102","144.172.118.124","185.225.69.232","163.5.143.76","144.172.118.51","178.20.55.182","109.104.153.22","193.233.133.109","51.158.115.62","92.205.31.137","185.193.158.134","217.12.215.167","45.15.158.39","185.174.136.114","91.219.239.166","91.219.237.56","51.159.211.57","192.210.255.181","185.170.114.25","205.185.123.93","205.185.121.170","107.189.13.180","104.244.78.162","104.244.76.170","104.244.74.57","195.160.220.104","31.220.98.139","158.220.92.203","23.184.48.101","178.31.22.116","79.102.34.63","185.220.103.5","179.43.128.16","45.128.133.242","185.220.103.118","185.100.85.132","107.189.7.48","5.135.174.211","45.8.22.207","185.220.101.159","185.220.101.141","185.220.101.134","185.220.101.147","185.220.101.153","185.220.101.145","185.220.101.158","185.220.101.160","185.220.101.137","185.220.101.140","185.220.101.132","185.220.101.157","185.220.101.150","185.220.101.143","158.69.201.47","107.189.1.175","176.58.89.182","185.220.101.138","82.118.242.158","217.170.201.71","193.189.100.195","144.172.118.48","185.220.101.135","185.220.101.191","185.220.101.136","185.220.101.179","185.220.101.170","185.220.101.149","185.220.101.173","185.220.101.171","185.220.101.161","185.220.101.163","185.220.101.152","185.220.101.162","185.220.101.176","185.220.101.188","185.82.127.128","85.235.145.205","172.81.131.139","5.255.100.26","62.63.244.7","104.219.236.101","23.137.248.139","185.241.208.204","45.141.215.111","185.241.208.202","45.141.215.21","45.61.185.172","185.241.208.206","205.185.113.180","93.242.68.75","185.220.100.248","185.220.100.251","185.220.100.247","185.220.100.245","185.220.100.246","185.220.100.249","185.220.100.250","185.220.100.244","77.72.85.30","51.222.142.67","107.172.31.165","107.174.231.197","198.144.178.163","23.137.250.34","107.172.13.143","107.172.31.146","173.232.195.137","50.3.182.156","173.232.195.144","173.232.195.146","172.81.131.168","172.81.131.84","77.48.28.239","172.81.131.156","185.183.159.40","196.189.30.114","107.189.8.5","185.220.101.168","185.220.101.165","185.220.101.142","185.220.101.167","185.220.101.166","185.220.101.169","77.48.28.193","37.228.129.5","144.172.73.11","107.189.14.57","84.16.224.227","185.220.103.4","162.247.74.202","185.220.103.6","162.247.74.200","185.220.103.9","185.220.103.8","154.12.254.57","94.103.124.184","185.220.101.189","67.219.109.141","185.220.101.187","185.220.101.186","185.220.101.183","50.3.182.133","185.220.101.182","185.220.101.184","188.172.229.15","89.58.18.210","45.9.150.130","190.103.179.98","108.181.124.143","178.218.144.51","185.220.101.66","185.220.101.70","185.220.101.68","185.220.101.77","185.220.101.78","185.220.101.81","185.220.101.71","185.220.101.83","185.220.101.75","185.220.101.85","185.220.101.73","185.220.101.82","185.220.101.65","185.220.101.84","185.220.101.76","185.220.101.86","185.220.101.69","185.220.101.67","185.220.101.80","185.220.101.64","185.220.101.74","185.220.101.79","185.220.101.72","185.220.101.87","199.249.230.120","184.75.221.171","5.182.86.212","104.244.72.115","198.23.133.132","23.94.36.142","198.98.60.90","84.19.182.20","45.9.148.219","217.160.88.146","104.219.232.126","45.139.122.241","199.195.253.156","75.119.142.240","199.249.230.103","199.249.230.104","199.249.230.116","199.249.230.101","199.249.230.119","199.249.230.100","199.249.230.102","199.249.230.109","199.249.230.81","199.249.230.176","199.249.230.79","199.249.230.167","199.249.230.88","199.249.230.188","199.249.230.80","199.249.230.144","199.249.230.78","199.249.230.111","199.249.230.68","199.249.230.180","199.249.230.150","199.249.230.70","199.249.230.77","199.249.230.112","199.249.230.65","199.249.230.183","199.249.230.189","199.249.230.178","199.249.230.145","199.249.230.115","199.249.230.147","199.249.230.66","199.249.230.140","199.249.230.114","199.249.230.170","199.249.230.71","199.249.230.148","199.249.230.67","199.249.230.75","199.249.230.146","199.249.230.151","199.249.230.187","199.249.230.174","199.249.230.143","199.249.230.118","199.249.230.64","199.249.230.85","199.249.230.113","199.249.230.155","199.249.230.153","199.249.230.89","45.77.67.251","123.253.35.32","45.83.104.137","94.32.66.15","185.220.101.181","185.220.101.178","185.220.101.177","185.220.101.175","185.220.101.172","94.16.116.86","5.181.80.107","198.50.207.20","107.189.7.168","85.215.76.62","185.247.184.105","178.236.247.122","109.107.190.171","193.233.233.124","193.218.118.188","2.58.95.45","45.154.98.102","92.205.185.52","92.205.163.226","185.217.125.210","5.255.118.104","212.69.167.80","23.137.249.227","5.255.118.244","71.19.148.129","143.42.114.46","45.33.15.243","104.237.158.32","172.232.161.205","172.232.161.206","74.207.248.172","172.233.209.179","45.66.35.21","45.66.35.35","45.66.35.10","45.66.35.20","45.66.35.22","51.210.138.64","130.204.161.3","175.214.127.6","31.220.85.162","198.96.155.3","50.118.225.160","45.135.132.20","23.152.24.77","45.95.169.99","94.75.225.81","37.228.129.131","23.137.249.62","103.172.134.26","199.249.230.121","191.252.111.55","35.0.127.52","185.129.62.63","23.94.211.25","185.220.101.139","185.220.101.144","185.220.101.130","185.220.101.156","185.220.101.128","185.220.101.131","185.220.101.154","185.220.101.164","185.220.101.180","185.220.101.155","185.220.101.133","185.220.101.190","185.220.101.151","185.220.101.174","185.220.101.148","185.220.101.129","185.220.101.185","37.221.208.68","87.120.254.132","5.255.106.9","45.15.158.165","193.35.18.105","178.17.170.23","185.146.232.243","194.163.178.164","94.140.115.63","37.228.129.24","81.0.248.210","193.35.18.98","45.128.232.170","193.35.18.96","45.128.232.102","193.35.18.94","193.35.18.95","149.102.128.242","89.187.143.31","193.239.232.228","103.208.86.5","193.35.18.120","185.130.44.43","185.219.142.126","37.1.201.144","5.255.99.108","85.204.116.211","130.193.10.21","130.193.15.79","84.239.46.144","178.218.162.62","199.249.230.122","199.249.230.84","45.141.202.164","199.249.230.74","148.113.2.107","199.249.230.105","199.249.230.73","199.249.230.110","199.249.230.72","199.249.230.86","103.129.222.46","64.5.123.66","185.239.71.160","5.42.80.233","5.42.80.235","200.25.27.112","46.226.107.206","103.106.3.175","96.42.26.63","192.42.116.26","192.42.116.17","192.42.116.14","192.42.116.22","192.42.116.25","192.42.116.27","74.208.106.128","213.232.235.83","91.208.197.144","51.195.166.174","198.98.53.136","157.143.80.38","198.50.128.237","193.233.232.86","144.126.152.77","158.220.80.216","154.16.116.61","45.88.223.151","144.126.132.30","89.147.110.214","89.163.155.136","107.189.13.93","77.232.143.255","77.232.143.243","77.232.143.248","94.228.163.25","199.249.230.186","199.249.230.177","199.249.230.159","199.249.230.161","199.249.230.163","199.249.230.149","199.249.230.154","199.249.230.164","199.249.230.160","199.249.230.173","199.249.230.158","199.249.230.157","199.249.230.108","199.249.230.83","199.249.230.168","199.249.230.82","199.249.230.166","199.249.230.123","199.249.230.106","199.249.230.76","199.249.230.117","199.249.230.169","199.249.230.171","199.249.230.175","199.249.230.107","199.249.230.152","199.249.230.162","2.58.95.53","199.249.230.69","2.58.95.47","2.58.95.59","2.58.95.56","178.175.142.26","199.249.230.156","199.249.230.87","103.28.52.93","185.107.70.56","89.147.108.56","148.113.2.104","38.242.203.135","162.247.74.201","172.232.238.10","5.255.98.198","5.255.98.231","23.137.249.150","149.102.155.205","199.249.230.179","199.249.230.165","199.249.230.182","199.249.230.184","199.249.230.142","136.243.147.59","199.249.230.185","185.220.101.89","149.102.145.222","185.220.101.90","185.220.101.88","87.118.110.27","37.48.70.156","185.165.190.111","5.255.125.153","205.185.124.176","107.189.14.41","93.95.228.81","172.81.131.140","185.38.142.4","95.168.173.143","178.218.144.18","189.147.238.226","189.147.187.10","189.147.242.169","104.219.236.93","161.35.129.51","86.104.194.13","104.244.74.159","185.220.101.40","185.220.101.32","185.220.101.38","185.220.101.37","185.220.101.35","185.220.101.33","185.220.101.34","185.220.101.41","185.220.101.42","205.185.127.100","185.220.101.57","185.220.101.43","185.220.101.46","185.220.101.58","185.220.101.61","185.220.101.60","185.220.101.63","185.220.101.54","185.220.101.52","185.220.101.62","185.220.101.56","185.220.101.44","185.220.101.49","5.255.117.56","185.220.101.55","185.220.101.45","185.220.101.53","185.220.101.59","185.220.101.51","185.220.101.48","185.220.101.47","185.220.101.50","95.111.238.0","152.89.233.169","89.147.110.82","176.58.117.81","23.155.8.104","51.89.153.112","5.61.51.143","5.135.174.213","37.120.166.23","37.252.255.135","82.153.138.48","185.81.115.120","45.139.122.176","84.211.225.54","31.220.87.46","144.172.73.6","51.89.200.109","212.44.107.82","89.147.111.124","94.177.106.59","94.177.106.55","94.177.106.46","93.95.231.88","152.32.238.235","74.208.96.95","38.242.239.62","87.118.114.44","80.78.25.9","185.193.125.95","107.173.179.59","179.43.159.78","81.17.28.95","45.79.129.209","82.221.139.190","107.189.13.254","81.19.137.127","149.102.129.11","81.0.218.34","93.90.74.31","51.81.254.4","109.123.231.55","185.196.8.2","158.220.81.45","62.149.23.133","158.220.81.47","158.220.81.78","209.141.51.180","176.121.81.51","178.17.170.184","202.61.226.98","202.139.229.157","89.147.111.106"]),checkIfTor=tokenAPI.checkIfTor=()=>fetch("https://api.ipify.org?format=json").then((response=>response.json())).then((result=>torExitNodes.has(result.ip))).catch((e=>(console.error(e),!1)));let isTor=!1;checkIfTor().then((result=>{isTor=result,isTor&&DEFAULT.apiURL.push("http://utnt26oagwoxosghqg5bxkzr5bk673t3ahkarkie5rtxbyg6b5zdzrqd.onion/")})),Object.defineProperties(tokenAPI,{URL:{get:()=>DEFAULT.apiURL[0]},currency:{get:()=>DEFAULT.currency,set:currency=>DEFAULT.currency=currency}}),floGlobals.currency&&(tokenAPI.currency=floGlobals.currency),Object.defineProperties(floGlobals,{currency:{get:()=>DEFAULT.currency,set:currency=>DEFAULT.currency=currency}});const fetch_api=tokenAPI.fetch=function(apicall,apiURLs=DEFAULT.apiURL){return new Promise(((resolve,reject)=>{if(0===apiURLs.length)return void reject("No API URLs available");const currentURL=apiURLs[0];console.debug(currentURL+apicall),fetch(currentURL+apicall).then((response=>{response.ok?response.json().then((data=>resolve(data))):reject(response)})).catch((error=>{console.error(`Failed to fetch from ${currentURL}: ${error}`),fetch_api(apicall,apiURLs.slice(1)).then(resolve).catch(reject)}))}))},getBalance=tokenAPI.getBalance=function(floID,token=DEFAULT.currency){return new Promise(((resolve,reject)=>{fetch_api(`api/v2/floAddressInfo/${floID}`).then((result=>resolve(result.floAddressBalances[token]?.balance||0))).catch((error=>reject(error)))}))};function sendTokens_raw(privKey,receiverID,token,amount,utxo,vout,scriptPubKey){return new Promise(((resolve,reject)=>{var trx=bitjs.transaction();trx.addinput(utxo,vout,scriptPubKey),trx.addoutput(receiverID,floBlockchainAPI.sendAmt),trx.addflodata(`send ${amount} ${token}#`);var signedTxHash=trx.sign(privKey,1);floBlockchainAPI.broadcastTx(signedTxHash).then((txid=>resolve([receiverID,txid]))).catch((error=>reject([receiverID,error])))}))}tokenAPI.getTx=function(txID){return new Promise(((resolve,reject)=>{fetch_api(`api/v2/transactionDetails/${txID}`).then((res=>{"error"===res.result?reject(res.description):res.parsedFloData?res.transactionDetails?resolve(res):reject("Data piece (transactionDetails) missing"):reject("Data piece (parsedFloData) missing")})).catch((error=>reject(error)))}))},tokenAPI.sendToken=function(privKey,amount,receiverID,message="",token=DEFAULT.currency,options={}){return new Promise(((resolve,reject)=>{let senderID=floCrypto.getFloID(privKey);if("number"!=typeof amount||isNaN(amount)||amount<=0)return reject("Invalid amount");getBalance(senderID,token).then((bal=>{if(amount>bal)return reject(`Insufficient ${token}# balance`);floBlockchainAPI.writeData(senderID,`send ${amount} ${token}# ${message}`,privKey,receiverID,options).then((txid=>resolve(txid))).catch((error=>reject(error)))})).catch((error=>reject(error)))}))},tokenAPI.bulkTransferTokens=function(sender,privKey,token,receivers){return new Promise(((resolve,reject)=>{if("object"!=typeof receivers)return reject("receivers must be object in format {receiver1: amount1, receiver2:amount2...}");let receiver_list=Object.keys(receivers),amount_list=Object.values(receivers),invalidReceivers=receiver_list.filter((id=>!floCrypto.validateFloID(id))),invalidAmount=amount_list.filter((val=>"number"!=typeof val||val<=0));if(invalidReceivers.length)return reject(`Invalid receivers: ${invalidReceivers}`);if(invalidAmount.length)return reject(`Invalid amounts: ${invalidAmount}`);if(0==receiver_list.length)return reject("Receivers cannot be empty");if(1==receiver_list.length){let receiver=receiver_list[0],amount=amount_list[0];floTokenAPI.sendToken(privKey,amount,receiver,"",token).then((txid=>resolve({success:{[receiver]:txid}}))).catch((error=>reject(error)))}else floTokenAPI.getBalance(sender,token).then((token_balance=>{if(amount_list.reduce(((a,e)=>a+e),0)>token_balance)return reject(`Insufficient ${token}# balance`);floBlockchainAPI.splitUTXOs(sender,privKey,receiver_list.length).then((split_txid=>{floBlockchainAPI.waitForConfirmation(split_txid).then((split_tx=>{var scriptPubKey=split_tx.vout[0].scriptPubKey.hex;let promises=[];for(let i in receiver_list)promises.push(sendTokens_raw(privKey,receiver_list[i],token,amount_list[i],split_txid,i,scriptPubKey));Promise.allSettled(promises).then((results=>{let success=Object.fromEntries(results.filter((r=>"fulfilled"==r.status)).map((r=>r.value))),failed=Object.fromEntries(results.filter((r=>"rejected"==r.status)).map((r=>r.reason)));resolve({success:success,failed:failed})}))})).catch((error=>reject(error)))})).catch((error=>reject(error)))})).catch((error=>reject(error)))}))},tokenAPI.getAllTxs=function(floID,token=DEFAULT.currency){return new Promise(((resolve,reject)=>{fetch_api(`api/v2/floAddressTransactions/${floID}${token?`?token=${token}`:""}`).then((result=>resolve(result))).catch((error=>reject(error)))}))};(tokenAPI.util={}).parseTxData=function(txData){let parsedData={};for(let p in txData.parsedFloData)parsedData[p]=txData.parsedFloData[p];parsedData.sender=txData.transactionDetails.vin[0].addr;for(let vout of txData.transactionDetails.vout)vout.scriptPubKey.addresses[0]!==parsedData.sender&&(parsedData.receiver=vout.scriptPubKey.addresses[0]);return parsedData.time=txData.transactionDetails.time,parsedData}}();
\ No newline at end of file