MCPcopy Index your code
hub / github.com/chain/Core / assetsAPI

Function assetsAPI

sdk/node/src/api/assets.js:46–143  ·  view source on GitHub ↗
(client)

Source from the content-addressed store, hash-verified

44 * @module AssetsApi
45 */
46const assetsAPI = (client) => {
47 /**
48 * @typedef {Object} createRequest
49 *
50 * @property {String} [alias]
51 * User specified, unique identifier.
52 *
53 * @property {String[]} rootXpubs
54 * The list of keys used to create the issuance program for the asset.
55 *
56 * @property {Number} quorum
57 * The number of keys required to issue units of the asset.
58 *
59 * @property {Object} [tags]
60 * User-specified, arbitrary/unstructured data local to the asset's originating core.
61 *
62 * @property {Object} [defintion]
63 * User-specified, arbitrary/unstructured data visible across blockchain networks.
64 */
65
66 /**
67 * @typedef {Object} updateTagsRequest
68 *
69 * @property {String} [id]
70 * The asset ID. Either the ID or alias must be specified, but not both.
71 *
72 * @property {String} [alias]
73 * The asset alias. Either the ID or alias must be specified, but not both.
74 *
75 * @property {Object} [tags]
76 * A new set of tags, which will replace the existing tags.
77 */
78
79 return {
80 /**
81 * Create a new asset.
82 *
83 * @param {module:AssetsApi~createRequest} params - Parameters for asset creation.
84 * @param {objectCallback} [callback] - Optional callback. Use instead of Promise return value as desired.
85 * @returns {Promise<Asset>} Newly created asset.
86 */
87 create: (params, cb) => shared.create(client, '/create-asset', params, {cb}),
88
89 /**
90 * Create multiple new assets.
91 *
92 * @param {module:AssetsApi~createRequest[]} params - Parameters for creation of multiple assets.
93 * @param {batchCallback} [callback] - Optional callback. Use instead of Promise return value as desired.
94 * @returns {Promise<BatchResponse<Asset>>} Newly created assets.
95 */
96 createBatch: (params, cb) => shared.createBatch(client, '/create-asset', params, {cb}),
97
98 /**
99 * Update asset tags.
100 *
101 * @param {module:AssetsApi~updateTagsRequest} params - Parameters for updating asset tags.
102 * @param {objectCallback} [cb] - Optional callback. Use instead of Promise return value as desired.
103 * @returns {Promise<Object>} Success message.

Callers 1

constructorMethod · 0.85

Calls 5

singletonBatchRequestMethod · 0.80
batchRequestMethod · 0.80
queryMethod · 0.80
createMethod · 0.65
createBatchMethod · 0.45

Tested by

no test coverage detected