Merge pull request #28 from pubky/update-bindings

chore: update bindings
This commit is contained in:
Corey
2025-05-12 13:14:03 -04:00
committed by GitHub
9 changed files with 9 additions and 5 deletions

View File

@@ -1237,7 +1237,7 @@ PODS:
- ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core - ReactCommon/turbomodule/core
- Yoga - Yoga
- react-native-pubky (0.10.3): - react-native-pubky (0.10.4):
- DoubleConversion - DoubleConversion
- glog - glog
- hermes-engine - hermes-engine
@@ -1757,7 +1757,7 @@ SPEC CHECKSUMS:
React-logger: 4072f39df335ca443932e0ccece41fbeb5ca8404 React-logger: 4072f39df335ca443932e0ccece41fbeb5ca8404
React-Mapbuffer: 714f2fae68edcabfc332b754e9fbaa8cfc68fdd4 React-Mapbuffer: 714f2fae68edcabfc332b754e9fbaa8cfc68fdd4
React-microtasksnativemodule: 4943ad8f99be8ccf5a63329fa7d269816609df9e React-microtasksnativemodule: 4943ad8f99be8ccf5a63329fa7d269816609df9e
react-native-pubky: c17a151ec1ce63258083c97a2a97500fd043170c react-native-pubky: 87c1142e8610d444be8380f4c7eb93816bf5b072
React-nativeconfig: 4a9543185905fe41014c06776bf126083795aed9 React-nativeconfig: 4a9543185905fe41014c06776bf126083795aed9
React-NativeModulesApple: 0506da59fc40d2e1e6e12a233db5e81c46face27 React-NativeModulesApple: 0506da59fc40d2e1e6e12a233db5e81c46face27
React-perflogger: 3bbb82f18e9ac29a1a6931568e99d6305ef4403b React-perflogger: 3bbb82f18e9ac29a1a6931568e99d6305ef4403b

View File

@@ -1,6 +1,6 @@
{ {
"name": "@synonymdev/react-native-pubky", "name": "@synonymdev/react-native-pubky",
"version": "0.10.3", "version": "0.10.4",
"description": "React Native Implementation of Pubky", "description": "React Native Implementation of Pubky",
"source": "./src/index.tsx", "source": "./src/index.tsx",
"main": "./lib/commonjs/index.js", "main": "./lib/commonjs/index.js",

View File

@@ -199,13 +199,17 @@ export async function signOut(secretKey: string): Promise<Result<string[]>> {
} }
} }
export async function get(url: string): Promise<Result<unknown>> { export async function get(url: string): Promise<Result<string>> {
try { try {
const res = await Pubky.get(url); const res = await Pubky.get(url);
if (res[0] === 'error') { if (res[0] === 'error') {
return err(res[1]); return err(res[1]);
} }
return ok(JSON.parse(res[1])); // Return the raw response directly
// It will be either:
// - Plain text (for UTF-8 content)
// - "base64:..." (for binary content)
return ok(res[1]);
} catch (e) { } catch (e) {
return err(JSON.stringify(e)); return err(JSON.stringify(e));
} }