# Fractional NFT Credit

## Creating Credit Classes

```
scalar CreditClassID

tx CreateCreditClass(
  classMetadata data.HashURI,
  issuers Address*,
  creditMetadataClass data.HashURI,
  validationScript script.ScriptID?
) CreditClassID
```

## Issuing Credits

```
tx IssueCredit(
  cls CreditClassID,
  holder Address,
  liquidUnits Decimal,
  burnedUnits Decimal,
  metadata data.HashURI
) AssetID
```

```
IssueCredit(
  CarbonCredit,
  SomeUser,
  100,
  0,
  HashURI("Qmsdgknwetinsdgsdgi"))
```

## Sending and Burning (Retiring) Credits

Sending and burning (or retiring) of credits is done via the `bank.Send` and `bank.Burn` transactions.

## Queries

```
struct CreditHolding {
  liquidUnits: Decimal
  burnedUnits: Decimal
}

query GetCreditHolding(credit AssetID, holder: Address) CreditHolding
```

## State

```
table CreditClass {
  id: uint64
  metadata: data.HashURI
  designer: Address
  issuers: Address*
  validationScript: script.ScriptID?
  @auto_primary_key(id)
  @index(designer)
  @multi_index(issuers)
}
```


---

# 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://aaronc.gitbook.io/regen-docs/draft/token.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.
