@bitgo/wasm-utxo 4.11.1 → 4.13.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.
@@ -55,6 +55,8 @@ type Miniscript = Wrap<{
55
55
  older: number;
56
56
  }> | Wrap<{
57
57
  after: number;
58
+ }> | Wrap<{
59
+ payload_drop: string;
58
60
  }>;
59
61
  type TapTree = [TapTree, TapTree] | Miniscript;
60
62
  type Descriptor = {
@@ -105,6 +105,8 @@ function fromUnknown(v) {
105
105
  return node("multi", value);
106
106
  case "MultiA":
107
107
  return node("multi_a", value);
108
+ case "PayloadDrop":
109
+ return node("payload_drop", value);
108
110
  case "Tree":
109
111
  if (!Array.isArray(value) || value.length !== 2) {
110
112
  throw new Error(`Invalid Tree node: ${JSON.stringify(value)}`);
@@ -48,6 +48,8 @@ declare module "./wasm/wasm_utxo.js" {
48
48
  namespace WrapMiniscript {
49
49
  function fromString(miniscript: string, ctx: ScriptContext): WrapMiniscript;
50
50
  function fromBitcoinScript(script: Uint8Array, ctx: ScriptContext): WrapMiniscript;
51
+ function fromStringExt(miniscript: string, ctx: ScriptContext, extParams?: ExtParamsConfig): WrapMiniscript;
52
+ function fromBitcoinScriptExt(script: Uint8Array, ctx: ScriptContext, extParams?: ExtParamsConfig): WrapMiniscript;
51
53
  }
52
54
  /** BIP32 derivation data from a PSBT */
53
55
  interface PsbtBip32Derivation {
@@ -5091,6 +5091,31 @@ class WrapMiniscript {
5091
5091
  wasm.__wbindgen_add_to_stack_pointer(16);
5092
5092
  }
5093
5093
  }
5094
+ /**
5095
+ * @param {Uint8Array} script
5096
+ * @param {string} context_type
5097
+ * @param {any} ext_params_config
5098
+ * @returns {WrapMiniscript}
5099
+ */
5100
+ static fromBitcoinScriptExt(script, context_type, ext_params_config) {
5101
+ try {
5102
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
5103
+ const ptr0 = passArray8ToWasm0(script, wasm.__wbindgen_export);
5104
+ const len0 = WASM_VECTOR_LEN;
5105
+ const ptr1 = passStringToWasm0(context_type, wasm.__wbindgen_export, wasm.__wbindgen_export2);
5106
+ const len1 = WASM_VECTOR_LEN;
5107
+ wasm.wrapminiscript_fromBitcoinScriptExt(retptr, ptr0, len0, ptr1, len1, addHeapObject(ext_params_config));
5108
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
5109
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
5110
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
5111
+ if (r2) {
5112
+ throw takeObject(r1);
5113
+ }
5114
+ return WrapMiniscript.__wrap(r0);
5115
+ } finally {
5116
+ wasm.__wbindgen_add_to_stack_pointer(16);
5117
+ }
5118
+ }
5094
5119
  /**
5095
5120
  * @param {string} script
5096
5121
  * @param {string} context_type
@@ -5115,6 +5140,31 @@ class WrapMiniscript {
5115
5140
  wasm.__wbindgen_add_to_stack_pointer(16);
5116
5141
  }
5117
5142
  }
5143
+ /**
5144
+ * @param {string} script
5145
+ * @param {string} context_type
5146
+ * @param {any} ext_params_config
5147
+ * @returns {WrapMiniscript}
5148
+ */
5149
+ static fromStringExt(script, context_type, ext_params_config) {
5150
+ try {
5151
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
5152
+ const ptr0 = passStringToWasm0(script, wasm.__wbindgen_export, wasm.__wbindgen_export2);
5153
+ const len0 = WASM_VECTOR_LEN;
5154
+ const ptr1 = passStringToWasm0(context_type, wasm.__wbindgen_export, wasm.__wbindgen_export2);
5155
+ const len1 = WASM_VECTOR_LEN;
5156
+ wasm.wrapminiscript_fromStringExt(retptr, ptr0, len0, ptr1, len1, addHeapObject(ext_params_config));
5157
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
5158
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
5159
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
5160
+ if (r2) {
5161
+ throw takeObject(r1);
5162
+ }
5163
+ return WrapMiniscript.__wrap(r0);
5164
+ } finally {
5165
+ wasm.__wbindgen_add_to_stack_pointer(16);
5166
+ }
5167
+ }
5118
5168
  /**
5119
5169
  * @returns {any}
5120
5170
  */
Binary file
@@ -1,6 +1,28 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  export const memory: WebAssembly.Memory;
4
+ export const __wbg_wrapdescriptor_free: (a: number, b: number) => void;
5
+ export const __wbg_wrapminiscript_free: (a: number, b: number) => void;
6
+ export const wrapdescriptor_atDerivationIndex: (a: number, b: number, c: number) => void;
7
+ export const wrapdescriptor_descType: (a: number, b: number) => void;
8
+ export const wrapdescriptor_encode: (a: number, b: number) => void;
9
+ export const wrapdescriptor_fromString: (a: number, b: number, c: number, d: number, e: number) => void;
10
+ export const wrapdescriptor_fromStringDetectType: (a: number, b: number, c: number) => void;
11
+ export const wrapdescriptor_fromStringExt: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
12
+ export const wrapdescriptor_hasWildcard: (a: number) => number;
13
+ export const wrapdescriptor_maxWeightToSatisfy: (a: number, b: number) => void;
14
+ export const wrapdescriptor_node: (a: number, b: number) => void;
15
+ export const wrapdescriptor_scriptPubkey: (a: number, b: number) => void;
16
+ export const wrapdescriptor_toAsmString: (a: number, b: number) => void;
17
+ export const wrapdescriptor_toString: (a: number, b: number) => void;
18
+ export const wrapminiscript_encode: (a: number, b: number) => void;
19
+ export const wrapminiscript_fromBitcoinScript: (a: number, b: number, c: number, d: number, e: number) => void;
20
+ export const wrapminiscript_fromBitcoinScriptExt: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
21
+ export const wrapminiscript_fromString: (a: number, b: number, c: number, d: number, e: number) => void;
22
+ export const wrapminiscript_fromStringExt: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
23
+ export const wrapminiscript_node: (a: number, b: number) => void;
24
+ export const wrapminiscript_toAsmString: (a: number, b: number) => void;
25
+ export const wrapminiscript_toString: (a: number, b: number) => void;
4
26
  export const __wbg_bip322namespace_free: (a: number, b: number) => void;
5
27
  export const __wbg_bitgopsbt_free: (a: number, b: number) => void;
6
28
  export const __wbg_fixedscriptwalletnamespace_free: (a: number, b: number) => void;
@@ -137,9 +159,9 @@ export const wasmrootwalletkeys_new: (a: number, b: number, c: number, d: number
137
159
  export const wasmrootwalletkeys_user_key: (a: number) => number;
138
160
  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;
139
161
  export const wasmbip32_from_bip32_properties: (a: number, b: number) => void;
140
- export const bitgopsbt_sign_wallet_input: (a: number, b: number, c: number, d: number) => void;
141
162
  export const parsePsbtToJson: (a: number, b: number, c: number, d: number, e: number) => void;
142
163
  export const parseTxToJson: (a: number, b: number, c: number, d: number, e: number) => void;
164
+ export const bitgopsbt_sign_wallet_input: (a: number, b: number, c: number, d: number) => void;
143
165
  export const bitgopsbt_sign_all_with_xpriv: (a: number, b: number, c: number) => void;
144
166
  export const bitgopsbt_sign_replay_protection_inputs: (a: number, b: number, c: number) => void;
145
167
  export const __wbg_addressnamespace_free: (a: number, b: number) => void;
@@ -253,26 +275,6 @@ export const wasmzcashtransaction_lock_time: (a: number) => number;
253
275
  export const wasmzcashtransaction_version: (a: number) => number;
254
276
  export const wrappsbt_lock_time: (a: number) => number;
255
277
  export const wrappsbt_version: (a: number) => number;
256
- export const __wbg_wrapdescriptor_free: (a: number, b: number) => void;
257
- export const __wbg_wrapminiscript_free: (a: number, b: number) => void;
258
- export const wrapdescriptor_atDerivationIndex: (a: number, b: number, c: number) => void;
259
- export const wrapdescriptor_descType: (a: number, b: number) => void;
260
- export const wrapdescriptor_encode: (a: number, b: number) => void;
261
- export const wrapdescriptor_fromString: (a: number, b: number, c: number, d: number, e: number) => void;
262
- export const wrapdescriptor_fromStringDetectType: (a: number, b: number, c: number) => void;
263
- export const wrapdescriptor_fromStringExt: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
264
- export const wrapdescriptor_hasWildcard: (a: number) => number;
265
- export const wrapdescriptor_maxWeightToSatisfy: (a: number, b: number) => void;
266
- export const wrapdescriptor_node: (a: number, b: number) => void;
267
- export const wrapdescriptor_scriptPubkey: (a: number, b: number) => void;
268
- export const wrapdescriptor_toAsmString: (a: number, b: number) => void;
269
- export const wrapdescriptor_toString: (a: number, b: number) => void;
270
- export const wrapminiscript_encode: (a: number, b: number) => void;
271
- export const wrapminiscript_fromBitcoinScript: (a: number, b: number, c: number, d: number, e: number) => void;
272
- export const wrapminiscript_fromString: (a: number, b: number, c: number, d: number, e: number) => void;
273
- export const wrapminiscript_node: (a: number, b: number) => void;
274
- export const wrapminiscript_toAsmString: (a: number, b: number) => void;
275
- export const wrapminiscript_toString: (a: number, b: number) => void;
276
278
  export const rustsecp256k1_v0_10_0_context_create: (a: number) => number;
277
279
  export const rustsecp256k1_v0_10_0_context_destroy: (a: number) => void;
278
280
  export const rustsecp256k1_v0_10_0_default_error_callback_fn: (a: number, b: number) => void;
@@ -55,6 +55,8 @@ type Miniscript = Wrap<{
55
55
  older: number;
56
56
  }> | Wrap<{
57
57
  after: number;
58
+ }> | Wrap<{
59
+ payload_drop: string;
58
60
  }>;
59
61
  type TapTree = [TapTree, TapTree] | Miniscript;
60
62
  type Descriptor = {
@@ -101,6 +101,8 @@ function fromUnknown(v) {
101
101
  return node("multi", value);
102
102
  case "MultiA":
103
103
  return node("multi_a", value);
104
+ case "PayloadDrop":
105
+ return node("payload_drop", value);
104
106
  case "Tree":
105
107
  if (!Array.isArray(value) || value.length !== 2) {
106
108
  throw new Error(`Invalid Tree node: ${JSON.stringify(value)}`);
@@ -48,6 +48,8 @@ declare module "./wasm/wasm_utxo.js" {
48
48
  namespace WrapMiniscript {
49
49
  function fromString(miniscript: string, ctx: ScriptContext): WrapMiniscript;
50
50
  function fromBitcoinScript(script: Uint8Array, ctx: ScriptContext): WrapMiniscript;
51
+ function fromStringExt(miniscript: string, ctx: ScriptContext, extParams?: ExtParamsConfig): WrapMiniscript;
52
+ function fromBitcoinScriptExt(script: Uint8Array, ctx: ScriptContext, extParams?: ExtParamsConfig): WrapMiniscript;
51
53
  }
52
54
  /** BIP32 derivation data from a PSBT */
53
55
  interface PsbtBip32Derivation {
@@ -5072,6 +5072,31 @@ export class WrapMiniscript {
5072
5072
  wasm.__wbindgen_add_to_stack_pointer(16);
5073
5073
  }
5074
5074
  }
5075
+ /**
5076
+ * @param {Uint8Array} script
5077
+ * @param {string} context_type
5078
+ * @param {any} ext_params_config
5079
+ * @returns {WrapMiniscript}
5080
+ */
5081
+ static fromBitcoinScriptExt(script, context_type, ext_params_config) {
5082
+ try {
5083
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
5084
+ const ptr0 = passArray8ToWasm0(script, wasm.__wbindgen_export);
5085
+ const len0 = WASM_VECTOR_LEN;
5086
+ const ptr1 = passStringToWasm0(context_type, wasm.__wbindgen_export, wasm.__wbindgen_export2);
5087
+ const len1 = WASM_VECTOR_LEN;
5088
+ wasm.wrapminiscript_fromBitcoinScriptExt(retptr, ptr0, len0, ptr1, len1, addHeapObject(ext_params_config));
5089
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
5090
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
5091
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
5092
+ if (r2) {
5093
+ throw takeObject(r1);
5094
+ }
5095
+ return WrapMiniscript.__wrap(r0);
5096
+ } finally {
5097
+ wasm.__wbindgen_add_to_stack_pointer(16);
5098
+ }
5099
+ }
5075
5100
  /**
5076
5101
  * @param {string} script
5077
5102
  * @param {string} context_type
@@ -5096,6 +5121,31 @@ export class WrapMiniscript {
5096
5121
  wasm.__wbindgen_add_to_stack_pointer(16);
5097
5122
  }
5098
5123
  }
5124
+ /**
5125
+ * @param {string} script
5126
+ * @param {string} context_type
5127
+ * @param {any} ext_params_config
5128
+ * @returns {WrapMiniscript}
5129
+ */
5130
+ static fromStringExt(script, context_type, ext_params_config) {
5131
+ try {
5132
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
5133
+ const ptr0 = passStringToWasm0(script, wasm.__wbindgen_export, wasm.__wbindgen_export2);
5134
+ const len0 = WASM_VECTOR_LEN;
5135
+ const ptr1 = passStringToWasm0(context_type, wasm.__wbindgen_export, wasm.__wbindgen_export2);
5136
+ const len1 = WASM_VECTOR_LEN;
5137
+ wasm.wrapminiscript_fromStringExt(retptr, ptr0, len0, ptr1, len1, addHeapObject(ext_params_config));
5138
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
5139
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
5140
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
5141
+ if (r2) {
5142
+ throw takeObject(r1);
5143
+ }
5144
+ return WrapMiniscript.__wrap(r0);
5145
+ } finally {
5146
+ wasm.__wbindgen_add_to_stack_pointer(16);
5147
+ }
5148
+ }
5099
5149
  /**
5100
5150
  * @returns {any}
5101
5151
  */
Binary file
@@ -1,6 +1,28 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  export const memory: WebAssembly.Memory;
4
+ export const __wbg_wrapdescriptor_free: (a: number, b: number) => void;
5
+ export const __wbg_wrapminiscript_free: (a: number, b: number) => void;
6
+ export const wrapdescriptor_atDerivationIndex: (a: number, b: number, c: number) => void;
7
+ export const wrapdescriptor_descType: (a: number, b: number) => void;
8
+ export const wrapdescriptor_encode: (a: number, b: number) => void;
9
+ export const wrapdescriptor_fromString: (a: number, b: number, c: number, d: number, e: number) => void;
10
+ export const wrapdescriptor_fromStringDetectType: (a: number, b: number, c: number) => void;
11
+ export const wrapdescriptor_fromStringExt: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
12
+ export const wrapdescriptor_hasWildcard: (a: number) => number;
13
+ export const wrapdescriptor_maxWeightToSatisfy: (a: number, b: number) => void;
14
+ export const wrapdescriptor_node: (a: number, b: number) => void;
15
+ export const wrapdescriptor_scriptPubkey: (a: number, b: number) => void;
16
+ export const wrapdescriptor_toAsmString: (a: number, b: number) => void;
17
+ export const wrapdescriptor_toString: (a: number, b: number) => void;
18
+ export const wrapminiscript_encode: (a: number, b: number) => void;
19
+ export const wrapminiscript_fromBitcoinScript: (a: number, b: number, c: number, d: number, e: number) => void;
20
+ export const wrapminiscript_fromBitcoinScriptExt: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
21
+ export const wrapminiscript_fromString: (a: number, b: number, c: number, d: number, e: number) => void;
22
+ export const wrapminiscript_fromStringExt: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
23
+ export const wrapminiscript_node: (a: number, b: number) => void;
24
+ export const wrapminiscript_toAsmString: (a: number, b: number) => void;
25
+ export const wrapminiscript_toString: (a: number, b: number) => void;
4
26
  export const __wbg_bip322namespace_free: (a: number, b: number) => void;
5
27
  export const __wbg_bitgopsbt_free: (a: number, b: number) => void;
6
28
  export const __wbg_fixedscriptwalletnamespace_free: (a: number, b: number) => void;
@@ -137,9 +159,9 @@ export const wasmrootwalletkeys_new: (a: number, b: number, c: number, d: number
137
159
  export const wasmrootwalletkeys_user_key: (a: number) => number;
138
160
  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;
139
161
  export const wasmbip32_from_bip32_properties: (a: number, b: number) => void;
140
- export const bitgopsbt_sign_wallet_input: (a: number, b: number, c: number, d: number) => void;
141
162
  export const parsePsbtToJson: (a: number, b: number, c: number, d: number, e: number) => void;
142
163
  export const parseTxToJson: (a: number, b: number, c: number, d: number, e: number) => void;
164
+ export const bitgopsbt_sign_wallet_input: (a: number, b: number, c: number, d: number) => void;
143
165
  export const bitgopsbt_sign_all_with_xpriv: (a: number, b: number, c: number) => void;
144
166
  export const bitgopsbt_sign_replay_protection_inputs: (a: number, b: number, c: number) => void;
145
167
  export const __wbg_addressnamespace_free: (a: number, b: number) => void;
@@ -253,26 +275,6 @@ export const wasmzcashtransaction_lock_time: (a: number) => number;
253
275
  export const wasmzcashtransaction_version: (a: number) => number;
254
276
  export const wrappsbt_lock_time: (a: number) => number;
255
277
  export const wrappsbt_version: (a: number) => number;
256
- export const __wbg_wrapdescriptor_free: (a: number, b: number) => void;
257
- export const __wbg_wrapminiscript_free: (a: number, b: number) => void;
258
- export const wrapdescriptor_atDerivationIndex: (a: number, b: number, c: number) => void;
259
- export const wrapdescriptor_descType: (a: number, b: number) => void;
260
- export const wrapdescriptor_encode: (a: number, b: number) => void;
261
- export const wrapdescriptor_fromString: (a: number, b: number, c: number, d: number, e: number) => void;
262
- export const wrapdescriptor_fromStringDetectType: (a: number, b: number, c: number) => void;
263
- export const wrapdescriptor_fromStringExt: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
264
- export const wrapdescriptor_hasWildcard: (a: number) => number;
265
- export const wrapdescriptor_maxWeightToSatisfy: (a: number, b: number) => void;
266
- export const wrapdescriptor_node: (a: number, b: number) => void;
267
- export const wrapdescriptor_scriptPubkey: (a: number, b: number) => void;
268
- export const wrapdescriptor_toAsmString: (a: number, b: number) => void;
269
- export const wrapdescriptor_toString: (a: number, b: number) => void;
270
- export const wrapminiscript_encode: (a: number, b: number) => void;
271
- export const wrapminiscript_fromBitcoinScript: (a: number, b: number, c: number, d: number, e: number) => void;
272
- export const wrapminiscript_fromString: (a: number, b: number, c: number, d: number, e: number) => void;
273
- export const wrapminiscript_node: (a: number, b: number) => void;
274
- export const wrapminiscript_toAsmString: (a: number, b: number) => void;
275
- export const wrapminiscript_toString: (a: number, b: number) => void;
276
278
  export const rustsecp256k1_v0_10_0_context_create: (a: number) => number;
277
279
  export const rustsecp256k1_v0_10_0_context_destroy: (a: number) => void;
278
280
  export const rustsecp256k1_v0_10_0_default_error_callback_fn: (a: number, b: number) => void;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bitgo/wasm-utxo",
3
3
  "description": "WebAssembly wrapper for rust-bitcoin (beta)",
4
- "version": "4.11.1",
4
+ "version": "4.13.0",
5
5
  "type": "module",
6
6
  "repository": {
7
7
  "type": "git",