examples icon indicating copy to clipboard operation
examples copied to clipboard

feat: exchange rate example in Rust

Open ielashi opened this issue 3 months ago • 4 comments

Adds an example of how to fetch an exchange rate from the exchange rate canister. This example is intended to be showcased on ICP Ninja along with a tutorial in https://internetcomputer.org/docs/defi/

ielashi avatar Dec 02 '25 18:12 ielashi

Looks like tokenmania is failing CI. It's unclear to me why given that this PR doesn't touch it in any form.

ielashi avatar Dec 02 '25 18:12 ielashi

Looks like tokenmania is failing CI. It's unclear to me why given that this PR doesn't touch it in any form.

@ielashi I assume it was a change in the icrc_ledger_types crate which might have been updated.

the example defines icrc-ledger-types = "0.1.6", the log prints Downloaded icrc-ledger-types v0.1.12

marc0olo avatar Dec 02 '25 18:12 marc0olo

Looks like tokenmania is failing CI. It's unclear to me why given that this PR doesn't touch it in any form.

@ielashi I assume it was a change in the icrc_ledger_types crate which might have been updated.

the example defines icrc-ledger-types = "0.1.6", the log prints Downloaded icrc-ledger-types v0.1.12

This is independent of this change - I think master is broken. I'll fix it in a separate PR. In the meantime, please have a look at this project.

ielashi avatar Dec 03 '25 08:12 ielashi

@ielashi is it intentional that you didn't add a README? 🤔

I just recognized that this is also the case in the receiving-icp example.

this might also lead to some weird behavior on ICP Ninja. I just remember that I recently checked this with @raymondk and this is what Ninja shows in the UI for receiving-icp (cc @fxgst @viviveevee) :

image

marc0olo avatar Dec 03 '25 08:12 marc0olo

@marc0olo done! I also added a readme for the receiving-icp example in https://github.com/dfinity/examples/pull/1298

ielashi avatar Jan 08 '26 10:01 ielashi

@ielashi I see that the example is missing in the CODEOWNERS file, can you also add it there and assign the defi team before merging?

marc0olo avatar Jan 09 '26 08:01 marc0olo