@xyo-network/react-payload-huri 9.0.1 → 9.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.
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { UsePromiseState } from '@xylabs/react-promise';
|
|
2
|
-
import type { DivinerInstance } from '@xyo-network/
|
|
3
|
-
import type { Payload } from '@xyo-network/payload-model';
|
|
2
|
+
import type { DivinerInstance, Payload } from '@xyo-network/sdk-js';
|
|
4
3
|
export declare const useFetchHuri: (hashOrHuri?: string, diviner?: DivinerInstance, token?: string) => [Payload[] | undefined, Error | undefined, UsePromiseState | undefined];
|
|
5
4
|
//# sourceMappingURL=useFetchHuri.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFetchHuri.d.ts","sourceRoot":"","sources":["../../../src/hooks/useFetchHuri.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAI5D,OAAO,KAAK,EAAE,eAAe,EAAE,
|
|
1
|
+
{"version":3,"file":"useFetchHuri.d.ts","sourceRoot":"","sources":["../../../src/hooks/useFetchHuri.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAI5D,OAAO,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAKnE,eAAO,MAAM,YAAY,GAAI,aAAa,MAAM,EAAE,UAAU,eAAe,EAAE,QAAQ,MAAM,KAAG,CAAC,OAAO,EAAE,GAAG,SAAS,EAAE,KAAK,GAAG,SAAS,EAAE,eAAe,GAAG,SAAS,CAYnK,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/hooks/useBuildHuri.tsx", "../../src/hooks/useFetchHuri.tsx", "../../src/hooks/useParseHuriFromRoute.tsx"],
|
|
4
|
-
"sourcesContent": ["import { useNetwork } from '@xyo-network/react-network'\n\nexport const useBuildHuri = (hash?: string) => {\n const { network } = useNetwork()\n const networkUri = network?.nodes?.find(node => node.type === 'archivist')?.uri\n\n if (!hash || hash.startsWith('http')) {\n return\n }\n\n return `${networkUri}/${hash}`\n}\n", "import type { UsePromiseState } from '@xylabs/react-promise'\nimport { usePromise } from '@xylabs/react-promise'\nimport type { HuriPayload } from '@xyo-network/diviner-huri'\nimport { HuriSchema } from '@xyo-network/diviner-huri'\nimport type { DivinerInstance
|
|
5
|
-
"mappings": ";AAAA,SAAS,kBAAkB;AAEpB,IAAM,eAAe,CAAC,SAAkB;AAC7C,QAAM,EAAE,QAAQ,IAAI,WAAW;AAC/B,QAAM,aAAa,SAAS,OAAO,KAAK,UAAQ,KAAK,SAAS,WAAW,GAAG;AAE5E,MAAI,CAAC,QAAQ,KAAK,WAAW,MAAM,GAAG;AACpC;AAAA,EACF;AAEA,SAAO,GAAG,UAAU,IAAI,IAAI;AAC9B;;;ACVA,SAAS,kBAAkB;AAE3B,SAAS,kBAAkB;
|
|
4
|
+
"sourcesContent": ["import { useNetwork } from '@xyo-network/react-network'\n\nexport const useBuildHuri = (hash?: string) => {\n const { network } = useNetwork()\n const networkUri = network?.nodes?.find(node => node.type === 'archivist')?.uri\n\n if (!hash || hash.startsWith('http')) {\n return\n }\n\n return `${networkUri}/${hash}`\n}\n", "import type { UsePromiseState } from '@xylabs/react-promise'\nimport { usePromise } from '@xylabs/react-promise'\nimport type { HuriPayload } from '@xyo-network/diviner-huri'\nimport { HuriSchema } from '@xyo-network/diviner-huri'\nimport type { DivinerInstance, Payload } from '@xyo-network/sdk-js'\nimport { useMemo } from 'react'\n\nimport { useBuildHuri } from './useBuildHuri.tsx'\n\nexport const useFetchHuri = (hashOrHuri?: string, diviner?: DivinerInstance, token?: string): [Payload[] | undefined, Error | undefined, UsePromiseState | undefined] => {\n const huri = useBuildHuri(hashOrHuri) ?? hashOrHuri\n const huriPayload: HuriPayload | undefined = useMemo(\n () => (huri\n ? {\n huri: [huri], schema: HuriSchema, tokens: token ? [token] : undefined,\n }\n : undefined),\n [huri, token],\n )\n\n return usePromise(async () => (diviner && huriPayload ? await diviner.divine([huriPayload]) : undefined), [diviner, huriPayload])\n}\n", "import { useParams, useSearchParams } from 'react-router-dom'\n\nimport { useBuildHuri } from './useBuildHuri.tsx'\n\nexport type RouteOptions = 'routeParam' | 'searchParam' | 'any'\n\nexport const useParseHuriFromRoute = (routeOption: RouteOptions = 'any') => {\n const { hash: hashParam } = useParams()\n\n const huriFromHashParam = useBuildHuri(hashParam)\n\n const [params] = useSearchParams()\n const huriSearchParameter = params.get('huri')\n const decodedHuriParam = decodeURIComponent(huriSearchParameter ?? '')\n\n switch (routeOption) {\n case 'routeParam': {\n return huriFromHashParam\n }\n case 'searchParam': {\n return decodedHuriParam\n }\n default: {\n return huriFromHashParam || decodedHuriParam\n }\n }\n}\n"],
|
|
5
|
+
"mappings": ";AAAA,SAAS,kBAAkB;AAEpB,IAAM,eAAe,CAAC,SAAkB;AAC7C,QAAM,EAAE,QAAQ,IAAI,WAAW;AAC/B,QAAM,aAAa,SAAS,OAAO,KAAK,UAAQ,KAAK,SAAS,WAAW,GAAG;AAE5E,MAAI,CAAC,QAAQ,KAAK,WAAW,MAAM,GAAG;AACpC;AAAA,EACF;AAEA,SAAO,GAAG,UAAU,IAAI,IAAI;AAC9B;;;ACVA,SAAS,kBAAkB;AAE3B,SAAS,kBAAkB;AAE3B,SAAS,eAAe;AAIjB,IAAM,eAAe,CAAC,YAAqB,SAA2B,UAA4F;AACvK,QAAM,OAAO,aAAa,UAAU,KAAK;AACzC,QAAM,cAAuC;AAAA,IAC3C,MAAO,OACH;AAAA,MACE,MAAM,CAAC,IAAI;AAAA,MAAG,QAAQ;AAAA,MAAY,QAAQ,QAAQ,CAAC,KAAK,IAAI;AAAA,IAC9D,IACA;AAAA,IACJ,CAAC,MAAM,KAAK;AAAA,EACd;AAEA,SAAO,WAAW,YAAa,WAAW,cAAc,MAAM,QAAQ,OAAO,CAAC,WAAW,CAAC,IAAI,QAAY,CAAC,SAAS,WAAW,CAAC;AAClI;;;ACrBA,SAAS,WAAW,uBAAuB;AAMpC,IAAM,wBAAwB,CAAC,cAA4B,UAAU;AAC1E,QAAM,EAAE,MAAM,UAAU,IAAI,UAAU;AAEtC,QAAM,oBAAoB,aAAa,SAAS;AAEhD,QAAM,CAAC,MAAM,IAAI,gBAAgB;AACjC,QAAM,sBAAsB,OAAO,IAAI,MAAM;AAC7C,QAAM,mBAAmB,mBAAmB,uBAAuB,EAAE;AAErE,UAAQ,aAAa;AAAA,IACnB,KAAK,cAAc;AACjB,aAAO;AAAA,IACT;AAAA,IACA,KAAK,eAAe;AAClB,aAAO;AAAA,IACT;AAAA,IACA,SAAS;AACP,aAAO,qBAAqB;AAAA,IAC9B;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyo-network/react-payload-huri",
|
|
3
|
-
"version": "9.0.
|
|
3
|
+
"version": "9.0.4",
|
|
4
4
|
"description": "Common React library for all XYO projects that use React",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"xyo",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"README.md"
|
|
42
42
|
],
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@xyo-network/react-network": "~9.0.
|
|
44
|
+
"@xyo-network/react-network": "~9.0.4"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@bitauth/libauth": "~3.0.0",
|
|
@@ -52,22 +52,20 @@
|
|
|
52
52
|
"@opentelemetry/sdk-trace-base": "^2.7.1",
|
|
53
53
|
"@scure/base": "~2.2.0",
|
|
54
54
|
"@scure/bip39": "~2.2.0",
|
|
55
|
-
"@types/react": "^19.2.
|
|
56
|
-
"@xylabs/geo": "^6.0.
|
|
55
|
+
"@types/react": "^19.2.16",
|
|
56
|
+
"@xylabs/geo": "^6.0.7",
|
|
57
57
|
"@xylabs/react-promise": "~9.0.2",
|
|
58
58
|
"@xylabs/react-select": "~9.0.2",
|
|
59
59
|
"@xylabs/react-shared": "~9.0.2",
|
|
60
|
-
"@xylabs/sdk-js": "^6.0.
|
|
61
|
-
"@xylabs/threads": "^6.0.
|
|
62
|
-
"@xylabs/toolchain": "~8.1.
|
|
63
|
-
"@xylabs/tsconfig": "^8.1.
|
|
64
|
-
"@xylabs/tsconfig-dom": "^8.1.
|
|
65
|
-
"@xylabs/tsconfig-react": "~8.1.
|
|
66
|
-
"@xyo-network/diviner-huri": "~6.0.
|
|
67
|
-
"@xyo-network/
|
|
68
|
-
"@xyo-network/
|
|
69
|
-
"@xyo-network/payload-model": "^6.0.5",
|
|
70
|
-
"@xyo-network/sdk-protocol-js": "~6.0.5",
|
|
60
|
+
"@xylabs/sdk-js": "^6.0.7",
|
|
61
|
+
"@xylabs/threads": "^6.0.7",
|
|
62
|
+
"@xylabs/toolchain": "~8.1.15",
|
|
63
|
+
"@xylabs/tsconfig": "^8.1.15",
|
|
64
|
+
"@xylabs/tsconfig-dom": "^8.1.15",
|
|
65
|
+
"@xylabs/tsconfig-react": "~8.1.15",
|
|
66
|
+
"@xyo-network/diviner-huri": "~6.0.2",
|
|
67
|
+
"@xyo-network/sdk-js": "^6.0.2",
|
|
68
|
+
"@xyo-network/sdk-protocol-js": "~6.0.7",
|
|
71
69
|
"ajv": "^8.20.0",
|
|
72
70
|
"async-mutex": "^0.5.0",
|
|
73
71
|
"bn.js": "^5.2.3",
|
|
@@ -77,16 +75,13 @@
|
|
|
77
75
|
"ethers": "^6.16.0",
|
|
78
76
|
"hash-wasm": "~4.12.0",
|
|
79
77
|
"idb": "^8.0.3",
|
|
80
|
-
"lru-cache": "^11.
|
|
81
|
-
"mapbox-gl": "^3.23.1",
|
|
78
|
+
"lru-cache": "^11.5.1",
|
|
82
79
|
"observable-fns": "~0.6.1",
|
|
83
80
|
"pako": "^2.1.0",
|
|
84
|
-
"react": "^19.2.
|
|
85
|
-
"react-dom": "^19.2.
|
|
81
|
+
"react": "^19.2.7",
|
|
82
|
+
"react-dom": "^19.2.7",
|
|
86
83
|
"react-router-dom": "^7.16.0",
|
|
87
|
-
"store2": "~2.14.4",
|
|
88
84
|
"typescript": "^6.0.3",
|
|
89
|
-
"wasm-feature-detect": "~1.8.0",
|
|
90
85
|
"webextension-polyfill": "^0.12.0",
|
|
91
86
|
"zod": "^4.4.3"
|
|
92
87
|
},
|
|
@@ -106,9 +101,7 @@
|
|
|
106
101
|
"@xylabs/sdk-js": "^6.0",
|
|
107
102
|
"@xylabs/threads": "^6.0",
|
|
108
103
|
"@xyo-network/diviner-huri": "~6.0",
|
|
109
|
-
"@xyo-network/
|
|
110
|
-
"@xyo-network/network": "~6.0",
|
|
111
|
-
"@xyo-network/payload-model": "^6.0",
|
|
104
|
+
"@xyo-network/sdk-js": "^6.0",
|
|
112
105
|
"@xyo-network/sdk-protocol-js": "~6.0",
|
|
113
106
|
"ajv": "^8.20",
|
|
114
107
|
"async-mutex": "^0.5",
|
|
@@ -119,14 +112,11 @@
|
|
|
119
112
|
"hash-wasm": "~4.12",
|
|
120
113
|
"idb": "^8.0",
|
|
121
114
|
"lru-cache": "^11.3",
|
|
122
|
-
"mapbox-gl": "^3.23",
|
|
123
115
|
"observable-fns": "~0.6",
|
|
124
116
|
"pako": "^2.1",
|
|
125
117
|
"react": "^19.2",
|
|
126
118
|
"react-dom": "^19.2",
|
|
127
119
|
"react-router-dom": "^7.15",
|
|
128
|
-
"store2": "~2.14",
|
|
129
|
-
"wasm-feature-detect": "~1.8",
|
|
130
120
|
"webextension-polyfill": "^0.12",
|
|
131
121
|
"zod": "^4.4"
|
|
132
122
|
},
|