{"id":38546415,"url":"https://github.com/zarbanio/zarban-ts","last_synced_at":"2026-01-17T07:21:08.815Z","repository":{"id":267872389,"uuid":"897501629","full_name":"zarbanio/zarban-ts","owner":"zarbanio","description":"Zarban typeScript SDK","archived":false,"fork":false,"pushed_at":"2024-12-24T11:56:04.000Z","size":1371,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-26T04:58:39.211Z","etag":null,"topics":["blockchain","defi","sdk-typescript","typesctipt"],"latest_commit_sha":null,"homepage":"https://zarban.io","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zarbanio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-02T18:34:06.000Z","updated_at":"2024-12-24T11:56:08.000Z","dependencies_parsed_at":"2024-12-13T00:35:23.023Z","dependency_job_id":null,"html_url":"https://github.com/zarbanio/zarban-ts","commit_stats":null,"previous_names":["zarbanio/zarban-ts"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/zarbanio/zarban-ts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zarbanio%2Fzarban-ts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zarbanio%2Fzarban-ts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zarbanio%2Fzarban-ts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zarbanio%2Fzarban-ts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zarbanio","download_url":"https://codeload.github.com/zarbanio/zarban-ts/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zarbanio%2Fzarban-ts/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28503582,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T06:57:29.758Z","status":"ssl_error","status_checked_at":"2026-01-17T06:56:03.931Z","response_time":85,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blockchain","defi","sdk-typescript","typesctipt"],"created_at":"2026-01-17T07:21:08.165Z","updated_at":"2026-01-17T07:21:08.801Z","avatar_url":"https://github.com/zarbanio.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Zarban SDK\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://zarban.io/favicon.ico\" width=\"400\" alt=\"Logo\"\u003e\n\u003c/p\u003e\n\n[![npm version](https://badge.fury.io/js/zarban.svg)](https://badge.fury.io/js/zarban)\n[![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n[![TypeScript](https://img.shields.io/badge/TypeScript-5.7%2B-blue)](https://www.typescriptlang.org/)\n[![Node.js](https://img.shields.io/node/v/zarban)](https://www.npmjs.com/package/zarban)\n\nZarban SDK is a typeScript interface for interacting with the Zarban DeFi protocol, enabling developers to seamlessly integrate lending and borrowing functionalities into their applications. This SDK simplifies complex DeFi operations by providing easy-to-use methods for lending assets, managing collateral, borrowing funds, and monitoring positions in the Zarban protocol.\n\n## Features\n\n- **Automated API Client Generation**: Built using OpenAPI specification, ensuring type safety and up-to-date API compatibility\n- **Lending Operations**: Easily deposit assets, view lending rates, and manage lending positions\n- **Borrowing Management**: Streamlined methods for borrowing assets, managing collateral, and monitoring loan health\n- **Position Tracking**: Real-time access to user positions, including borrowed amounts, collateral ratios, and liquidation thresholds\n- **Market Data**: Simple methods to fetch current interest rates, available liquidity, and market statistics\n- **Type Safety**: Full type hints support for typeScript static type checking\n- **Error Handling**: Comprehensive error handling with detailed exceptions for DeFi operations\n- **Async Support**: Asynchronous methods for improved performance in high-throughput applications\n\n## Environments\n\nZarban SDK supports two distinct environments:\n\n1. **Mainnet**: The production environment for the Zarban DeFi protocol.\n\n   - Wallet API: `https://wapi.zarban.io`\n   - Service API: `https://api.zarban.io`\n\n2. **Testnet**: A separate testing environment for the Zarban protocol.\n   - Wallet API: `https://testwapi.zarban.io`\n   - Service API: `https://testapi.zarban.io`\n\nBe sure to use the appropriate environment configuration when interacting with the Zarban SDK.\n\n## Installation\n\n```bash\nnpm install zarban\n```\n\nor:\n\n```bash\nyarn install zarban\n```\n\n## Quick Start\n\nZarban SDK provides access to two distinct APIs:\n\n### 1. Wallet API (`zarban.wallet`)\n\nThe Wallet API handles user authentication and wallet management operations.\n\n### 2. Service API(`zarban.service`)\n\nThe Zarban Service API provides access to core DeFi protocol operations.\n\n```typeScript\nimport { Wallet } from \"zarban\";\n\n// Initialize the client\nconst cfg = Wallet.Configuration({\n    basePath: \"https://testwapi.zarban.io\",\n  });\n\nconst authApi = new Wallet.AuthApi.AuthApi(cfg);\n\n// Make a simple API call\ntry{\n  response = await authApi.someMethod()\n  console.log(response)\n}catch(error){\n  console.log(error)\n}\n```\n\n## Usage Examples\n\nFor detailed usage examples, see our [Examples Documentation](docs/examples).\n\n### Advanced Usage\n\nHere's a simple example to sign up and get started with Zarban:\n\n```typeScript\nimport { Wallet, ZarbanUtils } from \"zarban\";\nconst { withErrorHandler } = ZarbanUtils;\n\nasync function signupExample() {\n  // Create and configure the Configuration object\n  const cfg = new Wallet.Configuration({\n    basePath: \"https://testwapi.zarban.io\",\n  });\n\n  // Create an instance of the authApi using the Configuration\n  const authApi = new Wallet.AuthApi.AuthApi(cfg);\n\n  // Prepare the signup request data\n  const signupRequest: Wallet.SignUpRequest = {\n    email: \"user@example.com\",\n    password: \"yourSecurePassword\",\n  };\n\n  const signupWithHandler = withErrorHandler\u003cWallet.SimpleResponse\u003e(\n    \"Wallet\",\n    () =\u003e authApi.signupWithEmailAndPassword(signupRequest),\n    (response) =\u003e {\n      console.log(\"Signup successful!\");\n      console.log(\"Confirmation link sent.\");\n      console.log(\n        `Message: ${JSON.stringify(response.data.messages, null, 2)}`\n      );\n    }\n  );\n\n  const [result, error] = await signupWithHandler();\n  if (error) {\n    // You can do some extra work with errors here!\n    return error;\n  }\n  return result;\n}\n\n// Execute with proper error handling\nif (require.main === module) {\n  signupExample().then((result) =\u003e {\n    if (result instanceof Error) {\n      process.exit(1);\n    }\n    process.exit(0);\n  });\n}\n```\n\n## Configuration\n\nThe SDK can be configured with various options to customize its behavior and authentication methods.\n\n### Basic Configuration\n\n```typeScript\nimport { Wallet } from \"zarban\";\n\n// Basic configuration with just the host URL\nconst cfg = new Wallet.Configuration({\n    basePath: \"https://testwapi.zarban.io\",\n});\n```\n\n### Authentication Options\n\nThe SDK supports multiple authentication methods:\n\n1. API Key Authentication:\n\n```typeScript\nconst cfg = new Wallet.Configuration({\n    basePath: \"https://testwapi.zarban.io\",\n    apiKey: {\"APIKeyAuth\": \"your-api-key-here\"},\n});\n```\n\n2. Basic Authentication:\n\n```typeScript\nconst cfg = new Wallet.Configuration({\n    basePath: \"https://testwapi.zarban.io\",\n    username: \"your-username\",\n    password: \"your-password\"\n});\n```\n\n### Configuration Parameters\n\n| Parameter    | Type                                                                                                                                     | Description                                                                                                     |\n| ------------ | ---------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |\n| apiKey       | `string \\| Promise\u003cstring\u003e \\| ((name: string) =\u003e string) \\| ((name: string) =\u003e Promise\u003cstring\u003e)`                                         | Parameter for apiKey security. Can be a string, Promise of string, or function returning string/Promise.        |\n| username     | `string`                                                                                                                                 | Parameter for basic security authentication username.                                                           |\n| password     | `string`                                                                                                                                 | Parameter for basic security authentication password.                                                           |\n| accessToken  | `string \\| Promise\u003cstring\u003e \\| ((name?: string, scopes?: string[]) =\u003e string) \\| ((name?: string, scopes?: string[]) =\u003e Promise\u003cstring\u003e)` | Parameter for OAuth2 security. Can be a string, Promise of string, or function taking optional name and scopes. |\n| basePath     | `string`                                                                                                                                 | Override the default base path for API requests.                                                                |\n| serverIndex  | `number`                                                                                                                                 | Override the default server index for API requests.                                                             |\n| baseOptions  | `any`                                                                                                                                    | Base options to be applied to all axios calls.                                                                  |\n| formDataCtor | `new () =\u003e any`                                                                                                                          | Custom FormData constructor for environments that don't support the native FormData class.                      |\n\n## Error Handling\n\nTo make error handling easier, we provide a utility function named withErrorHandler. This function simplifies the process of managing errors and helps avoid repetitive try/catch blocks in your code.\n\nWhile using withErrorHandler is not mandatory, we highly recommend it for cleaner and more maintainable code. If you prefer, you can always handle errors manually using traditional try/catch blocks.\n\n### Usage example:\n\nUsing withErrorHandler\n\n```typeScript\nimport { ZarbanUtils } from \"zarban\";\nconst { withErrorHandler } = ZarbanUtils;\n\nconst loginWithHandler = withErrorHandler\u003cWallet.JwtResponse\u003e(\n    \"Wallet\",\n    () =\u003e authApi.loginWithEmailAndPassword(loginRequest),\n    (response) =\u003e {\n      console.log(\"Login successful!\");\n      console.log(`Token: ${response.data.token}`);\n    }\n  );\n\n  const [response, error] = await loginWithHandler();\n  if (error) {\n    // you can do some addition works with error here!\n    return error;\n  }\n```\n\nManual Error Handling\n\n```typeScript\n  try{\n    const response = await authApi.loginWithEmailAndPassword(loginRequest)\n    console.log(\"Login successful!\");\n    console.log(`Token: ${response.data.token}`);\n  }catch(error){\n    // handle different types of error here\n    console.log(error)\n  }\n```\n\n## Contributing\n\nWe welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.\n\n1. Fork the repository\n2. Create a new branch\n3. Make your changes\n4. Submit a pull request\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Support\n\n- Create an issue on GitHub\n- Email: info@zarban.io\n- Documentation: [https://docs.zarban.io](https://docs.zarban.io)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzarbanio%2Fzarban-ts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzarbanio%2Fzarban-ts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzarbanio%2Fzarban-ts/lists"}