docs(readme): add USDT Payment example and fix Transaction args decimal scaling - #77
Open
samuelchimmy wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
README.md— one commit, two targeted fixesFix 1: Transaction example
argsdecimal clarificationThe existing
Transactionexample passesargs: ["0x717...", 1]— a rawuint256value of1. For cUSD (18 decimals) this is0.000000000000000001 cUSD, not1 cUSD. This is misleading for any developer copying the example.Changed to
1_000_000_000_000_000_000n(1 cUSD in wei) and added inline comments explaining:0x48065fbBE25f71C9282ddf5e1cD6D6A887483D5e, 6 decimals →1_000_000n)Fix 2: Add USDT
PaymentexampleThe
Paymentsection has one example using cUSD. TheIdentityprops table already liststoken: "CELO" | "cUSD" | "USDT"showing USDT is a supported token type, but there is noPaymentexample showing how to use it.Added a
### Example with USDTsubsection immediately after the existingPaymentBasicexample with:PaymentUSDTcomponent following the exact same pattern asPaymentBasicamountis passed as a human-readable stringWhy
The
Transactionexample withargs: [address, 1]is the kind of mistake that causes real fund loss — a developer copying it and substituting their own token address would send a transaction that appears to succeed but transfers a negligible amount. The corrected value makes the scaling requirement explicit.The USDT
Paymentexample closes a gap between the props documentation (which mentions USDT) and the usage examples (which only show cUSD).How to verify
1_000_000_000_000_000_000ninREADME.md— should appear in the Transaction example with accompanying decimal commentsPaymentUSDT— the complete component should appear under### Example with USDT48065fbBE— USDT address should appear in both the Transaction comment and the PaymentUSDT constant