@xyo-network/bridge 2.46.1 → 2.46.3

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,26 +1,22 @@
1
- import { ArchivistWrapper } from '@xyo-network/archivist-wrapper'
2
- import { Axios } from '@xyo-network/axios'
3
- import { uuid } from '@xyo-network/core'
4
- import { PayloadWrapper } from '@xyo-network/payload-wrapper'
1
+ import { AxiosJson } from '@xyo-network/axios'
2
+ import { NodeWrapper } from '@xyo-network/node'
5
3
 
6
- import { HttpBridgeConfigSchema, XyoHttpBridge } from '../HttpBridge'
4
+ import { HttpBridge } from '../HttpBridge'
5
+ import { HttpBridgeConfigSchema } from '../HttpBridgeConfig'
7
6
 
8
- test('XyoHttpBridge', async () => {
9
- const nodeUri = `${process.env.API_DOMAIN}` ?? 'https://beta.api.archivist.xyo.network'
10
- const targetAddress = 'temp'
7
+ test('HttpBridge', async () => {
8
+ const nodeUri = `${process.env.API_DOMAIN}` ?? 'http://localhost:8080'
11
9
 
12
- const bridge = await XyoHttpBridge.create({
13
- axios: new Axios(),
14
- config: { nodeUri, schema: HttpBridgeConfigSchema, targetAddress },
10
+ const bridge = await HttpBridge.create({
11
+ axios: new AxiosJson(),
12
+ config: { nodeUri, schema: HttpBridgeConfigSchema, targetAddress: '5111228f724a066ac060fe2e6c8bbaae44b107d5' },
15
13
  })
16
- const wrapper = new ArchivistWrapper(bridge)
17
- const debugPayload = {
18
- nonce: uuid(),
19
- schema: 'network.xyo.debug',
20
- }
21
- const result = await wrapper.insert([debugPayload])
22
- console.log(result)
23
- //expect(result).toBeDefined()
24
- await wrapper.get([new PayloadWrapper(debugPayload).hash])
25
- //expect(result2).toBeDefined()
14
+ const wrapper = NodeWrapper.wrap(bridge)
15
+ const description = await wrapper.describe()
16
+ expect(description.children).toBeArray()
17
+ expect(description.children?.length).toBeGreaterThan(0)
18
+ expect(description.queries).toBeArray()
19
+ expect(description.queries?.length).toBeGreaterThan(0)
20
+
21
+ console.log(JSON.stringify(description, null, 2))
26
22
  })