@airgap/bitcoin 0.13.11-beta.1 → 0.13.11-beta.3
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.
- package/index.d.ts +1 -0
- package/index.js +18 -0
- package/index.js.map +1 -0
- package/package.json +1 -5
- package/v0/index.d.ts +14 -0
- package/v0/index.js +34 -0
- package/v0/index.js.map +1 -0
- package/v0/protocol/BitcoinAddress.d.ts +9 -0
- package/v0/protocol/BitcoinAddress.js +23 -0
- package/v0/protocol/BitcoinAddress.js.map +1 -0
- package/v0/protocol/BitcoinCryptoClient.d.ts +11 -0
- package/v0/protocol/BitcoinCryptoClient.js +91 -0
- package/v0/protocol/BitcoinCryptoClient.js.map +1 -0
- package/v0/protocol/BitcoinProtocol.d.ts +167 -0
- package/v0/protocol/BitcoinProtocol.js +1063 -0
- package/v0/protocol/BitcoinProtocol.js.map +1 -0
- package/v0/protocol/BitcoinProtocolOptions.d.ts +26 -0
- package/v0/protocol/BitcoinProtocolOptions.js +148 -0
- package/v0/protocol/BitcoinProtocolOptions.js.map +1 -0
- package/v0/protocol/BitcoinSegwitAddress.d.ts +7 -0
- package/v0/protocol/BitcoinSegwitAddress.js +41 -0
- package/v0/protocol/BitcoinSegwitAddress.js.map +1 -0
- package/v0/protocol/BitcoinSegwitProtocol.d.ts +28 -0
- package/v0/protocol/BitcoinSegwitProtocol.js +541 -0
- package/v0/protocol/BitcoinSegwitProtocol.js.map +1 -0
- package/v0/protocol/BitcoinTestnetProtocol.d.ts +7 -0
- package/v0/protocol/BitcoinTestnetProtocol.js +58 -0
- package/v0/protocol/BitcoinTestnetProtocol.js.map +1 -0
- package/v0/protocol/BitcoinTypes.d.ts +21 -0
- package/v0/protocol/BitcoinTypes.js +3 -0
- package/v0/protocol/BitcoinTypes.js.map +1 -0
- package/v0/serializer/schemas/v2/transaction-sign-request-bitcoin-segwit.json +0 -0
- package/v0/serializer/schemas/v2/transaction-sign-request-bitcoin.json +73 -0
- package/v0/serializer/schemas/v2/transaction-sign-response-bitcoin-segwit.json +0 -0
- package/v0/serializer/schemas/v2/transaction-sign-response-bitcoin.json +37 -0
- package/v0/serializer/schemas/v3/transaction-sign-request-bitcoin-segwit.json +29 -0
- package/v0/serializer/schemas/v3/transaction-sign-request-bitcoin.json +73 -0
- package/v0/serializer/schemas/v3/transaction-sign-response-bitcoin-segwit.json +19 -0
- package/v0/serializer/schemas/v3/transaction-sign-response-bitcoin.json +37 -0
- package/v0/serializer/validators/transaction-validator.d.ts +15 -0
- package/v0/serializer/validators/transaction-validator.js +81 -0
- package/v0/serializer/validators/transaction-validator.js.map +1 -0
- package/v0/serializer/validators/validators.d.ts +1 -0
- package/v0/serializer/validators/validators.js +151 -0
- package/v0/serializer/validators/validators.js.map +1 -0
- package/v0/types/signed-transaction-bitcoin-segwit.d.ts +5 -0
- package/v0/types/signed-transaction-bitcoin-segwit.js +3 -0
- package/v0/types/signed-transaction-bitcoin-segwit.js.map +1 -0
- package/v0/types/signed-transaction-bitcoin.d.ts +9 -0
- package/v0/types/signed-transaction-bitcoin.js +3 -0
- package/v0/types/signed-transaction-bitcoin.js.map +1 -0
- package/v0/types/transaction-bitcoin.d.ts +20 -0
- package/v0/types/transaction-bitcoin.js +3 -0
- package/v0/types/transaction-bitcoin.js.map +1 -0
- package/v0/types/unsigned-transaction-bitcoin-segwit.d.ts +7 -0
- package/v0/types/unsigned-transaction-bitcoin-segwit.js +3 -0
- package/v0/types/unsigned-transaction-bitcoin-segwit.js.map +1 -0
- package/v0/types/unsigned-transaction-bitcoin.d.ts +22 -0
- package/v0/types/unsigned-transaction-bitcoin.js +3 -0
- package/v0/types/unsigned-transaction-bitcoin.js.map +1 -0
- package/v1/block-explorer/BlockCypherBlockExplorer.d.ts +9 -0
- package/v1/block-explorer/BlockCypherBlockExplorer.js +74 -0
- package/v1/block-explorer/BlockCypherBlockExplorer.js.map +1 -0
- package/v1/data/BitcoinAddress.d.ts +7 -0
- package/v1/data/BitcoinAddress.js +20 -0
- package/v1/data/BitcoinAddress.js.map +1 -0
- package/v1/data/BitcoinSegwitAddress.d.ts +8 -0
- package/v1/data/BitcoinSegwitAddress.js +25 -0
- package/v1/data/BitcoinSegwitAddress.js.map +1 -0
- package/v1/index.d.ts +20 -0
- package/v1/index.js +24 -0
- package/v1/index.js.map +1 -0
- package/v1/module/BitcoinModule.d.ts +16 -0
- package/v1/module/BitcoinModule.js +112 -0
- package/v1/module/BitcoinModule.js.map +1 -0
- package/v1/module.d.ts +3 -0
- package/v1/module.js +24 -0
- package/v1/module.js.map +1 -0
- package/v1/protocol/BitcoinCryptoClient.d.ts +12 -0
- package/v1/protocol/BitcoinCryptoClient.js +96 -0
- package/v1/protocol/BitcoinCryptoClient.js.map +1 -0
- package/v1/protocol/BitcoinProtocol.d.ts +72 -0
- package/v1/protocol/BitcoinProtocol.js +1193 -0
- package/v1/protocol/BitcoinProtocol.js.map +1 -0
- package/v1/protocol/BitcoinSegwitProtocol.d.ts +52 -0
- package/v1/protocol/BitcoinSegwitProtocol.js +720 -0
- package/v1/protocol/BitcoinSegwitProtocol.js.map +1 -0
- package/v1/protocol/BitcoinTestnetProtocol.d.ts +12 -0
- package/v1/protocol/BitcoinTestnetProtocol.js +73 -0
- package/v1/protocol/BitcoinTestnetProtocol.js.map +1 -0
- package/v1/serializer/v3/schemas/converter/transaction-converter.d.ts +13 -0
- package/v1/serializer/v3/schemas/converter/transaction-converter.js +75 -0
- package/v1/serializer/v3/schemas/converter/transaction-converter.js.map +1 -0
- package/v1/serializer/v3/schemas/definitions/transaction-sign-request-bitcoin-segwit.d.ts +4 -0
- package/v1/serializer/v3/schemas/definitions/transaction-sign-request-bitcoin-segwit.js +3 -0
- package/v1/serializer/v3/schemas/definitions/transaction-sign-request-bitcoin-segwit.js.map +1 -0
- package/v1/serializer/v3/schemas/definitions/transaction-sign-request-bitcoin.d.ts +4 -0
- package/v1/serializer/v3/schemas/definitions/transaction-sign-request-bitcoin.js +3 -0
- package/v1/serializer/v3/schemas/definitions/transaction-sign-request-bitcoin.js.map +1 -0
- package/v1/serializer/v3/schemas/definitions/transaction-sign-response-bitcoin-segwit.d.ts +3 -0
- package/v1/serializer/v3/schemas/definitions/transaction-sign-response-bitcoin-segwit.js +3 -0
- package/v1/serializer/v3/schemas/definitions/transaction-sign-response-bitcoin-segwit.js.map +1 -0
- package/v1/serializer/v3/schemas/definitions/transaction-sign-response-bitcoin.d.ts +7 -0
- package/v1/serializer/v3/schemas/definitions/transaction-sign-response-bitcoin.js +3 -0
- package/v1/serializer/v3/schemas/definitions/transaction-sign-response-bitcoin.js.map +1 -0
- package/v1/serializer/v3/schemas/generated/transaction-sign-request-bitcoin-segwit.json +29 -0
- package/v1/serializer/v3/schemas/generated/transaction-sign-request-bitcoin.json +79 -0
- package/v1/serializer/v3/schemas/generated/transaction-sign-response-bitcoin-segwit.json +19 -0
- package/v1/serializer/v3/schemas/generated/transaction-sign-response-bitcoin.json +37 -0
- package/v1/serializer/v3/serializer-companion.d.ts +14 -0
- package/v1/serializer/v3/serializer-companion.js +197 -0
- package/v1/serializer/v3/serializer-companion.js.map +1 -0
- package/v1/serializer/v3/validators/transaction-validator.d.ts +7 -0
- package/v1/serializer/v3/validators/transaction-validator.js +56 -0
- package/v1/serializer/v3/validators/transaction-validator.js.map +1 -0
- package/v1/serializer/v3/validators/validators.d.ts +7 -0
- package/v1/serializer/v3/validators/validators.js +238 -0
- package/v1/serializer/v3/validators/validators.js.map +1 -0
- package/v1/types/bitcoinjs.d.ts +14 -0
- package/v1/types/bitcoinjs.js +3 -0
- package/v1/types/bitcoinjs.js.map +1 -0
- package/v1/types/crypto.d.ts +2 -0
- package/v1/types/crypto.js +3 -0
- package/v1/types/crypto.js.map +1 -0
- package/v1/types/indexer.d.ts +81 -0
- package/v1/types/indexer.js +3 -0
- package/v1/types/indexer.js.map +1 -0
- package/v1/types/key.d.ts +6 -0
- package/v1/types/key.js +3 -0
- package/v1/types/key.js.map +1 -0
- package/v1/types/protocol.d.ts +17 -0
- package/v1/types/protocol.js +3 -0
- package/v1/types/protocol.js.map +1 -0
- package/v1/types/transaction.d.ts +39 -0
- package/v1/types/transaction.js +3 -0
- package/v1/types/transaction.js.map +1 -0
- package/v1/utils/common.d.ts +2 -0
- package/v1/utils/common.js +28 -0
- package/v1/utils/common.js.map +1 -0
- package/v1/utils/key.d.ts +34 -0
- package/v1/utils/key.js +190 -0
- package/v1/utils/key.js.map +1 -0
- package/v1/utils/network.d.ts +2 -0
- package/v1/utils/network.js +22 -0
- package/v1/utils/network.js.map +1 -0
- package/v1/utils/signature.d.ts +2 -0
- package/v1/utils/signature.js +34 -0
- package/v1/utils/signature.js.map +1 -0
package/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './v0';
|
package/index.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./v0"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
package/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uCAAoB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@airgap/bitcoin",
|
|
3
|
-
"version": "0.13.11-beta.
|
|
3
|
+
"version": "0.13.11-beta.3",
|
|
4
4
|
"description": "The @airgap/bitcoin is a Bitcoin implementation of the ICoinProtocol interface from @airgap/coinlib-core.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"airgap",
|
|
@@ -17,10 +17,6 @@
|
|
|
17
17
|
"publishConfig": {
|
|
18
18
|
"access": "public"
|
|
19
19
|
},
|
|
20
|
-
"main": "dist/index.js",
|
|
21
|
-
"files": [
|
|
22
|
-
"dist"
|
|
23
|
-
],
|
|
24
20
|
"scripts": {
|
|
25
21
|
"build": "rm -rf ./dist && tsc && node scripts/copy-files-after-build.js",
|
|
26
22
|
"build-scripts": "tsc scripts/*.ts",
|
package/v0/index.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BitcoinAddress } from './protocol/BitcoinAddress';
|
|
2
|
+
import { BitcoinCryptoClient } from './protocol/BitcoinCryptoClient';
|
|
3
|
+
import { BitcoinProtocol } from './protocol/BitcoinProtocol';
|
|
4
|
+
import { BitcoinProtocolConfig, BitcoinProtocolNetwork, BitcoinProtocolNetworkExtras, BitcoinProtocolOptions, BlockcypherBlockExplorer } from './protocol/BitcoinProtocolOptions';
|
|
5
|
+
import { BitcoinSegwitAddress } from './protocol/BitcoinSegwitAddress';
|
|
6
|
+
import { BitcoinSegwitProtocol } from './protocol/BitcoinSegwitProtocol';
|
|
7
|
+
import { BitcoinTestnetProtocol } from './protocol/BitcoinTestnetProtocol';
|
|
8
|
+
import { SignedBitcoinTransaction } from './types/signed-transaction-bitcoin';
|
|
9
|
+
import { SignedBitcoinSegwitTransaction } from './types/signed-transaction-bitcoin-segwit';
|
|
10
|
+
import { RawBitcoinSegwitTransaction, RawBitcoinTransaction } from './types/transaction-bitcoin';
|
|
11
|
+
import { UnsignedBitcoinTransaction } from './types/unsigned-transaction-bitcoin';
|
|
12
|
+
import { UnsignedBitcoinSegwitTransaction } from './types/unsigned-transaction-bitcoin-segwit';
|
|
13
|
+
export { BitcoinProtocol, BitcoinTestnetProtocol, BitcoinCryptoClient, BitcoinProtocolNetworkExtras, BlockcypherBlockExplorer, BitcoinProtocolNetwork, BitcoinProtocolConfig, BitcoinProtocolOptions, BitcoinAddress, RawBitcoinTransaction, UnsignedBitcoinTransaction, UnsignedBitcoinSegwitTransaction, SignedBitcoinTransaction, SignedBitcoinSegwitTransaction };
|
|
14
|
+
export { BitcoinSegwitProtocol, BitcoinSegwitAddress, RawBitcoinSegwitTransaction };
|
package/v0/index.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BitcoinSegwitAddress = exports.BitcoinSegwitProtocol = exports.BitcoinAddress = exports.BitcoinProtocolOptions = exports.BitcoinProtocolConfig = exports.BitcoinProtocolNetwork = exports.BlockcypherBlockExplorer = exports.BitcoinProtocolNetworkExtras = exports.BitcoinCryptoClient = exports.BitcoinTestnetProtocol = exports.BitcoinProtocol = void 0;
|
|
4
|
+
var coinlib_core_1 = require("@airgap/coinlib-core");
|
|
5
|
+
var serializer_1 = require("@airgap/serializer");
|
|
6
|
+
var BitcoinAddress_1 = require("./protocol/BitcoinAddress");
|
|
7
|
+
Object.defineProperty(exports, "BitcoinAddress", { enumerable: true, get: function () { return BitcoinAddress_1.BitcoinAddress; } });
|
|
8
|
+
var BitcoinCryptoClient_1 = require("./protocol/BitcoinCryptoClient");
|
|
9
|
+
Object.defineProperty(exports, "BitcoinCryptoClient", { enumerable: true, get: function () { return BitcoinCryptoClient_1.BitcoinCryptoClient; } });
|
|
10
|
+
var BitcoinProtocol_1 = require("./protocol/BitcoinProtocol");
|
|
11
|
+
Object.defineProperty(exports, "BitcoinProtocol", { enumerable: true, get: function () { return BitcoinProtocol_1.BitcoinProtocol; } });
|
|
12
|
+
var BitcoinProtocolOptions_1 = require("./protocol/BitcoinProtocolOptions");
|
|
13
|
+
Object.defineProperty(exports, "BitcoinProtocolConfig", { enumerable: true, get: function () { return BitcoinProtocolOptions_1.BitcoinProtocolConfig; } });
|
|
14
|
+
Object.defineProperty(exports, "BitcoinProtocolNetwork", { enumerable: true, get: function () { return BitcoinProtocolOptions_1.BitcoinProtocolNetwork; } });
|
|
15
|
+
Object.defineProperty(exports, "BitcoinProtocolNetworkExtras", { enumerable: true, get: function () { return BitcoinProtocolOptions_1.BitcoinProtocolNetworkExtras; } });
|
|
16
|
+
Object.defineProperty(exports, "BitcoinProtocolOptions", { enumerable: true, get: function () { return BitcoinProtocolOptions_1.BitcoinProtocolOptions; } });
|
|
17
|
+
Object.defineProperty(exports, "BlockcypherBlockExplorer", { enumerable: true, get: function () { return BitcoinProtocolOptions_1.BlockcypherBlockExplorer; } });
|
|
18
|
+
var BitcoinSegwitAddress_1 = require("./protocol/BitcoinSegwitAddress");
|
|
19
|
+
Object.defineProperty(exports, "BitcoinSegwitAddress", { enumerable: true, get: function () { return BitcoinSegwitAddress_1.BitcoinSegwitAddress; } });
|
|
20
|
+
var BitcoinSegwitProtocol_1 = require("./protocol/BitcoinSegwitProtocol");
|
|
21
|
+
Object.defineProperty(exports, "BitcoinSegwitProtocol", { enumerable: true, get: function () { return BitcoinSegwitProtocol_1.BitcoinSegwitProtocol; } });
|
|
22
|
+
var BitcoinTestnetProtocol_1 = require("./protocol/BitcoinTestnetProtocol");
|
|
23
|
+
Object.defineProperty(exports, "BitcoinTestnetProtocol", { enumerable: true, get: function () { return BitcoinTestnetProtocol_1.BitcoinTestnetProtocol; } });
|
|
24
|
+
var transaction_validator_1 = require("./serializer/validators/transaction-validator");
|
|
25
|
+
// Serializer
|
|
26
|
+
serializer_1.SerializerV3.addSchema(serializer_1.IACMessageType.TransactionSignRequest, { schema: require('./serializer/schemas/v3/transaction-sign-request-bitcoin-segwit.json') }, coinlib_core_1.MainProtocolSymbols.BTC_SEGWIT);
|
|
27
|
+
serializer_1.SerializerV3.addSchema(serializer_1.IACMessageType.TransactionSignResponse, { schema: require('./serializer/schemas/v3/transaction-sign-response-bitcoin-segwit.json') }, coinlib_core_1.MainProtocolSymbols.BTC_SEGWIT);
|
|
28
|
+
serializer_1.Serializer.addSchema(serializer_1.IACMessageType.TransactionSignRequest, { schema: require('./serializer/schemas/v2/transaction-sign-request-bitcoin.json') }, coinlib_core_1.MainProtocolSymbols.BTC);
|
|
29
|
+
serializer_1.Serializer.addSchema(serializer_1.IACMessageType.TransactionSignResponse, { schema: require('./serializer/schemas/v2/transaction-sign-response-bitcoin.json') }, coinlib_core_1.MainProtocolSymbols.BTC);
|
|
30
|
+
serializer_1.SerializerV3.addSchema(serializer_1.IACMessageType.TransactionSignRequest, { schema: require('./serializer/schemas/v3/transaction-sign-request-bitcoin.json') }, coinlib_core_1.MainProtocolSymbols.BTC);
|
|
31
|
+
serializer_1.SerializerV3.addSchema(serializer_1.IACMessageType.TransactionSignResponse, { schema: require('./serializer/schemas/v3/transaction-sign-response-bitcoin.json') }, coinlib_core_1.MainProtocolSymbols.BTC);
|
|
32
|
+
serializer_1.Serializer.addValidator(coinlib_core_1.MainProtocolSymbols.BTC, new transaction_validator_1.BitcoinTransactionValidatorFactoryV2());
|
|
33
|
+
serializer_1.SerializerV3.addValidator(coinlib_core_1.MainProtocolSymbols.BTC, new transaction_validator_1.BitcoinTransactionValidatorFactory());
|
|
34
|
+
//# sourceMappingURL=index.js.map
|
package/v0/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/v0/index.ts"],"names":[],"mappings":";;;AAAA,qDAA0D;AAC1D,iDAA6E;AAE7E,4DAA0D;AA6BxD,+FA7BO,+BAAc,OA6BP;AA5BhB,sEAAoE;AAsBlE,oGAtBO,yCAAmB,OAsBP;AArBrB,8DAA4D;AAmB1D,gGAnBO,iCAAe,OAmBP;AAlBjB,4EAM0C;AAkBxC,sGAvBA,8CAAqB,OAuBA;AADrB,uGArBA,+CAAsB,OAqBA;AAFtB,6GAlBA,qDAA4B,OAkBA;AAI5B,uGArBA,+CAAsB,OAqBA;AAHtB,yGAjBA,iDAAwB,OAiBA;AAf1B,wEAAsE;AA4BtC,qGA5BvB,2CAAoB,OA4BuB;AA3BpD,0EAAwE;AA2B/D,sGA3BA,6CAAqB,OA2BA;AA1B9B,4EAA0E;AAUxE,uGAVO,+CAAsB,OAUP;AATxB,uFAAwI;AA2BxI,aAAa;AAEb,yBAAY,CAAC,SAAS,CACpB,2BAAc,CAAC,sBAAsB,EACrC,EAAE,MAAM,EAAE,OAAO,CAAC,sEAAsE,CAAC,EAAE,EAC3F,kCAAmB,CAAC,UAAU,CAC/B,CAAA;AACD,yBAAY,CAAC,SAAS,CACpB,2BAAc,CAAC,uBAAuB,EACtC,EAAE,MAAM,EAAE,OAAO,CAAC,uEAAuE,CAAC,EAAE,EAC5F,kCAAmB,CAAC,UAAU,CAC/B,CAAA;AAED,uBAAU,CAAC,SAAS,CAClB,2BAAc,CAAC,sBAAsB,EACrC,EAAE,MAAM,EAAE,OAAO,CAAC,+DAA+D,CAAC,EAAE,EACpF,kCAAmB,CAAC,GAAG,CACxB,CAAA;AACD,uBAAU,CAAC,SAAS,CAClB,2BAAc,CAAC,uBAAuB,EACtC,EAAE,MAAM,EAAE,OAAO,CAAC,gEAAgE,CAAC,EAAE,EACrF,kCAAmB,CAAC,GAAG,CACxB,CAAA;AAED,yBAAY,CAAC,SAAS,CACpB,2BAAc,CAAC,sBAAsB,EACrC,EAAE,MAAM,EAAE,OAAO,CAAC,+DAA+D,CAAC,EAAE,EACpF,kCAAmB,CAAC,GAAG,CACxB,CAAA;AACD,yBAAY,CAAC,SAAS,CACpB,2BAAc,CAAC,uBAAuB,EACtC,EAAE,MAAM,EAAE,OAAO,CAAC,gEAAgE,CAAC,EAAE,EACrF,kCAAmB,CAAC,GAAG,CACxB,CAAA;AAED,uBAAU,CAAC,YAAY,CAAC,kCAAmB,CAAC,GAAG,EAAE,IAAI,4DAAoC,EAAE,CAAC,CAAA;AAC5F,yBAAY,CAAC,YAAY,CAAC,kCAAmB,CAAC,GAAG,EAAE,IAAI,0DAAkC,EAAE,CAAC,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IAirGapAddress } from '@airgap/coinlib-core/interfaces/IAirGapAddress';
|
|
2
|
+
export declare class BitcoinAddress implements IAirGapAddress {
|
|
3
|
+
protected readonly value: string;
|
|
4
|
+
readonly visibilityDerivationIndex?: number | undefined;
|
|
5
|
+
readonly addressDerivationIndex?: number | undefined;
|
|
6
|
+
constructor(value: string, visibilityDerivationIndex?: number | undefined, addressDerivationIndex?: number | undefined);
|
|
7
|
+
static from(node: any, visibilityDerivationIndex?: number, addressDerivationIndex?: number): BitcoinAddress;
|
|
8
|
+
asString(): string;
|
|
9
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BitcoinAddress = void 0;
|
|
4
|
+
var BitcoinAddress = /** @class */ (function () {
|
|
5
|
+
// TODO: types
|
|
6
|
+
function BitcoinAddress(value, visibilityDerivationIndex, addressDerivationIndex) {
|
|
7
|
+
this.value = value;
|
|
8
|
+
this.visibilityDerivationIndex = visibilityDerivationIndex;
|
|
9
|
+
this.addressDerivationIndex = addressDerivationIndex;
|
|
10
|
+
}
|
|
11
|
+
BitcoinAddress.from = function (node, visibilityDerivationIndex, addressDerivationIndex) {
|
|
12
|
+
var _node = visibilityDerivationIndex !== undefined && addressDerivationIndex !== undefined
|
|
13
|
+
? node.derive(visibilityDerivationIndex).derive(addressDerivationIndex)
|
|
14
|
+
: node;
|
|
15
|
+
return new BitcoinAddress(_node.getAddress(), visibilityDerivationIndex, addressDerivationIndex);
|
|
16
|
+
};
|
|
17
|
+
BitcoinAddress.prototype.asString = function () {
|
|
18
|
+
return this.value;
|
|
19
|
+
};
|
|
20
|
+
return BitcoinAddress;
|
|
21
|
+
}());
|
|
22
|
+
exports.BitcoinAddress = BitcoinAddress;
|
|
23
|
+
//# sourceMappingURL=BitcoinAddress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BitcoinAddress.js","sourceRoot":"","sources":["../../../src/v0/protocol/BitcoinAddress.ts"],"names":[],"mappings":";;;AAEA;IACE,cAAc;IACd,wBACqB,KAAa,EAChB,yBAAkC,EAClC,sBAA+B;QAF5B,UAAK,GAAL,KAAK,CAAQ;QAChB,8BAAyB,GAAzB,yBAAyB,CAAS;QAClC,2BAAsB,GAAtB,sBAAsB,CAAS;IAC9C,CAAC;IAEU,mBAAI,GAAlB,UAAmB,IAAS,EAAE,yBAAkC,EAAE,sBAA+B;QAC/F,IAAM,KAAK,GACT,yBAAyB,KAAK,SAAS,IAAI,sBAAsB,KAAK,SAAS;YAC7E,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,yBAAyB,CAAC,CAAC,MAAM,CAAC,sBAAsB,CAAC;YACvE,CAAC,CAAC,IAAI,CAAA;QAEV,OAAO,IAAI,cAAc,CAAC,KAAK,CAAC,UAAU,EAAE,EAAE,yBAAyB,EAAE,sBAAsB,CAAC,CAAA;IAClG,CAAC;IAEM,iCAAQ,GAAf;QACE,OAAO,IAAI,CAAC,KAAK,CAAA;IACnB,CAAC;IACH,qBAAC;AAAD,CAAC,AApBD,IAoBC;AApBY,wCAAc"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ICoinProtocol } from '@airgap/coinlib-core';
|
|
2
|
+
import { Secp256k1CryptoClient } from '@airgap/coinlib-core/protocols/Secp256k1CryptoClient';
|
|
3
|
+
export declare class BitcoinCryptoClient extends Secp256k1CryptoClient {
|
|
4
|
+
private readonly protocol;
|
|
5
|
+
private readonly bitcoinJSMessage;
|
|
6
|
+
constructor(protocol: ICoinProtocol, bitcoinJSMessage: any);
|
|
7
|
+
signMessage(message: string, keypair: {
|
|
8
|
+
privateKey: string;
|
|
9
|
+
}): Promise<string>;
|
|
10
|
+
verifyMessage(message: string, signature: string, publicKey: string): Promise<boolean>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
|
+
function step(op) {
|
|
31
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
32
|
+
while (_) try {
|
|
33
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
34
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
35
|
+
switch (op[0]) {
|
|
36
|
+
case 0: case 1: t = op; break;
|
|
37
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
38
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
39
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
40
|
+
default:
|
|
41
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
42
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
43
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
44
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
45
|
+
if (t[2]) _.ops.pop();
|
|
46
|
+
_.trys.pop(); continue;
|
|
47
|
+
}
|
|
48
|
+
op = body.call(thisArg, _);
|
|
49
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
50
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
|
+
exports.BitcoinCryptoClient = void 0;
|
|
55
|
+
var Secp256k1CryptoClient_1 = require("@airgap/coinlib-core/protocols/Secp256k1CryptoClient");
|
|
56
|
+
var BitcoinCryptoClient = /** @class */ (function (_super) {
|
|
57
|
+
__extends(BitcoinCryptoClient, _super);
|
|
58
|
+
function BitcoinCryptoClient(protocol, bitcoinJSMessage) {
|
|
59
|
+
var _this = _super.call(this) || this;
|
|
60
|
+
_this.protocol = protocol;
|
|
61
|
+
_this.bitcoinJSMessage = bitcoinJSMessage;
|
|
62
|
+
return _this;
|
|
63
|
+
}
|
|
64
|
+
BitcoinCryptoClient.prototype.signMessage = function (message, keypair) {
|
|
65
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
66
|
+
var signature;
|
|
67
|
+
return __generator(this, function (_a) {
|
|
68
|
+
signature = this.bitcoinJSMessage.sign(message, Buffer.from(keypair.privateKey, 'hex'), true);
|
|
69
|
+
return [2 /*return*/, signature.toString('base64')];
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
};
|
|
73
|
+
BitcoinCryptoClient.prototype.verifyMessage = function (message, signature, publicKey) {
|
|
74
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
75
|
+
var rawSignature, address;
|
|
76
|
+
return __generator(this, function (_a) {
|
|
77
|
+
switch (_a.label) {
|
|
78
|
+
case 0:
|
|
79
|
+
rawSignature = Buffer.from(signature, 'base64');
|
|
80
|
+
return [4 /*yield*/, this.protocol.getAddressFromPublicKey(publicKey)];
|
|
81
|
+
case 1:
|
|
82
|
+
address = _a.sent();
|
|
83
|
+
return [2 /*return*/, this.bitcoinJSMessage.verify(message, address.address, rawSignature)];
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
};
|
|
88
|
+
return BitcoinCryptoClient;
|
|
89
|
+
}(Secp256k1CryptoClient_1.Secp256k1CryptoClient));
|
|
90
|
+
exports.BitcoinCryptoClient = BitcoinCryptoClient;
|
|
91
|
+
//# sourceMappingURL=BitcoinCryptoClient.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BitcoinCryptoClient.js","sourceRoot":"","sources":["../../../src/v0/protocol/BitcoinCryptoClient.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,8FAA4F;AAE5F;IAAyC,uCAAqB;IAC5D,6BAA6B,QAAuB,EAAmB,gBAAqB;QAA5F,YACE,iBAAO,SACR;QAF4B,cAAQ,GAAR,QAAQ,CAAe;QAAmB,sBAAgB,GAAhB,gBAAgB,CAAK;;IAE5F,CAAC;IAEY,yCAAW,GAAxB,UAAyB,OAAe,EAAE,OAA+B;;;;gBACjE,SAAS,GAAW,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,KAAK,CAAC,EAAE,IAAI,CAAC,CAAA;gBAE3G,sBAAO,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAA;;;KACpC;IAEY,2CAAa,GAA1B,UAA2B,OAAe,EAAE,SAAiB,EAAE,SAAiB;;;;;;wBACxE,YAAY,GAAW,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAA;wBAE7C,qBAAM,IAAI,CAAC,QAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,EAAA;;wBAAhE,OAAO,GAAG,SAAsD;wBAEtE,sBAAO,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,YAAY,CAAC,EAAA;;;;KAC5E;IACH,0BAAC;AAAD,CAAC,AAlBD,CAAyC,6CAAqB,GAkB7D;AAlBY,kDAAmB"}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { UnsignedTransaction } from '@airgap/coinlib-core';
|
|
2
|
+
import { IAirGapSignedTransaction } from '@airgap/coinlib-core/interfaces/IAirGapSignedTransaction';
|
|
3
|
+
import { AirGapTransactionStatus, IAirGapTransaction } from '@airgap/coinlib-core/interfaces/IAirGapTransaction';
|
|
4
|
+
import { CurrencyUnit, FeeDefaults, ICoinProtocol } from '@airgap/coinlib-core/protocols/ICoinProtocol';
|
|
5
|
+
import { ICoinSubProtocol } from '@airgap/coinlib-core/protocols/ICoinSubProtocol';
|
|
6
|
+
import { ProtocolSymbols } from '@airgap/coinlib-core/utils/ProtocolSymbols';
|
|
7
|
+
import { SignedBitcoinTransaction } from '../types/signed-transaction-bitcoin';
|
|
8
|
+
import { RawBitcoinTransaction } from '../types/transaction-bitcoin';
|
|
9
|
+
import { BitcoinCryptoClient } from './BitcoinCryptoClient';
|
|
10
|
+
import { BitcoinProtocolOptions } from './BitcoinProtocolOptions';
|
|
11
|
+
import { BitcoinAddressCursor, BitcoinAddressResult, BitcoinBlockbookTransactionCursor, BitcoinBlockbookTransactionResult } from './BitcoinTypes';
|
|
12
|
+
export interface UTXOResponse {
|
|
13
|
+
txid: string;
|
|
14
|
+
vout: number;
|
|
15
|
+
value: string;
|
|
16
|
+
height: number;
|
|
17
|
+
confirmations: number;
|
|
18
|
+
address: string;
|
|
19
|
+
path: string;
|
|
20
|
+
}
|
|
21
|
+
export interface Vin {
|
|
22
|
+
txid: string;
|
|
23
|
+
sequence: any;
|
|
24
|
+
n: number;
|
|
25
|
+
addresses: string[];
|
|
26
|
+
value: string;
|
|
27
|
+
hex: string;
|
|
28
|
+
}
|
|
29
|
+
export interface Vout {
|
|
30
|
+
value: string;
|
|
31
|
+
n: number;
|
|
32
|
+
hex: string;
|
|
33
|
+
addresses: string[];
|
|
34
|
+
spent?: boolean;
|
|
35
|
+
}
|
|
36
|
+
export interface Transaction {
|
|
37
|
+
txid: string;
|
|
38
|
+
version: number;
|
|
39
|
+
vin: Vin[];
|
|
40
|
+
vout: Vout[];
|
|
41
|
+
blockhash: string;
|
|
42
|
+
blockHeight: number;
|
|
43
|
+
confirmations: number;
|
|
44
|
+
blockTime: number;
|
|
45
|
+
value: string;
|
|
46
|
+
valueIn: string;
|
|
47
|
+
fees: string;
|
|
48
|
+
hex: string;
|
|
49
|
+
}
|
|
50
|
+
export interface Token {
|
|
51
|
+
type: string;
|
|
52
|
+
name: string;
|
|
53
|
+
path: string;
|
|
54
|
+
transfers: number;
|
|
55
|
+
decimals: number;
|
|
56
|
+
balance: string;
|
|
57
|
+
totalReceived: string;
|
|
58
|
+
totalSent: string;
|
|
59
|
+
}
|
|
60
|
+
export interface XPubResponse {
|
|
61
|
+
page: number;
|
|
62
|
+
totalPages: number;
|
|
63
|
+
itemsOnPage: number;
|
|
64
|
+
address: string;
|
|
65
|
+
balance: string;
|
|
66
|
+
totalReceived: string;
|
|
67
|
+
totalSent: string;
|
|
68
|
+
unconfirmedBalance: string;
|
|
69
|
+
unconfirmedTxs: number;
|
|
70
|
+
txs: number;
|
|
71
|
+
transactions?: Transaction[];
|
|
72
|
+
totalTokens?: number;
|
|
73
|
+
tokens?: Token[];
|
|
74
|
+
}
|
|
75
|
+
export interface AddressResponse {
|
|
76
|
+
page: number;
|
|
77
|
+
totalPages: number;
|
|
78
|
+
itemsOnPage: number;
|
|
79
|
+
address: string;
|
|
80
|
+
balance: string;
|
|
81
|
+
totalReceived: string;
|
|
82
|
+
totalSent: string;
|
|
83
|
+
unconfirmedBalance: string;
|
|
84
|
+
unconfirmedTxs: number;
|
|
85
|
+
txs: number;
|
|
86
|
+
transactions?: Transaction[];
|
|
87
|
+
}
|
|
88
|
+
export declare class BitcoinProtocol implements ICoinProtocol {
|
|
89
|
+
readonly options: BitcoinProtocolOptions;
|
|
90
|
+
symbol: string;
|
|
91
|
+
name: string;
|
|
92
|
+
marketSymbol: string;
|
|
93
|
+
feeSymbol: string;
|
|
94
|
+
feeDefaults: FeeDefaults;
|
|
95
|
+
decimals: number;
|
|
96
|
+
feeDecimals: number;
|
|
97
|
+
identifier: ProtocolSymbols;
|
|
98
|
+
units: CurrencyUnit[];
|
|
99
|
+
supportsHD: boolean;
|
|
100
|
+
standardDerivationPath: string;
|
|
101
|
+
addressIsCaseSensitive: boolean;
|
|
102
|
+
addressValidationPattern: string;
|
|
103
|
+
addressPlaceholder: string;
|
|
104
|
+
readonly cryptoClient: BitcoinCryptoClient;
|
|
105
|
+
constructor(options?: BitcoinProtocolOptions);
|
|
106
|
+
getSymbol(): Promise<string>;
|
|
107
|
+
getName(): Promise<string>;
|
|
108
|
+
getMarketSymbol(): Promise<string>;
|
|
109
|
+
getFeeSymbol(): Promise<string>;
|
|
110
|
+
getFeeDefaults(): Promise<FeeDefaults>;
|
|
111
|
+
getDecimals(): Promise<number>;
|
|
112
|
+
getFeeDecimals(): Promise<number>;
|
|
113
|
+
getIdentifier(): Promise<ProtocolSymbols>;
|
|
114
|
+
getUnits(): Promise<CurrencyUnit[]>;
|
|
115
|
+
getSupportsHD(): Promise<boolean>;
|
|
116
|
+
getStandardDerivationPath(): Promise<string>;
|
|
117
|
+
getAddressIsCaseSensitive(): Promise<boolean>;
|
|
118
|
+
getAddressValidationPattern(): Promise<string>;
|
|
119
|
+
getAddressPlaceholder(): Promise<string>;
|
|
120
|
+
getOptions(): Promise<BitcoinProtocolOptions>;
|
|
121
|
+
getBlockExplorerLinkForAddress(address: string): Promise<string>;
|
|
122
|
+
getBlockExplorerLinkForTxId(txId: string): Promise<string>;
|
|
123
|
+
getPublicKeyFromMnemonic(mnemonic: string, derivationPath: string, password?: string): Promise<string>;
|
|
124
|
+
getPrivateKeyFromMnemonic(mnemonic: string, derivationPath: string, password?: string): Promise<string>;
|
|
125
|
+
getExtendedPublicKeyFromMnemonic(mnemonic: string, derivationPath: string, password?: string | undefined): Promise<string>;
|
|
126
|
+
getExtendedPrivateKeyFromMnemonic(mnemonic: string, derivationPath: string, password?: string): Promise<string>;
|
|
127
|
+
getPublicKeyFromHexSecret(secret: string, derivationPath: string): Promise<string>;
|
|
128
|
+
getPrivateKeyFromHexSecret(secret: string, derivationPath: string): Promise<string>;
|
|
129
|
+
getExtendedPublicKeyFromHexSecret(secret: string, derivationPath: string): Promise<string>;
|
|
130
|
+
getExtendedPrivateKeyFromHexSecret(secret: string, derivationPath: string): Promise<string>;
|
|
131
|
+
getAddressFromPublicKey(publicKey: string, cursor?: BitcoinAddressCursor): Promise<BitcoinAddressResult>;
|
|
132
|
+
getAddressesFromPublicKey(publicKey: string, cursor?: BitcoinAddressCursor): Promise<BitcoinAddressResult[]>;
|
|
133
|
+
getAddressFromExtendedPublicKey(extendedPublicKey: string, visibilityDerivationIndex: number, addressDerivationIndex: number): Promise<BitcoinAddressResult>;
|
|
134
|
+
getAddressesFromExtendedPublicKey(extendedPublicKey: string, visibilityDerivationIndex: number, addressCount: number, offset: number): Promise<BitcoinAddressResult[]>;
|
|
135
|
+
signWithPrivateKey(privateKey: string, transaction: RawBitcoinTransaction): Promise<IAirGapSignedTransaction>;
|
|
136
|
+
signWithExtendedPrivateKey(extendedPrivateKey: string, transaction: RawBitcoinTransaction): Promise<string>;
|
|
137
|
+
getTransactionDetails(unsignedTx: UnsignedTransaction): Promise<IAirGapTransaction[]>;
|
|
138
|
+
getTransactionDetailsFromSigned(signedTx: SignedBitcoinTransaction): Promise<IAirGapTransaction[]>;
|
|
139
|
+
getBalanceOfAddresses(addresses: string[]): Promise<string>;
|
|
140
|
+
getBalanceOfPublicKey(publicKey: string): Promise<string>;
|
|
141
|
+
getBalanceOfExtendedPublicKey(extendedPublicKey: string, offset?: number): Promise<string>;
|
|
142
|
+
getBalanceOfPublicKeyForSubProtocols(publicKey: string, subProtocols: ICoinSubProtocol[]): Promise<string[]>;
|
|
143
|
+
getAvailableBalanceOfAddresses(addresses: string[]): Promise<string>;
|
|
144
|
+
estimateMaxTransactionValueFromExtendedPublicKey(extendedPublicKey: string, recipients: string[], fee?: string): Promise<string>;
|
|
145
|
+
estimateMaxTransactionValueFromPublicKey(publicKey: string, recipients: string[], fee?: string): Promise<string>;
|
|
146
|
+
estimateFeeDefaultsFromExtendedPublicKey(publicKey: string, recipients: string[], values: string[], data?: any): Promise<FeeDefaults>;
|
|
147
|
+
estimateFeeDefaultsFromPublicKey(publicKey: string, recipients: string[], values: string[], data?: any): Promise<FeeDefaults>;
|
|
148
|
+
prepareTransactionFromExtendedPublicKey(extendedPublicKey: string, offset: number, recipients: string[], values: string[], fee: string, extras: unknown): Promise<RawBitcoinTransaction>;
|
|
149
|
+
prepareTransactionFromPublicKey(publicKey: string, recipients: string[], values: string[], fee: string): Promise<RawBitcoinTransaction>;
|
|
150
|
+
broadcastTransaction(rawTransaction: string): Promise<string>;
|
|
151
|
+
getTransactionsFromExtendedPublicKey(extendedPublicKey: string, limit: number, cursor?: BitcoinBlockbookTransactionCursor, addressOffset?: number): Promise<BitcoinBlockbookTransactionResult>;
|
|
152
|
+
getTransactionsFromPublicKey(publicKey: string, limit: number, cursor?: BitcoinBlockbookTransactionCursor): Promise<BitcoinBlockbookTransactionResult>;
|
|
153
|
+
getTransactionsFromAddresses(addresses: string[], limit: number, cursor?: BitcoinBlockbookTransactionCursor): Promise<BitcoinBlockbookTransactionResult>;
|
|
154
|
+
private containsSome;
|
|
155
|
+
signMessage(message: string, keypair: {
|
|
156
|
+
privateKey: string;
|
|
157
|
+
}): Promise<string>;
|
|
158
|
+
verifyMessage(message: string, signature: string, publicKey: string): Promise<boolean>;
|
|
159
|
+
encryptAsymmetric(message: string, publicKey: string): Promise<string>;
|
|
160
|
+
decryptAsymmetric(message: string, keypair: {
|
|
161
|
+
publicKey: string;
|
|
162
|
+
privateKey: string;
|
|
163
|
+
}): Promise<string>;
|
|
164
|
+
encryptAES(message: string, privateKey: string): Promise<string>;
|
|
165
|
+
decryptAES(message: string, privateKey: string): Promise<string>;
|
|
166
|
+
getTransactionStatuses(transactionHashes: string[]): Promise<AirGapTransactionStatus[]>;
|
|
167
|
+
}
|