Skip to main content

Web Frontend - NEAR API JS

The NEAR API JS provides various methods and functionalities for interacting with smart contracts, retrieving account information, sending transactions, and more.

info

You can refer to the NEAR API JS documentation for detailed information on how to use the available methods and interact with the Calimero network.

Create a new Private Shard API key

  • Generate a new token in the Calimero console dashboard. Follow the steps provided here.
  • Copy your API key somewhere safe for security reasons. The API key will only be shown to you once. Make sure to store it securely, as it cannot be retrieved or restored.

Initialize the connection with the private shard

Create a new ConnectConfig with the following parameters and initialize the connection.

const connectionConfig = {
networkId: shardId,
keyStore: myKeyStore,
nodeUrl: "https://api-testnet.calimero.network/api/v1/shards/xabi/neard-rpc/",
headers: {
"x-api-key" : TOKEN
}
};

const near = await connect({ ...config, keyStore });