# Examples

## Create NFT Schema

```go
// Read JSON data from file
jsonData, err := ioutil.ReadFile("schema.json")
if err != nil {
	fmt.Println(err)
	return
}

// Decode JSON data into a map[string]interface{} variable
var data map[string]interface{}
err = json.Unmarshal(jsonData, &data)
if err != nil {
	fmt.Println(err)
	return
}

// Encode the JSON data as a base64 string
base64Data := base64.StdEncoding.EncodeToString(jsonData)

msg := &nftmngrtypes.MsgCreateNFTSchema{
	Creator:         client.ConnectedAddress,
	NftSchemaBase64: base64Data,
}
txResponse, err := client.GenerateOrBroadcastTx(msg)
if err != nil {
	fmt.Println(err)
	return
}
```

## Create NFT Metadata

```go
// Read JSON data from file
jsonData, err := ioutil.ReadFile("metadata.json")
if err != nil {
	fmt.Println(err)
	return
}

// Decode JSON data into a map[string]interface{} variable
var data map[string]interface{}
err = json.Unmarshal(jsonData, &data)
if err != nil {
	fmt.Println(err)
	return
}

// Encode the JSON data as a base64 string
base64Data := base64.StdEncoding.EncodeToString(jsonData)

msg := &nftmngrtypes.MsgCreateMetadata{
	Creator:       client.ConnectedAddress,
	NftSchemaCode: "six-protocol.develop_v220",
	TokenId:       "1",
	Base64NFTData: base64Data,
}

txResponse, err := client.GenerateOrBroadcastTx(msg)
if err != nil {
	fmt.Println(err)
	return
}
```

## Perform Action by Admin

```go
refID := uuid.New()
msg := &nftmngrtypes.MsgPerformActionByAdmin{
	Creator:       client.ConnectedAddress,
	NftSchemaCode: "six-protocol.develop_v220",
	TokenId:       "1",
	Action:        "test_read_nft",
	RefId:         refID.String(),
	Parameters:    []*nftmngrtypes.ActionParameter{},
}

txResponse, err := client.GenerateOrBroadcastTx(msg)
if err != nil {
	fmt.Println(err)
	return
}
```


---

# Agent Instructions: 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://sixnetwork.gitbook.io/nft-gen-2-tech-doc/getting-started/sdk-for-go/examples.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.
