Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
90c60d3af0 | ||
|
|
3ee0eee80d | ||
|
|
69ce870a81 | ||
|
|
d8467c3206 | ||
|
|
de87f40a01 |
@@ -5,6 +5,7 @@ import type {
|
||||
BlockExplorerTransactions,
|
||||
} from '../routes/types/block-explorer-response';
|
||||
import { DATA_SOURCES } from '../config';
|
||||
import isNumber from 'lodash/isNumber';
|
||||
|
||||
export interface TxsStateProps {
|
||||
txsData: BlockExplorerTransactionResult[];
|
||||
@@ -54,15 +55,15 @@ export const useTxsData = ({ limit, filters }: IUseTxsData) => {
|
||||
} = useFetch<BlockExplorerTransactions>(url, {}, false);
|
||||
|
||||
useEffect(() => {
|
||||
if (data?.transactions?.length) {
|
||||
if (data && isNumber(data?.transactions?.length)) {
|
||||
setTxsState((prev) => ({
|
||||
txsData: [...prev.txsData, ...data.transactions],
|
||||
hasMoreTxs: true,
|
||||
hasMoreTxs: data.transactions.length > 0,
|
||||
lastCursor:
|
||||
data.transactions[data.transactions.length - 1].cursor || '',
|
||||
data.transactions[data.transactions.length - 1]?.cursor || '',
|
||||
}));
|
||||
}
|
||||
}, [setTxsState, data?.transactions]);
|
||||
}, [setTxsState, data]);
|
||||
|
||||
const loadTxs = useCallback(() => {
|
||||
return refetch({
|
||||
|
||||
@@ -1,11 +1,77 @@
|
||||
[
|
||||
{
|
||||
"tranche_id": 50,
|
||||
"tranche_start": "2023-10-01T00:00:00.000Z",
|
||||
"tranche_end": "2024-04-01T00:00:00.000Z",
|
||||
"total_added": "2500",
|
||||
"total_removed": "0",
|
||||
"locked_amount": "2500",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "2500",
|
||||
"user": "0x6ad69157EfB1E17EBf6614D352D098589EaE3060",
|
||||
"tx": "0x0e229459260c2e74579e12e05ffd21cb4e470e3a4eacf85b7f924778b4f1c8a6"
|
||||
}
|
||||
],
|
||||
"withdrawals": [],
|
||||
"users": [
|
||||
{
|
||||
"address": "0x6ad69157EfB1E17EBf6614D352D098589EaE3060",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "2500",
|
||||
"user": "0x6ad69157EfB1E17EBf6614D352D098589EaE3060",
|
||||
"tranche_id": 50,
|
||||
"tx": "0x0e229459260c2e74579e12e05ffd21cb4e470e3a4eacf85b7f924778b4f1c8a6"
|
||||
}
|
||||
],
|
||||
"withdrawals": [],
|
||||
"total_tokens": "2500",
|
||||
"withdrawn_tokens": "0",
|
||||
"remaining_tokens": "2500"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"tranche_id": 51,
|
||||
"tranche_start": "2024-01-01T00:00:00.000Z",
|
||||
"tranche_end": "2024-07-01T00:00:00.000Z",
|
||||
"total_added": "2500",
|
||||
"total_removed": "0",
|
||||
"locked_amount": "2500",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "2500",
|
||||
"user": "0x6ad69157EfB1E17EBf6614D352D098589EaE3060",
|
||||
"tx": "0x0e229459260c2e74579e12e05ffd21cb4e470e3a4eacf85b7f924778b4f1c8a6"
|
||||
}
|
||||
],
|
||||
"withdrawals": [],
|
||||
"users": [
|
||||
{
|
||||
"address": "0x6ad69157EfB1E17EBf6614D352D098589EaE3060",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "2500",
|
||||
"user": "0x6ad69157EfB1E17EBf6614D352D098589EaE3060",
|
||||
"tranche_id": 51,
|
||||
"tx": "0x0e229459260c2e74579e12e05ffd21cb4e470e3a4eacf85b7f924778b4f1c8a6"
|
||||
}
|
||||
],
|
||||
"withdrawals": [],
|
||||
"total_tokens": "2500",
|
||||
"withdrawn_tokens": "0",
|
||||
"remaining_tokens": "2500"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"tranche_id": 49,
|
||||
"tranche_start": "2022-12-05T00:00:00.000Z",
|
||||
"tranche_end": "2023-12-05T00:00:00.000Z",
|
||||
"total_added": "86666.297",
|
||||
"total_removed": "0",
|
||||
"locked_amount": "73487.251446645509463922",
|
||||
"locked_amount": "73249.3478444544925131235",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "86666.297",
|
||||
@@ -71,7 +137,7 @@
|
||||
"tranche_end": "2023-06-01T00:00:00.000Z",
|
||||
"total_added": "2500",
|
||||
"total_removed": "0",
|
||||
"locked_amount": "1682.6333244301995",
|
||||
"locked_amount": "1668.8703512922265",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "2500",
|
||||
@@ -265,12 +331,34 @@
|
||||
"tranche_id": 42,
|
||||
"tranche_start": "2023-07-01T00:00:00.000Z",
|
||||
"tranche_end": "2024-01-01T00:00:00.000Z",
|
||||
"total_added": "0",
|
||||
"total_added": "2500",
|
||||
"total_removed": "0",
|
||||
"locked_amount": "0",
|
||||
"deposits": [],
|
||||
"locked_amount": "2500",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "2500",
|
||||
"user": "0x6ad69157EfB1E17EBf6614D352D098589EaE3060",
|
||||
"tx": "0x0e229459260c2e74579e12e05ffd21cb4e470e3a4eacf85b7f924778b4f1c8a6"
|
||||
}
|
||||
],
|
||||
"withdrawals": [],
|
||||
"users": []
|
||||
"users": [
|
||||
{
|
||||
"address": "0x6ad69157EfB1E17EBf6614D352D098589EaE3060",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "2500",
|
||||
"user": "0x6ad69157EfB1E17EBf6614D352D098589EaE3060",
|
||||
"tranche_id": 42,
|
||||
"tx": "0x0e229459260c2e74579e12e05ffd21cb4e470e3a4eacf85b7f924778b4f1c8a6"
|
||||
}
|
||||
],
|
||||
"withdrawals": [],
|
||||
"total_tokens": "2500",
|
||||
"withdrawn_tokens": "0",
|
||||
"remaining_tokens": "2500"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"tranche_id": 43,
|
||||
@@ -450,7 +538,7 @@
|
||||
"tranche_end": "2023-12-05T00:00:00.000Z",
|
||||
"total_added": "129999.45",
|
||||
"total_removed": "0",
|
||||
"locked_amount": "73420.20357622098315111",
|
||||
"locked_amount": "73182.51703113279114459",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "129999.45",
|
||||
@@ -516,7 +604,7 @@
|
||||
"tranche_end": "2023-09-03T00:00:00.000Z",
|
||||
"total_added": "62600",
|
||||
"total_removed": "0",
|
||||
"locked_amount": "37130.49642947742434",
|
||||
"locked_amount": "36958.65609462201678",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "10000",
|
||||
@@ -709,7 +797,7 @@
|
||||
"tranche_end": "2023-09-17T00:00:00.000Z",
|
||||
"total_added": "5000",
|
||||
"total_removed": "0",
|
||||
"locked_amount": "3157.4754249112125",
|
||||
"locked_amount": "3143.75015854896",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "5000",
|
||||
@@ -920,7 +1008,7 @@
|
||||
"tranche_end": "2023-04-05T00:00:00.000Z",
|
||||
"total_added": "97499.58",
|
||||
"total_removed": "0",
|
||||
"locked_amount": "15240.5819298544871083824",
|
||||
"locked_amount": "15007.4335706261557266036",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "97499.58",
|
||||
@@ -953,7 +1041,7 @@
|
||||
"tranche_end": "2023-04-05T00:00:00.000Z",
|
||||
"total_added": "135173.4239508",
|
||||
"total_removed": "98230.390980249184455396",
|
||||
"locked_amount": "20831.244321407448710024671284",
|
||||
"locked_amount": "20512.570765727364279134238384",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "135173.4239508",
|
||||
@@ -999,7 +1087,7 @@
|
||||
"tranche_end": "2023-04-05T00:00:00.000Z",
|
||||
"total_added": "32499.86",
|
||||
"total_removed": "0",
|
||||
"locked_amount": "6411.4496271174975967098",
|
||||
"locked_amount": "6313.3681386469486371386",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "32499.86",
|
||||
@@ -1032,7 +1120,7 @@
|
||||
"tranche_end": "2023-04-05T00:00:00.000Z",
|
||||
"total_added": "10833.29",
|
||||
"total_removed": "0",
|
||||
"locked_amount": "2086.8646383922243299952",
|
||||
"locked_amount": "2054.9400656552973229102",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "10833.29",
|
||||
@@ -1065,7 +1153,7 @@
|
||||
"tranche_end": "2023-04-05T00:00:00.000Z",
|
||||
"total_added": "22749.93",
|
||||
"total_removed": "0",
|
||||
"locked_amount": "7801.1661111092940288519",
|
||||
"locked_amount": "7681.824927994110236595",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "6500",
|
||||
@@ -1204,7 +1292,7 @@
|
||||
"tranche_end": "2023-05-01T00:00:00.000Z",
|
||||
"total_added": "22500",
|
||||
"total_removed": "3707.308452225",
|
||||
"locked_amount": "11373.775610036832",
|
||||
"locked_amount": "11249.22450506445675",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "7500",
|
||||
@@ -1380,7 +1468,7 @@
|
||||
"tranche_end": "2023-06-02T00:00:00.000Z",
|
||||
"total_added": "1939928.38",
|
||||
"total_removed": "928642.9598472029154",
|
||||
"locked_amount": "656363.903872495430316328",
|
||||
"locked_amount": "651038.697124657027213976",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "1852091.69",
|
||||
@@ -1732,7 +1820,7 @@
|
||||
"tranche_end": "2023-02-01T00:00:00.000Z",
|
||||
"total_added": "42500",
|
||||
"total_removed": "24434.0787288",
|
||||
"locked_amount": "576.45383579911392",
|
||||
"locked_amount": "345.026450533412745",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "12500",
|
||||
@@ -1830,7 +1918,7 @@
|
||||
"tranche_start": "2021-09-03T00:00:00.000Z",
|
||||
"tranche_end": "2022-03-03T00:00:00.000Z",
|
||||
"total_added": "3145.41",
|
||||
"total_removed": "1726.74",
|
||||
"total_removed": "1736.74",
|
||||
"locked_amount": "0",
|
||||
"deposits": [
|
||||
{
|
||||
@@ -1995,6 +2083,11 @@
|
||||
}
|
||||
],
|
||||
"withdrawals": [
|
||||
{
|
||||
"amount": "10",
|
||||
"user": "0x4cBC0C88d8FE503f62823B42f30a4900292C13bE",
|
||||
"tx": "0xa0ad93f116b5a6098ceda7e07141f806a90d5fb94f0c0555ac7049709a7fb3b7"
|
||||
},
|
||||
{
|
||||
"amount": "20",
|
||||
"user": "0xE9F41a0090fcc7eaf626037003AAD44B17098E7C",
|
||||
@@ -2241,10 +2334,17 @@
|
||||
"tx": "0xf6ffe87368413b25eb480d979745c5f7c32444318abb1c75e0c3bf3dba3410cd"
|
||||
}
|
||||
],
|
||||
"withdrawals": [],
|
||||
"withdrawals": [
|
||||
{
|
||||
"amount": "10",
|
||||
"user": "0x4cBC0C88d8FE503f62823B42f30a4900292C13bE",
|
||||
"tranche_id": 12,
|
||||
"tx": "0xa0ad93f116b5a6098ceda7e07141f806a90d5fb94f0c0555ac7049709a7fb3b7"
|
||||
}
|
||||
],
|
||||
"total_tokens": "10",
|
||||
"withdrawn_tokens": "0",
|
||||
"remaining_tokens": "10"
|
||||
"withdrawn_tokens": "10",
|
||||
"remaining_tokens": "0"
|
||||
},
|
||||
{
|
||||
"address": "0xF3638a47940B4d8c4b7F0AabB44Dc6DB8313a03A",
|
||||
@@ -6722,8 +6822,8 @@
|
||||
"tranche_id": 11,
|
||||
"tranche_start": "2021-09-03T00:00:00.000Z",
|
||||
"tranche_end": "2022-09-03T00:00:00.000Z",
|
||||
"total_added": "53995.000000000000000003",
|
||||
"total_removed": "42939.21518131551",
|
||||
"total_added": "54025.000000000000000003",
|
||||
"total_removed": "43035.21518131551",
|
||||
"locked_amount": "0",
|
||||
"deposits": [
|
||||
{
|
||||
@@ -6781,6 +6881,16 @@
|
||||
"user": "0xa7d3D2CC58e1E82e3ff2C2Cd3B750442522aBbfb",
|
||||
"tx": "0x6957b2bd0f9f04f7cc124c11638be50ff5e2a26412e0be0c16f7aac1f1b73bc6"
|
||||
},
|
||||
{
|
||||
"amount": "15",
|
||||
"user": "0xB12Cdb63E38f9a6ff2C0F68aBC3CA9beFCb7148c",
|
||||
"tx": "0x7a0b7cc2723724de05fc2185b23021413450f47d40e27bcfa6b26f0872e94c9f"
|
||||
},
|
||||
{
|
||||
"amount": "15",
|
||||
"user": "0xB12Cdb63E38f9a6ff2C0F68aBC3CA9beFCb7148c",
|
||||
"tx": "0xcbf45579767dff34e84484629ee3fb3355232245f30ad259443e3864db80a707"
|
||||
},
|
||||
{
|
||||
"amount": "20",
|
||||
"user": "0xB12Cdb63E38f9a6ff2C0F68aBC3CA9beFCb7148c",
|
||||
@@ -16728,6 +16838,11 @@
|
||||
"user": "0xa10aD7E7712617fc4ABe0811D8a30fD96cE48F9f",
|
||||
"tx": "0x7ffe3e795b50a8449052143a739d53aec81c2f53c7981f31496b8c121bd4ec81"
|
||||
},
|
||||
{
|
||||
"amount": "96",
|
||||
"user": "0x4cBC0C88d8FE503f62823B42f30a4900292C13bE",
|
||||
"tx": "0x51d8ec749dbb4148d170869bca8a6b8ce679bfea0686f9582c3a58f3f31fd77a"
|
||||
},
|
||||
{
|
||||
"amount": "200",
|
||||
"user": "0xa7d3D2CC58e1E82e3ff2C2Cd3B750442522aBbfb",
|
||||
@@ -17799,6 +17914,18 @@
|
||||
{
|
||||
"address": "0xB12Cdb63E38f9a6ff2C0F68aBC3CA9beFCb7148c",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "15",
|
||||
"user": "0xB12Cdb63E38f9a6ff2C0F68aBC3CA9beFCb7148c",
|
||||
"tranche_id": 11,
|
||||
"tx": "0x7a0b7cc2723724de05fc2185b23021413450f47d40e27bcfa6b26f0872e94c9f"
|
||||
},
|
||||
{
|
||||
"amount": "15",
|
||||
"user": "0xB12Cdb63E38f9a6ff2C0F68aBC3CA9beFCb7148c",
|
||||
"tranche_id": 11,
|
||||
"tx": "0xcbf45579767dff34e84484629ee3fb3355232245f30ad259443e3864db80a707"
|
||||
},
|
||||
{
|
||||
"amount": "20",
|
||||
"user": "0xB12Cdb63E38f9a6ff2C0F68aBC3CA9beFCb7148c",
|
||||
@@ -18570,9 +18697,9 @@
|
||||
"tx": "0x6940787f6ceaac0846e69f1bc93ad9efee8c39774b91ea29f84328ae64fc9969"
|
||||
}
|
||||
],
|
||||
"total_tokens": "2600",
|
||||
"total_tokens": "2630",
|
||||
"withdrawn_tokens": "2585",
|
||||
"remaining_tokens": "15"
|
||||
"remaining_tokens": "45"
|
||||
},
|
||||
{
|
||||
"address": "0xE9F41a0090fcc7eaf626037003AAD44B17098E7C",
|
||||
@@ -30450,10 +30577,17 @@
|
||||
"tx": "0xe7518eaa0fe2385aec5ab0f8617ba0b62d71d82e8be39586763020ec04c98422"
|
||||
}
|
||||
],
|
||||
"withdrawals": [],
|
||||
"withdrawals": [
|
||||
{
|
||||
"amount": "96",
|
||||
"user": "0x4cBC0C88d8FE503f62823B42f30a4900292C13bE",
|
||||
"tranche_id": 11,
|
||||
"tx": "0x51d8ec749dbb4148d170869bca8a6b8ce679bfea0686f9582c3a58f3f31fd77a"
|
||||
}
|
||||
],
|
||||
"total_tokens": "96",
|
||||
"withdrawn_tokens": "0",
|
||||
"remaining_tokens": "96"
|
||||
"withdrawn_tokens": "96",
|
||||
"remaining_tokens": "0"
|
||||
},
|
||||
{
|
||||
"address": "0xaf487ccD027742705EC1B2DD1adCFAb0eBccDeAb",
|
||||
@@ -33294,8 +33428,8 @@
|
||||
"tranche_start": "2022-03-05T00:00:00.000Z",
|
||||
"tranche_end": "2023-06-05T00:00:00.000Z",
|
||||
"total_added": "3732368.4671",
|
||||
"total_removed": "442882.3484327902809",
|
||||
"locked_amount": "1033104.123341510407167357286",
|
||||
"total_removed": "587661.3975847902809",
|
||||
"locked_amount": "1024921.1346101525677902113",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "1998.95815",
|
||||
@@ -33464,6 +33598,11 @@
|
||||
}
|
||||
],
|
||||
"withdrawals": [
|
||||
{
|
||||
"amount": "144779.049152",
|
||||
"user": "0x1da69E9C22d77Ef8Ccbf5a1F2d83eDBc5Dcc20fA",
|
||||
"tx": "0x0b7e2937cd20679a8b18424808e50d0bfa356895b08fcac7afeb5166214a6134"
|
||||
},
|
||||
{
|
||||
"amount": "2536.282963529438",
|
||||
"user": "0xE6CacAE56Cca8dFdB7910b5A13578719D4E57DA0",
|
||||
@@ -34184,10 +34323,17 @@
|
||||
"tx": "0xeb14f907c987ad54eed8697ec95c8a674c9034a4cbee43b013f947bb0e398ce5"
|
||||
}
|
||||
],
|
||||
"withdrawals": [],
|
||||
"withdrawals": [
|
||||
{
|
||||
"amount": "144779.049152",
|
||||
"user": "0x1da69E9C22d77Ef8Ccbf5a1F2d83eDBc5Dcc20fA",
|
||||
"tranche_id": 1,
|
||||
"tx": "0x0b7e2937cd20679a8b18424808e50d0bfa356895b08fcac7afeb5166214a6134"
|
||||
}
|
||||
],
|
||||
"total_tokens": "200000",
|
||||
"withdrawn_tokens": "0",
|
||||
"remaining_tokens": "200000"
|
||||
"withdrawn_tokens": "144779.049152",
|
||||
"remaining_tokens": "55220.950848"
|
||||
},
|
||||
{
|
||||
"address": "0x4d50f66eF38892248Bb4Badbbf993dE965BDb029",
|
||||
@@ -34586,8 +34732,8 @@
|
||||
"tranche_start": "2022-06-05T00:00:00.000Z",
|
||||
"tranche_end": "2023-12-05T00:00:00.000Z",
|
||||
"total_added": "15870102.715470999700000001",
|
||||
"total_removed": "549182.48543502092691952",
|
||||
"locked_amount": "8963008.4753852283836950014010192461651798",
|
||||
"total_removed": "549870.41589506708867952",
|
||||
"locked_amount": "8933992.1227419284607449818059509603906462",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "16249.93",
|
||||
@@ -35101,6 +35247,11 @@
|
||||
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
|
||||
"tx": "0x6c49f9f742a84f7889b90e6f978f3fb1f642ea447f737f348b3fac91716b9717"
|
||||
},
|
||||
{
|
||||
"amount": "687.93046004616176",
|
||||
"user": "0xe3eB4CF43C072658401996b71D43eE26E573562D",
|
||||
"tx": "0x137cf963adc7f889f2b24bb3d55716cb6b8581bf13040f13e65f1d16c52e2f9f"
|
||||
},
|
||||
{
|
||||
"amount": "858.360074993579125",
|
||||
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
|
||||
@@ -38006,6 +38157,12 @@
|
||||
"tranche_id": 2,
|
||||
"tx": "0x7882fc86536accee89368b825b374eb365ee5f051cb89fb3710c7e2d24b0d29d"
|
||||
},
|
||||
{
|
||||
"amount": "687.93046004616176",
|
||||
"user": "0xe3eB4CF43C072658401996b71D43eE26E573562D",
|
||||
"tranche_id": 2,
|
||||
"tx": "0x137cf963adc7f889f2b24bb3d55716cb6b8581bf13040f13e65f1d16c52e2f9f"
|
||||
},
|
||||
{
|
||||
"amount": "1293.67099136315494",
|
||||
"user": "0xe3eB4CF43C072658401996b71D43eE26E573562D",
|
||||
@@ -38206,8 +38363,8 @@
|
||||
}
|
||||
],
|
||||
"total_tokens": "150551.801",
|
||||
"withdrawn_tokens": "65072.74657224015982",
|
||||
"remaining_tokens": "85479.05442775984018"
|
||||
"withdrawn_tokens": "65760.67703228632158",
|
||||
"remaining_tokens": "84791.12396771367842"
|
||||
},
|
||||
{
|
||||
"address": "0x4d982Ab0823fD2f48e934a7be2bb0a5374a26148",
|
||||
@@ -39933,7 +40090,7 @@
|
||||
"tranche_end": "2023-05-05T00:00:00.000Z",
|
||||
"total_added": "14597706.0446472999",
|
||||
"total_removed": "3709441.39326687814680893",
|
||||
"locked_amount": "2553146.968835877717601199418901287",
|
||||
"locked_amount": "2526359.257346743126435428429250596",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "129284.449",
|
||||
@@ -46655,8 +46812,8 @@
|
||||
"tranche_start": "2021-10-05T00:00:00.000Z",
|
||||
"tranche_end": "2023-04-05T00:00:00.000Z",
|
||||
"total_added": "5778205.3912159303",
|
||||
"total_removed": "2622261.560853924298939789",
|
||||
"locked_amount": "691860.405151183386025619771012724",
|
||||
"total_removed": "2641378.858038489881081789",
|
||||
"locked_amount": "681276.418331096005378072261313125",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "552496.6455",
|
||||
@@ -46800,6 +46957,11 @@
|
||||
}
|
||||
],
|
||||
"withdrawals": [
|
||||
{
|
||||
"amount": "19117.297184565582142",
|
||||
"user": "0x1dD2718fd01d05C9F50Fce8Bb723A4C7483A1E15",
|
||||
"tx": "0xf86662bab80d05690accd866da9bbe8e7a82e1b62133350789d7a863f1019211"
|
||||
},
|
||||
{
|
||||
"amount": "3634.58269967002683",
|
||||
"user": "0xafa64cCa337eFEE0AD827F6C2684e69275226e90",
|
||||
@@ -47602,6 +47764,12 @@
|
||||
}
|
||||
],
|
||||
"withdrawals": [
|
||||
{
|
||||
"amount": "19117.297184565582142",
|
||||
"user": "0x1dD2718fd01d05C9F50Fce8Bb723A4C7483A1E15",
|
||||
"tranche_id": 4,
|
||||
"tx": "0xf86662bab80d05690accd866da9bbe8e7a82e1b62133350789d7a863f1019211"
|
||||
},
|
||||
{
|
||||
"amount": "376.2625308599198808",
|
||||
"user": "0x1dD2718fd01d05C9F50Fce8Bb723A4C7483A1E15",
|
||||
@@ -47610,8 +47778,8 @@
|
||||
}
|
||||
],
|
||||
"total_tokens": "22099.90582",
|
||||
"withdrawn_tokens": "376.2625308599198808",
|
||||
"remaining_tokens": "21723.6432891400801192"
|
||||
"withdrawn_tokens": "19493.5597154255020228",
|
||||
"remaining_tokens": "2606.3461045744979772"
|
||||
},
|
||||
{
|
||||
"address": "0x759C9ABABA492500c4c730bEB568B5b851Dec2c7",
|
||||
@@ -48550,8 +48718,8 @@
|
||||
"tranche_start": "2022-06-05T00:00:00.000Z",
|
||||
"tranche_end": "2023-06-05T00:00:00.000Z",
|
||||
"total_added": "472355.6199999996",
|
||||
"total_removed": "31616.1712341930685",
|
||||
"locked_amount": "163701.253818397273052118746829",
|
||||
"total_removed": "31629.2828545632685",
|
||||
"locked_amount": "162404.61247795584206776805580924",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "3000",
|
||||
@@ -55170,6 +55338,11 @@
|
||||
}
|
||||
],
|
||||
"withdrawals": [
|
||||
{
|
||||
"amount": "13.1116203702",
|
||||
"user": "0x4cBC0C88d8FE503f62823B42f30a4900292C13bE",
|
||||
"tx": "0xf712a2417c5e58f65ac39422766fd902301f905f41e9eed0dc097e1dfa641b1c"
|
||||
},
|
||||
{
|
||||
"amount": "78.261187214",
|
||||
"user": "0x479F059c46c6873C6B970A92911084b3eA036d56",
|
||||
@@ -63409,10 +63582,17 @@
|
||||
"tx": "0x057f65938b1360b6d2c4ebf5e789c67897cf60cb6a13f947004def03891afbd8"
|
||||
}
|
||||
],
|
||||
"withdrawals": [],
|
||||
"withdrawals": [
|
||||
{
|
||||
"amount": "13.1116203702",
|
||||
"user": "0x4cBC0C88d8FE503f62823B42f30a4900292C13bE",
|
||||
"tranche_id": 5,
|
||||
"tx": "0xf712a2417c5e58f65ac39422766fd902301f905f41e9eed0dc097e1dfa641b1c"
|
||||
}
|
||||
],
|
||||
"total_tokens": "20",
|
||||
"withdrawn_tokens": "0",
|
||||
"remaining_tokens": "20"
|
||||
"withdrawn_tokens": "13.1116203702",
|
||||
"remaining_tokens": "6.8883796298"
|
||||
},
|
||||
{
|
||||
"address": "0x9999099991E044E3538379C80F00308E430881AA",
|
||||
|
||||
@@ -21,21 +21,15 @@ const orderUpdatedAt = 'updatedAt';
|
||||
const assetSelectField = 'select[name="asset"]';
|
||||
const amountField = 'input[name="amount"]';
|
||||
const txTimeout = Cypress.env('txTimeout');
|
||||
const sepoliaUrl = Cypress.env('ETHERSCAN_URL');
|
||||
const btcName =
|
||||
'BTC (local)5cfa87844724df6069b94e4c8a6f03af21907d7bc251593d08e4251043ee9f7c - tBTC';
|
||||
const btcName = 'BTC (local)';
|
||||
const btcSymbol = 'tBTC';
|
||||
const usdcSymbol = 'fUSDC';
|
||||
const toastContent = 'toast-content';
|
||||
const ordersTab = 'Orders';
|
||||
const depositsTab = 'Deposits';
|
||||
const toastCloseBtn = 'toast-close';
|
||||
const price = '390';
|
||||
const size = '0.0005';
|
||||
const newPrice = '200';
|
||||
|
||||
// TODO: ensure this test runs only if capsule is running via workflow
|
||||
// Because the tests are run on a live network to optimize time, the tests are interdependent and must be run in the given order.
|
||||
describe('capsule', { tags: '@slow' }, () => {
|
||||
before(() => {
|
||||
cy.createMarket();
|
||||
@@ -56,8 +50,8 @@ describe('capsule', { tags: '@slow' }, () => {
|
||||
marketId: market.id,
|
||||
type: Schema.OrderType.TYPE_LIMIT,
|
||||
side: Schema.Side.SIDE_BUY,
|
||||
size: size,
|
||||
price: price,
|
||||
size: '0.0005',
|
||||
price: '390',
|
||||
timeInForce: Schema.OrderTimeInForce.TIME_IN_FORCE_GTC,
|
||||
};
|
||||
const rawPrice = removeDecimal(order.price, market.decimalPlaces);
|
||||
@@ -70,8 +64,7 @@ describe('capsule', { tags: '@slow' }, () => {
|
||||
|
||||
cy.getByTestId(toastContent).should(
|
||||
'contain.text',
|
||||
`ConfirmedYour transaction has been confirmed View in block explorerSubmit order - activeTEST.24h+${order.size} @ ${order.price}.00 ${usdcSymbol}`,
|
||||
{ matchCase: false }
|
||||
`ConfirmedYour transaction has been confirmed View in block explorerSubmit order - activeTEST.24h+0.0005 @ 390.00 ${usdcSymbol}`
|
||||
);
|
||||
cy.getByTestId(toastCloseBtn).click();
|
||||
// orderbook cells are keyed by price level
|
||||
@@ -82,7 +75,7 @@ describe('capsule', { tags: '@slow' }, () => {
|
||||
.should('contain.text', rawSize);
|
||||
|
||||
cy.getByTestId(ordersTab).click();
|
||||
cy.getByTestId('edit', txTimeout).should('contain.text', 'Edit');
|
||||
cy.getByTestId('edit').should('contain.text', 'Edit');
|
||||
cy.getByTestId('tab-orders').within(() => {
|
||||
cy.get('.ag-center-cols-container')
|
||||
.children()
|
||||
@@ -120,41 +113,35 @@ describe('capsule', { tags: '@slow' }, () => {
|
||||
checkIfDataAndTimeOfCreationAndUpdateIsEqual(orderCreatedAt);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it('can edit order', function () {
|
||||
//edit order
|
||||
cy.getByTestId(ordersTab).click();
|
||||
cy.getByTestId('edit').first().should('be.visible').click();
|
||||
cy.getByTestId('dialog-title').should('contain.text', 'Edit order');
|
||||
cy.get('#limitPrice').focus().clear().type(newPrice);
|
||||
cy.get('#limitPrice').focus().clear().type('200');
|
||||
cy.getByTestId('edit-order').find('[type="submit"]').click();
|
||||
cy.getByTestId(toastContent).should(
|
||||
'contain.text',
|
||||
`ConfirmedYour transaction has been confirmed View in block explorerEdit order - activeTEST.24h+${size} @ ${price}.00 ${usdcSymbol}+${size} @ ${newPrice}.00 ${usdcSymbol}`,
|
||||
{ matchCase: false }
|
||||
`ConfirmedYour transaction has been confirmed View in block explorerEdit order - activeTEST.24h+0.0005 @ 200.00 ${usdcSymbol}+0.0005 @ 200.00 ${usdcSymbol}`
|
||||
);
|
||||
cy.getByTestId(ordersTab).click();
|
||||
cy.getByTestId(toastCloseBtn).click({ multiple: true });
|
||||
cy.getByTestId(toastCloseBtn).click();
|
||||
cy.get('.ag-center-cols-container')
|
||||
.children()
|
||||
.first()
|
||||
.within(() => {
|
||||
cy.get(`[col-id='${orderPrice}']`).then(($price) => {
|
||||
expect(parseFloat($price.text())).to.equal(parseFloat(newPrice));
|
||||
expect(parseFloat($price.text())).to.equal(parseFloat('200'));
|
||||
});
|
||||
checkIfDataAndTimeOfCreationAndUpdateIsEqual(orderUpdatedAt);
|
||||
});
|
||||
});
|
||||
|
||||
it('can cancel order', function () {
|
||||
//cancel order
|
||||
cy.getByTestId(ordersTab).click();
|
||||
cy.getByTestId('cancel').first().click();
|
||||
cy.getByTestId(toastContent).should(
|
||||
'contain.text',
|
||||
`ConfirmedYour transaction has been confirmed View in block explorerCancel order - cancelledTEST.24h+${size} @ ${newPrice}.00 ${usdcSymbol}`,
|
||||
{ matchCase: false }
|
||||
`ConfirmedYour transaction has been confirmed View in block explorerCancel order - cancelledTEST.24h+0.0005 @ 200.00 ${usdcSymbol}`
|
||||
);
|
||||
cy.getByTestId(toastCloseBtn).click({ multiple: true });
|
||||
cy.getByTestId(toastCloseBtn).click();
|
||||
|
||||
cy.getByTestId('tab-orders')
|
||||
.get('.ag-center-cols-container')
|
||||
@@ -164,10 +151,7 @@ describe('capsule', { tags: '@slow' }, () => {
|
||||
.should('contain.text', OrderStatusMapping.STATUS_CANCELLED);
|
||||
});
|
||||
|
||||
it('can deposit', function () {
|
||||
cy.visit('/#/portfolio');
|
||||
cy.get('main[data-testid="/portfolio"]').should('exist');
|
||||
|
||||
it('can deposit and withdrawal', function () {
|
||||
// 1001-DEPO-001
|
||||
// 1001-DEPO-002
|
||||
// 1001-DEPO-003
|
||||
@@ -176,12 +160,27 @@ describe('capsule', { tags: '@slow' }, () => {
|
||||
// 1001-DEPO-007
|
||||
// 1001-DEPO-008
|
||||
// 1001-DEPO-009
|
||||
// 1001-DEPO-010
|
||||
// 1002-WITH-001
|
||||
// 1002-WITH-006
|
||||
// 1002-WITH-009
|
||||
// 002-WITH-011
|
||||
// 1002-WITH-024
|
||||
// 1002-WITH-012
|
||||
// 1002-WITH-013
|
||||
// 1002-WITH-014
|
||||
// 1002-WITH-015
|
||||
// 1002-WITH-016
|
||||
// 1002-WITH-019
|
||||
|
||||
cy.visit('/#/portfolio');
|
||||
cy.get('main[data-testid="/portfolio"]').should('exist');
|
||||
|
||||
cy.highlight('creating deposit');
|
||||
|
||||
cy.getByTestId(depositsTab).click();
|
||||
cy.getByTestId('deposit-button').click();
|
||||
connectEthereumWallet('Unknown');
|
||||
cy.get(assetSelectField, txTimeout).select(btcName, { force: true });
|
||||
cy.get(assetSelectField, txTimeout).select(btcName);
|
||||
cy.getByTestId('deposit-approve-submit').click();
|
||||
cy.getByTestId('dialog-title').should('contain.text', 'Approve complete');
|
||||
cy.get('[data-testid="Return to deposit"]').click();
|
||||
@@ -189,8 +188,7 @@ describe('capsule', { tags: '@slow' }, () => {
|
||||
cy.getByTestId('deposit-submit').click();
|
||||
cy.getByTestId(toastContent, txTimeout).should(
|
||||
'contain.text',
|
||||
`Transaction confirmedYour transaction has been confirmed.View on EtherscanDeposit 1.00 ${btcSymbol}`,
|
||||
{ matchCase: false }
|
||||
`Transaction completedYour transaction has been completedView on EtherscanDeposit 1.00 ${btcSymbol}`
|
||||
);
|
||||
cy.getByTestId(toastCloseBtn).click();
|
||||
cy.getByTestId('Collateral').click();
|
||||
@@ -198,6 +196,8 @@ describe('capsule', { tags: '@slow' }, () => {
|
||||
cy.highlight('deposit verification');
|
||||
|
||||
cy.getByTestId('asset', txTimeout).should('contain.text', btcSymbol);
|
||||
// need to reload page to see deposit history complete
|
||||
cy.reload();
|
||||
cy.getByTestId(depositsTab).click();
|
||||
cy.get('.ag-cell-value', txTimeout).should('contain.text', btcSymbol);
|
||||
cy.get('[col-id="status"]').should('not.have.text', 'Open', txTimeout);
|
||||
@@ -214,29 +214,15 @@ describe('capsule', { tags: '@slow' }, () => {
|
||||
cy.get('[col-id="txHash"]')
|
||||
.find('a')
|
||||
.should('have.attr', 'href')
|
||||
.and('contain', `${sepoliaUrl}/tx/0x`);
|
||||
.and('contain', 'https://sepolia.etherscan.io/tx');
|
||||
});
|
||||
});
|
||||
|
||||
it('can withdrawal', function () {
|
||||
// 1002-WITH-001
|
||||
// 1002-WITH-006
|
||||
// 1002-WITH-009
|
||||
// 1002-WITH-011
|
||||
// 1002-WITH-024
|
||||
// 1002-WITH-012
|
||||
// 1002-WITH-013
|
||||
// 1002-WITH-014
|
||||
// 1002-WITH-015
|
||||
// 1002-WITH-016
|
||||
// 1002-WITH-019
|
||||
cy.highlight('creating withdrawals');
|
||||
|
||||
cy.getByTestId('Withdrawals').click();
|
||||
cy.getByTestId('withdraw-dialog-button').click();
|
||||
cy.get(assetSelectField, txTimeout).select(
|
||||
'BTC (local)5cfa87844724df6069b94e4c8a6f03af21907d7bc251593d08e4251043ee9f7c - tBTC',
|
||||
{ force: true }
|
||||
);
|
||||
connectEthereumWallet('Unknown');
|
||||
cy.get(assetSelectField).select(btcName);
|
||||
cy.get(amountField).clear().type('1');
|
||||
cy.getByTestId('submit-withdrawal').click();
|
||||
cy.getByTestId(toastContent, txTimeout).should(
|
||||
@@ -257,7 +243,7 @@ describe('capsule', { tags: '@slow' }, () => {
|
||||
cy.getByTestId('toast-complete-withdrawal').click();
|
||||
cy.getByTestId(toastContent, txTimeout).should(
|
||||
'contain.text',
|
||||
'Transaction confirmed'
|
||||
'Transaction completed'
|
||||
);
|
||||
|
||||
cy.getByTestId('complete-withdrawal', txTimeout).should('not.exist');
|
||||
@@ -272,28 +258,17 @@ describe('capsule', { tags: '@slow' }, () => {
|
||||
cy.get('[col-id="details.receiverAddress"]')
|
||||
.find('a')
|
||||
.should('have.attr', 'href')
|
||||
.and('contain', `${sepoliaUrl}/address/`);
|
||||
.and('contain', 'https://sepolia.etherscan.io/address/');
|
||||
cy.get('[col-id="createdTimestamp"]').should('not.be.empty');
|
||||
cy.get('[col-id="withdrawnTimestamp"]').should('not.be.empty');
|
||||
cy.get('[col-id="status"]').should('have.text', 'Completed');
|
||||
cy.get('[col-id="txHash"]')
|
||||
.find('a')
|
||||
.should('have.attr', 'href')
|
||||
.and('contain', `${sepoliaUrl}/tx/0x`);
|
||||
.and('contain', 'https://sepolia.etherscan.io/tx/0x');
|
||||
});
|
||||
});
|
||||
|
||||
it('deposit - if approved amount is less than deposit: must see that an approval is needed and be prompted to approve more', function () {
|
||||
// 1001-DEPO-006
|
||||
|
||||
cy.getByTestId(depositsTab).click();
|
||||
cy.getByTestId('deposit-button').click();
|
||||
cy.get(assetSelectField, txTimeout).select(btcName, { force: true });
|
||||
cy.get(amountField).clear().type('20000000');
|
||||
cy.getByTestId('deposit-approve-submit').should('be.visible');
|
||||
});
|
||||
});
|
||||
|
||||
function checkIfDataAndTimeOfCreationAndUpdateIsEqual(date: string) {
|
||||
cy.get(`[col-id='${date}'] .ag-cell-wrapper`)
|
||||
.children('span')
|
||||
|
||||
@@ -56,7 +56,6 @@ describe('deposit form validation', { tags: '@smoke' }, () => {
|
||||
});
|
||||
|
||||
it('insufficient funds', () => {
|
||||
// 1001-DEPO-005
|
||||
// Deposit amount is valid, but less than approved. This will always be the case because our
|
||||
// CI wallet wont have approved any assets
|
||||
cy.get(amountField)
|
||||
|
||||
@@ -454,4 +454,8 @@ describe('amend and cancel order', { tags: '@smoke' }, () => {
|
||||
);
|
||||
});
|
||||
});
|
||||
it.skip('tbd for 7003-MORD', () => {
|
||||
// NOT COVERED: must see the reference, offset and direction for each part pegged order - waiting for clarification
|
||||
// NOT COVERED: must see the reference, offset and direction for each part liquidity order order - waiting for clarification
|
||||
});
|
||||
});
|
||||
|
||||
@@ -48,7 +48,7 @@ function createNewMarketProposal(): ProposalSubmissionBody {
|
||||
signers: [
|
||||
{
|
||||
pubKey: {
|
||||
key: '70d14a321e02e71992fd115563df765000ccc4775cbe71a0e2f9ff5a3b9dc680',
|
||||
key: '0xfCEAdAFab14d46e20144F48824d0C09B1a03F2BC',
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user