Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Projected NFT indexing #158

Merged
merged 14 commits into from
Dec 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,151 changes: 740 additions & 411 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM rust:1.67 AS x-builder
FROM rust:1.73 AS x-builder

WORKDIR /indexer

Expand Down
2 changes: 1 addition & 1 deletion docs/bin/Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ pyparsing = "*"
[dev-packages]

[requires]
python_version = "3.8"
python_version = "3.10"
11 changes: 6 additions & 5 deletions docs/bin/Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions docs/bin/default.dot
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ N16;
N17;
N18;
N19;
N20;

}

Expand All @@ -60,6 +61,7 @@ N19;
N17[label="MultieraTxCredentialRelationTask"][shape="box"];
N18[label="MultieraAssetMintTask"][shape="box"];
N19[label="MultieraCip25EntryTask"][shape="box"];
N20[label="MultieraAddressDelegationTask"][shape="box"];
N0 -> N1[label=""];
N2 -> N3[label=""];
N3 -> N4[label=""];
Expand All @@ -81,4 +83,5 @@ N19;
N8 -> N18[label=""];
N9 -> N19[label=""];
N18 -> N19[label=""];
N15 -> N20[label=""];
}
134 changes: 73 additions & 61 deletions docs/bin/default.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/bin/gen-sql-graph.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ fi

pip install --user pipenv

# if this fails, try running `pipenv --rm && pipenv --clear` from the bin directory
pipenv install

pipenv shell "python ./sql_graphviz.py ./schema.sql | dot -Tsvg > ./sql-graph.svg && exit"
187 changes: 185 additions & 2 deletions docs/bin/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@
},
"hash": {
"type": "string",
"description": "[0-9a-fA-F]{64}",
"example": "cf8c63a909d91776e27f7d05457e823a9dba606a7ab499ac435e7904ee70d7c8"
"example": "cf8c63a909d91776e27f7d05457e823a9dba606a7ab499ac435e7904ee70d7c8",
"pattern": "[0-9a-fA-F]{64}"
},
"era": {
"type": "number",
Expand Down Expand Up @@ -757,6 +757,130 @@
],
"type": "object"
},
"ProjectedNftRangeResponse": {
"items": {
"properties": {
"forHowLong": {
"type": "number",
"format": "double",
"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
},
"plutusDatum": {
"type": "string",
"nullable": true,
"description": "Projected NFT datum: serialized state of the Projected NFT",
"example": "d8799fd8799f581c9040f057461d9adc09108fe5cb630077cf75c6e981d3ed91f6fb18f6ffd87980ff",
"pattern": "[0-9a-fA-F]+"
},
"status": {
"type": "string",
"nullable": true,
"description": "Projected NFT status: Lock / Unlocking / Claim / Invalid",
"example": "Lock"
},
"amount": {
"type": "number",
"format": "double",
"description": "Number of assets of `asset` type used in this Projected NFT event.",
"example": 1
},
"asset": {
"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]+"
},
"previousTxOutputIndex": {
"type": "number",
"format": "double",
"nullable": true,
"description": "Output index of related previous Projected NFT event. Null if event has `status` Lock.",
"example": 1
},
"previousTxHash": {
"type": "string",
"nullable": true,
"description": "Transaction id of related previous Projected NFT event.\nE.g. you locked the NFT and get unlocking event: you will see previousTxHash = transaction hash of lock event.\nNull if event has `status` Lock.",
"example": "28eb069e3e8c13831d431e3b2e35f58525493ab2d77fde83184993e4aa7a0eda",
"pattern": "[0-9a-fA-F]{64}"
},
"actionOutputIndex": {
"type": "number",
"format": "double",
"nullable": true,
"description": "Output index of related Projected NFT event. Null if it is claim event (No new UTxO is created).",
"example": 1
},
"actionTxId": {
"type": "string",
"nullable": true,
"description": "Transaction id of related Projected NFT event",
"example": "28eb069e3e8c13831d431e3b2e35f58525493ab2d77fde83184993e4aa7a0eda",
"pattern": "[0-9a-fA-F]{64}"
},
"ownerAddress": {
"type": "string",
"nullable": true,
"description": "Projected NFT owner address. Not null only if owned by Public Key Hash.",
"example": "9040f057461d9adc09108fe5cb630077cf75c6e981d3ed91f6fb18f6",
"pattern": "[0-9a-fA-F]+"
},
"actionSlot": {
"type": "number",
"format": "double",
"description": "Slot at which the transaction happened",
"example": 512345
}
},
"required": [
"forHowLong",
"plutusDatum",
"status",
"amount",
"asset",
"previousTxOutputIndex",
"previousTxHash",
"actionOutputIndex",
"actionTxId",
"ownerAddress",
"actionSlot"
],
"type": "object"
},
"type": "array"
},
"ProjectedNftRangeRequest": {
"properties": {
"range": {
"properties": {
"maxSlot": {
"type": "number",
"format": "double",
"description": "Maximal slot from which the events should be returned (inclusive)",
"example": 46154860
},
"minSlot": {
"type": "number",
"format": "double",
"description": "Minimal slot from which the events should be returned (not inclusive)",
"example": 46154769
}
},
"required": [
"maxSlot",
"minSlot"
],
"type": "object",
"description": "Projected NFT events in this slot range will be returned"
}
},
"required": [
"range"
],
"type": "object"
},
"BlockInfo": {
"allOf": [
{
Expand Down Expand Up @@ -1470,6 +1594,65 @@
}
}
},
"/projected-nft/range": {
"post": {
"operationId": "ProjectedNftRange",
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ProjectedNftRangeResponse"
}
}
}
},
"400": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorShape"
}
}
}
},
"409": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorShape"
}
}
}
},
"422": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorShape"
}
}
}
}
},
"security": [],
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ProjectedNftRangeRequest"
}
}
}
}
}
},
"/transaction/history": {
"post": {
"operationId": "TransactionHistory",
Expand Down
Loading
Loading