PHPackages                             emekaorjiani/linkio - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. emekaorjiani/linkio

ActiveLibrary

emekaorjiani/linkio
===================

Laravel package for LinkIO integration

v1.0.3(1y ago)0133MITPHP

Since Mar 11Pushed 1y ago1 watchersCompare

[ Source](https://github.com/emekaorjiani/linkio)[ Packagist](https://packagist.org/packages/emekaorjiani/linkio)[ RSS](/packages/emekaorjiani-linkio/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (5)Used By (0)

📦 LinkIO Laravel Package
========================

[](#-linkio-laravel-package)

> **Laravel LinkIO Integration Package**
> Developed by **Emeka Orjiani** |

---

🌐 Introduction
--------------

[](#-introduction)

The `emekaorjiani/linkio` package provides a seamless integration of the **LinkIO API** into Laravel applications. This package allows you to manage **On-Ramp**, **Off-Ramp**, **Bridge Transactions**, and **Rates**, as well as handle **secure webhooks** directly from your Laravel backend.

It simplifies complex API interactions, making it easy to initiate transactions, fetch rates, and process webhooks securely—all backend-driven and ready for consumption by your frontend (React, Vue, Inertia.js, Blade).

---

✅ Features
----------

[](#-features)

- 🔐 Secure **On-Ramp** (fiat → crypto) transactions
- 🔓 Easy **Off-Ramp** (crypto → fiat) transactions
- 🔄 **Bridging** between currencies and networks
- 📈 Retrieve real-time **Rates** (on-ramp, off-ramp, bridge, OTC buy/sell)
- 📡 Secure **Webhook Handling** with signature verification middleware
- 🚀 Clean **Laravel Services**, **Facades**, and **DTOs** for data consistency
- 🎉 Ready for **React**, **Vue**, **Inertia.js**, and **Blade** integration

---

📥 Installation
--------------

[](#-installation)

### Step 1: Install via Composer

[](#step-1-install-via-composer)

```
composer require emekaorjiani/linkio
```

### Step 2: Publish Configuration (optional)

[](#step-2-publish-configuration-optional)

```
php artisan vendor:publish --tag=linkio-config
```

This will create a config file at `config/linkio.php`.

---

⚙️ Configuration
----------------

[](#️-configuration)

Open your `.env` file and add your LinkIO credentials:

```
LINKIO_API_KEY=your_linkio_api_key
LINKIO_API_SECRET=your_linkio_api_secret
LINKIO_BASE_URL=https://api.linkio.world/v1
LINKIO_WEBHOOK_SECRET=your_linkio_webhook_secret
```

Check or edit the published config file at `config/linkio.php`:

```
return [
    'api_key'        => env('LINKIO_API_KEY'),
    'api_secret'     => env('LINKIO_API_SECRET'),
    'base_url'       => env('LINKIO_BASE_URL', 'https://api.linkio.world/v1'),
    'webhook_secret' => env('LINKIO_WEBHOOK_SECRET', ''),
];
```

---

🚀 Usage Examples
----------------

[](#-usage-examples)

> 💡 Import the **Facade** in your controllers or services:

```
use EmekaOrjiani\LinkIO\Facades\LinkIO;
```

---

### 1. On-Ramp Transactions (Fiat ➡️ Crypto)

[](#1-on-ramp-transactions-fiat-️-crypto)

#### Create On-Ramp Transaction

[](#create-on-ramp-transaction)

```
$transaction = LinkIO::onRamp()->createOnRampTransaction(
    walletAddress: '0xYourWalletAddress',
    amount: 1000,
    fiatCurrency: 'NGN'
);

return response()->json($transaction);
```

#### Get On-Ramp Transaction

[](#get-on-ramp-transaction)

```
$transaction = LinkIO::onRamp()->getOnRampTransaction('transaction_id');
```

#### List On-Ramp Transactions

[](#list-on-ramp-transactions)

```
$transactions = LinkIO::onRamp()->listOnRampTransactions([
    'status' => 'completed',
]);
```

---

### 2. Off-Ramp Transactions (Crypto ➡️ Fiat)

[](#2-off-ramp-transactions-crypto-️-fiat)

#### Create Off-Ramp Transaction

[](#create-off-ramp-transaction)

```
$transaction = LinkIO::offRamp()->createOffRampTransaction(
    walletAddress: '0xYourWalletAddress',
    amount: 0.5,
    cryptoCurrency: 'USDT'
);
```

#### Get Off-Ramp Transaction

[](#get-off-ramp-transaction)

```
$transaction = LinkIO::offRamp()->getOffRampTransaction('transaction_id');
```

#### List Off-Ramp Transactions

[](#list-off-ramp-transactions)

```
$transactions = LinkIO::offRamp()->listOffRampTransactions();
```

---

### 3. Bridge Transactions (Cross-Network / Cross-Currency)

[](#3-bridge-transactions-cross-network--cross-currency)

#### Create Bridge Transaction

[](#create-bridge-transaction)

```
$transaction = LinkIO::bridge()->createBridgeTransaction(
    walletAddress: '0xYourWalletAddress',
    sourceAmount: 0.5,
    sourceCurrency: 'USDT',
    sourceNetwork: 'TRON',
    destinationCurrency: 'USDT',
    destinationNetwork: 'BSC'
);
```

#### Get Bridge Transaction

[](#get-bridge-transaction)

```
$transaction = LinkIO::bridge()->getBridgeTransaction('transaction_id');
```

#### List Bridge Transactions

[](#list-bridge-transactions)

```
$transactions = LinkIO::bridge()->listBridgeTransactions();
```

---

### 4. Rates (On-Ramp, Off-Ramp, Bridge, OTC)

[](#4-rates-on-ramp-off-ramp-bridge-otc)

#### On-Ramp Rate

[](#on-ramp-rate)

```
$rate = LinkIO::rates()->getOnRampRates('NGN', 'USDT');
```

#### Off-Ramp Rate

[](#off-ramp-rate)

```
$rate = LinkIO::rates()->getOffRampRates('USDT', 'NGN');
```

#### Bridge Rate

[](#bridge-rate)

```
$rate = LinkIO::rates()->getBridgeRates('USDT', 'USDT', 'TRON', 'BSC');
```

#### OTC Buy Rate

[](#otc-buy-rate)

```
$rate = LinkIO::rates()->getOTCBuyRates('NGN', 'USDT');
```

#### OTC Sell Rate

[](#otc-sell-rate)

```
$rate = LinkIO::rates()->getOTCSellRates('USDT', 'NGN');
```

---

🛡️ Webhook Handling
-------------------

[](#️-webhook-handling)

### 1. Register Webhook Route in `routes/api.php`

[](#1-register-webhook-route-in-routesapiphp)

```
use EmekaOrjiani\LinkIO\Http\Controllers\WebhookController;

Route::post('/webhook/linkio', [WebhookController::class, 'handle'])
    ->middleware('linkio.signature');
```

### 2. Handle the Webhook in `WebhookController`

[](#2-handle-the-webhook-in-webhookcontroller)

This is already set up with:

```
public function handle(Request $request)
{
    $payload = WebhookPayloadDTO::fromRequest($request);

    if ($payload->eventType === 'transaction.completed') {
        // Process your completed transaction
    }

    return response()->json(['status' => 'ok']);
}
```

### 3. Middleware Security (`EnsureSignature.php`)

[](#3-middleware-security-ensuresignaturephp)

The `linkio.signature` middleware verifies incoming webhook requests by validating the signature with your `LINKIO_WEBHOOK_SECRET`.

---

🛠️ How it Works (Under the Hood)
--------------------------------

[](#️-how-it-works-under-the-hood)

- **Services**: Each core process (OnRamp, OffRamp, Bridge, Rates) has its own dedicated Service class under `src/Services`.
- **Client**: `LinkIOClient.php` handles API requests using Laravel’s `Http` facade, with signature verification and response validation.
- **DTOs**: Each API response is transformed into a Data Transfer Object (DTO) for clean, predictable data structures.
- **Middleware**: `EnsureSignature` middleware protects your webhook routes from spoofed or unauthorized requests.

---

📝 Example Laravel Controller
----------------------------

[](#-example-laravel-controller)

You can easily wire this into your Laravel project, exposing clean REST APIs for your frontend (React, Vue, Inertia.js).

```
namespace App\Http\Controllers;

use Illuminate\Http\Request;
use EmekaOrjiani\LinkIO\Facades\LinkIO;

class OnRampController extends Controller
{
    public function create(Request $request)
    {
        $request->validate([
            'wallet_address' => 'required|string',
            'amount' => 'required|numeric|min:1',
            'fiat_currency' => 'required|string|size:3'
        ]);

        $transaction = LinkIO::onRamp()->createOnRampTransaction(
            $request->wallet_address,
            $request->amount,
            $request->fiat_currency
        );

        return response()->json($transaction);
    }
}
```

---

🔗 Frontend Consumption Example (React)
--------------------------------------

[](#-frontend-consumption-example-react)

This Laravel package is backend-centric. Your React frontend can consume the endpoints you expose.

```
import axios from 'axios';

async function initiateOnRamp(wallet, amount, fiatCurrency) {
  try {
    const res = await axios.post('/api/on-ramp', {
      wallet_address: wallet,
      amount: amount,
      fiat_currency: fiatCurrency,
    });

    console.log('Transaction created:', res.data);
  } catch (error) {
    console.error('OnRamp Error:', error.response?.data);
  }
}
```

---

✅ Requirements
--------------

[](#-requirements)

- PHP `^8.0`
- Laravel `9.x` or `10.x`
- LinkIO API Credentials (get them from your LinkIO dashboard)

---

🏗️ Project Structure
--------------------

[](#️-project-structure)

```
emekaorjiani/linkio
├── src/
│   ├── LinkIOServiceProvider.php
│   ├── Facades/LinkIO.php
│   ├── Http/
│   │   ├── Controllers/WebhookController.php
│   │   └── Middleware/EnsureSignature.php
│   ├── Services/
│   │   ├── LinkIOClient.php
│   │   ├── OnRampService.php
│   │   ├── OffRampService.php
│   │   ├── BridgeService.php
│   │   └── RatesService.php
│   ├── DTOs/
│   │   ├── OnRampTransactionDTO.php
│   │   ├── OffRampTransactionDTO.php
│   │   ├── BridgeTransactionDTO.php
│   │   ├── RateDTO.php
│   │   └── WebhookPayloadDTO.php
│   └── Exceptions/LinkIOException.php
├── config/linkio.php
└── README.md

```

---

✉️ Author
---------

[](#️-author)

**Emeka Orjiani**
📧

---

📄 License
---------

[](#-license)

This Laravel package is open-sourced software licensed under the [MIT license](LICENSE).

---

❤️ Contributing
---------------

[](#️-contributing)

Feel free to submit issues or pull requests!
Fork the repo → create a feature branch → submit a pull request.

---

🚀 Future Roadmap (Optional)
---------------------------

[](#-future-roadmap-optional)

- Add **support for LinkIO Widget Integration**
- Add **Laravel Events** for Webhook callbacks
- Add **Caching** for Rates endpoints
- Add **Optional Notifications** for transactions in Laravel

---

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance45

Moderate activity, may be stable

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

4

Last Release

434d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3dd5ebcc5035939eb71fdc5b7af98adc607e8c20d9613d49f06507637ea9bf3e?d=identicon)[Emekaorjiani](/maintainers/Emekaorjiani)

---

Top Contributors

[![emekaorjiani](https://avatars.githubusercontent.com/u/22224191?v=4)](https://github.com/emekaorjiani "emekaorjiani (5 commits)")

### Embed Badge

![Health badge](/badges/emekaorjiani-linkio/health.svg)

```
[![Health](https://phpackages.com/badges/emekaorjiani-linkio/health.svg)](https://phpackages.com/packages/emekaorjiani-linkio)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
