Skip to content

Latest commit

 

History

History
59 lines (35 loc) · 1.13 KB

README.md

File metadata and controls

59 lines (35 loc) · 1.13 KB

Build status

blockfrost-dart


Dart SDK for Blockfrost.io API.

Getting startedUsage


Getting started

To use this SDK, you first need login into to blockfrost.io create your project to retrive your API token.


Usage

Using the SDK is pretty straight-forward as you can see from the following example.

Cardano

import 'package:blockfrost_api/blockfrost_api.dart';

void main() async  {

	String projectId = "<insert project id>";
		
	String out;
	
	try
	{
		BlockService service = BlockService(Service.networkCardanoMainnet, projectId);
    	
		BlockContent block = await service.getLatestBlock();
			  	
		out = block.hash;
	}	
	
	catch(e)
	{
		out = e.toString();
	}
	
	print(out);

}