> For the complete documentation index, see [llms.txt](https://wiki.ternoa.network/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wiki.ternoa.network/build/sdk-javascript/quickstart.md).

# Quickstart

An API instance must be initialize using the *initializeApi* function in **ternoa-js/blockchain** before calling some SDK functions. The default chain endpoint is:&#x20;

`DEFAULT_CHAIN_ENDPOINT = "wss://alphanet.ternoa.com"`.

It can be modified by passing a new endpoint as a parameter to the *initializeApi* function.

Functions are organized by theme. In the example below, the import of *generateSeed* and *getKeyringFromSeed* from the subpath **ternoa-js/account** allows us to generate a new account and display its address.

```typescript
import { generateSeed, getKeyringFromSeed } from "ternoa-js/account";

(async () => {
  const account = await generateSeed()
  const keyring = await getKeyringFromSeed(account.seed)
  const address = keyring.address
  console.log("Your fresh public address is: ", address)
})().catch((e) => {
  console.log(e)
})
```

Among all the features provided by the Ternoa SDK, this short snippet of code allows you to create an NFT, submit and sign it at a glance.

This single line ***createNft*** function, require a few parameters :&#x20;

* some `offchainData` metadatas,
* a `royalty`,
* a `collectionId`

&#x20;if you want this NFT to belong to a collection, a boolean to define its `isSoulbound` status, the `keyring` to sign and submit the transaction, and a `waitUntil` callback parameter, to define at which point we want to get the results of the transaction execution.

```typescript
import { createNft } from "ternoa-js/nft"
import { generateSeed, getKeyringFromSeed } from "ternoa-js/account"

const createMyFirstNFT = async () => {
  try {
    // We initialize an API instance connected to the Alphanet chain
    await initializeApi()

    // Here we create, sign and submit the NFT transaction with your keyring
    await createNft("My first NFT", 10, undefined, false, keyring, WaitUntil.BlockInclusion)
  } catch (e) {
    console.log(e)
  }
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://wiki.ternoa.network/build/sdk-javascript/quickstart.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
