react-native-zano 0.2.2 → 0.2.4

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 CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 0.2.4 (2025-09-19)
6
+
7
+ - fixed: Re-publish with correctly-built binaries.
8
+
9
+ ## 0.2.3 (2025-09-18)
10
+
11
+ - fixed: Fix `burnAsset` return value and types
12
+
5
13
  ## 0.2.2 (2025-09-09)
6
14
 
7
15
  - added: Add `burnAsset` method
@@ -1 +1 @@
1
- export declare const srcPath: string;
1
+ export {};
@@ -26,14 +26,13 @@
26
26
  // so it's simpler to pull that in from CocoaPods directly.
27
27
  //
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.srcPath = void 0;
30
29
  const promises_1 = require("fs/promises");
31
30
  const os_1 = require("os");
32
31
  const path_1 = require("path");
33
32
  const android_tools_1 = require("./utils/android-tools");
34
33
  const common_1 = require("./utils/common");
35
34
  const ios_tools_1 = require("./utils/ios-tools");
36
- exports.srcPath = (0, path_1.join)(__dirname, '../src');
35
+ const srcPath = (0, path_1.join)(__dirname, '../src');
37
36
  async function main() {
38
37
  await (0, promises_1.mkdir)(common_1.tmpPath, { recursive: true });
39
38
  await downloadSources();
@@ -168,19 +167,19 @@ async function buildAndroidZano(platform) {
168
167
  '-fPIC',
169
168
  `-o${(0, path_1.join)(outPath, 'librnzano.so')}`,
170
169
  ...includePaths.map(path => `-I${(0, path_1.join)(common_1.tmpPath, path)}`),
171
- ...jniSources.map(source => (0, path_1.join)(exports.srcPath, source)),
170
+ ...jniSources.map(source => (0, path_1.join)(srcPath, source)),
172
171
  ...boostLibs.map(name => (0, path_1.join)(boostPath, `/lib/libboost_${name}.a`)),
173
172
  ...sslLibs.map(name => (0, path_1.join)(sslPath, `${arch}/lib/lib${name}.a`)),
174
173
  ...zanoLibs.map(name => (0, path_1.join)(zanoLibPath, `lib${name}.a`)),
175
174
  '-llog',
176
- `-Wl,--version-script=${(0, path_1.join)(exports.srcPath, 'jni/exports.map')}`,
175
+ `-Wl,--version-script=${(0, path_1.join)(srcPath, 'jni/exports.map')}`,
177
176
  '-Wl,--no-undefined',
178
177
  '-Wl,-z,max-page-size=16384'
179
178
  ]);
180
179
  }
181
180
  /**
182
- * Invokes CMake to build Zano, then breaks open the resulting .a files
183
- * and re-assembles them into one giant .a file.
181
+ * Invokes CMake to build Zano,
182
+ * then combines everything into a big .o file.
184
183
  */
185
184
  async function buildIosZano(platform) {
186
185
  const { sdk, arch, cmakePlatform } = platform;
@@ -220,7 +219,7 @@ async function buildIosZano(platform) {
220
219
  ...(useCxx ? cxxflags : cflags),
221
220
  ...sdkFlags,
222
221
  `-o${object}`,
223
- (0, path_1.join)(exports.srcPath, source)
222
+ (0, path_1.join)(srcPath, source)
224
223
  ]);
225
224
  }
226
225
  // Build Zano itself:
@@ -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,29 +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
- transfers: Array<{
61
- assetId: string;
62
- nativeAmount: number;
63
- recipient: string;
64
- }>;
65
- comment?: string;
66
- fee: number;
67
- paymentId?: string;
68
- }): Promise<string>;
69
- burnAsset(walletId: number, opts: {
70
- assetId: string;
71
- burnAmount: number;
72
- nativeAmount?: number;
73
- pointTxToAddress?: string;
74
- serviceEntries?: Array<{
75
- body: string;
76
- flags: number;
77
- instruction: string;
78
- security: string;
79
- service_id: string;
80
- }>;
81
- }): Promise<string>;
59
+ transfer(walletId: number, opts: TransferParams): Promise<string>;
60
+ burnAsset(walletId: number, opts: BurnAssetParams): Promise<string>;
82
61
  private handleRpcResponse;
83
62
  private _asyncCallWithRetry;
84
63
  }
@@ -310,7 +310,7 @@ class CppBridge {
310
310
  };
311
311
  const response = await this._asyncCallWithRetry('invoke', walletId, JSON.stringify(params));
312
312
  const result = this.handleRpcResponse(response);
313
- return JSON.stringify(result);
313
+ return result.tx_id;
314
314
  }
315
315
  // -----------------------------------------------------------------------------
316
316
  // Utils
@@ -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 {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-zano",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "description": "React Native bindings for the Zano blockchain",
5
5
  "homepage": "https://github.com/EdgeApp/react-native-zano",
6
6
  "repository": {