Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/markjivko/enjin-php-sdk
Enjin Platform SDK for PHP
https://github.com/markjivko/enjin-php-sdk
blockchain blockchain-sdk enjin-platform enjin-sdk markjivko nft nfts non-fungible-tokens php sdk sdk-php
Last synced: about 2 months ago
JSON representation
Enjin Platform SDK for PHP
- Host: GitHub
- URL: https://github.com/markjivko/enjin-php-sdk
- Owner: markjivko
- License: apache-2.0
- Created: 2021-12-17T16:34:48.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-01-29T12:08:56.000Z (almost 3 years ago)
- Last Synced: 2024-03-21T18:55:17.525Z (10 months ago)
- Topics: blockchain, blockchain-sdk, enjin-platform, enjin-sdk, markjivko, nft, nfts, non-fungible-tokens, php, sdk, sdk-php
- Language: PHP
- Homepage: https://enjin.io/products/platform
- Size: 85.9 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Blockchain SDK by Enjin for PHP
Create blockchain applications using the PHP programming language.
[Learn more](https://enjin.io/) about the Enjin blockchain platform.
Sign up to Enjin Cloud: [Kovan (Testnet)](https://kovan.cloud.enjin.io/),
[Mainnet (Production)](https://cloud.enjin.io/) or [JumpNet](https://jumpnet.cloud.enjin.io/).This is a port from the official [Java](https://github.com/enjin/enjin-java-sdk)/[C#](https://github.com/enjin/enjin-csharp-sdk) SDKs with no support for async tasks and events (by design).
### Resources
* [Enjin Docs](https://docs.enjin.io)
### Table of Contents
* [Compatibility](#compatibility)
* [Installation](#installation)
* [Quick Start](#quick-start)
* [Contributing](#contributing)
* [Issues](#issues)
* [Pull Requests](#pull-requests)
* [Copyright and Licensing](#copyright-and-licensing)## Compatibility
The Enjin PHP SDK requires at a minimum PHP7.
## Installation
Simply clone this Git repository and use a PSR-4 Autoloader.
## Quick Start
This example showcases how to quickly create and authenticate a client on the project schema which will then allow us to
make further requests to the platform.```php
// Enjin Platform SDK for PHP
use Enjin\Sdk\EnjinHosts;
use Enjin\Sdk\ProjectClient;
use Enjin\Sdk\GraphQL\Request\Project;
use Enjin\Sdk\GraphQL\Request\Shared;// Get the project client
$projectClient = new ProjectClient(EnjinHosts::KOVAN);// Authenticate project
$accessToken = $projectClient->authProject(
(new Project\Query\AuthProject())
->setUuid('00000000-0000-0000-0000-000000000000')
->setSecret('AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA')
);// Store the authentication token
if (null !== $accessToken) {
echo 'Client is now authenticated' . PHP_EOL;
$projectClient->auth($accessToken->getToken());
// Get gas prices
$gasPrices = $projectClient->getGasPrices(new Shared\Query\GetGasPrices());
}
```## Contributing
Contributions to the SDK are appreciated!
### Issues
You can open issues for bugs and enhancement requests.
### Pull Requests
If you make any changes or improvements to the SDK, which you believe are beneficial to others, consider making a pull
request to merge your changes to be included in the next release.Be sure to include your name in the list of contributors.
## Copyright and Licensing
The license summary below may be copied.
```text
Copyright 2021 Enjin Pte. Ltd.Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```