@xoxno/types 1.0.488 → 1.0.489

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -59,6 +59,7 @@ export declare class NftDoc extends NftDocBase {
59
59
  owner?: string;
60
60
  saleInfo?: NftSaleInfo;
61
61
  metadata?: NftMetadata;
62
+ constructor(props?: Partial<NftDoc>);
62
63
  }
63
64
  export declare class ExtraProperties {
64
65
  currentEpoch?: number;
@@ -310,9 +310,15 @@ __decorate([
310
310
  __metadata("design:type", Number)
311
311
  ], NftDocBase.prototype, "_ts", void 0);
312
312
  class NftDoc extends NftDocBase {
313
- constructor() {
314
- super(...arguments);
313
+ constructor(props) {
314
+ super(props);
315
315
  this.metadata = { attributes: [] };
316
+ // Subclass field initializers run AFTER the base constructor's
317
+ // Object.assign, so the `= { attributes: [] }` default above would
318
+ // silently clobber any metadata passed in props. Re-apply it.
319
+ if (props?.metadata !== undefined) {
320
+ this.metadata = props.metadata;
321
+ }
316
322
  }
317
323
  }
318
324
  exports.NftDoc = NftDoc;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xoxno/types",
3
- "version": "1.0.488",
3
+ "version": "1.0.489",
4
4
  "description": "Shared types and utilities for XOXNO API.",
5
5
  "exports": {
6
6
  ".": {