@utexo/rgb-lib-linux-arm64 0.3.0-beta.10
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 +11 -0
- package/binding.gyp +38 -0
- package/package.json +41 -0
- package/rgb-lib/bindings/c-ffi/rgblib.hpp +220 -0
- package/rgb-lib/bindings/c-ffi/target/aarch64-unknown-linux-gnu/release/librgblibcffi.so +0 -0
- package/rgblib.js +1 -0
- package/swig_wrap.cxx +5302 -0
- package/wrapper.js +838 -0
package/README.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# RGB Lib Node.js bindings for linux arm64
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@utexo/rgb-lib-linux-arm64)
|
|
4
|
+
|
|
5
|
+
This project builds a platform-specific Node.js package for the [rgb-lib] Rust
|
|
6
|
+
library and is intended to be installed as a dependency.
|
|
7
|
+
|
|
8
|
+
See the [main package] for details.
|
|
9
|
+
|
|
10
|
+
[rgb-lib]: https://github.com/UTEXO-Protocol/rgb-lib
|
|
11
|
+
[main package]: https://www.npmjs.com/package/@utexo/rgb-lib
|
package/binding.gyp
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"targets": [
|
|
3
|
+
{
|
|
4
|
+
"target_name": "rgblib",
|
|
5
|
+
"sources": [ "swig_wrap.cxx" ],
|
|
6
|
+
"cflags!": [ "-fno-exceptions" ],
|
|
7
|
+
"cflags_cc!": [ "-fno-exceptions" ],
|
|
8
|
+
"conditions": [
|
|
9
|
+
[
|
|
10
|
+
"OS!='win'",
|
|
11
|
+
{
|
|
12
|
+
"library_dirs": [
|
|
13
|
+
"<(module_root_dir)/rgb-lib/bindings/c-ffi/target/aarch64-unknown-linux-gnu/release/",
|
|
14
|
+
],
|
|
15
|
+
"libraries": [
|
|
16
|
+
"-lrgblibcffi",
|
|
17
|
+
"-Wl,-rpath,<(module_root_dir)/rgb-lib/bindings/c-ffi/target/aarch64-unknown-linux-gnu/release/",
|
|
18
|
+
],
|
|
19
|
+
},
|
|
20
|
+
"OS=='win'",
|
|
21
|
+
{
|
|
22
|
+
"libraries": [
|
|
23
|
+
"<(module_root_dir)/rgb-lib/bindings/c-ffi/target/aarch64-unknown-linux-gnu/release/rgblibcffi.lib"
|
|
24
|
+
],
|
|
25
|
+
"copies": [
|
|
26
|
+
{
|
|
27
|
+
"destination": "<(module_root_dir)/build/Release/",
|
|
28
|
+
"files": [
|
|
29
|
+
"<(module_root_dir)/rgb-lib/bindings/c-ffi/target/aarch64-unknown-linux-gnu/release/rgblibcffi.dll"
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@utexo/rgb-lib-linux-arm64",
|
|
3
|
+
"version": "0.3.0-beta.10",
|
|
4
|
+
"description": "Node.js bindings for rgb-lib on linux-arm64",
|
|
5
|
+
"main": "wrapper.js",
|
|
6
|
+
"os": [
|
|
7
|
+
"linux"
|
|
8
|
+
],
|
|
9
|
+
"cpu": [
|
|
10
|
+
"arm64"
|
|
11
|
+
],
|
|
12
|
+
"files": [
|
|
13
|
+
"binding.gyp",
|
|
14
|
+
"rgb-lib/bindings/c-ffi/rgblib.hpp",
|
|
15
|
+
"rgb-lib/bindings/c-ffi/target/aarch64-unknown-linux-gnu/release/librgblibcffi.so",
|
|
16
|
+
"rgb-lib/bindings/c-ffi/target/aarch64-unknown-linux-gnu/release/librgblibcffi.def",
|
|
17
|
+
"rgb-lib/bindings/c-ffi/target/aarch64-unknown-linux-gnu/release/librgblibcffi.lib",
|
|
18
|
+
"rgblib.js",
|
|
19
|
+
"swig_wrap.cxx",
|
|
20
|
+
"wrapper.js"
|
|
21
|
+
],
|
|
22
|
+
"scripts": {
|
|
23
|
+
"test": "echo \"No tests available\" && exit 1",
|
|
24
|
+
"prepack": "touch rgb-lib/.npmignore",
|
|
25
|
+
"postpack": "rm rgb-lib/.npmignore",
|
|
26
|
+
"build": "npm run rust-build && npm run swig-build",
|
|
27
|
+
"rust-build": "cross build -r -F camel_case --manifest-path ./rgb-lib/bindings/c-ffi/Cargo.toml --target aarch64-unknown-linux-gnu",
|
|
28
|
+
"swig-build": "swig -javascript -node -c++ swig.i"
|
|
29
|
+
},
|
|
30
|
+
"author": "Zoe Faltibà <zoefaltiba@gmail.com>",
|
|
31
|
+
"license": "MIT",
|
|
32
|
+
"bugs": {
|
|
33
|
+
"url": "https://github.com/UTEXO-Protocol/rgb-lib-nodejs/issues"
|
|
34
|
+
},
|
|
35
|
+
"homepage": "https://github.com/UTEXO-Protocol/rgb-lib-nodejs#readme",
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"big.js": "^6.2.2",
|
|
38
|
+
"node-addon-api": "^8.3.0",
|
|
39
|
+
"node-gyp": "^11.0.0"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
#include <cstdarg>
|
|
2
|
+
#include <cstddef>
|
|
3
|
+
#include <cstdint>
|
|
4
|
+
#include <cstdlib>
|
|
5
|
+
#include <ostream>
|
|
6
|
+
#include <new>
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
enum class CResultValue {
|
|
10
|
+
Ok,
|
|
11
|
+
Err,
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
struct COpaqueStruct {
|
|
15
|
+
const void *ptr;
|
|
16
|
+
uint64_t ty;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
struct CResult {
|
|
20
|
+
CResultValue result;
|
|
21
|
+
COpaqueStruct inner;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
struct CResultString {
|
|
25
|
+
CResultValue result;
|
|
26
|
+
char *inner;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
extern "C" {
|
|
31
|
+
|
|
32
|
+
void free_invoice(COpaqueStruct obj);
|
|
33
|
+
|
|
34
|
+
void free_online(COpaqueStruct obj);
|
|
35
|
+
|
|
36
|
+
void free_wallet(COpaqueStruct obj);
|
|
37
|
+
|
|
38
|
+
CResult rgblib_backup(const COpaqueStruct *wallet, const char *backup_path, const char *password);
|
|
39
|
+
|
|
40
|
+
CResultString rgblib_backup_info(const COpaqueStruct *wallet);
|
|
41
|
+
|
|
42
|
+
CResultString rgblib_blind_receive(const COpaqueStruct *wallet,
|
|
43
|
+
const char *asset_id_opt,
|
|
44
|
+
const char *assignment,
|
|
45
|
+
const char *duration_seconds_opt,
|
|
46
|
+
const char *transport_endpoints,
|
|
47
|
+
const char *min_confirmations);
|
|
48
|
+
|
|
49
|
+
CResultString rgblib_create_utxos(const COpaqueStruct *wallet,
|
|
50
|
+
const COpaqueStruct *online,
|
|
51
|
+
bool up_to,
|
|
52
|
+
const char *num_opt,
|
|
53
|
+
const char *size_opt,
|
|
54
|
+
const char *fee_rate,
|
|
55
|
+
bool skip_sync);
|
|
56
|
+
|
|
57
|
+
CResultString rgblib_create_utxos_begin(const COpaqueStruct *wallet,
|
|
58
|
+
const COpaqueStruct *online,
|
|
59
|
+
bool up_to,
|
|
60
|
+
const char *num_opt,
|
|
61
|
+
const char *size_opt,
|
|
62
|
+
const char *fee_rate,
|
|
63
|
+
bool skip_sync);
|
|
64
|
+
|
|
65
|
+
CResultString rgblib_create_utxos_end(const COpaqueStruct *wallet,
|
|
66
|
+
const COpaqueStruct *online,
|
|
67
|
+
const char *signed_psbt,
|
|
68
|
+
bool skip_sync);
|
|
69
|
+
|
|
70
|
+
CResultString rgblib_delete_transfers(const COpaqueStruct *wallet,
|
|
71
|
+
const char *batch_transfer_idx_opt,
|
|
72
|
+
bool no_asset_only);
|
|
73
|
+
|
|
74
|
+
CResultString rgblib_fail_transfers(const COpaqueStruct *wallet,
|
|
75
|
+
const COpaqueStruct *online,
|
|
76
|
+
const char *batch_transfer_idx_opt,
|
|
77
|
+
bool no_asset_only,
|
|
78
|
+
bool skip_sync);
|
|
79
|
+
|
|
80
|
+
CResultString rgblib_finalize_psbt(const COpaqueStruct *wallet, const char *signed_psbt);
|
|
81
|
+
|
|
82
|
+
CResultString rgblib_generate_keys(const char *bitcoin_network);
|
|
83
|
+
|
|
84
|
+
CResultString rgblib_get_address(const COpaqueStruct *wallet);
|
|
85
|
+
|
|
86
|
+
CResultString rgblib_get_asset_balance(const COpaqueStruct *wallet, const char *asset_id);
|
|
87
|
+
|
|
88
|
+
CResultString rgblib_get_btc_balance(const COpaqueStruct *wallet,
|
|
89
|
+
const COpaqueStruct *online,
|
|
90
|
+
bool skip_sync);
|
|
91
|
+
|
|
92
|
+
CResultString rgblib_get_fee_estimation(const COpaqueStruct *wallet,
|
|
93
|
+
const COpaqueStruct *online,
|
|
94
|
+
const char *blocks);
|
|
95
|
+
|
|
96
|
+
CResult rgblib_go_online(const COpaqueStruct *wallet,
|
|
97
|
+
bool skip_consistency_check,
|
|
98
|
+
const char *electrum_url);
|
|
99
|
+
|
|
100
|
+
CResultString rgblib_inflate(const COpaqueStruct *wallet,
|
|
101
|
+
const COpaqueStruct *online,
|
|
102
|
+
const char *asset_id,
|
|
103
|
+
const char *inflation_amounts,
|
|
104
|
+
const char *fee_rate,
|
|
105
|
+
const char *min_confirmations);
|
|
106
|
+
|
|
107
|
+
CResultString rgblib_invoice_data(const COpaqueStruct *invoice);
|
|
108
|
+
|
|
109
|
+
CResult rgblib_invoice_new(const char *invoice_string);
|
|
110
|
+
|
|
111
|
+
CResultString rgblib_invoice_string(const COpaqueStruct *invoice);
|
|
112
|
+
|
|
113
|
+
CResultString rgblib_issue_asset_cfa(const COpaqueStruct *wallet,
|
|
114
|
+
const char *name,
|
|
115
|
+
const char *details_opt,
|
|
116
|
+
const char *precision,
|
|
117
|
+
const char *amounts,
|
|
118
|
+
const char *file_path_opt);
|
|
119
|
+
|
|
120
|
+
CResultString rgblib_issue_asset_ifa(const COpaqueStruct *wallet,
|
|
121
|
+
const char *ticker,
|
|
122
|
+
const char *name,
|
|
123
|
+
const char *precision,
|
|
124
|
+
const char *amounts,
|
|
125
|
+
const char *inflation_amounts,
|
|
126
|
+
const char *replace_rights_num,
|
|
127
|
+
const char *reject_list_url_opt);
|
|
128
|
+
|
|
129
|
+
CResultString rgblib_issue_asset_nia(const COpaqueStruct *wallet,
|
|
130
|
+
const char *ticker,
|
|
131
|
+
const char *name,
|
|
132
|
+
const char *precision,
|
|
133
|
+
const char *amounts);
|
|
134
|
+
|
|
135
|
+
CResultString rgblib_issue_asset_uda(const COpaqueStruct *wallet,
|
|
136
|
+
const char *ticker,
|
|
137
|
+
const char *name,
|
|
138
|
+
const char *details_opt,
|
|
139
|
+
const char *precision,
|
|
140
|
+
const char *media_file_path_opt,
|
|
141
|
+
const char *attachments_file_paths);
|
|
142
|
+
|
|
143
|
+
CResultString rgblib_list_assets(const COpaqueStruct *wallet, const char *filter_asset_schemas);
|
|
144
|
+
|
|
145
|
+
CResultString rgblib_list_transactions(const COpaqueStruct *wallet,
|
|
146
|
+
const COpaqueStruct *online,
|
|
147
|
+
bool skip_sync);
|
|
148
|
+
|
|
149
|
+
CResultString rgblib_list_transfers(const COpaqueStruct *wallet, const char *asset_id_opt);
|
|
150
|
+
|
|
151
|
+
CResultString rgblib_list_unspents(const COpaqueStruct *wallet,
|
|
152
|
+
const COpaqueStruct *online,
|
|
153
|
+
bool settled_only,
|
|
154
|
+
bool skip_sync);
|
|
155
|
+
|
|
156
|
+
CResult rgblib_new_wallet(const char *wallet_data);
|
|
157
|
+
|
|
158
|
+
CResultString rgblib_refresh(const COpaqueStruct *wallet,
|
|
159
|
+
const COpaqueStruct *online,
|
|
160
|
+
const char *asset_id_opt,
|
|
161
|
+
const char *filter,
|
|
162
|
+
bool skip_sync);
|
|
163
|
+
|
|
164
|
+
CResult rgblib_restore_backup(const char *backup_path,
|
|
165
|
+
const char *password,
|
|
166
|
+
const char *target_dir);
|
|
167
|
+
|
|
168
|
+
CResultString rgblib_restore_keys(const char *bitcoin_network, const char *mnemonic);
|
|
169
|
+
|
|
170
|
+
CResultString rgblib_send(const COpaqueStruct *wallet,
|
|
171
|
+
const COpaqueStruct *online,
|
|
172
|
+
const char *recipient_map,
|
|
173
|
+
bool donation,
|
|
174
|
+
const char *fee_rate,
|
|
175
|
+
const char *min_confirmations,
|
|
176
|
+
bool skip_sync);
|
|
177
|
+
|
|
178
|
+
CResultString rgblib_send_begin(const COpaqueStruct *wallet,
|
|
179
|
+
const COpaqueStruct *online,
|
|
180
|
+
const char *recipient_map,
|
|
181
|
+
bool donation,
|
|
182
|
+
const char *fee_rate,
|
|
183
|
+
const char *min_confirmations);
|
|
184
|
+
|
|
185
|
+
CResultString rgblib_send_btc(const COpaqueStruct *wallet,
|
|
186
|
+
const COpaqueStruct *online,
|
|
187
|
+
const char *address,
|
|
188
|
+
const char *amount,
|
|
189
|
+
const char *fee_rate,
|
|
190
|
+
bool skip_sync);
|
|
191
|
+
|
|
192
|
+
CResultString rgblib_send_btc_begin(const COpaqueStruct *wallet,
|
|
193
|
+
const COpaqueStruct *online,
|
|
194
|
+
const char *address,
|
|
195
|
+
const char *amount,
|
|
196
|
+
const char *fee_rate,
|
|
197
|
+
bool skip_sync);
|
|
198
|
+
|
|
199
|
+
CResultString rgblib_send_btc_end(const COpaqueStruct *wallet,
|
|
200
|
+
const COpaqueStruct *online,
|
|
201
|
+
const char *signed_psbt,
|
|
202
|
+
bool skip_sync);
|
|
203
|
+
|
|
204
|
+
CResultString rgblib_send_end(const COpaqueStruct *wallet,
|
|
205
|
+
const COpaqueStruct *online,
|
|
206
|
+
const char *signed_psbt,
|
|
207
|
+
bool skip_sync);
|
|
208
|
+
|
|
209
|
+
CResultString rgblib_sign_psbt(const COpaqueStruct *wallet, const char *unsigned_psbt);
|
|
210
|
+
|
|
211
|
+
CResultString rgblib_sync(const COpaqueStruct *wallet, const COpaqueStruct *online);
|
|
212
|
+
|
|
213
|
+
CResultString rgblib_witness_receive(const COpaqueStruct *wallet,
|
|
214
|
+
const char *asset_id_opt,
|
|
215
|
+
const char *assignment,
|
|
216
|
+
const char *duration_seconds_opt,
|
|
217
|
+
const char *transport_endpoints,
|
|
218
|
+
const char *min_confirmations);
|
|
219
|
+
|
|
220
|
+
} // extern "C"
|
|
Binary file
|
package/rgblib.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require("./build/Release/rgblib");
|