com.jelurida.ardor.contracts

## Class ChildToParentExchange

- java.lang.Object
- - nxt.addons.AbstractContract
  - - com.jelurida.ardor.contracts.ChildToParentExchange

- All Implemented Interfaces:
    Contract

      public class ChildToParentExchange
      extends AbstractContract

  Sample contract which receives amount in child chain and returns amount in parent chain according to the coin exchange order book. It let's you to exchange child coins to ARDR without first having ARDR in the account which was a major limitation. The contract demonstrates 3 different callbacks. processTransaction - activated by a transaction with trigger message processBlock - scans the transaction in a block and when finding one which matches the criteria performs the exchange processRequest - simulates the operation of the contract without actually receiving or submitting transactions

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `ChildToParentExchange.CoinExchangeOrders`
    `static interface` | `ChildToParentExchange.Params`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ChildToParentExchange()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `JO` | `processBlock(BlockContext context)`
    `JO` | `processRequest(RequestContext context)` Simulate the process, given amount and chain, calculate how much will be returned
    `JO` | `processTransaction(TransactionContext context)`

    - ### Methods inherited from class nxt.addons.AbstractContract

      `isDuplicate, processInvocation, processVoucher`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface nxt.addons.Contract

      `minProductVersion`

- - ### Constructor Detail

    - #### ChildToParentExchange

          public ChildToParentExchange()

  - ### Method Detail

    - #### processBlock

          public JO processBlock(BlockContext context)

      Specified by:
        `processBlock` in interface `Contract`
      Overrides:
        `processBlock` in class `AbstractContract`

    - #### processTransaction

          public JO processTransaction(TransactionContext context)

      Specified by:
        `processTransaction` in interface `Contract`
      Overrides:
        `processTransaction` in class `AbstractContract`

    - #### processRequest

          public JO processRequest(RequestContext context)

      Simulate the process, given amount and chain, calculate how much will be returned
      Specified by:
        `processRequest` in interface `Contract`
      Overrides:
        `processRequest` in class `AbstractContract`
      Parameters:
        `context` - contract context