-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(examples): add usage examples #24
feat(examples): add usage examples #24
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for contributing. Looking good, just needs a few changes and simplifications.
Please follow the conventional commits naming for PR titles since we plan to auto-gen changelog from them.
examples/src/main/kotlin/io/ethers/examples/abi/TransferERC20.kt
Outdated
Show resolved
Hide resolved
examples/src/main/kotlin/io/ethers/examples/abi/TransferERC20.kt
Outdated
Show resolved
Hide resolved
examples/src/main/kotlin/io/ethers/examples/balancetracker/BalanceTracker.kt
Outdated
Show resolved
Hide resolved
examples/src/main/kotlin/io/ethers/examples/balancetracker/BalanceTracker.kt
Outdated
Show resolved
Hide resolved
examples/src/main/kotlin/io/ethers/examples/batchrequests/BatchRequests.kt
Outdated
Show resolved
Hide resolved
examples/src/main/kotlin/io/ethers/examples/datadecoding/DataDecoding.kt
Outdated
Show resolved
Hide resolved
...rc/main/kotlin/io/ethers/examples/tokenswapwitheventlistening/TokenSwapWithEventListening.kt
Outdated
Show resolved
Hide resolved
...rc/main/kotlin/io/ethers/examples/tokenswapwitheventlistening/TokenSwapWithEventListening.kt
Show resolved
Hide resolved
747aa24
to
20e54e6
Compare
…ly ws provider, simplification
20e54e6
to
64c3765
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, two small changes and it's ready for merge
|
||
// # Manually decode function input data when we only know function signature | ||
val function = AbiFunction.parseSignature("swapExactTokensForTokens(uint256,uint256,address[],address,uint256)") | ||
val manualDec = AbiCodec.decodeWithPrefix(4, function.inputs, calldata.value) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be replaced with function.decodeCall
. Normally, users should not use AbiCodec
directly.
…AbiCodec.decodeWithPrefix` for manual data decoding
…, don't close wsClient
…ing with SC wrapper
491ff07
to
6b1efaa
Compare
Description
Created examples:
Solution