We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3a24454 commit ffd7f60Copy full SHA for ffd7f60
src/xrc_demo/main.mo
@@ -13,10 +13,7 @@ actor {
13
14
/// Extract the current exchange rate for the given symbol.
15
public func get_exchange_rate(symbol : Text) : async Float {
16
- let time_sec = Time.now() / 1_000_000_000;
17
- // Use the previous minute to increase the chance of getting a rate because
18
- // not every exchange has data available for the current minute.
19
- let time = Nat64.fromIntWrap(time_sec - 60);
+
20
let request : XRC.GetExchangeRateRequest = {
21
base_asset = {
22
symbol = symbol;
@@ -26,7 +23,8 @@ actor {
26
23
symbol = "USDT";
27
24
class_ = #Cryptocurrency;
28
25
};
29
- timestamp = ?time;
+ // Get the current rate.
+ timestamp = null;
30
31
32
// Every XRC call needs 10B cycles.
0 commit comments