Griptape.js
  • What is Griptape.js?
  • 🛹Getting Started
  • 🚀Bootstrapping Your App
  • 🗞️Interacting with Contracts
    • Contract Definitions
      • More on Definitions
    • Creating Contract Clients
    • Built-In Definitions
    • Extending Contract Definitions
    • Contract Registry
    • Instantiating Contracts
  • 🔑Using Viewing Keys and Permits
    • Using the viewing key manager
    • Using Keplr with Griptape
    • Managing Permits
  • 🕢Handling Events
  • ⚒️Using Utilities
  • 🔀API Reference
    • Bootstrap
    • Contracts
    • Viewing Keys
    • Permits
    • Events
    • Utilities
  • 🐝Tricks Tutorials
    • React Tutorials
      • Hello, Griptape
      • Hello, Contracts
      • Hello, Events
      • Hello, Viewing Keys
      • Hello, Permits
      • Hello, Transactions
      • Hello, Mint
    • Vue Tutorials
      • Hello, Griptape
      • Hello, Contracts
      • Hello, Events
      • Hello, Viewing Keys
      • Hello, Permits
      • Hello, Transactions
      • Hello, Mint
  • 💾Hackathon
    • Welcome Packet
    • Getting Set Up
    • Glossary
Powered by GitBook
On this page
  • KeplrViewingKeyManager
  • add(BaseContract)
  • get(string)
  • ViewingKeyManager
  • add(BaseContract, string)
  • get(string)
  • set(BaseContract, string)
  1. API Reference

Viewing Keys

PreviousContractsNextPermits

Last updated 3 years ago

KeplrViewingKeyManager

add()

Arguments:

  • {}: a contract specification object.

Returns: {string} : key.

Description: This functiona ads a new viewing key by using the suggestToken API from Keplr.

get(string)

Arguments:

  • {string}: contract id or address.

Returns: {object} : key.

Description: Get a viewing key. This function calls viewingKeyManager API from GriptapeJS.

ViewingKeyManager

add(, string)

Arguments:

  • {string} : a key.

Returns: {string} : key value.

Description: This function checks that a key exists, if not it throws the error ''Empty or undefined key cannot be added'' and ends. If there is a key it gets the account, if there is no account it throws the 'No account available' error, but if there is an account it adds the key to local storage.

get(string)

Arguments: {string} : contract id or address.

Returns: {string} : key value.

Usage: This function gets the key for the received address or id.

Arguments:

  • {string}: a key.

Returns: Nothing.

Description: This function updates in the local storage the received key for the corresponding account.

{}: a contract specification object

set(, string)

{}: a contract specification object

🔀
BaseContract
BaseContract
BaseContract
BaseContract
BaseContract
BaseContract