nlplay / tinkoff-invest
Tinkoff invest REST API Laravel facade
1.0.0
2021-02-12 06:54 UTC
This package is auto-updated.
Last update: 2024-09-12 14:46:41 UTC
README
描述
官方API文档可在此处找到: https://tinkoffcreditsystems.github.io/invest-openapi/ https://tinkoffcreditsystems.github.io/invest-openapi/swagger-ui/
该软件包基于 Illuminate\Support\Facades\Http 构建。
安装
1. 通过 composer 下载扩展
composer require nlplay/tinkoff-invest
2. 发布配置文件
php artisan vendor:publish --tag=tinkoff-invest
3. 按照此处描述添加您的 tinkoff 密钥 https://tinkoffcreditsystems.github.io/invest-openapi/auth/ 到 .env
TINKOFF_INVEST_TOKEN=
用法
为了发送请求,只需使用 Facade 即可
use Nlplay\TinkoffInvest\Facades\TinkoffInvest;
可用方法列表(sb - 沙盒)
orders(string $brokerAccountId = null)
ordersLimitOrder(string $figi, string $brokerAccountId = null)
ordersMarketOrder(string $figi, string $brokerAccountId = null)
ordersCancel(string $orderId, string $brokerAccountId = null)
portfolio(string $brokerAccountId = null)
portfolioCurrencies(string $brokerAccountId = null)
marketStocks()
marketBonds()
marketEtfs()
marketCurrencies()
marketOrderBook(string $figi, int $depth)
marketCandles(string $figi, string $from, string $to, string $interval)
marketSearchByFigi(string $figi)
marketSearchByTicker(string $ticker)
operations(string $from, string $to, string $brokerAccountId = null, string $figi = null)
userAccounts()
sbRegister()
sbCurrenciesBalance(string $brokerAccountId = null)
sbPositionsBalance(string $brokerAccountId = null)
sbRemove()
sbClear()
示例
use Nlplay\TinkoffInvest\Facades\TinkoffInvest; $currencies = TinkoffInvest::marketCurrencies();