@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.
- package/LICENSE.md +7 -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 +62 -0
- package/index.js +85 -0
- package/index.js.map +1 -0
- package/internal/index.d.ts +5 -0
- package/internal/index.js +7 -0
- package/internal/index.js.map +1 -0
- package/internal/protocol/AirGapDelegateProtocol.d.ts +20 -0
- package/internal/protocol/AirGapDelegateProtocol.js +3 -0
- package/internal/protocol/AirGapDelegateProtocol.js.map +1 -0
- package/internal/utils/protocol.d.ts +5 -0
- package/internal/utils/protocol.js +24 -0
- package/internal/utils/protocol.js.map +1 -0
- package/module/extensions/extensions.d.ts +7 -0
- package/module/extensions/extensions.js +3 -0
- package/module/extensions/extensions.js.map +1 -0
- package/module/extensions/serialization/ProtocolSerializer.d.ts +19 -0
- package/module/extensions/serialization/ProtocolSerializer.js +3 -0
- package/module/extensions/serialization/ProtocolSerializer.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 +24 -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 +8 -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 +16 -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/dapp/WalletConnectProtocol.d.ts +17 -0
- package/protocol/extensions/dapp/WalletConnectProtocol.js +3 -0
- package/protocol/extensions/dapp/WalletConnectProtocol.js.map +1 -0
- package/protocol/extensions/extensions.d.ts +43 -0
- package/protocol/extensions/extensions.js +3 -0
- package/protocol/extensions/extensions.js.map +1 -0
- package/protocol/extensions/multisig/multisig.d.ts +7 -0
- package/protocol/extensions/multisig/multisig.js +3 -0
- package/protocol/extensions/multisig/multisig.js.map +1 -0
- package/protocol/extensions/sub-protocol/GetTokenBalancesExtension.d.ts +19 -0
- package/protocol/extensions/sub-protocol/GetTokenBalancesExtension.js +3 -0
- package/protocol/extensions/sub-protocol/GetTokenBalancesExtension.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 +7 -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 +68 -0
- package/protocol/protocol.js +3 -0
- package/protocol/protocol.js.map +1 -0
- package/readme.md +0 -0
- package/serializer/serializer.d.ts +12 -0
- package/serializer/serializer.js +3 -0
- package/serializer/serializer.js.map +1 -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 +16 -0
- package/types/amount.js +46 -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/crypto.d.ts +29 -0
- package/types/crypto.js +3 -0
- package/types/crypto.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 +8 -0
- package/types/meta/utility-types.js +3 -0
- package/types/meta/utility-types.js.map +1 -0
- package/types/module.d.ts +14 -0
- package/types/module.js +3 -0
- package/types/module.js.map +1 -0
- package/types/protocol.d.ts +57 -0
- package/types/protocol.js +3 -0
- package/types/protocol.js.map +1 -0
- package/types/serializer.d.ts +6 -0
- package/types/serializer.js +3 -0
- package/types/serializer.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 +68 -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/module.d.ts +9 -0
- package/utils/module.js +42 -0
- package/utils/module.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 +63 -0
- package/utils/protocol.js +198 -0
- package/utils/protocol.js.map +1 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
Copyright 2019 Papers AG
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
4
|
+
|
|
5
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -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 '@wallfree-dev/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,62 @@
|
|
|
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 { AirGapSerializedAnyProtocol, AirGapSerializedOfflineProtocol, AirGapSerializedOnlineProtocol, ProtocolSerializerExtension, ProtocolSerializerModule } from './module/extensions/serialization/ProtocolSerializer';
|
|
9
|
+
import { AirGapModule } from './module/module';
|
|
10
|
+
import { ModuleNetworkRegistry } from './module/module-network-registry';
|
|
11
|
+
import { FetchDataForMultipleAddressesExtension, FetchDataForMultipleAddressesProtocol } from './protocol/extensions/address/FetchDataForMultipleAddressesExtension';
|
|
12
|
+
import { MultiAddressPublicKeyExtension, MultiAddressPublicKeyProtocol } from './protocol/extensions/address/MultiAddressPublicKeyExtension';
|
|
13
|
+
import { Bip32Extension, OfflineBip32Protocol, OnlineBip32Protocol } from './protocol/extensions/bip/Bip32Extension';
|
|
14
|
+
import { AESExtension } from './protocol/extensions/crypto/AESExtension';
|
|
15
|
+
import { AsymmetricEncryptionExtension } from './protocol/extensions/crypto/AsymmetricEncryptionExtension';
|
|
16
|
+
import { CryptoExtension } from './protocol/extensions/crypto/CryptoExtension';
|
|
17
|
+
import { SignMessageExtension } from './protocol/extensions/crypto/SignMessageExtension';
|
|
18
|
+
import { WalletConnectExtension, WalletConnectProtocol, WalletConnectRequest } from './protocol/extensions/dapp/WalletConnectProtocol';
|
|
19
|
+
import { MultisigExtension, MultisigProtocol } from './protocol/extensions/multisig/multisig';
|
|
20
|
+
import { GetTokenBalances, GetTokenBalancesExtension, TokenDetails } from './protocol/extensions/sub-protocol/GetTokenBalancesExtension';
|
|
21
|
+
import { BaseMultiTokenSubProtocol, MultiTokenBalanceConfiguration, MultiTokenSubProtocolExtension, OnlineMultiTokenSubProtocol } from './protocol/extensions/sub-protocol/MultiTokenSubProtocolExtension';
|
|
22
|
+
import { SingleTokenSubProtocol, SingleTokenSubProtocolExtension } from './protocol/extensions/sub-protocol/SingleTokenSubProtocolExtension';
|
|
23
|
+
import { SubProtocol, SubProtocolExtension } from './protocol/extensions/sub-protocol/SubProtocolExtension';
|
|
24
|
+
import { TransactionStatusCheckerExtension } from './protocol/extensions/transaction/TransactionStatusCheckerExtension';
|
|
25
|
+
import { AirGapAnyProtocol, AirGapOfflineProtocol, AirGapOnlineProtocol, AirGapProtocol } from './protocol/protocol';
|
|
26
|
+
import { AirGapV3SerializerCompanion } from './serializer/serializer';
|
|
27
|
+
import { Address, AddressCursor, AddressWithCursor } from './types/address';
|
|
28
|
+
import { AirGapInterface } from './types/airgap';
|
|
29
|
+
import { Amount } from './types/amount';
|
|
30
|
+
import { Balance } from './types/balance';
|
|
31
|
+
import { BlockExplorerMetadata } from './types/block-explorer';
|
|
32
|
+
import { BytesString, BytesStringFormat, HexString } from './types/bytes';
|
|
33
|
+
import { CryptoAlgorithm, CryptoConfiguration, CryptoDerivative, CryptoSecretType, Ed25519CryptoConfiguration, SaplingCryptoConfiguration, Secp256K1CryptoConfiguration, Sr25519CryptoConfiguration } from './types/crypto';
|
|
34
|
+
import { FeeDefaults, FeeEstimation } from './types/fee';
|
|
35
|
+
import { ExtendedKeyPair, ExtendedPublicKey, ExtendedSecretKey, KeyPair, KeyType, PublicKey, SecretKey } from './types/key';
|
|
36
|
+
import { RecursivePartial } from './types/meta/utility-types';
|
|
37
|
+
import { FullProtocolConfiguration, OfflineProtocolConfiguration, OnlineProtocolConfiguration, ProtocolConfiguration } from './types/module';
|
|
38
|
+
import { ProtocolAccountMetadata, ProtocolFeeMetadata, ProtocolMetadata, ProtocolNetwork, ProtocolNetworkType, ProtocolSymbol, ProtocolTransactionArbitraryDataMetadata, ProtocolTransactionMetadata, ProtocolUnitsMetadata } from './types/protocol';
|
|
39
|
+
import { V3SchemaConfiguration } from './types/serializer';
|
|
40
|
+
import { Signature } from './types/signature';
|
|
41
|
+
import { SubProtocolType } from './types/sub-protocol';
|
|
42
|
+
import { AirGapTransaction, AirGapTransactionStatus, AirGapTransactionsWithCursor, SignedTransaction, TransactionCursor, TransactionDetails, TransactionFullConfiguration, TransactionSimpleConfiguration, TransactionType, UnsignedTransaction } from './types/transaction';
|
|
43
|
+
import { AirGapUIAction } from './types/ui/action';
|
|
44
|
+
import { AirGapUIAlert } from './types/ui/alert';
|
|
45
|
+
import { AirGapUIText } from './types/ui/text';
|
|
46
|
+
import { isAmount } from './utils/amount';
|
|
47
|
+
import { implementsInterface, Schema } from './utils/interface';
|
|
48
|
+
import { isAnyKey, isExtendedPublicKey, isExtendedSecretKey, isPublicKey, isSecretKey } from './utils/key';
|
|
49
|
+
import { canSerializeProtocols, createSupportedProtocols, protocolSerializerSchema } from './utils/module';
|
|
50
|
+
import { normalizeToUndefined } from './utils/normalize';
|
|
51
|
+
import { aesEncryptionSchema, asymmetricEncryptionBaseSchema, asymmetricEncryptionOfflineSchema, baseProtocolSchema, bip32BaseProtocolSchema, bip32OfflineProtocolSchema, bip32OnlineProtocolSchema, canEncryptAES, canEncryptAsymmetric, canFetchDataForAddress, canFetchDataForMultipleAddresses, canGetTokenBalances, canSignMessage, configurableContractProtocolSchema, configurableTransactionInjectorSchema, fetchDataForAddressProtocolSchema, fetchDataForMultipleAddressesProtocolSchema, getTokenBalancesSchema, hasConfigurableContract, hasConfigurableTransactionInjector, hasMultiAddressPublicKeys, isAnyProtocol, isBip32Protocol, isMultisig, isMultiTokenSubProtocol, isOfflineProtocol, isOnlineProtocol, isSingleTokenSubProtocol, isSubProtocol, isTransactionStatusChecker, multiAddressPublicKeyProtocolSchema, multiTokenSubProtocolBaseSchema, offlineProtocolSchema, onlineProtocolSchema, protocolNetworkIdentifier, signMessageBaseSchema, signMessageOfflineSchema, singleTokenSubProtocolSchema, subProtocolSchema, supportsWalletConnect, transactionStatusCheckerSchema, walletConnectProtocolSchema } from './utils/protocol';
|
|
52
|
+
export { AirGapBlockExplorer, BlockExplorerMetadata };
|
|
53
|
+
export { newSuccessUIAlert, newInfoUIAlert, newWarningUIAlert, newErrorUIAlert, newPlainUIText, newAmount, newSecretKey, newExtendedSecretKey, newPublicKey, newExtendedPublicKey, newSignature, newUnsignedTransaction, newSignedTransaction };
|
|
54
|
+
export { AirGapModule, ModuleNetworkRegistry, ProtocolConfiguration, OfflineProtocolConfiguration, OnlineProtocolConfiguration, FullProtocolConfiguration, AirGapSerializedOfflineProtocol, AirGapSerializedOnlineProtocol, AirGapSerializedAnyProtocol };
|
|
55
|
+
export { ProtocolSerializerExtension, ProtocolSerializerModule };
|
|
56
|
+
export { AirGapOfflineProtocol, AirGapOnlineProtocol, AirGapProtocol, AirGapAnyProtocol, ProtocolMetadata, ProtocolUnitsMetadata, ProtocolSymbol, ProtocolFeeMetadata, ProtocolAccountMetadata, ProtocolTransactionMetadata, ProtocolTransactionArbitraryDataMetadata, ProtocolNetworkType, ProtocolNetwork, SubProtocolType };
|
|
57
|
+
export { FetchDataForMultipleAddressesExtension, FetchDataForMultipleAddressesProtocol, MultiAddressPublicKeyExtension, MultiAddressPublicKeyProtocol, Bip32Extension, OfflineBip32Protocol, OnlineBip32Protocol, SubProtocolExtension, SubProtocol, SingleTokenSubProtocolExtension, SingleTokenSubProtocol, MultiTokenSubProtocolExtension, BaseMultiTokenSubProtocol, OnlineMultiTokenSubProtocol, TokenDetails, GetTokenBalancesExtension, GetTokenBalances, CryptoExtension, AESExtension, AsymmetricEncryptionExtension, SignMessageExtension, TransactionStatusCheckerExtension, WalletConnectRequest, WalletConnectExtension, WalletConnectProtocol, MultisigProtocol, MultisigExtension };
|
|
58
|
+
export { AirGapV3SerializerCompanion, V3SchemaConfiguration };
|
|
59
|
+
export { AirGapInterface };
|
|
60
|
+
export { AirGapUIAction, AirGapUIAlert, AirGapUIText, Address, AddressCursor, AddressWithCursor, Amount, Balance, MultiTokenBalanceConfiguration, BytesStringFormat, BytesString, HexString, CryptoAlgorithm, CryptoSecretType, Ed25519CryptoConfiguration, Sr25519CryptoConfiguration, Secp256K1CryptoConfiguration, SaplingCryptoConfiguration, CryptoConfiguration, CryptoDerivative, FeeDefaults, FeeEstimation, KeyType, SecretKey, ExtendedSecretKey, PublicKey, ExtendedPublicKey, KeyPair, ExtendedKeyPair, Signature, TransactionType, UnsignedTransaction, SignedTransaction, AirGapTransaction, TransactionCursor, AirGapTransactionsWithCursor, TransactionDetails, TransactionSimpleConfiguration, TransactionFullConfiguration, AirGapTransactionStatus, RecursivePartial };
|
|
61
|
+
export { isAmount, Schema, implementsInterface, isAnyKey, isSecretKey, isExtendedSecretKey, isPublicKey, isExtendedPublicKey, createSupportedProtocols, canSerializeProtocols, isAnyProtocol, isOfflineProtocol, isOnlineProtocol, isBip32Protocol, isSubProtocol, isSingleTokenSubProtocol, isMultisig, isMultiTokenSubProtocol, canGetTokenBalances, canFetchDataForAddress, canFetchDataForMultipleAddresses, hasMultiAddressPublicKeys, hasConfigurableContract, canEncryptAES, canEncryptAsymmetric, canSignMessage, hasConfigurableTransactionInjector, isTransactionStatusChecker, supportsWalletConnect, protocolNetworkIdentifier, normalizeToUndefined };
|
|
62
|
+
export { protocolSerializerSchema, baseProtocolSchema, offlineProtocolSchema, onlineProtocolSchema, bip32BaseProtocolSchema, bip32OfflineProtocolSchema, bip32OnlineProtocolSchema, subProtocolSchema, singleTokenSubProtocolSchema, multiTokenSubProtocolBaseSchema, getTokenBalancesSchema, fetchDataForAddressProtocolSchema, fetchDataForMultipleAddressesProtocolSchema, multiAddressPublicKeyProtocolSchema, configurableContractProtocolSchema, aesEncryptionSchema, asymmetricEncryptionBaseSchema, asymmetricEncryptionOfflineSchema, signMessageBaseSchema, signMessageOfflineSchema, configurableTransactionInjectorSchema, transactionStatusCheckerSchema, walletConnectProtocolSchema };
|
package/index.js
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.bip32OfflineProtocolSchema = exports.bip32BaseProtocolSchema = exports.onlineProtocolSchema = exports.offlineProtocolSchema = exports.baseProtocolSchema = exports.protocolSerializerSchema = exports.normalizeToUndefined = exports.protocolNetworkIdentifier = exports.supportsWalletConnect = exports.isTransactionStatusChecker = exports.hasConfigurableTransactionInjector = exports.canSignMessage = exports.canEncryptAsymmetric = exports.canEncryptAES = exports.hasConfigurableContract = exports.hasMultiAddressPublicKeys = exports.canFetchDataForMultipleAddresses = exports.canFetchDataForAddress = exports.canGetTokenBalances = exports.isMultiTokenSubProtocol = exports.isMultisig = exports.isSingleTokenSubProtocol = exports.isSubProtocol = exports.isBip32Protocol = exports.isOnlineProtocol = exports.isOfflineProtocol = exports.isAnyProtocol = exports.canSerializeProtocols = exports.createSupportedProtocols = exports.isExtendedPublicKey = exports.isPublicKey = exports.isExtendedSecretKey = exports.isSecretKey = exports.isAnyKey = exports.implementsInterface = exports.isAmount = exports.ModuleNetworkRegistry = exports.newSignedTransaction = exports.newUnsignedTransaction = exports.newSignature = exports.newExtendedPublicKey = exports.newPublicKey = exports.newExtendedSecretKey = exports.newSecretKey = exports.newAmount = exports.newPlainUIText = exports.newErrorUIAlert = exports.newWarningUIAlert = exports.newInfoUIAlert = exports.newSuccessUIAlert = void 0;
|
|
4
|
+
exports.walletConnectProtocolSchema = exports.transactionStatusCheckerSchema = exports.configurableTransactionInjectorSchema = exports.signMessageOfflineSchema = exports.signMessageBaseSchema = exports.asymmetricEncryptionOfflineSchema = exports.asymmetricEncryptionBaseSchema = exports.aesEncryptionSchema = exports.configurableContractProtocolSchema = exports.multiAddressPublicKeyProtocolSchema = exports.fetchDataForMultipleAddressesProtocolSchema = exports.fetchDataForAddressProtocolSchema = exports.getTokenBalancesSchema = exports.multiTokenSubProtocolBaseSchema = exports.singleTokenSubProtocolSchema = exports.subProtocolSchema = exports.bip32OnlineProtocolSchema = void 0;
|
|
5
|
+
var amount_1 = require("./factories/amount");
|
|
6
|
+
Object.defineProperty(exports, "newAmount", { enumerable: true, get: function () { return amount_1.newAmount; } });
|
|
7
|
+
var key_1 = require("./factories/key");
|
|
8
|
+
Object.defineProperty(exports, "newExtendedPublicKey", { enumerable: true, get: function () { return key_1.newExtendedPublicKey; } });
|
|
9
|
+
Object.defineProperty(exports, "newExtendedSecretKey", { enumerable: true, get: function () { return key_1.newExtendedSecretKey; } });
|
|
10
|
+
Object.defineProperty(exports, "newPublicKey", { enumerable: true, get: function () { return key_1.newPublicKey; } });
|
|
11
|
+
Object.defineProperty(exports, "newSecretKey", { enumerable: true, get: function () { return key_1.newSecretKey; } });
|
|
12
|
+
var signature_1 = require("./factories/signature");
|
|
13
|
+
Object.defineProperty(exports, "newSignature", { enumerable: true, get: function () { return signature_1.newSignature; } });
|
|
14
|
+
var transaction_1 = require("./factories/transaction");
|
|
15
|
+
Object.defineProperty(exports, "newSignedTransaction", { enumerable: true, get: function () { return transaction_1.newSignedTransaction; } });
|
|
16
|
+
Object.defineProperty(exports, "newUnsignedTransaction", { enumerable: true, get: function () { return transaction_1.newUnsignedTransaction; } });
|
|
17
|
+
var alert_1 = require("./factories/ui/alert");
|
|
18
|
+
Object.defineProperty(exports, "newErrorUIAlert", { enumerable: true, get: function () { return alert_1.newErrorUIAlert; } });
|
|
19
|
+
Object.defineProperty(exports, "newInfoUIAlert", { enumerable: true, get: function () { return alert_1.newInfoUIAlert; } });
|
|
20
|
+
Object.defineProperty(exports, "newSuccessUIAlert", { enumerable: true, get: function () { return alert_1.newSuccessUIAlert; } });
|
|
21
|
+
Object.defineProperty(exports, "newWarningUIAlert", { enumerable: true, get: function () { return alert_1.newWarningUIAlert; } });
|
|
22
|
+
var text_1 = require("./factories/ui/text");
|
|
23
|
+
Object.defineProperty(exports, "newPlainUIText", { enumerable: true, get: function () { return text_1.newPlainUIText; } });
|
|
24
|
+
var module_network_registry_1 = require("./module/module-network-registry");
|
|
25
|
+
Object.defineProperty(exports, "ModuleNetworkRegistry", { enumerable: true, get: function () { return module_network_registry_1.ModuleNetworkRegistry; } });
|
|
26
|
+
var amount_2 = require("./utils/amount");
|
|
27
|
+
Object.defineProperty(exports, "isAmount", { enumerable: true, get: function () { return amount_2.isAmount; } });
|
|
28
|
+
var interface_1 = require("./utils/interface");
|
|
29
|
+
Object.defineProperty(exports, "implementsInterface", { enumerable: true, get: function () { return interface_1.implementsInterface; } });
|
|
30
|
+
var key_2 = require("./utils/key");
|
|
31
|
+
Object.defineProperty(exports, "isAnyKey", { enumerable: true, get: function () { return key_2.isAnyKey; } });
|
|
32
|
+
Object.defineProperty(exports, "isExtendedPublicKey", { enumerable: true, get: function () { return key_2.isExtendedPublicKey; } });
|
|
33
|
+
Object.defineProperty(exports, "isExtendedSecretKey", { enumerable: true, get: function () { return key_2.isExtendedSecretKey; } });
|
|
34
|
+
Object.defineProperty(exports, "isPublicKey", { enumerable: true, get: function () { return key_2.isPublicKey; } });
|
|
35
|
+
Object.defineProperty(exports, "isSecretKey", { enumerable: true, get: function () { return key_2.isSecretKey; } });
|
|
36
|
+
var module_1 = require("./utils/module");
|
|
37
|
+
Object.defineProperty(exports, "canSerializeProtocols", { enumerable: true, get: function () { return module_1.canSerializeProtocols; } });
|
|
38
|
+
Object.defineProperty(exports, "createSupportedProtocols", { enumerable: true, get: function () { return module_1.createSupportedProtocols; } });
|
|
39
|
+
Object.defineProperty(exports, "protocolSerializerSchema", { enumerable: true, get: function () { return module_1.protocolSerializerSchema; } });
|
|
40
|
+
var normalize_1 = require("./utils/normalize");
|
|
41
|
+
Object.defineProperty(exports, "normalizeToUndefined", { enumerable: true, get: function () { return normalize_1.normalizeToUndefined; } });
|
|
42
|
+
var protocol_1 = require("./utils/protocol");
|
|
43
|
+
Object.defineProperty(exports, "aesEncryptionSchema", { enumerable: true, get: function () { return protocol_1.aesEncryptionSchema; } });
|
|
44
|
+
Object.defineProperty(exports, "asymmetricEncryptionBaseSchema", { enumerable: true, get: function () { return protocol_1.asymmetricEncryptionBaseSchema; } });
|
|
45
|
+
Object.defineProperty(exports, "asymmetricEncryptionOfflineSchema", { enumerable: true, get: function () { return protocol_1.asymmetricEncryptionOfflineSchema; } });
|
|
46
|
+
Object.defineProperty(exports, "baseProtocolSchema", { enumerable: true, get: function () { return protocol_1.baseProtocolSchema; } });
|
|
47
|
+
Object.defineProperty(exports, "bip32BaseProtocolSchema", { enumerable: true, get: function () { return protocol_1.bip32BaseProtocolSchema; } });
|
|
48
|
+
Object.defineProperty(exports, "bip32OfflineProtocolSchema", { enumerable: true, get: function () { return protocol_1.bip32OfflineProtocolSchema; } });
|
|
49
|
+
Object.defineProperty(exports, "bip32OnlineProtocolSchema", { enumerable: true, get: function () { return protocol_1.bip32OnlineProtocolSchema; } });
|
|
50
|
+
Object.defineProperty(exports, "canEncryptAES", { enumerable: true, get: function () { return protocol_1.canEncryptAES; } });
|
|
51
|
+
Object.defineProperty(exports, "canEncryptAsymmetric", { enumerable: true, get: function () { return protocol_1.canEncryptAsymmetric; } });
|
|
52
|
+
Object.defineProperty(exports, "canFetchDataForAddress", { enumerable: true, get: function () { return protocol_1.canFetchDataForAddress; } });
|
|
53
|
+
Object.defineProperty(exports, "canFetchDataForMultipleAddresses", { enumerable: true, get: function () { return protocol_1.canFetchDataForMultipleAddresses; } });
|
|
54
|
+
Object.defineProperty(exports, "canGetTokenBalances", { enumerable: true, get: function () { return protocol_1.canGetTokenBalances; } });
|
|
55
|
+
Object.defineProperty(exports, "canSignMessage", { enumerable: true, get: function () { return protocol_1.canSignMessage; } });
|
|
56
|
+
Object.defineProperty(exports, "configurableContractProtocolSchema", { enumerable: true, get: function () { return protocol_1.configurableContractProtocolSchema; } });
|
|
57
|
+
Object.defineProperty(exports, "configurableTransactionInjectorSchema", { enumerable: true, get: function () { return protocol_1.configurableTransactionInjectorSchema; } });
|
|
58
|
+
Object.defineProperty(exports, "fetchDataForAddressProtocolSchema", { enumerable: true, get: function () { return protocol_1.fetchDataForAddressProtocolSchema; } });
|
|
59
|
+
Object.defineProperty(exports, "fetchDataForMultipleAddressesProtocolSchema", { enumerable: true, get: function () { return protocol_1.fetchDataForMultipleAddressesProtocolSchema; } });
|
|
60
|
+
Object.defineProperty(exports, "getTokenBalancesSchema", { enumerable: true, get: function () { return protocol_1.getTokenBalancesSchema; } });
|
|
61
|
+
Object.defineProperty(exports, "hasConfigurableContract", { enumerable: true, get: function () { return protocol_1.hasConfigurableContract; } });
|
|
62
|
+
Object.defineProperty(exports, "hasConfigurableTransactionInjector", { enumerable: true, get: function () { return protocol_1.hasConfigurableTransactionInjector; } });
|
|
63
|
+
Object.defineProperty(exports, "hasMultiAddressPublicKeys", { enumerable: true, get: function () { return protocol_1.hasMultiAddressPublicKeys; } });
|
|
64
|
+
Object.defineProperty(exports, "isAnyProtocol", { enumerable: true, get: function () { return protocol_1.isAnyProtocol; } });
|
|
65
|
+
Object.defineProperty(exports, "isBip32Protocol", { enumerable: true, get: function () { return protocol_1.isBip32Protocol; } });
|
|
66
|
+
Object.defineProperty(exports, "isMultisig", { enumerable: true, get: function () { return protocol_1.isMultisig; } });
|
|
67
|
+
Object.defineProperty(exports, "isMultiTokenSubProtocol", { enumerable: true, get: function () { return protocol_1.isMultiTokenSubProtocol; } });
|
|
68
|
+
Object.defineProperty(exports, "isOfflineProtocol", { enumerable: true, get: function () { return protocol_1.isOfflineProtocol; } });
|
|
69
|
+
Object.defineProperty(exports, "isOnlineProtocol", { enumerable: true, get: function () { return protocol_1.isOnlineProtocol; } });
|
|
70
|
+
Object.defineProperty(exports, "isSingleTokenSubProtocol", { enumerable: true, get: function () { return protocol_1.isSingleTokenSubProtocol; } });
|
|
71
|
+
Object.defineProperty(exports, "isSubProtocol", { enumerable: true, get: function () { return protocol_1.isSubProtocol; } });
|
|
72
|
+
Object.defineProperty(exports, "isTransactionStatusChecker", { enumerable: true, get: function () { return protocol_1.isTransactionStatusChecker; } });
|
|
73
|
+
Object.defineProperty(exports, "multiAddressPublicKeyProtocolSchema", { enumerable: true, get: function () { return protocol_1.multiAddressPublicKeyProtocolSchema; } });
|
|
74
|
+
Object.defineProperty(exports, "multiTokenSubProtocolBaseSchema", { enumerable: true, get: function () { return protocol_1.multiTokenSubProtocolBaseSchema; } });
|
|
75
|
+
Object.defineProperty(exports, "offlineProtocolSchema", { enumerable: true, get: function () { return protocol_1.offlineProtocolSchema; } });
|
|
76
|
+
Object.defineProperty(exports, "onlineProtocolSchema", { enumerable: true, get: function () { return protocol_1.onlineProtocolSchema; } });
|
|
77
|
+
Object.defineProperty(exports, "protocolNetworkIdentifier", { enumerable: true, get: function () { return protocol_1.protocolNetworkIdentifier; } });
|
|
78
|
+
Object.defineProperty(exports, "signMessageBaseSchema", { enumerable: true, get: function () { return protocol_1.signMessageBaseSchema; } });
|
|
79
|
+
Object.defineProperty(exports, "signMessageOfflineSchema", { enumerable: true, get: function () { return protocol_1.signMessageOfflineSchema; } });
|
|
80
|
+
Object.defineProperty(exports, "singleTokenSubProtocolSchema", { enumerable: true, get: function () { return protocol_1.singleTokenSubProtocolSchema; } });
|
|
81
|
+
Object.defineProperty(exports, "subProtocolSchema", { enumerable: true, get: function () { return protocol_1.subProtocolSchema; } });
|
|
82
|
+
Object.defineProperty(exports, "supportsWalletConnect", { enumerable: true, get: function () { return protocol_1.supportsWalletConnect; } });
|
|
83
|
+
Object.defineProperty(exports, "transactionStatusCheckerSchema", { enumerable: true, get: function () { return protocol_1.transactionStatusCheckerSchema; } });
|
|
84
|
+
Object.defineProperty(exports, "walletConnectProtocolSchema", { enumerable: true, get: function () { return protocol_1.walletConnectProtocolSchema; } });
|
|
85
|
+
//# 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":";;;;AAEA,6CAA8C;AAsJ5C,0FAtJO,kBAAS,OAsJP;AArJX,uCAAwG;AAyJtG,qGAzJO,0BAAoB,OAyJP;AAFpB,qGAvJ6B,0BAAoB,OAuJ7B;AACpB,6FAxJmD,kBAAY,OAwJnD;AAFZ,6FAtJiE,kBAAY,OAsJjE;AArJd,mDAAoD;AAyJlD,6FAzJO,wBAAY,OAyJP;AAxJd,uDAAsF;AA0JpF,qGA1JO,kCAAoB,OA0JP;AADpB,uGAzJ6B,oCAAsB,OAyJ7B;AAxJxB,8CAA4G;AAgJ1G,gGAhJO,uBAAe,OAgJP;AAFf,+FA9IwB,sBAAc,OA8IxB;AADd,kGA7IwC,yBAAiB,OA6IxC;AAEjB,kGA/I2D,yBAAiB,OA+I3D;AA9InB,4CAAoD;AAgJlD,+FAhJO,qBAAc,OAgJP;AAvIhB,4EAAwE;AAsJtE,sGAtJO,+CAAqB,OAsJP;AA5EvB,yCAAyC;AAsMvC,yFAtMO,iBAAQ,OAsMP;AArMV,+CAA+D;AAuM7D,oGAvMO,+BAAmB,OAuMP;AAtMrB,mCAA0G;AAuMxG,yFAvMO,cAAQ,OAuMP;AAIR,oGA3MiB,yBAAmB,OA2MjB;AAFnB,oGAzMsC,yBAAmB,OAyMtC;AACnB,4FA1M2D,iBAAW,OA0M3D;AAFX,4FAxMwE,iBAAW,OAwMxE;AAvMb,yCAA0G;AA4MxG,sGA5MO,8BAAqB,OA4MP;AADrB,yGA3M8B,iCAAwB,OA2M9B;AA4BxB,yGAvOwD,iCAAwB,OAuOxD;AAtO1B,+CAAwD;AAgOtD,qGAhOO,gCAAoB,OAgOP;AA/NtB,6CA2CyB;AAyMvB,oGAnPA,8BAAmB,OAmPA;AACnB,+GAnPA,yCAA8B,OAmPA;AAC9B,kHAnPA,4CAAiC,OAmPA;AAhBjC,mGAlOA,6BAAkB,OAkOA;AAGlB,wGApOA,kCAAuB,OAoOA;AACvB,2GApOA,qCAA0B,OAoOA;AAC1B,0GApOA,oCAAyB,OAoOA;AAnBzB,8FAhNA,wBAAa,OAgNA;AACb,qGAhNA,+BAAoB,OAgNA;AALpB,uGA1MA,iCAAsB,OA0MA;AACtB,iHA1MA,2CAAgC,OA0MA;AAFhC,oGAvMA,8BAAmB,OAuMA;AAOnB,+FA7MA,yBAAc,OA6MA;AAyBd,mHArOA,6CAAkC,OAqOA;AAMlC,sHA1OA,gDAAqC,OA0OA;AATrC,kHAhOA,4CAAiC,OAgOA;AACjC,4HAhOA,sDAA2C,OAgOA;AAF3C,uGA7NA,iCAAsB,OA6NA;AAxBtB,wGApMA,kCAAuB,OAoMA;AAIvB,mHAvMA,6CAAkC,OAuMA;AALlC,0GAjMA,oCAAyB,OAiMA;AAXzB,8FArLA,wBAAa,OAqLA;AAGb,gGAvLA,0BAAe,OAuLA;AAGf,2FAzLA,qBAAU,OAyLA;AACV,wGAzLA,kCAAuB,OAyLA;AANvB,kGAlLA,4BAAiB,OAkLA;AACjB,iGAlLA,2BAAgB,OAkLA;AAGhB,yGApLA,mCAAwB,OAoLA;AADxB,8FAlLA,wBAAa,OAkLA;AAab,2GA9LA,qCAA0B,OA8LA;AAsB1B,oHAnNA,8CAAmC,OAmNA;AAJnC,gHA9MA,0CAA+B,OA8MA;AAP/B,sGAtMA,gCAAqB,OAsMA;AACrB,qGAtMA,+BAAoB,OAsMA;AAVpB,0GA3LA,oCAAyB,OA2LA;AAyBzB,sGAnNA,gCAAqB,OAmNA;AACrB,yGAnNA,mCAAwB,OAmNA;AAXxB,6GAvMA,uCAA4B,OAuMA;AAD5B,kGArMA,4BAAiB,OAqMA;AAfjB,sGArLA,gCAAqB,OAqLA;AA6BrB,+GAjNA,yCAA8B,OAiNA;AAC9B,4GAjNA,sCAA2B,OAiNA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.delegateProtocolSchema = exports.supportsDelegation = void 0;
|
|
4
|
+
var protocol_1 = require("./utils/protocol");
|
|
5
|
+
Object.defineProperty(exports, "delegateProtocolSchema", { enumerable: true, get: function () { return protocol_1.delegateProtocolSchema; } });
|
|
6
|
+
Object.defineProperty(exports, "supportsDelegation", { enumerable: true, get: function () { return protocol_1.supportsDelegation; } });
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/internal/index.ts"],"names":[],"mappings":";;;AACA,6CAA6E;AAYpE,uGAZA,iCAAsB,OAYA;AAJtB,mGARwB,6BAAkB,OAQxB"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { DelegateeDetails, DelegationDetails, DelegatorDetails } from '@wallfree-dev/coinlib-core';
|
|
2
|
+
import { Address } from '../../types/address';
|
|
3
|
+
import { PublicKey } from '../../types/key';
|
|
4
|
+
/**
|
|
5
|
+
* DO NOT USE!
|
|
6
|
+
* This is an internal type and will be removed in future releases.
|
|
7
|
+
*/
|
|
8
|
+
export interface AirGapDelegateProtocol {
|
|
9
|
+
getDefaultDelegatee(): Promise<Address>;
|
|
10
|
+
getCurrentDelegateesForPublicKey(publicKey: PublicKey, data?: any): Promise<Address[]>;
|
|
11
|
+
getCurrentDelegateesForAddress(address: Address, data?: any): Promise<Address[]>;
|
|
12
|
+
getDelegateeDetails(address: Address, data?: any): Promise<DelegateeDetails>;
|
|
13
|
+
isPublicKeyDelegating(publicKey: PublicKey, data?: any): Promise<boolean>;
|
|
14
|
+
isAddressDelegating(address: Address, data?: any): Promise<boolean>;
|
|
15
|
+
getDelegatorDetailsFromPublicKey(publicKey: PublicKey, data?: any): Promise<DelegatorDetails>;
|
|
16
|
+
getDelegatorDetailsFromAddress(address: Address, data?: any): Promise<DelegatorDetails>;
|
|
17
|
+
getDelegationDetailsFromPublicKey(publicKey: PublicKey, delegatees: Address[], data?: any): Promise<DelegationDetails>;
|
|
18
|
+
getDelegationDetailsFromAddress(address: Address, delegatees: Address[], data?: any): Promise<DelegationDetails>;
|
|
19
|
+
prepareDelegatorActionFromPublicKey(publicKey: PublicKey, type: any, data?: any): Promise<any[]>;
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AirGapDelegateProtocol.js","sourceRoot":"","sources":["../../../src/internal/protocol/AirGapDelegateProtocol.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { AnyProtocol } from '../../protocol/protocol';
|
|
2
|
+
import { Schema } from '../../utils/interface';
|
|
3
|
+
import { AirGapDelegateProtocol } from '../protocol/AirGapDelegateProtocol';
|
|
4
|
+
export declare const delegateProtocolSchema: Schema<AirGapDelegateProtocol>;
|
|
5
|
+
export declare function supportsDelegation(object: AnyProtocol): object is AnyProtocol & AirGapDelegateProtocol;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Schemas
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.supportsDelegation = exports.delegateProtocolSchema = void 0;
|
|
5
|
+
var interface_1 = require("../../utils/interface");
|
|
6
|
+
exports.delegateProtocolSchema = {
|
|
7
|
+
getCurrentDelegateesForAddress: 'required',
|
|
8
|
+
getCurrentDelegateesForPublicKey: 'required',
|
|
9
|
+
getDefaultDelegatee: 'required',
|
|
10
|
+
getDelegateeDetails: 'required',
|
|
11
|
+
getDelegationDetailsFromAddress: 'required',
|
|
12
|
+
getDelegationDetailsFromPublicKey: 'required',
|
|
13
|
+
getDelegatorDetailsFromAddress: 'required',
|
|
14
|
+
getDelegatorDetailsFromPublicKey: 'required',
|
|
15
|
+
isAddressDelegating: 'required',
|
|
16
|
+
isPublicKeyDelegating: 'required',
|
|
17
|
+
prepareDelegatorActionFromPublicKey: 'required'
|
|
18
|
+
};
|
|
19
|
+
// Implementation Checks
|
|
20
|
+
function supportsDelegation(object) {
|
|
21
|
+
return (0, interface_1.implementsInterface)(object, exports.delegateProtocolSchema);
|
|
22
|
+
}
|
|
23
|
+
exports.supportsDelegation = supportsDelegation;
|
|
24
|
+
//# sourceMappingURL=protocol.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"protocol.js","sourceRoot":"","sources":["../../../src/internal/utils/protocol.ts"],"names":[],"mappings":";AAAA,UAAU;;;AAGV,mDAAmE;AAGtD,QAAA,sBAAsB,GAAmC;IACpE,8BAA8B,EAAE,UAAU;IAC1C,gCAAgC,EAAE,UAAU;IAC5C,mBAAmB,EAAE,UAAU;IAC/B,mBAAmB,EAAE,UAAU;IAC/B,+BAA+B,EAAE,UAAU;IAC3C,iCAAiC,EAAE,UAAU;IAC7C,8BAA8B,EAAE,UAAU;IAC1C,gCAAgC,EAAE,UAAU;IAC5C,mBAAmB,EAAE,UAAU;IAC/B,qBAAqB,EAAE,UAAU;IACjC,mCAAmC,EAAE,UAAU;CAChD,CAAA;AAED,wBAAwB;AAExB,SAAgB,kBAAkB,CAAC,MAAmB;IACpD,OAAO,IAAA,+BAAmB,EAAyB,MAAM,EAAE,8BAAsB,CAAC,CAAA;AACpF,CAAC;AAFD,gDAEC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Module } from '../module';
|
|
2
|
+
import { ProtocolSerializerExtension } from './serialization/ProtocolSerializer';
|
|
3
|
+
export declare type ModuleExtensions<T> = T extends Module ? Extensions<T> : never;
|
|
4
|
+
interface Extensions<T extends Module> {
|
|
5
|
+
ProtocolSerializer: ProtocolSerializerExtension<T>;
|
|
6
|
+
}
|
|
7
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extensions.js","sourceRoot":"","sources":["../../../src/module/extensions/extensions.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { AirGapOfflineProtocol, AirGapOnlineProtocol } from '../../../protocol/protocol';
|
|
2
|
+
import { Module } from '../../module';
|
|
3
|
+
interface AirGapSerializedBaseProtocol<T extends string> {
|
|
4
|
+
type: T;
|
|
5
|
+
identifier: string;
|
|
6
|
+
}
|
|
7
|
+
export interface AirGapSerializedOfflineProtocol extends AirGapSerializedBaseProtocol<'offline'> {
|
|
8
|
+
}
|
|
9
|
+
export interface AirGapSerializedOnlineProtocol extends AirGapSerializedBaseProtocol<'online'> {
|
|
10
|
+
}
|
|
11
|
+
export declare type AirGapSerializedAnyProtocol = AirGapSerializedOfflineProtocol | AirGapSerializedOnlineProtocol;
|
|
12
|
+
export declare type ProtocolSerializerExtension<_T extends Module> = ProtocolSerializerModule;
|
|
13
|
+
export interface ProtocolSerializerModule {
|
|
14
|
+
serializeOfflineProtocol(protocol: AirGapOfflineProtocol): Promise<AirGapSerializedOfflineProtocol | undefined>;
|
|
15
|
+
deserializeOfflineProtocol(serialized: AirGapSerializedOfflineProtocol): Promise<AirGapOfflineProtocol | undefined>;
|
|
16
|
+
serializeOnlineProtocol(protocol: AirGapOnlineProtocol): Promise<AirGapSerializedOnlineProtocol | undefined>;
|
|
17
|
+
deserializeOnlineProtocol(serialized: AirGapSerializedOnlineProtocol): Promise<AirGapOnlineProtocol | undefined>;
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProtocolSerializer.js","sourceRoot":"","sources":["../../../../src/module/extensions/serialization/ProtocolSerializer.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,24 @@
|
|
|
1
|
+
import { AirGapBlockExplorer } from '../block-explorer/block-explorer';
|
|
2
|
+
import { AirGapOfflineProtocol, AirGapOnlineProtocol } from '../protocol/protocol';
|
|
3
|
+
import { AirGapV3SerializerCompanion } from '../serializer/serializer';
|
|
4
|
+
import { AirGapInterface } from '../types/airgap';
|
|
5
|
+
import { ApplicableModuleExtension } from '../types/airgap';
|
|
6
|
+
import { Complement } from '../types/meta/utility-types';
|
|
7
|
+
import { ProtocolConfiguration } from '../types/module';
|
|
8
|
+
import { ProtocolNetwork } from '../types/protocol';
|
|
9
|
+
interface ModuleGeneric<_Protocols extends string = string, _ProtocolNetwork extends ProtocolNetwork = ProtocolNetwork> {
|
|
10
|
+
Protocols: _Protocols;
|
|
11
|
+
ProtocolNetwork: _ProtocolNetwork;
|
|
12
|
+
}
|
|
13
|
+
declare type TypedProtocols<G extends Partial<ModuleGeneric>> = Complement<ModuleGeneric, G>['Protocols'];
|
|
14
|
+
declare type TypedProtocolNetwork<G extends Partial<ModuleGeneric>> = Complement<ModuleGeneric, G>['ProtocolNetwork'];
|
|
15
|
+
interface _Module<_Protocols extends ModuleGeneric['Protocols'] = any, _ProtocolNetwork extends ModuleGeneric['ProtocolNetwork'] = any> {
|
|
16
|
+
supportedProtocols: Record<_Protocols, ProtocolConfiguration>;
|
|
17
|
+
createOfflineProtocol(identifier: _Protocols): Promise<AirGapOfflineProtocol | undefined>;
|
|
18
|
+
createOnlineProtocol(identifier: _Protocols, networkOrId?: _ProtocolNetwork | string): Promise<AirGapOnlineProtocol | undefined>;
|
|
19
|
+
createBlockExplorer(identifier: _Protocols, networkOrId?: _ProtocolNetwork | string): Promise<AirGapBlockExplorer | undefined>;
|
|
20
|
+
createV3SerializerCompanion(): Promise<AirGapV3SerializerCompanion>;
|
|
21
|
+
}
|
|
22
|
+
export declare type Module<G extends Partial<ModuleGeneric> = {}> = _Module<TypedProtocols<G>, TypedProtocolNetwork<G>>;
|
|
23
|
+
export declare type AirGapModule<G extends Partial<ModuleGeneric> = {}, E0 extends ApplicableModuleExtension<Module> = undefined, E1 extends ApplicableModuleExtension<Module> = undefined, E2 extends ApplicableModuleExtension<Module> = undefined, E3 extends ApplicableModuleExtension<Module> = undefined, E4 extends ApplicableModuleExtension<Module> = undefined, E5 extends ApplicableModuleExtension<Module> = undefined, E6 extends ApplicableModuleExtension<Module> = undefined, E7 extends ApplicableModuleExtension<Module> = undefined, E8 extends ApplicableModuleExtension<Module> = undefined, E9 extends ApplicableModuleExtension<Module> = undefined> = AirGapInterface<Module<G>, E0, E1, E2, E3, E4, E5, E6, E7, E8, E9>;
|
|
24
|
+
export {};
|