{"id":13780108,"url":"https://github.com/blockfrost/blockfrost-java","last_synced_at":"2025-08-01T15:31:59.020Z","repository":{"id":41250518,"uuid":"388098557","full_name":"blockfrost/blockfrost-java","owner":"blockfrost","description":"Java SDK for the Blockfrost.io API.","archived":false,"fork":false,"pushed_at":"2023-10-22T20:38:07.000Z","size":408,"stargazers_count":11,"open_issues_count":9,"forks_count":10,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-11-17T15:47:44.511Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/blockfrost.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}},"created_at":"2021-07-21T11:45:04.000Z","updated_at":"2023-09-27T08:25:15.000Z","dependencies_parsed_at":"2024-01-15T20:47:20.974Z","dependency_job_id":null,"html_url":"https://github.com/blockfrost/blockfrost-java","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blockfrost%2Fblockfrost-java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blockfrost%2Fblockfrost-java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blockfrost%2Fblockfrost-java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blockfrost%2Fblockfrost-java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/blockfrost","download_url":"https://codeload.github.com/blockfrost/blockfrost-java/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228389159,"owners_count":17912189,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-08-03T18:01:12.398Z","updated_at":"2024-12-06T00:11:27.311Z","avatar_url":"https://github.com/blockfrost.png","language":"Java","funding_links":[],"categories":["Blockfrost Java Client"],"sub_categories":[],"readme":"[![Build](https://github.com/blockfrost/blockfrost-java/actions/workflows/build.yml/badge.svg)](https://github.com/blockfrost/blockfrost-java/actions/workflows/build.yml) [![Integration Tests](https://github.com/blockfrost/blockfrost-java/actions/workflows/integration-test.yml/badge.svg)](https://github.com/blockfrost/blockfrost-java/actions/workflows/integration-test.yml)\n\n# blockfrost-java\n\nJava SDK for the Blockfrost.io API.\n\n**Compatible with Blockfrost.io OpenAPI version 0.1.26**\n\n\n## Getting started\n\nTo use this SDK, you first need to log in to [blockfrost.io](https://blockfrost.io), create your project and retrieve the API token.\n\n\u003cimg src=\"https://i.imgur.com/smY12ro.png\"\u003e\n\n\u003cbr/\u003e\n\n## Build\n\n```\n$\u003e git clone https://github.com/blockfrost/blockfrost-java.git\n$\u003e ./gradlew clean build\n```\n\n## Publish to Local Maven Repository\n\n```\n$\u003e ./gradlew publishToMavenLocal\n```\n\n## Run Integration tests\nTo run integration tests, you need Blockfrost Project Id for Cardano Testnet.\n```\nexport BF_PROJECT_ID=\u003cBlockfrost Cardano Testnet Project Id\u003e\nexport BF_IPFS_PROJECT_ID=\u003cBlockfrost Ipfs Project Id\u003e\n\n./gradlew integrationTest -PBF_PROJECT_ID=${BF_PROJECT_ID} -PBF_IPFS_PROJECT_ID=${BF_IPFS_PROJECT_ID}\n```\n\n## How to use ?\n\n### Add dependency \n\n- For Maven, add the following dependency to project's pom.xml\n\n```\n    \u003cdependencies\u003e\n        \u003cdependency\u003e\n            \u003cgroupId\u003eio.blockfrost\u003c/groupId\u003e\n            \u003cartifactId\u003eblockfrost-java\u003c/artifactId\u003e\n            \u003cversion\u003e$version\u003c/version\u003e\n        \u003c/dependency\u003e\n    \u003c/dependencies\u003e\n```\n\n- For Gradle, add the following dependency to build.gradle\n\n```\ncompile 'com.bloxbean.cardano:cardano-client-lib:$version'\n```\n\n**Note:** Replace '$version' with the correct version number\n\n**For example:** $version = 0.1.0-SNAPSHOT (If you have published snapshot jar to your local maven repository)\n\n### Usage\n\n#### Following services are available\n\n- **Cardano**\n    - AccountService\n    - AddressService\n    - AssetService\n    - BlockService\n    - EpochService\n    - HealthService\n    - LedgerService\n    - MetadataService\n    - NetworkService\n    - PoolService\n    - TransactionService\n  - NutLinkService\n- **IPFS**\n    - IPFSService\n\n\n#### Cardano Api Usage\n\n- Create a BlockService instance\n\n```\nBlockService blockService = new BlockServiceImpl(Constants.BLOCKFROST_TESTNET_URL, PROJECT_ID);\n```\n\n- Get Latest Block Details\n\n```\nBlock block = blockService.getLatestBlock();\n```\n\n#### IPFS Api Usage\n\n- Create IPFSService instance\n\n```\nIPFSService ipfsService = new IPFSServiceImpl(Constants.BLOCKFROST_IPFS_URL, IPFS_PROJECT_ID);\n```\n\n- Add to IPFS, Pin the content and Get content by CID\n\n```\nFile file = new File(\u003cpath to file\u003e);\nIPFSObject ipfsObject = ipfsService.add(file);\n\n//pin\nPinResponse pinResponse = ipfsService.pinAdd(ipfsObject.getIpfsHash());\n       \n//get\nbyte[] bytes = ipfsService.get(ipfsObject.getIpfsHash());\n```\n#### Release resources when program exits\nTo release OkHttpClient's thread pool and other resources when the program exits, invoke the following api.\n\n```\nNetworkHelper.getInstance().shutdown();\n```\n\n### Configuration\n\nA supported configuration property can be set through system property or environment variable. You can also directly set a config property using ConfigHelper.\n\n**Example:**\n```\nConfigHelper.INSTANCE.setThreadCount(60);\nConfigHelper.INSTANCE.setRateLimitForPeriod(40);\n```\n\n**List of supported config properties**\n\n| Property Name | Description |\n| --------------|-------------|\n| BF_API_MAX_THREADS | No of threads to use while fetching multiple pages of data in a single request. **Default Value: 10** (Example: getAllAddressUtxos, getAddressTransactions ...)|\n| BF_RATE_LIMIT_FOR_PERIOD |  The permission limit for refresh period. This property is used in rate limit implementation. **Default Value: 10** |\n| BF_RATE_LIMIT_REFRESH_PERIOD_IN_SEC | The period of limit refresh in sec.  **Default Value: 1** After each period rate limiter sets its permission count to value set for BF_RATE_LIMIT_FOR_PERIOD.|\n| BF_RATE_LIMIT_TIMEOUT_DURATION_IN_MILLIS | The default wait for permission duration in milliseconds. **Default Value: 5000**|\n| BF_CONNECTION_TIMEOUT | The connect timeout (connection/read/write) for new connections in seconds. **Default Value: 90**|\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblockfrost%2Fblockfrost-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblockfrost%2Fblockfrost-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblockfrost%2Fblockfrost-java/lists"}