@teleportdao/bitcoin 1.7.19 → 1.7.21

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 (44) hide show
  1. package/.tmp/rbf.ts +24 -27
  2. package/dist/helper/teleswap-helper.d.ts.map +1 -1
  3. package/dist/helper/teleswap-helper.js +6 -5
  4. package/dist/helper/teleswap-helper.js.map +1 -1
  5. package/package.json +3 -3
  6. package/src/bitcoin-interface-ordinal.ts +181 -181
  7. package/src/bitcoin-interface-teleswap.ts +252 -252
  8. package/src/bitcoin-interface-utils.ts +60 -60
  9. package/src/bitcoin-interface.ts +241 -241
  10. package/src/bitcoin-utils.ts +591 -591
  11. package/src/bitcoin-wallet-base.ts +310 -310
  12. package/src/helper/brc20-helper.ts +181 -181
  13. package/src/helper/ordinal-helper.ts +118 -118
  14. package/src/helper/teleswap-helper.ts +6 -5
  15. package/src/index.ts +15 -15
  16. package/src/ordinal-wallet.ts +738 -738
  17. package/src/sign/index.ts +1 -1
  18. package/src/sign/sign-transaction.ts +108 -108
  19. package/src/teleswap-wallet.ts +155 -155
  20. package/src/transaction-builder/bitcoin-transaction-builder.ts +44 -44
  21. package/src/transaction-builder/index.ts +3 -3
  22. package/src/transaction-builder/ordinal-transaction-builder.ts +147 -147
  23. package/src/transaction-builder/transaction-builder.ts +706 -706
  24. package/src/type.ts +48 -48
  25. package/src/utils/networks.ts +33 -33
  26. package/src/utils/tools.ts +90 -90
  27. package/tsconfig.json +9 -9
  28. package/webpack.config.js +16 -16
  29. package/dist/bitcoin-base.d.ts +0 -93
  30. package/dist/bitcoin-base.d.ts.map +0 -1
  31. package/dist/bitcoin-base.js +0 -236
  32. package/dist/bitcoin-base.js.map +0 -1
  33. package/dist/helper/burn-request-helper.d.ts +0 -7
  34. package/dist/helper/burn-request-helper.d.ts.map +0 -1
  35. package/dist/helper/burn-request-helper.js +0 -26
  36. package/dist/helper/burn-request-helper.js.map +0 -1
  37. package/dist/helper/teleport-request-helper.d.ts +0 -47
  38. package/dist/helper/teleport-request-helper.d.ts.map +0 -1
  39. package/dist/helper/teleport-request-helper.js +0 -146
  40. package/dist/helper/teleport-request-helper.js.map +0 -1
  41. package/dist/teleport-dao-payments.d.ts +0 -76
  42. package/dist/teleport-dao-payments.d.ts.map +0 -1
  43. package/dist/teleport-dao-payments.js +0 -217
  44. package/dist/teleport-dao-payments.js.map +0 -1
@@ -1,252 +1,252 @@
1
- import { bitcoin } from "@teleportdao/providers"
2
- import { parseBlockHeader } from "./bitcoin-utils"
3
- import {
4
- checkAndParseWrapRequest,
5
- getBurnTransactionInfo,
6
- UnwrapInfo,
7
- WrapOpReturnWithType,
8
- } from "./helper/teleswap-helper"
9
- import BitcoinInterface from "./bitcoin-interface"
10
- import { Transaction } from "./type"
11
-
12
- export type ValidWrapRequest = {
13
- transaction: bitcoin.Types.ConfirmedTransaction & {
14
- address?: string
15
- addressScript?: string
16
- merkleProof?: Transaction["merkleProof"]
17
- }
18
- request: {
19
- status: boolean
20
- data: WrapOpReturnWithType
21
- value: number
22
- valueOutputIndex: number
23
- }
24
- lockerAddress: string
25
- lockerLockingScript: string
26
- }
27
-
28
- export type InValidWrapRequest = {
29
- transaction: bitcoin.Types.ConfirmedTransaction & {
30
- address?: string
31
- addressScript?: string
32
- merkleProof?: Transaction["merkleProof"]
33
- }
34
- request: {
35
- status: boolean
36
- message: string
37
- code: string
38
- }
39
- lockerAddress: string
40
- lockerLockingScript: string
41
- }
42
-
43
- export type UnwrapRequest = {
44
- burnInfo: UnwrapInfo | undefined
45
- lockerAddress: string
46
- lockerLockingScript: string
47
- }
48
-
49
- export class BitcoinInterfaceTeleswap extends BitcoinInterface {
50
- // relayer
51
- async getHexBlockHeaders(startBlockNumber: number, endBlockNumber: number) {
52
- const blockHeaders = []
53
- let difficulty = null
54
- let hexBlockHeaders = ""
55
-
56
- let fromBlockNumber = startBlockNumber
57
- for (let blockNumber = startBlockNumber; blockNumber <= endBlockNumber; blockNumber += 1) {
58
- let blockHeader = await this.getBlockHeaderHex(blockNumber)
59
- console.log("block", blockNumber)
60
- let parsedBlockHeader = parseBlockHeader(blockHeader)
61
- if (difficulty && parsedBlockHeader.difficulty !== difficulty) {
62
- blockHeaders.push({
63
- hexBlockHeaders,
64
- fromBlockNumber,
65
- toBlockNumber: blockNumber - 1,
66
- difficulty,
67
- })
68
- hexBlockHeaders = blockHeader
69
- fromBlockNumber = blockNumber
70
- } else {
71
- hexBlockHeaders += blockHeader
72
- }
73
- difficulty = parsedBlockHeader.difficulty
74
- }
75
- if (hexBlockHeaders) {
76
- blockHeaders.push({
77
- hexBlockHeaders,
78
- fromBlockNumber,
79
- toBlockNumber: endBlockNumber,
80
- difficulty,
81
- })
82
- }
83
-
84
- return blockHeaders
85
- }
86
-
87
- async getWrapRequests(addresses: string[], startblockNumber: number, endBlockNumber: number) {
88
- // transaction in StartBlock is not returned --> (startblockNumber,endBlockNumber]
89
- let transactions = await this.getMultipleBlocksTransactions(
90
- addresses,
91
- startblockNumber,
92
- endBlockNumber,
93
- )
94
-
95
- let requests: ValidWrapRequest[] = []
96
- let invalidRequests: InValidWrapRequest[] = []
97
-
98
- for (let inputTx of transactions) {
99
- let { transaction, request, lockerAddress, lockerLockingScript } =
100
- await this.getWrapRequestByTx(inputTx, inputTx.address)
101
- if (request.status && "data" in request && request.data) {
102
- requests.push({
103
- transaction,
104
- request,
105
- lockerAddress,
106
- lockerLockingScript,
107
- })
108
- } else if (request.code !== "NO_OP_RETURN") {
109
- invalidRequests.push({ transaction, request, lockerAddress, lockerLockingScript })
110
- }
111
- }
112
- return { requests, invalidRequests }
113
- }
114
-
115
- async getMempoolWrapRequests(addresses: string[]) {
116
- // transaction in StartBlock is not returned --> (startblockNumber,endBlockNumber]
117
- let transactions = await this.apiProvider.getMempoolTransactionHistoryForMultipleAddresses(
118
- addresses,
119
- )
120
-
121
- let requests = []
122
- let invalidRequests = []
123
-
124
- for (let inputTx of transactions) {
125
- let { transaction, request, lockerAddress, lockerLockingScript } =
126
- await this.getWrapRequestByTx(inputTx, inputTx.address)
127
- if (request.status) {
128
- requests.push({ transaction, request, lockerAddress, lockerLockingScript })
129
- } else if (request.code !== "NO_OP_RETURN") {
130
- invalidRequests.push({ transaction, request, lockerAddress, lockerLockingScript })
131
- }
132
- }
133
- return { requests, invalidRequests }
134
- }
135
-
136
- async getWrapRequestByTx(
137
- inputTransaction:
138
- | { txId: string }
139
- | (bitcoin.Types.ConfirmedTransaction & {
140
- address?: string
141
- addressScript?: string
142
- merkleProof?: Transaction["merkleProof"]
143
- }),
144
- lockerAddress: string,
145
- ) {
146
- let transaction: bitcoin.Types.ConfirmedTransaction & {
147
- address?: string
148
- addressScript?: string
149
- merkleProof?: Transaction["merkleProof"]
150
- }
151
- if ("vout" in inputTransaction && "blockNumber" in inputTransaction) {
152
- transaction = inputTransaction
153
- } else {
154
- if (!inputTransaction.txId) throw new Error("txId not exist")
155
- transaction = await this.getTransaction(inputTransaction.txId)
156
- }
157
-
158
- let vout = transaction.vout
159
- let request = checkAndParseWrapRequest(vout!, lockerAddress)
160
- let lockerLockingScript: string =
161
- transaction.addressScript ||
162
- this.convertAddressToScript(lockerAddress).script!.toString("hex")
163
-
164
- return {
165
- transaction,
166
- request,
167
- lockerAddress,
168
- lockerLockingScript,
169
- }
170
- }
171
-
172
- async getLockersUnWrapTransactions(
173
- addresses: string[],
174
- startBlockNumber: number,
175
- endBlockNumber: number,
176
- ) {
177
- let transactions = await this.getMultipleBlocksTransactions(
178
- addresses,
179
- startBlockNumber,
180
- endBlockNumber,
181
- )
182
-
183
- let validTxs = []
184
- for (let transaction of transactions) {
185
- let address = transaction.address
186
- // check if its a transaction to spend btc
187
- let txBurnInfo = await this.getTransactionUnwrapInfoByTx(transaction, address)
188
- if (txBurnInfo) {
189
- const { burnInfo, lockerAddress, lockerLockingScript } = txBurnInfo
190
- validTxs.push({
191
- transaction,
192
- burnInfo,
193
- lockerAddress,
194
- lockerLockingScript,
195
- })
196
- }
197
- }
198
- return validTxs
199
- }
200
-
201
- async getLockersUnwrapMEmpoolTransactions(
202
- addresses: string[],
203
- startBlockNumber: number,
204
- endBlockNumber: number,
205
- ) {
206
- let transactions = await this.getMultipleBlocksTransactions(
207
- addresses,
208
- startBlockNumber,
209
- endBlockNumber,
210
- )
211
-
212
- let validTxs = []
213
- for (let transaction of transactions) {
214
- let address = transaction.address
215
- // check if its a transaction to spend btc
216
- let txBurnInfo = await this.getTransactionUnwrapInfoByTx(transaction, address)
217
- if (txBurnInfo) {
218
- const { burnInfo, lockerAddress, lockerLockingScript } = txBurnInfo
219
- validTxs.push({
220
- transaction,
221
- burnInfo,
222
- lockerAddress,
223
- lockerLockingScript,
224
- })
225
- }
226
- }
227
- return validTxs
228
- }
229
-
230
- async getTransactionUnwrapInfoByTx(
231
- transaction: {
232
- txId: any
233
- vout?: any
234
- vin?: any
235
- addressScript?: any
236
- },
237
- lockerAddress: string,
238
- ) {
239
- if (!transaction.txId) throw new Error("txId not exist")
240
- let vin = transaction.vin || (await this.getTransaction(transaction.txId)).vin
241
- let burnInfo = getBurnTransactionInfo(lockerAddress, vin, transaction.vout)
242
- if (!burnInfo) return
243
- let lockerLockingScript: string =
244
- transaction.addressScript ||
245
- this.convertAddressToScript(lockerAddress).script!.toString("hex")
246
- return {
247
- burnInfo,
248
- lockerAddress,
249
- lockerLockingScript,
250
- } as UnwrapRequest
251
- }
252
- }
1
+ import { bitcoin } from "@teleportdao/providers"
2
+ import { parseBlockHeader } from "./bitcoin-utils"
3
+ import {
4
+ checkAndParseWrapRequest,
5
+ getBurnTransactionInfo,
6
+ UnwrapInfo,
7
+ WrapOpReturnWithType,
8
+ } from "./helper/teleswap-helper"
9
+ import BitcoinInterface from "./bitcoin-interface"
10
+ import { Transaction } from "./type"
11
+
12
+ export type ValidWrapRequest = {
13
+ transaction: bitcoin.Types.ConfirmedTransaction & {
14
+ address?: string
15
+ addressScript?: string
16
+ merkleProof?: Transaction["merkleProof"]
17
+ }
18
+ request: {
19
+ status: boolean
20
+ data: WrapOpReturnWithType
21
+ value: number
22
+ valueOutputIndex: number
23
+ }
24
+ lockerAddress: string
25
+ lockerLockingScript: string
26
+ }
27
+
28
+ export type InValidWrapRequest = {
29
+ transaction: bitcoin.Types.ConfirmedTransaction & {
30
+ address?: string
31
+ addressScript?: string
32
+ merkleProof?: Transaction["merkleProof"]
33
+ }
34
+ request: {
35
+ status: boolean
36
+ message: string
37
+ code: string
38
+ }
39
+ lockerAddress: string
40
+ lockerLockingScript: string
41
+ }
42
+
43
+ export type UnwrapRequest = {
44
+ burnInfo: UnwrapInfo | undefined
45
+ lockerAddress: string
46
+ lockerLockingScript: string
47
+ }
48
+
49
+ export class BitcoinInterfaceTeleswap extends BitcoinInterface {
50
+ // relayer
51
+ async getHexBlockHeaders(startBlockNumber: number, endBlockNumber: number) {
52
+ const blockHeaders = []
53
+ let difficulty = null
54
+ let hexBlockHeaders = ""
55
+
56
+ let fromBlockNumber = startBlockNumber
57
+ for (let blockNumber = startBlockNumber; blockNumber <= endBlockNumber; blockNumber += 1) {
58
+ let blockHeader = await this.getBlockHeaderHex(blockNumber)
59
+ console.log("block", blockNumber)
60
+ let parsedBlockHeader = parseBlockHeader(blockHeader)
61
+ if (difficulty && parsedBlockHeader.difficulty !== difficulty) {
62
+ blockHeaders.push({
63
+ hexBlockHeaders,
64
+ fromBlockNumber,
65
+ toBlockNumber: blockNumber - 1,
66
+ difficulty,
67
+ })
68
+ hexBlockHeaders = blockHeader
69
+ fromBlockNumber = blockNumber
70
+ } else {
71
+ hexBlockHeaders += blockHeader
72
+ }
73
+ difficulty = parsedBlockHeader.difficulty
74
+ }
75
+ if (hexBlockHeaders) {
76
+ blockHeaders.push({
77
+ hexBlockHeaders,
78
+ fromBlockNumber,
79
+ toBlockNumber: endBlockNumber,
80
+ difficulty,
81
+ })
82
+ }
83
+
84
+ return blockHeaders
85
+ }
86
+
87
+ async getWrapRequests(addresses: string[], startblockNumber: number, endBlockNumber: number) {
88
+ // transaction in StartBlock is not returned --> (startblockNumber,endBlockNumber]
89
+ let transactions = await this.getMultipleBlocksTransactions(
90
+ addresses,
91
+ startblockNumber,
92
+ endBlockNumber,
93
+ )
94
+
95
+ let requests: ValidWrapRequest[] = []
96
+ let invalidRequests: InValidWrapRequest[] = []
97
+
98
+ for (let inputTx of transactions) {
99
+ let { transaction, request, lockerAddress, lockerLockingScript } =
100
+ await this.getWrapRequestByTx(inputTx, inputTx.address)
101
+ if (request.status && "data" in request && request.data) {
102
+ requests.push({
103
+ transaction,
104
+ request,
105
+ lockerAddress,
106
+ lockerLockingScript,
107
+ })
108
+ } else if (request.code !== "NO_OP_RETURN") {
109
+ invalidRequests.push({ transaction, request, lockerAddress, lockerLockingScript })
110
+ }
111
+ }
112
+ return { requests, invalidRequests }
113
+ }
114
+
115
+ async getMempoolWrapRequests(addresses: string[]) {
116
+ // transaction in StartBlock is not returned --> (startblockNumber,endBlockNumber]
117
+ let transactions = await this.apiProvider.getMempoolTransactionHistoryForMultipleAddresses(
118
+ addresses,
119
+ )
120
+
121
+ let requests = []
122
+ let invalidRequests = []
123
+
124
+ for (let inputTx of transactions) {
125
+ let { transaction, request, lockerAddress, lockerLockingScript } =
126
+ await this.getWrapRequestByTx(inputTx, inputTx.address)
127
+ if (request.status) {
128
+ requests.push({ transaction, request, lockerAddress, lockerLockingScript })
129
+ } else if (request.code !== "NO_OP_RETURN") {
130
+ invalidRequests.push({ transaction, request, lockerAddress, lockerLockingScript })
131
+ }
132
+ }
133
+ return { requests, invalidRequests }
134
+ }
135
+
136
+ async getWrapRequestByTx(
137
+ inputTransaction:
138
+ | { txId: string }
139
+ | (bitcoin.Types.ConfirmedTransaction & {
140
+ address?: string
141
+ addressScript?: string
142
+ merkleProof?: Transaction["merkleProof"]
143
+ }),
144
+ lockerAddress: string,
145
+ ) {
146
+ let transaction: bitcoin.Types.ConfirmedTransaction & {
147
+ address?: string
148
+ addressScript?: string
149
+ merkleProof?: Transaction["merkleProof"]
150
+ }
151
+ if ("vout" in inputTransaction && "blockNumber" in inputTransaction) {
152
+ transaction = inputTransaction
153
+ } else {
154
+ if (!inputTransaction.txId) throw new Error("txId not exist")
155
+ transaction = await this.getTransaction(inputTransaction.txId)
156
+ }
157
+
158
+ let vout = transaction.vout
159
+ let request = checkAndParseWrapRequest(vout!, lockerAddress)
160
+ let lockerLockingScript: string =
161
+ transaction.addressScript ||
162
+ this.convertAddressToScript(lockerAddress).script!.toString("hex")
163
+
164
+ return {
165
+ transaction,
166
+ request,
167
+ lockerAddress,
168
+ lockerLockingScript,
169
+ }
170
+ }
171
+
172
+ async getLockersUnWrapTransactions(
173
+ addresses: string[],
174
+ startBlockNumber: number,
175
+ endBlockNumber: number,
176
+ ) {
177
+ let transactions = await this.getMultipleBlocksTransactions(
178
+ addresses,
179
+ startBlockNumber,
180
+ endBlockNumber,
181
+ )
182
+
183
+ let validTxs = []
184
+ for (let transaction of transactions) {
185
+ let address = transaction.address
186
+ // check if its a transaction to spend btc
187
+ let txBurnInfo = await this.getTransactionUnwrapInfoByTx(transaction, address)
188
+ if (txBurnInfo) {
189
+ const { burnInfo, lockerAddress, lockerLockingScript } = txBurnInfo
190
+ validTxs.push({
191
+ transaction,
192
+ burnInfo,
193
+ lockerAddress,
194
+ lockerLockingScript,
195
+ })
196
+ }
197
+ }
198
+ return validTxs
199
+ }
200
+
201
+ async getLockersUnwrapMEmpoolTransactions(
202
+ addresses: string[],
203
+ startBlockNumber: number,
204
+ endBlockNumber: number,
205
+ ) {
206
+ let transactions = await this.getMultipleBlocksTransactions(
207
+ addresses,
208
+ startBlockNumber,
209
+ endBlockNumber,
210
+ )
211
+
212
+ let validTxs = []
213
+ for (let transaction of transactions) {
214
+ let address = transaction.address
215
+ // check if its a transaction to spend btc
216
+ let txBurnInfo = await this.getTransactionUnwrapInfoByTx(transaction, address)
217
+ if (txBurnInfo) {
218
+ const { burnInfo, lockerAddress, lockerLockingScript } = txBurnInfo
219
+ validTxs.push({
220
+ transaction,
221
+ burnInfo,
222
+ lockerAddress,
223
+ lockerLockingScript,
224
+ })
225
+ }
226
+ }
227
+ return validTxs
228
+ }
229
+
230
+ async getTransactionUnwrapInfoByTx(
231
+ transaction: {
232
+ txId: any
233
+ vout?: any
234
+ vin?: any
235
+ addressScript?: any
236
+ },
237
+ lockerAddress: string,
238
+ ) {
239
+ if (!transaction.txId) throw new Error("txId not exist")
240
+ let vin = transaction.vin || (await this.getTransaction(transaction.txId)).vin
241
+ let burnInfo = getBurnTransactionInfo(lockerAddress, vin, transaction.vout)
242
+ if (!burnInfo) return
243
+ let lockerLockingScript: string =
244
+ transaction.addressScript ||
245
+ this.convertAddressToScript(lockerAddress).script!.toString("hex")
246
+ return {
247
+ burnInfo,
248
+ lockerAddress,
249
+ lockerLockingScript,
250
+ } as UnwrapRequest
251
+ }
252
+ }
@@ -1,60 +1,60 @@
1
- import type { Network } from "bitcoinjs-lib"
2
- import networks from "./utils/networks"
3
- import {
4
- createAddressObjectByHash,
5
- createAddressObjectByAddress,
6
- createAddressObjectByPublicKey,
7
- createAddressObjectByScript,
8
- } from "./bitcoin-utils"
9
-
10
- export class BitcoinInterfaceUtils {
11
- testnet: boolean
12
- network: Network
13
- constructor(networkName: string) {
14
- this.testnet = networkName.includes("_testnet")
15
- this.network = networks[networkName]
16
- }
17
-
18
- convertHashToAddress(hashHex: string, addressType: string) {
19
- let addressObj = createAddressObjectByHash(
20
- { addressType, hash: Buffer.from(hashHex, "hex") },
21
- this.network,
22
- )
23
- if (!addressObj.address) throw new Error("incorrect input")
24
- return addressObj.address
25
- }
26
-
27
- convertScriptToAddress(scriptHex: string, addressType: string) {
28
- let addressObj = createAddressObjectByScript(
29
- { addressType, script: Buffer.from(scriptHex, "hex") },
30
- this.network,
31
- )
32
- if (!addressObj.address) throw new Error("incorrect input")
33
- return addressObj.address
34
- }
35
-
36
- convertAddressToScript(address: string) {
37
- let { addressObject, addressType } = createAddressObjectByAddress(address, this.network)
38
- const hash = addressType === "p2tr" ? addressObject.pubkey : addressObject.hash
39
- return {
40
- script: addressObject.output,
41
- hash,
42
- addressType,
43
- }
44
- }
45
-
46
- convertAddressToObject(address: string) {
47
- let addObj = createAddressObjectByAddress(address, this.network)
48
- return addObj
49
- }
50
-
51
- createAddressObjectByPublicKey(publicKey: string, addressType: string) {
52
- let addObj = createAddressObjectByPublicKey(
53
- { publicKey: Buffer.from(publicKey, "hex"), addressType },
54
- this.network,
55
- )
56
- return addObj
57
- }
58
- }
59
-
60
- export default BitcoinInterfaceUtils
1
+ import type { Network } from "bitcoinjs-lib"
2
+ import networks from "./utils/networks"
3
+ import {
4
+ createAddressObjectByHash,
5
+ createAddressObjectByAddress,
6
+ createAddressObjectByPublicKey,
7
+ createAddressObjectByScript,
8
+ } from "./bitcoin-utils"
9
+
10
+ export class BitcoinInterfaceUtils {
11
+ testnet: boolean
12
+ network: Network
13
+ constructor(networkName: string) {
14
+ this.testnet = networkName.includes("_testnet")
15
+ this.network = networks[networkName]
16
+ }
17
+
18
+ convertHashToAddress(hashHex: string, addressType: string) {
19
+ let addressObj = createAddressObjectByHash(
20
+ { addressType, hash: Buffer.from(hashHex, "hex") },
21
+ this.network,
22
+ )
23
+ if (!addressObj.address) throw new Error("incorrect input")
24
+ return addressObj.address
25
+ }
26
+
27
+ convertScriptToAddress(scriptHex: string, addressType: string) {
28
+ let addressObj = createAddressObjectByScript(
29
+ { addressType, script: Buffer.from(scriptHex, "hex") },
30
+ this.network,
31
+ )
32
+ if (!addressObj.address) throw new Error("incorrect input")
33
+ return addressObj.address
34
+ }
35
+
36
+ convertAddressToScript(address: string) {
37
+ let { addressObject, addressType } = createAddressObjectByAddress(address, this.network)
38
+ const hash = addressType === "p2tr" ? addressObject.pubkey : addressObject.hash
39
+ return {
40
+ script: addressObject.output,
41
+ hash,
42
+ addressType,
43
+ }
44
+ }
45
+
46
+ convertAddressToObject(address: string) {
47
+ let addObj = createAddressObjectByAddress(address, this.network)
48
+ return addObj
49
+ }
50
+
51
+ createAddressObjectByPublicKey(publicKey: string, addressType: string) {
52
+ let addObj = createAddressObjectByPublicKey(
53
+ { publicKey: Buffer.from(publicKey, "hex"), addressType },
54
+ this.network,
55
+ )
56
+ return addObj
57
+ }
58
+ }
59
+
60
+ export default BitcoinInterfaceUtils