@airgap/bitcoin 0.13.42-beta.5 → 0.13.43-beta.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.
Files changed (56) hide show
  1. package/package.json +8 -6
  2. package/v0/protocol/BitcoinSegwitProtocol.d.ts +1 -0
  3. package/v0/protocol/BitcoinSegwitProtocol.js +22 -15
  4. package/v0/protocol/BitcoinSegwitProtocol.js.map +1 -1
  5. package/v1/data/BitcoinLegacyAddress.d.ts +9 -0
  6. package/v1/data/BitcoinLegacyAddress.js +25 -0
  7. package/v1/data/BitcoinLegacyAddress.js.map +1 -0
  8. package/v1/data/BitcoinSegwitAddress.d.ts +2 -1
  9. package/v1/data/BitcoinSegwitAddress.js.map +1 -1
  10. package/v1/data/BitcoinTaprootAddress.d.ts +9 -0
  11. package/v1/data/BitcoinTaprootAddress.js +57 -0
  12. package/v1/data/BitcoinTaprootAddress.js.map +1 -0
  13. package/v1/index.d.ts +12 -6
  14. package/v1/index.js +6 -1
  15. package/v1/index.js.map +1 -1
  16. package/v1/module/BitcoinModule.d.ts +1 -1
  17. package/v1/module/BitcoinModule.js +7 -1
  18. package/v1/module/BitcoinModule.js.map +1 -1
  19. package/v1/protocol/BitcoinLegacyProtocol.d.ts +56 -0
  20. package/v1/protocol/BitcoinLegacyProtocol.js +861 -0
  21. package/v1/protocol/BitcoinLegacyProtocol.js.map +1 -0
  22. package/v1/protocol/BitcoinProtocol.js +1 -0
  23. package/v1/protocol/BitcoinProtocol.js.map +1 -1
  24. package/v1/protocol/BitcoinSegwitProtocol.d.ts +3 -2
  25. package/v1/protocol/BitcoinSegwitProtocol.js +36 -23
  26. package/v1/protocol/BitcoinSegwitProtocol.js.map +1 -1
  27. package/v1/protocol/BitcoinTaprootProtocol.d.ts +60 -0
  28. package/v1/protocol/BitcoinTaprootProtocol.js +1079 -0
  29. package/v1/protocol/BitcoinTaprootProtocol.js.map +1 -0
  30. package/v1/serializer/v3/schemas/converter/transaction-converter.d.ts +13 -1
  31. package/v1/serializer/v3/schemas/converter/transaction-converter.js +43 -1
  32. package/v1/serializer/v3/schemas/converter/transaction-converter.js.map +1 -1
  33. package/v1/serializer/v3/schemas/definitions/transaction-sign-request-bitcoin-legacy.d.ts +4 -0
  34. package/v1/serializer/v3/schemas/definitions/transaction-sign-request-bitcoin-legacy.js +3 -0
  35. package/v1/serializer/v3/schemas/definitions/transaction-sign-request-bitcoin-legacy.js.map +1 -0
  36. package/v1/serializer/v3/schemas/definitions/transaction-sign-request-bitcoin-taproot.d.ts +4 -0
  37. package/v1/serializer/v3/schemas/definitions/transaction-sign-request-bitcoin-taproot.js +3 -0
  38. package/v1/serializer/v3/schemas/definitions/transaction-sign-request-bitcoin-taproot.js.map +1 -0
  39. package/v1/serializer/v3/schemas/definitions/transaction-sign-response-bitcoin-legacy.d.ts +3 -0
  40. package/v1/serializer/v3/schemas/definitions/transaction-sign-response-bitcoin-legacy.js +3 -0
  41. package/v1/serializer/v3/schemas/definitions/transaction-sign-response-bitcoin-legacy.js.map +1 -0
  42. package/v1/serializer/v3/schemas/definitions/transaction-sign-response-bitcoin-taproot.d.ts +3 -0
  43. package/v1/serializer/v3/schemas/definitions/transaction-sign-response-bitcoin-taproot.js +3 -0
  44. package/v1/serializer/v3/schemas/definitions/transaction-sign-response-bitcoin-taproot.js.map +1 -0
  45. package/v1/serializer/v3/schemas/generated/transaction-sign-request-bitcoin-legacy.json +29 -0
  46. package/v1/serializer/v3/schemas/generated/transaction-sign-request-bitcoin-taproot.json +29 -0
  47. package/v1/serializer/v3/schemas/generated/transaction-sign-response-bitcoin-legacy.json +19 -0
  48. package/v1/serializer/v3/schemas/generated/transaction-sign-response-bitcoin-taproot.json +19 -0
  49. package/v1/serializer/v3/serializer-companion.d.ts +0 -1
  50. package/v1/serializer/v3/serializer-companion.js +68 -46
  51. package/v1/serializer/v3/serializer-companion.js.map +1 -1
  52. package/v1/types/bitcoinjs.d.ts +12 -0
  53. package/v1/types/transaction.d.ts +20 -0
  54. package/v1/utils/protocol.d.ts +3 -0
  55. package/v1/utils/protocol.js +6 -1
  56. package/v1/utils/protocol.js.map +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@airgap/bitcoin",
3
- "version": "0.13.42-beta.5",
3
+ "version": "0.13.43-beta.0",
4
4
  "description": "The @airgap/bitcoin is a Bitcoin implementation of the ICoinProtocol interface from @airgap/coinlib-core.",
5
5
  "keywords": [
6
6
  "airgap",
@@ -30,11 +30,13 @@
30
30
  },
31
31
  "author": "Papers AG <contact@papers.ch> (https://papers.ch)",
32
32
  "dependencies": {
33
- "@airgap/coinlib-core": "^0.13.42-beta.5",
34
- "@airgap/crypto": "^0.13.42-beta.5",
35
- "@airgap/module-kit": "^0.13.42-beta.5",
36
- "@airgap/serializer": "^0.13.42-beta.5",
37
- "bitcoinjs-lib": "5.2.0"
33
+ "@airgap/coinlib-core": "^0.13.43-beta.0",
34
+ "@airgap/crypto": "^0.13.43-beta.0",
35
+ "@airgap/module-kit": "^0.13.43-beta.0",
36
+ "@airgap/serializer": "^0.13.43-beta.0",
37
+ "@bitcoinerlab/secp256k1": "1.2.0",
38
+ "bip32": "5.0.0-rc.0",
39
+ "bitcoinjs-lib": "6.1.7"
38
40
  },
39
41
  "localDependencies": {
40
42
  "bitcoinjs-message": "2.1.1"
@@ -8,6 +8,7 @@ export declare class BitcoinSegwitProtocol extends BitcoinProtocol {
8
8
  identifier: ProtocolSymbols;
9
9
  standardDerivationPath: string;
10
10
  addressPlaceholder: string;
11
+ private readonly bip32;
11
12
  constructor(options?: BitcoinProtocolOptions);
12
13
  getPublicKeyFromHexSecret(secret: string, derivationPath: string): Promise<string>;
13
14
  getPrivateKeyFromHexSecret(secret: string, derivationPath: string): Promise<string>;
@@ -96,6 +96,8 @@ var bitcoinJS = __importStar(require("bitcoinjs-lib"));
96
96
  var BitcoinProtocol_1 = require("./BitcoinProtocol");
97
97
  var BitcoinProtocolOptions_1 = require("./BitcoinProtocolOptions");
98
98
  var BitcoinSegwitAddress_1 = require("./BitcoinSegwitAddress");
99
+ var bip32_1 = require("bip32");
100
+ var secp256k1_1 = __importDefault(require("@bitcoinerlab/secp256k1"));
99
101
  var DUST_AMOUNT = 50;
100
102
  // This function handles arrays and objects
101
103
  function eachRecursive(obj) {
@@ -138,13 +140,14 @@ var BitcoinSegwitProtocol = /** @class */ (function (_super) {
138
140
  _this.identifier = ProtocolSymbols_1.MainProtocolSymbols.BTC_SEGWIT;
139
141
  _this.standardDerivationPath = "m/84'/0'/0'";
140
142
  _this.addressPlaceholder = 'bc1...';
143
+ _this.bip32 = (0, bip32_1.BIP32Factory)(secp256k1_1.default);
141
144
  return _this;
142
145
  }
143
146
  BitcoinSegwitProtocol.prototype.getPublicKeyFromHexSecret = function (secret, derivationPath) {
144
147
  return __awaiter(this, void 0, void 0, function () {
145
148
  var bitcoinNode, neutered, zpub;
146
149
  return __generator(this, function (_a) {
147
- bitcoinNode = bitcoinJS.bip32.fromSeed(Buffer.from(secret, 'hex'), this.options.network.extras.network);
150
+ bitcoinNode = this.bip32.fromSeed(Buffer.from(secret, 'hex'), this.options.network.extras.network);
148
151
  neutered = bitcoinNode.derivePath(derivationPath).neutered();
149
152
  zpub = new ExtendedPublicKey(neutered.toBase58()).toZPub();
150
153
  return [2 /*return*/, zpub];
@@ -156,14 +159,14 @@ var BitcoinSegwitProtocol = /** @class */ (function (_super) {
156
159
  var bitcoinNode, privateKey;
157
160
  return __generator(this, function (_a) {
158
161
  if (!derivationPath) {
159
- return [2 /*return*/, bitcoinJS.bip32.fromSeed(Buffer.from(secret, 'hex'), this.options.network.extras.network)];
162
+ return [2 /*return*/, this.bip32.fromSeed(Buffer.from(secret, 'hex'), this.options.network.extras.network)];
160
163
  }
161
- bitcoinNode = bitcoinJS.bip32.fromSeed(Buffer.from(secret, 'hex'), this.options.network.extras.network);
164
+ bitcoinNode = this.bip32.fromSeed(Buffer.from(secret, 'hex'), this.options.network.extras.network);
162
165
  privateKey = bitcoinNode.derivePath(derivationPath).privateKey;
163
166
  if (!privateKey) {
164
167
  throw new Error('No privatekey!');
165
168
  }
166
- return [2 /*return*/, privateKey.toString('hex')];
169
+ return [2 /*return*/, Buffer.from(privateKey).toString('hex')];
167
170
  });
168
171
  });
169
172
  };
@@ -180,7 +183,7 @@ var BitcoinSegwitProtocol = /** @class */ (function (_super) {
180
183
  return __awaiter(this, void 0, void 0, function () {
181
184
  var bitcoinNode;
182
185
  return __generator(this, function (_a) {
183
- bitcoinNode = bitcoinJS.bip32.fromSeed(Buffer.from(secret, 'hex'), this.options.network.extras.network);
186
+ bitcoinNode = this.bip32.fromSeed(Buffer.from(secret, 'hex'), this.options.network.extras.network);
184
187
  return [2 /*return*/, bitcoinNode.derivePath(derivationPath).toBase58()];
185
188
  });
186
189
  });
@@ -189,7 +192,7 @@ var BitcoinSegwitProtocol = /** @class */ (function (_super) {
189
192
  return __awaiter(this, void 0, void 0, function () {
190
193
  var address;
191
194
  return __generator(this, function (_a) {
192
- address = BitcoinSegwitAddress_1.BitcoinSegwitAddress.fromAddress(bitcoinJS.bip32.fromBase58(publicKey, this.options.network.extras.network).toBase58());
195
+ address = BitcoinSegwitAddress_1.BitcoinSegwitAddress.fromAddress(this.bip32.fromBase58(publicKey, this.options.network.extras.network).toBase58());
193
196
  return [2 /*return*/, {
194
197
  address: address.asString(),
195
198
  cursor: { hasNext: false }
@@ -212,11 +215,11 @@ var BitcoinSegwitProtocol = /** @class */ (function (_super) {
212
215
  var xpub, keyPair, obj, addressRaw, address;
213
216
  return __generator(this, function (_a) {
214
217
  xpub = new ExtendedPublicKey(extendedPublicKey).toXpub();
215
- keyPair = bitcoinJS.bip32
218
+ keyPair = this.bip32
216
219
  .fromBase58(xpub, this.options.network.extras.network)
217
220
  .derive(visibilityDerivationIndex)
218
221
  .derive(addressDerivationIndex);
219
- obj = bitcoinJS.payments.p2wpkh({ pubkey: keyPair.publicKey });
222
+ obj = bitcoinJS.payments.p2wpkh({ pubkey: Buffer.from(keyPair.publicKey) });
220
223
  addressRaw = obj.address;
221
224
  if (!addressRaw) {
222
225
  throw new Error('could not generate address');
@@ -231,11 +234,11 @@ var BitcoinSegwitProtocol = /** @class */ (function (_super) {
231
234
  };
232
235
  BitcoinSegwitProtocol.prototype.getAddressesFromExtendedPublicKey = function (extendedPublicKey, visibilityDerivationIndex, addressCount, offset) {
233
236
  // broadcaster knows this (both broadcaster and signer)
234
- var node = bitcoinJS.bip32.fromBase58(new ExtendedPublicKey(extendedPublicKey).toXpub(), this.options.network.extras.network);
237
+ var node = this.bip32.fromBase58(new ExtendedPublicKey(extendedPublicKey).toXpub(), this.options.network.extras.network);
235
238
  var generatorArray = Array.from(new Array(addressCount), function (x, i) { return i + offset; });
236
239
  return Promise.all(generatorArray.map(function (x) {
237
240
  var keyPair = node.derive(visibilityDerivationIndex).derive(x);
238
- var addressRaw = bitcoinJS.payments.p2wpkh({ pubkey: keyPair.publicKey }).address;
241
+ var addressRaw = bitcoinJS.payments.p2wpkh({ pubkey: Buffer.from(keyPair.publicKey) }).address;
239
242
  if (!addressRaw) {
240
243
  throw new Error('could not generate address');
241
244
  }
@@ -455,12 +458,12 @@ var BitcoinSegwitProtocol = /** @class */ (function (_super) {
455
458
  key: Buffer.from('amount'),
456
459
  value: Buffer.from(wrappedValues.reduce(function (accumulator, currentValue) { return accumulator.plus(currentValue); }).toString())
457
460
  });
458
- keyPair = bitcoinJS.bip32.fromBase58(new ExtendedPublicKey(extendedPublicKey).toXpub());
461
+ keyPair = this.bip32.fromBase58(new ExtendedPublicKey(extendedPublicKey).toXpub());
459
462
  replaceByFee = extras.replaceByFee ? true : false;
460
463
  transaction.ins.forEach(function (tx) {
461
464
  var indexes = getPathIndexes(tx.derivationPath);
462
465
  var childNode = keyPair.derivePath(indexes.join('/'));
463
- var p2wpkh = bitcoinJS.payments.p2wpkh({ pubkey: childNode.publicKey, network: _this.options.network.extras.network });
466
+ var p2wpkh = bitcoinJS.payments.p2wpkh({ pubkey: Buffer.from(childNode.publicKey), network: _this.options.network.extras.network });
464
467
  var p2shOutput = p2wpkh.output;
465
468
  if (!p2shOutput) {
466
469
  throw new Error('no p2shOutput');
@@ -476,7 +479,7 @@ var BitcoinSegwitProtocol = /** @class */ (function (_super) {
476
479
  bip32Derivation: [
477
480
  {
478
481
  masterFingerprint: Buffer.from(extras.masterFingerprint, 'hex'),
479
- pubkey: childNode.publicKey,
482
+ pubkey: Buffer.from(childNode.publicKey),
480
483
  path: tx.derivationPath
481
484
  }
482
485
  ]
@@ -505,7 +508,7 @@ var BitcoinSegwitProtocol = /** @class */ (function (_super) {
505
508
  var rawBitcoinSegwitTx, bip32PK, decodedPSBT;
506
509
  return __generator(this, function (_a) {
507
510
  rawBitcoinSegwitTx = transaction;
508
- bip32PK = bitcoinJS.bip32.fromBase58(extendedPrivateKey);
511
+ bip32PK = this.bip32.fromBase58(extendedPrivateKey);
509
512
  decodedPSBT = bitcoinJS.Psbt.fromHex(rawBitcoinSegwitTx.psbt);
510
513
  decodedPSBT.data.inputs.forEach(function (input, index) {
511
514
  var _a;
@@ -514,7 +517,11 @@ var BitcoinSegwitProtocol = /** @class */ (function (_super) {
514
517
  // This uses the same logic to find child key as the "findWalletByFingerprintDerivationPathAndProtocolIdentifier" method in the Vault
515
518
  var cutoffFrom = deriv.path.lastIndexOf("'") || deriv.path.lastIndexOf('h');
516
519
  var childPath = deriv.path.substr(cutoffFrom + 2);
517
- decodedPSBT.signInput(index, bip32PK.derivePath(childPath));
520
+ var childNode_1 = bip32PK.derivePath(childPath);
521
+ decodedPSBT.signInput(index, {
522
+ publicKey: Buffer.from(childNode_1.publicKey),
523
+ sign: function (hash, lowR) { return Buffer.from(childNode_1.sign(hash, lowR)); }
524
+ });
518
525
  console.log("Signed input ".concat(index, " with path ").concat(deriv.path));
519
526
  }
520
527
  catch (e) {
@@ -1 +1 @@
1
- {"version":3,"file":"BitcoinSegwitProtocol.js","sourceRoot":"","sources":["../../../src/v0/protocol/BitcoinSegwitProt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CAAC,cAAc,CAAC,CAAC,iBAAiB,EAAE,CAAC,kBAAkB,EAAE,CAAC,KAAK,EAAE,CAAA;gBAE9G,sBAAO,iBAAM,oBAAoB,YAAC,cAAc,CAAC,EAAA;;;KAClD;IACH,4BAAC;AAAD,CAAC,AAjcD,CAA2C,iCAAe,GAiczD;AAjcY,sDAAqB"}
@@ -0,0 +1,9 @@
1
+ import type * as bitcoin from 'bitcoinjs-lib';
2
+ import { BIP32Interface } from 'bip32';
3
+ export declare class BitcoinLegacyAddress {
4
+ protected readonly value: string;
5
+ private constructor();
6
+ static fromBip32(bip32: BIP32Interface): BitcoinLegacyAddress;
7
+ static fromPayment(payment: bitcoin.Payment): BitcoinLegacyAddress;
8
+ asString(): string;
9
+ }
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BitcoinLegacyAddress = void 0;
4
+ var coinlib_core_1 = require("@airgap/coinlib-core");
5
+ var errors_1 = require("@airgap/coinlib-core/errors");
6
+ var BitcoinLegacyAddress = /** @class */ (function () {
7
+ function BitcoinLegacyAddress(value) {
8
+ this.value = value;
9
+ }
10
+ BitcoinLegacyAddress.fromBip32 = function (bip32) {
11
+ return new BitcoinLegacyAddress(bip32.toBase58());
12
+ };
13
+ BitcoinLegacyAddress.fromPayment = function (payment) {
14
+ if (payment.address === undefined) {
15
+ throw new errors_1.UnsupportedError(coinlib_core_1.Domain.BITCOIN, 'Could not generate address.');
16
+ }
17
+ return new BitcoinLegacyAddress(payment.address);
18
+ };
19
+ BitcoinLegacyAddress.prototype.asString = function () {
20
+ return this.value;
21
+ };
22
+ return BitcoinLegacyAddress;
23
+ }());
24
+ exports.BitcoinLegacyAddress = BitcoinLegacyAddress;
25
+ //# sourceMappingURL=BitcoinLegacyAddress.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BitcoinLegacyAddress.js","sourceRoot":"","sources":["../../../src/v1/data/BitcoinLegacyAddress.ts"],"names":[],"mappings":";;;AAAA,qDAA6C;AAC7C,sDAA8D;AAI9D;IACE,8BAAuC,KAAa;QAAb,UAAK,GAAL,KAAK,CAAQ;IAAG,CAAC;IAE1C,8BAAS,GAAvB,UAAwB,KAAqB;QAC3C,OAAO,IAAI,oBAAoB,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAA;IACnD,CAAC;IAEa,gCAAW,GAAzB,UAA0B,OAAwB;QAChD,IAAI,OAAO,CAAC,OAAO,KAAK,SAAS,EAAE;YACjC,MAAM,IAAI,yBAAgB,CAAC,qBAAM,CAAC,OAAO,EAAE,6BAA6B,CAAC,CAAA;SAC1E;QAED,OAAO,IAAI,oBAAoB,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;IAClD,CAAC;IAEM,uCAAQ,GAAf;QACE,OAAO,IAAI,CAAC,KAAK,CAAA;IACnB,CAAC;IACH,2BAAC;AAAD,CAAC,AAlBD,IAkBC;AAlBY,oDAAoB"}
@@ -1,8 +1,9 @@
1
1
  import type * as bitcoin from 'bitcoinjs-lib';
2
+ import { BIP32Interface } from 'bip32';
2
3
  export declare class BitcoinSegwitAddress {
3
4
  protected readonly value: string;
4
5
  private constructor();
5
- static fromBip32(bip32: bitcoin.BIP32Interface): BitcoinSegwitAddress;
6
+ static fromBip32(bip32: BIP32Interface): BitcoinSegwitAddress;
6
7
  static fromPayment(payment: bitcoin.Payment): BitcoinSegwitAddress;
7
8
  asString(): string;
8
9
  }
@@ -1 +1 @@
1
- {"version":3,"file":"BitcoinSegwitAddress.js","sourceRoot":"","sources":["../../../src/v1/data/BitcoinSegwitAddress.ts"],"names":[],"mappings":";;;AAAA,qDAA6C;AAC7C,sDAA8D;AAG9D;IACE,8BAAuC,KAAa;QAAb,UAAK,GAAL,KAAK,CAAQ;IAAG,CAAC;IAE1C,8BAAS,GAAvB,UAAwB,KAA6B;QACnD,OAAO,IAAI,oBAAoB,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAA;IACnD,CAAC;IAEa,gCAAW,GAAzB,UAA0B,OAAwB;QAChD,IAAI,OAAO,CAAC,OAAO,KAAK,SAAS,EAAE;YACjC,MAAM,IAAI,yBAAgB,CAAC,qBAAM,CAAC,OAAO,EAAE,6BAA6B,CAAC,CAAA;SAC1E;QAED,OAAO,IAAI,oBAAoB,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;IAClD,CAAC;IAEM,uCAAQ,GAAf;QACE,OAAO,IAAI,CAAC,KAAK,CAAA;IACnB,CAAC;IACH,2BAAC;AAAD,CAAC,AAlBD,IAkBC;AAlBY,oDAAoB"}
1
+ {"version":3,"file":"BitcoinSegwitAddress.js","sourceRoot":"","sources":["../../../src/v1/data/BitcoinSegwitAddress.ts"],"names":[],"mappings":";;;AAAA,qDAA6C;AAC7C,sDAA8D;AAI9D;IACE,8BAAuC,KAAa;QAAb,UAAK,GAAL,KAAK,CAAQ;IAAG,CAAC;IAE1C,8BAAS,GAAvB,UAAwB,KAAqB;QAC3C,OAAO,IAAI,oBAAoB,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAA;IACnD,CAAC;IAEa,gCAAW,GAAzB,UAA0B,OAAwB;QAChD,IAAI,OAAO,CAAC,OAAO,KAAK,SAAS,EAAE;YACjC,MAAM,IAAI,yBAAgB,CAAC,qBAAM,CAAC,OAAO,EAAE,6BAA6B,CAAC,CAAA;SAC1E;QAED,OAAO,IAAI,oBAAoB,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;IAClD,CAAC;IAEM,uCAAQ,GAAf;QACE,OAAO,IAAI,CAAC,KAAK,CAAA;IACnB,CAAC;IACH,2BAAC;AAAD,CAAC,AAlBD,IAkBC;AAlBY,oDAAoB"}
@@ -0,0 +1,9 @@
1
+ import * as bitcoin from 'bitcoinjs-lib';
2
+ import { BIP32Interface } from 'bip32';
3
+ export declare class BitcoinTaprootAddress {
4
+ protected readonly value: string;
5
+ private constructor();
6
+ static fromBip32(bip32: BIP32Interface): BitcoinTaprootAddress;
7
+ static fromPayment(payment: bitcoin.Payment): BitcoinTaprootAddress;
8
+ asString(): string;
9
+ }
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.BitcoinTaprootAddress = void 0;
27
+ var coinlib_core_1 = require("@airgap/coinlib-core");
28
+ var errors_1 = require("@airgap/coinlib-core/errors");
29
+ var bitcoin = __importStar(require("bitcoinjs-lib"));
30
+ var BitcoinTaprootAddress = /** @class */ (function () {
31
+ function BitcoinTaprootAddress(value) {
32
+ this.value = value;
33
+ }
34
+ BitcoinTaprootAddress.fromBip32 = function (bip32) {
35
+ var xOnlyPubkey = bip32.publicKey.slice(1, 33);
36
+ var payment = bitcoin.payments.p2tr({
37
+ internalPubkey: Buffer.from(xOnlyPubkey),
38
+ network: bitcoin.networks.bitcoin
39
+ });
40
+ if (payment.address === undefined) {
41
+ throw new errors_1.UnsupportedError(coinlib_core_1.Domain.BITCOIN, 'Could not generate Taproot address from BIP32.');
42
+ }
43
+ return new BitcoinTaprootAddress(payment.address);
44
+ };
45
+ BitcoinTaprootAddress.fromPayment = function (payment) {
46
+ if (payment.address === undefined) {
47
+ throw new errors_1.UnsupportedError(coinlib_core_1.Domain.BITCOIN, 'Could not generate Taproot address from payment.');
48
+ }
49
+ return new BitcoinTaprootAddress(payment.address);
50
+ };
51
+ BitcoinTaprootAddress.prototype.asString = function () {
52
+ return this.value;
53
+ };
54
+ return BitcoinTaprootAddress;
55
+ }());
56
+ exports.BitcoinTaprootAddress = BitcoinTaprootAddress;
57
+ //# sourceMappingURL=BitcoinTaprootAddress.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BitcoinTaprootAddress.js","sourceRoot":"","sources":["../../../src/v1/data/BitcoinTaprootAddress.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qDAA6C;AAC7C,sDAA8D;AAC9D,qDAAwC;AAGxC;IACE,+BAAuC,KAAa;QAAb,UAAK,GAAL,KAAK,CAAQ;IAAG,CAAC;IAE1C,+BAAS,GAAvB,UAAwB,KAAqB;QAC3C,IAAM,WAAW,GAAG,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;QAEhD,IAAM,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC;YACpC,cAAc,EAAE,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC;YACxC,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,OAAO;SAClC,CAAC,CAAA;QAEF,IAAI,OAAO,CAAC,OAAO,KAAK,SAAS,EAAE;YACjC,MAAM,IAAI,yBAAgB,CAAC,qBAAM,CAAC,OAAO,EAAE,gDAAgD,CAAC,CAAA;SAC7F;QAED,OAAO,IAAI,qBAAqB,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;IACnD,CAAC;IAEa,iCAAW,GAAzB,UAA0B,OAAwB;QAChD,IAAI,OAAO,CAAC,OAAO,KAAK,SAAS,EAAE;YACjC,MAAM,IAAI,yBAAgB,CAAC,qBAAM,CAAC,OAAO,EAAE,kDAAkD,CAAC,CAAA;SAC/F;QAED,OAAO,IAAI,qBAAqB,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;IACnD,CAAC;IAEM,wCAAQ,GAAf;QACE,OAAO,IAAI,CAAC,KAAK,CAAA;IACnB,CAAC;IACH,4BAAC;AAAD,CAAC,AA7BD,IA6BC;AA7BY,sDAAqB"}
package/v1/index.d.ts CHANGED
@@ -1,22 +1,28 @@
1
1
  import { BlockCypherBlockExplorer } from './block-explorer/BlockCypherBlockExplorer';
2
2
  import { BitcoinModule } from './module/BitcoinModule';
3
+ import { BitcoinLegacyProtocol, createBitcoinLegacyProtocol } from './protocol/BitcoinLegacyProtocol';
3
4
  import { BitcoinProtocol, createBitcoinProtocol, createBitcoinProtocolOptions } from './protocol/BitcoinProtocol';
4
5
  import { BitcoinSegwitProtocol, createBitcoinSegwitProtocol } from './protocol/BitcoinSegwitProtocol';
6
+ import { BitcoinTaprootProtocol, createBitcoinTaprootProtocol } from './protocol/BitcoinTaprootProtocol';
5
7
  import { BitcoinTestnetProtocol, createBitcoinTestnetProtocol } from './protocol/BitcoinTestnetProtocol';
6
8
  import { bitcoinSignedTransactionToResponse, bitcoinTransactionSignRequestToUnsigned, bitcoinTransactionSignResponseToSigned, bitcoinUnsignedTransactionToRequest } from './serializer/v3/schemas/converter/transaction-converter';
7
9
  import { BitcoinTransactionSignRequest } from './serializer/v3/schemas/definitions/transaction-sign-request-bitcoin';
10
+ import { BitcoinLegacyTransactionSignRequest } from './serializer/v3/schemas/definitions/transaction-sign-request-bitcoin-legacy';
8
11
  import { BitcoinSegwitTransactionSignRequest } from './serializer/v3/schemas/definitions/transaction-sign-request-bitcoin-segwit';
12
+ import { BitcoinTaprootTransactionSignRequest } from './serializer/v3/schemas/definitions/transaction-sign-request-bitcoin-taproot';
9
13
  import { BitcoinTransactionSignResponse } from './serializer/v3/schemas/definitions/transaction-sign-response-bitcoin';
10
14
  import { BitcoinSegwitTransactionSignResponse } from './serializer/v3/schemas/definitions/transaction-sign-response-bitcoin-segwit';
15
+ import { BitcoinLegacyTransactionSignResponse } from './serializer/v3/schemas/definitions/transaction-sign-response-bitcoin-legacy';
16
+ import { BitcoinTaprootTransactionSignResponse } from './serializer/v3/schemas/definitions/transaction-sign-response-bitcoin-taproot';
11
17
  import { BitcoinTransactionValidator } from './serializer/v3/validators/transaction-validator';
12
18
  import { bitcoinValidators } from './serializer/v3/validators/validators';
13
19
  import { BitcoinCryptoConfiguration } from './types/crypto';
14
20
  import { BitcoinProtocolNetwork, BitcoinProtocolOptions, BitcoinUnits } from './types/protocol';
15
- import { BitcoinInTransaction, BitcoinOutTransaction, BitcoinSegwitSignedTransaction, BitcoinSegwitUnsignedTransaction, BitcoinSignedTransaction, BitcoinTransactionCursor, BitcoinUnsignedTransaction } from './types/transaction';
16
- import { isBitcoinProtocol, isBitcoinSegwitProtocol } from './utils/protocol';
21
+ import { BitcoinInTransaction, BitcoinOutTransaction, BitcoinLegacySignedTransaction, BitcoinLegacyUnsignedTransaction, BitcoinSegwitSignedTransaction, BitcoinSegwitUnsignedTransaction, BitcoinTaprootSignedTransaction, BitcoinTaprootUnsignedTransaction, BitcoinSignedTransaction, BitcoinTransactionCursor, BitcoinUnsignedTransaction } from './types/transaction';
22
+ import { isBitcoinProtocol, isBitcoinSegwitProtocol, isBitcoinTaprootProtocol } from './utils/protocol';
17
23
  export { BitcoinModule };
18
- export { BitcoinProtocol, BitcoinTestnetProtocol, BitcoinSegwitProtocol, createBitcoinProtocol, createBitcoinTestnetProtocol, createBitcoinSegwitProtocol, createBitcoinProtocolOptions };
24
+ export { BitcoinProtocol, BitcoinTestnetProtocol, BitcoinLegacyProtocol, BitcoinSegwitProtocol, BitcoinTaprootProtocol, createBitcoinProtocol, createBitcoinLegacyProtocol, createBitcoinTestnetProtocol, createBitcoinSegwitProtocol, createBitcoinTaprootProtocol, createBitcoinProtocolOptions };
19
25
  export { BlockCypherBlockExplorer };
20
- export { BitcoinCryptoConfiguration, BitcoinUnits, BitcoinProtocolNetwork, BitcoinProtocolOptions, BitcoinUnsignedTransaction, BitcoinSignedTransaction, BitcoinSegwitUnsignedTransaction, BitcoinSegwitSignedTransaction, BitcoinInTransaction, BitcoinOutTransaction, BitcoinTransactionCursor };
21
- export { BitcoinTransactionSignRequest, BitcoinTransactionSignResponse, BitcoinSegwitTransactionSignRequest, BitcoinSegwitTransactionSignResponse, BitcoinTransactionValidator, bitcoinValidators, bitcoinUnsignedTransactionToRequest, bitcoinSignedTransactionToResponse, bitcoinTransactionSignRequestToUnsigned, bitcoinTransactionSignResponseToSigned };
22
- export { isBitcoinProtocol, isBitcoinSegwitProtocol };
26
+ export { BitcoinCryptoConfiguration, BitcoinUnits, BitcoinProtocolNetwork, BitcoinProtocolOptions, BitcoinUnsignedTransaction, BitcoinSignedTransaction, BitcoinLegacyUnsignedTransaction, BitcoinLegacySignedTransaction, BitcoinSegwitUnsignedTransaction, BitcoinSegwitSignedTransaction, BitcoinTaprootUnsignedTransaction, BitcoinTaprootSignedTransaction, BitcoinInTransaction, BitcoinOutTransaction, BitcoinTransactionCursor };
27
+ export { BitcoinTransactionSignRequest, BitcoinTransactionSignResponse, BitcoinLegacyTransactionSignRequest, BitcoinSegwitTransactionSignRequest, BitcoinTaprootTransactionSignRequest, BitcoinLegacyTransactionSignResponse, BitcoinSegwitTransactionSignResponse, BitcoinTaprootTransactionSignResponse, BitcoinTransactionValidator, bitcoinValidators, bitcoinUnsignedTransactionToRequest, bitcoinSignedTransactionToResponse, bitcoinTransactionSignRequestToUnsigned, bitcoinTransactionSignResponseToSigned };
28
+ export { isBitcoinProtocol, isBitcoinSegwitProtocol, isBitcoinTaprootProtocol };
package/v1/index.js CHANGED
@@ -1,15 +1,19 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isBitcoinSegwitProtocol = exports.isBitcoinProtocol = exports.bitcoinTransactionSignResponseToSigned = exports.bitcoinTransactionSignRequestToUnsigned = exports.bitcoinSignedTransactionToResponse = exports.bitcoinUnsignedTransactionToRequest = exports.bitcoinValidators = exports.BitcoinTransactionValidator = exports.BlockCypherBlockExplorer = exports.createBitcoinProtocolOptions = exports.createBitcoinSegwitProtocol = exports.createBitcoinTestnetProtocol = exports.createBitcoinProtocol = exports.BitcoinModule = void 0;
3
+ exports.isBitcoinTaprootProtocol = exports.isBitcoinSegwitProtocol = exports.isBitcoinProtocol = exports.bitcoinTransactionSignResponseToSigned = exports.bitcoinTransactionSignRequestToUnsigned = exports.bitcoinSignedTransactionToResponse = exports.bitcoinUnsignedTransactionToRequest = exports.bitcoinValidators = exports.BitcoinTransactionValidator = exports.BlockCypherBlockExplorer = exports.createBitcoinProtocolOptions = exports.createBitcoinTaprootProtocol = exports.createBitcoinSegwitProtocol = exports.createBitcoinTestnetProtocol = exports.createBitcoinLegacyProtocol = exports.createBitcoinProtocol = exports.BitcoinModule = void 0;
4
4
  var BlockCypherBlockExplorer_1 = require("./block-explorer/BlockCypherBlockExplorer");
5
5
  Object.defineProperty(exports, "BlockCypherBlockExplorer", { enumerable: true, get: function () { return BlockCypherBlockExplorer_1.BlockCypherBlockExplorer; } });
6
6
  var BitcoinModule_1 = require("./module/BitcoinModule");
7
7
  Object.defineProperty(exports, "BitcoinModule", { enumerable: true, get: function () { return BitcoinModule_1.BitcoinModule; } });
8
+ var BitcoinLegacyProtocol_1 = require("./protocol/BitcoinLegacyProtocol");
9
+ Object.defineProperty(exports, "createBitcoinLegacyProtocol", { enumerable: true, get: function () { return BitcoinLegacyProtocol_1.createBitcoinLegacyProtocol; } });
8
10
  var BitcoinProtocol_1 = require("./protocol/BitcoinProtocol");
9
11
  Object.defineProperty(exports, "createBitcoinProtocol", { enumerable: true, get: function () { return BitcoinProtocol_1.createBitcoinProtocol; } });
10
12
  Object.defineProperty(exports, "createBitcoinProtocolOptions", { enumerable: true, get: function () { return BitcoinProtocol_1.createBitcoinProtocolOptions; } });
11
13
  var BitcoinSegwitProtocol_1 = require("./protocol/BitcoinSegwitProtocol");
12
14
  Object.defineProperty(exports, "createBitcoinSegwitProtocol", { enumerable: true, get: function () { return BitcoinSegwitProtocol_1.createBitcoinSegwitProtocol; } });
15
+ var BitcoinTaprootProtocol_1 = require("./protocol/BitcoinTaprootProtocol");
16
+ Object.defineProperty(exports, "createBitcoinTaprootProtocol", { enumerable: true, get: function () { return BitcoinTaprootProtocol_1.createBitcoinTaprootProtocol; } });
13
17
  var BitcoinTestnetProtocol_1 = require("./protocol/BitcoinTestnetProtocol");
14
18
  Object.defineProperty(exports, "createBitcoinTestnetProtocol", { enumerable: true, get: function () { return BitcoinTestnetProtocol_1.createBitcoinTestnetProtocol; } });
15
19
  var transaction_converter_1 = require("./serializer/v3/schemas/converter/transaction-converter");
@@ -24,4 +28,5 @@ Object.defineProperty(exports, "bitcoinValidators", { enumerable: true, get: fun
24
28
  var protocol_1 = require("./utils/protocol");
25
29
  Object.defineProperty(exports, "isBitcoinProtocol", { enumerable: true, get: function () { return protocol_1.isBitcoinProtocol; } });
26
30
  Object.defineProperty(exports, "isBitcoinSegwitProtocol", { enumerable: true, get: function () { return protocol_1.isBitcoinSegwitProtocol; } });
31
+ Object.defineProperty(exports, "isBitcoinTaprootProtocol", { enumerable: true, get: function () { return protocol_1.isBitcoinTaprootProtocol; } });
27
32
  //# sourceMappingURL=index.js.map
package/v1/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/v1/index.ts"],"names":[],"mappings":";;;AAAA,sFAAoF;AAgD3E,yGAhDA,mDAAwB,OAgDA;AA/CjC,wDAAsD;AA+B7C,8FA/BA,6BAAa,OA+BA;AA9BtB,8DAAiH;AAsC/G,sGAtCwB,uCAAqB,OAsCxB;AAGrB,6GAzC+C,8CAA4B,OAyC/C;AAxC9B,0EAAqG;AAuCnG,4GAvC8B,mDAA2B,OAuC9B;AAtC7B,4EAAwG;AAqCtG,6GArC+B,qDAA4B,OAqC/B;AApC9B,iGAKgE;AAkE9D,mHAtEA,0DAAkC,OAsEA;AAClC,wHAtEA,+DAAuC,OAsEA;AACvC,uHAtEA,8DAAsC,OAsEA;AAHtC,oHAlEA,2DAAmC,OAkEA;AA5DrC,0FAA8F;AA0D5F,4GA1DO,mDAA2B,OA0DP;AAzD7B,oEAAyE;AA0DvE,kGA1DO,8BAAiB,OA0DP;AA9CnB,6CAA6E;AAuDpE,kGAvDA,4BAAiB,OAuDA;AAAE,wGAvDA,kCAAuB,OAuDA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/v1/index.ts"],"names":[],"mappings":";;;AAAA,sFAAoF;AA8D3E,yGA9DA,mDAAwB,OA8DA;AA7DjC,wDAAsD;AAyC7C,8FAzCA,6BAAa,OAyCA;AAxCtB,0EAAqG;AAmDnG,4GAnD8B,mDAA2B,OAmD9B;AAlD7B,8DAAiH;AAiD/G,sGAjDwB,uCAAqB,OAiDxB;AAKrB,6GAtD+C,8CAA4B,OAsD/C;AArD9B,0EAAqG;AAmDnG,4GAnD8B,mDAA2B,OAmD9B;AAlD7B,4EAAwG;AAmDtG,6GAnD+B,qDAA4B,OAmD/B;AAlD9B,4EAAwG;AAgDtG,6GAhD+B,qDAA4B,OAgD/B;AA/C9B,iGAKgE;AAsF9D,mHA1FA,0DAAkC,OA0FA;AAClC,wHA1FA,+DAAuC,OA0FA;AACvC,uHA1FA,8DAAsC,OA0FA;AAHtC,oHAtFA,2DAAmC,OAsFA;AA5ErC,0FAA8F;AA0E5F,4GA1EO,mDAA2B,OA0EP;AAzE7B,oEAAyE;AA0EvE,kGA1EO,8BAAiB,OA0EP;AA1DnB,6CAAuG;AAmE9F,kGAnEA,4BAAiB,OAmEA;AAAE,wGAnEA,kCAAuB,OAmEA;AAAE,yGAnEA,mCAAwB,OAmEA"}
@@ -1,7 +1,7 @@
1
1
  import { MainProtocolSymbols } from '@airgap/coinlib-core';
2
2
  import { AirGapBlockExplorer, AirGapModule, AirGapOfflineProtocol, AirGapOnlineProtocol, AirGapV3SerializerCompanion, ProtocolConfiguration } from '@airgap/module-kit';
3
3
  import { BitcoinProtocolNetwork } from '../types/protocol';
4
- declare type SupportedProtocols = MainProtocolSymbols.BTC | MainProtocolSymbols.BTC_SEGWIT;
4
+ declare type SupportedProtocols = MainProtocolSymbols.BTC | MainProtocolSymbols.BTC_SEGWIT | MainProtocolSymbols.BTC_TAPROOT;
5
5
  export declare class BitcoinModule implements AirGapModule<{
6
6
  Protocols: SupportedProtocols;
7
7
  ProtocolNetwork: BitcoinProtocolNetwork;
@@ -41,9 +41,12 @@ var coinlib_core_1 = require("@airgap/coinlib-core");
41
41
  var errors_1 = require("@airgap/coinlib-core/errors");
42
42
  var module_kit_1 = require("@airgap/module-kit");
43
43
  var BlockCypherBlockExplorer_1 = require("../block-explorer/BlockCypherBlockExplorer");
44
+ // import { BITCOIN_MAINNET_PROTOCOL_NETWORK, createBitcoinProtocol } from '../protocol/BitcoinProtocol'
44
45
  var BitcoinProtocol_1 = require("../protocol/BitcoinProtocol");
45
46
  var BitcoinSegwitProtocol_1 = require("../protocol/BitcoinSegwitProtocol");
47
+ var BitcoinTaprootProtocol_1 = require("../protocol/BitcoinTaprootProtocol");
46
48
  var serializer_companion_1 = require("../serializer/v3/serializer-companion");
49
+ var BitcoinLegacyProtocol_1 = require("../protocol/BitcoinLegacyProtocol");
47
50
  var BitcoinModule = /** @class */ (function () {
48
51
  function BitcoinModule() {
49
52
  var _a;
@@ -53,6 +56,7 @@ var BitcoinModule = /** @class */ (function () {
53
56
  this.networkRegistries = (_a = {},
54
57
  _a[coinlib_core_1.MainProtocolSymbols.BTC] = networkRegistry,
55
58
  _a[coinlib_core_1.MainProtocolSymbols.BTC_SEGWIT] = networkRegistry,
59
+ _a[coinlib_core_1.MainProtocolSymbols.BTC_TAPROOT] = networkRegistry,
56
60
  _a);
57
61
  this.supportedProtocols = (0, module_kit_1.createSupportedProtocols)(this.networkRegistries);
58
62
  }
@@ -99,9 +103,11 @@ var BitcoinModule = /** @class */ (function () {
99
103
  BitcoinModule.prototype.createProtocol = function (identifier, network) {
100
104
  switch (identifier) {
101
105
  case coinlib_core_1.MainProtocolSymbols.BTC:
102
- return (0, BitcoinProtocol_1.createBitcoinProtocol)({ network: network });
106
+ return (0, BitcoinLegacyProtocol_1.createBitcoinLegacyProtocol)({ network: network });
103
107
  case coinlib_core_1.MainProtocolSymbols.BTC_SEGWIT:
104
108
  return (0, BitcoinSegwitProtocol_1.createBitcoinSegwitProtocol)({ network: network });
109
+ case coinlib_core_1.MainProtocolSymbols.BTC_TAPROOT:
110
+ return (0, BitcoinTaprootProtocol_1.createBitcoinTaprootProtocol)({ network: network });
105
111
  default:
106
112
  throw new errors_1.ConditionViolationError(coinlib_core_1.Domain.BITCOIN, "Protocol ".concat(identifier, " not supported."));
107
113
  }
@@ -1 +1 @@
1
- {"version":3,"file":"BitcoinModule.js","sourceRoot":"","sources":["../../../src/v1/module/BitcoinModule.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qDAAkE;AAClE,sDAAqE;AACrE,iDAW2B;AAE3B,uFAAqF;AACrF,+DAAqG;AACrG,2EAA+E;AAC/E,8EAAoF;AAKpF;IAIE;;QACE,IAAM,eAAe,GAA0B,IAAI,kCAAqB,CAAC;YACvE,iBAAiB,EAAE,CAAC,kDAAgC,CAAC;SACtD,CAAC,CAAA;QACF,IAAI,CAAC,iBAAiB;YACpB,GAAC,kCAAmB,CAAC,GAAG,IAAG,eAAe;YAC1C,GAAC,kCAAmB,CAAC,UAAU,IAAG,eAAe;eAClD,CAAA;QACD,IAAI,CAAC,kBAAkB,GAAG,IAAA,qCAAwB,EAAC,IAAI,CAAC,iBAAiB,CAAC,CAAA;IAC5E,CAAC;IAEY,6CAAqB,GAAlC,UAAmC,UAA8B;;;gBAC/D,sBAAO,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,EAAA;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ative, ExtendedKeyPair, ExtendedPublicKey, ExtendedSecretKey, FeeDefaults, KeyPair, ProtocolMetadata, PublicKey, RecursivePartial, SecretKey, Signature, TransactionDetails, TransactionSimpleConfiguration } from '@airgap/module-kit';
2
+ import * as bitcoin from 'bitcoinjs-lib';
3
+ import { BitcoinLegacyJS } from '../types/bitcoinjs';
4
+ import { BitcoinCryptoConfiguration } from '../types/crypto';
5
+ import { BitcoinProtocolNetwork, BitcoinProtocolOptions, BitcoinUnits } from '../types/protocol';
6
+ import { BitcoinLegacySignedTransaction, BitcoinLegacyUnsignedTransaction, BitcoinTransactionCursor, LegacyTransactionFullConfiguration } from '../types/transaction';
7
+ import { BitcoinProtocol, BitcoinProtocolImpl } from './BitcoinProtocol';
8
+ export interface BitcoinLegacyProtocol extends BitcoinProtocol<BitcoinLegacySignedTransaction, BitcoinLegacyUnsignedTransaction> {
9
+ _isBitcoinProtocol: true;
10
+ prepareTransactionWithPublicKey(publicKey: PublicKey | ExtendedPublicKey, details: TransactionDetails<BitcoinUnits>[], configuration: LegacyTransactionFullConfiguration<BitcoinUnits>): Promise<BitcoinLegacyUnsignedTransaction>;
11
+ }
12
+ export declare class BitcoinLegacyProtocolImpl implements BitcoinLegacyProtocol {
13
+ readonly _isBitcoinProtocol: true;
14
+ private readonly options;
15
+ readonly bitcoinJS: BitcoinLegacyJS;
16
+ readonly legacy: BitcoinProtocolImpl;
17
+ private readonly metadata;
18
+ constructor(options?: RecursivePartial<BitcoinProtocolOptions>, bitcoinJS?: typeof bitcoin);
19
+ private readonly bip32;
20
+ getMetadata(): Promise<ProtocolMetadata<BitcoinUnits>>;
21
+ getAddressFromPublicKey(publicKey: PublicKey | ExtendedPublicKey): Promise<string>;
22
+ private getAddressFromNonExtendedPublicKey;
23
+ private getAddressFromExtendedPublicKey;
24
+ deriveFromExtendedPublicKey(extendedPublicKey: ExtendedPublicKey, visibilityIndex: number, addressIndex: number): Promise<PublicKey>;
25
+ getDetailsFromTransaction(transaction: BitcoinLegacySignedTransaction | BitcoinLegacyUnsignedTransaction, _publicKey: PublicKey | ExtendedPublicKey): Promise<AirGapTransaction<BitcoinUnits>[]>;
26
+ private getDetailsFromPSBT;
27
+ verifyMessageWithPublicKey(message: string, signature: Signature, publicKey: ExtendedPublicKey | PublicKey): Promise<boolean>;
28
+ encryptAsymmetricWithPublicKey(payload: string, publicKey: ExtendedPublicKey | PublicKey): Promise<string>;
29
+ getCryptoConfiguration(): Promise<BitcoinCryptoConfiguration>;
30
+ getKeyPairFromDerivative(derivative: CryptoDerivative): Promise<KeyPair>;
31
+ getExtendedKeyPairFromDerivative(derivative: CryptoDerivative): Promise<ExtendedKeyPair>;
32
+ deriveFromExtendedSecretKey(extendedSecretKey: ExtendedSecretKey, visibilityIndex: number, addressIndex: number): Promise<SecretKey>;
33
+ signTransactionWithSecretKey(transaction: BitcoinLegacyUnsignedTransaction, secretKey: SecretKey | ExtendedSecretKey): Promise<BitcoinLegacySignedTransaction>;
34
+ private signTransactionWithNonExtendedSecretKey;
35
+ private signTransactionWithExtendedSecretKey;
36
+ signMessageWithKeyPair(message: string, keyPair: ExtendedKeyPair | KeyPair): Promise<Signature>;
37
+ decryptAsymmetricWithKeyPair(payload: string, keyPair: ExtendedKeyPair | KeyPair): Promise<string>;
38
+ encryptAESWithSecretKey(payload: string, secretKey: SecretKey | ExtendedSecretKey): Promise<string>;
39
+ decryptAESWithSecretKey(payload: string, secretKey: SecretKey | ExtendedSecretKey): Promise<string>;
40
+ getNetwork(): Promise<BitcoinProtocolNetwork>;
41
+ getTransactionsForPublicKey(publicKey: ExtendedPublicKey | PublicKey, limit: number, cursor?: BitcoinTransactionCursor): Promise<AirGapTransactionsWithCursor<BitcoinTransactionCursor, BitcoinUnits>>;
42
+ getTransactionsForAddress(address: string, limit: number, cursor?: BitcoinTransactionCursor): Promise<AirGapTransactionsWithCursor<BitcoinTransactionCursor, BitcoinUnits>>;
43
+ getTransactionsForAddresses(addresses: string[], limit: number, cursor?: BitcoinTransactionCursor): Promise<AirGapTransactionsWithCursor<BitcoinTransactionCursor, BitcoinUnits>>;
44
+ getBalanceOfPublicKey(publicKey: ExtendedPublicKey | PublicKey): Promise<Balance<BitcoinUnits>>;
45
+ getBalanceOfAddress(address: string): Promise<Balance<BitcoinUnits>>;
46
+ getBalanceOfAddresses(addresses: string[]): Promise<Balance<BitcoinUnits>>;
47
+ getTransactionMaxAmountWithPublicKey(publicKey: ExtendedPublicKey | PublicKey, to: string[], configuration?: LegacyTransactionFullConfiguration<BitcoinUnits>): Promise<Amount<BitcoinUnits>>;
48
+ getTransactionFeeWithPublicKey(_publicKey: ExtendedPublicKey | PublicKey, _details: TransactionDetails<BitcoinUnits>[], _configuration?: TransactionSimpleConfiguration): Promise<FeeDefaults<BitcoinUnits>>;
49
+ prepareTransactionWithPublicKey(publicKey: ExtendedPublicKey | PublicKey, details: TransactionDetails<BitcoinUnits>[], configuration?: LegacyTransactionFullConfiguration<BitcoinUnits>): Promise<BitcoinLegacyUnsignedTransaction>;
50
+ private prepareTransactionWithNonExtendedPublicKey;
51
+ private prepareTransactionWithExtendedPublicKey;
52
+ broadcastTransaction(transaction: BitcoinLegacySignedTransaction): Promise<string>;
53
+ private convertCryptoDerivative;
54
+ private derivativeToBip32Node;
55
+ }
56
+ export declare function createBitcoinLegacyProtocol(options?: RecursivePartial<BitcoinProtocolOptions>): BitcoinLegacyProtocol;