Skip to content

Commit 3bb3180

Browse files
committed
Update idl file
1 parent 9bc7f36 commit 3bb3180

File tree

1 file changed

+16
-37
lines changed

1 file changed

+16
-37
lines changed

api/gear/bridging_payment.idl

Lines changed: 16 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,45 @@
1-
/// Config usd for Bridging Payment service initialization.
2-
type InitConfig = struct {
3-
/// Admin of this service. For detailed description see [State::admin_address].
1+
/// Global state of the Bridging Payment service.
2+
type State = struct {
3+
/// Admin of this service. Admin is in charge of:
4+
/// - Changing fee
5+
/// - Withdrawing collected fees from the program address
6+
/// - Updating [Config] of this service
47
admin_address: actor_id,
5-
/// Address of the `vft-manager` where bridging request will be sent.
6-
vft_manager_address: actor_id,
7-
/// [Config] that will be initially set for this service.
8-
config: Config,
9-
};
10-
11-
/// Config of the Bridging Payment service.
12-
type Config = struct {
138
/// Fee that will be taken from all the incoming bridging requests.
149
fee: u128,
15-
/// Gas that will be reserved for reply processing.
16-
gas_for_reply_deposit: u64,
17-
/// Gas that will be attached to a message to the `vft-manager`.
18-
gas_to_send_request_to_vft_manager: u64,
19-
/// Reply timeout that will be applied to a message to the `vft-manager`.
20-
reply_timeout: u32,
21-
/// Gas that's required to process `make_request` logic.
22-
gas_for_request_to_vft_manager_msg: u64,
2310
};
2411

2512
constructor {
2613
/// Create Bridging Payment program.
27-
New : (init_config: InitConfig);
14+
New : (initial_state: State);
2815
};
2916

3017
service BridgingPayment {
31-
/// Send request to the underlying `vft-manager` program.
18+
/// Pay fees for message processing to the relayer.
3219
///
33-
/// This method will take additional fee from the message sender, so **exactly** [Config::fee] must
20+
/// This method requires that **exactly** [Config::fee] must
3421
/// be attached as a value when sending message to this method.
3522
///
3623
/// Current fee amount can be retreived by calling `get_config`.
37-
MakeRequest : (amount: u256, receiver: h160, vara_token_id: actor_id) -> null;
24+
PayFees : (nonce: u256) -> null;
3825
/// Withdraw fees that were collected from user requests.
3926
///
4027
/// This method can be called only by admin.
4128
ReclaimFee : () -> null;
42-
/// Set new config.
29+
/// Set new admin.
4330
///
4431
/// This method can be called only by admin.
45-
SetConfig : (config: Config) -> null;
32+
SetAdmin : (new_admin: actor_id) -> null;
4633
/// Set fee that this program will take from incoming requests.
4734
///
4835
/// This method can be called only by admin.
4936
SetFee : (fee: u128) -> null;
50-
/// Set new `vft-manager` address.
51-
///
52-
/// This method can be called only by admin.
53-
UpdateVftManagerAddress : (new_vft_manager_address: actor_id) -> null;
54-
/// Get admin address.
55-
query AdminAddress : () -> actor_id;
56-
/// Get currently applied [Config].
57-
query GetConfig : () -> Config;
58-
/// Get `vft-manager` address.
59-
query VftManagerAddress : () -> actor_id;
37+
/// Get current service [State].
38+
query GetState : () -> State;
6039

6140
events {
62-
/// Bridging of tokens from Gear to Ethereum is requested successfully.
63-
TeleportVaraToEth: struct { nonce: u256, sender: actor_id, amount: u256, receiver: h160, eth_token_id: h160 };
41+
/// Fee for the message processing by relayer was paid.
42+
BridgingPaid: struct { nonce: u256 };
6443
}
6544
};
6645

0 commit comments

Comments
 (0)