Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into chunked-upload
Browse files Browse the repository at this point in the history
  • Loading branch information
wkolod committed Dec 8, 2023
2 parents 0c0ecb9 + d72d07d commit 3b6c5c6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@akord/akord-js",
"version": "4.23.5",
"version": "4.23.6",
"description": "A set of core js functions to interact with Akord",
"main": "lib/index.js",
"repository": "git@github.com:Akord-com/akord-js.git",
Expand Down
7 changes: 5 additions & 2 deletions src/core/nft.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { assetTags } from "../types/asset";
import { BadRequest } from "../errors/bad-request";

const DEFAULT_TICKER = "ATOMIC";
const DEFAULT_TYPE = "image";
const DEFAULT_CONTRACT_SRC = "Of9pi--Gj7hCTawhgxOwbuWnFI1h24TTgO5pw8ENJNQ"; // Atomic asset contract source

class NFTService extends NodeService<NFT> {
Expand Down Expand Up @@ -116,11 +117,13 @@ export const nftMetadataToTags = (metadata: NFTMetadata): Tags => {
{ name: smartweaveTags.CONTRACT_SOURCE, value: metadata.contractTxId || DEFAULT_CONTRACT_SRC },
{ name: smartweaveTags.INIT_STATE, value: JSON.stringify(initState) },
{ name: assetTags.TITLE, value: metadata.name },
{ name: assetTags.TYPE, value: metadata.type },
{ name: 'Creator', value: metadata.creator },
{ name: assetTags.TYPE, value: metadata.type || DEFAULT_TYPE },
{ name: 'Contract-Manifest', value: '{"evaluationOptions":{"sourceType":"redstone-sequencer","allowBigInt":true,"internalWrites":true,"unsafeClient":"skip","useConstructor":true}}' },
];

if (metadata.creator) {
nftTags.push({ name: 'Creator', value: metadata.creator });
}
if (metadata.description) {
nftTags.push({ name: assetTags.DESCRIPTION, value: metadata.description });
}
Expand Down
2 changes: 1 addition & 1 deletion src/types/asset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ export enum assetTags {
};

export type AssetMetadata = {
type: AssetType,
name: string, // max 150 characters
type?: AssetType, // default to "image"
description?: string, // optional description, max 300 characters
topics?: string[],
}
Expand Down

0 comments on commit 3b6c5c6

Please sign in to comment.