content: /*
   * Copyright 2023 Ant Group
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *     http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  
  package com.alipay.antchain.bridge.plugins.spi.bbc.core.write;
  
  import com.alipay.antchain.bridge.commons.core.base.CrossChainMessageReceipt;
  
  /**
   * We can write antchain-bridge data to blockchain through
   * {@code IAntChainBridgeDataWriter}.
   *
   * <p>
   *     AntChainBridge data is the data generated by the AntChainBridge
   *     system during the cross-chain process. For example,
   *     the relayer relays cross-chain message from sender chain
   *     to receiver chain and the message is a kind of antchain-bridge data.
   *     Mostly, {@code IAntChainBridgeDataWriter} instance send the antchain-bridge data
   *     by sending transactions through blockchain SDK.
   * </p>
   *
   * <p>
   *     All types of antchain-bridge data can be found in project {@code antchain-bridge-commons}.
   * </p>
   *
   * <p>
   *     All {@code IAntChainBridgeDataWriter} functions are split into multiple
   *     interfaces like {@link IAMWriter}, {@link ISDPWriter}.
   * </p>
   */
  public interface IAntChainBridgeDataWriter extends IAMWriter, ISDPWriter {
  
      /**
       * Set up the AuthMessage contract.
       *
       * <p>
       *     This method would prepare the {@code AuthMessage} contract
       *     before blockchain ready to cross-chain. Every blockchain
       *     instance which join the cross-chain network would deploy
       *     an unique {@code AuthMessage} contract.
       * </p>
       */
      void setupAuthMessageContract();
  
      /**
       * Set up the SDP message contract.
       *
       * <p>
       *     This method would prepare the SDP message contract
       *     before blockchain ready to cross-chain. And {@code AuthMessage} Contract
       *     is supposed to be ready before calling this method.
       * </p>
       */
      void setupSDPMessageContract();
  
      /**
       * Set up the PTC contracts. For example PTCHub and its verify contracts
       */
      void setupPTCContract();
  
      /**
       * 提交链下异常消息
       * @param exceptionMsgAuthor    异常跨链消息原发送合约
       * @param exceptionMsgPkg       异常跨链消息原文（SDP消息序列化）
       * @return
       */
      CrossChainMessageReceipt recvOffChainException(String exceptionMsgAuthor, byte[] exceptionMsgPkg);
  }
  