react-native-zano 0.2.1 → 0.2.3
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 +8 -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 +3 -11
- package/lib/src/CppBridge.js +15 -0
- package/lib/src/types.d.ts +16 -0
- 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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AddressInfo, AsyncCallResponse, CloseResponse, ConnectivityStatus, FeePriority, GetBalancesResponse, GetRecentTransactionsResponse, GetSeedPhraseInfo, JsonRpc, ReturnCode, TryPullResultResponse, WalletDetails, WalletFiles, WalletInfoExtended, WalletStatus } from './types';
|
|
1
|
+
import { AddressInfo, AsyncCallResponse, BurnAssetParams, CloseResponse, ConnectivityStatus, FeePriority, GetBalancesResponse, GetRecentTransactionsResponse, GetSeedPhraseInfo, JsonRpc, ReturnCode, TransferParams, TryPullResultResponse, WalletDetails, WalletFiles, WalletInfoExtended, WalletStatus } from './types';
|
|
2
2
|
/**
|
|
3
3
|
* The shape of the native C++ module exposed to React Native.
|
|
4
4
|
*
|
|
@@ -56,16 +56,8 @@ 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, opts:
|
|
60
|
-
|
|
61
|
-
assetId: string;
|
|
62
|
-
nativeAmount: number;
|
|
63
|
-
recipient: string;
|
|
64
|
-
}>;
|
|
65
|
-
comment?: string;
|
|
66
|
-
fee: number;
|
|
67
|
-
paymentId?: string;
|
|
68
|
-
}): Promise<string>;
|
|
59
|
+
transfer(walletId: number, opts: TransferParams): Promise<string>;
|
|
60
|
+
burnAsset(walletId: number, opts: BurnAssetParams): Promise<string>;
|
|
69
61
|
private handleRpcResponse;
|
|
70
62
|
private _asyncCallWithRetry;
|
|
71
63
|
}
|
package/lib/src/CppBridge.js
CHANGED
|
@@ -297,6 +297,21 @@ class CppBridge {
|
|
|
297
297
|
const result = this.handleRpcResponse(response);
|
|
298
298
|
return result.tx_hash;
|
|
299
299
|
}
|
|
300
|
+
async burnAsset(walletId, opts) {
|
|
301
|
+
const params = {
|
|
302
|
+
method: 'burn_asset',
|
|
303
|
+
params: {
|
|
304
|
+
asset_id: opts.assetId,
|
|
305
|
+
burn_amount: opts.burnAmount,
|
|
306
|
+
native_amount: opts.nativeAmount ?? 0,
|
|
307
|
+
point_tx_to_address: opts.pointTxToAddress ?? '',
|
|
308
|
+
service_entries: opts.serviceEntries ?? []
|
|
309
|
+
}
|
|
310
|
+
};
|
|
311
|
+
const response = await this._asyncCallWithRetry('invoke', walletId, JSON.stringify(params));
|
|
312
|
+
const result = this.handleRpcResponse(response);
|
|
313
|
+
return result.tx_id;
|
|
314
|
+
}
|
|
300
315
|
// -----------------------------------------------------------------------------
|
|
301
316
|
// Utils
|
|
302
317
|
// -----------------------------------------------------------------------------
|
package/lib/src/types.d.ts
CHANGED
|
@@ -233,4 +233,20 @@ export interface TransferResponse {
|
|
|
233
233
|
tx_size: number;
|
|
234
234
|
tx_unsigned_hex: '';
|
|
235
235
|
}
|
|
236
|
+
export interface BurnAssetParams {
|
|
237
|
+
assetId: string;
|
|
238
|
+
burnAmount: number;
|
|
239
|
+
nativeAmount?: number;
|
|
240
|
+
pointTxToAddress?: string;
|
|
241
|
+
serviceEntries?: Array<{
|
|
242
|
+
body: string;
|
|
243
|
+
flags?: number;
|
|
244
|
+
instruction: string;
|
|
245
|
+
security?: string;
|
|
246
|
+
service_id: string;
|
|
247
|
+
}>;
|
|
248
|
+
}
|
|
249
|
+
export interface BurnAssetResponse {
|
|
250
|
+
tx_id: string;
|
|
251
|
+
}
|
|
236
252
|
export {};
|