Download the PHP package tigusigalpa/tokenterminal-php without Composer

On this page you can find all versions of the php package tigusigalpa/tokenterminal-php. 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 tokenterminal-php

TokenTerminal PHP/Laravel Client/SDK/Library

Tokenterminal PHP Laravel SDK

PHP Version License: MIT Tests PHPStan Coverage Codecov CodeQL Dependency Audit

A PHP client for the Token Terminal API v2.

It covers every endpoint the API exposes today, keeps the awkward parts (retries, redirects after a project gets renamed, responses that are half data and half errors) out of your application code, and drops into Laravel without any wiring.

What you get

Requirements

Installation

Quick start

Configuration

Environment variables

Variable Required Default Description
TOKEN_TERMINAL_API_KEY Yes — Your Token Terminal API key
TOKEN_TERMINAL_BASE_URL No https://api.tokenterminal.com Custom base URL
TOKEN_TERMINAL_TIMEOUT No 30 HTTP timeout in seconds
TOKEN_TERMINAL_RETRY_ATTEMPTS No 3 Maximum retry attempts
TOKEN_TERMINAL_MAX_RETRIES No 3 Alias for TOKEN_TERMINAL_RETRY_ATTEMPTS, shared with the Go SDK
TOKEN_TERMINAL_RETRY_DELAY No 1 Initial retry delay in seconds

Once those are set, this is all you need:

Building the config by hand

Endpoints

Domain Method HTTP Route
Assets $client->assets()->all() GET /v2/assets
Assets $client->assets()->get($id) GET /v2/assets/{asset_id}
Assets $client->assets()->historicalMetrics($id, $req) GET /v2/assets/{asset_id}/metrics
Assets $client->assets()->metricsBreakdown($id, $req) POST /v2/assets/{asset_id}/metrics-breakdown
Projects $client->projects()->all() GET /v2/projects
Projects $client->projects()->get($id) GET /v2/projects/{project_id}
Projects $client->projects()->product($pid, $prodId) GET /v2/projects/{project_id}/products/{product_id}
Projects $client->projects()->financialStatement($id, $req) GET /v2/projects/{project_id}/financial-statement
Projects $client->projects()->historicalMetrics($id, $req) GET /v2/projects/{project_id}/metrics
Projects $client->projects()->productHistoricalMetrics($pid, $prodId, $req) GET /v2/projects/{project_id}/products/{product_id}/metrics
Projects $client->projects()->metricAggregations($id) GET /v2/projects/{project_id}/metric-aggregations
Market Sectors $client->marketSectors()->all() GET /v2/market-sectors
Market Sectors $client->marketSectors()->get($id) GET /v2/market-sectors/{market_sector_id}
Metrics $client->metrics()->all() GET /v2/metrics
Metrics $client->metrics()->data($id, $req) GET /v2/metrics/{metric_id}
Metrics $client->metrics()->aggregations($req) GET /v2/metric-aggregations
Metrics $client->metrics()->breakdown($req) POST /v2/metric-breakdown
Datasets $client->datasets()->all() GET /v2/datasets
Datasets $client->datasets()->blockchainComparison($req) GET /v2/datasets/blockchain_comparison
Datasets $client->datasets()->cohortAnalysis($req) GET /v2/datasets/cohort_analysis
Datasets $client->datasets()->cryptoScreener($req) GET /v2/datasets/crypto_screener
Datasets $client->datasets()->insiderTransactions($req) GET /v2/datasets/insider_transactions
Datasets $client->datasets()->projectContracts($req) GET /v2/datasets/project_contracts
Datasets $client->datasets()->trendingContracts($req) GET /v2/datasets/trending_contracts

Errors

Catch the specific case you can actually handle, and let ApiException cover the rest:

The hierarchy:

Partial success

Some endpoints happily return usable data together with an errors array, for example when one metric id out of five is wrong. Instead of throwing everything away, the SDK hands you both:

How retries behave

Laravel

Auto-discovery takes care of the service provider. Publish the config if you want to tweak it:

There's more detail in examples/laravel_usage.md.

Examples

Example What it shows Run it
Basic Listing projects and metrics php examples/basic.php
Project Metrics Historical metrics with filters php examples/project_metrics.php
Metric Breakdown POST breakdown with stats php examples/metric_breakdown.php
Datasets Querying the crypto screener php examples/datasets.php
Error Handling Dealing with API errors php examples/error_handling.php
Laravel Usage Laravel integration guide See examples/laravel_usage.md

Testing

The unit suite runs on PHP 8.1+. Laravel integration tests use a separate Laravel 12/Testbench 10 environment on PHP 8.2+:

Everything runs against Guzzle's MockHandler, so the test suites never touch the real API and need no API key.

API documentation

License

MIT © Igor Sazonov


All versions of tokenterminal-php with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
ext-json Version *
psr/http-client Version ^1.0
psr/http-factory Version ^1.0
psr/http-message Version ^1.1 || ^2.0
guzzlehttp/guzzle Version ^7.0
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 tigusigalpa/tokenterminal-php contains the following files

Loading the files please wait ...