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

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.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");
@@ -29765,7 +29767,7 @@ Object.defineProperty(exports, "isSubProtocol", { enumerable: true, get: functio
29765
29767
  Object.defineProperty(exports, "isTransactionStatusChecker", { enumerable: true, get: function () { return protocol_1.isTransactionStatusChecker; } });
29766
29768
  Object.defineProperty(exports, "protocolNetworkIdentifier", { enumerable: true, get: function () { return protocol_1.protocolNetworkIdentifier; } });
29767
29769
 
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){
29770
+ },{"./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
29771
  "use strict";
29770
29772
  Object.defineProperty(exports, "__esModule", { value: true });
29771
29773
  exports.ModuleNetworkRegistry = void 0;
@@ -29788,7 +29790,7 @@ var ModuleNetworkRegistry = /** @class */ (function () {
29788
29790
  }());
29789
29791
  exports.ModuleNetworkRegistry = ModuleNetworkRegistry;
29790
29792
 
29791
- },{"../utils/protocol":203}],198:[function(require,module,exports){
29793
+ },{"../utils/protocol":204}],198:[function(require,module,exports){
29792
29794
  "use strict";
29793
29795
  var __importDefault = (this && this.__importDefault) || function (mod) {
29794
29796
  return (mod && mod.__esModule) ? mod : { "default": mod };
@@ -29853,7 +29855,7 @@ function implementsInterface(object, schema) {
29853
29855
  if (typeof object !== 'object' || !object) {
29854
29856
  return false;
29855
29857
  }
29856
- return Object.keys(schema).every(function (key) { return schema[key] === 'optional' || object[key] !== undefined; });
29858
+ return Object.keys(schema).every(function (key) { return schema[key] === 'optional' || key in object; });
29857
29859
  }
29858
29860
  exports.implementsInterface = implementsInterface;
29859
29861
 
@@ -29887,13 +29889,43 @@ exports.isExtendedPublicKey = isExtendedPublicKey;
29887
29889
  },{"./interface":200}],202:[function(require,module,exports){
29888
29890
  "use strict";
29889
29891
  Object.defineProperty(exports, "__esModule", { value: true });
29892
+ exports.createSupportedProtocols = void 0;
29893
+ function createSupportedProtocols(online, offline) {
29894
+ var onlineIdentifiers = new Set(Object.keys(online));
29895
+ var offlineIdentifiers = offline ? new Set(offline) : onlineIdentifiers;
29896
+ var identifiers = new Set(Array.from(onlineIdentifiers).concat(Array.from(onlineIdentifiers)));
29897
+ return Array.from(identifiers).reduce(function (obj, next) {
29898
+ var _a;
29899
+ var offlineConfiguration = offlineIdentifiers.has(next) ? { type: 'offline' } : undefined;
29900
+ var onlineConfiguration = online[next]
29901
+ ? createOnlineProtocolConfiguration(online[next])
29902
+ : undefined;
29903
+ var configuration = offlineConfiguration !== undefined && onlineConfiguration !== undefined
29904
+ ? { type: 'full', offline: offlineConfiguration, online: onlineConfiguration }
29905
+ : (offlineConfiguration !== null && offlineConfiguration !== void 0 ? offlineConfiguration : onlineConfiguration);
29906
+ return Object.assign(obj, (_a = {}, _a[next] = configuration, _a));
29907
+ // tslint:disable-next-line: no-object-literal-type-assertion
29908
+ }, {});
29909
+ }
29910
+ exports.createSupportedProtocols = createSupportedProtocols;
29911
+ function createOnlineProtocolConfiguration(networks) {
29912
+ var _a;
29913
+ return {
29914
+ type: 'online',
29915
+ networks: (_a = networks.supportedNetworks) !== null && _a !== void 0 ? _a : networks
29916
+ };
29917
+ }
29918
+
29919
+ },{}],203:[function(require,module,exports){
29920
+ "use strict";
29921
+ Object.defineProperty(exports, "__esModule", { value: true });
29890
29922
  exports.normalizeToUndefined = void 0;
29891
29923
  function normalizeToUndefined(value) {
29892
29924
  return value !== null ? value : undefined;
29893
29925
  }
29894
29926
  exports.normalizeToUndefined = normalizeToUndefined;
29895
29927
 
29896
- },{}],203:[function(require,module,exports){
29928
+ },{}],204:[function(require,module,exports){
29897
29929
  "use strict";
29898
29930
  var __assign = (this && this.__assign) || function () {
29899
29931
  __assign = Object.assign || function(t) {
@@ -29908,6 +29940,7 @@ var __assign = (this && this.__assign) || function () {
29908
29940
  };
29909
29941
  Object.defineProperty(exports, "__esModule", { value: true });
29910
29942
  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;
29943
+ // @ts-ignore
29911
29944
  var createHash = require("@airgap/coinlib-core/dependencies/src/create-hash-1.2.0/index");
29912
29945
  var interface_1 = require("./interface");
29913
29946
  // Schemas
@@ -29922,7 +29955,8 @@ var bip32BaseProtocolSchema = __assign(__assign({}, baseProtocolSchema), { deriv
29922
29955
  var bip32OfflineProtocolSchema = __assign(__assign(__assign({}, bip32BaseProtocolSchema), offlineProtocolSchema), { getExtendedKeyPairFromSecret: 'required' });
29923
29956
  var bip32OnlineProtocolSchema = __assign(__assign({}, bip32BaseProtocolSchema), onlineProtocolSchema);
29924
29957
  var subProtocolSchema = {
29925
- getType: 'required'
29958
+ getType: 'required',
29959
+ mainProtocol: 'required'
29926
29960
  };
29927
29961
  var singleTokenSubProtocolSchema = __assign(__assign({}, subProtocolSchema), { getContractAddress: 'required' });
29928
29962
  var multiTokenSubProtocolBaseSchema = singleTokenSubProtocolSchema;
@@ -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
45
  import { canEncryptAES, canEncryptAsymmetric, canFetchDataForMultipleAddresses, canSignMessage, hasConfigurableContract, hasConfigurableTransactionInjector, hasMultiAddressPublicKeys, isBip32Protocol, isMultiTokenSubProtocol, 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, 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.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");
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;AAnIb,+CAAwD;AAoJtD,qGApJO,gCAAoB,OAoJP;AAnJtB,6CAcyB;AA+HvB,8FA5IA,wBAAa,OA4IA;AACb,qGA5IA,+BAAoB,OA4IA;AAJpB,iHAvIA,2CAAgC,OAuIA;AAKhC,+FA3IA,yBAAc,OA2IA;AAHd,wGAvIA,kCAAuB,OA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JP;AA3JtB,6CAcyB;AAuIvB,8FApJA,wBAAa,OAoJA;AACb,qGApJA,+BAAoB,OAoJA;AAJpB,iHA/IA,2CAAgC,OA+IA;AAKhC,+FAnJA,yBAAc,OAmJA;AAHd,wGA/IA,kCAAuB,OA+IA;AAIvB,mHAlJA,6CAAkC,OAkJA;AALlC,0GA5IA,oCAAyB,OA4IA;AALzB,gGAtIA,0BAAe,OAsIA;AAGf,wGAxIA,kCAAuB,OAwIA;AADvB,yGAtIA,mCAAwB,OAsIA;AADxB,8FApIA,wBAAa,OAoIA;AAUb,2GA7IA,qCAA0B,OA6IA;AAC1B,0GA7IA,oCAAyB,OA6IA"}
@@ -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.4",
4
4
  "description": "TODO",
5
5
  "keywords": [
6
6
  "airgap",
@@ -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":""}
@@ -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,CAA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object.defineProperty(exports, "__esModule", { value: true });
14
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;
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
@@ -26,7 +27,8 @@ var bip32BaseProtocolSchema = __assign(__assign({}, baseProtocolSchema), { deriv
26
27
  var bip32OfflineProtocolSchema = __assign(__assign(__assign({}, bip32BaseProtocolSchema), offlineProtocolSchema), { getExtendedKeyPairFromSecret: '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;
@@ -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,UAAU,EAChC,4BAA4B,EAAE,UAAU,GACzC,CAAA;AAED,IAAM,oBAAoB,yBACrB,kBAAkB,KACrB,oBAAoB,EA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