Near Protocol Contract

Contract Address
Here to get MAPO mainnet and testnet MCS contract address.
Contract interface
Interact with contract interface
transfer_in
Transfer from Mapo to Near based on the proof data and event. Must attach enough NEAR funds to cover for storage of the proof.
input parameters
receipt_proof
ReceiptProof
the proof of one receipt
index
usize
the index of event among all the events in the receipt
transfer_out_token
Transfer out tokens to other blockchain.
input parameters
token
String
NEAR account of the mcs token contract
to
Vec
the target account address on target blockchain
amount
U128
the amount of token to transfer out
to_chain
u128
the chain id of target blockchain
transfer_out_native
Transfer out native token to other blockchain.
input parameters
to
Vec
the target account address on target blockchain
to_chain
u128
the chain id of target blockchain
deposit_out_native
Deposit out native token to MAP blockchain.
input parameters
to
Vec
the target account address on MAP blockchain
Management Interface
init
Initialize the contract with configuration parameters.
input parameters
map_light_client
String
NEAR account of the MAP light client contract
map_bridge_address
String
the address of the MCS contract on MAP blockchain, in hex
wrapped_token
String
NEAR account of the wrap near contract
near_chain_id
u128
the chain id of the near blockchain
version
Get the version info of the current MCS contract.
deploy_mcs_token
Deploy MCS token contract. The deployed token can be minted/burnt by MCS contract.
input parameters
name
String
the name of MCS token, the full address of the token will be .
is_used_event
Check if the event is ussed or not.
input parameters
order_id
&CryptoHash
the order id of the event
output parameters
bool
true if the event is already used, false otherwise
set_metadata
Get the record information( validators, threshold and epoch) for the epecified epoch.
input parameters
address
String
the contract address of the MCS token
name
Option
the human-readable name of the token
symbol
Option
the abbreviation, like wETH or AMPL
reference
Option
a link to a valid JSON file containing various keys offering supplementary details on the token
reference_hash
Option
the base64-encoded sha256 hash of the JSON file contained in the reference field
decimals
Option
used in frontends to show the proper significant digits of a token
icon
Option
a small image associated with this token
controller
Get the controller of the MCS contract.
output parameters
Option
the controller account id of the MCS contract
set_controller
Set the controller of the MCS contract.
input parameters
controller
AccountId
the controller account id of the MCS contract
controller_or_self
Check if the predecessor is controller or self.
output parameters
bool
true if the predecessor is controller or self, false otherwise
get_mcs_tokens
Get all deployed MCS tokens and their target chains.
output parameters
Vec<(String, HashSet)>
deployed MCS tokens and their target chains
get_fungible_tokens
Get all registered fungible tokens and their target chains.
output parameters
Vec<(String, HashSet)>
registered fungible tokens and their target chains
get_native_token_to_chains
Get all registered native token target chains.
output parameters
HashSet
registered native token target chains
add_native_to_chain
Add target chain for native token.
input parameters
to_chain
u128
target chain id
remove_native_to_chain
Remove target chain for native token.
input parameters
to_chain
u128
target chain id
add_mcs_token_to_chain
Allow the MCS token to be transfered to the target chain.
input parameters
token
String
MCS token address
to_chain
u128
target chain id
remove_mcs_token_to_chain
Remove the target chain id from the allow list of the MCS token.
input parameters
token
String
MCS token address
to_chain
u128
target chain id
valid_mcs_token_out
Check if the MCS token is allowed to be transfered to the target chain.
input parameters
token
&String
MCS token address
to_chain
u128
target chain id
output parameters
bool
true if target chain is allowed, false otherwise
add_fungible_token_to_chain
Allow the fungible token to be transfered to the target chain.
input parameters
token
String
fungible token address
to_chain
u128
target chain id
remove_fungible_token_to_chain
Remove the target chain id from the allow list of the fungible token.
input parameters
token
String
fungible token address
to_chain
u128
target chain id
valid_fungible_token_out
Check if the fungible token is allowed to be transfered to the target chain.
input parameters
token
&String
MCS token address
to_chain
u128
target chain id
output parameters
bool
true if target chain is allowed, false otherwise
Data structure
Here are some main data structure for map light client contract.
MapCrossChainService is the map cross chain service contract.
ReceiptProof includes the proof and the receipt to prove.
Last updated
Was this helpful?