Search in sources :

Example 21 with Account

use of org.xel.Account in project elastic-core-maven by OrdinaryDude.

the class ParameterParser method getSenderAccount.

public static Account getSenderAccount(HttpServletRequest req) throws ParameterException {
    byte[] publicKey = getPublicKey(req);
    Account account = Account.getAccount(publicKey);
    if (account == null) {
        throw new ParameterException(UNKNOWN_ACCOUNT);
    }
    return account;
}
Also used : Account(org.xel.Account)

Example 22 with Account

use of org.xel.Account in project elastic-core-maven by OrdinaryDude.

the class SendMessage method processRequest.

@Override
protected JSONStreamAware processRequest(HttpServletRequest req) throws NxtException {
    long recipientId = ParameterParser.getAccountId(req, "recipient", false);
    Account account = ParameterParser.getSenderAccount(req);
    return createTransaction(req, account, recipientId, 0, Attachment.ARBITRARY_MESSAGE);
}
Also used : Account(org.xel.Account)

Aggregations

Account (org.xel.Account)22 JSONObject (org.json.simple.JSONObject)8 Attachment (org.xel.Attachment)8 JSONArray (org.json.simple.JSONArray)5 Transaction (org.xel.Transaction)3 ArrayList (java.util.ArrayList)2 TreeSet (java.util.TreeSet)1 PollBuilder (org.xel.Attachment.MessagingPollCreation.PollBuilder)1 Block (org.xel.Block)1 Generator (org.xel.Generator)1 PhasingParams (org.xel.PhasingParams)1 PhasingPoll (org.xel.PhasingPoll)1 Poll (org.xel.Poll)1 TaggedData (org.xel.TaggedData)1