@airgap/module-kit 0.13.45-beta.1 → 0.13.45-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/block-explorer/block-explorer.d.ts +1 -1
  2. package/factories/amount.js +4 -5
  3. package/factories/amount.js.map +1 -1
  4. package/factories/key.js +12 -17
  5. package/factories/key.js.map +1 -1
  6. package/factories/signature.js +3 -5
  7. package/factories/signature.js.map +1 -1
  8. package/factories/transaction.js +4 -16
  9. package/factories/transaction.js.map +1 -1
  10. package/factories/ui/alert.js +8 -20
  11. package/factories/ui/alert.js.map +1 -1
  12. package/factories/ui/text.js +1 -2
  13. package/factories/ui/text.js.map +1 -1
  14. package/index.js +13 -13
  15. package/index.js.map +1 -1
  16. package/internal/index.js +1 -1
  17. package/internal/index.js.map +1 -1
  18. package/internal/utils/protocol.js +3 -3
  19. package/internal/utils/protocol.js.map +1 -1
  20. package/module/extensions/extensions.d.ts +1 -1
  21. package/module/extensions/serialization/ProtocolSerializer.d.ts +2 -2
  22. package/module/module-network-registry.js +10 -13
  23. package/module/module-network-registry.js.map +1 -1
  24. package/module/module.d.ts +4 -4
  25. package/package.json +3 -3
  26. package/protocol/extensions/address/FetchDataForAddressExtension.d.ts +1 -1
  27. package/protocol/extensions/address/FetchDataForMultipleAddressesExtension.d.ts +1 -1
  28. package/protocol/extensions/address/MultiAddressPublicKeyExtension.d.ts +1 -1
  29. package/protocol/extensions/bip/Bip32Extension.d.ts +3 -3
  30. package/protocol/extensions/contract/ConfigurableContractExtension.d.ts +1 -1
  31. package/protocol/extensions/crypto/AESExtension.d.ts +1 -1
  32. package/protocol/extensions/crypto/AsymmetricEncryptionExtension.d.ts +1 -1
  33. package/protocol/extensions/crypto/CryptoExtension.d.ts +1 -1
  34. package/protocol/extensions/crypto/SignMessageExtension.d.ts +1 -1
  35. package/protocol/extensions/dapp/WalletConnectProtocol.d.ts +1 -1
  36. package/protocol/extensions/extensions.d.ts +1 -1
  37. package/protocol/extensions/multisig/multisig.d.ts +1 -1
  38. package/protocol/extensions/sub-protocol/GetTokenBalancesExtension.d.ts +2 -2
  39. package/protocol/extensions/sub-protocol/MultiTokenSubProtocolExtension.d.ts +1 -1
  40. package/protocol/extensions/sub-protocol/SingleTokenSubProtocolExtension.d.ts +1 -1
  41. package/protocol/extensions/sub-protocol/SubProtocolExtension.d.ts +1 -1
  42. package/protocol/extensions/transaction/ConfigurableTransactionInjectorExtension.d.ts +1 -1
  43. package/protocol/extensions/transaction/TransactionStatusCheckerExtension.d.ts +1 -1
  44. package/protocol/protocol.d.ts +20 -20
  45. package/types/address.d.ts +1 -1
  46. package/types/airgap.d.ts +7 -7
  47. package/types/amount.js +18 -23
  48. package/types/amount.js.map +1 -1
  49. package/types/bytes.d.ts +1 -1
  50. package/types/crypto.d.ts +3 -3
  51. package/types/fee.d.ts +1 -1
  52. package/types/key.d.ts +3 -3
  53. package/types/meta/utility-types.d.ts +6 -6
  54. package/types/module.d.ts +1 -1
  55. package/types/protocol.d.ts +2 -2
  56. package/types/sub-protocol.d.ts +1 -1
  57. package/types/transaction.d.ts +2 -2
  58. package/types/ui/text.d.ts +2 -2
  59. package/utils/amount.js +3 -4
  60. package/utils/amount.js.map +1 -1
  61. package/utils/interface.d.ts +1 -1
  62. package/utils/interface.js +2 -3
  63. package/utils/interface.js.map +1 -1
  64. package/utils/key.d.ts +1 -1
  65. package/utils/key.js +6 -7
  66. package/utils/key.js.map +1 -1
  67. package/utils/module.js +14 -16
  68. package/utils/module.js.map +1 -1
  69. package/utils/normalize.js +1 -2
  70. package/utils/normalize.js.map +1 -1
  71. package/utils/protocol.js +81 -55
  72. package/utils/protocol.js.map +1 -1
@@ -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 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,6 @@
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 type SubProtocolExtension<_T extends _AnyProtocol> = SubProtocol;
4
4
  export interface SubProtocol {
5
5
  getType(): Promise<SubProtocolType>;
6
6
  mainProtocol(): Promise<string>;
@@ -1,5 +1,5 @@
1
1
  import { _OnlineProtocol } from '../../protocol';
2
- export declare type ConfigurableTransactionInjectorExtension<_T extends _OnlineProtocol> = ConfigurableTransactionInjectorProtocol;
2
+ export 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 type TransactionStatusCheckerExtension<_T extends _OnlineProtocol> = TransactionStatusChecker;
4
4
  export interface TransactionStatusChecker {
5
5
  getTransactionStatus(transactionIds: string[]): Promise<Record<string, AirGapTransactionStatus>>;
6
6
  }
@@ -24,28 +24,28 @@ export interface OnlineGeneric<_AddressCursor extends AddressCursor = AddressCur
24
24
  FeeEstimation: _FeeEstimation;
25
25
  TransactionCursor: _TransactionCursor;
26
26
  }
27
- declare type TypedAddressCursor<G extends Partial<BaseGeneric>> = Complement<BaseGeneric, G>['AddressCursor'];
28
- declare type TypedAddressResult<G extends Partial<BaseGeneric>> = Complement<BaseGeneric<TypedAddressCursor<G>>, G>['AddressResult'];
29
- declare type TypedProtocolNetwork<G extends Partial<OnlineGeneric>> = Complement<OnlineGeneric, G>['ProtocolNetwork'];
30
- declare type TypedCryptoConfiguration<G extends Partial<OfflineGeneric>> = Complement<OfflineGeneric, G>['CryptoConfiguration'];
31
- declare type TypedUnits<G extends Partial<BaseGeneric>> = Complement<BaseGeneric, G>['Units'];
32
- declare type TypedFeeUnits<G extends Partial<BaseGeneric>> = Complement<BaseGeneric<any, any, TypedUnits<G>>, G>['FeeUnits'];
33
- declare type TypedFeeEstimation<G extends Partial<OnlineGeneric>> = Complement<OnlineGeneric<any, any, any, any, TypedFeeUnits<G>>, G>['FeeEstimation'];
34
- declare type TypedSignedTransaction<G extends Partial<BaseGeneric>> = Complement<BaseGeneric, G>['SignedTransaction'];
35
- declare type TypedUnsignedTransaction<G extends Partial<BaseGeneric>> = Complement<BaseGeneric, G>['UnsignedTransaction'];
36
- declare type TypedTransactionCursor<G extends Partial<OnlineGeneric>> = Complement<OnlineGeneric, G>['TransactionCursor'];
27
+ type TypedAddressCursor<G extends Partial<BaseGeneric>> = Complement<BaseGeneric, G>['AddressCursor'];
28
+ type TypedAddressResult<G extends Partial<BaseGeneric>> = Complement<BaseGeneric<TypedAddressCursor<G>>, G>['AddressResult'];
29
+ type TypedProtocolNetwork<G extends Partial<OnlineGeneric>> = Complement<OnlineGeneric, G>['ProtocolNetwork'];
30
+ type TypedCryptoConfiguration<G extends Partial<OfflineGeneric>> = Complement<OfflineGeneric, G>['CryptoConfiguration'];
31
+ type TypedUnits<G extends Partial<BaseGeneric>> = Complement<BaseGeneric, G>['Units'];
32
+ type TypedFeeUnits<G extends Partial<BaseGeneric>> = Complement<BaseGeneric<any, any, TypedUnits<G>>, G>['FeeUnits'];
33
+ type TypedFeeEstimation<G extends Partial<OnlineGeneric>> = Complement<OnlineGeneric<any, any, any, any, TypedFeeUnits<G>>, G>['FeeEstimation'];
34
+ type TypedSignedTransaction<G extends Partial<BaseGeneric>> = Complement<BaseGeneric, G>['SignedTransaction'];
35
+ type TypedUnsignedTransaction<G extends Partial<BaseGeneric>> = Complement<BaseGeneric, G>['UnsignedTransaction'];
36
+ type TypedTransactionCursor<G extends Partial<OnlineGeneric>> = Complement<OnlineGeneric, G>['TransactionCursor'];
37
37
  export interface _BaseProtocol<_AddressCursor extends BaseGeneric['AddressCursor'] = any, _AddressResult extends BaseGeneric['AddressResult'] = any, _Units extends BaseGeneric['Units'] = any, _FeeUnits extends BaseGeneric['FeeUnits'] = any, _SignedTransaction extends BaseGeneric['SignedTransaction'] = any, _UnsignedTransaction extends BaseGeneric['UnsignedTransaction'] = any, _PublicKey extends PublicKey | ExtendedPublicKey = any> {
38
38
  getMetadata(): Promise<ProtocolMetadata<_Units, _FeeUnits>>;
39
39
  getAddressFromPublicKey(publicKey: _PublicKey): Promise<_AddressResult>;
40
40
  getDetailsFromTransaction(transaction: _UnsignedTransaction | _SignedTransaction, publicKey: _PublicKey): Promise<AirGapTransaction<_Units, _FeeUnits>[]>;
41
41
  }
42
- export declare type BaseProtocol<G extends Partial<BaseGeneric> = {}> = _BaseProtocol<TypedAddressCursor<G>, TypedAddressResult<G>, TypedUnits<G>, TypedFeeUnits<G>, TypedSignedTransaction<G>, TypedUnsignedTransaction<G>, PublicKey>;
42
+ export type BaseProtocol<G extends Partial<BaseGeneric> = {}> = _BaseProtocol<TypedAddressCursor<G>, TypedAddressResult<G>, TypedUnits<G>, TypedFeeUnits<G>, TypedSignedTransaction<G>, TypedUnsignedTransaction<G>, PublicKey>;
43
43
  export interface _OfflineProtocol<_AddressCursor extends OfflineGeneric['AddressCursor'] = any, _AddressResult extends OfflineGeneric['AddressResult'] = any, _CryptoConfiguration extends OfflineGeneric['CryptoConfiguration'] = any, _Units extends BaseGeneric['Units'] = any, _FeeUnits extends BaseGeneric['FeeUnits'] = any, _SignedTransaction extends BaseGeneric['SignedTransaction'] = any, _UnsignedTransaction extends BaseGeneric['UnsignedTransaction'] = any, _PublicKey extends PublicKey | ExtendedPublicKey = any, _SecretKey extends SecretKey | ExtendedSecretKey = any, _KeyPair extends KeyPair | ExtendedKeyPair = any> extends _BaseProtocol<_AddressCursor, _AddressResult, _Units, _FeeUnits, _SignedTransaction, _UnsignedTransaction, _PublicKey> {
44
44
  getCryptoConfiguration(): Promise<_CryptoConfiguration>;
45
45
  getKeyPairFromDerivative(derivative: CryptoDerivative): Promise<KeyPair>;
46
46
  signTransactionWithSecretKey(transaction: _UnsignedTransaction, secretKey: _SecretKey): Promise<_SignedTransaction>;
47
47
  }
48
- export declare type OfflineProtocol<G extends Partial<OfflineGeneric> = {}> = _OfflineProtocol<TypedAddressCursor<G>, TypedAddressResult<G>, TypedCryptoConfiguration<G>, TypedUnits<G>, TypedFeeUnits<G>, TypedSignedTransaction<G>, TypedUnsignedTransaction<G>, PublicKey, SecretKey, KeyPair>;
48
+ export type OfflineProtocol<G extends Partial<OfflineGeneric> = {}> = _OfflineProtocol<TypedAddressCursor<G>, TypedAddressResult<G>, TypedCryptoConfiguration<G>, TypedUnits<G>, TypedFeeUnits<G>, TypedSignedTransaction<G>, TypedUnsignedTransaction<G>, PublicKey, SecretKey, KeyPair>;
49
49
  export interface _OnlineProtocol<_AddressCursor extends OnlineGeneric['AddressCursor'] = any, _AddressResult extends OnlineGeneric['AddressResult'] = any, _ProtocolNetwork extends OnlineGeneric['ProtocolNetwork'] = any, _Units extends OnlineGeneric['Units'] = any, _FeeUnits extends OnlineGeneric['FeeUnits'] = any, _FeeEstimation extends OnlineGeneric['FeeEstimation'] = any, _SignedTransaction extends OnlineGeneric['SignedTransaction'] = any, _UnsignedTransaction extends OnlineGeneric['UnsignedTransaction'] = any, _TransactionCursor extends OnlineGeneric['TransactionCursor'] = any, _PublicKey extends PublicKey | ExtendedPublicKey = any, _BalanceConfiguration extends Object | undefined = any> extends _BaseProtocol<_AddressCursor, _AddressResult, _Units, _FeeUnits, _SignedTransaction, _UnsignedTransaction, _PublicKey> {
50
50
  getNetwork(): Promise<_ProtocolNetwork>;
51
51
  getTransactionsForPublicKey(publicKey: _PublicKey, limit: number, cursor?: _TransactionCursor): Promise<AirGapTransactionsWithCursor<_TransactionCursor, _Units, _FeeUnits>>;
@@ -55,14 +55,14 @@ export interface _OnlineProtocol<_AddressCursor extends OnlineGeneric['AddressCu
55
55
  prepareTransactionWithPublicKey(publicKey: _PublicKey, details: TransactionDetails<_Units>[], configuration?: TransactionFullConfiguration<_FeeUnits>): Promise<_UnsignedTransaction>;
56
56
  broadcastTransaction(transaction: _SignedTransaction): Promise<string>;
57
57
  }
58
- export declare type OnlineProtocol<G extends Partial<OnlineGeneric> = {}> = _OnlineProtocol<TypedAddressCursor<G>, TypedAddressResult<G>, TypedProtocolNetwork<G>, TypedUnits<G>, TypedFeeUnits<G>, TypedFeeEstimation<G>, TypedSignedTransaction<G>, TypedUnsignedTransaction<G>, TypedTransactionCursor<G>, PublicKey, undefined>;
59
- export declare type _Protocol = _OfflineProtocol & _OnlineProtocol;
58
+ export type OnlineProtocol<G extends Partial<OnlineGeneric> = {}> = _OnlineProtocol<TypedAddressCursor<G>, TypedAddressResult<G>, TypedProtocolNetwork<G>, TypedUnits<G>, TypedFeeUnits<G>, TypedFeeEstimation<G>, TypedSignedTransaction<G>, TypedUnsignedTransaction<G>, TypedTransactionCursor<G>, PublicKey, undefined>;
59
+ export type _Protocol = _OfflineProtocol & _OnlineProtocol;
60
60
  export interface Protocol<G extends Partial<OfflineGeneric & OnlineGeneric> = {}> extends OfflineProtocol<G>, OnlineProtocol<G> {
61
61
  }
62
- export declare type _AnyProtocol = _OfflineProtocol | _OnlineProtocol;
63
- export declare type AnyProtocol<G extends Partial<OfflineGeneric & OnlineGeneric> = {}> = OfflineProtocol<G> | OnlineProtocol<G>;
64
- export declare type AirGapOfflineProtocol<G extends Partial<OfflineGeneric> = {}, E0 extends ApplicableProtocolExtension<_OfflineProtocol> = undefined, E1 extends ApplicableProtocolExtension<_OfflineProtocol> = undefined, E2 extends ApplicableProtocolExtension<_OfflineProtocol> = undefined, E3 extends ApplicableProtocolExtension<_OfflineProtocol> = undefined, E4 extends ApplicableProtocolExtension<_OfflineProtocol> = undefined, E5 extends ApplicableProtocolExtension<_OfflineProtocol> = undefined, E6 extends ApplicableProtocolExtension<_OfflineProtocol> = undefined, E7 extends ApplicableProtocolExtension<_OfflineProtocol> = undefined, E8 extends ApplicableProtocolExtension<_OfflineProtocol> = undefined, E9 extends ApplicableProtocolExtension<_OfflineProtocol> = undefined> = AirGapInterface<OfflineProtocol<G>, E0, E1, E2, E3, E4, E5, E6, E7, E8, E9>;
65
- export declare type AirGapOnlineProtocol<G extends Partial<OnlineGeneric> = {}, E0 extends ApplicableProtocolExtension<_OnlineProtocol> = undefined, E1 extends ApplicableProtocolExtension<_OnlineProtocol> = undefined, E2 extends ApplicableProtocolExtension<_OnlineProtocol> = undefined, E3 extends ApplicableProtocolExtension<_OnlineProtocol> = undefined, E4 extends ApplicableProtocolExtension<_OnlineProtocol> = undefined, E5 extends ApplicableProtocolExtension<_OnlineProtocol> = undefined, E6 extends ApplicableProtocolExtension<_OnlineProtocol> = undefined, E7 extends ApplicableProtocolExtension<_OnlineProtocol> = undefined, E8 extends ApplicableProtocolExtension<_OnlineProtocol> = undefined, E9 extends ApplicableProtocolExtension<_OnlineProtocol> = undefined> = AirGapInterface<OnlineProtocol<G>, E0, E1, E2, E3, E4, E5, E6, E7, E8, E9>;
66
- export declare type AirGapProtocol<G extends Partial<OfflineGeneric & OnlineGeneric> = {}, E0 extends ApplicableProtocolExtension<_OfflineProtocol & _OnlineProtocol> = undefined, E1 extends ApplicableProtocolExtension<_OfflineProtocol & _OnlineProtocol> = undefined, E2 extends ApplicableProtocolExtension<_OfflineProtocol & _OnlineProtocol> = undefined, E3 extends ApplicableProtocolExtension<_OfflineProtocol & _OnlineProtocol> = undefined, E4 extends ApplicableProtocolExtension<_OfflineProtocol & _OnlineProtocol> = undefined, E5 extends ApplicableProtocolExtension<_OfflineProtocol & _OnlineProtocol> = undefined, E6 extends ApplicableProtocolExtension<_OfflineProtocol & _OnlineProtocol> = undefined, E7 extends ApplicableProtocolExtension<_OfflineProtocol & _OnlineProtocol> = undefined, E8 extends ApplicableProtocolExtension<_OfflineProtocol & _OnlineProtocol> = undefined, E9 extends ApplicableProtocolExtension<_OfflineProtocol & _OnlineProtocol> = undefined> = AirGapInterface<Protocol<G>, E0, E1, E2, E3, E4, E5, E6, E7, E8, E9>;
67
- export declare type AirGapAnyProtocol<G extends Partial<OfflineGeneric & OnlineGeneric> = {}, E0 extends ApplicableProtocolExtension<_OfflineProtocol | _OnlineProtocol> = undefined, E1 extends ApplicableProtocolExtension<_OfflineProtocol | _OnlineProtocol> = undefined, E2 extends ApplicableProtocolExtension<_OfflineProtocol | _OnlineProtocol> = undefined, E3 extends ApplicableProtocolExtension<_OfflineProtocol | _OnlineProtocol> = undefined, E4 extends ApplicableProtocolExtension<_OfflineProtocol | _OnlineProtocol> = undefined, E5 extends ApplicableProtocolExtension<_OfflineProtocol | _OnlineProtocol> = undefined, E6 extends ApplicableProtocolExtension<_OfflineProtocol | _OnlineProtocol> = undefined, E7 extends ApplicableProtocolExtension<_OfflineProtocol | _OnlineProtocol> = undefined, E8 extends ApplicableProtocolExtension<_OfflineProtocol | _OnlineProtocol> = undefined, E9 extends ApplicableProtocolExtension<_OfflineProtocol | _OnlineProtocol> = undefined> = AirGapInterface<AnyProtocol<G>, E0, E1, E2, E3, E4, E5, E6, E7, E8, E9>;
62
+ export type _AnyProtocol = _OfflineProtocol | _OnlineProtocol;
63
+ export type AnyProtocol<G extends Partial<OfflineGeneric & OnlineGeneric> = {}> = OfflineProtocol<G> | OnlineProtocol<G>;
64
+ export type AirGapOfflineProtocol<G extends Partial<OfflineGeneric> = {}, E0 extends ApplicableProtocolExtension<_OfflineProtocol> = undefined, E1 extends ApplicableProtocolExtension<_OfflineProtocol> = undefined, E2 extends ApplicableProtocolExtension<_OfflineProtocol> = undefined, E3 extends ApplicableProtocolExtension<_OfflineProtocol> = undefined, E4 extends ApplicableProtocolExtension<_OfflineProtocol> = undefined, E5 extends ApplicableProtocolExtension<_OfflineProtocol> = undefined, E6 extends ApplicableProtocolExtension<_OfflineProtocol> = undefined, E7 extends ApplicableProtocolExtension<_OfflineProtocol> = undefined, E8 extends ApplicableProtocolExtension<_OfflineProtocol> = undefined, E9 extends ApplicableProtocolExtension<_OfflineProtocol> = undefined> = AirGapInterface<OfflineProtocol<G>, E0, E1, E2, E3, E4, E5, E6, E7, E8, E9>;
65
+ export type AirGapOnlineProtocol<G extends Partial<OnlineGeneric> = {}, E0 extends ApplicableProtocolExtension<_OnlineProtocol> = undefined, E1 extends ApplicableProtocolExtension<_OnlineProtocol> = undefined, E2 extends ApplicableProtocolExtension<_OnlineProtocol> = undefined, E3 extends ApplicableProtocolExtension<_OnlineProtocol> = undefined, E4 extends ApplicableProtocolExtension<_OnlineProtocol> = undefined, E5 extends ApplicableProtocolExtension<_OnlineProtocol> = undefined, E6 extends ApplicableProtocolExtension<_OnlineProtocol> = undefined, E7 extends ApplicableProtocolExtension<_OnlineProtocol> = undefined, E8 extends ApplicableProtocolExtension<_OnlineProtocol> = undefined, E9 extends ApplicableProtocolExtension<_OnlineProtocol> = undefined> = AirGapInterface<OnlineProtocol<G>, E0, E1, E2, E3, E4, E5, E6, E7, E8, E9>;
66
+ export type AirGapProtocol<G extends Partial<OfflineGeneric & OnlineGeneric> = {}, E0 extends ApplicableProtocolExtension<_OfflineProtocol & _OnlineProtocol> = undefined, E1 extends ApplicableProtocolExtension<_OfflineProtocol & _OnlineProtocol> = undefined, E2 extends ApplicableProtocolExtension<_OfflineProtocol & _OnlineProtocol> = undefined, E3 extends ApplicableProtocolExtension<_OfflineProtocol & _OnlineProtocol> = undefined, E4 extends ApplicableProtocolExtension<_OfflineProtocol & _OnlineProtocol> = undefined, E5 extends ApplicableProtocolExtension<_OfflineProtocol & _OnlineProtocol> = undefined, E6 extends ApplicableProtocolExtension<_OfflineProtocol & _OnlineProtocol> = undefined, E7 extends ApplicableProtocolExtension<_OfflineProtocol & _OnlineProtocol> = undefined, E8 extends ApplicableProtocolExtension<_OfflineProtocol & _OnlineProtocol> = undefined, E9 extends ApplicableProtocolExtension<_OfflineProtocol & _OnlineProtocol> = undefined> = AirGapInterface<Protocol<G>, E0, E1, E2, E3, E4, E5, E6, E7, E8, E9>;
67
+ export type AirGapAnyProtocol<G extends Partial<OfflineGeneric & OnlineGeneric> = {}, E0 extends ApplicableProtocolExtension<_OfflineProtocol | _OnlineProtocol> = undefined, E1 extends ApplicableProtocolExtension<_OfflineProtocol | _OnlineProtocol> = undefined, E2 extends ApplicableProtocolExtension<_OfflineProtocol | _OnlineProtocol> = undefined, E3 extends ApplicableProtocolExtension<_OfflineProtocol | _OnlineProtocol> = undefined, E4 extends ApplicableProtocolExtension<_OfflineProtocol | _OnlineProtocol> = undefined, E5 extends ApplicableProtocolExtension<_OfflineProtocol | _OnlineProtocol> = undefined, E6 extends ApplicableProtocolExtension<_OfflineProtocol | _OnlineProtocol> = undefined, E7 extends ApplicableProtocolExtension<_OfflineProtocol | _OnlineProtocol> = undefined, E8 extends ApplicableProtocolExtension<_OfflineProtocol | _OnlineProtocol> = undefined, E9 extends ApplicableProtocolExtension<_OfflineProtocol | _OnlineProtocol> = undefined> = AirGapInterface<AnyProtocol<G>, E0, E1, E2, E3, E4, E5, E6, E7, E8, E9>;
68
68
  export {};
@@ -1,5 +1,5 @@
1
1
  import { BaseCursor } from './base/cursor';
2
- export declare type Address = string;
2
+ export type Address = string;
3
3
  export interface AddressCursor extends BaseCursor {
4
4
  }
5
5
  export interface AddressWithCursor<_Cursor extends AddressCursor = AddressCursor> {
package/types/airgap.d.ts CHANGED
@@ -5,11 +5,11 @@ 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, 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
- export declare type ApplicableExtension<T> = keyof AirGapExtensions<T> | undefined;
11
- export declare type ApplicableBlockExplorerExtension<T> = keyof BlockExplorerExtensions<T> | undefined;
12
- export declare type ApplicableModuleExtension<T> = keyof ModuleExtensions<T> | undefined;
13
- export declare type ApplicableProtocolExtension<T> = keyof ProtocolExtensions<T> | undefined;
14
- declare type AirGapExtensions<T> = T extends BlockExplorer ? BlockExplorerExtensions<T> : T extends Module ? ModuleExtensions<T> : T extends _AnyProtocol ? ProtocolExtensions<T> : never;
8
+ export 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
+ 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
+ export type ApplicableExtension<T> = keyof AirGapExtensions<T> | undefined;
11
+ export type ApplicableBlockExplorerExtension<T> = keyof BlockExplorerExtensions<T> | undefined;
12
+ export type ApplicableModuleExtension<T> = keyof ModuleExtensions<T> | undefined;
13
+ export type ApplicableProtocolExtension<T> = keyof ProtocolExtensions<T> | undefined;
14
+ type AirGapExtensions<T> = T extends BlockExplorer ? BlockExplorerExtensions<T> : T extends Module ? ModuleExtensions<T> : T extends _AnyProtocol ? ProtocolExtensions<T> : never;
15
15
  export {};
package/types/amount.js CHANGED
@@ -4,43 +4,38 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.AmountEnhanced = void 0;
7
- var bignumber_1 = __importDefault(require("@airgap/coinlib-core/dependencies/src/bignumber.js-9.0.0/bignumber"));
8
- var AmountEnhanced = /** @class */ (function () {
9
- function AmountEnhanced(value, unit) {
7
+ const bignumber_1 = __importDefault(require("@airgap/coinlib-core/dependencies/src/bignumber.js-9.0.0/bignumber"));
8
+ class AmountEnhanced {
9
+ get value() {
10
+ return this.bnValue.toString(10);
11
+ }
12
+ constructor(value, unit) {
10
13
  this.unit = unit;
11
14
  this.bnValue = new bignumber_1.default(value);
12
15
  }
13
- Object.defineProperty(AmountEnhanced.prototype, "value", {
14
- get: function () {
15
- return this.bnValue.toString(10);
16
- },
17
- enumerable: false,
18
- configurable: true
19
- });
20
- AmountEnhanced.prototype.convert = function (unit, unitsMetadata) {
21
- var blockchainAmount = this.blockchain(unitsMetadata);
22
- var unitValue = blockchainAmount.bnValue.shiftedBy(-unitsMetadata[unit].decimals);
16
+ convert(unit, unitsMetadata) {
17
+ const blockchainAmount = this.blockchain(unitsMetadata);
18
+ const unitValue = blockchainAmount.bnValue.shiftedBy(-unitsMetadata[unit].decimals);
23
19
  return new AmountEnhanced(unitValue, unit);
24
- };
25
- AmountEnhanced.prototype.blockchain = function (unitsMetadata) {
20
+ }
21
+ blockchain(unitsMetadata) {
26
22
  if (this.unit === 'blockchain') {
27
23
  return new AmountEnhanced(this.bnValue, this.unit);
28
24
  }
29
- var blockchainValue = this.bnValue.shiftedBy(unitsMetadata[this.unit].decimals);
25
+ const blockchainValue = this.bnValue.shiftedBy(unitsMetadata[this.unit].decimals);
30
26
  return new AmountEnhanced(blockchainValue, 'blockchain');
31
- };
27
+ }
32
28
  // Different representations
33
- AmountEnhanced.prototype.toBigNumber = function () {
29
+ toBigNumber() {
34
30
  return new bignumber_1.default(this.value);
35
- };
31
+ }
36
32
  // Serialization
37
- AmountEnhanced.prototype.toJSON = function () {
33
+ toJSON() {
38
34
  return {
39
35
  value: this.value,
40
36
  unit: this.unit
41
37
  };
42
- };
43
- return AmountEnhanced;
44
- }());
38
+ }
39
+ }
45
40
  exports.AmountEnhanced = AmountEnhanced;
46
41
  //# sourceMappingURL=amount.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"amount.js","sourceRoot":"","sources":["../../src/types/amount.ts"],"names":[],"mappings":";;;;;;AAAA,iHAA0F;AAS1F;IAOE,wBAAmB,KAAkC,EAAkB,IAA4B;QAA5B,SAAI,GAAJ,IAAI,CAAwB;QACjG,IAAI,CAAC,OAAO,GAAG,IAAI,mBAAS,CAAC,KAAK,CAAC,CAAA;IACrC,CAAC;IARD,sBAAW,iCAAK;aAAhB;YACE,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAA;QAClC,CAAC;;;OAAA;IAQM,gCAAO,GAAd,UAAe,IAAY,EAAE,aAA4C;QACvE,IAAM,gBAAgB,GAA2B,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,CAAA;QAC/E,IAAM,SAAS,GAAc,gBAAgB,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAA;QAE9F,OAAO,IAAI,cAAc,CAAS,SAAS,EAAE,IAAI,CAAC,CAAA;IACpD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QAAQ,CAAC,CAAA;QAE9F,OAAO,IAAI,cAAc,CAAS,SAAS,EAAE,IAAI,CAAC,CAAA;IACpD,CAAC;IAEM,UAAU,CAAC,aAA4C;QAC5D,IAAI,IAAI,CAAC,IAAI,KAAK,YAAY,EAAE,CAAC;YAC/B,OAAO,IAAI,cAAc,CAAS,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,CAAA;QAC5D,CAAC;QAED,MAAM,eAAe,GAAc,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAA;QAE5F,OAAO,IAAI,cAAc,CAAS,eAAe,EAAE,YAAY,CAAC,CAAA;IAClE,CAAC;IAED,4BAA4B;IAErB,WAAW;QAChB,OAAO,IAAI,mBAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IAClC,CAAC;IAED,gBAAgB;IAET,MAAM;QACX,OAAO;YACL,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,IAAI,EAAE,IAAI,CAAC,IAAI;SAChB,CAAA;IACH,CAAC;CACF;AA1CD,wCA0CC"}
package/types/bytes.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export declare type BytesStringFormat = 'hex' | 'encoded';
1
+ export type BytesStringFormat = 'hex' | 'encoded';
2
2
  export interface BytesString {
3
3
  format: BytesStringFormat;
4
4
  value: string;
package/types/crypto.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- export declare type CryptoAlgorithm = 'ed25519' | 'sr25519' | 'secp256k1' | /* | 'secp256r1' */ 'sapling';
2
- export declare type CryptoSecretType = 'secret' | 'miniSecretXor';
1
+ export type CryptoAlgorithm = 'ed25519' | 'sr25519' | 'secp256k1' | /* | 'secp256r1' */ 'sapling';
2
+ export type CryptoSecretType = 'secret' | 'miniSecretXor';
3
3
  interface BaseCryptoConfiguration<_Algorithm extends CryptoAlgorithm> {
4
4
  algorithm: _Algorithm;
5
5
  }
@@ -17,7 +17,7 @@ export interface Secp256K1CryptoConfiguration<_SecretType extends CryptoSecretTy
17
17
  export interface SaplingCryptoConfiguration<_SecretType extends CryptoSecretType = CryptoSecretType> extends BaseCryptoConfiguration<'sapling'> {
18
18
  secretType?: _SecretType;
19
19
  }
20
- export declare type CryptoConfiguration = Ed25519CryptoConfiguration | Sr25519CryptoConfiguration | Secp256K1CryptoConfiguration | SaplingCryptoConfiguration;
20
+ export type CryptoConfiguration = Ed25519CryptoConfiguration | Sr25519CryptoConfiguration | Secp256K1CryptoConfiguration | SaplingCryptoConfiguration;
21
21
  export interface CryptoDerivative {
22
22
  depth: number;
23
23
  parentFingerprint: number;
package/types/fee.d.ts CHANGED
@@ -4,4 +4,4 @@ export interface FeeDefaults<_Units extends string = string> {
4
4
  medium: Amount<_Units>;
5
5
  high: Amount<_Units>;
6
6
  }
7
- export declare type FeeEstimation<_Units extends string = string> = FeeDefaults<_Units> | Amount<_Units>;
7
+ export type FeeEstimation<_Units extends string = string> = FeeDefaults<_Units> | Amount<_Units>;
package/types/key.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Sealed } from './base/sealed';
2
2
  import { BytesString } from './bytes';
3
- export declare type KeyType = 'priv' | 'xpriv' | 'pub' | 'xpub';
3
+ export type KeyType = 'priv' | 'xpriv' | 'pub' | 'xpub';
4
4
  interface BaseKey<_Type extends KeyType> extends Sealed<_Type>, BytesString {
5
5
  }
6
6
  export interface SecretKey extends BaseKey<'priv'> {
@@ -15,6 +15,6 @@ interface BaseKeyPair<_SecretKey extends SecretKey | ExtendedSecretKey, _PublicK
15
15
  secretKey: _SecretKey;
16
16
  publicKey: _PublicKey;
17
17
  }
18
- export declare type KeyPair = BaseKeyPair<SecretKey, PublicKey>;
19
- export declare type ExtendedKeyPair = BaseKeyPair<ExtendedSecretKey, ExtendedPublicKey>;
18
+ export type KeyPair = BaseKeyPair<SecretKey, PublicKey>;
19
+ export type ExtendedKeyPair = BaseKeyPair<ExtendedSecretKey, ExtendedPublicKey>;
20
20
  export {};
@@ -1,8 +1,8 @@
1
- export declare type Complement<T, P extends Partial<T>> = Required<Omit<T, keyof P> & P>;
2
- export declare type RecursivePartial<T> = {
1
+ export type Complement<T, P extends Partial<T>> = Required<Omit<T, keyof P> & P>;
2
+ export type RecursivePartial<T> = {
3
3
  [K in keyof T]?: T[K] extends (infer U)[] ? RecursivePartial<U>[] : T[K] extends object ? RecursivePartial<T[K]> : T[K];
4
4
  };
5
- export declare type Override<T, U> = Omit<T, keyof U> & U;
6
- export declare type ExtractTyped<T, K extends T> = Extract<T, K>;
7
- export declare type ExcludeTyped<T, K extends T> = Exclude<T, K>;
8
- export declare type OmitTyped<T, K extends keyof T> = Omit<T, K>;
5
+ export type Override<T, U> = Omit<T, keyof U> & U;
6
+ export type ExtractTyped<T, K extends T> = Extract<T, K>;
7
+ export type ExcludeTyped<T, K extends T> = Exclude<T, K>;
8
+ export type OmitTyped<T, K extends keyof T> = Omit<T, K>;
package/types/module.d.ts CHANGED
@@ -11,4 +11,4 @@ export interface FullProtocolConfiguration {
11
11
  offline: OfflineProtocolConfiguration;
12
12
  online: OnlineProtocolConfiguration;
13
13
  }
14
- export declare type ProtocolConfiguration = OfflineProtocolConfiguration | OnlineProtocolConfiguration | FullProtocolConfiguration;
14
+ export type ProtocolConfiguration = OfflineProtocolConfiguration | OnlineProtocolConfiguration | FullProtocolConfiguration;
@@ -9,7 +9,7 @@ export interface ProtocolMetadata<_Units extends string = string, _FeeUnits exte
9
9
  account: ProtocolAccountMetadata;
10
10
  transaction?: ProtocolTransactionMetadata<_Units>;
11
11
  }
12
- export declare type ProtocolUnitsMetadata<_Units extends string = string> = {
12
+ export type ProtocolUnitsMetadata<_Units extends string = string> = {
13
13
  [key in _Units]: {
14
14
  symbol: ProtocolSymbol;
15
15
  decimals: number;
@@ -48,7 +48,7 @@ export interface ProtocolTransactionArbitraryDataMetadata {
48
48
  maxLength?: number;
49
49
  regex?: string;
50
50
  }
51
- export declare type ProtocolNetworkType = 'mainnet' | 'testnet' | 'custom';
51
+ export type ProtocolNetworkType = 'mainnet' | 'testnet' | 'custom';
52
52
  export interface ProtocolNetwork {
53
53
  name: string;
54
54
  type: ProtocolNetworkType;
@@ -1 +1 @@
1
- export declare type SubProtocolType = 'token' | 'account';
1
+ export type SubProtocolType = 'token' | 'account';
@@ -5,7 +5,7 @@ import { Sealed } from './base/sealed';
5
5
  import { ProtocolNetwork } from './protocol';
6
6
  import { AirGapUIAlert } from './ui/alert';
7
7
  import { AirGapUIText } from './ui/text';
8
- export declare type TransactionType = 'unsigned' | 'signed';
8
+ export type TransactionType = 'unsigned' | 'signed';
9
9
  interface BaseTransaction<_Type extends TransactionType> extends Sealed<_Type> {
10
10
  }
11
11
  export interface UnsignedTransaction extends BaseTransaction<'unsigned'> {
@@ -64,5 +64,5 @@ interface UnknownTransactionStatus extends BaseTransactionStatus<'unknown'> {
64
64
  interface CustomTransactionStatus extends BaseTransactionStatus<'custom'> {
65
65
  name: string;
66
66
  }
67
- export declare type AirGapTransactionStatus = AppliedTransactionStatus | FailedTransactionStatus | UnknownTransactionStatus | CustomTransactionStatus;
67
+ export type AirGapTransactionStatus = AppliedTransactionStatus | FailedTransactionStatus | UnknownTransactionStatus | CustomTransactionStatus;
68
68
  export {};
@@ -1,9 +1,9 @@
1
1
  import { Sealed } from '../base/sealed';
2
- declare type UITextType = 'plain';
2
+ type UITextType = 'plain';
3
3
  interface BaseUIText<_Type extends UITextType> extends Sealed<_Type> {
4
4
  value: string;
5
5
  }
6
6
  interface PlainUIText extends BaseUIText<'plain'> {
7
7
  }
8
- export declare type AirGapUIText = PlainUIText;
8
+ export type AirGapUIText = PlainUIText;
9
9
  export {};
package/utils/amount.js CHANGED
@@ -1,13 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isAmount = void 0;
4
- var interface_1 = require("./interface");
5
- var amountSchema = {
3
+ exports.isAmount = isAmount;
4
+ const interface_1 = require("./interface");
5
+ const amountSchema = {
6
6
  value: 'required',
7
7
  unit: 'required'
8
8
  };
9
9
  function isAmount(object) {
10
10
  return (0, interface_1.implementsInterface)(object, amountSchema);
11
11
  }
12
- exports.isAmount = isAmount;
13
12
  //# sourceMappingURL=amount.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"amount.js","sourceRoot":"","sources":["../../src/utils/amount.ts"],"names":[],"mappings":";;;AAEA,yCAAyD;AAEzD,IAAM,YAAY,GAAmB;IACnC,KAAK,EAAE,UAAU;IACjB,IAAI,EAAE,UAAU;CACjB,CAAA;AAED,SAAgB,QAAQ,CAAwB,MAAe;IAC7D,OAAO,IAAA,+BAAmB,EAAC,MAAM,EAAE,YAAY,CAAC,CAAA;AAClD,CAAC;AAFD,4BAEC"}
1
+ {"version":3,"file":"amount.js","sourceRoot":"","sources":["../../src/utils/amount.ts"],"names":[],"mappings":";;AASA,4BAEC;AATD,2CAAyD;AAEzD,MAAM,YAAY,GAAmB;IACnC,KAAK,EAAE,UAAU;IACjB,IAAI,EAAE,UAAU;CACjB,CAAA;AAED,SAAgB,QAAQ,CAAwB,MAAe;IAC7D,OAAO,IAAA,+BAAmB,EAAC,MAAM,EAAE,YAAY,CAAC,CAAA;AAClD,CAAC"}
@@ -1,2 +1,2 @@
1
- export declare type Schema<T> = Record<keyof T, 'required' | 'optional'>;
1
+ export type Schema<T> = Record<keyof T, 'required' | 'optional'>;
2
2
  export declare function implementsInterface<T>(object: unknown, schema: Schema<T>): object is T;
@@ -1,11 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.implementsInterface = void 0;
3
+ exports.implementsInterface = implementsInterface;
4
4
  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' || key in object; });
8
+ return Object.keys(schema).every((key) => schema[key] === 'optional' || key in object);
9
9
  }
10
- exports.implementsInterface = implementsInterface;
11
10
  //# 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,GAAW,IAAK,OAAA,MAAM,CAAC,GAAsB,CAAC,KAAK,UAAU,IAAI,GAAG,IAAI,MAAM,EAA9D,CAA8D,CAAC,CAAA;AACnH,CAAC;AAND,kDAMC"}
1
+ {"version":3,"file":"interface.js","sourceRoot":"","sources":["../../src/utils/interface.ts"],"names":[],"mappings":";;AAEA,kDAMC;AAND,SAAgB,mBAAmB,CAAI,MAAe,EAAE,MAAiB;IACvE,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,CAAC,MAAM,EAAE,CAAC;QAC1C,OAAO,KAAK,CAAA;IACd,CAAC;IAED,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,GAAW,EAAE,EAAE,CAAC,MAAM,CAAC,GAAsB,CAAC,KAAK,UAAU,IAAI,GAAG,IAAI,MAAM,CAAC,CAAA;AACnH,CAAC"}
package/utils/key.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { ExtendedPublicKey, ExtendedSecretKey, PublicKey, SecretKey } from '../types/key';
2
- declare type AnyKey = SecretKey | ExtendedSecretKey | PublicKey | ExtendedPublicKey;
2
+ type AnyKey = SecretKey | ExtendedSecretKey | PublicKey | ExtendedPublicKey;
3
3
  export declare function isAnyKey(object: unknown): object is AnyKey;
4
4
  export declare function isSecretKey(object: unknown): object is SecretKey;
5
5
  export declare function isExtendedSecretKey(object: unknown): object is ExtendedSecretKey;
package/utils/key.js CHANGED
@@ -1,26 +1,25 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isExtendedPublicKey = exports.isPublicKey = exports.isExtendedSecretKey = exports.isSecretKey = exports.isAnyKey = void 0;
4
- var interface_1 = require("./interface");
3
+ exports.isAnyKey = isAnyKey;
4
+ exports.isSecretKey = isSecretKey;
5
+ exports.isExtendedSecretKey = isExtendedSecretKey;
6
+ exports.isPublicKey = isPublicKey;
7
+ exports.isExtendedPublicKey = isExtendedPublicKey;
8
+ const interface_1 = require("./interface");
5
9
  function isAnyKey(object) {
6
10
  return ((0, interface_1.implementsInterface)(object, { type: 'required', format: 'required', value: 'required' }) &&
7
11
  (object.type === 'priv' || object.type === 'xpriv' || object.type === 'pub' || object.type === 'xpub'));
8
12
  }
9
- exports.isAnyKey = isAnyKey;
10
13
  function isSecretKey(object) {
11
14
  return isAnyKey(object) && object.type === 'priv';
12
15
  }
13
- exports.isSecretKey = isSecretKey;
14
16
  function isExtendedSecretKey(object) {
15
17
  return isAnyKey(object) && object.type === 'xpriv';
16
18
  }
17
- exports.isExtendedSecretKey = isExtendedSecretKey;
18
19
  function isPublicKey(object) {
19
20
  return isAnyKey(object) && object.type === 'pub';
20
21
  }
21
- exports.isPublicKey = isPublicKey;
22
22
  function isExtendedPublicKey(object) {
23
23
  return isAnyKey(object) && object.type === 'xpub';
24
24
  }
25
- exports.isExtendedPublicKey = isExtendedPublicKey;
26
25
  //# sourceMappingURL=key.js.map
package/utils/key.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"key.js","sourceRoot":"","sources":["../../src/utils/key.ts"],"names":[],"mappings":";;;AACA,yCAAiD;AAGjD,SAAgB,QAAQ,CAAC,MAAe;IACtC,OAAO,CACL,IAAA,+BAAmB,EAAS,MAAM,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC;QAChG,CAAC,MAAM,CAAC,IAAI,KAAK,MAAM,IAAI,MAAM,CAAC,IAA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IAAI,MAAM,CAAC,IAAI,KAAK,MAAM,CAAA;AACnD,CAAC;AAED,SAAgB,mBAAmB,CAAC,MAAe;IACjD,OAAO,QAAQ,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,IAAI,KAAK,OAAO,CAAA;AACpD,CAAC;AAED,SAAgB,WAAW,CAAC,MAAe;IACzC,OAAO,QAAQ,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,IAAI,KAAK,KAAK,CAAA;AAClD,CAAC;AAED,SAAgB,mBAAmB,CAAC,MAAe;IACjD,OAAO,QAAQ,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,IAAI,KAAK,MAAM,CAAA;AACnD,CAAC"}
package/utils/module.js CHANGED
@@ -1,30 +1,29 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.canSerializeProtocols = exports.protocolSerializerSchema = exports.createSupportedProtocols = void 0;
4
- var interface_1 = require("./interface");
3
+ exports.protocolSerializerSchema = void 0;
4
+ exports.createSupportedProtocols = createSupportedProtocols;
5
+ exports.canSerializeProtocols = canSerializeProtocols;
6
+ const interface_1 = require("./interface");
5
7
  function createSupportedProtocols(online, offline) {
6
- var onlineIdentifiers = new Set(Object.keys(online));
7
- var offlineIdentifiers = offline ? new Set(offline) : onlineIdentifiers;
8
- var identifiers = new Set(Array.from(onlineIdentifiers).concat(Array.from(onlineIdentifiers)));
9
- return Array.from(identifiers).reduce(function (obj, next) {
10
- var _a;
11
- var offlineConfiguration = offlineIdentifiers.has(next) ? { type: 'offline' } : undefined;
12
- var onlineConfiguration = online[next]
8
+ const onlineIdentifiers = new Set(Object.keys(online));
9
+ const offlineIdentifiers = offline ? new Set(offline) : onlineIdentifiers;
10
+ const identifiers = new Set(Array.from(onlineIdentifiers).concat(Array.from(onlineIdentifiers)));
11
+ return Array.from(identifiers).reduce((obj, next) => {
12
+ const offlineConfiguration = offlineIdentifiers.has(next) ? { type: 'offline' } : undefined;
13
+ const onlineConfiguration = online[next]
13
14
  ? createOnlineProtocolConfiguration(online[next])
14
15
  : undefined;
15
- var configuration = offlineConfiguration !== undefined && onlineConfiguration !== undefined
16
+ const configuration = offlineConfiguration !== undefined && onlineConfiguration !== undefined
16
17
  ? { type: 'full', offline: offlineConfiguration, online: onlineConfiguration }
17
- : (offlineConfiguration !== null && offlineConfiguration !== void 0 ? offlineConfiguration : onlineConfiguration);
18
- return Object.assign(obj, (_a = {}, _a[next] = configuration, _a));
18
+ : (offlineConfiguration ?? onlineConfiguration);
19
+ return Object.assign(obj, { [next]: configuration });
19
20
  // tslint:disable-next-line: no-object-literal-type-assertion
20
21
  }, {});
21
22
  }
22
- exports.createSupportedProtocols = createSupportedProtocols;
23
23
  function createOnlineProtocolConfiguration(networks) {
24
- var _a;
25
24
  return {
26
25
  type: 'online',
27
- networks: (_a = networks.supportedNetworks) !== null && _a !== void 0 ? _a : networks
26
+ networks: networks.supportedNetworks ?? networks
28
27
  };
29
28
  }
30
29
  // Schemas
@@ -38,5 +37,4 @@ exports.protocolSerializerSchema = {
38
37
  function canSerializeProtocols(module) {
39
38
  return (0, interface_1.implementsInterface)(module, exports.protocolSerializerSchema);
40
39
  }
41
- exports.canSerializeProtocols = canSerializeProtocols;
42
40
  //# sourceMappingURL=module.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"module.js","sourceRoot":"","sources":["../../src/utils/module.ts"],"names":[],"mappings":";;;AAMA,yCAAyD;AAEzD,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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AAgE,CAAA;QAEnH,OAAO,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,aAAa,EAAE,CAAC,CAAA;QACpD,6DAA6D;IAC/D,CAAC,EAAE,EAAsC,CAAC,CAAA;AAC5C,CAAC;AAED,SAAS,iCAAiC,CAAC,QAAiE;IAC1G,OAAO;QACL,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAG,QAAkC,CAAC,iBAAiB,IAAI,QAAQ;KAC5E,CAAA;AACH,CAAC;AAED,UAAU;AAEG,QAAA,wBAAwB,GAAqC;IACxE,wBAAwB,EAAE,UAAU;IACpC,0BAA0B,EAAE,UAAU;IACtC,uBAAuB,EAAE,UAAU;IACnC,yBAAyB,EAAE,UAAU;CACtC,CAAA;AAED,wBAAwB;AAExB,SAAgB,qBAAqB,CAAmB,MAAS;IAC/D,OAAO,IAAA,+BAAmB,EAA2B,MAAM,EAAE,gCAAwB,CAAC,CAAA;AACxF,CAAC"}
@@ -1,8 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.normalizeToUndefined = void 0;
3
+ exports.normalizeToUndefined = normalizeToUndefined;
4
4
  function normalizeToUndefined(value) {
5
5
  return value !== null ? value : undefined;
6
6
  }
7
- exports.normalizeToUndefined = normalizeToUndefined;
8
7
  //# sourceMappingURL=normalize.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"normalize.js","sourceRoot":"","sources":["../../src/utils/normalize.ts"],"names":[],"mappings":";;;AAAA,SAAgB,oBAAoB,CAAI,KAA2B;IACjE,OAAO,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAA;AAC3C,CAAC;AAFD,oDAEC"}
1
+ {"version":3,"file":"normalize.js","sourceRoot":"","sources":["../../src/utils/normalize.ts"],"names":[],"mappings":";;AAAA,oDAEC;AAFD,SAAgB,oBAAoB,CAAI,KAA2B;IACjE,OAAO,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAA;AAC3C,CAAC"}