mainnet-cash / mainnet-php-generated
一个面向开发者的比特币现金钱包API。此API目前处于*活跃*开发中,在1.0.0版本正式发布之前可能会进行破坏性变更。
2.4.3
2024-08-16 07:01 UTC
Requires
- php: >=7.2
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^6.2
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.12
- phpunit/phpunit: ^8.0 || ^9.0
- dev-master
- 2.4.3
- 2.4.2
- 2.4.1
- 2.4.0
- 2.3.16
- 2.3.15
- 2.3.14
- 2.3.13
- 2.3.12
- 2.3.11
- 2.3.10
- 2.3.9
- 2.3.8-alpha.0
- 2.3.7
- 2.3.6
- 2.3.5
- 2.3.4
- 2.3.3
- 2.3.2
- 2.3.1
- 2.3.0
- 2.2.9
- 2.2.8
- 2.2.7
- 2.2.6
- 2.2.5
- 2.2.4
- 2.2.2
- 2.2.1
- 2.2.0
- 2.1.1
- 2.1.0
- 2.1.0-alpha.5
- 2.1.0-alpha.3
- 2.0.1
- 2.0.0
- 1.1.34
- 1.1.34-alpha.1
- 1.1.33
- 1.1.32
- 1.1.31
- 1.1.30
- 1.1.29
- 1.1.28
- 1.1.27
- 1.1.26
- 1.1.25
- 1.1.24
- 1.1.23
- 1.1.22
- 1.1.21
- 1.1.20
- 1.1.19
- 1.1.18
- 1.1.17
- 1.1.16
- 1.1.15
- 1.1.14
- 1.1.13
- 1.1.12
- 1.1.11
- 1.1.10
- 1.1.9
- 1.1.8
- 1.1.7
- 1.1.6
- 1.1.5
- 1.1.4
- 1.1.3
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.18
- 1.0.17
- 1.0.16
- 1.0.15
- 1.0.14
- 1.0.13
- 1.0.11
- 1.0.10
- 1.0.9
- 1.0.8
- 1.0.7
- 1.0.6
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- 1.0.0-rc.3
- 1.0.0-rc.2
- 1.0.0-rc.1
- 1.0.0-rc.0
- 0.5.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2
- 0.0.1-rc.3
- 0.0.1-rc.2
This package is auto-updated.
Last update: 2024-09-12 19:34:34 UTC
README
一个面向开发者的比特币现金钱包API
此API目前处于 活跃 开发中,在1.0.0版本正式发布之前可能会进行破坏性变更。
此PHP包是由 OpenAPI Generator 项目自动生成的
- API版本:2.4.3
- 构建包:org.openapitools.codegen.languages.PhpClientCodegen
要求
PHP 7.2及以上
安装与使用
Composer
要通过 Composer 安装绑定,请将以下内容添加到 composer.json
{ "repositories": [ { "type": "vcs", "url": "https://github.com/mainnet-cash/mainnet-php-generated.git" } ], "require": { "mainnet-cash/mainnet-php-generated": "*@dev" } }
然后运行 composer install
手动安装
下载文件并包含 autoload.php
require_once('/path/to/Mainnet/vendor/autoload.php');
测试
要运行单元测试
composer install ./vendor/bin/phpunit
入门指南
请按照 安装过程 进行操作,然后运行以下命令
<?php require_once(__DIR__ . '/vendor/autoload.php'); // Configure Bearer authorization: bearerAuth $config = Mainnet\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); $apiInstance = new Mainnet\Api\ContractApi( // 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 ); $contract_fn_request = {"contractId":"testnet:TURNME1UQmxaakEwT0dJelpHRXpOVEUzT1RObU5tVmtNVFJqWXpKbVpHVTBOakJpWldOak5XSTJOVGhrT1RFek9EUTBNMkk1WVRNd01EQTNNRGRoTm1FMzpNRE0wT1RjNFlXTTBOalJtTXpVNFlqSXpOV1l4TVRJeE1tVmlObVV3TVRkaFpqa3dNakUxWWprd1lqRm1aamMwTnpGa09XRmxNbUZpWWpWbE1Ea3lOak5pOk1qRTE=:Y29udHJhY3QgVHJhbnNmZXJXaXRoVGltZW91dChwdWJrZXkgc2VuZGVyLCBwdWJrZXkgcmVjaXBpZW50LCBpbnQgdGltZW91dCkgewogICAgZnVuY3Rpb24gdHJhbnNmZXIoc2lnIHJlY2lwaWVudFNpZykgewogICAgICAgIHJlcXVpcmUoY2hlY2tTaWcocmVjaXBpZW50U2lnLCByZWNpcGllbnQpKTsKICAgIH0KCiAgICBmdW5jdGlvbiB0aW1lb3V0KHNpZyBzZW5kZXJTaWcpIHsKICAgICAgICByZXF1aXJlKGNoZWNrU2lnKHNlbmRlclNpZywgc2VuZGVyKSk7CiAgICAgICAgcmVxdWlyZSh0eC50aW1lID49IHRpbWVvdXQpOwogICAgfQp9Cg==:1996128042","action":"send","function":"timeout","to":{"unit":"sat","cashaddr":"bchtest:qpalhxhl05mlhms3ys43u76rn0ttdv3qg2usm4nm7t","value":2000},"feePerByte":1}; // \Mainnet\Model\ContractFnRequest | Request a new cashscript contract try { $result = $apiInstance->contractFn($contract_fn_request); print_r($result); } catch (Exception $e) { echo 'Exception when calling ContractApi->contractFn: ', $e->getMessage(), PHP_EOL; } ?>
API端点文档
所有URI都是相对于 https://rest-unstable.mainnet.cash
模型文档
- AuthChainElement
- BalanceRequest
- BalanceResponse
- CashscriptReceipt
- Contract
- ContractFnRequest
- ContractFnResponse
- ContractInfoRequest
- ContractInfoResponse
- ContractRequest
- ContractResponse
- ConvertRequest
- CreateSignedMessageRequest
- DepositAddressResponse
- ElectrumRawTransaction
- ElectrumRawTransactionScriptPubKey
- ElectrumRawTransactionScriptSig
- ElectrumRawTransactionVin
- ElectrumRawTransactionVout
- EncodeTransactionRequest
- EncodeTransactionResponse
- Error
- EscrowContract
- EscrowFnRequest
- EscrowInfoRequest
- EscrowInfoResponse
- EscrowRequest
- EscrowResponse
- GetAddressesResponse
- GetAddrsByXpubKeyRequest
- GetTestnetBchRequest
- GetTestnetBchResponse
- GetXpubKeyInfoRequest
- GetXpubKeyInfoResponse
- HistoryRequest
- InOutput
- InlineObject
- InlineObject1
- InlineObject2
- InlineObject3
- InlineObject4
- MaxAmountToSendRequest
- MineRequest
- NetworkEnum
- OpReturnData
- ScalableVectorGraphic
- SendMaxRequest
- SendMaxResponse
- SendRequest
- SendRequestItem
- SendRequestItemAnyOf
- SendRequestOptions
- SendResponse
- SerializedWallet
- SignedMessageResponse
- SignedMessageResponseDetails
- SignedMessageResponseRaw
- SubmitTransactionRequest
- SubmitTransactionResponse
- Token
- TokenAmountChange
- TokenBurnRequest
- TokenGenesisRequest
- TokenMintRequest
- TokenMintRequestRequests
- TokenSendRequest
- TransactionHistoryItem
- UnitType
- UtilDecodeTransactionRequest
- Utxo
- VerifySignedMessageRequest
- VerifySignedMessageResponse
- VerifySignedMessageResponseDetails
- WalletInfo
- WalletMnemonic
- WalletNamedExistsRequest
- WalletReplaceNamedRequest
- WalletRequest
- WalletResponse
- WalletType
- WatchAddressRequest
- WatchAddressResponse
- Wif
- XPubKey
- XPubKeyRequest
- XPubKeyResponse
- ZeroBalanceResponse
授权文档
bearerAuth
- 类型: Bearer认证