Package com.jelurida.ardor.contracts
Class ChildToParentExchange
Sample contract which receives amount in child chain and returns amount in parent chain according to the coin exchange
order book.
It enables users to exchange child coins to ARDR without first having ARDR in the account which is a major limitation.
The contract demonstrates two different callbacks.
processTransaction - activated by a transaction with trigger message
processRequest - simulates the operation of the contract without actually receiving or submitting transactions
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic interface -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprocessRequest(RequestContext context) Simulate the process, given amount and chain, calculate how much will be returnedprocessTransaction(TransactionContext context) Methods inherited from class nxt.addons.AbstractContract
isDuplicate, processBlock, processInvocation, 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
-
ChildToParentExchange
public ChildToParentExchange()
-
-
Method Details
-
processTransaction
- Specified by:
processTransactionin interfaceContract<Object,Object> - Overrides:
processTransactionin classAbstractContract<Object,Object>
-
processRequest
Simulate the process, given amount and chain, calculate how much will be returned- Specified by:
processRequestin interfaceContract<Object,Object> - Overrides:
processRequestin classAbstractContract<Object,Object> - Parameters:
context- contract context
-