@bitgo/wasm-utxo 4.0.1 → 4.1.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 +7 -0
- package/dist/cjs/js/descriptorWallet/Psbt.js +18 -0
- 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 +13 -0
- package/dist/cjs/js/fixedScriptWallet/BitGoPsbt.js +24 -0
- 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/wasm/wasm_utxo.d.ts +51 -0
- package/dist/cjs/js/wasm/wasm_utxo.js +340 -10
- package/dist/cjs/js/wasm/wasm_utxo_bg.wasm +0 -0
- package/dist/cjs/js/wasm/wasm_utxo_bg.wasm.d.ts +156 -141
- package/dist/esm/js/descriptorWallet/Psbt.d.ts +7 -0
- package/dist/esm/js/descriptorWallet/Psbt.js +18 -0
- 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 +13 -0
- package/dist/esm/js/fixedScriptWallet/BitGoPsbt.js +24 -0
- 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/wasm/wasm_utxo.d.ts +51 -0
- package/dist/esm/js/wasm/wasm_utxo.js +1 -1
- package/dist/esm/js/wasm/wasm_utxo_bg.js +339 -10
- package/dist/esm/js/wasm/wasm_utxo_bg.wasm +0 -0
- package/dist/esm/js/wasm/wasm_utxo_bg.wasm.d.ts +156 -141
- package/package.json +1 -1
|
@@ -334,7 +334,15 @@ 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
|
+
/**
|
|
338
|
+
* Get a KV value from a specific PSBT input. Returns `undefined` if not present.
|
|
339
|
+
*/
|
|
340
|
+
get_input_kv(index: number, key: any): Uint8Array | undefined;
|
|
337
341
|
get_inputs(): any;
|
|
342
|
+
/**
|
|
343
|
+
* Get a KV value from the PSBT global map. Returns `undefined` if not present.
|
|
344
|
+
*/
|
|
345
|
+
get_kv(key: any): Uint8Array | undefined;
|
|
338
346
|
/**
|
|
339
347
|
* Get the network type for transaction extraction
|
|
340
348
|
*
|
|
@@ -342,6 +350,10 @@ export class BitGoPsbt {
|
|
|
342
350
|
* wrapper class should be used in TypeScript.
|
|
343
351
|
*/
|
|
344
352
|
get_network_type(): string;
|
|
353
|
+
/**
|
|
354
|
+
* Get a KV value from a specific PSBT output. Returns `undefined` if not present.
|
|
355
|
+
*/
|
|
356
|
+
get_output_kv(index: number, key: any): Uint8Array | undefined;
|
|
345
357
|
get_outputs(): any;
|
|
346
358
|
get_outputs_with_address(): any;
|
|
347
359
|
input_count(): number;
|
|
@@ -384,6 +396,21 @@ export class BitGoPsbt {
|
|
|
384
396
|
* The serialized PSBT as a byte array
|
|
385
397
|
*/
|
|
386
398
|
serialize(): Uint8Array;
|
|
399
|
+
/**
|
|
400
|
+
* Set an arbitrary KV pair on a specific PSBT input.
|
|
401
|
+
*/
|
|
402
|
+
set_input_kv(index: number, key: any, value: Uint8Array): void;
|
|
403
|
+
/**
|
|
404
|
+
* Set an arbitrary KV pair on the PSBT global map.
|
|
405
|
+
* `key` must be `{ type: "unknown", keyType: number, data?: Uint8Array }` or
|
|
406
|
+
* `{ type: "proprietary", prefix: Uint8Array, subtype: number, key?: Uint8Array }` or
|
|
407
|
+
* `{ type: "bitgo", subtype: number, key?: Uint8Array }`.
|
|
408
|
+
*/
|
|
409
|
+
set_kv(key: any, value: Uint8Array): void;
|
|
410
|
+
/**
|
|
411
|
+
* Set an arbitrary KV pair on a specific PSBT output.
|
|
412
|
+
*/
|
|
413
|
+
set_output_kv(index: number, key: any, value: Uint8Array): void;
|
|
387
414
|
/**
|
|
388
415
|
* Sign all MuSig2 keypath inputs in a single pass with optimized sighash computation.
|
|
389
416
|
*
|
|
@@ -676,6 +703,11 @@ export class FixedScriptWalletNamespace {
|
|
|
676
703
|
* The OP_RETURN script as bytes
|
|
677
704
|
*/
|
|
678
705
|
static create_op_return_script(data?: Uint8Array | null): Uint8Array;
|
|
706
|
+
/**
|
|
707
|
+
* Returns an object mapping BitGo proprietary key subtype names to their `u8` values.
|
|
708
|
+
* Values are loaded directly from the Rust enum at build time — no duplication in TypeScript.
|
|
709
|
+
*/
|
|
710
|
+
static get_bitgo_key_subtypes(): any;
|
|
679
711
|
static output_script(keys: WasmRootWalletKeys, chain: number, index: number, network: any): Uint8Array;
|
|
680
712
|
static output_script_with_network_str(keys: WasmRootWalletKeys, chain: number, index: number, network: string): Uint8Array;
|
|
681
713
|
/**
|
|
@@ -1234,6 +1266,19 @@ export class WasmTransaction {
|
|
|
1234
1266
|
version(): number;
|
|
1235
1267
|
}
|
|
1236
1268
|
|
|
1269
|
+
/**
|
|
1270
|
+
* Top-level package info namespace
|
|
1271
|
+
*/
|
|
1272
|
+
export class WasmUtxoNamespace {
|
|
1273
|
+
private constructor();
|
|
1274
|
+
free(): void;
|
|
1275
|
+
[Symbol.dispose](): void;
|
|
1276
|
+
/**
|
|
1277
|
+
* Returns the wasm-utxo build version as `{ version: string, gitHash: string }`.
|
|
1278
|
+
*/
|
|
1279
|
+
static get_wasm_utxo_version(): any;
|
|
1280
|
+
}
|
|
1281
|
+
|
|
1237
1282
|
/**
|
|
1238
1283
|
* A Zcash transaction with network-specific fields
|
|
1239
1284
|
*
|
|
@@ -1356,7 +1401,10 @@ export class WrapPsbt {
|
|
|
1356
1401
|
extract_transaction(): WasmTransaction;
|
|
1357
1402
|
finalize_mut(): void;
|
|
1358
1403
|
get_global_xpubs(): any;
|
|
1404
|
+
get_input_kv(index: number, key: any): Uint8Array | undefined;
|
|
1359
1405
|
get_inputs(): any;
|
|
1406
|
+
get_kv(key: any): Uint8Array | undefined;
|
|
1407
|
+
get_output_kv(index: number, key: any): Uint8Array | undefined;
|
|
1360
1408
|
get_outputs(): any;
|
|
1361
1409
|
get_outputs_with_address(coin: string): any;
|
|
1362
1410
|
get_partial_signatures(input_index: number): any;
|
|
@@ -1382,6 +1430,9 @@ export class WrapPsbt {
|
|
|
1382
1430
|
remove_input(index: number): void;
|
|
1383
1431
|
remove_output(index: number): void;
|
|
1384
1432
|
serialize(): Uint8Array;
|
|
1433
|
+
set_input_kv(index: number, key: any, value: Uint8Array): void;
|
|
1434
|
+
set_kv(key: any, value: Uint8Array): void;
|
|
1435
|
+
set_output_kv(index: number, key: any, value: Uint8Array): void;
|
|
1385
1436
|
/**
|
|
1386
1437
|
* Sign all inputs with a WasmBIP32 key
|
|
1387
1438
|
*
|
|
@@ -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,33 @@ export class BitGoPsbt {
|
|
|
1191
1191
|
const ret = wasm.bitgopsbt_get_global_xpubs(this.__wbg_ptr);
|
|
1192
1192
|
return takeObject(ret);
|
|
1193
1193
|
}
|
|
1194
|
+
/**
|
|
1195
|
+
* Get a KV value from a specific PSBT input. Returns `undefined` if not present.
|
|
1196
|
+
* @param {number} index
|
|
1197
|
+
* @param {any} key
|
|
1198
|
+
* @returns {Uint8Array | undefined}
|
|
1199
|
+
*/
|
|
1200
|
+
get_input_kv(index, key) {
|
|
1201
|
+
try {
|
|
1202
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1203
|
+
wasm.bitgopsbt_get_input_kv(retptr, this.__wbg_ptr, index, addHeapObject(key));
|
|
1204
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1205
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1206
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1207
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
1208
|
+
if (r3) {
|
|
1209
|
+
throw takeObject(r2);
|
|
1210
|
+
}
|
|
1211
|
+
let v1;
|
|
1212
|
+
if (r0 !== 0) {
|
|
1213
|
+
v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
1214
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
1215
|
+
}
|
|
1216
|
+
return v1;
|
|
1217
|
+
} finally {
|
|
1218
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1219
|
+
}
|
|
1220
|
+
}
|
|
1194
1221
|
/**
|
|
1195
1222
|
* @returns {any}
|
|
1196
1223
|
*/
|
|
@@ -1209,6 +1236,32 @@ export class BitGoPsbt {
|
|
|
1209
1236
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1210
1237
|
}
|
|
1211
1238
|
}
|
|
1239
|
+
/**
|
|
1240
|
+
* Get a KV value from the PSBT global map. Returns `undefined` if not present.
|
|
1241
|
+
* @param {any} key
|
|
1242
|
+
* @returns {Uint8Array | undefined}
|
|
1243
|
+
*/
|
|
1244
|
+
get_kv(key) {
|
|
1245
|
+
try {
|
|
1246
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1247
|
+
wasm.bitgopsbt_get_kv(retptr, this.__wbg_ptr, addHeapObject(key));
|
|
1248
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1249
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1250
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1251
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
1252
|
+
if (r3) {
|
|
1253
|
+
throw takeObject(r2);
|
|
1254
|
+
}
|
|
1255
|
+
let v1;
|
|
1256
|
+
if (r0 !== 0) {
|
|
1257
|
+
v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
1258
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
1259
|
+
}
|
|
1260
|
+
return v1;
|
|
1261
|
+
} finally {
|
|
1262
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1263
|
+
}
|
|
1264
|
+
}
|
|
1212
1265
|
/**
|
|
1213
1266
|
* Get the network type for transaction extraction
|
|
1214
1267
|
*
|
|
@@ -1232,6 +1285,33 @@ export class BitGoPsbt {
|
|
|
1232
1285
|
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
1233
1286
|
}
|
|
1234
1287
|
}
|
|
1288
|
+
/**
|
|
1289
|
+
* Get a KV value from a specific PSBT output. Returns `undefined` if not present.
|
|
1290
|
+
* @param {number} index
|
|
1291
|
+
* @param {any} key
|
|
1292
|
+
* @returns {Uint8Array | undefined}
|
|
1293
|
+
*/
|
|
1294
|
+
get_output_kv(index, key) {
|
|
1295
|
+
try {
|
|
1296
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1297
|
+
wasm.bitgopsbt_get_output_kv(retptr, this.__wbg_ptr, index, addHeapObject(key));
|
|
1298
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1299
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1300
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1301
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
1302
|
+
if (r3) {
|
|
1303
|
+
throw takeObject(r2);
|
|
1304
|
+
}
|
|
1305
|
+
let v1;
|
|
1306
|
+
if (r0 !== 0) {
|
|
1307
|
+
v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
1308
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
1309
|
+
}
|
|
1310
|
+
return v1;
|
|
1311
|
+
} finally {
|
|
1312
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1313
|
+
}
|
|
1314
|
+
}
|
|
1235
1315
|
/**
|
|
1236
1316
|
* @returns {any}
|
|
1237
1317
|
*/
|
|
@@ -1437,6 +1517,71 @@ export class BitGoPsbt {
|
|
|
1437
1517
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1438
1518
|
}
|
|
1439
1519
|
}
|
|
1520
|
+
/**
|
|
1521
|
+
* Set an arbitrary KV pair on a specific PSBT input.
|
|
1522
|
+
* @param {number} index
|
|
1523
|
+
* @param {any} key
|
|
1524
|
+
* @param {Uint8Array} value
|
|
1525
|
+
*/
|
|
1526
|
+
set_input_kv(index, key, value) {
|
|
1527
|
+
try {
|
|
1528
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1529
|
+
const ptr0 = passArray8ToWasm0(value, wasm.__wbindgen_export);
|
|
1530
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1531
|
+
wasm.bitgopsbt_set_input_kv(retptr, this.__wbg_ptr, index, addHeapObject(key), ptr0, len0);
|
|
1532
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1533
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1534
|
+
if (r1) {
|
|
1535
|
+
throw takeObject(r0);
|
|
1536
|
+
}
|
|
1537
|
+
} finally {
|
|
1538
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1539
|
+
}
|
|
1540
|
+
}
|
|
1541
|
+
/**
|
|
1542
|
+
* Set an arbitrary KV pair on the PSBT global map.
|
|
1543
|
+
* `key` must be `{ type: "unknown", keyType: number, data?: Uint8Array }` or
|
|
1544
|
+
* `{ type: "proprietary", prefix: Uint8Array, subtype: number, key?: Uint8Array }` or
|
|
1545
|
+
* `{ type: "bitgo", subtype: number, key?: Uint8Array }`.
|
|
1546
|
+
* @param {any} key
|
|
1547
|
+
* @param {Uint8Array} value
|
|
1548
|
+
*/
|
|
1549
|
+
set_kv(key, value) {
|
|
1550
|
+
try {
|
|
1551
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1552
|
+
const ptr0 = passArray8ToWasm0(value, wasm.__wbindgen_export);
|
|
1553
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1554
|
+
wasm.bitgopsbt_set_kv(retptr, this.__wbg_ptr, addHeapObject(key), ptr0, len0);
|
|
1555
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1556
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1557
|
+
if (r1) {
|
|
1558
|
+
throw takeObject(r0);
|
|
1559
|
+
}
|
|
1560
|
+
} finally {
|
|
1561
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1562
|
+
}
|
|
1563
|
+
}
|
|
1564
|
+
/**
|
|
1565
|
+
* Set an arbitrary KV pair on a specific PSBT output.
|
|
1566
|
+
* @param {number} index
|
|
1567
|
+
* @param {any} key
|
|
1568
|
+
* @param {Uint8Array} value
|
|
1569
|
+
*/
|
|
1570
|
+
set_output_kv(index, key, value) {
|
|
1571
|
+
try {
|
|
1572
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1573
|
+
const ptr0 = passArray8ToWasm0(value, wasm.__wbindgen_export);
|
|
1574
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1575
|
+
wasm.bitgopsbt_set_output_kv(retptr, this.__wbg_ptr, index, addHeapObject(key), ptr0, len0);
|
|
1576
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1577
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1578
|
+
if (r1) {
|
|
1579
|
+
throw takeObject(r0);
|
|
1580
|
+
}
|
|
1581
|
+
} finally {
|
|
1582
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1583
|
+
}
|
|
1584
|
+
}
|
|
1440
1585
|
/**
|
|
1441
1586
|
* Sign all MuSig2 keypath inputs in a single pass with optimized sighash computation.
|
|
1442
1587
|
*
|
|
@@ -2087,6 +2232,15 @@ export class FixedScriptWalletNamespace {
|
|
|
2087
2232
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2088
2233
|
}
|
|
2089
2234
|
}
|
|
2235
|
+
/**
|
|
2236
|
+
* Returns an object mapping BitGo proprietary key subtype names to their `u8` values.
|
|
2237
|
+
* Values are loaded directly from the Rust enum at build time — no duplication in TypeScript.
|
|
2238
|
+
* @returns {any}
|
|
2239
|
+
*/
|
|
2240
|
+
static get_bitgo_key_subtypes() {
|
|
2241
|
+
const ret = wasm.fixedscriptwalletnamespace_get_bitgo_key_subtypes();
|
|
2242
|
+
return takeObject(ret);
|
|
2243
|
+
}
|
|
2090
2244
|
/**
|
|
2091
2245
|
* @param {WasmRootWalletKeys} keys
|
|
2092
2246
|
* @param {number} chain
|
|
@@ -4035,21 +4189,21 @@ export class WasmTransaction {
|
|
|
4035
4189
|
* @returns {number}
|
|
4036
4190
|
*/
|
|
4037
4191
|
input_count() {
|
|
4038
|
-
const ret = wasm.
|
|
4192
|
+
const ret = wasm.wasmdashtransaction_input_count(this.__wbg_ptr);
|
|
4039
4193
|
return ret >>> 0;
|
|
4040
4194
|
}
|
|
4041
4195
|
/**
|
|
4042
4196
|
* @returns {number}
|
|
4043
4197
|
*/
|
|
4044
4198
|
lock_time() {
|
|
4045
|
-
const ret = wasm.
|
|
4199
|
+
const ret = wasm.wasmdashtransaction_lock_time(this.__wbg_ptr);
|
|
4046
4200
|
return ret >>> 0;
|
|
4047
4201
|
}
|
|
4048
4202
|
/**
|
|
4049
4203
|
* @returns {number}
|
|
4050
4204
|
*/
|
|
4051
4205
|
output_count() {
|
|
4052
|
-
const ret = wasm.
|
|
4206
|
+
const ret = wasm.wasmdashtransaction_output_count(this.__wbg_ptr);
|
|
4053
4207
|
return ret >>> 0;
|
|
4054
4208
|
}
|
|
4055
4209
|
/**
|
|
@@ -4076,12 +4230,48 @@ export class WasmTransaction {
|
|
|
4076
4230
|
* @returns {number}
|
|
4077
4231
|
*/
|
|
4078
4232
|
version() {
|
|
4079
|
-
const ret = wasm.
|
|
4233
|
+
const ret = wasm.wasmdashtransaction_version(this.__wbg_ptr);
|
|
4080
4234
|
return ret;
|
|
4081
4235
|
}
|
|
4082
4236
|
}
|
|
4083
4237
|
if (Symbol.dispose) WasmTransaction.prototype[Symbol.dispose] = WasmTransaction.prototype.free;
|
|
4084
4238
|
|
|
4239
|
+
/**
|
|
4240
|
+
* Top-level package info namespace
|
|
4241
|
+
*/
|
|
4242
|
+
export class WasmUtxoNamespace {
|
|
4243
|
+
__destroy_into_raw() {
|
|
4244
|
+
const ptr = this.__wbg_ptr;
|
|
4245
|
+
this.__wbg_ptr = 0;
|
|
4246
|
+
WasmUtxoNamespaceFinalization.unregister(this);
|
|
4247
|
+
return ptr;
|
|
4248
|
+
}
|
|
4249
|
+
free() {
|
|
4250
|
+
const ptr = this.__destroy_into_raw();
|
|
4251
|
+
wasm.__wbg_wasmutxonamespace_free(ptr, 0);
|
|
4252
|
+
}
|
|
4253
|
+
/**
|
|
4254
|
+
* Returns the wasm-utxo build version as `{ version: string, gitHash: string }`.
|
|
4255
|
+
* @returns {any}
|
|
4256
|
+
*/
|
|
4257
|
+
static get_wasm_utxo_version() {
|
|
4258
|
+
try {
|
|
4259
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
4260
|
+
wasm.wasmutxonamespace_get_wasm_utxo_version(retptr);
|
|
4261
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
4262
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
4263
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
4264
|
+
if (r2) {
|
|
4265
|
+
throw takeObject(r1);
|
|
4266
|
+
}
|
|
4267
|
+
return takeObject(r0);
|
|
4268
|
+
} finally {
|
|
4269
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
4270
|
+
}
|
|
4271
|
+
}
|
|
4272
|
+
}
|
|
4273
|
+
if (Symbol.dispose) WasmUtxoNamespace.prototype[Symbol.dispose] = WasmUtxoNamespace.prototype.free;
|
|
4274
|
+
|
|
4085
4275
|
/**
|
|
4086
4276
|
* A Zcash transaction with network-specific fields
|
|
4087
4277
|
*
|
|
@@ -4235,21 +4425,21 @@ export class WasmZcashTransaction {
|
|
|
4235
4425
|
* @returns {number}
|
|
4236
4426
|
*/
|
|
4237
4427
|
input_count() {
|
|
4238
|
-
const ret = wasm.
|
|
4428
|
+
const ret = wasm.wasmdashtransaction_input_count(this.__wbg_ptr);
|
|
4239
4429
|
return ret >>> 0;
|
|
4240
4430
|
}
|
|
4241
4431
|
/**
|
|
4242
4432
|
* @returns {number}
|
|
4243
4433
|
*/
|
|
4244
4434
|
lock_time() {
|
|
4245
|
-
const ret = wasm.
|
|
4435
|
+
const ret = wasm.wasmdashtransaction_lock_time(this.__wbg_ptr);
|
|
4246
4436
|
return ret >>> 0;
|
|
4247
4437
|
}
|
|
4248
4438
|
/**
|
|
4249
4439
|
* @returns {number}
|
|
4250
4440
|
*/
|
|
4251
4441
|
output_count() {
|
|
4252
|
-
const ret = wasm.
|
|
4442
|
+
const ret = wasm.wasmdashtransaction_output_count(this.__wbg_ptr);
|
|
4253
4443
|
return ret >>> 0;
|
|
4254
4444
|
}
|
|
4255
4445
|
/**
|
|
@@ -4281,7 +4471,7 @@ export class WasmZcashTransaction {
|
|
|
4281
4471
|
* @returns {number}
|
|
4282
4472
|
*/
|
|
4283
4473
|
version() {
|
|
4284
|
-
const ret = wasm.
|
|
4474
|
+
const ret = wasm.wasmdashtransaction_version(this.__wbg_ptr);
|
|
4285
4475
|
return ret;
|
|
4286
4476
|
}
|
|
4287
4477
|
}
|
|
@@ -4916,6 +5106,32 @@ export class WrapPsbt {
|
|
|
4916
5106
|
const ret = wasm.wrappsbt_get_global_xpubs(this.__wbg_ptr);
|
|
4917
5107
|
return takeObject(ret);
|
|
4918
5108
|
}
|
|
5109
|
+
/**
|
|
5110
|
+
* @param {number} index
|
|
5111
|
+
* @param {any} key
|
|
5112
|
+
* @returns {Uint8Array | undefined}
|
|
5113
|
+
*/
|
|
5114
|
+
get_input_kv(index, key) {
|
|
5115
|
+
try {
|
|
5116
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
5117
|
+
wasm.wrappsbt_get_input_kv(retptr, this.__wbg_ptr, index, addHeapObject(key));
|
|
5118
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
5119
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
5120
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
5121
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
5122
|
+
if (r3) {
|
|
5123
|
+
throw takeObject(r2);
|
|
5124
|
+
}
|
|
5125
|
+
let v1;
|
|
5126
|
+
if (r0 !== 0) {
|
|
5127
|
+
v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
5128
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
5129
|
+
}
|
|
5130
|
+
return v1;
|
|
5131
|
+
} finally {
|
|
5132
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
5133
|
+
}
|
|
5134
|
+
}
|
|
4919
5135
|
/**
|
|
4920
5136
|
* @returns {any}
|
|
4921
5137
|
*/
|
|
@@ -4934,6 +5150,57 @@ export class WrapPsbt {
|
|
|
4934
5150
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
4935
5151
|
}
|
|
4936
5152
|
}
|
|
5153
|
+
/**
|
|
5154
|
+
* @param {any} key
|
|
5155
|
+
* @returns {Uint8Array | undefined}
|
|
5156
|
+
*/
|
|
5157
|
+
get_kv(key) {
|
|
5158
|
+
try {
|
|
5159
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
5160
|
+
wasm.wrappsbt_get_kv(retptr, this.__wbg_ptr, addHeapObject(key));
|
|
5161
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
5162
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
5163
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
5164
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
5165
|
+
if (r3) {
|
|
5166
|
+
throw takeObject(r2);
|
|
5167
|
+
}
|
|
5168
|
+
let v1;
|
|
5169
|
+
if (r0 !== 0) {
|
|
5170
|
+
v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
5171
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
5172
|
+
}
|
|
5173
|
+
return v1;
|
|
5174
|
+
} finally {
|
|
5175
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
5176
|
+
}
|
|
5177
|
+
}
|
|
5178
|
+
/**
|
|
5179
|
+
* @param {number} index
|
|
5180
|
+
* @param {any} key
|
|
5181
|
+
* @returns {Uint8Array | undefined}
|
|
5182
|
+
*/
|
|
5183
|
+
get_output_kv(index, key) {
|
|
5184
|
+
try {
|
|
5185
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
5186
|
+
wasm.wrappsbt_get_output_kv(retptr, this.__wbg_ptr, index, addHeapObject(key));
|
|
5187
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
5188
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
5189
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
5190
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
5191
|
+
if (r3) {
|
|
5192
|
+
throw takeObject(r2);
|
|
5193
|
+
}
|
|
5194
|
+
let v1;
|
|
5195
|
+
if (r0 !== 0) {
|
|
5196
|
+
v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
5197
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
5198
|
+
}
|
|
5199
|
+
return v1;
|
|
5200
|
+
} finally {
|
|
5201
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
5202
|
+
}
|
|
5203
|
+
}
|
|
4937
5204
|
/**
|
|
4938
5205
|
* @returns {any}
|
|
4939
5206
|
*/
|
|
@@ -5042,7 +5309,7 @@ export class WrapPsbt {
|
|
|
5042
5309
|
* @returns {number}
|
|
5043
5310
|
*/
|
|
5044
5311
|
lock_time() {
|
|
5045
|
-
const ret = wasm.
|
|
5312
|
+
const ret = wasm.wasmdashtransaction_lock_time(this.__wbg_ptr);
|
|
5046
5313
|
return ret >>> 0;
|
|
5047
5314
|
}
|
|
5048
5315
|
/**
|
|
@@ -5115,6 +5382,65 @@ export class WrapPsbt {
|
|
|
5115
5382
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
5116
5383
|
}
|
|
5117
5384
|
}
|
|
5385
|
+
/**
|
|
5386
|
+
* @param {number} index
|
|
5387
|
+
* @param {any} key
|
|
5388
|
+
* @param {Uint8Array} value
|
|
5389
|
+
*/
|
|
5390
|
+
set_input_kv(index, key, value) {
|
|
5391
|
+
try {
|
|
5392
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
5393
|
+
const ptr0 = passArray8ToWasm0(value, wasm.__wbindgen_export);
|
|
5394
|
+
const len0 = WASM_VECTOR_LEN;
|
|
5395
|
+
wasm.wrappsbt_set_input_kv(retptr, this.__wbg_ptr, index, addHeapObject(key), ptr0, len0);
|
|
5396
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
5397
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
5398
|
+
if (r1) {
|
|
5399
|
+
throw takeObject(r0);
|
|
5400
|
+
}
|
|
5401
|
+
} finally {
|
|
5402
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
5403
|
+
}
|
|
5404
|
+
}
|
|
5405
|
+
/**
|
|
5406
|
+
* @param {any} key
|
|
5407
|
+
* @param {Uint8Array} value
|
|
5408
|
+
*/
|
|
5409
|
+
set_kv(key, value) {
|
|
5410
|
+
try {
|
|
5411
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
5412
|
+
const ptr0 = passArray8ToWasm0(value, wasm.__wbindgen_export);
|
|
5413
|
+
const len0 = WASM_VECTOR_LEN;
|
|
5414
|
+
wasm.wrappsbt_set_kv(retptr, this.__wbg_ptr, addHeapObject(key), ptr0, len0);
|
|
5415
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
5416
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
5417
|
+
if (r1) {
|
|
5418
|
+
throw takeObject(r0);
|
|
5419
|
+
}
|
|
5420
|
+
} finally {
|
|
5421
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
5422
|
+
}
|
|
5423
|
+
}
|
|
5424
|
+
/**
|
|
5425
|
+
* @param {number} index
|
|
5426
|
+
* @param {any} key
|
|
5427
|
+
* @param {Uint8Array} value
|
|
5428
|
+
*/
|
|
5429
|
+
set_output_kv(index, key, value) {
|
|
5430
|
+
try {
|
|
5431
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
5432
|
+
const ptr0 = passArray8ToWasm0(value, wasm.__wbindgen_export);
|
|
5433
|
+
const len0 = WASM_VECTOR_LEN;
|
|
5434
|
+
wasm.wrappsbt_set_output_kv(retptr, this.__wbg_ptr, index, addHeapObject(key), ptr0, len0);
|
|
5435
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
5436
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
5437
|
+
if (r1) {
|
|
5438
|
+
throw takeObject(r0);
|
|
5439
|
+
}
|
|
5440
|
+
} finally {
|
|
5441
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
5442
|
+
}
|
|
5443
|
+
}
|
|
5118
5444
|
/**
|
|
5119
5445
|
* Sign all inputs with a WasmBIP32 key
|
|
5120
5446
|
*
|
|
@@ -5333,7 +5659,7 @@ export class WrapPsbt {
|
|
|
5333
5659
|
* @returns {number}
|
|
5334
5660
|
*/
|
|
5335
5661
|
version() {
|
|
5336
|
-
const ret = wasm.
|
|
5662
|
+
const ret = wasm.wasmdashtransaction_version(this.__wbg_ptr);
|
|
5337
5663
|
return ret;
|
|
5338
5664
|
}
|
|
5339
5665
|
}
|
|
@@ -5768,6 +6094,9 @@ const WasmRootWalletKeysFinalization = (typeof FinalizationRegistry === 'undefin
|
|
|
5768
6094
|
const WasmTransactionFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
5769
6095
|
? { register: () => {}, unregister: () => {} }
|
|
5770
6096
|
: new FinalizationRegistry(ptr => wasm.__wbg_wasmtransaction_free(ptr >>> 0, 1));
|
|
6097
|
+
const WasmUtxoNamespaceFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
6098
|
+
? { register: () => {}, unregister: () => {} }
|
|
6099
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmutxonamespace_free(ptr >>> 0, 1));
|
|
5771
6100
|
const WasmZcashTransactionFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
5772
6101
|
? { register: () => {}, unregister: () => {} }
|
|
5773
6102
|
: new FinalizationRegistry(ptr => wasm.__wbg_wasmzcashtransaction_free(ptr >>> 0, 1));
|
|
Binary file
|