Module 0xa5::events
use 0x1::ascii;
use 0x1::string;
use 0x2::address;
use 0x2::event;
use 0x2::hash;
use 0xa1::bytes32;
use 0xa5::token_id;
Struct CoinRegistered
struct CoinRegistered<T> has copy, drop
Fields
-
token_id: token_id::TokenId
-
Struct InterchainTransfer
struct InterchainTransfer<T> has copy, drop
Fields
-
token_id: token_id::TokenId
-
-
source_address: address
-
-
destination_chain: ascii::String
-
-
destination_address: vector<u8>
-
-
amount: u64
-
-
data_hash: bytes32::Bytes32
-
Struct InterchainTokenDeploymentStarted
struct InterchainTokenDeploymentStarted<T> has copy, drop
Fields
-
token_id: token_id::TokenId
-
-
name: string::String
-
-
symbol: ascii::String
-
-
decimals: u8
-
-
destination_chain: ascii::String
-
Struct InterchainTransferReceived
struct InterchainTransferReceived<T> has copy, drop
Fields
-
message_id: ascii::String
-
-
token_id: token_id::TokenId
-
-
source_chain: ascii::String
-
-
source_address: vector<u8>
-
-
destination_address: address
-
-
amount: u64
-
-
data_hash: bytes32::Bytes32
-
Struct UnregisteredCoinReceived
struct UnregisteredCoinReceived<T> has copy, drop
Fields
-
token_id: token_id::UnregisteredTokenId
-
-
symbol: ascii::String
-
-
decimals: u8
-
Struct TrustedAddressSet
struct TrustedAddressSet has copy, drop
Fields
-
chain_name: ascii::String
-
-
trusted_address: ascii::String
-
Struct TrustedAddressRemoved
struct TrustedAddressRemoved has copy, drop
Fields
-
chain_name: ascii::String
-
Struct FlowLimitSet
struct FlowLimitSet<T> has copy, drop
Fields
-
token_id: token_id::TokenId
-
-
flow_limit: u64
-
Function coin_registered
public(friend) fun coin_registered<T>(token_id: token_id::TokenId)
Implementation
public(package) fun coin_registered<T>(token_id: TokenId) {
event::emit(CoinRegistered<T> {
token_id,
});
}
Function interchain_transfer
public(friend) fun interchain_transfer<T>(token_id: token_id::TokenId, source_address: address, destination_chain: ascii::String, destination_address: vector<u8>, amount: u64, data: &vector<u8>)
Implementation
public(package) fun interchain_transfer<T>(
token_id: TokenId,
source_address: address,
destination_chain: String,
destination_address: vector<u8>,
amount: u64,
data: &vector<u8>,
) {
let data_hash = if (data.length() == 0) {
bytes32::new(@0x0)
} else {
bytes32::new(address::from_bytes(keccak256(data)))
};
event::emit(InterchainTransfer<T> {
token_id,
source_address,
destination_chain,
destination_address,
amount,
data_hash,
});
}
Function interchain_token_deployment_started
public(friend) fun interchain_token_deployment_started<T>(token_id: token_id::TokenId, name: string::String, symbol: ascii::String, decimals: u8, destination_chain: ascii::String)
Implementation
public(package) fun interchain_token_deployment_started<T>(
token_id: TokenId,
name: string::String,
symbol: String,
decimals: u8,
destination_chain: String,
) {
event::emit(InterchainTokenDeploymentStarted<T> {
token_id,
name,
symbol,
decimals,
destination_chain,
});
}
Function interchain_transfer_received
public(friend) fun interchain_transfer_received<T>(message_id: ascii::String, token_id: token_id::TokenId, source_chain: ascii::String, source_address: vector<u8>, destination_address: address, amount: u64, data: &vector<u8>)
Implementation
public(package) fun interchain_transfer_received<T>(
message_id: String,
token_id: TokenId,
source_chain: String,
source_address: vector<u8>,
destination_address: address,
amount: u64,
data: &vector<u8>,
) {
let data_hash = bytes32::new(address::from_bytes(keccak256(data)));
event::emit(InterchainTransferReceived<T> {
message_id,
token_id,
source_chain,
source_address,
destination_address,
amount,
data_hash,
});
}
Function unregistered_coin_received
public(friend) fun unregistered_coin_received<T>(token_id: token_id::UnregisteredTokenId, symbol: ascii::String, decimals: u8)
Implementation
public(package) fun unregistered_coin_received<T>(
token_id: UnregisteredTokenId,
symbol: String,
decimals: u8,
) {
event::emit(UnregisteredCoinReceived<T> {
token_id,
symbol,
decimals,
});
}
Function trusted_address_set
public(friend) fun trusted_address_set(chain_name: ascii::String, trusted_address: ascii::String)
Implementation
public(package) fun trusted_address_set(
chain_name: String,
trusted_address: String,
) {
event::emit(TrustedAddressSet {
chain_name,
trusted_address,
});
}
Function trusted_address_removed
public(friend) fun trusted_address_removed(chain_name: ascii::String)
Implementation
public(package) fun trusted_address_removed(chain_name: String) {
event::emit(TrustedAddressRemoved {
chain_name,
});
}
Function flow_limit_set
public(friend) fun flow_limit_set<T>(token_id: token_id::TokenId, flow_limit: u64)
Implementation
public(package) fun flow_limit_set<T>(token_id: TokenId, flow_limit: u64) {
event::emit(FlowLimitSet<T> {
token_id,
flow_limit,
});
}