From 3cf35d13550d729bb8161450ad30ebfc6e2c328f Mon Sep 17 00:00:00 2001 From: YashK Date: Tue, 2 Jul 2024 12:22:48 +0530 Subject: [PATCH 1/8] fix: removed inactive APIs and fixed incorrect power --- testnet/jobs.json | 82 +++-------------------------------------------- 1 file changed, 5 insertions(+), 77 deletions(-) diff --git a/testnet/jobs.json b/testnet/jobs.json index 55560f4..c72f2ad 100644 --- a/testnet/jobs.json +++ b/testnet/jobs.json @@ -31,14 +31,6 @@ "selector": "/html/body/div[5]/div[5]/div[1]/div/div[1]/div[3]/div/div[1]/span[1]/span", "url": "https://www.coingecko.com/en/coins/ethereum" }, - { - "weight": 1, - "power": 2, - "selectorType": 0, - "name": "ethusd_binance", - "selector": "price", - "url": "https://api.binance.com/api/v3/avgPrice?symbol=ETHBUSD" - }, { "weight": 1, "power": 2, @@ -68,41 +60,25 @@ "power": 2, "selectorType": 0, "name": "ethusd_cryptocompare", - "selector": "[USD]", + "selector": "USD", "url": "https://min-api.cryptocompare.com/data/price?fsym=ETH&tsyms=USD" }, { "weight": 1, - "power": 2, + "power": 8, "selectorType": 0, "name": "razorusd_cryptocompare", - "selector": "[USD]", + "selector": "USD", "url": "https://min-api.cryptocompare.com/data/price?fsym=RAZOR&tsyms=USD" }, { "weight": 1, - "power": 2, - "selectorType": 0, - "name": "razorusd_mexc", - "selector": "data[0][last]", - "url": "https://www.mexc.com/open/api/v2/market/ticker?symbol=RAZOR_USDT" - }, - { - "weight": 1, - "power": 2, + "power": 8, "selectorType": 0, "name": "razorusd_gateio", "selector": "[0].last", "url": "https://api.gateio.ws/api/v4/spot/tickers?currency_pair=RAZOR_USDT" }, - { - "weight": 1, - "power": 2, - "selectorType": 0, - "name": "uftusd_mexc", - "selector": "data[0][last]", - "url": "https://www.mexc.com/open/api/v2/market/ticker?symbol=UFT_USDT" - }, { "weight": 1, "power": 2, @@ -116,17 +92,9 @@ "power": 2, "selectorType": 0, "name": "uftusd_cryptocompare", - "selector": "[USD]", + "selector": "USD", "url": "https://min-api.cryptocompare.com/data/price?fsym=UFT&tsyms=USD" }, - { - "weight": 1, - "power": 2, - "selectorType": 0, - "name": "uftusd_binance", - "selector": "price", - "url": "https://api.binance.com/api/v3/avgPrice?symbol=UFTBUSD" - }, { "weight": 1, "power": -4, @@ -263,14 +231,6 @@ "selector": "result.MATICUSD.c[0]", "url": "https://api.kraken.com/0/public/Ticker?pair=MATICUSD" }, - { - "weight": 1, - "power": 4, - "selectorType": 0, - "name": "maticusd_binance", - "selector": "price", - "url": "https://api.binance.com/api/v3/avgPrice?symbol=MATICBUSD" - }, { "weight": 1, "power": 4, @@ -287,14 +247,6 @@ "selector": "USD", "url": "https://min-api.cryptocompare.com/data/price?fsym=MATIC&tsyms=USD" }, - { - "weight": 1, - "power": 4, - "selectorType": 1, - "name": "maticusd_coinmarjetcap_xhtml", - "selector": "/html/body/div[1]/div[2]/div/div[2]/div/div/div[2]/div[1]/div[2]/span", - "url": "https://coinmarketcap.com/currencies/polygon/" - }, { "weight": 1, "power": 4, @@ -335,14 +287,6 @@ "selector": "USD", "url": "https://min-api.cryptocompare.com/data/price?fsym=GRT&tsyms=USD" }, - { - "weight": 1, - "power": 4, - "selectorType": 1, - "name": "grtusd_blockworks_xhtml", - "selector": "/html/body/div[1]/div/main/div[2]/div[1]/section[2]/div[1]/div/div[1]/div[1]/p", - "url": "https://blockworks.co/price/grt" - }, { "weight": 1, "power": 4, @@ -367,14 +311,6 @@ "selector": "data.amount", "url": "https://api.coinbase.com/v2/prices/ARB-USD/spot" }, - { - "weight": 1, - "power": 4, - "selectorType": 1, - "name": "arb_binance_xhtml", - "selector": "/html/body/div[3]/section/div/div[2]/div[4]/div[1]/div[1]", - "url": "https://www.binance.com/en-IN/price/arbitrum" - }, { "weight": 1, "power": 4, @@ -431,14 +367,6 @@ "selector": "data.amount", "url": "https://api.coinbase.com/v2/prices/SKL-USD/spot" }, - { - "weight": 1, - "power": 6, - "selectorType": 1, - "name": "sklusd_binance_xhtml", - "selector": "/html/body/div[3]/section/div/div[2]/div[4]/div[1]/div[1]", - "url": "https://www.binance.com/en-IN/price/skale-network" - }, { "weight": 1, "power": 6, From 421212ac8352246a20c0552c9a9b478637c4226f Mon Sep 17 00:00:00 2001 From: YashK Date: Tue, 2 Jul 2024 12:36:04 +0530 Subject: [PATCH 2/8] feat: added new razor oracle price feed API jobs for every collection --- testnet/jobs.json | 88 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) diff --git a/testnet/jobs.json b/testnet/jobs.json index c72f2ad..7aa8ea6 100644 --- a/testnet/jobs.json +++ b/testnet/jobs.json @@ -398,5 +398,93 @@ "name": "razorusdp_uniswap_v2", "selector": "result", "url": "{\"type\": \"POST\",\"url\": \"https://rpc.ankr.com/eth\",\"body\": {\"jsonrpc\":\"2.0\",\"id\":7269270904970082,\"method\":\"eth_call\",\"params\":[{\"from\":\"0x0000000000000000000000000000000000000000\",\"data\":\"0xd06ca61f0000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000200000000000000000000000050de6856358cc35f3a9a57eaaa34bd4cb707d2cd0000000000000000000000008e870d67f660d95d5be530380d0ec0bd388289e1\",\"to\":\"0x7a250d5630b4cf539739df2c5dacb4c659f2488d\"},\"latest\"]},\"header\": {\"content-type\": \"application/json\"}, \"returnType\": \"hexArray[1]\"}" + }, + { + "weight": 1, + "power": 2, + "selectorType": 0, + "name": "pricefeed_eth", + "selector": "ethCollectionMedian", + "url": "https://datafeeds-staging.razorscan.io/prices" + }, + { + "weight": 1, + "power": 8, + "selectorType": 0, + "name": "pricefeed_rzr", + "selector": "RAZORUSD", + "url": "https://datafeeds-staging.razorscan.io/prices" + }, + { + "weight": 1, + "power": 2, + "selectorType": 0, + "name": "pricefeed_uft", + "selector": "UFTUSD", + "url": "https://datafeeds-staging.razorscan.io/prices" + }, + { + "weight": 1, + "power": 2, + "selectorType": 0, + "name": "pricefeed_btc", + "selector": "BTCUSD", + "url": "https://datafeeds-staging.razorscan.io/prices" + }, + { + "weight": 1, + "power": 5, + "selectorType": 0, + "name": "pricefeed_usdc", + "selector": "USDCUSD", + "url": "https://datafeeds-staging.razorscan.io/prices" + }, + { + "weight": 1, + "power": 5, + "selectorType": 0, + "name": "pricefeed_usdt", + "selector": "USDTUSD", + "url": "https://datafeeds-staging.razorscan.io/prices" + }, + { + "weight": 1, + "power": 4, + "selectorType": 0, + "name": "pricefeed_matic", + "selector": "MATICUSD", + "url": "https://datafeeds-staging.razorscan.io/prices" + }, + { + "weight": 1, + "power": 4, + "selectorType": 0, + "name": "pricefeed_grt", + "selector": "GRTUSD", + "url": "https://datafeeds-staging.razorscan.io/prices" + }, + { + "weight": 1, + "power": 4, + "selectorType": 0, + "name": "pricefeed_arb", + "selector": "ARBUSD", + "url": "https://datafeeds-staging.razorscan.io/prices" + }, + { + "weight": 1, + "power": 4, + "selectorType": 0, + "name": "pricefeed_sol", + "selector": "SOLUSD", + "url": "https://datafeeds-staging.razorscan.io/prices" + }, + { + "weight": 1, + "power": 6, + "selectorType": 0, + "name": "pricefeed_skale", + "selector": "SKALEUSD", + "url": "https://datafeeds-staging.razorscan.io/prices" } ] \ No newline at end of file From eaa46a2a3d0c415fce6aa797cb27f109bed97335 Mon Sep 17 00:00:00 2001 From: YashK Date: Tue, 2 Jul 2024 13:30:35 +0530 Subject: [PATCH 3/8] refactor: rearranged jobs and respective collection jobIds --- testnet/collections.json | 22 ++--- testnet/jobs.json | 198 +++++++++++++++++++-------------------- 2 files changed, 106 insertions(+), 114 deletions(-) diff --git a/testnet/collections.json b/testnet/collections.json index 66a4564..da6a4cd 100644 --- a/testnet/collections.json +++ b/testnet/collections.json @@ -1,76 +1,76 @@ [ { - "jobIDs": [1, 2, 3, 5, 6, 8, 9, 24], + "jobIDs": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], "aggregationMethod": 2, "power": 2, "name": "ethCollectionMedian", "tolerance": 500000 }, { - "jobIDs": [10, 11, 58], + "jobIDs": [11, 12, 13, 14, 15], "aggregationMethod": 2, "power": 8, "name": "RAZORUSD", "tolerance": 500000 }, { - "jobIDs": [13, 15, 16], + "jobIDs": [16, 17, 18], "aggregationMethod": 2, "power": 2, "name": "UFTUSD", "tolerance": 500000 }, { - "jobIDs": [18, 19, 20, 21, 23], + "jobIDs": [19, 20, 21, 22, 23, 24, 25], "aggregationMethod": 2, "power": 2, "name": "BTCUSD", "tolerance": 500000 }, { - "jobIDs": [25, 26, 27], + "jobIDs": [26, 27, 28, 29], "aggregationMethod": 2, "power": 5, "name": "USDCUSD", "tolerance": 500000 }, { - "jobIDs": [28, 29, 30], + "jobIDs": [30, 31, 32, 33], "aggregationMethod": 2, "power": 5, "name": "USDTUSD", "tolerance": 500000 }, { - "jobIDs": [31, 32, 33, 34, 35, 36], + "jobIDs": [34, 35, 36, 37, 38, 39], "aggregationMethod": 2, "power": 4, "name": "MATICUSD", "tolerance": 500000 }, { - "jobIDs": [38, 39, 40, 41, 42], + "jobIDs": [40, 41, 42, 43, 44, 45], "aggregationMethod": 2, "power": 4, "name": "GRTUSD", "tolerance": 500000 }, { - "jobIDs": [44, 45, 46], + "jobIDs": [46, 47, 48, 49], "aggregationMethod": 2, "power": 4, "name": "ARBUSD", "tolerance": 500000 }, { - "jobIDs": [48, 49, 50, 51], + "jobIDs": [50, 51, 52, 53, 54], "aggregationMethod": 2, "power": 4, "name": "SOLUSD", "tolerance": 500000 }, { - "jobIDs": [52, 53, 54, 57], + "jobIDs": [55, 56, 57, 58, 59, 60], "aggregationMethod": 2, "power": 6, "name": "SKALEUSD", diff --git a/testnet/jobs.json b/testnet/jobs.json index 7aa8ea6..02aa5ee 100644 --- a/testnet/jobs.json +++ b/testnet/jobs.json @@ -63,6 +63,22 @@ "selector": "USD", "url": "https://min-api.cryptocompare.com/data/price?fsym=ETH&tsyms=USD" }, + { + "weight": 1, + "power": -4, + "selectorType": 0, + "name": "ethusd_postJob", + "selector": "result", + "url": "{\"type\": \"POST\",\"url\": \"https://rpc.ankr.com/eth\",\"body\": {\"jsonrpc\":\"2.0\",\"method\":\"eth_call\",\"params\":[{\"to\":\"0xb27308f9f90d607463bb33ea1bebb41c27ce5ab6\",\"data\":\"0xf7729d43000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000000000000000000000000000000000000000000bb80000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000000000000000000000000000000000\"}],\"id\":5},\"header\": {\"content-type\": \"application/json\"}, \"returnType\": \"hex\"}" + }, + { + "weight": 1, + "power": 2, + "selectorType": 0, + "name": "pricefeed_eth", + "selector": "ethCollectionMedian", + "url": "https://datafeeds-staging.razorscan.io/prices" + }, { "weight": 1, "power": 8, @@ -79,6 +95,30 @@ "selector": "[0].last", "url": "https://api.gateio.ws/api/v4/spot/tickers?currency_pair=RAZOR_USDT" }, + { + "weight": 1, + "power": 8, + "selectorType": 0, + "name": "razorusd_coinbase", + "selector": "data.amount", + "url": "https://api.coinbase.com/v2/prices/RAZOR-USD/spot" + }, + { + "weight": 1, + "power": 8, + "selectorType": 0, + "name": "razorusdp_uniswap_v2", + "selector": "result", + "url": "{\"type\": \"POST\",\"url\": \"https://rpc.ankr.com/eth\",\"body\": {\"jsonrpc\":\"2.0\",\"id\":7269270904970082,\"method\":\"eth_call\",\"params\":[{\"from\":\"0x0000000000000000000000000000000000000000\",\"data\":\"0xd06ca61f0000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000200000000000000000000000050de6856358cc35f3a9a57eaaa34bd4cb707d2cd0000000000000000000000008e870d67f660d95d5be530380d0ec0bd388289e1\",\"to\":\"0x7a250d5630b4cf539739df2c5dacb4c659f2488d\"},\"latest\"]},\"header\": {\"content-type\": \"application/json\"}, \"returnType\": \"hexArray[1]\"}" + }, + { + "weight": 1, + "power": 8, + "selectorType": 0, + "name": "pricefeed_rzr", + "selector": "RAZORUSD", + "url": "https://datafeeds-staging.razorscan.io/prices" + }, { "weight": 1, "power": 2, @@ -97,11 +137,11 @@ }, { "weight": 1, - "power": -4, + "power": 2, "selectorType": 0, - "name": "ethusd_postJob", - "selector": "result", - "url": "{\"type\": \"POST\",\"url\": \"https://rpc.ankr.com/eth\",\"body\": {\"jsonrpc\":\"2.0\",\"method\":\"eth_call\",\"params\":[{\"to\":\"0xb27308f9f90d607463bb33ea1bebb41c27ce5ab6\",\"data\":\"0xf7729d43000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000000000000000000000000000000000000000000bb80000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000000000000000000000000000000000\"}],\"id\":5},\"header\": {\"content-type\": \"application/json\"}, \"returnType\": \"hex\"}" + "name": "pricefeed_uft", + "selector": "UFTUSD", + "url": "https://datafeeds-staging.razorscan.io/prices" }, { "weight": 1, @@ -155,9 +195,9 @@ "weight": 1, "power": 2, "selectorType": 0, - "name": "eth_kucoin_common_api", - "selector": "data.ETH", - "url": "https://api.kucoin.com/api/v1/prices?base=USD¤cies=ETH,BTC" + "name": "pricefeed_btc", + "selector": "BTCUSD", + "url": "https://datafeeds-staging.razorscan.io/prices" }, { "weight": 1, @@ -183,6 +223,14 @@ "selector": "result.USDCUSD.c[0]", "url": "https://api.kraken.com/0/public/Ticker?pair=USDCUSD" }, + { + "weight": 1, + "power": 5, + "selectorType": 0, + "name": "pricefeed_usdc", + "selector": "USDCUSD", + "url": "https://datafeeds-staging.razorscan.io/prices" + }, { "weight": 1, "power": 5, @@ -207,6 +255,14 @@ "selector": "result.USDTZUSD.c[0]", "url": "https://api.kraken.com/0/public/Ticker?pair=USDTZUSD" }, + { + "weight": 1, + "power": 5, + "selectorType": 0, + "name": "pricefeed_usdt", + "selector": "USDTUSD", + "url": "https://datafeeds-staging.razorscan.io/prices" + }, { "weight": 1, "power": 4, @@ -247,6 +303,14 @@ "selector": "USD", "url": "https://min-api.cryptocompare.com/data/price?fsym=MATIC&tsyms=USD" }, + { + "weight": 1, + "power": 4, + "selectorType": 0, + "name": "pricefeed_matic", + "selector": "MATICUSD", + "url": "https://datafeeds-staging.razorscan.io/prices" + }, { "weight": 1, "power": 4, @@ -287,6 +351,14 @@ "selector": "USD", "url": "https://min-api.cryptocompare.com/data/price?fsym=GRT&tsyms=USD" }, + { + "weight": 1, + "power": 4, + "selectorType": 0, + "name": "pricefeed_grt", + "selector": "GRTUSD", + "url": "https://datafeeds-staging.razorscan.io/prices" + }, { "weight": 1, "power": 4, @@ -311,6 +383,14 @@ "selector": "data.amount", "url": "https://api.coinbase.com/v2/prices/ARB-USD/spot" }, + { + "weight": 1, + "power": 4, + "selectorType": 0, + "name": "pricefeed_arb", + "selector": "ARBUSD", + "url": "https://datafeeds-staging.razorscan.io/prices" + }, { "weight": 1, "power": 4, @@ -343,6 +423,14 @@ "selector": "last", "url": "https://api.gemini.com/v1/pubticker/solusd" }, + { + "weight": 1, + "power": 4, + "selectorType": 0, + "name": "pricefeed_sol", + "selector": "SOLUSD", + "url": "https://datafeeds-staging.razorscan.io/prices" + }, { "weight": 1, "power": 6, @@ -383,102 +471,6 @@ "selector": "USD", "url": "https://min-api.cryptocompare.com/data/price?fsym=SKL&tsyms=USD" }, - { - "weight": 1, - "power": 8, - "selectorType": 0, - "name": "razorusd_coinbase", - "selector": "data.amount", - "url": "https://api.coinbase.com/v2/prices/RAZOR-USD/spot" - }, - { - "weight": 1, - "power": 8, - "selectorType": 0, - "name": "razorusdp_uniswap_v2", - "selector": "result", - "url": "{\"type\": \"POST\",\"url\": \"https://rpc.ankr.com/eth\",\"body\": {\"jsonrpc\":\"2.0\",\"id\":7269270904970082,\"method\":\"eth_call\",\"params\":[{\"from\":\"0x0000000000000000000000000000000000000000\",\"data\":\"0xd06ca61f0000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000200000000000000000000000050de6856358cc35f3a9a57eaaa34bd4cb707d2cd0000000000000000000000008e870d67f660d95d5be530380d0ec0bd388289e1\",\"to\":\"0x7a250d5630b4cf539739df2c5dacb4c659f2488d\"},\"latest\"]},\"header\": {\"content-type\": \"application/json\"}, \"returnType\": \"hexArray[1]\"}" - }, - { - "weight": 1, - "power": 2, - "selectorType": 0, - "name": "pricefeed_eth", - "selector": "ethCollectionMedian", - "url": "https://datafeeds-staging.razorscan.io/prices" - }, - { - "weight": 1, - "power": 8, - "selectorType": 0, - "name": "pricefeed_rzr", - "selector": "RAZORUSD", - "url": "https://datafeeds-staging.razorscan.io/prices" - }, - { - "weight": 1, - "power": 2, - "selectorType": 0, - "name": "pricefeed_uft", - "selector": "UFTUSD", - "url": "https://datafeeds-staging.razorscan.io/prices" - }, - { - "weight": 1, - "power": 2, - "selectorType": 0, - "name": "pricefeed_btc", - "selector": "BTCUSD", - "url": "https://datafeeds-staging.razorscan.io/prices" - }, - { - "weight": 1, - "power": 5, - "selectorType": 0, - "name": "pricefeed_usdc", - "selector": "USDCUSD", - "url": "https://datafeeds-staging.razorscan.io/prices" - }, - { - "weight": 1, - "power": 5, - "selectorType": 0, - "name": "pricefeed_usdt", - "selector": "USDTUSD", - "url": "https://datafeeds-staging.razorscan.io/prices" - }, - { - "weight": 1, - "power": 4, - "selectorType": 0, - "name": "pricefeed_matic", - "selector": "MATICUSD", - "url": "https://datafeeds-staging.razorscan.io/prices" - }, - { - "weight": 1, - "power": 4, - "selectorType": 0, - "name": "pricefeed_grt", - "selector": "GRTUSD", - "url": "https://datafeeds-staging.razorscan.io/prices" - }, - { - "weight": 1, - "power": 4, - "selectorType": 0, - "name": "pricefeed_arb", - "selector": "ARBUSD", - "url": "https://datafeeds-staging.razorscan.io/prices" - }, - { - "weight": 1, - "power": 4, - "selectorType": 0, - "name": "pricefeed_sol", - "selector": "SOLUSD", - "url": "https://datafeeds-staging.razorscan.io/prices" - }, { "weight": 1, "power": 6, From dac468c53b260ad798d6419c6436bd986dbc7910 Mon Sep 17 00:00:00 2001 From: YashK Date: Tue, 2 Jul 2024 13:58:06 +0530 Subject: [PATCH 4/8] fix: replaced bitfinex v2 API with v1 API --- testnet/jobs.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testnet/jobs.json b/testnet/jobs.json index 02aa5ee..1df3f09 100644 --- a/testnet/jobs.json +++ b/testnet/jobs.json @@ -52,8 +52,8 @@ "power": 2, "selectorType": 0, "name": "ethusd_bitfinex", - "selector": "[0]", - "url": "https://api-pub.bitfinex.com/v2/ticker/tETHUSD" + "selector": "last_price", + "url": "https://api.bitfinex.com/v1/pubticker/ethusd" }, { "weight": 1, From eaf1f97f279359b7de7513a4026e42a39ea237f1 Mon Sep 17 00:00:00 2001 From: YashK Date: Wed, 17 Jul 2024 17:50:23 +0530 Subject: [PATCH 5/8] refactor: removed eth XHTML job from collection --- testnet/collections.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testnet/collections.json b/testnet/collections.json index da6a4cd..29f59de 100644 --- a/testnet/collections.json +++ b/testnet/collections.json @@ -1,6 +1,6 @@ [ { - "jobIDs": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], + "jobIDs": [1, 2, 3, 5, 6, 7, 8, 9, 10], "aggregationMethod": 2, "power": 2, "name": "ethCollectionMedian", From 5d8bebb0fc57ff06dd1b01397f98ea9b435d8e85 Mon Sep 17 00:00:00 2001 From: YashK Date: Thu, 18 Jul 2024 01:07:41 +0530 Subject: [PATCH 6/8] refactor: removed eth post job from collection --- testnet/collections.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testnet/collections.json b/testnet/collections.json index 29f59de..e002631 100644 --- a/testnet/collections.json +++ b/testnet/collections.json @@ -1,6 +1,6 @@ [ { - "jobIDs": [1, 2, 3, 5, 6, 7, 8, 9, 10], + "jobIDs": [1, 2, 3, 5, 6, 7, 8, 10], "aggregationMethod": 2, "power": 2, "name": "ethCollectionMedian", From 0e5b61936c75d3132c72e0694312e18a88a82858 Mon Sep 17 00:00:00 2001 From: YashK Date: Thu, 18 Jul 2024 11:36:47 +0530 Subject: [PATCH 7/8] fix: decoding post request returned data in tests --- test/utils/request.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/utils/request.js b/test/utils/request.js index 4a0e58b..2e2954c 100644 --- a/test/utils/request.js +++ b/test/utils/request.js @@ -39,7 +39,7 @@ const weiToEther = (weiValue) => { const decodeUniswapV2Data = (data, returnType) => { // Check if data can be converted into a number - if (!isNaN(Number(data))) { + if (typeof data === "number") { return Number(data); } From 79db44d31239bb23635e183d217fe0f284e6efff Mon Sep 17 00:00:00 2001 From: YashK Date: Thu, 18 Jul 2024 11:42:06 +0530 Subject: [PATCH 8/8] fix: returned value of post job in tests --- test/utils/request.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/utils/request.js b/test/utils/request.js index 2e2954c..1d374d8 100644 --- a/test/utils/request.js +++ b/test/utils/request.js @@ -48,7 +48,7 @@ const decodeUniswapV2Data = (data, returnType) => { if (returnType === "hex") { // Convert hex to number and return return Number(data); - } else if (returnType === "hexArray") { + } else if (returnType.startsWith("hexArray")) { const match = returnType.match(/\[(\d+)\]/); const index = match ? parseInt(match[1], 10) : null; if (index !== null) {