react-native-zano 0.1.3 → 0.2.0
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/CHANGELOG.md +4 -0
- package/android/src/main/jniLibs/arm64-v8a/librnzano.so +0 -0
- package/android/src/main/jniLibs/armeabi-v7a/librnzano.so +0 -0
- package/android/src/main/jniLibs/x86/librnzano.so +0 -0
- package/android/src/main/jniLibs/x86_64/librnzano.so +0 -0
- package/ios/ZanoModule.xcframework/Info.plist +5 -5
- package/ios/ZanoModule.xcframework/ios-arm64/libzano-module.a +0 -0
- package/ios/ZanoModule.xcframework/ios-arm64_x86_64-simulator/libzano-module.a +0 -0
- package/lib/src/CppBridge.d.ts +7 -5
- package/lib/src/CppBridge.js +22 -11
- package/lib/src/types.d.ts +6 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -8,32 +8,32 @@
|
|
|
8
8
|
<key>BinaryPath</key>
|
|
9
9
|
<string>libzano-module.a</string>
|
|
10
10
|
<key>LibraryIdentifier</key>
|
|
11
|
-
<string>ios-
|
|
11
|
+
<string>ios-arm64_x86_64-simulator</string>
|
|
12
12
|
<key>LibraryPath</key>
|
|
13
13
|
<string>libzano-module.a</string>
|
|
14
14
|
<key>SupportedArchitectures</key>
|
|
15
15
|
<array>
|
|
16
16
|
<string>arm64</string>
|
|
17
|
+
<string>x86_64</string>
|
|
17
18
|
</array>
|
|
18
19
|
<key>SupportedPlatform</key>
|
|
19
20
|
<string>ios</string>
|
|
21
|
+
<key>SupportedPlatformVariant</key>
|
|
22
|
+
<string>simulator</string>
|
|
20
23
|
</dict>
|
|
21
24
|
<dict>
|
|
22
25
|
<key>BinaryPath</key>
|
|
23
26
|
<string>libzano-module.a</string>
|
|
24
27
|
<key>LibraryIdentifier</key>
|
|
25
|
-
<string>ios-
|
|
28
|
+
<string>ios-arm64</string>
|
|
26
29
|
<key>LibraryPath</key>
|
|
27
30
|
<string>libzano-module.a</string>
|
|
28
31
|
<key>SupportedArchitectures</key>
|
|
29
32
|
<array>
|
|
30
33
|
<string>arm64</string>
|
|
31
|
-
<string>x86_64</string>
|
|
32
34
|
</array>
|
|
33
35
|
<key>SupportedPlatform</key>
|
|
34
36
|
<string>ios</string>
|
|
35
|
-
<key>SupportedPlatformVariant</key>
|
|
36
|
-
<string>simulator</string>
|
|
37
37
|
</dict>
|
|
38
38
|
</array>
|
|
39
39
|
<key>CFBundlePackageType</key>
|
|
Binary file
|
|
Binary file
|
package/lib/src/CppBridge.d.ts
CHANGED
|
@@ -56,12 +56,14 @@ export declare class CppBridge {
|
|
|
56
56
|
getBalances(walletId: number): Promise<GetBalancesResponse>;
|
|
57
57
|
getTransactions(walletId: number, offset?: number): Promise<GetRecentTransactionsResponse>;
|
|
58
58
|
whitelistAssets(walletId: number, assetIds: string[]): Promise<void>;
|
|
59
|
-
transfer(walletId: number,
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
59
|
+
transfer(walletId: number, opts: {
|
|
60
|
+
transfers: Array<{
|
|
61
|
+
assetId: string;
|
|
62
|
+
nativeAmount: number;
|
|
63
|
+
recipient: string;
|
|
64
|
+
}>;
|
|
64
65
|
comment?: string;
|
|
66
|
+
fee: number;
|
|
65
67
|
paymentId?: string;
|
|
66
68
|
}): Promise<string>;
|
|
67
69
|
private handleRpcResponse;
|
package/lib/src/CppBridge.js
CHANGED
|
@@ -262,22 +262,33 @@ class CppBridge {
|
|
|
262
262
|
}
|
|
263
263
|
}
|
|
264
264
|
}
|
|
265
|
-
async transfer(walletId,
|
|
265
|
+
async transfer(walletId, opts) {
|
|
266
|
+
// Transaction can only have one payment ID
|
|
267
|
+
let paymentId = opts.paymentId;
|
|
268
|
+
for (const transfer of opts.transfers) {
|
|
269
|
+
const addressInfo = await this.getAddressInfo(transfer.recipient);
|
|
270
|
+
if (!addressInfo.is_integrated)
|
|
271
|
+
continue;
|
|
272
|
+
if (paymentId == null) {
|
|
273
|
+
paymentId = addressInfo.payment_id;
|
|
274
|
+
}
|
|
275
|
+
else if (paymentId !== addressInfo.payment_id) {
|
|
276
|
+
throw new Error('Transaction can only have one payment ID');
|
|
277
|
+
}
|
|
278
|
+
}
|
|
266
279
|
const params = {
|
|
267
280
|
method: 'transfer',
|
|
268
281
|
params: {
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
fee: transferOpts.fee,
|
|
282
|
+
destinations: opts.transfers.map(t => ({
|
|
283
|
+
address: t.recipient,
|
|
284
|
+
amount: t.nativeAmount,
|
|
285
|
+
asset_id: t.assetId
|
|
286
|
+
})),
|
|
287
|
+
comment: opts.comment,
|
|
288
|
+
fee: opts.fee,
|
|
289
|
+
payment_id: opts.paymentId ?? '',
|
|
278
290
|
hide_receiver: true,
|
|
279
291
|
mixin: 15,
|
|
280
|
-
payment_id: transferOpts.paymentId ?? '',
|
|
281
292
|
push_payer: false,
|
|
282
293
|
service_entries_permanent: true
|
|
283
294
|
}
|
package/lib/src/types.d.ts
CHANGED
|
@@ -219,11 +219,13 @@ export interface WhitelistAssetsResponse {
|
|
|
219
219
|
own_assets: AssetInfo[];
|
|
220
220
|
}
|
|
221
221
|
export interface TransferParams {
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
222
|
+
transfers: Array<{
|
|
223
|
+
assetId: string;
|
|
224
|
+
nativeAmount: number;
|
|
225
|
+
recipient: string;
|
|
226
|
+
}>;
|
|
226
227
|
comment?: string;
|
|
228
|
+
fee: number;
|
|
227
229
|
paymentId?: string;
|
|
228
230
|
}
|
|
229
231
|
export interface TransferResponse {
|