Skip to content

dudetheman/peatio_tradingview

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TradingView Charting Library UDF Data Source

Sample implementation of server-side UDF-compatible data source for Peatio exchange for TradingView Charting Library.

First change api on backend peatio

app/api/api_v2/tools.rb

# encoding: UTF-8
# frozen_string_literal: true

module APIv2
  class Tools < Grape::API
    desc 'Get server current time, in seconds since Unix epoch.'
    get "/timestamp" do
      ({"serverTime": (Time.now.to_f * 1000).to_i})
    end
  end
end

app/api/api_v2/entities/market.rb

# encoding: UTF-8
# frozen_string_literal: true

module APIv2
  module Entities
    class Market < Base
      expose :id, documentation: "Unique market id. It's always in the form of xxxyyy, where xxx is the base currency code, yyy is the quote currency code, e.g. 'btcusd'. All available markets can be found at /api/v2/markets."
      expose :name
      expose :ask_precision
      expose :bid_precision
      expose :bid_unit
      expose :ask_unit
    end
  end
end

Run

$ npm install
$ npm start

Image Demo:

alt text

Links

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%