Download the PHP package mayvenstudios/flow-php-sdk without Composer

On this page you can find all versions of the php package mayvenstudios/flow-php-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package flow-php-sdk

Flow PHP SDK

:warning: This is an alpha release; functionality may change.

This is a Laravel PHP package that allows you to interact with the Flow blockchain by using the Flow CLI.

In the future we'll make a full integration with the GRPC interface, but for now it's just a wrapper around the Flow CLI.

At the moment, the SDK includes the following features:

Installation

Composer

To add this SDK to your project using Composer, use the following:

Environment variables

After this, you should add the following variables in your .env file. This example shows the default Flow CLI path for macOS if you're using Homebrew, but on a Linux server it will likely be ~/.local/bin

Cadence folder

It's very important that you put all your flow.json config file and the contracts, scripts and transactions in a folder called cadence in the root directory of your project. This folder will be used as the base path to run the flow command, so that it will be able to read all the necessary Flow configurations.

Config file (optional)

If you're using Laravel you can also run this command to publish the config files if you need.

Install the grpc extension (optional)

This is only needed if you want to help develop the full GRPC version.

Example Usage

Once you have added the package via Composer and setup the environment variables, you can use the Flow Facade in the following ways.

Please remember to import the class at the beginning of your PHP with use Flow;

All the output will be returned as PHP Object parsed from the JSON returned by the Flow CLI.

Get the latest Block

Get the latest Block by ID

Get Events within a range of Blocks (250 max)

Run a script

Execute a transaction

Arguments

You can easily pass arguments to the script and transactions by using the following methods

Integer (UInt64)

Fix (UFix64)

String

Address

Bool

DictionaryString (Dictionary of {String:String})

Contribution

Project is in the very early phase, all contributions are welcomed.

Read the contributing guide to get started.

Dependencies

Protobuf-PHP Illuminate-Support

License

Apache License 2.0


All versions of flow-php-sdk with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0.0
illuminate/support Version ^10.0
symfony/process Version ^6.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package mayvenstudios/flow-php-sdk contains the following files

Loading the files please wait ....