Package com.jelurida.ardor.contracts
Class HelloWorldForwarder
java.lang.Object
nxt.addons.AbstractContract
com.jelurida.ardor.contracts.HelloWorldForwarder
- All Implemented Interfaces:
Contract
Sample contract to demonstrate basic operations.
To trigger the contract, send a message transaction or transaction with attached message, set the recipient to the
contract runner account, set the message text to the following json:
{"contract":"HelloWorld", "params": { "recipientAccount": "[RS account address]", "greeting": { "message": "Hi"}}}
In response the contract will send a message transaction to the "recipientAccount" specified by the sender in the
attached message with text specified by the greeting.
Note the recipientAccount and greeting variables, the value of these variables is automatically assigned in runtime
based on the parameters specified in the attached message of the trigger transaction.
Note the validation annotations which validate the recipient, chain and transaction type
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprocessTransaction(TransactionContext context) Invoked when the trigger transaction is included in a blockMethods inherited from class nxt.addons.AbstractContract
isDuplicate, processBlock, processInvocation, processRequest, processVoucherMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface nxt.addons.Contract
init, minProductVersion, shutdown
-
Constructor Details
-
HelloWorldForwarder
public HelloWorldForwarder()
-
-
Method Details
-
processTransaction
Invoked when the trigger transaction is included in a block- Specified by:
processTransactionin interfaceContract- Overrides:
processTransactionin classAbstractContract- Parameters:
context- the transaction context
-