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

Feat/intergrate dynamic token #356

Open
wants to merge 143 commits into
base: main
Choose a base branch
from
Open

Conversation

quangdz1704
Copy link
Contributor

@quangdz1704 quangdz1704 commented Nov 11, 2024

This pull request includes significant updates to the oraidex-common package, including new workflows, dependency updates, and major refactoring of the codebase. The most important changes include the addition of a new GitHub Actions workflow, updates to multiple dependencies, and major refactoring in the oraidex-common package.

Workflow and Dependency Updates:

Major Refactoring:

  • packages/oraidex-common/package.json: Updated the package version to 2.0.0, added module and types fields, and included @oraichain/common as a dependency. [1] [2]
  • packages/oraidex-common/src/alpha-network.ts and packages/oraidex-common/src/celestia-network.ts: Removed obsolete token and network configurations. [1] [2]
  • packages/oraidex-common/src/common.ts: Added a new OraidexCommon class that centralizes the management of token and chain configurations.
  • packages/oraidex-common/src/config/chainInfosWithIcon.ts, packages/oraidex-common/src/config/icon.ts, and packages/oraidex-common/src/config/index.ts: Refactored and centralized icon configurations and mappings. [1] [2] [3] [4] [5] [6]

These changes aim to improve the maintainability and scalability of the codebase by centralizing configurations and updating dependencies to their latest versions.

@quangdz1704 quangdz1704 self-assigned this Nov 11, 2024
quangdz1704 and others added 5 commits November 12, 2024 01:07
* feat: add HTT token configuration to oraidex.json

* fix: update HTT token denomination format in oraidex.json

* fix: update HTT token coingecko_id in oraidex.json
Copy link

github-actions bot commented Dec 13, 2024

badge

Code Coverage Summary

Filename                                                                      Stmts    Miss  Cover    Missing
--------------------------------------------------------------------------  -------  ------  -------  ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
docs/assets/main.js                                                              58      58  0.00%    1-58
docs/assets/search.js                                                             1       1  0.00%    1
packages/ibc-routing/hardhat.config.ts                                           59      59  0.00%    1-75
packages/ibc-routing/src/db.ts                                                  158     158  0.00%    1-263
packages/ibc-routing/src/event.ts                                                85      85  0.00%    1-122
packages/ibc-routing/src/index.ts                                                31      31  0.00%    1-56
packages/ibc-routing/src/machine.ts                                              30      30  0.00%    1-34
packages/ibc-routing/test/mock-eth-ws.ts                                         52      52  0.00%    1-55
packages/ibc-routing/test/mock-tendermint-ws.spec.ts                             25      17  32.00%   7-24
packages/oraidex-common/src/axios-request.ts                                     11      11  0.00%    1-20
packages/oraidex-common/src/bigdecimal.ts                                       139      44  68.34%   23-24, 40-41, 45-54, 63-65, 120-124, 127-146, 149-150, 153-154, 180-181, 184-185
packages/oraidex-common/src/common.ts                                           120      69  42.50%   42-43, 46-47, 50-51, 58-59, 62-63, 70-71, 74-75, 78-79, 82-83, 86-87, 90-91, 94-95, 98-99, 102-103, 106-107, 110-111, 114-115, 118-119, 122-145, 148-149, 156-157, 160-161, 164-165, 168-169
packages/oraidex-common/src/constant.ts                                         226       0  100.00%
packages/oraidex-common/src/helper.ts                                           514     162  68.48%   142-143, 146-157, 160-170, 277-279, 296-303, 306-319, 329-335, 345-360, 363-370, 373-403, 406-419, 422-428, 431-437, 441-450, 459-473, 479-481, 567-568, 592-595, 643-645, 648-650, 653-654
packages/oraidex-common/src/ibc-info.ts                                         184     184  0.00%    1-218
packages/oraidex-common/src/index.ts                                             16      16  0.00%    1-18
packages/oraidex-common/src/network.ts                                           16      16  0.00%    62-77
packages/oraidex-common/src/pairs.ts                                             83      83  0.00%    1-114
packages/oraidex-common/src/wallet.ts                                           146     146  0.00%    1-236
packages/oraidex-common/src/config/chainInfosWithIcon.ts                        210      15  92.85%   234-251
packages/oraidex-common/src/config/icon.ts                                       26       0  100.00%
packages/oraidex-common/src/config/index.ts                                       2       0  100.00%
packages/oraidex-common/src/interface/index.ts                                    1       0  100.00%
packages/oraidex-common/src/interface/wallet.ts                                  21       0  100.00%
packages/oraidex-common/src/supported/index.ts                                    3       3  0.00%    1-3
packages/oraidex-common/src/supported/supported-reader.ts                        21      21  0.00%    1-27
packages/oraidex-common/src/supported/supported.ts                               85      85  0.00%    1-85
packages/oraidex-common/tests/bigdecimal.spec.ts                                220       0  100.00%
packages/oraidex-common/tests/helper.spec.ts                                    590      10  98.30%   124-125, 356-357, 659-660, 675-676, 691-692
packages/oraiswap-v3/src/const.ts                                                11       0  100.00%
packages/oraiswap-v3/src/error.ts                                                15       6  60.00%   3-4, 9-10, 15-16
packages/oraiswap-v3/src/handler.ts                                             292      28  90.41%   63-64, 100-101, 216-217, 341-355, 358-366
packages/oraiswap-v3/src/helpers.ts                                             477     267  44.02%   125-126, 136-137, 162-163, 191-192, 202-203, 286-290, 293-300, 303-363, 366-371, 374-383, 387-443, 446-454, 457-489, 492-505, 513-558, 561-567, 570-594
packages/oraiswap-v3/src/index.ts                                                 7       0  100.00%
packages/oraiswap-v3/src/main.ts                                                 30      30  0.00%    1-70
packages/oraiswap-v3/src/types.ts                                                 9       0  100.00%
packages/oraiswap-v3/src/zap-consumer.ts                                        411     386  6.08%    82-129, 137-139, 149-176, 186-199, 217-289, 305-536, 548-600
packages/oraiswap-v3/src/wasm/oraiswap_v3_wasm.d.ts                              32      32  0.00%    469-500
packages/oraiswap-v3/src/wasm/oraiswap_v3_wasm.js                              1543     369  76.08%   32-34, 92-94, 100-101, 103-108, 113-120, 136-145, 160-223, 249-250, 278-279, 307-308, 336-337, 365-366, 394-395, 423-424, 463-464, 496-497, 525-526, 543-544, 565-579, 723-724, 748-749, 770-771, 783-786, 801-802, 832-833, 863-864, 884-885, 910-911, 929-953, 958-961, 966-969, 976-979, 984-987, 992-995, 1002-1005, 1010-1013, 1028-1031, 1036-1039, 1044-1047, 1062-1065, 1080-1083, 1088-1091, 1096-1099, 1106-1109, 1114-1117, 1122-1125, 1132-1135, 1149-1150, 1161-1164, 1170-1173, 1188-1191, 1196-1199, 1204-1207, 1214-1217, 1219-1225, 1300-1301, 1329-1330, 1333-1335, 1356-1361, 1364-1365, 1368-1372, 1386-1387, 1390-1391, 1394-1395, 1398-1399, 1402-1403, 1406-1407, 1410-1413, 1416-1417, 1420-1421, 1424-1425, 1428-1431, 1434-1437, 1444, 1447-1448, 1451-1458, 1465-1466, 1469-1470, 1473-1474, 1477, 1480-1481, 1484-1491, 1500-1504, 1507, 1510-1511
packages/oraiswap-v3/tests/handler.spec.ts                                      280       0  100.00%
packages/oraiswap-v3/tests/helpers.spec.ts                                      577       0  100.00%
packages/oraiswap-v3/tests/test-common.ts                                        97       0  100.00%
packages/oraiswap-v3/tests/wasm-bindgen.spec.ts                                 368       3  99.18%   450-452
packages/oraiswap-v3/tests/zap-consumer.spec.ts                                 213       0  100.00%
packages/universal-swap/src/handler.ts                                         1141     741  35.05%   94-95, 104-112, 115-123, 131-132, 136-137, 142, 144-149, 163-165, 171-178, 200-205, 226-250, 338-369, 379-386, 400-477, 481-512, 516-535, 538-555, 559-619, 624-715, 721-823, 826-891, 893-981, 985-995, 1043-1061, 1083-1085, 1091, 1153-1186, 1211-1214, 1221-1232, 1237-1261, 1302-1303, 1316-1359, 1422-1423
packages/universal-swap/src/helper.ts                                          1090     466  57.24%   95-97, 237-238, 242-243, 264-265, 279-280, 294-299, 327-328, 339-340, 343-344, 438-460, 469-471, 473-516, 530-585, 626-628, 653-659, 685-687, 691-693, 700-731, 787-795, 803-848, 856-865, 879-932, 974-975, 1019, 1026-1051, 1053-1054, 1098-1099, 1103-1106, 1125-1175, 1185-1204, 1268-1278, 1289-1294, 1313, 1332-1368, 1440-1484
packages/universal-swap/src/index.ts                                              6       6  0.00%    1-6
packages/universal-swap/src/swap-filter.ts                                       44      16  63.63%   56-64, 68-76
packages/universal-swap/src/types.ts                                             14       0  100.00%
packages/universal-swap/src/wrapper.ts                                           87      87  0.00%    1-126
packages/universal-swap/src/msg/common.ts                                        34      12  64.70%   11-12, 16-17, 20-21, 24-25, 30-31, 33-34
packages/universal-swap/src/msg/index.ts                                          4       0  100.00%
packages/universal-swap/src/msg/msgs.ts                                         195      87  55.38%   28-29, 51-52, 85-92, 108-127, 129-132, 138-139, 155-156, 162-169, 190-232
packages/universal-swap/src/msg/types.ts                                          6       0  100.00%
packages/universal-swap/src/msg/chains/chain.ts                                  21       4  80.95%   20-21, 24-25
packages/universal-swap/src/msg/chains/cosmos.ts                                118      14  88.13%   29-30, 34-35, 61-62, 66-67, 71-72, 109-110, 134-135
packages/universal-swap/src/msg/chains/index.ts                                   3       0  100.00%
packages/universal-swap/src/msg/chains/oraichain.ts                             519      92  82.27%   46-47, 57-58, 80-103, 131-137, 154, 187-193, 237, 291-317, 356, 512-515, 544-545, 630-647
packages/universal-swap/src/msg/chains/osmosis.ts                               239     117  51.04%   34-35, 45-46, 85-86, 103, 119-124, 140, 154-172, 176-181, 220-312
packages/universal-swap/src/proto/index.ts                                        1       1  0.00%    1
packages/universal-swap/src/proto/universal-swap-memo-proto-handler.ts           66      60  9.09%    21-46, 50-91
packages/universal-swap/src/proto/universal_swap_memo.ts                        918     724  21.13%   106-108, 131-179, 182-189, 192-209, 212-213, 215-228, 231-233, 244-264, 267-272, 275-280, 283-284, 286-289, 292-294, 298-302, 305-325, 328-331, 334-339, 342-343, 345-348, 351-353, 357-364, 367-394, 397-403, 406-414, 417-418, 420-424, 427-429, 446-480, 483-488, 491-502, 505-506, 508-513, 516-518, 529-530, 535-569, 572-581, 584-595, 598-599, 601-612, 615-617, 637-678, 681-689, 692-706, 709-710, 712-730, 733-735, 758-806, 809-816, 819-836, 839-840, 842-849, 852-854, 868-869, 877-925, 928-935, 938-955, 958-959, 961-968, 971-973, 987-1014, 1017-1021, 1024-1032, 1035-1036, 1038-1042, 1045-1047, 1058-1078, 1081-1082, 1085-1090, 1093-1094, 1096-1099, 1119-1127, 1130-1136
packages/universal-swap/src/universal-demos/alpha-ibc-new.ts                     83      83  0.00%    1-96
packages/universal-swap/src/universal-demos/alpha-smart-router.ts                80      80  0.00%    1-90
packages/universal-swap/src/universal-demos/decode-memo.ts                       16      16  0.00%    1-19
packages/universal-swap/src/universal-demos/evm-to-evm.ts                        54      54  0.00%    1-66
packages/universal-swap/src/universal-demos/from-cosmos-to-evm.ts                45      45  0.00%    1-58
packages/universal-swap/src/universal-demos/from-oraichain-to-evm.ts             42      42  0.00%    1-61
packages/universal-swap/src/universal-demos/from-oraichain-to-oraichain.ts       58      58  0.00%    1-75
packages/universal-swap/src/universal-demos/handle-simulate-swap.ts              35      35  0.00%    1-41
packages/universal-swap/src/universal-demos/ibc-hooks-demo.ts                    43      43  0.00%    1-50
packages/universal-swap/src/universal-demos/neutaro-ibc-demo.ts                  43      43  0.00%    1-51
packages/universal-swap/src/universal-demos/noble-ibc-demo.ts                    44      44  0.00%    1-49
packages/universal-swap/src/universal-demos/offline-wallet.ts                    21      21  0.00%    1-24
packages/universal-swap/tests/helper.spec.ts                                    666      27  95.94%   347, 360-362, 933-955
packages/universal-swap/tests/index.spec.ts                                    1122      40  96.43%   242-245, 298-299, 301-302, 304-305, 307-308, 310-311, 325-332, 1214-1233
packages/universal-swap/tests/smart-router-common.ts                            864       0  100.00%
packages/universal-swap/tests/test-common.ts                                     56       0  100.00%
packages/universal-swap/tests/msg/comos-msg.spec.ts                             208       0  100.00%
packages/universal-swap/tests/msg/msgs.spec.ts                                  609       0  100.00%
packages/universal-swap/tests/msg/oraichain-msg.spec.ts                         880       2  99.77%   130-131
packages/universal-swap/tests/msg/osmosis-msg.spec.ts                           357       0  100.00%
packages/universal-swap/tests/msg/test-data.ts                                    8       8  0.00%    1-9
TOTAL                                                                         17335    5545  68.01%

Diff against main

Filename                                                                      Stmts    Miss  Cover
--------------------------------------------------------------------------  -------  ------  --------
packages/oraidex-common/src/bigdecimal.ts                                         0      -6  +4.32%
packages/oraidex-common/src/common.ts                                          +120     +69  +42.50%
packages/oraidex-common/src/constant.ts                                          +8       0  +100.00%
packages/oraidex-common/src/helper.ts                                           +23     +11  -0.76%
packages/oraidex-common/src/index.ts                                             +2      +2  +100.00%
packages/oraidex-common/src/network.ts                                        -1137     +16  -100.00%
packages/oraidex-common/src/pairs.ts                                            -77     +79  -97.50%
packages/oraidex-common/src/config/chainInfosWithIcon.ts                         +2    -193  +92.85%
packages/oraidex-common/src/config/icon.ts                                      +26       0  +100.00%
packages/oraidex-common/src/config/index.ts                                      +2       0  +100.00%
packages/oraidex-common/src/interface/index.ts                                    0      -1  +100.00%
packages/oraidex-common/src/interface/wallet.ts                                   0     -21  +100.00%
packages/oraidex-common/src/supported/index.ts                                   +3      +3  +100.00%
packages/oraidex-common/src/supported/supported-reader.ts                       +21     +21  +100.00%
packages/oraidex-common/src/supported/supported.ts                              +85     +85  +100.00%
packages/oraidex-common/tests/helper.spec.ts                                    +29       0  +0.09%
packages/oraiswap-v3/src/helpers.ts                                             +10     +10  -0.94%
packages/oraiswap-v3/src/main.ts                                                 -2      -2  +100.00%
packages/oraiswap-v3/src/zap-consumer.ts                                        +17     +16  -0.01%
packages/oraiswap-v3/tests/zap-consumer.spec.ts                                  +4       0  +100.00%
packages/universal-swap/src/handler.ts                                          +92     +67  -0.69%
packages/universal-swap/src/helper.ts                                           +32     +24  -0.98%
packages/universal-swap/src/swap-filter.ts                                       +4     +16  -36.37%
packages/universal-swap/src/wrapper.ts                                           +8      +8  +100.00%
packages/universal-swap/src/msg/msgs.ts                                         +47     +26  -3.40%
packages/universal-swap/src/msg/chains/chain.ts                                  +1       0  +0.95%
packages/universal-swap/src/msg/chains/cosmos.ts                                 +7       0  +0.75%
packages/universal-swap/src/msg/chains/oraichain.ts                              +1       0  +0.04%
packages/universal-swap/src/msg/chains/osmosis.ts                                +7       0  +1.48%
packages/universal-swap/src/universal-demos/alpha-ibc-new.ts                     +5      +5  +100.00%
packages/universal-swap/src/universal-demos/alpha-smart-router.ts                +1      +1  +100.00%
packages/universal-swap/src/universal-demos/evm-to-evm.ts                        +2      +2  +100.00%
packages/universal-swap/src/universal-demos/from-cosmos-to-evm.ts                +4      +4  +100.00%
packages/universal-swap/src/universal-demos/from-oraichain-to-evm.ts             +1      +1  +100.00%
packages/universal-swap/src/universal-demos/from-oraichain-to-oraichain.ts       +4      +4  +100.00%
packages/universal-swap/src/universal-demos/handle-simulate-swap.ts              +4      +4  +100.00%
packages/universal-swap/src/universal-demos/ibc-hooks-demo.ts                    +3      +3  +100.00%
packages/universal-swap/src/universal-demos/neutaro-ibc-demo.ts                  +3      +3  +100.00%
packages/universal-swap/src/universal-demos/noble-ibc-demo.ts                    +3      +3  +100.00%
packages/universal-swap/src/universal-demos/offline-wallet.ts                    +2      +2  +100.00%
packages/universal-swap/tests/helper.spec.ts                                    -48       0  -0.27%
packages/universal-swap/tests/index.spec.ts                                      +8     +10  -0.87%
packages/universal-swap/tests/msg/msgs.spec.ts                                  +29       0  +100.00%
packages/universal-swap/tests/msg/oraichain-msg.spec.ts                         +40       0  +0.01%
TOTAL                                                                          -604    +272  -2.10%

Results for commit: 489d8f9

Minimum allowed coverage is 0%

♻️ This comment has been updated with latest results

@trungbach trungbach changed the title Feat/intergrate common Feat/intergrate dynamic token Dec 20, 2024
vuonghuuhung
vuonghuuhung previously approved these changes Dec 20, 2024
Copy link
Member

@vuonghuuhung vuonghuuhung left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants