skycoin rest api。
skyapi的Python项目详细描述
SkyAPI
Skycoin是下一代加密货币。
这个python包由OpenAPI Generator项目自动生成:
- API版本:0.25.1
- 软件包版本:1.0.0
- 构建包:org.openapitols.codegen.languages.pythonclientcodegen 有关详细信息,请访问http://127.0.0.1:6420
要求。
python 2.7和3.4+
安装和使用
pip安装
如果python包托管在github上,则可以直接从github安装
pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git
(您可能需要使用根权限运行pip
:sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git
)
然后导入包:
importskyapi
设置工具
通过Setuptools安装。
python setup.py install --user
(或sudo python setup.py install
为所有用户安装软件包)
然后导入包:
importskyapi
开始
请按照installation procedure操作,然后运行以下命令:
from__future__importprint_functionimporttimeimportskyapifromskyapi.restimportApiExceptionfrompprintimportpprint# create an instance of the API classapi_instance=skyapi.DefaultApi(skyapi.ApiClient(configuration))try:# Returns the total number of unique address that have coins.api_response=api_instance.address_count()pprint(api_response)exceptApiExceptionase:print("Exception when calling DefaultApi->address_count: %s\n"%e)
API端点文档
所有uri都与http://127.0.0.1:6420
Class | Method | HTTP request | Description |
---|---|---|---|
DefaultApi | address_count | GET /api/v1/addresscount | Returns the total number of unique address that have coins. |
DefaultApi | address_uxouts | GET /api/v1/address_uxouts | |
DefaultApi | balance_get | GET /api/v1/balance | Returns the balance of one or more addresses, both confirmed and predicted. The predicted balance is the confirmed balance minus the pending spends. |
DefaultApi | balance_post | POST /api/v1/balance | Returns the balance of one or more addresses, both confirmed and predicted. The predicted balance is the confirmed balance minus the pending spends. |
DefaultApi | block | GET /api/v1/block | |
DefaultApi | blockchain_metadata | GET /api/v1/blockchain/metadata | Returns the blockchain metadata. |
DefaultApi | blockchain_progress | GET /api/v1/blockchain/progress | Returns the blockchain sync progress. |
DefaultApi | blocks_get | GET /api/v1/blocks | blocksHandler returns blocks between a start and end point, |
DefaultApi | blocks_post | POST /api/v1/blocks | blocksHandler returns blocks between a start and end point, |
DefaultApi | coin_supply | GET /api/v1/coinSupply | |
DefaultApi | csrf | GET /api/v1/csrf | Creates a new CSRF token. Previous CSRF tokens are invalidated by this call. |
DefaultApi | default_connections | GET /api/v1/network/defaultConnections | defaultConnectionsHandler returns the list of default hardcoded bootstrap addresses.\n They are not necessarily connected to. |
DefaultApi | explorer_address | GET /api/v1/explorer/address | |
DefaultApi | health | GET /api/v1/health | Returns node health data. |
DefaultApi | last_blocks | GET /api/v1/last_blocks | |
DefaultApi | network_connection | GET /api/v1/network/connection | This endpoint returns a specific connection. |
DefaultApi | network_connections | GET /api/v1/network/connections | This endpoint returns all outgoings connections. |
DefaultApi | network_connections_disconnect | POST /api/v1/network/connection/disconnect | |
DefaultApi | network_connections_exchange | GET /api/v1/network/connections/exchange | |
DefaultApi | network_connections_trust | GET /api/v1/network/connections/trust | trustConnectionsHandler returns all trusted connections.\n They are not necessarily connected to. In the default configuration, these will be a subset of the default hardcoded bootstrap addresses. |
DefaultApi | outputs_get | GET /api/v1/outputs | If neither addrs nor hashes are specificed, return all unspent outputs. If only one filter is specified, then return outputs match the filter. Both filters cannot be specified. |
DefaultApi | outputs_post | POST /api/v1/outputs | If neither addrs nor hashes are specificed, return all unspent outputs. If only one filter is specified, then return outputs match the filter. Both filters cannot be specified. |
DefaultApi | pending_txs | GET /api/v1/pendingTxs | |
DefaultApi | resend_unconfirmed_txns | POST /api/v1/resendUnconfirmedTxns | |
DefaultApi | richlist | GET /api/v1/richlist | Returns the top skycoin holders. |
DefaultApi | transaction | GET /api/v1/transaction | |
DefaultApi | transaction_inject | POST /api/v2/transaction/inject | Broadcast a hex-encoded, serialized transaction to the network. |
DefaultApi | transaction_raw | GET /api/v2/transaction/raw | Returns the hex-encoded byte serialization of a transaction. The transaction may be confirmed or unconfirmed. |
DefaultApi | transaction_verify | POST /api/v2/transaction/verify | |
DefaultApi | transactions_get | GET /api/v1/transactions | Returns transactions that match the filters. |
DefaultApi | transactions_post | POST /api/v1/transactions | Returns transactions that match the filters. |
DefaultApi | uxout | GET /api/v1/uxout | Returns an unspent output by ID. |
DefaultApi | verify_address | POST /api/v2/address/verify | Verifies a Skycoin address. |
DefaultApi | version | GET /api/v1/version | |
DefaultApi | wallet | GET /api/v1/wallet | Returns a wallet by id. |
DefaultApi | wallet_balance | GET /api/v1/wallet/balance | Returns the wallet's balance, both confirmed and predicted. The predicted balance is the confirmed balance minus the pending spends. |
DefaultApi | wallet_create | POST /api/v1/wallet/create | |
DefaultApi | wallet_decrypt | POST /api/v1/wallet/decrypt | Decrypts wallet. |
DefaultApi | wallet_encrypt | POST /api/v1/wallet/encrypt | Encrypt wallet. |
DefaultApi | wallet_folder | GET /api/v1/wallets/folderName | |
DefaultApi | wallet_new_address | POST /api/v1/wallet/newAddress | |
DefaultApi | wallet_new_seed | GET /api/v1/wallet/newSeed | |
DefaultApi | wallet_recover | POST /api/v2/wallet/recover | Recovers an encrypted wallet by providing the seed. The first address will be generated from seed and compared to the first address of the specified wallet. If they match, the wallet will be regenerated with an optional password. If the wallet is not encrypted, an error is returned. |
DefaultApi | wallet_seed | POST /api/v1/wallet/seed | This endpoint only works for encrypted wallets. If the wallet is unencrypted, The seed will be not returned. |
DefaultApi | wallet_seed_verify | POST /api/v2/wallet/seed/verify | Verifies a wallet seed. |
DefaultApi | wallet_spent | POST /api/v1/wallet/spend | |
DefaultApi | wallet_transaction | POST /api/v1/wallet/transaction | |
DefaultApi | wallet_transactions | GET /api/v1/wallet/transactions | |
DefaultApi | wallet_unload | POST /api/v1/wallet/unload | Unloads wallet from the wallet service. |
DefaultApi | wallet_update | POST /api/v1/wallet/update | Update the wallet. |
DefaultApi | wallets | GET /api/v1/wallets |
型号文档
- ApiV1ExplorerAddressInputs
- ApiV1ExplorerAddressOutputs
- ApiV1ExplorerAddressStatus
- ApiV1PendingTxsTransaction
- ApiV1WalletTransactionHoursSelection
- ApiV1WalletTransactionTo
- ApiV1WalletTransactionWallet
- ApiV1WalletsEntries
- ApiV1WalletsMeta
- InlineObject
- InlineResponse200
- InlineResponse2001
- InlineResponse2002
- InlineResponse2003
- InlineResponse2003UnconfirmedVerifyTransaction
- InlineResponse2004
- InlineResponse2005
- InlineResponse2006
- InlineResponse2007
- InlineResponse2007Data
- InlineResponseDefault
授权文件
CSRFAUTH
- 类型:api键
- api密钥参数名:x-csrf-token
- 位置:http头