@@ -15,6 +15,7 @@ type Product = 'unknown' | 'bitbox02-multi' | 'bitbox02-btconly' | 'bitbox02-nov
1515type BtcCoin = 'btc' | 'tbtc' | 'ltc' | 'tltc' | 'rbtc';
1616type BtcFormatUnit = 'default' | 'sat';
1717type XPubType = 'tpub' | 'xpub' | 'ypub' | 'zpub' | 'vpub' | 'upub' | 'Vpub' | 'Zpub' | 'Upub' | 'Ypub';
18+ type BtcXPubsType = 'tpub' | 'xpub';
1819type Keypath = string | number[];
1920type XPub = string;
2021type DeviceInfo = {
@@ -50,6 +51,7 @@ type BtcSignMessageSignature = {
5051 recid: bigint,
5152 electrumSig65: Uint8Array,
5253};
54+ type BtcXpubs = string[];
5355// nonce, gasPrice, gasLimit and value must be big-endian encoded, no trailing zeroes.
5456type EthTransaction = {
5557 nonce: Uint8Array;
@@ -172,6 +174,8 @@ extern "C" {
172174 pub type TsBtcFormatUnit ;
173175 #[ wasm_bindgen( typescript_type = "XPubType" ) ]
174176 pub type TsXPubType ;
177+ #[ wasm_bindgen( typescript_type = "BtcXPubsType" ) ]
178+ pub type TsBtcXPubsType ;
175179 #[ wasm_bindgen( typescript_type = "Keypath" ) ]
176180 pub type TsKeypath ;
177181 #[ wasm_bindgen( typescript_type = "DeviceInfo" ) ]
@@ -190,6 +194,8 @@ extern "C" {
190194 pub type TsBtcScriptConfigWithKeypath ;
191195 #[ wasm_bindgen( typescript_type = "BtcSignMessageSignature" ) ]
192196 pub type TsBtcSignMessageSignature ;
197+ #[ wasm_bindgen( typescript_type = "BtcXpubs" ) ]
198+ pub type TsBtcXpubs ;
193199 #[ wasm_bindgen( typescript_type = "EthTransaction" ) ]
194200 pub type TsEthTransaction ;
195201 #[ wasm_bindgen( typescript_type = "Eth1559Transaction" ) ]
@@ -238,6 +244,14 @@ impl TryFrom<TsXPubType> for crate::pb::btc_pub_request::XPubType {
238244 }
239245}
240246
247+ impl TryFrom < TsBtcXPubsType > for crate :: pb:: btc_xpubs_request:: XPubType {
248+ type Error = JavascriptError ;
249+ fn try_from ( value : TsBtcXPubsType ) -> Result < Self , Self :: Error > {
250+ serde_wasm_bindgen:: from_value ( value. into ( ) )
251+ . map_err ( |_| JavascriptError :: InvalidType ( "wrong type for BTCXPubsType" ) )
252+ }
253+ }
254+
241255impl TryFrom < TsKeypath > for crate :: Keypath {
242256 type Error = JavascriptError ;
243257 fn try_from ( value : TsKeypath ) -> Result < Self , Self :: Error > {
0 commit comments