@airgap/coinlib-core 0.13.7-beta.0 → 0.13.7-beta.2

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.
Files changed (275) hide show
  1. package/actions/GetKtAccountsAction.js +1 -1
  2. package/actions/GetKtAccountsAction.js.map +1 -1
  3. package/airgap-coinlib-core.min.js +2914 -2332
  4. package/index.d.ts +1 -3
  5. package/index.js +1 -6
  6. package/index.js.map +1 -1
  7. package/interfaces/IAirGapAddress.d.ts +19 -0
  8. package/interfaces/IAirGapAddress.js +3 -0
  9. package/interfaces/IAirGapAddress.js.map +1 -0
  10. package/package.json +1 -1
  11. package/protocols/CryptoClient.d.ts +4 -5
  12. package/protocols/Ed25519CryptoClient.d.ts +1 -2
  13. package/protocols/Ed25519CryptoClient.js +1 -1
  14. package/protocols/Ed25519CryptoClient.js.map +1 -1
  15. package/protocols/ICoinBaseProtocol.d.ts +47 -0
  16. package/protocols/ICoinBaseProtocol.js +3 -0
  17. package/protocols/ICoinBaseProtocol.js.map +1 -0
  18. package/protocols/ICoinOfflineProtocol.d.ts +22 -0
  19. package/protocols/ICoinOfflineProtocol.js +3 -0
  20. package/protocols/ICoinOfflineProtocol.js.map +1 -0
  21. package/protocols/ICoinOnlineProtocol.d.ts +46 -0
  22. package/protocols/ICoinOnlineProtocol.js +3 -0
  23. package/protocols/ICoinOnlineProtocol.js.map +1 -0
  24. package/protocols/ICoinProtocol.d.ts +4 -110
  25. package/protocols/ICoinSubProtocol.d.ts +3 -3
  26. package/protocols/NonExtendedProtocol.d.ts +4 -3
  27. package/protocols/NonExtendedProtocol.js +4 -1
  28. package/protocols/NonExtendedProtocol.js.map +1 -1
  29. package/protocols/Secp256k1CryptoClient.d.ts +1 -2
  30. package/protocols/Secp256k1CryptoClient.js +1 -1
  31. package/protocols/Secp256k1CryptoClient.js.map +1 -1
  32. package/protocols/Sr25519CryptoClient.d.ts +1 -2
  33. package/protocols/aeternity/AeternityAddress.d.ts +1 -1
  34. package/protocols/aeternity/AeternityAddress.js +1 -1
  35. package/protocols/aeternity/AeternityCryptoClient.d.ts +1 -2
  36. package/protocols/aeternity/AeternityCryptoClient.js +1 -1
  37. package/protocols/aeternity/AeternityCryptoClient.js.map +1 -1
  38. package/protocols/aeternity/AeternityProtocol.d.ts +41 -33
  39. package/protocols/aeternity/AeternityProtocol.js +70 -56
  40. package/protocols/aeternity/AeternityProtocol.js.map +1 -1
  41. package/protocols/aeternity/AeternityTypes.d.ts +6 -0
  42. package/protocols/bitcoin/BitcoinAddress.d.ts +1 -1
  43. package/protocols/bitcoin/BitcoinAddress.js +1 -1
  44. package/protocols/bitcoin/BitcoinCryptoClient.d.ts +1 -2
  45. package/protocols/bitcoin/BitcoinCryptoClient.js +2 -2
  46. package/protocols/bitcoin/BitcoinCryptoClient.js.map +1 -1
  47. package/protocols/bitcoin/BitcoinProtocol.d.ts +43 -32
  48. package/protocols/bitcoin/BitcoinProtocol.js +98 -79
  49. package/protocols/bitcoin/BitcoinProtocol.js.map +1 -1
  50. package/protocols/bitcoin/BitcoinSegwitAddress.d.ts +1 -1
  51. package/protocols/bitcoin/BitcoinSegwitAddress.js +1 -1
  52. package/protocols/bitcoin/BitcoinSegwitProtocol.d.ts +10 -11
  53. package/protocols/bitcoin/BitcoinSegwitProtocol.js +42 -29
  54. package/protocols/bitcoin/BitcoinSegwitProtocol.js.map +1 -1
  55. package/protocols/bitcoin/BitcoinTestnetProtocol.d.ts +6 -3
  56. package/protocols/bitcoin/BitcoinTestnetProtocol.js +6 -3
  57. package/protocols/bitcoin/BitcoinTestnetProtocol.js.map +1 -1
  58. package/protocols/bitcoin/BitcoinTypes.d.ts +6 -0
  59. package/protocols/cosmos/CosmosAddress.d.ts +1 -1
  60. package/protocols/cosmos/CosmosAddress.js +1 -1
  61. package/protocols/cosmos/CosmosCryptoClient.d.ts +1 -2
  62. package/protocols/cosmos/CosmosCryptoClient.js +1 -1
  63. package/protocols/cosmos/CosmosCryptoClient.js.map +1 -1
  64. package/protocols/cosmos/CosmosProtocol.d.ts +41 -29
  65. package/protocols/cosmos/CosmosProtocol.js +72 -58
  66. package/protocols/cosmos/CosmosProtocol.js.map +1 -1
  67. package/protocols/cosmos/CosmosTransaction.d.ts +3 -2
  68. package/protocols/cosmos/CosmosTransaction.js +2 -2
  69. package/protocols/cosmos/CosmosTransaction.js.map +1 -1
  70. package/protocols/cosmos/CosmosTypes.d.ts +6 -0
  71. package/protocols/cosmos/CosmosTypes.js.map +1 -1
  72. package/protocols/cosmos/cosmos-message/CosmosDelegateMessage.d.ts +3 -2
  73. package/protocols/cosmos/cosmos-message/CosmosDelegateMessage.js +3 -3
  74. package/protocols/cosmos/cosmos-message/CosmosDelegateMessage.js.map +1 -1
  75. package/protocols/cosmos/cosmos-message/CosmosMessage.d.ts +3 -2
  76. package/protocols/cosmos/cosmos-message/CosmosMessage.js.map +1 -1
  77. package/protocols/cosmos/cosmos-message/CosmosSendMessage.d.ts +2 -2
  78. package/protocols/cosmos/cosmos-message/CosmosSendMessage.js +3 -3
  79. package/protocols/cosmos/cosmos-message/CosmosSendMessage.js.map +1 -1
  80. package/protocols/cosmos/cosmos-message/CosmosWithdrawDelegationRewardMessage.d.ts +3 -2
  81. package/protocols/cosmos/cosmos-message/CosmosWithdrawDelegationRewardMessage.js +3 -3
  82. package/protocols/cosmos/cosmos-message/CosmosWithdrawDelegationRewardMessage.js.map +1 -1
  83. package/protocols/ethereum/BaseEthereumProtocol.d.ts +43 -31
  84. package/protocols/ethereum/BaseEthereumProtocol.js +95 -76
  85. package/protocols/ethereum/BaseEthereumProtocol.js.map +1 -1
  86. package/protocols/ethereum/EthereumAddress.d.ts +1 -1
  87. package/protocols/ethereum/EthereumAddress.js +1 -1
  88. package/protocols/ethereum/EthereumCryptoClient.d.ts +1 -2
  89. package/protocols/ethereum/EthereumCryptoClient.js +8 -7
  90. package/protocols/ethereum/EthereumCryptoClient.js.map +1 -1
  91. package/protocols/ethereum/EthereumProtocol.d.ts +6 -4
  92. package/protocols/ethereum/EthereumProtocol.js +8 -6
  93. package/protocols/ethereum/EthereumProtocol.js.map +1 -1
  94. package/protocols/ethereum/EthereumTypes.d.ts +6 -0
  95. package/protocols/ethereum/clients/info-clients/EtherscanInfoClient.js +82 -58
  96. package/protocols/ethereum/clients/info-clients/EtherscanInfoClient.js.map +1 -1
  97. package/protocols/ethereum/clients/info-clients/InfoClient.d.ts +3 -3
  98. package/protocols/ethereum/erc20/GenericERC20.d.ts +10 -7
  99. package/protocols/ethereum/erc20/GenericERC20.js +27 -23
  100. package/protocols/ethereum/erc20/GenericERC20.js.map +1 -1
  101. package/protocols/groestlcoin/GroestlcoinProtocol.d.ts +29 -15
  102. package/protocols/groestlcoin/GroestlcoinProtocol.js +31 -17
  103. package/protocols/groestlcoin/GroestlcoinProtocol.js.map +1 -1
  104. package/protocols/substrate/SubstrateCryptoClient.d.ts +1 -2
  105. package/protocols/substrate/SubstrateCryptoClient.js +7 -7
  106. package/protocols/substrate/SubstrateCryptoClient.js.map +1 -1
  107. package/protocols/substrate/SubstrateDelegateProtocol.js +35 -35
  108. package/protocols/substrate/SubstrateDelegateProtocol.js.map +1 -1
  109. package/protocols/substrate/SubstrateProtocol.d.ts +43 -29
  110. package/protocols/substrate/SubstrateProtocol.js +60 -52
  111. package/protocols/substrate/SubstrateProtocol.js.map +1 -1
  112. package/protocols/substrate/SubstrateTypes.d.ts +6 -0
  113. package/protocols/substrate/astar/AstarProtocol.d.ts +28 -15
  114. package/protocols/substrate/astar/AstarProtocol.js +30 -17
  115. package/protocols/substrate/astar/AstarProtocol.js.map +1 -1
  116. package/protocols/substrate/astar/shiden/ShidenProtocol.d.ts +22 -11
  117. package/protocols/substrate/astar/shiden/ShidenProtocol.js +24 -13
  118. package/protocols/substrate/astar/shiden/ShidenProtocol.js.map +1 -1
  119. package/protocols/substrate/common/SubstrateAccountController.js +4 -4
  120. package/protocols/substrate/common/data/account/SubstrateAddress.d.ts +1 -1
  121. package/protocols/substrate/common/data/account/SubstrateAddress.js +2 -2
  122. package/protocols/substrate/common/data/scale/type/SCALEAccountId.js +1 -1
  123. package/protocols/substrate/common/data/transaction/SubstrateTransactionPayload.d.ts +1 -1
  124. package/protocols/substrate/common/data/transaction/method/SubstrateTransactionMethodArgs.js +12 -12
  125. package/protocols/substrate/kusama/KusamaProtocol.d.ts +28 -15
  126. package/protocols/substrate/kusama/KusamaProtocol.js +30 -17
  127. package/protocols/substrate/kusama/KusamaProtocol.js.map +1 -1
  128. package/protocols/substrate/moonbeam/MoonbeamProtocol.d.ts +28 -15
  129. package/protocols/substrate/moonbeam/MoonbeamProtocol.js +61 -48
  130. package/protocols/substrate/moonbeam/MoonbeamProtocol.js.map +1 -1
  131. package/protocols/substrate/moonbeam/controllers/MoonbeamAccountController.js +3 -3
  132. package/protocols/substrate/moonbeam/data/account/MoonbeamAddress.d.ts +1 -1
  133. package/protocols/substrate/moonbeam/data/account/MoonbeamAddress.js +3 -3
  134. package/protocols/substrate/moonbeam/moonbase/MoonbaseProtocol.d.ts +20 -12
  135. package/protocols/substrate/moonbeam/moonbase/MoonbaseProtocol.js +22 -14
  136. package/protocols/substrate/moonbeam/moonbase/MoonbaseProtocol.js.map +1 -1
  137. package/protocols/substrate/moonbeam/moonriver/MoonriverProtocol.d.ts +20 -12
  138. package/protocols/substrate/moonbeam/moonriver/MoonriverProtocol.js +22 -14
  139. package/protocols/substrate/moonbeam/moonriver/MoonriverProtocol.js.map +1 -1
  140. package/protocols/substrate/polkadot/PolkadotProtocol.d.ts +28 -15
  141. package/protocols/substrate/polkadot/PolkadotProtocol.js +30 -17
  142. package/protocols/substrate/polkadot/PolkadotProtocol.js.map +1 -1
  143. package/protocols/tezos/TezosAddress.d.ts +1 -1
  144. package/protocols/tezos/TezosAddress.js +1 -1
  145. package/protocols/tezos/TezosCryptoClient.d.ts +1 -1
  146. package/protocols/tezos/TezosCryptoClient.js +1 -1
  147. package/protocols/tezos/TezosCryptoClient.js.map +1 -1
  148. package/protocols/tezos/TezosProtocol.d.ts +42 -29
  149. package/protocols/tezos/TezosProtocol.js +105 -94
  150. package/protocols/tezos/TezosProtocol.js.map +1 -1
  151. package/protocols/tezos/contract/TezosContract.js +1 -0
  152. package/protocols/tezos/contract/TezosContract.js.map +1 -1
  153. package/protocols/tezos/fa/TezosBTC.d.ts +0 -1
  154. package/protocols/tezos/fa/TezosBTC.js +1 -3
  155. package/protocols/tezos/fa/TezosBTC.js.map +1 -1
  156. package/protocols/tezos/fa/TezosBTCtez.d.ts +0 -1
  157. package/protocols/tezos/fa/TezosBTCtez.js +1 -3
  158. package/protocols/tezos/fa/TezosBTCtez.js.map +1 -1
  159. package/protocols/tezos/fa/TezosCTez.d.ts +0 -1
  160. package/protocols/tezos/fa/TezosCTez.js +1 -3
  161. package/protocols/tezos/fa/TezosCTez.js.map +1 -1
  162. package/protocols/tezos/fa/TezosDOGA.d.ts +0 -1
  163. package/protocols/tezos/fa/TezosDOGA.js +1 -3
  164. package/protocols/tezos/fa/TezosDOGA.js.map +1 -1
  165. package/protocols/tezos/fa/TezosETHtz.d.ts +0 -1
  166. package/protocols/tezos/fa/TezosETHtz.js +1 -3
  167. package/protocols/tezos/fa/TezosETHtz.js.map +1 -1
  168. package/protocols/tezos/fa/TezosFA1Protocol.js +6 -6
  169. package/protocols/tezos/fa/TezosFA1Protocol.js.map +1 -1
  170. package/protocols/tezos/fa/TezosFA2Protocol.d.ts +3 -2
  171. package/protocols/tezos/fa/TezosFA2Protocol.js +10 -9
  172. package/protocols/tezos/fa/TezosFA2Protocol.js.map +1 -1
  173. package/protocols/tezos/fa/TezosFAProtocol.d.ts +9 -5
  174. package/protocols/tezos/fa/TezosFAProtocol.js +48 -35
  175. package/protocols/tezos/fa/TezosFAProtocol.js.map +1 -1
  176. package/protocols/tezos/fa/TezosKolibriUSD.d.ts +0 -1
  177. package/protocols/tezos/fa/TezosKolibriUSD.js +1 -3
  178. package/protocols/tezos/fa/TezosKolibriUSD.js.map +1 -1
  179. package/protocols/tezos/fa/TezosPlanty.d.ts +0 -1
  180. package/protocols/tezos/fa/TezosPlanty.js +1 -3
  181. package/protocols/tezos/fa/TezosPlanty.js.map +1 -1
  182. package/protocols/tezos/fa/TezosQUIPU.d.ts +0 -1
  183. package/protocols/tezos/fa/TezosQUIPU.js +1 -3
  184. package/protocols/tezos/fa/TezosQUIPU.js.map +1 -1
  185. package/protocols/tezos/fa/TezosSIRS.d.ts +0 -1
  186. package/protocols/tezos/fa/TezosSIRS.js +1 -3
  187. package/protocols/tezos/fa/TezosSIRS.js.map +1 -1
  188. package/protocols/tezos/fa/TezosStaker.d.ts +0 -1
  189. package/protocols/tezos/fa/TezosStaker.js +1 -3
  190. package/protocols/tezos/fa/TezosStaker.js.map +1 -1
  191. package/protocols/tezos/fa/TezosUBTC.d.ts +0 -1
  192. package/protocols/tezos/fa/TezosUBTC.js +1 -3
  193. package/protocols/tezos/fa/TezosUBTC.js.map +1 -1
  194. package/protocols/tezos/fa/TezosUDEFI.d.ts +0 -1
  195. package/protocols/tezos/fa/TezosUDEFI.js +1 -3
  196. package/protocols/tezos/fa/TezosUDEFI.js.map +1 -1
  197. package/protocols/tezos/fa/TezosUSD.d.ts +0 -1
  198. package/protocols/tezos/fa/TezosUSD.js +1 -3
  199. package/protocols/tezos/fa/TezosUSD.js.map +1 -1
  200. package/protocols/tezos/fa/TezosUSDT.d.ts +0 -1
  201. package/protocols/tezos/fa/TezosUSDT.js +1 -3
  202. package/protocols/tezos/fa/TezosUSDT.js.map +1 -1
  203. package/protocols/tezos/fa/TezosUUSD.d.ts +0 -1
  204. package/protocols/tezos/fa/TezosUUSD.js +1 -3
  205. package/protocols/tezos/fa/TezosUUSD.js.map +1 -1
  206. package/protocols/tezos/fa/TezosWRAP.d.ts +0 -1
  207. package/protocols/tezos/fa/TezosWRAP.js +1 -3
  208. package/protocols/tezos/fa/TezosWRAP.js.map +1 -1
  209. package/protocols/tezos/fa/TezosWrapped.d.ts +0 -1
  210. package/protocols/tezos/fa/TezosWrapped.js +1 -3
  211. package/protocols/tezos/fa/TezosWrapped.js.map +1 -1
  212. package/protocols/tezos/fa/TezosYOU.d.ts +0 -1
  213. package/protocols/tezos/fa/TezosYOU.js +1 -3
  214. package/protocols/tezos/fa/TezosYOU.js.map +1 -1
  215. package/protocols/tezos/kt/TezosKtProtocol.d.ts +10 -7
  216. package/protocols/tezos/kt/TezosKtProtocol.js +50 -20
  217. package/protocols/tezos/kt/TezosKtProtocol.js.map +1 -1
  218. package/protocols/tezos/sapling/TezosSaplingCryptoClient.d.ts +1 -1
  219. package/protocols/tezos/sapling/TezosSaplingProtocol.d.ts +43 -28
  220. package/protocols/tezos/sapling/TezosSaplingProtocol.js +129 -69
  221. package/protocols/tezos/sapling/TezosSaplingProtocol.js.map +1 -1
  222. package/protocols/tezos/sapling/utils/TezosSaplingBookkeeper.js +7 -7
  223. package/protocols/tezos/sapling/utils/TezosSaplingBookkeeper.js.map +1 -1
  224. package/protocols/tezos/types/TezosAddressCursor.d.ts +3 -0
  225. package/protocols/tezos/types/TezosAddressCursor.js +3 -0
  226. package/protocols/tezos/types/TezosAddressCursor.js.map +1 -0
  227. package/protocols/tezos/types/TezosAddressResult.d.ts +4 -0
  228. package/protocols/tezos/types/TezosAddressResult.js +3 -0
  229. package/protocols/tezos/types/TezosAddressResult.js.map +1 -0
  230. package/protocols/tezos/types/kt/TezosKtAddressCursor.d.ts +4 -0
  231. package/protocols/tezos/types/kt/TezosKtAddressCursor.js +3 -0
  232. package/protocols/tezos/types/kt/TezosKtAddressCursor.js.map +1 -0
  233. package/protocols/tezos/types/kt/TezosKtAddressResult.d.ts +5 -0
  234. package/protocols/tezos/types/kt/TezosKtAddressResult.js +3 -0
  235. package/protocols/tezos/types/kt/TezosKtAddressResult.js.map +1 -0
  236. package/protocols/tezos/types/sapling/TezosSaplingAddressCursor.d.ts +4 -0
  237. package/protocols/tezos/types/sapling/TezosSaplingAddressCursor.js +3 -0
  238. package/protocols/tezos/types/sapling/TezosSaplingAddressCursor.js.map +1 -0
  239. package/protocols/tezos/types/sapling/TezosSaplingAddressResult.d.ts +4 -0
  240. package/protocols/tezos/types/sapling/TezosSaplingAddressResult.js +3 -0
  241. package/protocols/tezos/types/sapling/TezosSaplingAddressResult.js.map +1 -0
  242. package/serializer/unsigned-transactions/xtz-btc-transactions.validator.js +23 -10
  243. package/serializer/unsigned-transactions/xtz-btc-transactions.validator.js.map +1 -1
  244. package/serializer/validators/validators.js +246 -140
  245. package/serializer/validators/validators.js.map +1 -1
  246. package/serializer-v3/unsigned-transactions/xtz-btc-transactions.validator.js +23 -10
  247. package/serializer-v3/unsigned-transactions/xtz-btc-transactions.validator.js.map +1 -1
  248. package/serializer-v3/validators/validators.js +246 -140
  249. package/serializer-v3/validators/validators.js.map +1 -1
  250. package/utils/AES.d.ts +2 -3
  251. package/utils/AES.js +3 -1
  252. package/utils/AES.js.map +1 -1
  253. package/utils/protocolsByIdentifier.d.ts +1 -1
  254. package/utils/protocolsByIdentifier.js +114 -24
  255. package/utils/protocolsByIdentifier.js.map +1 -1
  256. package/utils/supportedProtocols.d.ts +2 -2
  257. package/utils/supportedProtocols.js +114 -12
  258. package/utils/supportedProtocols.js.map +1 -1
  259. package/wallet/AirGapCoinWallet.d.ts +1 -1
  260. package/wallet/AirGapCoinWallet.js +45 -27
  261. package/wallet/AirGapCoinWallet.js.map +1 -1
  262. package/wallet/AirGapMarketWallet.js +28 -24
  263. package/wallet/AirGapMarketWallet.js.map +1 -1
  264. package/wallet/AirGapNFTWallet.d.ts +1 -1
  265. package/wallet/AirGapNFTWallet.js +26 -5
  266. package/wallet/AirGapNFTWallet.js.map +1 -1
  267. package/wallet/AirGapWallet.d.ts +1 -1
  268. package/wallet/AirGapWallet.js +23 -12
  269. package/wallet/AirGapWallet.js.map +1 -1
  270. package/utils/createProtocol.d.ts +0 -3
  271. package/utils/createProtocol.js +0 -143
  272. package/utils/createProtocol.js.map +0 -1
  273. package/utils/subProtocols.d.ts +0 -8
  274. package/utils/subProtocols.js +0 -53
  275. package/utils/subProtocols.js.map +0 -1
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import { IAirGapSignedTransaction } from '../../interfaces/IAirGapSignedTransaction';
3
2
  import { AirGapTransactionStatus, IAirGapTransaction } from '../../interfaces/IAirGapTransaction';
4
3
  import { SignedBitcoinTransaction } from '../../serializer/schemas/definitions/signed-transaction-bitcoin';
@@ -7,8 +6,7 @@ import { RawBitcoinTransaction } from '../../serializer/types';
7
6
  import { ProtocolSymbols } from '../../utils/ProtocolSymbols';
8
7
  import { CurrencyUnit, FeeDefaults, ICoinProtocol } from '../ICoinProtocol';
9
8
  import { ICoinSubProtocol } from '../ICoinSubProtocol';
10
- import { BitcoinBlockbookTransactionCursor, BitcoinBlockbookTransactionResult } from './BitcoinTypes';
11
- import { BitcoinAddress } from './BitcoinAddress';
9
+ import { BitcoinAddressCursor, BitcoinAddressResult, BitcoinBlockbookTransactionCursor, BitcoinBlockbookTransactionResult } from './BitcoinTypes';
12
10
  import { BitcoinProtocolOptions } from './BitcoinProtocolOptions';
13
11
  import { BitcoinCryptoClient } from './BitcoinCryptoClient';
14
12
  export interface UTXOResponse {
@@ -88,38 +86,51 @@ export interface AddressResponse {
88
86
  transactions?: Transaction[];
89
87
  }
90
88
  export declare class BitcoinProtocol implements ICoinProtocol {
91
- readonly options: BitcoinProtocolOptions;
92
- symbol: string;
93
- name: string;
94
- marketSymbol: string;
95
- feeSymbol: string;
96
- subProtocols: never[];
97
- feeDefaults: FeeDefaults;
98
- decimals: number;
99
- feeDecimals: number;
100
- identifier: ProtocolSymbols;
101
- units: CurrencyUnit[];
102
- supportsHD: boolean;
103
- standardDerivationPath: string;
104
- addressIsCaseSensitive: boolean;
105
- addressValidationPattern: string;
106
- addressPlaceholder: string;
89
+ protected readonly _options: BitcoinProtocolOptions;
90
+ protected _symbol: string;
91
+ symbol: Promise<string>;
92
+ protected _name: string;
93
+ name: Promise<string>;
94
+ protected _marketSymbol: string;
95
+ marketSymbol: Promise<string>;
96
+ protected _feeSymbol: string;
97
+ feeSymbol: Promise<string>;
98
+ protected _feeDefaults: FeeDefaults;
99
+ feeDefaults: Promise<FeeDefaults>;
100
+ protected _decimals: number;
101
+ decimals: Promise<number>;
102
+ protected _feeDecimals: number;
103
+ feeDecimals: Promise<number>;
104
+ protected _identifier: ProtocolSymbols;
105
+ identifier: Promise<ProtocolSymbols>;
106
+ protected _units: CurrencyUnit[];
107
+ units: Promise<CurrencyUnit[]>;
108
+ protected _supportsHD: boolean;
109
+ supportsHD: Promise<boolean>;
110
+ protected _standardDerivationPath: string;
111
+ standardDerivationPath: Promise<string>;
112
+ protected _addressIsCaseSensitive: boolean;
113
+ addressIsCaseSensitive: Promise<boolean>;
114
+ protected _addressValidationPattern: string;
115
+ addressValidationPattern: Promise<string>;
116
+ protected _addressPlaceholder: string;
117
+ addressPlaceholder: Promise<string>;
107
118
  readonly cryptoClient: BitcoinCryptoClient;
108
- constructor(options?: BitcoinProtocolOptions);
119
+ readonly options: Promise<BitcoinProtocolOptions>;
120
+ constructor(_options?: BitcoinProtocolOptions);
109
121
  getBlockExplorerLinkForAddress(address: string): Promise<string>;
110
122
  getBlockExplorerLinkForTxId(txId: string): Promise<string>;
111
123
  getPublicKeyFromMnemonic(mnemonic: string, derivationPath: string, password?: string): Promise<string>;
112
- getPrivateKeyFromMnemonic(mnemonic: string, derivationPath: string, password?: string): Promise<Buffer>;
124
+ getPrivateKeyFromMnemonic(mnemonic: string, derivationPath: string, password?: string): Promise<string>;
113
125
  getExtendedPrivateKeyFromMnemonic(mnemonic: string, derivationPath: string, password?: string): Promise<string>;
114
126
  getPublicKeyFromHexSecret(secret: string, derivationPath: string): Promise<string>;
115
- getPrivateKeyFromHexSecret(secret: string, derivationPath: string): Promise<Buffer>;
127
+ getPrivateKeyFromHexSecret(secret: string, derivationPath: string): Promise<string>;
116
128
  getExtendedPrivateKeyFromHexSecret(secret: string, derivationPath: string): Promise<string>;
117
- getAddressFromPublicKey(publicKey: string): Promise<BitcoinAddress>;
118
- getAddressesFromPublicKey(publicKey: string): Promise<BitcoinAddress[]>;
119
- getAddressFromExtendedPublicKey(extendedPublicKey: string, visibilityDerivationIndex: number, addressDerivationIndex: number): Promise<BitcoinAddress>;
120
- getAddressesFromExtendedPublicKey(extendedPublicKey: string, visibilityDerivationIndex: number, addressCount: number, offset: number): Promise<BitcoinAddress[]>;
121
- getNextAddressFromPublicKey(publicKey: string, current: BitcoinAddress): Promise<BitcoinAddress>;
122
- signWithPrivateKey(privateKey: Buffer, transaction: RawBitcoinTransaction): Promise<IAirGapSignedTransaction>;
129
+ getAddressFromPublicKey(publicKey: string, cursor?: BitcoinAddressCursor): Promise<BitcoinAddressResult>;
130
+ getAddressesFromPublicKey(publicKey: string, cursor?: BitcoinAddressCursor): Promise<BitcoinAddressResult[]>;
131
+ getAddressFromExtendedPublicKey(extendedPublicKey: string, visibilityDerivationIndex: number, addressDerivationIndex: number): Promise<BitcoinAddressResult>;
132
+ getAddressesFromExtendedPublicKey(extendedPublicKey: string, visibilityDerivationIndex: number, addressCount: number, offset: number): Promise<BitcoinAddressResult[]>;
133
+ signWithPrivateKey(privateKey: string, transaction: RawBitcoinTransaction): Promise<IAirGapSignedTransaction>;
123
134
  signWithExtendedPrivateKey(extendedPrivateKey: string, transaction: RawBitcoinTransaction): Promise<string>;
124
135
  getTransactionDetails(unsignedTx: UnsignedTransaction): Promise<IAirGapTransaction[]>;
125
136
  getTransactionDetailsFromSigned(signedTx: SignedBitcoinTransaction): Promise<IAirGapTransaction[]>;
@@ -140,15 +151,15 @@ export declare class BitcoinProtocol implements ICoinProtocol {
140
151
  getTransactionsFromAddresses(addresses: string[], limit: number, cursor?: BitcoinBlockbookTransactionCursor): Promise<BitcoinBlockbookTransactionResult>;
141
152
  private containsSome;
142
153
  signMessage(message: string, keypair: {
143
- privateKey: Buffer;
154
+ privateKey: string;
144
155
  }): Promise<string>;
145
156
  verifyMessage(message: string, signature: string, publicKey: string): Promise<boolean>;
146
157
  encryptAsymmetric(message: string, publicKey: string): Promise<string>;
147
158
  decryptAsymmetric(message: string, keypair: {
148
159
  publicKey: string;
149
- privateKey: Buffer;
160
+ privateKey: string;
150
161
  }): Promise<string>;
151
- encryptAES(message: string, privateKey: Buffer): Promise<string>;
152
- decryptAES(message: string, privateKey: Buffer): Promise<string>;
162
+ encryptAES(message: string, privateKey: string): Promise<string>;
163
+ decryptAES(message: string, privateKey: string): Promise<string>;
153
164
  getTransactionStatuses(transactionHashes: string[]): Promise<AirGapTransactionStatus[]>;
154
165
  }
@@ -78,23 +78,30 @@ var errors_1 = require("../../errors");
78
78
  var coinlib_error_1 = require("../../errors/coinlib-error");
79
79
  var DUST_AMOUNT = 50;
80
80
  var BitcoinProtocol = /** @class */ (function () {
81
- function BitcoinProtocol(options) {
82
- if (options === void 0) { options = new BitcoinProtocolOptions_1.BitcoinProtocolOptions(); }
83
- this.options = options;
84
- this.symbol = 'BTC';
85
- this.name = 'Bitcoin (Legacy)';
86
- this.marketSymbol = 'btc';
87
- this.feeSymbol = 'btc';
88
- this.subProtocols = [];
89
- this.feeDefaults = {
81
+ function BitcoinProtocol(_options) {
82
+ if (_options === void 0) { _options = new BitcoinProtocolOptions_1.BitcoinProtocolOptions(); }
83
+ this._options = _options;
84
+ this._symbol = 'BTC';
85
+ this.symbol = Promise.resolve(this._symbol);
86
+ this._name = 'Bitcoin (Legacy)';
87
+ this.name = Promise.resolve(this._name);
88
+ this._marketSymbol = 'btc';
89
+ this.marketSymbol = Promise.resolve(this._marketSymbol);
90
+ this._feeSymbol = 'btc';
91
+ this.feeSymbol = Promise.resolve(this._feeSymbol);
92
+ this._feeDefaults = {
90
93
  low: '0.00002',
91
94
  medium: '0.00004',
92
95
  high: '0.00005'
93
96
  };
94
- this.decimals = 8;
95
- this.feeDecimals = 8;
96
- this.identifier = ProtocolSymbols_1.MainProtocolSymbols.BTC;
97
- this.units = [
97
+ this.feeDefaults = Promise.resolve(this._feeDefaults);
98
+ this._decimals = 8;
99
+ this.decimals = Promise.resolve(this._decimals);
100
+ this._feeDecimals = 8;
101
+ this.feeDecimals = Promise.resolve(this._feeDecimals);
102
+ this._identifier = ProtocolSymbols_1.MainProtocolSymbols.BTC;
103
+ this.identifier = Promise.resolve(this._identifier);
104
+ this._units = [
98
105
  {
99
106
  unitSymbol: 'BTC',
100
107
  factor: '1'
@@ -108,24 +115,31 @@ var BitcoinProtocol = /** @class */ (function () {
108
115
  factor: '0.00000001'
109
116
  }
110
117
  ];
111
- this.supportsHD = true;
112
- this.standardDerivationPath = "m/44'/0'/0'";
113
- this.addressIsCaseSensitive = true;
114
- this.addressValidationPattern = '^(?:[13]{1}[a-km-zA-HJ-NP-Z1-9]{25,34}|bc1[a-z0-9]{39,59})$';
115
- this.addressPlaceholder = '1ABC...';
118
+ this.units = Promise.resolve(this._units);
119
+ this._supportsHD = true;
120
+ this.supportsHD = Promise.resolve(this._supportsHD);
121
+ this._standardDerivationPath = "m/44'/0'/0'";
122
+ this.standardDerivationPath = Promise.resolve(this._standardDerivationPath);
123
+ this._addressIsCaseSensitive = true;
124
+ this.addressIsCaseSensitive = Promise.resolve(this._addressIsCaseSensitive);
125
+ this._addressValidationPattern = '^(?:[13]{1}[a-km-zA-HJ-NP-Z1-9]{25,34}|bc1[a-z0-9]{39,59})$';
126
+ this.addressValidationPattern = Promise.resolve(this._addressValidationPattern);
127
+ this._addressPlaceholder = '1ABC...';
128
+ this.addressPlaceholder = Promise.resolve(this._addressPlaceholder);
129
+ this.options = Promise.resolve(this._options);
116
130
  this.cryptoClient = new BitcoinCryptoClient_1.BitcoinCryptoClient(this, bitcoinJSMessage);
117
131
  }
118
132
  BitcoinProtocol.prototype.getBlockExplorerLinkForAddress = function (address) {
119
133
  return __awaiter(this, void 0, void 0, function () {
120
134
  return __generator(this, function (_a) {
121
- return [2 /*return*/, this.options.network.blockExplorer.getAddressLink(address)];
135
+ return [2 /*return*/, this._options.network.blockExplorer.getAddressLink(address)];
122
136
  });
123
137
  });
124
138
  };
125
139
  BitcoinProtocol.prototype.getBlockExplorerLinkForTxId = function (txId) {
126
140
  return __awaiter(this, void 0, void 0, function () {
127
141
  return __generator(this, function (_a) {
128
- return [2 /*return*/, this.options.network.blockExplorer.getTransactionLink(txId)];
142
+ return [2 /*return*/, this._options.network.blockExplorer.getTransactionLink(txId)];
129
143
  });
130
144
  });
131
145
  };
@@ -160,7 +174,7 @@ var BitcoinProtocol = /** @class */ (function () {
160
174
  return __awaiter(this, void 0, void 0, function () {
161
175
  var bitcoinNode;
162
176
  return __generator(this, function (_a) {
163
- bitcoinNode = this.options.config.bitcoinJSLib.HDNode.fromSeedHex(secret, this.options.network.extras.network);
177
+ bitcoinNode = this._options.config.bitcoinJSLib.HDNode.fromSeedHex(secret, this._options.network.extras.network);
164
178
  return [2 /*return*/, bitcoinNode.derivePath(derivationPath).neutered().toBase58()];
165
179
  });
166
180
  });
@@ -169,8 +183,8 @@ var BitcoinProtocol = /** @class */ (function () {
169
183
  return __awaiter(this, void 0, void 0, function () {
170
184
  var bitcoinNode;
171
185
  return __generator(this, function (_a) {
172
- bitcoinNode = this.options.config.bitcoinJSLib.HDNode.fromSeedHex(secret, this.options.network.extras.network);
173
- return [2 /*return*/, bitcoinNode.derivePath(derivationPath).keyPair.d.toBuffer(32)];
186
+ bitcoinNode = this._options.config.bitcoinJSLib.HDNode.fromSeedHex(secret, this._options.network.extras.network);
187
+ return [2 /*return*/, bitcoinNode.derivePath(derivationPath).keyPair.d.toBuffer(32).toString('hex')];
174
188
  });
175
189
  });
176
190
  };
@@ -178,25 +192,29 @@ var BitcoinProtocol = /** @class */ (function () {
178
192
  return __awaiter(this, void 0, void 0, function () {
179
193
  var bitcoinNode;
180
194
  return __generator(this, function (_a) {
181
- bitcoinNode = this.options.config.bitcoinJSLib.HDNode.fromSeedHex(secret, this.options.network.extras.network);
195
+ bitcoinNode = this._options.config.bitcoinJSLib.HDNode.fromSeedHex(secret, this._options.network.extras.network);
182
196
  return [2 /*return*/, bitcoinNode.derivePath(derivationPath).toBase58()];
183
197
  });
184
198
  });
185
199
  };
186
- BitcoinProtocol.prototype.getAddressFromPublicKey = function (publicKey) {
200
+ BitcoinProtocol.prototype.getAddressFromPublicKey = function (publicKey, cursor) {
187
201
  return __awaiter(this, void 0, void 0, function () {
188
- var node;
202
+ var node, address;
189
203
  return __generator(this, function (_a) {
190
- node = this.options.config.bitcoinJSLib.HDNode.fromBase58(publicKey, this.options.network.extras.network);
191
- return [2 /*return*/, BitcoinAddress_1.BitcoinAddress.from(node)];
204
+ node = this._options.config.bitcoinJSLib.HDNode.fromBase58(publicKey, this._options.network.extras.network);
205
+ address = BitcoinAddress_1.BitcoinAddress.from(node);
206
+ return [2 /*return*/, {
207
+ address: address.asString(),
208
+ cursor: { hasNext: false }
209
+ }];
192
210
  });
193
211
  });
194
212
  };
195
- BitcoinProtocol.prototype.getAddressesFromPublicKey = function (publicKey) {
213
+ BitcoinProtocol.prototype.getAddressesFromPublicKey = function (publicKey, cursor) {
196
214
  return __awaiter(this, void 0, void 0, function () {
197
215
  return __generator(this, function (_a) {
198
216
  switch (_a.label) {
199
- case 0: return [4 /*yield*/, this.getAddressFromPublicKey(publicKey)];
217
+ case 0: return [4 /*yield*/, this.getAddressFromPublicKey(publicKey, cursor)];
200
218
  case 1: return [2 /*return*/, [_a.sent()]];
201
219
  }
202
220
  });
@@ -204,10 +222,14 @@ var BitcoinProtocol = /** @class */ (function () {
204
222
  };
205
223
  BitcoinProtocol.prototype.getAddressFromExtendedPublicKey = function (extendedPublicKey, visibilityDerivationIndex, addressDerivationIndex) {
206
224
  return __awaiter(this, void 0, void 0, function () {
207
- var node;
225
+ var node, address;
208
226
  return __generator(this, function (_a) {
209
- node = this.options.config.bitcoinJSLib.HDNode.fromBase58(extendedPublicKey, this.options.network.extras.network);
210
- return [2 /*return*/, BitcoinAddress_1.BitcoinAddress.from(node, visibilityDerivationIndex, addressDerivationIndex)];
227
+ node = this._options.config.bitcoinJSLib.HDNode.fromBase58(extendedPublicKey, this._options.network.extras.network);
228
+ address = BitcoinAddress_1.BitcoinAddress.from(node, visibilityDerivationIndex, addressDerivationIndex);
229
+ return [2 /*return*/, {
230
+ address: address.asString(),
231
+ cursor: { hasNext: false }
232
+ }];
211
233
  });
212
234
  });
213
235
  };
@@ -215,18 +237,15 @@ var BitcoinProtocol = /** @class */ (function () {
215
237
  return __awaiter(this, void 0, void 0, function () {
216
238
  var node, generatorArray;
217
239
  return __generator(this, function (_a) {
218
- node = this.options.config.bitcoinJSLib.HDNode.fromBase58(extendedPublicKey, this.options.network.extras.network);
240
+ node = this._options.config.bitcoinJSLib.HDNode.fromBase58(extendedPublicKey, this._options.network.extras.network);
219
241
  generatorArray = Array.from(new Array(addressCount), function (_, i) { return i + offset; });
220
- return [2 /*return*/, Promise.all(generatorArray.map(function (x) { return BitcoinAddress_1.BitcoinAddress.from(node, visibilityDerivationIndex, x); }))];
221
- });
222
- });
223
- };
224
- BitcoinProtocol.prototype.getNextAddressFromPublicKey = function (publicKey, current) {
225
- return __awaiter(this, void 0, void 0, function () {
226
- var node;
227
- return __generator(this, function (_a) {
228
- node = this.options.config.bitcoinJSLib.HDNode.fromBase58(publicKey, this.options.network.extras.network);
229
- return [2 /*return*/, BitcoinAddress_1.BitcoinAddress.from(node, current.visibilityDerivationIndex, current.addressDerivationIndex !== undefined ? current.addressDerivationIndex + 1 : undefined)];
242
+ return [2 /*return*/, Promise.all(generatorArray.map(function (x) {
243
+ var address = BitcoinAddress_1.BitcoinAddress.from(node, visibilityDerivationIndex, x);
244
+ return {
245
+ address: address.asString(),
246
+ cursor: { hasNext: false }
247
+ };
248
+ }))];
230
249
  });
231
250
  });
232
251
  };
@@ -236,7 +255,7 @@ var BitcoinProtocol = /** @class */ (function () {
236
255
  return __generator(this, function (_d) {
237
256
  switch (_d.label) {
238
257
  case 0:
239
- transactionBuilder = new this.options.config.bitcoinJSLib.TransactionBuilder(this.options.network.extras.network);
258
+ transactionBuilder = new this._options.config.bitcoinJSLib.TransactionBuilder(this._options.network.extras.network);
240
259
  for (_i = 0, _a = transaction.ins; _i < _a.length; _i++) {
241
260
  input = _a[_i];
242
261
  transactionBuilder.addInput(input.txId, input.vout);
@@ -247,9 +266,9 @@ var BitcoinProtocol = /** @class */ (function () {
247
266
  if (!(_b < _c.length)) return [3 /*break*/, 5];
248
267
  output = _c[_b];
249
268
  if (!output.isChange) return [3 /*break*/, 3];
250
- return [4 /*yield*/, this.getAddressFromPublicKey(privateKey.toString('hex'))];
269
+ return [4 /*yield*/, this.getAddressFromPublicKey(privateKey)];
251
270
  case 2:
252
- generatedChangeAddress = (_d.sent()).getValue();
271
+ generatedChangeAddress = (_d.sent()).address;
253
272
  if (generatedChangeAddress !== output.recipient) {
254
273
  throw new errors_1.ConditionViolationError(coinlib_error_1.Domain.BITCOIN, 'Change address could not be verified.');
255
274
  }
@@ -262,7 +281,7 @@ var BitcoinProtocol = /** @class */ (function () {
262
281
  return [3 /*break*/, 1];
263
282
  case 5:
264
283
  for (i = 0; i < transaction.ins.length; i++) {
265
- transactionBuilder.sign(i, privateKey);
284
+ transactionBuilder.sign(i, Buffer.from(privateKey, 'hex'));
266
285
  }
267
286
  return [2 /*return*/, transactionBuilder.build().toHex()];
268
287
  }
@@ -275,8 +294,8 @@ var BitcoinProtocol = /** @class */ (function () {
275
294
  return __generator(this, function (_d) {
276
295
  switch (_d.label) {
277
296
  case 0:
278
- transactionBuilder = new this.options.config.bitcoinJSLib.TransactionBuilder(this.options.network.extras.network);
279
- node = this.options.config.bitcoinJSLib.HDNode.fromBase58(extendedPrivateKey, this.options.network.extras.network);
297
+ transactionBuilder = new this._options.config.bitcoinJSLib.TransactionBuilder(this._options.network.extras.network);
298
+ node = this._options.config.bitcoinJSLib.HDNode.fromBase58(extendedPrivateKey, this._options.network.extras.network);
280
299
  for (_i = 0, _a = transaction.ins; _i < _a.length; _i++) {
281
300
  input = _a[_i];
282
301
  transactionBuilder.addInput(input.txId, input.vout);
@@ -293,7 +312,7 @@ var BitcoinProtocol = /** @class */ (function () {
293
312
  if (!output.derivationPath) return [3 /*break*/, 3];
294
313
  return [4 /*yield*/, this.getAddressesFromExtendedPublicKey(extendedPrivateKey, 1, 1, parseInt(output.derivationPath, 10))];
295
314
  case 2:
296
- generatedChangeAddress = (_d.sent()).map(function (address) { return address.getValue(); });
315
+ generatedChangeAddress = (_d.sent()).map(function (address) { return address.address; });
297
316
  changeAddressIsValid = generatedChangeAddress.includes(output.recipient);
298
317
  return [3 /*break*/, 7];
299
318
  case 3:
@@ -303,7 +322,7 @@ var BitcoinProtocol = /** @class */ (function () {
303
322
  if (!(x < changeAddressMaxAddresses)) return [3 /*break*/, 7];
304
323
  return [4 /*yield*/, this.getAddressesFromExtendedPublicKey(extendedPrivateKey, 1, changeAddressBatchSize, x)];
305
324
  case 5:
306
- addresses = (_d.sent()).map(function (address) { return address.getValue(); });
325
+ addresses = (_d.sent()).map(function (address) { return address.address; });
307
326
  if (addresses.indexOf(output.recipient) >= 0) {
308
327
  changeAddressIsValid = true;
309
328
  x = changeAddressMaxAddresses;
@@ -357,8 +376,8 @@ var BitcoinProtocol = /** @class */ (function () {
357
376
  .reduce(function (accumulator, currentValue) { return accumulator.plus(currentValue); })
358
377
  .toString(10),
359
378
  fee: feeCalculator.toString(10),
360
- protocolIdentifier: this.identifier,
361
- network: this.options.network,
379
+ protocolIdentifier: this._identifier,
380
+ network: this._options.network,
362
381
  isInbound: false,
363
382
  transactionDetails: unsignedTx.transaction,
364
383
  warnings: warnings
@@ -377,14 +396,14 @@ var BitcoinProtocol = /** @class */ (function () {
377
396
  from: signedTx.from,
378
397
  amount: signedTx.amount,
379
398
  fee: signedTx.fee,
380
- protocolIdentifier: this.identifier,
381
- network: this.options.network,
399
+ protocolIdentifier: this._identifier,
400
+ network: this._options.network,
382
401
  isInbound: false,
383
402
  transactionDetails: signedTx.transaction
384
403
  };
385
- bitcoinTx = this.options.config.bitcoinJSLib.Transaction.fromHex(signedTx.transaction);
404
+ bitcoinTx = this._options.config.bitcoinJSLib.Transaction.fromHex(signedTx.transaction);
386
405
  bitcoinTx.outs.forEach(function (output) {
387
- var address = _this.options.config.bitcoinJSLib.address.fromOutputScript(output.script, _this.options.network.extras.network);
406
+ var address = _this._options.config.bitcoinJSLib.address.fromOutputScript(output.script, _this._options.network.extras.network);
388
407
  // only works if one output is target and rest is change, but this way we can filter out change addresses
389
408
  if (new bignumber_1.default(output.value).isEqualTo(signedTx.amount)) {
390
409
  tx.to.push(address);
@@ -406,7 +425,7 @@ var BitcoinProtocol = /** @class */ (function () {
406
425
  case 1:
407
426
  if (!(_i < addresses_1.length)) return [3 /*break*/, 4];
408
427
  address = addresses_1[_i];
409
- return [4 /*yield*/, index_1.default.get(this.options.network.extras.indexerApi + "/api/v2/address/" + address + "?details=basic", {
428
+ return [4 /*yield*/, index_1.default.get(this._options.network.extras.indexerApi + "/api/v2/address/" + address + "?details=basic", {
410
429
  responseType: 'json'
411
430
  })];
412
431
  case 2:
@@ -429,7 +448,7 @@ var BitcoinProtocol = /** @class */ (function () {
429
448
  case 0: return [4 /*yield*/, this.getAddressFromPublicKey(publicKey)];
430
449
  case 1:
431
450
  address = _a.sent();
432
- return [2 /*return*/, this.getBalanceOfAddresses([address.getValue()])];
451
+ return [2 /*return*/, this.getBalanceOfAddresses([address.address])];
433
452
  }
434
453
  });
435
454
  });
@@ -440,7 +459,7 @@ var BitcoinProtocol = /** @class */ (function () {
440
459
  var data;
441
460
  return __generator(this, function (_a) {
442
461
  switch (_a.label) {
443
- case 0: return [4 /*yield*/, index_1.default.get(this.options.network.extras.indexerApi + "/api/v2/xpub/" + extendedPublicKey + "?pageSize=1", {
462
+ case 0: return [4 /*yield*/, index_1.default.get(this._options.network.extras.indexerApi + "/api/v2/xpub/" + extendedPublicKey + "?pageSize=1", {
444
463
  responseType: 'json'
445
464
  })];
446
465
  case 1:
@@ -483,10 +502,10 @@ var BitcoinProtocol = /** @class */ (function () {
483
502
  var result, estimatedFee, feeStepFactor, mediumFee, lowFee, highFee;
484
503
  return __generator(this, function (_a) {
485
504
  switch (_a.label) {
486
- case 0: return [4 /*yield*/, index_1.default.get(this.options.network.extras.indexerApi + "/api/v2/estimatefee/5")];
505
+ case 0: return [4 /*yield*/, index_1.default.get(this._options.network.extras.indexerApi + "/api/v2/estimatefee/5")];
487
506
  case 1:
488
507
  result = (_a.sent()).data.result;
489
- estimatedFee = new bignumber_1.default(result).shiftedBy(this.feeDecimals);
508
+ estimatedFee = new bignumber_1.default(result).shiftedBy(this._feeDecimals);
490
509
  if (estimatedFee.isZero()) {
491
510
  return [2 /*return*/, this.feeDefaults];
492
511
  }
@@ -526,7 +545,7 @@ var BitcoinProtocol = /** @class */ (function () {
526
545
  throw new errors_1.ConditionViolationError(coinlib_error_1.Domain.BITCOIN, 'recipients do not match values');
527
546
  }
528
547
  return [4 /*yield*/, index_1.default
529
- .get(this.options.network.extras.indexerApi + "/api/v2/utxo/" + extendedPublicKey + "?confirmed=true", {
548
+ .get(this._options.network.extras.indexerApi + "/api/v2/utxo/" + extendedPublicKey + "?confirmed=true", {
530
549
  responseType: 'json'
531
550
  })
532
551
  .catch(function (error) {
@@ -562,7 +581,7 @@ var BitcoinProtocol = /** @class */ (function () {
562
581
  return [4 /*yield*/, this.getAddressFromExtendedPublicKey(extendedPublicKey, indexes[0], indexes[1])];
563
582
  case 3:
564
583
  derivedAddress = _a.sent();
565
- if (derivedAddress.getValue() === utxo.address) {
584
+ if (derivedAddress.address === utxo.address) {
566
585
  transaction.ins.push({
567
586
  txId: utxo.txid,
568
587
  value: new bignumber_1.default(utxo.value).toString(10),
@@ -605,7 +624,7 @@ var BitcoinProtocol = /** @class */ (function () {
605
624
  case 6:
606
625
  derivedAddress = _a.sent();
607
626
  transaction.outs.push({
608
- recipient: derivedAddress.getValue(),
627
+ recipient: derivedAddress.address,
609
628
  isChange: true,
610
629
  value: changeValue.toString(10),
611
630
  derivationPath: changeAddressIndex.toString()
@@ -633,8 +652,8 @@ var BitcoinProtocol = /** @class */ (function () {
633
652
  }
634
653
  return [4 /*yield*/, this.getAddressFromPublicKey(publicKey)];
635
654
  case 1:
636
- address = (_a.sent()).getValue();
637
- return [4 /*yield*/, index_1.default.get(this.options.network.extras.indexerApi + "/api/v2/utxo/" + address, {
655
+ address = (_a.sent()).address;
656
+ return [4 /*yield*/, index_1.default.get(this._options.network.extras.indexerApi + "/api/v2/utxo/" + address, {
638
657
  responseType: 'json'
639
658
  })];
640
659
  case 2:
@@ -687,7 +706,7 @@ var BitcoinProtocol = /** @class */ (function () {
687
706
  var data;
688
707
  return __generator(this, function (_a) {
689
708
  switch (_a.label) {
690
- case 0: return [4 /*yield*/, index_1.default.post(this.options.network.extras.indexerApi + '/api/v2/sendtx/', rawTransaction)];
709
+ case 0: return [4 /*yield*/, index_1.default.post(this._options.network.extras.indexerApi + '/api/v2/sendtx/', rawTransaction)];
691
710
  case 1:
692
711
  data = (_a.sent()).data;
693
712
  return [2 /*return*/, data.result];
@@ -704,7 +723,7 @@ var BitcoinProtocol = /** @class */ (function () {
704
723
  switch (_g.label) {
705
724
  case 0:
706
725
  page = (_a = cursor === null || cursor === void 0 ? void 0 : cursor.page) !== null && _a !== void 0 ? _a : 1;
707
- return [4 /*yield*/, index_1.default.get(this.options.network.extras.indexerApi +
726
+ return [4 /*yield*/, index_1.default.get(this._options.network.extras.indexerApi +
708
727
  '/api/v2/xpub/' +
709
728
  extendedPublicKey +
710
729
  ("?details=txs&tokens=used&pageSize=" + limit + "&page=" + page), {
@@ -754,8 +773,8 @@ var BitcoinProtocol = /** @class */ (function () {
754
773
  amount: amount.toString(10),
755
774
  fee: new bignumber_1.default(transaction.fees).toString(10),
756
775
  blockHeight: transaction.blockHeight.toString(),
757
- protocolIdentifier: this.identifier,
758
- network: this.options.network,
776
+ protocolIdentifier: this._identifier,
777
+ network: this._options.network,
759
778
  timestamp: transaction.blockTime
760
779
  };
761
780
  airGapTransactions.push(airGapTransaction);
@@ -779,7 +798,7 @@ var BitcoinProtocol = /** @class */ (function () {
779
798
  case 0: return [4 /*yield*/, this.getAddressFromPublicKey(publicKey)];
780
799
  case 1:
781
800
  address = _a.sent();
782
- return [2 /*return*/, this.getTransactionsFromAddresses([address.getValue()], limit, cursor)];
801
+ return [2 /*return*/, this.getTransactionsFromAddresses([address.address], limit, cursor)];
783
802
  }
784
803
  });
785
804
  });
@@ -793,7 +812,7 @@ var BitcoinProtocol = /** @class */ (function () {
793
812
  case 0:
794
813
  airGapTransactions = [];
795
814
  page = (_a = cursor === null || cursor === void 0 ? void 0 : cursor.page) !== null && _a !== void 0 ? _a : 1;
796
- url = this.options.network.extras.indexerApi + "/api/v2/address/" + addresses[0] + "?page=" + page + "&pageSize=" + limit + "&details=txs";
815
+ url = this._options.network.extras.indexerApi + "/api/v2/address/" + addresses[0] + "?page=" + page + "&pageSize=" + limit + "&details=txs";
797
816
  return [4 /*yield*/, index_1.default.get(url, {
798
817
  responseType: 'json'
799
818
  })];
@@ -839,8 +858,8 @@ var BitcoinProtocol = /** @class */ (function () {
839
858
  amount: amount.toString(10),
840
859
  fee: new bignumber_1.default(transaction.fees).toString(10),
841
860
  blockHeight: transaction.blockHeight.toString(),
842
- protocolIdentifier: this.identifier,
843
- network: this.options.network,
861
+ protocolIdentifier: this._identifier,
862
+ network: this._options.network,
844
863
  timestamp: transaction.blockTime
845
864
  };
846
865
  airGapTransactions.push(airGapTransaction);
@@ -883,7 +902,7 @@ var BitcoinProtocol = /** @class */ (function () {
883
902
  return __awaiter(this, void 0, void 0, function () {
884
903
  var childPublicKey;
885
904
  return __generator(this, function (_a) {
886
- childPublicKey = this.options.config.bitcoinJSLib.HDNode.fromBase58(publicKey, this.options.network.extras.network)
905
+ childPublicKey = this._options.config.bitcoinJSLib.HDNode.fromBase58(publicKey, this._options.network.extras.network)
887
906
  .derive(0)
888
907
  .derive(0)
889
908
  .getPublicKeyBuffer();
@@ -895,11 +914,11 @@ var BitcoinProtocol = /** @class */ (function () {
895
914
  return __awaiter(this, void 0, void 0, function () {
896
915
  var childPrivateKey;
897
916
  return __generator(this, function (_a) {
898
- childPrivateKey = this.options.config.bitcoinJSLib.HDNode.fromBase58(keypair.privateKey.toString('hex'), this.options.network.extras.network)
917
+ childPrivateKey = this._options.config.bitcoinJSLib.HDNode.fromBase58(keypair.privateKey, this._options.network.extras.network)
899
918
  .derive(0)
900
919
  .derive(0)
901
920
  .keyPair.d.toBuffer(32);
902
- return [2 /*return*/, this.cryptoClient.decryptAsymmetric(message, { publicKey: '', privateKey: childPrivateKey })];
921
+ return [2 /*return*/, this.cryptoClient.decryptAsymmetric(message, { publicKey: '', privateKey: childPrivateKey.toString('hex') })];
903
922
  });
904
923
  });
905
924
  };