Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/blockfrost/blockfrost-php

PHP SDK for the Blockfrost.io API
https://github.com/blockfrost/blockfrost-php

api blockfrost cardano php sdk

Last synced: 17 days ago
JSON representation

PHP SDK for the Blockfrost.io API

Awesome Lists containing this project

README

        

[![Build status](https://github.com/blockfrost/blockfrost-php/actions/workflows/php.yml/badge.svg)](https://github.com/blockfrost/blockfrost-php/actions/workflows/php.yml)

# blockfrost-php


PHP SDK for Blockfrost.io API.



Getting started
Installation
Usage



## Getting started

To use this SDK, you first need login into to [blockfrost.io](https://blockfrost.io) create your project to retrive your API token.


## Installation

### Composer

This SDK uses guzzlehttp for REST. [Composer](https://getcomposer.org/) is the preferred package manager to import this:

### composer.json

```json
{
"require" : {
"guzzlehttp/guzzle" : "^7.0"
},
"autoload" : {
"psr-4" : {
"Blockfrost\\" : "../blockfrost_api/"
}
},
"minimum-stability" : "dev",
"require-dev": {
"phpunit/phpunit": "^9.5"
}
}
```

```console
$ php composer.phar update
```

## Usage

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

### Cardano

```php
getLatestBlock();

echo $res->hash;
}

catch(Exception $err)
{
echo $err->getMessage();
}

?>
```