Skip to content

Try to use @aptos-labs/ts-sdk for getting view function from mainnet contract and got an Error #513

Answered by 0xmaayan
wocaatm asked this question in Questions
Discussion options

You must be logged in to vote

Hey @wocaatm , looking at the contract on the Explorer the first 2 arguments are of type Object which mean the input should be an address.

The AptosCoin FA address is 0xa, BUT because you are trying to use Cellana Finance contract, they use a different AptosCoin FA address which is 0xedc2704f2cef417a06d1756a04a16a9fa6faaed13af469be9cdfcac5a21a8e2e.

This should work:

payload: {
   function: '0x4bf51972879e3b95c4781a5cdcb9e1ee24ef483e7d22f2d903626f126df62bd1::liquidity_pool::liquidity_pool',
   functionArguments: [
      "0xedc2704f2cef417a06d1756a04a16a9fa6faaed13af469be9cdfcac5a21a8e2e",
      "0x2ebb2ccac5e027a87fa0e2e5f656a3a4238d6a48d93ec9b610d570fc0aa0df12",
      "false"
   ],
}

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by 0xmaayan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants