Download the PHP package hyperchaincn/qsnark-php-sdk without Composer
On this page you can find all versions of the php package hyperchaincn/qsnark-php-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package qsnark-php-sdk
Qsnark-PHP-SDK
趣链开发者平台 SDK for PHP
安装
-
直接下载
- 使用 composer 安装
使用方法
API
规范
- 当前 SDK 使用趣链开发者平台 v1 版本的 API
- 所有接口返回的数据的格式都是键值对数组(获取 payload 接口例外,后期会统一进行规范)
- 初始化 Qsnark 实例时,sdk 会自动获取
access token
,并且也会在 token 过期后,自动根据refresh token
获取新的access token
(细节参见Request.php
的handle_request()
方法)
初始化 SDK 实例
授权码 $qsnark->token
-
获取授权码
- get_access_token()
- 获取最新的授权码
- refresh_access_token()
账号 $qsnark->account
- 新建账号
- create_account()
区块 $qsnark->block
-
根据区块编号查询单个区块
- query_block_by_number(int $number)
-
根据区块hash查询单个区块
- query_block_by_hash(string $hash)
-
以分页的方式查询多个区块信息
- query_blocks_by_page(int $page, int $page_size)
- 根据区块号范围查询多个区块信息
- query_blocks_by_range(int $from, int $to)
智能合约 $qsnark->constract
-
编译合约
- compile_contract(array $options)
-
异步部署合约: 直接返回交易的hash值,但不能保证合约一定能部署成功,一般会通过查询交易hash是否有数据来判断是否部署成功
- deploy_contract_async(array $options)
-
同步部署合约: 只有合约部署成功或失败后,才会返回数据
- deploy_contract_sync(array $options)
-
获取 Payload
- get_payload(array $options)
-
异步调用合约: 直接返回交易的hash值,但不能保证合约一定能调用成功,一般会通过查询交易hash是否有数据来判断是否调用成功
- invoke_contract_async(array $options)
-
同步调用合约: 只有合约调用成功或失败后,才会返回数据
- invoke_contract_sync(array $options)
-
维护智能合约: 可对部署后的合约进行升级/冻结/解冻
- maintain_contract(array $options)
- 查询智能合约状态
- query_contract_status(string $address)
交易 $qsnark->transaction
-
查询区块链交易总数
- count_transaction()
-
通过交易哈希值查询单条交易信息
- query_transaction_by_hash(string $hash)
-
通过交易哈希值查询交易回执信息
- query_txreceipt_by_hash(string $hash)
- 根据时间戳范围查询非法交易
- query_all_illegal_transactions(int $start, int $end)
All versions of qsnark-php-sdk with dependencies
PHP Build Version
Package Version
Requires
php Version
^5.3.3 || ^7.0
The package hyperchaincn/qsnark-php-sdk contains the following files
Loading the files please wait ....