2022-09-18 22:15:59 -05:00
|
|
|
@page "/mint"
|
2022-09-20 20:20:18 -05:00
|
|
|
@using NftFaucetRadzen.Plugins.NetworkPlugins
|
2022-09-18 22:15:59 -05:00
|
|
|
@inherits BasicComponent
|
|
|
|
|
|
|
|
<PageTitle>Mint</PageTitle>
|
|
|
|
<RadzenContent Container="main">
|
|
|
|
<RadzenHeading Size="H1" Text="Mint" />
|
|
|
|
<p>
|
|
|
|
<text style="font-weight: bold;">Network: </text>
|
|
|
|
@if (AppState?.SelectedNetwork == null)
|
|
|
|
{
|
|
|
|
@:<text style="color: red;">NOT SELECTED</text>
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
@:<text style="color: green;">OK</text>
|
|
|
|
}
|
|
|
|
</p>
|
|
|
|
<p>
|
|
|
|
<text style="font-weight: bold;">Provider: </text>
|
|
|
|
@if (AppState?.SelectedProvider == null)
|
|
|
|
{
|
|
|
|
@:<text style="color: red;">NOT SELECTED</text>
|
|
|
|
}
|
|
|
|
else if (!AppState.SelectedProvider.IsConfigured)
|
|
|
|
{
|
|
|
|
@:<text style="color: red;">NOT CONFIGURED</text>
|
|
|
|
}
|
2022-09-20 21:41:53 -05:00
|
|
|
else if (!NetworkMatches)
|
|
|
|
{
|
|
|
|
@:<text style="color: red;">NETWORK MISMATCH</text>
|
|
|
|
} else
|
2022-09-18 22:15:59 -05:00
|
|
|
{
|
|
|
|
@:<text style="color: green;">OK</text>
|
|
|
|
}
|
|
|
|
</p>
|
2022-09-20 22:24:05 -05:00
|
|
|
<p>
|
|
|
|
@if (string.IsNullOrEmpty(SourceAddress))
|
|
|
|
{
|
|
|
|
@:<text style="font-weight: bold;">Balance: </text>
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
@:<text style="font-weight: bold;">Balance</text>
|
|
|
|
@:<text> (@SourceAddress)</text>
|
|
|
|
@:<text style="font-weight: bold;">: </text>
|
|
|
|
}
|
|
|
|
|
|
|
|
@if (AppState?.SelectedProvider == null || !AppState.SelectedProvider.IsConfigured || string.IsNullOrEmpty(SourceAddress))
|
|
|
|
{
|
|
|
|
@:<text style="color: red;">UNKNOWN</text>
|
|
|
|
}
|
|
|
|
else if (BalanceIsZero)
|
|
|
|
{
|
|
|
|
@:<text style="color: red;">ZERO</text>
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
@:<text style="color: green;">OK</text>
|
|
|
|
}
|
|
|
|
</p>
|
2022-09-18 22:15:59 -05:00
|
|
|
<p>
|
|
|
|
<text style="font-weight: bold;">Contract: </text>
|
|
|
|
@if (AppState?.SelectedContract == null)
|
|
|
|
{
|
|
|
|
@:<text style="color: red;">NOT SELECTED</text>
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
@:<text style="color: green;">OK</text>
|
|
|
|
}
|
|
|
|
</p>
|
|
|
|
<p>
|
|
|
|
<text style="font-weight: bold;">Token: </text>
|
|
|
|
@if (AppState?.SelectedToken == null)
|
|
|
|
{
|
|
|
|
@:<text style="color: red;">NOT SELECTED</text>
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
@:<text style="color: green;">OK</text>
|
|
|
|
}
|
|
|
|
</p>
|
|
|
|
<p>
|
|
|
|
<text style="font-weight: bold;">Upload location: </text>
|
|
|
|
@if (AppState?.SelectedUploadLocation == null)
|
|
|
|
{
|
|
|
|
@:<text style="color: red;">NOT SELECTED</text>
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
@:<text style="color: green;">OK</text>
|
|
|
|
}
|
|
|
|
</p>
|
|
|
|
@if (IsReadyToMint)
|
|
|
|
{
|
2022-09-20 20:20:18 -05:00
|
|
|
<div class="mb-4">
|
|
|
|
<h4>Destination address</h4>
|
2022-09-28 20:49:55 -05:00
|
|
|
<RadzenTextBox Placeholder="<null>" @bind-Value="@AppState.UserStorage.DestinationAddress" Class="w-100"/>
|
2022-09-20 20:20:18 -05:00
|
|
|
</div>
|
|
|
|
if (AppState!.SelectedContract!.Type == ContractType.Erc1155)
|
|
|
|
{
|
|
|
|
<div class="mb-4">
|
|
|
|
<h4>Tokens amount</h4>
|
2022-09-28 20:49:55 -05:00
|
|
|
<RadzenNumeric TValue="int" Min="1" Max="100000" @bind-Value="@AppState.UserStorage.TokenAmount" Class="w-100" />
|
2022-09-20 20:20:18 -05:00
|
|
|
</div>
|
|
|
|
}
|
2022-09-28 20:49:55 -05:00
|
|
|
<RadzenButton Text="Mint" Disabled="@string.IsNullOrEmpty(AppState.UserStorage.DestinationAddress)" Click="@(async () => await Mint())" />
|
2022-09-18 22:15:59 -05:00
|
|
|
}
|
|
|
|
</RadzenContent>
|