Cross-Contract Calls
Your contract can interact with other deployed contracts, querying information and executing functions on them.
Since NEAR is a sharded blockchain, its cross-contract calls behave differently than calls do in other chains. In NEAR. cross-contract calls are asynchronous and independent.
You will need two independent functions: one to make the call, and another to receive the result
There is a delay between the call and the callback execution, usually of 1 or 2 blocks. During this time, the contract is still active and can receive other calls.
Snippet: Querying Information
While making your contract, it is likely that you will want to query information from another contract. Below, you can see a basic example in which we query the greeting message from our Hello NEAR example.
- 🌐 Javascript
- 🦀 Rust
Loading...