@bitgo/wasm-utxo 4.0.2 → 4.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/dist/cjs/js/descriptorWallet/Psbt.d.ts +3 -15
- package/dist/cjs/js/descriptorWallet/Psbt.js +3 -41
- package/dist/cjs/js/fixedScriptWallet/BitGoKeySubtype.d.ts +37 -0
- package/dist/cjs/js/fixedScriptWallet/BitGoKeySubtype.js +5 -0
- package/dist/cjs/js/fixedScriptWallet/BitGoPsbt.d.ts +7 -52
- package/dist/cjs/js/fixedScriptWallet/BitGoPsbt.js +4 -75
- package/dist/cjs/js/fixedScriptWallet/index.d.ts +1 -1
- package/dist/cjs/js/fixedScriptWallet/index.js +3 -1
- package/dist/cjs/js/index.d.ts +5 -0
- package/dist/cjs/js/index.js +8 -3
- package/dist/cjs/js/psbt.d.ts +7 -0
- package/dist/cjs/js/psbtBase.d.ts +44 -0
- package/dist/cjs/js/psbtBase.js +62 -0
- package/dist/cjs/js/transaction.d.ts +6 -58
- package/dist/cjs/js/transaction.js +10 -117
- package/dist/cjs/js/transactionBase.d.ts +28 -0
- package/dist/cjs/js/transactionBase.js +37 -0
- package/dist/cjs/js/wasm/wasm_utxo.d.ts +31 -4
- package/dist/cjs/js/wasm/wasm_utxo.js +333 -13
- package/dist/cjs/js/wasm/wasm_utxo_bg.wasm +0 -0
- package/dist/cjs/js/wasm/wasm_utxo_bg.wasm.d.ts +148 -133
- package/dist/esm/js/descriptorWallet/Psbt.d.ts +3 -15
- package/dist/esm/js/descriptorWallet/Psbt.js +3 -41
- package/dist/esm/js/fixedScriptWallet/BitGoKeySubtype.d.ts +37 -0
- package/dist/esm/js/fixedScriptWallet/BitGoKeySubtype.js +2 -0
- package/dist/esm/js/fixedScriptWallet/BitGoPsbt.d.ts +7 -52
- package/dist/esm/js/fixedScriptWallet/BitGoPsbt.js +4 -75
- package/dist/esm/js/fixedScriptWallet/index.d.ts +1 -1
- package/dist/esm/js/fixedScriptWallet/index.js +1 -0
- package/dist/esm/js/index.d.ts +5 -0
- package/dist/esm/js/index.js +4 -0
- package/dist/esm/js/psbt.d.ts +7 -0
- package/dist/esm/js/psbtBase.d.ts +44 -0
- package/dist/esm/js/psbtBase.js +58 -0
- package/dist/esm/js/transaction.d.ts +6 -58
- package/dist/esm/js/transaction.js +11 -118
- package/dist/esm/js/transactionBase.d.ts +28 -0
- package/dist/esm/js/transactionBase.js +33 -0
- package/dist/esm/js/wasm/wasm_utxo.d.ts +31 -4
- package/dist/esm/js/wasm/wasm_utxo.js +1 -1
- package/dist/esm/js/wasm/wasm_utxo_bg.js +332 -13
- package/dist/esm/js/wasm/wasm_utxo_bg.wasm +0 -0
- package/dist/esm/js/wasm/wasm_utxo_bg.wasm.d.ts +148 -133
- package/package.json +1 -1
|
@@ -334,7 +334,9 @@ export class BitGoPsbt {
|
|
|
334
334
|
*/
|
|
335
335
|
generate_musig2_nonces(xpriv: WasmBIP32, session_id_bytes?: Uint8Array | null): void;
|
|
336
336
|
get_global_xpubs(): any;
|
|
337
|
+
get_input_kv(index: number, key: any): Uint8Array | undefined;
|
|
337
338
|
get_inputs(): any;
|
|
339
|
+
get_kv(key: any): Uint8Array | undefined;
|
|
338
340
|
/**
|
|
339
341
|
* Get the network type for transaction extraction
|
|
340
342
|
*
|
|
@@ -342,6 +344,7 @@ export class BitGoPsbt {
|
|
|
342
344
|
* wrapper class should be used in TypeScript.
|
|
343
345
|
*/
|
|
344
346
|
get_network_type(): string;
|
|
347
|
+
get_output_kv(index: number, key: any): Uint8Array | undefined;
|
|
345
348
|
get_outputs(): any;
|
|
346
349
|
get_outputs_with_address(): any;
|
|
347
350
|
input_count(): number;
|
|
@@ -384,6 +387,9 @@ export class BitGoPsbt {
|
|
|
384
387
|
* The serialized PSBT as a byte array
|
|
385
388
|
*/
|
|
386
389
|
serialize(): Uint8Array;
|
|
390
|
+
set_input_kv(index: number, key: any, value: Uint8Array): void;
|
|
391
|
+
set_kv(key: any, value: Uint8Array): void;
|
|
392
|
+
set_output_kv(index: number, key: any, value: Uint8Array): void;
|
|
387
393
|
/**
|
|
388
394
|
* Sign all MuSig2 keypath inputs in a single pass with optimized sighash computation.
|
|
389
395
|
*
|
|
@@ -583,10 +589,7 @@ export class BitGoPsbt {
|
|
|
583
589
|
* - `Err(WasmUtxoError)` if signing fails
|
|
584
590
|
*/
|
|
585
591
|
sign_with_xpriv(input_index: number, xpriv: WasmBIP32): void;
|
|
586
|
-
|
|
587
|
-
* Get the unsigned transaction ID
|
|
588
|
-
*/
|
|
589
|
-
unsigned_txid(): string;
|
|
592
|
+
unsigned_tx_id(): string;
|
|
590
593
|
/**
|
|
591
594
|
* Verify if a replay protection input has a valid signature
|
|
592
595
|
*
|
|
@@ -676,6 +679,11 @@ export class FixedScriptWalletNamespace {
|
|
|
676
679
|
* The OP_RETURN script as bytes
|
|
677
680
|
*/
|
|
678
681
|
static create_op_return_script(data?: Uint8Array | null): Uint8Array;
|
|
682
|
+
/**
|
|
683
|
+
* Returns an object mapping BitGo proprietary key subtype names to their `u8` values.
|
|
684
|
+
* Values are loaded directly from the Rust enum at build time — no duplication in TypeScript.
|
|
685
|
+
*/
|
|
686
|
+
static get_bitgo_key_subtypes(): any;
|
|
679
687
|
static output_script(keys: WasmRootWalletKeys, chain: number, index: number, network: any): Uint8Array;
|
|
680
688
|
static output_script_with_network_str(keys: WasmRootWalletKeys, chain: number, index: number, network: string): Uint8Array;
|
|
681
689
|
/**
|
|
@@ -1234,6 +1242,19 @@ export class WasmTransaction {
|
|
|
1234
1242
|
version(): number;
|
|
1235
1243
|
}
|
|
1236
1244
|
|
|
1245
|
+
/**
|
|
1246
|
+
* Top-level package info namespace
|
|
1247
|
+
*/
|
|
1248
|
+
export class WasmUtxoNamespace {
|
|
1249
|
+
private constructor();
|
|
1250
|
+
free(): void;
|
|
1251
|
+
[Symbol.dispose](): void;
|
|
1252
|
+
/**
|
|
1253
|
+
* Returns the wasm-utxo build version as `{ version: string, gitHash: string }`.
|
|
1254
|
+
*/
|
|
1255
|
+
static get_wasm_utxo_version(): any;
|
|
1256
|
+
}
|
|
1257
|
+
|
|
1237
1258
|
/**
|
|
1238
1259
|
* A Zcash transaction with network-specific fields
|
|
1239
1260
|
*
|
|
@@ -1356,7 +1377,10 @@ export class WrapPsbt {
|
|
|
1356
1377
|
extract_transaction(): WasmTransaction;
|
|
1357
1378
|
finalize_mut(): void;
|
|
1358
1379
|
get_global_xpubs(): any;
|
|
1380
|
+
get_input_kv(index: number, key: any): Uint8Array | undefined;
|
|
1359
1381
|
get_inputs(): any;
|
|
1382
|
+
get_kv(key: any): Uint8Array | undefined;
|
|
1383
|
+
get_output_kv(index: number, key: any): Uint8Array | undefined;
|
|
1360
1384
|
get_outputs(): any;
|
|
1361
1385
|
get_outputs_with_address(coin: string): any;
|
|
1362
1386
|
get_partial_signatures(input_index: number): any;
|
|
@@ -1382,6 +1406,9 @@ export class WrapPsbt {
|
|
|
1382
1406
|
remove_input(index: number): void;
|
|
1383
1407
|
remove_output(index: number): void;
|
|
1384
1408
|
serialize(): Uint8Array;
|
|
1409
|
+
set_input_kv(index: number, key: any, value: Uint8Array): void;
|
|
1410
|
+
set_kv(key: any, value: Uint8Array): void;
|
|
1411
|
+
set_output_kv(index: number, key: any, value: Uint8Array): void;
|
|
1385
1412
|
/**
|
|
1386
1413
|
* Sign all inputs with a WasmBIP32 key
|
|
1387
1414
|
*
|
|
@@ -5,5 +5,5 @@ import { __wbg_set_wasm } from "./wasm_utxo_bg.js";
|
|
|
5
5
|
__wbg_set_wasm(wasm);
|
|
6
6
|
|
|
7
7
|
export {
|
|
8
|
-
AddressNamespace, Bip322Namespace, BitGoPsbt, FixedScriptWalletNamespace, InscriptionsNamespace, MessageNamespace, UtxolibCompatNamespace, WasmBIP32, WasmDashTransaction, WasmDimensions, WasmECPair, WasmReplayProtection, WasmRootWalletKeys, WasmTransaction, WasmZcashTransaction, WrapDescriptor, WrapMiniscript, WrapPsbt, isInspectEnabled, parsePsbtRawToJson, parsePsbtToJson, parseTxToJson
|
|
8
|
+
AddressNamespace, Bip322Namespace, BitGoPsbt, FixedScriptWalletNamespace, InscriptionsNamespace, MessageNamespace, UtxolibCompatNamespace, WasmBIP32, WasmDashTransaction, WasmDimensions, WasmECPair, WasmReplayProtection, WasmRootWalletKeys, WasmTransaction, WasmUtxoNamespace, WasmZcashTransaction, WrapDescriptor, WrapMiniscript, WrapPsbt, isInspectEnabled, parsePsbtRawToJson, parsePsbtToJson, parseTxToJson
|
|
9
9
|
} from "./wasm_utxo_bg.js";
|
|
@@ -1191,6 +1191,32 @@ export class BitGoPsbt {
|
|
|
1191
1191
|
const ret = wasm.bitgopsbt_get_global_xpubs(this.__wbg_ptr);
|
|
1192
1192
|
return takeObject(ret);
|
|
1193
1193
|
}
|
|
1194
|
+
/**
|
|
1195
|
+
* @param {number} index
|
|
1196
|
+
* @param {any} key
|
|
1197
|
+
* @returns {Uint8Array | undefined}
|
|
1198
|
+
*/
|
|
1199
|
+
get_input_kv(index, key) {
|
|
1200
|
+
try {
|
|
1201
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1202
|
+
wasm.bitgopsbt_get_input_kv(retptr, this.__wbg_ptr, index, addHeapObject(key));
|
|
1203
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1204
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1205
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1206
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
1207
|
+
if (r3) {
|
|
1208
|
+
throw takeObject(r2);
|
|
1209
|
+
}
|
|
1210
|
+
let v1;
|
|
1211
|
+
if (r0 !== 0) {
|
|
1212
|
+
v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
1213
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
1214
|
+
}
|
|
1215
|
+
return v1;
|
|
1216
|
+
} finally {
|
|
1217
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1218
|
+
}
|
|
1219
|
+
}
|
|
1194
1220
|
/**
|
|
1195
1221
|
* @returns {any}
|
|
1196
1222
|
*/
|
|
@@ -1209,6 +1235,31 @@ export class BitGoPsbt {
|
|
|
1209
1235
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1210
1236
|
}
|
|
1211
1237
|
}
|
|
1238
|
+
/**
|
|
1239
|
+
* @param {any} key
|
|
1240
|
+
* @returns {Uint8Array | undefined}
|
|
1241
|
+
*/
|
|
1242
|
+
get_kv(key) {
|
|
1243
|
+
try {
|
|
1244
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1245
|
+
wasm.bitgopsbt_get_kv(retptr, this.__wbg_ptr, addHeapObject(key));
|
|
1246
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1247
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1248
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1249
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
1250
|
+
if (r3) {
|
|
1251
|
+
throw takeObject(r2);
|
|
1252
|
+
}
|
|
1253
|
+
let v1;
|
|
1254
|
+
if (r0 !== 0) {
|
|
1255
|
+
v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
1256
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
1257
|
+
}
|
|
1258
|
+
return v1;
|
|
1259
|
+
} finally {
|
|
1260
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1261
|
+
}
|
|
1262
|
+
}
|
|
1212
1263
|
/**
|
|
1213
1264
|
* Get the network type for transaction extraction
|
|
1214
1265
|
*
|
|
@@ -1232,6 +1283,32 @@ export class BitGoPsbt {
|
|
|
1232
1283
|
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
1233
1284
|
}
|
|
1234
1285
|
}
|
|
1286
|
+
/**
|
|
1287
|
+
* @param {number} index
|
|
1288
|
+
* @param {any} key
|
|
1289
|
+
* @returns {Uint8Array | undefined}
|
|
1290
|
+
*/
|
|
1291
|
+
get_output_kv(index, key) {
|
|
1292
|
+
try {
|
|
1293
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1294
|
+
wasm.bitgopsbt_get_output_kv(retptr, this.__wbg_ptr, index, addHeapObject(key));
|
|
1295
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1296
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1297
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1298
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
1299
|
+
if (r3) {
|
|
1300
|
+
throw takeObject(r2);
|
|
1301
|
+
}
|
|
1302
|
+
let v1;
|
|
1303
|
+
if (r0 !== 0) {
|
|
1304
|
+
v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
1305
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
1306
|
+
}
|
|
1307
|
+
return v1;
|
|
1308
|
+
} finally {
|
|
1309
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1310
|
+
}
|
|
1311
|
+
}
|
|
1235
1312
|
/**
|
|
1236
1313
|
* @returns {any}
|
|
1237
1314
|
*/
|
|
@@ -1437,6 +1514,65 @@ export class BitGoPsbt {
|
|
|
1437
1514
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1438
1515
|
}
|
|
1439
1516
|
}
|
|
1517
|
+
/**
|
|
1518
|
+
* @param {number} index
|
|
1519
|
+
* @param {any} key
|
|
1520
|
+
* @param {Uint8Array} value
|
|
1521
|
+
*/
|
|
1522
|
+
set_input_kv(index, key, value) {
|
|
1523
|
+
try {
|
|
1524
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1525
|
+
const ptr0 = passArray8ToWasm0(value, wasm.__wbindgen_export);
|
|
1526
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1527
|
+
wasm.bitgopsbt_set_input_kv(retptr, this.__wbg_ptr, index, addHeapObject(key), ptr0, len0);
|
|
1528
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1529
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1530
|
+
if (r1) {
|
|
1531
|
+
throw takeObject(r0);
|
|
1532
|
+
}
|
|
1533
|
+
} finally {
|
|
1534
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1535
|
+
}
|
|
1536
|
+
}
|
|
1537
|
+
/**
|
|
1538
|
+
* @param {any} key
|
|
1539
|
+
* @param {Uint8Array} value
|
|
1540
|
+
*/
|
|
1541
|
+
set_kv(key, value) {
|
|
1542
|
+
try {
|
|
1543
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1544
|
+
const ptr0 = passArray8ToWasm0(value, wasm.__wbindgen_export);
|
|
1545
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1546
|
+
wasm.bitgopsbt_set_kv(retptr, this.__wbg_ptr, addHeapObject(key), ptr0, len0);
|
|
1547
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1548
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1549
|
+
if (r1) {
|
|
1550
|
+
throw takeObject(r0);
|
|
1551
|
+
}
|
|
1552
|
+
} finally {
|
|
1553
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1554
|
+
}
|
|
1555
|
+
}
|
|
1556
|
+
/**
|
|
1557
|
+
* @param {number} index
|
|
1558
|
+
* @param {any} key
|
|
1559
|
+
* @param {Uint8Array} value
|
|
1560
|
+
*/
|
|
1561
|
+
set_output_kv(index, key, value) {
|
|
1562
|
+
try {
|
|
1563
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1564
|
+
const ptr0 = passArray8ToWasm0(value, wasm.__wbindgen_export);
|
|
1565
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1566
|
+
wasm.bitgopsbt_set_output_kv(retptr, this.__wbg_ptr, index, addHeapObject(key), ptr0, len0);
|
|
1567
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1568
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1569
|
+
if (r1) {
|
|
1570
|
+
throw takeObject(r0);
|
|
1571
|
+
}
|
|
1572
|
+
} finally {
|
|
1573
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1574
|
+
}
|
|
1575
|
+
}
|
|
1440
1576
|
/**
|
|
1441
1577
|
* Sign all MuSig2 keypath inputs in a single pass with optimized sighash computation.
|
|
1442
1578
|
*
|
|
@@ -1812,15 +1948,14 @@ export class BitGoPsbt {
|
|
|
1812
1948
|
}
|
|
1813
1949
|
}
|
|
1814
1950
|
/**
|
|
1815
|
-
* Get the unsigned transaction ID
|
|
1816
1951
|
* @returns {string}
|
|
1817
1952
|
*/
|
|
1818
|
-
|
|
1953
|
+
unsigned_tx_id() {
|
|
1819
1954
|
let deferred1_0;
|
|
1820
1955
|
let deferred1_1;
|
|
1821
1956
|
try {
|
|
1822
1957
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1823
|
-
wasm.
|
|
1958
|
+
wasm.bitgopsbt_unsigned_tx_id(retptr, this.__wbg_ptr);
|
|
1824
1959
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1825
1960
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1826
1961
|
deferred1_0 = r0;
|
|
@@ -2087,6 +2222,15 @@ export class FixedScriptWalletNamespace {
|
|
|
2087
2222
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2088
2223
|
}
|
|
2089
2224
|
}
|
|
2225
|
+
/**
|
|
2226
|
+
* Returns an object mapping BitGo proprietary key subtype names to their `u8` values.
|
|
2227
|
+
* Values are loaded directly from the Rust enum at build time — no duplication in TypeScript.
|
|
2228
|
+
* @returns {any}
|
|
2229
|
+
*/
|
|
2230
|
+
static get_bitgo_key_subtypes() {
|
|
2231
|
+
const ret = wasm.fixedscriptwalletnamespace_get_bitgo_key_subtypes();
|
|
2232
|
+
return takeObject(ret);
|
|
2233
|
+
}
|
|
2090
2234
|
/**
|
|
2091
2235
|
* @param {WasmRootWalletKeys} keys
|
|
2092
2236
|
* @param {number} chain
|
|
@@ -4035,21 +4179,21 @@ export class WasmTransaction {
|
|
|
4035
4179
|
* @returns {number}
|
|
4036
4180
|
*/
|
|
4037
4181
|
input_count() {
|
|
4038
|
-
const ret = wasm.
|
|
4182
|
+
const ret = wasm.wasmdashtransaction_input_count(this.__wbg_ptr);
|
|
4039
4183
|
return ret >>> 0;
|
|
4040
4184
|
}
|
|
4041
4185
|
/**
|
|
4042
4186
|
* @returns {number}
|
|
4043
4187
|
*/
|
|
4044
4188
|
lock_time() {
|
|
4045
|
-
const ret = wasm.
|
|
4189
|
+
const ret = wasm.wasmdashtransaction_lock_time(this.__wbg_ptr);
|
|
4046
4190
|
return ret >>> 0;
|
|
4047
4191
|
}
|
|
4048
4192
|
/**
|
|
4049
4193
|
* @returns {number}
|
|
4050
4194
|
*/
|
|
4051
4195
|
output_count() {
|
|
4052
|
-
const ret = wasm.
|
|
4196
|
+
const ret = wasm.wasmdashtransaction_output_count(this.__wbg_ptr);
|
|
4053
4197
|
return ret >>> 0;
|
|
4054
4198
|
}
|
|
4055
4199
|
/**
|
|
@@ -4076,12 +4220,48 @@ export class WasmTransaction {
|
|
|
4076
4220
|
* @returns {number}
|
|
4077
4221
|
*/
|
|
4078
4222
|
version() {
|
|
4079
|
-
const ret = wasm.
|
|
4223
|
+
const ret = wasm.wasmdashtransaction_version(this.__wbg_ptr);
|
|
4080
4224
|
return ret;
|
|
4081
4225
|
}
|
|
4082
4226
|
}
|
|
4083
4227
|
if (Symbol.dispose) WasmTransaction.prototype[Symbol.dispose] = WasmTransaction.prototype.free;
|
|
4084
4228
|
|
|
4229
|
+
/**
|
|
4230
|
+
* Top-level package info namespace
|
|
4231
|
+
*/
|
|
4232
|
+
export class WasmUtxoNamespace {
|
|
4233
|
+
__destroy_into_raw() {
|
|
4234
|
+
const ptr = this.__wbg_ptr;
|
|
4235
|
+
this.__wbg_ptr = 0;
|
|
4236
|
+
WasmUtxoNamespaceFinalization.unregister(this);
|
|
4237
|
+
return ptr;
|
|
4238
|
+
}
|
|
4239
|
+
free() {
|
|
4240
|
+
const ptr = this.__destroy_into_raw();
|
|
4241
|
+
wasm.__wbg_wasmutxonamespace_free(ptr, 0);
|
|
4242
|
+
}
|
|
4243
|
+
/**
|
|
4244
|
+
* Returns the wasm-utxo build version as `{ version: string, gitHash: string }`.
|
|
4245
|
+
* @returns {any}
|
|
4246
|
+
*/
|
|
4247
|
+
static get_wasm_utxo_version() {
|
|
4248
|
+
try {
|
|
4249
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
4250
|
+
wasm.wasmutxonamespace_get_wasm_utxo_version(retptr);
|
|
4251
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
4252
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
4253
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
4254
|
+
if (r2) {
|
|
4255
|
+
throw takeObject(r1);
|
|
4256
|
+
}
|
|
4257
|
+
return takeObject(r0);
|
|
4258
|
+
} finally {
|
|
4259
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
4260
|
+
}
|
|
4261
|
+
}
|
|
4262
|
+
}
|
|
4263
|
+
if (Symbol.dispose) WasmUtxoNamespace.prototype[Symbol.dispose] = WasmUtxoNamespace.prototype.free;
|
|
4264
|
+
|
|
4085
4265
|
/**
|
|
4086
4266
|
* A Zcash transaction with network-specific fields
|
|
4087
4267
|
*
|
|
@@ -4235,21 +4415,21 @@ export class WasmZcashTransaction {
|
|
|
4235
4415
|
* @returns {number}
|
|
4236
4416
|
*/
|
|
4237
4417
|
input_count() {
|
|
4238
|
-
const ret = wasm.
|
|
4418
|
+
const ret = wasm.wasmdashtransaction_input_count(this.__wbg_ptr);
|
|
4239
4419
|
return ret >>> 0;
|
|
4240
4420
|
}
|
|
4241
4421
|
/**
|
|
4242
4422
|
* @returns {number}
|
|
4243
4423
|
*/
|
|
4244
4424
|
lock_time() {
|
|
4245
|
-
const ret = wasm.
|
|
4425
|
+
const ret = wasm.wasmdashtransaction_lock_time(this.__wbg_ptr);
|
|
4246
4426
|
return ret >>> 0;
|
|
4247
4427
|
}
|
|
4248
4428
|
/**
|
|
4249
4429
|
* @returns {number}
|
|
4250
4430
|
*/
|
|
4251
4431
|
output_count() {
|
|
4252
|
-
const ret = wasm.
|
|
4432
|
+
const ret = wasm.wasmdashtransaction_output_count(this.__wbg_ptr);
|
|
4253
4433
|
return ret >>> 0;
|
|
4254
4434
|
}
|
|
4255
4435
|
/**
|
|
@@ -4281,7 +4461,7 @@ export class WasmZcashTransaction {
|
|
|
4281
4461
|
* @returns {number}
|
|
4282
4462
|
*/
|
|
4283
4463
|
version() {
|
|
4284
|
-
const ret = wasm.
|
|
4464
|
+
const ret = wasm.wasmdashtransaction_version(this.__wbg_ptr);
|
|
4285
4465
|
return ret;
|
|
4286
4466
|
}
|
|
4287
4467
|
}
|
|
@@ -4916,6 +5096,32 @@ export class WrapPsbt {
|
|
|
4916
5096
|
const ret = wasm.wrappsbt_get_global_xpubs(this.__wbg_ptr);
|
|
4917
5097
|
return takeObject(ret);
|
|
4918
5098
|
}
|
|
5099
|
+
/**
|
|
5100
|
+
* @param {number} index
|
|
5101
|
+
* @param {any} key
|
|
5102
|
+
* @returns {Uint8Array | undefined}
|
|
5103
|
+
*/
|
|
5104
|
+
get_input_kv(index, key) {
|
|
5105
|
+
try {
|
|
5106
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
5107
|
+
wasm.wrappsbt_get_input_kv(retptr, this.__wbg_ptr, index, addHeapObject(key));
|
|
5108
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
5109
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
5110
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
5111
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
5112
|
+
if (r3) {
|
|
5113
|
+
throw takeObject(r2);
|
|
5114
|
+
}
|
|
5115
|
+
let v1;
|
|
5116
|
+
if (r0 !== 0) {
|
|
5117
|
+
v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
5118
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
5119
|
+
}
|
|
5120
|
+
return v1;
|
|
5121
|
+
} finally {
|
|
5122
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
5123
|
+
}
|
|
5124
|
+
}
|
|
4919
5125
|
/**
|
|
4920
5126
|
* @returns {any}
|
|
4921
5127
|
*/
|
|
@@ -4934,6 +5140,57 @@ export class WrapPsbt {
|
|
|
4934
5140
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
4935
5141
|
}
|
|
4936
5142
|
}
|
|
5143
|
+
/**
|
|
5144
|
+
* @param {any} key
|
|
5145
|
+
* @returns {Uint8Array | undefined}
|
|
5146
|
+
*/
|
|
5147
|
+
get_kv(key) {
|
|
5148
|
+
try {
|
|
5149
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
5150
|
+
wasm.wrappsbt_get_kv(retptr, this.__wbg_ptr, addHeapObject(key));
|
|
5151
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
5152
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
5153
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
5154
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
5155
|
+
if (r3) {
|
|
5156
|
+
throw takeObject(r2);
|
|
5157
|
+
}
|
|
5158
|
+
let v1;
|
|
5159
|
+
if (r0 !== 0) {
|
|
5160
|
+
v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
5161
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
5162
|
+
}
|
|
5163
|
+
return v1;
|
|
5164
|
+
} finally {
|
|
5165
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
5166
|
+
}
|
|
5167
|
+
}
|
|
5168
|
+
/**
|
|
5169
|
+
* @param {number} index
|
|
5170
|
+
* @param {any} key
|
|
5171
|
+
* @returns {Uint8Array | undefined}
|
|
5172
|
+
*/
|
|
5173
|
+
get_output_kv(index, key) {
|
|
5174
|
+
try {
|
|
5175
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
5176
|
+
wasm.wrappsbt_get_output_kv(retptr, this.__wbg_ptr, index, addHeapObject(key));
|
|
5177
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
5178
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
5179
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
5180
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
5181
|
+
if (r3) {
|
|
5182
|
+
throw takeObject(r2);
|
|
5183
|
+
}
|
|
5184
|
+
let v1;
|
|
5185
|
+
if (r0 !== 0) {
|
|
5186
|
+
v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
5187
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
5188
|
+
}
|
|
5189
|
+
return v1;
|
|
5190
|
+
} finally {
|
|
5191
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
5192
|
+
}
|
|
5193
|
+
}
|
|
4937
5194
|
/**
|
|
4938
5195
|
* @returns {any}
|
|
4939
5196
|
*/
|
|
@@ -5042,7 +5299,7 @@ export class WrapPsbt {
|
|
|
5042
5299
|
* @returns {number}
|
|
5043
5300
|
*/
|
|
5044
5301
|
lock_time() {
|
|
5045
|
-
const ret = wasm.
|
|
5302
|
+
const ret = wasm.wasmdashtransaction_lock_time(this.__wbg_ptr);
|
|
5046
5303
|
return ret >>> 0;
|
|
5047
5304
|
}
|
|
5048
5305
|
/**
|
|
@@ -5115,6 +5372,65 @@ export class WrapPsbt {
|
|
|
5115
5372
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
5116
5373
|
}
|
|
5117
5374
|
}
|
|
5375
|
+
/**
|
|
5376
|
+
* @param {number} index
|
|
5377
|
+
* @param {any} key
|
|
5378
|
+
* @param {Uint8Array} value
|
|
5379
|
+
*/
|
|
5380
|
+
set_input_kv(index, key, value) {
|
|
5381
|
+
try {
|
|
5382
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
5383
|
+
const ptr0 = passArray8ToWasm0(value, wasm.__wbindgen_export);
|
|
5384
|
+
const len0 = WASM_VECTOR_LEN;
|
|
5385
|
+
wasm.wrappsbt_set_input_kv(retptr, this.__wbg_ptr, index, addHeapObject(key), ptr0, len0);
|
|
5386
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
5387
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
5388
|
+
if (r1) {
|
|
5389
|
+
throw takeObject(r0);
|
|
5390
|
+
}
|
|
5391
|
+
} finally {
|
|
5392
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
5393
|
+
}
|
|
5394
|
+
}
|
|
5395
|
+
/**
|
|
5396
|
+
* @param {any} key
|
|
5397
|
+
* @param {Uint8Array} value
|
|
5398
|
+
*/
|
|
5399
|
+
set_kv(key, value) {
|
|
5400
|
+
try {
|
|
5401
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
5402
|
+
const ptr0 = passArray8ToWasm0(value, wasm.__wbindgen_export);
|
|
5403
|
+
const len0 = WASM_VECTOR_LEN;
|
|
5404
|
+
wasm.wrappsbt_set_kv(retptr, this.__wbg_ptr, addHeapObject(key), ptr0, len0);
|
|
5405
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
5406
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
5407
|
+
if (r1) {
|
|
5408
|
+
throw takeObject(r0);
|
|
5409
|
+
}
|
|
5410
|
+
} finally {
|
|
5411
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
5412
|
+
}
|
|
5413
|
+
}
|
|
5414
|
+
/**
|
|
5415
|
+
* @param {number} index
|
|
5416
|
+
* @param {any} key
|
|
5417
|
+
* @param {Uint8Array} value
|
|
5418
|
+
*/
|
|
5419
|
+
set_output_kv(index, key, value) {
|
|
5420
|
+
try {
|
|
5421
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
5422
|
+
const ptr0 = passArray8ToWasm0(value, wasm.__wbindgen_export);
|
|
5423
|
+
const len0 = WASM_VECTOR_LEN;
|
|
5424
|
+
wasm.wrappsbt_set_output_kv(retptr, this.__wbg_ptr, index, addHeapObject(key), ptr0, len0);
|
|
5425
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
5426
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
5427
|
+
if (r1) {
|
|
5428
|
+
throw takeObject(r0);
|
|
5429
|
+
}
|
|
5430
|
+
} finally {
|
|
5431
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
5432
|
+
}
|
|
5433
|
+
}
|
|
5118
5434
|
/**
|
|
5119
5435
|
* Sign all inputs with a WasmBIP32 key
|
|
5120
5436
|
*
|
|
@@ -5333,7 +5649,7 @@ export class WrapPsbt {
|
|
|
5333
5649
|
* @returns {number}
|
|
5334
5650
|
*/
|
|
5335
5651
|
version() {
|
|
5336
|
-
const ret = wasm.
|
|
5652
|
+
const ret = wasm.wasmdashtransaction_version(this.__wbg_ptr);
|
|
5337
5653
|
return ret;
|
|
5338
5654
|
}
|
|
5339
5655
|
}
|
|
@@ -5768,6 +6084,9 @@ const WasmRootWalletKeysFinalization = (typeof FinalizationRegistry === 'undefin
|
|
|
5768
6084
|
const WasmTransactionFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
5769
6085
|
? { register: () => {}, unregister: () => {} }
|
|
5770
6086
|
: new FinalizationRegistry(ptr => wasm.__wbg_wasmtransaction_free(ptr >>> 0, 1));
|
|
6087
|
+
const WasmUtxoNamespaceFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
6088
|
+
? { register: () => {}, unregister: () => {} }
|
|
6089
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmutxonamespace_free(ptr >>> 0, 1));
|
|
5771
6090
|
const WasmZcashTransactionFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
5772
6091
|
? { register: () => {}, unregister: () => {} }
|
|
5773
6092
|
: new FinalizationRegistry(ptr => wasm.__wbg_wasmzcashtransaction_free(ptr >>> 0, 1));
|
|
Binary file
|