Near Protocol Contract
Last updated
Last updated
Here to get MAPO mainnet and testnet MCS contract address.
Transfer from Mapo to Near based on the proof data and event. Must attach enough NEAR funds to cover for storage of the proof.
parameter | type | comment |
---|---|---|
receipt_proof | ReceiptProof | the proof of one receipt |
index | usize | the index of event among all the events in the receipt |
Transfer out tokens to other blockchain.
parameter | type | comment |
---|---|---|
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 token to other blockchain.
parameter | type | comment |
---|---|---|
to | Vec | the target account address on target blockchain |
to_chain | u128 | the chain id of target blockchain |
Deposit out native token to MAP blockchain.
parameter | type | comment |
---|---|---|
to | Vec | the target account address on MAP blockchain |
Initialize the contract with configuration parameters.
parameter | type | comment |
---|---|---|
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 |
Get the version info of the current MCS contract.
Deploy MCS token contract. The deployed token can be minted/burnt by MCS contract.
parameter | type | comment |
---|---|---|
name | String | the name of MCS token, the full address of the token will be . |
Check if the event is ussed or not.
parameter | type | comment |
---|---|---|
order_id | &CryptoHash | the order id of the event |
type | comment |
---|---|
bool | true if the event is already used, false otherwise |
Get the record information( validators, threshold and epoch) for the epecified epoch.
parameter | type | comment |
---|---|---|
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 |
Get the controller of the MCS contract.
type | comment |
---|---|
Option | the controller account id of the MCS contract |
Set the controller of the MCS contract.
parameter | type | comment |
---|---|---|
controller | AccountId | the controller account id of the MCS contract |
Check if the predecessor is controller or self.
type | comment |
---|---|
bool | true if the predecessor is controller or self, false otherwise |
Get all deployed MCS tokens and their target chains.
type | comment |
---|---|
Vec<(String, HashSet)> | deployed MCS tokens and their target chains |
Get all registered fungible tokens and their target chains.
type | comment |
---|---|
Vec<(String, HashSet)> | registered fungible tokens and their target chains |
Get all registered native token target chains.
type | comment |
---|---|
HashSet | registered native token target chains |
Add target chain for native token.
parameter | type | comment |
---|---|---|
to_chain | u128 | target chain id |
Remove target chain for native token.
parameter | type | comment |
---|---|---|
to_chain | u128 | target chain id |
Allow the MCS token to be transfered to the target chain.
parameter | type | comment |
---|---|---|
token | String | MCS token address |
to_chain | u128 | target chain id |
Remove the target chain id from the allow list of the MCS token.
parameter | type | comment |
---|---|---|
token | String | MCS token address |
to_chain | u128 | target chain id |
Check if the MCS token is allowed to be transfered to the target chain.
parameter | type | comment |
---|---|---|
token | &String | MCS token address |
to_chain | u128 | target chain id |
type | comment |
---|---|
bool | true if target chain is allowed, false otherwise |
Allow the fungible token to be transfered to the target chain.
parameter | type | comment |
---|---|---|
token | String | fungible token address |
to_chain | u128 | target chain id |
Remove the target chain id from the allow list of the fungible token.
parameter | type | comment |
---|---|---|
token | String | fungible token address |
to_chain | u128 | target chain id |
Check if the fungible token is allowed to be transfered to the target chain.
parameter | type | comment |
---|---|---|
token | &String | MCS token address |
to_chain | u128 | target chain id |
type | comment |
---|---|
bool | true if target chain is allowed, false otherwise |
MapCrossChainService is the map cross chain service contract.
ReceiptProof includes the proof and the receipt to prove.