npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

yq-okex-api-service

v1.0.2

Published

1. attention ! just suport the spring-ioc framework.

Downloads

4

Readme

yq-okex-api-service

intruoduce

  1. attention ! just suport the spring-ioc framework.

install

npm instlal yq-okex-api-service

usage

1.set the configuration file
file path: ${Project}/resource/app-dev.yaml
basic config:
Spring-ioc:
  log:
    state: on
    level: info
YqOkexApiService:
  API_KEY: e345345ad8-4b0c-8c49-c1b850bdbf9a
  API_SECRET: CFD9E52342340889546456EBCBC7CA2EDE1
  API_PASS: 12456e245645612312312312323!~

2. load email module at launch.

const {SpringBoot} = require("spring-ioc")
const {YqOkexApiServiceScaner} = require("./spring_extends")


new SpringBoot({
	rootPath:__dirname,
	srcList:["./demo"],
	moduleList:[YqOkexApiServiceScaner("./spring_extends")]
}).start();

3. call in the spring container!

const {wait} = require('zcutil-cli-input')

//@SpringBoot
class Application {

	//@Autowired
	yqOkexApiService;

	log;

	//查询价格
	async testSearchPrice(){

		const coin = "BTC-USDT"

		const log = this.log.method("testSearchPrice")

		log.info(`请求价格:${coin}`);

		const price = await this.yqOkexApiService.getTicker(coin)

		log.info(`${coin}:${price}`)
	}


	//查询余额
	async testBalance(coinName){
		const log = this.log.method("testBalance")
		log.info(`开始查询${coinName}余额`)
		const balance = await this.yqOkexApiService.getBalance(coinName)
		log.info(`${coinName}:${balance}`)
	}

	//测试购买4U usdt
	async testBuyBTC(){
		const log = this.log.method("testBuyBTC")
		log.info(`测试购买3U  BTC`)
		const result = await this.yqOkexApiService.buy('BTC-USDT',3)
		log.info(`服务器返回:${JSON.stringify(result)}`)
	}

	async testSell(size){
		const log = this.log.method("testSell")
		log.info(`出售BTC 数量:${size}`)
		const result = await this.yqOkexApiService.sell('BTC-USDT',size)
		log.info(`服务器返回:${JSON.stringify(result)}`)
	}

	async main(){

		const panic = await this.yqOkexApiService.getMarketSentiment();

		this.log.info(`恐慌情绪:${panic}`)

		//查询价格
		await this.testSearchPrice();

		//查询余额
		await this.testBalance("BTC");

		//测试购买
		await this.testBuyBTC();

		this.log.info("等待2秒!")
		await wait(2)

		//重新查询余额
		await this.testBalance("BTC");

		//测试出售
		await this.testSell(0.0001)

		this.log.info("等待2秒!")
		await wait(2)

		//重新查询余额
		await this.testBalance("BTC");

	}

}

 module.exports = { Application }