2

I want to obtain in my smart contract the list of keys for a specific user. On RPC, I would do it like this:

curl --location --request POST 'https://rpc.mainnet.near.org/' \
--header 'Content-Type: application/json' \
--data-raw '{
  "jsonrpc": "2.0",
  "id": "dontcare",
  "method": "query",
  "params": {
    "request_type": "view_access_key_list",
    "finality": "final",
    "account_id": "account.near"
  }
}'

What is the near-sdk-rs equivalent of this?

I know if I wanted to create keys, I'd use Promise::new(...).add_access_key(...). But I can't find any read operations here (and it wouldn't really make sense to use a Promise for a read anyways).

But surely it must be accessible to smart contracts, if it's accessible to the protocol. What am I missing?

tituszban
  • 4,797
  • 2
  • 19
  • 30

0 Answers0