Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastienGllmt committed Dec 26, 2023
1 parent 9d54b25 commit afac29a
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 24 deletions.
45 changes: 33 additions & 12 deletions docs/bin/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -757,15 +757,23 @@
],
"type": "object"
},
"ProjectedNftStatus": {
"enum": [
"Lock",
"Unlocking",
"Claim",
"Invalid"
],
"type": "string"
},
"ProjectedNftRangeResponse": {
"items": {
"properties": {
"forHowLong": {
"type": "number",
"format": "double",
"type": "string",
"nullable": true,
"description": "UNIX timestamp till which the funds can't be claimed in the Unlocking state.\nIf the status is not Unlocking this is always null.",
"example": 1701266986000
"example": "1701266986000"
},
"plutusDatum": {
"type": "string",
Expand All @@ -775,22 +783,31 @@
"pattern": "[0-9a-fA-F]+"
},
"status": {
"type": "string",
"allOf": [
{
"$ref": "#/components/schemas/ProjectedNftStatus"
}
],
"nullable": true,
"description": "Projected NFT status: Lock / Unlocking / Claim / Invalid",
"example": "Lock"
},
"amount": {
"type": "number",
"format": "double",
"type": "string",
"description": "Number of assets of `asset` type used in this Projected NFT event.",
"example": 1
"example": "1"
},
"asset": {
"assetName": {
"type": "string",
"description": "Asset that relates to Projected NFT event. Consists of 2 parts: PolicyId and AssetName",
"example": "96f7dc9749ede0140f042516f4b723d7261610d6b12ccb19f3475278.415045",
"pattern": "[0-9a-fA-F]+.[0-9a-fA-F]+"
"description": "Asset name that relates to Projected NFT event",
"example": "415045",
"pattern": "([0-9a-fA-F]{2}){0,32}"
},
"policyId": {
"type": "string",
"description": "Asset policy id that relates to Projected NFT event",
"example": "96f7dc9749ede0140f042516f4b723d7261610d6b12ccb19f3475278",
"pattern": "[0-9a-fA-F]{56}"
},
"previousTxOutputIndex": {
"type": "number",
Expand Down Expand Up @@ -839,7 +856,8 @@
"plutusDatum",
"status",
"amount",
"asset",
"assetName",
"policyId",
"previousTxOutputIndex",
"previousTxHash",
"actionOutputIndex",
Expand All @@ -853,6 +871,9 @@
},
"ProjectedNftRangeRequest": {
"properties": {
"address": {
"type": "string"
},
"range": {
"properties": {
"maxSlot": {
Expand Down
12 changes: 6 additions & 6 deletions docs/docs/indexer/Tasks/MultiEraProjectedNftTask.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ Parses projected NFT contract data
<summary>Configuration</summary>

```rust
use super::PayloadConfig::PayloadConfig;
use super::ReadonlyConfig::ReadonlyConfig;
use pallas::ledger::addresses::Address;
use pallas::ledger::primitives::alonzo::PlutusScript;
use pallas::ledger::primitives::babbage::PlutusV2Script;

#[derive(Debug, Clone, Copy, serde::Deserialize, serde::Serialize)]
pub struct PayloadAndReadonlyConfig {
pub include_payload: bool,
pub readonly: bool,
#[derive(Debug, Clone, serde::Deserialize, serde::Serialize)]
pub struct AddressConfig {
pub address: String,
}

```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import type { ErrorShape } from '../../../shared/errors';
import type { EndpointTypes } from '../../../shared/routes';
import { Routes } from '../../../shared/routes';
import { projectedNftRange, projectedNftRangeByAddress } from '../services/ProjectedNftRange';
import type {ProjectedNftRangeResponse} from '../../../shared/models/ProjectedNftRange';
import type {ProjectedNftRangeResponse, ProjectedNftStatus} from '../../../shared/models/ProjectedNftRange';
import {PROJECTED_NFT_LIMIT} from "../../../shared/constants";
import {Errors, genErrorMessage} from "../../../shared/errors";

Expand Down Expand Up @@ -76,7 +76,7 @@ export class ProjectedNftRangeController extends Controller {
policyId: data.policy_id,
assetName: data.asset_name,
amount: data.amount,
status: data.status,
status: data.status as ProjectedNftStatus | null,
plutusDatum: data.plutus_datum,
actionSlot: data.action_slot,
forHowLong: data.for_how_long,
Expand Down Expand Up @@ -108,7 +108,7 @@ export class ProjectedNftRangeController extends Controller {
policyId: data.policy_id,
assetName: data.asset_name,
amount: data.amount,
status: data.status,
status: data.status as ProjectedNftStatus | null,
plutusDatum: data.plutus_datum,
actionSlot: data.action_slot,
forHowLong: data.for_how_long,
Expand Down
13 changes: 10 additions & 3 deletions webserver/shared/models/ProjectedNftRange.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ export type ProjectedNftRangeRequest = {
address: string | undefined
};

export enum ProjectedNftStatus {
Lock = 'Lock',
Unlocking = 'Unlocking',
Claim = 'Claim',
Invalid = 'Invalid'
};

export type ProjectedNftRangeResponse = {
/**
* Slot at which the transaction happened
Expand Down Expand Up @@ -68,14 +75,14 @@ export type ProjectedNftRangeResponse = {
/**
* Asset policy id that relates to Projected NFT event
*
* @pattern [0-9a-fA-F]+.[0-9a-fA-F]+
* @pattern [0-9a-fA-F]{56}
* @example "96f7dc9749ede0140f042516f4b723d7261610d6b12ccb19f3475278"
*/
policyId: string,
/**
* Asset name that relates to Projected NFT event
*
* @pattern [0-9a-fA-F]+.[0-9a-fA-F]+
* @pattern ([0-9a-fA-F]{2}){0,32}
* @example "415045"
*/
assetName: string,
Expand All @@ -90,7 +97,7 @@ export type ProjectedNftRangeResponse = {
*
* @example "Lock"
*/
status: string | null,
status: ProjectedNftStatus | null,
/**
* Projected NFT datum: serialized state of the Projected NFT
*
Expand Down

0 comments on commit afac29a

Please sign in to comment.