Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Btc pricetracker update #37

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ INFURA_PROJECT_SECRET=your_infura_project_secret
# WEB3 ENDPOINTS | OPTIONAL IF YOU FILLED INFURA_PROJECT AND INFURA_PROJECT_SECRET, CAN SET IT TO NULL IF YOU WANT TO
ETHERSCAN_API=your_etherscan_api_key_or_null
ALCHEMY_API=your_alchemy_api_key_or_null
SEPOLIA_QUICKNODE_RPC=your_sepolia_quicknode_rpc_or_null
391 changes: 249 additions & 142 deletions src/sample_showrunners/btcTicker/btcTickerChannel.ts

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions src/sample_showrunners/btcTicker/btcTickerJobs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
// Execute a cron job every 5 Minutes = */5 * * * *
// Starts from seconds = * * * * * *

import config from '../../config';
import logger from '../../loaders/logger';

import { Container } from 'typedi';
import schedule from 'node-schedule';

Expand Down
7 changes: 0 additions & 7 deletions src/sample_showrunners/btcTicker/btcTickerKeys.json

This file was deleted.

4 changes: 4 additions & 0 deletions src/sample_showrunners/btcTicker/btcTickerModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export interface BtcTickerUserData {
_id?: string;
lastCycle?: number;
lastBtcPrice?: number;
settingsValue?: number;
}

const btcTickerUserSchema = new Schema<BtcTickerUserData>({
Expand All @@ -15,6 +16,9 @@ const btcTickerUserSchema = new Schema<BtcTickerUserData>({
},
lastBtcPrice: {
type: Number
},
settingsValue: {
type: Number,
}
});

Expand Down
4 changes: 2 additions & 2 deletions src/sample_showrunners/btcTicker/btcTickerSettings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"cmcEndpoint": "https://pro-api.coinmarketcap.com/",
"providerUrl":"https://sepolia.gateway.tenderly.co",
"providerUrl":"SEPOLIA_PROVIDER_HERE",
"route":"v1/cryptocurrency/quotes/latest",
"cmcKey":"coin marketcap api key"
"cmcKey":"CMC_API_Key"
}

212 changes: 163 additions & 49 deletions src/sample_showrunners/priceTracker/priceTrackerChannel.ts

Large diffs are not rendered by default.

7 changes: 0 additions & 7 deletions src/sample_showrunners/priceTracker/priceTrackerKeys.json

This file was deleted.

19 changes: 18 additions & 1 deletion src/sample_showrunners/priceTracker/priceTrackerModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,20 @@ import { model, Schema } from 'mongoose';
export interface PriceTrackerData {
_id?: string;
lastCycle?: number;
settingsValue?: number;
}


const priceTrackerSchema = new Schema<PriceTrackerData>({
_id: {
type: String,
},
lastCycle: {
type: Number,
},
},
settingsValue: {
type: Number,
}
});

export const priceTrackerModel = model<PriceTrackerData>('priceTrackerUserDB', priceTrackerSchema);
Expand Down Expand Up @@ -45,3 +50,15 @@ const PriceTrackerTokenSchema = new Schema<PriceTrackerToken>({
});

export const priceTrackerTokenModel = model<PriceTrackerToken>('priceTokenTracker', PriceTrackerTokenSchema);

export interface UserTokenInfo {
_id?: String;
userTokenPrevPrice?: Number;
}

const UserTokenInfoSchema = new Schema<UserTokenInfo>({
_id: String,
userTokenPrevPrice: Number,
});

export const userTokenModel = model<UserTokenInfo>('userTokenInfo', UserTokenInfoSchema);
11 changes: 9 additions & 2 deletions src/sample_showrunners/priceTracker/priceTrackerSettings.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
{
"ETH_TRACKER_CACHE_KEY": "ETH_TRACKER_CACHE_KEY",
"PAGINATION_PARAMS": {
"limit": 1000,
"currentPage": 1,
"totalPages": 1
},
"DEFAULT_BALANCE_OBJECT": { "balance": 0 },
"cmcEndpoint": "https://pro-api.coinmarketcap.com/",
"providerUrl":"https://ethereum-sepolia.publicnode.com",
"providerUrl":"SEPOLIA_PROVIDER_URL",
"route":"v2/cryptocurrency/quotes/latest",
"cmcKey":"4fd478f1-5d64-4666-bd4d-c9d1489a6c5e",
"cmcKey":"CMC_API_KEY",
"id":"1,1027,1839,5426,2010,5805,1975,6636,3890,9111",
"tokenNames":["BTC","ETH","BNB","SOL","ADA","AVAX","LINK","DOT","MATIC","PUSH"]
}
Expand Down
2 changes: 0 additions & 2 deletions src/sample_showrunners/priceTracker/test.json

This file was deleted.

Loading