zulucrypto/mobius-php

Mobius 的 API 客户端

v1.0.0 2017-10-15 23:18 UTC

This package is not auto-updated.

Last update: 2024-09-29 04:25:57 UTC


README

为使用 PHP 编写的应用程序提供对 Mobius API 的简单访问

安装

使用 composer 安装

$ composer require zulucrypto/mobius-php

快速入门

此库提供了一种面向对象的方式与 Mobius API 交互

// Main object for working with the API
$mobius = new Mobius($API_KEY);

// Retrieves an object to work with the DApp store
$appStore = $mobius->getAppStore($APP_UID);

// Easily query a user's balance
$userBalance = $appStore->getBalance($EMAIL);

// Use 5 MOBI and get the user's updated balance
$userBalance = $appStore->useBalance($EMAIL, 5);

对象

  • Mobius - 所有主要 API 对象都可通过此类访问
  • AppStore - 处理用户余额的方法
  • Token - 处理 ERC20 令牌的方法

更多信息