@koralabs/kora-labs-common 6.1.1 → 6.1.2

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.
@@ -1,7 +1,6 @@
1
1
  import { IPersonalizedHandle, ISubHandleSettings, IUTxO } from '.';
2
2
  import { Sort } from '../../types';
3
- export interface SubHandleSettings {
4
- settings: ISubHandleSettings;
3
+ export interface SubHandleSettings extends ISubHandleSettings {
5
4
  utxo: IUTxO;
6
5
  }
7
6
  export interface StoredHandle extends IPersonalizedHandle {
@@ -14,10 +13,7 @@ export interface StoredHandle extends IPersonalizedHandle {
14
13
  [key: string]: string;
15
14
  };
16
15
  payment_key_hash: string;
17
- subhandle_settings?: {
18
- settings?: string;
19
- utxo: IUTxO;
20
- };
16
+ subhandle_settings?: SubHandleSettings;
21
17
  sub_rarity?: string;
22
18
  sub_length?: number;
23
19
  sub_characters?: string;
@@ -72,21 +68,27 @@ export interface HolderViewModel {
72
68
  default_handle: string;
73
69
  manually_set: boolean;
74
70
  }
75
- export interface IGetAllQueryParams {
76
- records_per_page?: string;
77
- page?: string;
78
- sort?: Sort;
71
+ export interface IHandleSearchParams {
79
72
  characters?: string;
80
73
  length?: string;
81
74
  rarity?: string;
82
75
  numeric_modifiers?: string;
83
- slot_number?: string;
84
76
  search?: string;
85
77
  holder_address?: string;
86
78
  personalized?: boolean;
87
- og?: 'true' | 'false';
88
79
  handle_type?: string;
89
- type: string;
80
+ public_subhandles?: boolean;
81
+ og?: 'true' | 'false';
82
+ }
83
+ export interface IHandleSearchInput extends IHandleSearchParams {
84
+ handles?: string[];
85
+ }
86
+ export interface IGetAllQueryParams extends IHandleSearchParams {
87
+ records_per_page?: string;
88
+ page?: string;
89
+ sort?: Sort;
90
+ slot_number?: string;
91
+ type?: 'bech32stake' | 'holder' | 'stakekeyhash' | 'assetname' | 'handlehex' | 'paymentkeyhash' | 'bech32address' | 'hexaddress';
90
92
  }
91
93
  export type ISearchBody = string[];
92
94
  export interface IGetAllHoldersQueryParams {
@@ -1,16 +1,5 @@
1
- interface HandleSearchInput {
2
- characters?: string;
3
- length?: string;
4
- rarity?: string;
5
- numeric_modifiers?: string;
6
- search?: string;
7
- holder_address?: string;
8
- personalized?: boolean;
9
- handle_type?: string;
10
- og?: string;
11
- handles?: string[];
12
- }
13
- export declare class HandleSearchModel {
1
+ import { IHandleSearchInput } from '..';
2
+ export declare class HandleSearchModel implements IHandleSearchInput {
14
3
  private _characters?;
15
4
  private _length?;
16
5
  private _rarity?;
@@ -21,7 +10,8 @@ export declare class HandleSearchModel {
21
10
  private _handle_type?;
22
11
  private _og?;
23
12
  private _handles?;
24
- constructor(input?: HandleSearchInput);
13
+ private _public_subhandles?;
14
+ constructor(input?: IHandleSearchInput);
25
15
  get characters(): string | undefined;
26
16
  set characters(value: string | undefined);
27
17
  get rarity(): string | undefined;
@@ -38,9 +28,10 @@ export declare class HandleSearchModel {
38
28
  set holder_address(value: string | undefined);
39
29
  get personalized(): boolean | undefined;
40
30
  set personalized(value: boolean | undefined);
41
- get og(): boolean | undefined;
42
- set og(value: boolean | undefined);
31
+ get og(): "true" | "false" | undefined;
32
+ set og(value: "true" | "false" | undefined);
33
+ get public_subhandles(): boolean | undefined;
34
+ set public_subhandles(value: boolean | undefined);
43
35
  get handles(): string[] | undefined;
44
36
  set handles(value: string[] | undefined);
45
37
  }
46
- export {};
@@ -6,17 +6,11 @@ const errors_1 = require("../../errors");
6
6
  const utils_1 = require("../../utils");
7
7
  class HandleSearchModel {
8
8
  constructor(input) {
9
- const { characters, length, rarity, numeric_modifiers, search, holder_address, og, personalized, handle_type, handles } = input !== null && input !== void 0 ? input : {};
10
- this.characters = characters;
11
- this.length = length;
12
- this.rarity = rarity;
13
- this.numeric_modifiers = numeric_modifiers;
14
- this.search = search;
15
- this.holder_address = holder_address;
16
- this.personalized = personalized;
17
- this.handle_type = handle_type;
18
- this.og = og === 'true';
19
- this.handles = handles;
9
+ for (const key in input) {
10
+ if (input.hasOwnProperty(key) && this.hasOwnProperty(key)) {
11
+ this[key] = input[key];
12
+ }
13
+ }
20
14
  }
21
15
  get characters() {
22
16
  return this._characters;
@@ -111,6 +105,12 @@ class HandleSearchModel {
111
105
  set og(value) {
112
106
  this._og = value;
113
107
  }
108
+ get public_subhandles() {
109
+ return this._public_subhandles;
110
+ }
111
+ set public_subhandles(value) {
112
+ this._public_subhandles = value;
113
+ }
114
114
  get handles() {
115
115
  return this._handles;
116
116
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@koralabs/kora-labs-common",
3
- "version": "6.1.1",
3
+ "version": "6.1.2",
4
4
  "description": "Kora Labs Common Utilities",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -358,7 +358,7 @@ const decodeObject = ({ val, constr = null, schema = {}, defaultKeyType = Defaul
358
358
  }
359
359
  else if (Buffer.isBuffer(val)) {
360
360
  if (schema === 'string' || schema === 'bool') {
361
- const result = Buffer.from(val).toString('utf8');
361
+ const result = val.toString('utf8');
362
362
  if (schema === 'bool' && (0, boolean_1.isBooleanable)(result)) {
363
363
  return (0, boolean_1.boolean)(result);
364
364
  }
@@ -368,7 +368,7 @@ const decodeObject = ({ val, constr = null, schema = {}, defaultKeyType = Defaul
368
368
  // }
369
369
  return result;
370
370
  }
371
- return `0x${Buffer.from(val).toString('hex')}`;
371
+ return `0x${val.toString('hex')}`;
372
372
  }
373
373
  else {
374
374
  if (schema === 'bool' && (0, boolean_1.isBooleanable)(val)) {
@@ -383,7 +383,8 @@ const decodeCborToJson = async ({ cborString, schema, defaultKeyType, forJson })
383
383
  121: (val) => ({ [`constructor_0`]: val }),
384
384
  122: (val) => ({ [`constructor_1`]: val }),
385
385
  123: (val) => ({ [`constructor_2`]: val }),
386
- 124: (val) => ({ [`constructor_3`]: val })
386
+ 124: (val) => ({ [`constructor_3`]: val }),
387
+ 125: (val) => ({ [`constructor_3`]: val })
387
388
  }
388
389
  });
389
390
  let [data] = decoded;