Skip to content
This repository was archived by the owner on Jan 15, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
a284929
wallet porfolio
Adesojisouljay Jan 5, 2023
c328ac8
fixed trans
Adesojisouljay Jan 5, 2023
703288b
engine token details
Adesojisouljay Jan 6, 2023
b282444
fixed points
Adesojisouljay Jan 8, 2023
80ac66e
engine transactions history
Adesojisouljay Jan 9, 2023
c885bc3
profile tokens
Adesojisouljay Jan 20, 2023
2a9c3ef
profile tokens: engine
Adesojisouljay Jan 29, 2023
c67a23f
checkbox fixes
Adesojisouljay Feb 7, 2023
1aa76f6
type logo amd date format
Adesojisouljay Feb 10, 2023
edb371e
Merge branch 'development' of https://github.com/ecency/ecency-vision…
Adesojisouljay Feb 11, 2023
8833e1a
fix map key
Adesojisouljay Feb 11, 2023
4e06397
fixed chart toggle
Adesojisouljay Feb 13, 2023
2907956
chcekbox logics
Adesojisouljay Feb 18, 2023
37739d6
logic fixes
Adesojisouljay Feb 22, 2023
ecf9e74
transactions filtering
Adesojisouljay Mar 4, 2023
43480a1
filter transactions
Adesojisouljay Mar 13, 2023
7e31c80
Merge branch 'development' of https://github.com/ecency/ecency-vision…
Adesojisouljay Mar 13, 2023
8a5607a
fixed style import
Adesojisouljay Mar 13, 2023
30ec4d7
syntax fixes
Adesojisouljay Mar 14, 2023
5a80234
clear consoles
Adesojisouljay Mar 15, 2023
56df71e
default chart
Adesojisouljay Mar 29, 2023
a38aee5
fixed wallet path
Adesojisouljay Apr 4, 2023
95ac4e2
Merge branch 'development' of https://github.com/ecency/ecency-vision…
Adesojisouljay Apr 4, 2023
23fbe1e
bug fixes
Adesojisouljay May 29, 2023
fdcb288
Merge branch 'development' of https://github.com/ecency/ecency-vision…
Adesojisouljay May 29, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 33 additions & 6 deletions src/common/api/hive-engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,7 @@ export const getMetrics: any = async (symbol?: any, account?: any) => {
},
id: 1
};

// const result = await axios
// .post(HIVE_ENGINE_RPC_URL, data, {
// headers: { "Content-type": "application/json" }
// })
// return result;

return axios
.post(HIVE_ENGINE_RPC_URL, data, {
headers: { "Content-type": "application/json" }
Expand All @@ -188,3 +183,35 @@ export const getMarketData = async (symbol: any) => {
});
return history;
};

export async function getTransactions(symbol: string, account: string, limit: number, offset?: number): Promise<any> {
const url: any = engine.mainTransactionUrl;
return axios({
url,
method: "GET",
params: {
account,
token: symbol,
limit,
offset
}
}).then((response) => {
return response.data;
});
};

export async function getOtherTransactions(account: string, limit: number, symbol: string, offset: number = 0) {
const url: any = engine.otherTransactionsUrl;
const response = await axios({
url,
method: "GET",
params: {
account,
limit,
offset,
type: "user",
symbol
}
});
return response.data;
}
14 changes: 14 additions & 0 deletions src/common/api/misc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,17 @@ export const fetchGif = async (query: string | null, limit: string, offset: stri
}
return gifs;
};

export const marketInfo = async (): Promise<number> => {

const url = `https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&ids=hive%2C%20hive_dollar&order=market_cap_desc&per_page=100&page=1&sparkline=false`;
const { data } = await axios.get(url)
return data;
};

export const marketChart = async (token: string): Promise<number> => {

const url = `https://api.coingecko.com/api/v3/coins/${token}/market_chart?vs_currency=usd&days=30`;
const { data } = await axios.get(url)
return data;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, do not use async/await and then constructions together.
It should be:

const { data } = await axis.get(url);
return data;

};
12 changes: 12 additions & 0 deletions src/common/api/spk-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,18 @@ export const getSpkWallet = async (username: string): Promise<SpkApiWallet> => {
const resp = await axios.get<SpkApiWallet>(`${spkNode}/@${username}`);
return resp.data;
};
export const getMarketInfo = async (): Promise<SpkApiWallet> => {
const resp = await axios.get<SpkApiWallet>(`${spkNode}/dex`);
// console.log(resp.data)
return resp.data;
};

export const getLarynxData = async () => {
fetch(`https://spknode.blocktrades.us/dex`).then((data: any)=> data.json())
.then((result: any) =>{
// console.log(result)
})
}

export const getMarkets = async (): Promise<Markets> => {
const resp = await axios.get<SpkMarkets>(`${spkNode}/markets`);
Expand Down
6 changes: 6 additions & 0 deletions src/common/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,12 @@ const App = (props: any) => {
path={routes.PROPOSAL_DETAIL}
component={ProposalDetailContainer}
/>
<Route
exact={true}
strict={true}
path={routes.TOKEN_DETAIL}
component={ProfilePage}
/>
<Route exact={true} strict={true} path={routes.ABOUT} component={AboutPage} />
<Route exact={true} strict={true} path={routes.GUESTS} component={GuestPostPage} />
<Route exact={true} strict={true} path={routes.CONTRIBUTE} component={ContributePage} />
Expand Down
1 change: 0 additions & 1 deletion src/common/components/community-card/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ export class EditPic extends BaseComponent<EditPicProps, EditPicState> {

const { addAccount, onUpdate } = this.props;
const { profile } = account;

const newProfile = {
profile_image: url
};
Expand Down
2 changes: 0 additions & 2 deletions src/common/components/engine-tokens-estimated/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ export const EngineTokensEstimated = (props: any) => {
};
});

// const walletTokens = mappedBalanceMetrics.filter((w: any) => w.balance !== 0 || w.stakedBalance !== 0)

const tokens_usd_prices = mappedBalanceMetrics.map((w: any) => {
return w.symbol === "SWAP.HIVE"
? Number(pricePerHive * w.balance)
Expand Down
33 changes: 33 additions & 0 deletions src/common/components/engine-tokens-list/index.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
@import "src/style/colors";
@import "src/style/variables";
@import "src/style/bootstrap_vars";
@import "src/style/mixins";

.portfolio-list-container{
display: flex;
align-items: center;
justify-content: space-between;

.token-list{
padding: 10px;
gap: 5px;
// flex-wrap: wrap;

img{
width: 50px;
height: 50px;
border-radius: 50%;
}
span{
margin: 0 15px;
}
}

.add-btn{

input{
width: 20px;
height: 20px;
}
}
}
35 changes: 35 additions & 0 deletions src/common/components/engine-tokens-list/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import React, { useEffect, useState} from 'react'
import { _t } from '../../i18n';
import "./index.scss";

const EngineTokensList = (props: any) => {
const { token, handleChange, i, favoriteToken } = props;

const [checked, setChecked] = useState(favoriteToken)

return (
<>
<div className="list-body portfolio-list-container cursor-pointer">
<div className="token-list">
<img src={token.icon} />
<span className="item-name notransalte cursor-pointer">
{token?.name}
</span>
</div>
<div className='add-btn'>
<input
type="checkbox"
value={token?.name}
checked={(checked ? true : false)}
onChange={(e) => {
handleChange(e.target.checked, token);
setChecked(!checked)
}}
/>
</div>
</div>
</>
)
}

export default EngineTokensList;
10 changes: 5 additions & 5 deletions src/common/components/hive-engine-chart/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ export const HiveEngineChart = (props: any) => {
enabled: false
},
chart: {
height: "70",
width: "600",
height: "40",
width: "100",
zoomType: "x",
backgroundColor: "transparent",
border: "none",
Expand All @@ -56,7 +56,7 @@ export const HiveEngineChart = (props: any) => {
area: {
fillColor: theme === Theme.night ? "#2e3d51" : "#f3f7fb",
lineColor: "transparent",
lineWidth: 399
lineWidth: 150
},
series: {
marker: {
Expand Down Expand Up @@ -120,14 +120,14 @@ export const HiveEngineChart = (props: any) => {
series: [
{
name: "tokens",
data: prices.length === 0 ? [0, 0] : prices,
data: prices?.length === 0 ? [0, 0] : prices,
type: "line",
enableMouseTracking: true
}
]
};
return (
<div className="market-graph d-flex justify-items-center ml-5">
<div className="market-graph d-flex justify-items-center">
<div className="graph">
<ReactHighcharts config={config} />
</div>
Expand Down
Loading