@airgap/module-kit 0.13.7-beta.23

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 (160) hide show
  1. package/LICENSE.md +7 -0
  2. package/airgap-module-kit.min.js +30062 -0
  3. package/block-explorer/block-explorer.d.ts +8 -0
  4. package/block-explorer/block-explorer.js +3 -0
  5. package/block-explorer/block-explorer.js.map +1 -0
  6. package/block-explorer/extensions/extensions.d.ts +2 -0
  7. package/block-explorer/extensions/extensions.js +3 -0
  8. package/block-explorer/extensions/extensions.js.map +1 -0
  9. package/factories/amount.d.ts +4 -0
  10. package/factories/amount.js +16 -0
  11. package/factories/amount.js.map +1 -0
  12. package/factories/key.d.ts +5 -0
  13. package/factories/key.js +24 -0
  14. package/factories/key.js.map +1 -0
  15. package/factories/signature.d.ts +2 -0
  16. package/factories/signature.js +9 -0
  17. package/factories/signature.js.map +1 -0
  18. package/factories/transaction.d.ts +3 -0
  19. package/factories/transaction.js +23 -0
  20. package/factories/transaction.js.map +1 -0
  21. package/factories/ui/alert.d.ts +5 -0
  22. package/factories/ui/alert.js +31 -0
  23. package/factories/ui/alert.js.map +1 -0
  24. package/factories/ui/text.d.ts +2 -0
  25. package/factories/ui/text.js +8 -0
  26. package/factories/ui/text.js.map +1 -0
  27. package/index.d.ts +50 -0
  28. package/index.js +51 -0
  29. package/index.js.map +1 -0
  30. package/module/extensions/extensions.d.ts +2 -0
  31. package/module/extensions/extensions.js +3 -0
  32. package/module/extensions/extensions.js.map +1 -0
  33. package/module/module-network-registry.d.ts +11 -0
  34. package/module/module-network-registry.js +22 -0
  35. package/module/module-network-registry.js.map +1 -0
  36. package/module/module.d.ts +11 -0
  37. package/module/module.js +3 -0
  38. package/module/module.js.map +1 -0
  39. package/package.json +56 -0
  40. package/protocol/extensions/address/FetchDataForAddressExtension.d.ts +9 -0
  41. package/protocol/extensions/address/FetchDataForAddressExtension.js +3 -0
  42. package/protocol/extensions/address/FetchDataForAddressExtension.js.map +1 -0
  43. package/protocol/extensions/address/FetchDataForMultipleAddressesExtension.d.ts +9 -0
  44. package/protocol/extensions/address/FetchDataForMultipleAddressesExtension.js +3 -0
  45. package/protocol/extensions/address/FetchDataForMultipleAddressesExtension.js.map +1 -0
  46. package/protocol/extensions/address/MultiAddressPublicKeyExtension.d.ts +7 -0
  47. package/protocol/extensions/address/MultiAddressPublicKeyExtension.js +3 -0
  48. package/protocol/extensions/address/MultiAddressPublicKeyExtension.js.map +1 -0
  49. package/protocol/extensions/bip/Bip32Extension.d.ts +15 -0
  50. package/protocol/extensions/bip/Bip32Extension.js +3 -0
  51. package/protocol/extensions/bip/Bip32Extension.js.map +1 -0
  52. package/protocol/extensions/contract/ConfigurableContractExtension.d.ts +7 -0
  53. package/protocol/extensions/contract/ConfigurableContractExtension.js +3 -0
  54. package/protocol/extensions/contract/ConfigurableContractExtension.js.map +1 -0
  55. package/protocol/extensions/crypto/AESExtension.d.ts +7 -0
  56. package/protocol/extensions/crypto/AESExtension.js +3 -0
  57. package/protocol/extensions/crypto/AESExtension.js.map +1 -0
  58. package/protocol/extensions/crypto/AsymmetricEncryptionExtension.d.ts +9 -0
  59. package/protocol/extensions/crypto/AsymmetricEncryptionExtension.js +3 -0
  60. package/protocol/extensions/crypto/AsymmetricEncryptionExtension.js.map +1 -0
  61. package/protocol/extensions/crypto/CryptoExtension.d.ts +5 -0
  62. package/protocol/extensions/crypto/CryptoExtension.js +3 -0
  63. package/protocol/extensions/crypto/CryptoExtension.js.map +1 -0
  64. package/protocol/extensions/crypto/SignMessageExtension.d.ts +10 -0
  65. package/protocol/extensions/crypto/SignMessageExtension.js +3 -0
  66. package/protocol/extensions/crypto/SignMessageExtension.js.map +1 -0
  67. package/protocol/extensions/extensions.d.ts +37 -0
  68. package/protocol/extensions/extensions.js +3 -0
  69. package/protocol/extensions/extensions.js.map +1 -0
  70. package/protocol/extensions/sub-protocol/MultiTokenSubProtocolExtension.d.ts +12 -0
  71. package/protocol/extensions/sub-protocol/MultiTokenSubProtocolExtension.js +3 -0
  72. package/protocol/extensions/sub-protocol/MultiTokenSubProtocolExtension.js.map +1 -0
  73. package/protocol/extensions/sub-protocol/SingleTokenSubProtocolExtension.d.ts +9 -0
  74. package/protocol/extensions/sub-protocol/SingleTokenSubProtocolExtension.js +3 -0
  75. package/protocol/extensions/sub-protocol/SingleTokenSubProtocolExtension.js.map +1 -0
  76. package/protocol/extensions/sub-protocol/SubProtocolExtension.d.ts +6 -0
  77. package/protocol/extensions/sub-protocol/SubProtocolExtension.js +3 -0
  78. package/protocol/extensions/sub-protocol/SubProtocolExtension.js.map +1 -0
  79. package/protocol/extensions/transaction/ConfigurableTransactionInjectorExtension.d.ts +6 -0
  80. package/protocol/extensions/transaction/ConfigurableTransactionInjectorExtension.js +3 -0
  81. package/protocol/extensions/transaction/ConfigurableTransactionInjectorExtension.js.map +1 -0
  82. package/protocol/extensions/transaction/TransactionStatusCheckerExtension.d.ts +6 -0
  83. package/protocol/extensions/transaction/TransactionStatusCheckerExtension.js +3 -0
  84. package/protocol/extensions/transaction/TransactionStatusCheckerExtension.js.map +1 -0
  85. package/protocol/protocol.d.ts +65 -0
  86. package/protocol/protocol.js +3 -0
  87. package/protocol/protocol.js.map +1 -0
  88. package/readme.md +0 -0
  89. package/types/address.d.ts +8 -0
  90. package/types/address.js +3 -0
  91. package/types/address.js.map +1 -0
  92. package/types/airgap.d.ts +15 -0
  93. package/types/airgap.js +3 -0
  94. package/types/airgap.js.map +1 -0
  95. package/types/amount.d.ts +15 -0
  96. package/types/amount.js +42 -0
  97. package/types/amount.js.map +1 -0
  98. package/types/balance.d.ts +5 -0
  99. package/types/balance.js +3 -0
  100. package/types/balance.js.map +1 -0
  101. package/types/base/cursor.d.ts +3 -0
  102. package/types/base/cursor.js +3 -0
  103. package/types/base/cursor.js.map +1 -0
  104. package/types/base/sealed.d.ts +3 -0
  105. package/types/base/sealed.js +3 -0
  106. package/types/base/sealed.js.map +1 -0
  107. package/types/block-explorer.d.ts +4 -0
  108. package/types/block-explorer.js +3 -0
  109. package/types/block-explorer.js.map +1 -0
  110. package/types/bytes.d.ts +8 -0
  111. package/types/bytes.js +3 -0
  112. package/types/bytes.js.map +1 -0
  113. package/types/fee.d.ts +7 -0
  114. package/types/fee.js +3 -0
  115. package/types/fee.js.map +1 -0
  116. package/types/key.d.ts +20 -0
  117. package/types/key.js +3 -0
  118. package/types/key.js.map +1 -0
  119. package/types/meta/utility-types.d.ts +5 -0
  120. package/types/meta/utility-types.js +3 -0
  121. package/types/meta/utility-types.js.map +1 -0
  122. package/types/protocol.d.ts +60 -0
  123. package/types/protocol.js +3 -0
  124. package/types/protocol.js.map +1 -0
  125. package/types/secret.d.ts +12 -0
  126. package/types/secret.js +3 -0
  127. package/types/secret.js.map +1 -0
  128. package/types/signature.d.ts +3 -0
  129. package/types/signature.js +3 -0
  130. package/types/signature.js.map +1 -0
  131. package/types/sub-protocol.d.ts +1 -0
  132. package/types/sub-protocol.js +3 -0
  133. package/types/sub-protocol.js.map +1 -0
  134. package/types/transaction.d.ts +63 -0
  135. package/types/transaction.js +3 -0
  136. package/types/transaction.js.map +1 -0
  137. package/types/ui/action.d.ts +4 -0
  138. package/types/ui/action.js +3 -0
  139. package/types/ui/action.js.map +1 -0
  140. package/types/ui/alert.d.ts +9 -0
  141. package/types/ui/alert.js +3 -0
  142. package/types/ui/alert.js.map +1 -0
  143. package/types/ui/text.d.ts +9 -0
  144. package/types/ui/text.js +3 -0
  145. package/types/ui/text.js.map +1 -0
  146. package/utils/amount.d.ts +2 -0
  147. package/utils/amount.js +13 -0
  148. package/utils/amount.js.map +1 -0
  149. package/utils/interface.d.ts +2 -0
  150. package/utils/interface.js +11 -0
  151. package/utils/interface.js.map +1 -0
  152. package/utils/key.d.ts +8 -0
  153. package/utils/key.js +26 -0
  154. package/utils/key.js.map +1 -0
  155. package/utils/normalize.d.ts +1 -0
  156. package/utils/normalize.js +8 -0
  157. package/utils/normalize.js.map +1 -0
  158. package/utils/protocol.d.ts +29 -0
  159. package/utils/protocol.js +164 -0
  160. package/utils/protocol.js.map +1 -0
@@ -0,0 +1,12 @@
1
+ import { Sealed } from './base/sealed';
2
+ export declare type SecretType = 'mnemonic' | 'hex';
3
+ interface BaseSecret<_Type extends SecretType> extends Sealed<_Type> {
4
+ value: string;
5
+ }
6
+ export interface MnemonicSecret extends BaseSecret<'mnemonic'> {
7
+ password?: string;
8
+ }
9
+ export interface HexSecret extends BaseSecret<'hex'> {
10
+ }
11
+ export declare type Secret = MnemonicSecret | HexSecret;
12
+ export {};
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=secret.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"secret.js","sourceRoot":"","sources":["../../src/types/secret.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ import { BytesString } from './bytes';
2
+ export interface Signature extends BytesString {
3
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=signature.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signature.js","sourceRoot":"","sources":["../../src/types/signature.ts"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ export declare type SubProtocolType = 'token' | 'account';
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=sub-protocol.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sub-protocol.js","sourceRoot":"","sources":["../../src/types/sub-protocol.ts"],"names":[],"mappings":""}
@@ -0,0 +1,63 @@
1
+ import { Address } from './address';
2
+ import { Amount } from './amount';
3
+ import { BaseCursor } from './base/cursor';
4
+ import { Sealed } from './base/sealed';
5
+ import { ProtocolNetwork } from './protocol';
6
+ import { AirGapUIAlert } from './ui/alert';
7
+ import { AirGapUIText } from './ui/text';
8
+ export declare type TransactionType = 'unsigned' | 'signed';
9
+ interface BaseTransaction<_Type extends TransactionType> extends Sealed<_Type> {
10
+ }
11
+ export interface UnsignedTransaction extends BaseTransaction<'unsigned'> {
12
+ }
13
+ export interface SignedTransaction extends BaseTransaction<'signed'> {
14
+ }
15
+ export interface AirGapTransaction<_Units extends string = string, _FeeUnits extends string = _Units> {
16
+ from: string[];
17
+ to: string[];
18
+ isInbound: boolean;
19
+ amount: Amount<_Units>;
20
+ fee: Amount<_FeeUnits>;
21
+ network: ProtocolNetwork;
22
+ timestamp?: number;
23
+ status?: AirGapTransactionStatus;
24
+ type?: string | {
25
+ name: string;
26
+ [key: string]: string;
27
+ };
28
+ uiAlerts?: AirGapUIAlert[];
29
+ arbitraryData?: string | [AirGapUIText, string];
30
+ json?: any;
31
+ }
32
+ export interface TransactionCursor extends BaseCursor {
33
+ }
34
+ export interface AirGapTransactionsWithCursor<_Cursor extends TransactionCursor = TransactionCursor, _Units extends string = string, _FeeUnits extends string = _Units> {
35
+ transactions: AirGapTransaction<_Units, _FeeUnits>[];
36
+ cursor: _Cursor;
37
+ }
38
+ export interface TransactionDetails<_Units extends string = string> {
39
+ to: Address;
40
+ amount: Amount<_Units>;
41
+ arbitraryData?: string;
42
+ }
43
+ export interface TransactionConfiguration<_FeeUnits extends string = string> {
44
+ fee?: Amount<_FeeUnits>;
45
+ arbitraryData?: string;
46
+ keepMinBalance?: boolean;
47
+ assetId?: number;
48
+ }
49
+ interface BaseTransactionStatus<_Type extends string> extends Sealed<_Type> {
50
+ hash?: string;
51
+ block?: string;
52
+ }
53
+ interface AppliedTransactionStatus extends BaseTransactionStatus<'applied'> {
54
+ }
55
+ interface FailedTransactionStatus extends BaseTransactionStatus<'failed'> {
56
+ }
57
+ interface UnknownTransactionStatus extends BaseTransactionStatus<'unknown'> {
58
+ }
59
+ interface CustomTransactionStatus extends BaseTransactionStatus<'custom'> {
60
+ name: string;
61
+ }
62
+ export declare type AirGapTransactionStatus = AppliedTransactionStatus | FailedTransactionStatus | UnknownTransactionStatus | CustomTransactionStatus;
63
+ export {};
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=transaction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transaction.js","sourceRoot":"","sources":["../../src/types/transaction.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ import { AirGapUIText } from './text';
2
+ export interface AirGapUIAction {
3
+ text: AirGapUIText;
4
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=action.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"action.js","sourceRoot":"","sources":["../../../src/types/ui/action.ts"],"names":[],"mappings":""}
@@ -0,0 +1,9 @@
1
+ import { AirGapUIAction } from './action';
2
+ import { AirGapUIText } from './text';
3
+ export interface AirGapUIAlert {
4
+ type: 'success' | 'info' | 'warning' | 'error';
5
+ title: AirGapUIText;
6
+ description: AirGapUIText;
7
+ icon?: string;
8
+ actions?: AirGapUIAction[];
9
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=alert.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"alert.js","sourceRoot":"","sources":["../../../src/types/ui/alert.ts"],"names":[],"mappings":""}
@@ -0,0 +1,9 @@
1
+ import { Sealed } from '../base/sealed';
2
+ declare type UITextType = 'plain';
3
+ interface BaseUIText<_Type extends UITextType> extends Sealed<_Type> {
4
+ value: string;
5
+ }
6
+ interface PlainUIText extends BaseUIText<'plain'> {
7
+ }
8
+ export declare type AirGapUIText = PlainUIText;
9
+ export {};
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=text.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text.js","sourceRoot":"","sources":["../../../src/types/ui/text.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ import { Amount } from '../types/amount';
2
+ export declare function isAmount<_Units extends string>(object: unknown): object is Amount<_Units>;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isAmount = void 0;
4
+ var interface_1 = require("./interface");
5
+ var amountSchema = {
6
+ value: 'required',
7
+ unit: 'required'
8
+ };
9
+ function isAmount(object) {
10
+ return (0, interface_1.implementsInterface)(object, amountSchema);
11
+ }
12
+ exports.isAmount = isAmount;
13
+ //# sourceMappingURL=amount.js.map
@@ -0,0 +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"}
@@ -0,0 +1,2 @@
1
+ export declare type Schema<T> = Record<keyof T, 'required' | 'optional'>;
2
+ export declare function implementsInterface<T>(object: unknown, schema: Schema<T>): object is T;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.implementsInterface = void 0;
4
+ function implementsInterface(object, schema) {
5
+ if (typeof object !== 'object' || !object) {
6
+ return false;
7
+ }
8
+ return Object.keys(schema).every(function (key) { return schema[key] === 'optional' || object[key] !== undefined; });
9
+ }
10
+ exports.implementsInterface = implementsInterface;
11
+ //# sourceMappingURL=interface.js.map
@@ -0,0 +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"}
package/utils/key.d.ts ADDED
@@ -0,0 +1,8 @@
1
+ import { ExtendedPublicKey, ExtendedSecretKey, PublicKey, SecretKey } from '../types/key';
2
+ declare type AnyKey = SecretKey | ExtendedSecretKey | PublicKey | ExtendedPublicKey;
3
+ export declare function isAnyKey(object: unknown): object is AnyKey;
4
+ export declare function isSecretKey(object: unknown): object is SecretKey;
5
+ export declare function isExtendedSecretKey(object: unknown): object is ExtendedSecretKey;
6
+ export declare function isPublicKey(object: unknown): object is PublicKey;
7
+ export declare function isExtendedPublicKey(object: unknown): object is ExtendedPublicKey;
8
+ export {};
package/utils/key.js ADDED
@@ -0,0 +1,26 @@
1
+ "use strict";
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");
5
+ function isAnyKey(object) {
6
+ return ((0, interface_1.implementsInterface)(object, { type: 'required', format: 'required', value: 'required' }) &&
7
+ (object.type === 'priv' || object.type === 'xpriv' || object.type === 'pub' || object.type === 'xpub'));
8
+ }
9
+ exports.isAnyKey = isAnyKey;
10
+ function isSecretKey(object) {
11
+ return isAnyKey(object) && object.type === 'priv';
12
+ }
13
+ exports.isSecretKey = isSecretKey;
14
+ function isExtendedSecretKey(object) {
15
+ return isAnyKey(object) && object.type === 'xpriv';
16
+ }
17
+ exports.isExtendedSecretKey = isExtendedSecretKey;
18
+ function isPublicKey(object) {
19
+ return isAnyKey(object) && object.type === 'pub';
20
+ }
21
+ exports.isPublicKey = isPublicKey;
22
+ function isExtendedPublicKey(object) {
23
+ return isAnyKey(object) && object.type === 'xpub';
24
+ }
25
+ exports.isExtendedPublicKey = isExtendedPublicKey;
26
+ //# sourceMappingURL=key.js.map
@@ -0,0 +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,IAAI,KAAK,OAAO,IAAI,MAAM,CAAC,IAAI,KAAK,KAAK,IAAI,MAAM,CAAC,IAAI,KAAK,MAAM,CAAC,CACvG,CAAA;AACH,CAAC;AALD,4BAKC;AAED,SAAgB,WAAW,CAAC,MAAe;IACzC,OAAO,QAAQ,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,IAAI,KAAK,MAAM,CAAA;AACnD,CAAC;AAFD,kCAEC;AAED,SAAgB,mBAAmB,CAAC,MAAe;IACjD,OAAO,QAAQ,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,IAAI,KAAK,OAAO,CAAA;AACpD,CAAC;AAFD,kDAEC;AAED,SAAgB,WAAW,CAAC,MAAe;IACzC,OAAO,QAAQ,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,IAAI,KAAK,KAAK,CAAA;AAClD,CAAC;AAFD,kCAEC;AAED,SAAgB,mBAAmB,CAAC,MAAe;IACjD,OAAO,QAAQ,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,IAAI,KAAK,MAAM,CAAA;AACnD,CAAC;AAFD,kDAEC"}
@@ -0,0 +1 @@
1
+ export declare function normalizeToUndefined<T>(value: T | undefined | null): T | undefined;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.normalizeToUndefined = void 0;
4
+ function normalizeToUndefined(value) {
5
+ return value !== null ? value : undefined;
6
+ }
7
+ exports.normalizeToUndefined = normalizeToUndefined;
8
+ //# sourceMappingURL=normalize.js.map
@@ -0,0 +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"}
@@ -0,0 +1,29 @@
1
+ import { FetchDataForAddressExtension } from '../protocol/extensions/address/FetchDataForAddressExtension';
2
+ import { FetchDataForMultipleAddressesExtension } from '../protocol/extensions/address/FetchDataForMultipleAddressesExtension';
3
+ import { MultiAddressPublicKeyExtension } from '../protocol/extensions/address/MultiAddressPublicKeyExtension';
4
+ import { Bip32Extension } from '../protocol/extensions/bip/Bip32Extension';
5
+ import { ConfigurableContractProtocol } from '../protocol/extensions/contract/ConfigurableContractExtension';
6
+ import { AESExtension } from '../protocol/extensions/crypto/AESExtension';
7
+ import { AsymmetricEncryptionExtension } from '../protocol/extensions/crypto/AsymmetricEncryptionExtension';
8
+ import { SignMessageExtension } from '../protocol/extensions/crypto/SignMessageExtension';
9
+ import { MultiTokenSubProtocolExtension } from '../protocol/extensions/sub-protocol/MultiTokenSubProtocolExtension';
10
+ import { SingleTokenSubProtocolExtension } from '../protocol/extensions/sub-protocol/SingleTokenSubProtocolExtension';
11
+ import { SubProtocol } from '../protocol/extensions/sub-protocol/SubProtocolExtension';
12
+ import { ConfigurableTransactionInjectorProtocol } from '../protocol/extensions/transaction/ConfigurableTransactionInjectorExtension';
13
+ import { TransactionStatusCheckerExtension } from '../protocol/extensions/transaction/TransactionStatusCheckerExtension';
14
+ import { AnyProtocol, OfflineProtocol, OnlineProtocol } from '../protocol/protocol';
15
+ import { ProtocolNetwork } from '../types/protocol';
16
+ export declare function isBip32Protocol<T extends AnyProtocol>(protocol: T): protocol is T & Bip32Extension<T>;
17
+ export declare function isSubProtocol<T extends AnyProtocol>(protocol: T): protocol is T & SubProtocol;
18
+ export declare function isSingleTokenSubProtocol<T extends AnyProtocol>(protocol: T): protocol is T & SingleTokenSubProtocolExtension<T>;
19
+ export declare function isMultiTokenSubProtocol<T extends AnyProtocol>(protocol: T): protocol is T & MultiTokenSubProtocolExtension<T>;
20
+ export declare function canFetchDataForAddress<T extends OnlineProtocol>(protocol: T): protocol is T & FetchDataForAddressExtension<T>;
21
+ export declare function canFetchDataForMultipleAddresses<T extends OnlineProtocol>(protocol: T): protocol is T & FetchDataForMultipleAddressesExtension<T>;
22
+ export declare function hasMultiAddressPublicKeys<T extends AnyProtocol>(protocol: T): protocol is T & MultiAddressPublicKeyExtension<T>;
23
+ export declare function hasConfigurableContract<T extends AnyProtocol>(protocol: T): protocol is T & ConfigurableContractProtocol;
24
+ export declare function canEncryptAES<T extends OfflineProtocol>(protocol: T): protocol is T & AESExtension<T>;
25
+ export declare function canEncryptAsymmetric<T extends AnyProtocol>(protocol: T): protocol is T & AsymmetricEncryptionExtension<T>;
26
+ export declare function canSignMessage<T extends AnyProtocol>(protocol: T): protocol is T & SignMessageExtension<T>;
27
+ export declare function hasConfigurableTransactionInjector<T extends OnlineProtocol>(protocol: T): protocol is T & ConfigurableTransactionInjectorProtocol;
28
+ export declare function isTransactionStatusChecker<T extends OnlineProtocol>(protocol: T): protocol is T & TransactionStatusCheckerExtension<T>;
29
+ export declare function protocolNetworkIdentifier(network: ProtocolNetwork): string;
@@ -0,0 +1,164 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
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;
15
+ var createHash = require("@airgap/coinlib-core/dependencies/src/create-hash-1.2.0/index");
16
+ var interface_1 = require("./interface");
17
+ // Schemas
18
+ var baseProtocolSchema = {
19
+ getAddressFromPublicKey: 'required',
20
+ getDetailsFromTransaction: 'required',
21
+ getMetadata: 'required'
22
+ };
23
+ var offlineProtocolSchema = __assign(__assign({}, baseProtocolSchema), { getKeyPairFromSecret: 'required', signTransactionWithSecretKey: 'required' });
24
+ var onlineProtocolSchema = __assign(__assign({}, baseProtocolSchema), { broadcastTransaction: 'required', getBalanceOfPublicKey: 'required', getNetwork: 'required', getTransactionFeeWithPublicKey: 'required', getTransactionMaxAmountWithPublicKey: 'required', getTransactionsForPublicKey: 'required', prepareTransactionWithPublicKey: 'required' });
25
+ var bip32BaseProtocolSchema = __assign(__assign({}, baseProtocolSchema), { deriveFromExtendedPublicKey: 'required' });
26
+ var bip32OfflineProtocolSchema = __assign(__assign(__assign({}, bip32BaseProtocolSchema), offlineProtocolSchema), { getExtendedKeyPairFromSecret: 'required' });
27
+ var bip32OnlineProtocolSchema = __assign(__assign({}, bip32BaseProtocolSchema), onlineProtocolSchema);
28
+ var subProtocolSchema = {
29
+ getType: 'required'
30
+ };
31
+ var singleTokenSubProtocolSchema = __assign(__assign({}, subProtocolSchema), { getContractAddress: 'required' });
32
+ var multiTokenSubProtocolBaseSchema = singleTokenSubProtocolSchema;
33
+ var multiTokenSubProtocolOnlineSchema = __assign(__assign({}, multiTokenSubProtocolBaseSchema), onlineProtocolSchema);
34
+ var fetchDataForAddressProtocolSchema = {
35
+ getBalanceOfAddress: 'required',
36
+ getTransactionsForAddress: 'required'
37
+ };
38
+ var fetchDataForMultipleAddressesProtocolSchema = {
39
+ getBalanceOfAddresses: 'required',
40
+ getTransactionsForAddresses: 'required'
41
+ };
42
+ var multiAddressPublicKeyProtocolSchema = {
43
+ getNextAddressFromPublicKey: 'required'
44
+ };
45
+ var configurableContractProtocolSchema = {
46
+ isContractValid: 'required',
47
+ getContractAddress: 'required',
48
+ setContractAddress: 'required'
49
+ };
50
+ var aesEncryptionSchema = {
51
+ decryptAESWithSecretKey: 'required',
52
+ encryptAESWithSecretKey: 'required'
53
+ };
54
+ var asymmetricEncryptionBaseSchema = {
55
+ encryptAsymmetricWithPublicKey: 'required'
56
+ };
57
+ var asymmetricEncryptionOfflineSchema = __assign(__assign({}, asymmetricEncryptionBaseSchema), { decryptAsymmetricWithKeyPair: 'required' });
58
+ var signMessageBaseSchema = {
59
+ verifyMessageWithPublicKey: 'required'
60
+ };
61
+ var signMessageOfflineSchema = __assign(__assign({}, signMessageBaseSchema), { signMessageWithKeyPair: 'required' });
62
+ var configurableTransactionInjectorSchema = {
63
+ getInjectorUrl: 'required',
64
+ setInjectorUrl: 'required'
65
+ };
66
+ var transactionStatusCheckerSchema = {
67
+ getTransactionStatus: 'required'
68
+ };
69
+ // Implementation Checks
70
+ function isOfflineProtocol(object) {
71
+ return (0, interface_1.implementsInterface)(object, offlineProtocolSchema);
72
+ }
73
+ function isOnlineProtocol(object) {
74
+ return (0, interface_1.implementsInterface)(object, onlineProtocolSchema);
75
+ }
76
+ function isOfflineBip32Protocol(protocol) {
77
+ return (0, interface_1.implementsInterface)(protocol, bip32OfflineProtocolSchema);
78
+ }
79
+ function isOnlineBip32Protocol(protocol) {
80
+ return (0, interface_1.implementsInterface)(protocol, bip32OnlineProtocolSchema);
81
+ }
82
+ function isBip32Protocol(protocol) {
83
+ var extendedWithBip32 = false;
84
+ if (isOfflineProtocol(protocol)) {
85
+ extendedWithBip32 = isOfflineBip32Protocol(protocol);
86
+ }
87
+ if (isOnlineProtocol(protocol)) {
88
+ extendedWithBip32 && (extendedWithBip32 = isOnlineBip32Protocol(protocol));
89
+ }
90
+ return extendedWithBip32;
91
+ }
92
+ exports.isBip32Protocol = isBip32Protocol;
93
+ function isSubProtocol(protocol) {
94
+ return (0, interface_1.implementsInterface)(protocol, subProtocolSchema);
95
+ }
96
+ exports.isSubProtocol = isSubProtocol;
97
+ function isSingleTokenSubProtocol(protocol) {
98
+ return (0, interface_1.implementsInterface)(protocol, singleTokenSubProtocolSchema);
99
+ }
100
+ exports.isSingleTokenSubProtocol = isSingleTokenSubProtocol;
101
+ function isMultiTokenSubProtocol(protocol) {
102
+ var extendedWithMultiTokenSubProtocol = (0, interface_1.implementsInterface)(protocol, multiTokenSubProtocolBaseSchema);
103
+ if (isOnlineProtocol(protocol)) {
104
+ extendedWithMultiTokenSubProtocol && (extendedWithMultiTokenSubProtocol = (0, interface_1.implementsInterface)(protocol, multiTokenSubProtocolOnlineSchema));
105
+ }
106
+ return extendedWithMultiTokenSubProtocol;
107
+ }
108
+ exports.isMultiTokenSubProtocol = isMultiTokenSubProtocol;
109
+ function canFetchDataForAddress(protocol) {
110
+ return (0, interface_1.implementsInterface)(protocol, fetchDataForAddressProtocolSchema);
111
+ }
112
+ exports.canFetchDataForAddress = canFetchDataForAddress;
113
+ function canFetchDataForMultipleAddresses(protocol) {
114
+ return (0, interface_1.implementsInterface)(protocol, fetchDataForMultipleAddressesProtocolSchema);
115
+ }
116
+ exports.canFetchDataForMultipleAddresses = canFetchDataForMultipleAddresses;
117
+ function hasMultiAddressPublicKeys(protocol) {
118
+ return (0, interface_1.implementsInterface)(protocol, multiAddressPublicKeyProtocolSchema);
119
+ }
120
+ exports.hasMultiAddressPublicKeys = hasMultiAddressPublicKeys;
121
+ function hasConfigurableContract(protocol) {
122
+ return (0, interface_1.implementsInterface)(protocol, configurableContractProtocolSchema);
123
+ }
124
+ exports.hasConfigurableContract = hasConfigurableContract;
125
+ function canEncryptAES(protocol) {
126
+ return (0, interface_1.implementsInterface)(protocol, aesEncryptionSchema);
127
+ }
128
+ exports.canEncryptAES = canEncryptAES;
129
+ function canEncryptAsymmetric(protocol) {
130
+ var extendedWithAsymmetricEncryption = (0, interface_1.implementsInterface)(protocol, asymmetricEncryptionBaseSchema);
131
+ if (isOfflineProtocol(protocol)) {
132
+ extendedWithAsymmetricEncryption && (extendedWithAsymmetricEncryption = (0, interface_1.implementsInterface)(protocol, asymmetricEncryptionOfflineSchema));
133
+ }
134
+ return extendedWithAsymmetricEncryption;
135
+ }
136
+ exports.canEncryptAsymmetric = canEncryptAsymmetric;
137
+ function canSignMessage(protocol) {
138
+ var extendedWithSignMessage = (0, interface_1.implementsInterface)(protocol, signMessageBaseSchema);
139
+ if (isOfflineProtocol(protocol)) {
140
+ extendedWithSignMessage && (extendedWithSignMessage = (0, interface_1.implementsInterface)(protocol, signMessageOfflineSchema));
141
+ }
142
+ return extendedWithSignMessage;
143
+ }
144
+ exports.canSignMessage = canSignMessage;
145
+ function hasConfigurableTransactionInjector(protocol) {
146
+ return (0, interface_1.implementsInterface)(protocol, configurableTransactionInjectorSchema);
147
+ }
148
+ exports.hasConfigurableTransactionInjector = hasConfigurableTransactionInjector;
149
+ function isTransactionStatusChecker(protocol) {
150
+ return (0, interface_1.implementsInterface)(protocol, transactionStatusCheckerSchema);
151
+ }
152
+ exports.isTransactionStatusChecker = isTransactionStatusChecker;
153
+ // Identifier
154
+ var sha256hashShort = function (input) {
155
+ var hash = createHash('sha256');
156
+ hash.update(input);
157
+ return hash.digest('base64').slice(0, 10);
158
+ };
159
+ function protocolNetworkIdentifier(network) {
160
+ var hashed = sha256hashShort("".concat(network.name, "-").concat(network.rpcUrl));
161
+ return "".concat(network.type, "-").concat(hashed);
162
+ }
163
+ exports.protocolNetworkIdentifier = protocolNetworkIdentifier;
164
+ //# sourceMappingURL=protocol.js.map
@@ -0,0 +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,EAAE,UAAU,EAChC,qBAAqB,EAAE,UAAU,EACjC,UAAU,EAAE,UAAU,EACtB,8BAA8B,EAAE,UAAU,EAC1C,oCAAoC,EAAE,UAAU,EAChD,2BAA2B,EAAE,UAAU,EACvC,+BAA+B,EAAE,UAAU,GAC5C,CAAA;AAED,IAAM,uBAAuB,yBACxB,kBAAkB,KACrB,2BAA2B,EAAE,UAAU,GACxC,CAAA;AAED,IAAM,0BAA0B,kCAC3B,uBAAuB,GACvB,qBAAqB,KACxB,4BAA4B,EAAE,UAAU,GACzC,CAAA;AAED,IAAM,yBAAyB,yBAC1B,uBAAuB,GACvB,oBAAoB,CACxB,CAAA;AAED,IAAM,iBAAiB,GAAwB;IAC7C,OAAO,EAAE,UAAU;CACpB,CAAA;AAED,IAAM,4BAA4B,yBAC7B,iBAAiB,KACpB,kBAAkB,EAAE,UAAU,GAC/B,CAAA;AAED,IAAM,+BAA+B,GAAsC,4BAA4B,CAAA;AACvG,IAAM,iCAAiC,yBAClC,+BAA+B,GAC/B,oBAAoB,CACxB,CAAA;AAED,IAAM,iCAAiC,GAAwC;IAC7E,mBAAmB,EAAE,UAAU;IAC/B,yBAAyB,EAAE,UAAU;CACtC,CAAA;AAED,IAAM,2CAA2C,GAAkD;IACjG,qBAAqB,EAAE,UAAU;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