Skip to content

Commit

Permalink
Changed .json to .ts for sample channels
Browse files Browse the repository at this point in the history
  • Loading branch information
Arunava-Barua committed Aug 28, 2024
1 parent 74b79d5 commit 1cad246
Show file tree
Hide file tree
Showing 21 changed files with 25 additions and 54 deletions.
3 changes: 2 additions & 1 deletion src/sample_showrunners/aave/aaveChannel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
import { Service, Inject } from 'typedi';
import config, { defaultSdkSettings, settings } from '../../config';
import { ethers } from 'ethers';
import aaveSettings from './aaveSettings.json';
import {aaveSettings} from './aaveSettings';
import {keys} from './aaveKeys';
import aaveLendingPoolDeployedContractABI from './aave_LendingPool.json';
import { EPNSChannel } from '../../helpers/epnschannel';
import { Logger } from 'winston';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
export const keys = {
"PRIVATE_KEY_NEW_STANDARD": {
"PK": "YOUR_CHANNEL_PRIVATE_KEY_HERE",
"CHAIN_ID": "CHAIN_ID_HERE | SUPPORTED VALUES = eip155:1 or eip155:42 for Ethereum | eip155:137 or eip155:80001 for Polygon"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
export const aaveSettings = {
"aaveLendingPoolDeployedContractPolygonMainnet": "0x8dFf5E27EA6b7AC08EbFdf9eB090F32ee9a30fcf",
"aaveLendingPoolDeployedContractPolygonMumbai": "0x9198F13B08E299d85E096929fA9781A1E3d5d827",
"aaveLendingPoolDeployedContractMainnet": "0x7d2768dE32b0b80b7a3454c06BdAc94A69DDc7A9",
Expand Down
32 changes: 1 addition & 31 deletions src/sample_showrunners/bank/bankChannel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { PushAPI } from "@pushprotocol/restapi";

import { ethers } from "ethers";
import bank from "./bank.json";
import {keys} from "./bankKeys";

import 'dotenv/config'
require('dotenv').config()
Expand All @@ -30,30 +31,11 @@ export default class BankChannel extends EPNSChannel {
});
}

/*
event Apy(uint256 apy);
event Investments(uint256 investment);
event HolidayStatus(bool holiday);
Category 1 --> Boolean
This notification use-case considers a scenario where the users get notification about Bank holidays.
Category 2, 3 --> Slider
This notification use-case send notification to users who are interested in investments and APY.
*/

async startEventListener(simulate) {
this.logInfo("EventListener function started!")

const { contract, userAlice } = await this.initializeUser();

// contract.on("Apy", async (apy, event) => {
// // call functions in channel
// this.logInfo("Calling ---> apyNotif()");

// this.apyNotif(userAlice, apy, simulate);
// })

contract.on("Investments", async (investment, event) => {
// call functions in channel
this.logInfo("Calling ---> investmentNotif()");
Expand All @@ -69,18 +51,6 @@ export default class BankChannel extends EPNSChannel {
})

}

// async apyNotif(userAlice, apy, simulate) {
// try {
// this.logInfo("Getting events ---> apyNotif");

//

// }catch (error) {
// this.logInfo("Error caused in the getInitiated function", error);
// }
// }


// This function is triggered with slider settings
async investmentNotif(userAlice, investment, simulate) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
export const keys = {
"PRIVATE_KEY_NEW_STANDARD": {
"PK": "YOUR_CHANNEL_PRIVATE_KEY_HERE",
"CHAIN_ID": "CHAIN_ID_HERE | SUPPORTED VALUES = eip155:1 or eip155:42 for Ethereum | eip155:137 or eip155:80001 for Polygon"
Expand Down
4 changes: 2 additions & 2 deletions src/sample_showrunners/btcTicker/btcTickerChannel.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@

import { Service, Inject } from 'typedi';
import config from '../../config';
import settings from './btcTickerSettings.json';
import {settings} from './btcTickerSettings';
import { EPNSChannel } from '../../helpers/epnschannel';
import { Logger } from 'winston';
import keys from './btcTickerKeys.json';
import {keys} from './btcTickerKeys';
import { PushAPI, CONSTANTS } from '@pushprotocol/restapi';
import { ethers } from 'ethers';
import { btcTickerUserModel, btcTickerGlobalModel } from './btcTickerModel';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
export const keys = {
"PRIVATE_KEY_NEW_STANDARD": {
"PK": "0xyour channel's PK goes here",
"CHAIN_ID": "eip115:chainId (11155111 for sepolia)"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
export const settings = {
"cmcEndpoint": "https://pro-api.coinmarketcap.com/",
"providerUrl":"https://sepolia.gateway.tenderly.co",
"route":"v1/cryptocurrency/quotes/latest",
Expand Down
2 changes: 1 addition & 1 deletion src/sample_showrunners/digible/digibleChannel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { EPNSChannel, ISendNotificationParams } from '../../helpers/epnschannel'
import { ethers } from 'ethers';
import digiTradeABI from './digiTradeAbi.json';
import digiTrackABI from './digiTrackabi.json';
import digibleSettings from './digibleSettings.json';
import {digibleSettings} from './digibleSettings';
import { digibleModel } from './digibleModel';
import ERC20ABI from './ERC20.json';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
export const keys = {
"PRIVATE_KEY_NEW_STANDARD": {
"PK": "YOUR_CHANNEL_PRIVATE_KEY_HERE",
"CHAIN_ID": "CHAIN_ID_HERE | SUPPORTED VALUES = eip155:1 or eip155:42 for Ethereum | eip155:137 or eip155:80001 for Polygon"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
export const digibleSettings = {
"digiTrackContractAddressMainnet": "0x4168a4D108b24A347F19617BB95C25c8Eb9618de",
"digiTrackContractAddressTestnet": "0x4168a4D108b24A347F19617BB95C25c8Eb9618de",
"digiTradeContractAddressMainnet": "0x915338948fBF10583DD15C6FcCCF55565FF5b60f",
Expand Down
2 changes: 1 addition & 1 deletion src/sample_showrunners/ens/ensChannel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import config, { defaultSdkSettings, settings } from '../../config';
import { EPNSChannel } from '../../helpers/epnschannel';
import { Logger } from 'winston';
import { request, gql } from 'graphql-request';
import ensSettings from './ensSettings.json';
import {ensSettings} from './ensSettings';
const NETWORK_TO_MONITOR = config.web3MainnetNetwork;
const TRIGGER_THRESHOLD_SECS = 60 * 60 * 24 * 7; // 7 Days

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
export const keys = {
"PRIVATE_KEY_NEW_STANDARD": {
"PK": "YOUR_CHANNEL_PRIVATE_KEY_HERE",
"CHAIN_ID": "CHAIN_ID_HERE | SUPPORTED VALUES = eip155:1 or eip155:42 for Ethereum | eip155:137 or eip155:80001 for Polygon"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
export const ensSettings = {
"ensDeployedContract": "0x57f1887a8bf19b14fc0df6fd9b2acc9af147ea85",
"ensEndpoint": "https://api.thegraph.com/subgraphs/name/ensdomains/ens"
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
export const keys = {
"PRIVATE_KEY_NEW_STANDARD": {
"PK": "YOUR_CHANNEL_PRIVATE_KEY_HERE",
"CHAIN_ID": "CHAIN_ID_HERE | SUPPORTED VALUES = eip155:1 or eip155:42 for Ethereum | eip155:137 or eip155:80001 for Polygon"
Expand Down
4 changes: 2 additions & 2 deletions src/sample_showrunners/priceTracker/priceTrackerChannel.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Inject, Service } from 'typedi';
import { Logger } from 'winston';
import config from '../../config';
import settings from './priceTrackerSettings.json';
import {settings} from './priceTrackerSettings';
import { EPNSChannel } from '../../helpers/epnschannel';
import keys from './priceTrackerKeys.json';
import {keys} from './priceTrackerKeys';
import { PushAPI, CONSTANTS } from '@pushprotocol/restapi';
import { ethers } from 'ethers';
import axios from 'axios';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
export const keys = {
"PRIVATE_KEY_NEW_STANDARD": {
"PK": "0x{Privatekey}",
"CHAIN_ID": "eip115:11155111 (for sepolia)"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
export const settings = {
"cmcEndpoint": "https://pro-api.coinmarketcap.com/",
"providerUrl":"https://ethereum-sepolia.publicnode.com",
"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
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Inject, Service } from 'typedi';
import config, { defaultSdkSettings } from '../../config';

import { request, gql } from 'graphql-request';
import proofOfHumanitySettings from './proofOfHumanitySettings.json';
import {proofOfHumanitySettings} from './proofOfHumanitySettings';
import proofOfHumanityABI from './proofOfHumanity.json';

import { Contract } from '@ethersproject/contracts';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
export const keys = {
"PRIVATE_KEY": "YOUR_CHANNEL_PRIVATE_KEY_HERE"
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
export const proofOfHumanitySettings = {
"proofOfHumanityDeployedContract":"0xc5e9ddebb09cd64dfacab4011a0d5cedaf7c9bdb"
}

0 comments on commit 1cad246

Please sign in to comment.