@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.
- package/LICENSE.md +7 -0
- package/airgap-module-kit.min.js +30062 -0
- package/block-explorer/block-explorer.d.ts +8 -0
- package/block-explorer/block-explorer.js +3 -0
- package/block-explorer/block-explorer.js.map +1 -0
- package/block-explorer/extensions/extensions.d.ts +2 -0
- package/block-explorer/extensions/extensions.js +3 -0
- package/block-explorer/extensions/extensions.js.map +1 -0
- package/factories/amount.d.ts +4 -0
- package/factories/amount.js +16 -0
- package/factories/amount.js.map +1 -0
- package/factories/key.d.ts +5 -0
- package/factories/key.js +24 -0
- package/factories/key.js.map +1 -0
- package/factories/signature.d.ts +2 -0
- package/factories/signature.js +9 -0
- package/factories/signature.js.map +1 -0
- package/factories/transaction.d.ts +3 -0
- package/factories/transaction.js +23 -0
- package/factories/transaction.js.map +1 -0
- package/factories/ui/alert.d.ts +5 -0
- package/factories/ui/alert.js +31 -0
- package/factories/ui/alert.js.map +1 -0
- package/factories/ui/text.d.ts +2 -0
- package/factories/ui/text.js +8 -0
- package/factories/ui/text.js.map +1 -0
- package/index.d.ts +50 -0
- package/index.js +51 -0
- package/index.js.map +1 -0
- package/module/extensions/extensions.d.ts +2 -0
- package/module/extensions/extensions.js +3 -0
- package/module/extensions/extensions.js.map +1 -0
- package/module/module-network-registry.d.ts +11 -0
- package/module/module-network-registry.js +22 -0
- package/module/module-network-registry.js.map +1 -0
- package/module/module.d.ts +11 -0
- package/module/module.js +3 -0
- package/module/module.js.map +1 -0
- package/package.json +56 -0
- package/protocol/extensions/address/FetchDataForAddressExtension.d.ts +9 -0
- package/protocol/extensions/address/FetchDataForAddressExtension.js +3 -0
- package/protocol/extensions/address/FetchDataForAddressExtension.js.map +1 -0
- package/protocol/extensions/address/FetchDataForMultipleAddressesExtension.d.ts +9 -0
- package/protocol/extensions/address/FetchDataForMultipleAddressesExtension.js +3 -0
- package/protocol/extensions/address/FetchDataForMultipleAddressesExtension.js.map +1 -0
- package/protocol/extensions/address/MultiAddressPublicKeyExtension.d.ts +7 -0
- package/protocol/extensions/address/MultiAddressPublicKeyExtension.js +3 -0
- package/protocol/extensions/address/MultiAddressPublicKeyExtension.js.map +1 -0
- package/protocol/extensions/bip/Bip32Extension.d.ts +15 -0
- package/protocol/extensions/bip/Bip32Extension.js +3 -0
- package/protocol/extensions/bip/Bip32Extension.js.map +1 -0
- package/protocol/extensions/contract/ConfigurableContractExtension.d.ts +7 -0
- package/protocol/extensions/contract/ConfigurableContractExtension.js +3 -0
- package/protocol/extensions/contract/ConfigurableContractExtension.js.map +1 -0
- package/protocol/extensions/crypto/AESExtension.d.ts +7 -0
- package/protocol/extensions/crypto/AESExtension.js +3 -0
- package/protocol/extensions/crypto/AESExtension.js.map +1 -0
- package/protocol/extensions/crypto/AsymmetricEncryptionExtension.d.ts +9 -0
- package/protocol/extensions/crypto/AsymmetricEncryptionExtension.js +3 -0
- package/protocol/extensions/crypto/AsymmetricEncryptionExtension.js.map +1 -0
- package/protocol/extensions/crypto/CryptoExtension.d.ts +5 -0
- package/protocol/extensions/crypto/CryptoExtension.js +3 -0
- package/protocol/extensions/crypto/CryptoExtension.js.map +1 -0
- package/protocol/extensions/crypto/SignMessageExtension.d.ts +10 -0
- package/protocol/extensions/crypto/SignMessageExtension.js +3 -0
- package/protocol/extensions/crypto/SignMessageExtension.js.map +1 -0
- package/protocol/extensions/extensions.d.ts +37 -0
- package/protocol/extensions/extensions.js +3 -0
- package/protocol/extensions/extensions.js.map +1 -0
- package/protocol/extensions/sub-protocol/MultiTokenSubProtocolExtension.d.ts +12 -0
- package/protocol/extensions/sub-protocol/MultiTokenSubProtocolExtension.js +3 -0
- package/protocol/extensions/sub-protocol/MultiTokenSubProtocolExtension.js.map +1 -0
- package/protocol/extensions/sub-protocol/SingleTokenSubProtocolExtension.d.ts +9 -0
- package/protocol/extensions/sub-protocol/SingleTokenSubProtocolExtension.js +3 -0
- package/protocol/extensions/sub-protocol/SingleTokenSubProtocolExtension.js.map +1 -0
- package/protocol/extensions/sub-protocol/SubProtocolExtension.d.ts +6 -0
- package/protocol/extensions/sub-protocol/SubProtocolExtension.js +3 -0
- package/protocol/extensions/sub-protocol/SubProtocolExtension.js.map +1 -0
- package/protocol/extensions/transaction/ConfigurableTransactionInjectorExtension.d.ts +6 -0
- package/protocol/extensions/transaction/ConfigurableTransactionInjectorExtension.js +3 -0
- package/protocol/extensions/transaction/ConfigurableTransactionInjectorExtension.js.map +1 -0
- package/protocol/extensions/transaction/TransactionStatusCheckerExtension.d.ts +6 -0
- package/protocol/extensions/transaction/TransactionStatusCheckerExtension.js +3 -0
- package/protocol/extensions/transaction/TransactionStatusCheckerExtension.js.map +1 -0
- package/protocol/protocol.d.ts +65 -0
- package/protocol/protocol.js +3 -0
- package/protocol/protocol.js.map +1 -0
- package/readme.md +0 -0
- package/types/address.d.ts +8 -0
- package/types/address.js +3 -0
- package/types/address.js.map +1 -0
- package/types/airgap.d.ts +15 -0
- package/types/airgap.js +3 -0
- package/types/airgap.js.map +1 -0
- package/types/amount.d.ts +15 -0
- package/types/amount.js +42 -0
- package/types/amount.js.map +1 -0
- package/types/balance.d.ts +5 -0
- package/types/balance.js +3 -0
- package/types/balance.js.map +1 -0
- package/types/base/cursor.d.ts +3 -0
- package/types/base/cursor.js +3 -0
- package/types/base/cursor.js.map +1 -0
- package/types/base/sealed.d.ts +3 -0
- package/types/base/sealed.js +3 -0
- package/types/base/sealed.js.map +1 -0
- package/types/block-explorer.d.ts +4 -0
- package/types/block-explorer.js +3 -0
- package/types/block-explorer.js.map +1 -0
- package/types/bytes.d.ts +8 -0
- package/types/bytes.js +3 -0
- package/types/bytes.js.map +1 -0
- package/types/fee.d.ts +7 -0
- package/types/fee.js +3 -0
- package/types/fee.js.map +1 -0
- package/types/key.d.ts +20 -0
- package/types/key.js +3 -0
- package/types/key.js.map +1 -0
- package/types/meta/utility-types.d.ts +5 -0
- package/types/meta/utility-types.js +3 -0
- package/types/meta/utility-types.js.map +1 -0
- package/types/protocol.d.ts +60 -0
- package/types/protocol.js +3 -0
- package/types/protocol.js.map +1 -0
- package/types/secret.d.ts +12 -0
- package/types/secret.js +3 -0
- package/types/secret.js.map +1 -0
- package/types/signature.d.ts +3 -0
- package/types/signature.js +3 -0
- package/types/signature.js.map +1 -0
- package/types/sub-protocol.d.ts +1 -0
- package/types/sub-protocol.js +3 -0
- package/types/sub-protocol.js.map +1 -0
- package/types/transaction.d.ts +63 -0
- package/types/transaction.js +3 -0
- package/types/transaction.js.map +1 -0
- package/types/ui/action.d.ts +4 -0
- package/types/ui/action.js +3 -0
- package/types/ui/action.js.map +1 -0
- package/types/ui/alert.d.ts +9 -0
- package/types/ui/alert.js +3 -0
- package/types/ui/alert.js.map +1 -0
- package/types/ui/text.d.ts +9 -0
- package/types/ui/text.js +3 -0
- package/types/ui/text.js.map +1 -0
- package/utils/amount.d.ts +2 -0
- package/utils/amount.js +13 -0
- package/utils/amount.js.map +1 -0
- package/utils/interface.d.ts +2 -0
- package/utils/interface.js +11 -0
- package/utils/interface.js.map +1 -0
- package/utils/key.d.ts +8 -0
- package/utils/key.js +26 -0
- package/utils/key.js.map +1 -0
- package/utils/normalize.d.ts +1 -0
- package/utils/normalize.js +8 -0
- package/utils/normalize.js.map +1 -0
- package/utils/protocol.d.ts +29 -0
- package/utils/protocol.js +164 -0
- package/utils/protocol.js.map +1 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AirGapInterface } from '../types/airgap';
|
|
2
|
+
import { BlockExplorerMetadata } from '../types/block-explorer';
|
|
3
|
+
export interface BlockExplorer {
|
|
4
|
+
getMetadata(): Promise<BlockExplorerMetadata>;
|
|
5
|
+
createAddressUrl(address: string): Promise<string>;
|
|
6
|
+
createTransactionUrl(transactionId: string): Promise<string>;
|
|
7
|
+
}
|
|
8
|
+
export declare type AirGapBlockExplorer = AirGapInterface<BlockExplorer>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"block-explorer.js","sourceRoot":"","sources":["../../src/block-explorer/block-explorer.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extensions.js","sourceRoot":"","sources":["../../../src/block-explorer/extensions/extensions.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import BigNumber from '@airgap/coinlib-core/dependencies/src/bignumber.js-9.0.0/bignumber';
|
|
2
|
+
import { Amount, AmountEnhanced } from '../types/amount';
|
|
3
|
+
export declare function newAmount<_Units extends string>(amount: Amount<_Units>): AmountEnhanced<_Units>;
|
|
4
|
+
export declare function newAmount<_Units extends string>(amount: number | string | BigNumber, unit: Amount<_Units>['unit']): AmountEnhanced<_Units>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.newAmount = void 0;
|
|
4
|
+
var amount_1 = require("../types/amount");
|
|
5
|
+
var amount_2 = require("../utils/amount");
|
|
6
|
+
function newAmount(amount, unitOrUndefined) {
|
|
7
|
+
if ((0, amount_2.isAmount)(amount)) {
|
|
8
|
+
return new amount_1.AmountEnhanced(amount.value, amount.unit);
|
|
9
|
+
}
|
|
10
|
+
else {
|
|
11
|
+
var unit = unitOrUndefined;
|
|
12
|
+
return new amount_1.AmountEnhanced(amount, unit);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.newAmount = newAmount;
|
|
16
|
+
//# sourceMappingURL=amount.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"amount.js","sourceRoot":"","sources":["../../src/factories/amount.ts"],"names":[],"mappings":";;;AAEA,0CAAwD;AACxD,0CAA0C;AAI1C,SAAgB,SAAS,CACvB,MAAoD,EACpD,eAAwC;IAExC,IAAI,IAAA,iBAAQ,EAAS,MAAM,CAAC,EAAE;QAC5B,OAAO,IAAI,uBAAc,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,CAAA;KACrD;SAAM;QACL,IAAM,IAAI,GAA2B,eAAgB,CAAA;QAErD,OAAO,IAAI,uBAAc,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;KACxC;AACH,CAAC;AAXD,8BAWC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ExtendedPublicKey, ExtendedSecretKey, PublicKey, SecretKey } from '../types/key';
|
|
2
|
+
export declare function newSecretKey(value: string, format?: SecretKey['format']): SecretKey;
|
|
3
|
+
export declare function newExtendedSecretKey(value: string, format?: ExtendedSecretKey['format']): ExtendedSecretKey;
|
|
4
|
+
export declare function newPublicKey(value: string, format?: PublicKey['format']): PublicKey;
|
|
5
|
+
export declare function newExtendedPublicKey(value: string, format?: ExtendedPublicKey['format']): ExtendedPublicKey;
|
package/factories/key.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.newExtendedPublicKey = exports.newPublicKey = exports.newExtendedSecretKey = exports.newSecretKey = void 0;
|
|
4
|
+
function newSecretKey(value, format) {
|
|
5
|
+
if (format === void 0) { format = 'encoded'; }
|
|
6
|
+
return { type: 'priv', value: value, format: format };
|
|
7
|
+
}
|
|
8
|
+
exports.newSecretKey = newSecretKey;
|
|
9
|
+
function newExtendedSecretKey(value, format) {
|
|
10
|
+
if (format === void 0) { format = 'encoded'; }
|
|
11
|
+
return { type: 'xpriv', value: value, format: format };
|
|
12
|
+
}
|
|
13
|
+
exports.newExtendedSecretKey = newExtendedSecretKey;
|
|
14
|
+
function newPublicKey(value, format) {
|
|
15
|
+
if (format === void 0) { format = 'encoded'; }
|
|
16
|
+
return { type: 'pub', value: value, format: format };
|
|
17
|
+
}
|
|
18
|
+
exports.newPublicKey = newPublicKey;
|
|
19
|
+
function newExtendedPublicKey(value, format) {
|
|
20
|
+
if (format === void 0) { format = 'encoded'; }
|
|
21
|
+
return { type: 'xpub', value: value, format: format };
|
|
22
|
+
}
|
|
23
|
+
exports.newExtendedPublicKey = newExtendedPublicKey;
|
|
24
|
+
//# sourceMappingURL=key.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"key.js","sourceRoot":"","sources":["../../src/factories/key.ts"],"names":[],"mappings":";;;AAEA,SAAgB,YAAY,CAAC,KAAa,EAAE,MAAuC;IAAvC,uBAAA,EAAA,kBAAuC;IACjF,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,OAAA,EAAE,MAAM,QAAA,EAAE,CAAA;AACxC,CAAC;AAFD,oCAEC;AAED,SAAgB,oBAAoB,CAAC,KAAa,EAAE,MAA+C;IAA/C,uBAAA,EAAA,kBAA+C;IACjG,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,OAAA,EAAE,MAAM,QAAA,EAAE,CAAA;AACzC,CAAC;AAFD,oDAEC;AAED,SAAgB,YAAY,CAAC,KAAa,EAAE,MAAuC;IAAvC,uBAAA,EAAA,kBAAuC;IACjF,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,OAAA,EAAE,MAAM,QAAA,EAAE,CAAA;AACvC,CAAC;AAFD,oCAEC;AAED,SAAgB,oBAAoB,CAAC,KAAa,EAAE,MAA+C;IAA/C,uBAAA,EAAA,kBAA+C;IACjG,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,OAAA,EAAE,MAAM,QAAA,EAAE,CAAA;AACxC,CAAC;AAFD,oDAEC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.newSignature = void 0;
|
|
4
|
+
function newSignature(value, format) {
|
|
5
|
+
if (format === void 0) { format = 'encoded'; }
|
|
6
|
+
return { value: value, format: format };
|
|
7
|
+
}
|
|
8
|
+
exports.newSignature = newSignature;
|
|
9
|
+
//# sourceMappingURL=signature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signature.js","sourceRoot":"","sources":["../../src/factories/signature.ts"],"names":[],"mappings":";;;AAEA,SAAgB,YAAY,CAAC,KAAa,EAAE,MAAuC;IAAvC,uBAAA,EAAA,kBAAuC;IACjF,OAAO,EAAE,KAAK,OAAA,EAAE,MAAM,QAAA,EAAE,CAAA;AAC1B,CAAC;AAFD,oCAEC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { SignedTransaction, UnsignedTransaction } from '../types/transaction';
|
|
2
|
+
export declare function newUnsignedTransaction<T extends UnsignedTransaction>(transaction: Omit<T, 'type'>): T;
|
|
3
|
+
export declare function newSignedTransaction<T extends SignedTransaction>(transaction: Omit<T, 'type'>): T;
|
|
@@ -0,0 +1,23 @@
|
|
|
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.newSignedTransaction = exports.newUnsignedTransaction = void 0;
|
|
15
|
+
function newUnsignedTransaction(transaction) {
|
|
16
|
+
return __assign(__assign({}, transaction), { type: 'unsigned' });
|
|
17
|
+
}
|
|
18
|
+
exports.newUnsignedTransaction = newUnsignedTransaction;
|
|
19
|
+
function newSignedTransaction(transaction) {
|
|
20
|
+
return __assign(__assign({}, transaction), { type: 'signed' });
|
|
21
|
+
}
|
|
22
|
+
exports.newSignedTransaction = newSignedTransaction;
|
|
23
|
+
//# sourceMappingURL=transaction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transaction.js","sourceRoot":"","sources":["../../src/factories/transaction.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAEA,SAAgB,sBAAsB,CAAgC,WAA4B;IAChG,OAAO,sBAAK,WAAW,KAAE,IAAI,EAAE,UAAU,GAAO,CAAA;AAClD,CAAC;AAFD,wDAEC;AAED,SAAgB,oBAAoB,CAA8B,WAA4B;IAC5F,OAAO,sBAAK,WAAW,KAAE,IAAI,EAAE,QAAQ,GAAO,CAAA;AAChD,CAAC;AAFD,oDAEC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { AirGapUIAlert } from '../../types/ui/alert';
|
|
2
|
+
export declare function newSuccessUIAlert(alert: Omit<AirGapUIAlert, 'type'>): AirGapUIAlert;
|
|
3
|
+
export declare function newInfoUIAlert(alert: Omit<AirGapUIAlert, 'type'>): AirGapUIAlert;
|
|
4
|
+
export declare function newWarningUIAlert(alert: Omit<AirGapUIAlert, 'type'>): AirGapUIAlert;
|
|
5
|
+
export declare function newErrorUIAlert(alert: Omit<AirGapUIAlert, 'type'>): AirGapUIAlert;
|
|
@@ -0,0 +1,31 @@
|
|
|
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.newErrorUIAlert = exports.newWarningUIAlert = exports.newInfoUIAlert = exports.newSuccessUIAlert = void 0;
|
|
15
|
+
function newSuccessUIAlert(alert) {
|
|
16
|
+
return __assign(__assign({}, alert), { type: 'success' });
|
|
17
|
+
}
|
|
18
|
+
exports.newSuccessUIAlert = newSuccessUIAlert;
|
|
19
|
+
function newInfoUIAlert(alert) {
|
|
20
|
+
return __assign(__assign({}, alert), { type: 'info' });
|
|
21
|
+
}
|
|
22
|
+
exports.newInfoUIAlert = newInfoUIAlert;
|
|
23
|
+
function newWarningUIAlert(alert) {
|
|
24
|
+
return __assign(__assign({}, alert), { type: 'warning' });
|
|
25
|
+
}
|
|
26
|
+
exports.newWarningUIAlert = newWarningUIAlert;
|
|
27
|
+
function newErrorUIAlert(alert) {
|
|
28
|
+
return __assign(__assign({}, alert), { type: 'error' });
|
|
29
|
+
}
|
|
30
|
+
exports.newErrorUIAlert = newErrorUIAlert;
|
|
31
|
+
//# sourceMappingURL=alert.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert.js","sourceRoot":"","sources":["../../../src/factories/ui/alert.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAEA,SAAgB,iBAAiB,CAAC,KAAkC;IAClE,6BAAY,KAAK,KAAE,IAAI,EAAE,SAAS,IAAE;AACtC,CAAC;AAFD,8CAEC;AAED,SAAgB,cAAc,CAAC,KAAkC;IAC/D,6BAAY,KAAK,KAAE,IAAI,EAAE,MAAM,IAAE;AACnC,CAAC;AAFD,wCAEC;AAED,SAAgB,iBAAiB,CAAC,KAAkC;IAClE,6BAAY,KAAK,KAAE,IAAI,EAAE,SAAS,IAAE;AACtC,CAAC;AAFD,8CAEC;AAED,SAAgB,eAAe,CAAC,KAAkC;IAChE,6BAAY,KAAK,KAAE,IAAI,EAAE,OAAO,IAAE;AACpC,CAAC;AAFD,0CAEC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.newPlainUIText = void 0;
|
|
4
|
+
function newPlainUIText(text) {
|
|
5
|
+
return { type: 'plain', value: text };
|
|
6
|
+
}
|
|
7
|
+
exports.newPlainUIText = newPlainUIText;
|
|
8
|
+
//# sourceMappingURL=text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text.js","sourceRoot":"","sources":["../../../src/factories/ui/text.ts"],"names":[],"mappings":";;;AAEA,SAAgB,cAAc,CAAC,IAAY;IACzC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAA;AACvC,CAAC;AAFD,wCAEC"}
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { AirGapBlockExplorer } from './block-explorer/block-explorer';
|
|
2
|
+
import { newAmount } from './factories/amount';
|
|
3
|
+
import { newExtendedPublicKey, newExtendedSecretKey, newPublicKey, newSecretKey } from './factories/key';
|
|
4
|
+
import { newSignature } from './factories/signature';
|
|
5
|
+
import { newSignedTransaction, newUnsignedTransaction } from './factories/transaction';
|
|
6
|
+
import { newErrorUIAlert, newInfoUIAlert, newSuccessUIAlert, newWarningUIAlert } from './factories/ui/alert';
|
|
7
|
+
import { newPlainUIText } from './factories/ui/text';
|
|
8
|
+
import { AirGapModule } from './module/module';
|
|
9
|
+
import { ModuleNetworkRegistry } from './module/module-network-registry';
|
|
10
|
+
import { FetchDataForMultipleAddressesExtension, FetchDataForMultipleAddressesProtocol } from './protocol/extensions/address/FetchDataForMultipleAddressesExtension';
|
|
11
|
+
import { MultiAddressPublicKeyExtension, MultiAddressPublicKeyProtocol } from './protocol/extensions/address/MultiAddressPublicKeyExtension';
|
|
12
|
+
import { Bip32Extension, OfflineBip32Protocol, OnlineBip32Protocol } from './protocol/extensions/bip/Bip32Extension';
|
|
13
|
+
import { AESExtension } from './protocol/extensions/crypto/AESExtension';
|
|
14
|
+
import { AsymmetricEncryptionExtension } from './protocol/extensions/crypto/AsymmetricEncryptionExtension';
|
|
15
|
+
import { CryptoExtension } from './protocol/extensions/crypto/CryptoExtension';
|
|
16
|
+
import { SignMessageExtension } from './protocol/extensions/crypto/SignMessageExtension';
|
|
17
|
+
import { BaseMultiTokenSubProtocol, MultiTokenBalanceConfiguration, MultiTokenSubProtocolExtension, OnlineMultiTokenSubProtocol } from './protocol/extensions/sub-protocol/MultiTokenSubProtocolExtension';
|
|
18
|
+
import { SingleTokenSubProtocol, SingleTokenSubProtocolExtension } from './protocol/extensions/sub-protocol/SingleTokenSubProtocolExtension';
|
|
19
|
+
import { SubProtocol, SubProtocolExtension } from './protocol/extensions/sub-protocol/SubProtocolExtension';
|
|
20
|
+
import { TransactionStatusCheckerExtension } from './protocol/extensions/transaction/TransactionStatusCheckerExtension';
|
|
21
|
+
import { AirGapAnyProtocol, AirGapOfflineProtocol, AirGapOnlineProtocol, AirGapProtocol } from './protocol/protocol';
|
|
22
|
+
import { Address, AddressCursor, AddressWithCursor } from './types/address';
|
|
23
|
+
import { AirGapInterface } from './types/airgap';
|
|
24
|
+
import { Amount } from './types/amount';
|
|
25
|
+
import { Balance } from './types/balance';
|
|
26
|
+
import { BlockExplorerMetadata } from './types/block-explorer';
|
|
27
|
+
import { BytesString, BytesStringFormat, HexString } from './types/bytes';
|
|
28
|
+
import { FeeDefaults, FeeEstimation } from './types/fee';
|
|
29
|
+
import { ExtendedKeyPair, ExtendedPublicKey, ExtendedSecretKey, KeyPair, KeyType, PublicKey, SecretKey } from './types/key';
|
|
30
|
+
import { RecursivePartial } from './types/meta/utility-types';
|
|
31
|
+
import { ProtocolAccountMetadata, ProtocolFeeMetadata, ProtocolMetadata, ProtocolNetwork, ProtocolNetworkType, ProtocolSymbol, ProtocolUnitsMetadata } from './types/protocol';
|
|
32
|
+
import { HexSecret, MnemonicSecret, Secret, SecretType } from './types/secret';
|
|
33
|
+
import { Signature } from './types/signature';
|
|
34
|
+
import { SubProtocolType } from './types/sub-protocol';
|
|
35
|
+
import { AirGapTransaction, AirGapTransactionStatus, AirGapTransactionsWithCursor, SignedTransaction, TransactionConfiguration, TransactionCursor, TransactionDetails, TransactionType, UnsignedTransaction } from './types/transaction';
|
|
36
|
+
import { AirGapUIAction } from './types/ui/action';
|
|
37
|
+
import { AirGapUIAlert } from './types/ui/alert';
|
|
38
|
+
import { AirGapUIText } from './types/ui/text';
|
|
39
|
+
import { isAmount } from './utils/amount';
|
|
40
|
+
import { implementsInterface, Schema } from './utils/interface';
|
|
41
|
+
import { isAnyKey, isExtendedPublicKey, isExtendedSecretKey, isPublicKey, isSecretKey } from './utils/key';
|
|
42
|
+
import { normalizeToUndefined } from './utils/normalize';
|
|
43
|
+
import { canEncryptAES, canEncryptAsymmetric, canFetchDataForMultipleAddresses, canSignMessage, hasConfigurableContract, hasConfigurableTransactionInjector, hasMultiAddressPublicKeys, isBip32Protocol, isMultiTokenSubProtocol, isSingleTokenSubProtocol, isSubProtocol, isTransactionStatusChecker, protocolNetworkIdentifier } from './utils/protocol';
|
|
44
|
+
export { AirGapBlockExplorer, BlockExplorerMetadata };
|
|
45
|
+
export { newSuccessUIAlert, newInfoUIAlert, newWarningUIAlert, newErrorUIAlert, newPlainUIText, newAmount, newSecretKey, newExtendedSecretKey, newPublicKey, newExtendedPublicKey, newSignature, newUnsignedTransaction, newSignedTransaction };
|
|
46
|
+
export { AirGapModule, ModuleNetworkRegistry };
|
|
47
|
+
export { AirGapOfflineProtocol, AirGapOnlineProtocol, AirGapProtocol, AirGapAnyProtocol, FetchDataForMultipleAddressesExtension, FetchDataForMultipleAddressesProtocol, MultiAddressPublicKeyExtension, MultiAddressPublicKeyProtocol, Bip32Extension, OfflineBip32Protocol, OnlineBip32Protocol, SubProtocolExtension, SubProtocol, SingleTokenSubProtocolExtension, SingleTokenSubProtocol, MultiTokenSubProtocolExtension, BaseMultiTokenSubProtocol, OnlineMultiTokenSubProtocol, CryptoExtension, AESExtension, AsymmetricEncryptionExtension, SignMessageExtension, TransactionStatusCheckerExtension, ProtocolMetadata, ProtocolUnitsMetadata, ProtocolSymbol, ProtocolFeeMetadata, ProtocolAccountMetadata, ProtocolNetworkType, ProtocolNetwork, SubProtocolType };
|
|
48
|
+
export { AirGapInterface };
|
|
49
|
+
export { AirGapUIAction, AirGapUIAlert, AirGapUIText, Address, AddressCursor, AddressWithCursor, Amount, Balance, MultiTokenBalanceConfiguration, BytesStringFormat, BytesString, HexString, FeeDefaults, FeeEstimation, KeyType, SecretKey, ExtendedSecretKey, PublicKey, ExtendedPublicKey, KeyPair, ExtendedKeyPair, SecretType, MnemonicSecret, HexSecret, Secret, Signature, TransactionType, UnsignedTransaction, SignedTransaction, AirGapTransaction, TransactionCursor, AirGapTransactionsWithCursor, TransactionDetails, TransactionConfiguration, AirGapTransactionStatus, RecursivePartial };
|
|
50
|
+
export { isAmount, Schema, implementsInterface, isAnyKey, isSecretKey, isExtendedSecretKey, isPublicKey, isExtendedPublicKey, isBip32Protocol, isSubProtocol, isSingleTokenSubProtocol, isMultiTokenSubProtocol, canFetchDataForMultipleAddresses, hasMultiAddressPublicKeys, hasConfigurableContract, canEncryptAES, canEncryptAsymmetric, canSignMessage, hasConfigurableTransactionInjector, isTransactionStatusChecker, protocolNetworkIdentifier, normalizeToUndefined };
|
package/index.js
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.normalizeToUndefined = exports.protocolNetworkIdentifier = exports.isTransactionStatusChecker = exports.hasConfigurableTransactionInjector = exports.canSignMessage = exports.canEncryptAsymmetric = exports.canEncryptAES = exports.hasConfigurableContract = exports.hasMultiAddressPublicKeys = exports.canFetchDataForMultipleAddresses = exports.isMultiTokenSubProtocol = exports.isSingleTokenSubProtocol = exports.isSubProtocol = exports.isBip32Protocol = exports.isExtendedPublicKey = exports.isPublicKey = exports.isExtendedSecretKey = exports.isSecretKey = exports.isAnyKey = exports.implementsInterface = exports.isAmount = exports.ModuleNetworkRegistry = exports.newSignedTransaction = exports.newUnsignedTransaction = exports.newSignature = exports.newExtendedPublicKey = exports.newPublicKey = exports.newExtendedSecretKey = exports.newSecretKey = exports.newAmount = exports.newPlainUIText = exports.newErrorUIAlert = exports.newWarningUIAlert = exports.newInfoUIAlert = exports.newSuccessUIAlert = void 0;
|
|
4
|
+
var amount_1 = require("./factories/amount");
|
|
5
|
+
Object.defineProperty(exports, "newAmount", { enumerable: true, get: function () { return amount_1.newAmount; } });
|
|
6
|
+
var key_1 = require("./factories/key");
|
|
7
|
+
Object.defineProperty(exports, "newExtendedPublicKey", { enumerable: true, get: function () { return key_1.newExtendedPublicKey; } });
|
|
8
|
+
Object.defineProperty(exports, "newExtendedSecretKey", { enumerable: true, get: function () { return key_1.newExtendedSecretKey; } });
|
|
9
|
+
Object.defineProperty(exports, "newPublicKey", { enumerable: true, get: function () { return key_1.newPublicKey; } });
|
|
10
|
+
Object.defineProperty(exports, "newSecretKey", { enumerable: true, get: function () { return key_1.newSecretKey; } });
|
|
11
|
+
var signature_1 = require("./factories/signature");
|
|
12
|
+
Object.defineProperty(exports, "newSignature", { enumerable: true, get: function () { return signature_1.newSignature; } });
|
|
13
|
+
var transaction_1 = require("./factories/transaction");
|
|
14
|
+
Object.defineProperty(exports, "newSignedTransaction", { enumerable: true, get: function () { return transaction_1.newSignedTransaction; } });
|
|
15
|
+
Object.defineProperty(exports, "newUnsignedTransaction", { enumerable: true, get: function () { return transaction_1.newUnsignedTransaction; } });
|
|
16
|
+
var alert_1 = require("./factories/ui/alert");
|
|
17
|
+
Object.defineProperty(exports, "newErrorUIAlert", { enumerable: true, get: function () { return alert_1.newErrorUIAlert; } });
|
|
18
|
+
Object.defineProperty(exports, "newInfoUIAlert", { enumerable: true, get: function () { return alert_1.newInfoUIAlert; } });
|
|
19
|
+
Object.defineProperty(exports, "newSuccessUIAlert", { enumerable: true, get: function () { return alert_1.newSuccessUIAlert; } });
|
|
20
|
+
Object.defineProperty(exports, "newWarningUIAlert", { enumerable: true, get: function () { return alert_1.newWarningUIAlert; } });
|
|
21
|
+
var text_1 = require("./factories/ui/text");
|
|
22
|
+
Object.defineProperty(exports, "newPlainUIText", { enumerable: true, get: function () { return text_1.newPlainUIText; } });
|
|
23
|
+
var module_network_registry_1 = require("./module/module-network-registry");
|
|
24
|
+
Object.defineProperty(exports, "ModuleNetworkRegistry", { enumerable: true, get: function () { return module_network_registry_1.ModuleNetworkRegistry; } });
|
|
25
|
+
var amount_2 = require("./utils/amount");
|
|
26
|
+
Object.defineProperty(exports, "isAmount", { enumerable: true, get: function () { return amount_2.isAmount; } });
|
|
27
|
+
var interface_1 = require("./utils/interface");
|
|
28
|
+
Object.defineProperty(exports, "implementsInterface", { enumerable: true, get: function () { return interface_1.implementsInterface; } });
|
|
29
|
+
var key_2 = require("./utils/key");
|
|
30
|
+
Object.defineProperty(exports, "isAnyKey", { enumerable: true, get: function () { return key_2.isAnyKey; } });
|
|
31
|
+
Object.defineProperty(exports, "isExtendedPublicKey", { enumerable: true, get: function () { return key_2.isExtendedPublicKey; } });
|
|
32
|
+
Object.defineProperty(exports, "isExtendedSecretKey", { enumerable: true, get: function () { return key_2.isExtendedSecretKey; } });
|
|
33
|
+
Object.defineProperty(exports, "isPublicKey", { enumerable: true, get: function () { return key_2.isPublicKey; } });
|
|
34
|
+
Object.defineProperty(exports, "isSecretKey", { enumerable: true, get: function () { return key_2.isSecretKey; } });
|
|
35
|
+
var normalize_1 = require("./utils/normalize");
|
|
36
|
+
Object.defineProperty(exports, "normalizeToUndefined", { enumerable: true, get: function () { return normalize_1.normalizeToUndefined; } });
|
|
37
|
+
var protocol_1 = require("./utils/protocol");
|
|
38
|
+
Object.defineProperty(exports, "canEncryptAES", { enumerable: true, get: function () { return protocol_1.canEncryptAES; } });
|
|
39
|
+
Object.defineProperty(exports, "canEncryptAsymmetric", { enumerable: true, get: function () { return protocol_1.canEncryptAsymmetric; } });
|
|
40
|
+
Object.defineProperty(exports, "canFetchDataForMultipleAddresses", { enumerable: true, get: function () { return protocol_1.canFetchDataForMultipleAddresses; } });
|
|
41
|
+
Object.defineProperty(exports, "canSignMessage", { enumerable: true, get: function () { return protocol_1.canSignMessage; } });
|
|
42
|
+
Object.defineProperty(exports, "hasConfigurableContract", { enumerable: true, get: function () { return protocol_1.hasConfigurableContract; } });
|
|
43
|
+
Object.defineProperty(exports, "hasConfigurableTransactionInjector", { enumerable: true, get: function () { return protocol_1.hasConfigurableTransactionInjector; } });
|
|
44
|
+
Object.defineProperty(exports, "hasMultiAddressPublicKeys", { enumerable: true, get: function () { return protocol_1.hasMultiAddressPublicKeys; } });
|
|
45
|
+
Object.defineProperty(exports, "isBip32Protocol", { enumerable: true, get: function () { return protocol_1.isBip32Protocol; } });
|
|
46
|
+
Object.defineProperty(exports, "isMultiTokenSubProtocol", { enumerable: true, get: function () { return protocol_1.isMultiTokenSubProtocol; } });
|
|
47
|
+
Object.defineProperty(exports, "isSingleTokenSubProtocol", { enumerable: true, get: function () { return protocol_1.isSingleTokenSubProtocol; } });
|
|
48
|
+
Object.defineProperty(exports, "isSubProtocol", { enumerable: true, get: function () { return protocol_1.isSubProtocol; } });
|
|
49
|
+
Object.defineProperty(exports, "isTransactionStatusChecker", { enumerable: true, get: function () { return protocol_1.isTransactionStatusChecker; } });
|
|
50
|
+
Object.defineProperty(exports, "protocolNetworkIdentifier", { enumerable: true, get: function () { return protocol_1.protocolNetworkIdentifier; } });
|
|
51
|
+
//# sourceMappingURL=index.js.map
|
package/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AACA,6CAA8C;AA+F5C,0FA/FO,kBAAS,OA+FP;AA9FX,uCAAwG;AAkGtG,qGAlGO,0BAAoB,OAkGP;AAFpB,qGAhG6B,0BAAoB,OAgG7B;AACpB,6FAjGmD,kBAAY,OAiGnD;AAFZ,6FA/FiE,kBAAY,OA+FjE;AA9Fd,mDAAoD;AAkGlD,6FAlGO,wBAAY,OAkGP;AAjGd,uDAAsF;AAmGpF,qGAnGO,kCAAoB,OAmGP;AADpB,uGAlG6B,oCAAsB,OAkG7B;AAjGxB,8CAA4G;AAyF1G,gGAzFO,uBAAe,OAyFP;AAFf,+FAvFwB,sBAAc,OAuFxB;AADd,kGAtFwC,yBAAiB,OAsFxC;AAEjB,kGAxF2D,yBAAiB,OAwF3D;AAvFnB,4CAAoD;AAyFlD,+FAzFO,qBAAc,OAyFP;AAvFhB,4EAAwE;AAoGjD,sGApGd,+CAAqB,OAoGc;AA5C5C,yCAAyC;AAkIvC,yFAlIO,iBAAQ,OAkIP;AAjIV,+CAA+D;AAmI7D,oGAnIO,+BAAmB,OAmIP;AAlIrB,mCAA0G;AAmIxG,yFAnIO,cAAQ,OAmIP;AAIR,oGAvIiB,yBAAmB,OAuIjB;AAFnB,oGArIsC,yBAAmB,OAqItC;AACnB,4FAtI2D,iBAAW,OAsI3D;AAFX,4FApIwE,iBAAW,OAoIxE;AAnIb,+CAAwD;AAoJtD,qGApJO,gCAAoB,OAoJP;AAnJtB,6CAcyB;AA+HvB,8FA5IA,wBAAa,OA4IA;AACb,qGA5IA,+BAAoB,OA4IA;AAJpB,iHAvIA,2CAAgC,OAuIA;AAKhC,+FA3IA,yBAAc,OA2IA;AAHd,wGAvIA,kCAAuB,OAuIA;AAIvB,mHA1IA,6CAAkC,OA0IA;AALlC,0GApIA,oCAAyB,OAoIA;AALzB,gGA9HA,0BAAe,OA8HA;AAGf,wGAhIA,kCAAuB,OAgIA;AADvB,yGA9HA,mCAAwB,OA8HA;AADxB,8FA5HA,wBAAa,OA4HA;AAUb,2GArIA,qCAA0B,OAqIA;AAC1B,0GArIA,oCAAyB,OAqIA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extensions.js","sourceRoot":"","sources":["../../../src/module/extensions/extensions.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ProtocolNetwork } from '../types/protocol';
|
|
2
|
+
export declare class ModuleNetworkRegistry<_ProtocolNetwork extends ProtocolNetwork = ProtocolNetwork> {
|
|
3
|
+
readonly supportedNetworks: Record<string, _ProtocolNetwork>;
|
|
4
|
+
private readonly defaultNetworkId;
|
|
5
|
+
constructor(options: NetworkRegistryOptions<_ProtocolNetwork>);
|
|
6
|
+
findNetwork(networkId?: string): _ProtocolNetwork | undefined;
|
|
7
|
+
}
|
|
8
|
+
export interface NetworkRegistryOptions<_ProtocolNetwork extends ProtocolNetwork = ProtocolNetwork> {
|
|
9
|
+
supportedNetworks: _ProtocolNetwork[];
|
|
10
|
+
defaultNetwork?: _ProtocolNetwork;
|
|
11
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ModuleNetworkRegistry = void 0;
|
|
4
|
+
var protocol_1 = require("../utils/protocol");
|
|
5
|
+
var ModuleNetworkRegistry = /** @class */ (function () {
|
|
6
|
+
function ModuleNetworkRegistry(options) {
|
|
7
|
+
var _a;
|
|
8
|
+
this.supportedNetworks = options.supportedNetworks.reduce(function (obj, next) {
|
|
9
|
+
var _a;
|
|
10
|
+
return Object.assign(obj, (_a = {}, _a[(0, protocol_1.protocolNetworkIdentifier)(next)] = next, _a));
|
|
11
|
+
}, {});
|
|
12
|
+
var defaultNetwork = (_a = options.defaultNetwork) !== null && _a !== void 0 ? _a : options.supportedNetworks[0];
|
|
13
|
+
this.defaultNetworkId = defaultNetwork ? (0, protocol_1.protocolNetworkIdentifier)(defaultNetwork) : undefined;
|
|
14
|
+
}
|
|
15
|
+
ModuleNetworkRegistry.prototype.findNetwork = function (networkId) {
|
|
16
|
+
var targetNetworkId = networkId !== null && networkId !== void 0 ? networkId : this.defaultNetworkId;
|
|
17
|
+
return targetNetworkId ? this.supportedNetworks[targetNetworkId] : undefined;
|
|
18
|
+
};
|
|
19
|
+
return ModuleNetworkRegistry;
|
|
20
|
+
}());
|
|
21
|
+
exports.ModuleNetworkRegistry = ModuleNetworkRegistry;
|
|
22
|
+
//# sourceMappingURL=module-network-registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module-network-registry.js","sourceRoot":"","sources":["../../src/module/module-network-registry.ts"],"names":[],"mappings":";;;AACA,8CAA6D;AAE7D;IAIE,+BAAmB,OAAiD;;QAClE,IAAI,CAAC,iBAAiB,GAAG,OAAO,CAAC,iBAAiB,CAAC,MAAM,CAAC,UAAC,GAAqC,EAAE,IAAsB;;YACtH,OAAO,MAAM,CAAC,MAAM,CAAC,GAAG,YAAI,GAAC,IAAA,oCAAyB,EAAC,IAAI,CAAC,IAAG,IAAI,MAAG,CAAA;QACxE,CAAC,EAAE,EAAE,CAAC,CAAA;QAEN,IAAM,cAAc,GAAiC,MAAA,OAAO,CAAC,cAAc,mCAAI,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAA;QAC3G,IAAI,CAAC,gBAAgB,GAAG,cAAc,CAAC,CAAC,CAAC,IAAA,oCAAyB,EAAC,cAAc,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;IAChG,CAAC;IAEM,2CAAW,GAAlB,UAAmB,SAAkB;QACnC,IAAM,eAAe,GAAuB,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,IAAI,CAAC,gBAAgB,CAAA;QAE9E,OAAO,eAAe,CAAC,CAAC,CAAC,IAAI,CAAC,iBAAiB,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;IAC9E,CAAC;IACH,4BAAC;AAAD,CAAC,AAlBD,IAkBC;AAlBY,sDAAqB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BlockExplorer } from '../block-explorer/block-explorer';
|
|
2
|
+
import { OfflineProtocol, OnlineProtocol } from '../protocol/protocol';
|
|
3
|
+
import { AirGapInterface } from '../types/airgap';
|
|
4
|
+
import { ProtocolNetwork } from '../types/protocol';
|
|
5
|
+
export interface Module {
|
|
6
|
+
supportedNetworks: Record<string, ProtocolNetwork>;
|
|
7
|
+
createOfflineProtocol(): Promise<OfflineProtocol | undefined>;
|
|
8
|
+
createOnlineProtocol(networkId?: string): Promise<OnlineProtocol | undefined>;
|
|
9
|
+
createBlockExplorer(networkId?: string): Promise<BlockExplorer | undefined>;
|
|
10
|
+
}
|
|
11
|
+
export declare type AirGapModule = AirGapInterface<Module>;
|
package/module/module.js
ADDED
|
@@ -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": "@airgap/module-kit",
|
|
3
|
+
"version": "0.13.7-beta.23",
|
|
4
|
+
"description": "TODO",
|
|
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/*.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
|
+
"test-legacy": "",
|
|
29
|
+
"browserify": "browserify ./dist/index.js -s airgapModuleKit > ./dist/airgap-module-kit.min.js"
|
|
30
|
+
},
|
|
31
|
+
"author": "Papers GmbH <contact@papers.ch> (https://papers.ch)",
|
|
32
|
+
"peerDependencies": {
|
|
33
|
+
"@airgap/coinlib-core": "^0.13.7-beta.0"
|
|
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 @@
|
|
|
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 @@
|
|
|
1
|
+
{"version":3,"file":"FetchDataForMultipleAddressesExtension.js","sourceRoot":"","sources":["../../../../src/protocol/extensions/address/FetchDataForMultipleAddressesExtension.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,7 @@
|
|
|
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> {
|
|
6
|
+
getNextAddressFromPublicKey(publicKey: _PublicKey, cursor: _AddressCursor): Promise<AddressWithCursor<_AddressCursor> | undefined>;
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MultiAddressPublicKeyExtension.js","sourceRoot":"","sources":["../../../../src/protocol/extensions/address/MultiAddressPublicKeyExtension.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ExtendedKeyPair, ExtendedPublicKey, ExtendedSecretKey, KeyPair, PublicKey, SecretKey } from '../../../types/key';
|
|
2
|
+
import { Secret } from '../../../types/secret';
|
|
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'], _Units extends OfflineGeneric['Units'] = OfflineGeneric['Units'], _FeeUnits extends OfflineGeneric['FeeUnits'] = OfflineGeneric['FeeUnits'], _SignedTransaction extends OfflineGeneric['SignedTransaction'] = OfflineGeneric['SignedTransaction'], _UnsignedTransaction extends OfflineGeneric['UnsignedTransaction'] = OfflineGeneric['UnsignedTransaction']> extends BaseBip32Protocol<_AddressCursor, _AddressResult, _Units, _FeeUnits, _SignedTransaction, _UnsignedTransaction>, _OfflineProtocol<_AddressCursor, _AddressResult, _Units, _FeeUnits, _SignedTransaction, _UnsignedTransaction, PublicKey | ExtendedPublicKey, SecretKey | ExtendedSecretKey, KeyPair | ExtendedKeyPair> {
|
|
11
|
+
getExtendedKeyPairFromSecret(secret: Secret, derivationPath?: string): Promise<ExtendedKeyPair>;
|
|
12
|
+
}
|
|
13
|
+
export interface OnlineBip32Protocol<_AddressCursor extends OnlineGeneric['AddressCursor'] = OnlineGeneric['AddressCursor'], _AddressResult extends OnlineGeneric['AddressResult'] = OnlineGeneric['AddressResult'], _ProtocolNetwork extends OnlineGeneric['ProtocolNetwork'] = OnlineGeneric['ProtocolNetwork'], _Units extends OnlineGeneric['Units'] = OnlineGeneric['Units'], _FeeUnits extends OnlineGeneric['FeeUnits'] = OnlineGeneric['FeeUnits'], _FeeEstimation extends OnlineGeneric['FeeEstimation'] = OnlineGeneric['FeeEstimation'], _SignedTransaction extends OnlineGeneric['SignedTransaction'] = OnlineGeneric['SignedTransaction'], _UnsignedTransaction extends OnlineGeneric['UnsignedTransaction'] = OnlineGeneric['UnsignedTransaction'], _TransactionCursor extends OnlineGeneric['TransactionCursor'] = OnlineGeneric['TransactionCursor'], _BalanceConfiguration extends Object | undefined = undefined> extends BaseBip32Protocol<_AddressCursor, _AddressResult, _Units, _FeeUnits, _SignedTransaction, _UnsignedTransaction>, _OnlineProtocol<_AddressCursor, _AddressResult, _ProtocolNetwork, _Units, _FeeUnits, _FeeEstimation, _SignedTransaction, _UnsignedTransaction, _TransactionCursor, PublicKey | ExtendedPublicKey, _BalanceConfiguration> {
|
|
14
|
+
}
|
|
15
|
+
export {};
|
|
@@ -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 @@
|
|
|
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, 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 @@
|
|
|
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, 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
|
+
}
|