New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@twin.org/nft-service

Package Overview
Dependencies
Maintainers
0
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@twin.org/nft-service - npm Package Compare versions

Comparing version 0.0.1-next.16 to 0.0.1-next.17

10

dist/types/nftService.d.ts

@@ -22,3 +22,2 @@ import { type INftComponent } from "@twin.org/nft-models";

* Mint an NFT.
* @param issuer The issuer for the NFT, will also be the initial owner.
* @param tag The tag for the NFT.

@@ -31,3 +30,3 @@ * @param immutableMetadata The immutable metadata for the NFT.

*/
mint<T = unknown, U = unknown>(issuer: string, tag: string, immutableMetadata?: T, metadata?: U, namespace?: string, identity?: string): Promise<string>;
mint<T = unknown, U = unknown>(tag: string, immutableMetadata?: T, metadata?: U, namespace?: string, identity?: string): Promise<string>;
/**

@@ -56,3 +55,4 @@ * Resolve an NFT.

* @param id The id of the NFT to transfer in urn format.
* @param recipient The recipient of the NFT.
* @param recipientIdentity The recipient identity for the NFT.
* @param recipientAddress The recipient address for the NFT.
* @param metadata Optional mutable data to include during the transfer.

@@ -62,3 +62,3 @@ * @param identity The identity to perform the nft operation on.

*/
transfer<T = unknown>(id: string, recipient: string, metadata?: T, identity?: string): Promise<void>;
transfer<U = unknown>(id: string, recipientIdentity: string, recipientAddress: string, metadata?: U, identity?: string): Promise<void>;
/**

@@ -71,3 +71,3 @@ * Update the data of the NFT.

*/
update<T = unknown>(id: string, metadata: T, identity?: string): Promise<void>;
update<U = unknown>(id: string, metadata: U, identity?: string): Promise<void>;
}
# @twin.org/nft-service - Changelog
## v0.0.1-next.16
## v0.0.1-next.17
- Initial Release
{
"openapi": "3.1.0",
"info": {
"title": "TWIN - Test Endpoints",
"description": "REST API for TWIN - Test Endpoints.",
"version": "1.0.0",
"license": {
"name": "Apache 2.0 License",
"url": "https://opensource.org/licenses/Apache-2.0"
}
},
"servers": [
{
"url": "https://localhost"
}
],
"tags": [
{
"name": "NFT",
"description": "Endpoints which are modelled to access an NFT contract."
}
],
"paths": {
"/nft": {
"post": {
"operationId": "nftMint",
"summary": "Mint an NFT",
"tags": [
"NFT"
],
"security": [
{
"jwtBearerAuthScheme": []
}
],
"requestBody": {
"description": "Mint the data and return the NFT id.",
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/NftMintRequest"
},
"examples": {
"nftMintExample": {
"value": {
"issuer": "tst1prctjk5ck0dutnsunnje6u90jk5htx03qznjjmkd6843pzltlgz87srjzzv",
"tag": "MY-NFT",
"immutableMetadata": {
"docName": "bill-of-lading",
"mimeType": "application/pdf",
"fingerprint": "0xf0b95a98b3dbc5ce1c9ce59d70af95a97599f100a7296ecdd1eb108bebfa047f"
},
"metadata": {
"data": "tst1prctjk5ck0dutnsunnje6u90jk5htx03qznjjmkd6843pzltlgz87srjzzv"
}
}
}
}
}
}
},
"responses": {
"201": {
"description": "The rest request ended in created response.",
"headers": {
"location": {
"schema": {
"type": "string"
},
"description": "e.g. nft:iota:aW90YS1uZnQ6dHN0OjB4NzYyYjljNDllYTg2OWUwZWJkYTliYmZhNzY5Mzk0NDdhNDI4ZGNmMTc4YzVkMTVhYjQ0N2UyZDRmYmJiNGViMg=="
}
}
},
"400": {
"description": "The server cannot process the request, see the content for more details.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
},
"examples": {
"exampleResponse": {
"value": {
"name": "GeneralError",
"message": "component.error",
"properties": {
"foo": "bar"
}
}
}
}
}
}
},
"401": {
"description": "You are not authorized to use the API or no credentials were supplied, see the content for more details.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
},
"examples": {
"exampleResponse": {
"value": {
"name": "UnauthorizedError",
"message": "component.error"
}
}
}
}
}
},
"500": {
"description": "The server has encountered a situation it does not know how to handle, see the content for more details.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
},
"examples": {
"exampleResponse": {
"value": {
"name": "InternalServerError",
"message": "component.error"
}
}
}
}
}
}
}
}
},
"/nft/{id}": {
"get": {
"operationId": "nftResolve",
"summary": "Resolve an NFT",
"tags": [
"NFT"
],
"parameters": [
{
"name": "id",
"description": "The id of the NFT to resolve.",
"in": "path",
"required": true,
"schema": {
"type": "string"
},
"style": "simple",
"example": "nft:iota:aW90YS1uZnQ6dHN0OjB4NzYyYjljNDllYTg2OWUwZWJkYTliYmZhNzY5Mzk0NDdhNDI4ZGNmMTc4YzVkMTVhYjQ0N2UyZDRmYmJiNGViMg=="
}
],
"security": [
{
"jwtBearerAuthScheme": []
}
],
"responses": {
"200": {
"description": "Response to resolving the NFT.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/NftResolveResponse"
},
"examples": {
"nftResolveResponseExample": {
"value": {
"issuer": "tst1prctjk5ck0dutnsunnje6u90jk5htx03qznjjmkd6843pzltlgz87srjzzv",
"owner": "tst1prctjk5ck0dutnsunnje6u90jk5htx03qznjjmkd6843pzltlgz87srjzzv",
"tag": "MY-NFT",
"immutableMetadata": {
"docName": "bill-of-lading",
"mimeType": "application/pdf",
"fingerprint": "0xf0b95a98b3dbc5ce1c9ce59d70af95a97599f100a7296ecdd1eb108bebfa047f"
},
"metadata": {
"data": "AAAAA"
}
}
}
}
}
}
},
"400": {
"description": "The server cannot process the request, see the content for more details.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
},
"examples": {
"exampleResponse": {
"value": {
"name": "GeneralError",
"message": "component.error",
"properties": {
"foo": "bar"
}
}
}
}
}
}
},
"401": {
"description": "You are not authorized to use the API or no credentials were supplied, see the content for more details.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
},
"examples": {
"exampleResponse": {
"value": {
"name": "UnauthorizedError",
"message": "component.error"
}
}
}
}
}
},
"500": {
"description": "The server has encountered a situation it does not know how to handle, see the content for more details.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
},
"examples": {
"exampleResponse": {
"value": {
"name": "InternalServerError",
"message": "component.error"
}
}
}
}
}
}
}
},
"delete": {
"operationId": "nftBurn",
"summary": "Burn an NFT",
"tags": [
"NFT"
],
"parameters": [
{
"name": "id",
"description": "The id of the NFT to burn.",
"in": "path",
"required": true,
"schema": {
"type": "string"
},
"style": "simple",
"example": "nft:iota:aW90YS1uZnQ6dHN0OjB4NzYyYjljNDllYTg2OWUwZWJkYTliYmZhNzY5Mzk0NDdhNDI4ZGNmMTc4YzVkMTVhYjQ0N2UyZDRmYmJiNGViMg=="
}
],
"security": [
{
"jwtBearerAuthScheme": []
}
],
"responses": {
"204": {
"description": "The rest request ended in success with no data."
},
"400": {
"description": "The server cannot process the request, see the content for more details.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
},
"examples": {
"exampleResponse": {
"value": {
"name": "GeneralError",
"message": "component.error",
"properties": {
"foo": "bar"
}
}
}
}
}
}
},
"401": {
"description": "You are not authorized to use the API or no credentials were supplied, see the content for more details.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
},
"examples": {
"exampleResponse": {
"value": {
"name": "UnauthorizedError",
"message": "component.error"
}
}
}
}
}
},
"500": {
"description": "The server has encountered a situation it does not know how to handle, see the content for more details.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
},
"examples": {
"exampleResponse": {
"value": {
"name": "InternalServerError",
"message": "component.error"
}
}
}
}
}
}
}
},
"put": {
"operationId": "nftUpdate",
"summary": "Update an NFT",
"tags": [
"NFT"
],
"parameters": [
{
"name": "id",
"description": "The id of the NFT to transfer in urn format.",
"in": "path",
"required": true,
"schema": {
"type": "string"
},
"style": "simple",
"example": "nft:iota:aW90YS1uZnQ6dHN0OjB4NzYyYjljNDllYTg2OWUwZWJkYTliYmZhNzY5Mzk0NDdhNDI4ZGNmMTc4YzVkMTVhYjQ0N2UyZDRmYmJiNGViMg=="
}
],
"security": [
{
"jwtBearerAuthScheme": []
}
],
"requestBody": {
"description": "Update the mutable data for the NFT.",
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/NftUpdateRequest"
},
"examples": {
"nftUpdateExample": {
"value": {
"metadata": {
"data": "AAAAA"
}
}
}
}
}
}
},
"responses": {
"204": {
"description": "The rest request ended in success with no data."
},
"400": {
"description": "The server cannot process the request, see the content for more details.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
},
"examples": {
"exampleResponse": {
"value": {
"name": "GeneralError",
"message": "component.error",
"properties": {
"foo": "bar"
}
}
}
}
}
}
},
"401": {
"description": "You are not authorized to use the API or no credentials were supplied, see the content for more details.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
},
"examples": {
"exampleResponse": {
"value": {
"name": "UnauthorizedError",
"message": "component.error"
}
}
}
}
}
},
"500": {
"description": "The server has encountered a situation it does not know how to handle, see the content for more details.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
},
"examples": {
"exampleResponse": {
"value": {
"name": "InternalServerError",
"message": "component.error"
}
}
}
}
}
}
}
}
},
"/nft/{id}/transfer": {
"post": {
"operationId": "nftTransfer",
"summary": "Transfer an NFT",
"tags": [
"NFT"
],
"parameters": [
{
"name": "id",
"description": "The id of the NFT to transfer in urn format.",
"in": "path",
"required": true,
"schema": {
"type": "string"
},
"style": "simple",
"example": "nft:iota:aW90YS1uZnQ6dHN0OjB4NzYyYjljNDllYTg2OWUwZWJkYTliYmZhNzY5Mzk0NDdhNDI4ZGNmMTc4YzVkMTVhYjQ0N2UyZDRmYmJiNGViMg=="
}
],
"security": [
{
"jwtBearerAuthScheme": []
}
],
"requestBody": {
"description": "Transfer the NFT and update the metadata.",
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/NftTransferRequest"
},
"examples": {
"nftTransferExample": {
"value": {
"recipient": "tst1prctjk5ck0dutnsunnje6u90jk5htx03qznjjmkd6843pzltlgz87srjzzv",
"metadata": {
"data": "AAAAA"
}
}
}
}
}
}
},
"responses": {
"204": {
"description": "The rest request ended in success with no data."
},
"400": {
"description": "The server cannot process the request, see the content for more details.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
},
"examples": {
"exampleResponse": {
"value": {
"name": "GeneralError",
"message": "component.error",
"properties": {
"foo": "bar"
}
}
}
}
}
}
},
"401": {
"description": "You are not authorized to use the API or no credentials were supplied, see the content for more details.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
},
"examples": {
"exampleResponse": {
"value": {
"name": "UnauthorizedError",
"message": "component.error"
}
}
}
}
}
},
"500": {
"description": "The server has encountered a situation it does not know how to handle, see the content for more details.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
},
"examples": {
"exampleResponse": {
"value": {
"name": "InternalServerError",
"message": "component.error"
}
}
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"Error": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "The name for the error."
},
"message": {
"type": "string",
"description": "The message for the error."
},
"source": {
"type": "string",
"description": "The source of the error."
},
"properties": {
"type": "object",
"additionalProperties": {},
"description": "Any additional information for the error."
},
"stack": {
"type": "string",
"description": "The stack trace for the error."
},
"inner": {
"$ref": "#/components/schemas/Error"
}
},
"required": [
"name",
"message"
],
"additionalProperties": false,
"description": "Model to describe serialized error."
},
"NftMintRequest": {
"type": "object",
"properties": {
"issuer": {
"type": "string",
"description": "The issuer for the NFT, will also be the initial owner."
},
"tag": {
"type": "string",
"description": "The tag for the NFT."
},
"immutableMetadata": {
"description": "The immutable metadata for the NFT."
},
"metadata": {
"description": "The metadata for the NFT."
},
"namespace": {
"type": "string",
"description": "The namespace of the connector to use for the NFT, defaults to component configured namespace."
}
},
"required": [
"issuer",
"tag"
],
"additionalProperties": false,
"description": "The data to be used in the minting."
},
"NftResolveResponse": {
"type": "object",
"properties": {
"issuer": {
"type": "string",
"description": "The issuer of the NFT."
},
"owner": {
"type": "string",
"description": "The owner of the NFT."
},
"tag": {
"type": "string",
"description": "The tag data for the NFT."
},
"immutableMetadata": {
"description": "The immutable data for the NFT."
},
"metadata": {
"description": "The metadata for the NFT."
}
},
"required": [
"issuer",
"owner",
"tag"
],
"additionalProperties": false,
"description": "The data that was resolved."
},
"NftTransferRequest": {
"type": "object",
"properties": {
"recipient": {
"type": "string",
"description": "The recipient for the NFT."
},
"metadata": {
"description": "The metadata for the NFT."
}
},
"required": [
"recipient"
],
"additionalProperties": false,
"description": "The data to be used in the transfer."
},
"NftUpdateRequest": {
"type": "object",
"properties": {
"metadata": {
"description": "The metadata for the NFT."
}
},
"additionalProperties": false,
"description": "The data to be used in the update."
}
},
"securitySchemes": {
"jwtBearerAuthScheme": {
"type": "http",
"scheme": "bearer",
"bearerFormat": "JWT"
}
}
}
}
"openapi": "3.1.0",
"info": {
"title": "TWIN - Test Endpoints",
"description": "REST API for TWIN - Test Endpoints.",
"version": "1.0.0",
"license": {
"name": "Apache 2.0 License",
"url": "https://opensource.org/licenses/Apache-2.0"
}
},
"servers": [
{
"url": "https://localhost"
}
],
"tags": [
{
"name": "NFT",
"description": "Endpoints which are modelled to access an NFT contract."
}
],
"paths": {
"/nft": {
"post": {
"operationId": "nftMint",
"summary": "Mint an NFT",
"tags": [
"NFT"
],
"security": [
{
"jwtBearerAuthScheme": []
}
],
"requestBody": {
"description": "Mint the data and return the NFT id.",
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/NftMintRequest"
},
"examples": {
"nftMintExample": {
"value": {
"tag": "MY-NFT",
"immutableMetadata": {
"docName": "bill-of-lading",
"mimeType": "application/pdf",
"fingerprint": "0xf0b95a98b3dbc5ce1c9ce59d70af95a97599f100a7296ecdd1eb108bebfa047f"
},
"metadata": {
"data": "tst1prctjk5ck0dutnsunnje6u90jk5htx03qznjjmkd6843pzltlgz87srjzzv"
}
}
}
}
}
}
},
"responses": {
"201": {
"description": "The rest request ended in created response.",
"headers": {
"location": {
"schema": {
"type": "string"
},
"description": "e.g. nft:iota:aW90YS1uZnQ6dHN0OjB4NzYyYjljNDllYTg2OWUwZWJkYTliYmZhNzY5Mzk0NDdhNDI4ZGNmMTc4YzVkMTVhYjQ0N2UyZDRmYmJiNGViMg=="
}
}
},
"400": {
"description": "The server cannot process the request, see the content for more details.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
},
"examples": {
"exampleResponse": {
"value": {
"name": "GeneralError",
"message": "component.error",
"properties": {
"foo": "bar"
}
}
}
}
}
}
},
"401": {
"description": "You are not authorized to use the API or no credentials were supplied, see the content for more details.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
},
"examples": {
"exampleResponse": {
"value": {
"name": "UnauthorizedError",
"message": "component.error"
}
}
}
}
}
},
"500": {
"description": "The server has encountered a situation it does not know how to handle, see the content for more details.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
},
"examples": {
"exampleResponse": {
"value": {
"name": "InternalServerError",
"message": "component.error"
}
}
}
}
}
}
}
}
},
"/nft/{id}": {
"get": {
"operationId": "nftResolve",
"summary": "Resolve an NFT",
"tags": [
"NFT"
],
"parameters": [
{
"name": "id",
"description": "The id of the NFT to resolve.",
"in": "path",
"required": true,
"schema": {
"type": "string"
},
"style": "simple",
"example": "nft:iota:aW90YS1uZnQ6dHN0OjB4NzYyYjljNDllYTg2OWUwZWJkYTliYmZhNzY5Mzk0NDdhNDI4ZGNmMTc4YzVkMTVhYjQ0N2UyZDRmYmJiNGViMg=="
}
],
"security": [
{
"jwtBearerAuthScheme": []
}
],
"responses": {
"200": {
"description": "Response to resolving the NFT.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/NftResolveResponse"
},
"examples": {
"nftResolveResponseExample": {
"value": {
"issuer": "did:iota:tst:0x85ef62ea94fc4eeeeeddf6acc3b566e988e613081d0b93cc54ed831ed4c18d44",
"owner": "did:iota:tst:0x85ef62ea94fc4eeeeeddf6acc3b566e988e613081d0b93cc54ed831ed4c18d44",
"tag": "MY-NFT",
"immutableMetadata": {
"docName": "bill-of-lading",
"mimeType": "application/pdf",
"fingerprint": "0xf0b95a98b3dbc5ce1c9ce59d70af95a97599f100a7296ecdd1eb108bebfa047f"
},
"metadata": {
"data": "AAAAA"
}
}
}
}
}
}
},
"400": {
"description": "The server cannot process the request, see the content for more details.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
},
"examples": {
"exampleResponse": {
"value": {
"name": "GeneralError",
"message": "component.error",
"properties": {
"foo": "bar"
}
}
}
}
}
}
},
"401": {
"description": "You are not authorized to use the API or no credentials were supplied, see the content for more details.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
},
"examples": {
"exampleResponse": {
"value": {
"name": "UnauthorizedError",
"message": "component.error"
}
}
}
}
}
},
"500": {
"description": "The server has encountered a situation it does not know how to handle, see the content for more details.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
},
"examples": {
"exampleResponse": {
"value": {
"name": "InternalServerError",
"message": "component.error"
}
}
}
}
}
}
}
},
"delete": {
"operationId": "nftBurn",
"summary": "Burn an NFT",
"tags": [
"NFT"
],
"parameters": [
{
"name": "id",
"description": "The id of the NFT to burn.",
"in": "path",
"required": true,
"schema": {
"type": "string"
},
"style": "simple",
"example": "nft:iota:aW90YS1uZnQ6dHN0OjB4NzYyYjljNDllYTg2OWUwZWJkYTliYmZhNzY5Mzk0NDdhNDI4ZGNmMTc4YzVkMTVhYjQ0N2UyZDRmYmJiNGViMg=="
}
],
"security": [
{
"jwtBearerAuthScheme": []
}
],
"responses": {
"204": {
"description": "The rest request ended in success with no data."
},
"400": {
"description": "The server cannot process the request, see the content for more details.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
},
"examples": {
"exampleResponse": {
"value": {
"name": "GeneralError",
"message": "component.error",
"properties": {
"foo": "bar"
}
}
}
}
}
}
},
"401": {
"description": "You are not authorized to use the API or no credentials were supplied, see the content for more details.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
},
"examples": {
"exampleResponse": {
"value": {
"name": "UnauthorizedError",
"message": "component.error"
}
}
}
}
}
},
"500": {
"description": "The server has encountered a situation it does not know how to handle, see the content for more details.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
},
"examples": {
"exampleResponse": {
"value": {
"name": "InternalServerError",
"message": "component.error"
}
}
}
}
}
}
}
},
"put": {
"operationId": "nftUpdate",
"summary": "Update an NFT",
"tags": [
"NFT"
],
"parameters": [
{
"name": "id",
"description": "The id of the NFT to transfer in urn format.",
"in": "path",
"required": true,
"schema": {
"type": "string"
},
"style": "simple",
"example": "nft:iota:aW90YS1uZnQ6dHN0OjB4NzYyYjljNDllYTg2OWUwZWJkYTliYmZhNzY5Mzk0NDdhNDI4ZGNmMTc4YzVkMTVhYjQ0N2UyZDRmYmJiNGViMg=="
}
],
"security": [
{
"jwtBearerAuthScheme": []
}
],
"requestBody": {
"description": "Update the mutable data for the NFT.",
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/NftUpdateRequest"
},
"examples": {
"nftUpdateExample": {
"value": {
"metadata": {
"data": "AAAAA"
}
}
}
}
}
}
},
"responses": {
"204": {
"description": "The rest request ended in success with no data."
},
"400": {
"description": "The server cannot process the request, see the content for more details.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
},
"examples": {
"exampleResponse": {
"value": {
"name": "GeneralError",
"message": "component.error",
"properties": {
"foo": "bar"
}
}
}
}
}
}
},
"401": {
"description": "You are not authorized to use the API or no credentials were supplied, see the content for more details.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
},
"examples": {
"exampleResponse": {
"value": {
"name": "UnauthorizedError",
"message": "component.error"
}
}
}
}
}
},
"500": {
"description": "The server has encountered a situation it does not know how to handle, see the content for more details.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
},
"examples": {
"exampleResponse": {
"value": {
"name": "InternalServerError",
"message": "component.error"
}
}
}
}
}
}
}
}
},
"/nft/{id}/transfer": {
"post": {
"operationId": "nftTransfer",
"summary": "Transfer an NFT",
"tags": [
"NFT"
],
"parameters": [
{
"name": "id",
"description": "The id of the NFT to transfer in urn format.",
"in": "path",
"required": true,
"schema": {
"type": "string"
},
"style": "simple",
"example": "nft:iota:aW90YS1uZnQ6dHN0OjB4NzYyYjljNDllYTg2OWUwZWJkYTliYmZhNzY5Mzk0NDdhNDI4ZGNmMTc4YzVkMTVhYjQ0N2UyZDRmYmJiNGViMg=="
}
],
"security": [
{
"jwtBearerAuthScheme": []
}
],
"requestBody": {
"description": "Transfer the NFT and update the metadata.",
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/NftTransferRequest"
},
"examples": {
"nftTransferExample": {
"value": {
"recipientIdentity": "did:iota:tst:0x85ef62ea94fc4eeeeeddf6acc3b566e988e613081d0b93cc54ed831ed4c18d44",
"recipientAddress": "tst1prctjk5ck0dutnsunnje6u90jk5htx03qznjjmkd6843pzltlgz87srjzzv",
"metadata": {
"data": "AAAAA"
}
}
}
}
}
}
},
"responses": {
"204": {
"description": "The rest request ended in success with no data."
},
"400": {
"description": "The server cannot process the request, see the content for more details.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
},
"examples": {
"exampleResponse": {
"value": {
"name": "GeneralError",
"message": "component.error",
"properties": {
"foo": "bar"
}
}
}
}
}
}
},
"401": {
"description": "You are not authorized to use the API or no credentials were supplied, see the content for more details.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
},
"examples": {
"exampleResponse": {
"value": {
"name": "UnauthorizedError",
"message": "component.error"
}
}
}
}
}
},
"500": {
"description": "The server has encountered a situation it does not know how to handle, see the content for more details.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
},
"examples": {
"exampleResponse": {
"value": {
"name": "InternalServerError",
"message": "component.error"
}
}
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"Error": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "The name for the error."
},
"message": {
"type": "string",
"description": "The message for the error."
},
"source": {
"type": "string",
"description": "The source of the error."
},
"properties": {
"type": "object",
"additionalProperties": {},
"description": "Any additional information for the error."
},
"stack": {
"type": "string",
"description": "The stack trace for the error."
},
"inner": {
"$ref": "#/components/schemas/Error"
}
},
"required": [
"name",
"message"
],
"additionalProperties": false,
"description": "Model to describe serialized error."
},
"NftMintRequest": {
"type": "object",
"properties": {
"tag": {
"type": "string",
"description": "The tag for the NFT."
},
"immutableMetadata": {
"description": "The immutable metadata for the NFT."
},
"metadata": {
"description": "The metadata for the NFT."
},
"namespace": {
"type": "string",
"description": "The namespace of the connector to use for the NFT, defaults to component configured namespace."
}
},
"required": [
"tag"
],
"additionalProperties": false,
"description": "The data to be used in the minting."
},
"NftResolveResponse": {
"type": "object",
"properties": {
"issuer": {
"type": "string",
"description": "The issuer of the NFT."
},
"owner": {
"type": "string",
"description": "The owner of the NFT."
},
"tag": {
"type": "string",
"description": "The tag data for the NFT."
},
"immutableMetadata": {
"description": "The immutable data for the NFT."
},
"metadata": {
"description": "The metadata for the NFT."
}
},
"required": [
"issuer",
"owner",
"tag"
],
"additionalProperties": false,
"description": "The data that was resolved."
},
"NftTransferRequest": {
"type": "object",
"properties": {
"recipientIdentity": {
"type": "string",
"description": "The recipient identity for the NFT."
},
"recipientAddress": {
"type": "string",
"description": "The recipient address for the NFT."
},
"metadata": {
"description": "The metadata for the NFT."
}
},
"required": [
"recipientIdentity",
"recipientAddress"
],
"additionalProperties": false,
"description": "The data to be used in the transfer."
},
"NftUpdateRequest": {
"type": "object",
"properties": {
"metadata": {
"description": "The metadata for the NFT."
}
},
"additionalProperties": false,
"description": "The data to be used in the update."
}
},
"securitySchemes": {
"jwtBearerAuthScheme": {
"type": "http",
"scheme": "bearer",
"bearerFormat": "JWT"
}
}
}
}

@@ -53,3 +53,3 @@ # Class: NftService

> **mint**\<`T`, `U`\>(`issuer`, `tag`, `immutableMetadata`?, `metadata`?, `namespace`?, `identity`?): `Promise`\<`string`\>
> **mint**\<`T`, `U`\>(`tag`, `immutableMetadata`?, `metadata`?, `namespace`?, `identity`?): `Promise`\<`string`\>

@@ -66,8 +66,2 @@ Mint an NFT.

##### issuer
`string`
The issuer for the NFT, will also be the initial owner.
##### tag

@@ -187,3 +181,3 @@

> **transfer**\<`T`\>(`id`, `recipient`, `metadata`?, `identity`?): `Promise`\<`void`\>
> **transfer**\<`U`\>(`id`, `recipientIdentity`, `recipientAddress`, `metadata`?, `identity`?): `Promise`\<`void`\>

@@ -194,3 +188,3 @@ Transfer an NFT.

• **T** = `unknown`
• **U** = `unknown`

@@ -205,11 +199,17 @@ #### Parameters

##### recipient
##### recipientIdentity
`string`
The recipient of the NFT.
The recipient identity for the NFT.
##### recipientAddress
`string`
The recipient address for the NFT.
##### metadata?
`T`
`U`

@@ -238,3 +238,3 @@ Optional mutable data to include during the transfer.

> **update**\<`T`\>(`id`, `metadata`, `identity`?): `Promise`\<`void`\>
> **update**\<`U`\>(`id`, `metadata`, `identity`?): `Promise`\<`void`\>

@@ -245,3 +245,3 @@ Update the data of the NFT.

• **T** = `unknown`
• **U** = `unknown`

@@ -258,3 +258,3 @@ #### Parameters

`T`
`U`

@@ -261,0 +261,0 @@ The mutable data to update.

{
"name": "@twin.org/nft-service",
"version": "0.0.1-next.16",
"version": "0.0.1-next.17",
"description": "NFT contract implementation and REST endpoint definitions",

@@ -21,3 +21,3 @@ "repository": {

"@twin.org/nameof": "next",
"@twin.org/nft-models": "0.0.1-next.16",
"@twin.org/nft-models": "0.0.1-next.17",
"@twin.org/web": "next"

@@ -24,0 +24,0 @@ },

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc