@synonymdev/react-native-pubky 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- package/LICENSE +20 -0
- package/README.md +57 -0
- package/android/build.gradle +101 -0
- package/android/gradle.properties +5 -0
- package/android/src/main/AndroidManifest.xml +3 -0
- package/android/src/main/AndroidManifestNew.xml +2 -0
- package/android/src/main/java/com/pubky/PubkyModule.kt +43 -0
- package/android/src/main/java/com/pubky/PubkyPackage.kt +17 -0
- package/android/src/main/java/com/pubky/pubky.iml +11 -0
- package/android/src/main/java/uniffi/mobile/mobile.kt +688 -0
- package/android/src/main/jniLibs/arm64-v8a/libmobile.so +0 -0
- package/android/src/main/jniLibs/armeabi-v7a/libmobile.so +0 -0
- package/android/src/main/jniLibs/x86/libmobile.so +0 -0
- package/android/src/main/jniLibs/x86_64/libmobile.so +0 -0
- package/ios/Frameworks/Mobile.xcframework/Info.plist +47 -0
- package/ios/Frameworks/Mobile.xcframework/ios-arm64/Headers/mobileFFI.h +194 -0
- package/ios/Frameworks/Mobile.xcframework/ios-arm64/Headers/module.modulemap +6 -0
- package/ios/Frameworks/Mobile.xcframework/ios-arm64/libmobile.a +0 -0
- package/ios/Frameworks/Mobile.xcframework/ios-arm64-simulator/Headers/mobileFFI.h +194 -0
- package/ios/Frameworks/Mobile.xcframework/ios-arm64-simulator/Headers/module.modulemap +6 -0
- package/ios/Frameworks/Mobile.xcframework/ios-arm64-simulator/libmobile.a +0 -0
- package/ios/Pubky-Bridging-Header.h +2 -0
- package/ios/Pubky.mm +16 -0
- package/ios/Pubky.swift +16 -0
- package/ios/mobile.swift +484 -0
- package/lib/commonjs/index.js +25 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/module/index.js +21 -0
- package/lib/module/index.js.map +1 -0
- package/lib/typescript/commonjs/package.json +1 -0
- package/lib/typescript/commonjs/src/index.d.ts +3 -0
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -0
- package/lib/typescript/module/package.json +1 -0
- package/lib/typescript/module/src/index.d.ts +3 -0
- package/lib/typescript/module/src/index.d.ts.map +1 -0
- package/package.json +198 -0
- package/react-native-pubky.podspec +50 -0
- package/src/index.tsx +30 -0
@@ -0,0 +1,47 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
3
|
+
<plist version="1.0">
|
4
|
+
<dict>
|
5
|
+
<key>AvailableLibraries</key>
|
6
|
+
<array>
|
7
|
+
<dict>
|
8
|
+
<key>BinaryPath</key>
|
9
|
+
<string>libmobile.a</string>
|
10
|
+
<key>HeadersPath</key>
|
11
|
+
<string>Headers</string>
|
12
|
+
<key>LibraryIdentifier</key>
|
13
|
+
<string>ios-arm64</string>
|
14
|
+
<key>LibraryPath</key>
|
15
|
+
<string>libmobile.a</string>
|
16
|
+
<key>SupportedArchitectures</key>
|
17
|
+
<array>
|
18
|
+
<string>arm64</string>
|
19
|
+
</array>
|
20
|
+
<key>SupportedPlatform</key>
|
21
|
+
<string>ios</string>
|
22
|
+
</dict>
|
23
|
+
<dict>
|
24
|
+
<key>BinaryPath</key>
|
25
|
+
<string>libmobile.a</string>
|
26
|
+
<key>HeadersPath</key>
|
27
|
+
<string>Headers</string>
|
28
|
+
<key>LibraryIdentifier</key>
|
29
|
+
<string>ios-arm64-simulator</string>
|
30
|
+
<key>LibraryPath</key>
|
31
|
+
<string>libmobile.a</string>
|
32
|
+
<key>SupportedArchitectures</key>
|
33
|
+
<array>
|
34
|
+
<string>arm64</string>
|
35
|
+
</array>
|
36
|
+
<key>SupportedPlatform</key>
|
37
|
+
<string>ios</string>
|
38
|
+
<key>SupportedPlatformVariant</key>
|
39
|
+
<string>simulator</string>
|
40
|
+
</dict>
|
41
|
+
</array>
|
42
|
+
<key>CFBundlePackageType</key>
|
43
|
+
<string>XFWK</string>
|
44
|
+
<key>XCFrameworkFormatVersion</key>
|
45
|
+
<string>1.0</string>
|
46
|
+
</dict>
|
47
|
+
</plist>
|
@@ -0,0 +1,194 @@
|
|
1
|
+
// This file was autogenerated by some hot garbage in the `uniffi` crate.
|
2
|
+
// Trust me, you don't want to mess with it!
|
3
|
+
|
4
|
+
#pragma once
|
5
|
+
|
6
|
+
#include <stdbool.h>
|
7
|
+
#include <stddef.h>
|
8
|
+
#include <stdint.h>
|
9
|
+
|
10
|
+
// The following structs are used to implement the lowest level
|
11
|
+
// of the FFI, and thus useful to multiple uniffied crates.
|
12
|
+
// We ensure they are declared exactly once, with a header guard, UNIFFI_SHARED_H.
|
13
|
+
#ifdef UNIFFI_SHARED_H
|
14
|
+
// We also try to prevent mixing versions of shared uniffi header structs.
|
15
|
+
// If you add anything to the #else block, you must increment the version suffix in UNIFFI_SHARED_HEADER_V4
|
16
|
+
#ifndef UNIFFI_SHARED_HEADER_V4
|
17
|
+
#error Combining helper code from multiple versions of uniffi is not supported
|
18
|
+
#endif // ndef UNIFFI_SHARED_HEADER_V4
|
19
|
+
#else
|
20
|
+
#define UNIFFI_SHARED_H
|
21
|
+
#define UNIFFI_SHARED_HEADER_V4
|
22
|
+
// ⚠️ Attention: If you change this #else block (ending in `#endif // def UNIFFI_SHARED_H`) you *must* ⚠️
|
23
|
+
// ⚠️ increment the version suffix in all instances of UNIFFI_SHARED_HEADER_V4 in this file. ⚠️
|
24
|
+
|
25
|
+
typedef struct RustBuffer
|
26
|
+
{
|
27
|
+
int32_t capacity;
|
28
|
+
int32_t len;
|
29
|
+
uint8_t *_Nullable data;
|
30
|
+
} RustBuffer;
|
31
|
+
|
32
|
+
typedef int32_t (*ForeignCallback)(uint64_t, int32_t, const uint8_t *_Nonnull, int32_t, RustBuffer *_Nonnull);
|
33
|
+
|
34
|
+
// Task defined in Rust that Swift executes
|
35
|
+
typedef void (*UniFfiRustTaskCallback)(const void * _Nullable, int8_t);
|
36
|
+
|
37
|
+
// Callback to execute Rust tasks using a Swift Task
|
38
|
+
//
|
39
|
+
// Args:
|
40
|
+
// executor: ForeignExecutor lowered into a size_t value
|
41
|
+
// delay: Delay in MS
|
42
|
+
// task: UniFfiRustTaskCallback to call
|
43
|
+
// task_data: data to pass the task callback
|
44
|
+
typedef int8_t (*UniFfiForeignExecutorCallback)(size_t, uint32_t, UniFfiRustTaskCallback _Nullable, const void * _Nullable);
|
45
|
+
|
46
|
+
typedef struct ForeignBytes
|
47
|
+
{
|
48
|
+
int32_t len;
|
49
|
+
const uint8_t *_Nullable data;
|
50
|
+
} ForeignBytes;
|
51
|
+
|
52
|
+
// Error definitions
|
53
|
+
typedef struct RustCallStatus {
|
54
|
+
int8_t code;
|
55
|
+
RustBuffer errorBuf;
|
56
|
+
} RustCallStatus;
|
57
|
+
|
58
|
+
// ⚠️ Attention: If you change this #else block (ending in `#endif // def UNIFFI_SHARED_H`) you *must* ⚠️
|
59
|
+
// ⚠️ increment the version suffix in all instances of UNIFFI_SHARED_HEADER_V4 in this file. ⚠️
|
60
|
+
#endif // def UNIFFI_SHARED_H
|
61
|
+
|
62
|
+
// Continuation callback for UniFFI Futures
|
63
|
+
typedef void (*UniFfiRustFutureContinuation)(void * _Nonnull, int8_t);
|
64
|
+
|
65
|
+
// Scaffolding functions
|
66
|
+
void* _Nonnull uniffi_mobile_fn_func_auth(RustBuffer url, RustBuffer secret_key
|
67
|
+
);
|
68
|
+
RustBuffer uniffi_mobile_fn_func_myexample(RustCallStatus *_Nonnull out_status
|
69
|
+
|
70
|
+
);
|
71
|
+
RustBuffer ffi_mobile_rustbuffer_alloc(int32_t size, RustCallStatus *_Nonnull out_status
|
72
|
+
);
|
73
|
+
RustBuffer ffi_mobile_rustbuffer_from_bytes(ForeignBytes bytes, RustCallStatus *_Nonnull out_status
|
74
|
+
);
|
75
|
+
void ffi_mobile_rustbuffer_free(RustBuffer buf, RustCallStatus *_Nonnull out_status
|
76
|
+
);
|
77
|
+
RustBuffer ffi_mobile_rustbuffer_reserve(RustBuffer buf, int32_t additional, RustCallStatus *_Nonnull out_status
|
78
|
+
);
|
79
|
+
void ffi_mobile_rust_future_continuation_callback_set(UniFfiRustFutureContinuation _Nonnull callback
|
80
|
+
);
|
81
|
+
void ffi_mobile_rust_future_poll_u8(void* _Nonnull handle, void* _Nonnull uniffi_callback
|
82
|
+
);
|
83
|
+
void ffi_mobile_rust_future_cancel_u8(void* _Nonnull handle
|
84
|
+
);
|
85
|
+
void ffi_mobile_rust_future_free_u8(void* _Nonnull handle
|
86
|
+
);
|
87
|
+
uint8_t ffi_mobile_rust_future_complete_u8(void* _Nonnull handle, RustCallStatus *_Nonnull out_status
|
88
|
+
);
|
89
|
+
void ffi_mobile_rust_future_poll_i8(void* _Nonnull handle, void* _Nonnull uniffi_callback
|
90
|
+
);
|
91
|
+
void ffi_mobile_rust_future_cancel_i8(void* _Nonnull handle
|
92
|
+
);
|
93
|
+
void ffi_mobile_rust_future_free_i8(void* _Nonnull handle
|
94
|
+
);
|
95
|
+
int8_t ffi_mobile_rust_future_complete_i8(void* _Nonnull handle, RustCallStatus *_Nonnull out_status
|
96
|
+
);
|
97
|
+
void ffi_mobile_rust_future_poll_u16(void* _Nonnull handle, void* _Nonnull uniffi_callback
|
98
|
+
);
|
99
|
+
void ffi_mobile_rust_future_cancel_u16(void* _Nonnull handle
|
100
|
+
);
|
101
|
+
void ffi_mobile_rust_future_free_u16(void* _Nonnull handle
|
102
|
+
);
|
103
|
+
uint16_t ffi_mobile_rust_future_complete_u16(void* _Nonnull handle, RustCallStatus *_Nonnull out_status
|
104
|
+
);
|
105
|
+
void ffi_mobile_rust_future_poll_i16(void* _Nonnull handle, void* _Nonnull uniffi_callback
|
106
|
+
);
|
107
|
+
void ffi_mobile_rust_future_cancel_i16(void* _Nonnull handle
|
108
|
+
);
|
109
|
+
void ffi_mobile_rust_future_free_i16(void* _Nonnull handle
|
110
|
+
);
|
111
|
+
int16_t ffi_mobile_rust_future_complete_i16(void* _Nonnull handle, RustCallStatus *_Nonnull out_status
|
112
|
+
);
|
113
|
+
void ffi_mobile_rust_future_poll_u32(void* _Nonnull handle, void* _Nonnull uniffi_callback
|
114
|
+
);
|
115
|
+
void ffi_mobile_rust_future_cancel_u32(void* _Nonnull handle
|
116
|
+
);
|
117
|
+
void ffi_mobile_rust_future_free_u32(void* _Nonnull handle
|
118
|
+
);
|
119
|
+
uint32_t ffi_mobile_rust_future_complete_u32(void* _Nonnull handle, RustCallStatus *_Nonnull out_status
|
120
|
+
);
|
121
|
+
void ffi_mobile_rust_future_poll_i32(void* _Nonnull handle, void* _Nonnull uniffi_callback
|
122
|
+
);
|
123
|
+
void ffi_mobile_rust_future_cancel_i32(void* _Nonnull handle
|
124
|
+
);
|
125
|
+
void ffi_mobile_rust_future_free_i32(void* _Nonnull handle
|
126
|
+
);
|
127
|
+
int32_t ffi_mobile_rust_future_complete_i32(void* _Nonnull handle, RustCallStatus *_Nonnull out_status
|
128
|
+
);
|
129
|
+
void ffi_mobile_rust_future_poll_u64(void* _Nonnull handle, void* _Nonnull uniffi_callback
|
130
|
+
);
|
131
|
+
void ffi_mobile_rust_future_cancel_u64(void* _Nonnull handle
|
132
|
+
);
|
133
|
+
void ffi_mobile_rust_future_free_u64(void* _Nonnull handle
|
134
|
+
);
|
135
|
+
uint64_t ffi_mobile_rust_future_complete_u64(void* _Nonnull handle, RustCallStatus *_Nonnull out_status
|
136
|
+
);
|
137
|
+
void ffi_mobile_rust_future_poll_i64(void* _Nonnull handle, void* _Nonnull uniffi_callback
|
138
|
+
);
|
139
|
+
void ffi_mobile_rust_future_cancel_i64(void* _Nonnull handle
|
140
|
+
);
|
141
|
+
void ffi_mobile_rust_future_free_i64(void* _Nonnull handle
|
142
|
+
);
|
143
|
+
int64_t ffi_mobile_rust_future_complete_i64(void* _Nonnull handle, RustCallStatus *_Nonnull out_status
|
144
|
+
);
|
145
|
+
void ffi_mobile_rust_future_poll_f32(void* _Nonnull handle, void* _Nonnull uniffi_callback
|
146
|
+
);
|
147
|
+
void ffi_mobile_rust_future_cancel_f32(void* _Nonnull handle
|
148
|
+
);
|
149
|
+
void ffi_mobile_rust_future_free_f32(void* _Nonnull handle
|
150
|
+
);
|
151
|
+
float ffi_mobile_rust_future_complete_f32(void* _Nonnull handle, RustCallStatus *_Nonnull out_status
|
152
|
+
);
|
153
|
+
void ffi_mobile_rust_future_poll_f64(void* _Nonnull handle, void* _Nonnull uniffi_callback
|
154
|
+
);
|
155
|
+
void ffi_mobile_rust_future_cancel_f64(void* _Nonnull handle
|
156
|
+
);
|
157
|
+
void ffi_mobile_rust_future_free_f64(void* _Nonnull handle
|
158
|
+
);
|
159
|
+
double ffi_mobile_rust_future_complete_f64(void* _Nonnull handle, RustCallStatus *_Nonnull out_status
|
160
|
+
);
|
161
|
+
void ffi_mobile_rust_future_poll_pointer(void* _Nonnull handle, void* _Nonnull uniffi_callback
|
162
|
+
);
|
163
|
+
void ffi_mobile_rust_future_cancel_pointer(void* _Nonnull handle
|
164
|
+
);
|
165
|
+
void ffi_mobile_rust_future_free_pointer(void* _Nonnull handle
|
166
|
+
);
|
167
|
+
void*_Nonnull ffi_mobile_rust_future_complete_pointer(void* _Nonnull handle, RustCallStatus *_Nonnull out_status
|
168
|
+
);
|
169
|
+
void ffi_mobile_rust_future_poll_rust_buffer(void* _Nonnull handle, void* _Nonnull uniffi_callback
|
170
|
+
);
|
171
|
+
void ffi_mobile_rust_future_cancel_rust_buffer(void* _Nonnull handle
|
172
|
+
);
|
173
|
+
void ffi_mobile_rust_future_free_rust_buffer(void* _Nonnull handle
|
174
|
+
);
|
175
|
+
RustBuffer ffi_mobile_rust_future_complete_rust_buffer(void* _Nonnull handle, RustCallStatus *_Nonnull out_status
|
176
|
+
);
|
177
|
+
void ffi_mobile_rust_future_poll_void(void* _Nonnull handle, void* _Nonnull uniffi_callback
|
178
|
+
);
|
179
|
+
void ffi_mobile_rust_future_cancel_void(void* _Nonnull handle
|
180
|
+
);
|
181
|
+
void ffi_mobile_rust_future_free_void(void* _Nonnull handle
|
182
|
+
);
|
183
|
+
void ffi_mobile_rust_future_complete_void(void* _Nonnull handle, RustCallStatus *_Nonnull out_status
|
184
|
+
);
|
185
|
+
uint16_t uniffi_mobile_checksum_func_auth(void
|
186
|
+
|
187
|
+
);
|
188
|
+
uint16_t uniffi_mobile_checksum_func_myexample(void
|
189
|
+
|
190
|
+
);
|
191
|
+
uint32_t ffi_mobile_uniffi_contract_version(void
|
192
|
+
|
193
|
+
);
|
194
|
+
|
Binary file
|
@@ -0,0 +1,194 @@
|
|
1
|
+
// This file was autogenerated by some hot garbage in the `uniffi` crate.
|
2
|
+
// Trust me, you don't want to mess with it!
|
3
|
+
|
4
|
+
#pragma once
|
5
|
+
|
6
|
+
#include <stdbool.h>
|
7
|
+
#include <stddef.h>
|
8
|
+
#include <stdint.h>
|
9
|
+
|
10
|
+
// The following structs are used to implement the lowest level
|
11
|
+
// of the FFI, and thus useful to multiple uniffied crates.
|
12
|
+
// We ensure they are declared exactly once, with a header guard, UNIFFI_SHARED_H.
|
13
|
+
#ifdef UNIFFI_SHARED_H
|
14
|
+
// We also try to prevent mixing versions of shared uniffi header structs.
|
15
|
+
// If you add anything to the #else block, you must increment the version suffix in UNIFFI_SHARED_HEADER_V4
|
16
|
+
#ifndef UNIFFI_SHARED_HEADER_V4
|
17
|
+
#error Combining helper code from multiple versions of uniffi is not supported
|
18
|
+
#endif // ndef UNIFFI_SHARED_HEADER_V4
|
19
|
+
#else
|
20
|
+
#define UNIFFI_SHARED_H
|
21
|
+
#define UNIFFI_SHARED_HEADER_V4
|
22
|
+
// ⚠️ Attention: If you change this #else block (ending in `#endif // def UNIFFI_SHARED_H`) you *must* ⚠️
|
23
|
+
// ⚠️ increment the version suffix in all instances of UNIFFI_SHARED_HEADER_V4 in this file. ⚠️
|
24
|
+
|
25
|
+
typedef struct RustBuffer
|
26
|
+
{
|
27
|
+
int32_t capacity;
|
28
|
+
int32_t len;
|
29
|
+
uint8_t *_Nullable data;
|
30
|
+
} RustBuffer;
|
31
|
+
|
32
|
+
typedef int32_t (*ForeignCallback)(uint64_t, int32_t, const uint8_t *_Nonnull, int32_t, RustBuffer *_Nonnull);
|
33
|
+
|
34
|
+
// Task defined in Rust that Swift executes
|
35
|
+
typedef void (*UniFfiRustTaskCallback)(const void * _Nullable, int8_t);
|
36
|
+
|
37
|
+
// Callback to execute Rust tasks using a Swift Task
|
38
|
+
//
|
39
|
+
// Args:
|
40
|
+
// executor: ForeignExecutor lowered into a size_t value
|
41
|
+
// delay: Delay in MS
|
42
|
+
// task: UniFfiRustTaskCallback to call
|
43
|
+
// task_data: data to pass the task callback
|
44
|
+
typedef int8_t (*UniFfiForeignExecutorCallback)(size_t, uint32_t, UniFfiRustTaskCallback _Nullable, const void * _Nullable);
|
45
|
+
|
46
|
+
typedef struct ForeignBytes
|
47
|
+
{
|
48
|
+
int32_t len;
|
49
|
+
const uint8_t *_Nullable data;
|
50
|
+
} ForeignBytes;
|
51
|
+
|
52
|
+
// Error definitions
|
53
|
+
typedef struct RustCallStatus {
|
54
|
+
int8_t code;
|
55
|
+
RustBuffer errorBuf;
|
56
|
+
} RustCallStatus;
|
57
|
+
|
58
|
+
// ⚠️ Attention: If you change this #else block (ending in `#endif // def UNIFFI_SHARED_H`) you *must* ⚠️
|
59
|
+
// ⚠️ increment the version suffix in all instances of UNIFFI_SHARED_HEADER_V4 in this file. ⚠️
|
60
|
+
#endif // def UNIFFI_SHARED_H
|
61
|
+
|
62
|
+
// Continuation callback for UniFFI Futures
|
63
|
+
typedef void (*UniFfiRustFutureContinuation)(void * _Nonnull, int8_t);
|
64
|
+
|
65
|
+
// Scaffolding functions
|
66
|
+
void* _Nonnull uniffi_mobile_fn_func_auth(RustBuffer url, RustBuffer secret_key
|
67
|
+
);
|
68
|
+
RustBuffer uniffi_mobile_fn_func_myexample(RustCallStatus *_Nonnull out_status
|
69
|
+
|
70
|
+
);
|
71
|
+
RustBuffer ffi_mobile_rustbuffer_alloc(int32_t size, RustCallStatus *_Nonnull out_status
|
72
|
+
);
|
73
|
+
RustBuffer ffi_mobile_rustbuffer_from_bytes(ForeignBytes bytes, RustCallStatus *_Nonnull out_status
|
74
|
+
);
|
75
|
+
void ffi_mobile_rustbuffer_free(RustBuffer buf, RustCallStatus *_Nonnull out_status
|
76
|
+
);
|
77
|
+
RustBuffer ffi_mobile_rustbuffer_reserve(RustBuffer buf, int32_t additional, RustCallStatus *_Nonnull out_status
|
78
|
+
);
|
79
|
+
void ffi_mobile_rust_future_continuation_callback_set(UniFfiRustFutureContinuation _Nonnull callback
|
80
|
+
);
|
81
|
+
void ffi_mobile_rust_future_poll_u8(void* _Nonnull handle, void* _Nonnull uniffi_callback
|
82
|
+
);
|
83
|
+
void ffi_mobile_rust_future_cancel_u8(void* _Nonnull handle
|
84
|
+
);
|
85
|
+
void ffi_mobile_rust_future_free_u8(void* _Nonnull handle
|
86
|
+
);
|
87
|
+
uint8_t ffi_mobile_rust_future_complete_u8(void* _Nonnull handle, RustCallStatus *_Nonnull out_status
|
88
|
+
);
|
89
|
+
void ffi_mobile_rust_future_poll_i8(void* _Nonnull handle, void* _Nonnull uniffi_callback
|
90
|
+
);
|
91
|
+
void ffi_mobile_rust_future_cancel_i8(void* _Nonnull handle
|
92
|
+
);
|
93
|
+
void ffi_mobile_rust_future_free_i8(void* _Nonnull handle
|
94
|
+
);
|
95
|
+
int8_t ffi_mobile_rust_future_complete_i8(void* _Nonnull handle, RustCallStatus *_Nonnull out_status
|
96
|
+
);
|
97
|
+
void ffi_mobile_rust_future_poll_u16(void* _Nonnull handle, void* _Nonnull uniffi_callback
|
98
|
+
);
|
99
|
+
void ffi_mobile_rust_future_cancel_u16(void* _Nonnull handle
|
100
|
+
);
|
101
|
+
void ffi_mobile_rust_future_free_u16(void* _Nonnull handle
|
102
|
+
);
|
103
|
+
uint16_t ffi_mobile_rust_future_complete_u16(void* _Nonnull handle, RustCallStatus *_Nonnull out_status
|
104
|
+
);
|
105
|
+
void ffi_mobile_rust_future_poll_i16(void* _Nonnull handle, void* _Nonnull uniffi_callback
|
106
|
+
);
|
107
|
+
void ffi_mobile_rust_future_cancel_i16(void* _Nonnull handle
|
108
|
+
);
|
109
|
+
void ffi_mobile_rust_future_free_i16(void* _Nonnull handle
|
110
|
+
);
|
111
|
+
int16_t ffi_mobile_rust_future_complete_i16(void* _Nonnull handle, RustCallStatus *_Nonnull out_status
|
112
|
+
);
|
113
|
+
void ffi_mobile_rust_future_poll_u32(void* _Nonnull handle, void* _Nonnull uniffi_callback
|
114
|
+
);
|
115
|
+
void ffi_mobile_rust_future_cancel_u32(void* _Nonnull handle
|
116
|
+
);
|
117
|
+
void ffi_mobile_rust_future_free_u32(void* _Nonnull handle
|
118
|
+
);
|
119
|
+
uint32_t ffi_mobile_rust_future_complete_u32(void* _Nonnull handle, RustCallStatus *_Nonnull out_status
|
120
|
+
);
|
121
|
+
void ffi_mobile_rust_future_poll_i32(void* _Nonnull handle, void* _Nonnull uniffi_callback
|
122
|
+
);
|
123
|
+
void ffi_mobile_rust_future_cancel_i32(void* _Nonnull handle
|
124
|
+
);
|
125
|
+
void ffi_mobile_rust_future_free_i32(void* _Nonnull handle
|
126
|
+
);
|
127
|
+
int32_t ffi_mobile_rust_future_complete_i32(void* _Nonnull handle, RustCallStatus *_Nonnull out_status
|
128
|
+
);
|
129
|
+
void ffi_mobile_rust_future_poll_u64(void* _Nonnull handle, void* _Nonnull uniffi_callback
|
130
|
+
);
|
131
|
+
void ffi_mobile_rust_future_cancel_u64(void* _Nonnull handle
|
132
|
+
);
|
133
|
+
void ffi_mobile_rust_future_free_u64(void* _Nonnull handle
|
134
|
+
);
|
135
|
+
uint64_t ffi_mobile_rust_future_complete_u64(void* _Nonnull handle, RustCallStatus *_Nonnull out_status
|
136
|
+
);
|
137
|
+
void ffi_mobile_rust_future_poll_i64(void* _Nonnull handle, void* _Nonnull uniffi_callback
|
138
|
+
);
|
139
|
+
void ffi_mobile_rust_future_cancel_i64(void* _Nonnull handle
|
140
|
+
);
|
141
|
+
void ffi_mobile_rust_future_free_i64(void* _Nonnull handle
|
142
|
+
);
|
143
|
+
int64_t ffi_mobile_rust_future_complete_i64(void* _Nonnull handle, RustCallStatus *_Nonnull out_status
|
144
|
+
);
|
145
|
+
void ffi_mobile_rust_future_poll_f32(void* _Nonnull handle, void* _Nonnull uniffi_callback
|
146
|
+
);
|
147
|
+
void ffi_mobile_rust_future_cancel_f32(void* _Nonnull handle
|
148
|
+
);
|
149
|
+
void ffi_mobile_rust_future_free_f32(void* _Nonnull handle
|
150
|
+
);
|
151
|
+
float ffi_mobile_rust_future_complete_f32(void* _Nonnull handle, RustCallStatus *_Nonnull out_status
|
152
|
+
);
|
153
|
+
void ffi_mobile_rust_future_poll_f64(void* _Nonnull handle, void* _Nonnull uniffi_callback
|
154
|
+
);
|
155
|
+
void ffi_mobile_rust_future_cancel_f64(void* _Nonnull handle
|
156
|
+
);
|
157
|
+
void ffi_mobile_rust_future_free_f64(void* _Nonnull handle
|
158
|
+
);
|
159
|
+
double ffi_mobile_rust_future_complete_f64(void* _Nonnull handle, RustCallStatus *_Nonnull out_status
|
160
|
+
);
|
161
|
+
void ffi_mobile_rust_future_poll_pointer(void* _Nonnull handle, void* _Nonnull uniffi_callback
|
162
|
+
);
|
163
|
+
void ffi_mobile_rust_future_cancel_pointer(void* _Nonnull handle
|
164
|
+
);
|
165
|
+
void ffi_mobile_rust_future_free_pointer(void* _Nonnull handle
|
166
|
+
);
|
167
|
+
void*_Nonnull ffi_mobile_rust_future_complete_pointer(void* _Nonnull handle, RustCallStatus *_Nonnull out_status
|
168
|
+
);
|
169
|
+
void ffi_mobile_rust_future_poll_rust_buffer(void* _Nonnull handle, void* _Nonnull uniffi_callback
|
170
|
+
);
|
171
|
+
void ffi_mobile_rust_future_cancel_rust_buffer(void* _Nonnull handle
|
172
|
+
);
|
173
|
+
void ffi_mobile_rust_future_free_rust_buffer(void* _Nonnull handle
|
174
|
+
);
|
175
|
+
RustBuffer ffi_mobile_rust_future_complete_rust_buffer(void* _Nonnull handle, RustCallStatus *_Nonnull out_status
|
176
|
+
);
|
177
|
+
void ffi_mobile_rust_future_poll_void(void* _Nonnull handle, void* _Nonnull uniffi_callback
|
178
|
+
);
|
179
|
+
void ffi_mobile_rust_future_cancel_void(void* _Nonnull handle
|
180
|
+
);
|
181
|
+
void ffi_mobile_rust_future_free_void(void* _Nonnull handle
|
182
|
+
);
|
183
|
+
void ffi_mobile_rust_future_complete_void(void* _Nonnull handle, RustCallStatus *_Nonnull out_status
|
184
|
+
);
|
185
|
+
uint16_t uniffi_mobile_checksum_func_auth(void
|
186
|
+
|
187
|
+
);
|
188
|
+
uint16_t uniffi_mobile_checksum_func_myexample(void
|
189
|
+
|
190
|
+
);
|
191
|
+
uint32_t ffi_mobile_uniffi_contract_version(void
|
192
|
+
|
193
|
+
);
|
194
|
+
|
package/ios/Pubky.mm
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
#import <React/RCTBridgeModule.h>
|
2
|
+
|
3
|
+
@interface RCT_EXTERN_MODULE(Pubky, NSObject)
|
4
|
+
|
5
|
+
RCT_EXTERN_METHOD(auth:(NSString *)url
|
6
|
+
secretKey:(NSString *)secretKey
|
7
|
+
withResolver:(RCTPromiseResolveBlock)resolve
|
8
|
+
withRejecter:(RCTPromiseRejectBlock)reject)
|
9
|
+
|
10
|
+
|
11
|
+
+ (BOOL)requiresMainQueueSetup
|
12
|
+
{
|
13
|
+
return NO;
|
14
|
+
}
|
15
|
+
|
16
|
+
@end
|
package/ios/Pubky.swift
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
import Foundation
|
2
|
+
|
3
|
+
@objc(Pubky)
|
4
|
+
class Pubky: NSObject {
|
5
|
+
@objc(auth:secretKey:withResolver:withRejecter:)
|
6
|
+
func auth(_ url: String, secretKey: String, resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) {
|
7
|
+
Task {
|
8
|
+
do {
|
9
|
+
let result = try await react_native_pubky.auth(url: url, secretKey: secretKey)
|
10
|
+
resolve(result)
|
11
|
+
} catch {
|
12
|
+
reject("auth Error", "Failed to auth", error)
|
13
|
+
}
|
14
|
+
}
|
15
|
+
}
|
16
|
+
}
|