@airgap/module-kit 0.13.8-beta.3 → 0.13.8-beta.5

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.
@@ -29716,7 +29716,7 @@ exports.newPlainUIText = newPlainUIText;
29716
29716
  },{}],196:[function(require,module,exports){
29717
29717
  "use strict";
29718
29718
  Object.defineProperty(exports, "__esModule", { value: true });
29719
- exports.normalizeToUndefined = exports.protocolNetworkIdentifier = exports.isTransactionStatusChecker = exports.hasConfigurableTransactionInjector = exports.canSignMessage = exports.canEncryptAsymmetric = exports.canEncryptAES = exports.hasConfigurableContract = exports.hasMultiAddressPublicKeys = exports.canFetchDataForMultipleAddresses = exports.isMultiTokenSubProtocol = exports.isSingleTokenSubProtocol = exports.isSubProtocol = exports.isBip32Protocol = exports.isExtendedPublicKey = exports.isPublicKey = exports.isExtendedSecretKey = exports.isSecretKey = exports.isAnyKey = exports.implementsInterface = exports.isAmount = exports.ModuleNetworkRegistry = exports.newSignedTransaction = exports.newUnsignedTransaction = exports.newSignature = exports.newExtendedPublicKey = exports.newPublicKey = exports.newExtendedSecretKey = exports.newSecretKey = exports.newAmount = exports.newPlainUIText = exports.newErrorUIAlert = exports.newWarningUIAlert = exports.newInfoUIAlert = exports.newSuccessUIAlert = void 0;
29719
+ exports.normalizeToUndefined = exports.protocolNetworkIdentifier = exports.isTransactionStatusChecker = exports.hasConfigurableTransactionInjector = exports.canSignMessage = exports.canEncryptAsymmetric = exports.canEncryptAES = exports.hasConfigurableContract = exports.hasMultiAddressPublicKeys = exports.canFetchDataForMultipleAddresses = exports.isMultiTokenSubProtocol = exports.isSingleTokenSubProtocol = exports.isSubProtocol = exports.isBip32Protocol = exports.isOnlineProtocol = exports.isOfflineProtocol = exports.createSupportedProtocols = exports.isExtendedPublicKey = exports.isPublicKey = exports.isExtendedSecretKey = exports.isSecretKey = exports.isAnyKey = exports.implementsInterface = exports.isAmount = exports.ModuleNetworkRegistry = exports.newSignedTransaction = exports.newUnsignedTransaction = exports.newSignature = exports.newExtendedPublicKey = exports.newPublicKey = exports.newExtendedSecretKey = exports.newSecretKey = exports.newAmount = exports.newPlainUIText = exports.newErrorUIAlert = exports.newWarningUIAlert = exports.newInfoUIAlert = exports.newSuccessUIAlert = void 0;
29720
29720
  var amount_1 = require("./factories/amount");
29721
29721
  Object.defineProperty(exports, "newAmount", { enumerable: true, get: function () { return amount_1.newAmount; } });
29722
29722
  var key_1 = require("./factories/key");
@@ -29748,6 +29748,8 @@ Object.defineProperty(exports, "isExtendedPublicKey", { enumerable: true, get: f
29748
29748
  Object.defineProperty(exports, "isExtendedSecretKey", { enumerable: true, get: function () { return key_2.isExtendedSecretKey; } });
29749
29749
  Object.defineProperty(exports, "isPublicKey", { enumerable: true, get: function () { return key_2.isPublicKey; } });
29750
29750
  Object.defineProperty(exports, "isSecretKey", { enumerable: true, get: function () { return key_2.isSecretKey; } });
29751
+ var module_1 = require("./utils/module");
29752
+ Object.defineProperty(exports, "createSupportedProtocols", { enumerable: true, get: function () { return module_1.createSupportedProtocols; } });
29751
29753
  var normalize_1 = require("./utils/normalize");
29752
29754
  Object.defineProperty(exports, "normalizeToUndefined", { enumerable: true, get: function () { return normalize_1.normalizeToUndefined; } });
29753
29755
  var protocol_1 = require("./utils/protocol");
@@ -29760,12 +29762,14 @@ Object.defineProperty(exports, "hasConfigurableTransactionInjector", { enumerabl
29760
29762
  Object.defineProperty(exports, "hasMultiAddressPublicKeys", { enumerable: true, get: function () { return protocol_1.hasMultiAddressPublicKeys; } });
29761
29763
  Object.defineProperty(exports, "isBip32Protocol", { enumerable: true, get: function () { return protocol_1.isBip32Protocol; } });
29762
29764
  Object.defineProperty(exports, "isMultiTokenSubProtocol", { enumerable: true, get: function () { return protocol_1.isMultiTokenSubProtocol; } });
29765
+ Object.defineProperty(exports, "isOfflineProtocol", { enumerable: true, get: function () { return protocol_1.isOfflineProtocol; } });
29766
+ Object.defineProperty(exports, "isOnlineProtocol", { enumerable: true, get: function () { return protocol_1.isOnlineProtocol; } });
29763
29767
  Object.defineProperty(exports, "isSingleTokenSubProtocol", { enumerable: true, get: function () { return protocol_1.isSingleTokenSubProtocol; } });
29764
29768
  Object.defineProperty(exports, "isSubProtocol", { enumerable: true, get: function () { return protocol_1.isSubProtocol; } });
29765
29769
  Object.defineProperty(exports, "isTransactionStatusChecker", { enumerable: true, get: function () { return protocol_1.isTransactionStatusChecker; } });
29766
29770
  Object.defineProperty(exports, "protocolNetworkIdentifier", { enumerable: true, get: function () { return protocol_1.protocolNetworkIdentifier; } });
29767
29771
 
29768
- },{"./factories/amount":190,"./factories/key":191,"./factories/signature":192,"./factories/transaction":193,"./factories/ui/alert":194,"./factories/ui/text":195,"./module/module-network-registry":197,"./utils/amount":199,"./utils/interface":200,"./utils/key":201,"./utils/normalize":202,"./utils/protocol":203}],197:[function(require,module,exports){
29772
+ },{"./factories/amount":190,"./factories/key":191,"./factories/signature":192,"./factories/transaction":193,"./factories/ui/alert":194,"./factories/ui/text":195,"./module/module-network-registry":197,"./utils/amount":199,"./utils/interface":200,"./utils/key":201,"./utils/module":202,"./utils/normalize":203,"./utils/protocol":204}],197:[function(require,module,exports){
29769
29773
  "use strict";
29770
29774
  Object.defineProperty(exports, "__esModule", { value: true });
29771
29775
  exports.ModuleNetworkRegistry = void 0;
@@ -29788,7 +29792,7 @@ var ModuleNetworkRegistry = /** @class */ (function () {
29788
29792
  }());
29789
29793
  exports.ModuleNetworkRegistry = ModuleNetworkRegistry;
29790
29794
 
29791
- },{"../utils/protocol":203}],198:[function(require,module,exports){
29795
+ },{"../utils/protocol":204}],198:[function(require,module,exports){
29792
29796
  "use strict";
29793
29797
  var __importDefault = (this && this.__importDefault) || function (mod) {
29794
29798
  return (mod && mod.__esModule) ? mod : { "default": mod };
@@ -29853,7 +29857,7 @@ function implementsInterface(object, schema) {
29853
29857
  if (typeof object !== 'object' || !object) {
29854
29858
  return false;
29855
29859
  }
29856
- return Object.keys(schema).every(function (key) { return schema[key] === 'optional' || object[key] !== undefined; });
29860
+ return Object.keys(schema).every(function (key) { return schema[key] === 'optional' || key in object; });
29857
29861
  }
29858
29862
  exports.implementsInterface = implementsInterface;
29859
29863
 
@@ -29887,13 +29891,43 @@ exports.isExtendedPublicKey = isExtendedPublicKey;
29887
29891
  },{"./interface":200}],202:[function(require,module,exports){
29888
29892
  "use strict";
29889
29893
  Object.defineProperty(exports, "__esModule", { value: true });
29894
+ exports.createSupportedProtocols = void 0;
29895
+ function createSupportedProtocols(online, offline) {
29896
+ var onlineIdentifiers = new Set(Object.keys(online));
29897
+ var offlineIdentifiers = offline ? new Set(offline) : onlineIdentifiers;
29898
+ var identifiers = new Set(Array.from(onlineIdentifiers).concat(Array.from(onlineIdentifiers)));
29899
+ return Array.from(identifiers).reduce(function (obj, next) {
29900
+ var _a;
29901
+ var offlineConfiguration = offlineIdentifiers.has(next) ? { type: 'offline' } : undefined;
29902
+ var onlineConfiguration = online[next]
29903
+ ? createOnlineProtocolConfiguration(online[next])
29904
+ : undefined;
29905
+ var configuration = offlineConfiguration !== undefined && onlineConfiguration !== undefined
29906
+ ? { type: 'full', offline: offlineConfiguration, online: onlineConfiguration }
29907
+ : (offlineConfiguration !== null && offlineConfiguration !== void 0 ? offlineConfiguration : onlineConfiguration);
29908
+ return Object.assign(obj, (_a = {}, _a[next] = configuration, _a));
29909
+ // tslint:disable-next-line: no-object-literal-type-assertion
29910
+ }, {});
29911
+ }
29912
+ exports.createSupportedProtocols = createSupportedProtocols;
29913
+ function createOnlineProtocolConfiguration(networks) {
29914
+ var _a;
29915
+ return {
29916
+ type: 'online',
29917
+ networks: (_a = networks.supportedNetworks) !== null && _a !== void 0 ? _a : networks
29918
+ };
29919
+ }
29920
+
29921
+ },{}],203:[function(require,module,exports){
29922
+ "use strict";
29923
+ Object.defineProperty(exports, "__esModule", { value: true });
29890
29924
  exports.normalizeToUndefined = void 0;
29891
29925
  function normalizeToUndefined(value) {
29892
29926
  return value !== null ? value : undefined;
29893
29927
  }
29894
29928
  exports.normalizeToUndefined = normalizeToUndefined;
29895
29929
 
29896
- },{}],203:[function(require,module,exports){
29930
+ },{}],204:[function(require,module,exports){
29897
29931
  "use strict";
29898
29932
  var __assign = (this && this.__assign) || function () {
29899
29933
  __assign = Object.assign || function(t) {
@@ -29907,7 +29941,8 @@ var __assign = (this && this.__assign) || function () {
29907
29941
  return __assign.apply(this, arguments);
29908
29942
  };
29909
29943
  Object.defineProperty(exports, "__esModule", { value: true });
29910
- exports.protocolNetworkIdentifier = exports.isTransactionStatusChecker = exports.hasConfigurableTransactionInjector = exports.canSignMessage = exports.canEncryptAsymmetric = exports.canEncryptAES = exports.hasConfigurableContract = exports.hasMultiAddressPublicKeys = exports.canFetchDataForMultipleAddresses = exports.canFetchDataForAddress = exports.isMultiTokenSubProtocol = exports.isSingleTokenSubProtocol = exports.isSubProtocol = exports.isBip32Protocol = void 0;
29944
+ exports.protocolNetworkIdentifier = exports.isTransactionStatusChecker = exports.hasConfigurableTransactionInjector = exports.canSignMessage = exports.canEncryptAsymmetric = exports.canEncryptAES = exports.hasConfigurableContract = exports.hasMultiAddressPublicKeys = exports.canFetchDataForMultipleAddresses = exports.canFetchDataForAddress = exports.isMultiTokenSubProtocol = exports.isSingleTokenSubProtocol = exports.isSubProtocol = exports.isBip32Protocol = exports.isOnlineProtocol = exports.isOfflineProtocol = void 0;
29945
+ // @ts-ignore
29911
29946
  var createHash = require("@airgap/coinlib-core/dependencies/src/create-hash-1.2.0/index");
29912
29947
  var interface_1 = require("./interface");
29913
29948
  // Schemas
@@ -29919,10 +29954,11 @@ var baseProtocolSchema = {
29919
29954
  var offlineProtocolSchema = __assign(__assign({}, baseProtocolSchema), { getKeyPairFromSecret: 'required', signTransactionWithSecretKey: 'required' });
29920
29955
  var onlineProtocolSchema = __assign(__assign({}, baseProtocolSchema), { broadcastTransaction: 'required', getBalanceOfPublicKey: 'required', getNetwork: 'required', getTransactionFeeWithPublicKey: 'required', getTransactionMaxAmountWithPublicKey: 'required', getTransactionsForPublicKey: 'required', prepareTransactionWithPublicKey: 'required' });
29921
29956
  var bip32BaseProtocolSchema = __assign(__assign({}, baseProtocolSchema), { deriveFromExtendedPublicKey: 'required' });
29922
- var bip32OfflineProtocolSchema = __assign(__assign(__assign({}, bip32BaseProtocolSchema), offlineProtocolSchema), { getExtendedKeyPairFromSecret: 'required' });
29957
+ var bip32OfflineProtocolSchema = __assign(__assign(__assign({}, bip32BaseProtocolSchema), offlineProtocolSchema), { getExtendedKeyPairFromSecret: 'required', deriveFromExtendedSecretKey: 'required' });
29923
29958
  var bip32OnlineProtocolSchema = __assign(__assign({}, bip32BaseProtocolSchema), onlineProtocolSchema);
29924
29959
  var subProtocolSchema = {
29925
- getType: 'required'
29960
+ getType: 'required',
29961
+ mainProtocol: 'required'
29926
29962
  };
29927
29963
  var singleTokenSubProtocolSchema = __assign(__assign({}, subProtocolSchema), { getContractAddress: 'required' });
29928
29964
  var multiTokenSubProtocolBaseSchema = singleTokenSubProtocolSchema;
@@ -29966,9 +30002,11 @@ var transactionStatusCheckerSchema = {
29966
30002
  function isOfflineProtocol(object) {
29967
30003
  return (0, interface_1.implementsInterface)(object, offlineProtocolSchema);
29968
30004
  }
30005
+ exports.isOfflineProtocol = isOfflineProtocol;
29969
30006
  function isOnlineProtocol(object) {
29970
30007
  return (0, interface_1.implementsInterface)(object, onlineProtocolSchema);
29971
30008
  }
30009
+ exports.isOnlineProtocol = isOnlineProtocol;
29972
30010
  function isOfflineBip32Protocol(protocol) {
29973
30011
  return (0, interface_1.implementsInterface)(protocol, bip32OfflineProtocolSchema);
29974
30012
  }
@@ -1,2 +1,2 @@
1
- export interface BlockExplorerExtensions<T> {
1
+ export interface BlockExplorerExtensions<_T> {
2
2
  }
package/index.d.ts CHANGED
@@ -28,6 +28,7 @@ import { BytesString, BytesStringFormat, HexString } from './types/bytes';
28
28
  import { FeeDefaults, FeeEstimation } from './types/fee';
29
29
  import { ExtendedKeyPair, ExtendedPublicKey, ExtendedSecretKey, KeyPair, KeyType, PublicKey, SecretKey } from './types/key';
30
30
  import { RecursivePartial } from './types/meta/utility-types';
31
+ import { FullProtocolConfiguration, OfflineProtocolConfiguration, OnlineProtocolConfiguration, ProtocolConfiguration } from './types/module';
31
32
  import { ProtocolAccountMetadata, ProtocolFeeMetadata, ProtocolMetadata, ProtocolNetwork, ProtocolNetworkType, ProtocolSymbol, ProtocolUnitsMetadata } from './types/protocol';
32
33
  import { HexSecret, MnemonicSecret, Secret, SecretType } from './types/secret';
33
34
  import { Signature } from './types/signature';
@@ -39,12 +40,13 @@ import { AirGapUIText } from './types/ui/text';
39
40
  import { isAmount } from './utils/amount';
40
41
  import { implementsInterface, Schema } from './utils/interface';
41
42
  import { isAnyKey, isExtendedPublicKey, isExtendedSecretKey, isPublicKey, isSecretKey } from './utils/key';
43
+ import { createSupportedProtocols } from './utils/module';
42
44
  import { normalizeToUndefined } from './utils/normalize';
43
- import { canEncryptAES, canEncryptAsymmetric, canFetchDataForMultipleAddresses, canSignMessage, hasConfigurableContract, hasConfigurableTransactionInjector, hasMultiAddressPublicKeys, isBip32Protocol, isMultiTokenSubProtocol, isSingleTokenSubProtocol, isSubProtocol, isTransactionStatusChecker, protocolNetworkIdentifier } from './utils/protocol';
45
+ import { canEncryptAES, canEncryptAsymmetric, canFetchDataForMultipleAddresses, canSignMessage, hasConfigurableContract, hasConfigurableTransactionInjector, hasMultiAddressPublicKeys, isBip32Protocol, isMultiTokenSubProtocol, isOfflineProtocol, isOnlineProtocol, isSingleTokenSubProtocol, isSubProtocol, isTransactionStatusChecker, protocolNetworkIdentifier } from './utils/protocol';
44
46
  export { AirGapBlockExplorer, BlockExplorerMetadata };
45
47
  export { newSuccessUIAlert, newInfoUIAlert, newWarningUIAlert, newErrorUIAlert, newPlainUIText, newAmount, newSecretKey, newExtendedSecretKey, newPublicKey, newExtendedPublicKey, newSignature, newUnsignedTransaction, newSignedTransaction };
46
- export { AirGapModule, ModuleNetworkRegistry };
48
+ export { AirGapModule, ModuleNetworkRegistry, ProtocolConfiguration, OfflineProtocolConfiguration, OnlineProtocolConfiguration, FullProtocolConfiguration };
47
49
  export { AirGapOfflineProtocol, AirGapOnlineProtocol, AirGapProtocol, AirGapAnyProtocol, FetchDataForMultipleAddressesExtension, FetchDataForMultipleAddressesProtocol, MultiAddressPublicKeyExtension, MultiAddressPublicKeyProtocol, Bip32Extension, OfflineBip32Protocol, OnlineBip32Protocol, SubProtocolExtension, SubProtocol, SingleTokenSubProtocolExtension, SingleTokenSubProtocol, MultiTokenSubProtocolExtension, BaseMultiTokenSubProtocol, OnlineMultiTokenSubProtocol, CryptoExtension, AESExtension, AsymmetricEncryptionExtension, SignMessageExtension, TransactionStatusCheckerExtension, ProtocolMetadata, ProtocolUnitsMetadata, ProtocolSymbol, ProtocolFeeMetadata, ProtocolAccountMetadata, ProtocolNetworkType, ProtocolNetwork, SubProtocolType };
48
50
  export { AirGapInterface };
49
51
  export { AirGapUIAction, AirGapUIAlert, AirGapUIText, Address, AddressCursor, AddressWithCursor, Amount, Balance, MultiTokenBalanceConfiguration, BytesStringFormat, BytesString, HexString, FeeDefaults, FeeEstimation, KeyType, SecretKey, ExtendedSecretKey, PublicKey, ExtendedPublicKey, KeyPair, ExtendedKeyPair, SecretType, MnemonicSecret, HexSecret, Secret, Signature, TransactionType, UnsignedTransaction, SignedTransaction, AirGapTransaction, TransactionCursor, AirGapTransactionsWithCursor, TransactionDetails, TransactionConfiguration, AirGapTransactionStatus, RecursivePartial };
50
- export { isAmount, Schema, implementsInterface, isAnyKey, isSecretKey, isExtendedSecretKey, isPublicKey, isExtendedPublicKey, isBip32Protocol, isSubProtocol, isSingleTokenSubProtocol, isMultiTokenSubProtocol, canFetchDataForMultipleAddresses, hasMultiAddressPublicKeys, hasConfigurableContract, canEncryptAES, canEncryptAsymmetric, canSignMessage, hasConfigurableTransactionInjector, isTransactionStatusChecker, protocolNetworkIdentifier, normalizeToUndefined };
52
+ export { isAmount, Schema, implementsInterface, isAnyKey, isSecretKey, isExtendedSecretKey, isPublicKey, isExtendedPublicKey, createSupportedProtocols, isOfflineProtocol, isOnlineProtocol, isBip32Protocol, isSubProtocol, isSingleTokenSubProtocol, isMultiTokenSubProtocol, canFetchDataForMultipleAddresses, hasMultiAddressPublicKeys, hasConfigurableContract, canEncryptAES, canEncryptAsymmetric, canSignMessage, hasConfigurableTransactionInjector, isTransactionStatusChecker, protocolNetworkIdentifier, normalizeToUndefined };
package/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.normalizeToUndefined = exports.protocolNetworkIdentifier = exports.isTransactionStatusChecker = exports.hasConfigurableTransactionInjector = exports.canSignMessage = exports.canEncryptAsymmetric = exports.canEncryptAES = exports.hasConfigurableContract = exports.hasMultiAddressPublicKeys = exports.canFetchDataForMultipleAddresses = exports.isMultiTokenSubProtocol = exports.isSingleTokenSubProtocol = exports.isSubProtocol = exports.isBip32Protocol = exports.isExtendedPublicKey = exports.isPublicKey = exports.isExtendedSecretKey = exports.isSecretKey = exports.isAnyKey = exports.implementsInterface = exports.isAmount = exports.ModuleNetworkRegistry = exports.newSignedTransaction = exports.newUnsignedTransaction = exports.newSignature = exports.newExtendedPublicKey = exports.newPublicKey = exports.newExtendedSecretKey = exports.newSecretKey = exports.newAmount = exports.newPlainUIText = exports.newErrorUIAlert = exports.newWarningUIAlert = exports.newInfoUIAlert = exports.newSuccessUIAlert = void 0;
3
+ exports.normalizeToUndefined = exports.protocolNetworkIdentifier = exports.isTransactionStatusChecker = exports.hasConfigurableTransactionInjector = exports.canSignMessage = exports.canEncryptAsymmetric = exports.canEncryptAES = exports.hasConfigurableContract = exports.hasMultiAddressPublicKeys = exports.canFetchDataForMultipleAddresses = exports.isMultiTokenSubProtocol = exports.isSingleTokenSubProtocol = exports.isSubProtocol = exports.isBip32Protocol = exports.isOnlineProtocol = exports.isOfflineProtocol = exports.createSupportedProtocols = exports.isExtendedPublicKey = exports.isPublicKey = exports.isExtendedSecretKey = exports.isSecretKey = exports.isAnyKey = exports.implementsInterface = exports.isAmount = exports.ModuleNetworkRegistry = exports.newSignedTransaction = exports.newUnsignedTransaction = exports.newSignature = exports.newExtendedPublicKey = exports.newPublicKey = exports.newExtendedSecretKey = exports.newSecretKey = exports.newAmount = exports.newPlainUIText = exports.newErrorUIAlert = exports.newWarningUIAlert = exports.newInfoUIAlert = exports.newSuccessUIAlert = void 0;
4
4
  var amount_1 = require("./factories/amount");
5
5
  Object.defineProperty(exports, "newAmount", { enumerable: true, get: function () { return amount_1.newAmount; } });
6
6
  var key_1 = require("./factories/key");
@@ -32,6 +32,8 @@ Object.defineProperty(exports, "isExtendedPublicKey", { enumerable: true, get: f
32
32
  Object.defineProperty(exports, "isExtendedSecretKey", { enumerable: true, get: function () { return key_2.isExtendedSecretKey; } });
33
33
  Object.defineProperty(exports, "isPublicKey", { enumerable: true, get: function () { return key_2.isPublicKey; } });
34
34
  Object.defineProperty(exports, "isSecretKey", { enumerable: true, get: function () { return key_2.isSecretKey; } });
35
+ var module_1 = require("./utils/module");
36
+ Object.defineProperty(exports, "createSupportedProtocols", { enumerable: true, get: function () { return module_1.createSupportedProtocols; } });
35
37
  var normalize_1 = require("./utils/normalize");
36
38
  Object.defineProperty(exports, "normalizeToUndefined", { enumerable: true, get: function () { return normalize_1.normalizeToUndefined; } });
37
39
  var protocol_1 = require("./utils/protocol");
@@ -44,6 +46,8 @@ Object.defineProperty(exports, "hasConfigurableTransactionInjector", { enumerabl
44
46
  Object.defineProperty(exports, "hasMultiAddressPublicKeys", { enumerable: true, get: function () { return protocol_1.hasMultiAddressPublicKeys; } });
45
47
  Object.defineProperty(exports, "isBip32Protocol", { enumerable: true, get: function () { return protocol_1.isBip32Protocol; } });
46
48
  Object.defineProperty(exports, "isMultiTokenSubProtocol", { enumerable: true, get: function () { return protocol_1.isMultiTokenSubProtocol; } });
49
+ Object.defineProperty(exports, "isOfflineProtocol", { enumerable: true, get: function () { return protocol_1.isOfflineProtocol; } });
50
+ Object.defineProperty(exports, "isOnlineProtocol", { enumerable: true, get: function () { return protocol_1.isOnlineProtocol; } });
47
51
  Object.defineProperty(exports, "isSingleTokenSubProtocol", { enumerable: true, get: function () { return protocol_1.isSingleTokenSubProtocol; } });
48
52
  Object.defineProperty(exports, "isSubProtocol", { enumerable: true, get: function () { return protocol_1.isSubProtocol; } });
49
53
  Object.defineProperty(exports, "isTransactionStatusChecker", { enumerable: true, get: function () { return protocol_1.isTransactionStatusChecker; } });
package/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AACA,6CAA8C;AA+F5C,0FA/FO,kBAAS,OA+FP;AA9FX,uCAAwG;AAkGtG,qGAlGO,0BAAoB,OAkGP;AAFpB,qGAhG6B,0BAAoB,OAgG7B;AACpB,6FAjGmD,kBAAY,OAiGnD;AAFZ,6FA/FiE,kBAAY,OA+FjE;AA9Fd,mDAAoD;AAkGlD,6FAlGO,wBAAY,OAkGP;AAjGd,uDAAsF;AAmGpF,qGAnGO,kCAAoB,OAmGP;AADpB,uGAlG6B,oCAAsB,OAkG7B;AAjGxB,8CAA4G;AAyF1G,gGAzFO,uBAAe,OAyFP;AAFf,+FAvFwB,sBAAc,OAuFxB;AADd,kGAtFwC,yBAAiB,OAsFxC;AAEjB,kGAxF2D,yBAAiB,OAwF3D;AAvFnB,4CAAoD;AAyFlD,+FAzFO,qBAAc,OAyFP;AAvFhB,4EAAwE;AAoGjD,sGApGd,+CAAqB,OAoGc;AA5C5C,yCAAyC;AAkIvC,yFAlIO,iBAAQ,OAkIP;AAjIV,+CAA+D;AAmI7D,oGAnIO,+BAAmB,OAmIP;AAlIrB,mCAA0G;AAmIxG,yFAnIO,cAAQ,OAmIP;AAIR,oGAvIiB,yBAAmB,OAuIjB;AAFnB,oGArIsC,yBAAmB,OAqItC;AACnB,4FAtI2D,iBAAW,OAsI3D;AAFX,4FApIwE,iBAAW,OAoIxE;A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,yBAAmB,OAiJjB;AAFnB,oGA/IsC,yBAAmB,OA+ItC;AACnB,4FAhJ2D,iBAAW,OAgJ3D;AAFX,4FA9IwE,iBAAW,OA8IxE;AA7Ib,yCAAyD;AAiJvD,yGAjJO,iCAAwB,OAiJP;AAhJ1B,+CAAwD;AAgKtD,qGAhKO,gCAAoB,OAgKP;AA/JtB,6CAgByB;AAyIvB,8FAxJA,wBAAa,OAwJA;AACb,qGAxJA,+BAAoB,OAwJA;AAJpB,iHAnJA,2CAAgC,OAmJA;AAKhC,+FAvJA,yBAAc,OAuJA;AAHd,wGAnJA,kCAAuB,OAmJA;AAIvB,mHAtJA,6CAAkC,OAsJA;AALlC,0GAhJA,oCAAyB,OAgJA;AALzB,gGA1IA,0BAAe,OA0IA;AAGf,wGA5IA,kCAAuB,OA4IA;AALvB,kGAtIA,4BAAiB,OAsIA;AACjB,iGAtIA,2BAAgB,OAsIA;AAGhB,yGAxIA,mCAAwB,OAwIA;AADxB,8FAtIA,wBAAa,OAsIA;AAUb,2GA/IA,qCAA0B,OA+IA;AAC1B,0GA/IA,oCAAyB,OA+IA"}
@@ -1,2 +1,2 @@
1
- export interface ModuleExtensions<T> {
1
+ export interface ModuleExtensions<_T> {
2
2
  }
@@ -1,11 +1,18 @@
1
1
  import { BlockExplorer } from '../block-explorer/block-explorer';
2
2
  import { OfflineProtocol, OnlineProtocol } from '../protocol/protocol';
3
3
  import { AirGapInterface } from '../types/airgap';
4
- import { ProtocolNetwork } from '../types/protocol';
5
- export interface Module {
6
- supportedNetworks: Record<string, ProtocolNetwork>;
7
- createOfflineProtocol(): Promise<OfflineProtocol | undefined>;
8
- createOnlineProtocol(networkId?: string): Promise<OnlineProtocol | undefined>;
9
- createBlockExplorer(networkId?: string): Promise<BlockExplorer | undefined>;
4
+ import { Complement } from '../types/meta/utility-types';
5
+ import { ProtocolConfiguration } from '../types/module';
6
+ interface ModuleGeneric<_Protocols extends string = string> {
7
+ Protocols: _Protocols;
10
8
  }
11
- export declare type AirGapModule = AirGapInterface<Module>;
9
+ declare type TypedProtocols<G extends Partial<ModuleGeneric>> = Complement<ModuleGeneric, G>['Protocols'];
10
+ interface _Module<_Protocols extends ModuleGeneric['Protocols'] = any> {
11
+ supportedProtocols: Record<_Protocols, ProtocolConfiguration>;
12
+ createOfflineProtocol(identifier: _Protocols): Promise<OfflineProtocol | undefined>;
13
+ createOnlineProtocol(identifier: _Protocols, networkId?: string): Promise<OnlineProtocol | undefined>;
14
+ createBlockExplorer(identifier: _Protocols, networkId?: string): Promise<BlockExplorer | undefined>;
15
+ }
16
+ export declare type Module<G extends Partial<ModuleGeneric> = {}> = _Module<TypedProtocols<G>>;
17
+ export declare type AirGapModule<G extends Partial<ModuleGeneric> = {}> = AirGapInterface<Module<G>>;
18
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@airgap/module-kit",
3
- "version": "0.13.8-beta.3",
3
+ "version": "0.13.8-beta.5",
4
4
  "description": "TODO",
5
5
  "keywords": [
6
6
  "airgap",
@@ -9,6 +9,7 @@ export interface BaseBip32Protocol<_AddressCursor extends BaseGeneric['AddressCu
9
9
  }
10
10
  export interface OfflineBip32Protocol<_AddressCursor extends OfflineGeneric['AddressCursor'] = OfflineGeneric['AddressCursor'], _AddressResult extends OfflineGeneric['AddressResult'] = OfflineGeneric['AddressResult'], _Units extends OfflineGeneric['Units'] = OfflineGeneric['Units'], _FeeUnits extends OfflineGeneric['FeeUnits'] = OfflineGeneric['FeeUnits'], _SignedTransaction extends OfflineGeneric['SignedTransaction'] = OfflineGeneric['SignedTransaction'], _UnsignedTransaction extends OfflineGeneric['UnsignedTransaction'] = OfflineGeneric['UnsignedTransaction']> extends BaseBip32Protocol<_AddressCursor, _AddressResult, _Units, _FeeUnits, _SignedTransaction, _UnsignedTransaction>, _OfflineProtocol<_AddressCursor, _AddressResult, _Units, _FeeUnits, _SignedTransaction, _UnsignedTransaction, PublicKey | ExtendedPublicKey, SecretKey | ExtendedSecretKey, KeyPair | ExtendedKeyPair> {
11
11
  getExtendedKeyPairFromSecret(secret: Secret, derivationPath?: string): Promise<ExtendedKeyPair>;
12
+ deriveFromExtendedSecretKey(extendedSecretKey: ExtendedSecretKey, visibilityIndex: number, addressIndex: number): Promise<SecretKey>;
12
13
  }
13
14
  export interface OnlineBip32Protocol<_AddressCursor extends OnlineGeneric['AddressCursor'] = OnlineGeneric['AddressCursor'], _AddressResult extends OnlineGeneric['AddressResult'] = OnlineGeneric['AddressResult'], _ProtocolNetwork extends OnlineGeneric['ProtocolNetwork'] = OnlineGeneric['ProtocolNetwork'], _Units extends OnlineGeneric['Units'] = OnlineGeneric['Units'], _FeeUnits extends OnlineGeneric['FeeUnits'] = OnlineGeneric['FeeUnits'], _FeeEstimation extends OnlineGeneric['FeeEstimation'] = OnlineGeneric['FeeEstimation'], _SignedTransaction extends OnlineGeneric['SignedTransaction'] = OnlineGeneric['SignedTransaction'], _UnsignedTransaction extends OnlineGeneric['UnsignedTransaction'] = OnlineGeneric['UnsignedTransaction'], _TransactionCursor extends OnlineGeneric['TransactionCursor'] = OnlineGeneric['TransactionCursor'], _BalanceConfiguration extends Object | undefined = undefined> extends BaseBip32Protocol<_AddressCursor, _AddressResult, _Units, _FeeUnits, _SignedTransaction, _UnsignedTransaction>, _OnlineProtocol<_AddressCursor, _AddressResult, _ProtocolNetwork, _Units, _FeeUnits, _FeeEstimation, _SignedTransaction, _UnsignedTransaction, _TransactionCursor, PublicKey | ExtendedPublicKey, _BalanceConfiguration> {
14
15
  }
@@ -1,5 +1,5 @@
1
1
  import { _AnyProtocol } from '../../protocol';
2
- export declare type ConfigurableContractExtension<T extends _AnyProtocol> = ConfigurableContractProtocol;
2
+ export declare type ConfigurableContractExtension<_T extends _AnyProtocol> = ConfigurableContractProtocol;
3
3
  export interface ConfigurableContractProtocol {
4
4
  isContractValid(address: string): Promise<boolean>;
5
5
  getContractAddress(): Promise<string | undefined>;
@@ -2,7 +2,7 @@ import { Address } from '../../../types/address';
2
2
  import { SubProtocolType } from '../../../types/sub-protocol';
3
3
  import { _AnyProtocol } from '../../protocol';
4
4
  import { SubProtocol } from './SubProtocolExtension';
5
- export declare type SingleTokenSubProtocolExtension<T extends _AnyProtocol> = SingleTokenSubProtocol;
5
+ export declare type SingleTokenSubProtocolExtension<_T extends _AnyProtocol> = SingleTokenSubProtocol;
6
6
  export interface SingleTokenSubProtocol extends SubProtocol {
7
7
  getType(): Promise<Extract<SubProtocolType, 'token'>>;
8
8
  getContractAddress(): Promise<Address>;
@@ -1,6 +1,7 @@
1
1
  import { SubProtocolType } from '../../../types/sub-protocol';
2
2
  import { _AnyProtocol } from '../../protocol';
3
- export declare type SubProtocolExtension<T extends _AnyProtocol> = SubProtocol;
3
+ export declare type SubProtocolExtension<_T extends _AnyProtocol> = SubProtocol;
4
4
  export interface SubProtocol {
5
5
  getType(): Promise<SubProtocolType>;
6
+ mainProtocol(): Promise<string>;
6
7
  }
@@ -1,5 +1,5 @@
1
1
  import { _OnlineProtocol } from '../../protocol';
2
- export declare type ConfigurableTransactionInjectorExtension<T extends _OnlineProtocol> = ConfigurableTransactionInjectorProtocol;
2
+ export declare type ConfigurableTransactionInjectorExtension<_T extends _OnlineProtocol> = ConfigurableTransactionInjectorProtocol;
3
3
  export interface ConfigurableTransactionInjectorProtocol {
4
4
  getInjectorUrl(): Promise<string | undefined>;
5
5
  setInjectorUrl(url: string): Promise<void>;
@@ -1,6 +1,6 @@
1
1
  import { AirGapTransactionStatus } from '../../../types/transaction';
2
2
  import { _OnlineProtocol } from '../../protocol';
3
- export declare type TransactionStatusCheckerExtension<T extends _OnlineProtocol> = TransactionStatusChecker;
3
+ export declare type TransactionStatusCheckerExtension<_T extends _OnlineProtocol> = TransactionStatusChecker;
4
4
  export interface TransactionStatusChecker {
5
5
  getTransactionStatus(transactionIds: string[]): Promise<Record<string, AirGapTransactionStatus>>;
6
6
  }
package/types/airgap.d.ts CHANGED
@@ -5,8 +5,8 @@ import { Module } from '../module/module';
5
5
  import { ProtocolExtensions } from '../protocol/extensions/extensions';
6
6
  import { _AnyProtocol } from '../protocol/protocol';
7
7
  import { Override } from './meta/utility-types';
8
- export declare type AirGapInterface<T, E0 extends ApplicableExtension<T> = undefined, E1 extends ApplicableExtension<T> = undefined, E2 extends ApplicableExtension<T> = undefined, E3 extends ApplicableExtension<T> = undefined, E4 extends ApplicableExtension<T> = undefined, E5 extends ApplicableExtension<T> = undefined, E6 extends ApplicableExtension<T> = undefined, E7 extends ApplicableExtension<T> = undefined, E8 extends ApplicableExtension<T> = undefined, E9 extends ApplicableExtension<T> = undefined> = _Interface<T, E0, E1, E2, E3, E4, E5, E6, E7, E8, E9>;
9
- declare type _Interface<T, E0 = undefined, E1 = undefined, E2 = undefined, E3 = undefined, E4 = undefined, E5 = undefined, E6 = undefined, E7 = undefined, E8 = undefined, E9 = undefined> = E0 extends keyof AirGapExtensions<T> ? _Interface<Override<T, AirGapExtensions<T>[E0]>, E1, E2, E3, E4, E5, E6, E7, E8, E9> : T;
8
+ export declare type AirGapInterface<T, E0 extends ApplicableExtension<T> = undefined, E1 extends ApplicableExtension<T> = undefined, E2 extends ApplicableExtension<T> = undefined, E3 extends ApplicableExtension<T> = undefined, E4 extends ApplicableExtension<T> = undefined, E5 extends ApplicableExtension<T> = undefined, E6 extends ApplicableExtension<T> = undefined, E7 extends ApplicableExtension<T> = undefined, E8 extends ApplicableExtension<T> = undefined, E9 extends ApplicableExtension<T> = undefined> = _Interface<T, [E0, E1, E2, E3, E4, E5, E6, E7, E8, E9]>;
9
+ declare type _Interface<T, E extends readonly any[]> = E extends [infer Head, ...infer Tail] ? Head extends undefined ? T : Head extends keyof AirGapExtensions<T> ? _Interface<Override<T, AirGapExtensions<T>[Head]>, [...Tail]> extends infer I ? I : never : never : never;
10
10
  export declare type ApplicableExtension<T> = keyof AirGapExtensions<T> | undefined;
11
11
  export declare type ApplicableBlockExplorerExtension<T> = keyof BlockExplorerExtensions<T> | undefined;
12
12
  export declare type ApplicableModuleExtension<T> = keyof ModuleExtensions<T> | undefined;
@@ -0,0 +1,14 @@
1
+ import { ProtocolNetwork } from './protocol';
2
+ export interface OfflineProtocolConfiguration {
3
+ type: 'offline';
4
+ }
5
+ export interface OnlineProtocolConfiguration {
6
+ type: 'online';
7
+ networks: Record<string, ProtocolNetwork>;
8
+ }
9
+ export interface FullProtocolConfiguration {
10
+ type: 'full';
11
+ offline: OfflineProtocolConfiguration;
12
+ online: OnlineProtocolConfiguration;
13
+ }
14
+ export declare type ProtocolConfiguration = OfflineProtocolConfiguration | OnlineProtocolConfiguration | FullProtocolConfiguration;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module.js","sourceRoot":"","sources":["../../src/types/module.ts"],"names":[],"mappings":""}
@@ -1,6 +1,6 @@
1
1
  import { Amount } from './amount';
2
2
  import { FeeDefaults } from './fee';
3
- export interface ProtocolMetadata<_Units extends string, _FeeUnits extends string = _Units> {
3
+ export interface ProtocolMetadata<_Units extends string = string, _FeeUnits extends string = _Units> {
4
4
  name: string;
5
5
  identifier: string;
6
6
  units: ProtocolUnitsMetadata<_Units>;
@@ -9,7 +9,7 @@ export interface ProtocolMetadata<_Units extends string, _FeeUnits extends strin
9
9
  account?: ProtocolAccountMetadata;
10
10
  transaction?: ProtocolTransactionMetadata<_Units>;
11
11
  }
12
- export declare type ProtocolUnitsMetadata<_Units extends string> = {
12
+ export declare type ProtocolUnitsMetadata<_Units extends string = string> = {
13
13
  [key in _Units]: {
14
14
  symbol: ProtocolSymbol;
15
15
  decimals: number;
@@ -19,15 +19,11 @@ export interface ProtocolSymbol {
19
19
  value: string;
20
20
  market?: string;
21
21
  }
22
- interface ProtocolFeeMetadataWithUnits<_FeeUnits extends string> {
23
- units: ProtocolUnitsMetadata<_FeeUnits>;
24
- mainUnit: _FeeUnits;
22
+ export interface ProtocolFeeMetadata<_FeeUnits extends string = string> {
25
23
  defaults?: FeeDefaults<_FeeUnits>;
24
+ units?: ProtocolUnitsMetadata<_FeeUnits>;
25
+ mainUnit?: _FeeUnits;
26
26
  }
27
- interface ProtocolFeeMetadataWithoutUnits<_FeeUnits extends string> {
28
- defaults?: FeeDefaults<_FeeUnits>;
29
- }
30
- export declare type ProtocolFeeMetadata<_FeeUnits extends string> = ProtocolFeeMetadataWithoutUnits<_FeeUnits> | ProtocolFeeMetadataWithUnits<_FeeUnits>;
31
27
  export interface ProtocolAccountMetadata {
32
28
  standardDerivationPath?: string;
33
29
  address?: {
@@ -36,7 +32,7 @@ export interface ProtocolAccountMetadata {
36
32
  regex?: string;
37
33
  };
38
34
  }
39
- export interface ProtocolTransactionMetadata<_Units extends string> {
35
+ export interface ProtocolTransactionMetadata<_Units extends string = string> {
40
36
  arbitraryData?: ProtocolTransactionArbitraryDataMetadata | {
41
37
  root?: ProtocolTransactionArbitraryDataMetadata;
42
38
  inner?: ProtocolTransactionArbitraryDataMetadata;
@@ -57,4 +53,3 @@ export interface ProtocolNetwork {
57
53
  type: ProtocolNetworkType;
58
54
  rpcUrl: string;
59
55
  }
60
- export {};
@@ -28,6 +28,7 @@ export interface AirGapTransaction<_Units extends string = string, _FeeUnits ext
28
28
  uiAlerts?: AirGapUIAlert[];
29
29
  arbitraryData?: string | [AirGapUIText, string];
30
30
  json?: any;
31
+ extra?: any;
31
32
  }
32
33
  export interface TransactionCursor extends BaseCursor {
33
34
  }
@@ -5,7 +5,7 @@ function implementsInterface(object, schema) {
5
5
  if (typeof object !== 'object' || !object) {
6
6
  return false;
7
7
  }
8
- return Object.keys(schema).every(function (key) { return schema[key] === 'optional' || object[key] !== undefined; });
8
+ return Object.keys(schema).every(function (key) { return schema[key] === 'optional' || key in object; });
9
9
  }
10
10
  exports.implementsInterface = implementsInterface;
11
11
  //# sourceMappingURL=interface.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"interface.js","sourceRoot":"","sources":["../../src/utils/interface.ts"],"names":[],"mappings":";;;AAEA,SAAgB,mBAAmB,CAAI,MAAe,EAAE,MAAiB;IACvE,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,CAAC,MAAM,EAAE;QACzC,OAAO,KAAK,CAAA;KACb;IAED,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,UAAC,GAAG,IAAK,OAAA,MAAM,CAAC,GAAG,CAAC,KAAK,UAAU,IAAI,MAAM,CAAC,GAAG,CAAC,KAAK,SAAS,EAAvD,CAAuD,CAAC,CAAA;AACpG,CAAC;AAND,kDAMC"}
1
+ {"version":3,"file":"interface.js","sourceRoot":"","sources":["../../src/utils/interface.ts"],"names":[],"mappings":";;;AAEA,SAAgB,mBAAmB,CAAI,MAAe,EAAE,MAAiB;IACvE,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,CAAC,MAAM,EAAE;QACzC,OAAO,KAAK,CAAA;KACb;IAED,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,UAAC,GAAW,IAAK,OAAA,MAAM,CAAC,GAAsB,CAAC,KAAK,UAAU,IAAI,GAAG,IAAI,MAAM,EAA9D,CAA8D,CAAC,CAAA;AACnH,CAAC;AAND,kDAMC"}
@@ -0,0 +1,4 @@
1
+ import { ModuleNetworkRegistry } from '../module/module-network-registry';
2
+ import { ProtocolConfiguration } from '../types/module';
3
+ import { ProtocolNetwork } from '../types/protocol';
4
+ export declare function createSupportedProtocols<P extends string = string>(online: Record<P, ModuleNetworkRegistry> | Record<P, Record<string, ProtocolNetwork>>, offline?: P[]): Record<P, ProtocolConfiguration>;
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createSupportedProtocols = void 0;
4
+ function createSupportedProtocols(online, offline) {
5
+ var onlineIdentifiers = new Set(Object.keys(online));
6
+ var offlineIdentifiers = offline ? new Set(offline) : onlineIdentifiers;
7
+ var identifiers = new Set(Array.from(onlineIdentifiers).concat(Array.from(onlineIdentifiers)));
8
+ return Array.from(identifiers).reduce(function (obj, next) {
9
+ var _a;
10
+ var offlineConfiguration = offlineIdentifiers.has(next) ? { type: 'offline' } : undefined;
11
+ var onlineConfiguration = online[next]
12
+ ? createOnlineProtocolConfiguration(online[next])
13
+ : undefined;
14
+ var configuration = offlineConfiguration !== undefined && onlineConfiguration !== undefined
15
+ ? { type: 'full', offline: offlineConfiguration, online: onlineConfiguration }
16
+ : (offlineConfiguration !== null && offlineConfiguration !== void 0 ? offlineConfiguration : onlineConfiguration);
17
+ return Object.assign(obj, (_a = {}, _a[next] = configuration, _a));
18
+ // tslint:disable-next-line: no-object-literal-type-assertion
19
+ }, {});
20
+ }
21
+ exports.createSupportedProtocols = createSupportedProtocols;
22
+ function createOnlineProtocolConfiguration(networks) {
23
+ var _a;
24
+ return {
25
+ type: 'online',
26
+ networks: (_a = networks.supportedNetworks) !== null && _a !== void 0 ? _a : networks
27
+ };
28
+ }
29
+ //# sourceMappingURL=module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module.js","sourceRoot":"","sources":["../../src/utils/module.ts"],"names":[],"mappings":";;;AAIA,SAAgB,wBAAwB,CACtC,MAAqF,EACrF,OAAa;IAEb,IAAM,iBAAiB,GAAW,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAQ,CAAC,CAAA;IACrE,IAAM,kBAAkB,GAAW,OAAO,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAA;IAEjF,IAAM,WAAW,GAAW,IAAI,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAA;IAExG,OAAO,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,MAAM,CAAC,UAAC,GAAqC,EAAE,IAAO;;QACnF,IAAM,oBAAoB,GAA6C,kBAAkB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,SAAS,CAAA;QACrI,IAAM,mBAAmB,GAA4C,MAAM,CAAC,IAAI,CAAC;YAC/E,CAAC,CAAC,iCAAiC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;YACjD,CAAC,CAAC,SAAS,CAAA;QAEb,IAAM,aAAa,GACjB,oBAAoB,KAAK,SAAS,IAAI,mBAAmB,KAAK,SAAS;YACrE,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,oBAAoB,EAAE,MAAM,EAAE,mBAAmB,EAAE;YAC9E,CAAC,CAAE,CAAC,oBAAoB,aAApB,oBAAoB,cAApB,oBAAoB,GAAI,mBAAmB,CAAgE,CAAA;QAEnH,OAAO,MAAM,CAAC,MAAM,CAAC,GAAG,YAAI,GAAC,IAAI,IAAG,aAAa,MAAG,CAAA;QACpD,6DAA6D;IAC/D,CAAC,EAAE,EAAsC,CAAC,CAAA;AAC5C,CAAC;AAvBD,4DAuBC;AAED,SAAS,iCAAiC,CAAC,QAAiE;;IAC1G,OAAO;QACL,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,MAAC,QAAkC,CAAC,iBAAiB,mCAAI,QAAQ;KAC5E,CAAA;AACH,CAAC"}
@@ -13,6 +13,8 @@ import { ConfigurableTransactionInjectorProtocol } from '../protocol/extensions/
13
13
  import { TransactionStatusCheckerExtension } from '../protocol/extensions/transaction/TransactionStatusCheckerExtension';
14
14
  import { AnyProtocol, OfflineProtocol, OnlineProtocol } from '../protocol/protocol';
15
15
  import { ProtocolNetwork } from '../types/protocol';
16
+ export declare function isOfflineProtocol(object: AnyProtocol): object is OfflineProtocol;
17
+ export declare function isOnlineProtocol(object: AnyProtocol): object is OnlineProtocol;
16
18
  export declare function isBip32Protocol<T extends AnyProtocol>(protocol: T): protocol is T & Bip32Extension<T>;
17
19
  export declare function isSubProtocol<T extends AnyProtocol>(protocol: T): protocol is T & SubProtocol;
18
20
  export declare function isSingleTokenSubProtocol<T extends AnyProtocol>(protocol: T): protocol is T & SingleTokenSubProtocolExtension<T>;
package/utils/protocol.js CHANGED
@@ -11,7 +11,8 @@ var __assign = (this && this.__assign) || function () {
11
11
  return __assign.apply(this, arguments);
12
12
  };
13
13
  Object.defineProperty(exports, "__esModule", { value: true });
14
- exports.protocolNetworkIdentifier = exports.isTransactionStatusChecker = exports.hasConfigurableTransactionInjector = exports.canSignMessage = exports.canEncryptAsymmetric = exports.canEncryptAES = exports.hasConfigurableContract = exports.hasMultiAddressPublicKeys = exports.canFetchDataForMultipleAddresses = exports.canFetchDataForAddress = exports.isMultiTokenSubProtocol = exports.isSingleTokenSubProtocol = exports.isSubProtocol = exports.isBip32Protocol = void 0;
14
+ exports.protocolNetworkIdentifier = exports.isTransactionStatusChecker = exports.hasConfigurableTransactionInjector = exports.canSignMessage = exports.canEncryptAsymmetric = exports.canEncryptAES = exports.hasConfigurableContract = exports.hasMultiAddressPublicKeys = exports.canFetchDataForMultipleAddresses = exports.canFetchDataForAddress = exports.isMultiTokenSubProtocol = exports.isSingleTokenSubProtocol = exports.isSubProtocol = exports.isBip32Protocol = exports.isOnlineProtocol = exports.isOfflineProtocol = void 0;
15
+ // @ts-ignore
15
16
  var createHash = require("@airgap/coinlib-core/dependencies/src/create-hash-1.2.0/index");
16
17
  var interface_1 = require("./interface");
17
18
  // Schemas
@@ -23,10 +24,11 @@ var baseProtocolSchema = {
23
24
  var offlineProtocolSchema = __assign(__assign({}, baseProtocolSchema), { getKeyPairFromSecret: 'required', signTransactionWithSecretKey: 'required' });
24
25
  var onlineProtocolSchema = __assign(__assign({}, baseProtocolSchema), { broadcastTransaction: 'required', getBalanceOfPublicKey: 'required', getNetwork: 'required', getTransactionFeeWithPublicKey: 'required', getTransactionMaxAmountWithPublicKey: 'required', getTransactionsForPublicKey: 'required', prepareTransactionWithPublicKey: 'required' });
25
26
  var bip32BaseProtocolSchema = __assign(__assign({}, baseProtocolSchema), { deriveFromExtendedPublicKey: 'required' });
26
- var bip32OfflineProtocolSchema = __assign(__assign(__assign({}, bip32BaseProtocolSchema), offlineProtocolSchema), { getExtendedKeyPairFromSecret: 'required' });
27
+ var bip32OfflineProtocolSchema = __assign(__assign(__assign({}, bip32BaseProtocolSchema), offlineProtocolSchema), { getExtendedKeyPairFromSecret: 'required', deriveFromExtendedSecretKey: 'required' });
27
28
  var bip32OnlineProtocolSchema = __assign(__assign({}, bip32BaseProtocolSchema), onlineProtocolSchema);
28
29
  var subProtocolSchema = {
29
- getType: 'required'
30
+ getType: 'required',
31
+ mainProtocol: 'required'
30
32
  };
31
33
  var singleTokenSubProtocolSchema = __assign(__assign({}, subProtocolSchema), { getContractAddress: 'required' });
32
34
  var multiTokenSubProtocolBaseSchema = singleTokenSubProtocolSchema;
@@ -70,9 +72,11 @@ var transactionStatusCheckerSchema = {
70
72
  function isOfflineProtocol(object) {
71
73
  return (0, interface_1.implementsInterface)(object, offlineProtocolSchema);
72
74
  }
75
+ exports.isOfflineProtocol = isOfflineProtocol;
73
76
  function isOnlineProtocol(object) {
74
77
  return (0, interface_1.implementsInterface)(object, onlineProtocolSchema);
75
78
  }
79
+ exports.isOnlineProtocol = isOnlineProtocol;
76
80
  function isOfflineBip32Protocol(protocol) {
77
81
  return (0, interface_1.implementsInterface)(protocol, bip32OfflineProtocolSchema);
78
82
  }
@@ -1 +1 @@
1
- {"version":3,"file":"protocol.js","sourceRoot":"","sources":["../../src/utils/protocol.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,0FAA4F;AAsC5F,yCAAyD;AAEzD,UAAU;AAEV,IAAM,kBAAkB,GAAyB;IAC/C,uBAAuB,EAAE,UAAU;IACnC,yBAAyB,EAAE,UAAU;IACrC,WAAW,EAAE,UAAU;CACxB,CAAA;AAED,IAAM,qBAAqB,yBACtB,kBAAkB,KACrB,oBAAoB,EAAE,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