@wallfree-dev/module-kit 0.13.42

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 (192) hide show
  1. package/LICENSE.md +7 -0
  2. package/block-explorer/block-explorer.d.ts +8 -0
  3. package/block-explorer/block-explorer.js +3 -0
  4. package/block-explorer/block-explorer.js.map +1 -0
  5. package/block-explorer/extensions/extensions.d.ts +2 -0
  6. package/block-explorer/extensions/extensions.js +3 -0
  7. package/block-explorer/extensions/extensions.js.map +1 -0
  8. package/factories/amount.d.ts +4 -0
  9. package/factories/amount.js +16 -0
  10. package/factories/amount.js.map +1 -0
  11. package/factories/key.d.ts +5 -0
  12. package/factories/key.js +24 -0
  13. package/factories/key.js.map +1 -0
  14. package/factories/signature.d.ts +2 -0
  15. package/factories/signature.js +9 -0
  16. package/factories/signature.js.map +1 -0
  17. package/factories/transaction.d.ts +3 -0
  18. package/factories/transaction.js +23 -0
  19. package/factories/transaction.js.map +1 -0
  20. package/factories/ui/alert.d.ts +5 -0
  21. package/factories/ui/alert.js +31 -0
  22. package/factories/ui/alert.js.map +1 -0
  23. package/factories/ui/text.d.ts +2 -0
  24. package/factories/ui/text.js +8 -0
  25. package/factories/ui/text.js.map +1 -0
  26. package/index.d.ts +62 -0
  27. package/index.js +85 -0
  28. package/index.js.map +1 -0
  29. package/internal/index.d.ts +5 -0
  30. package/internal/index.js +7 -0
  31. package/internal/index.js.map +1 -0
  32. package/internal/protocol/AirGapDelegateProtocol.d.ts +20 -0
  33. package/internal/protocol/AirGapDelegateProtocol.js +3 -0
  34. package/internal/protocol/AirGapDelegateProtocol.js.map +1 -0
  35. package/internal/utils/protocol.d.ts +5 -0
  36. package/internal/utils/protocol.js +24 -0
  37. package/internal/utils/protocol.js.map +1 -0
  38. package/module/extensions/extensions.d.ts +7 -0
  39. package/module/extensions/extensions.js +3 -0
  40. package/module/extensions/extensions.js.map +1 -0
  41. package/module/extensions/serialization/ProtocolSerializer.d.ts +19 -0
  42. package/module/extensions/serialization/ProtocolSerializer.js +3 -0
  43. package/module/extensions/serialization/ProtocolSerializer.js.map +1 -0
  44. package/module/module-network-registry.d.ts +11 -0
  45. package/module/module-network-registry.js +22 -0
  46. package/module/module-network-registry.js.map +1 -0
  47. package/module/module.d.ts +24 -0
  48. package/module/module.js +3 -0
  49. package/module/module.js.map +1 -0
  50. package/package.json +56 -0
  51. package/protocol/extensions/address/FetchDataForAddressExtension.d.ts +9 -0
  52. package/protocol/extensions/address/FetchDataForAddressExtension.js +3 -0
  53. package/protocol/extensions/address/FetchDataForAddressExtension.js.map +1 -0
  54. package/protocol/extensions/address/FetchDataForMultipleAddressesExtension.d.ts +9 -0
  55. package/protocol/extensions/address/FetchDataForMultipleAddressesExtension.js +3 -0
  56. package/protocol/extensions/address/FetchDataForMultipleAddressesExtension.js.map +1 -0
  57. package/protocol/extensions/address/MultiAddressPublicKeyExtension.d.ts +8 -0
  58. package/protocol/extensions/address/MultiAddressPublicKeyExtension.js +3 -0
  59. package/protocol/extensions/address/MultiAddressPublicKeyExtension.js.map +1 -0
  60. package/protocol/extensions/bip/Bip32Extension.d.ts +16 -0
  61. package/protocol/extensions/bip/Bip32Extension.js +3 -0
  62. package/protocol/extensions/bip/Bip32Extension.js.map +1 -0
  63. package/protocol/extensions/contract/ConfigurableContractExtension.d.ts +7 -0
  64. package/protocol/extensions/contract/ConfigurableContractExtension.js +3 -0
  65. package/protocol/extensions/contract/ConfigurableContractExtension.js.map +1 -0
  66. package/protocol/extensions/crypto/AESExtension.d.ts +7 -0
  67. package/protocol/extensions/crypto/AESExtension.js +3 -0
  68. package/protocol/extensions/crypto/AESExtension.js.map +1 -0
  69. package/protocol/extensions/crypto/AsymmetricEncryptionExtension.d.ts +9 -0
  70. package/protocol/extensions/crypto/AsymmetricEncryptionExtension.js +3 -0
  71. package/protocol/extensions/crypto/AsymmetricEncryptionExtension.js.map +1 -0
  72. package/protocol/extensions/crypto/CryptoExtension.d.ts +5 -0
  73. package/protocol/extensions/crypto/CryptoExtension.js +3 -0
  74. package/protocol/extensions/crypto/CryptoExtension.js.map +1 -0
  75. package/protocol/extensions/crypto/SignMessageExtension.d.ts +10 -0
  76. package/protocol/extensions/crypto/SignMessageExtension.js +3 -0
  77. package/protocol/extensions/crypto/SignMessageExtension.js.map +1 -0
  78. package/protocol/extensions/dapp/WalletConnectProtocol.d.ts +17 -0
  79. package/protocol/extensions/dapp/WalletConnectProtocol.js +3 -0
  80. package/protocol/extensions/dapp/WalletConnectProtocol.js.map +1 -0
  81. package/protocol/extensions/extensions.d.ts +43 -0
  82. package/protocol/extensions/extensions.js +3 -0
  83. package/protocol/extensions/extensions.js.map +1 -0
  84. package/protocol/extensions/multisig/multisig.d.ts +7 -0
  85. package/protocol/extensions/multisig/multisig.js +3 -0
  86. package/protocol/extensions/multisig/multisig.js.map +1 -0
  87. package/protocol/extensions/sub-protocol/GetTokenBalancesExtension.d.ts +19 -0
  88. package/protocol/extensions/sub-protocol/GetTokenBalancesExtension.js +3 -0
  89. package/protocol/extensions/sub-protocol/GetTokenBalancesExtension.js.map +1 -0
  90. package/protocol/extensions/sub-protocol/MultiTokenSubProtocolExtension.d.ts +12 -0
  91. package/protocol/extensions/sub-protocol/MultiTokenSubProtocolExtension.js +3 -0
  92. package/protocol/extensions/sub-protocol/MultiTokenSubProtocolExtension.js.map +1 -0
  93. package/protocol/extensions/sub-protocol/SingleTokenSubProtocolExtension.d.ts +9 -0
  94. package/protocol/extensions/sub-protocol/SingleTokenSubProtocolExtension.js +3 -0
  95. package/protocol/extensions/sub-protocol/SingleTokenSubProtocolExtension.js.map +1 -0
  96. package/protocol/extensions/sub-protocol/SubProtocolExtension.d.ts +7 -0
  97. package/protocol/extensions/sub-protocol/SubProtocolExtension.js +3 -0
  98. package/protocol/extensions/sub-protocol/SubProtocolExtension.js.map +1 -0
  99. package/protocol/extensions/transaction/ConfigurableTransactionInjectorExtension.d.ts +6 -0
  100. package/protocol/extensions/transaction/ConfigurableTransactionInjectorExtension.js +3 -0
  101. package/protocol/extensions/transaction/ConfigurableTransactionInjectorExtension.js.map +1 -0
  102. package/protocol/extensions/transaction/TransactionStatusCheckerExtension.d.ts +6 -0
  103. package/protocol/extensions/transaction/TransactionStatusCheckerExtension.js +3 -0
  104. package/protocol/extensions/transaction/TransactionStatusCheckerExtension.js.map +1 -0
  105. package/protocol/protocol.d.ts +68 -0
  106. package/protocol/protocol.js +3 -0
  107. package/protocol/protocol.js.map +1 -0
  108. package/readme.md +0 -0
  109. package/serializer/serializer.d.ts +12 -0
  110. package/serializer/serializer.js +3 -0
  111. package/serializer/serializer.js.map +1 -0
  112. package/types/address.d.ts +8 -0
  113. package/types/address.js +3 -0
  114. package/types/address.js.map +1 -0
  115. package/types/airgap.d.ts +15 -0
  116. package/types/airgap.js +3 -0
  117. package/types/airgap.js.map +1 -0
  118. package/types/amount.d.ts +16 -0
  119. package/types/amount.js +46 -0
  120. package/types/amount.js.map +1 -0
  121. package/types/balance.d.ts +5 -0
  122. package/types/balance.js +3 -0
  123. package/types/balance.js.map +1 -0
  124. package/types/base/cursor.d.ts +3 -0
  125. package/types/base/cursor.js +3 -0
  126. package/types/base/cursor.js.map +1 -0
  127. package/types/base/sealed.d.ts +3 -0
  128. package/types/base/sealed.js +3 -0
  129. package/types/base/sealed.js.map +1 -0
  130. package/types/block-explorer.d.ts +4 -0
  131. package/types/block-explorer.js +3 -0
  132. package/types/block-explorer.js.map +1 -0
  133. package/types/bytes.d.ts +8 -0
  134. package/types/bytes.js +3 -0
  135. package/types/bytes.js.map +1 -0
  136. package/types/crypto.d.ts +29 -0
  137. package/types/crypto.js +3 -0
  138. package/types/crypto.js.map +1 -0
  139. package/types/fee.d.ts +7 -0
  140. package/types/fee.js +3 -0
  141. package/types/fee.js.map +1 -0
  142. package/types/key.d.ts +20 -0
  143. package/types/key.js +3 -0
  144. package/types/key.js.map +1 -0
  145. package/types/meta/utility-types.d.ts +8 -0
  146. package/types/meta/utility-types.js +3 -0
  147. package/types/meta/utility-types.js.map +1 -0
  148. package/types/module.d.ts +14 -0
  149. package/types/module.js +3 -0
  150. package/types/module.js.map +1 -0
  151. package/types/protocol.d.ts +57 -0
  152. package/types/protocol.js +3 -0
  153. package/types/protocol.js.map +1 -0
  154. package/types/serializer.d.ts +6 -0
  155. package/types/serializer.js +3 -0
  156. package/types/serializer.js.map +1 -0
  157. package/types/signature.d.ts +3 -0
  158. package/types/signature.js +3 -0
  159. package/types/signature.js.map +1 -0
  160. package/types/sub-protocol.d.ts +1 -0
  161. package/types/sub-protocol.js +3 -0
  162. package/types/sub-protocol.js.map +1 -0
  163. package/types/transaction.d.ts +68 -0
  164. package/types/transaction.js +3 -0
  165. package/types/transaction.js.map +1 -0
  166. package/types/ui/action.d.ts +4 -0
  167. package/types/ui/action.js +3 -0
  168. package/types/ui/action.js.map +1 -0
  169. package/types/ui/alert.d.ts +9 -0
  170. package/types/ui/alert.js +3 -0
  171. package/types/ui/alert.js.map +1 -0
  172. package/types/ui/text.d.ts +9 -0
  173. package/types/ui/text.js +3 -0
  174. package/types/ui/text.js.map +1 -0
  175. package/utils/amount.d.ts +2 -0
  176. package/utils/amount.js +13 -0
  177. package/utils/amount.js.map +1 -0
  178. package/utils/interface.d.ts +2 -0
  179. package/utils/interface.js +11 -0
  180. package/utils/interface.js.map +1 -0
  181. package/utils/key.d.ts +8 -0
  182. package/utils/key.js +26 -0
  183. package/utils/key.js.map +1 -0
  184. package/utils/module.d.ts +9 -0
  185. package/utils/module.js +42 -0
  186. package/utils/module.js.map +1 -0
  187. package/utils/normalize.d.ts +1 -0
  188. package/utils/normalize.js +8 -0
  189. package/utils/normalize.js.map +1 -0
  190. package/utils/protocol.d.ts +63 -0
  191. package/utils/protocol.js +198 -0
  192. package/utils/protocol.js.map +1 -0
@@ -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/module/module.ts"],"names":[],"mappings":""}
package/package.json ADDED
@@ -0,0 +1,56 @@
1
+ {
2
+ "name": "@wallfree-dev/module-kit",
3
+ "version": "0.13.42",
4
+ "description": "The @wallfree-dev/module-kit package provides the common interfaces and functionalities to implement AirGap modules.",
5
+ "keywords": [
6
+ "airgap",
7
+ "blockchain",
8
+ "crypto"
9
+ ],
10
+ "license": "MIT",
11
+ "homepage": "https://www.airgap.it",
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "https://github.com/airgap-it/airgap-coin-lib"
15
+ },
16
+ "publishConfig": {
17
+ "access": "public"
18
+ },
19
+ "scripts": {
20
+ "build": "rm -rf ./dist && tsc && node scripts/copy-files-after-build.js && node scripts/make-ts-declaration-files-backwards-compatible.js",
21
+ "build-scripts": "tsc scripts/copy-files-after-build.ts scripts/make-ts-declaration-files-backwards-compatible.ts",
22
+ "lint": "tslint -c ./tslint.json --project ./tsconfig.json --format stylish --fix",
23
+ "lint:prettier": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
24
+ "lint-ci": "tslint -t json -o ../../lint-reports/module-kit.json --project . || true",
25
+ "lint-ci:prettier": "prettier \"src/**/*.ts\" \"test/**/*.ts\" --list-different",
26
+ "test": "",
27
+ "test-ci": "",
28
+ "browserify": "browserify ./dist/index.js -s airgapModuleKit > ./dist/airgap-module-kit.min.js"
29
+ },
30
+ "author": "Papers AG <contact@papers.ch> (https://papers.ch)",
31
+ "dependencies": {
32
+ "@wallfree-dev/coinlib-core": "^0.13.42",
33
+ "@wallfree-dev/serializer": "^0.13.42"
34
+ },
35
+ "nyc": {
36
+ "include": [
37
+ "src/**/*.ts"
38
+ ],
39
+ "exclude": [
40
+ "test/**/*.spec.ts"
41
+ ],
42
+ "extension": [
43
+ ".ts"
44
+ ],
45
+ "require": [
46
+ "ts-node/register"
47
+ ],
48
+ "reporter": [
49
+ "text",
50
+ "text-summary"
51
+ ],
52
+ "report-dir": "../../coverage/module-kit",
53
+ "sourceMap": true,
54
+ "instrument": true
55
+ }
56
+ }
@@ -0,0 +1,9 @@
1
+ import { Address } from '../../../types/address';
2
+ import { Balance } from '../../../types/balance';
3
+ import { AirGapTransactionsWithCursor } from '../../../types/transaction';
4
+ import { _OnlineProtocol, OnlineGeneric } from '../../protocol';
5
+ export declare type FetchDataForAddressExtension<T extends _OnlineProtocol> = T extends _OnlineProtocol<any, any, any, infer _Units, infer _FeeUnits, any, any, any, infer _TransactionCursor, any, infer _BalanceConfiguration> ? FetchDataForAddressProtocol<_Units, _FeeUnits, _TransactionCursor, _BalanceConfiguration> : never;
6
+ export interface FetchDataForAddressProtocol<_Units extends OnlineGeneric['Units'] = OnlineGeneric['Units'], _FeeUnits extends OnlineGeneric['FeeUnits'] = OnlineGeneric['FeeUnits'], _TransactionCursor extends OnlineGeneric['TransactionCursor'] = OnlineGeneric['TransactionCursor'], _BalanceConfiguration extends Object | undefined = undefined> {
7
+ getTransactionsForAddress(address: Address, limit: number, cursor?: _TransactionCursor): Promise<AirGapTransactionsWithCursor<_TransactionCursor, _Units, _FeeUnits>>;
8
+ getBalanceOfAddress(address: Address, configuration?: _BalanceConfiguration): Promise<Balance<_Units>>;
9
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=FetchDataForAddressExtension.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FetchDataForAddressExtension.js","sourceRoot":"","sources":["../../../../src/protocol/extensions/address/FetchDataForAddressExtension.ts"],"names":[],"mappings":""}
@@ -0,0 +1,9 @@
1
+ import { Address } from '../../../types/address';
2
+ import { Balance } from '../../../types/balance';
3
+ import { AirGapTransactionsWithCursor } from '../../../types/transaction';
4
+ import { _OnlineProtocol, OnlineGeneric } from '../../protocol';
5
+ export declare type FetchDataForMultipleAddressesExtension<T extends _OnlineProtocol> = T extends _OnlineProtocol<any, any, any, infer _Units, infer _FeeUnits, any, any, any, infer _TransactionCursor, any, infer _BalanceConfiguration> ? FetchDataForMultipleAddressesProtocol<_Units, _FeeUnits, _TransactionCursor, _BalanceConfiguration> : never;
6
+ export interface FetchDataForMultipleAddressesProtocol<_Units extends OnlineGeneric['Units'] = OnlineGeneric['Units'], _FeeUnits extends OnlineGeneric['FeeUnits'] = OnlineGeneric['FeeUnits'], _TransactionCursor extends OnlineGeneric['TransactionCursor'] = OnlineGeneric['TransactionCursor'], _BalanceConfiguration extends Object | undefined = undefined> {
7
+ getTransactionsForAddresses(addresses: Address[], limit: number, cursor?: _TransactionCursor): Promise<AirGapTransactionsWithCursor<_TransactionCursor, _Units, _FeeUnits>>;
8
+ getBalanceOfAddresses(addresses: Address[], configuration?: _BalanceConfiguration): Promise<Balance<_Units>>;
9
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=FetchDataForMultipleAddressesExtension.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FetchDataForMultipleAddressesExtension.js","sourceRoot":"","sources":["../../../../src/protocol/extensions/address/FetchDataForMultipleAddressesExtension.ts"],"names":[],"mappings":""}
@@ -0,0 +1,8 @@
1
+ import { AddressWithCursor } from '../../../types/address';
2
+ import { ExtendedPublicKey, PublicKey } from '../../../types/key';
3
+ import { _AnyProtocol, _BaseProtocol, BaseGeneric } from '../../protocol';
4
+ export declare type MultiAddressPublicKeyExtension<T extends _AnyProtocol> = T extends _BaseProtocol<infer _BaseAddressCursor, infer _AddressResult, any, any, any, any, infer _PublicKey> ? _AddressResult extends AddressWithCursor<infer _AddressCursor> ? MultiAddressPublicKeyProtocol<_AddressCursor, _PublicKey> : MultiAddressPublicKeyProtocol<_BaseAddressCursor, _PublicKey> : never;
5
+ export interface MultiAddressPublicKeyProtocol<_AddressCursor extends BaseGeneric['AddressCursor'] = BaseGeneric['AddressCursor'], _PublicKey extends PublicKey | ExtendedPublicKey = PublicKey | ExtendedPublicKey> {
6
+ getInitialAddressesFromPublicKey(publicKey: _PublicKey): Promise<AddressWithCursor<_AddressCursor>[]>;
7
+ getNextAddressFromPublicKey(publicKey: _PublicKey, cursor: _AddressCursor): Promise<AddressWithCursor<_AddressCursor> | undefined>;
8
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=MultiAddressPublicKeyExtension.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MultiAddressPublicKeyExtension.js","sourceRoot":"","sources":["../../../../src/protocol/extensions/address/MultiAddressPublicKeyExtension.ts"],"names":[],"mappings":""}
@@ -0,0 +1,16 @@
1
+ import { CryptoDerivative } from '../../../types/crypto';
2
+ import { ExtendedKeyPair, ExtendedPublicKey, ExtendedSecretKey, KeyPair, PublicKey, SecretKey } from '../../../types/key';
3
+ import { _AnyProtocol, _BaseProtocol, _OfflineProtocol, _OnlineProtocol, _Protocol, BaseGeneric, OfflineGeneric, OnlineGeneric } from '../../protocol';
4
+ export declare type Bip32Extension<T extends _AnyProtocol> = T extends _Protocol ? InferredOfflineBip32Protocol<T> & InferredOnlineBip32Protocol<T> : T extends _OfflineProtocol ? InferredOfflineBip32Protocol<T> : T extends _OnlineProtocol ? InferredOnlineBip32Protocol<T> : never;
5
+ declare type InferredOfflineBip32Protocol<T> = T extends _OfflineProtocol<infer _AddressCursor, infer _AddressResult, infer _Units, infer _FeeUnits, infer _SignedTransaction, infer _UnsignedTransaction> ? OfflineBip32Protocol<_AddressCursor, _AddressResult, _Units, _FeeUnits, _SignedTransaction, _UnsignedTransaction> : never;
6
+ declare type InferredOnlineBip32Protocol<T> = T extends _OnlineProtocol<infer _AddressCursor, infer _AddressResult, infer _ProtocolNetwork, infer _Units, infer _FeeUnits, infer _FeeEstimation, infer _SignedTransaction, infer _UnsignedTransaction, infer _TransactionCursor, any, infer _BalanceConfiguration> ? OnlineBip32Protocol<_AddressCursor, _AddressResult, _ProtocolNetwork, _Units, _FeeUnits, _FeeEstimation, _SignedTransaction, _UnsignedTransaction, _TransactionCursor, _BalanceConfiguration> : never;
7
+ export interface BaseBip32Protocol<_AddressCursor extends BaseGeneric['AddressCursor'] = BaseGeneric['AddressCursor'], _AddressResult extends BaseGeneric['AddressResult'] = BaseGeneric['AddressResult'], _Units extends BaseGeneric['Units'] = BaseGeneric['Units'], _FeeUnits extends BaseGeneric['FeeUnits'] = BaseGeneric['FeeUnits'], _SignedTransaction extends BaseGeneric['SignedTransaction'] = BaseGeneric['SignedTransaction'], _UnsignedTransaction extends BaseGeneric['UnsignedTransaction'] = BaseGeneric['UnsignedTransaction']> extends _BaseProtocol<_AddressCursor, _AddressResult, _Units, _FeeUnits, _SignedTransaction, _UnsignedTransaction, PublicKey | ExtendedPublicKey> {
8
+ deriveFromExtendedPublicKey(extendedPublicKey: ExtendedPublicKey, visibilityIndex: number, addressIndex: number): Promise<PublicKey>;
9
+ }
10
+ export interface OfflineBip32Protocol<_AddressCursor extends OfflineGeneric['AddressCursor'] = OfflineGeneric['AddressCursor'], _AddressResult extends OfflineGeneric['AddressResult'] = OfflineGeneric['AddressResult'], _CryptoConfiguration extends OfflineGeneric['CryptoConfiguration'] = OfflineGeneric['CryptoConfiguration'], _Units extends OfflineGeneric['Units'] = OfflineGeneric['Units'], _FeeUnits extends OfflineGeneric['FeeUnits'] = OfflineGeneric['FeeUnits'], _SignedTransaction extends OfflineGeneric['SignedTransaction'] = OfflineGeneric['SignedTransaction'], _UnsignedTransaction extends OfflineGeneric['UnsignedTransaction'] = OfflineGeneric['UnsignedTransaction']> extends BaseBip32Protocol<_AddressCursor, _AddressResult, _Units, _FeeUnits, _SignedTransaction, _UnsignedTransaction>, _OfflineProtocol<_AddressCursor, _AddressResult, _CryptoConfiguration, _Units, _FeeUnits, _SignedTransaction, _UnsignedTransaction, PublicKey | ExtendedPublicKey, SecretKey | ExtendedSecretKey, KeyPair | ExtendedKeyPair> {
11
+ getExtendedKeyPairFromDerivative(derivative: CryptoDerivative): Promise<ExtendedKeyPair>;
12
+ deriveFromExtendedSecretKey(extendedSecretKey: ExtendedSecretKey, visibilityIndex: number, addressIndex: number): Promise<SecretKey>;
13
+ }
14
+ export interface OnlineBip32Protocol<_AddressCursor extends OnlineGeneric['AddressCursor'] = OnlineGeneric['AddressCursor'], _AddressResult extends OnlineGeneric['AddressResult'] = OnlineGeneric['AddressResult'], _ProtocolNetwork extends OnlineGeneric['ProtocolNetwork'] = OnlineGeneric['ProtocolNetwork'], _Units extends OnlineGeneric['Units'] = OnlineGeneric['Units'], _FeeUnits extends OnlineGeneric['FeeUnits'] = OnlineGeneric['FeeUnits'], _FeeEstimation extends OnlineGeneric['FeeEstimation'] = OnlineGeneric['FeeEstimation'], _SignedTransaction extends OnlineGeneric['SignedTransaction'] = OnlineGeneric['SignedTransaction'], _UnsignedTransaction extends OnlineGeneric['UnsignedTransaction'] = OnlineGeneric['UnsignedTransaction'], _TransactionCursor extends OnlineGeneric['TransactionCursor'] = OnlineGeneric['TransactionCursor'], _BalanceConfiguration extends Object | undefined = undefined> extends BaseBip32Protocol<_AddressCursor, _AddressResult, _Units, _FeeUnits, _SignedTransaction, _UnsignedTransaction>, _OnlineProtocol<_AddressCursor, _AddressResult, _ProtocolNetwork, _Units, _FeeUnits, _FeeEstimation, _SignedTransaction, _UnsignedTransaction, _TransactionCursor, PublicKey | ExtendedPublicKey, _BalanceConfiguration> {
15
+ }
16
+ export {};
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=Bip32Extension.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Bip32Extension.js","sourceRoot":"","sources":["../../../../src/protocol/extensions/bip/Bip32Extension.ts"],"names":[],"mappings":""}
@@ -0,0 +1,7 @@
1
+ import { _AnyProtocol } from '../../protocol';
2
+ export declare type ConfigurableContractExtension<_T extends _AnyProtocol> = ConfigurableContractProtocol;
3
+ export interface ConfigurableContractProtocol {
4
+ isContractValid(address: string): Promise<boolean>;
5
+ getContractAddress(): Promise<string | undefined>;
6
+ setContractAddress(address: string): Promise<void>;
7
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=ConfigurableContractExtension.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConfigurableContractExtension.js","sourceRoot":"","sources":["../../../../src/protocol/extensions/contract/ConfigurableContractExtension.ts"],"names":[],"mappings":""}
@@ -0,0 +1,7 @@
1
+ import { ExtendedSecretKey, SecretKey } from '../../../types/key';
2
+ import { _OfflineProtocol } from '../../protocol';
3
+ export declare type AESExtension<T extends _OfflineProtocol> = T extends _OfflineProtocol<any, any, any, any, any, any, any, any, infer _SecretKey> ? AES<_SecretKey> : never;
4
+ export interface AES<_SecretKey extends SecretKey | ExtendedSecretKey = SecretKey> {
5
+ encryptAESWithSecretKey(payload: string, secretKey: _SecretKey): Promise<string>;
6
+ decryptAESWithSecretKey(payload: string, secretKey: _SecretKey): Promise<string>;
7
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=AESExtension.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AESExtension.js","sourceRoot":"","sources":["../../../../src/protocol/extensions/crypto/AESExtension.ts"],"names":[],"mappings":""}
@@ -0,0 +1,9 @@
1
+ import { ExtendedKeyPair, ExtendedPublicKey, KeyPair, PublicKey } from '../../../types/key';
2
+ import { _AnyProtocol, _BaseProtocol, _OfflineProtocol } from '../../protocol';
3
+ export declare type AsymmetricEncryptionExtension<T extends _AnyProtocol> = T extends _OfflineProtocol<any, any, any, any, any, any, any, infer _PublicKey, any, infer _KeyPair> ? OfflineAsymmetricEncryption<_PublicKey, _KeyPair> : T extends _BaseProtocol<any, any, any, any, any, any, infer _PublicKey> ? BaseAsymmetricEncryption<_PublicKey> : never;
4
+ export interface BaseAsymmetricEncryption<_PublicKey extends PublicKey | ExtendedPublicKey = PublicKey> {
5
+ encryptAsymmetricWithPublicKey(payload: string, publicKey: _PublicKey): Promise<string>;
6
+ }
7
+ export interface OfflineAsymmetricEncryption<_PublicKey extends PublicKey | ExtendedPublicKey = PublicKey, _KeyPair extends KeyPair | ExtendedKeyPair = KeyPair> extends BaseAsymmetricEncryption<_PublicKey> {
8
+ decryptAsymmetricWithKeyPair(payload: string, keyPair: _KeyPair): Promise<string>;
9
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=AsymmetricEncryptionExtension.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AsymmetricEncryptionExtension.js","sourceRoot":"","sources":["../../../../src/protocol/extensions/crypto/AsymmetricEncryptionExtension.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ import { _AnyProtocol, _OfflineProtocol } from '../../protocol';
2
+ import { AESExtension } from './AESExtension';
3
+ import { AsymmetricEncryptionExtension } from './AsymmetricEncryptionExtension';
4
+ import { SignMessageExtension } from './SignMessageExtension';
5
+ export declare type CryptoExtension<T extends _AnyProtocol> = SignMessageExtension<T> & AsymmetricEncryptionExtension<T> & (T extends _OfflineProtocol ? AESExtension<T> : {});
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=CryptoExtension.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CryptoExtension.js","sourceRoot":"","sources":["../../../../src/protocol/extensions/crypto/CryptoExtension.ts"],"names":[],"mappings":""}
@@ -0,0 +1,10 @@
1
+ import { ExtendedKeyPair, ExtendedPublicKey, KeyPair, PublicKey } from '../../../types/key';
2
+ import { Signature } from '../../../types/signature';
3
+ import { _AnyProtocol, _BaseProtocol, _OfflineProtocol } from '../../protocol';
4
+ export declare type SignMessageExtension<T extends _AnyProtocol> = T extends _OfflineProtocol<any, any, any, any, any, any, any, infer _PublicKey, any, infer _KeyPair> ? OfflineSignMessage<_PublicKey, _KeyPair> : T extends _BaseProtocol<any, any, any, any, any, any, infer _PublicKey> ? BaseSignMessage<_PublicKey> : never;
5
+ export interface BaseSignMessage<_PublicKey extends PublicKey | ExtendedPublicKey = PublicKey> {
6
+ verifyMessageWithPublicKey(message: string, signature: Signature, publicKey: _PublicKey): Promise<boolean>;
7
+ }
8
+ export interface OfflineSignMessage<_PublicKey extends PublicKey | ExtendedPublicKey = PublicKey, _KeyPair extends KeyPair | ExtendedKeyPair = KeyPair> extends BaseSignMessage<_PublicKey> {
9
+ signMessageWithKeyPair(message: string, keyPair: _KeyPair): Promise<Signature>;
10
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=SignMessageExtension.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SignMessageExtension.js","sourceRoot":"","sources":["../../../../src/protocol/extensions/crypto/SignMessageExtension.ts"],"names":[],"mappings":""}
@@ -0,0 +1,17 @@
1
+ import { ExtendedPublicKey, PublicKey } from '../../../types/key';
2
+ import { UnsignedTransaction } from '../../../types/transaction';
3
+ import { _OnlineProtocol } from '../../protocol';
4
+ export declare type WalletConnectExtension<T extends _OnlineProtocol> = T extends _OnlineProtocol<any, any, any, any, any, any, any, infer _UnsignedTransaction, any, infer _PublicKey> ? WalletConnectProtocol<_UnsignedTransaction, _PublicKey> : never;
5
+ export interface WalletConnectRequest {
6
+ from?: string;
7
+ to?: string;
8
+ data?: string;
9
+ gasLimit?: string;
10
+ gasPrice?: string;
11
+ value?: string;
12
+ nonce?: string;
13
+ }
14
+ export interface WalletConnectProtocol<_UnsignedTransaction extends UnsignedTransaction = UnsignedTransaction, _PublicKey extends PublicKey | ExtendedPublicKey = PublicKey | ExtendedPublicKey> {
15
+ getWalletConnectChain(): Promise<string>;
16
+ prepareWalletConnectTransactionWithPublicKey(publicKey: _PublicKey, request: WalletConnectRequest): Promise<_UnsignedTransaction>;
17
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=WalletConnectProtocol.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WalletConnectProtocol.js","sourceRoot":"","sources":["../../../../src/protocol/extensions/dapp/WalletConnectProtocol.ts"],"names":[],"mappings":""}
@@ -0,0 +1,43 @@
1
+ import { _AnyProtocol, _OfflineProtocol, _OnlineProtocol, _Protocol } from '../protocol';
2
+ import { FetchDataForAddressExtension } from './address/FetchDataForAddressExtension';
3
+ import { FetchDataForMultipleAddressesExtension } from './address/FetchDataForMultipleAddressesExtension';
4
+ import { MultiAddressPublicKeyExtension } from './address/MultiAddressPublicKeyExtension';
5
+ import { Bip32Extension } from './bip/Bip32Extension';
6
+ import { ConfigurableContractExtension } from './contract/ConfigurableContractExtension';
7
+ import { AESExtension } from './crypto/AESExtension';
8
+ import { AsymmetricEncryptionExtension } from './crypto/AsymmetricEncryptionExtension';
9
+ import { CryptoExtension } from './crypto/CryptoExtension';
10
+ import { SignMessageExtension } from './crypto/SignMessageExtension';
11
+ import { WalletConnectExtension } from './dapp/WalletConnectProtocol';
12
+ import { MultisigExtension } from './multisig/multisig';
13
+ import { GetTokenBalancesExtension } from './sub-protocol/GetTokenBalancesExtension';
14
+ import { MultiTokenSubProtocolExtension } from './sub-protocol/MultiTokenSubProtocolExtension';
15
+ import { SingleTokenSubProtocolExtension } from './sub-protocol/SingleTokenSubProtocolExtension';
16
+ import { SubProtocolExtension } from './sub-protocol/SubProtocolExtension';
17
+ import { ConfigurableTransactionInjectorExtension } from './transaction/ConfigurableTransactionInjectorExtension';
18
+ import { TransactionStatusCheckerExtension } from './transaction/TransactionStatusCheckerExtension';
19
+ export declare type ProtocolExtensions<T> = T extends _Protocol ? OfflineExtensions<T> & OnlineExtensions<T> : T extends _OfflineProtocol ? OfflineExtensions<T> : T extends _OnlineProtocol ? OnlineExtensions<T> : never;
20
+ interface OfflineAndOnlineExtensions<T extends _AnyProtocol> {
21
+ Bip32: Bip32Extension<T>;
22
+ ConfigurableContract: ConfigurableContractExtension<T>;
23
+ MultiAddressPublicKey: MultiAddressPublicKeyExtension<T>;
24
+ SubProtocol: SubProtocolExtension<T>;
25
+ SingleTokenSubProtocol: SingleTokenSubProtocolExtension<T>;
26
+ MultiTokenSubProtocol: MultiTokenSubProtocolExtension<T>;
27
+ Crypto: CryptoExtension<T>;
28
+ AsymmetricEncryption: AsymmetricEncryptionExtension<T>;
29
+ SignMessage: SignMessageExtension<T>;
30
+ }
31
+ interface OfflineExtensions<T extends _OfflineProtocol> extends OfflineAndOnlineExtensions<T> {
32
+ AES: AESExtension<T>;
33
+ }
34
+ interface OnlineExtensions<T extends _OnlineProtocol> extends OfflineAndOnlineExtensions<T> {
35
+ FetchDataForAddress: FetchDataForAddressExtension<T>;
36
+ FetchDataForMultipleAddresses: FetchDataForMultipleAddressesExtension<T>;
37
+ GetTokenBalances: GetTokenBalancesExtension<T>;
38
+ ConfigurableTransactionInjector: ConfigurableTransactionInjectorExtension<T>;
39
+ TransactionStatusChecker: TransactionStatusCheckerExtension<T>;
40
+ WalletConnect: WalletConnectExtension<T>;
41
+ Multisig: MultisigExtension<T>;
42
+ }
43
+ export {};
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=extensions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extensions.js","sourceRoot":"","sources":["../../../src/protocol/extensions/extensions.ts"],"names":[],"mappings":""}
@@ -0,0 +1,7 @@
1
+ import { PublicKey, ExtendedPublicKey } from '../../../types/key';
2
+ import { UnsignedTransaction } from '../../../types/transaction';
3
+ import { _AnyProtocol, _BaseProtocol } from '../../protocol';
4
+ export declare type MultisigExtension<T extends _AnyProtocol> = T extends _BaseProtocol<any, any, any, any, any, any, infer _PublicKey> ? MultisigProtocol<_PublicKey, UnsignedTransaction> : never;
5
+ export interface MultisigProtocol<_PublicKey extends PublicKey | ExtendedPublicKey = PublicKey, _UnsignedTransaction extends UnsignedTransaction = UnsignedTransaction> {
6
+ getMultisigStatus(publicKey: PublicKey): Promise<boolean>;
7
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=multisig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"multisig.js","sourceRoot":"","sources":["../../../../src/protocol/extensions/multisig/multisig.ts"],"names":[],"mappings":""}
@@ -0,0 +1,19 @@
1
+ import { Amount } from '../../../types/amount';
2
+ import { ExtendedPublicKey, PublicKey } from '../../../types/key';
3
+ import { _OnlineProtocol } from '../../protocol';
4
+ export declare type GetTokenBalancesExtension<T extends _OnlineProtocol> = T extends _OnlineProtocol<any, any, any, any, any, any, any, any, any, infer _PublicKey> ? GetTokenBalances<_PublicKey> : never;
5
+ interface BaseTokenDetails<_Type extends string> {
6
+ type: _Type;
7
+ identifier: string;
8
+ contractAddress: string;
9
+ }
10
+ interface SingleTokenDetails extends BaseTokenDetails<'single'> {
11
+ }
12
+ interface MultiTokenDetails extends BaseTokenDetails<'multi'> {
13
+ tokenId: string;
14
+ }
15
+ export declare type TokenDetails = SingleTokenDetails | MultiTokenDetails;
16
+ export interface GetTokenBalances<_PublicKey extends PublicKey | ExtendedPublicKey = PublicKey> {
17
+ getTokenBalancesOfPublicKey(publicKey: _PublicKey, tokens: TokenDetails[]): Promise<Record<string, Amount>>;
18
+ }
19
+ export {};
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=GetTokenBalancesExtension.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GetTokenBalancesExtension.js","sourceRoot":"","sources":["../../../../src/protocol/extensions/sub-protocol/GetTokenBalancesExtension.ts"],"names":[],"mappings":""}
@@ -0,0 +1,12 @@
1
+ import { ExtendedPublicKey, PublicKey } from '../../../types/key';
2
+ import { Override } from '../../../types/meta/utility-types';
3
+ import { _AnyProtocol, _OnlineProtocol, OnlineGeneric } from '../../protocol';
4
+ import { SingleTokenSubProtocol } from './SingleTokenSubProtocolExtension';
5
+ export declare type MultiTokenSubProtocolExtension<T extends _AnyProtocol> = T extends _OnlineProtocol<infer _AddressCursor, infer _AddressResult, infer _ProtocolNetwork, infer _Units, infer _FeeUnits, infer _FeeEstimation, infer _SignedTransaction, infer _UnsignedTransaction, infer _TransactionCursor, infer _PublicKey, infer _BalanceConfiguration> ? OnlineMultiTokenSubProtocol<_AddressCursor, _AddressResult, _ProtocolNetwork, _Units, _FeeUnits, _FeeEstimation, _SignedTransaction, _UnsignedTransaction, _TransactionCursor, _PublicKey, _BalanceConfiguration> : BaseMultiTokenSubProtocol;
6
+ export interface BaseMultiTokenSubProtocol extends SingleTokenSubProtocol {
7
+ }
8
+ export interface MultiTokenBalanceConfiguration {
9
+ tokenId: string;
10
+ }
11
+ export interface OnlineMultiTokenSubProtocol<_AddressCursor extends OnlineGeneric['AddressCursor'] = OnlineGeneric['AddressCursor'], _AddressResult extends OnlineGeneric['AddressResult'] = OnlineGeneric['AddressResult'], _ProtocolNetwork extends OnlineGeneric['ProtocolNetwork'] = OnlineGeneric['ProtocolNetwork'], _Units extends OnlineGeneric['Units'] = OnlineGeneric['Units'], _FeeUnits extends OnlineGeneric['FeeUnits'] = OnlineGeneric['FeeUnits'], _FeeEstimation extends OnlineGeneric['FeeEstimation'] = OnlineGeneric['FeeEstimation'], _SignedTransaction extends OnlineGeneric['SignedTransaction'] = OnlineGeneric['SignedTransaction'], _UnsignedTransaction extends OnlineGeneric['UnsignedTransaction'] = OnlineGeneric['UnsignedTransaction'], _TransactionCursor extends OnlineGeneric['TransactionCursor'] = OnlineGeneric['TransactionCursor'], _PublicKey extends PublicKey | ExtendedPublicKey = PublicKey, _BalanceConfiguration extends unknown | undefined = undefined> extends BaseMultiTokenSubProtocol, _OnlineProtocol<_AddressCursor, _AddressResult, _ProtocolNetwork, _Units, _FeeUnits, _FeeEstimation, _SignedTransaction, _UnsignedTransaction, _TransactionCursor, _PublicKey, MultiTokenBalanceConfiguration extends _BalanceConfiguration ? MultiTokenBalanceConfiguration : _BalanceConfiguration extends undefined ? MultiTokenBalanceConfiguration : Override<_BalanceConfiguration, MultiTokenBalanceConfiguration>> {
12
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=MultiTokenSubProtocolExtension.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MultiTokenSubProtocolExtension.js","sourceRoot":"","sources":["../../../../src/protocol/extensions/sub-protocol/MultiTokenSubProtocolExtension.ts"],"names":[],"mappings":""}
@@ -0,0 +1,9 @@
1
+ import { Address } from '../../../types/address';
2
+ import { SubProtocolType } from '../../../types/sub-protocol';
3
+ import { _AnyProtocol } from '../../protocol';
4
+ import { SubProtocol } from './SubProtocolExtension';
5
+ export declare type SingleTokenSubProtocolExtension<_T extends _AnyProtocol> = SingleTokenSubProtocol;
6
+ export interface SingleTokenSubProtocol extends SubProtocol {
7
+ getType(): Promise<Extract<SubProtocolType, 'token'>>;
8
+ getContractAddress(): Promise<Address>;
9
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=SingleTokenSubProtocolExtension.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SingleTokenSubProtocolExtension.js","sourceRoot":"","sources":["../../../../src/protocol/extensions/sub-protocol/SingleTokenSubProtocolExtension.ts"],"names":[],"mappings":""}
@@ -0,0 +1,7 @@
1
+ import { SubProtocolType } from '../../../types/sub-protocol';
2
+ import { _AnyProtocol } from '../../protocol';
3
+ export declare type SubProtocolExtension<_T extends _AnyProtocol> = SubProtocol;
4
+ export interface SubProtocol {
5
+ getType(): Promise<SubProtocolType>;
6
+ mainProtocol(): Promise<string>;
7
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=SubProtocolExtension.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SubProtocolExtension.js","sourceRoot":"","sources":["../../../../src/protocol/extensions/sub-protocol/SubProtocolExtension.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ import { _OnlineProtocol } from '../../protocol';
2
+ export declare type ConfigurableTransactionInjectorExtension<_T extends _OnlineProtocol> = ConfigurableTransactionInjectorProtocol;
3
+ export interface ConfigurableTransactionInjectorProtocol {
4
+ getInjectorUrl(): Promise<string | undefined>;
5
+ setInjectorUrl(url: string): Promise<void>;
6
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=ConfigurableTransactionInjectorExtension.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConfigurableTransactionInjectorExtension.js","sourceRoot":"","sources":["../../../../src/protocol/extensions/transaction/ConfigurableTransactionInjectorExtension.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ import { AirGapTransactionStatus } from '../../../types/transaction';
2
+ import { _OnlineProtocol } from '../../protocol';
3
+ export declare type TransactionStatusCheckerExtension<_T extends _OnlineProtocol> = TransactionStatusChecker;
4
+ export interface TransactionStatusChecker {
5
+ getTransactionStatus(transactionIds: string[]): Promise<Record<string, AirGapTransactionStatus>>;
6
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=TransactionStatusCheckerExtension.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TransactionStatusCheckerExtension.js","sourceRoot":"","sources":["../../../../src/protocol/extensions/transaction/TransactionStatusCheckerExtension.ts"],"names":[],"mappings":""}
@@ -0,0 +1,68 @@
1
+ import { Address, AddressCursor, AddressWithCursor } from '../types/address';
2
+ import { AirGapInterface, ApplicableProtocolExtension } from '../types/airgap';
3
+ import { Amount } from '../types/amount';
4
+ import { Balance } from '../types/balance';
5
+ import { CryptoConfiguration, CryptoDerivative } from '../types/crypto';
6
+ import { FeeEstimation } from '../types/fee';
7
+ import { ExtendedKeyPair, ExtendedPublicKey, ExtendedSecretKey, KeyPair, PublicKey, SecretKey } from '../types/key';
8
+ import { Complement } from '../types/meta/utility-types';
9
+ import { ProtocolMetadata, ProtocolNetwork } from '../types/protocol';
10
+ import { AirGapTransaction, AirGapTransactionsWithCursor, SignedTransaction, TransactionSimpleConfiguration, TransactionCursor, TransactionDetails, UnsignedTransaction, TransactionFullConfiguration } from '../types/transaction';
11
+ export interface BaseGeneric<_AddressCursor extends AddressCursor = AddressCursor, _AddressResult extends Address | AddressWithCursor<_AddressCursor> = Address | AddressWithCursor<_AddressCursor>, _Units extends string = string, _FeeUnits extends string = _Units, _SignedTransaction extends SignedTransaction = SignedTransaction, _UnsignedTransaction extends UnsignedTransaction = UnsignedTransaction> {
12
+ AddressCursor: _AddressCursor;
13
+ AddressResult: _AddressResult;
14
+ Units: _Units;
15
+ FeeUnits: _FeeUnits;
16
+ SignedTransaction: _SignedTransaction;
17
+ UnsignedTransaction: _UnsignedTransaction;
18
+ }
19
+ export interface OfflineGeneric<_AddressCursor extends AddressCursor = AddressCursor, _AddressResult extends Address | AddressWithCursor<_AddressCursor> = Address | AddressWithCursor<_AddressCursor>, _CryptoConfiguration extends CryptoConfiguration = CryptoConfiguration, _Units extends string = string, _FeeUnits extends string = _Units, _SignedTransaction extends SignedTransaction = SignedTransaction, _UnsignedTransaction extends UnsignedTransaction = UnsignedTransaction> extends BaseGeneric<_AddressCursor, _AddressResult, _Units, _FeeUnits, _SignedTransaction, _UnsignedTransaction> {
20
+ CryptoConfiguration: _CryptoConfiguration;
21
+ }
22
+ export interface OnlineGeneric<_AddressCursor extends AddressCursor = AddressCursor, _AddressResult extends Address | AddressWithCursor<_AddressCursor> = Address | AddressWithCursor<_AddressCursor>, _ProtocolNetwork extends ProtocolNetwork = ProtocolNetwork, _Units extends string = string, _FeeUnits extends string = _Units, _FeeEstimation extends FeeEstimation<_FeeUnits> | undefined = FeeEstimation<_FeeUnits> | undefined, _SignedTransaction extends SignedTransaction = SignedTransaction, _UnsignedTransaction extends UnsignedTransaction = UnsignedTransaction, _TransactionCursor extends TransactionCursor = TransactionCursor> extends BaseGeneric<_AddressCursor, _AddressResult, _Units, _FeeUnits, _SignedTransaction, _UnsignedTransaction> {
23
+ ProtocolNetwork: _ProtocolNetwork;
24
+ FeeEstimation: _FeeEstimation;
25
+ TransactionCursor: _TransactionCursor;
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'];
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
+ getMetadata(): Promise<ProtocolMetadata<_Units, _FeeUnits>>;
39
+ getAddressFromPublicKey(publicKey: _PublicKey): Promise<_AddressResult>;
40
+ getDetailsFromTransaction(transaction: _UnsignedTransaction | _SignedTransaction, publicKey: _PublicKey): Promise<AirGapTransaction<_Units, _FeeUnits>[]>;
41
+ }
42
+ export declare type BaseProtocol<G extends Partial<BaseGeneric> = {}> = _BaseProtocol<TypedAddressCursor<G>, TypedAddressResult<G>, TypedUnits<G>, TypedFeeUnits<G>, TypedSignedTransaction<G>, TypedUnsignedTransaction<G>, PublicKey>;
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
+ getCryptoConfiguration(): Promise<_CryptoConfiguration>;
45
+ getKeyPairFromDerivative(derivative: CryptoDerivative): Promise<KeyPair>;
46
+ signTransactionWithSecretKey(transaction: _UnsignedTransaction, secretKey: _SecretKey): Promise<_SignedTransaction>;
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>;
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
+ getNetwork(): Promise<_ProtocolNetwork>;
51
+ getTransactionsForPublicKey(publicKey: _PublicKey, limit: number, cursor?: _TransactionCursor): Promise<AirGapTransactionsWithCursor<_TransactionCursor, _Units, _FeeUnits>>;
52
+ getBalanceOfPublicKey(publicKey: _PublicKey, configuration?: _BalanceConfiguration): Promise<Balance<_Units>>;
53
+ getTransactionMaxAmountWithPublicKey(publicKey: _PublicKey, to: Address[], configuration?: TransactionFullConfiguration<_FeeUnits>): Promise<Amount<_Units>>;
54
+ getTransactionFeeWithPublicKey(publicKey: _PublicKey, details: TransactionDetails<_Units>[], configuration?: TransactionSimpleConfiguration): Promise<_FeeEstimation>;
55
+ prepareTransactionWithPublicKey(publicKey: _PublicKey, details: TransactionDetails<_Units>[], configuration?: TransactionFullConfiguration<_FeeUnits>): Promise<_UnsignedTransaction>;
56
+ broadcastTransaction(transaction: _SignedTransaction): Promise<string>;
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;
60
+ export interface Protocol<G extends Partial<OfflineGeneric & OnlineGeneric> = {}> extends OfflineProtocol<G>, OnlineProtocol<G> {
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>;
68
+ export {};
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=protocol.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"protocol.js","sourceRoot":"","sources":["../../src/protocol/protocol.ts"],"names":[],"mappings":""}
package/readme.md ADDED
File without changes