@airgap/module-kit 0.13.14-beta.0 → 0.13.14-beta.2
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/index.d.ts +4 -4
- package/index.js +3 -2
- package/index.js.map +1 -1
- package/package.json +3 -3
- package/protocol/protocol.d.ts +4 -4
- package/types/meta/utility-types.d.ts +1 -0
- package/types/transaction.d.ts +4 -2
- package/utils/protocol.d.ts +3 -2
- package/utils/protocol.js +5 -1
- package/utils/protocol.js.map +1 -1
package/index.d.ts
CHANGED
|
@@ -35,7 +35,7 @@ import { ProtocolAccountMetadata, ProtocolFeeMetadata, ProtocolMetadata, Protoco
|
|
|
35
35
|
import { V3SchemaConfiguration } from './types/serializer';
|
|
36
36
|
import { Signature } from './types/signature';
|
|
37
37
|
import { SubProtocolType } from './types/sub-protocol';
|
|
38
|
-
import { AirGapTransaction, AirGapTransactionStatus, AirGapTransactionsWithCursor, SignedTransaction,
|
|
38
|
+
import { AirGapTransaction, AirGapTransactionStatus, AirGapTransactionsWithCursor, SignedTransaction, TransactionSimpleConfiguration, TransactionCursor, TransactionDetails, TransactionType, UnsignedTransaction, TransactionFullConfiguration } from './types/transaction';
|
|
39
39
|
import { AirGapUIAction } from './types/ui/action';
|
|
40
40
|
import { AirGapUIAlert } from './types/ui/alert';
|
|
41
41
|
import { AirGapUIText } from './types/ui/text';
|
|
@@ -44,13 +44,13 @@ import { implementsInterface, Schema } from './utils/interface';
|
|
|
44
44
|
import { isAnyKey, isExtendedPublicKey, isExtendedSecretKey, isPublicKey, isSecretKey } from './utils/key';
|
|
45
45
|
import { createSupportedProtocols } from './utils/module';
|
|
46
46
|
import { normalizeToUndefined } from './utils/normalize';
|
|
47
|
-
import { aesEncryptionSchema, asymmetricEncryptionBaseSchema, asymmetricEncryptionOfflineSchema, baseProtocolSchema, bip32BaseProtocolSchema, bip32OfflineProtocolSchema, bip32OnlineProtocolSchema, canEncryptAES, canEncryptAsymmetric, canFetchDataForAddress, canFetchDataForMultipleAddresses, canSignMessage, configurableContractProtocolSchema, configurableTransactionInjectorSchema, fetchDataForAddressProtocolSchema, fetchDataForMultipleAddressesProtocolSchema, hasConfigurableContract, hasConfigurableTransactionInjector, hasMultiAddressPublicKeys, isBip32Protocol, isMultiTokenSubProtocol, isOfflineProtocol, isOnlineProtocol, isSingleTokenSubProtocol, isSubProtocol, isTransactionStatusChecker, multiAddressPublicKeyProtocolSchema, multiTokenSubProtocolBaseSchema, offlineProtocolSchema, onlineProtocolSchema, protocolNetworkIdentifier, signMessageBaseSchema, signMessageOfflineSchema, singleTokenSubProtocolSchema, subProtocolSchema, transactionStatusCheckerSchema } from './utils/protocol';
|
|
47
|
+
import { aesEncryptionSchema, asymmetricEncryptionBaseSchema, asymmetricEncryptionOfflineSchema, baseProtocolSchema, bip32BaseProtocolSchema, bip32OfflineProtocolSchema, bip32OnlineProtocolSchema, canEncryptAES, canEncryptAsymmetric, canFetchDataForAddress, canFetchDataForMultipleAddresses, canSignMessage, configurableContractProtocolSchema, configurableTransactionInjectorSchema, fetchDataForAddressProtocolSchema, fetchDataForMultipleAddressesProtocolSchema, hasConfigurableContract, hasConfigurableTransactionInjector, hasMultiAddressPublicKeys, isAnyProtocol, isBip32Protocol, isMultiTokenSubProtocol, isOfflineProtocol, isOnlineProtocol, isSingleTokenSubProtocol, isSubProtocol, isTransactionStatusChecker, multiAddressPublicKeyProtocolSchema, multiTokenSubProtocolBaseSchema, offlineProtocolSchema, onlineProtocolSchema, protocolNetworkIdentifier, signMessageBaseSchema, signMessageOfflineSchema, singleTokenSubProtocolSchema, subProtocolSchema, transactionStatusCheckerSchema } from './utils/protocol';
|
|
48
48
|
export { AirGapBlockExplorer, BlockExplorerMetadata };
|
|
49
49
|
export { newSuccessUIAlert, newInfoUIAlert, newWarningUIAlert, newErrorUIAlert, newPlainUIText, newAmount, newSecretKey, newExtendedSecretKey, newPublicKey, newExtendedPublicKey, newSignature, newUnsignedTransaction, newSignedTransaction };
|
|
50
50
|
export { AirGapModule, ModuleNetworkRegistry, ProtocolConfiguration, OfflineProtocolConfiguration, OnlineProtocolConfiguration, FullProtocolConfiguration };
|
|
51
51
|
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, ProtocolTransactionMetadata, ProtocolNetworkType, ProtocolNetwork, SubProtocolType };
|
|
52
52
|
export { AirGapV3SerializerCompanion, V3SchemaConfiguration };
|
|
53
53
|
export { AirGapInterface };
|
|
54
|
-
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,
|
|
55
|
-
export { isAmount, Schema, implementsInterface, isAnyKey, isSecretKey, isExtendedSecretKey, isPublicKey, isExtendedPublicKey, createSupportedProtocols, isOfflineProtocol, isOnlineProtocol, isBip32Protocol, isSubProtocol, isSingleTokenSubProtocol, isMultiTokenSubProtocol, canFetchDataForAddress, canFetchDataForMultipleAddresses, hasMultiAddressPublicKeys, hasConfigurableContract, canEncryptAES, canEncryptAsymmetric, canSignMessage, hasConfigurableTransactionInjector, isTransactionStatusChecker, protocolNetworkIdentifier, normalizeToUndefined };
|
|
54
|
+
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 };
|
|
55
|
+
export { isAmount, Schema, implementsInterface, isAnyKey, isSecretKey, isExtendedSecretKey, isPublicKey, isExtendedPublicKey, createSupportedProtocols, isAnyProtocol, isOfflineProtocol, isOnlineProtocol, isBip32Protocol, isSubProtocol, isSingleTokenSubProtocol, isMultiTokenSubProtocol, canFetchDataForAddress, canFetchDataForMultipleAddresses, hasMultiAddressPublicKeys, hasConfigurableContract, canEncryptAES, canEncryptAsymmetric, canSignMessage, hasConfigurableTransactionInjector, isTransactionStatusChecker, protocolNetworkIdentifier, normalizeToUndefined };
|
|
56
56
|
export { baseProtocolSchema, offlineProtocolSchema, onlineProtocolSchema, bip32BaseProtocolSchema, bip32OfflineProtocolSchema, bip32OnlineProtocolSchema, subProtocolSchema, singleTokenSubProtocolSchema, multiTokenSubProtocolBaseSchema, fetchDataForAddressProtocolSchema, fetchDataForMultipleAddressesProtocolSchema, multiAddressPublicKeyProtocolSchema, configurableContractProtocolSchema, aesEncryptionSchema, asymmetricEncryptionBaseSchema, asymmetricEncryptionOfflineSchema, signMessageBaseSchema, signMessageOfflineSchema, configurableTransactionInjectorSchema, transactionStatusCheckerSchema };
|
package/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.transactionStatusCheckerSchema = exports.configurableTransactionInjectorSchema = exports.signMessageOfflineSchema = exports.signMessageBaseSchema = exports.asymmetricEncryptionOfflineSchema = exports.asymmetricEncryptionBaseSchema = exports.aesEncryptionSchema = exports.configurableContractProtocolSchema = exports.multiAddressPublicKeyProtocolSchema = void 0;
|
|
3
|
+
exports.fetchDataForAddressProtocolSchema = exports.multiTokenSubProtocolBaseSchema = exports.singleTokenSubProtocolSchema = exports.subProtocolSchema = exports.bip32OnlineProtocolSchema = exports.bip32OfflineProtocolSchema = exports.bip32BaseProtocolSchema = exports.onlineProtocolSchema = exports.offlineProtocolSchema = exports.baseProtocolSchema = exports.normalizeToUndefined = exports.protocolNetworkIdentifier = exports.isTransactionStatusChecker = exports.hasConfigurableTransactionInjector = exports.canSignMessage = exports.canEncryptAsymmetric = exports.canEncryptAES = exports.hasConfigurableContract = exports.hasMultiAddressPublicKeys = exports.canFetchDataForMultipleAddresses = exports.canFetchDataForAddress = exports.isMultiTokenSubProtocol = exports.isSingleTokenSubProtocol = exports.isSubProtocol = exports.isBip32Protocol = exports.isOnlineProtocol = exports.isOfflineProtocol = exports.isAnyProtocol = 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.transactionStatusCheckerSchema = exports.configurableTransactionInjectorSchema = exports.signMessageOfflineSchema = exports.signMessageBaseSchema = exports.asymmetricEncryptionOfflineSchema = exports.asymmetricEncryptionBaseSchema = exports.aesEncryptionSchema = exports.configurableContractProtocolSchema = exports.multiAddressPublicKeyProtocolSchema = exports.fetchDataForMultipleAddressesProtocolSchema = void 0;
|
|
5
5
|
var amount_1 = require("./factories/amount");
|
|
6
6
|
Object.defineProperty(exports, "newAmount", { enumerable: true, get: function () { return amount_1.newAmount; } });
|
|
7
7
|
var key_1 = require("./factories/key");
|
|
@@ -57,6 +57,7 @@ Object.defineProperty(exports, "fetchDataForMultipleAddressesProtocolSchema", {
|
|
|
57
57
|
Object.defineProperty(exports, "hasConfigurableContract", { enumerable: true, get: function () { return protocol_1.hasConfigurableContract; } });
|
|
58
58
|
Object.defineProperty(exports, "hasConfigurableTransactionInjector", { enumerable: true, get: function () { return protocol_1.hasConfigurableTransactionInjector; } });
|
|
59
59
|
Object.defineProperty(exports, "hasMultiAddressPublicKeys", { enumerable: true, get: function () { return protocol_1.hasMultiAddressPublicKeys; } });
|
|
60
|
+
Object.defineProperty(exports, "isAnyProtocol", { enumerable: true, get: function () { return protocol_1.isAnyProtocol; } });
|
|
60
61
|
Object.defineProperty(exports, "isBip32Protocol", { enumerable: true, get: function () { return protocol_1.isBip32Protocol; } });
|
|
61
62
|
Object.defineProperty(exports, "isMultiTokenSubProtocol", { enumerable: true, get: function () { return protocol_1.isMultiTokenSubProtocol; } });
|
|
62
63
|
Object.defineProperty(exports, "isOfflineProtocol", { enumerable: true, get: function () { return protocol_1.isOfflineProtocol; } });
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AACA,6CAA8C;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources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BAAoB,OAmLA;AALpB,uGA7KA,iCAAsB,OA6KA;AACtB,iHA7KA,2CAAgC,OA6KA;AAKhC,+FAjLA,yBAAc,OAiLA;AAsBd,mHAtMA,6CAAkC,OAsMA;AAMlC,sHA3MA,gDAAqC,OA2MA;AATrC,kHAjMA,4CAAiC,OAiMA;AACjC,4HAjMA,sDAA2C,OAiMA;AAvB3C,wGAzKA,kCAAuB,OAyKA;AAIvB,mHA5KA,6CAAkC,OA4KA;AALlC,0GAtKA,oCAAyB,OAsKA;AATzB,8FA5JA,wBAAa,OA4JA;AAGb,gGA9JA,0BAAe,OA8JA;AAGf,wGAhKA,kCAAuB,OAgKA;AALvB,kGA1JA,4BAAiB,OA0JA;AACjB,iGA1JA,2BAAgB,OA0JA;AAGhB,yGA5JA,mCAAwB,OA4JA;AADxB,8FA1JA,wBAAa,OA0JA;AAWb,2GApKA,qCAA0B,OAoKA;AAmB1B,oHAtLA,8CAAmC,OAsLA;AAHnC,gHAlLA,0CAA+B,OAkLA;AAP/B,sGA1KA,gCAAqB,OA0KA;AACrB,qGA1KA,+BAAoB,OA0KA;AATpB,0GAhKA,oCAAyB,OAgKA;AAuBzB,sGAtLA,gCAAqB,OAsLA;AACrB,yGAtLA,mCAAwB,OAsLA;AAVxB,6GA3KA,uCAA4B,OA2KA;AAD5B,kGAzKA,4BAAiB,OAyKA;AAajB,+GArLA,yCAA8B,OAqLA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@airgap/module-kit",
|
|
3
|
-
"version": "0.13.14-beta.
|
|
3
|
+
"version": "0.13.14-beta.2",
|
|
4
4
|
"description": "The @airgap/module-kit package provides the common interfaces and functionalities to implement AirGap modules.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"airgap",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
},
|
|
30
30
|
"author": "Papers AG <contact@papers.ch> (https://papers.ch)",
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@airgap/coinlib-core": "
|
|
33
|
-
"@airgap/serializer": "
|
|
32
|
+
"@airgap/coinlib-core": "*",
|
|
33
|
+
"@airgap/serializer": "*"
|
|
34
34
|
},
|
|
35
35
|
"nyc": {
|
|
36
36
|
"include": [
|
package/protocol/protocol.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { FeeEstimation } from '../types/fee';
|
|
|
7
7
|
import { ExtendedKeyPair, ExtendedPublicKey, ExtendedSecretKey, KeyPair, PublicKey, SecretKey } from '../types/key';
|
|
8
8
|
import { Complement } from '../types/meta/utility-types';
|
|
9
9
|
import { ProtocolMetadata, ProtocolNetwork } from '../types/protocol';
|
|
10
|
-
import { AirGapTransaction, AirGapTransactionsWithCursor, SignedTransaction,
|
|
10
|
+
import { AirGapTransaction, AirGapTransactionsWithCursor, SignedTransaction, TransactionSimpleConfiguration, TransactionCursor, TransactionDetails, UnsignedTransaction, TransactionFullConfiguration } from '../types/transaction';
|
|
11
11
|
export interface BaseGeneric<_AddressCursor extends AddressCursor = AddressCursor, _AddressResult extends Address | AddressWithCursor<_AddressCursor> = Address | AddressWithCursor<_AddressCursor>, _Units extends string = string, _FeeUnits extends string = _Units, _SignedTransaction extends SignedTransaction = SignedTransaction, _UnsignedTransaction extends UnsignedTransaction = UnsignedTransaction> {
|
|
12
12
|
AddressCursor: _AddressCursor;
|
|
13
13
|
AddressResult: _AddressResult;
|
|
@@ -50,9 +50,9 @@ export interface _OnlineProtocol<_AddressCursor extends OnlineGeneric['AddressCu
|
|
|
50
50
|
getNetwork(): Promise<_ProtocolNetwork>;
|
|
51
51
|
getTransactionsForPublicKey(publicKey: _PublicKey, limit: number, cursor?: _TransactionCursor): Promise<AirGapTransactionsWithCursor<_TransactionCursor, _Units, _FeeUnits>>;
|
|
52
52
|
getBalanceOfPublicKey(publicKey: _PublicKey, configuration?: _BalanceConfiguration): Promise<Balance<_Units>>;
|
|
53
|
-
getTransactionMaxAmountWithPublicKey(publicKey: _PublicKey, to: Address[], configuration?:
|
|
54
|
-
getTransactionFeeWithPublicKey(publicKey: _PublicKey, details: TransactionDetails<_Units>[]): Promise<_FeeEstimation>;
|
|
55
|
-
prepareTransactionWithPublicKey(publicKey: _PublicKey, details: TransactionDetails<_Units>[], configuration?:
|
|
53
|
+
getTransactionMaxAmountWithPublicKey(publicKey: _PublicKey, to: Address[], configuration?: TransactionFullConfiguration<_FeeUnits>): Promise<Amount<_Units>>;
|
|
54
|
+
getTransactionFeeWithPublicKey(publicKey: _PublicKey, details: TransactionDetails<_Units>[], configuration?: TransactionSimpleConfiguration): Promise<_FeeEstimation>;
|
|
55
|
+
prepareTransactionWithPublicKey(publicKey: _PublicKey, details: TransactionDetails<_Units>[], configuration?: TransactionFullConfiguration<_FeeUnits>): Promise<_UnsignedTransaction>;
|
|
56
56
|
broadcastTransaction(transaction: _SignedTransaction): Promise<string>;
|
|
57
57
|
}
|
|
58
58
|
export declare type OnlineProtocol<G extends Partial<OnlineGeneric> = {}> = _OnlineProtocol<TypedAddressCursor<G>, TypedAddressResult<G>, TypedProtocolNetwork<G>, TypedUnits<G>, TypedFeeUnits<G>, TypedFeeEstimation<G>, TypedSignedTransaction<G>, TypedUnsignedTransaction<G>, TypedTransactionCursor<G>, PublicKey, undefined>;
|
|
@@ -5,3 +5,4 @@ export declare type RecursivePartial<T> = {
|
|
|
5
5
|
export declare type Override<T, U> = Omit<T, keyof U> & U;
|
|
6
6
|
export declare type ExtractTyped<T, K extends T> = Extract<T, K>;
|
|
7
7
|
export declare type ExcludeTyped<T, K extends T> = Exclude<T, K>;
|
|
8
|
+
export declare type OmitTyped<T, K extends keyof T> = Omit<T, K>;
|
package/types/transaction.d.ts
CHANGED
|
@@ -41,12 +41,14 @@ export interface TransactionDetails<_Units extends string = string> {
|
|
|
41
41
|
amount: Amount<_Units>;
|
|
42
42
|
arbitraryData?: string;
|
|
43
43
|
}
|
|
44
|
-
export interface
|
|
45
|
-
fee?: Amount<_FeeUnits>;
|
|
44
|
+
export interface TransactionSimpleConfiguration {
|
|
46
45
|
arbitraryData?: string;
|
|
47
46
|
keepMinBalance?: boolean;
|
|
48
47
|
assetId?: number;
|
|
49
48
|
}
|
|
49
|
+
export interface TransactionFullConfiguration<_FeeUnits extends string = string> extends TransactionSimpleConfiguration {
|
|
50
|
+
fee?: Amount<_FeeUnits>;
|
|
51
|
+
}
|
|
50
52
|
interface BaseTransactionStatus<_Type extends string> extends Sealed<_Type> {
|
|
51
53
|
hash?: string;
|
|
52
54
|
block?: string;
|
package/utils/protocol.d.ts
CHANGED
|
@@ -35,8 +35,9 @@ export declare const signMessageBaseSchema: Schema<BaseSignMessage>;
|
|
|
35
35
|
export declare const signMessageOfflineSchema: Schema<OfflineSignMessage>;
|
|
36
36
|
export declare const configurableTransactionInjectorSchema: Schema<ConfigurableTransactionInjectorProtocol>;
|
|
37
37
|
export declare const transactionStatusCheckerSchema: Schema<TransactionStatusChecker>;
|
|
38
|
-
export declare function
|
|
39
|
-
export declare function
|
|
38
|
+
export declare function isAnyProtocol(object: unknown): object is AnyProtocol;
|
|
39
|
+
export declare function isOfflineProtocol(object: unknown): object is OfflineProtocol;
|
|
40
|
+
export declare function isOnlineProtocol(object: unknown): object is OnlineProtocol;
|
|
40
41
|
export declare function isBip32Protocol<T extends AnyProtocol>(protocol: T): protocol is T & Bip32Extension<T>;
|
|
41
42
|
export declare function isSubProtocol<T extends AnyProtocol>(protocol: T): protocol is T & SubProtocol;
|
|
42
43
|
export declare function isSingleTokenSubProtocol<T extends AnyProtocol>(protocol: T): protocol is T & SingleTokenSubProtocolExtension<T>;
|
package/utils/protocol.js
CHANGED
|
@@ -11,7 +11,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.protocolNetworkIdentifier = exports.isTransactionStatusChecker = exports.hasConfigurableTransactionInjector = exports.canSignMessage = exports.canEncryptAsymmetric = exports.canEncryptAES = exports.hasConfigurableContract = exports.hasMultiAddressPublicKeys = exports.canFetchDataForMultipleAddresses = exports.canFetchDataForAddress = exports.isMultiTokenSubProtocol = exports.isSingleTokenSubProtocol = exports.isSubProtocol = exports.isBip32Protocol = exports.isOnlineProtocol = exports.isOfflineProtocol = exports.transactionStatusCheckerSchema = exports.configurableTransactionInjectorSchema = exports.signMessageOfflineSchema = exports.signMessageBaseSchema = exports.asymmetricEncryptionOfflineSchema = exports.asymmetricEncryptionBaseSchema = exports.aesEncryptionSchema = exports.configurableContractProtocolSchema = exports.multiAddressPublicKeyProtocolSchema = exports.fetchDataForMultipleAddressesProtocolSchema = exports.fetchDataForAddressProtocolSchema = exports.multiTokenSubProtocolOnlineSchema = exports.multiTokenSubProtocolBaseSchema = exports.singleTokenSubProtocolSchema = exports.subProtocolSchema = exports.bip32OnlineProtocolSchema = exports.bip32OfflineProtocolSchema = exports.bip32BaseProtocolSchema = exports.onlineProtocolSchema = exports.offlineProtocolSchema = exports.baseProtocolSchema = void 0;
|
|
14
|
+
exports.protocolNetworkIdentifier = exports.isTransactionStatusChecker = exports.hasConfigurableTransactionInjector = exports.canSignMessage = exports.canEncryptAsymmetric = exports.canEncryptAES = exports.hasConfigurableContract = exports.hasMultiAddressPublicKeys = exports.canFetchDataForMultipleAddresses = exports.canFetchDataForAddress = exports.isMultiTokenSubProtocol = exports.isSingleTokenSubProtocol = exports.isSubProtocol = exports.isBip32Protocol = exports.isOnlineProtocol = exports.isOfflineProtocol = exports.isAnyProtocol = exports.transactionStatusCheckerSchema = exports.configurableTransactionInjectorSchema = exports.signMessageOfflineSchema = exports.signMessageBaseSchema = exports.asymmetricEncryptionOfflineSchema = exports.asymmetricEncryptionBaseSchema = exports.aesEncryptionSchema = exports.configurableContractProtocolSchema = exports.multiAddressPublicKeyProtocolSchema = exports.fetchDataForMultipleAddressesProtocolSchema = exports.fetchDataForAddressProtocolSchema = exports.multiTokenSubProtocolOnlineSchema = exports.multiTokenSubProtocolBaseSchema = exports.singleTokenSubProtocolSchema = exports.subProtocolSchema = exports.bip32OnlineProtocolSchema = exports.bip32OfflineProtocolSchema = exports.bip32BaseProtocolSchema = exports.onlineProtocolSchema = exports.offlineProtocolSchema = exports.baseProtocolSchema = void 0;
|
|
15
15
|
// @ts-ignore
|
|
16
16
|
var createHash = require("@airgap/coinlib-core/dependencies/src/create-hash-1.2.0/index");
|
|
17
17
|
var interface_1 = require("./interface");
|
|
@@ -70,6 +70,10 @@ exports.transactionStatusCheckerSchema = {
|
|
|
70
70
|
getTransactionStatus: 'required'
|
|
71
71
|
};
|
|
72
72
|
// Implementation Checks
|
|
73
|
+
function isAnyProtocol(object) {
|
|
74
|
+
return isOfflineProtocol(object) || isOnlineProtocol(object);
|
|
75
|
+
}
|
|
76
|
+
exports.isAnyProtocol = isAnyProtocol;
|
|
73
77
|
function isOfflineProtocol(object) {
|
|
74
78
|
return (0, interface_1.implementsInterface)(object, exports.offlineProtocolSchema);
|
|
75
79
|
}
|
package/utils/protocol.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol.js","sourceRoot":"","sources":["../../src/utils/protocol.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,aAAa;AACb,0FAA4F;AAsC5F,yCAAyD;AAEzD,UAAU;AAEG,QAAA,kBAAkB,GAAyB;IACtD,uBAAuB,EAAE,UAAU;IACnC,yBAAyB,EAAE,UAAU;IACrC,WAAW,EAAE,UAAU;CACxB,CAAA;AAEY,QAAA,qBAAqB,yBAC7B,0BAAkB,KACrB,sBAAsB,EAAE,UAAU,EAClC,wBAAwB,EAAE,UAAU,EACpC,4BAA4B,EAAE,UAAU,IACzC;AAEY,QAAA,oBAAoB,yBAC5B,0BAAkB,KACrB,oBAAoB,EAAE,UAAU,EAChC,qBAAqB,EAAE,UAAU,EACjC,UAAU,EAAE,UAAU,EACtB,8BAA8B,EAAE,UAAU,EAC1C,oCAAoC,EAAE,UAAU,EAChD,2BAA2B,EAA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