Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Backend/OTC.csproj.user
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,9 @@
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<_LastSelectedProfileId>C:\Code\OTC\Backend\Properties\PublishProfiles\FolderProfile.pubxml</_LastSelectedProfileId>
<ActiveDebugProfile>OTC</ActiveDebugProfile>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DebuggerFlavor>ProjectDebugger</DebuggerFlavor>
</PropertyGroup>
</Project>
39 changes: 35 additions & 4 deletions Backend/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,15 @@ public Offer(string iD, Address seller, string sellSymbol, string sellAmount, st

class Program
{

const string LanguageHeader = "Accept-Language";
static SDK.API phantasmaAPI;

const float ONE_MIN = 60f;
const float TEN_MIN = 600f;
const float HALF_AN_HOUR = 1800f;
const float ONE_HOUR = 3600f;

static string DetectLanguage(HTTPRequest request)
{
if (request.headers.ContainsKey(LanguageHeader))
Expand Down Expand Up @@ -262,15 +268,23 @@ static void Main(string[] args)
running = false;
};


float time = 0;
while (running)
{
Thread.Sleep(500);
Thread.Sleep(1000); // 1000m = 1sec
time++;
if (time <= HALF_AN_HOUR)
GetAllOTC();
}
}

private static void GetAllOTC()
{
offers.Clear();
var myScript = new ScriptBuilder().CallContract(NativeContractKind.Exchange.GetContractName(), "GetOTC").EndScript();
var myScript = new ScriptBuilder()
.CallContract(NativeContractKind.Exchange.GetContractName(), "GetOTC")
.EndScript();
var scriptStr = Base16.Encode(myScript);
phantasmaAPI.InvokeRawScript(DomainSettings.RootChainName, scriptStr, (script) =>
{
Expand All @@ -291,8 +305,25 @@ public static int GetDecimals(string symbol)
{
switch (symbol)
{
case "SOUL": return 8;
case "KCAL": return 10;
case "GOATI":
return 3;
case "SOUL":
case "GAS":
case "GM":
return 8;
case "KCAL":
return 10;
case "BNB":
case "ETH":
case "DAI":
case "HOD":
return 18;
case "NEO":
case "MKNI":
return 0;
case "USDT":
case "USDC":
return 6;
default: throw new System.Exception("Unknown decimals for " + symbol);
}
}
Expand Down
218 changes: 140 additions & 78 deletions Frontend/public/css/otc.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,84 +10,146 @@
color: #fff;
background-color: #1abc9c;
border-color: #1abc9c;
}
}

.btn-primary {
color: #fff;
background-color: #1abc9c;
border-color: #1abc9c;
}
.btn-primary:hover {
color: #fff;
background-color: #159a80;
border-color: #148f77;
}
.btn-primary:focus, .btn-primary.focus {
color: #fff;
background-color: #159a80;
border-color: #148f77;
box-shadow: 0 0 0 0.2rem rgba(60, 198, 171, 0.5);
}
.btn-primary.disabled, .btn-primary:disabled {
color: #fff;
background-color: #1abc9c;
border-color: #1abc9c;
}
.btn-primary:not(:disabled):not(.disabled):active, .btn-primary:not(:disabled):not(.disabled).active, .show > .btn-primary.dropdown-toggle {
color: #fff;
background-color: #148f77;
border-color: #12846e;
}
.btn-primary:not(:disabled):not(.disabled):active:focus, .btn-primary:not(:disabled):not(.disabled).active:focus, .show > .btn-primary.dropdown-toggle:focus {
box-shadow: 0 0 0 0.2rem rgba(60, 198, 171, 0.5);
}

.btn-secondary {
color: #fff;
background-color: #2c3e50;
border-color: #2c3e50;
}
.btn-secondary:hover {
color: #fff;
background-color: #1e2b37;
border-color: #1a252f;
}
.btn-secondary:focus, .btn-secondary.focus {
color: #fff;
background-color: #1e2b37;
border-color: #1a252f;
box-shadow: 0 0 0 0.2rem rgba(76, 91, 106, 0.5);
}
.btn-secondary.disabled, .btn-secondary:disabled {
color: #fff;
background-color: #2c3e50;
border-color: #2c3e50;
}
.btn-secondary:not(:disabled):not(.disabled):active, .btn-secondary:not(:disabled):not(.disabled).active, .show > .btn-secondary.dropdown-toggle {
color: #fff;
background-color: #1a252f;
border-color: #151e27;
}
.btn-secondary:not(:disabled):not(.disabled):active:focus, .btn-secondary:not(:disabled):not(.disabled).active:focus, .show > .btn-secondary.dropdown-toggle:focus {
box-shadow: 0 0 0 0.2rem rgba(76, 91, 106, 0.5);
}
.btn-primary {
color: #fff;
background-color: #1abc9c;
border-color: #1abc9c;
}
.btn-primary:hover {
color: #fff;
background-color: #159a80;
border-color: #148f77;
}
.btn-primary:focus, .btn-primary.focus {
color: #fff;
background-color: #159a80;
border-color: #148f77;
box-shadow: 0 0 0 0.2rem rgba(60, 198, 171, 0.5);
}
.btn-primary.disabled, .btn-primary:disabled {
color: #fff;
background-color: #1abc9c;
border-color: #1abc9c;
}
.btn-primary:not(:disabled):not(.disabled):active, .btn-primary:not(:disabled):not(.disabled).active, .show > .btn-primary.dropdown-toggle {
color: #fff;
background-color: #148f77;
border-color: #12846e;
}
.btn-primary:not(:disabled):not(.disabled):active:focus, .btn-primary:not(:disabled):not(.disabled).active:focus, .show > .btn-primary.dropdown-toggle:focus {
box-shadow: 0 0 0 0.2rem rgba(60, 198, 171, 0.5);
}

.btn-secondary {
color: #fff;
background-color: #2c3e50;
border-color: #2c3e50;
}
.btn-secondary:hover {
color: #fff;
background-color: #1e2b37;
border-color: #1a252f;
}
.btn-secondary:focus, .btn-secondary.focus {
color: #fff;
background-color: #1e2b37;
border-color: #1a252f;
box-shadow: 0 0 0 0.2rem rgba(76, 91, 106, 0.5);
}
.btn-secondary.disabled, .btn-secondary:disabled {
color: #fff;
background-color: #2c3e50;
border-color: #2c3e50;
}
.btn-secondary:not(:disabled):not(.disabled):active, .btn-secondary:not(:disabled):not(.disabled).active, .show > .btn-secondary.dropdown-toggle {
color: #fff;
background-color: #1a252f;
border-color: #151e27;
}
.btn-secondary:not(:disabled):not(.disabled):active:focus, .btn-secondary:not(:disabled):not(.disabled).active:focus, .show > .btn-secondary.dropdown-toggle:focus {
box-shadow: 0 0 0 0.2rem rgba(76, 91, 106, 0.5);
}

.btn-social {
border-radius: 100%;
display: inline-flex;
width: 3.25rem;
height: 3.25rem;
font-size: 1.25rem;
justify-content: center;
align-items: center;
}

a {
color: #1abc9c;
text-decoration: none;
background-color: transparent;
}
a:hover {
color: #117964;
text-decoration: underline;
}

#userDetails{
z-index: 10;
bottom: 0;
right: 0;
}

/* Balances */
#balances_list{
background: transparent !important;
max-height: 100px !important;
overflow-y: scroll;
}

.btn-social {
border-radius: 100%;
display: inline-flex;
width: 3.25rem;
height: 3.25rem;
font-size: 1.25rem;
justify-content: center;
align-items: center;
}
/* ScollBar */
/* width */
::-webkit-scrollbar {
width: 10px;
}

/* Track */
::-webkit-scrollbar-track {
background: #f1f1f1;
}

/* Handle */
::-webkit-scrollbar-thumb {
background: #1abc9c;
}

/* Handle on hover */
::-webkit-scrollbar-thumb:hover {
background: #148f77;
}

.footer {
padding-top: 5rem;
padding-bottom: 5rem;
background-color: #2c3e50;
color: #fff;
}

.copyright {
background-color: #1a252f;
}

.offer {
border-style: dotted;
border-width:2px;
border-radius:20px;
padding:20px;
}

a {
color: #1abc9c;
text-decoration: none;
background-color: transparent;
}
a:hover {
color: #117964;
text-decoration: underline;
}
.userDetails {
padding: 12px;
background-color: #1a252f;
color: #fff;
border-width:2px;
border-radius:20px;
border-bottom-left-radius: 0px;
border-bottom-right-radius: 0px;
}
27 changes: 0 additions & 27 deletions Frontend/public/css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -10228,30 +10228,3 @@ form .row:first-child .floating-label-form-group {
border-top: 1px solid #e9ecef;
}

.footer {
padding-top: 5rem;
padding-bottom: 5rem;
background-color: #2c3e50;
color: #fff;
}

.copyright {
background-color: #1a252f;
}

.offer {
border-style: dotted;
border-width:2px;
border-radius:20px;
padding:20px;
}

.userDetails {
padding: 12px;
background-color: #1a252f;
color: #fff;
border-width:2px;
border-radius:20px;
border-bottom-left-radius: 0px;
border-bottom-right-radius: 0px;
}
Loading