@bitgo/wasm-utxo 1.15.0 → 1.17.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 +10 -1
- package/dist/cjs/js/fixedScriptWallet/BitGoPsbt.d.ts +5 -2
- package/dist/cjs/js/fixedScriptWallet/BitGoPsbt.js +2 -0
- package/dist/cjs/js/fixedScriptWallet/ZcashBitGoPsbt.d.ts +113 -0
- package/dist/cjs/js/fixedScriptWallet/ZcashBitGoPsbt.js +114 -0
- package/dist/cjs/js/fixedScriptWallet/index.d.ts +2 -1
- package/dist/cjs/js/fixedScriptWallet/index.js +5 -1
- package/dist/cjs/js/index.d.ts +1 -0
- package/dist/cjs/js/index.js +5 -1
- package/dist/cjs/js/transaction.d.ts +46 -0
- package/dist/cjs/js/transaction.js +76 -0
- package/dist/cjs/js/wasm/wasm_utxo.d.ts +109 -0
- package/dist/cjs/js/wasm/wasm_utxo.js +345 -0
- package/dist/cjs/js/wasm/wasm_utxo_bg.wasm +0 -0
- package/dist/cjs/js/wasm/wasm_utxo_bg.wasm.d.ts +54 -41
- package/dist/esm/js/fixedScriptWallet/BitGoPsbt.d.ts +5 -2
- package/dist/esm/js/fixedScriptWallet/BitGoPsbt.js +2 -0
- package/dist/esm/js/fixedScriptWallet/ZcashBitGoPsbt.d.ts +113 -0
- package/dist/esm/js/fixedScriptWallet/ZcashBitGoPsbt.js +110 -0
- package/dist/esm/js/fixedScriptWallet/index.d.ts +2 -1
- package/dist/esm/js/fixedScriptWallet/index.js +3 -0
- package/dist/esm/js/index.d.ts +1 -0
- package/dist/esm/js/index.js +1 -0
- package/dist/esm/js/transaction.d.ts +46 -0
- package/dist/esm/js/transaction.js +70 -0
- package/dist/esm/js/wasm/wasm_utxo.d.ts +109 -0
- package/dist/esm/js/wasm/wasm_utxo_bg.js +342 -0
- package/dist/esm/js/wasm/wasm_utxo_bg.wasm +0 -0
- package/dist/esm/js/wasm/wasm_utxo_bg.wasm.d.ts +54 -41
- package/package.json +1 -1
|
@@ -186,6 +186,10 @@ const WasmBIP32Finalization = (typeof FinalizationRegistry === 'undefined')
|
|
|
186
186
|
? { register: () => {}, unregister: () => {} }
|
|
187
187
|
: new FinalizationRegistry(ptr => wasm.__wbg_wasmbip32_free(ptr >>> 0, 1));
|
|
188
188
|
|
|
189
|
+
const WasmDashTransactionFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
190
|
+
? { register: () => {}, unregister: () => {} }
|
|
191
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmdashtransaction_free(ptr >>> 0, 1));
|
|
192
|
+
|
|
189
193
|
const WasmECPairFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
190
194
|
? { register: () => {}, unregister: () => {} }
|
|
191
195
|
: new FinalizationRegistry(ptr => wasm.__wbg_wasmecpair_free(ptr >>> 0, 1));
|
|
@@ -198,6 +202,14 @@ const WasmRootWalletKeysFinalization = (typeof FinalizationRegistry === 'undefin
|
|
|
198
202
|
? { register: () => {}, unregister: () => {} }
|
|
199
203
|
: new FinalizationRegistry(ptr => wasm.__wbg_wasmrootwalletkeys_free(ptr >>> 0, 1));
|
|
200
204
|
|
|
205
|
+
const WasmTransactionFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
206
|
+
? { register: () => {}, unregister: () => {} }
|
|
207
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmtransaction_free(ptr >>> 0, 1));
|
|
208
|
+
|
|
209
|
+
const WasmZcashTransactionFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
210
|
+
? { register: () => {}, unregister: () => {} }
|
|
211
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmzcashtransaction_free(ptr >>> 0, 1));
|
|
212
|
+
|
|
201
213
|
const WrapDescriptorFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
202
214
|
? { register: () => {}, unregister: () => {} }
|
|
203
215
|
: new FinalizationRegistry(ptr => wasm.__wbg_wrapdescriptor_free(ptr >>> 0, 1));
|
|
@@ -392,6 +404,14 @@ export class BitGoPsbt {
|
|
|
392
404
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
393
405
|
}
|
|
394
406
|
}
|
|
407
|
+
/**
|
|
408
|
+
* Get the Zcash expiry height (returns None for non-Zcash PSBTs)
|
|
409
|
+
* @returns {number | undefined}
|
|
410
|
+
*/
|
|
411
|
+
expiry_height() {
|
|
412
|
+
const ret = wasm.bitgopsbt_expiry_height(this.__wbg_ptr);
|
|
413
|
+
return ret === 0x100000001 ? undefined : ret;
|
|
414
|
+
}
|
|
395
415
|
/**
|
|
396
416
|
* Get the unsigned transaction ID
|
|
397
417
|
* @returns {string}
|
|
@@ -503,6 +523,14 @@ export class BitGoPsbt {
|
|
|
503
523
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
504
524
|
}
|
|
505
525
|
}
|
|
526
|
+
/**
|
|
527
|
+
* Get the Zcash version group ID (returns None for non-Zcash PSBTs)
|
|
528
|
+
* @returns {number | undefined}
|
|
529
|
+
*/
|
|
530
|
+
version_group_id() {
|
|
531
|
+
const ret = wasm.bitgopsbt_version_group_id(this.__wbg_ptr);
|
|
532
|
+
return ret === 0x100000001 ? undefined : ret;
|
|
533
|
+
}
|
|
506
534
|
/**
|
|
507
535
|
* Add a wallet output with full PSBT metadata
|
|
508
536
|
*
|
|
@@ -574,6 +602,47 @@ export class BitGoPsbt {
|
|
|
574
602
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
575
603
|
}
|
|
576
604
|
}
|
|
605
|
+
/**
|
|
606
|
+
* Create an empty Zcash PSBT with the required consensus branch ID
|
|
607
|
+
*
|
|
608
|
+
* This method is specifically for Zcash networks which require additional
|
|
609
|
+
* parameters for sighash computation.
|
|
610
|
+
*
|
|
611
|
+
* # Arguments
|
|
612
|
+
* * `network` - Network name (must be "zcash" or "zcashTest")
|
|
613
|
+
* * `wallet_keys` - The wallet's root keys (used to set global xpubs)
|
|
614
|
+
* * `consensus_branch_id` - Zcash consensus branch ID (e.g., 0xC2D6D0B4 for NU5)
|
|
615
|
+
* * `version` - Optional transaction version (default: 4 for Zcash Sapling+)
|
|
616
|
+
* * `lock_time` - Optional lock time (default: 0)
|
|
617
|
+
* * `version_group_id` - Optional version group ID (defaults to Sapling: 0x892F2085)
|
|
618
|
+
* * `expiry_height` - Optional expiry height
|
|
619
|
+
* @param {string} network
|
|
620
|
+
* @param {WasmRootWalletKeys} wallet_keys
|
|
621
|
+
* @param {number} consensus_branch_id
|
|
622
|
+
* @param {number | null} [version]
|
|
623
|
+
* @param {number | null} [lock_time]
|
|
624
|
+
* @param {number | null} [version_group_id]
|
|
625
|
+
* @param {number | null} [expiry_height]
|
|
626
|
+
* @returns {BitGoPsbt}
|
|
627
|
+
*/
|
|
628
|
+
static create_empty_zcash(network, wallet_keys, consensus_branch_id, version, lock_time, version_group_id, expiry_height) {
|
|
629
|
+
try {
|
|
630
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
631
|
+
const ptr0 = passStringToWasm0(network, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
632
|
+
const len0 = WASM_VECTOR_LEN;
|
|
633
|
+
_assertClass(wallet_keys, WasmRootWalletKeys);
|
|
634
|
+
wasm.bitgopsbt_create_empty_zcash(retptr, ptr0, len0, wallet_keys.__wbg_ptr, consensus_branch_id, isLikeNone(version) ? 0x100000001 : (version) >> 0, isLikeNone(lock_time) ? 0x100000001 : (lock_time) >>> 0, isLikeNone(version_group_id) ? 0x100000001 : (version_group_id) >>> 0, isLikeNone(expiry_height) ? 0x100000001 : (expiry_height) >>> 0);
|
|
635
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
636
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
637
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
638
|
+
if (r2) {
|
|
639
|
+
throw takeObject(r1);
|
|
640
|
+
}
|
|
641
|
+
return BitGoPsbt.__wrap(r0);
|
|
642
|
+
} finally {
|
|
643
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
644
|
+
}
|
|
645
|
+
}
|
|
577
646
|
/**
|
|
578
647
|
* Extract the final transaction from a finalized PSBT
|
|
579
648
|
*
|
|
@@ -850,6 +919,50 @@ export class BitGoPsbt {
|
|
|
850
919
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
851
920
|
}
|
|
852
921
|
}
|
|
922
|
+
/**
|
|
923
|
+
* Create an empty Zcash PSBT with consensus branch ID determined from block height
|
|
924
|
+
*
|
|
925
|
+
* This method automatically determines the correct consensus branch ID based on
|
|
926
|
+
* the network and block height using the network upgrade activation heights.
|
|
927
|
+
*
|
|
928
|
+
* # Arguments
|
|
929
|
+
* * `network` - Network name (must be "zcash" or "zcashTest")
|
|
930
|
+
* * `wallet_keys` - The wallet's root keys (used to set global xpubs)
|
|
931
|
+
* * `block_height` - Block height to determine consensus rules
|
|
932
|
+
* * `version` - Optional transaction version (default: 4 for Zcash Sapling+)
|
|
933
|
+
* * `lock_time` - Optional lock time (default: 0)
|
|
934
|
+
* * `version_group_id` - Optional version group ID (defaults to Sapling: 0x892F2085)
|
|
935
|
+
* * `expiry_height` - Optional expiry height
|
|
936
|
+
*
|
|
937
|
+
* # Errors
|
|
938
|
+
* Returns error if block height is before Overwinter activation
|
|
939
|
+
* @param {string} network
|
|
940
|
+
* @param {WasmRootWalletKeys} wallet_keys
|
|
941
|
+
* @param {number} block_height
|
|
942
|
+
* @param {number | null} [version]
|
|
943
|
+
* @param {number | null} [lock_time]
|
|
944
|
+
* @param {number | null} [version_group_id]
|
|
945
|
+
* @param {number | null} [expiry_height]
|
|
946
|
+
* @returns {BitGoPsbt}
|
|
947
|
+
*/
|
|
948
|
+
static create_empty_zcash_at_height(network, wallet_keys, block_height, version, lock_time, version_group_id, expiry_height) {
|
|
949
|
+
try {
|
|
950
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
951
|
+
const ptr0 = passStringToWasm0(network, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
952
|
+
const len0 = WASM_VECTOR_LEN;
|
|
953
|
+
_assertClass(wallet_keys, WasmRootWalletKeys);
|
|
954
|
+
wasm.bitgopsbt_create_empty_zcash_at_height(retptr, ptr0, len0, wallet_keys.__wbg_ptr, block_height, isLikeNone(version) ? 0x100000001 : (version) >> 0, isLikeNone(lock_time) ? 0x100000001 : (lock_time) >>> 0, isLikeNone(version_group_id) ? 0x100000001 : (version_group_id) >>> 0, isLikeNone(expiry_height) ? 0x100000001 : (expiry_height) >>> 0);
|
|
955
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
956
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
957
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
958
|
+
if (r2) {
|
|
959
|
+
throw takeObject(r1);
|
|
960
|
+
}
|
|
961
|
+
return BitGoPsbt.__wrap(r0);
|
|
962
|
+
} finally {
|
|
963
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
964
|
+
}
|
|
965
|
+
}
|
|
853
966
|
/**
|
|
854
967
|
* Parse outputs with wallet keys to identify which outputs belong to a wallet
|
|
855
968
|
*
|
|
@@ -1557,6 +1670,74 @@ export class WasmBIP32 {
|
|
|
1557
1670
|
}
|
|
1558
1671
|
if (Symbol.dispose) WasmBIP32.prototype[Symbol.dispose] = WasmBIP32.prototype.free;
|
|
1559
1672
|
|
|
1673
|
+
/**
|
|
1674
|
+
* Dash transaction wrapper that supports Dash special transactions (EVO) by preserving extra payload.
|
|
1675
|
+
*/
|
|
1676
|
+
export class WasmDashTransaction {
|
|
1677
|
+
static __wrap(ptr) {
|
|
1678
|
+
ptr = ptr >>> 0;
|
|
1679
|
+
const obj = Object.create(WasmDashTransaction.prototype);
|
|
1680
|
+
obj.__wbg_ptr = ptr;
|
|
1681
|
+
WasmDashTransactionFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1682
|
+
return obj;
|
|
1683
|
+
}
|
|
1684
|
+
__destroy_into_raw() {
|
|
1685
|
+
const ptr = this.__wbg_ptr;
|
|
1686
|
+
this.__wbg_ptr = 0;
|
|
1687
|
+
WasmDashTransactionFinalization.unregister(this);
|
|
1688
|
+
return ptr;
|
|
1689
|
+
}
|
|
1690
|
+
free() {
|
|
1691
|
+
const ptr = this.__destroy_into_raw();
|
|
1692
|
+
wasm.__wbg_wasmdashtransaction_free(ptr, 0);
|
|
1693
|
+
}
|
|
1694
|
+
/**
|
|
1695
|
+
* Deserialize a Dash transaction from bytes (supports EVO special tx extra payload).
|
|
1696
|
+
* @param {Uint8Array} bytes
|
|
1697
|
+
* @returns {WasmDashTransaction}
|
|
1698
|
+
*/
|
|
1699
|
+
static from_bytes(bytes) {
|
|
1700
|
+
try {
|
|
1701
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1702
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_export);
|
|
1703
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1704
|
+
wasm.wasmdashtransaction_from_bytes(retptr, ptr0, len0);
|
|
1705
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1706
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1707
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1708
|
+
if (r2) {
|
|
1709
|
+
throw takeObject(r1);
|
|
1710
|
+
}
|
|
1711
|
+
return WasmDashTransaction.__wrap(r0);
|
|
1712
|
+
} finally {
|
|
1713
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1714
|
+
}
|
|
1715
|
+
}
|
|
1716
|
+
/**
|
|
1717
|
+
* Serialize the Dash transaction to bytes (preserving tx_type and extra payload).
|
|
1718
|
+
* @returns {Uint8Array}
|
|
1719
|
+
*/
|
|
1720
|
+
to_bytes() {
|
|
1721
|
+
try {
|
|
1722
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1723
|
+
wasm.wasmdashtransaction_to_bytes(retptr, this.__wbg_ptr);
|
|
1724
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1725
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1726
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1727
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
1728
|
+
if (r3) {
|
|
1729
|
+
throw takeObject(r2);
|
|
1730
|
+
}
|
|
1731
|
+
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
1732
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
1733
|
+
return v1;
|
|
1734
|
+
} finally {
|
|
1735
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1736
|
+
}
|
|
1737
|
+
}
|
|
1738
|
+
}
|
|
1739
|
+
if (Symbol.dispose) WasmDashTransaction.prototype[Symbol.dispose] = WasmDashTransaction.prototype.free;
|
|
1740
|
+
|
|
1560
1741
|
/**
|
|
1561
1742
|
* WASM wrapper for elliptic curve key pairs (always uses compressed keys)
|
|
1562
1743
|
*/
|
|
@@ -2002,6 +2183,167 @@ export class WasmRootWalletKeys {
|
|
|
2002
2183
|
}
|
|
2003
2184
|
if (Symbol.dispose) WasmRootWalletKeys.prototype[Symbol.dispose] = WasmRootWalletKeys.prototype.free;
|
|
2004
2185
|
|
|
2186
|
+
/**
|
|
2187
|
+
* A Bitcoin-like transaction (for all networks except Zcash)
|
|
2188
|
+
*
|
|
2189
|
+
* This class provides basic transaction parsing and serialization for testing
|
|
2190
|
+
* compatibility with third-party transaction fixtures.
|
|
2191
|
+
*/
|
|
2192
|
+
export class WasmTransaction {
|
|
2193
|
+
static __wrap(ptr) {
|
|
2194
|
+
ptr = ptr >>> 0;
|
|
2195
|
+
const obj = Object.create(WasmTransaction.prototype);
|
|
2196
|
+
obj.__wbg_ptr = ptr;
|
|
2197
|
+
WasmTransactionFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
2198
|
+
return obj;
|
|
2199
|
+
}
|
|
2200
|
+
__destroy_into_raw() {
|
|
2201
|
+
const ptr = this.__wbg_ptr;
|
|
2202
|
+
this.__wbg_ptr = 0;
|
|
2203
|
+
WasmTransactionFinalization.unregister(this);
|
|
2204
|
+
return ptr;
|
|
2205
|
+
}
|
|
2206
|
+
free() {
|
|
2207
|
+
const ptr = this.__destroy_into_raw();
|
|
2208
|
+
wasm.__wbg_wasmtransaction_free(ptr, 0);
|
|
2209
|
+
}
|
|
2210
|
+
/**
|
|
2211
|
+
* Deserialize a transaction from bytes
|
|
2212
|
+
*
|
|
2213
|
+
* # Arguments
|
|
2214
|
+
* * `bytes` - The serialized transaction bytes
|
|
2215
|
+
*
|
|
2216
|
+
* # Returns
|
|
2217
|
+
* A WasmTransaction instance
|
|
2218
|
+
*
|
|
2219
|
+
* # Errors
|
|
2220
|
+
* Returns an error if the bytes cannot be parsed as a valid transaction
|
|
2221
|
+
* @param {Uint8Array} bytes
|
|
2222
|
+
* @returns {WasmTransaction}
|
|
2223
|
+
*/
|
|
2224
|
+
static from_bytes(bytes) {
|
|
2225
|
+
try {
|
|
2226
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2227
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_export);
|
|
2228
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2229
|
+
wasm.wasmtransaction_from_bytes(retptr, ptr0, len0);
|
|
2230
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2231
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2232
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
2233
|
+
if (r2) {
|
|
2234
|
+
throw takeObject(r1);
|
|
2235
|
+
}
|
|
2236
|
+
return WasmTransaction.__wrap(r0);
|
|
2237
|
+
} finally {
|
|
2238
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2239
|
+
}
|
|
2240
|
+
}
|
|
2241
|
+
/**
|
|
2242
|
+
* Serialize the transaction to bytes
|
|
2243
|
+
*
|
|
2244
|
+
* # Returns
|
|
2245
|
+
* The serialized transaction bytes
|
|
2246
|
+
* @returns {Uint8Array}
|
|
2247
|
+
*/
|
|
2248
|
+
to_bytes() {
|
|
2249
|
+
try {
|
|
2250
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2251
|
+
wasm.wasmtransaction_to_bytes(retptr, this.__wbg_ptr);
|
|
2252
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2253
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2254
|
+
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
2255
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
2256
|
+
return v1;
|
|
2257
|
+
} finally {
|
|
2258
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2259
|
+
}
|
|
2260
|
+
}
|
|
2261
|
+
}
|
|
2262
|
+
if (Symbol.dispose) WasmTransaction.prototype[Symbol.dispose] = WasmTransaction.prototype.free;
|
|
2263
|
+
|
|
2264
|
+
/**
|
|
2265
|
+
* A Zcash transaction with network-specific fields
|
|
2266
|
+
*
|
|
2267
|
+
* This class provides basic transaction parsing and serialization for Zcash
|
|
2268
|
+
* transactions, which use the Overwinter transaction format.
|
|
2269
|
+
*/
|
|
2270
|
+
export class WasmZcashTransaction {
|
|
2271
|
+
static __wrap(ptr) {
|
|
2272
|
+
ptr = ptr >>> 0;
|
|
2273
|
+
const obj = Object.create(WasmZcashTransaction.prototype);
|
|
2274
|
+
obj.__wbg_ptr = ptr;
|
|
2275
|
+
WasmZcashTransactionFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
2276
|
+
return obj;
|
|
2277
|
+
}
|
|
2278
|
+
__destroy_into_raw() {
|
|
2279
|
+
const ptr = this.__wbg_ptr;
|
|
2280
|
+
this.__wbg_ptr = 0;
|
|
2281
|
+
WasmZcashTransactionFinalization.unregister(this);
|
|
2282
|
+
return ptr;
|
|
2283
|
+
}
|
|
2284
|
+
free() {
|
|
2285
|
+
const ptr = this.__destroy_into_raw();
|
|
2286
|
+
wasm.__wbg_wasmzcashtransaction_free(ptr, 0);
|
|
2287
|
+
}
|
|
2288
|
+
/**
|
|
2289
|
+
* Deserialize a Zcash transaction from bytes
|
|
2290
|
+
*
|
|
2291
|
+
* # Arguments
|
|
2292
|
+
* * `bytes` - The serialized transaction bytes
|
|
2293
|
+
*
|
|
2294
|
+
* # Returns
|
|
2295
|
+
* A WasmZcashTransaction instance
|
|
2296
|
+
*
|
|
2297
|
+
* # Errors
|
|
2298
|
+
* Returns an error if the bytes cannot be parsed as a valid Zcash transaction
|
|
2299
|
+
* @param {Uint8Array} bytes
|
|
2300
|
+
* @returns {WasmZcashTransaction}
|
|
2301
|
+
*/
|
|
2302
|
+
static from_bytes(bytes) {
|
|
2303
|
+
try {
|
|
2304
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2305
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_export);
|
|
2306
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2307
|
+
wasm.wasmzcashtransaction_from_bytes(retptr, ptr0, len0);
|
|
2308
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2309
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2310
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
2311
|
+
if (r2) {
|
|
2312
|
+
throw takeObject(r1);
|
|
2313
|
+
}
|
|
2314
|
+
return WasmZcashTransaction.__wrap(r0);
|
|
2315
|
+
} finally {
|
|
2316
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2317
|
+
}
|
|
2318
|
+
}
|
|
2319
|
+
/**
|
|
2320
|
+
* Serialize the transaction to bytes
|
|
2321
|
+
*
|
|
2322
|
+
* # Returns
|
|
2323
|
+
* The serialized transaction bytes
|
|
2324
|
+
* @returns {Uint8Array}
|
|
2325
|
+
*/
|
|
2326
|
+
to_bytes() {
|
|
2327
|
+
try {
|
|
2328
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2329
|
+
wasm.wasmzcashtransaction_to_bytes(retptr, this.__wbg_ptr);
|
|
2330
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2331
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2332
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
2333
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
2334
|
+
if (r3) {
|
|
2335
|
+
throw takeObject(r2);
|
|
2336
|
+
}
|
|
2337
|
+
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
2338
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
2339
|
+
return v1;
|
|
2340
|
+
} finally {
|
|
2341
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2342
|
+
}
|
|
2343
|
+
}
|
|
2344
|
+
}
|
|
2345
|
+
if (Symbol.dispose) WasmZcashTransaction.prototype[Symbol.dispose] = WasmZcashTransaction.prototype.free;
|
|
2346
|
+
|
|
2005
2347
|
export class WrapDescriptor {
|
|
2006
2348
|
static __wrap(ptr) {
|
|
2007
2349
|
ptr = ptr >>> 0;
|
|
Binary file
|
|
@@ -1,30 +1,7 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
-
export const __wbg_wasmbip32_free: (a: number, b: number) => void;
|
|
5
4
|
export const __wbg_wrapdescriptor_free: (a: number, b: number) => void;
|
|
6
|
-
export const __wbg_wrapminiscript_free: (a: number, b: number) => void;
|
|
7
|
-
export const __wbg_wrappsbt_free: (a: number, b: number) => void;
|
|
8
|
-
export const wasmbip32_chain_code: (a: number) => number;
|
|
9
|
-
export const wasmbip32_depth: (a: number) => number;
|
|
10
|
-
export const wasmbip32_derive: (a: number, b: number, c: number) => void;
|
|
11
|
-
export const wasmbip32_derive_hardened: (a: number, b: number, c: number) => void;
|
|
12
|
-
export const wasmbip32_derive_path: (a: number, b: number, c: number, d: number) => void;
|
|
13
|
-
export const wasmbip32_fingerprint: (a: number) => number;
|
|
14
|
-
export const wasmbip32_from_base58: (a: number, b: number, c: number) => void;
|
|
15
|
-
export const wasmbip32_from_bip32_interface: (a: number, b: number) => void;
|
|
16
|
-
export const wasmbip32_from_seed: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
17
|
-
export const wasmbip32_from_xprv: (a: number, b: number, c: number) => void;
|
|
18
|
-
export const wasmbip32_from_xpub: (a: number, b: number, c: number) => void;
|
|
19
|
-
export const wasmbip32_identifier: (a: number) => number;
|
|
20
|
-
export const wasmbip32_index: (a: number) => number;
|
|
21
|
-
export const wasmbip32_is_neutered: (a: number) => number;
|
|
22
|
-
export const wasmbip32_neutered: (a: number) => number;
|
|
23
|
-
export const wasmbip32_parent_fingerprint: (a: number) => number;
|
|
24
|
-
export const wasmbip32_private_key: (a: number) => number;
|
|
25
|
-
export const wasmbip32_public_key: (a: number) => number;
|
|
26
|
-
export const wasmbip32_to_base58: (a: number, b: number) => void;
|
|
27
|
-
export const wasmbip32_to_wif: (a: number, b: number) => void;
|
|
28
5
|
export const wrapdescriptor_atDerivationIndex: (a: number, b: number, c: number) => void;
|
|
29
6
|
export const wrapdescriptor_descType: (a: number, b: number) => void;
|
|
30
7
|
export const wrapdescriptor_encode: (a: number, b: number) => void;
|
|
@@ -36,28 +13,16 @@ export const wrapdescriptor_node: (a: number, b: number) => void;
|
|
|
36
13
|
export const wrapdescriptor_scriptPubkey: (a: number, b: number) => void;
|
|
37
14
|
export const wrapdescriptor_toAsmString: (a: number, b: number) => void;
|
|
38
15
|
export const wrapdescriptor_toString: (a: number, b: number) => void;
|
|
39
|
-
export const wrapminiscript_encode: (a: number, b: number) => void;
|
|
40
|
-
export const wrapminiscript_fromBitcoinScript: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
41
|
-
export const wrapminiscript_fromString: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
42
|
-
export const wrapminiscript_node: (a: number, b: number) => void;
|
|
43
|
-
export const wrapminiscript_toAsmString: (a: number, b: number) => void;
|
|
44
|
-
export const wrapminiscript_toString: (a: number, b: number) => void;
|
|
45
|
-
export const wrappsbt_clone: (a: number) => number;
|
|
46
|
-
export const wrappsbt_deserialize: (a: number, b: number, c: number) => void;
|
|
47
|
-
export const wrappsbt_finalize: (a: number, b: number) => void;
|
|
48
|
-
export const wrappsbt_serialize: (a: number, b: number) => void;
|
|
49
|
-
export const wrappsbt_signWithPrv: (a: number, b: number, c: number, d: number) => void;
|
|
50
|
-
export const wrappsbt_signWithXprv: (a: number, b: number, c: number, d: number) => void;
|
|
51
|
-
export const wrappsbt_updateInputWithDescriptor: (a: number, b: number, c: number, d: number) => void;
|
|
52
|
-
export const wrappsbt_updateOutputWithDescriptor: (a: number, b: number, c: number, d: number) => void;
|
|
53
|
-
export const wasmbip32_from_bip32_properties: (a: number, b: number) => void;
|
|
54
16
|
export const __wbg_addressnamespace_free: (a: number, b: number) => void;
|
|
55
17
|
export const __wbg_bitgopsbt_free: (a: number, b: number) => void;
|
|
56
18
|
export const __wbg_fixedscriptwalletnamespace_free: (a: number, b: number) => void;
|
|
57
|
-
export const
|
|
19
|
+
export const __wbg_wasmbip32_free: (a: number, b: number) => void;
|
|
58
20
|
export const __wbg_wasmecpair_free: (a: number, b: number) => void;
|
|
59
21
|
export const __wbg_wasmreplayprotection_free: (a: number, b: number) => void;
|
|
60
22
|
export const __wbg_wasmrootwalletkeys_free: (a: number, b: number) => void;
|
|
23
|
+
export const __wbg_wasmtransaction_free: (a: number, b: number) => void;
|
|
24
|
+
export const __wbg_wasmzcashtransaction_free: (a: number, b: number) => void;
|
|
25
|
+
export const __wbg_wrappsbt_free: (a: number, b: number) => void;
|
|
61
26
|
export const addressnamespace_from_output_script_with_coin: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
62
27
|
export const addressnamespace_to_output_script_with_coin: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
63
28
|
export const bitgopsbt_add_input: (a: number, b: number, c: number, d: number, e: number, f: bigint, g: number, h: number, i: number, j: number, k: number) => void;
|
|
@@ -68,6 +33,9 @@ export const bitgopsbt_add_wallet_input: (a: number, b: number, c: number, d: nu
|
|
|
68
33
|
export const bitgopsbt_add_wallet_output: (a: number, b: number, c: number, d: number, e: bigint, f: number) => void;
|
|
69
34
|
export const bitgopsbt_combine_musig2_nonces: (a: number, b: number, c: number) => void;
|
|
70
35
|
export const bitgopsbt_create_empty: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
36
|
+
export const bitgopsbt_create_empty_zcash: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
|
|
37
|
+
export const bitgopsbt_create_empty_zcash_at_height: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
|
|
38
|
+
export const bitgopsbt_expiry_height: (a: number) => number;
|
|
71
39
|
export const bitgopsbt_extract_transaction: (a: number, b: number) => void;
|
|
72
40
|
export const bitgopsbt_finalize_all_inputs: (a: number, b: number) => void;
|
|
73
41
|
export const bitgopsbt_from_bytes: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
@@ -84,10 +52,29 @@ export const bitgopsbt_verify_replay_protection_signature: (a: number, b: number
|
|
|
84
52
|
export const bitgopsbt_verify_signature_with_pub: (a: number, b: number, c: number, d: number) => void;
|
|
85
53
|
export const bitgopsbt_verify_signature_with_xpub: (a: number, b: number, c: number, d: number) => void;
|
|
86
54
|
export const bitgopsbt_version: (a: number) => number;
|
|
55
|
+
export const bitgopsbt_version_group_id: (a: number) => number;
|
|
87
56
|
export const fixedscriptwalletnamespace_address: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
88
57
|
export const fixedscriptwalletnamespace_output_script: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
89
|
-
export const
|
|
90
|
-
export const
|
|
58
|
+
export const wasmbip32_chain_code: (a: number) => number;
|
|
59
|
+
export const wasmbip32_depth: (a: number) => number;
|
|
60
|
+
export const wasmbip32_derive: (a: number, b: number, c: number) => void;
|
|
61
|
+
export const wasmbip32_derive_hardened: (a: number, b: number, c: number) => void;
|
|
62
|
+
export const wasmbip32_derive_path: (a: number, b: number, c: number, d: number) => void;
|
|
63
|
+
export const wasmbip32_fingerprint: (a: number) => number;
|
|
64
|
+
export const wasmbip32_from_base58: (a: number, b: number, c: number) => void;
|
|
65
|
+
export const wasmbip32_from_bip32_interface: (a: number, b: number) => void;
|
|
66
|
+
export const wasmbip32_from_seed: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
67
|
+
export const wasmbip32_from_xprv: (a: number, b: number, c: number) => void;
|
|
68
|
+
export const wasmbip32_from_xpub: (a: number, b: number, c: number) => void;
|
|
69
|
+
export const wasmbip32_identifier: (a: number) => number;
|
|
70
|
+
export const wasmbip32_index: (a: number) => number;
|
|
71
|
+
export const wasmbip32_is_neutered: (a: number) => number;
|
|
72
|
+
export const wasmbip32_neutered: (a: number) => number;
|
|
73
|
+
export const wasmbip32_parent_fingerprint: (a: number) => number;
|
|
74
|
+
export const wasmbip32_private_key: (a: number) => number;
|
|
75
|
+
export const wasmbip32_public_key: (a: number) => number;
|
|
76
|
+
export const wasmbip32_to_base58: (a: number, b: number) => void;
|
|
77
|
+
export const wasmbip32_to_wif: (a: number, b: number) => void;
|
|
91
78
|
export const wasmecpair_from_private_key: (a: number, b: number, c: number) => void;
|
|
92
79
|
export const wasmecpair_from_public_key: (a: number, b: number, c: number) => void;
|
|
93
80
|
export const wasmecpair_from_wif: (a: number, b: number, c: number) => void;
|
|
@@ -106,6 +93,32 @@ export const wasmrootwalletkeys_bitgo_key: (a: number) => number;
|
|
|
106
93
|
export const wasmrootwalletkeys_new: (a: number, b: number, c: number, d: number) => void;
|
|
107
94
|
export const wasmrootwalletkeys_user_key: (a: number) => number;
|
|
108
95
|
export const wasmrootwalletkeys_with_derivation_prefixes: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => void;
|
|
96
|
+
export const wasmtransaction_from_bytes: (a: number, b: number, c: number) => void;
|
|
97
|
+
export const wasmtransaction_to_bytes: (a: number, b: number) => void;
|
|
98
|
+
export const wasmzcashtransaction_from_bytes: (a: number, b: number, c: number) => void;
|
|
99
|
+
export const wasmzcashtransaction_to_bytes: (a: number, b: number) => void;
|
|
100
|
+
export const wrappsbt_clone: (a: number) => number;
|
|
101
|
+
export const wrappsbt_deserialize: (a: number, b: number, c: number) => void;
|
|
102
|
+
export const wrappsbt_finalize: (a: number, b: number) => void;
|
|
103
|
+
export const wrappsbt_serialize: (a: number, b: number) => void;
|
|
104
|
+
export const wrappsbt_signWithPrv: (a: number, b: number, c: number, d: number) => void;
|
|
105
|
+
export const wrappsbt_signWithXprv: (a: number, b: number, c: number, d: number) => void;
|
|
106
|
+
export const wrappsbt_updateInputWithDescriptor: (a: number, b: number, c: number, d: number) => void;
|
|
107
|
+
export const wrappsbt_updateOutputWithDescriptor: (a: number, b: number, c: number, d: number) => void;
|
|
108
|
+
export const wasmbip32_from_bip32_properties: (a: number, b: number) => void;
|
|
109
|
+
export const __wbg_utxolibcompatnamespace_free: (a: number, b: number) => void;
|
|
110
|
+
export const __wbg_wasmdashtransaction_free: (a: number, b: number) => void;
|
|
111
|
+
export const __wbg_wrapminiscript_free: (a: number, b: number) => void;
|
|
112
|
+
export const utxolibcompatnamespace_from_output_script: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
113
|
+
export const utxolibcompatnamespace_to_output_script: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
114
|
+
export const wasmdashtransaction_from_bytes: (a: number, b: number, c: number) => void;
|
|
115
|
+
export const wasmdashtransaction_to_bytes: (a: number, b: number) => void;
|
|
116
|
+
export const wrapminiscript_encode: (a: number, b: number) => void;
|
|
117
|
+
export const wrapminiscript_fromBitcoinScript: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
118
|
+
export const wrapminiscript_fromString: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
119
|
+
export const wrapminiscript_node: (a: number, b: number) => void;
|
|
120
|
+
export const wrapminiscript_toAsmString: (a: number, b: number) => void;
|
|
121
|
+
export const wrapminiscript_toString: (a: number, b: number) => void;
|
|
109
122
|
export const rustsecp256k1_v0_10_0_context_create: (a: number) => number;
|
|
110
123
|
export const rustsecp256k1_v0_10_0_context_destroy: (a: number) => void;
|
|
111
124
|
export const rustsecp256k1_v0_10_0_default_error_callback_fn: (a: number, b: number) => void;
|