@xyo-network/core 2.20.20 → 2.20.23

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.
@@ -19,7 +19,7 @@ export declare class Huri {
19
19
  private validateParse;
20
20
  get href(): string;
21
21
  toString(): string;
22
- fetch(): Promise<XyoPayload | undefined>;
22
+ fetch(): Promise<import("../Payload").XyoPayloadFull | undefined>;
23
23
  static fetch(huri: Huri): Promise<XyoPayload | undefined>;
24
24
  private static parseProtocol;
25
25
  private static parsePath;
@@ -4,6 +4,6 @@ import { XyoPayloadWrapper } from './Wrapper';
4
4
  export declare class XyoPayloadWrapperValidator<T extends XyoPayloadWrapper<XyoPayload> = XyoPayloadWrapper<XyoPayload>> {
5
5
  protected wrapper: T;
6
6
  constructor(wrapper: T);
7
- get payload(): XyoPayloadValidator<XyoPayload>;
7
+ get payload(): XyoPayloadValidator<import("../models").XyoPayloadFull>;
8
8
  all(): Error[];
9
9
  }
@@ -1,4 +1,4 @@
1
1
  import { XyoPayloadBody } from './Body';
2
2
  import { WithXyoPayloadMeta } from './WithXyoPayloadMeta';
3
- declare type XyoPayload = WithXyoPayloadMeta<XyoPayloadBody>;
4
- export type { XyoPayload };
3
+ export declare type XyoPayloadFull = WithXyoPayloadMeta<XyoPayloadBody>;
4
+ export declare type XyoPayload<T = XyoPayloadFull> = T extends XyoPayloadFull ? T : XyoPayloadFull & T;
@@ -1,5 +1,4 @@
1
- import { XyoPayloadBody } from './Body';
2
- import { XyoPayloadMeta } from './Meta';
3
- import { WithXyoPayloadMeta } from './WithXyoPayloadMeta';
4
- import { XyoPayload } from './XyoPayload';
5
- export type { WithXyoPayloadMeta, XyoPayload, XyoPayloadBody, XyoPayloadMeta };
1
+ export * from './Body';
2
+ export * from './Meta';
3
+ export * from './WithXyoPayloadMeta';
4
+ export * from './XyoPayload';
@@ -1,2 +1,5 @@
1
- export {};
1
+ export * from './Body';
2
+ export * from './Meta';
3
+ export * from './WithXyoPayloadMeta';
4
+ export * from './XyoPayload';
2
5
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/Payload/models/index.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/Payload/models/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAA;AACtB,cAAc,QAAQ,CAAA;AACtB,cAAc,sBAAsB,CAAA;AACpC,cAAc,cAAc,CAAA"}
@@ -0,0 +1 @@
1
+ export declare const exists: <T>(x: T | null | undefined) => x is T;
@@ -0,0 +1,4 @@
1
+ export const exists = (x) => {
2
+ return !!x;
3
+ };
4
+ //# sourceMappingURL=exists.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exists.js","sourceRoot":"","sources":["../../../src/lib/exists.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,MAAM,GAAG,CAAI,CAAuB,EAAU,EAAE;IAC3D,OAAO,CAAC,CAAC,CAAC,CAAA;AACZ,CAAC,CAAA"}
@@ -0,0 +1,6 @@
1
+ import { XyoBoundWitness } from '../BoundWitness';
2
+ import { XyoPayload } from '../Payload';
3
+ import { XyoSchemaPayload } from '../Schema';
4
+ export declare const isXyoPayloadOfSchemaType: <T extends import("../Payload").XyoPayloadFull>(schema: string) => (x: XyoPayload) => x is T;
5
+ export declare const isXyoSchemaPayload: (x: XyoPayload) => x is XyoSchemaPayload;
6
+ export declare const isXyoBoundWitnessPayload: (x: XyoPayload) => x is XyoBoundWitness;
@@ -0,0 +1,6 @@
1
+ export const isXyoPayloadOfSchemaType = (schema) => {
2
+ return (x) => x.schema === schema;
3
+ };
4
+ export const isXyoSchemaPayload = isXyoPayloadOfSchemaType('network.xyo.schema');
5
+ export const isXyoBoundWitnessPayload = isXyoPayloadOfSchemaType('network.xyo.boundwitness');
6
+ //# sourceMappingURL=isXyoPayloadOfSchemaType.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isXyoPayloadOfSchemaType.js","sourceRoot":"","sources":["../../../src/lib/isXyoPayloadOfSchemaType.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAuB,MAAc,EAAE,EAAE;IAC/E,OAAO,CAAC,CAAa,EAAU,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,MAAM,CAAA;AACvD,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,kBAAkB,GAAG,wBAAwB,CAAmB,oBAAoB,CAAC,CAAA;AAClG,MAAM,CAAC,MAAM,wBAAwB,GAAG,wBAAwB,CAAkB,0BAA0B,CAAC,CAAA"}
package/package.json CHANGED
@@ -9,67 +9,27 @@
9
9
  "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/issues"
10
10
  },
11
11
  "dependencies": {
12
- "@ethersproject/providers": "^5.6.5",
13
12
  "@xylabs/sdk-js": "^2.5.5",
14
- "@xyo-network/ethers-wrappers": "^2.6.17",
15
- "@xyo-network/sdk-xyo-mongo-js": "^2.2.7",
16
- "@xyo-network/sdk-xyo-typechain": "^1.0.3",
17
- "ajv": "^8.11.0",
18
13
  "axios": "^0.27.2",
19
- "bn.js": "^5.2.0",
20
- "bowser": "^2.11.0",
21
14
  "elliptic": "^6.5.4",
22
15
  "keccak256": "^1.0.6",
23
16
  "lodash": "^4.17.21",
24
- "lru-cache": "^7.10.1",
25
- "mongodb": "^4.6.0",
26
- "neo4j-driver": "^4.4.5",
27
- "neo4j-driver-core": "^4.4.5",
28
- "pako": "^2.0.4",
29
- "randombytes": "^2.1.0",
30
17
  "sha.js": "^2.4.11",
31
- "systeminformation": "^5.11.15",
32
- "ua-parser-js": "^1.0.2",
33
- "uuid": "^8.3.2"
18
+ "ua-parser-js": "^1.0.2"
34
19
  },
35
20
  "description": "Primary SDK for using XYO Protocol 2.0",
36
21
  "devDependencies": {
37
- "@babel/core": "^7.17.10",
38
- "@babel/preset-env": "^7.17.10",
39
- "@types/bn.js": "^5.1.0",
22
+ "@babel/core": "^7.17.12",
23
+ "@babel/preset-env": "^7.17.12",
40
24
  "@types/elliptic": "^6.4.14",
41
- "@types/jest": "^27.5.1",
42
- "@types/json-schema": "^7.0.11",
43
25
  "@types/lodash": "^4.14.182",
44
- "@types/lru-cache": "^7.6.1",
45
- "@types/node": "^17.0.32",
46
- "@types/pako": "^1.0.3",
47
- "@types/randombytes": "^2.0.0",
26
+ "@types/node": "^17.0.34",
48
27
  "@types/sha.js": "^2.4.0",
49
28
  "@types/ua-parser-js": "^0.7.36",
50
- "@types/uuid": "^8.3.4",
51
29
  "@xylabs/eslint-config": "^2.3.22",
52
- "@xylabs/rollup-config": "^1.1.17",
53
30
  "@xylabs/ts-scripts": "^1.0.66",
54
- "@xylabs/tsconfig": "^1.0.13",
55
- "babel-jest": "^28.1.0",
56
- "copyfiles": "^2.4.1",
57
- "dotenv": "^16.0.1",
58
- "eslint": "^8.15.0",
59
- "ethers": "^5.6.5",
60
- "jest": "^28.1.0",
61
- "jest-environment-jsdom": "^28.1.0",
62
- "jest-sorted": "^1.0.14",
63
31
  "license-checker": "^25.0.1",
64
- "npm-package-json-lint": "^6.3.0",
65
- "npm-package-json-lint-config-default": "^5.0.0",
66
- "rimraf": "^3.0.2",
67
- "rollbar": "^2.25.0",
68
- "rollup": "^2.72.1",
69
- "ts-jest": "^28.0.2",
70
- "ts-node": "^10.7.0",
71
32
  "tslib": "^2.4.0",
72
- "typedoc": "^0.22.15",
73
33
  "typescript": "^4.6.4"
74
34
  },
75
35
  "browser": "dist/esm/browserIndex.js",
@@ -112,6 +72,6 @@
112
72
  },
113
73
  "sideEffects": true,
114
74
  "types": "dist/esm/index.d.ts",
115
- "version": "2.20.20",
75
+ "version": "2.20.23",
116
76
  "packageManager": "yarn@3.1.1"
117
77
  }
@@ -1,6 +1,6 @@
1
1
  import { XyoPayloadBody } from './Body'
2
2
  import { WithXyoPayloadMeta } from './WithXyoPayloadMeta'
3
3
 
4
- type XyoPayload = WithXyoPayloadMeta<XyoPayloadBody>
4
+ export type XyoPayloadFull = WithXyoPayloadMeta<XyoPayloadBody>
5
5
 
6
- export type { XyoPayload }
6
+ export type XyoPayload<T = XyoPayloadFull> = T extends XyoPayloadFull ? T : XyoPayloadFull & T
@@ -1,6 +1,4 @@
1
- import { XyoPayloadBody } from './Body'
2
- import { XyoPayloadMeta } from './Meta'
3
- import { WithXyoPayloadMeta } from './WithXyoPayloadMeta'
4
- import { XyoPayload } from './XyoPayload'
5
-
6
- export type { WithXyoPayloadMeta, XyoPayload, XyoPayloadBody, XyoPayloadMeta }
1
+ export * from './Body'
2
+ export * from './Meta'
3
+ export * from './WithXyoPayloadMeta'
4
+ export * from './XyoPayload'
@@ -0,0 +1,3 @@
1
+ export const exists = <T>(x: T | undefined | null): x is T => {
2
+ return !!x
3
+ }
@@ -0,0 +1,10 @@
1
+ import { XyoBoundWitness } from '../BoundWitness'
2
+ import { XyoPayload } from '../Payload'
3
+ import { XyoSchemaPayload } from '../Schema'
4
+
5
+ export const isXyoPayloadOfSchemaType = <T extends XyoPayload>(schema: string) => {
6
+ return (x: XyoPayload): x is T => x.schema === schema
7
+ }
8
+
9
+ export const isXyoSchemaPayload = isXyoPayloadOfSchemaType<XyoSchemaPayload>('network.xyo.schema')
10
+ export const isXyoBoundWitnessPayload = isXyoPayloadOfSchemaType<XyoBoundWitness>('network.xyo.boundwitness')
package/rollup.config.js DELETED
@@ -1,5 +0,0 @@
1
- import { getRollupConfig } from '@xylabs/rollup-config'
2
-
3
- import pkg from './package.json'
4
-
5
- export default getRollupConfig({pkg, browserIndex: './src/browserIndex.ts', nodeIndex: './src/nodeIndex.ts', bundlePrefix: 'bundle/', outputs: ['cjs5', 'node', 'node-esm']})