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

Recive #315

Open
Re2906 opened this issue Oct 29, 2024 · 1 comment
Open

Recive #315

Re2906 opened this issue Oct 29, 2024 · 1 comment

Comments

@Re2906
Copy link

Re2906 commented Oct 29, 2024

String input = "Amount: "201057993"\n" +
"QueryId: 702837699428045\n" +
"Step:\n" +
" Params:\n" +
" KindOut: false\n" +
" Limit: "401857633816219"\n" +
" Next: null\n" +
" PoolAddr: 0:231324b5b22cfb8307237fde6c8333520ee5a96b3f365e08264c2b2a86271ac1\n" +
"SwapParams:\n" +
" Deadline: 1724087188\n" +
" FulfillPayload: null\n" +
" RecipientAddr: 0:4818f679ede118884806590b9b705a00fa6aa0cf7009d4b3d128ff263b031c88\n" +
" ReferralAddr: 0:d9949a2b4a80787112796fc82dd2a4786e42dfcd50d55dee5298c3dc125d1304\n" +
" RejectPayload: null";

    String[] lines = input.split("\n");

    String amount = "";
    String queryId = "";

    for (String line : lines) {
        if (line.startsWith("Amount:")) {
            amount = line.substring(line.indexOf("\"") + 1, line.lastIndexOf("\""));
        } else if (line.startsWith("QueryId:")) {
            queryId = line.substring(line.indexOf(":") + 2);
        }
    }

    assertEquals("201057993", amount);
    assertEquals("702837699428045", queryId);
}

}

@AliChaudhy222
Copy link

Thfdfbv

@Re2906 Re2906 mentioned this issue Oct 31, 2024
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

No branches or pull requests

2 participants