mainnet-cash/mainnet-php-generated
Composer 安装命令:
composer require mainnet-cash/mainnet-php-generated
包简介
A developer friendly bitcoin cash wallet api This API is currently in *active* development, breaking changes may be made prior to official release of version 1.0.0.
README 文档
README
A developer friendly bitcoin cash wallet api
This API is currently in active development, breaking changes may be made prior to official release of version 1.0.0.
This PHP package is automatically generated by the OpenAPI Generator project:
- API version: 3.1.7
- Build package: org.openapitools.codegen.languages.PhpClientCodegen
Requirements
PHP 7.2 and later
Installation & Usage
Composer
To install the bindings via Composer, add the following to composer.json:
{
"repositories": [
{
"type": "vcs",
"url": "https://github.com/mainnet-cash/mainnet-php-generated.git"
}
],
"require": {
"mainnet-cash/mainnet-php-generated": "*@dev"
}
}
Then run composer install
Manual Installation
Download the files and include autoload.php:
require_once('/path/to/Mainnet/vendor/autoload.php');
Tests
To run the unit tests:
composer install ./vendor/bin/phpunit
Getting Started
Please follow the installation procedure and then run the following:
<?php require_once(__DIR__ . '/vendor/autoload.php'); // Configure Bearer authorization: bearerAuth $config = Mainnet\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); $apiInstance = new Mainnet\Api\FaucetApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client(), $config ); try { $result = $apiInstance->getAddresses(); print_r($result); } catch (Exception $e) { echo 'Exception when calling FaucetApi->getAddresses: ', $e->getMessage(), PHP_EOL; } ?>
Documentation for API Endpoints
All URIs are relative to https://rest-unstable.mainnet.cash
| Class | Method | HTTP request | Description |
|---|---|---|---|
| FaucetApi | getAddresses | POST /faucet/get_addresses | Get addresses to return back or donate the testnet bch and tokens |
| FaucetApi | getTestnetBch | POST /faucet/get_testnet_bch | Get testnet bch |
| MineApi | mine | POST /mine | Mine regtest coins to a specified address |
| UtilApi | convert | POST /util/convert | convert between units |
| UtilApi | exchangeRate | POST /util/exchange_rate | convert between units |
| UtilApi | getAddrsByXpubKey | POST /util/get_addrs_by_xpubkey | Derive heristic determined addresses from an extended public key, per BIP32 |
| UtilApi | getXpubKeyInfo | POST /util/get_xpubkey_info | Decode information about an extended public key, per BIP32 |
| WalletApi | balance | POST /wallet/balance | Get total balance for wallet |
| WalletApi | createWallet | POST /wallet/create | create a new wallet |
| WalletApi | depositAddress | POST /wallet/deposit_address | Get a deposit address in cash address format |
| WalletApi | encodeTransaction | POST /wallet/encode_transaction | Encode and sign a transaction given a list of sendRequests, options and estimate fees |
| WalletApi | getAllNftTokenBalances | POST /wallet/get_all_nft_token_balances | Get non-fungible token balance |
| WalletApi | getAllTokenBalances | POST /wallet/get_all_token_balances | Get non-fungible token balance |
| WalletApi | getHistory | POST /wallet/get_history | Get a list of transactions related to a wallet |
| WalletApi | getNftTokenBalance | POST /wallet/get_nft_token_balance | Get non-fungible token balance |
| WalletApi | getTokenBalance | POST /wallet/get_token_balance | Get fungible token balance |
| WalletApi | getTokenUtxos | POST /wallet/get_token_utxos | Get token utxos |
| WalletApi | info | POST /wallet/info | Get information about a wallet |
| WalletApi | maxAmountToSend | POST /wallet/max_amount_to_send | Get maximum spendable amount |
| WalletApi | namedExists | POST /wallet/named_exists | Check if a named wallet already exists |
| WalletApi | replaceNamed | POST /wallet/replace_named | Replace (recover) named wallet with a new walletId. If wallet with a provided name does not exist yet, it will be creted with a `walletId` supplied If wallet exists it will be overwritten without exception |
| WalletApi | send | POST /wallet/send | Send some amount to a given address |
| WalletApi | sendMax | POST /wallet/send_max | Send all available funds to a given address |
| WalletApi | submitTransaction | POST /wallet/submit_transaction | submit an encoded and signed transaction to the network |
| WalletApi | tokenBurn | POST /wallet/token_burn | Perform an explicit token burn |
| WalletApi | tokenDepositAddress | POST /wallet/token_deposit_address | Get a token aware deposit address in cash address format |
| WalletApi | tokenGenesis | POST /wallet/token_genesis | Create new token category |
| WalletApi | tokenMint | POST /wallet/token_mint | Mint new non-fungible tokens |
| WalletApi | utxos | POST /wallet/utxo | Get detailed information about unspent outputs (utxos) |
| WalletApi | xpubkeys | POST /wallet/xpubkeys | A set of xpubkeys and paths for the wallet. |
| WalletBcmrApi | bcmrAddMetadataRegistryAuthChain | POST /wallet/bcmr/add_registry_authchain | Add BCMR metadata registry from autchain, returning the built chain |
| WalletBcmrApi | bcmrAddRegistry | POST /wallet/bcmr/add_registry | Add BCMR registry from parameter |
| WalletBcmrApi | bcmrAddRegistryFromUri | POST /wallet/bcmr/add_registry_from_uri | Reset tracked BCMR registries |
| WalletBcmrApi | bcmrBuildAuthChain | POST /wallet/bcmr/build_authchain | Build a BCMR authchain |
| WalletBcmrApi | bcmrGetRegistries | POST /wallet/bcmr/get_registries | Get tracked BCMR registries |
| WalletBcmrApi | bcmrGetTokenInfo | POST /wallet/bcmr/get_token_info | Get token info |
| WalletBcmrApi | bcmrResetRegistries | POST /wallet/bcmr/reset_registries | Reset tracked BCMR registries |
| WalletSignedApi | signedMessageSign | POST /wallet/signed/sign | Returns the message signature |
| WalletSignedApi | signedMessageVerify | POST /wallet/signed/verify | Returns a boolean indicating whether message was valid for a given address |
| WalletUtilApi | utilDecodeTransaction | POST /wallet/util/decode_transaction | Decode a bitcoin transaction. Accepts both transaction hash or raw transaction in hex format. |
| WalletUtilApi | utilGetRawTransaction | POST /wallet/util/get_raw_transaction | Get bitcoin raw transaction |
| WebhookApi | watchAddress | POST /webhook/watch_address | Create a webhook to watch cashaddress balance and transactions. |
Documentation For Models
- AuthChainElement
- BalanceRequest
- BalanceResponse
- ConvertRequest
- ConvertResponse
- CreateSignedMessageRequest
- DepositAddressResponse
- ElectrumRawTransaction
- ElectrumRawTransactionScriptPubKey
- ElectrumRawTransactionScriptSig
- ElectrumRawTransactionVin
- ElectrumRawTransactionVout
- EncodeTransactionRequest
- EncodeTransactionResponse
- Error
- GetAddressesResponse
- GetAddrsByXpubKeyRequest
- GetTestnetBchRequest
- GetTestnetBchResponse
- GetXpubKeyInfoRequest
- GetXpubKeyInfoResponse
- HistoryRequest
- InOutput
- InlineObject
- InlineObject1
- InlineObject2
- InlineObject3
- InlineObject4
- InlineObject5
- InlineResponse200
- MaxAmountToSendRequest
- MineRequest
- NetworkEnum
- OpReturnData
- SendMaxRequest
- SendMaxResponse
- SendRequest
- SendRequestItem
- SendRequestItemAnyOf
- SendRequestOptions
- SendResponse
- SerializedWallet
- SignedMessageResponse
- SignedMessageResponseDetails
- SignedMessageResponseRaw
- SubmitTransactionRequest
- SubmitTransactionResponse
- Token
- TokenAmountChange
- TokenBurnRequest
- TokenGenesisRequest
- TokenMintRequest
- TokenMintRequestRequests
- TokenNft
- TokenSendRequest
- TransactionHistoryItem
- UnitType
- UtilDecodeTransactionRequest
- Utxo
- VerifySignedMessageRequest
- VerifySignedMessageResponse
- VerifySignedMessageResponseDetails
- WalletInfo
- WalletMnemonic
- WalletNamedExistsRequest
- WalletNamedExistsResponse
- WalletReplaceNamedRequest
- WalletReplaceNamedResponse
- WalletRequest
- WalletResponse
- WalletType
- WatchAddressRequest
- WatchAddressResponse
- Wif
- XPubKey
- XPubKeyRequest
- XPubKeyResponse
Documentation For Authorization
bearerAuth
- Type: Bearer authentication
Author
mainnet-cash/mainnet-php-generated 适用场景与选型建议
mainnet-cash/mainnet-php-generated 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.34k 次下载、GitHub Stars 达 2, 最近一次更新时间为 2020 年 11 月 18 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「php」 「rest」 「api」 「sdk」 「openapi」 「openapitools」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 mainnet-cash/mainnet-php-generated 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 mainnet-cash/mainnet-php-generated 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 mainnet-cash/mainnet-php-generated 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A PSR-7 compatible library for making CRUD API endpoints
Api bundle
Alfabank REST API integration
A Flickr wrapper to allow you to call the Flickr api with Guzzle as the backend.Goal is to have 100% Flickr api coverage rather than just upload/display photos (currently at 23%).
BlockCypher's PHP SDK for REST API
Helper classes for creating cookie headers
统计信息
- 总下载量: 2.34k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 19
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: unlicense
- 更新时间: 2020-11-18