Complex Cross Contract Call
This example presents 3 instances of complex cross-contract calls. Particularly, it shows:
- How to batch multiple function calls to a same contract.
- How to call multiple contracts in parallel, each returning a different type.
- Different ways of handling the responses in the callback.
Simple Cross-Contract Calls
Check the tutorial on how to use simple cross-contract calls
Obtaining the Cross Contract Call Exampleโ
You have two options to start the Donation Example:
- You can use the app through
Github Codespaces
, which will open a web-based interactive environment. - Clone the repository locally and use it from your computer.
Codespaces | Clone locally |
---|---|
๐ https://github.com/near-examples/cross-contract-calls |
Structure of the Exampleโ
The smart contract is available in two flavors: Rust and JavaScript
- ๐ JavaScript
- ๐ฆ Rust
โโโ sandbox-ts # sandbox testing
โ โโโ external-contracts
โ โ โโโ counter.wasm
โ โ โโโ guest-book.wasm
โ โ โโโ hello-near.wasm
โ โโโ main.ava.ts
โโโ src # contract's code
โ โโโ internal
โ โ โโโ batch_actions.ts
โ โ โโโ constants.ts
โ โ โโโ multiple_contracts.ts
โ โ โโโ similar_contracts.ts
โ โ โโโ utils.ts