You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: crates/sui-graphql-client/README.md
+9-11Lines changed: 9 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,7 +37,7 @@ async fn main() -> Result<()> {
37
37
```
38
38
39
39
## Requesting gas from the faucet
40
-
The client provides an API to request gas from the faucet. The `request_and_wait` function sends a request to the faucet and waits until the transaction is confirmed. The function returns the transaction details if the request is successful.
40
+
The client provides an API to request gas from the faucet. The `request` function sends a request to the faucet and waits until the transaction is confirmed. The function returns the transaction details if the request is successful.
41
41
42
42
### Example for standard devnet/testnet/local networks.
let address = Address::from_str("SUI_ADDRESS_HERE")?;
53
53
// Request gas from the faucet and wait until a coin is received
54
54
// As the client is set to devnet, faucet will use the devnet faucet.
55
-
let faucet = FaucetClient::devnet().request_and_wait(address).await?;
56
-
if let Some(resp) = faucet {
57
-
let coins = resp.sent;
58
-
for coin in coins {
55
+
let faucet = FaucetClient::devnet().request(address).await;
56
+
if let Ok(resp) = faucet {
57
+
for coin in resp.coins_sent {
59
58
println!("coin: {:?}", coin);
60
59
}
61
60
}
62
61
63
62
// Request gas from the testnet faucet by explicitly setting the faucet to testnet
64
-
let faucet_testnet = FaucetClient::testnet().request_and_wait(address).await?;
63
+
let faucet_testnet = FaucetClient::testnet().request(address).await?;
65
64
Ok(())
66
65
}
67
66
```
68
67
69
68
### Example for custom faucet service.
70
-
Note that this `FaucetClient` is explicitly designed to work with two endpoints: `v1/gas`, and `v1/status`. When passing in the custom faucet URL, skip the final endpoint and only pass in the top-level url (e.g., `https://faucet.devnet.sui.io`).
69
+
Note that this `FaucetClient` is explicitly designed to work with this endpoint: `v2/gas`, When passing in the custom faucet URL, skip the final endpoint and only pass in the top-level url (e.g., `https://faucet.devnet.sui.io`).
0 commit comments