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

Ton web #309

Open
Re2906 opened this issue Oct 27, 2024 · 4 comments
Open

Ton web #309

Re2906 opened this issue Oct 27, 2024 · 4 comments

Comments

@Re2906
Copy link

Re2906 commented Oct 27, 2024

No description provided.

@Re2906
Copy link
Author

Re2906 commented Oct 28, 2024

{
  "balance": "190227417",
  "wallet_type": "wallet v4 r2",
  "seqno": 910,
  "wallet_id": 698983191,
  "last_transaction_lt": "50159798000003",
  "last_transaction_hash": "W9K5xarl6NVcmi4VRLse8QwBYZ4BrIiHbY/2axCP5qE=",
  "status": "active"
}

Headers

{
  "balance": "190227417",
  "wallet_type": "wallet v4 r2",
  "seqno": 910,
  "wallet_id": 698983191,
  "last_transaction_lt": "50159798000003",
  "last_transaction_hash": "W9K5xarl6NVcmi4VRLse8QwBYZ4BrIiHbY/2axCP5qE=",
  "status": "active"
}

@Re2906
Copy link
Author

Re2906 commented Oct 28, 2024

{
  "balance": "190227417",
  "wallet_type": "wallet v4 r2",
  "seqno": 910,
  "wallet_id": 698983191,
  "last_transaction_lt": "50159798000003",
  "last_transaction_hash": "W9K5xarl6NVcmi4VRLse8QwBYZ4BrIiHbY/2axCP5qE=",
  "status": "active"
}

Headers

{
  "balance": "190227417",
  "wallet_type": "wallet v4 r2",
  "seqno": 910,
  "wallet_id": 698983191,
  "last_transaction_lt": "50159798000003",
  "last_transaction_hash": "W9K5xarl6NVcmi4VRLse8QwBYZ4BrIiHbY/2axCP5qE=",
  "status": "active"
}

@khalilmosavi
Copy link

{
"balance": "190227417",
"wallet_type": "wallet v4 r2",
"seqno": 910,
"wallet_id": 698983191,
"last_transaction_lt": "50159798000003",
"last_transaction_hash": "W9K5xarl6NVcmi4VRLse8QwBYZ4BrIiHbY/2axCP5qE=",
"status": "active"
}

Headers

{
"balance": "190227417",
"wallet_type": "wallet v4 r2",
"seqno": 910,
"wallet_id": 698983191,
"last_transaction_lt": "50159798000003",
"last_transaction_hash": "W9K5xarl6NVcmi4VRLse8QwBYZ4BrIiHbY/2axCP5qE=",
"status": "active"
}

@Re2906
Copy link
Author

Re2906 commented Oct 29, 2024

import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;

public class QueryParserTest {

    @Test
    public void testQueryParser() {
        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);
    }
}

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