Assetyzer

The Assetyzer module in the Neucron JavaScript SDK provides functionalities related to asset management on the Neucron platform. This includes retrieving asset details by ID and deploying new assets.

Get Asset Details by ID

To get detailed information about a specific asset by its ID, you can use the following code:

import NeucronSDK from 'neucron-sdk/src/neucron-sdk.js';

const neucronSDK = new NeucronSDK();
await neucronSDK.authentication.login({
  email: 'dummy@example.com',
  password: 'dummyPassword'
});

const options = {
  assetId: 'f764572f-9acc-4f18-a686-d6ee01c11248'
};

const response = await neucronSDK.assetyzer.getAssetDetailById(options);
console.log(response);

Response:

{
  data: [
    {
      walletId: 'f1be9b7d-a9d5-40df-b6c6-e7f176057b14',
      assetId: 'f764572f-9acc-4f18-a686-d6ee01c11248',
      symbol: 'TCL',
      publickey: '0358351ba1fe1af1cd0d0c0a17bd45153023cdad3cb4370ca67071d03b40992d57',
      totalSupply: 3,
      AssetType: 'gh',
      assetName: 'Citadel',
      protocolName: 'TCL -f764572f-9acc-4f18-a686-d6ee01c11248-gh',
      legalTerm: 'Terms | Privacy | CCPA | Cookie Policy | Cookie Settings | Legal and Compliance',
      assetImgUrl: 'https://rb.gy/vhngdm',
      companyWebsite: 'https://timechainlabs.io/',
      minted: true,
      txid: '86823375b2acdc02976c09e1a001000ecd2abe2e95e068e521aff636034e5692',
      outputIndex: 0,
      header_info: { /* Object */ },
      instruments: { /* Object */ },
      minterPaymail: '1035@neucron.io',
      maintenanceFee: 0,
      executedAt: '2024-01-01T15:54:04.688729Z',
      identity_provider_publickey: '',
      eligble_merchant_code: { merchantCode: [/* Array */] }
    },
    // Additional asset details if available
  ],
  status_code: 200
}

Deploy Asset

To deploy a new asset, use the following code:

import NeucronSDK from 'neucron-sdk/src/neucron-sdk.js';

const neucronSDK = new NeucronSDK();
await neucronSDK.authentication.login({
  email: 'dummy@example.com',
  password: 'dummyPassword'
});

const options = {
  assetId: '8a193a57-32d2-4bf9-a91a-9868e619930b'
};

const response = await neucronSDK.assetyzer.deploy(options);
console.log(response);

Response:

{
  Authorization: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3MDcwNTYyNjAsImlhdCI6MTcwNDQ2NDI2MCwiaXNzIjoiaHR0cHM6Ly9uZXVjcm9uLmlvIiwianRpIjoiNWY0MTIzYjUtZjJlZi00YWRjLWE1M2MtYzlkNzVlYTg3NDZiIiwibmJmIjoxNzA0NDY0MjYwLCJzdWIiOiIwZjMxNDU3ZS04Njk1LTQxYjAtODMyMC1mMDZmODQ3Mzc5OWYiLCJ1c2VyX2lkIjoiMGYzMTQ1N2UtODY5NS00M
  },
  data: {
    walletId: 'f1be9b7d-a9d5-40df-b6c6-e7f176057b14',
    assetId: '8a193a57-32d2-4bf9-a91a-9868e619930b',
    symbol: 'TCL',
    publickey: '0358351ba1fe1af1cd0d0c0a17bd45153023cdad3cb4370ca67071d03b40992d57',
    totalSupply: 10,
    AssetType: 'areser',
    assetName: 'Citadel',
    protocolName: 'TCL -8a193a57-32d2-4bf9-a91a-9868e619930b-areser',
    legalTerm: 'Terms | Privacy | CCPA | Cookie Policy | Cookie Settings | Legal and Compliance',
    assetImgUrl: 'https://rb.gy/vhngdm',
    companyWebsite: 'https://timechainlabs.io/',
    minted: true,
    txid: '36af456d6b1e366dfd425b91ad2056b120ddca65c9b457af578282f96a29ab04',
    outputIndex: 0,
    header_info: { /* Object */ },
    instruments: { propertyname: 'string', propertyAddress: 'string' },
    minterPaymail: 'newcoco@dev.neucron.io',
    maintenanceFee: 0,
    executedAt: '2024-01-05T14:16:54.063017Z',
    identity_provider_publickey: 'string',
    eligble_merchant_code: { merchantCode: [/* Array */] }
  },
  status_code: 200
}

Create Asset

To create a new asset, use the following code:

import NeucronSDK from 'neucron-sdk/src/neucron-sdk.js';

const neucronSDK = new NeucronSDK();
await neucronSDK.authentication.login({
  email: 'dummy@example.com',
  password: 'dummyPassword'
});

const options = {
  assetImgUrl: 'https://rb.gy/vhngdm',
  assetName: 'Citadel',
  assetType: 'game',
  companyWebsite: 'https://timechainlabs.io/',
  eligble_merchant_code: {
    merchantCode: [
      {
        mc_code: 'string'
      }
    ]
  },
  header_info: {
    contractAddress: 'string',
    contractEndDate: 'string',
    contractTitle: 'string',
    governingLaw: 'string',
    issuer: 'string',
    juridiction: 'string',
    type: 'string'
  },
  identity_provider_publickey: 'string',
  instruments: {
    maintenanceFee: 0,
    managementFee: 0,
    piecePerToken: 0,
    propertyAddress: 'string',
    propertyValue: 0,
    propertyname: 'string',
    rentalIncome: 0,
    sqFoot: 0
  },
  legalTerm: 'Terms | Privacy | CCPA | Cookie Policy | Cookie Settings | Legal and Compliance',
  symbol: 'TCL',
  totalSupply: 10
};

const response = await neucronSDK.assetyzer.createAsset(options, { assetType: 'courier' });
console.log(response);

Response:

{
  assetID: '60570cef-e6d7-4ee8-84c1-23a863f37b35'
}

Send Asset

To send an asset to a specified paymail, use the following code:

import NeucronSDK from 'neucron-sdk/src/neucron-sdk.js';

const neucronSDK = new NeucronSDK();
await neucronSDK.authentication.login({
  email: 'dummy@example.com',
  password: 'dummyPassword'
});

const options = {
  amount: 2,
  paymail: 'shubh@dev.neucron.io',
  assetId: 'de8670ca-aac2-45b0-b584-1d0be5ab0b0f'
};

const response = await neucronSDK.assetyzer.send(options);
console.log(response);

Response:

{
  data: '652161c3af4a4ad77a27fc98ca1c70feb3536d5e154898b8057be22e4624f384',
  status_code: 200
}

This concludes the documentation for the Assetyzer module in the Neucron JavaScript SDK. For more details or additional functionalities, please refer to the official Neucron SDK documentation.

Last updated