mirror of
https://github.com/aljazceru/react-native-pubky.git
synced 2025-12-18 23:24:22 +01:00
refactor: return session info
Returns session info when signing up/in. Bumps version to 0.9.3.
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1237,7 +1237,7 @@ PODS:
|
|||||||
- ReactCommon/turbomodule/bridging
|
- ReactCommon/turbomodule/bridging
|
||||||
- ReactCommon/turbomodule/core
|
- ReactCommon/turbomodule/core
|
||||||
- Yoga
|
- Yoga
|
||||||
- react-native-pubky (0.9.2):
|
- react-native-pubky (0.9.3):
|
||||||
- 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: b33ab8648b1ae4084ab1969f13b87baa51aa7a8e
|
react-native-pubky: e88bb8d49d795e78a269a32b790068fbd5824b8f
|
||||||
React-nativeconfig: 4a9543185905fe41014c06776bf126083795aed9
|
React-nativeconfig: 4a9543185905fe41014c06776bf126083795aed9
|
||||||
React-NativeModulesApple: 0506da59fc40d2e1e6e12a233db5e81c46face27
|
React-NativeModulesApple: 0506da59fc40d2e1e6e12a233db5e81c46face27
|
||||||
React-perflogger: 3bbb82f18e9ac29a1a6931568e99d6305ef4403b
|
React-perflogger: 3bbb82f18e9ac29a1a6931568e99d6305ef4403b
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ import {
|
|||||||
} from '@synonymdev/react-native-pubky';
|
} from '@synonymdev/react-native-pubky';
|
||||||
|
|
||||||
const HOMESERVER = '8pinxxgqs41n4aididenw5apqp1urfmzdztr8jt4abrkdn435ewo';
|
const HOMESERVER = '8pinxxgqs41n4aididenw5apqp1urfmzdztr8jt4abrkdn435ewo';
|
||||||
|
//const HOMESERVER = 'ufibwbmed6jeq9k4p583go95wofakh9fwpp4k734trq79pd9u1uy';
|
||||||
const SECRET_KEY =
|
const SECRET_KEY =
|
||||||
'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855';
|
'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855';
|
||||||
const PUBLIC_KEY = 'z4e8s17cou9qmuwen8p1556jzhf1wktmzo6ijsfnri9c4hnrdfty';
|
const PUBLIC_KEY = 'z4e8s17cou9qmuwen8p1556jzhf1wktmzo6ijsfnri9c4hnrdfty';
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@synonymdev/react-native-pubky",
|
"name": "@synonymdev/react-native-pubky",
|
||||||
"version": "0.9.2",
|
"version": "0.9.3",
|
||||||
"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",
|
||||||
|
|||||||
@@ -129,25 +129,25 @@ export async function resolve(publicKey: string): Promise<Result<IDNSPacket>> {
|
|||||||
export async function signUp(
|
export async function signUp(
|
||||||
secretKey: string,
|
secretKey: string,
|
||||||
homeserver: string
|
homeserver: string
|
||||||
): Promise<Result<string[]>> {
|
): Promise<Result<SessionInfo>> {
|
||||||
try {
|
try {
|
||||||
const res = await Pubky.signUp(secretKey, homeserver);
|
const res = await Pubky.signUp(secretKey, homeserver);
|
||||||
if (res[0] === 'error') {
|
if (res[0] === 'error') {
|
||||||
return err(res[1]);
|
return err(res[1]);
|
||||||
}
|
}
|
||||||
return ok(res[1]);
|
return ok(JSON.parse(res[1]));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return err(JSON.stringify(e));
|
return err(JSON.stringify(e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function signIn(secretKey: string): Promise<Result<string[]>> {
|
export async function signIn(secretKey: string): Promise<Result<SessionInfo>> {
|
||||||
try {
|
try {
|
||||||
const res = await Pubky.signIn(secretKey);
|
const res = await Pubky.signIn(secretKey);
|
||||||
if (res[0] === 'error') {
|
if (res[0] === 'error') {
|
||||||
return err(res[1]);
|
return err(res[1]);
|
||||||
}
|
}
|
||||||
return ok(res[1]);
|
return ok(JSON.parse(res[1]));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return err(JSON.stringify(e));
|
return err(JSON.stringify(e));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user