react-native-pirate-wallet 0.2.1 → 0.3.2

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/README.md CHANGED
@@ -76,8 +76,10 @@ await sdk.configureAccountStorage({
76
76
  - `scripts/`
77
77
  - `src/`
78
78
 
79
- The Android native libraries are distributed in the exact-version
80
- `react-native-pirate-wallet-android` companion package.
79
+ Native libraries are distributed in exact-version Android ARM, Android x86_64,
80
+ iOS device, iOS simulator arm64, and iOS simulator x86_64 companion packages.
81
+ On macOS, CocoaPods combines the two thin simulator archives into the universal
82
+ XCFramework slice expected by Xcode.
81
83
 
82
84
  ## Preparing native artifacts in this repo
83
85
 
@@ -89,8 +91,9 @@ bash scripts/prepare-react-native-plugin.sh
89
91
 
90
92
  That copies:
91
93
 
92
- - Android JNI libraries into `bindings/react-native-pirate-wallet-android/`
93
- - the iOS XCFramework into this package
94
+ - Android JNI libraries into the two Android companion packages
95
+ - the iOS device XCFramework slice and two thin simulator archives into the
96
+ three iOS companion packages
94
97
 
95
98
  There is also a minimal consumer app in:
96
99
 
@@ -289,13 +292,18 @@ Receive-address APIs are shielded and wallet-scoped:
289
292
  - returns generated external receive addresses
290
293
  - `listAddressBalances(walletId, keyId?)`
291
294
  - RPC: `list_address_balances`
292
- - returns per-address balance entries
295
+ - without `keyId`, returns external receive-address balance entries only
296
+ - with `keyId`, also returns internal change-address entries for that key group
293
297
 
294
298
  These APIs return shielded receive addresses. Newly generated addresses use
295
- Sapling before Ironwood activation and Ironwood after activation. The current
296
- address can still be an older Sapling address until the wallet rotates, and
297
- `listAddresses(walletId)` can contain both Sapling and Ironwood receive
298
- addresses over time.
299
+ Sapling before Ironwood activation and Ironwood after activation. At activation,
300
+ both current- and next-address calls select Ironwood; existing Sapling addresses
301
+ remain valid, so `listAddresses(walletId)` can contain both pools over time.
302
+
303
+ Internal change is always included in `getBalance(walletId)`. Do not sum an
304
+ unfiltered `listAddressBalances(walletId)` response to calculate the wallet
305
+ total, because its default external-only view intentionally omits internal
306
+ address rows.
299
307
 
300
308
  - `getBalance(walletId)`
301
309
  - RPC: `get_balance`
@@ -529,9 +537,10 @@ npm install react-native-pirate-wallet
529
537
  cd ios && pod install
530
538
  ```
531
539
 
532
- On Android, npm installs the exact-version
533
- `react-native-pirate-wallet-android` companion automatically. The wrapper
534
- autolinks as a standard React Native native module and adds the companion's JNI
535
- libraries to the build.
540
+ On Android, npm installs the exact-version ARM and x86_64 companions
541
+ automatically. The wrapper autolinks as a standard React Native native module
542
+ and adds their JNI libraries to the build.
536
543
 
537
- On iOS, the podspec links the vendored `PirateWalletNative.xcframework`.
544
+ On macOS, npm installs the exact-version device and simulator companions.
545
+ During `pod install`, the podspec assembles and links
546
+ `PirateWalletNative.xcframework` from those packages.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-pirate-wallet",
3
- "version": "0.2.1",
3
+ "version": "0.3.2",
4
4
  "description": "React Native wrapper for the Pirate Unified Wallet native SDK surfaces",
5
5
  "keywords": [
6
6
  "react-native",
@@ -43,7 +43,6 @@
43
43
  "test": "node test/smoke.js",
44
44
  "verify:package": "node scripts/verify-package.js",
45
45
  "prepare:native": "node scripts/assemble-ios-framework.js",
46
- "postinstall": "npm run prepare:native",
47
46
  "prepack": "node scripts/verify-package.js --publish-layout"
48
47
  },
49
48
  "engines": {
@@ -53,10 +52,11 @@
53
52
  "react-native": ">=0.71.0 <1.0.0"
54
53
  },
55
54
  "optionalDependencies": {
56
- "react-native-pirate-wallet-android": "0.2.1",
57
- "react-native-pirate-wallet-android-x86_64": "0.2.1",
58
- "react-native-pirate-wallet-ios-device": "0.2.1",
59
- "react-native-pirate-wallet-ios-simulator": "0.2.1"
55
+ "react-native-pirate-wallet-android": "0.3.2",
56
+ "react-native-pirate-wallet-android-x86_64": "0.3.2",
57
+ "react-native-pirate-wallet-ios-device": "0.3.2",
58
+ "react-native-pirate-wallet-ios-simulator-arm64": "0.3.2",
59
+ "react-native-pirate-wallet-ios-simulator-x86_64": "0.3.2"
60
60
  },
61
61
  "publishConfig": {
62
62
  "access": "public"
@@ -2,6 +2,16 @@ require "json"
2
2
 
3
3
  package = JSON.parse(File.read(File.join(__dir__, "package.json")))
4
4
 
5
+ assembly_script = File.join(__dir__, "scripts", "assemble-ios-framework.js")
6
+ framework_path = File.join(__dir__, "ios", "Frameworks", "PirateWalletNative.xcframework")
7
+
8
+ # npm may block dependency lifecycle scripts, so assemble the split iOS binary
9
+ # packages when CocoaPods actually needs the framework.
10
+ Pod::Executable.execute_command("node", [assembly_script, "--force"])
11
+ unless File.directory?(framework_path)
12
+ raise Pod::Informative, "PirateWalletNative.xcframework could not be assembled"
13
+ end
14
+
5
15
  Pod::Spec.new do |s|
6
16
  s.name = package["name"]
7
17
  s.version = package["version"]
@@ -1,18 +1,23 @@
1
- 'use strict';
1
+ "use strict";
2
2
 
3
- const fs = require('fs');
4
- const path = require('path');
3
+ const childProcess = require("child_process");
4
+ const fs = require("fs");
5
+ const path = require("path");
5
6
 
6
- const packageRoot = path.resolve(__dirname, '..');
7
- const frameworkName = 'PirateWalletNative.xcframework';
8
- const iosPackages = [
7
+ const packageRoot = path.resolve(__dirname, "..");
8
+ const frameworkName = "PirateWalletNative.xcframework";
9
+ const devicePackage = {
10
+ name: "react-native-pirate-wallet-ios-device",
11
+ slice: "ios-arm64",
12
+ };
13
+ const simulatorPackages = [
9
14
  {
10
- name: 'react-native-pirate-wallet-ios-device',
11
- slice: 'ios-arm64',
15
+ name: "react-native-pirate-wallet-ios-simulator-arm64",
16
+ architecture: "arm64",
12
17
  },
13
18
  {
14
- name: 'react-native-pirate-wallet-ios-simulator',
15
- slice: 'ios-arm64_x86_64-simulator',
19
+ name: "react-native-pirate-wallet-ios-simulator-x86_64",
20
+ architecture: "x86_64",
16
21
  },
17
22
  ];
18
23
 
@@ -22,43 +27,41 @@ function candidatePackageJsonPaths(packageName) {
22
27
  candidates.push(
23
28
  require.resolve(`${packageName}/package.json`, {
24
29
  paths: [process.cwd(), packageRoot],
25
- }),
30
+ })
26
31
  );
27
32
  } catch (_) {
28
33
  // The monorepo package is resolved below before it has been published.
29
34
  }
30
- candidates.push(
31
- path.resolve(packageRoot, '..', packageName, 'package.json'),
32
- );
35
+ candidates.push(path.resolve(packageRoot, "..", packageName, "package.json"));
33
36
  return [...new Set(candidates)];
34
37
  }
35
38
 
36
39
  function resolvePackage(packageName, expectedVersion) {
37
40
  for (const packageJsonPath of candidatePackageJsonPaths(packageName)) {
38
- if (!fs.statSync(packageJsonPath, {throwIfNoEntry: false})?.isFile()) {
41
+ if (!fs.statSync(packageJsonPath, { throwIfNoEntry: false })?.isFile()) {
39
42
  continue;
40
43
  }
41
- const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
44
+ const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, "utf8"));
42
45
  if (packageJson.name !== packageName) {
43
46
  continue;
44
47
  }
45
48
  if (packageJson.version !== expectedVersion) {
46
49
  throw new Error(
47
50
  `${packageName}@${packageJson.version} does not match ` +
48
- `react-native-pirate-wallet@${expectedVersion}`,
51
+ `react-native-pirate-wallet@${expectedVersion}`
49
52
  );
50
53
  }
51
- return path.dirname(packageJsonPath);
54
+ return { root: path.dirname(packageJsonPath), packageJson };
52
55
  }
53
56
  throw new Error(
54
57
  `${packageName}@${expectedVersion} is required to build ` +
55
- 'react-native-pirate-wallet for iOS',
58
+ "react-native-pirate-wallet for iOS"
56
59
  );
57
60
  }
58
61
 
59
62
  function linkTree(source, destination) {
60
- fs.mkdirSync(destination, {recursive: true});
61
- for (const entry of fs.readdirSync(source, {withFileTypes: true})) {
63
+ fs.mkdirSync(destination, { recursive: true });
64
+ for (const entry of fs.readdirSync(source, { withFileTypes: true })) {
62
65
  const sourcePath = path.join(source, entry.name);
63
66
  const destinationPath = path.join(destination, entry.name);
64
67
  if (entry.isDirectory()) {
@@ -71,7 +74,7 @@ function linkTree(source, destination) {
71
74
  try {
72
75
  fs.linkSync(sourcePath, destinationPath);
73
76
  } catch (error) {
74
- if (!['EXDEV', 'EPERM', 'EACCES', 'EMLINK'].includes(error.code)) {
77
+ if (!["EXDEV", "EPERM", "EACCES", "EMLINK"].includes(error.code)) {
75
78
  throw error;
76
79
  }
77
80
  fs.copyFileSync(sourcePath, destinationPath);
@@ -79,45 +82,140 @@ function linkTree(source, destination) {
79
82
  }
80
83
  }
81
84
 
85
+ function runXcrun(args) {
86
+ const result = childProcess.spawnSync("xcrun", args, { encoding: "utf8" });
87
+ if (result.error) {
88
+ throw result.error;
89
+ }
90
+ if (result.status !== 0) {
91
+ throw new Error(
92
+ `xcrun ${args.join(" ")} failed:\n${result.stderr || result.stdout}`
93
+ );
94
+ }
95
+ return result.stdout.trim();
96
+ }
97
+
98
+ function verifyArchitectures(archive, expected) {
99
+ const actual = runXcrun(["lipo", "-archs", archive]).split(/\s+/).sort();
100
+ const wanted = [...expected].sort();
101
+ if (JSON.stringify(actual) !== JSON.stringify(wanted)) {
102
+ throw new Error(
103
+ `${archive} has architectures ${actual.join(
104
+ ", "
105
+ )}; expected ${wanted.join(", ")}`
106
+ );
107
+ }
108
+ }
109
+
110
+ function assertMatchingFile(left, right, label) {
111
+ const leftData = fs.readFileSync(left);
112
+ const rightData = fs.readFileSync(right);
113
+ if (!leftData.equals(rightData)) {
114
+ throw new Error(`iOS binary packages contain different ${label}`);
115
+ }
116
+ }
117
+
82
118
  function assemble() {
83
- if (process.platform !== 'darwin' && !process.argv.includes('--force')) {
119
+ if (process.platform !== "darwin") {
120
+ if (process.argv.includes("--force")) {
121
+ throw new Error("iOS XCFramework assembly requires macOS and xcrun lipo");
122
+ }
84
123
  return;
85
124
  }
86
125
 
87
126
  const wrapperPackage = JSON.parse(
88
- fs.readFileSync(path.join(packageRoot, 'package.json'), 'utf8'),
127
+ fs.readFileSync(path.join(packageRoot, "package.json"), "utf8")
89
128
  );
90
- const resolved = iosPackages.map(({name, slice}) => {
91
- const expectedVersion = wrapperPackage.optionalDependencies?.[name];
129
+ function resolveExact(descriptor) {
130
+ const expectedVersion =
131
+ wrapperPackage.optionalDependencies?.[descriptor.name];
92
132
  if (expectedVersion !== wrapperPackage.version) {
93
- throw new Error(`${name} must use the exact wrapper version`);
133
+ throw new Error(`${descriptor.name} must use the exact wrapper version`);
94
134
  }
95
- const root = resolvePackage(name, expectedVersion);
96
135
  return {
97
- name,
98
- slice,
99
- framework: path.join(root, 'ios', 'Frameworks', frameworkName),
136
+ ...descriptor,
137
+ ...resolvePackage(descriptor.name, expectedVersion),
100
138
  };
101
- });
139
+ }
102
140
 
103
- const infoPlists = resolved.map(({framework}) =>
104
- fs.readFileSync(path.join(framework, 'Info.plist')),
141
+ const device = resolveExact(devicePackage);
142
+ const simulators = simulatorPackages.map(resolveExact);
143
+ const deviceFramework = path.join(
144
+ device.root,
145
+ "ios",
146
+ "Frameworks",
147
+ frameworkName
105
148
  );
106
- if (!infoPlists.slice(1).every(data => data.equals(infoPlists[0]))) {
107
- throw new Error('iOS binary packages contain different XCFramework metadata');
149
+ const deviceSlice = path.join(deviceFramework, device.slice);
150
+ if (!fs.statSync(deviceSlice, { throwIfNoEntry: false })?.isDirectory()) {
151
+ throw new Error(
152
+ `${device.name} is missing XCFramework slice ${device.slice}`
153
+ );
108
154
  }
109
155
 
110
- const output = path.join(packageRoot, 'ios', 'Frameworks', frameworkName);
111
- fs.rmSync(output, {recursive: true, force: true});
112
- fs.mkdirSync(output, {recursive: true});
113
- fs.writeFileSync(path.join(output, 'Info.plist'), infoPlists[0]);
156
+ const simulatorInputs = simulators.map((simulator) => {
157
+ const metadata = simulator.packageJson.pirateWalletNative;
158
+ if (
159
+ metadata?.platform !== "ios-simulator" ||
160
+ JSON.stringify(metadata.architectures) !==
161
+ JSON.stringify([simulator.architecture])
162
+ ) {
163
+ throw new Error(
164
+ `${simulator.name} does not identify its expected simulator architecture`
165
+ );
166
+ }
167
+ const archive = path.join(simulator.root, "ios", "libpirate_ffi_native.a");
168
+ const headers = path.join(simulator.root, "ios", "Headers");
169
+ verifyArchitectures(archive, [simulator.architecture]);
170
+ return { ...simulator, archive, headers };
171
+ });
114
172
 
115
- for (const {name, slice, framework} of resolved) {
116
- const source = path.join(framework, slice);
117
- if (!fs.statSync(source, {throwIfNoEntry: false})?.isDirectory()) {
118
- throw new Error(`${name} is missing XCFramework slice ${slice}`);
173
+ const canonicalHeaders = path.join(deviceSlice, "Headers");
174
+ for (const simulator of simulatorInputs) {
175
+ for (const header of ["module.modulemap", "pirate_wallet_service.h"]) {
176
+ assertMatchingFile(
177
+ path.join(canonicalHeaders, header),
178
+ path.join(simulator.headers, header),
179
+ header
180
+ );
119
181
  }
120
- linkTree(source, path.join(output, slice));
182
+ }
183
+
184
+ const frameworksRoot = path.join(packageRoot, "ios", "Frameworks");
185
+ fs.mkdirSync(frameworksRoot, { recursive: true });
186
+ const temporaryRoot = fs.mkdtempSync(
187
+ path.join(frameworksRoot, `${frameworkName}.tmp-`)
188
+ );
189
+ const output = path.join(frameworksRoot, frameworkName);
190
+ try {
191
+ fs.copyFileSync(
192
+ path.join(deviceFramework, "Info.plist"),
193
+ path.join(temporaryRoot, "Info.plist")
194
+ );
195
+ linkTree(deviceSlice, path.join(temporaryRoot, device.slice));
196
+
197
+ const simulatorSlice = path.join(
198
+ temporaryRoot,
199
+ "ios-arm64_x86_64-simulator"
200
+ );
201
+ linkTree(canonicalHeaders, path.join(simulatorSlice, "Headers"));
202
+ const universalArchive = path.join(
203
+ simulatorSlice,
204
+ "libpirate_ffi_native.a"
205
+ );
206
+ runXcrun([
207
+ "lipo",
208
+ "-create",
209
+ ...simulatorInputs.map((simulator) => simulator.archive),
210
+ "-output",
211
+ universalArchive,
212
+ ]);
213
+ verifyArchitectures(universalArchive, ["arm64", "x86_64"]);
214
+
215
+ fs.rmSync(output, { recursive: true, force: true });
216
+ fs.renameSync(temporaryRoot, output);
217
+ } finally {
218
+ fs.rmSync(temporaryRoot, { recursive: true, force: true });
121
219
  }
122
220
  }
123
221
 
@@ -1,9 +1,9 @@
1
- 'use strict';
1
+ "use strict";
2
2
 
3
- const fs = require('fs');
4
- const path = require('path');
3
+ const fs = require("fs");
4
+ const path = require("path");
5
5
 
6
- const packageRoot = path.resolve(__dirname, '..');
6
+ const packageRoot = path.resolve(__dirname, "..");
7
7
 
8
8
  function fail(message) {
9
9
  console.error(`[react-native-pirate-wallet] ${message}`);
@@ -12,7 +12,7 @@ function fail(message) {
12
12
 
13
13
  function requireFile(relativePath) {
14
14
  const absolutePath = path.join(packageRoot, relativePath);
15
- if (!fs.statSync(absolutePath, {throwIfNoEntry: false})?.isFile()) {
15
+ if (!fs.statSync(absolutePath, { throwIfNoEntry: false })?.isFile()) {
16
16
  fail(`Required package file is missing: ${relativePath}`);
17
17
  return;
18
18
  }
@@ -28,96 +28,117 @@ function rejectPath(relativePath) {
28
28
  }
29
29
 
30
30
  function collectFiles(directory) {
31
- if (!fs.statSync(directory, {throwIfNoEntry: false})?.isDirectory()) {
31
+ if (!fs.statSync(directory, { throwIfNoEntry: false })?.isDirectory()) {
32
32
  return [];
33
33
  }
34
34
 
35
- return fs.readdirSync(directory, {withFileTypes: true}).flatMap(entry => {
35
+ return fs.readdirSync(directory, { withFileTypes: true }).flatMap((entry) => {
36
36
  const entryPath = path.join(directory, entry.name);
37
37
  return entry.isDirectory() ? collectFiles(entryPath) : [entryPath];
38
38
  });
39
39
  }
40
40
 
41
41
  const packageJson = JSON.parse(
42
- fs.readFileSync(path.join(packageRoot, 'package.json'), 'utf8'),
42
+ fs.readFileSync(path.join(packageRoot, "package.json"), "utf8")
43
43
  );
44
44
 
45
- if (packageJson.name !== 'react-native-pirate-wallet') {
45
+ if (packageJson.name !== "react-native-pirate-wallet") {
46
46
  fail(`Unexpected package name: ${packageJson.name}`);
47
47
  }
48
48
  if (!/^\d+\.\d+\.\d+(?:[-+][0-9A-Za-z.-]+)?$/.test(packageJson.version)) {
49
- fail(`Package version is not valid semantic versioning: ${packageJson.version}`);
49
+ fail(
50
+ `Package version is not valid semantic versioning: ${packageJson.version}`
51
+ );
50
52
  }
51
53
  if (packageJson.private === true) {
52
- fail('The publishable package must not be marked private');
54
+ fail("The publishable package must not be marked private");
53
55
  }
54
- if (packageJson.repository?.url !== 'https://github.com/PirateNetwork/Pirate-Unified-Light-Wallet.git') {
55
- fail('The repository URL must match the GitHub repository used for npm provenance');
56
+ if (
57
+ packageJson.repository?.url !==
58
+ "https://github.com/PirateNetwork/Pirate-Unified-Light-Wallet.git"
59
+ ) {
60
+ fail(
61
+ "The repository URL must match the GitHub repository used for npm provenance"
62
+ );
56
63
  }
57
- if (packageJson.publishConfig?.access !== 'public') {
58
- fail('publishConfig.access must remain public');
64
+ if (packageJson.publishConfig?.access !== "public") {
65
+ fail("publishConfig.access must remain public");
59
66
  }
60
67
 
61
68
  [
62
- 'LICENSE-MIT',
63
- 'README.md',
64
- 'react-native.config.js',
65
- 'react-native-pirate-wallet.podspec',
66
- 'scripts/assemble-ios-framework.js',
67
- 'scripts/resolve-android-packages.js',
68
- 'test/smoke.js',
69
- 'src/index.js',
70
- 'src/index.d.ts',
71
- 'android/src/main/AndroidManifest.xml',
72
- 'android/src/main/java/com/pirate/wallet/reactnative/PirateWalletReactNativeModule.kt',
73
- 'ios/PirateWalletReactNative.m',
74
- 'ios/PirateWalletReactNative.swift',
69
+ "LICENSE-MIT",
70
+ "README.md",
71
+ "react-native.config.js",
72
+ "react-native-pirate-wallet.podspec",
73
+ "scripts/assemble-ios-framework.js",
74
+ "scripts/resolve-android-packages.js",
75
+ "test/smoke.js",
76
+ "src/index.js",
77
+ "src/index.d.ts",
78
+ "android/src/main/AndroidManifest.xml",
79
+ "android/src/main/java/com/pirate/wallet/reactnative/PirateWalletReactNativeModule.kt",
80
+ "ios/PirateWalletReactNative.m",
81
+ "ios/PirateWalletReactNative.swift",
75
82
  ].forEach(requireFile);
76
83
 
77
- if (process.argv.includes('--publish-layout')) {
84
+ if (process.argv.includes("--publish-layout")) {
78
85
  [
79
- 'android/.gradle',
80
- 'android/build',
81
- 'android/src/main/jniLibs',
82
- 'ios/Frameworks/PirateWalletNative.xcframework',
86
+ "android/.gradle",
87
+ "android/build",
88
+ "android/src/main/jniLibs",
89
+ "ios/Frameworks/PirateWalletNative.xcframework",
83
90
  ].forEach(rejectPath);
84
91
  }
85
92
 
86
93
  const binaryPackageNames = [
87
- 'react-native-pirate-wallet-android',
88
- 'react-native-pirate-wallet-android-x86_64',
89
- 'react-native-pirate-wallet-ios-device',
90
- 'react-native-pirate-wallet-ios-simulator',
94
+ "react-native-pirate-wallet-android",
95
+ "react-native-pirate-wallet-android-x86_64",
96
+ "react-native-pirate-wallet-ios-device",
97
+ "react-native-pirate-wallet-ios-simulator-arm64",
98
+ "react-native-pirate-wallet-ios-simulator-x86_64",
91
99
  ];
92
100
  for (const binaryPackageName of binaryPackageNames) {
93
101
  if (
94
- packageJson.optionalDependencies?.[binaryPackageName] !== packageJson.version
102
+ packageJson.optionalDependencies?.[binaryPackageName] !==
103
+ packageJson.version
95
104
  ) {
96
105
  fail(`${binaryPackageName} must use the same exact version as the wrapper`);
97
106
  }
98
107
  }
99
108
 
100
109
  if (
101
- !process.argv.includes('--publish-layout') &&
102
- (process.platform === 'darwin' || process.argv.includes('--all-platforms'))
110
+ !process.argv.includes("--publish-layout") &&
111
+ (process.platform === "darwin" || process.argv.includes("--all-platforms"))
103
112
  ) {
104
113
  const staticLibraries = collectFiles(
105
- path.join(packageRoot, 'ios', 'Frameworks', 'PirateWalletNative.xcframework'),
106
- ).filter(file => file.endsWith('.a'));
114
+ path.join(
115
+ packageRoot,
116
+ "ios",
117
+ "Frameworks",
118
+ "PirateWalletNative.xcframework"
119
+ )
120
+ ).filter((file) => file.endsWith(".a"));
107
121
  if (staticLibraries.length !== 2) {
108
- fail('The iOS XCFramework must contain device and simulator static libraries');
122
+ fail(
123
+ "The iOS XCFramework must contain device and simulator static libraries"
124
+ );
109
125
  }
110
126
  for (const library of staticLibraries) {
111
127
  if (fs.statSync(library).size === 0) {
112
- fail(`The iOS static library is empty: ${path.relative(packageRoot, library)}`);
128
+ fail(
129
+ `The iOS static library is empty: ${path.relative(
130
+ packageRoot,
131
+ library
132
+ )}`
133
+ );
113
134
  }
114
135
  }
115
136
  }
116
137
 
117
138
  try {
118
- const {resolveAndroidJniLibsPaths} = require('./resolve-android-packages');
139
+ const { resolveAndroidJniLibsPaths } = require("./resolve-android-packages");
119
140
  if (resolveAndroidJniLibsPaths().length !== 2) {
120
- fail('Both Android binary packages must resolve');
141
+ fail("Both Android binary packages must resolve");
121
142
  }
122
143
  } catch (error) {
123
144
  fail(error.message);
package/test/smoke.js CHANGED
@@ -48,6 +48,12 @@ function createMockNativeModule() {
48
48
  ])
49
49
  case 'get_active_wallet':
50
50
  return ok('wallet-1')
51
+ case 'current_receive_address':
52
+ assert.strictEqual(request.wallet_id, 'wallet-1')
53
+ return ok('pirate1current')
54
+ case 'next_receive_address':
55
+ assert.strictEqual(request.wallet_id, 'wallet-1')
56
+ return ok('pirate1next')
51
57
  case 'get_balance':
52
58
  return ok({ total: '1000', spendable: '900', pending: '100' })
53
59
  case 'format_amount':
@@ -158,6 +164,9 @@ async function main() {
158
164
  const latestBirthdayHeight = await sdk.getLatestBirthdayHeight('wallet-1')
159
165
  assert.strictEqual(latestBirthdayHeight, 345678)
160
166
 
167
+ assert.strictEqual(await sdk.getCurrentAddress('wallet-1'), 'pirate1current')
168
+ assert.strictEqual(await sdk.getNextAddress('wallet-1'), 'pirate1next')
169
+
161
170
  const groups = await sdk.advancedKeyManagement.listKeyGroups('wallet-1')
162
171
  assert.strictEqual(groups.length, 1)
163
172