react-native-neural-wallet-lib 0.1.36 → 0.1.38
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/NeuralWalletLib.podspec +0 -2
- package/android/src/main/jniLibs/arm64-v8a/libwallet.a +0 -0
- package/android/src/main/jniLibs/armeabi-v7a/libwallet.a +0 -0
- package/android/src/main/jniLibs/x86/libwallet.a +0 -0
- package/android/src/main/jniLibs/x86_64/libwallet.a +0 -0
- package/cpp/generated/wallet.cpp +47 -0
- package/cpp/generated/wallet.hpp +6 -0
- package/ios/libs/libwallet.a +0 -0
- package/lib/module/generated/wallet-ffi.js.map +1 -1
- package/lib/module/generated/wallet.js +299 -0
- package/lib/module/generated/wallet.js.map +1 -1
- package/lib/typescript/src/generated/wallet-ffi.d.ts +2 -0
- package/lib/typescript/src/generated/wallet-ffi.d.ts.map +1 -1
- package/lib/typescript/src/generated/wallet.d.ts +365 -0
- package/lib/typescript/src/generated/wallet.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/generated/wallet-ffi.ts +6 -0
- package/src/generated/wallet.ts +396 -0
package/NeuralWalletLib.podspec
CHANGED
|
@@ -18,8 +18,6 @@ Pod::Spec.new do |s|
|
|
|
18
18
|
s.source_files = "ios/**/*.{h,m,mm,swift}", "ios/generated/**/*.{h,m,mm}", "cpp/**/*.{hpp,cpp,c,h}", "cpp/generated/**/*.{hpp,cpp,c,h}"
|
|
19
19
|
s.vendored_frameworks = "NeuralWalletLibFramework.xcframework"
|
|
20
20
|
s.dependency "uniffi-bindgen-react-native", "0.29.3-0"
|
|
21
|
-
s.vendored_libraries = 'ios/libs/libwallet.a'
|
|
22
|
-
s.preserve_paths = 'ios/libs/libwallet.a'
|
|
23
21
|
|
|
24
22
|
# Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
|
|
25
23
|
# See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/cpp/generated/wallet.cpp
CHANGED
|
@@ -100,6 +100,9 @@ typedef struct UniffiForeignFutureStructVoid {
|
|
|
100
100
|
} UniffiForeignFutureStructVoid;
|
|
101
101
|
typedef void (*UniffiForeignFutureCompleteVoid)(
|
|
102
102
|
uint64_t callback_data, UniffiForeignFutureStructVoid result);
|
|
103
|
+
RustBuffer
|
|
104
|
+
uniffi_wallet_fn_func_bitcoin_wif_to_keypair(RustBuffer wif, RustBuffer network,
|
|
105
|
+
RustCallStatus *uniffi_out_err);
|
|
103
106
|
RustBuffer uniffi_wallet_fn_func_evm_private_key_to_keypair(
|
|
104
107
|
RustBuffer private_key_hex, RustCallStatus *uniffi_out_err);
|
|
105
108
|
RustBuffer uniffi_wallet_fn_func_generate_bitcoin_keypair(
|
|
@@ -248,6 +251,7 @@ void ffi_wallet_rust_future_free_void(
|
|
|
248
251
|
/*handle*/ uint64_t handle);
|
|
249
252
|
void ffi_wallet_rust_future_complete_void(
|
|
250
253
|
/*handle*/ uint64_t handle, RustCallStatus *uniffi_out_err);
|
|
254
|
+
uint16_t uniffi_wallet_checksum_func_bitcoin_wif_to_keypair();
|
|
251
255
|
uint16_t uniffi_wallet_checksum_func_evm_private_key_to_keypair();
|
|
252
256
|
uint16_t uniffi_wallet_checksum_func_generate_bitcoin_keypair();
|
|
253
257
|
uint16_t uniffi_wallet_checksum_func_generate_complex_password();
|
|
@@ -1665,6 +1669,17 @@ NativeWallet::NativeWallet(
|
|
|
1665
1669
|
return this->cpp_uniffi_internal_fn_func_ffi__arraybuffer_to_string(
|
|
1666
1670
|
rt, thisVal, args, count);
|
|
1667
1671
|
});
|
|
1672
|
+
props["ubrn_uniffi_wallet_fn_func_bitcoin_wif_to_keypair"] =
|
|
1673
|
+
jsi::Function::createFromHostFunction(
|
|
1674
|
+
rt,
|
|
1675
|
+
jsi::PropNameID::forAscii(
|
|
1676
|
+
rt, "ubrn_uniffi_wallet_fn_func_bitcoin_wif_to_keypair"),
|
|
1677
|
+
2,
|
|
1678
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
1679
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
1680
|
+
return this->cpp_uniffi_wallet_fn_func_bitcoin_wif_to_keypair(
|
|
1681
|
+
rt, thisVal, args, count);
|
|
1682
|
+
});
|
|
1668
1683
|
props["ubrn_uniffi_wallet_fn_func_evm_private_key_to_keypair"] =
|
|
1669
1684
|
jsi::Function::createFromHostFunction(
|
|
1670
1685
|
rt,
|
|
@@ -1754,6 +1769,17 @@ NativeWallet::NativeWallet(
|
|
|
1754
1769
|
return this->cpp_uniffi_wallet_fn_func_string_to_base64(
|
|
1755
1770
|
rt, thisVal, args, count);
|
|
1756
1771
|
});
|
|
1772
|
+
props["ubrn_uniffi_wallet_checksum_func_bitcoin_wif_to_keypair"] =
|
|
1773
|
+
jsi::Function::createFromHostFunction(
|
|
1774
|
+
rt,
|
|
1775
|
+
jsi::PropNameID::forAscii(
|
|
1776
|
+
rt, "ubrn_uniffi_wallet_checksum_func_bitcoin_wif_to_keypair"),
|
|
1777
|
+
0,
|
|
1778
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
1779
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
1780
|
+
return this->cpp_uniffi_wallet_checksum_func_bitcoin_wif_to_keypair(
|
|
1781
|
+
rt, thisVal, args, count);
|
|
1782
|
+
});
|
|
1757
1783
|
props["ubrn_uniffi_wallet_checksum_func_evm_private_key_to_keypair"] =
|
|
1758
1784
|
jsi::Function::createFromHostFunction(
|
|
1759
1785
|
rt,
|
|
@@ -1923,6 +1949,20 @@ jsi::Value NativeWallet::cpp_uniffi_internal_fn_func_ffi__arraybuffer_to_string(
|
|
|
1923
1949
|
}
|
|
1924
1950
|
|
|
1925
1951
|
// Methods calling directly into the uniffi generated C API of the Rust crate.
|
|
1952
|
+
jsi::Value NativeWallet::cpp_uniffi_wallet_fn_func_bitcoin_wif_to_keypair(
|
|
1953
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
1954
|
+
size_t count) {
|
|
1955
|
+
RustCallStatus status =
|
|
1956
|
+
uniffi::wallet::Bridging<RustCallStatus>::rustSuccess(rt);
|
|
1957
|
+
auto value = uniffi_wallet_fn_func_bitcoin_wif_to_keypair(
|
|
1958
|
+
uniffi::wallet::Bridging<RustBuffer>::fromJs(rt, callInvoker, args[0]),
|
|
1959
|
+
uniffi::wallet::Bridging<RustBuffer>::fromJs(rt, callInvoker, args[1]),
|
|
1960
|
+
&status);
|
|
1961
|
+
uniffi::wallet::Bridging<RustCallStatus>::copyIntoJs(rt, callInvoker, status,
|
|
1962
|
+
args[count - 1]);
|
|
1963
|
+
|
|
1964
|
+
return uniffi::wallet::Bridging<RustBuffer>::toJs(rt, callInvoker, value);
|
|
1965
|
+
}
|
|
1926
1966
|
jsi::Value NativeWallet::cpp_uniffi_wallet_fn_func_evm_private_key_to_keypair(
|
|
1927
1967
|
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
1928
1968
|
size_t count) {
|
|
@@ -2031,6 +2071,13 @@ jsi::Value NativeWallet::cpp_uniffi_wallet_fn_func_string_to_base64(
|
|
|
2031
2071
|
|
|
2032
2072
|
return uniffi::wallet::Bridging<RustBuffer>::toJs(rt, callInvoker, value);
|
|
2033
2073
|
}
|
|
2074
|
+
jsi::Value NativeWallet::cpp_uniffi_wallet_checksum_func_bitcoin_wif_to_keypair(
|
|
2075
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
2076
|
+
size_t count) {
|
|
2077
|
+
auto value = uniffi_wallet_checksum_func_bitcoin_wif_to_keypair();
|
|
2078
|
+
|
|
2079
|
+
return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
|
|
2080
|
+
}
|
|
2034
2081
|
jsi::Value
|
|
2035
2082
|
NativeWallet::cpp_uniffi_wallet_checksum_func_evm_private_key_to_keypair(
|
|
2036
2083
|
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
package/cpp/generated/wallet.hpp
CHANGED
|
@@ -28,6 +28,9 @@ protected:
|
|
|
28
28
|
jsi::Value cpp_uniffi_internal_fn_func_ffi__arraybuffer_to_string(
|
|
29
29
|
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
30
30
|
size_t count);
|
|
31
|
+
jsi::Value cpp_uniffi_wallet_fn_func_bitcoin_wif_to_keypair(
|
|
32
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
33
|
+
size_t count);
|
|
31
34
|
jsi::Value cpp_uniffi_wallet_fn_func_evm_private_key_to_keypair(
|
|
32
35
|
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
33
36
|
size_t count);
|
|
@@ -52,6 +55,9 @@ protected:
|
|
|
52
55
|
jsi::Value cpp_uniffi_wallet_fn_func_string_to_base64(
|
|
53
56
|
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
54
57
|
size_t count);
|
|
58
|
+
jsi::Value cpp_uniffi_wallet_checksum_func_bitcoin_wif_to_keypair(
|
|
59
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
60
|
+
size_t count);
|
|
55
61
|
jsi::Value cpp_uniffi_wallet_checksum_func_evm_private_key_to_keypair(
|
|
56
62
|
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
57
63
|
size_t count);
|
package/ios/libs/libwallet.a
CHANGED
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getter","globalThis","NativeWallet","isRustFutureContinuationCallbackTypeCompatible","isUniffiForeignFutureTypeCompatible"],"sourceRoot":"../../../src","sources":["generated/wallet-ffi.ts"],"mappings":";;AAAA;AACA;;
|
|
1
|
+
{"version":3,"names":["getter","globalThis","NativeWallet","isRustFutureContinuationCallbackTypeCompatible","isUniffiForeignFutureTypeCompatible"],"sourceRoot":"../../../src","sources":["generated/wallet-ffi.ts"],"mappings":";;AAAA;AACA;;AA8EA;AACA;AACA;AACA;AACA;AACA,MAAMA,MAAmC,GAAGA,CAAA,KACzCC,UAAU,CAASC,YAAY;AAClC,eAAeF,MAAM;;AAErB;;AAmHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMG,8CAGL,GAAG,IAAI;AACR,MAAMC,mCAGL,GAAG,IAAI","ignoreList":[]}
|
|
@@ -16,6 +16,11 @@ typeof process !== 'object' ||
|
|
|
16
16
|
process?.env?.NODE_ENV !== 'production' || false;
|
|
17
17
|
// Public interface members begin here.
|
|
18
18
|
|
|
19
|
+
export function bitcoinWifToKeypair(wif, network) /*throws*/{
|
|
20
|
+
return FfiConverterTypeBitcoinKeyPair2.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBitcoinWIFError.lift.bind(FfiConverterTypeBitcoinWIFError), /*caller:*/callStatus => {
|
|
21
|
+
return nativeModule().ubrn_uniffi_wallet_fn_func_bitcoin_wif_to_keypair(FfiConverterString.lower(wif), FfiConverterTypeNetwork.lower(network), callStatus);
|
|
22
|
+
}, /*liftString:*/FfiConverterString.lift));
|
|
23
|
+
}
|
|
19
24
|
export function evmPrivateKeyToKeypair(privateKeyHex) /*throws*/{
|
|
20
25
|
return FfiConverterTypeKeyPair.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeEvmPrivateKeyError.lift.bind(FfiConverterTypeEvmPrivateKeyError), /*caller:*/callStatus => {
|
|
21
26
|
return nativeModule().ubrn_uniffi_wallet_fn_func_evm_private_key_to_keypair(FfiConverterString.lower(privateKeyHex), callStatus);
|
|
@@ -103,6 +108,57 @@ const FfiConverterTypeBitcoinKeyPair = (() => {
|
|
|
103
108
|
}
|
|
104
109
|
return new FFIConverter();
|
|
105
110
|
})();
|
|
111
|
+
/**
|
|
112
|
+
* Generated factory for {@link BitcoinKeyPair2} record objects.
|
|
113
|
+
*/
|
|
114
|
+
export const BitcoinKeyPair2 = (() => {
|
|
115
|
+
const defaults = () => ({});
|
|
116
|
+
const create = (() => {
|
|
117
|
+
return uniffiCreateRecord(defaults);
|
|
118
|
+
})();
|
|
119
|
+
return Object.freeze({
|
|
120
|
+
/**
|
|
121
|
+
* Create a frozen instance of {@link BitcoinKeyPair2}, with defaults specified
|
|
122
|
+
* in Rust, in the {@link wallet} crate.
|
|
123
|
+
*/
|
|
124
|
+
create,
|
|
125
|
+
/**
|
|
126
|
+
* Create a frozen instance of {@link BitcoinKeyPair2}, with defaults specified
|
|
127
|
+
* in Rust, in the {@link wallet} crate.
|
|
128
|
+
*/
|
|
129
|
+
new: create,
|
|
130
|
+
/**
|
|
131
|
+
* Defaults specified in the {@link wallet} crate.
|
|
132
|
+
*/
|
|
133
|
+
defaults: () => Object.freeze(defaults())
|
|
134
|
+
});
|
|
135
|
+
})();
|
|
136
|
+
const FfiConverterTypeBitcoinKeyPair2 = (() => {
|
|
137
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
138
|
+
read(from) {
|
|
139
|
+
return {
|
|
140
|
+
publicKey: FfiConverterString.read(from),
|
|
141
|
+
wif: FfiConverterString.read(from),
|
|
142
|
+
p2pkh: FfiConverterString.read(from),
|
|
143
|
+
p2shP2wpkh: FfiConverterString.read(from),
|
|
144
|
+
p2wpkh: FfiConverterString.read(from),
|
|
145
|
+
p2tr: FfiConverterString.read(from)
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
write(value, into) {
|
|
149
|
+
FfiConverterString.write(value.publicKey, into);
|
|
150
|
+
FfiConverterString.write(value.wif, into);
|
|
151
|
+
FfiConverterString.write(value.p2pkh, into);
|
|
152
|
+
FfiConverterString.write(value.p2shP2wpkh, into);
|
|
153
|
+
FfiConverterString.write(value.p2wpkh, into);
|
|
154
|
+
FfiConverterString.write(value.p2tr, into);
|
|
155
|
+
}
|
|
156
|
+
allocationSize(value) {
|
|
157
|
+
return FfiConverterString.allocationSize(value.publicKey) + FfiConverterString.allocationSize(value.wif) + FfiConverterString.allocationSize(value.p2pkh) + FfiConverterString.allocationSize(value.p2shP2wpkh) + FfiConverterString.allocationSize(value.p2wpkh) + FfiConverterString.allocationSize(value.p2tr);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
return new FFIConverter();
|
|
161
|
+
})();
|
|
106
162
|
/**
|
|
107
163
|
* Generated factory for {@link KeyPair} record objects.
|
|
108
164
|
*/
|
|
@@ -197,6 +253,245 @@ const FfiConverterTypeAddressType = (() => {
|
|
|
197
253
|
return new FFIConverter();
|
|
198
254
|
})();
|
|
199
255
|
|
|
256
|
+
// Error type: BitcoinWifError
|
|
257
|
+
|
|
258
|
+
// Enum: BitcoinWifError
|
|
259
|
+
export let BitcoinWifError_Tags = /*#__PURE__*/function (BitcoinWifError_Tags) {
|
|
260
|
+
BitcoinWifError_Tags["InvalidBase58"] = "InvalidBase58";
|
|
261
|
+
BitcoinWifError_Tags["BadLength"] = "BadLength";
|
|
262
|
+
BitcoinWifError_Tags["InvalidChecksum"] = "InvalidChecksum";
|
|
263
|
+
BitcoinWifError_Tags["InvalidSecretKey"] = "InvalidSecretKey";
|
|
264
|
+
BitcoinWifError_Tags["InvalidPublicKey"] = "InvalidPublicKey";
|
|
265
|
+
BitcoinWifError_Tags["InvalidTweakScalar"] = "InvalidTweakScalar";
|
|
266
|
+
return BitcoinWifError_Tags;
|
|
267
|
+
}({});
|
|
268
|
+
export const BitcoinWifError = (() => {
|
|
269
|
+
class InvalidBase58_ extends UniffiError {
|
|
270
|
+
/**
|
|
271
|
+
* @private
|
|
272
|
+
* This field is private and should not be used, use `tag` instead.
|
|
273
|
+
*/
|
|
274
|
+
[uniffiTypeNameSymbol] = 'BitcoinWifError';
|
|
275
|
+
tag = BitcoinWifError_Tags.InvalidBase58;
|
|
276
|
+
constructor() {
|
|
277
|
+
super('BitcoinWifError', 'InvalidBase58');
|
|
278
|
+
}
|
|
279
|
+
static new() {
|
|
280
|
+
return new InvalidBase58_();
|
|
281
|
+
}
|
|
282
|
+
static instanceOf(obj) {
|
|
283
|
+
return obj.tag === BitcoinWifError_Tags.InvalidBase58;
|
|
284
|
+
}
|
|
285
|
+
static hasInner(obj) {
|
|
286
|
+
return false;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
class BadLength_ extends UniffiError {
|
|
290
|
+
/**
|
|
291
|
+
* @private
|
|
292
|
+
* This field is private and should not be used, use `tag` instead.
|
|
293
|
+
*/
|
|
294
|
+
[uniffiTypeNameSymbol] = 'BitcoinWifError';
|
|
295
|
+
tag = BitcoinWifError_Tags.BadLength;
|
|
296
|
+
constructor() {
|
|
297
|
+
super('BitcoinWifError', 'BadLength');
|
|
298
|
+
}
|
|
299
|
+
static new() {
|
|
300
|
+
return new BadLength_();
|
|
301
|
+
}
|
|
302
|
+
static instanceOf(obj) {
|
|
303
|
+
return obj.tag === BitcoinWifError_Tags.BadLength;
|
|
304
|
+
}
|
|
305
|
+
static hasInner(obj) {
|
|
306
|
+
return false;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
class InvalidChecksum_ extends UniffiError {
|
|
310
|
+
/**
|
|
311
|
+
* @private
|
|
312
|
+
* This field is private and should not be used, use `tag` instead.
|
|
313
|
+
*/
|
|
314
|
+
[uniffiTypeNameSymbol] = 'BitcoinWifError';
|
|
315
|
+
tag = BitcoinWifError_Tags.InvalidChecksum;
|
|
316
|
+
constructor() {
|
|
317
|
+
super('BitcoinWifError', 'InvalidChecksum');
|
|
318
|
+
}
|
|
319
|
+
static new() {
|
|
320
|
+
return new InvalidChecksum_();
|
|
321
|
+
}
|
|
322
|
+
static instanceOf(obj) {
|
|
323
|
+
return obj.tag === BitcoinWifError_Tags.InvalidChecksum;
|
|
324
|
+
}
|
|
325
|
+
static hasInner(obj) {
|
|
326
|
+
return false;
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
class InvalidSecretKey_ extends UniffiError {
|
|
330
|
+
/**
|
|
331
|
+
* @private
|
|
332
|
+
* This field is private and should not be used, use `tag` instead.
|
|
333
|
+
*/
|
|
334
|
+
[uniffiTypeNameSymbol] = 'BitcoinWifError';
|
|
335
|
+
tag = BitcoinWifError_Tags.InvalidSecretKey;
|
|
336
|
+
constructor() {
|
|
337
|
+
super('BitcoinWifError', 'InvalidSecretKey');
|
|
338
|
+
}
|
|
339
|
+
static new() {
|
|
340
|
+
return new InvalidSecretKey_();
|
|
341
|
+
}
|
|
342
|
+
static instanceOf(obj) {
|
|
343
|
+
return obj.tag === BitcoinWifError_Tags.InvalidSecretKey;
|
|
344
|
+
}
|
|
345
|
+
static hasInner(obj) {
|
|
346
|
+
return false;
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
class InvalidPublicKey_ extends UniffiError {
|
|
350
|
+
/**
|
|
351
|
+
* @private
|
|
352
|
+
* This field is private and should not be used, use `tag` instead.
|
|
353
|
+
*/
|
|
354
|
+
[uniffiTypeNameSymbol] = 'BitcoinWifError';
|
|
355
|
+
tag = BitcoinWifError_Tags.InvalidPublicKey;
|
|
356
|
+
constructor() {
|
|
357
|
+
super('BitcoinWifError', 'InvalidPublicKey');
|
|
358
|
+
}
|
|
359
|
+
static new() {
|
|
360
|
+
return new InvalidPublicKey_();
|
|
361
|
+
}
|
|
362
|
+
static instanceOf(obj) {
|
|
363
|
+
return obj.tag === BitcoinWifError_Tags.InvalidPublicKey;
|
|
364
|
+
}
|
|
365
|
+
static hasInner(obj) {
|
|
366
|
+
return false;
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
class InvalidTweakScalar_ extends UniffiError {
|
|
370
|
+
/**
|
|
371
|
+
* @private
|
|
372
|
+
* This field is private and should not be used, use `tag` instead.
|
|
373
|
+
*/
|
|
374
|
+
[uniffiTypeNameSymbol] = 'BitcoinWifError';
|
|
375
|
+
tag = BitcoinWifError_Tags.InvalidTweakScalar;
|
|
376
|
+
constructor() {
|
|
377
|
+
super('BitcoinWifError', 'InvalidTweakScalar');
|
|
378
|
+
}
|
|
379
|
+
static new() {
|
|
380
|
+
return new InvalidTweakScalar_();
|
|
381
|
+
}
|
|
382
|
+
static instanceOf(obj) {
|
|
383
|
+
return obj.tag === BitcoinWifError_Tags.InvalidTweakScalar;
|
|
384
|
+
}
|
|
385
|
+
static hasInner(obj) {
|
|
386
|
+
return false;
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
function instanceOf(obj) {
|
|
390
|
+
return obj[uniffiTypeNameSymbol] === 'BitcoinWifError';
|
|
391
|
+
}
|
|
392
|
+
return Object.freeze({
|
|
393
|
+
instanceOf,
|
|
394
|
+
InvalidBase58: InvalidBase58_,
|
|
395
|
+
BadLength: BadLength_,
|
|
396
|
+
InvalidChecksum: InvalidChecksum_,
|
|
397
|
+
InvalidSecretKey: InvalidSecretKey_,
|
|
398
|
+
InvalidPublicKey: InvalidPublicKey_,
|
|
399
|
+
InvalidTweakScalar: InvalidTweakScalar_
|
|
400
|
+
});
|
|
401
|
+
})();
|
|
402
|
+
// FfiConverter for enum BitcoinWifError
|
|
403
|
+
const FfiConverterTypeBitcoinWIFError = (() => {
|
|
404
|
+
const ordinalConverter = FfiConverterInt32;
|
|
405
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
406
|
+
read(from) {
|
|
407
|
+
switch (ordinalConverter.read(from)) {
|
|
408
|
+
case 1:
|
|
409
|
+
return new BitcoinWifError.InvalidBase58();
|
|
410
|
+
case 2:
|
|
411
|
+
return new BitcoinWifError.BadLength();
|
|
412
|
+
case 3:
|
|
413
|
+
return new BitcoinWifError.InvalidChecksum();
|
|
414
|
+
case 4:
|
|
415
|
+
return new BitcoinWifError.InvalidSecretKey();
|
|
416
|
+
case 5:
|
|
417
|
+
return new BitcoinWifError.InvalidPublicKey();
|
|
418
|
+
case 6:
|
|
419
|
+
return new BitcoinWifError.InvalidTweakScalar();
|
|
420
|
+
default:
|
|
421
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
write(value, into) {
|
|
425
|
+
switch (value.tag) {
|
|
426
|
+
case BitcoinWifError_Tags.InvalidBase58:
|
|
427
|
+
{
|
|
428
|
+
ordinalConverter.write(1, into);
|
|
429
|
+
return;
|
|
430
|
+
}
|
|
431
|
+
case BitcoinWifError_Tags.BadLength:
|
|
432
|
+
{
|
|
433
|
+
ordinalConverter.write(2, into);
|
|
434
|
+
return;
|
|
435
|
+
}
|
|
436
|
+
case BitcoinWifError_Tags.InvalidChecksum:
|
|
437
|
+
{
|
|
438
|
+
ordinalConverter.write(3, into);
|
|
439
|
+
return;
|
|
440
|
+
}
|
|
441
|
+
case BitcoinWifError_Tags.InvalidSecretKey:
|
|
442
|
+
{
|
|
443
|
+
ordinalConverter.write(4, into);
|
|
444
|
+
return;
|
|
445
|
+
}
|
|
446
|
+
case BitcoinWifError_Tags.InvalidPublicKey:
|
|
447
|
+
{
|
|
448
|
+
ordinalConverter.write(5, into);
|
|
449
|
+
return;
|
|
450
|
+
}
|
|
451
|
+
case BitcoinWifError_Tags.InvalidTweakScalar:
|
|
452
|
+
{
|
|
453
|
+
ordinalConverter.write(6, into);
|
|
454
|
+
return;
|
|
455
|
+
}
|
|
456
|
+
default:
|
|
457
|
+
// Throwing from here means that BitcoinWifError_Tags hasn't matched an ordinal.
|
|
458
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
allocationSize(value) {
|
|
462
|
+
switch (value.tag) {
|
|
463
|
+
case BitcoinWifError_Tags.InvalidBase58:
|
|
464
|
+
{
|
|
465
|
+
return ordinalConverter.allocationSize(1);
|
|
466
|
+
}
|
|
467
|
+
case BitcoinWifError_Tags.BadLength:
|
|
468
|
+
{
|
|
469
|
+
return ordinalConverter.allocationSize(2);
|
|
470
|
+
}
|
|
471
|
+
case BitcoinWifError_Tags.InvalidChecksum:
|
|
472
|
+
{
|
|
473
|
+
return ordinalConverter.allocationSize(3);
|
|
474
|
+
}
|
|
475
|
+
case BitcoinWifError_Tags.InvalidSecretKey:
|
|
476
|
+
{
|
|
477
|
+
return ordinalConverter.allocationSize(4);
|
|
478
|
+
}
|
|
479
|
+
case BitcoinWifError_Tags.InvalidPublicKey:
|
|
480
|
+
{
|
|
481
|
+
return ordinalConverter.allocationSize(5);
|
|
482
|
+
}
|
|
483
|
+
case BitcoinWifError_Tags.InvalidTweakScalar:
|
|
484
|
+
{
|
|
485
|
+
return ordinalConverter.allocationSize(6);
|
|
486
|
+
}
|
|
487
|
+
default:
|
|
488
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
return new FFIConverter();
|
|
493
|
+
})();
|
|
494
|
+
|
|
200
495
|
// Error type: BitcoinWalletError
|
|
201
496
|
|
|
202
497
|
// Enum: BitcoinWalletError
|
|
@@ -1830,6 +2125,9 @@ function uniffiEnsureInitialized() {
|
|
|
1830
2125
|
if (bindingsContractVersion !== scaffoldingContractVersion) {
|
|
1831
2126
|
throw new UniffiInternalError.ContractVersionMismatch(scaffoldingContractVersion, bindingsContractVersion);
|
|
1832
2127
|
}
|
|
2128
|
+
if (nativeModule().ubrn_uniffi_wallet_checksum_func_bitcoin_wif_to_keypair() !== 63811) {
|
|
2129
|
+
throw new UniffiInternalError.ApiChecksumMismatch('uniffi_wallet_checksum_func_bitcoin_wif_to_keypair');
|
|
2130
|
+
}
|
|
1833
2131
|
if (nativeModule().ubrn_uniffi_wallet_checksum_func_evm_private_key_to_keypair() !== 61806) {
|
|
1834
2132
|
throw new UniffiInternalError.ApiChecksumMismatch('uniffi_wallet_checksum_func_evm_private_key_to_keypair');
|
|
1835
2133
|
}
|
|
@@ -1860,6 +2158,7 @@ export default Object.freeze({
|
|
|
1860
2158
|
converters: {
|
|
1861
2159
|
FfiConverterTypeAddressType,
|
|
1862
2160
|
FfiConverterTypeBitcoinKeyPair,
|
|
2161
|
+
FfiConverterTypeBitcoinKeyPair2,
|
|
1863
2162
|
FfiConverterTypeKeyPair,
|
|
1864
2163
|
FfiConverterTypeNetwork
|
|
1865
2164
|
}
|