@dcspark/cml-cip25-wasm-nodejs
Advanced tools
Comparing version
@@ -139,2 +139,19 @@ /* tslint:disable */ | ||
/** | ||
* Create a Metadata containing only the CIP25 schema | ||
* @returns {Metadata} | ||
*/ | ||
to_metadata(): Metadata; | ||
/** | ||
* Read the CIP25 schema from a Metadata. Ignores all other data besides CIP25 | ||
* Can fail if the Metadata does not conform to CIP25 | ||
* @param {Metadata} metadata | ||
* @returns {CIP25Metadata} | ||
*/ | ||
static from_metadata(metadata: Metadata): CIP25Metadata; | ||
/** | ||
* Add to an existing metadata (could be empty) the full CIP25 metadata | ||
* @param {Metadata} metadata | ||
*/ | ||
add_to_metadata(metadata: Metadata): void; | ||
/** | ||
* Serialize to CBOR bytes compatible with tx metadata | ||
@@ -179,19 +196,2 @@ * Does not guarantee any specific type of CBOR format and should NOT | ||
static new(key_721: LabelMetadata): CIP25Metadata; | ||
/** | ||
* Create a Metadata containing only the CIP25 schema | ||
* @returns {Metadata} | ||
*/ | ||
to_metadata(): Metadata; | ||
/** | ||
* Read the CIP25 schema from a Metadata. Ignores all other data besides CIP25 | ||
* Can fail if the Metadata does not conform to CIP25 | ||
* @param {Metadata} metadata | ||
* @returns {CIP25Metadata} | ||
*/ | ||
static from_metadata(metadata: Metadata): CIP25Metadata; | ||
/** | ||
* Add to an existing metadata (could be empty) the full CIP25 metadata | ||
* @param {Metadata} metadata | ||
*/ | ||
add_to_metadata(metadata: Metadata): void; | ||
} | ||
@@ -210,2 +210,11 @@ /** | ||
/** | ||
* @param {string} str | ||
* @returns {ChunkableString} | ||
*/ | ||
static from_string(str: string): ChunkableString; | ||
/** | ||
* @returns {string} | ||
*/ | ||
to_string(): string; | ||
/** | ||
* @returns {Uint8Array} | ||
@@ -254,11 +263,2 @@ */ | ||
as_chunked(): String64s | undefined; | ||
/** | ||
* @param {string} str | ||
* @returns {ChunkableString} | ||
*/ | ||
static from_string(str: string): ChunkableString; | ||
/** | ||
* @returns {string} | ||
*/ | ||
to_string(): string; | ||
} | ||
@@ -716,2 +716,47 @@ /** | ||
*/ | ||
export class MiniMetadataDetails { | ||
free(): void; | ||
/** | ||
* @returns {MiniMetadataDetails} | ||
*/ | ||
static new(): MiniMetadataDetails; | ||
/** | ||
* @returns {string} | ||
*/ | ||
to_json(): string; | ||
/** | ||
* @returns {MiniMetadataDetailsJSON} | ||
*/ | ||
to_json_value(): any; | ||
/** | ||
* @param {string} json | ||
* @returns {MiniMetadataDetails} | ||
*/ | ||
static from_json(json: string): MiniMetadataDetails; | ||
/** | ||
* @param {String64} name | ||
*/ | ||
set_name(name: String64): void; | ||
/** | ||
* @returns {String64 | undefined} | ||
*/ | ||
name(): String64 | undefined; | ||
/** | ||
* @param {ChunkableString} image | ||
*/ | ||
set_image(image: ChunkableString): void; | ||
/** | ||
* @returns {ChunkableString | undefined} | ||
*/ | ||
image(): ChunkableString | undefined; | ||
/** | ||
* loose parsing of CIP25 metadata to allow for common exceptions to the format | ||
* `metadatum` should represent the data where the `MetadataDetails` is in the cip25 structure | ||
* @param {TransactionMetadatum} metadatum | ||
* @returns {MiniMetadataDetails} | ||
*/ | ||
static loose_parse(metadatum: TransactionMetadatum): MiniMetadataDetails; | ||
} | ||
/** | ||
*/ | ||
export class PolicyIdV1 { | ||
@@ -828,2 +873,15 @@ free(): void; | ||
/** | ||
* @param {string} s | ||
* @returns {String64} | ||
*/ | ||
static new(s: string): String64; | ||
/** | ||
* @returns {string} | ||
*/ | ||
to_str(): string; | ||
/** | ||
* @returns {string} | ||
*/ | ||
get_str(): string; | ||
/** | ||
* @returns {Uint8Array} | ||
@@ -854,15 +912,2 @@ */ | ||
get(): string; | ||
/** | ||
* @param {string} s | ||
* @returns {String64} | ||
*/ | ||
static new(s: string): String64; | ||
/** | ||
* @returns {string} | ||
*/ | ||
to_str(): string; | ||
/** | ||
* @returns {string} | ||
*/ | ||
get_str(): string; | ||
} | ||
@@ -869,0 +914,0 @@ /** |
{ | ||
"name": "@dcspark/cml-cip25-wasm-nodejs", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"files": [ | ||
@@ -5,0 +5,0 @@ "cml_cip25_wasm_bg.wasm", |
@@ -47,2 +47,9 @@ # cml-cip25 | ||
} | ||
``` | ||
We also support loose NFT parsing to try and parse key information out of potentially incorrectly formatted CIP25 | ||
```typescript | ||
const details = wasm.CIP25.MiniMetadataDetails.loose_parse(Buffer.from("a1646e616d65694d6574617665727365", "hex")); | ||
console.log(details.name()); | ||
``` |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
672788
2.38%4267
4.48%54
14.89%