{"_id":"@axvietnam/convert","_rev":"2-9127ee46f90e2a7514b182851135e223","name":"@axvietnam/convert","dist-tags":{"latest":"6.0.1"},"versions":{"6.0.1":{"name":"@axvietnam/convert","version":"6.0.1","keywords":["AXVN","API","Convert","Connector","REST","Trading"],"author":{"name":"hoangxuanbien"},"license":"MIT","_id":"@axvietnam/convert@6.0.1","maintainers":[{"name":"sbvvietnam","email":"magnesi24vnd@gmail.com"}],"homepage":"https://github.com/axvietnam/connector-js#readme","bugs":{"url":"https://github.com/axvietnam/connector-js/issues"},"dist":{"shasum":"35644cb86a6c28c07d3864e48a5a796734910a7e","tarball":"https://registry.npmjs.org/@axvietnam/convert/-/convert-6.0.1.tgz","fileCount":10,"integrity":"sha512-1s7Ri7Xgk4KwDEXvXKqtCpwA14D7ir8kjjgmWMA8XtdZl55x2XctlNRwIzLzERTf4uIK7iQPBNa8zT4xYkX8Lw==","signatures":[{"sig":"MEUCIFovwYutVEVnaUesW4wbC34ZXcH7P34eG9WELX1ImCwZAiEA0RiOTTKJ3NXaPfLIpdO/qbpGH9LrL9wNMIOzw2wcUV8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":325941},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"import":"./dist/index.mjs","require":"./dist/index.js"}},"gitHead":"092e4f289e9047114fb8ec66256510cc207e16bb","scripts":{"lint":"npx eslint '**/*.ts' --fix","test":"npx jest --maxWorkers=4 --bail","build":"npm run clean && tsdown","clean":"rm -rf dist","format":"npx prettier --ignore-path .prettierignore --write .","typecheck":"tsc --noEmit","test:watch":"npx jest --watch","prepublishOnly":"npm run build"},"_npmUser":{"name":"sbvvietnam","email":"magnesi24vnd@gmail.com"},"repository":{"url":"git+https://github.com/axvietnam/connector-js.git","type":"git"},"_npmVersion":"10.8.2","description":"Official AXVN Convert Connector - A lightweight library that provides a convenient interface to AXVN's Convert REST API.","directories":{},"_nodeVersion":"20.20.2","dependencies":{"axios":"^1.7.4","@axvietnam/common":"2.4.5"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.6.4","eslint":"8.57.0","tsdown":"^0.16.5","ts-jest":"^29.1.1","ts-node":"^10.9.1","prettier":"^3.3.3","typescript":"^5.7.2","@types/jest":"^29.5.4","@types/node":"^20.17.24","json-with-bigint":"^3.5.8","typescript-eslint":"^8.24.0"},"_npmOperationalInternal":{"tmp":"tmp/convert_6.0.1_1786799643323_0.4266957230890127","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2026-08-15T13:14:03.188Z","modified":"2026-08-16T18:06:16.648Z","6.0.1":"2026-08-15T13:14:03.468Z"},"bugs":{"url":"https://github.com/axvietnam/connector-js/issues"},"author":{"name":"hoangxuanbien"},"license":"MIT","homepage":"https://github.com/axvietnam/connector-js#readme","keywords":["AXVN","API","Convert","Connector","REST","Trading"],"repository":{"url":"git+https://github.com/axvietnam/connector-js.git","type":"git"},"description":"Official AXVN Convert Connector - A lightweight library that provides a convenient interface to AXVN's Convert REST API.","maintainers":[{"email":"magnesi24vnd@gmail.com","name":"sbvvietnam"},{"email":"Nhamhuan@gmail.com","name":"nhamhuan"}],"readme":"# AXVN JavaScript Convert Connector\n\n[![Open Issues](https://img.shields.io/github/issues/axvietnam/connector-js)](https://github.com/axvietnam/connector-js/issues)\n[![Code Style: Prettier](https://img.shields.io/badge/code%20style-prettier-ff69b4)](https://prettier.io/)\n[![npm version](https://badge.fury.io/js/@axvietnam%2Fconvert.svg)](https://badge.fury.io/js/@axvietnam%2Fconvert)\n[![npm Downloads](https://img.shields.io/npm/dm/@axvietnam/convert.svg)](https://www.npmjs.com/package/@axvietnam/convert)\n![Node.js Version](https://img.shields.io/badge/Node.js-%3E=22.12.0-brightgreen)\n[![Socket Badge](https://socket.dev/api/badge/npm/package/@axvietnam/convert)](https://socket.dev/npm/package/@axvietnam/convert)\n[![Docs](https://img.shields.io/badge/docs-online-blue?style=flat-square)](https://axvietnam.github.io/axvietnam-connector-js/modules/_axvietnam_convert.html)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nThis is a client library for the AXVN Convert API, enabling developers to interact programmatically with AXVN's Convert trading platform. The library provides tools to buy or sell cryptocurrencies through the REST API:\n\n- [REST API](./src/rest-api/rest-api.ts)\n\n## Table of Contents\n\n- [Supported Features](#supported-features)\n- [Installation](#installation)\n- [Documentation](#documentation)\n- [REST APIs](#rest-apis)\n- [Testing](#testing)\n- [Migration Guide](#migration-guide)\n- [Contributing](#contributing)\n- [Licence](#licence)\n\n## Supported Features\n\n- REST API Endpoints:\n  - `/sapi/v1/convert/*`\n- Inclusion of test cases and examples for quick onboarding.\n\n## Installation\n\nTo use this library, ensure your environment is running Node.js version **22.12.0** or later. If you're using `nvm` (Node Version Manager), you can set the correct version as follows:\n\n```bash\nnvm install 22.12.0\nnvm use 22.12.0\n```\n\nThen install the library using `npm`:\n\n```bash\nnpm install @axvietnam/convert\n```\n\n## Documentation\n\nFor detailed information, refer to the [AXVN API Documentation](https://developers.vnkr.vn/docs/convert).\n\n### REST APIs\n\nAll REST API endpoints are available through the [`rest-api`](./src/rest-api/rest-api.ts) module. Note that some endpoints require authentication using your AXVN API credentials.\n\n```typescript\nimport { Convert, ConvertRestAPI } from '@axvietnam/convert';\n\nconst configurationRestAPI = {\n    apiKey: 'your-api-key',\n    apiSecret: 'your-api-secret',\n};\nconst client = new Convert({ configurationRestAPI });\n\nclient.restAPI\n    .listAllConvertPairs()\n    .then((res) => res.data())\n    .then((data: ConvertRestAPI.ListAllConvertPairsResponse) => console.log(data))\n    .catch((err) => console.error(err));\n```\n\nMore examples can be found in the [`examples/rest-api`](./examples/rest-api/) folder.\n\n#### Configuration Options\n\nThe REST API supports the following advanced configuration options:\n\n- `timeout`: Timeout for requests in milliseconds (default: 1000 ms).\n- `proxy`: Proxy configuration:\n  - `host`: Proxy server hostname.\n  - `port`: Proxy server port.\n  - `protocol`: Proxy protocol (http or https).\n  - `auth`: Proxy authentication credentials:\n    - `username`: Proxy username.\n    - `password`: Proxy password.\n- `keepAlive`: Enable HTTP keep-alive (default: true).\n- `compression`: Enable response compression (default: true).\n- `retries`: Number of retry attempts for failed requests (default: 3).\n- `backoff`: Delay in milliseconds between retries (default: 1000 ms).\n- `httpsAgent`: Custom HTTPS agent for advanced TLS configuration.\n- `privateKey`: RSA or ED25519 private key for authentication.\n- `privateKeyPassphrase`: Passphrase for the private key, if encrypted.\n\n##### Timeout\n\nYou can configure a timeout for requests in milliseconds. If the request exceeds the specified timeout, it will be aborted. See the [Timeout example](./docs/rest-api/timeout.md) for detailed usage.\n\n##### Proxy\n\nThe REST API supports HTTP/HTTPS proxy configurations. See the [Proxy example](./docs/rest-api/proxy.md) for detailed usage.\n\n##### Keep-Alive\n\nEnable HTTP keep-alive for persistent connections. See the [Keep-Alive example](./docs/rest-api/keepAlive.md) for detailed usage.\n\n##### Compression\n\nEnable or disable response compression. See the [Compression example](./docs/rest-api/compression.md) for detailed usage.\n\n##### Retries\n\nConfigure the number of retry attempts and delay in milliseconds between retries for failed requests. See the [Retries example](./docs/rest-api/retries.md) for detailed usage.\n\n##### HTTPS Agent\n\nCustomize the HTTPS agent for advanced TLS configurations. See the [HTTPS Agent example](./docs/rest-api/httpsAgent.md) for detailed usage.\n\n##### Key Pair Based Authentication\n\nThe REST API supports key pair-based authentication for secure communication. You can use `RSA` or `ED25519` keys for signing requests. See the [Key Pair Based Authentication example](./docs/rest-api/key-pair-authentication.md) for detailed usage.\n\n##### Certificate Pinning\n\nTo enhance security, you can use certificate pinning with the `httpsAgent` option in the configuration. This ensures the client only communicates with servers using specific certificates. See the [Certificate Pinning example](./docs/rest-api/certificate-pinning.md) for detailed usage.\n\n#### Error Handling\n\nThe REST API provides detailed error types to help you handle issues effectively:\n\n- `ConnectorClientError`: General client error.\n- `RequiredError`: Thrown when a required parameter is missing.\n- `UnauthorizedError`: Indicates missing or invalid authentication credentials.\n- `ForbiddenError`: Access to the requested resource is forbidden.\n- `TooManyRequestsError`: Rate limit exceeded.\n- `RateLimitBanError`: IP address banned for exceeding rate limits.\n- `ServerError`: Internal server error.\n- `NetworkError`: Issues with network connectivity.\n- `NotFoundError`: Resource not found.\n- `BadRequestError`: Invalid request.\n\nSee the [Error Handling example](./docs/rest-api/error-handling.md) for detailed usage.\n\nIf `basePath` is not provided, it defaults to `https://api.vnkr.vn`.\n\n## Testing\n\nTo run the tests:\n\n```bash\nnpm install\n\nnpm run test\n```\n\nThe tests cover:\n\n- REST API endpoints\n- Error handling and edge cases\n\n## Migration Guide\n\nIf you are upgrading to the new modularized structure, refer to the [Migration Guide](./docs/migration_guide_convert_connector.md) for detailed steps.\n\n## Contributing\n\nContributions are welcome!\n\nSince this repository contains auto-generated code, we encourage you to start by opening a GitHub issue to discuss your ideas or suggest improvements. This helps ensure that changes align with the project's goals and auto-generation processes.\n\nTo contribute:\n\n1. Open a GitHub issue describing your suggestion or the bug you've identified.\n2. If it's determined that changes are necessary, the maintainers will merge the changes into the main branch.\n\nPlease ensure that all tests pass if you're making a direct contribution. Submit a pull request only after discussing and confirming the change.\n\nThank you for your contributions!\n\n## Disclaimer\n\nThis SDK is provided by AXVN on an \"as is\" and \"as available\" basis for use at your own risk. AXVN makes no representations or warranties of any kind, whether express or implied, as to the operation of the SDK, its accuracy, reliability, completeness, or fitness for any particular purpose.\n\nTo the fullest extent permitted by law, AXVN shall not be liable for any losses, damages, or expenses of any kind arising from or in connection with your use of, or inability to use, this SDK, including but not limited to any financial losses resulting from errors, bugs, interruptions, or inaccuracies in the SDK.\n\nYour use of this SDK to access the AXVN Platform is subject to the AXVN API Key Terms and the AXVN Terms of Use, which shall prevail in the event of any conflict with this disclaimer. You are solely responsible for any orders or transactions executed through the AXVN Platform using this SDK.\n\nThis SDK is not intended to constitute investment advice or a recommendation to buy, sell, or hold any digital asset. You should independently evaluate and verify all information before acting.\n\n- [AXVN Terms of Use](https://www.vnkr.vn/en/terms)\n- [AXVN API Key Terms](https://www.vnkr.vn/en/about-legal/terms-axvietnam-api)\n\n## Licence\n\nThis project is licensed under the MIT License. See the [LICENCE](./LICENCE) file for details.\n","readmeFilename":"README.md"}