illus --> Is there any way I can get other return types than Promise through cross-contract-call?
Benji | NEAR --> Iām a solid 80% sure that you can only use promises. <@!austinabell> can u give a more definitive answer haha. In docs, it says NEAR introduced promises to make devās lives easier but does that mean promises are the only way to deal with cross-contract calls?
illus --> Itās too complex even get result of other contractās getter functionā¦
austinabell --> Do you mean like the return type from the function you are calling? If so, you canāt and the reason is because that function call is not done within the current execution and is happening later (usually next block) so you canāt use a value that may or may not succeed in the future.
Generally the pattern for following up with this data is with callbacks, which essentially uses this data from this future computation and continues to execute with the resolved value you want. Unfortunately breaking up the logic into pieces like this is the only way to handle this asynchronous execution, but hopefully in the future we can abstract over this š
See some docs on callbacks here: https://www.near-sdk.io/cross-contract/callbacks