@xyo-network/diviner-payload-stats 6.0.0 → 6.0.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,5 +1,5 @@
1
1
  import type { DivinerConfig } from '@xyo-network/diviner-model';
2
- import { type Payload } from '@xyo-network/payload-model';
2
+ import { type Payload } from '@xyo-network/sdk-protocol-js';
3
3
  export declare const PayloadStatsDivinerConfigSchema: string & {
4
4
  readonly __schema: true;
5
5
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../src/Config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAC/D,OAAO,EAAY,KAAK,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAInE,eAAO,MAAM,+BAA+B;;CAAwD,CAAA;AACpG,MAAM,MAAM,+BAA+B,GAAG,OAAO,+BAA+B,CAAA;AAEpF,MAAM,MAAM,yBAAyB,CAAC,CAAC,SAAS,OAAO,GAAG,OAAO,IAAI,aAAa,CAChF,CAAC,GAAG;IACF,MAAM,EAAE,+BAA+B,CAAA;CACxC,CACF,CAAA"}
1
+ {"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../src/Config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAC/D,OAAO,EAAY,KAAK,OAAO,EAAE,MAAM,8BAA8B,CAAA;AAIrE,eAAO,MAAM,+BAA+B;;CAAwD,CAAA;AACpG,MAAM,MAAM,+BAA+B,GAAG,OAAO,+BAA+B,CAAA;AAEpF,MAAM,MAAM,yBAAyB,CAAC,CAAC,SAAS,OAAO,GAAG,OAAO,IAAI,aAAa,CAChF,CAAC,GAAG;IACF,MAAM,EAAE,+BAA+B,CAAA;CACxC,CACF,CAAA"}
@@ -1,11 +1,10 @@
1
- import type { Address } from '@xylabs/sdk-js';
2
- import { type Payload, type Schema } from '@xyo-network/payload-model';
1
+ import { type Payload, type Schema, type XyoAddress } from '@xyo-network/sdk-protocol-js';
3
2
  import type { PayloadStatsDivinerParams } from './Params.ts';
4
3
  import { PayloadStatsDiviner } from './PayloadStatsDiviner.ts';
5
4
  export declare class MemoryPayloadStatsDiviner<TParams extends PayloadStatsDivinerParams = PayloadStatsDivinerParams> extends PayloadStatsDiviner<TParams> {
6
5
  static readonly configSchemas: Schema[];
7
6
  static readonly defaultConfigSchema: Schema;
8
- protected divineAddress(address: Address): Promise<number>;
7
+ protected divineAddress(address: XyoAddress): Promise<number>;
9
8
  protected divineAllAddresses(): Promise<number>;
10
9
  protected divineHandler(payloads?: Payload[]): Promise<Payload[]>;
11
10
  }
@@ -1 +1 @@
1
- {"version":3,"file":"MemoryPayloadStatsDiviner.d.ts","sourceRoot":"","sources":["../../src/MemoryPayloadStatsDiviner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAI7C,OAAO,EACU,KAAK,OAAO,EAAE,KAAK,MAAM,EACzC,MAAM,4BAA4B,CAAA;AAGnC,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAA;AAE5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAK9D,qBAAa,yBAAyB,CAAC,OAAO,SAAS,yBAAyB,GAAG,yBAAyB,CAAE,SAAQ,mBAAmB,CAAC,OAAO,CAAC;IAChJ,gBAAyB,aAAa,EAAE,MAAM,EAAE,CAA4D;IAC5G,gBAAyB,mBAAmB,EAAE,MAAM,CAAkC;cAEtE,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC;cAShD,kBAAkB,IAAI,OAAO,CAAC,MAAM,CAAC;cAM5B,aAAa,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;CAcjF"}
1
+ {"version":3,"file":"MemoryPayloadStatsDiviner.d.ts","sourceRoot":"","sources":["../../src/MemoryPayloadStatsDiviner.ts"],"names":[],"mappings":"AAEA,OAAO,EACU,KAAK,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,UAAU,EAC1D,MAAM,8BAA8B,CAAA;AAGrC,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAA;AAE5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAK9D,qBAAa,yBAAyB,CAAC,OAAO,SAAS,yBAAyB,GAAG,yBAAyB,CAAE,SAAQ,mBAAmB,CAAC,OAAO,CAAC;IAChJ,gBAAyB,aAAa,EAAE,MAAM,EAAE,CAA4D;IAC5G,gBAAyB,mBAAmB,EAAE,MAAM,CAAkC;cAEtE,aAAa,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC;cASnD,kBAAkB,IAAI,OAAO,CAAC,MAAM,CAAC;cAM5B,aAAa,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;CAYjF"}
@@ -1,4 +1,4 @@
1
- import type { Payload } from '@xyo-network/payload-model';
1
+ import type { Payload } from '@xyo-network/sdk-protocol-js';
2
2
  import { PayloadStatsDivinerSchema } from './Schema.ts';
3
3
  export type PayloadStatsPayload = Payload<{
4
4
  count: number;
@@ -1 +1 @@
1
- {"version":3,"file":"Payload.d.ts","sourceRoot":"","sources":["../../src/Payload.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAEzD,OAAO,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAA;AAEvD,MAAM,MAAM,mBAAmB,GAAG,OAAO,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,yBAAyB,CAAA;CAAE,CAAC,CAAA;AAC/F,eAAO,MAAM,qBAAqB,GAAI,IAAI,OAAO,GAAG,IAAI,KAAG,CAAC,IAAI,mBAA8D,CAAA"}
1
+ {"version":3,"file":"Payload.d.ts","sourceRoot":"","sources":["../../src/Payload.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAA;AAE3D,OAAO,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAA;AAEvD,MAAM,MAAM,mBAAmB,GAAG,OAAO,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,yBAAyB,CAAA;CAAE,CAAC,CAAA;AAC/F,eAAO,MAAM,qBAAqB,GAAI,IAAI,OAAO,GAAG,IAAI,KAAG,CAAC,IAAI,mBAA8D,CAAA"}
@@ -1,6 +1,6 @@
1
1
  import { AbstractDiviner } from '@xyo-network/diviner-abstract';
2
2
  import type { DivinerInstance, DivinerModuleEventData } from '@xyo-network/diviner-model';
3
- import type { Payload } from '@xyo-network/payload-model';
3
+ import type { Payload } from '@xyo-network/sdk-protocol-js';
4
4
  import type { PayloadStatsDivinerParams } from './Params.ts';
5
5
  export declare abstract class PayloadStatsDiviner<TParams extends PayloadStatsDivinerParams = PayloadStatsDivinerParams, TIn extends Payload = Payload, TOut extends Payload = Payload, TEventData extends DivinerModuleEventData<DivinerInstance<TParams, TIn, TOut>, TIn, TOut> = DivinerModuleEventData<DivinerInstance<TParams, TIn, TOut>, TIn, TOut>> extends AbstractDiviner<TParams, TIn, TOut, TEventData> {
6
6
  }
@@ -1 +1 @@
1
- {"version":3,"file":"PayloadStatsDiviner.d.ts","sourceRoot":"","sources":["../../src/PayloadStatsDiviner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAA;AACzF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAEzD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAA;AAE5D,8BAAsB,mBAAmB,CACvC,OAAO,SAAS,yBAAyB,GAAG,yBAAyB,EACrE,GAAG,SAAS,OAAO,GAAG,OAAO,EAC7B,IAAI,SAAS,OAAO,GAAG,OAAO,EAC9B,UAAU,SAAS,sBAAsB,CAAC,eAAe,CAAC,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,sBAAsB,CAChH,eAAe,CAAC,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC,EACnC,GAAG,EACH,IAAI,CACL,CACD,SAAQ,eAAe,CAAC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,CAAC;CAAG"}
1
+ {"version":3,"file":"PayloadStatsDiviner.d.ts","sourceRoot":"","sources":["../../src/PayloadStatsDiviner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAA;AACzF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAA;AAE3D,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAA;AAE5D,8BAAsB,mBAAmB,CACvC,OAAO,SAAS,yBAAyB,GAAG,yBAAyB,EACrE,GAAG,SAAS,OAAO,GAAG,OAAO,EAC7B,IAAI,SAAS,OAAO,GAAG,OAAO,EAC9B,UAAU,SAAS,sBAAsB,CAAC,eAAe,CAAC,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,sBAAsB,CAChH,eAAe,CAAC,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC,EACnC,GAAG,EACH,IAAI,CACL,CACD,SAAQ,eAAe,CAAC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,CAAC;CAAG"}
@@ -1,4 +1,4 @@
1
- import { type Payload, type Query } from '@xyo-network/payload-model';
1
+ import { type Payload, type Query } from '@xyo-network/sdk-protocol-js';
2
2
  export declare const PayloadStatsQuerySchema: string & {
3
3
  readonly __schema: true;
4
4
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Query.d.ts","sourceRoot":"","sources":["../../src/Query.ts"],"names":[],"mappings":"AAAA,OAAO,EACK,KAAK,OAAO,EAAE,KAAK,KAAK,EACnC,MAAM,4BAA4B,CAAA;AAInC,eAAO,MAAM,uBAAuB;;CAAuD,CAAA;AAC3F,MAAM,MAAM,uBAAuB,GAAG,OAAO,uBAAuB,CAAA;AAEpE,MAAM,MAAM,wBAAwB,GAAG,KAAK,CAAC;IAAE,MAAM,EAAE,uBAAuB,CAAA;CAAE,CAAC,CAAA;AACjF,eAAO,MAAM,0BAA0B,GAAI,IAAI,OAAO,GAAG,IAAI,KAAG,CAAC,IAAI,wBAAiE,CAAA"}
1
+ {"version":3,"file":"Query.d.ts","sourceRoot":"","sources":["../../src/Query.ts"],"names":[],"mappings":"AAAA,OAAO,EACK,KAAK,OAAO,EAAE,KAAK,KAAK,EACnC,MAAM,8BAA8B,CAAA;AAIrC,eAAO,MAAM,uBAAuB;;CAAuD,CAAA;AAC3F,MAAM,MAAM,uBAAuB,GAAG,OAAO,uBAAuB,CAAA;AAEpE,MAAM,MAAM,wBAAwB,GAAG,KAAK,CAAC;IAAE,MAAM,EAAE,uBAAuB,CAAA;CAAE,CAAC,CAAA;AACjF,eAAO,MAAM,0BAA0B,GAAI,IAAI,OAAO,GAAG,IAAI,KAAG,CAAC,IAAI,wBAAiE,CAAA"}
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/PayloadStatsDiviner.ts"],
4
- "sourcesContent": ["import { AbstractDiviner } from '@xyo-network/diviner-abstract'\nimport type { DivinerInstance, DivinerModuleEventData } from '@xyo-network/diviner-model'\nimport type { Payload } from '@xyo-network/payload-model'\n\nimport type { PayloadStatsDivinerParams } from './Params.ts'\n\nexport abstract class PayloadStatsDiviner<\n TParams extends PayloadStatsDivinerParams = PayloadStatsDivinerParams,\n TIn extends Payload = Payload,\n TOut extends Payload = Payload,\n TEventData extends DivinerModuleEventData<DivinerInstance<TParams, TIn, TOut>, TIn, TOut> = DivinerModuleEventData<\n DivinerInstance<TParams, TIn, TOut>,\n TIn,\n TOut\n >,\n> extends AbstractDiviner<TParams, TIn, TOut, TEventData> {}\n"],
4
+ "sourcesContent": ["import { AbstractDiviner } from '@xyo-network/diviner-abstract'\nimport type { DivinerInstance, DivinerModuleEventData } from '@xyo-network/diviner-model'\nimport type { Payload } from '@xyo-network/sdk-protocol-js'\n\nimport type { PayloadStatsDivinerParams } from './Params.ts'\n\nexport abstract class PayloadStatsDiviner<\n TParams extends PayloadStatsDivinerParams = PayloadStatsDivinerParams,\n TIn extends Payload = Payload,\n TOut extends Payload = Payload,\n TEventData extends DivinerModuleEventData<DivinerInstance<TParams, TIn, TOut>, TIn, TOut> = DivinerModuleEventData<\n DivinerInstance<TParams, TIn, TOut>,\n TIn,\n TOut\n >,\n> extends AbstractDiviner<TParams, TIn, TOut, TEventData> {}\n"],
5
5
  "mappings": ";AAAA,SAAS,uBAAuB;AAMzB,IAAe,sBAAf,cASG,gBAAgD;AAAC;",
6
6
  "names": []
7
7
  }
@@ -5,17 +5,16 @@ var PayloadStatsDiviner = class extends AbstractDiviner {
5
5
 
6
6
  // src/MemoryPayloadStatsDiviner.ts
7
7
  import { assertEx } from "@xylabs/sdk-js";
8
- import { isBoundWitness } from "@xyo-network/boundwitness-model";
9
- import { PayloadBuilder } from "@xyo-network/payload-builder";
8
+ import { isBoundWitness, PayloadBuilder } from "@xyo-network/sdk-protocol-js";
10
9
  import {
11
10
  isStorageMeta
12
- } from "@xyo-network/payload-model";
11
+ } from "@xyo-network/sdk-protocol-js";
13
12
 
14
13
  // src/Config.ts
15
- import { asSchema as asSchema2 } from "@xyo-network/payload-model";
14
+ import { asSchema as asSchema2 } from "@xyo-network/sdk-protocol-js";
16
15
 
17
16
  // src/Schema.ts
18
- import { asSchema } from "@xyo-network/payload-model";
17
+ import { asSchema } from "@xyo-network/sdk-protocol-js";
19
18
  var PayloadStatsDivinerSchema = asSchema("network.xyo.diviner.payload.stats", true);
20
19
 
21
20
  // src/Config.ts
@@ -24,7 +23,7 @@ var PayloadStatsDivinerConfigSchema = asSchema2(`${PayloadStatsDivinerSchema}.co
24
23
  // src/Query.ts
25
24
  import {
26
25
  asSchema as asSchema3
27
- } from "@xyo-network/payload-model";
26
+ } from "@xyo-network/sdk-protocol-js";
28
27
  var PayloadStatsQuerySchema = asSchema3(`${PayloadStatsDivinerSchema}.query`, true);
29
28
  var isPayloadStatsQueryPayload = (x) => x?.schema === PayloadStatsQuerySchema;
30
29
 
@@ -46,9 +45,7 @@ var MemoryPayloadStatsDiviner = class extends PayloadStatsDiviner {
46
45
  if (!query) return [];
47
46
  const addresses = query?.address ? Array.isArray(query?.address) ? query.address : [query.address] : void 0;
48
47
  const counts = addresses ? await Promise.all(addresses.map((address) => this.divineAddress(address))) : [await this.divineAllAddresses()];
49
- return await Promise.all(
50
- counts.map((count) => new PayloadBuilder({ schema: PayloadStatsDivinerSchema }).fields({ count }).build())
51
- );
48
+ return counts.map((count) => new PayloadBuilder({ schema: PayloadStatsDivinerSchema }).fields({ count }).build());
52
49
  }
53
50
  };
54
51
 
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/PayloadStatsDiviner.ts", "../../src/MemoryPayloadStatsDiviner.ts", "../../src/Config.ts", "../../src/Schema.ts", "../../src/Query.ts", "../../src/Payload.ts"],
4
- "sourcesContent": ["import { AbstractDiviner } from '@xyo-network/diviner-abstract'\nimport type { DivinerInstance, DivinerModuleEventData } from '@xyo-network/diviner-model'\nimport type { Payload } from '@xyo-network/payload-model'\n\nimport type { PayloadStatsDivinerParams } from './Params.ts'\n\nexport abstract class PayloadStatsDiviner<\n TParams extends PayloadStatsDivinerParams = PayloadStatsDivinerParams,\n TIn extends Payload = Payload,\n TOut extends Payload = Payload,\n TEventData extends DivinerModuleEventData<DivinerInstance<TParams, TIn, TOut>, TIn, TOut> = DivinerModuleEventData<\n DivinerInstance<TParams, TIn, TOut>,\n TIn,\n TOut\n >,\n> extends AbstractDiviner<TParams, TIn, TOut, TEventData> {}\n", "import type { Address } from '@xylabs/sdk-js'\nimport { assertEx } from '@xylabs/sdk-js'\nimport { isBoundWitness } from '@xyo-network/boundwitness-model'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport {\n isStorageMeta, type Payload, type Schema,\n} from '@xyo-network/payload-model'\n\nimport { PayloadStatsDivinerConfigSchema } from './Config.ts'\nimport type { PayloadStatsDivinerParams } from './Params.ts'\nimport type { PayloadStatsPayload } from './Payload.ts'\nimport { PayloadStatsDiviner } from './PayloadStatsDiviner.ts'\nimport type { PayloadStatsQueryPayload } from './Query.ts'\nimport { isPayloadStatsQueryPayload } from './Query.ts'\nimport { PayloadStatsDivinerSchema } from './Schema.ts'\n\nexport class MemoryPayloadStatsDiviner<TParams extends PayloadStatsDivinerParams = PayloadStatsDivinerParams> extends PayloadStatsDiviner<TParams> {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, PayloadStatsDivinerConfigSchema]\n static override readonly defaultConfigSchema: Schema = PayloadStatsDivinerConfigSchema\n\n protected async divineAddress(address: Address): Promise<number> {\n const archivist = assertEx(await this.archivistInstance(), () => 'Unable to resolve archivist')\n return (await archivist.next({ limit: 20_000 }))\n .filter(x => isBoundWitness(x) && isStorageMeta(x))\n .filter(bw => bw.addresses.includes(address))\n .map(bw => bw.payload_hashes.length)\n .reduce((total, count) => total + count, 0)\n }\n\n protected async divineAllAddresses(): Promise<number> {\n const archivist = assertEx(await this.archivistInstance(), () => 'Unable to resolve archivist')\n const all = await archivist.next({ limit: 20_000 })\n return all.length\n }\n\n protected override async divineHandler(payloads?: Payload[]): Promise<Payload[]> {\n const query = payloads?.find<PayloadStatsQueryPayload>(isPayloadStatsQueryPayload)\n if (!query) return []\n const addresses\n = query?.address\n ? Array.isArray(query?.address)\n ? query.address\n : [query.address]\n : undefined\n const counts = addresses ? await Promise.all(addresses.map(address => this.divineAddress(address))) : [await this.divineAllAddresses()]\n return await Promise.all(\n counts.map(count => new PayloadBuilder<PayloadStatsPayload>({ schema: PayloadStatsDivinerSchema }).fields({ count }).build()),\n )\n }\n}\n", "import type { DivinerConfig } from '@xyo-network/diviner-model'\nimport { asSchema, type Payload } from '@xyo-network/payload-model'\n\nimport { PayloadStatsDivinerSchema } from './Schema.ts'\n\nexport const PayloadStatsDivinerConfigSchema = asSchema(`${PayloadStatsDivinerSchema}.config`, true)\nexport type PayloadStatsDivinerConfigSchema = typeof PayloadStatsDivinerConfigSchema\n\nexport type PayloadStatsDivinerConfig<T extends Payload = Payload> = DivinerConfig<\n T & {\n schema: PayloadStatsDivinerConfigSchema\n }\n>\n", "import { asSchema } from '@xyo-network/payload-model'\n\nexport const PayloadStatsDivinerSchema = asSchema('network.xyo.diviner.payload.stats', true)\nexport type PayloadStatsDivinerSchema = typeof PayloadStatsDivinerSchema\n", "import {\n asSchema, type Payload, type Query,\n} from '@xyo-network/payload-model'\n\nimport { PayloadStatsDivinerSchema } from './Schema.ts'\n\nexport const PayloadStatsQuerySchema = asSchema(`${PayloadStatsDivinerSchema}.query`, true)\nexport type PayloadStatsQuerySchema = typeof PayloadStatsQuerySchema\n\nexport type PayloadStatsQueryPayload = Query<{ schema: PayloadStatsQuerySchema }>\nexport const isPayloadStatsQueryPayload = (x?: Payload | null): x is PayloadStatsQueryPayload => x?.schema === PayloadStatsQuerySchema\n", "import type { Payload } from '@xyo-network/payload-model'\n\nimport { PayloadStatsDivinerSchema } from './Schema.ts'\n\nexport type PayloadStatsPayload = Payload<{ count: number; schema: PayloadStatsDivinerSchema }>\nexport const isPayloadStatsPayload = (x?: Payload | null): x is PayloadStatsPayload => x?.schema === PayloadStatsDivinerSchema\n"],
5
- "mappings": ";AAAA,SAAS,uBAAuB;AAMzB,IAAe,sBAAf,cASG,gBAAgD;AAAC;;;ACd3D,SAAS,gBAAgB;AACzB,SAAS,sBAAsB;AAC/B,SAAS,sBAAsB;AAC/B;AAAA,EACE;AAAA,OACK;;;ACLP,SAAS,YAAAA,iBAA8B;;;ACDvC,SAAS,gBAAgB;AAElB,IAAM,4BAA4B,SAAS,qCAAqC,IAAI;;;ADGpF,IAAM,kCAAkCC,UAAS,GAAG,yBAAyB,WAAW,IAAI;;;AELnG;AAAA,EACE,YAAAC;AAAA,OACK;AAIA,IAAM,0BAA0BC,UAAS,GAAG,yBAAyB,UAAU,IAAI;AAInF,IAAM,6BAA6B,CAAC,MAAsD,GAAG,WAAW;;;AHMxG,IAAM,4BAAN,cAA+G,oBAA6B;AAAA,EACjJ,OAAyB,gBAA0B,CAAC,GAAG,MAAM,eAAe,+BAA+B;AAAA,EAC3G,OAAyB,sBAA8B;AAAA,EAEvD,MAAgB,cAAc,SAAmC;AAC/D,UAAM,YAAY,SAAS,MAAM,KAAK,kBAAkB,GAAG,MAAM,6BAA6B;AAC9F,YAAQ,MAAM,UAAU,KAAK,EAAE,OAAO,IAAO,CAAC,GAC3C,OAAO,OAAK,eAAe,CAAC,KAAK,cAAc,CAAC,CAAC,EACjD,OAAO,QAAM,GAAG,UAAU,SAAS,OAAO,CAAC,EAC3C,IAAI,QAAM,GAAG,eAAe,MAAM,EAClC,OAAO,CAAC,OAAO,UAAU,QAAQ,OAAO,CAAC;AAAA,EAC9C;AAAA,EAEA,MAAgB,qBAAsC;AACpD,UAAM,YAAY,SAAS,MAAM,KAAK,kBAAkB,GAAG,MAAM,6BAA6B;AAC9F,UAAM,MAAM,MAAM,UAAU,KAAK,EAAE,OAAO,IAAO,CAAC;AAClD,WAAO,IAAI;AAAA,EACb;AAAA,EAEA,MAAyB,cAAc,UAA0C;AAC/E,UAAM,QAAQ,UAAU,KAA+B,0BAA0B;AACjF,QAAI,CAAC,MAAO,QAAO,CAAC;AACpB,UAAM,YACF,OAAO,UACL,MAAM,QAAQ,OAAO,OAAO,IAC1B,MAAM,UACN,CAAC,MAAM,OAAO,IAChB;AACN,UAAM,SAAS,YAAY,MAAM,QAAQ,IAAI,UAAU,IAAI,aAAW,KAAK,cAAc,OAAO,CAAC,CAAC,IAAI,CAAC,MAAM,KAAK,mBAAmB,CAAC;AACtI,WAAO,MAAM,QAAQ;AAAA,MACnB,OAAO,IAAI,WAAS,IAAI,eAAoC,EAAE,QAAQ,0BAA0B,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC;AAAA,IAC9H;AAAA,EACF;AACF;;;AI5CO,IAAM,wBAAwB,CAAC,MAAiD,GAAG,WAAW;",
4
+ "sourcesContent": ["import { AbstractDiviner } from '@xyo-network/diviner-abstract'\nimport type { DivinerInstance, DivinerModuleEventData } from '@xyo-network/diviner-model'\nimport type { Payload } from '@xyo-network/sdk-protocol-js'\n\nimport type { PayloadStatsDivinerParams } from './Params.ts'\n\nexport abstract class PayloadStatsDiviner<\n TParams extends PayloadStatsDivinerParams = PayloadStatsDivinerParams,\n TIn extends Payload = Payload,\n TOut extends Payload = Payload,\n TEventData extends DivinerModuleEventData<DivinerInstance<TParams, TIn, TOut>, TIn, TOut> = DivinerModuleEventData<\n DivinerInstance<TParams, TIn, TOut>,\n TIn,\n TOut\n >,\n> extends AbstractDiviner<TParams, TIn, TOut, TEventData> {}\n", "import { assertEx } from '@xylabs/sdk-js'\nimport { isBoundWitness, PayloadBuilder } from '@xyo-network/sdk-protocol-js'\nimport {\n isStorageMeta, type Payload, type Schema, type XyoAddress,\n} from '@xyo-network/sdk-protocol-js'\n\nimport { PayloadStatsDivinerConfigSchema } from './Config.ts'\nimport type { PayloadStatsDivinerParams } from './Params.ts'\nimport type { PayloadStatsPayload } from './Payload.ts'\nimport { PayloadStatsDiviner } from './PayloadStatsDiviner.ts'\nimport type { PayloadStatsQueryPayload } from './Query.ts'\nimport { isPayloadStatsQueryPayload } from './Query.ts'\nimport { PayloadStatsDivinerSchema } from './Schema.ts'\n\nexport class MemoryPayloadStatsDiviner<TParams extends PayloadStatsDivinerParams = PayloadStatsDivinerParams> extends PayloadStatsDiviner<TParams> {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, PayloadStatsDivinerConfigSchema]\n static override readonly defaultConfigSchema: Schema = PayloadStatsDivinerConfigSchema\n\n protected async divineAddress(address: XyoAddress): Promise<number> {\n const archivist = assertEx(await this.archivistInstance(), () => 'Unable to resolve archivist')\n return (await archivist.next({ limit: 20_000 }))\n .filter(x => isBoundWitness(x) && isStorageMeta(x))\n .filter(bw => bw.addresses.includes(address))\n .map(bw => bw.payload_hashes.length)\n .reduce((total, count) => total + count, 0)\n }\n\n protected async divineAllAddresses(): Promise<number> {\n const archivist = assertEx(await this.archivistInstance(), () => 'Unable to resolve archivist')\n const all = await archivist.next({ limit: 20_000 })\n return all.length\n }\n\n protected override async divineHandler(payloads?: Payload[]): Promise<Payload[]> {\n const query = payloads?.find<PayloadStatsQueryPayload>(isPayloadStatsQueryPayload)\n if (!query) return []\n const addresses\n = query?.address\n ? Array.isArray(query?.address)\n ? query.address\n : [query.address]\n : undefined\n const counts = addresses ? await Promise.all(addresses.map(address => this.divineAddress(address))) : [await this.divineAllAddresses()]\n return counts.map(count => new PayloadBuilder<PayloadStatsPayload>({ schema: PayloadStatsDivinerSchema }).fields({ count }).build())\n }\n}\n", "import type { DivinerConfig } from '@xyo-network/diviner-model'\nimport { asSchema, type Payload } from '@xyo-network/sdk-protocol-js'\n\nimport { PayloadStatsDivinerSchema } from './Schema.ts'\n\nexport const PayloadStatsDivinerConfigSchema = asSchema(`${PayloadStatsDivinerSchema}.config`, true)\nexport type PayloadStatsDivinerConfigSchema = typeof PayloadStatsDivinerConfigSchema\n\nexport type PayloadStatsDivinerConfig<T extends Payload = Payload> = DivinerConfig<\n T & {\n schema: PayloadStatsDivinerConfigSchema\n }\n>\n", "import { asSchema } from '@xyo-network/sdk-protocol-js'\n\nexport const PayloadStatsDivinerSchema = asSchema('network.xyo.diviner.payload.stats', true)\nexport type PayloadStatsDivinerSchema = typeof PayloadStatsDivinerSchema\n", "import {\n asSchema, type Payload, type Query,\n} from '@xyo-network/sdk-protocol-js'\n\nimport { PayloadStatsDivinerSchema } from './Schema.ts'\n\nexport const PayloadStatsQuerySchema = asSchema(`${PayloadStatsDivinerSchema}.query`, true)\nexport type PayloadStatsQuerySchema = typeof PayloadStatsQuerySchema\n\nexport type PayloadStatsQueryPayload = Query<{ schema: PayloadStatsQuerySchema }>\nexport const isPayloadStatsQueryPayload = (x?: Payload | null): x is PayloadStatsQueryPayload => x?.schema === PayloadStatsQuerySchema\n", "import type { Payload } from '@xyo-network/sdk-protocol-js'\n\nimport { PayloadStatsDivinerSchema } from './Schema.ts'\n\nexport type PayloadStatsPayload = Payload<{ count: number; schema: PayloadStatsDivinerSchema }>\nexport const isPayloadStatsPayload = (x?: Payload | null): x is PayloadStatsPayload => x?.schema === PayloadStatsDivinerSchema\n"],
5
+ "mappings": ";AAAA,SAAS,uBAAuB;AAMzB,IAAe,sBAAf,cASG,gBAAgD;AAAC;;;ACf3D,SAAS,gBAAgB;AACzB,SAAS,gBAAgB,sBAAsB;AAC/C;AAAA,EACE;AAAA,OACK;;;ACHP,SAAS,YAAAA,iBAA8B;;;ACDvC,SAAS,gBAAgB;AAElB,IAAM,4BAA4B,SAAS,qCAAqC,IAAI;;;ADGpF,IAAM,kCAAkCC,UAAS,GAAG,yBAAyB,WAAW,IAAI;;;AELnG;AAAA,EACE,YAAAC;AAAA,OACK;AAIA,IAAM,0BAA0BC,UAAS,GAAG,yBAAyB,UAAU,IAAI;AAInF,IAAM,6BAA6B,CAAC,MAAsD,GAAG,WAAW;;;AHIxG,IAAM,4BAAN,cAA+G,oBAA6B;AAAA,EACjJ,OAAyB,gBAA0B,CAAC,GAAG,MAAM,eAAe,+BAA+B;AAAA,EAC3G,OAAyB,sBAA8B;AAAA,EAEvD,MAAgB,cAAc,SAAsC;AAClE,UAAM,YAAY,SAAS,MAAM,KAAK,kBAAkB,GAAG,MAAM,6BAA6B;AAC9F,YAAQ,MAAM,UAAU,KAAK,EAAE,OAAO,IAAO,CAAC,GAC3C,OAAO,OAAK,eAAe,CAAC,KAAK,cAAc,CAAC,CAAC,EACjD,OAAO,QAAM,GAAG,UAAU,SAAS,OAAO,CAAC,EAC3C,IAAI,QAAM,GAAG,eAAe,MAAM,EAClC,OAAO,CAAC,OAAO,UAAU,QAAQ,OAAO,CAAC;AAAA,EAC9C;AAAA,EAEA,MAAgB,qBAAsC;AACpD,UAAM,YAAY,SAAS,MAAM,KAAK,kBAAkB,GAAG,MAAM,6BAA6B;AAC9F,UAAM,MAAM,MAAM,UAAU,KAAK,EAAE,OAAO,IAAO,CAAC;AAClD,WAAO,IAAI;AAAA,EACb;AAAA,EAEA,MAAyB,cAAc,UAA0C;AAC/E,UAAM,QAAQ,UAAU,KAA+B,0BAA0B;AACjF,QAAI,CAAC,MAAO,QAAO,CAAC;AACpB,UAAM,YACF,OAAO,UACL,MAAM,QAAQ,OAAO,OAAO,IAC1B,MAAM,UACN,CAAC,MAAM,OAAO,IAChB;AACN,UAAM,SAAS,YAAY,MAAM,QAAQ,IAAI,UAAU,IAAI,aAAW,KAAK,cAAc,OAAO,CAAC,CAAC,IAAI,CAAC,MAAM,KAAK,mBAAmB,CAAC;AACtI,WAAO,OAAO,IAAI,WAAS,IAAI,eAAoC,EAAE,QAAQ,0BAA0B,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC;AAAA,EACrI;AACF;;;AIxCO,IAAM,wBAAwB,CAAC,MAAiD,GAAG,WAAW;",
6
6
  "names": ["asSchema", "asSchema", "asSchema", "asSchema"]
7
7
  }
@@ -1,16 +1,15 @@
1
1
  // src/MemoryPayloadStatsDiviner.ts
2
2
  import { assertEx } from "@xylabs/sdk-js";
3
- import { isBoundWitness } from "@xyo-network/boundwitness-model";
4
- import { PayloadBuilder } from "@xyo-network/payload-builder";
3
+ import { isBoundWitness, PayloadBuilder } from "@xyo-network/sdk-protocol-js";
5
4
  import {
6
5
  isStorageMeta
7
- } from "@xyo-network/payload-model";
6
+ } from "@xyo-network/sdk-protocol-js";
8
7
 
9
8
  // src/Config.ts
10
- import { asSchema as asSchema2 } from "@xyo-network/payload-model";
9
+ import { asSchema as asSchema2 } from "@xyo-network/sdk-protocol-js";
11
10
 
12
11
  // src/Schema.ts
13
- import { asSchema } from "@xyo-network/payload-model";
12
+ import { asSchema } from "@xyo-network/sdk-protocol-js";
14
13
  var PayloadStatsDivinerSchema = asSchema("network.xyo.diviner.payload.stats", true);
15
14
 
16
15
  // src/Config.ts
@@ -24,7 +23,7 @@ var PayloadStatsDiviner = class extends AbstractDiviner {
24
23
  // src/Query.ts
25
24
  import {
26
25
  asSchema as asSchema3
27
- } from "@xyo-network/payload-model";
26
+ } from "@xyo-network/sdk-protocol-js";
28
27
  var PayloadStatsQuerySchema = asSchema3(`${PayloadStatsDivinerSchema}.query`, true);
29
28
  var isPayloadStatsQueryPayload = (x) => x?.schema === PayloadStatsQuerySchema;
30
29
 
@@ -46,9 +45,7 @@ var MemoryPayloadStatsDiviner = class extends PayloadStatsDiviner {
46
45
  if (!query) return [];
47
46
  const addresses = query?.address ? Array.isArray(query?.address) ? query.address : [query.address] : void 0;
48
47
  const counts = addresses ? await Promise.all(addresses.map((address) => this.divineAddress(address))) : [await this.divineAllAddresses()];
49
- return await Promise.all(
50
- counts.map((count) => new PayloadBuilder({ schema: PayloadStatsDivinerSchema }).fields({ count }).build())
51
- );
48
+ return counts.map((count) => new PayloadBuilder({ schema: PayloadStatsDivinerSchema }).fields({ count }).build());
52
49
  }
53
50
  };
54
51
  export {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/MemoryPayloadStatsDiviner.ts", "../../src/Config.ts", "../../src/Schema.ts", "../../src/PayloadStatsDiviner.ts", "../../src/Query.ts"],
4
- "sourcesContent": ["import type { Address } from '@xylabs/sdk-js'\nimport { assertEx } from '@xylabs/sdk-js'\nimport { isBoundWitness } from '@xyo-network/boundwitness-model'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport {\n isStorageMeta, type Payload, type Schema,\n} from '@xyo-network/payload-model'\n\nimport { PayloadStatsDivinerConfigSchema } from './Config.ts'\nimport type { PayloadStatsDivinerParams } from './Params.ts'\nimport type { PayloadStatsPayload } from './Payload.ts'\nimport { PayloadStatsDiviner } from './PayloadStatsDiviner.ts'\nimport type { PayloadStatsQueryPayload } from './Query.ts'\nimport { isPayloadStatsQueryPayload } from './Query.ts'\nimport { PayloadStatsDivinerSchema } from './Schema.ts'\n\nexport class MemoryPayloadStatsDiviner<TParams extends PayloadStatsDivinerParams = PayloadStatsDivinerParams> extends PayloadStatsDiviner<TParams> {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, PayloadStatsDivinerConfigSchema]\n static override readonly defaultConfigSchema: Schema = PayloadStatsDivinerConfigSchema\n\n protected async divineAddress(address: Address): Promise<number> {\n const archivist = assertEx(await this.archivistInstance(), () => 'Unable to resolve archivist')\n return (await archivist.next({ limit: 20_000 }))\n .filter(x => isBoundWitness(x) && isStorageMeta(x))\n .filter(bw => bw.addresses.includes(address))\n .map(bw => bw.payload_hashes.length)\n .reduce((total, count) => total + count, 0)\n }\n\n protected async divineAllAddresses(): Promise<number> {\n const archivist = assertEx(await this.archivistInstance(), () => 'Unable to resolve archivist')\n const all = await archivist.next({ limit: 20_000 })\n return all.length\n }\n\n protected override async divineHandler(payloads?: Payload[]): Promise<Payload[]> {\n const query = payloads?.find<PayloadStatsQueryPayload>(isPayloadStatsQueryPayload)\n if (!query) return []\n const addresses\n = query?.address\n ? Array.isArray(query?.address)\n ? query.address\n : [query.address]\n : undefined\n const counts = addresses ? await Promise.all(addresses.map(address => this.divineAddress(address))) : [await this.divineAllAddresses()]\n return await Promise.all(\n counts.map(count => new PayloadBuilder<PayloadStatsPayload>({ schema: PayloadStatsDivinerSchema }).fields({ count }).build()),\n )\n }\n}\n", "import type { DivinerConfig } from '@xyo-network/diviner-model'\nimport { asSchema, type Payload } from '@xyo-network/payload-model'\n\nimport { PayloadStatsDivinerSchema } from './Schema.ts'\n\nexport const PayloadStatsDivinerConfigSchema = asSchema(`${PayloadStatsDivinerSchema}.config`, true)\nexport type PayloadStatsDivinerConfigSchema = typeof PayloadStatsDivinerConfigSchema\n\nexport type PayloadStatsDivinerConfig<T extends Payload = Payload> = DivinerConfig<\n T & {\n schema: PayloadStatsDivinerConfigSchema\n }\n>\n", "import { asSchema } from '@xyo-network/payload-model'\n\nexport const PayloadStatsDivinerSchema = asSchema('network.xyo.diviner.payload.stats', true)\nexport type PayloadStatsDivinerSchema = typeof PayloadStatsDivinerSchema\n", "import { AbstractDiviner } from '@xyo-network/diviner-abstract'\nimport type { DivinerInstance, DivinerModuleEventData } from '@xyo-network/diviner-model'\nimport type { Payload } from '@xyo-network/payload-model'\n\nimport type { PayloadStatsDivinerParams } from './Params.ts'\n\nexport abstract class PayloadStatsDiviner<\n TParams extends PayloadStatsDivinerParams = PayloadStatsDivinerParams,\n TIn extends Payload = Payload,\n TOut extends Payload = Payload,\n TEventData extends DivinerModuleEventData<DivinerInstance<TParams, TIn, TOut>, TIn, TOut> = DivinerModuleEventData<\n DivinerInstance<TParams, TIn, TOut>,\n TIn,\n TOut\n >,\n> extends AbstractDiviner<TParams, TIn, TOut, TEventData> {}\n", "import {\n asSchema, type Payload, type Query,\n} from '@xyo-network/payload-model'\n\nimport { PayloadStatsDivinerSchema } from './Schema.ts'\n\nexport const PayloadStatsQuerySchema = asSchema(`${PayloadStatsDivinerSchema}.query`, true)\nexport type PayloadStatsQuerySchema = typeof PayloadStatsQuerySchema\n\nexport type PayloadStatsQueryPayload = Query<{ schema: PayloadStatsQuerySchema }>\nexport const isPayloadStatsQueryPayload = (x?: Payload | null): x is PayloadStatsQueryPayload => x?.schema === PayloadStatsQuerySchema\n"],
5
- "mappings": ";AACA,SAAS,gBAAgB;AACzB,SAAS,sBAAsB;AAC/B,SAAS,sBAAsB;AAC/B;AAAA,EACE;AAAA,OACK;;;ACLP,SAAS,YAAAA,iBAA8B;;;ACDvC,SAAS,gBAAgB;AAElB,IAAM,4BAA4B,SAAS,qCAAqC,IAAI;;;ADGpF,IAAM,kCAAkCC,UAAS,GAAG,yBAAyB,WAAW,IAAI;;;AELnG,SAAS,uBAAuB;AAMzB,IAAe,sBAAf,cASG,gBAAgD;AAAC;;;ACf3D;AAAA,EACE,YAAAC;AAAA,OACK;AAIA,IAAM,0BAA0BC,UAAS,GAAG,yBAAyB,UAAU,IAAI;AAInF,IAAM,6BAA6B,CAAC,MAAsD,GAAG,WAAW;;;AJMxG,IAAM,4BAAN,cAA+G,oBAA6B;AAAA,EACjJ,OAAyB,gBAA0B,CAAC,GAAG,MAAM,eAAe,+BAA+B;AAAA,EAC3G,OAAyB,sBAA8B;AAAA,EAEvD,MAAgB,cAAc,SAAmC;AAC/D,UAAM,YAAY,SAAS,MAAM,KAAK,kBAAkB,GAAG,MAAM,6BAA6B;AAC9F,YAAQ,MAAM,UAAU,KAAK,EAAE,OAAO,IAAO,CAAC,GAC3C,OAAO,OAAK,eAAe,CAAC,KAAK,cAAc,CAAC,CAAC,EACjD,OAAO,QAAM,GAAG,UAAU,SAAS,OAAO,CAAC,EAC3C,IAAI,QAAM,GAAG,eAAe,MAAM,EAClC,OAAO,CAAC,OAAO,UAAU,QAAQ,OAAO,CAAC;AAAA,EAC9C;AAAA,EAEA,MAAgB,qBAAsC;AACpD,UAAM,YAAY,SAAS,MAAM,KAAK,kBAAkB,GAAG,MAAM,6BAA6B;AAC9F,UAAM,MAAM,MAAM,UAAU,KAAK,EAAE,OAAO,IAAO,CAAC;AAClD,WAAO,IAAI;AAAA,EACb;AAAA,EAEA,MAAyB,cAAc,UAA0C;AAC/E,UAAM,QAAQ,UAAU,KAA+B,0BAA0B;AACjF,QAAI,CAAC,MAAO,QAAO,CAAC;AACpB,UAAM,YACF,OAAO,UACL,MAAM,QAAQ,OAAO,OAAO,IAC1B,MAAM,UACN,CAAC,MAAM,OAAO,IAChB;AACN,UAAM,SAAS,YAAY,MAAM,QAAQ,IAAI,UAAU,IAAI,aAAW,KAAK,cAAc,OAAO,CAAC,CAAC,IAAI,CAAC,MAAM,KAAK,mBAAmB,CAAC;AACtI,WAAO,MAAM,QAAQ;AAAA,MACnB,OAAO,IAAI,WAAS,IAAI,eAAoC,EAAE,QAAQ,0BAA0B,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC;AAAA,IAC9H;AAAA,EACF;AACF;",
4
+ "sourcesContent": ["import { assertEx } from '@xylabs/sdk-js'\nimport { isBoundWitness, PayloadBuilder } from '@xyo-network/sdk-protocol-js'\nimport {\n isStorageMeta, type Payload, type Schema, type XyoAddress,\n} from '@xyo-network/sdk-protocol-js'\n\nimport { PayloadStatsDivinerConfigSchema } from './Config.ts'\nimport type { PayloadStatsDivinerParams } from './Params.ts'\nimport type { PayloadStatsPayload } from './Payload.ts'\nimport { PayloadStatsDiviner } from './PayloadStatsDiviner.ts'\nimport type { PayloadStatsQueryPayload } from './Query.ts'\nimport { isPayloadStatsQueryPayload } from './Query.ts'\nimport { PayloadStatsDivinerSchema } from './Schema.ts'\n\nexport class MemoryPayloadStatsDiviner<TParams extends PayloadStatsDivinerParams = PayloadStatsDivinerParams> extends PayloadStatsDiviner<TParams> {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, PayloadStatsDivinerConfigSchema]\n static override readonly defaultConfigSchema: Schema = PayloadStatsDivinerConfigSchema\n\n protected async divineAddress(address: XyoAddress): Promise<number> {\n const archivist = assertEx(await this.archivistInstance(), () => 'Unable to resolve archivist')\n return (await archivist.next({ limit: 20_000 }))\n .filter(x => isBoundWitness(x) && isStorageMeta(x))\n .filter(bw => bw.addresses.includes(address))\n .map(bw => bw.payload_hashes.length)\n .reduce((total, count) => total + count, 0)\n }\n\n protected async divineAllAddresses(): Promise<number> {\n const archivist = assertEx(await this.archivistInstance(), () => 'Unable to resolve archivist')\n const all = await archivist.next({ limit: 20_000 })\n return all.length\n }\n\n protected override async divineHandler(payloads?: Payload[]): Promise<Payload[]> {\n const query = payloads?.find<PayloadStatsQueryPayload>(isPayloadStatsQueryPayload)\n if (!query) return []\n const addresses\n = query?.address\n ? Array.isArray(query?.address)\n ? query.address\n : [query.address]\n : undefined\n const counts = addresses ? await Promise.all(addresses.map(address => this.divineAddress(address))) : [await this.divineAllAddresses()]\n return counts.map(count => new PayloadBuilder<PayloadStatsPayload>({ schema: PayloadStatsDivinerSchema }).fields({ count }).build())\n }\n}\n", "import type { DivinerConfig } from '@xyo-network/diviner-model'\nimport { asSchema, type Payload } from '@xyo-network/sdk-protocol-js'\n\nimport { PayloadStatsDivinerSchema } from './Schema.ts'\n\nexport const PayloadStatsDivinerConfigSchema = asSchema(`${PayloadStatsDivinerSchema}.config`, true)\nexport type PayloadStatsDivinerConfigSchema = typeof PayloadStatsDivinerConfigSchema\n\nexport type PayloadStatsDivinerConfig<T extends Payload = Payload> = DivinerConfig<\n T & {\n schema: PayloadStatsDivinerConfigSchema\n }\n>\n", "import { asSchema } from '@xyo-network/sdk-protocol-js'\n\nexport const PayloadStatsDivinerSchema = asSchema('network.xyo.diviner.payload.stats', true)\nexport type PayloadStatsDivinerSchema = typeof PayloadStatsDivinerSchema\n", "import { AbstractDiviner } from '@xyo-network/diviner-abstract'\nimport type { DivinerInstance, DivinerModuleEventData } from '@xyo-network/diviner-model'\nimport type { Payload } from '@xyo-network/sdk-protocol-js'\n\nimport type { PayloadStatsDivinerParams } from './Params.ts'\n\nexport abstract class PayloadStatsDiviner<\n TParams extends PayloadStatsDivinerParams = PayloadStatsDivinerParams,\n TIn extends Payload = Payload,\n TOut extends Payload = Payload,\n TEventData extends DivinerModuleEventData<DivinerInstance<TParams, TIn, TOut>, TIn, TOut> = DivinerModuleEventData<\n DivinerInstance<TParams, TIn, TOut>,\n TIn,\n TOut\n >,\n> extends AbstractDiviner<TParams, TIn, TOut, TEventData> {}\n", "import {\n asSchema, type Payload, type Query,\n} from '@xyo-network/sdk-protocol-js'\n\nimport { PayloadStatsDivinerSchema } from './Schema.ts'\n\nexport const PayloadStatsQuerySchema = asSchema(`${PayloadStatsDivinerSchema}.query`, true)\nexport type PayloadStatsQuerySchema = typeof PayloadStatsQuerySchema\n\nexport type PayloadStatsQueryPayload = Query<{ schema: PayloadStatsQuerySchema }>\nexport const isPayloadStatsQueryPayload = (x?: Payload | null): x is PayloadStatsQueryPayload => x?.schema === PayloadStatsQuerySchema\n"],
5
+ "mappings": ";AAAA,SAAS,gBAAgB;AACzB,SAAS,gBAAgB,sBAAsB;AAC/C;AAAA,EACE;AAAA,OACK;;;ACHP,SAAS,YAAAA,iBAA8B;;;ACDvC,SAAS,gBAAgB;AAElB,IAAM,4BAA4B,SAAS,qCAAqC,IAAI;;;ADGpF,IAAM,kCAAkCC,UAAS,GAAG,yBAAyB,WAAW,IAAI;;;AELnG,SAAS,uBAAuB;AAMzB,IAAe,sBAAf,cASG,gBAAgD;AAAC;;;ACf3D;AAAA,EACE,YAAAC;AAAA,OACK;AAIA,IAAM,0BAA0BC,UAAS,GAAG,yBAAyB,UAAU,IAAI;AAInF,IAAM,6BAA6B,CAAC,MAAsD,GAAG,WAAW;;;AJIxG,IAAM,4BAAN,cAA+G,oBAA6B;AAAA,EACjJ,OAAyB,gBAA0B,CAAC,GAAG,MAAM,eAAe,+BAA+B;AAAA,EAC3G,OAAyB,sBAA8B;AAAA,EAEvD,MAAgB,cAAc,SAAsC;AAClE,UAAM,YAAY,SAAS,MAAM,KAAK,kBAAkB,GAAG,MAAM,6BAA6B;AAC9F,YAAQ,MAAM,UAAU,KAAK,EAAE,OAAO,IAAO,CAAC,GAC3C,OAAO,OAAK,eAAe,CAAC,KAAK,cAAc,CAAC,CAAC,EACjD,OAAO,QAAM,GAAG,UAAU,SAAS,OAAO,CAAC,EAC3C,IAAI,QAAM,GAAG,eAAe,MAAM,EAClC,OAAO,CAAC,OAAO,UAAU,QAAQ,OAAO,CAAC;AAAA,EAC9C;AAAA,EAEA,MAAgB,qBAAsC;AACpD,UAAM,YAAY,SAAS,MAAM,KAAK,kBAAkB,GAAG,MAAM,6BAA6B;AAC9F,UAAM,MAAM,MAAM,UAAU,KAAK,EAAE,OAAO,IAAO,CAAC;AAClD,WAAO,IAAI;AAAA,EACb;AAAA,EAEA,MAAyB,cAAc,UAA0C;AAC/E,UAAM,QAAQ,UAAU,KAA+B,0BAA0B;AACjF,QAAI,CAAC,MAAO,QAAO,CAAC;AACpB,UAAM,YACF,OAAO,UACL,MAAM,QAAQ,OAAO,OAAO,IAC1B,MAAM,UACN,CAAC,MAAM,OAAO,IAChB;AACN,UAAM,SAAS,YAAY,MAAM,QAAQ,IAAI,UAAU,IAAI,aAAW,KAAK,cAAc,OAAO,CAAC,CAAC,IAAI,CAAC,MAAM,KAAK,mBAAmB,CAAC;AACtI,WAAO,OAAO,IAAI,WAAS,IAAI,eAAoC,EAAE,QAAQ,0BAA0B,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC;AAAA,EACrI;AACF;",
6
6
  "names": ["asSchema", "asSchema", "asSchema", "asSchema"]
7
7
  }
@@ -1,8 +1,8 @@
1
1
  // src/Config.ts
2
- import { asSchema as asSchema2 } from "@xyo-network/payload-model";
2
+ import { asSchema as asSchema2 } from "@xyo-network/sdk-protocol-js";
3
3
 
4
4
  // src/Schema.ts
5
- import { asSchema } from "@xyo-network/payload-model";
5
+ import { asSchema } from "@xyo-network/sdk-protocol-js";
6
6
  var PayloadStatsDivinerSchema = asSchema("network.xyo.diviner.payload.stats", true);
7
7
 
8
8
  // src/Config.ts
@@ -14,7 +14,7 @@ var isPayloadStatsPayload = (x) => x?.schema === PayloadStatsDivinerSchema;
14
14
  // src/Query.ts
15
15
  import {
16
16
  asSchema as asSchema3
17
- } from "@xyo-network/payload-model";
17
+ } from "@xyo-network/sdk-protocol-js";
18
18
  var PayloadStatsQuerySchema = asSchema3(`${PayloadStatsDivinerSchema}.query`, true);
19
19
  var isPayloadStatsQueryPayload = (x) => x?.schema === PayloadStatsQuerySchema;
20
20
  export {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/Config.ts", "../../src/Schema.ts", "../../src/Payload.ts", "../../src/Query.ts"],
4
- "sourcesContent": ["import type { DivinerConfig } from '@xyo-network/diviner-model'\nimport { asSchema, type Payload } from '@xyo-network/payload-model'\n\nimport { PayloadStatsDivinerSchema } from './Schema.ts'\n\nexport const PayloadStatsDivinerConfigSchema = asSchema(`${PayloadStatsDivinerSchema}.config`, true)\nexport type PayloadStatsDivinerConfigSchema = typeof PayloadStatsDivinerConfigSchema\n\nexport type PayloadStatsDivinerConfig<T extends Payload = Payload> = DivinerConfig<\n T & {\n schema: PayloadStatsDivinerConfigSchema\n }\n>\n", "import { asSchema } from '@xyo-network/payload-model'\n\nexport const PayloadStatsDivinerSchema = asSchema('network.xyo.diviner.payload.stats', true)\nexport type PayloadStatsDivinerSchema = typeof PayloadStatsDivinerSchema\n", "import type { Payload } from '@xyo-network/payload-model'\n\nimport { PayloadStatsDivinerSchema } from './Schema.ts'\n\nexport type PayloadStatsPayload = Payload<{ count: number; schema: PayloadStatsDivinerSchema }>\nexport const isPayloadStatsPayload = (x?: Payload | null): x is PayloadStatsPayload => x?.schema === PayloadStatsDivinerSchema\n", "import {\n asSchema, type Payload, type Query,\n} from '@xyo-network/payload-model'\n\nimport { PayloadStatsDivinerSchema } from './Schema.ts'\n\nexport const PayloadStatsQuerySchema = asSchema(`${PayloadStatsDivinerSchema}.query`, true)\nexport type PayloadStatsQuerySchema = typeof PayloadStatsQuerySchema\n\nexport type PayloadStatsQueryPayload = Query<{ schema: PayloadStatsQuerySchema }>\nexport const isPayloadStatsQueryPayload = (x?: Payload | null): x is PayloadStatsQueryPayload => x?.schema === PayloadStatsQuerySchema\n"],
4
+ "sourcesContent": ["import type { DivinerConfig } from '@xyo-network/diviner-model'\nimport { asSchema, type Payload } from '@xyo-network/sdk-protocol-js'\n\nimport { PayloadStatsDivinerSchema } from './Schema.ts'\n\nexport const PayloadStatsDivinerConfigSchema = asSchema(`${PayloadStatsDivinerSchema}.config`, true)\nexport type PayloadStatsDivinerConfigSchema = typeof PayloadStatsDivinerConfigSchema\n\nexport type PayloadStatsDivinerConfig<T extends Payload = Payload> = DivinerConfig<\n T & {\n schema: PayloadStatsDivinerConfigSchema\n }\n>\n", "import { asSchema } from '@xyo-network/sdk-protocol-js'\n\nexport const PayloadStatsDivinerSchema = asSchema('network.xyo.diviner.payload.stats', true)\nexport type PayloadStatsDivinerSchema = typeof PayloadStatsDivinerSchema\n", "import type { Payload } from '@xyo-network/sdk-protocol-js'\n\nimport { PayloadStatsDivinerSchema } from './Schema.ts'\n\nexport type PayloadStatsPayload = Payload<{ count: number; schema: PayloadStatsDivinerSchema }>\nexport const isPayloadStatsPayload = (x?: Payload | null): x is PayloadStatsPayload => x?.schema === PayloadStatsDivinerSchema\n", "import {\n asSchema, type Payload, type Query,\n} from '@xyo-network/sdk-protocol-js'\n\nimport { PayloadStatsDivinerSchema } from './Schema.ts'\n\nexport const PayloadStatsQuerySchema = asSchema(`${PayloadStatsDivinerSchema}.query`, true)\nexport type PayloadStatsQuerySchema = typeof PayloadStatsQuerySchema\n\nexport type PayloadStatsQueryPayload = Query<{ schema: PayloadStatsQuerySchema }>\nexport const isPayloadStatsQueryPayload = (x?: Payload | null): x is PayloadStatsQueryPayload => x?.schema === PayloadStatsQuerySchema\n"],
5
5
  "mappings": ";AACA,SAAS,YAAAA,iBAA8B;;;ACDvC,SAAS,gBAAgB;AAElB,IAAM,4BAA4B,SAAS,qCAAqC,IAAI;;;ADGpF,IAAM,kCAAkCC,UAAS,GAAG,yBAAyB,WAAW,IAAI;;;AEA5F,IAAM,wBAAwB,CAAC,MAAiD,GAAG,WAAW;;;ACLrG;AAAA,EACE,YAAAC;AAAA,OACK;AAIA,IAAM,0BAA0BC,UAAS,GAAG,yBAAyB,UAAU,IAAI;AAInF,IAAM,6BAA6B,CAAC,MAAsD,GAAG,WAAW;",
6
6
  "names": ["asSchema", "asSchema", "asSchema", "asSchema"]
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/diviner-payload-stats",
3
- "version": "6.0.0",
3
+ "version": "6.0.2",
4
4
  "description": "Primary SDK for using XYO Protocol 2.0",
5
5
  "homepage": "https://xyo.network",
6
6
  "bugs": {
@@ -46,74 +46,64 @@
46
46
  "README.md"
47
47
  ],
48
48
  "dependencies": {
49
- "@xyo-network/diviner-model": "~6.0.0",
50
- "@xyo-network/module-model": "~6.0.0",
51
- "@xyo-network/diviner-abstract": "~6.0.0"
49
+ "@xyo-network/diviner-abstract": "~6.0.2",
50
+ "@xyo-network/diviner-model": "~6.0.2",
51
+ "@xyo-network/module-model": "~6.0.2"
52
52
  },
53
53
  "devDependencies": {
54
54
  "@bitauth/libauth": "~3.0.0",
55
+ "@metamask/providers": "^22.1.1",
56
+ "@noble/post-quantum": "~0.6.1",
55
57
  "@opentelemetry/api": "^1.9.1",
56
58
  "@opentelemetry/sdk-trace-base": "^2.7.1",
57
59
  "@scure/base": "~2.2.0",
58
- "@xylabs/sdk-js": "^6.0.0",
59
- "@xylabs/threads": "~6.0.0",
60
- "@xylabs/toolchain": "~8.0.17",
61
- "@xylabs/tsconfig": "~8.0.17",
62
- "@xyo-network/account": "~6.0",
63
- "@xyo-network/account-model": "~6.0",
64
- "@xyo-network/boundwitness-builder": "~6.0",
65
- "@xyo-network/boundwitness-model": "~6.0",
66
- "@xyo-network/boundwitness-wrapper": "~6.0",
67
- "@xyo-network/config-payload-plugin": "~6.0",
68
- "@xyo-network/manifest-model": "~6.0",
69
- "@xyo-network/payload-builder": "~6.0.0",
70
- "@xyo-network/payload-model": "~6.0.0",
71
- "@xyo-network/query-payload-plugin": "~6.0",
72
- "@xyo-network/wallet-model": "~6.0",
60
+ "@scure/bip39": "~2.2.0",
61
+ "@xylabs/geo": "^6.0.6",
62
+ "@xylabs/sdk-js": "^6.0.6",
63
+ "@xylabs/threads": "^6.0.6",
64
+ "@xylabs/toolchain": "~8.1.8",
65
+ "@xylabs/tsconfig": "~8.1.8",
66
+ "@xyo-network/sdk-protocol-js": "~6.0.7",
67
+ "ajv": "^8.20.0",
73
68
  "async-mutex": "^0.5.0",
74
69
  "bn.js": "^5.2.3",
75
70
  "buffer": "^6.0.3",
76
- "chalk": "^5.6.2",
77
71
  "debug": "~4.4.3",
78
- "eslint": "^10.4.0",
72
+ "eslint": "^10.4.1",
79
73
  "ethers": "^6.16.0",
80
74
  "hash-wasm": "~4.12.0",
81
- "lru-cache": "^11.5.0",
75
+ "idb": "^8.0.3",
76
+ "lru-cache": "^11.5.1",
82
77
  "observable-fns": "~0.6.1",
83
78
  "pako": "~2.1.0",
84
79
  "typescript": "~6.0.3",
85
- "wasm-feature-detect": "~1.8.0",
80
+ "webextension-polyfill": "^0.12.0",
86
81
  "zod": "^4.4.3"
87
82
  },
88
83
  "peerDependencies": {
89
84
  "@bitauth/libauth": "~3.0",
85
+ "@metamask/providers": "^22.1",
86
+ "@noble/post-quantum": "~0.6.1",
90
87
  "@opentelemetry/api": "^1.9",
91
88
  "@opentelemetry/sdk-trace-base": "^2.7",
92
89
  "@scure/base": "~2.2",
90
+ "@scure/bip39": "~2.2",
91
+ "@xylabs/geo": "^6.0",
93
92
  "@xylabs/sdk-js": "^6.0",
94
- "@xylabs/threads": "~6.0",
95
- "@xyo-network/account": "~6.0",
96
- "@xyo-network/account-model": "~6.0",
97
- "@xyo-network/boundwitness-builder": "~6.0",
98
- "@xyo-network/boundwitness-model": "~6.0",
99
- "@xyo-network/boundwitness-wrapper": "~6.0",
100
- "@xyo-network/config-payload-plugin": "~6.0",
101
- "@xyo-network/manifest-model": "~6.0",
102
- "@xyo-network/payload-builder": "~6.0",
103
- "@xyo-network/payload-model": "~6.0",
104
- "@xyo-network/query-payload-plugin": "~6.0",
105
- "@xyo-network/wallet-model": "~6.0",
93
+ "@xylabs/threads": "^6.0",
94
+ "@xyo-network/sdk-protocol-js": "~6.0",
95
+ "ajv": "^8.20",
106
96
  "async-mutex": "^0.5",
107
97
  "bn.js": "^5.2",
108
98
  "buffer": "^6.0",
109
- "chalk": "^5.6",
110
99
  "debug": "~4.4",
111
100
  "ethers": "^6.16",
112
101
  "hash-wasm": "~4.12",
102
+ "idb": "^8.0",
113
103
  "lru-cache": "^11.3",
114
104
  "observable-fns": "~0.6",
115
105
  "pako": "~2.1",
116
- "wasm-feature-detect": "~1.8",
106
+ "webextension-polyfill": "^0.12",
117
107
  "zod": "^4.4"
118
108
  },
119
109
  "publishConfig": {