()
| 2715 | } |
| 2716 | |
| 2717 | public java.util.concurrent.CompletableFuture<Object> testParadex() |
| 2718 | { |
| 2719 | |
| 2720 | return java.util.concurrent.CompletableFuture.supplyAsync(() -> { |
| 2721 | |
| 2722 | if (Helpers.isTrue(Helpers.isEqual(this.lang, "java"))) |
| 2723 | { |
| 2724 | return false; |
| 2725 | } |
| 2726 | Exchange exchange = this.initOfflineExchange("paradex"); |
| 2727 | exchange.walletAddress = "0xc751489d24a33172541ea451bc253d7a9e98c781"; |
| 2728 | exchange.privateKey = "c33b1eb4b53108bf52e10f636d8c1236c04c33a712357ba3543ab45f48a5cb0b"; |
| 2729 | Helpers.addElementToObject(exchange.options, "authToken", "token"); |
| 2730 | Helpers.addElementToObject(exchange.options, "systemConfig", new java.util.HashMap<String, Object>() {{ |
| 2731 | put( "starknet_gateway_url", "https://potc-testnet-sepolia.starknet.io" ); |
| 2732 | put( "starknet_fullnode_rpc_url", "https://pathfinder.api.testnet.paradex.trade/rpc/v0_7" ); |
| 2733 | put( "starknet_chain_id", "PRIVATE_SN_POTC_SEPOLIA" ); |
| 2734 | put( "block_explorer_url", "https://voyager.testnet.paradex.trade/" ); |
| 2735 | put( "paraclear_address", "0x286003f7c7bfc3f94e8f0af48b48302e7aee2fb13c23b141479ba00832ef2c6" ); |
| 2736 | put( "paraclear_decimals", 8 ); |
| 2737 | put( "paraclear_account_proxy_hash", "0x3530cc4759d78042f1b543bf797f5f3d647cde0388c33734cf91b7f7b9314a9" ); |
| 2738 | put( "paraclear_account_hash", "0x41cb0280ebadaa75f996d8d92c6f265f6d040bb3ba442e5f86a554f1765244e" ); |
| 2739 | put( "oracle_address", "0x2c6a867917ef858d6b193a0ff9e62b46d0dc760366920d631715d58baeaca1f" ); |
| 2740 | put( "bridged_tokens", new java.util.ArrayList<Object>(java.util.Arrays.asList(new java.util.HashMap<String, Object>() {{ |
| 2741 | put( "name", "TEST USDC" ); |
| 2742 | put( "symbol", "USDC" ); |
| 2743 | put( "decimals", 6 ); |
| 2744 | put( "l1_token_address", "0x29A873159D5e14AcBd63913D4A7E2df04570c666" ); |
| 2745 | put( "l1_bridge_address", "0x8586e05adc0C35aa11609023d4Ae6075Cb813b4C" ); |
| 2746 | put( "l2_token_address", "0x6f373b346561036d98ea10fb3e60d2f459c872b1933b50b21fe6ef4fda3b75e" ); |
| 2747 | put( "l2_bridge_address", "0x46e9237f5408b5f899e72125dd69bd55485a287aaf24663d3ebe00d237fc7ef" ); |
| 2748 | }})) ); |
| 2749 | put( "l1_core_contract_address", "0x582CC5d9b509391232cd544cDF9da036e55833Af" ); |
| 2750 | put( "l1_operator_address", "0x11bACdFbBcd3Febe5e8CEAa75E0Ef6444d9B45FB" ); |
| 2751 | put( "l1_chain_id", "11155111" ); |
| 2752 | put( "liquidation_fee", "0.2" ); |
| 2753 | }}); |
| 2754 | Object reqHeaders = null; |
| 2755 | Object id = "CCXT"; |
| 2756 | Assert(Helpers.isEqual(Helpers.GetValue(exchange.options, "broker"), id), Helpers.add(Helpers.add("paradex - id: ", id), " not in options")); |
| 2757 | (exchange.loadMarkets()).join(); |
| 2758 | try |
| 2759 | { |
| 2760 | (exchange.createOrder("BTC/USD:USDC", "limit", "buy", 1, 20000)).join(); |
| 2761 | } catch(Exception e) |
| 2762 | { |
| 2763 | reqHeaders = exchange.last_request_headers; |
| 2764 | } |
| 2765 | Assert(Helpers.isEqual(Helpers.GetValue(reqHeaders, "PARADEX-PARTNER"), id), Helpers.add(Helpers.add("paradex - id: ", id), " not in headers")); |
| 2766 | if (!Helpers.isTrue(isSync())) |
| 2767 | { |
| 2768 | (close(exchange)).join(); |
| 2769 | } |
| 2770 | return true; |
| 2771 | }); |
| 2772 | |
| 2773 | } |
| 2774 |
no test coverage detected