@akita-protocol/algomd-rn 1.0.0-alpha.6 → 1.0.0-alpha.7
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akita-protocol/algomd-rn",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.7",
|
|
4
4
|
"main": "src/index.ts",
|
|
5
5
|
"types": "src/index.ts",
|
|
6
6
|
"react-native": "src/index.ts",
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"vite": "^6.4.3"
|
|
80
80
|
},
|
|
81
81
|
"dependencies": {
|
|
82
|
-
"@akita-protocol/algomd-core": "1.0.0-alpha.
|
|
82
|
+
"@akita-protocol/algomd-core": "1.0.0-alpha.7"
|
|
83
83
|
},
|
|
84
84
|
"exports": {
|
|
85
85
|
".": "./src/index.ts",
|
|
@@ -42,6 +42,15 @@ export function useIndexerClient(): algosdk.Indexer | null {
|
|
|
42
42
|
const server = config.indexerServer ?? defaults.indexerServer
|
|
43
43
|
if (!server) return null
|
|
44
44
|
const token = config.indexerToken ?? defaults.indexerToken ?? ''
|
|
45
|
-
return new algosdk.Indexer(token, server,
|
|
45
|
+
return new algosdk.Indexer(token, server, urlPort(server), config.headers)
|
|
46
46
|
}, [config.network, config.indexerServer, config.indexerToken, config.headers])
|
|
47
47
|
}
|
|
48
|
+
|
|
49
|
+
/** The URL's explicit port, or "" for the scheme default, so algosdk keeps the configured port. */
|
|
50
|
+
function urlPort(url: string): string {
|
|
51
|
+
try {
|
|
52
|
+
return new URL(url).port
|
|
53
|
+
} catch {
|
|
54
|
+
return ''
|
|
55
|
+
}
|
|
56
|
+
}
|