@xyo-network/bridge-model 2.66.9 → 2.67.0-rc.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.
- package/dist/cjs/typeChecks.js +6 -5
- package/dist/cjs/typeChecks.js.map +1 -1
- package/dist/esm/typeChecks.js +7 -6
- package/dist/esm/typeChecks.js.map +1 -1
- package/dist/types/Bridge.d.ts +4 -4
- package/dist/types/Bridge.d.ts.map +1 -1
- package/dist/types/typeChecks.d.ts +107 -83
- package/dist/types/typeChecks.d.ts.map +1 -1
- package/package.json +11 -9
- package/src/Bridge.ts +3 -4
- package/src/typeChecks.ts +7 -6
- package/dist/docs.json +0 -20114
package/dist/cjs/typeChecks.js
CHANGED
|
@@ -2,14 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.withBridgeInstance = exports.withBridgeModule = exports.asBridgeInstance = exports.asBridgeModule = exports.isBridgeModule = exports.isBridgeInstance = void 0;
|
|
4
4
|
const module_model_1 = require("@xyo-network/module-model");
|
|
5
|
+
const object_identity_1 = require("@xyo-network/object-identity");
|
|
5
6
|
const Queries_1 = require("./Queries");
|
|
6
|
-
exports.isBridgeInstance = module_model_1.IsInstanceFactory.create({
|
|
7
|
+
exports.isBridgeInstance = new module_model_1.IsInstanceFactory().create({
|
|
7
8
|
connect: 'function',
|
|
8
9
|
disconnect: 'function',
|
|
9
|
-
}, module_model_1.isModuleInstance);
|
|
10
|
-
exports.isBridgeModule = module_model_1.IsModuleFactory.create([Queries_1.BridgeConnectQuerySchema, Queries_1.BridgeDisconnectQuerySchema]);
|
|
11
|
-
exports.asBridgeModule =
|
|
12
|
-
exports.asBridgeInstance =
|
|
10
|
+
}, [module_model_1.isModuleInstance]);
|
|
11
|
+
exports.isBridgeModule = new module_model_1.IsModuleFactory().create([Queries_1.BridgeConnectQuerySchema, Queries_1.BridgeDisconnectQuerySchema]);
|
|
12
|
+
exports.asBridgeModule = object_identity_1.AsObjectFactory.create(exports.isBridgeModule);
|
|
13
|
+
exports.asBridgeInstance = object_identity_1.AsObjectFactory.create(exports.isBridgeInstance);
|
|
13
14
|
exports.withBridgeModule = module_model_1.WithFactory.create(exports.isBridgeModule);
|
|
14
15
|
exports.withBridgeInstance = module_model_1.WithFactory.create(exports.isBridgeInstance);
|
|
15
16
|
//# sourceMappingURL=typeChecks.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typeChecks.js","sourceRoot":"","sources":["../../src/typeChecks.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"typeChecks.js","sourceRoot":"","sources":["../../src/typeChecks.ts"],"names":[],"mappings":";;;AAAA,4DAA6G;AAC7G,kEAA8D;AAG9D,uCAAiF;AAEpE,QAAA,gBAAgB,GAAG,IAAI,gCAAiB,EAAkB,CAAC,MAAM,CAC5E;IACE,OAAO,EAAE,UAAU;IACnB,UAAU,EAAE,UAAU;CACvB,EACD,CAAC,+BAAgB,CAAC,CACnB,CAAA;AACY,QAAA,cAAc,GAAG,IAAI,8BAAe,EAAgB,CAAC,MAAM,CAAC,CAAC,kCAAwB,EAAE,qCAA2B,CAAC,CAAC,CAAA;AAEpH,QAAA,cAAc,GAAG,iCAAe,CAAC,MAAM,CAAC,sBAAc,CAAC,CAAA;AACvD,QAAA,gBAAgB,GAAG,iCAAe,CAAC,MAAM,CAAC,wBAAgB,CAAC,CAAA;AAC3D,QAAA,gBAAgB,GAAG,0BAAW,CAAC,MAAM,CAAC,sBAAc,CAAC,CAAA;AACrD,QAAA,kBAAkB,GAAG,0BAAW,CAAC,MAAM,CAAC,wBAAgB,CAAC,CAAA"}
|
package/dist/esm/typeChecks.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IsInstanceFactory, IsModuleFactory, isModuleInstance, WithFactory } from '@xyo-network/module-model';
|
|
2
|
+
import { AsObjectFactory } from '@xyo-network/object-identity';
|
|
2
3
|
import { BridgeConnectQuerySchema, BridgeDisconnectQuerySchema } from './Queries';
|
|
3
|
-
export const isBridgeInstance = IsInstanceFactory.create({
|
|
4
|
+
export const isBridgeInstance = new IsInstanceFactory().create({
|
|
4
5
|
connect: 'function',
|
|
5
6
|
disconnect: 'function',
|
|
6
|
-
}, isModuleInstance);
|
|
7
|
-
export const isBridgeModule = IsModuleFactory.create([BridgeConnectQuerySchema, BridgeDisconnectQuerySchema]);
|
|
8
|
-
export const asBridgeModule =
|
|
9
|
-
export const asBridgeInstance =
|
|
7
|
+
}, [isModuleInstance]);
|
|
8
|
+
export const isBridgeModule = new IsModuleFactory().create([BridgeConnectQuerySchema, BridgeDisconnectQuerySchema]);
|
|
9
|
+
export const asBridgeModule = AsObjectFactory.create(isBridgeModule);
|
|
10
|
+
export const asBridgeInstance = AsObjectFactory.create(isBridgeInstance);
|
|
10
11
|
export const withBridgeModule = WithFactory.create(isBridgeModule);
|
|
11
12
|
export const withBridgeInstance = WithFactory.create(isBridgeInstance);
|
|
12
13
|
//# sourceMappingURL=typeChecks.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typeChecks.js","sourceRoot":"","sources":["../../src/typeChecks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"typeChecks.js","sourceRoot":"","sources":["../../src/typeChecks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AAC7G,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAA;AAG9D,OAAO,EAAE,wBAAwB,EAAE,2BAA2B,EAAE,MAAM,WAAW,CAAA;AAEjF,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,iBAAiB,EAAkB,CAAC,MAAM,CAC5E;IACE,OAAO,EAAE,UAAU;IACnB,UAAU,EAAE,UAAU;CACvB,EACD,CAAC,gBAAgB,CAAC,CACnB,CAAA;AACD,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,eAAe,EAAgB,CAAC,MAAM,CAAC,CAAC,wBAAwB,EAAE,2BAA2B,CAAC,CAAC,CAAA;AAEjI,MAAM,CAAC,MAAM,cAAc,GAAG,eAAe,CAAC,MAAM,CAAC,cAAc,CAAC,CAAA;AACpE,MAAM,CAAC,MAAM,gBAAgB,GAAG,eAAe,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAA;AACxE,MAAM,CAAC,MAAM,gBAAgB,GAAG,WAAW,CAAC,MAAM,CAAC,cAAc,CAAC,CAAA;AAClE,MAAM,CAAC,MAAM,kBAAkB,GAAG,WAAW,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAA"}
|
package/dist/types/Bridge.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { QueryBoundWitness } from '@xyo-network/boundwitness-builder';
|
|
2
|
-
import { AnyConfigSchema,
|
|
2
|
+
import { AnyConfigSchema, ModuleConfig, ModuleEventData, ModuleFilter, ModuleFilterOptions, ModuleInstance, ModuleParams, ModuleQueryResult, ModuleResolver } from '@xyo-network/module-model';
|
|
3
3
|
import { Payload, Query } from '@xyo-network/payload-model';
|
|
4
4
|
import { Promisable } from '@xyo-network/promise';
|
|
5
5
|
import { BridgeConfig } from './Config';
|
|
@@ -16,9 +16,9 @@ export interface BridgeModule<TParams extends BridgeParams = BridgeParams, TEven
|
|
|
16
16
|
targetQueries(address: string): string[];
|
|
17
17
|
targetQuery(address: string, query: Query, payloads?: Payload[]): Promisable<ModuleQueryResult>;
|
|
18
18
|
targetQueryable(address: string, query: QueryBoundWitness, payloads?: Payload[], queryConfig?: ModuleConfig): Promisable<boolean>;
|
|
19
|
-
targetResolve(address: string, filter?: ModuleFilter, options?: ModuleFilterOptions): Promisable<
|
|
20
|
-
targetResolve(address: string, nameOrAddress: string, options?: ModuleFilterOptions): Promisable<
|
|
21
|
-
targetResolve(address: string, nameOrAddressOrFilter?: ModuleFilter | string, options?: ModuleFilterOptions): Promisable<
|
|
19
|
+
targetResolve(address: string, filter?: ModuleFilter, options?: ModuleFilterOptions): Promisable<ModuleInstance[]>;
|
|
20
|
+
targetResolve(address: string, nameOrAddress: string, options?: ModuleFilterOptions): Promisable<ModuleInstance | undefined>;
|
|
21
|
+
targetResolve(address: string, nameOrAddressOrFilter?: ModuleFilter | string, options?: ModuleFilterOptions): Promisable<ModuleInstance | ModuleInstance[] | undefined>;
|
|
22
22
|
}
|
|
23
23
|
export type BridgeInstance<TParams extends BridgeParams = BridgeParams, TEventData extends ModuleEventData = ModuleEventData> = BridgeModule<TParams, TEventData> & Bridge;
|
|
24
24
|
//# sourceMappingURL=Bridge.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Bridge.d.ts","sourceRoot":"","sources":["../../src/Bridge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAA;AACrE,OAAO,EACL,eAAe,EACf,
|
|
1
|
+
{"version":3,"file":"Bridge.d.ts","sourceRoot":"","sources":["../../src/Bridge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAA;AACrE,OAAO,EACL,eAAe,EACf,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,mBAAmB,EACnB,cAAc,EACd,YAAY,EACZ,iBAAiB,EACjB,cAAc,EACf,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAA;AAC3D,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,MAAM,YAAY,CAAC,OAAO,SAAS,eAAe,CAAC,YAAY,CAAC,GAAG,eAAe,CAAC,YAAY,CAAC,IAAI,YAAY,CAAC,OAAO,CAAC,CAAA;AAE/H,MAAM,WAAW,YAAY,CAAC,OAAO,SAAS,YAAY,GAAG,YAAY,EAAE,UAAU,SAAS,eAAe,GAAG,eAAe,CAC7H,SAAQ,cAAc,CAAC,OAAO,EAAE,UAAU,CAAC;IAC3C,cAAc,IAAI,UAAU,CAAC,MAAM,CAAC,CAAA;IACpC,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,YAAY,CAAA;IAC3C,cAAc,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC,OAAO,EAAE,CAAC,CAAA;IACvD,kBAAkB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,cAAc,CAAA;IACpD,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;IACxC,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,CAAC,EAAE,OAAO,EAAE,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAA;IAC/F,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,iBAAiB,EAAE,QAAQ,CAAC,EAAE,OAAO,EAAE,EAAE,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC,OAAO,CAAC,CAAA;IAEjI,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,YAAY,EAAE,OAAO,CAAC,EAAE,mBAAmB,GAAG,UAAU,CAAC,cAAc,EAAE,CAAC,CAAA;IAClH,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,mBAAmB,GAAG,UAAU,CAAC,cAAc,GAAG,SAAS,CAAC,CAAA;IAC5H,aAAa,CACX,OAAO,EAAE,MAAM,EACf,qBAAqB,CAAC,EAAE,YAAY,GAAG,MAAM,EAC7C,OAAO,CAAC,EAAE,mBAAmB,GAC5B,UAAU,CAAC,cAAc,GAAG,cAAc,EAAE,GAAG,SAAS,CAAC,CAAA;CAC7D;AAED,MAAM,MAAM,cAAc,CAAC,OAAO,SAAS,YAAY,GAAG,YAAY,EAAE,UAAU,SAAS,eAAe,GAAG,eAAe,IAAI,YAAY,CAC1I,OAAO,EACP,UAAU,CACX,GACC,MAAM,CAAA"}
|
|
@@ -1,43 +1,9 @@
|
|
|
1
1
|
import { BridgeInstance, BridgeModule } from './Bridge';
|
|
2
|
-
export declare const isBridgeInstance: import("@xyo-network/
|
|
3
|
-
export declare const isBridgeModule: import("@xyo-network/module-model").ModuleTypeCheck<BridgeModule<import("
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
size?: number | undefined;
|
|
8
|
-
}> | undefined;
|
|
9
|
-
readonly schema: string;
|
|
10
|
-
readonly security?: {
|
|
11
|
-
readonly allowAnonymous?: boolean | undefined;
|
|
12
|
-
readonly allowed?: Record<string, (string | import("@xyo-network/module-model").CosigningAddressSet)[]> | undefined;
|
|
13
|
-
readonly disallowed?: Record<string, string[]> | undefined;
|
|
14
|
-
} | undefined;
|
|
15
|
-
readonly storeQueries?: boolean | undefined;
|
|
16
|
-
} & Omit<Omit<import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & {
|
|
17
|
-
readonly archivist?: import("@xyo-network/module-model").ArchivistModuleConfig | undefined;
|
|
18
|
-
readonly name?: string | undefined;
|
|
19
|
-
readonly paging?: Record<string, {
|
|
20
|
-
size?: number | undefined;
|
|
21
|
-
}> | undefined;
|
|
22
|
-
readonly schema: "network.xyo.bridge.config";
|
|
23
|
-
readonly security?: {
|
|
24
|
-
readonly allowAnonymous?: boolean | undefined;
|
|
25
|
-
readonly allowed?: Record<string, (string | import("@xyo-network/module-model").CosigningAddressSet)[]> | undefined;
|
|
26
|
-
readonly disallowed?: Record<string, string[]> | undefined;
|
|
27
|
-
} | undefined;
|
|
28
|
-
readonly storeQueries?: boolean | undefined;
|
|
29
|
-
} & Omit<{
|
|
30
|
-
discoverCache?: true | import("./Config").CacheConfig | undefined;
|
|
31
|
-
schema: "network.xyo.bridge.config";
|
|
32
|
-
}, "schema"> & {
|
|
33
|
-
schema: "network.xyo.bridge.config";
|
|
34
|
-
}, "schema"> & {
|
|
35
|
-
schema: string;
|
|
36
|
-
}, "schema"> & {
|
|
37
|
-
schema: string;
|
|
38
|
-
}>, import("@xyo-network/module-model").ModuleEventData>>;
|
|
39
|
-
export declare const asBridgeModule: {
|
|
40
|
-
(module: any): BridgeModule<import("./Bridge").BridgeParams<import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & {
|
|
2
|
+
export declare const isBridgeInstance: import("@xyo-network/object-identity").ObjectTypeCheck<BridgeInstance>;
|
|
3
|
+
export declare const isBridgeModule: import("@xyo-network/module-model").ModuleTypeCheck<BridgeModule<import("@xyo-network/core").BaseParamsFields & {
|
|
4
|
+
account?: import("@xyo-network/account-model").AccountInstance | "random" | undefined;
|
|
5
|
+
accountDerivationPath?: string | undefined;
|
|
6
|
+
config: import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & {
|
|
41
7
|
readonly archivist?: import("@xyo-network/module-model").ArchivistModuleConfig | undefined;
|
|
42
8
|
readonly name?: string | undefined;
|
|
43
9
|
readonly paging?: Record<string, {
|
|
@@ -72,8 +38,104 @@ export declare const asBridgeModule: {
|
|
|
72
38
|
schema: string;
|
|
73
39
|
}, "schema"> & {
|
|
74
40
|
schema: string;
|
|
75
|
-
}
|
|
76
|
-
|
|
41
|
+
};
|
|
42
|
+
ephemeralQueryAccountEnabled?: boolean | undefined;
|
|
43
|
+
wallet?: import("@xyo-network/wallet-model").WalletInstance | undefined;
|
|
44
|
+
}, import("@xyo-network/module-model").ModuleEventData>>;
|
|
45
|
+
export declare const asBridgeModule: {
|
|
46
|
+
(obj: any, config?: import("@xyo-network/object-identity").ObjectTypeConfig | undefined): BridgeModule<import("@xyo-network/core").BaseParamsFields & {
|
|
47
|
+
account?: import("@xyo-network/account-model").AccountInstance | "random" | undefined;
|
|
48
|
+
accountDerivationPath?: string | undefined;
|
|
49
|
+
config: import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & {
|
|
50
|
+
readonly archivist?: import("@xyo-network/module-model").ArchivistModuleConfig | undefined;
|
|
51
|
+
readonly name?: string | undefined;
|
|
52
|
+
readonly paging?: Record<string, {
|
|
53
|
+
size?: number | undefined;
|
|
54
|
+
}> | undefined;
|
|
55
|
+
readonly schema: string;
|
|
56
|
+
readonly security?: {
|
|
57
|
+
readonly allowAnonymous?: boolean | undefined;
|
|
58
|
+
readonly allowed?: Record<string, (string | import("@xyo-network/module-model").CosigningAddressSet)[]> | undefined;
|
|
59
|
+
readonly disallowed?: Record<string, string[]> | undefined;
|
|
60
|
+
} | undefined;
|
|
61
|
+
readonly storeQueries?: boolean | undefined;
|
|
62
|
+
} & Omit<Omit<import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & {
|
|
63
|
+
readonly archivist?: import("@xyo-network/module-model").ArchivistModuleConfig | undefined;
|
|
64
|
+
readonly name?: string | undefined;
|
|
65
|
+
readonly paging?: Record<string, {
|
|
66
|
+
size?: number | undefined;
|
|
67
|
+
}> | undefined;
|
|
68
|
+
readonly schema: "network.xyo.bridge.config";
|
|
69
|
+
readonly security?: {
|
|
70
|
+
readonly allowAnonymous?: boolean | undefined;
|
|
71
|
+
readonly allowed?: Record<string, (string | import("@xyo-network/module-model").CosigningAddressSet)[]> | undefined;
|
|
72
|
+
readonly disallowed?: Record<string, string[]> | undefined;
|
|
73
|
+
} | undefined;
|
|
74
|
+
readonly storeQueries?: boolean | undefined;
|
|
75
|
+
} & Omit<{
|
|
76
|
+
discoverCache?: true | import("./Config").CacheConfig | undefined;
|
|
77
|
+
schema: "network.xyo.bridge.config";
|
|
78
|
+
}, "schema"> & {
|
|
79
|
+
schema: "network.xyo.bridge.config";
|
|
80
|
+
}, "schema"> & {
|
|
81
|
+
schema: string;
|
|
82
|
+
}, "schema"> & {
|
|
83
|
+
schema: string;
|
|
84
|
+
};
|
|
85
|
+
ephemeralQueryAccountEnabled?: boolean | undefined;
|
|
86
|
+
wallet?: import("@xyo-network/wallet-model").WalletInstance | undefined;
|
|
87
|
+
}, import("@xyo-network/module-model").ModuleEventData> | undefined;
|
|
88
|
+
(obj: any, assert: string | (() => string), config?: import("@xyo-network/object-identity").ObjectTypeConfig | undefined): BridgeModule<import("@xyo-network/core").BaseParamsFields & {
|
|
89
|
+
account?: import("@xyo-network/account-model").AccountInstance | "random" | undefined;
|
|
90
|
+
accountDerivationPath?: string | undefined;
|
|
91
|
+
config: import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & {
|
|
92
|
+
readonly archivist?: import("@xyo-network/module-model").ArchivistModuleConfig | undefined;
|
|
93
|
+
readonly name?: string | undefined;
|
|
94
|
+
readonly paging?: Record<string, {
|
|
95
|
+
size?: number | undefined;
|
|
96
|
+
}> | undefined;
|
|
97
|
+
readonly schema: string;
|
|
98
|
+
readonly security?: {
|
|
99
|
+
readonly allowAnonymous?: boolean | undefined;
|
|
100
|
+
readonly allowed?: Record<string, (string | import("@xyo-network/module-model").CosigningAddressSet)[]> | undefined;
|
|
101
|
+
readonly disallowed?: Record<string, string[]> | undefined;
|
|
102
|
+
} | undefined;
|
|
103
|
+
readonly storeQueries?: boolean | undefined;
|
|
104
|
+
} & Omit<Omit<import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & {
|
|
105
|
+
readonly archivist?: import("@xyo-network/module-model").ArchivistModuleConfig | undefined;
|
|
106
|
+
readonly name?: string | undefined;
|
|
107
|
+
readonly paging?: Record<string, {
|
|
108
|
+
size?: number | undefined;
|
|
109
|
+
}> | undefined;
|
|
110
|
+
readonly schema: "network.xyo.bridge.config";
|
|
111
|
+
readonly security?: {
|
|
112
|
+
readonly allowAnonymous?: boolean | undefined;
|
|
113
|
+
readonly allowed?: Record<string, (string | import("@xyo-network/module-model").CosigningAddressSet)[]> | undefined;
|
|
114
|
+
readonly disallowed?: Record<string, string[]> | undefined;
|
|
115
|
+
} | undefined;
|
|
116
|
+
readonly storeQueries?: boolean | undefined;
|
|
117
|
+
} & Omit<{
|
|
118
|
+
discoverCache?: true | import("./Config").CacheConfig | undefined;
|
|
119
|
+
schema: "network.xyo.bridge.config";
|
|
120
|
+
}, "schema"> & {
|
|
121
|
+
schema: "network.xyo.bridge.config";
|
|
122
|
+
}, "schema"> & {
|
|
123
|
+
schema: string;
|
|
124
|
+
}, "schema"> & {
|
|
125
|
+
schema: string;
|
|
126
|
+
};
|
|
127
|
+
ephemeralQueryAccountEnabled?: boolean | undefined;
|
|
128
|
+
wallet?: import("@xyo-network/wallet-model").WalletInstance | undefined;
|
|
129
|
+
}, import("@xyo-network/module-model").ModuleEventData>;
|
|
130
|
+
};
|
|
131
|
+
export declare const asBridgeInstance: {
|
|
132
|
+
(obj: any, config?: import("@xyo-network/object-identity").ObjectTypeConfig | undefined): BridgeInstance | undefined;
|
|
133
|
+
(obj: any, assert: string | (() => string), config?: import("@xyo-network/object-identity").ObjectTypeConfig | undefined): BridgeInstance;
|
|
134
|
+
};
|
|
135
|
+
export declare const withBridgeModule: <R>(module: any, closure: (module: BridgeModule<import("@xyo-network/core").BaseParamsFields & {
|
|
136
|
+
account?: import("@xyo-network/account-model").AccountInstance | "random" | undefined;
|
|
137
|
+
accountDerivationPath?: string | undefined;
|
|
138
|
+
config: import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & {
|
|
77
139
|
readonly archivist?: import("@xyo-network/module-model").ArchivistModuleConfig | undefined;
|
|
78
140
|
readonly name?: string | undefined;
|
|
79
141
|
readonly paging?: Record<string, {
|
|
@@ -108,47 +170,9 @@ export declare const asBridgeModule: {
|
|
|
108
170
|
schema: string;
|
|
109
171
|
}, "schema"> & {
|
|
110
172
|
schema: string;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
(module: any, assert: string | (() => string)): BridgeInstance;
|
|
116
|
-
};
|
|
117
|
-
export declare const withBridgeModule: <R>(module: any, closure: (module: BridgeModule<import("./Bridge").BridgeParams<import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & {
|
|
118
|
-
readonly archivist?: import("@xyo-network/module-model").ArchivistModuleConfig | undefined;
|
|
119
|
-
readonly name?: string | undefined;
|
|
120
|
-
readonly paging?: Record<string, {
|
|
121
|
-
size?: number | undefined;
|
|
122
|
-
}> | undefined;
|
|
123
|
-
readonly schema: string;
|
|
124
|
-
readonly security?: {
|
|
125
|
-
readonly allowAnonymous?: boolean | undefined;
|
|
126
|
-
readonly allowed?: Record<string, (string | import("@xyo-network/module-model").CosigningAddressSet)[]> | undefined;
|
|
127
|
-
readonly disallowed?: Record<string, string[]> | undefined;
|
|
128
|
-
} | undefined;
|
|
129
|
-
readonly storeQueries?: boolean | undefined;
|
|
130
|
-
} & Omit<Omit<import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & {
|
|
131
|
-
readonly archivist?: import("@xyo-network/module-model").ArchivistModuleConfig | undefined;
|
|
132
|
-
readonly name?: string | undefined;
|
|
133
|
-
readonly paging?: Record<string, {
|
|
134
|
-
size?: number | undefined;
|
|
135
|
-
}> | undefined;
|
|
136
|
-
readonly schema: "network.xyo.bridge.config";
|
|
137
|
-
readonly security?: {
|
|
138
|
-
readonly allowAnonymous?: boolean | undefined;
|
|
139
|
-
readonly allowed?: Record<string, (string | import("@xyo-network/module-model").CosigningAddressSet)[]> | undefined;
|
|
140
|
-
readonly disallowed?: Record<string, string[]> | undefined;
|
|
141
|
-
} | undefined;
|
|
142
|
-
readonly storeQueries?: boolean | undefined;
|
|
143
|
-
} & Omit<{
|
|
144
|
-
discoverCache?: true | import("./Config").CacheConfig | undefined;
|
|
145
|
-
schema: "network.xyo.bridge.config";
|
|
146
|
-
}, "schema"> & {
|
|
147
|
-
schema: "network.xyo.bridge.config";
|
|
148
|
-
}, "schema"> & {
|
|
149
|
-
schema: string;
|
|
150
|
-
}, "schema"> & {
|
|
151
|
-
schema: string;
|
|
152
|
-
}>, import("@xyo-network/module-model").ModuleEventData>) => R) => R | undefined;
|
|
173
|
+
};
|
|
174
|
+
ephemeralQueryAccountEnabled?: boolean | undefined;
|
|
175
|
+
wallet?: import("@xyo-network/wallet-model").WalletInstance | undefined;
|
|
176
|
+
}, import("@xyo-network/module-model").ModuleEventData>) => R) => R | undefined;
|
|
153
177
|
export declare const withBridgeInstance: <R>(module: any, closure: (module: BridgeInstance) => R) => R | undefined;
|
|
154
178
|
//# sourceMappingURL=typeChecks.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typeChecks.d.ts","sourceRoot":"","sources":["../../src/typeChecks.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"typeChecks.d.ts","sourceRoot":"","sources":["../../src/typeChecks.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAGvD,eAAO,MAAM,gBAAgB,wEAM5B,CAAA;AACD,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wDAAsG,CAAA;AAEjI,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAyC,CAAA;AACpE,eAAO,MAAM,gBAAgB;;;CAA2C,CAAA;AACxE,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+EAAqC,CAAA;AAClE,eAAO,MAAM,kBAAkB,2EAAuC,CAAA"}
|
package/package.json
CHANGED
|
@@ -10,16 +10,17 @@
|
|
|
10
10
|
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/issues"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@xyo-network/boundwitness-builder": "~2.
|
|
14
|
-
"@xyo-network/core": "~2.
|
|
15
|
-
"@xyo-network/module": "~2.
|
|
16
|
-
"@xyo-network/module-model": "~2.
|
|
17
|
-
"@xyo-network/
|
|
18
|
-
"@xyo-network/
|
|
13
|
+
"@xyo-network/boundwitness-builder": "~2.67.0-rc.2",
|
|
14
|
+
"@xyo-network/core": "~2.67.0-rc.2",
|
|
15
|
+
"@xyo-network/module": "~2.67.0-rc.2",
|
|
16
|
+
"@xyo-network/module-model": "~2.67.0-rc.2",
|
|
17
|
+
"@xyo-network/object-identity": "~2.67.0-rc.2",
|
|
18
|
+
"@xyo-network/payload-model": "~2.67.0-rc.2",
|
|
19
|
+
"@xyo-network/promise": "~2.67.0-rc.2"
|
|
19
20
|
},
|
|
20
21
|
"devDependencies": {
|
|
21
|
-
"@xylabs/ts-scripts-yarn3": "^2.
|
|
22
|
-
"@xylabs/tsconfig": "^2.
|
|
22
|
+
"@xylabs/ts-scripts-yarn3": "^2.19.0",
|
|
23
|
+
"@xylabs/tsconfig": "^2.19.0",
|
|
23
24
|
"typescript": "^5.1.6"
|
|
24
25
|
},
|
|
25
26
|
"description": "Primary SDK for using XYO Protocol 2.0",
|
|
@@ -55,5 +56,6 @@
|
|
|
55
56
|
},
|
|
56
57
|
"sideEffects": false,
|
|
57
58
|
"types": "dist/types/index.d.ts",
|
|
58
|
-
"version": "2.
|
|
59
|
+
"version": "2.67.0-rc.2",
|
|
60
|
+
"stableVersion": "2.66.9"
|
|
59
61
|
}
|
package/src/Bridge.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { QueryBoundWitness } from '@xyo-network/boundwitness-builder'
|
|
2
2
|
import {
|
|
3
3
|
AnyConfigSchema,
|
|
4
|
-
Module,
|
|
5
4
|
ModuleConfig,
|
|
6
5
|
ModuleEventData,
|
|
7
6
|
ModuleFilter,
|
|
@@ -33,13 +32,13 @@ export interface BridgeModule<TParams extends BridgeParams = BridgeParams, TEven
|
|
|
33
32
|
targetQuery(address: string, query: Query, payloads?: Payload[]): Promisable<ModuleQueryResult>
|
|
34
33
|
targetQueryable(address: string, query: QueryBoundWitness, payloads?: Payload[], queryConfig?: ModuleConfig): Promisable<boolean>
|
|
35
34
|
|
|
36
|
-
targetResolve(address: string, filter?: ModuleFilter, options?: ModuleFilterOptions): Promisable<
|
|
37
|
-
targetResolve(address: string, nameOrAddress: string, options?: ModuleFilterOptions): Promisable<
|
|
35
|
+
targetResolve(address: string, filter?: ModuleFilter, options?: ModuleFilterOptions): Promisable<ModuleInstance[]>
|
|
36
|
+
targetResolve(address: string, nameOrAddress: string, options?: ModuleFilterOptions): Promisable<ModuleInstance | undefined>
|
|
38
37
|
targetResolve(
|
|
39
38
|
address: string,
|
|
40
39
|
nameOrAddressOrFilter?: ModuleFilter | string,
|
|
41
40
|
options?: ModuleFilterOptions,
|
|
42
|
-
): Promisable<
|
|
41
|
+
): Promisable<ModuleInstance | ModuleInstance[] | undefined>
|
|
43
42
|
}
|
|
44
43
|
|
|
45
44
|
export type BridgeInstance<TParams extends BridgeParams = BridgeParams, TEventData extends ModuleEventData = ModuleEventData> = BridgeModule<
|
package/src/typeChecks.ts
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IsInstanceFactory, IsModuleFactory, isModuleInstance, WithFactory } from '@xyo-network/module-model'
|
|
2
|
+
import { AsObjectFactory } from '@xyo-network/object-identity'
|
|
2
3
|
|
|
3
4
|
import { BridgeInstance, BridgeModule } from './Bridge'
|
|
4
5
|
import { BridgeConnectQuerySchema, BridgeDisconnectQuerySchema } from './Queries'
|
|
5
6
|
|
|
6
|
-
export const isBridgeInstance = IsInstanceFactory
|
|
7
|
+
export const isBridgeInstance = new IsInstanceFactory<BridgeInstance>().create(
|
|
7
8
|
{
|
|
8
9
|
connect: 'function',
|
|
9
10
|
disconnect: 'function',
|
|
10
11
|
},
|
|
11
|
-
isModuleInstance,
|
|
12
|
+
[isModuleInstance],
|
|
12
13
|
)
|
|
13
|
-
export const isBridgeModule = IsModuleFactory
|
|
14
|
+
export const isBridgeModule = new IsModuleFactory<BridgeModule>().create([BridgeConnectQuerySchema, BridgeDisconnectQuerySchema])
|
|
14
15
|
|
|
15
|
-
export const asBridgeModule =
|
|
16
|
-
export const asBridgeInstance =
|
|
16
|
+
export const asBridgeModule = AsObjectFactory.create(isBridgeModule)
|
|
17
|
+
export const asBridgeInstance = AsObjectFactory.create(isBridgeInstance)
|
|
17
18
|
export const withBridgeModule = WithFactory.create(isBridgeModule)
|
|
18
19
|
export const withBridgeInstance = WithFactory.create(isBridgeInstance)
|