@airgap/coinlib-core 0.12.4-beta.2 → 0.12.4-beta.6
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/airgap-coinlib-core.min.js +211 -202
- package/index.d.ts +3 -2
- package/index.js +3 -3
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/wallet/AirGapCoinWallet.d.ts +16 -0
- package/wallet/AirGapCoinWallet.js +160 -0
- package/wallet/AirGapCoinWallet.js.map +1 -0
- package/wallet/AirGapMarketWallet.d.ts +25 -15
- package/wallet/AirGapMarketWallet.js +121 -81
- package/wallet/AirGapMarketWallet.js.map +1 -1
- package/wallet/AirGapNFTWallet.d.ts +4 -4
- package/wallet/AirGapNFTWallet.js +16 -16
- package/wallet/AirGapNFTWallet.js.map +1 -1
- package/wallet/AirGapExtendedWallet.d.ts +0 -27
- package/wallet/AirGapExtendedWallet.js +0 -191
- package/wallet/AirGapExtendedWallet.js.map +0 -1
|
@@ -122241,9 +122241,9 @@ Object.defineProperty(exports, "getProtocolOptionsByIdentifier", { enumerable: t
|
|
|
122241
122241
|
var supportedProtocols_1 = require("./utils/supportedProtocols");
|
|
122242
122242
|
Object.defineProperty(exports, "addSupportedProtocol", { enumerable: true, get: function () { return supportedProtocols_1.addSupportedProtocol; } });
|
|
122243
122243
|
Object.defineProperty(exports, "supportedProtocols", { enumerable: true, get: function () { return supportedProtocols_1.supportedProtocols; } });
|
|
122244
|
-
var
|
|
122245
|
-
Object.defineProperty(exports, "AirGapMarketWallet", { enumerable: true, get: function () { return
|
|
122246
|
-
Object.defineProperty(exports, "TimeInterval", { enumerable: true, get: function () { return
|
|
122244
|
+
var AirGapCoinWallet_1 = require("./wallet/AirGapCoinWallet");
|
|
122245
|
+
Object.defineProperty(exports, "AirGapMarketWallet", { enumerable: true, get: function () { return AirGapCoinWallet_1.AirGapCoinWallet; } });
|
|
122246
|
+
Object.defineProperty(exports, "TimeInterval", { enumerable: true, get: function () { return AirGapCoinWallet_1.TimeInterval; } });
|
|
122247
122247
|
var AirGapNFTWallet_1 = require("./wallet/AirGapNFTWallet");
|
|
122248
122248
|
Object.defineProperty(exports, "AirGapNFTWallet", { enumerable: true, get: function () { return AirGapNFTWallet_1.AirGapNFTWallet; } });
|
|
122249
122249
|
var AirGapWallet_1 = require("./wallet/AirGapWallet");
|
|
@@ -122443,7 +122443,7 @@ var TezosQUIPU_1 = require("./protocols/tezos/fa/TezosQUIPU");
|
|
|
122443
122443
|
Object.defineProperty(exports, "TezosQUIPU", { enumerable: true, get: function () { return TezosQUIPU_1.TezosQUIPU; } });
|
|
122444
122444
|
Object.defineProperty(exports, "TezosQUIPUProtocolConfig", { enumerable: true, get: function () { return TezosQUIPU_1.TezosQUIPUProtocolConfig; } });
|
|
122445
122445
|
|
|
122446
|
-
},{"./actions/Action":214,"./actions/GetKtAccountsAction":215,"./actions/LinkedAction":216,"./actions/RepeatableAction":217,"./actions/SimpleAction":218,"./errors":489,"./errors/coinlib-error":488,"./protocols/CryptoClient":492,"./protocols/ICoinSubProtocol":494,"./protocols/aeternity/AeternityAddress":498,"./protocols/aeternity/AeternityCryptoClient":499,"./protocols/aeternity/AeternityProtocol":500,"./protocols/aeternity/AeternityProtocolOptions":501,"./protocols/bitcoin/BitcoinAddress":502,"./protocols/bitcoin/BitcoinCryptoClient":503,"./protocols/bitcoin/BitcoinProtocol":504,"./protocols/bitcoin/BitcoinProtocolOptions":505,"./protocols/bitcoin/BitcoinSegwitAddress":506,"./protocols/bitcoin/BitcoinSegwitProtocol":507,"./protocols/bitcoin/BitcoinTestnetProtocol":508,"./protocols/cosmos/CosmosAddress":509,"./protocols/cosmos/CosmosCryptoClient":511,"./protocols/cosmos/CosmosProtocol":514,"./protocols/cosmos/CosmosProtocolOptions":515,"./protocols/cosmos/CosmosTransaction":516,"./protocols/ethereum/EthereumAddress":522,"./protocols/ethereum/EthereumClassicProtocol":523,"./protocols/ethereum/EthereumCryptoClient":524,"./protocols/ethereum/EthereumProtocol":525,"./protocols/ethereum/EthereumProtocolOptions":526,"./protocols/ethereum/EthereumRopstenProtocol":527,"./protocols/ethereum/erc20/GenericERC20":532,"./protocols/groestlcoin/GroestlcoinProtocol":534,"./protocols/groestlcoin/GroestlcoinProtocolOptions":535,"./protocols/groestlcoin/GroestlcoinTestnetProtocol":536,"./protocols/substrate/SubstrateCryptoClient":537,"./protocols/substrate/SubstrateDelegateProtocol":538,"./protocols/substrate/SubstrateNetwork":539,"./protocols/substrate/SubstrateProtocol":540,"./protocols/substrate/SubstrateProtocolOptions":541,"./protocols/substrate/common/data/account/SubstrateAddress":546,"./protocols/substrate/common/data/staking/SubstrateEraElectionStatus":605,"./protocols/substrate/common/data/staking/SubstrateNominationStatus":608,"./protocols/substrate/common/data/staking/SubstratePayee":610,"./protocols/substrate/common/data/staking/SubstrateStakingActionType":612,"./protocols/substrate/common/data/transaction/SubstrateTransaction":616,"./protocols/substrate/common/node/SubstrateNodeClient":620,"./protocols/substrate/kusama/KusamaProtocol":625,"./protocols/substrate/kusama/KusamaProtocolOptions":626,"./protocols/substrate/moonbeam/MoonbeamProtocol":627,"./protocols/substrate/moonbeam/moonbase/MoonbaseProtocol":637,"./protocols/substrate/moonbeam/moonbase/MoonbaseProtocolOptions":638,"./protocols/substrate/moonbeam/moonriver/MoonriverProtocol":639,"./protocols/substrate/moonbeam/moonriver/MoonriverProtocolOptions":640,"./protocols/substrate/polkadot/PolkadotProtocol":643,"./protocols/substrate/polkadot/PolkadotProtocolOptions":644,"./protocols/tezos/TezosAddress":645,"./protocols/tezos/TezosCryptoClient":646,"./protocols/tezos/TezosProtocol":647,"./protocols/tezos/TezosProtocolOptions":648,"./protocols/tezos/TezosUtils":649,"./protocols/tezos/domains/TezosDomains":656,"./protocols/tezos/fa/TezosBTC":657,"./protocols/tezos/fa/TezosCTez":658,"./protocols/tezos/fa/TezosETHtz":659,"./protocols/tezos/fa/TezosFA1Protocol":660,"./protocols/tezos/fa/TezosFA1p2Protocol":661,"./protocols/tezos/fa/TezosFA2Protocol":662,"./protocols/tezos/fa/TezosFAProtocol":663,"./protocols/tezos/fa/TezosFAProtocolOptions":664,"./protocols/tezos/fa/TezosKolibriUSD":665,"./protocols/tezos/fa/TezosPlanty":666,"./protocols/tezos/fa/TezosQUIPU":667,"./protocols/tezos/fa/TezosStaker":668,"./protocols/tezos/fa/TezosUDEFI":669,"./protocols/tezos/fa/TezosUSD":670,"./protocols/tezos/fa/TezosUUSD":671,"./protocols/tezos/fa/TezosWRAP":672,"./protocols/tezos/fa/TezosWrapped":673,"./protocols/tezos/fa/TezosYOU":674,"./protocols/tezos/kt/TezosKtProtocol":676,"./protocols/tezos/sapling/TezosSaplingProtocol":682,"./protocols/tezos/sapling/TezosSaplingProtocolOptions":683,"./protocols/tezos/sapling/TezosShieldedTezProtocol":684,"./serializer-v3/serializer":731,"./serializer-v3/utils/generateId":739,"./serializer/interfaces":745,"./serializer/message":746,"./serializer/serializer":767,"./serializer/utils/generateId":775,"./utils/Network":781,"./utils/ProtocolBlockExplorer":782,"./utils/ProtocolNetwork":783,"./utils/ProtocolSymbols":784,"./utils/assert":786,"./utils/buffer":789,"./utils/coinlibReady":791,"./utils/protocolOptionsByIdentifier":796,"./utils/protocolsByIdentifier":797,"./utils/subProtocols":805,"./utils/supportedProtocols":806,"./wallet/
|
|
122446
|
+
},{"./actions/Action":214,"./actions/GetKtAccountsAction":215,"./actions/LinkedAction":216,"./actions/RepeatableAction":217,"./actions/SimpleAction":218,"./errors":489,"./errors/coinlib-error":488,"./protocols/CryptoClient":492,"./protocols/ICoinSubProtocol":494,"./protocols/aeternity/AeternityAddress":498,"./protocols/aeternity/AeternityCryptoClient":499,"./protocols/aeternity/AeternityProtocol":500,"./protocols/aeternity/AeternityProtocolOptions":501,"./protocols/bitcoin/BitcoinAddress":502,"./protocols/bitcoin/BitcoinCryptoClient":503,"./protocols/bitcoin/BitcoinProtocol":504,"./protocols/bitcoin/BitcoinProtocolOptions":505,"./protocols/bitcoin/BitcoinSegwitAddress":506,"./protocols/bitcoin/BitcoinSegwitProtocol":507,"./protocols/bitcoin/BitcoinTestnetProtocol":508,"./protocols/cosmos/CosmosAddress":509,"./protocols/cosmos/CosmosCryptoClient":511,"./protocols/cosmos/CosmosProtocol":514,"./protocols/cosmos/CosmosProtocolOptions":515,"./protocols/cosmos/CosmosTransaction":516,"./protocols/ethereum/EthereumAddress":522,"./protocols/ethereum/EthereumClassicProtocol":523,"./protocols/ethereum/EthereumCryptoClient":524,"./protocols/ethereum/EthereumProtocol":525,"./protocols/ethereum/EthereumProtocolOptions":526,"./protocols/ethereum/EthereumRopstenProtocol":527,"./protocols/ethereum/erc20/GenericERC20":532,"./protocols/groestlcoin/GroestlcoinProtocol":534,"./protocols/groestlcoin/GroestlcoinProtocolOptions":535,"./protocols/groestlcoin/GroestlcoinTestnetProtocol":536,"./protocols/substrate/SubstrateCryptoClient":537,"./protocols/substrate/SubstrateDelegateProtocol":538,"./protocols/substrate/SubstrateNetwork":539,"./protocols/substrate/SubstrateProtocol":540,"./protocols/substrate/SubstrateProtocolOptions":541,"./protocols/substrate/common/data/account/SubstrateAddress":546,"./protocols/substrate/common/data/staking/SubstrateEraElectionStatus":605,"./protocols/substrate/common/data/staking/SubstrateNominationStatus":608,"./protocols/substrate/common/data/staking/SubstratePayee":610,"./protocols/substrate/common/data/staking/SubstrateStakingActionType":612,"./protocols/substrate/common/data/transaction/SubstrateTransaction":616,"./protocols/substrate/common/node/SubstrateNodeClient":620,"./protocols/substrate/kusama/KusamaProtocol":625,"./protocols/substrate/kusama/KusamaProtocolOptions":626,"./protocols/substrate/moonbeam/MoonbeamProtocol":627,"./protocols/substrate/moonbeam/moonbase/MoonbaseProtocol":637,"./protocols/substrate/moonbeam/moonbase/MoonbaseProtocolOptions":638,"./protocols/substrate/moonbeam/moonriver/MoonriverProtocol":639,"./protocols/substrate/moonbeam/moonriver/MoonriverProtocolOptions":640,"./protocols/substrate/polkadot/PolkadotProtocol":643,"./protocols/substrate/polkadot/PolkadotProtocolOptions":644,"./protocols/tezos/TezosAddress":645,"./protocols/tezos/TezosCryptoClient":646,"./protocols/tezos/TezosProtocol":647,"./protocols/tezos/TezosProtocolOptions":648,"./protocols/tezos/TezosUtils":649,"./protocols/tezos/domains/TezosDomains":656,"./protocols/tezos/fa/TezosBTC":657,"./protocols/tezos/fa/TezosCTez":658,"./protocols/tezos/fa/TezosETHtz":659,"./protocols/tezos/fa/TezosFA1Protocol":660,"./protocols/tezos/fa/TezosFA1p2Protocol":661,"./protocols/tezos/fa/TezosFA2Protocol":662,"./protocols/tezos/fa/TezosFAProtocol":663,"./protocols/tezos/fa/TezosFAProtocolOptions":664,"./protocols/tezos/fa/TezosKolibriUSD":665,"./protocols/tezos/fa/TezosPlanty":666,"./protocols/tezos/fa/TezosQUIPU":667,"./protocols/tezos/fa/TezosStaker":668,"./protocols/tezos/fa/TezosUDEFI":669,"./protocols/tezos/fa/TezosUSD":670,"./protocols/tezos/fa/TezosUUSD":671,"./protocols/tezos/fa/TezosWRAP":672,"./protocols/tezos/fa/TezosWrapped":673,"./protocols/tezos/fa/TezosYOU":674,"./protocols/tezos/kt/TezosKtProtocol":676,"./protocols/tezos/sapling/TezosSaplingProtocol":682,"./protocols/tezos/sapling/TezosSaplingProtocolOptions":683,"./protocols/tezos/sapling/TezosShieldedTezProtocol":684,"./serializer-v3/serializer":731,"./serializer-v3/utils/generateId":739,"./serializer/interfaces":745,"./serializer/message":746,"./serializer/serializer":767,"./serializer/utils/generateId":775,"./utils/Network":781,"./utils/ProtocolBlockExplorer":782,"./utils/ProtocolNetwork":783,"./utils/ProtocolSymbols":784,"./utils/assert":786,"./utils/buffer":789,"./utils/coinlibReady":791,"./utils/protocolOptionsByIdentifier":796,"./utils/protocolsByIdentifier":797,"./utils/subProtocols":805,"./utils/supportedProtocols":806,"./wallet/AirGapCoinWallet":809,"./wallet/AirGapNFTWallet":811,"./wallet/AirGapWallet":812}],491:[function(require,module,exports){
|
|
122447
122447
|
"use strict";
|
|
122448
122448
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
122449
122449
|
exports.AirGapTransactionWarningType = exports.AirGapTransactionStatus = exports.AirGapTransactionType = void 0;
|
|
@@ -158511,14 +158511,175 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
158511
158511
|
}
|
|
158512
158512
|
};
|
|
158513
158513
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
158514
|
-
exports.
|
|
158514
|
+
exports.AirGapCoinWallet = exports.TimeInterval = void 0;
|
|
158515
|
+
var bignumber_1 = require("../dependencies/src/bignumber.js-9.0.0/bignumber");
|
|
158516
|
+
var TezosSaplingProtocol_1 = require("../protocols/tezos/sapling/TezosSaplingProtocol");
|
|
158517
|
+
var ProtocolNetwork_1 = require("../utils/ProtocolNetwork");
|
|
158518
|
+
var ProtocolSymbols_1 = require("../utils/ProtocolSymbols");
|
|
158519
|
+
var AirGapMarketWallet_1 = require("./AirGapMarketWallet");
|
|
158520
|
+
var TimeInterval;
|
|
158521
|
+
(function (TimeInterval) {
|
|
158522
|
+
TimeInterval["HOURS"] = "24h";
|
|
158523
|
+
TimeInterval["DAYS"] = "7d";
|
|
158524
|
+
TimeInterval["MONTH"] = "30d";
|
|
158525
|
+
})(TimeInterval = exports.TimeInterval || (exports.TimeInterval = {}));
|
|
158526
|
+
var AirGapCoinWallet = /** @class */ (function (_super) {
|
|
158527
|
+
__extends(AirGapCoinWallet, _super);
|
|
158528
|
+
function AirGapCoinWallet() {
|
|
158529
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
158530
|
+
}
|
|
158531
|
+
Object.defineProperty(AirGapCoinWallet.prototype, "currentMarketPrice", {
|
|
158532
|
+
get: function () {
|
|
158533
|
+
return this._currentMarketPrice;
|
|
158534
|
+
},
|
|
158535
|
+
set: function (marketPrice) {
|
|
158536
|
+
this._currentMarketPrice = this.protocol.options.network.type === ProtocolNetwork_1.NetworkType.MAINNET ? marketPrice : new bignumber_1.default(0);
|
|
158537
|
+
},
|
|
158538
|
+
enumerable: false,
|
|
158539
|
+
configurable: true
|
|
158540
|
+
});
|
|
158541
|
+
AirGapCoinWallet.prototype._synchronize = function () {
|
|
158542
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
158543
|
+
var _a, balance, marketPrice;
|
|
158544
|
+
return __generator(this, function (_b) {
|
|
158545
|
+
switch (_b.label) {
|
|
158546
|
+
case 0: return [4 /*yield*/, Promise.all([this.balanceOf(), this.fetchCurrentMarketPrice()])];
|
|
158547
|
+
case 1:
|
|
158548
|
+
_a = _b.sent(), balance = _a[0], marketPrice = _a[1];
|
|
158549
|
+
this.currentBalance = balance;
|
|
158550
|
+
this.currentMarketPrice = marketPrice;
|
|
158551
|
+
return [2 /*return*/];
|
|
158552
|
+
}
|
|
158553
|
+
});
|
|
158554
|
+
});
|
|
158555
|
+
};
|
|
158556
|
+
AirGapCoinWallet.prototype.fetchCurrentMarketPrice = function (baseSymbol) {
|
|
158557
|
+
if (baseSymbol === void 0) { baseSymbol = 'USD'; }
|
|
158558
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
158559
|
+
var _a;
|
|
158560
|
+
return __generator(this, function (_b) {
|
|
158561
|
+
switch (_b.label) {
|
|
158562
|
+
case 0:
|
|
158563
|
+
_a = this;
|
|
158564
|
+
return [4 /*yield*/, this.priceService.getCurrentMarketPrice(this.protocol, baseSymbol)];
|
|
158565
|
+
case 1:
|
|
158566
|
+
_a.currentMarketPrice = _b.sent();
|
|
158567
|
+
return [2 /*return*/, this.currentMarketPrice];
|
|
158568
|
+
}
|
|
158569
|
+
});
|
|
158570
|
+
});
|
|
158571
|
+
};
|
|
158572
|
+
AirGapCoinWallet.prototype.balanceOf = function () {
|
|
158573
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
158574
|
+
var _a, _b, _c, _d, _e;
|
|
158575
|
+
return __generator(this, function (_f) {
|
|
158576
|
+
switch (_f.label) {
|
|
158577
|
+
case 0:
|
|
158578
|
+
if (!((this.protocol.identifier === ProtocolSymbols_1.MainProtocolSymbols.BTC ||
|
|
158579
|
+
this.protocol.identifier === ProtocolSymbols_1.MainProtocolSymbols.BTC_SEGWIT ||
|
|
158580
|
+
this.protocol.identifier === ProtocolSymbols_1.MainProtocolSymbols.GRS) &&
|
|
158581
|
+
this.isExtendedPublicKey)) return [3 /*break*/, 2];
|
|
158582
|
+
_a = bignumber_1.default.bind;
|
|
158583
|
+
return [4 /*yield*/, this.protocol.getBalanceOfExtendedPublicKey(this.publicKey, 0)];
|
|
158584
|
+
case 1:
|
|
158585
|
+
// TODO: Remove and test
|
|
158586
|
+
/*
|
|
158587
|
+
We should remove this if BTC also uses blockbook. (And change the order of the if/else below)
|
|
158588
|
+
|
|
158589
|
+
The problem is that we have addresses cached for all protocols. But blockbook (grs) doesn't allow
|
|
158590
|
+
multiple addresses to be checked at once, so we need to xPub key there (or we would do 100s of requests).
|
|
158591
|
+
|
|
158592
|
+
We can also not simply change the order of the following if/else, because then it would use the xPub method for
|
|
158593
|
+
BTC as well, which results in the addresses being derived again, which causes massive lags in the apps.
|
|
158594
|
+
*/
|
|
158595
|
+
return [2 /*return*/, new (_a.apply(bignumber_1.default, [void 0, _f.sent()]))()];
|
|
158596
|
+
case 2:
|
|
158597
|
+
if (!(this.protocol instanceof TezosSaplingProtocol_1.TezosSaplingProtocol)) return [3 /*break*/, 4];
|
|
158598
|
+
_b = bignumber_1.default.bind;
|
|
158599
|
+
return [4 /*yield*/, this.protocol.getBalanceOfPublicKey(this.publicKey)];
|
|
158600
|
+
case 3: return [2 /*return*/, new (_b.apply(bignumber_1.default, [void 0, _f.sent()]))()];
|
|
158601
|
+
case 4:
|
|
158602
|
+
if (!(this.addresses.length > 0)) return [3 /*break*/, 6];
|
|
158603
|
+
_c = bignumber_1.default.bind;
|
|
158604
|
+
return [4 /*yield*/, this.protocol.getBalanceOfAddresses(this.addressesToCheck())];
|
|
158605
|
+
case 5: return [2 /*return*/, new (_c.apply(bignumber_1.default, [void 0, _f.sent()]))()];
|
|
158606
|
+
case 6:
|
|
158607
|
+
if (!this.isExtendedPublicKey) return [3 /*break*/, 8];
|
|
158608
|
+
_d = bignumber_1.default.bind;
|
|
158609
|
+
return [4 /*yield*/, this.protocol.getBalanceOfExtendedPublicKey(this.publicKey, 0)];
|
|
158610
|
+
case 7: return [2 /*return*/, new (_d.apply(bignumber_1.default, [void 0, _f.sent()]))()];
|
|
158611
|
+
case 8:
|
|
158612
|
+
_e = bignumber_1.default.bind;
|
|
158613
|
+
return [4 /*yield*/, this.protocol.getBalanceOfPublicKey(this.publicKey)];
|
|
158614
|
+
case 9: return [2 /*return*/, new (_e.apply(bignumber_1.default, [void 0, _f.sent()]))()];
|
|
158615
|
+
}
|
|
158616
|
+
});
|
|
158617
|
+
});
|
|
158618
|
+
};
|
|
158619
|
+
return AirGapCoinWallet;
|
|
158620
|
+
}(AirGapMarketWallet_1.AirGapMarketWallet));
|
|
158621
|
+
exports.AirGapCoinWallet = AirGapCoinWallet;
|
|
158622
|
+
|
|
158623
|
+
},{"../dependencies/src/bignumber.js-9.0.0/bignumber":268,"../protocols/tezos/sapling/TezosSaplingProtocol":682,"../utils/ProtocolNetwork":783,"../utils/ProtocolSymbols":784,"./AirGapMarketWallet":810}],810:[function(require,module,exports){
|
|
158624
|
+
"use strict";
|
|
158625
|
+
var __extends = (this && this.__extends) || (function () {
|
|
158626
|
+
var extendStatics = function (d, b) {
|
|
158627
|
+
extendStatics = Object.setPrototypeOf ||
|
|
158628
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
158629
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
158630
|
+
return extendStatics(d, b);
|
|
158631
|
+
};
|
|
158632
|
+
return function (d, b) {
|
|
158633
|
+
extendStatics(d, b);
|
|
158634
|
+
function __() { this.constructor = d; }
|
|
158635
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
158636
|
+
};
|
|
158637
|
+
})();
|
|
158638
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
158639
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
158640
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
158641
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
158642
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
158643
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
158644
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
158645
|
+
});
|
|
158646
|
+
};
|
|
158647
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
158648
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
158649
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
158650
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
158651
|
+
function step(op) {
|
|
158652
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
158653
|
+
while (_) try {
|
|
158654
|
+
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;
|
|
158655
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
158656
|
+
switch (op[0]) {
|
|
158657
|
+
case 0: case 1: t = op; break;
|
|
158658
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
158659
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
158660
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
158661
|
+
default:
|
|
158662
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
158663
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
158664
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
158665
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
158666
|
+
if (t[2]) _.ops.pop();
|
|
158667
|
+
_.trys.pop(); continue;
|
|
158668
|
+
}
|
|
158669
|
+
op = body.call(thisArg, _);
|
|
158670
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
158671
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
158672
|
+
}
|
|
158673
|
+
};
|
|
158674
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
158675
|
+
exports.AirGapMarketWallet = void 0;
|
|
158515
158676
|
var bignumber_1 = require("../dependencies/src/bignumber.js-9.0.0/bignumber");
|
|
158516
158677
|
var TezosSaplingProtocol_1 = require("../protocols/tezos/sapling/TezosSaplingProtocol");
|
|
158517
158678
|
var ProtocolSymbols_1 = require("../utils/ProtocolSymbols");
|
|
158518
158679
|
var AirGapWallet_1 = require("./AirGapWallet");
|
|
158519
|
-
var
|
|
158520
|
-
__extends(
|
|
158521
|
-
function
|
|
158680
|
+
var AirGapMarketWallet = /** @class */ (function (_super) {
|
|
158681
|
+
__extends(AirGapMarketWallet, _super);
|
|
158682
|
+
function AirGapMarketWallet(protocol, publicKey, isExtendedPublicKey, derivationPath, masterFingerprint, status, priceService, addressIndex) {
|
|
158522
158683
|
var _this = _super.call(this, protocol, publicKey, isExtendedPublicKey, derivationPath, masterFingerprint, status, addressIndex) || this;
|
|
158523
158684
|
_this.protocol = protocol;
|
|
158524
158685
|
_this.publicKey = publicKey;
|
|
@@ -158530,11 +158691,11 @@ var AirGapExtendedWallet = /** @class */ (function (_super) {
|
|
|
158530
158691
|
_this.addressIndex = addressIndex;
|
|
158531
158692
|
return _this;
|
|
158532
158693
|
}
|
|
158533
|
-
|
|
158694
|
+
AirGapMarketWallet.prototype.addressesToCheck = function () {
|
|
158534
158695
|
var addressesToReceive = this.addressIndex !== undefined ? [this.addresses[this.addressIndex]] : this.addresses;
|
|
158535
158696
|
return addressesToReceive;
|
|
158536
158697
|
};
|
|
158537
|
-
|
|
158698
|
+
AirGapMarketWallet.prototype.setProtocol = function (protocol) {
|
|
158538
158699
|
return __awaiter(this, void 0, void 0, function () {
|
|
158539
158700
|
return __generator(this, function (_a) {
|
|
158540
158701
|
switch (_a.label) {
|
|
@@ -158551,7 +158712,24 @@ var AirGapExtendedWallet = /** @class */ (function (_super) {
|
|
|
158551
158712
|
});
|
|
158552
158713
|
});
|
|
158553
158714
|
};
|
|
158554
|
-
|
|
158715
|
+
AirGapMarketWallet.prototype.synchronize = function () {
|
|
158716
|
+
var args = [];
|
|
158717
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
158718
|
+
args[_i] = arguments[_i];
|
|
158719
|
+
}
|
|
158720
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
158721
|
+
var _this = this;
|
|
158722
|
+
return __generator(this, function (_a) {
|
|
158723
|
+
if (this.synchronizePromise === undefined) {
|
|
158724
|
+
this.synchronizePromise = this._synchronize.apply(this, args).finally(function () {
|
|
158725
|
+
_this.synchronizePromise = undefined;
|
|
158726
|
+
});
|
|
158727
|
+
}
|
|
158728
|
+
return [2 /*return*/, this.synchronizePromise];
|
|
158729
|
+
});
|
|
158730
|
+
});
|
|
158731
|
+
};
|
|
158732
|
+
AirGapMarketWallet.prototype.fetchTransactions = function (limit, cursor) {
|
|
158555
158733
|
return __awaiter(this, void 0, void 0, function () {
|
|
158556
158734
|
var transactionResult;
|
|
158557
158735
|
return __generator(this, function (_a) {
|
|
@@ -158602,7 +158780,7 @@ var AirGapExtendedWallet = /** @class */ (function (_super) {
|
|
|
158602
158780
|
});
|
|
158603
158781
|
});
|
|
158604
158782
|
};
|
|
158605
|
-
|
|
158783
|
+
AirGapMarketWallet.prototype.prepareTransaction = function (recipients, values, fee, data) {
|
|
158606
158784
|
if (this.isExtendedPublicKey) {
|
|
158607
158785
|
return this.protocol.prepareTransactionFromExtendedPublicKey(this.publicKey, 0, recipients, values, fee, data);
|
|
158608
158786
|
}
|
|
@@ -158613,7 +158791,7 @@ var AirGapExtendedWallet = /** @class */ (function (_super) {
|
|
|
158613
158791
|
return this.protocol.prepareTransactionFromPublicKey(this.publicKey, recipients, values, fee, data);
|
|
158614
158792
|
}
|
|
158615
158793
|
};
|
|
158616
|
-
|
|
158794
|
+
AirGapMarketWallet.prototype.getMaxTransferValue = function (recipients, fee, excludeExistentialDeposit, data) {
|
|
158617
158795
|
return __awaiter(this, void 0, void 0, function () {
|
|
158618
158796
|
var _a, _b;
|
|
158619
158797
|
return __generator(this, function (_c) {
|
|
@@ -158631,7 +158809,7 @@ var AirGapExtendedWallet = /** @class */ (function (_super) {
|
|
|
158631
158809
|
});
|
|
158632
158810
|
});
|
|
158633
158811
|
};
|
|
158634
|
-
|
|
158812
|
+
AirGapMarketWallet.prototype.estimateFees = function (recipients, values, data) {
|
|
158635
158813
|
return __awaiter(this, void 0, void 0, function () {
|
|
158636
158814
|
return __generator(this, function (_a) {
|
|
158637
158815
|
if (this.isExtendedPublicKey) {
|
|
@@ -158647,180 +158825,11 @@ var AirGapExtendedWallet = /** @class */ (function (_super) {
|
|
|
158647
158825
|
});
|
|
158648
158826
|
});
|
|
158649
158827
|
};
|
|
158650
|
-
return AirGapExtendedWallet;
|
|
158651
|
-
}(AirGapWallet_1.AirGapWallet));
|
|
158652
|
-
exports.AirGapExtendedWallet = AirGapExtendedWallet;
|
|
158653
|
-
|
|
158654
|
-
},{"../dependencies/src/bignumber.js-9.0.0/bignumber":268,"../protocols/tezos/sapling/TezosSaplingProtocol":682,"../utils/ProtocolSymbols":784,"./AirGapWallet":812}],810:[function(require,module,exports){
|
|
158655
|
-
"use strict";
|
|
158656
|
-
var __extends = (this && this.__extends) || (function () {
|
|
158657
|
-
var extendStatics = function (d, b) {
|
|
158658
|
-
extendStatics = Object.setPrototypeOf ||
|
|
158659
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
158660
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
158661
|
-
return extendStatics(d, b);
|
|
158662
|
-
};
|
|
158663
|
-
return function (d, b) {
|
|
158664
|
-
extendStatics(d, b);
|
|
158665
|
-
function __() { this.constructor = d; }
|
|
158666
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
158667
|
-
};
|
|
158668
|
-
})();
|
|
158669
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
158670
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
158671
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
158672
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
158673
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
158674
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
158675
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
158676
|
-
});
|
|
158677
|
-
};
|
|
158678
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
158679
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
158680
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
158681
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
158682
|
-
function step(op) {
|
|
158683
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
158684
|
-
while (_) try {
|
|
158685
|
-
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;
|
|
158686
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
158687
|
-
switch (op[0]) {
|
|
158688
|
-
case 0: case 1: t = op; break;
|
|
158689
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
158690
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
158691
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
158692
|
-
default:
|
|
158693
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
158694
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
158695
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
158696
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
158697
|
-
if (t[2]) _.ops.pop();
|
|
158698
|
-
_.trys.pop(); continue;
|
|
158699
|
-
}
|
|
158700
|
-
op = body.call(thisArg, _);
|
|
158701
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
158702
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
158703
|
-
}
|
|
158704
|
-
};
|
|
158705
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
158706
|
-
exports.AirGapMarketWallet = exports.TimeInterval = void 0;
|
|
158707
|
-
var bignumber_1 = require("../dependencies/src/bignumber.js-9.0.0/bignumber");
|
|
158708
|
-
var TezosSaplingProtocol_1 = require("../protocols/tezos/sapling/TezosSaplingProtocol");
|
|
158709
|
-
var ProtocolNetwork_1 = require("../utils/ProtocolNetwork");
|
|
158710
|
-
var ProtocolSymbols_1 = require("../utils/ProtocolSymbols");
|
|
158711
|
-
var AirGapExtendedWallet_1 = require("./AirGapExtendedWallet");
|
|
158712
|
-
var TimeInterval;
|
|
158713
|
-
(function (TimeInterval) {
|
|
158714
|
-
TimeInterval["HOURS"] = "24h";
|
|
158715
|
-
TimeInterval["DAYS"] = "7d";
|
|
158716
|
-
TimeInterval["MONTH"] = "30d";
|
|
158717
|
-
})(TimeInterval = exports.TimeInterval || (exports.TimeInterval = {}));
|
|
158718
|
-
var AirGapMarketWallet = /** @class */ (function (_super) {
|
|
158719
|
-
__extends(AirGapMarketWallet, _super);
|
|
158720
|
-
function AirGapMarketWallet() {
|
|
158721
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
158722
|
-
}
|
|
158723
|
-
Object.defineProperty(AirGapMarketWallet.prototype, "currentMarketPrice", {
|
|
158724
|
-
get: function () {
|
|
158725
|
-
return this._currentMarketPrice;
|
|
158726
|
-
},
|
|
158727
|
-
set: function (marketPrice) {
|
|
158728
|
-
this._currentMarketPrice = this.protocol.options.network.type === ProtocolNetwork_1.NetworkType.MAINNET ? marketPrice : new bignumber_1.default(0);
|
|
158729
|
-
},
|
|
158730
|
-
enumerable: false,
|
|
158731
|
-
configurable: true
|
|
158732
|
-
});
|
|
158733
|
-
AirGapMarketWallet.prototype.synchronize = function () {
|
|
158734
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
158735
|
-
var _this = this;
|
|
158736
|
-
return __generator(this, function (_a) {
|
|
158737
|
-
if (this.synchronizePromise === undefined) {
|
|
158738
|
-
this.synchronizePromise = new Promise(function (resolve, reject) {
|
|
158739
|
-
Promise.all([_this.balanceOf(), _this.fetchCurrentMarketPrice()])
|
|
158740
|
-
.then(function (results) {
|
|
158741
|
-
_this.currentBalance = results[0];
|
|
158742
|
-
_this.currentMarketPrice = results[1];
|
|
158743
|
-
_this.synchronizePromise = undefined;
|
|
158744
|
-
resolve();
|
|
158745
|
-
})
|
|
158746
|
-
.catch(function (error) {
|
|
158747
|
-
_this.synchronizePromise = undefined;
|
|
158748
|
-
reject(error);
|
|
158749
|
-
});
|
|
158750
|
-
});
|
|
158751
|
-
}
|
|
158752
|
-
return [2 /*return*/, this.synchronizePromise];
|
|
158753
|
-
});
|
|
158754
|
-
});
|
|
158755
|
-
};
|
|
158756
|
-
AirGapMarketWallet.prototype.fetchCurrentMarketPrice = function (baseSymbol) {
|
|
158757
|
-
if (baseSymbol === void 0) { baseSymbol = 'USD'; }
|
|
158758
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
158759
|
-
var _a;
|
|
158760
|
-
return __generator(this, function (_b) {
|
|
158761
|
-
switch (_b.label) {
|
|
158762
|
-
case 0:
|
|
158763
|
-
_a = this;
|
|
158764
|
-
return [4 /*yield*/, this.priceService.getCurrentMarketPrice(this.protocol, baseSymbol)];
|
|
158765
|
-
case 1:
|
|
158766
|
-
_a.currentMarketPrice = _b.sent();
|
|
158767
|
-
return [2 /*return*/, this.currentMarketPrice];
|
|
158768
|
-
}
|
|
158769
|
-
});
|
|
158770
|
-
});
|
|
158771
|
-
};
|
|
158772
|
-
AirGapMarketWallet.prototype.balanceOf = function () {
|
|
158773
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
158774
|
-
var _a, _b, _c, _d, _e;
|
|
158775
|
-
return __generator(this, function (_f) {
|
|
158776
|
-
switch (_f.label) {
|
|
158777
|
-
case 0:
|
|
158778
|
-
if (!((this.protocol.identifier === ProtocolSymbols_1.MainProtocolSymbols.BTC ||
|
|
158779
|
-
this.protocol.identifier === ProtocolSymbols_1.MainProtocolSymbols.BTC_SEGWIT ||
|
|
158780
|
-
this.protocol.identifier === ProtocolSymbols_1.MainProtocolSymbols.GRS) &&
|
|
158781
|
-
this.isExtendedPublicKey)) return [3 /*break*/, 2];
|
|
158782
|
-
_a = bignumber_1.default.bind;
|
|
158783
|
-
return [4 /*yield*/, this.protocol.getBalanceOfExtendedPublicKey(this.publicKey, 0)];
|
|
158784
|
-
case 1:
|
|
158785
|
-
// TODO: Remove and test
|
|
158786
|
-
/*
|
|
158787
|
-
We should remove this if BTC also uses blockbook. (And change the order of the if/else below)
|
|
158788
|
-
|
|
158789
|
-
The problem is that we have addresses cached for all protocols. But blockbook (grs) doesn't allow
|
|
158790
|
-
multiple addresses to be checked at once, so we need to xPub key there (or we would do 100s of requests).
|
|
158791
|
-
|
|
158792
|
-
We can also not simply change the order of the following if/else, because then it would use the xPub method for
|
|
158793
|
-
BTC as well, which results in the addresses being derived again, which causes massive lags in the apps.
|
|
158794
|
-
*/
|
|
158795
|
-
return [2 /*return*/, new (_a.apply(bignumber_1.default, [void 0, _f.sent()]))()];
|
|
158796
|
-
case 2:
|
|
158797
|
-
if (!(this.protocol instanceof TezosSaplingProtocol_1.TezosSaplingProtocol)) return [3 /*break*/, 4];
|
|
158798
|
-
_b = bignumber_1.default.bind;
|
|
158799
|
-
return [4 /*yield*/, this.protocol.getBalanceOfPublicKey(this.publicKey)];
|
|
158800
|
-
case 3: return [2 /*return*/, new (_b.apply(bignumber_1.default, [void 0, _f.sent()]))()];
|
|
158801
|
-
case 4:
|
|
158802
|
-
if (!(this.addresses.length > 0)) return [3 /*break*/, 6];
|
|
158803
|
-
_c = bignumber_1.default.bind;
|
|
158804
|
-
return [4 /*yield*/, this.protocol.getBalanceOfAddresses(this.addressesToCheck())];
|
|
158805
|
-
case 5: return [2 /*return*/, new (_c.apply(bignumber_1.default, [void 0, _f.sent()]))()];
|
|
158806
|
-
case 6:
|
|
158807
|
-
if (!this.isExtendedPublicKey) return [3 /*break*/, 8];
|
|
158808
|
-
_d = bignumber_1.default.bind;
|
|
158809
|
-
return [4 /*yield*/, this.protocol.getBalanceOfExtendedPublicKey(this.publicKey, 0)];
|
|
158810
|
-
case 7: return [2 /*return*/, new (_d.apply(bignumber_1.default, [void 0, _f.sent()]))()];
|
|
158811
|
-
case 8:
|
|
158812
|
-
_e = bignumber_1.default.bind;
|
|
158813
|
-
return [4 /*yield*/, this.protocol.getBalanceOfPublicKey(this.publicKey)];
|
|
158814
|
-
case 9: return [2 /*return*/, new (_e.apply(bignumber_1.default, [void 0, _f.sent()]))()];
|
|
158815
|
-
}
|
|
158816
|
-
});
|
|
158817
|
-
});
|
|
158818
|
-
};
|
|
158819
158828
|
return AirGapMarketWallet;
|
|
158820
|
-
}(
|
|
158829
|
+
}(AirGapWallet_1.AirGapWallet));
|
|
158821
158830
|
exports.AirGapMarketWallet = AirGapMarketWallet;
|
|
158822
158831
|
|
|
158823
|
-
},{"../dependencies/src/bignumber.js-9.0.0/bignumber":268,"../protocols/tezos/sapling/TezosSaplingProtocol":682,"../utils/
|
|
158832
|
+
},{"../dependencies/src/bignumber.js-9.0.0/bignumber":268,"../protocols/tezos/sapling/TezosSaplingProtocol":682,"../utils/ProtocolSymbols":784,"./AirGapWallet":812}],811:[function(require,module,exports){
|
|
158824
158833
|
"use strict";
|
|
158825
158834
|
var __extends = (this && this.__extends) || (function () {
|
|
158826
158835
|
var extendStatics = function (d, b) {
|
|
@@ -158875,7 +158884,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
158875
158884
|
exports.AirGapNFTWallet = void 0;
|
|
158876
158885
|
var bignumber_1 = require("../dependencies/src/bignumber.js-9.0.0/bignumber");
|
|
158877
158886
|
var ProtocolNetwork_1 = require("../utils/ProtocolNetwork");
|
|
158878
|
-
var
|
|
158887
|
+
var AirGapMarketWallet_1 = require("./AirGapMarketWallet");
|
|
158879
158888
|
var AirGapNFTWallet = /** @class */ (function (_super) {
|
|
158880
158889
|
__extends(AirGapNFTWallet, _super);
|
|
158881
158890
|
function AirGapNFTWallet() {
|
|
@@ -158890,13 +158899,19 @@ var AirGapNFTWallet = /** @class */ (function (_super) {
|
|
|
158890
158899
|
AirGapNFTWallet.prototype.setCurrentMarketPrice = function (assetID, marketPrice) {
|
|
158891
158900
|
this.currentMarketPrice[assetID] = this.protocol.options.network.type === ProtocolNetwork_1.NetworkType.MAINNET ? marketPrice : new bignumber_1.default(0);
|
|
158892
158901
|
};
|
|
158893
|
-
AirGapNFTWallet.prototype.synchronize = function (
|
|
158902
|
+
AirGapNFTWallet.prototype.synchronize = function (assetsID) {
|
|
158903
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
158904
|
+
return __generator(this, function (_a) {
|
|
158905
|
+
return [2 /*return*/, _super.prototype.synchronize.call(this, assetsID)];
|
|
158906
|
+
});
|
|
158907
|
+
});
|
|
158908
|
+
};
|
|
158909
|
+
AirGapNFTWallet.prototype._synchronize = function (assetIDs) {
|
|
158894
158910
|
return __awaiter(this, void 0, void 0, function () {
|
|
158895
158911
|
var _this = this;
|
|
158896
158912
|
return __generator(this, function (_a) {
|
|
158897
|
-
|
|
158898
|
-
|
|
158899
|
-
Promise.all(assetIDs.map(function (assetID) { return __awaiter(_this, void 0, void 0, function () {
|
|
158913
|
+
switch (_a.label) {
|
|
158914
|
+
case 0: return [4 /*yield*/, Promise.all(assetIDs.map(function (assetID) { return __awaiter(_this, void 0, void 0, function () {
|
|
158900
158915
|
var _a, balance, marketPrice;
|
|
158901
158916
|
return __generator(this, function (_b) {
|
|
158902
158917
|
switch (_b.label) {
|
|
@@ -158908,17 +158923,11 @@ var AirGapNFTWallet = /** @class */ (function (_super) {
|
|
|
158908
158923
|
return [2 /*return*/];
|
|
158909
158924
|
}
|
|
158910
158925
|
});
|
|
158911
|
-
}); }))
|
|
158912
|
-
|
|
158913
|
-
|
|
158914
|
-
|
|
158915
|
-
.catch(function (error) {
|
|
158916
|
-
_this.synchronizePromise = undefined;
|
|
158917
|
-
reject(error);
|
|
158918
|
-
});
|
|
158919
|
-
});
|
|
158926
|
+
}); }))];
|
|
158927
|
+
case 1:
|
|
158928
|
+
_a.sent();
|
|
158929
|
+
return [2 /*return*/];
|
|
158920
158930
|
}
|
|
158921
|
-
return [2 /*return*/, this.synchronizePromise];
|
|
158922
158931
|
});
|
|
158923
158932
|
});
|
|
158924
158933
|
};
|
|
@@ -158950,10 +158959,10 @@ var AirGapNFTWallet = /** @class */ (function (_super) {
|
|
|
158950
158959
|
});
|
|
158951
158960
|
};
|
|
158952
158961
|
return AirGapNFTWallet;
|
|
158953
|
-
}(
|
|
158962
|
+
}(AirGapMarketWallet_1.AirGapMarketWallet));
|
|
158954
158963
|
exports.AirGapNFTWallet = AirGapNFTWallet;
|
|
158955
158964
|
|
|
158956
|
-
},{"../dependencies/src/bignumber.js-9.0.0/bignumber":268,"../utils/ProtocolNetwork":783,"./
|
|
158965
|
+
},{"../dependencies/src/bignumber.js-9.0.0/bignumber":268,"../utils/ProtocolNetwork":783,"./AirGapMarketWallet":810}],812:[function(require,module,exports){
|
|
158957
158966
|
"use strict";
|
|
158958
158967
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
158959
158968
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
package/index.d.ts
CHANGED
|
@@ -55,8 +55,9 @@ import { getProtocolByIdentifier } from './utils/protocolsByIdentifier';
|
|
|
55
55
|
import { addSubProtocol, getSubProtocolsByIdentifier } from './utils/subProtocols';
|
|
56
56
|
import { getProtocolOptionsByIdentifier } from './utils/protocolOptionsByIdentifier';
|
|
57
57
|
import { addSupportedProtocol, supportedProtocols } from './utils/supportedProtocols';
|
|
58
|
-
import {
|
|
58
|
+
import { AirGapCoinWallet, TimeInterval } from './wallet/AirGapCoinWallet';
|
|
59
59
|
import { AirGapNFTWallet } from './wallet/AirGapNFTWallet';
|
|
60
|
+
import { AirGapWalletPriceService } from './wallet/AirGapMarketWallet';
|
|
60
61
|
import { AirGapWallet, AirGapWalletStatus, SerializedAirGapWallet } from './wallet/AirGapWallet';
|
|
61
62
|
import { AeternityProtocolOptions, AeternalBlockExplorer, AeternityProtocolNetwork } from './protocols/aeternity/AeternityProtocolOptions';
|
|
62
63
|
import { AeternityCryptoClient } from './protocols/aeternity/AeternityCryptoClient';
|
|
@@ -136,7 +137,7 @@ import { TezosCTez, TezosCTezProtocolConfig } from './protocols/tezos/fa/TezosCT
|
|
|
136
137
|
import { TezosPlenty, TezosPlentyProtocolConfig } from './protocols/tezos/fa/TezosPlanty';
|
|
137
138
|
import { TezosWRAP, TezosWRAPProtocolConfig } from './protocols/tezos/fa/TezosWRAP';
|
|
138
139
|
import { TezosQUIPU, TezosQUIPUProtocolConfig } from './protocols/tezos/fa/TezosQUIPU';
|
|
139
|
-
export { AirGapWallet, AirGapMarketWallet, AirGapWalletStatus, AirGapNFTWallet, IAirGapWallet, IAirGapTransaction, ICoinProtocol, ICoinSubProtocol, ICoinDelegateProtocol, CryptoClient, ProtocolBlockExplorer, ProtocolNetwork, ProtocolSymbols, MainProtocolSymbols, SubProtocolSymbols, NetworkType, FeeDefaults };
|
|
140
|
+
export { AirGapWallet, AirGapCoinWallet as AirGapMarketWallet, AirGapWalletStatus, AirGapNFTWallet, IAirGapWallet, IAirGapTransaction, ICoinProtocol, ICoinSubProtocol, ICoinDelegateProtocol, CryptoClient, ProtocolBlockExplorer, ProtocolNetwork, ProtocolSymbols, MainProtocolSymbols, SubProtocolSymbols, NetworkType, FeeDefaults };
|
|
140
141
|
export { AeternityProtocol, AeternityCryptoClient, AeternityProtocolOptions, AeternalBlockExplorer, AeternityProtocolNetwork, AeternityAddress, RawAeternityTransaction };
|
|
141
142
|
export { BitcoinProtocol, BitcoinTestnetProtocol, BitcoinCryptoClient, BitcoinProtocolNetworkExtras, BlockcypherBlockExplorer, BitcoinProtocolNetwork, BitcoinProtocolConfig, BitcoinProtocolOptions, BitcoinAddress, RawBitcoinTransaction };
|
|
142
143
|
export { BitcoinSegwitProtocol, BitcoinSegwitAddress, RawBitcoinSegwitTransaction };
|
package/index.js
CHANGED
|
@@ -89,9 +89,9 @@ Object.defineProperty(exports, "getProtocolOptionsByIdentifier", { enumerable: t
|
|
|
89
89
|
var supportedProtocols_1 = require("./utils/supportedProtocols");
|
|
90
90
|
Object.defineProperty(exports, "addSupportedProtocol", { enumerable: true, get: function () { return supportedProtocols_1.addSupportedProtocol; } });
|
|
91
91
|
Object.defineProperty(exports, "supportedProtocols", { enumerable: true, get: function () { return supportedProtocols_1.supportedProtocols; } });
|
|
92
|
-
var
|
|
93
|
-
Object.defineProperty(exports, "AirGapMarketWallet", { enumerable: true, get: function () { return
|
|
94
|
-
Object.defineProperty(exports, "TimeInterval", { enumerable: true, get: function () { return
|
|
92
|
+
var AirGapCoinWallet_1 = require("./wallet/AirGapCoinWallet");
|
|
93
|
+
Object.defineProperty(exports, "AirGapMarketWallet", { enumerable: true, get: function () { return AirGapCoinWallet_1.AirGapCoinWallet; } });
|
|
94
|
+
Object.defineProperty(exports, "TimeInterval", { enumerable: true, get: function () { return AirGapCoinWallet_1.TimeInterval; } });
|
|
95
95
|
var AirGapNFTWallet_1 = require("./wallet/AirGapNFTWallet");
|
|
96
96
|
Object.defineProperty(exports, "AirGapNFTWallet", { enumerable: true, get: function () { return AirGapNFTWallet_1.AirGapNFTWallet; } });
|
|
97
97
|
var AirGapWallet_1 = require("./wallet/AirGapWallet");
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,iCAAiC;AACjC,yEAAyE;AACzE,0EAAwE;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,iCAAiC;AACjC,yEAAyE;AACzE,0EAAwE;AA4TtE,iGA5TO,mCAAgB,OA4TP;AA1TlB,mCAAmI;AAofjI,qGApfO,6BAAoB,OAofP;AAGpB,wGAvf6B,gCAAuB,OAuf7B;AAJvB,0GAnfsD,kCAAyB,OAmftD;AADzB,iGAlfiF,yBAAgB,OAkfjF;AAGhB,6FArfmG,qBAAY,OAqfnG;AApfd,wDAA+C;AAqf7C,uFArfO,sBAAM,OAqfP;AAlfR,6EAA2E;AA2QzE,kGA3QO,qCAAiB,OA2QP;AA1QnB,uEAAqE;AAqRnE,gGArRO,iCAAe,OAqRP;AApRjB,qFAAmF;AAqRjF,uGArRO,+CAAsB,OAqRP;AApRxB,oEAA8F;AA4S5F,2GA5SO,2CAA0B,OA4SP;AAR1B,+FApSmC,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