2022-09-29 21:54:11 -05:00
|
|
|
@page "/mint/in-progress"
|
|
|
|
@inherits BasicComponent
|
|
|
|
|
|
|
|
<PageTitle>Minting...</PageTitle>
|
|
|
|
|
|
|
|
@if (!string.IsNullOrEmpty(ProgressBarText))
|
|
|
|
{
|
|
|
|
<RadzenText TextStyle="TextStyle.Subtitle2" TagName="TagName.H3">@ProgressBarText</RadzenText>
|
|
|
|
<RadzenProgressBar Value="100" ShowValue="false" Mode="ProgressBarMode.Indeterminate" />
|
|
|
|
}
|
|
|
|
else if (State == MintingState.CheckingNetwork)
|
|
|
|
{
|
|
|
|
<RadzenContent Container="main">
|
|
|
|
<h4>Network mismatch!</h4>
|
|
|
|
<p>
|
|
|
|
<text style="font-weight: bold;">Selected network: </text>
|
|
|
|
<text style="color: green;">@(AppState?.SelectedNetwork?.Name ?? "<unknown>")</text>
|
|
|
|
</p>
|
|
|
|
<p>
|
2022-10-02 20:55:07 -05:00
|
|
|
<text style="font-weight: bold;">Wallet network: </text>
|
|
|
|
<text style="color: red;">@(WalletNetwork?.Name ?? "<unknown>")</text>
|
2022-09-29 21:54:11 -05:00
|
|
|
</p>
|
|
|
|
<div style="display: flex; justify-content: end;">
|
|
|
|
<RadzenButton Click="@(async (args) => await CheckNetwork())" Text="Try again" Disabled="@(!string.IsNullOrEmpty(ProgressBarText))" />
|
|
|
|
</div>
|
|
|
|
</RadzenContent>
|
|
|
|
} else if (State == MintingState.CheckingAddress)
|
|
|
|
{
|
|
|
|
<RadzenContent Container="main">
|
|
|
|
<h3>Address is not available!</h3>
|
|
|
|
<p>
|
2022-10-02 20:55:07 -05:00
|
|
|
<text style="font-weight: bold;">Wallet address: </text>
|
2022-09-29 22:33:34 -05:00
|
|
|
<text style="color: red;"><null></text>
|
2022-09-29 21:54:11 -05:00
|
|
|
</p>
|
|
|
|
<div style="display: flex; justify-content: end;">
|
|
|
|
<RadzenButton Click="@(async (args) => await CheckNetwork())" Text="Try again" Disabled="@(!string.IsNullOrEmpty(ProgressBarText))" />
|
|
|
|
</div>
|
|
|
|
</RadzenContent>
|
|
|
|
} else if (State == MintingState.CheckingBalance)
|
|
|
|
{
|
|
|
|
<RadzenContent Container="main">
|
|
|
|
<h3>Not enough balance!</h3>
|
|
|
|
<p>
|
2022-09-29 22:33:34 -05:00
|
|
|
<text style="font-weight: bold;">Balance</text>
|
|
|
|
<text> (@SourceAddress)</text>
|
|
|
|
<text style="font-weight: bold;">: </text>
|
|
|
|
<text style="color: red;">
|
|
|
|
@if (Balance != null)
|
|
|
|
{
|
2022-10-05 21:24:50 -05:00
|
|
|
@($"{Balance.Value:n0} {AppState.SelectedNetwork.SmallestCurrency}")
|
2022-09-29 22:33:34 -05:00
|
|
|
}
|
2022-09-30 06:09:39 -05:00
|
|
|
else if (!string.IsNullOrEmpty(GetBalanceError))
|
|
|
|
{
|
|
|
|
@GetBalanceError
|
|
|
|
}
|
2022-09-29 22:33:34 -05:00
|
|
|
else
|
|
|
|
{
|
|
|
|
@:<unknown>
|
|
|
|
}
|
|
|
|
</text>
|
2022-09-29 21:54:11 -05:00
|
|
|
</p>
|
2022-10-05 21:24:50 -05:00
|
|
|
<p>
|
|
|
|
<text style="font-weight: bold;">Minimum required balance: </text>
|
|
|
|
<text style="color: green;">
|
|
|
|
@($"{AppState.SelectedContract.MinBalanceRequired:n0} {AppState.SelectedNetwork.SmallestCurrency}")
|
|
|
|
</text>
|
|
|
|
</p>
|
2022-09-29 21:54:11 -05:00
|
|
|
<div style="display: flex; justify-content: end;">
|
2022-10-05 20:25:02 -05:00
|
|
|
@if (AppState.SelectedNetwork.SupportsAirdrop)
|
|
|
|
{
|
|
|
|
<RadzenButton Click="@(async (args) => await RequestAirdrop())" Text="Request airdrop" Disabled="@(!string.IsNullOrEmpty(ProgressBarText))" Style="margin-right: 1rem;" />
|
|
|
|
}
|
|
|
|
<RadzenButton Click="@(async (args) => await CheckNetwork())" Text="Try again" Disabled="@(!string.IsNullOrEmpty(ProgressBarText))"/>
|
2022-09-29 21:54:11 -05:00
|
|
|
</div>
|
|
|
|
</RadzenContent>
|
|
|
|
} else if (State == MintingState.SendingTransaction)
|
|
|
|
{
|
|
|
|
<RadzenContent Container="main">
|
|
|
|
<h3>Failed to send transaction!</h3>
|
|
|
|
<p>
|
|
|
|
<text>Error message:</text>
|
|
|
|
<br/>
|
|
|
|
<text style="font-weight: bold; color: red;">@SendTransactionError</text>
|
|
|
|
</p>
|
|
|
|
<div style="display: flex; justify-content: end;">
|
|
|
|
<RadzenButton Click="@(async (args) => await CheckNetwork())" Text="Try again" Disabled="@(!string.IsNullOrEmpty(ProgressBarText))" />
|
|
|
|
</div>
|
|
|
|
</RadzenContent>
|
|
|
|
} else if (State == MintingState.Done)
|
|
|
|
{
|
|
|
|
<RadzenContent Container="main">
|
|
|
|
<h3>Success</h3>
|
|
|
|
<p>
|
|
|
|
<text style="font-weight: bold;">Token minted!</text>
|
|
|
|
<br/>
|
2022-09-29 22:23:48 -05:00
|
|
|
<br/>
|
|
|
|
<br/>
|
2022-09-29 21:54:11 -05:00
|
|
|
<text style="font-weight: bold;">Transaction hash: </text>
|
2022-09-29 22:23:48 -05:00
|
|
|
<br/>
|
|
|
|
<RadzenLink Icon="open_in_new" Path="@(new Uri(AppState.SelectedNetwork.ExplorerUrl, "tx/" + TransactionHash).ToString())" Text="@TransactionHash" Target="_blank"/>
|
2022-09-29 21:54:11 -05:00
|
|
|
</p>
|
|
|
|
<div style="display: flex; justify-content: end;">
|
2022-10-02 20:24:43 -05:00
|
|
|
<RadzenButton Click="@((args) => Close())" Text="Close" Disabled="@(!string.IsNullOrEmpty(ProgressBarText))" />
|
2022-09-29 21:54:11 -05:00
|
|
|
</div>
|
|
|
|
</RadzenContent>
|
|
|
|
}
|