forked from icon-project/devportal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIBMCPeriphery.sol
54 lines (48 loc) · 1.81 KB
/
IBMCPeriphery.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// SPDX-License-Identifier: Apache-2.0
pragma solidity >=0.5.0 <0.8.0;
pragma experimental ABIEncoderV2;
import "../libraries/TypesLib.sol";
interface IBMCPeriphery {
/**
@notice Get BMC BTP address
*/
function getBmcBtpAddress() external view returns (string memory);
/**
@notice BSH contract sends a request to add its service name and contract address to BMC
@param _serviceName Service name of BSH contract
@param _addr Address of BSH contract
*/
function requestAddService(string memory _serviceName, address _addr)
external;
/**
@notice Verify and decode RelayMessage with BMV, and dispatch BTP Messages to registered BSHs
@dev Caller must be a registered relayer.
@param _prev BTP Address of the BMC generates the message
@param _msg base64 encoded string of serialized bytes of Relay Message refer RelayMessage structure
*/
function handleRelayMessage(string calldata _prev, string calldata _msg)
external;
/**
@notice Send the message to a specific network.
@dev Caller must be an registered BSH.
@param _to Network Address of destination network
@param _svc Name of the service
@param _sn Serial number of the message, it should be positive
@param _msg Serialized bytes of Service Message
*/
function sendMessage(
string calldata _to,
string calldata _svc,
uint256 _sn,
bytes calldata _msg
) external;
/*
@notice Get status of BMC.
@param _link BTP Address of the connected BMC
@return _linkStats The link status
*/
function getStatus(string calldata _link)
external
view
returns (Types.LinkStats memory _linkStats);
}