@bitgo/wasm-utxo 4.25.0 → 4.27.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/fixedScriptWallet/ZcashUnifiedAddress.d.ts +57 -0
- package/dist/cjs/js/fixedScriptWallet/ZcashUnifiedAddress.js +74 -0
- package/dist/cjs/js/fixedScriptWallet/ZcashV6Transaction.d.ts +45 -0
- package/dist/cjs/js/fixedScriptWallet/ZcashV6Transaction.js +73 -0
- package/dist/cjs/js/fixedScriptWallet/index.d.ts +2 -0
- package/dist/cjs/js/fixedScriptWallet/index.js +7 -1
- package/dist/cjs/js/wasm/wasm_utxo.d.ts +98 -0
- package/dist/cjs/js/wasm/wasm_utxo.js +324 -0
- package/dist/cjs/js/wasm/wasm_utxo_bg.wasm +0 -0
- package/dist/cjs/js/wasm/wasm_utxo_bg.wasm.d.ts +61 -44
- package/dist/esm/js/fixedScriptWallet/ZcashUnifiedAddress.d.ts +57 -0
- package/dist/esm/js/fixedScriptWallet/ZcashUnifiedAddress.js +70 -0
- package/dist/esm/js/fixedScriptWallet/ZcashV6Transaction.d.ts +45 -0
- package/dist/esm/js/fixedScriptWallet/ZcashV6Transaction.js +69 -0
- package/dist/esm/js/fixedScriptWallet/index.d.ts +2 -0
- package/dist/esm/js/fixedScriptWallet/index.js +4 -0
- package/dist/esm/js/wasm/wasm_utxo.d.ts +98 -0
- package/dist/esm/js/wasm/wasm_utxo.js +1 -1
- package/dist/esm/js/wasm/wasm_utxo_bg.js +322 -0
- package/dist/esm/js/wasm/wasm_utxo_bg.wasm +0 -0
- package/dist/esm/js/wasm/wasm_utxo_bg.wasm.d.ts +61 -44
- package/package.json +1 -1
|
@@ -6215,6 +6215,321 @@ class WrapPsbt {
|
|
|
6215
6215
|
if (Symbol.dispose) WrapPsbt.prototype[Symbol.dispose] = WrapPsbt.prototype.free;
|
|
6216
6216
|
exports.WrapPsbt = WrapPsbt;
|
|
6217
6217
|
|
|
6218
|
+
/**
|
|
6219
|
+
* A parsed ZIP-316 Unified Address.
|
|
6220
|
+
*
|
|
6221
|
+
* Decode once with [`ZcashUnifiedAddress::parse`], then read each component through
|
|
6222
|
+
* its accessor (returns `undefined` when absent). Ironwood reuses the Orchard
|
|
6223
|
+
* receiver, so `orchardReceiver` is the shielded receiver for Ironwood output notes.
|
|
6224
|
+
*/
|
|
6225
|
+
class ZcashUnifiedAddress {
|
|
6226
|
+
static __wrap(ptr) {
|
|
6227
|
+
ptr = ptr >>> 0;
|
|
6228
|
+
const obj = Object.create(ZcashUnifiedAddress.prototype);
|
|
6229
|
+
obj.__wbg_ptr = ptr;
|
|
6230
|
+
ZcashUnifiedAddressFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
6231
|
+
return obj;
|
|
6232
|
+
}
|
|
6233
|
+
__destroy_into_raw() {
|
|
6234
|
+
const ptr = this.__wbg_ptr;
|
|
6235
|
+
this.__wbg_ptr = 0;
|
|
6236
|
+
ZcashUnifiedAddressFinalization.unregister(this);
|
|
6237
|
+
return ptr;
|
|
6238
|
+
}
|
|
6239
|
+
free() {
|
|
6240
|
+
const ptr = this.__destroy_into_raw();
|
|
6241
|
+
wasm.__wbg_zcashunifiedaddress_free(ptr, 0);
|
|
6242
|
+
}
|
|
6243
|
+
/**
|
|
6244
|
+
* Whether `candidate` (another Unified Address, or a transparent Zcash address
|
|
6245
|
+
* on the same network) is a receiver of this Unified Address.
|
|
6246
|
+
* @param {string} candidate
|
|
6247
|
+
* @returns {boolean}
|
|
6248
|
+
*/
|
|
6249
|
+
contains(candidate) {
|
|
6250
|
+
try {
|
|
6251
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
6252
|
+
const ptr0 = passStringToWasm0(candidate, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
6253
|
+
const len0 = WASM_VECTOR_LEN;
|
|
6254
|
+
wasm.zcashunifiedaddress_contains(retptr, this.__wbg_ptr, ptr0, len0);
|
|
6255
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
6256
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
6257
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
6258
|
+
if (r2) {
|
|
6259
|
+
throw takeObject(r1);
|
|
6260
|
+
}
|
|
6261
|
+
return r0 !== 0;
|
|
6262
|
+
} finally {
|
|
6263
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
6264
|
+
}
|
|
6265
|
+
}
|
|
6266
|
+
/**
|
|
6267
|
+
* The Orchard/Ironwood receiver's raw 43 bytes (diversifier + pk_d), or `undefined`.
|
|
6268
|
+
* @returns {Uint8Array | undefined}
|
|
6269
|
+
*/
|
|
6270
|
+
get orchardReceiver() {
|
|
6271
|
+
try {
|
|
6272
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
6273
|
+
wasm.zcashunifiedaddress_orchardReceiver(retptr, this.__wbg_ptr);
|
|
6274
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
6275
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
6276
|
+
let v1;
|
|
6277
|
+
if (r0 !== 0) {
|
|
6278
|
+
v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
6279
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
6280
|
+
}
|
|
6281
|
+
return v1;
|
|
6282
|
+
} finally {
|
|
6283
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
6284
|
+
}
|
|
6285
|
+
}
|
|
6286
|
+
/**
|
|
6287
|
+
* Parse a Unified Address for `network` ("zcash"/"zec" or "zcashTest"/"tzec").
|
|
6288
|
+
*
|
|
6289
|
+
* All receiver components are resolved and validated eagerly, so the accessors
|
|
6290
|
+
* below are infallible. Throws if the address is malformed or on the wrong network.
|
|
6291
|
+
* @param {string} address
|
|
6292
|
+
* @param {string} network
|
|
6293
|
+
* @returns {ZcashUnifiedAddress}
|
|
6294
|
+
*/
|
|
6295
|
+
static parse(address, network) {
|
|
6296
|
+
try {
|
|
6297
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
6298
|
+
const ptr0 = passStringToWasm0(address, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
6299
|
+
const len0 = WASM_VECTOR_LEN;
|
|
6300
|
+
const ptr1 = passStringToWasm0(network, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
6301
|
+
const len1 = WASM_VECTOR_LEN;
|
|
6302
|
+
wasm.zcashunifiedaddress_parse(retptr, ptr0, len0, ptr1, len1);
|
|
6303
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
6304
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
6305
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
6306
|
+
if (r2) {
|
|
6307
|
+
throw takeObject(r1);
|
|
6308
|
+
}
|
|
6309
|
+
return ZcashUnifiedAddress.__wrap(r0);
|
|
6310
|
+
} finally {
|
|
6311
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
6312
|
+
}
|
|
6313
|
+
}
|
|
6314
|
+
/**
|
|
6315
|
+
* The Sapling receiver's raw 43 bytes (diversifier + pk_d), or `undefined`.
|
|
6316
|
+
* @returns {Uint8Array | undefined}
|
|
6317
|
+
*/
|
|
6318
|
+
get saplingReceiver() {
|
|
6319
|
+
try {
|
|
6320
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
6321
|
+
wasm.zcashunifiedaddress_saplingReceiver(retptr, this.__wbg_ptr);
|
|
6322
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
6323
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
6324
|
+
let v1;
|
|
6325
|
+
if (r0 !== 0) {
|
|
6326
|
+
v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
6327
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
6328
|
+
}
|
|
6329
|
+
return v1;
|
|
6330
|
+
} finally {
|
|
6331
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
6332
|
+
}
|
|
6333
|
+
}
|
|
6334
|
+
/**
|
|
6335
|
+
* The transparent receiver as scriptPubKey bytes (P2PKH/P2SH), or `undefined`.
|
|
6336
|
+
* @returns {Uint8Array | undefined}
|
|
6337
|
+
*/
|
|
6338
|
+
get transparentScript() {
|
|
6339
|
+
try {
|
|
6340
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
6341
|
+
wasm.zcashunifiedaddress_transparentScript(retptr, this.__wbg_ptr);
|
|
6342
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
6343
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
6344
|
+
let v1;
|
|
6345
|
+
if (r0 !== 0) {
|
|
6346
|
+
v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
6347
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
6348
|
+
}
|
|
6349
|
+
return v1;
|
|
6350
|
+
} finally {
|
|
6351
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
6352
|
+
}
|
|
6353
|
+
}
|
|
6354
|
+
}
|
|
6355
|
+
if (Symbol.dispose) ZcashUnifiedAddress.prototype[Symbol.dispose] = ZcashUnifiedAddress.prototype.free;
|
|
6356
|
+
exports.ZcashUnifiedAddress = ZcashUnifiedAddress;
|
|
6357
|
+
|
|
6358
|
+
/**
|
|
6359
|
+
* A parsed Zcash v6 (Ironwood / NU6.3) transaction — for inspection and txid.
|
|
6360
|
+
*
|
|
6361
|
+
* This wraps the raw v6 wire codec. The transaction id is exposed as an instance
|
|
6362
|
+
* method [`ZcashV6Transaction::get_id`] (canonical display-order hex), matching the
|
|
6363
|
+
* `getId()` convention used by the other transaction/PSBT wrappers, so callers never
|
|
6364
|
+
* pass raw bytes to a txid function or juggle internal vs display byte order.
|
|
6365
|
+
*/
|
|
6366
|
+
class ZcashV6Transaction {
|
|
6367
|
+
static __wrap(ptr) {
|
|
6368
|
+
ptr = ptr >>> 0;
|
|
6369
|
+
const obj = Object.create(ZcashV6Transaction.prototype);
|
|
6370
|
+
obj.__wbg_ptr = ptr;
|
|
6371
|
+
ZcashV6TransactionFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
6372
|
+
return obj;
|
|
6373
|
+
}
|
|
6374
|
+
__destroy_into_raw() {
|
|
6375
|
+
const ptr = this.__wbg_ptr;
|
|
6376
|
+
this.__wbg_ptr = 0;
|
|
6377
|
+
ZcashV6TransactionFinalization.unregister(this);
|
|
6378
|
+
return ptr;
|
|
6379
|
+
}
|
|
6380
|
+
free() {
|
|
6381
|
+
const ptr = this.__destroy_into_raw();
|
|
6382
|
+
wasm.__wbg_zcashv6transaction_free(ptr, 0);
|
|
6383
|
+
}
|
|
6384
|
+
/**
|
|
6385
|
+
* Consensus branch id carried in the v6 header.
|
|
6386
|
+
* @returns {number}
|
|
6387
|
+
*/
|
|
6388
|
+
get consensusBranchId() {
|
|
6389
|
+
const ret = wasm.zcashv6transaction_consensusBranchId(this.__wbg_ptr);
|
|
6390
|
+
return ret >>> 0;
|
|
6391
|
+
}
|
|
6392
|
+
/**
|
|
6393
|
+
* Expiry height.
|
|
6394
|
+
* @returns {number}
|
|
6395
|
+
*/
|
|
6396
|
+
get expiryHeight() {
|
|
6397
|
+
const ret = wasm.zcashv6transaction_expiryHeight(this.__wbg_ptr);
|
|
6398
|
+
return ret >>> 0;
|
|
6399
|
+
}
|
|
6400
|
+
/**
|
|
6401
|
+
* Decode a v6 transaction from raw wire bytes. Throws if the bytes are not a
|
|
6402
|
+
* valid v6 (Ironwood) transaction.
|
|
6403
|
+
* @param {Uint8Array} bytes
|
|
6404
|
+
* @returns {ZcashV6Transaction}
|
|
6405
|
+
*/
|
|
6406
|
+
static fromBytes(bytes) {
|
|
6407
|
+
try {
|
|
6408
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
6409
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_export);
|
|
6410
|
+
const len0 = WASM_VECTOR_LEN;
|
|
6411
|
+
wasm.zcashv6transaction_fromBytes(retptr, ptr0, len0);
|
|
6412
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
6413
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
6414
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
6415
|
+
if (r2) {
|
|
6416
|
+
throw takeObject(r1);
|
|
6417
|
+
}
|
|
6418
|
+
return ZcashV6Transaction.__wrap(r0);
|
|
6419
|
+
} finally {
|
|
6420
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
6421
|
+
}
|
|
6422
|
+
}
|
|
6423
|
+
/**
|
|
6424
|
+
* The canonical (display-order) ZIP-244 txid as a lowercase hex string.
|
|
6425
|
+
*
|
|
6426
|
+
* `Txid`'s `Display` emits display-order (byte-reversed) hex, matching how a
|
|
6427
|
+
* transaction id is printed everywhere else in the codebase.
|
|
6428
|
+
* @returns {string}
|
|
6429
|
+
*/
|
|
6430
|
+
getId() {
|
|
6431
|
+
let deferred1_0;
|
|
6432
|
+
let deferred1_1;
|
|
6433
|
+
try {
|
|
6434
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
6435
|
+
wasm.zcashv6transaction_getId(retptr, this.__wbg_ptr);
|
|
6436
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
6437
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
6438
|
+
deferred1_0 = r0;
|
|
6439
|
+
deferred1_1 = r1;
|
|
6440
|
+
return getStringFromWasm0(r0, r1);
|
|
6441
|
+
} finally {
|
|
6442
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
6443
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
6444
|
+
}
|
|
6445
|
+
}
|
|
6446
|
+
/**
|
|
6447
|
+
* Number of Ironwood actions (0 when the Ironwood slot is empty).
|
|
6448
|
+
* @returns {number}
|
|
6449
|
+
*/
|
|
6450
|
+
get ironwoodActionCount() {
|
|
6451
|
+
const ret = wasm.zcashv6transaction_ironwoodActionCount(this.__wbg_ptr);
|
|
6452
|
+
return ret >>> 0;
|
|
6453
|
+
}
|
|
6454
|
+
/**
|
|
6455
|
+
* The Ironwood note-commitment tree anchor (32 bytes), or `undefined`.
|
|
6456
|
+
* @returns {Uint8Array | undefined}
|
|
6457
|
+
*/
|
|
6458
|
+
get ironwoodAnchor() {
|
|
6459
|
+
try {
|
|
6460
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
6461
|
+
wasm.zcashv6transaction_ironwoodAnchor(retptr, this.__wbg_ptr);
|
|
6462
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
6463
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
6464
|
+
let v1;
|
|
6465
|
+
if (r0 !== 0) {
|
|
6466
|
+
v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
6467
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
6468
|
+
}
|
|
6469
|
+
return v1;
|
|
6470
|
+
} finally {
|
|
6471
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
6472
|
+
}
|
|
6473
|
+
}
|
|
6474
|
+
/**
|
|
6475
|
+
* The Ironwood bundle flag byte, or `undefined` when there is no bundle.
|
|
6476
|
+
* @returns {number | undefined}
|
|
6477
|
+
*/
|
|
6478
|
+
get ironwoodFlags() {
|
|
6479
|
+
const ret = wasm.zcashv6transaction_ironwoodFlags(this.__wbg_ptr);
|
|
6480
|
+
return ret === 0xFFFFFF ? undefined : ret;
|
|
6481
|
+
}
|
|
6482
|
+
/**
|
|
6483
|
+
* Net value crossing the Ironwood pool boundary (0 when there is no bundle).
|
|
6484
|
+
* @returns {bigint}
|
|
6485
|
+
*/
|
|
6486
|
+
get ironwoodValueBalance() {
|
|
6487
|
+
const ret = wasm.zcashv6transaction_ironwoodValueBalance(this.__wbg_ptr);
|
|
6488
|
+
return ret;
|
|
6489
|
+
}
|
|
6490
|
+
/**
|
|
6491
|
+
* Serialize back to raw v6 wire bytes.
|
|
6492
|
+
* @returns {Uint8Array}
|
|
6493
|
+
*/
|
|
6494
|
+
toBytes() {
|
|
6495
|
+
try {
|
|
6496
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
6497
|
+
wasm.zcashv6transaction_toBytes(retptr, this.__wbg_ptr);
|
|
6498
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
6499
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
6500
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
6501
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
6502
|
+
if (r3) {
|
|
6503
|
+
throw takeObject(r2);
|
|
6504
|
+
}
|
|
6505
|
+
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
6506
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
6507
|
+
return v1;
|
|
6508
|
+
} finally {
|
|
6509
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
6510
|
+
}
|
|
6511
|
+
}
|
|
6512
|
+
/**
|
|
6513
|
+
* The ZIP-244 txid in internal (non-reversed) byte order.
|
|
6514
|
+
* @returns {Uint8Array}
|
|
6515
|
+
*/
|
|
6516
|
+
txidBytes() {
|
|
6517
|
+
try {
|
|
6518
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
6519
|
+
wasm.zcashv6transaction_txidBytes(retptr, this.__wbg_ptr);
|
|
6520
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
6521
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
6522
|
+
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
6523
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
6524
|
+
return v1;
|
|
6525
|
+
} finally {
|
|
6526
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
6527
|
+
}
|
|
6528
|
+
}
|
|
6529
|
+
}
|
|
6530
|
+
if (Symbol.dispose) ZcashV6Transaction.prototype[Symbol.dispose] = ZcashV6Transaction.prototype.free;
|
|
6531
|
+
exports.ZcashV6Transaction = ZcashV6Transaction;
|
|
6532
|
+
|
|
6218
6533
|
/**
|
|
6219
6534
|
* Check if the inspect feature is enabled.
|
|
6220
6535
|
*
|
|
@@ -6390,6 +6705,9 @@ exports.parseTxToJson = parseTxToJson;
|
|
|
6390
6705
|
* `network`: "zcash" / "zec" for mainnet, "zcashTest" / "tzec" for testnet.
|
|
6391
6706
|
* Returns `None` if `height` is before Overwinter activation.
|
|
6392
6707
|
* Throws if `network` is not a recognised Zcash network name.
|
|
6708
|
+
*
|
|
6709
|
+
* Errors are thrown as the crate-standard [`WasmUtxoError`] (a marked `js_sys::Error`
|
|
6710
|
+
* with `.message` and `.code`), not a bare string.
|
|
6393
6711
|
* @param {string} network
|
|
6394
6712
|
* @param {number} height
|
|
6395
6713
|
* @returns {number | undefined}
|
|
@@ -6712,6 +7030,12 @@ const WrapMiniscriptFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
|
6712
7030
|
const WrapPsbtFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
6713
7031
|
? { register: () => {}, unregister: () => {} }
|
|
6714
7032
|
: new FinalizationRegistry(ptr => wasm.__wbg_wrappsbt_free(ptr >>> 0, 1));
|
|
7033
|
+
const ZcashUnifiedAddressFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
7034
|
+
? { register: () => {}, unregister: () => {} }
|
|
7035
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_zcashunifiedaddress_free(ptr >>> 0, 1));
|
|
7036
|
+
const ZcashV6TransactionFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
7037
|
+
? { register: () => {}, unregister: () => {} }
|
|
7038
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_zcashv6transaction_free(ptr >>> 0, 1));
|
|
6715
7039
|
|
|
6716
7040
|
function addHeapObject(obj) {
|
|
6717
7041
|
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
Binary file
|
|
@@ -1,26 +1,16 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
-
export const __wbg_addressnamespace_free: (a: number, b: number) => void;
|
|
5
4
|
export const __wbg_inscriptionsnamespace_free: (a: number, b: number) => void;
|
|
6
|
-
export const __wbg_messagenamespace_free: (a: number, b: number) => void;
|
|
7
|
-
export const __wbg_utxolibcompatnamespace_free: (a: number, b: number) => void;
|
|
8
5
|
export const __wbg_wasmdashtransaction_free: (a: number, b: number) => void;
|
|
9
|
-
export const
|
|
6
|
+
export const __wbg_wasmecpair_free: (a: number, b: number) => void;
|
|
10
7
|
export const __wbg_wasmtransaction_free: (a: number, b: number) => void;
|
|
11
|
-
export const __wbg_wasmutxonamespace_free: (a: number, b: number) => void;
|
|
12
8
|
export const __wbg_wasmzcashtransaction_free: (a: number, b: number) => void;
|
|
13
9
|
export const __wbg_wrappsbt_free: (a: number, b: number) => void;
|
|
14
|
-
export const
|
|
15
|
-
export const
|
|
10
|
+
export const __wbg_zcashunifiedaddress_free: (a: number, b: number) => void;
|
|
11
|
+
export const __wbg_zcashv6transaction_free: (a: number, b: number) => void;
|
|
16
12
|
export const inscriptionsnamespace_create_inscription_reveal_data: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
17
13
|
export const inscriptionsnamespace_sign_reveal_transaction: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: bigint) => void;
|
|
18
|
-
export const isInspectEnabled: () => number;
|
|
19
|
-
export const messagenamespace_sign_message: (a: number, b: number, c: number, d: number) => void;
|
|
20
|
-
export const messagenamespace_verify_message: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
21
|
-
export const parsePsbtRawToJson: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
22
|
-
export const utxolibcompatnamespace_from_output_script: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
23
|
-
export const utxolibcompatnamespace_to_output_script: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
24
14
|
export const wasmdashtransaction_from_bytes: (a: number, b: number, c: number) => void;
|
|
25
15
|
export const wasmdashtransaction_get_inputs: (a: number, b: number) => void;
|
|
26
16
|
export const wasmdashtransaction_get_outputs: (a: number, b: number) => void;
|
|
@@ -31,21 +21,16 @@ export const wasmdashtransaction_lock_time: (a: number) => number;
|
|
|
31
21
|
export const wasmdashtransaction_output_count: (a: number) => number;
|
|
32
22
|
export const wasmdashtransaction_to_bytes: (a: number, b: number) => void;
|
|
33
23
|
export const wasmdashtransaction_version: (a: number) => number;
|
|
34
|
-
export const
|
|
35
|
-
export const
|
|
36
|
-
export const
|
|
37
|
-
export const
|
|
38
|
-
export const
|
|
39
|
-
export const
|
|
40
|
-
export const
|
|
41
|
-
export const
|
|
42
|
-
export const
|
|
43
|
-
export const
|
|
44
|
-
export const wasmdimensions_get_vsize: (a: number, b: number, c: number) => number;
|
|
45
|
-
export const wasmdimensions_get_weight: (a: number, b: number, c: number) => number;
|
|
46
|
-
export const wasmdimensions_has_segwit: (a: number) => number;
|
|
47
|
-
export const wasmdimensions_plus: (a: number, b: number) => number;
|
|
48
|
-
export const wasmdimensions_times: (a: number, b: number) => number;
|
|
24
|
+
export const wasmecpair_from_private_key: (a: number, b: number, c: number) => void;
|
|
25
|
+
export const wasmecpair_from_public_key: (a: number, b: number, c: number) => void;
|
|
26
|
+
export const wasmecpair_from_wif: (a: number, b: number, c: number) => void;
|
|
27
|
+
export const wasmecpair_from_wif_mainnet: (a: number, b: number, c: number) => void;
|
|
28
|
+
export const wasmecpair_from_wif_testnet: (a: number, b: number, c: number) => void;
|
|
29
|
+
export const wasmecpair_private_key: (a: number) => number;
|
|
30
|
+
export const wasmecpair_public_key: (a: number) => number;
|
|
31
|
+
export const wasmecpair_to_wif: (a: number, b: number) => void;
|
|
32
|
+
export const wasmecpair_to_wif_mainnet: (a: number, b: number) => void;
|
|
33
|
+
export const wasmecpair_to_wif_testnet: (a: number, b: number) => void;
|
|
49
34
|
export const wasmtransaction_add_input: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
50
35
|
export const wasmtransaction_add_input_at_index: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
51
36
|
export const wasmtransaction_add_output: (a: number, b: number, c: number, d: bigint) => number;
|
|
@@ -58,7 +43,6 @@ export const wasmtransaction_get_outputs_with_address: (a: number, b: number, c:
|
|
|
58
43
|
export const wasmtransaction_get_txid: (a: number, b: number) => void;
|
|
59
44
|
export const wasmtransaction_get_vsize: (a: number) => number;
|
|
60
45
|
export const wasmtransaction_to_bytes: (a: number, b: number) => void;
|
|
61
|
-
export const wasmutxonamespace_get_wasm_utxo_version: (a: number) => void;
|
|
62
46
|
export const wasmzcashtransaction_from_bytes: (a: number, b: number, c: number) => void;
|
|
63
47
|
export const wasmzcashtransaction_get_inputs: (a: number, b: number) => void;
|
|
64
48
|
export const wasmzcashtransaction_get_outputs: (a: number, b: number) => void;
|
|
@@ -108,12 +92,26 @@ export const wrappsbt_update_input_with_descriptor: (a: number, b: number, c: nu
|
|
|
108
92
|
export const wrappsbt_update_output_with_descriptor: (a: number, b: number, c: number, d: number) => void;
|
|
109
93
|
export const wrappsbt_validate_signature_at_input: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
110
94
|
export const wrappsbt_verify_signature_with_key: (a: number, b: number, c: number, d: number) => void;
|
|
95
|
+
export const zcash_branch_id_for_height: (a: number, b: number, c: number, d: number) => void;
|
|
96
|
+
export const zcashunifiedaddress_contains: (a: number, b: number, c: number, d: number) => void;
|
|
97
|
+
export const zcashunifiedaddress_orchardReceiver: (a: number, b: number) => void;
|
|
98
|
+
export const zcashunifiedaddress_parse: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
99
|
+
export const zcashunifiedaddress_saplingReceiver: (a: number, b: number) => void;
|
|
100
|
+
export const zcashunifiedaddress_transparentScript: (a: number, b: number) => void;
|
|
101
|
+
export const zcashv6transaction_consensusBranchId: (a: number) => number;
|
|
102
|
+
export const zcashv6transaction_expiryHeight: (a: number) => number;
|
|
103
|
+
export const zcashv6transaction_fromBytes: (a: number, b: number, c: number) => void;
|
|
104
|
+
export const zcashv6transaction_getId: (a: number, b: number) => void;
|
|
105
|
+
export const zcashv6transaction_ironwoodActionCount: (a: number) => number;
|
|
106
|
+
export const zcashv6transaction_ironwoodAnchor: (a: number, b: number) => void;
|
|
107
|
+
export const zcashv6transaction_ironwoodFlags: (a: number) => number;
|
|
108
|
+
export const zcashv6transaction_ironwoodValueBalance: (a: number) => bigint;
|
|
109
|
+
export const zcashv6transaction_toBytes: (a: number, b: number) => void;
|
|
110
|
+
export const zcashv6transaction_txidBytes: (a: number, b: number) => void;
|
|
111
111
|
export const wasmtransaction_input_count: (a: number) => number;
|
|
112
112
|
export const wasmtransaction_output_count: (a: number) => number;
|
|
113
113
|
export const wasmzcashtransaction_input_count: (a: number) => number;
|
|
114
114
|
export const wasmzcashtransaction_output_count: (a: number) => number;
|
|
115
|
-
export const parsePsbtToJson: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
116
|
-
export const parseTxToJson: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
117
115
|
export const wasmtransaction_lock_time: (a: number) => number;
|
|
118
116
|
export const wasmtransaction_version: (a: number) => number;
|
|
119
117
|
export const wasmzcashtransaction_lock_time: (a: number) => number;
|
|
@@ -145,8 +143,8 @@ export const wrapminiscript_toString: (a: number, b: number) => void;
|
|
|
145
143
|
export const __wbg_bip322namespace_free: (a: number, b: number) => void;
|
|
146
144
|
export const __wbg_bitgopsbt_free: (a: number, b: number) => void;
|
|
147
145
|
export const __wbg_fixedscriptwalletnamespace_free: (a: number, b: number) => void;
|
|
146
|
+
export const __wbg_messagenamespace_free: (a: number, b: number) => void;
|
|
148
147
|
export const __wbg_wasmbip32_free: (a: number, b: number) => void;
|
|
149
|
-
export const __wbg_wasmecpair_free: (a: number, b: number) => void;
|
|
150
148
|
export const __wbg_wasmreplayprotection_free: (a: number, b: number) => void;
|
|
151
149
|
export const __wbg_wasmrootwalletkeys_free: (a: number, b: number) => void;
|
|
152
150
|
export const bip322namespace_add_bip322_input: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number) => void;
|
|
@@ -238,6 +236,8 @@ export const fixedscriptwalletnamespace_output_script_with_network_str: (a: numb
|
|
|
238
236
|
export const fixedscriptwalletnamespace_p2sh_p2pk_output_script: (a: number, b: number, c: number) => void;
|
|
239
237
|
export const fixedscriptwalletnamespace_supports_script_type: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
240
238
|
export const fixedscriptwalletnamespace_to_wallet_keys: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
239
|
+
export const messagenamespace_sign_message: (a: number, b: number, c: number, d: number) => void;
|
|
240
|
+
export const messagenamespace_verify_message: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
241
241
|
export const wasmbip32_chain_code: (a: number) => number;
|
|
242
242
|
export const wasmbip32_depth: (a: number) => number;
|
|
243
243
|
export const wasmbip32_derive: (a: number, b: number, c: number) => void;
|
|
@@ -260,16 +260,6 @@ export const wasmbip32_private_key: (a: number) => number;
|
|
|
260
260
|
export const wasmbip32_public_key: (a: number) => number;
|
|
261
261
|
export const wasmbip32_to_base58: (a: number, b: number) => void;
|
|
262
262
|
export const wasmbip32_to_wif: (a: number, b: number) => void;
|
|
263
|
-
export const wasmecpair_from_private_key: (a: number, b: number, c: number) => void;
|
|
264
|
-
export const wasmecpair_from_public_key: (a: number, b: number, c: number) => void;
|
|
265
|
-
export const wasmecpair_from_wif: (a: number, b: number, c: number) => void;
|
|
266
|
-
export const wasmecpair_from_wif_mainnet: (a: number, b: number, c: number) => void;
|
|
267
|
-
export const wasmecpair_from_wif_testnet: (a: number, b: number, c: number) => void;
|
|
268
|
-
export const wasmecpair_private_key: (a: number) => number;
|
|
269
|
-
export const wasmecpair_public_key: (a: number) => number;
|
|
270
|
-
export const wasmecpair_to_wif: (a: number, b: number) => void;
|
|
271
|
-
export const wasmecpair_to_wif_mainnet: (a: number, b: number) => void;
|
|
272
|
-
export const wasmecpair_to_wif_testnet: (a: number, b: number) => void;
|
|
273
263
|
export const wasmreplayprotection_from_addresses: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
274
264
|
export const wasmreplayprotection_from_output_scripts: (a: number, b: number) => number;
|
|
275
265
|
export const wasmreplayprotection_from_public_keys: (a: number, b: number, c: number) => void;
|
|
@@ -278,11 +268,38 @@ export const wasmrootwalletkeys_bitgo_key: (a: number) => number;
|
|
|
278
268
|
export const wasmrootwalletkeys_new: (a: number, b: number, c: number, d: number) => void;
|
|
279
269
|
export const wasmrootwalletkeys_user_key: (a: number) => number;
|
|
280
270
|
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;
|
|
281
|
-
export const zcash_branch_id_for_height: (a: number, b: number, c: number, d: number) => void;
|
|
282
271
|
export const wasmbip32_from_bip32_properties: (a: number, b: number) => void;
|
|
272
|
+
export const bitgopsbt_sign_replay_protection_inputs: (a: number, b: number, c: number) => void;
|
|
283
273
|
export const bitgopsbt_sign_wallet_input: (a: number, b: number, c: number, d: number) => void;
|
|
284
274
|
export const bitgopsbt_sign_all_with_xpriv: (a: number, b: number, c: number) => void;
|
|
285
|
-
export const
|
|
275
|
+
export const __wbg_addressnamespace_free: (a: number, b: number) => void;
|
|
276
|
+
export const __wbg_utxolibcompatnamespace_free: (a: number, b: number) => void;
|
|
277
|
+
export const __wbg_wasmdimensions_free: (a: number, b: number) => void;
|
|
278
|
+
export const __wbg_wasmutxonamespace_free: (a: number, b: number) => void;
|
|
279
|
+
export const addressnamespace_from_output_script_with_coin: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
280
|
+
export const addressnamespace_to_output_script_with_coin: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
281
|
+
export const isInspectEnabled: () => number;
|
|
282
|
+
export const parsePsbtRawToJson: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
283
|
+
export const utxolibcompatnamespace_from_output_script: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
284
|
+
export const utxolibcompatnamespace_to_output_script: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
285
|
+
export const wasmdimensions_empty: () => number;
|
|
286
|
+
export const wasmdimensions_from_input: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
287
|
+
export const wasmdimensions_from_input_script_type: (a: number, b: number, c: number, d: number) => void;
|
|
288
|
+
export const wasmdimensions_from_output_script_length: (a: number) => number;
|
|
289
|
+
export const wasmdimensions_from_output_script_type: (a: number, b: number, c: number) => void;
|
|
290
|
+
export const wasmdimensions_from_psbt: (a: number, b: number) => void;
|
|
291
|
+
export const wasmdimensions_get_input_vsize: (a: number, b: number, c: number) => number;
|
|
292
|
+
export const wasmdimensions_get_input_weight: (a: number, b: number, c: number) => number;
|
|
293
|
+
export const wasmdimensions_get_output_vsize: (a: number) => number;
|
|
294
|
+
export const wasmdimensions_get_output_weight: (a: number) => number;
|
|
295
|
+
export const wasmdimensions_get_vsize: (a: number, b: number, c: number) => number;
|
|
296
|
+
export const wasmdimensions_get_weight: (a: number, b: number, c: number) => number;
|
|
297
|
+
export const wasmdimensions_has_segwit: (a: number) => number;
|
|
298
|
+
export const wasmdimensions_plus: (a: number, b: number) => number;
|
|
299
|
+
export const wasmdimensions_times: (a: number, b: number) => number;
|
|
300
|
+
export const wasmutxonamespace_get_wasm_utxo_version: (a: number) => void;
|
|
301
|
+
export const parsePsbtToJson: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
302
|
+
export const parseTxToJson: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
286
303
|
export const rustsecp256k1_v0_10_0_context_create: (a: number) => number;
|
|
287
304
|
export const rustsecp256k1_v0_10_0_context_destroy: (a: number) => void;
|
|
288
305
|
export const rustsecp256k1_v0_10_0_default_error_callback_fn: (a: number, b: number) => void;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { ZcashUnifiedAddress as WasmZcashUnifiedAddress } from "../wasm/wasm_utxo.js";
|
|
2
|
+
import type { ZcashNetworkName } from "./ZcashBitGoPsbt.js";
|
|
3
|
+
/**
|
|
4
|
+
* A parsed ZIP-316 Unified Address.
|
|
5
|
+
*
|
|
6
|
+
* Decode once with {@link ZcashUnifiedAddress.parse}, then read each component
|
|
7
|
+
* through its accessor (returns `undefined` when the receiver is absent). Membership
|
|
8
|
+
* of another address is answered by {@link contains}.
|
|
9
|
+
*
|
|
10
|
+
* Ironwood reuses the Orchard receiver, so {@link orchardReceiver} is the shielded
|
|
11
|
+
* receiver used to construct an Ironwood output note.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```typescript
|
|
15
|
+
* const ua = ZcashUnifiedAddress.parse(uaString, "zec");
|
|
16
|
+
* const ironwood = ua.orchardReceiver; // 43 bytes, or undefined
|
|
17
|
+
* const script = ua.transparentScript; // scriptPubKey bytes, or undefined
|
|
18
|
+
* ua.contains(transparentAddress); // is it one of this UA's receivers?
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export declare class ZcashUnifiedAddress {
|
|
22
|
+
private _wasm;
|
|
23
|
+
private constructor();
|
|
24
|
+
/**
|
|
25
|
+
* Parse a Unified Address.
|
|
26
|
+
*
|
|
27
|
+
* @param address - The Bech32m unified address string
|
|
28
|
+
* @param network - Zcash network name ("zcash", "zcashTest", "zec", "tzec")
|
|
29
|
+
* @throws If the address is malformed or on the wrong network
|
|
30
|
+
*/
|
|
31
|
+
static parse(address: string, network: ZcashNetworkName): ZcashUnifiedAddress;
|
|
32
|
+
/**
|
|
33
|
+
* The Orchard (a.k.a. Ironwood) receiver — 43 raw bytes (11-byte diversifier +
|
|
34
|
+
* 32-byte pk_d) — or `undefined` if the UA has no Orchard receiver.
|
|
35
|
+
*/
|
|
36
|
+
get orchardReceiver(): Uint8Array | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* The Sapling receiver — 43 raw bytes (diversifier + pk_d) — or `undefined`.
|
|
39
|
+
*/
|
|
40
|
+
get saplingReceiver(): Uint8Array | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* The transparent receiver as scriptPubKey bytes (P2PKH or P2SH), ready to use as
|
|
43
|
+
* a `TxOut.scriptPubKey`, or `undefined` if the UA has no transparent receiver.
|
|
44
|
+
*/
|
|
45
|
+
get transparentScript(): Uint8Array | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* Whether `candidate` is a receiver of this unified address.
|
|
48
|
+
*
|
|
49
|
+
* @param candidate - Another Unified Address (matches if all of its receivers are
|
|
50
|
+
* contained here) or a transparent Zcash address (matches this UA's transparent
|
|
51
|
+
* receiver). Must be on the same network as this UA.
|
|
52
|
+
* @throws If `candidate` is malformed or on the wrong network
|
|
53
|
+
*/
|
|
54
|
+
contains(candidate: string): boolean;
|
|
55
|
+
/** @internal */
|
|
56
|
+
get wasm(): WasmZcashUnifiedAddress;
|
|
57
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { ZcashUnifiedAddress as WasmZcashUnifiedAddress } from "../wasm/wasm_utxo.js";
|
|
2
|
+
/**
|
|
3
|
+
* A parsed ZIP-316 Unified Address.
|
|
4
|
+
*
|
|
5
|
+
* Decode once with {@link ZcashUnifiedAddress.parse}, then read each component
|
|
6
|
+
* through its accessor (returns `undefined` when the receiver is absent). Membership
|
|
7
|
+
* of another address is answered by {@link contains}.
|
|
8
|
+
*
|
|
9
|
+
* Ironwood reuses the Orchard receiver, so {@link orchardReceiver} is the shielded
|
|
10
|
+
* receiver used to construct an Ironwood output note.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```typescript
|
|
14
|
+
* const ua = ZcashUnifiedAddress.parse(uaString, "zec");
|
|
15
|
+
* const ironwood = ua.orchardReceiver; // 43 bytes, or undefined
|
|
16
|
+
* const script = ua.transparentScript; // scriptPubKey bytes, or undefined
|
|
17
|
+
* ua.contains(transparentAddress); // is it one of this UA's receivers?
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export class ZcashUnifiedAddress {
|
|
21
|
+
_wasm;
|
|
22
|
+
constructor(_wasm) {
|
|
23
|
+
this._wasm = _wasm;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Parse a Unified Address.
|
|
27
|
+
*
|
|
28
|
+
* @param address - The Bech32m unified address string
|
|
29
|
+
* @param network - Zcash network name ("zcash", "zcashTest", "zec", "tzec")
|
|
30
|
+
* @throws If the address is malformed or on the wrong network
|
|
31
|
+
*/
|
|
32
|
+
static parse(address, network) {
|
|
33
|
+
return new ZcashUnifiedAddress(WasmZcashUnifiedAddress.parse(address, network));
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* The Orchard (a.k.a. Ironwood) receiver — 43 raw bytes (11-byte diversifier +
|
|
37
|
+
* 32-byte pk_d) — or `undefined` if the UA has no Orchard receiver.
|
|
38
|
+
*/
|
|
39
|
+
get orchardReceiver() {
|
|
40
|
+
return this._wasm.orchardReceiver;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* The Sapling receiver — 43 raw bytes (diversifier + pk_d) — or `undefined`.
|
|
44
|
+
*/
|
|
45
|
+
get saplingReceiver() {
|
|
46
|
+
return this._wasm.saplingReceiver;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* The transparent receiver as scriptPubKey bytes (P2PKH or P2SH), ready to use as
|
|
50
|
+
* a `TxOut.scriptPubKey`, or `undefined` if the UA has no transparent receiver.
|
|
51
|
+
*/
|
|
52
|
+
get transparentScript() {
|
|
53
|
+
return this._wasm.transparentScript;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Whether `candidate` is a receiver of this unified address.
|
|
57
|
+
*
|
|
58
|
+
* @param candidate - Another Unified Address (matches if all of its receivers are
|
|
59
|
+
* contained here) or a transparent Zcash address (matches this UA's transparent
|
|
60
|
+
* receiver). Must be on the same network as this UA.
|
|
61
|
+
* @throws If `candidate` is malformed or on the wrong network
|
|
62
|
+
*/
|
|
63
|
+
contains(candidate) {
|
|
64
|
+
return this._wasm.contains(candidate);
|
|
65
|
+
}
|
|
66
|
+
/** @internal */
|
|
67
|
+
get wasm() {
|
|
68
|
+
return this._wasm;
|
|
69
|
+
}
|
|
70
|
+
}
|