@bitgo/wasm-utxo 5.2.0 → 5.4.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/README.md +1 -0
- package/dist/cjs/js/fixedScriptWallet/ZcashIronwoodBitGoPsbt.d.ts +25 -0
- package/dist/cjs/js/fixedScriptWallet/ZcashIronwoodBitGoPsbt.js +33 -0
- package/dist/cjs/js/fixedScriptWallet/ZcashIronwoodWitness.d.ts +29 -0
- package/dist/cjs/js/fixedScriptWallet/ZcashIronwoodWitness.js +15 -0
- package/dist/cjs/js/fixedScriptWallet/index.d.ts +1 -0
- package/dist/cjs/js/wasm/wasm_utxo.d.ts +33 -0
- package/dist/cjs/js/wasm/wasm_utxo.js +181 -3
- package/dist/cjs/js/wasm/wasm_utxo_bg.wasm +0 -0
- package/dist/cjs/js/wasm/wasm_utxo_bg.wasm.d.ts +177 -174
- package/dist/esm/js/fixedScriptWallet/ZcashIronwoodBitGoPsbt.d.ts +25 -0
- package/dist/esm/js/fixedScriptWallet/ZcashIronwoodBitGoPsbt.js +33 -0
- package/dist/esm/js/fixedScriptWallet/ZcashIronwoodWitness.d.ts +29 -0
- package/dist/esm/js/fixedScriptWallet/ZcashIronwoodWitness.js +16 -1
- package/dist/esm/js/fixedScriptWallet/index.d.ts +1 -0
- package/dist/esm/js/wasm/wasm_utxo.d.ts +33 -0
- package/dist/esm/js/wasm/wasm_utxo.js +1 -1
- package/dist/esm/js/wasm/wasm_utxo_bg.js +180 -3
- package/dist/esm/js/wasm/wasm_utxo_bg.wasm +0 -0
- package/dist/esm/js/wasm/wasm_utxo_bg.wasm.d.ts +177 -174
- package/package.json +1 -1
|
@@ -2677,6 +2677,58 @@ export class BitGoPsbt {
|
|
|
2677
2677
|
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
2678
2678
|
}
|
|
2679
2679
|
}
|
|
2680
|
+
/**
|
|
2681
|
+
* Verify if a valid signature exists for a given ECPair key at the specified input index,
|
|
2682
|
+
* computed over the ZIP-244 v6 (Ironwood) transparent sighash — the v6 (Ironwood)
|
|
2683
|
+
* counterpart to `verify_signature_with_pub`, which digests ZIP-243 (Sapling) and would
|
|
2684
|
+
* report `Ok(false)` for a valid v6 signature. Only v6 (Ironwood) Zcash PSBTs are
|
|
2685
|
+
* supported.
|
|
2686
|
+
* @param {number} input_index
|
|
2687
|
+
* @param {WasmECPair} ecpair
|
|
2688
|
+
* @returns {boolean}
|
|
2689
|
+
*/
|
|
2690
|
+
verify_ironwood_v6_signature_with_pub(input_index, ecpair) {
|
|
2691
|
+
try {
|
|
2692
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2693
|
+
_assertClass(ecpair, WasmECPair);
|
|
2694
|
+
wasm.bitgopsbt_verify_ironwood_v6_signature_with_pub(retptr, this.__wbg_ptr, input_index, ecpair.__wbg_ptr);
|
|
2695
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2696
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2697
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
2698
|
+
if (r2) {
|
|
2699
|
+
throw takeObject(r1);
|
|
2700
|
+
}
|
|
2701
|
+
return r0 !== 0;
|
|
2702
|
+
} finally {
|
|
2703
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2704
|
+
}
|
|
2705
|
+
}
|
|
2706
|
+
/**
|
|
2707
|
+
* Verify if a valid signature exists for an extended public key at the specified input
|
|
2708
|
+
* index, computed over the ZIP-244 v6 (Ironwood) transparent sighash — the v6 (Ironwood)
|
|
2709
|
+
* counterpart to `verify_signature_with_xpub`, which digests ZIP-243 (Sapling) and would
|
|
2710
|
+
* report `Ok(false)` for a valid v6 signature. Only v6 (Ironwood) Zcash PSBTs are
|
|
2711
|
+
* supported.
|
|
2712
|
+
* @param {number} input_index
|
|
2713
|
+
* @param {WasmBIP32} xpub
|
|
2714
|
+
* @returns {boolean}
|
|
2715
|
+
*/
|
|
2716
|
+
verify_ironwood_v6_signature_with_xpub(input_index, xpub) {
|
|
2717
|
+
try {
|
|
2718
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2719
|
+
_assertClass(xpub, WasmBIP32);
|
|
2720
|
+
wasm.bitgopsbt_verify_ironwood_v6_signature_with_xpub(retptr, this.__wbg_ptr, input_index, xpub.__wbg_ptr);
|
|
2721
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2722
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2723
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
2724
|
+
if (r2) {
|
|
2725
|
+
throw takeObject(r1);
|
|
2726
|
+
}
|
|
2727
|
+
return r0 !== 0;
|
|
2728
|
+
} finally {
|
|
2729
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2730
|
+
}
|
|
2731
|
+
}
|
|
2680
2732
|
/**
|
|
2681
2733
|
* Verify if a replay protection input has a valid signature
|
|
2682
2734
|
*
|
|
@@ -7192,6 +7244,49 @@ export function ironwood_build_witness(cmx, position, auth_path, anchor) {
|
|
|
7192
7244
|
}
|
|
7193
7245
|
}
|
|
7194
7246
|
|
|
7247
|
+
/**
|
|
7248
|
+
* Build and validate an Ironwood witness from a pruned shard + cap, instead of a
|
|
7249
|
+
* caller-precomputed 32-entry path (see `ironwood_build_witness`).
|
|
7250
|
+
*
|
|
7251
|
+
* `shardHeight` chooses which level the shard's root sits at (it spans up to `2^shardHeight`
|
|
7252
|
+
* leaves); `shard` is the pruned subtree containing `position`, rooted at that level; `cap` is the
|
|
7253
|
+
* pruned tree above every shard, down to (and including) shard-root nodes. `leafCount` is the
|
|
7254
|
+
* total number of leaves committed to the tree as of `anchor` — positions beyond it are treated
|
|
7255
|
+
* as canonically empty. `shard`/`cap` are plain JS objects (not JSON strings) shaped like:
|
|
7256
|
+
* `{ type: "Nil" } | { type: "Leaf", hash: Uint8Array } | { type: "Parent", hash?: Uint8Array,
|
|
7257
|
+
* left: ShardTreeNode, right: ShardTreeNode }`.
|
|
7258
|
+
*
|
|
7259
|
+
* Throws under the same conditions as `ironwood_build_witness`, plus if `shard`/`cap` don't have
|
|
7260
|
+
* enough detail to witness `position` as of `leafCount`.
|
|
7261
|
+
* @param {number} position
|
|
7262
|
+
* @param {number} shard_height
|
|
7263
|
+
* @param {bigint} leaf_count
|
|
7264
|
+
* @param {Uint8Array} cmx
|
|
7265
|
+
* @param {any} shard
|
|
7266
|
+
* @param {any} cap
|
|
7267
|
+
* @param {Uint8Array} anchor
|
|
7268
|
+
* @returns {IronwoodWitness}
|
|
7269
|
+
*/
|
|
7270
|
+
export function ironwood_build_witness_from_shard(position, shard_height, leaf_count, cmx, shard, cap, anchor) {
|
|
7271
|
+
try {
|
|
7272
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
7273
|
+
const ptr0 = passArray8ToWasm0(cmx, wasm.__wbindgen_export);
|
|
7274
|
+
const len0 = WASM_VECTOR_LEN;
|
|
7275
|
+
const ptr1 = passArray8ToWasm0(anchor, wasm.__wbindgen_export);
|
|
7276
|
+
const len1 = WASM_VECTOR_LEN;
|
|
7277
|
+
wasm.ironwood_build_witness_from_shard(retptr, position, shard_height, leaf_count, ptr0, len0, addHeapObject(shard), addHeapObject(cap), ptr1, len1);
|
|
7278
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
7279
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
7280
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
7281
|
+
if (r2) {
|
|
7282
|
+
throw takeObject(r1);
|
|
7283
|
+
}
|
|
7284
|
+
return IronwoodWitness.__wrap(r0);
|
|
7285
|
+
} finally {
|
|
7286
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
7287
|
+
}
|
|
7288
|
+
}
|
|
7289
|
+
|
|
7195
7290
|
/**
|
|
7196
7291
|
* Check if the inspect feature is enabled.
|
|
7197
7292
|
*
|
|
@@ -7511,6 +7606,13 @@ export function __wbg_Error_8c4e43fe74559d73(arg0, arg1) {
|
|
|
7511
7606
|
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
7512
7607
|
return addHeapObject(ret);
|
|
7513
7608
|
}
|
|
7609
|
+
export function __wbg_String_8f0eb39a4a4c2f66(arg0, arg1) {
|
|
7610
|
+
const ret = String(getObject(arg1));
|
|
7611
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
7612
|
+
const len1 = WASM_VECTOR_LEN;
|
|
7613
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
7614
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
7615
|
+
}
|
|
7514
7616
|
export function __wbg___wbindgen_bigint_get_as_i64_8fcf4ce7f1ca72a2(arg0, arg1) {
|
|
7515
7617
|
const v = getObject(arg1);
|
|
7516
7618
|
const ret = typeof(v) === 'bigint' ? v : undefined;
|
|
@@ -7529,6 +7631,10 @@ export function __wbg___wbindgen_debug_string_0bc8482c6e3508ae(arg0, arg1) {
|
|
|
7529
7631
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
7530
7632
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
7531
7633
|
}
|
|
7634
|
+
export function __wbg___wbindgen_in_47fa6863be6f2f25(arg0, arg1) {
|
|
7635
|
+
const ret = getObject(arg0) in getObject(arg1);
|
|
7636
|
+
return ret;
|
|
7637
|
+
}
|
|
7532
7638
|
export function __wbg___wbindgen_is_bigint_31b12575b56f32fc(arg0) {
|
|
7533
7639
|
const ret = typeof(getObject(arg0)) === 'bigint';
|
|
7534
7640
|
return ret;
|
|
@@ -7558,6 +7664,10 @@ export function __wbg___wbindgen_jsval_eq_11888390b0186270(arg0, arg1) {
|
|
|
7558
7664
|
const ret = getObject(arg0) === getObject(arg1);
|
|
7559
7665
|
return ret;
|
|
7560
7666
|
}
|
|
7667
|
+
export function __wbg___wbindgen_jsval_loose_eq_9dd77d8cd6671811(arg0, arg1) {
|
|
7668
|
+
const ret = getObject(arg0) == getObject(arg1);
|
|
7669
|
+
return ret;
|
|
7670
|
+
}
|
|
7561
7671
|
export function __wbg___wbindgen_number_get_8ff4255516ccad3e(arg0, arg1) {
|
|
7562
7672
|
const obj = getObject(arg1);
|
|
7563
7673
|
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
@@ -7587,6 +7697,14 @@ export function __wbg_crypto_574e78ad8b13b65f(arg0) {
|
|
|
7587
7697
|
const ret = getObject(arg0).crypto;
|
|
7588
7698
|
return addHeapObject(ret);
|
|
7589
7699
|
}
|
|
7700
|
+
export function __wbg_done_57b39ecd9addfe81(arg0) {
|
|
7701
|
+
const ret = getObject(arg0).done;
|
|
7702
|
+
return ret;
|
|
7703
|
+
}
|
|
7704
|
+
export function __wbg_entries_58c7934c745daac7(arg0) {
|
|
7705
|
+
const ret = Object.entries(getObject(arg0));
|
|
7706
|
+
return addHeapObject(ret);
|
|
7707
|
+
}
|
|
7590
7708
|
export function __wbg_for_c3adefd268cb6f1c(arg0, arg1) {
|
|
7591
7709
|
const ret = Symbol.for(getStringFromWasm0(arg0, arg1));
|
|
7592
7710
|
return addHeapObject(ret);
|
|
@@ -7606,6 +7724,48 @@ export function __wbg_get_b3ed3ad4be2bc8ac() { return handleError(function (arg0
|
|
|
7606
7724
|
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
7607
7725
|
return addHeapObject(ret);
|
|
7608
7726
|
}, arguments); }
|
|
7727
|
+
export function __wbg_instanceof_ArrayBuffer_c367199e2fa2aa04(arg0) {
|
|
7728
|
+
let result;
|
|
7729
|
+
try {
|
|
7730
|
+
result = getObject(arg0) instanceof ArrayBuffer;
|
|
7731
|
+
} catch (_) {
|
|
7732
|
+
result = false;
|
|
7733
|
+
}
|
|
7734
|
+
const ret = result;
|
|
7735
|
+
return ret;
|
|
7736
|
+
}
|
|
7737
|
+
export function __wbg_instanceof_Map_53af74335dec57f4(arg0) {
|
|
7738
|
+
let result;
|
|
7739
|
+
try {
|
|
7740
|
+
result = getObject(arg0) instanceof Map;
|
|
7741
|
+
} catch (_) {
|
|
7742
|
+
result = false;
|
|
7743
|
+
}
|
|
7744
|
+
const ret = result;
|
|
7745
|
+
return ret;
|
|
7746
|
+
}
|
|
7747
|
+
export function __wbg_instanceof_Uint8Array_9b9075935c74707c(arg0) {
|
|
7748
|
+
let result;
|
|
7749
|
+
try {
|
|
7750
|
+
result = getObject(arg0) instanceof Uint8Array;
|
|
7751
|
+
} catch (_) {
|
|
7752
|
+
result = false;
|
|
7753
|
+
}
|
|
7754
|
+
const ret = result;
|
|
7755
|
+
return ret;
|
|
7756
|
+
}
|
|
7757
|
+
export function __wbg_isArray_d314bb98fcf08331(arg0) {
|
|
7758
|
+
const ret = Array.isArray(getObject(arg0));
|
|
7759
|
+
return ret;
|
|
7760
|
+
}
|
|
7761
|
+
export function __wbg_isSafeInteger_bfbc7332a9768d2a(arg0) {
|
|
7762
|
+
const ret = Number.isSafeInteger(getObject(arg0));
|
|
7763
|
+
return ret;
|
|
7764
|
+
}
|
|
7765
|
+
export function __wbg_iterator_6ff6560ca1568e55() {
|
|
7766
|
+
const ret = Symbol.iterator;
|
|
7767
|
+
return addHeapObject(ret);
|
|
7768
|
+
}
|
|
7609
7769
|
export function __wbg_length_32ed9a279acd054c(arg0) {
|
|
7610
7770
|
const ret = getObject(arg0).length;
|
|
7611
7771
|
return ret;
|
|
@@ -7646,6 +7806,14 @@ export function __wbg_new_with_length_a2c39cbe88fd8ff1(arg0) {
|
|
|
7646
7806
|
const ret = new Uint8Array(arg0 >>> 0);
|
|
7647
7807
|
return addHeapObject(ret);
|
|
7648
7808
|
}
|
|
7809
|
+
export function __wbg_next_3482f54c49e8af19() { return handleError(function (arg0) {
|
|
7810
|
+
const ret = getObject(arg0).next();
|
|
7811
|
+
return addHeapObject(ret);
|
|
7812
|
+
}, arguments); }
|
|
7813
|
+
export function __wbg_next_418f80d8f5303233(arg0) {
|
|
7814
|
+
const ret = getObject(arg0).next;
|
|
7815
|
+
return addHeapObject(ret);
|
|
7816
|
+
}
|
|
7649
7817
|
export function __wbg_node_905d3e251edff8a2(arg0) {
|
|
7650
7818
|
const ret = getObject(arg0).node;
|
|
7651
7819
|
return addHeapObject(ret);
|
|
@@ -7692,6 +7860,10 @@ export function __wbg_subarray_a96e1fef17ed23cb(arg0, arg1, arg2) {
|
|
|
7692
7860
|
const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
|
|
7693
7861
|
return addHeapObject(ret);
|
|
7694
7862
|
}
|
|
7863
|
+
export function __wbg_value_0546255b415e96c1(arg0) {
|
|
7864
|
+
const ret = getObject(arg0).value;
|
|
7865
|
+
return addHeapObject(ret);
|
|
7866
|
+
}
|
|
7695
7867
|
export function __wbg_versions_c01dfd4722a88165(arg0) {
|
|
7696
7868
|
const ret = getObject(arg0).versions;
|
|
7697
7869
|
return addHeapObject(ret);
|
|
@@ -7721,17 +7893,22 @@ export function __wbindgen_cast_0000000000000001(arg0) {
|
|
|
7721
7893
|
const ret = arg0;
|
|
7722
7894
|
return addHeapObject(ret);
|
|
7723
7895
|
}
|
|
7724
|
-
export function __wbindgen_cast_0000000000000002(arg0
|
|
7896
|
+
export function __wbindgen_cast_0000000000000002(arg0) {
|
|
7897
|
+
// Cast intrinsic for `I64 -> Externref`.
|
|
7898
|
+
const ret = arg0;
|
|
7899
|
+
return addHeapObject(ret);
|
|
7900
|
+
}
|
|
7901
|
+
export function __wbindgen_cast_0000000000000003(arg0, arg1) {
|
|
7725
7902
|
// Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
|
|
7726
7903
|
const ret = getArrayU8FromWasm0(arg0, arg1);
|
|
7727
7904
|
return addHeapObject(ret);
|
|
7728
7905
|
}
|
|
7729
|
-
export function
|
|
7906
|
+
export function __wbindgen_cast_0000000000000004(arg0, arg1) {
|
|
7730
7907
|
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
7731
7908
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
7732
7909
|
return addHeapObject(ret);
|
|
7733
7910
|
}
|
|
7734
|
-
export function
|
|
7911
|
+
export function __wbindgen_cast_0000000000000005(arg0) {
|
|
7735
7912
|
// Cast intrinsic for `U64 -> Externref`.
|
|
7736
7913
|
const ret = BigInt.asUintN(64, arg0);
|
|
7737
7914
|
return addHeapObject(ret);
|
|
Binary file
|