@xyo-network/bridge-model 2.47.1
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.
- package/LICENSE +165 -0
- package/README.md +13 -0
- package/dist/cjs/Bridge.js +3 -0
- package/dist/cjs/Bridge.js.map +1 -0
- package/dist/cjs/Config.js +5 -0
- package/dist/cjs/Config.js.map +1 -0
- package/dist/cjs/PartialConfig.js +3 -0
- package/dist/cjs/PartialConfig.js.map +1 -0
- package/dist/cjs/Queries/Connect.js +5 -0
- package/dist/cjs/Queries/Connect.js.map +1 -0
- package/dist/cjs/Queries/Disconnect.js +5 -0
- package/dist/cjs/Queries/Disconnect.js.map +1 -0
- package/dist/cjs/Queries/index.js +6 -0
- package/dist/cjs/Queries/index.js.map +1 -0
- package/dist/cjs/index.js +8 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/docs.json +5183 -0
- package/dist/esm/Bridge.js +2 -0
- package/dist/esm/Bridge.js.map +1 -0
- package/dist/esm/Config.js +2 -0
- package/dist/esm/Config.js.map +1 -0
- package/dist/esm/PartialConfig.js +2 -0
- package/dist/esm/PartialConfig.js.map +1 -0
- package/dist/esm/Queries/Connect.js +2 -0
- package/dist/esm/Queries/Connect.js.map +1 -0
- package/dist/esm/Queries/Disconnect.js +2 -0
- package/dist/esm/Queries/Disconnect.js.map +1 -0
- package/dist/esm/Queries/index.js +3 -0
- package/dist/esm/Queries/index.js.map +1 -0
- package/dist/esm/index.js +5 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/types/Bridge.d.ts +17 -0
- package/dist/types/Bridge.d.ts.map +1 -0
- package/dist/types/Config.d.ts +6 -0
- package/dist/types/Config.d.ts.map +1 -0
- package/dist/types/PartialConfig.d.ts +4 -0
- package/dist/types/PartialConfig.d.ts.map +1 -0
- package/dist/types/Queries/Connect.d.ts +8 -0
- package/dist/types/Queries/Connect.d.ts.map +1 -0
- package/dist/types/Queries/Disconnect.d.ts +8 -0
- package/dist/types/Queries/Disconnect.d.ts.map +1 -0
- package/dist/types/Queries/index.d.ts +8 -0
- package/dist/types/Queries/index.d.ts.map +1 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/index.d.ts.map +1 -0
- package/package.json +57 -0
- package/src/Bridge.ts +19 -0
- package/src/Config.ts +7 -0
- package/src/PartialConfig.ts +5 -0
- package/src/Queries/Connect.ts +9 -0
- package/src/Queries/Disconnect.ts +9 -0
- package/src/Queries/index.ts +10 -0
- package/src/index.ts +4 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Bridge.js","sourceRoot":"","sources":["../../src/Bridge.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Config.js","sourceRoot":"","sources":["../../src/Config.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,MAAM,qBAAqB,GAA0B,2BAA2B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PartialConfig.js","sourceRoot":"","sources":["../../src/PartialConfig.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Connect.js","sourceRoot":"","sources":["../../../src/Queries/Connect.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,2BAA2B,GAAgC,kCAAkC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Disconnect.js","sourceRoot":"","sources":["../../../src/Queries/Disconnect.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,8BAA8B,GAAmC,qCAAqC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Queries/index.ts"],"names":[],"mappings":"AAKA,cAAc,WAAW,CAAA;AACzB,cAAc,cAAc,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,UAAU,CAAA;AACxB,cAAc,iBAAiB,CAAA;AAC/B,cAAc,WAAW,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Module, ModuleConfig, ModuleFilter, ModuleQueryResult, XyoQuery, XyoQueryBoundWitness } from '@xyo-network/module-model';
|
|
2
|
+
import { XyoPayload } from '@xyo-network/payload-model';
|
|
3
|
+
import { Promisable } from '@xyo-network/promise';
|
|
4
|
+
import { BridgeConfig } from './Config';
|
|
5
|
+
export interface Bridge {
|
|
6
|
+
connect: () => Promisable<boolean>;
|
|
7
|
+
disconnect: () => Promisable<boolean>;
|
|
8
|
+
}
|
|
9
|
+
export interface BridgeModule<TConfig extends BridgeConfig = BridgeConfig> extends Bridge, Module<TConfig> {
|
|
10
|
+
targetResolver: Module['resolver'];
|
|
11
|
+
targetDiscover(address?: string): Promisable<XyoPayload[]>;
|
|
12
|
+
targetQueries(address: string): string[];
|
|
13
|
+
targetQuery(address: string, query: XyoQuery, payloads?: XyoPayload[]): Promisable<ModuleQueryResult>;
|
|
14
|
+
targetQueryable(address: string, query: XyoQueryBoundWitness, payloads?: XyoPayload[], queryConfig?: ModuleConfig): Promisable<boolean>;
|
|
15
|
+
targetResolve(address: string, filter?: ModuleFilter): Promisable<Module[]>;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=Bridge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Bridge.d.ts","sourceRoot":"","sources":["../../src/Bridge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,iBAAiB,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AACjI,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAEjD,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAEvC,MAAM,WAAW,MAAM;IACrB,OAAO,EAAE,MAAM,UAAU,CAAC,OAAO,CAAC,CAAA;IAClC,UAAU,EAAE,MAAM,UAAU,CAAC,OAAO,CAAC,CAAA;CACtC;AAED,MAAM,WAAW,YAAY,CAAC,OAAO,SAAS,YAAY,GAAG,YAAY,CAAE,SAAQ,MAAM,EAAE,MAAM,CAAC,OAAO,CAAC;IACxG,cAAc,EAAE,MAAM,CAAC,UAAU,CAAC,CAAA;IAClC,cAAc,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC,UAAU,EAAE,CAAC,CAAA;IAC1D,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;IACxC,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,CAAC,EAAE,UAAU,EAAE,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAA;IACrG,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,oBAAoB,EAAE,QAAQ,CAAC,EAAE,UAAU,EAAE,EAAE,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC,OAAO,CAAC,CAAA;IACvI,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,CAAA;CAC5E"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ModuleConfig } from '@xyo-network/module';
|
|
2
|
+
import { XyoPayload } from '@xyo-network/payload-model';
|
|
3
|
+
export type XyoBridgeConfigSchema = 'network.xyo.bridge.config';
|
|
4
|
+
export declare const XyoBridgeConfigSchema: XyoBridgeConfigSchema;
|
|
5
|
+
export type BridgeConfig<TConfig extends XyoPayload = XyoPayload> = ModuleConfig<TConfig>;
|
|
6
|
+
//# sourceMappingURL=Config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../src/Config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AAEvD,MAAM,MAAM,qBAAqB,GAAG,2BAA2B,CAAA;AAC/D,eAAO,MAAM,qBAAqB,EAAE,qBAAmD,CAAA;AAEvF,MAAM,MAAM,YAAY,CAAC,OAAO,SAAS,UAAU,GAAG,UAAU,IAAI,YAAY,CAAC,OAAO,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PartialConfig.d.ts","sourceRoot":"","sources":["../../src/PartialConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAEzD,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAEvC,MAAM,MAAM,mBAAmB,CAAC,CAAC,SAAS,YAAY,IAAI,mBAAmB,CAAC,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { XyoQuery } from '@xyo-network/module-model';
|
|
2
|
+
export type XyoBridgeConnectQuerySchema = 'network.xyo.query.bridge.connect';
|
|
3
|
+
export declare const XyoBridgeConnectQuerySchema: XyoBridgeConnectQuerySchema;
|
|
4
|
+
export type XyoBridgeConnectQuery = XyoQuery<{
|
|
5
|
+
schema: XyoBridgeConnectQuerySchema;
|
|
6
|
+
uri?: string;
|
|
7
|
+
}>;
|
|
8
|
+
//# sourceMappingURL=Connect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Connect.d.ts","sourceRoot":"","sources":["../../../src/Queries/Connect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAA;AAEpD,MAAM,MAAM,2BAA2B,GAAG,kCAAkC,CAAA;AAC5E,eAAO,MAAM,2BAA2B,EAAE,2BAAgE,CAAA;AAE1G,MAAM,MAAM,qBAAqB,GAAG,QAAQ,CAAC;IAC3C,MAAM,EAAE,2BAA2B,CAAA;IACnC,GAAG,CAAC,EAAE,MAAM,CAAA;CACb,CAAC,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { XyoQuery } from '@xyo-network/module-model';
|
|
2
|
+
export type XyoBridgeDisconnectQuerySchema = 'network.xyo.query.bridge.disconnect';
|
|
3
|
+
export declare const XyoBridgeDisconnectQuerySchema: XyoBridgeDisconnectQuerySchema;
|
|
4
|
+
export type XyoBridgeDisconnectQuery = XyoQuery<{
|
|
5
|
+
schema: XyoBridgeDisconnectQuerySchema;
|
|
6
|
+
uri?: string;
|
|
7
|
+
}>;
|
|
8
|
+
//# sourceMappingURL=Disconnect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Disconnect.d.ts","sourceRoot":"","sources":["../../../src/Queries/Disconnect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAA;AAEpD,MAAM,MAAM,8BAA8B,GAAG,qCAAqC,CAAA;AAClF,eAAO,MAAM,8BAA8B,EAAE,8BAAsE,CAAA;AAEnH,MAAM,MAAM,wBAAwB,GAAG,QAAQ,CAAC;IAC9C,MAAM,EAAE,8BAA8B,CAAA;IACtC,GAAG,CAAC,EAAE,MAAM,CAAA;CACb,CAAC,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ModuleQuery, XyoQuery } from '@xyo-network/module-model';
|
|
2
|
+
import { XyoBridgeConnectQuery } from './Connect';
|
|
3
|
+
import { XyoBridgeDisconnectQuery } from './Disconnect';
|
|
4
|
+
export * from './Connect';
|
|
5
|
+
export * from './Disconnect';
|
|
6
|
+
export type XyoBridgeQueryBase = XyoBridgeConnectQuery | XyoBridgeDisconnectQuery;
|
|
7
|
+
export type XyoBridgeQuery<T extends XyoQuery | void = void> = ModuleQuery<T extends XyoQuery ? XyoBridgeQueryBase | T : XyoBridgeQueryBase>;
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Queries/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAA;AAEjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAA;AACjD,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAA;AAEvD,cAAc,WAAW,CAAA;AACzB,cAAc,cAAc,CAAA;AAE5B,MAAM,MAAM,kBAAkB,GAAG,qBAAqB,GAAG,wBAAwB,CAAA;AACjF,MAAM,MAAM,cAAc,CAAC,CAAC,SAAS,QAAQ,GAAG,IAAI,GAAG,IAAI,IAAI,WAAW,CAAC,CAAC,SAAS,QAAQ,GAAG,kBAAkB,GAAG,CAAC,GAAG,kBAAkB,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,UAAU,CAAA;AACxB,cAAc,iBAAiB,CAAA;AAC/B,cAAc,WAAW,CAAA"}
|
package/package.json
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@xyo-network/bridge-model",
|
|
3
|
+
"author": {
|
|
4
|
+
"email": "support@xyo.network",
|
|
5
|
+
"name": "XYO Development Team",
|
|
6
|
+
"url": "https://xyo.network"
|
|
7
|
+
},
|
|
8
|
+
"bugs": {
|
|
9
|
+
"email": "support@xyo.network",
|
|
10
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/issues"
|
|
11
|
+
},
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"@xyo-network/module": "^2.47.1",
|
|
14
|
+
"@xyo-network/module-model": "^2.47.1",
|
|
15
|
+
"@xyo-network/payload-model": "^2.47.1",
|
|
16
|
+
"@xyo-network/promise": "^2.47.1"
|
|
17
|
+
},
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"@xylabs/ts-scripts-yarn3": "^2.14.15",
|
|
20
|
+
"@xylabs/tsconfig": "^2.14.15",
|
|
21
|
+
"typescript": "^4.9.5"
|
|
22
|
+
},
|
|
23
|
+
"description": "Primary SDK for using XYO Protocol 2.0",
|
|
24
|
+
"browser": "dist/esm/index.js",
|
|
25
|
+
"docs": "dist/docs.json",
|
|
26
|
+
"exports": {
|
|
27
|
+
".": {
|
|
28
|
+
"node": {
|
|
29
|
+
"import": "./dist/esm/index.js",
|
|
30
|
+
"require": "./dist/cjs/index.js"
|
|
31
|
+
},
|
|
32
|
+
"browser": {
|
|
33
|
+
"import": "./dist/esm/index.js",
|
|
34
|
+
"require": "./dist/cjs/index.js"
|
|
35
|
+
},
|
|
36
|
+
"default": "./dist/esm/index.js"
|
|
37
|
+
},
|
|
38
|
+
"./dist/docs.json": {
|
|
39
|
+
"default": "./dist/docs.json"
|
|
40
|
+
},
|
|
41
|
+
"./package.json": "./package.json"
|
|
42
|
+
},
|
|
43
|
+
"main": "dist/cjs/index.js",
|
|
44
|
+
"module": "dist/esm/index.js",
|
|
45
|
+
"homepage": "https://xyo.network",
|
|
46
|
+
"license": "LGPL-3.0",
|
|
47
|
+
"publishConfig": {
|
|
48
|
+
"access": "public"
|
|
49
|
+
},
|
|
50
|
+
"repository": {
|
|
51
|
+
"type": "git",
|
|
52
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js.git"
|
|
53
|
+
},
|
|
54
|
+
"sideEffects": false,
|
|
55
|
+
"types": "dist/types/index.d.ts",
|
|
56
|
+
"version": "2.47.1"
|
|
57
|
+
}
|
package/src/Bridge.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Module, ModuleConfig, ModuleFilter, ModuleQueryResult, XyoQuery, XyoQueryBoundWitness } from '@xyo-network/module-model'
|
|
2
|
+
import { XyoPayload } from '@xyo-network/payload-model'
|
|
3
|
+
import { Promisable } from '@xyo-network/promise'
|
|
4
|
+
|
|
5
|
+
import { BridgeConfig } from './Config'
|
|
6
|
+
|
|
7
|
+
export interface Bridge {
|
|
8
|
+
connect: () => Promisable<boolean>
|
|
9
|
+
disconnect: () => Promisable<boolean>
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface BridgeModule<TConfig extends BridgeConfig = BridgeConfig> extends Bridge, Module<TConfig> {
|
|
13
|
+
targetResolver: Module['resolver']
|
|
14
|
+
targetDiscover(address?: string): Promisable<XyoPayload[]>
|
|
15
|
+
targetQueries(address: string): string[]
|
|
16
|
+
targetQuery(address: string, query: XyoQuery, payloads?: XyoPayload[]): Promisable<ModuleQueryResult>
|
|
17
|
+
targetQueryable(address: string, query: XyoQueryBoundWitness, payloads?: XyoPayload[], queryConfig?: ModuleConfig): Promisable<boolean>
|
|
18
|
+
targetResolve(address: string, filter?: ModuleFilter): Promisable<Module[]>
|
|
19
|
+
}
|
package/src/Config.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ModuleConfig } from '@xyo-network/module'
|
|
2
|
+
import { XyoPayload } from '@xyo-network/payload-model'
|
|
3
|
+
|
|
4
|
+
export type XyoBridgeConfigSchema = 'network.xyo.bridge.config'
|
|
5
|
+
export const XyoBridgeConfigSchema: XyoBridgeConfigSchema = 'network.xyo.bridge.config'
|
|
6
|
+
|
|
7
|
+
export type BridgeConfig<TConfig extends XyoPayload = XyoPayload> = ModuleConfig<TConfig>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { XyoQuery } from '@xyo-network/module-model'
|
|
2
|
+
|
|
3
|
+
export type XyoBridgeConnectQuerySchema = 'network.xyo.query.bridge.connect'
|
|
4
|
+
export const XyoBridgeConnectQuerySchema: XyoBridgeConnectQuerySchema = 'network.xyo.query.bridge.connect'
|
|
5
|
+
|
|
6
|
+
export type XyoBridgeConnectQuery = XyoQuery<{
|
|
7
|
+
schema: XyoBridgeConnectQuerySchema
|
|
8
|
+
uri?: string
|
|
9
|
+
}>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { XyoQuery } from '@xyo-network/module-model'
|
|
2
|
+
|
|
3
|
+
export type XyoBridgeDisconnectQuerySchema = 'network.xyo.query.bridge.disconnect'
|
|
4
|
+
export const XyoBridgeDisconnectQuerySchema: XyoBridgeDisconnectQuerySchema = 'network.xyo.query.bridge.disconnect'
|
|
5
|
+
|
|
6
|
+
export type XyoBridgeDisconnectQuery = XyoQuery<{
|
|
7
|
+
schema: XyoBridgeDisconnectQuerySchema
|
|
8
|
+
uri?: string
|
|
9
|
+
}>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ModuleQuery, XyoQuery } from '@xyo-network/module-model'
|
|
2
|
+
|
|
3
|
+
import { XyoBridgeConnectQuery } from './Connect'
|
|
4
|
+
import { XyoBridgeDisconnectQuery } from './Disconnect'
|
|
5
|
+
|
|
6
|
+
export * from './Connect'
|
|
7
|
+
export * from './Disconnect'
|
|
8
|
+
|
|
9
|
+
export type XyoBridgeQueryBase = XyoBridgeConnectQuery | XyoBridgeDisconnectQuery
|
|
10
|
+
export type XyoBridgeQuery<T extends XyoQuery | void = void> = ModuleQuery<T extends XyoQuery ? XyoBridgeQueryBase | T : XyoBridgeQueryBase>
|
package/src/index.ts
ADDED