From a61d2569e44818f6114dd68021bfa38d206e5347 Mon Sep 17 00:00:00 2001 From: Ho3einWave Date: Wed, 30 Oct 2024 16:24:11 +0330 Subject: [PATCH] refactor: Add CONTRIBUTING.md and update README.md This commit adds a CONTRIBUTING.md file to provide guidelines for contributing to the MTS SDK project. It also updates the README.md file with usage examples and information about the Assets service in the MyTonSwap client. [Issue #123] --- CONTRIBUTING.md | 44 ++++++++++++++++++++++++++++++++++++++++++++ README.md | 45 +++++++++++++++++++++++++++++++++++++++------ 2 files changed, 83 insertions(+), 6 deletions(-) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..6123b93 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,44 @@ +# Contributing to MTS SDK + +Thank you for considering contributing to the MTS SDK project! We welcome contributions from the community and are grateful for your support. + +## How to Contribute + +### Reporting Bugs + +If you find a bug, please report it by opening an issue on our [GitHub Issues](https://github.com/your-repo/mts-sdk/issues) page. Provide as much detail as possible, including steps to reproduce the issue and any relevant logs or screenshots. + +### Feature Requests + +We are always looking to improve the MTS SDK. If you have a feature request, please open an issue on our [GitHub Issues](https://github.com/your-repo/mts-sdk/issues) page and describe the feature in detail. + +### Submitting Changes + +1. **Fork the Repository**: Fork the project on GitHub and clone your fork locally. +2. **Create a Branch**: Create a new branch for your changes (`git checkout -b my-feature-branch`). +3. **Make Changes**: Make your changes to the codebase. +4. **Commit Changes**: Commit your changes with a clear and concise commit message (`git commit -m "Add new feature"`). +5. **Push Changes**: Push your changes to your fork (`git push origin my-feature-branch`). +6. **Open a Pull Request**: Open a pull request on the main repository and provide a detailed description of your changes. + +### Code Style + +Please ensure your code adheres to the project's coding standards. We use [Prettier](https://prettier.io/) for code formatting. Run `npm run format` before committing your changes. + +### Testing + +Ensure that your changes do not break existing tests and add new tests for any new functionality. Run the test suite using `npm test`. + +### Documentation + +Update the documentation to reflect any changes or new features. This includes updating the README.md and any other relevant documentation files. + +## Code of Conduct + +Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project, you agree to abide by its terms. + +## Getting Help + +If you need help or have any questions, feel free to reach out by opening an issue or contacting the maintainers. + +Thank you for your contributions! diff --git a/README.md b/README.md index a494466..9afdc92 100644 --- a/README.md +++ b/README.md @@ -5,15 +5,48 @@

SDK for MyTonSwap DEX aggregator

-### ⚠️ Active Development Notice ⚠️ -This project is currently under active development and is not yet ready for public use. - -We recommend you DO NOT use this project in production environments until a stable release is announced. Expect frequent changes, updates, and possible breaking changes during this phase. - - Installation: ```bash npm install @mytonswap/sdk ``` +## Usage + +Here's a basic example of how to use the MyTonSwap SDK: + +```ts +import { MyTonSwapClient } from '@mytonswap/sdk'; + +const client = new MyTonSwapClient(); + +async function performSwap() { + const userWallet = 'your-wallet-address'; + const TON = await client.assets.getExactAsset('TON'); + const NOT = await client.assets.getExactAsset('NOT'); + const bestRoute = await client.router.findBestRoute( + TON!.address, + NOT!.address, + toNano(1), + 1, + ); + + const swap = await client.swap.createSwap(userWallet, bestRoute); + console.log(swap); +} + +performSwap(); +``` + + +## Contributing + +We welcome contributions! Please read our [contributing guidelines](CONTRIBUTING.md) before submitting a pull request. + +## License + +This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. + +## Support + +If you have any questions or need help, feel free to open an issue on our [GitHub repository](https://github.com/MyTonSwap/sdk/issues). \ No newline at end of file