@xyo-network/bridge-wrapper 3.0.2 → 3.0.4
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/neutral/index.mjs.map +1 -1
- package/package.json +9 -9
- package/src/BridgeWrapper.ts +6 -5
- package/xy.config.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/BridgeWrapper.ts"],"sourcesContent":["import { Address } from '@xylabs/hex'\nimport {\n BridgeExposeOptions,\n BridgeExposeQuery,\n
|
|
1
|
+
{"version":3,"sources":["../../src/BridgeWrapper.ts"],"sourcesContent":["import type { Address } from '@xylabs/hex'\nimport type {\n BridgeExposeOptions,\n BridgeExposeQuery,\n BridgeInstance,\n BridgeModule,\n BridgeUnexposeOptions,\n BridgeUnexposeQuery,\n ModuleFilterPayload } from '@xyo-network/bridge-model'\nimport {\n BridgeExposeQuerySchema,\n BridgeUnexposeQuerySchema,\n isBridgeInstance,\n isBridgeModule,\n ModuleFilterPayloadSchema,\n} from '@xyo-network/bridge-model'\nimport type { AddressPayload, ModuleIdentifier, ModuleInstance } from '@xyo-network/module-model'\nimport { constructableModuleWrapper, ModuleWrapper } from '@xyo-network/module-wrapper'\n\nconstructableModuleWrapper()\nexport class BridgeWrapper<TWrappedModule extends BridgeModule = BridgeModule>\n extends ModuleWrapper<TWrappedModule>\n implements BridgeInstance<TWrappedModule['params']> {\n static override instanceIdentityCheck = isBridgeInstance\n static override moduleIdentityCheck = isBridgeModule\n\n async expose(id: ModuleIdentifier, options?: BridgeExposeOptions): Promise<ModuleInstance[]> {\n const filterPayload: ModuleFilterPayload = { id, schema: ModuleFilterPayloadSchema, ...options }\n const addresses = (\n await this.sendQuery<BridgeExposeQuery, ModuleFilterPayload, AddressPayload>({ schema: BridgeExposeQuerySchema }, [filterPayload])\n ).map(({ address }) => address)\n return await Promise.all((addresses as Address[]).map(address => this.resolve(address)))\n }\n\n async unexpose(id: ModuleIdentifier, options?: BridgeUnexposeOptions): Promise<Address[]> {\n const filterPayload: ModuleFilterPayload = { id, schema: ModuleFilterPayloadSchema, ...options }\n return (\n await this.sendQuery<BridgeUnexposeQuery, ModuleFilterPayload, AddressPayload>({ schema: BridgeUnexposeQuerySchema }, [filterPayload])\n ).map(({ address }) => address)\n }\n}\n"],"mappings":";;;;AASA,SACEA,yBACAC,2BACAC,kBACAC,gBACAC,iCACK;AAEP,SAASC,4BAA4BC,qBAAqB;AAE1DC,2BAAAA;AACO,IAAMC,gBAAN,cACGC,cAAAA;EAZV,OAYUA;;;EAER,OAAgBC,wBAAwBC;EACxC,OAAgBC,sBAAsBC;EAEtC,MAAMC,OAAOC,IAAsBC,SAA0D;AAC3F,UAAMC,gBAAqC;MAAEF;MAAIG,QAAQC;MAA2B,GAAGH;IAAQ;AAC/F,UAAMI,aACJ,MAAM,KAAKC,UAAkE;MAAEH,QAAQI;IAAwB,GAAG;MAACL;KAAc,GACjIM,IAAI,CAAC,EAAEC,QAAO,MAAOA,OAAAA;AACvB,WAAO,MAAMC,QAAQC,IAAKN,UAAwBG,IAAIC,CAAAA,YAAW,KAAKG,QAAQH,OAAAA,CAAAA,CAAAA;EAChF;EAEA,MAAMI,SAASb,IAAsBC,SAAqD;AACxF,UAAMC,gBAAqC;MAAEF;MAAIG,QAAQC;MAA2B,GAAGH;IAAQ;AAC/F,YACE,MAAM,KAAKK,UAAoE;MAAEH,QAAQW;IAA0B,GAAG;MAACZ;KAAc,GACrIM,IAAI,CAAC,EAAEC,QAAO,MAAOA,OAAAA;EACzB;AACF;","names":["BridgeExposeQuerySchema","BridgeUnexposeQuerySchema","isBridgeInstance","isBridgeModule","ModuleFilterPayloadSchema","constructableModuleWrapper","ModuleWrapper","constructableModuleWrapper","BridgeWrapper","ModuleWrapper","instanceIdentityCheck","isBridgeInstance","moduleIdentityCheck","isBridgeModule","expose","id","options","filterPayload","schema","ModuleFilterPayloadSchema","addresses","sendQuery","BridgeExposeQuerySchema","map","address","Promise","all","resolve","unexpose","BridgeUnexposeQuerySchema"]}
|
package/package.json
CHANGED
|
@@ -7,17 +7,17 @@
|
|
|
7
7
|
},
|
|
8
8
|
"bugs": {
|
|
9
9
|
"email": "support@xyo.network",
|
|
10
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/issues"
|
|
10
|
+
"url": "git+https://github.com/XYOracleNetwork/sdk-xyo-client-js/issues"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@xylabs/hex": "^4.0.
|
|
14
|
-
"@xyo-network/bridge-model": "^3.0.
|
|
15
|
-
"@xyo-network/module-model": "^3.0.
|
|
16
|
-
"@xyo-network/module-wrapper": "^3.0.
|
|
13
|
+
"@xylabs/hex": "^4.0.2",
|
|
14
|
+
"@xyo-network/bridge-model": "^3.0.4",
|
|
15
|
+
"@xyo-network/module-model": "^3.0.4",
|
|
16
|
+
"@xyo-network/module-wrapper": "^3.0.4"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@xylabs/ts-scripts-yarn3": "^4.0.0-rc.
|
|
20
|
-
"@xylabs/tsconfig": "^4.0.0-rc.
|
|
19
|
+
"@xylabs/ts-scripts-yarn3": "^4.0.0-rc.20",
|
|
20
|
+
"@xylabs/tsconfig": "^4.0.0-rc.20",
|
|
21
21
|
"typescript": "^5.5.4"
|
|
22
22
|
},
|
|
23
23
|
"description": "Primary SDK for using XYO Protocol 2.0",
|
|
@@ -37,9 +37,9 @@
|
|
|
37
37
|
},
|
|
38
38
|
"repository": {
|
|
39
39
|
"type": "git",
|
|
40
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js.git"
|
|
40
|
+
"url": "git+https://github.com/XYOracleNetwork/sdk-xyo-client-js.git"
|
|
41
41
|
},
|
|
42
42
|
"sideEffects": false,
|
|
43
|
-
"version": "3.0.
|
|
43
|
+
"version": "3.0.4",
|
|
44
44
|
"type": "module"
|
|
45
45
|
}
|
package/src/BridgeWrapper.ts
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import { Address } from '@xylabs/hex'
|
|
2
|
-
import {
|
|
1
|
+
import type { Address } from '@xylabs/hex'
|
|
2
|
+
import type {
|
|
3
3
|
BridgeExposeOptions,
|
|
4
4
|
BridgeExposeQuery,
|
|
5
|
-
BridgeExposeQuerySchema,
|
|
6
5
|
BridgeInstance,
|
|
7
6
|
BridgeModule,
|
|
8
7
|
BridgeUnexposeOptions,
|
|
9
8
|
BridgeUnexposeQuery,
|
|
9
|
+
ModuleFilterPayload } from '@xyo-network/bridge-model'
|
|
10
|
+
import {
|
|
11
|
+
BridgeExposeQuerySchema,
|
|
10
12
|
BridgeUnexposeQuerySchema,
|
|
11
13
|
isBridgeInstance,
|
|
12
14
|
isBridgeModule,
|
|
13
|
-
ModuleFilterPayload,
|
|
14
15
|
ModuleFilterPayloadSchema,
|
|
15
16
|
} from '@xyo-network/bridge-model'
|
|
16
|
-
import { AddressPayload, ModuleIdentifier, ModuleInstance } from '@xyo-network/module-model'
|
|
17
|
+
import type { AddressPayload, ModuleIdentifier, ModuleInstance } from '@xyo-network/module-model'
|
|
17
18
|
import { constructableModuleWrapper, ModuleWrapper } from '@xyo-network/module-wrapper'
|
|
18
19
|
|
|
19
20
|
constructableModuleWrapper()
|
package/xy.config.ts
CHANGED