Skip to content
This repository was archived by the owner on Feb 9, 2026. It is now read-only.

Commit 31840d8

Browse files
committed
fix: wip
1 parent 2dd9ca5 commit 31840d8

6 files changed

Lines changed: 618 additions & 224 deletions

File tree

example/.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module.exports = {
22
root: true,
3-
extends: '@react-native',
3+
extends: ['@react-native', 'plugin:prettier/recommended'],
44
parser: '@typescript-eslint/parser',
55
env: {
66
jest: true,

example/babel.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
module.exports = {
22
presets: ['module:metro-react-native-babel-preset'],
3+
plugins: [['@babel/plugin-transform-private-methods', { loose: true }]],
34
};

example/package.json

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,15 @@
2828
"runner-android": "react-native run-android --no-packager"
2929
},
3030
"dependencies": {
31+
"@bitcoinerlab/secp256k1": "1.0.5",
3132
"@react-native-async-storage/async-storage": "1.19.4",
3233
"@react-native-clipboard/clipboard": "1.12.1",
3334
"@synonymdev/react-native-ldk": "../lib",
34-
"assert": "1.5.0",
35-
"b4a": "^1.6.4",
36-
"bip32": "2.0.6",
37-
"bip39": "3.0.4",
38-
"bitcoinjs-lib": "6.0.2",
35+
"assert": "2.1.0",
36+
"b4a": "^1.6.6",
37+
"bip32": "4.0.0",
38+
"bip39": "3.1.0",
39+
"bitcoinjs-lib": "6.1.5",
3940
"buffer": "4.9.2",
4041
"chai": "^4.3.7",
4142
"events": "1.1.1",
@@ -57,6 +58,7 @@
5758
"devDependencies": {
5859
"@babel/core": "^7.20.0",
5960
"@babel/preset-env": "^7.20.0",
61+
"@babel/plugin-transform-private-methods": "^7.20.0",
6062
"@babel/runtime": "^7.20.0",
6163
"@react-native/eslint-config": "^0.72.2",
6264
"@react-native/metro-config": "^0.72.11",
@@ -74,21 +76,21 @@
7476
"concurrently": "^8.2.0",
7577
"detox": "20.20.2",
7678
"electrum-client": "github:BlueWallet/rn-electrum-client#47acb51149e97fab249c3f8a314f708dbee4fb6e",
77-
"eslint": "8.27.0",
78-
"eslint-config-prettier": "^8.5.0",
79-
"fast-fifo": "^1.3.0",
79+
"eslint": "8.57.0",
80+
"eslint-config-prettier": "^9.1.0",
81+
"eslint-plugin-prettier": "^5.1.3",
8082
"jest": "^29.3.1",
8183
"metro-react-native-babel-preset": "0.76.8",
8284
"mocha": "^10.2.0",
8385
"mocha-remote-cli": "^1.6.1",
8486
"newline-decoder": "^1.0.0",
85-
"prettier": "2.7.1",
87+
"prettier": "3.3.2",
8688
"react-test-renderer": "18.2.0",
8789
"rn-nodeify": "10.3.0",
88-
"typescript": "4.8.4"
90+
"typescript": "5.5.2"
8991
},
9092
"engines": {
91-
"node": ">=16"
93+
"node": ">=18"
9294
},
9395
"react-native": {
9496
"crypto": "react-native-crypto",

example/tests/utils/test-profile.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import ecc from '@bitcoinerlab/secp256k1';
12
import {
23
IAddress,
34
TAccount,
@@ -7,13 +8,15 @@ import {
78
TTransactionData,
89
TTransactionPosition,
910
} from '@synonymdev/react-native-ldk';
10-
import * as bip32 from 'bip32';
11+
import { BIP32Factory } from 'bip32';
1112
import * as bip39 from 'bip39';
1213
import * as bitcoin from 'bitcoinjs-lib';
1314
import ElectrumClient from 'electrum-client';
1415
import { Platform } from 'react-native';
1516
import { randomBytes } from 'react-native-randombytes';
1617

18+
const bip32 = BIP32Factory(ecc);
19+
1720
import { skipRemoteBackups } from '.';
1821
import {
1922
getAddressFromScriptPubKey,
@@ -142,9 +145,8 @@ export default class TestProfile {
142145
const reversedHash = Buffer.from(hash).reverse();
143146
const scriptHash = reversedHash.toString('hex');
144147

145-
const history = await this.electrum.blockchainScripthash_getHistory(
146-
scriptHash,
147-
);
148+
const history =
149+
await this.electrum.blockchainScripthash_getHistory(scriptHash);
148150

149151
if (!history) {
150152
return [];

example/utils/helpers.ts

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,24 @@
1-
import Keychain from 'react-native-keychain';
1+
import ecc from '@bitcoinerlab/secp256k1';
22
import {
3+
IAddress,
34
TAccount,
45
TAvailableNetworks,
5-
IAddress,
66
} from '@synonymdev/react-native-ldk';
7-
import { getItem, setItem } from '../ldk';
8-
import { EAccount, TWallet } from './types';
9-
import { err, ok, Result } from './result';
7+
import networks from '@synonymdev/react-native-ldk/dist/utils/networks';
8+
import { ENetworks } from '@synonymdev/react-native-ldk/dist/utils/types';
9+
import { BIP32Factory } from 'bip32';
10+
import * as bip39 from 'bip39';
11+
import * as bitcoin from 'bitcoinjs-lib';
12+
import RNFS from 'react-native-fs';
13+
import Keychain from 'react-native-keychain';
1014
// @ts-ignore
1115
import { randomBytes } from 'react-native-randombytes';
12-
import * as bitcoin from 'bitcoinjs-lib';
16+
import { getItem, setItem } from '../ldk';
1317
import { selectedNetwork } from './constants';
14-
import RNFS from 'react-native-fs';
15-
import * as bip32 from 'bip32';
16-
import * as bip39 from 'bip39';
17-
import { ENetworks } from '@synonymdev/react-native-ldk/dist/utils/types';
18-
import networks from '@synonymdev/react-native-ldk/dist/utils/networks';
18+
import { Result, err, ok } from './result';
19+
import { EAccount, TWallet } from './types';
20+
21+
const bip32 = BIP32Factory(ecc);
1922

2023
/**
2124
* Use Keychain to save LDK name & seed.

0 commit comments

Comments
 (0)