Skip to content

Commit

Permalink
feat: update tx link (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
luizstacio authored Mar 27, 2024
1 parent 7c261fa commit 1ab2314
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ pub struct DispenseInput {
pub struct DispenseResponse {
pub status: String,
pub tokens: u64,
pub tx_id: String,
}

#[derive(Debug)]
Expand Down
1 change: 1 addition & 0 deletions src/routes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,7 @@ pub async fn dispense_tokens(
Ok(DispenseResponse {
status: "Success".to_string(),
tokens: config.dispense_amount,
tx_id: tx_id.to_string(),
})
}

Expand Down
7 changes: 2 additions & 5 deletions static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,7 @@ <h2 class="response-title">Test Ether sent to the wallet</h2>
<div class="provider-url">Node url: {{ public_node_url }}</div>
<script>
const faucetApp = (function () {
let providerUrl = "{{ public_node_url }}";
let blockExplorer = "https://fuellabs.github.io/block-explorer-v2";
let blockExplorer = "https://app.fuel.network";
let query = params = new URLSearchParams(document.location.search);
let address = query.get('address');

Expand Down Expand Up @@ -321,9 +320,7 @@ <h2 class="response-title">Test Ether sent to the wallet</h2>
document.getElementById("response").style.display = "block";
document.getElementById(
"explorer-link"
).href = `${blockExplorer}/address/${address}?providerUrl=${encodeURIComponent(
providerUrl
)}`;
).href = `${blockExplorer}/tx/0x${data.tx_id}`;
} else {
document.getElementById("response-failure").innerText = data.error;
hideWaiting();
Expand Down

0 comments on commit 1ab2314

Please sign in to comment.