Skip to content

Commit 1ab2314

Browse files
authored
feat: update tx link (#64)
1 parent 7c261fa commit 1ab2314

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

src/models.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ pub struct DispenseInput {
1919
pub struct DispenseResponse {
2020
pub status: String,
2121
pub tokens: u64,
22+
pub tx_id: String,
2223
}
2324

2425
#[derive(Debug)]

src/routes.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,7 @@ pub async fn dispense_tokens(
374374
Ok(DispenseResponse {
375375
status: "Success".to_string(),
376376
tokens: config.dispense_amount,
377+
tx_id: tx_id.to_string(),
377378
})
378379
}
379380

static/index.html

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,7 @@ <h2 class="response-title">Test Ether sent to the wallet</h2>
247247
<div class="provider-url">Node url: {{ public_node_url }}</div>
248248
<script>
249249
const faucetApp = (function () {
250-
let providerUrl = "{{ public_node_url }}";
251-
let blockExplorer = "https://fuellabs.github.io/block-explorer-v2";
250+
let blockExplorer = "https://app.fuel.network";
252251
let query = params = new URLSearchParams(document.location.search);
253252
let address = query.get('address');
254253

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

0 commit comments

Comments
 (0)