v2.2.2 OS (#794)
* fix: fixed transaction messages (#792) * Open Source + Docker image (#793) * feat: added dummy charting library * feat: added docker workflow * feat: remove tests and code-coverage * feat: added final TradingView fallback * env: set private to false * fix: added production env * env: added README and LICENSE * env: cleanup variables * env: add license field * env: finish docker setup * fix: updated the description of the dummy data
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
<svg viewBox="0 0 26 26" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M25 25H3.13333C2.3866 25 2.01323 25 1.72801 24.8547C1.47713 24.7268 1.27316 24.5229 1.14532 24.272C1 23.9868 1 23.6134 1 22.8667V1M23.6667 7.66667L18.4415 13.2435C18.2435 13.4549 18.1445 13.5606 18.025 13.6152C17.9196 13.6634 17.8034 13.6833 17.688 13.6729C17.5571 13.6611 17.4286 13.5944 17.1716 13.4609L12.8284 11.2058C12.5714 11.0723 12.4429 11.0056 12.312 10.9938C12.1966 10.9834 12.0804 11.0033 11.975 11.0515C11.8555 11.1061 11.7565 11.2118 11.5585 11.4231L6.33333 17"
|
||||
stroke="currentColor"
|
||||
stroke-width="1.33333"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 683 B |
@@ -38,6 +38,7 @@ export { default as GridWeb } from 'components/common/Icons/GridWeb.svg'
|
||||
export { default as HandCoins } from 'components/common/Icons/HandCoins.svg'
|
||||
export { default as Heart } from 'components/common/Icons/Heart.svg'
|
||||
export { default as InfoCircle } from 'components/common/Icons/InfoCircle.svg'
|
||||
export { default as LineChart } from 'components/common/Icons/LineChart.svg'
|
||||
export { default as LockLocked } from 'components/common/Icons/LockLocked.svg'
|
||||
export { default as LockUnlocked } from 'components/common/Icons/LockUnlocked.svg'
|
||||
export { default as Logo } from 'components/common/Icons/Logo.svg'
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
import classNames from 'classnames'
|
||||
import { useEffect, useMemo, useRef } from 'react'
|
||||
|
||||
import Card from 'components/common/Card'
|
||||
import DisplayCurrency from 'components/common/DisplayCurrency'
|
||||
import { FormattedNumber } from 'components/common/FormattedNumber'
|
||||
import { LineChart } from 'components/common/Icons'
|
||||
import Loading from 'components/common/Loading'
|
||||
import Text from 'components/common/Text'
|
||||
import { datafeed } from 'components/trade/TradeChart/DataFeed'
|
||||
@@ -36,6 +38,7 @@ export default function TradeChart(props: Props) {
|
||||
}, [prices, props.buyAsset.denom, props.sellAsset.denom])
|
||||
|
||||
const chartContainerRef = useRef<HTMLDivElement>() as React.MutableRefObject<HTMLInputElement>
|
||||
const hasTradingChartInstalled = process.env.CHARTING_LIBRARY_ACCESS_TOKEN
|
||||
|
||||
useEffect(() => {
|
||||
if (typeof window !== 'undefined' && window.TradingView) {
|
||||
@@ -124,10 +127,29 @@ export default function TradeChart(props: Props) {
|
||||
)}
|
||||
</div>
|
||||
}
|
||||
contentClassName='px-0.5 pb-0.5 h-full bg-chart w-[calc(100%-2px)] ml-[1px]'
|
||||
contentClassName={classNames(
|
||||
'px-0.5 pb-0.5 h-full w-[calc(100%-2px)] ml-[1px]',
|
||||
hasTradingChartInstalled ? 'bg-chart' : 'bg-white/5',
|
||||
)}
|
||||
className='h-[70dvh] max-h-[980px] min-h-[560px]'
|
||||
>
|
||||
<div ref={chartContainerRef} className='h-[calc(100%-32px)] overflow-hidden' />
|
||||
<div ref={chartContainerRef} className='h-[calc(100%-32px)] overflow-hidden'>
|
||||
{!hasTradingChartInstalled && (
|
||||
<div className='flex items-center w-full h-full'>
|
||||
<div className='flex flex-col flex-wrap items-center w-full gap-2'>
|
||||
<div className='w-8 mb-2'>
|
||||
<LineChart />
|
||||
</div>
|
||||
<Text size='lg' className='w-full text-center'>
|
||||
Trading View is not installed
|
||||
</Text>
|
||||
<Text size='sm' className='w-full text-center text-white/60'>
|
||||
Charting data is not available.
|
||||
</Text>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<PoweredByPyth />
|
||||
</Card>
|
||||
)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { ORACLE_DENOM } from 'constants/oracle'
|
||||
import useStore from 'store'
|
||||
import { ResolutionString } from 'utils/charting_library/charting_library'
|
||||
import { ResolutionString } from 'utils/charting_library'
|
||||
|
||||
// This does not retrigger when chains are switched. Assets might not be present on the new chain, but
|
||||
// This scenario is still caught.
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
'use strict'
|
||||
function o() {
|
||||
return 'CL v27.001 (internal id 3eb6c0e5 @ 2024-02-02T14:43:45.314Z)'
|
||||
}
|
||||
const s = class {
|
||||
constructor(e) {
|
||||
return
|
||||
}
|
||||
setDebugMode(e) {}
|
||||
onChartReady(e) {}
|
||||
headerReady() {}
|
||||
onGrayedObjectClicked(e) {}
|
||||
onShortcut(e, t) {}
|
||||
subscribe(e, t) {}
|
||||
unsubscribe(e, t) {}
|
||||
chart(e) {}
|
||||
getLanguage() {}
|
||||
setSymbol(e, t, a) {}
|
||||
remove() {}
|
||||
closePopupsAndDialogs() {}
|
||||
selectLineTool(e, t) {}
|
||||
selectedLineTool() {}
|
||||
save(e, t) {}
|
||||
load(e, t) {}
|
||||
getSavedCharts(e) {}
|
||||
loadChartFromServer(e) {}
|
||||
saveChartToServer(e, t, a) {}
|
||||
removeChartFromServer(e, t) {}
|
||||
onContextMenu(e) {}
|
||||
createButton(e) {}
|
||||
createDropdown(e) {}
|
||||
showNoticeDialog(e) {}
|
||||
showConfirmDialog(e) {}
|
||||
showLoadChartDialog() {}
|
||||
showSaveAsChartDialog() {}
|
||||
symbolInterval() {}
|
||||
mainSeriesPriceFormatter() {}
|
||||
getIntervals() {}
|
||||
getStudiesList() {}
|
||||
getStudyInputs(e) {}
|
||||
getStudyStyles(e) {}
|
||||
addCustomCSSFile(e) {}
|
||||
applyOverrides(e) {}
|
||||
applyStudiesOverrides(e) {}
|
||||
watchList() {}
|
||||
news() {}
|
||||
widgetbar() {}
|
||||
activeChart() {}
|
||||
activeChartIndex() {}
|
||||
setActiveChart(e) {}
|
||||
chartsCount() {}
|
||||
layout() {}
|
||||
setLayout(e) {}
|
||||
layoutName() {}
|
||||
changeTheme(e, t) {}
|
||||
getTheme() {}
|
||||
takeScreenshot() {}
|
||||
lockAllDrawingTools() {}
|
||||
hideAllDrawingTools() {}
|
||||
drawOnAllCharts(e) {}
|
||||
magnetEnabled() {}
|
||||
magnetMode() {}
|
||||
undoRedoState() {}
|
||||
setIntervalLinkingEnabled(e) {}
|
||||
setDateRangeLinkingEnabled(e) {}
|
||||
setTimeFrame(e) {}
|
||||
symbolSync() {}
|
||||
intervalSync() {}
|
||||
crosshairSync() {}
|
||||
timeSync() {}
|
||||
dateRangeSync() {}
|
||||
setFeatureEnabled(e, t) {}
|
||||
getAllFeatures() {}
|
||||
clearUndoHistory() {}
|
||||
undo() {}
|
||||
redo() {}
|
||||
startFullscreen() {}
|
||||
exitFullscreen() {}
|
||||
takeClientScreenshot(e) {}
|
||||
navigationButtonsVisibility() {}
|
||||
paneButtonsVisibility() {}
|
||||
dateFormat() {}
|
||||
timeHoursFormat() {}
|
||||
currencyAndUnitVisibility() {}
|
||||
supportedChartTypes() {}
|
||||
watermark() {}
|
||||
customSymbolStatus() {}
|
||||
setCSSCustomProperty(e, t) {}
|
||||
getCSSCustomPropertyValue(e) {}
|
||||
linking() {}
|
||||
_innerAPI() {}
|
||||
_innerWindow() {}
|
||||
_doWhenInnerWindowLoaded(e) {}
|
||||
_doWhenInnerApiLoaded(e) {}
|
||||
_autoResizeChart() {}
|
||||
_create() {}
|
||||
_render(e) {}
|
||||
}
|
||||
'undefined' != typeof window &&
|
||||
((window.TradingView = window.TradingView || {}), (window.TradingView.version = o))
|
||||
const r =
|
||||
!('undefined' == typeof window || !window.navigator || !window.navigator.userAgent) &&
|
||||
window.navigator.userAgent.includes('CriOS')
|
||||
;(exports.version = o), (exports.widget = s)
|
||||
+28336
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,103 @@
|
||||
function o() {
|
||||
return 'CL v27.001 (internal id 3eb6c0e5 @ 2024-02-02T14:43:45.314Z)'
|
||||
}
|
||||
let s = class {
|
||||
constructor(e) {
|
||||
return
|
||||
}
|
||||
setDebugMode(e) {}
|
||||
onChartReady(e) {}
|
||||
headerReady() {}
|
||||
onGrayedObjectClicked(e) {}
|
||||
onShortcut(e, t) {}
|
||||
subscribe(e, t) {}
|
||||
unsubscribe(e, t) {}
|
||||
chart(e) {}
|
||||
getLanguage() {}
|
||||
setSymbol(e, t, a) {}
|
||||
remove() {}
|
||||
closePopupsAndDialogs() {}
|
||||
selectLineTool(e, t) {}
|
||||
selectedLineTool() {}
|
||||
save(e, t) {}
|
||||
load(e, t) {}
|
||||
getSavedCharts(e) {}
|
||||
loadChartFromServer(e) {}
|
||||
saveChartToServer(e, t, a) {}
|
||||
removeChartFromServer(e, t) {}
|
||||
onContextMenu(e) {}
|
||||
createButton(e) {}
|
||||
createDropdown(e) {}
|
||||
showNoticeDialog(e) {}
|
||||
showConfirmDialog(e) {}
|
||||
showLoadChartDialog() {}
|
||||
showSaveAsChartDialog() {}
|
||||
symbolInterval() {}
|
||||
mainSeriesPriceFormatter() {}
|
||||
getIntervals() {}
|
||||
getStudiesList() {}
|
||||
getStudyInputs(e) {}
|
||||
getStudyStyles(e) {}
|
||||
addCustomCSSFile(e) {}
|
||||
applyOverrides(e) {}
|
||||
applyStudiesOverrides(e) {}
|
||||
watchList() {}
|
||||
news() {}
|
||||
widgetbar() {}
|
||||
activeChart() {}
|
||||
activeChartIndex() {}
|
||||
setActiveChart(e) {}
|
||||
chartsCount() {}
|
||||
layout() {}
|
||||
setLayout(e) {}
|
||||
layoutName() {}
|
||||
changeTheme(e, t) {}
|
||||
getTheme() {}
|
||||
takeScreenshot() {}
|
||||
lockAllDrawingTools() {}
|
||||
hideAllDrawingTools() {}
|
||||
drawOnAllCharts(e) {}
|
||||
magnetEnabled() {}
|
||||
magnetMode() {}
|
||||
undoRedoState() {}
|
||||
setIntervalLinkingEnabled(e) {}
|
||||
setDateRangeLinkingEnabled(e) {}
|
||||
setTimeFrame(e) {}
|
||||
symbolSync() {}
|
||||
intervalSync() {}
|
||||
crosshairSync() {}
|
||||
timeSync() {}
|
||||
dateRangeSync() {}
|
||||
setFeatureEnabled(e, t) {}
|
||||
getAllFeatures() {}
|
||||
clearUndoHistory() {}
|
||||
undo() {}
|
||||
redo() {}
|
||||
startFullscreen() {}
|
||||
exitFullscreen() {}
|
||||
takeClientScreenshot(e) {}
|
||||
navigationButtonsVisibility() {}
|
||||
paneButtonsVisibility() {}
|
||||
dateFormat() {}
|
||||
timeHoursFormat() {}
|
||||
currencyAndUnitVisibility() {}
|
||||
supportedChartTypes() {}
|
||||
watermark() {}
|
||||
customSymbolStatus() {}
|
||||
setCSSCustomProperty(e, t) {}
|
||||
getCSSCustomPropertyValue(e) {}
|
||||
linking() {}
|
||||
_innerAPI() {}
|
||||
_innerWindow() {}
|
||||
_doWhenInnerWindowLoaded(e) {}
|
||||
_doWhenInnerApiLoaded(e) {}
|
||||
_autoResizeChart() {}
|
||||
_create() {}
|
||||
_render(e) {}
|
||||
}
|
||||
'undefined' != typeof window &&
|
||||
((window.TradingView = window.TradingView || {}), (window.TradingView.version = o))
|
||||
let r =
|
||||
!('undefined' == typeof window || !window.navigator || !window.navigator.userAgent) &&
|
||||
window.navigator.userAgent.includes('CriOS')
|
||||
export { o as version, s as widget }
|
||||
@@ -0,0 +1,114 @@
|
||||
!(function (e, t) {
|
||||
'object' == typeof exports && 'undefined' != typeof module
|
||||
? t(exports)
|
||||
: 'function' == typeof define && define.amd
|
||||
? define(['exports'], t)
|
||||
: t(((e = 'undefined' != typeof globalThis ? globalThis : e || self).TradingView = {}))
|
||||
})(this, function (e) {
|
||||
'use strict'
|
||||
function t() {
|
||||
return 'CL v27.001 (internal id 3eb6c0e5 @ 2024-02-02T14:43:45.314Z)'
|
||||
}
|
||||
'undefined' != typeof window &&
|
||||
((window.TradingView = window.TradingView || {}), (window.TradingView.version = t)),
|
||||
'undefined' != typeof window &&
|
||||
window.navigator &&
|
||||
window.navigator.userAgent &&
|
||||
window.navigator.userAgent.includes('CriOS'),
|
||||
(e.version = t),
|
||||
(e.widget = class {
|
||||
constructor(e) {
|
||||
return
|
||||
}
|
||||
setDebugMode(e) {}
|
||||
onChartReady(e) {}
|
||||
headerReady() {}
|
||||
onGrayedObjectClicked(e) {}
|
||||
onShortcut(e, t) {}
|
||||
subscribe(e, t) {}
|
||||
unsubscribe(e, t) {}
|
||||
chart(e) {}
|
||||
getLanguage() {}
|
||||
setSymbol(e, t, n) {}
|
||||
remove() {}
|
||||
closePopupsAndDialogs() {}
|
||||
selectLineTool(e, t) {}
|
||||
selectedLineTool() {}
|
||||
save(e, t) {}
|
||||
load(e, t) {}
|
||||
getSavedCharts(e) {}
|
||||
loadChartFromServer(e) {}
|
||||
saveChartToServer(e, t, n) {}
|
||||
removeChartFromServer(e, t) {}
|
||||
onContextMenu(e) {}
|
||||
createButton(e) {}
|
||||
createDropdown(e) {}
|
||||
showNoticeDialog(e) {}
|
||||
showConfirmDialog(e) {}
|
||||
showLoadChartDialog() {}
|
||||
showSaveAsChartDialog() {}
|
||||
symbolInterval() {}
|
||||
mainSeriesPriceFormatter() {}
|
||||
getIntervals() {}
|
||||
getStudiesList() {}
|
||||
getStudyInputs(e) {}
|
||||
getStudyStyles(e) {}
|
||||
addCustomCSSFile(e) {}
|
||||
applyOverrides(e) {}
|
||||
applyStudiesOverrides(e) {}
|
||||
watchList() {}
|
||||
news() {}
|
||||
widgetbar() {}
|
||||
activeChart() {}
|
||||
activeChartIndex() {}
|
||||
setActiveChart(e) {}
|
||||
chartsCount() {}
|
||||
layout() {}
|
||||
setLayout(e) {}
|
||||
layoutName() {}
|
||||
changeTheme(e, t) {}
|
||||
getTheme() {}
|
||||
takeScreenshot() {}
|
||||
lockAllDrawingTools() {}
|
||||
hideAllDrawingTools() {}
|
||||
drawOnAllCharts(e) {}
|
||||
magnetEnabled() {}
|
||||
magnetMode() {}
|
||||
undoRedoState() {}
|
||||
setIntervalLinkingEnabled(e) {}
|
||||
setDateRangeLinkingEnabled(e) {}
|
||||
setTimeFrame(e) {}
|
||||
symbolSync() {}
|
||||
intervalSync() {}
|
||||
crosshairSync() {}
|
||||
timeSync() {}
|
||||
dateRangeSync() {}
|
||||
setFeatureEnabled(e, t) {}
|
||||
getAllFeatures() {}
|
||||
clearUndoHistory() {}
|
||||
undo() {}
|
||||
redo() {}
|
||||
startFullscreen() {}
|
||||
exitFullscreen() {}
|
||||
takeClientScreenshot(e) {}
|
||||
navigationButtonsVisibility() {}
|
||||
paneButtonsVisibility() {}
|
||||
dateFormat() {}
|
||||
timeHoursFormat() {}
|
||||
currencyAndUnitVisibility() {}
|
||||
supportedChartTypes() {}
|
||||
watermark() {}
|
||||
customSymbolStatus() {}
|
||||
setCSSCustomProperty(e, t) {}
|
||||
getCSSCustomPropertyValue(e) {}
|
||||
linking() {}
|
||||
_innerAPI() {}
|
||||
_innerWindow() {}
|
||||
_doWhenInnerWindowLoaded(e) {}
|
||||
_doWhenInnerApiLoaded(e) {}
|
||||
_autoResizeChart() {}
|
||||
_create() {}
|
||||
_render(e) {}
|
||||
}),
|
||||
Object.defineProperty(e, '__esModule', { value: !0 })
|
||||
})
|
||||
@@ -0,0 +1,8 @@
|
||||
var t,
|
||||
TradingView = void ('undefined' != typeof window &&
|
||||
((window.TradingView = window.TradingView || {}),
|
||||
(window.TradingView.version = function i() {})),
|
||||
'undefined' != typeof window &&
|
||||
window.navigator &&
|
||||
window.navigator.userAgent &&
|
||||
window.navigator.userAgent.includes('CriOS'))
|
||||
+1187
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"private": true,
|
||||
"description": "Dummy CL",
|
||||
"type": "module",
|
||||
"main": "charting_library.cjs.js",
|
||||
"module": "charting_library.esm.js",
|
||||
"types": "charting_library.d.ts"
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
# Dummy Charts Datafeeds
|
||||
|
||||
This folder contains dummy data for Data Feeds
|
||||
+97
@@ -0,0 +1,97 @@
|
||||
!(function (e, s) {
|
||||
'object' == typeof exports && 'undefined' != typeof module
|
||||
? s(exports)
|
||||
: 'function' == typeof define && define.amd
|
||||
? define(['exports'], s)
|
||||
: s(((e = 'undefined' != typeof globalThis ? globalThis : e || self).Datafeeds = {}))
|
||||
})(this, function (e) {
|
||||
'use strict'
|
||||
function s(e) {
|
||||
return void 0 === e ? '' : 'string' == typeof e ? e : e.message
|
||||
}
|
||||
class t {
|
||||
constructor(e, s, t) {
|
||||
return
|
||||
}
|
||||
getBars(e, s, t) {}
|
||||
async _processTruncatedResponse(e, s) {}
|
||||
_processHistoryResponse(e) {}
|
||||
}
|
||||
class r {
|
||||
constructor(e, s) {
|
||||
return
|
||||
}
|
||||
subscribeBars(e, s, t, r) {}
|
||||
unsubscribeBars(e) {}
|
||||
_updateData() {}
|
||||
_updateDataForSubscriber(e) {}
|
||||
_onSubscriberDataReceived(e, s) {}
|
||||
}
|
||||
class o {
|
||||
constructor(e) {
|
||||
return
|
||||
}
|
||||
subscribeQuotes(e, s, t, r) {}
|
||||
unsubscribeQuotes(e) {}
|
||||
_createTimersIfRequired() {}
|
||||
_destroyTimers() {}
|
||||
_updateQuotes(e) {}
|
||||
}
|
||||
function u(e, s, t, r) {}
|
||||
function n(e, s, t) {}
|
||||
class c {
|
||||
constructor(e, s, t) {
|
||||
return
|
||||
}
|
||||
resolveSymbol(e, s, t) {}
|
||||
searchSymbols(e, s, t, r) {}
|
||||
_init() {}
|
||||
_requestExchangeData(e) {}
|
||||
_onExchangeDataReceived(e, s) {}
|
||||
}
|
||||
function a(e, s) {}
|
||||
function i(e, s, t) {}
|
||||
class b {
|
||||
constructor(e, s, t, r = 1e4, o) {
|
||||
return
|
||||
}
|
||||
onReady(e) {}
|
||||
getQuotes(e, s, t) {}
|
||||
subscribeQuotes(e, s, t, r) {}
|
||||
unsubscribeQuotes(e) {}
|
||||
getMarks(e, s, t, r, o) {}
|
||||
getTimescaleMarks(e, s, t, r, o) {}
|
||||
getServerTime(e) {}
|
||||
searchSymbols(e, s, t, r) {}
|
||||
resolveSymbol(e, s, t, r) {}
|
||||
getBars(e, s, t, r, o) {}
|
||||
subscribeBars(e, s, t, r, o) {}
|
||||
unsubscribeBars(e) {}
|
||||
_requestConfiguration() {}
|
||||
_send(e, s) {}
|
||||
_setupWithConfiguration(e) {}
|
||||
}
|
||||
;(e.UDFCompatibleDatafeed = class extends b {
|
||||
constructor(e, s = 1e4, t) {
|
||||
let r = new (class e {
|
||||
constructor(e) {
|
||||
return
|
||||
}
|
||||
sendRequest(e, s, t) {}
|
||||
})()
|
||||
super(
|
||||
e,
|
||||
new (class e {
|
||||
constructor(e, s) {
|
||||
return
|
||||
}
|
||||
getQuotes(e) {}
|
||||
})(e, r),
|
||||
r,
|
||||
s,
|
||||
t,
|
||||
)
|
||||
}
|
||||
}),
|
||||
Object.defineProperty(e, '__esModule', { value: !0 })
|
||||
})
|
||||
@@ -10,7 +10,7 @@ export default function getTokenOutFromSwapResponse(
|
||||
try {
|
||||
if (response.result?.response.code === 0) {
|
||||
const rawLogs = JSON.parse(response.result.rawLogs)
|
||||
const events = rawLogs[0].events as Event[]
|
||||
const events = rawLogs.map((log: any) => log.events).flat() as Event[]
|
||||
let tokensOutValue = '0'
|
||||
events.forEach((event: Event) => {
|
||||
const attributes = event.attributes
|
||||
|
||||
Reference in New Issue
Block a user