Package foundation.icon.xcall
Interface Connection
-
public interface Connection
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.math.BigIntegergetFee(java.lang.String _to, boolean _response)Gets the fee to the target network _response should be true if it uses positive value for _sn ofsendMessage(java.lang.String, java.lang.String, java.math.BigInteger, byte[]).java.math.BigIntegersendMessage(java.lang.String _to, java.lang.String _svc, java.math.BigInteger _sn, byte[] _msg)Sends the message to a specific network.
-
-
-
Method Detail
-
sendMessage
java.math.BigInteger sendMessage(java.lang.String _to, java.lang.String _svc, java.math.BigInteger _sn, byte[] _msg)Sends the message to a specific network. Only allowed to be called by registered BSHs. _sn : positive for two-way message, zero for one-way message, negative for response- Parameters:
_to- String ( Network Address of destination network )_svc- String ( name of the service )_sn- Integer ( serial number of the message )_msg- Bytes ( serialized bytes of Service Message )- Returns:
- Integer ( network serial number of message )
-
getFee
java.math.BigInteger getFee(java.lang.String _to, boolean _response)Gets the fee to the target network _response should be true if it uses positive value for _sn ofsendMessage(java.lang.String, java.lang.String, java.math.BigInteger, byte[]). If _to is not reachable, then it reverts. If _to does not exist in the fee table, then it returns zero.- Parameters:
_to- String ( BTP Network Address of the destination BMC )_response- Boolean ( Whether the responding fee is included )- Returns:
- Integer (The fee of sending a message to a given destination network )
-
-