@airgap/module-kit 0.13.14-beta.2 → 0.13.14
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 -5
- package/index.js +1 -23
- package/index.js.map +1 -1
- package/internal/{protocol/AirGapDelegateProtocol.d.ts → AirGapDelegateProtocol.d.ts} +2 -2
- package/internal/AirGapDelegateProtocol.js.map +1 -0
- package/internal/index.d.ts +1 -4
- package/internal/index.js +0 -4
- package/internal/index.js.map +1 -1
- package/module/module.d.ts +5 -8
- package/package.json +1 -1
- package/protocol/extensions/address/MultiAddressPublicKeyExtension.d.ts +0 -1
- package/protocol/protocol.d.ts +4 -4
- package/types/meta/utility-types.d.ts +0 -1
- package/types/protocol.d.ts +0 -1
- package/types/transaction.d.ts +2 -4
- package/utils/protocol.d.ts +13 -36
- package/utils/protocol.js +41 -46
- package/utils/protocol.js.map +1 -1
- package/internal/protocol/AirGapDelegateProtocol.js.map +0 -1
- package/internal/utils/protocol.d.ts +0 -5
- package/internal/utils/protocol.js +0 -24
- package/internal/utils/protocol.js.map +0 -1
- /package/internal/{protocol/AirGapDelegateProtocol.js → AirGapDelegateProtocol.js} +0 -0
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, TransactionConfiguration, TransactionCursor, TransactionDetails, TransactionType, UnsignedTransaction } 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,12 @@ 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 {
|
|
47
|
+
import { canEncryptAES, canEncryptAsymmetric, canFetchDataForAddress, canFetchDataForMultipleAddresses, canSignMessage, hasConfigurableContract, hasConfigurableTransactionInjector, hasMultiAddressPublicKeys, isBip32Protocol, isMultiTokenSubProtocol, isOfflineProtocol, isOnlineProtocol, isSingleTokenSubProtocol, isSubProtocol, isTransactionStatusChecker, protocolNetworkIdentifier } 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,
|
|
56
|
-
export { baseProtocolSchema, offlineProtocolSchema, onlineProtocolSchema, bip32BaseProtocolSchema, bip32OfflineProtocolSchema, bip32OnlineProtocolSchema, subProtocolSchema, singleTokenSubProtocolSchema, multiTokenSubProtocolBaseSchema, fetchDataForAddressProtocolSchema, fetchDataForMultipleAddressesProtocolSchema, multiAddressPublicKeyProtocolSchema, configurableContractProtocolSchema, aesEncryptionSchema, asymmetricEncryptionBaseSchema, asymmetricEncryptionOfflineSchema, signMessageBaseSchema, signMessageOfflineSchema, configurableTransactionInjectorSchema, transactionStatusCheckerSchema };
|
|
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, TransactionConfiguration, AirGapTransactionStatus, RecursivePartial };
|
|
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 };
|
package/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
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 = exports.fetchDataForMultipleAddressesProtocolSchema = void 0;
|
|
3
|
+
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.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;
|
|
5
4
|
var amount_1 = require("./factories/amount");
|
|
6
5
|
Object.defineProperty(exports, "newAmount", { enumerable: true, get: function () { return amount_1.newAmount; } });
|
|
7
6
|
var key_1 = require("./factories/key");
|
|
@@ -38,26 +37,14 @@ Object.defineProperty(exports, "createSupportedProtocols", { enumerable: true, g
|
|
|
38
37
|
var normalize_1 = require("./utils/normalize");
|
|
39
38
|
Object.defineProperty(exports, "normalizeToUndefined", { enumerable: true, get: function () { return normalize_1.normalizeToUndefined; } });
|
|
40
39
|
var protocol_1 = require("./utils/protocol");
|
|
41
|
-
Object.defineProperty(exports, "aesEncryptionSchema", { enumerable: true, get: function () { return protocol_1.aesEncryptionSchema; } });
|
|
42
|
-
Object.defineProperty(exports, "asymmetricEncryptionBaseSchema", { enumerable: true, get: function () { return protocol_1.asymmetricEncryptionBaseSchema; } });
|
|
43
|
-
Object.defineProperty(exports, "asymmetricEncryptionOfflineSchema", { enumerable: true, get: function () { return protocol_1.asymmetricEncryptionOfflineSchema; } });
|
|
44
|
-
Object.defineProperty(exports, "baseProtocolSchema", { enumerable: true, get: function () { return protocol_1.baseProtocolSchema; } });
|
|
45
|
-
Object.defineProperty(exports, "bip32BaseProtocolSchema", { enumerable: true, get: function () { return protocol_1.bip32BaseProtocolSchema; } });
|
|
46
|
-
Object.defineProperty(exports, "bip32OfflineProtocolSchema", { enumerable: true, get: function () { return protocol_1.bip32OfflineProtocolSchema; } });
|
|
47
|
-
Object.defineProperty(exports, "bip32OnlineProtocolSchema", { enumerable: true, get: function () { return protocol_1.bip32OnlineProtocolSchema; } });
|
|
48
40
|
Object.defineProperty(exports, "canEncryptAES", { enumerable: true, get: function () { return protocol_1.canEncryptAES; } });
|
|
49
41
|
Object.defineProperty(exports, "canEncryptAsymmetric", { enumerable: true, get: function () { return protocol_1.canEncryptAsymmetric; } });
|
|
50
42
|
Object.defineProperty(exports, "canFetchDataForAddress", { enumerable: true, get: function () { return protocol_1.canFetchDataForAddress; } });
|
|
51
43
|
Object.defineProperty(exports, "canFetchDataForMultipleAddresses", { enumerable: true, get: function () { return protocol_1.canFetchDataForMultipleAddresses; } });
|
|
52
44
|
Object.defineProperty(exports, "canSignMessage", { enumerable: true, get: function () { return protocol_1.canSignMessage; } });
|
|
53
|
-
Object.defineProperty(exports, "configurableContractProtocolSchema", { enumerable: true, get: function () { return protocol_1.configurableContractProtocolSchema; } });
|
|
54
|
-
Object.defineProperty(exports, "configurableTransactionInjectorSchema", { enumerable: true, get: function () { return protocol_1.configurableTransactionInjectorSchema; } });
|
|
55
|
-
Object.defineProperty(exports, "fetchDataForAddressProtocolSchema", { enumerable: true, get: function () { return protocol_1.fetchDataForAddressProtocolSchema; } });
|
|
56
|
-
Object.defineProperty(exports, "fetchDataForMultipleAddressesProtocolSchema", { enumerable: true, get: function () { return protocol_1.fetchDataForMultipleAddressesProtocolSchema; } });
|
|
57
45
|
Object.defineProperty(exports, "hasConfigurableContract", { enumerable: true, get: function () { return protocol_1.hasConfigurableContract; } });
|
|
58
46
|
Object.defineProperty(exports, "hasConfigurableTransactionInjector", { enumerable: true, get: function () { return protocol_1.hasConfigurableTransactionInjector; } });
|
|
59
47
|
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; } });
|
|
61
48
|
Object.defineProperty(exports, "isBip32Protocol", { enumerable: true, get: function () { return protocol_1.isBip32Protocol; } });
|
|
62
49
|
Object.defineProperty(exports, "isMultiTokenSubProtocol", { enumerable: true, get: function () { return protocol_1.isMultiTokenSubProtocol; } });
|
|
63
50
|
Object.defineProperty(exports, "isOfflineProtocol", { enumerable: true, get: function () { return protocol_1.isOfflineProtocol; } });
|
|
@@ -65,14 +52,5 @@ Object.defineProperty(exports, "isOnlineProtocol", { enumerable: true, get: func
|
|
|
65
52
|
Object.defineProperty(exports, "isSingleTokenSubProtocol", { enumerable: true, get: function () { return protocol_1.isSingleTokenSubProtocol; } });
|
|
66
53
|
Object.defineProperty(exports, "isSubProtocol", { enumerable: true, get: function () { return protocol_1.isSubProtocol; } });
|
|
67
54
|
Object.defineProperty(exports, "isTransactionStatusChecker", { enumerable: true, get: function () { return protocol_1.isTransactionStatusChecker; } });
|
|
68
|
-
Object.defineProperty(exports, "multiAddressPublicKeyProtocolSchema", { enumerable: true, get: function () { return protocol_1.multiAddressPublicKeyProtocolSchema; } });
|
|
69
|
-
Object.defineProperty(exports, "multiTokenSubProtocolBaseSchema", { enumerable: true, get: function () { return protocol_1.multiTokenSubProtocolBaseSchema; } });
|
|
70
|
-
Object.defineProperty(exports, "offlineProtocolSchema", { enumerable: true, get: function () { return protocol_1.offlineProtocolSchema; } });
|
|
71
|
-
Object.defineProperty(exports, "onlineProtocolSchema", { enumerable: true, get: function () { return protocol_1.onlineProtocolSchema; } });
|
|
72
55
|
Object.defineProperty(exports, "protocolNetworkIdentifier", { enumerable: true, get: function () { return protocol_1.protocolNetworkIdentifier; } });
|
|
73
|
-
Object.defineProperty(exports, "signMessageBaseSchema", { enumerable: true, get: function () { return protocol_1.signMessageBaseSchema; } });
|
|
74
|
-
Object.defineProperty(exports, "signMessageOfflineSchema", { enumerable: true, get: function () { return protocol_1.signMessageOfflineSchema; } });
|
|
75
|
-
Object.defineProperty(exports, "singleTokenSubProtocolSchema", { enumerable: true, get: function () { return protocol_1.singleTokenSubProtocolSchema; } });
|
|
76
|
-
Object.defineProperty(exports, "subProtocolSchema", { enumerable: true, get: function () { return protocol_1.subProtocolSchema; } });
|
|
77
|
-
Object.defineProperty(exports, "transactionStatusCheckerSchema", { enumerable: true, get: function () { return protocol_1.transactionStatusCheckerSchema; } });
|
|
78
56
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AACA,6CAA8C;AAgH5C,0FAhHO,kBAAS,OAgHP;AA/GX,uCAAwG;AAmHtG,qGAnHO,0BAAoB,OAmHP;AAFpB,qGAjH6B,0BAAoB,OAiH7B;AACpB,6FAlHmD,kBAAY,OAkHnD;AAFZ,6FAhHiE,kBAAY,OAgHjE;AA/Gd,mDAAoD;AAmHlD,6FAnHO,wBAAY,OAmHP;AAlHd,uDAAsF;AAoHpF,qGApHO,kCAAoB,OAoHP;AADpB,uGAnH6B,oCAAsB,OAmH7B;AAlHxB,8CAA4G;AA0G1G,gGA1GO,uBAAe,OA0GP;AAFf,+FAxGwB,sBAAc,OAwGxB;AADd,kGAvGwC,yBAAiB,OAuGxC;AAEjB,kGAzG2D,yBAAiB,OAyG3D;AAxGnB,4CAAoD;AA0GlD,+FA1GO,qBAAc,OA0GP;AAxGhB,4EAAwE;AAuHtE,sGAvHO,+CAAqB,OAuHP;AAlDvB,yCAAyC;AAsJvC,yFAtJO,iBAAQ,OAsJP;AArJV,+CAA+D;AAuJ7D,oGAvJO,+BAAmB,OAuJP;AAtJrB,mCAA0G;AAuJxG,yFAvJO,cAAQ,OAuJP;AAIR,oGA3JiB,yBAAmB,OA2JjB;AAFnB,oGAzJsC,yBAAmB,OAyJtC;AACnB,4FA1J2D,iBAAW,OA0J3D;AAFX,4FAxJwE,iBAAW,OAwJxE;AAvJb,yCAAyD;AA2JvD,yGA3JO,iCAAwB,OA2JP;AA1J1B,+CAAwD;AA2KtD,qGA3KO,gCAAoB,OA2KP;AA1KtB,6CAiByB;AAmJvB,8FAnKA,wBAAa,OAmKA;AACb,qGAnKA,+BAAoB,OAmKA;AALpB,uGA7JA,iCAAsB,OA6JA;AACtB,iHA7JA,2CAAgC,OA6JA;AAKhC,+FAjKA,yBAAc,OAiKA;AAHd,wGA7JA,kCAAuB,OA6JA;AAIvB,mHAhKA,6CAAkC,OAgKA;AALlC,0GA1JA,oCAAyB,OA0JA;AANzB,gGAnJA,0BAAe,OAmJA;AAGf,wGArJA,kCAAuB,OAqJA;AALvB,kGA/IA,4BAAiB,OA+IA;AACjB,iGA/IA,2BAAgB,OA+IA;AAGhB,yGAjJA,mCAAwB,OAiJA;AADxB,8FA/IA,wBAAa,OA+IA;AAWb,2GAzJA,qCAA0B,OAyJA;AAC1B,0GAzJA,oCAAyB,OAyJA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DelegateeDetails, DelegationDetails, DelegatorDetails } from '@airgap/coinlib-core';
|
|
2
|
-
import { Address } from '
|
|
3
|
-
import { PublicKey } from '
|
|
2
|
+
import { Address } from '../types/address';
|
|
3
|
+
import { PublicKey } from '../types/key';
|
|
4
4
|
/**
|
|
5
5
|
* DO NOT USE!
|
|
6
6
|
* This is an internal type and will be removed in future releases.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AirGapDelegateProtocol.js","sourceRoot":"","sources":["../../src/internal/AirGapDelegateProtocol.ts"],"names":[],"mappings":""}
|
package/internal/index.d.ts
CHANGED
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
import { AirGapDelegateProtocol } from './
|
|
2
|
-
import { delegateProtocolSchema, supportsDelegation } from './utils/protocol';
|
|
1
|
+
import { AirGapDelegateProtocol } from './AirGapDelegateProtocol';
|
|
3
2
|
export { AirGapDelegateProtocol };
|
|
4
|
-
export { supportsDelegation };
|
|
5
|
-
export { delegateProtocolSchema };
|
package/internal/index.js
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
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
3
|
//# sourceMappingURL=index.js.map
|
package/internal/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/internal/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/internal/index.ts"],"names":[],"mappings":""}
|
package/module/module.d.ts
CHANGED
|
@@ -4,20 +4,17 @@ import { AirGapV3SerializerCompanion } from '../serializer/serializer';
|
|
|
4
4
|
import { AirGapInterface } from '../types/airgap';
|
|
5
5
|
import { Complement } from '../types/meta/utility-types';
|
|
6
6
|
import { ProtocolConfiguration } from '../types/module';
|
|
7
|
-
|
|
8
|
-
interface ModuleGeneric<_Protocols extends string = string, _ProtocolNetwork extends ProtocolNetwork = ProtocolNetwork> {
|
|
7
|
+
interface ModuleGeneric<_Protocols extends string = string> {
|
|
9
8
|
Protocols: _Protocols;
|
|
10
|
-
ProtocolNetwork: _ProtocolNetwork;
|
|
11
9
|
}
|
|
12
10
|
declare type TypedProtocols<G extends Partial<ModuleGeneric>> = Complement<ModuleGeneric, G>['Protocols'];
|
|
13
|
-
|
|
14
|
-
interface _Module<_Protocols extends ModuleGeneric['Protocols'] = any, _ProtocolNetwork extends ModuleGeneric['ProtocolNetwork'] = any> {
|
|
11
|
+
interface _Module<_Protocols extends ModuleGeneric['Protocols'] = any> {
|
|
15
12
|
supportedProtocols: Record<_Protocols, ProtocolConfiguration>;
|
|
16
13
|
createOfflineProtocol(identifier: _Protocols): Promise<AirGapOfflineProtocol | undefined>;
|
|
17
|
-
createOnlineProtocol(identifier: _Protocols,
|
|
18
|
-
createBlockExplorer(identifier: _Protocols,
|
|
14
|
+
createOnlineProtocol(identifier: _Protocols, networkId?: string): Promise<AirGapOnlineProtocol | undefined>;
|
|
15
|
+
createBlockExplorer(identifier: _Protocols, networkId?: string): Promise<AirGapBlockExplorer | undefined>;
|
|
19
16
|
createV3SerializerCompanion(): Promise<AirGapV3SerializerCompanion>;
|
|
20
17
|
}
|
|
21
|
-
export declare type Module<G extends Partial<ModuleGeneric> = {}> = _Module<TypedProtocols<G
|
|
18
|
+
export declare type Module<G extends Partial<ModuleGeneric> = {}> = _Module<TypedProtocols<G>>;
|
|
22
19
|
export declare type AirGapModule<G extends Partial<ModuleGeneric> = {}> = AirGapInterface<Module<G>>;
|
|
23
20
|
export {};
|
package/package.json
CHANGED
|
@@ -3,6 +3,5 @@ import { ExtendedPublicKey, PublicKey } from '../../../types/key';
|
|
|
3
3
|
import { _AnyProtocol, _BaseProtocol, BaseGeneric } from '../../protocol';
|
|
4
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
5
|
export interface MultiAddressPublicKeyProtocol<_AddressCursor extends BaseGeneric['AddressCursor'] = BaseGeneric['AddressCursor'], _PublicKey extends PublicKey | ExtendedPublicKey = PublicKey> {
|
|
6
|
-
getInitialAddressesFromPublicKey(publicKey: _PublicKey): Promise<AddressWithCursor<_AddressCursor>[]>;
|
|
7
6
|
getNextAddressFromPublicKey(publicKey: _PublicKey, cursor: _AddressCursor): Promise<AddressWithCursor<_AddressCursor> | undefined>;
|
|
8
7
|
}
|
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, TransactionConfiguration, TransactionCursor, TransactionDetails, UnsignedTransaction } 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>[]
|
|
55
|
-
prepareTransactionWithPublicKey(publicKey: _PublicKey, details: TransactionDetails<_Units>[], configuration?:
|
|
53
|
+
getTransactionMaxAmountWithPublicKey(publicKey: _PublicKey, to: Address[], configuration?: TransactionConfiguration<_FeeUnits>): Promise<Amount<_Units>>;
|
|
54
|
+
getTransactionFeeWithPublicKey(publicKey: _PublicKey, details: TransactionDetails<_Units>[]): Promise<_FeeEstimation>;
|
|
55
|
+
prepareTransactionWithPublicKey(publicKey: _PublicKey, details: TransactionDetails<_Units>[], configuration?: TransactionConfiguration<_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,4 +5,3 @@ 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/protocol.d.ts
CHANGED
package/types/transaction.d.ts
CHANGED
|
@@ -41,14 +41,12 @@ export interface TransactionDetails<_Units extends string = string> {
|
|
|
41
41
|
amount: Amount<_Units>;
|
|
42
42
|
arbitraryData?: string;
|
|
43
43
|
}
|
|
44
|
-
export interface
|
|
44
|
+
export interface TransactionConfiguration<_FeeUnits extends string = string> {
|
|
45
|
+
fee?: Amount<_FeeUnits>;
|
|
45
46
|
arbitraryData?: string;
|
|
46
47
|
keepMinBalance?: boolean;
|
|
47
48
|
assetId?: number;
|
|
48
49
|
}
|
|
49
|
-
export interface TransactionFullConfiguration<_FeeUnits extends string = string> extends TransactionSimpleConfiguration {
|
|
50
|
-
fee?: Amount<_FeeUnits>;
|
|
51
|
-
}
|
|
52
50
|
interface BaseTransactionStatus<_Type extends string> extends Sealed<_Type> {
|
|
53
51
|
hash?: string;
|
|
54
52
|
block?: string;
|
package/utils/protocol.d.ts
CHANGED
|
@@ -1,43 +1,20 @@
|
|
|
1
|
-
import { FetchDataForAddressExtension
|
|
2
|
-
import { FetchDataForMultipleAddressesExtension
|
|
3
|
-
import { MultiAddressPublicKeyExtension
|
|
4
|
-
import {
|
|
1
|
+
import { FetchDataForAddressExtension } from '../protocol/extensions/address/FetchDataForAddressExtension';
|
|
2
|
+
import { FetchDataForMultipleAddressesExtension } from '../protocol/extensions/address/FetchDataForMultipleAddressesExtension';
|
|
3
|
+
import { MultiAddressPublicKeyExtension } from '../protocol/extensions/address/MultiAddressPublicKeyExtension';
|
|
4
|
+
import { Bip32Extension } from '../protocol/extensions/bip/Bip32Extension';
|
|
5
5
|
import { ConfigurableContractProtocol } from '../protocol/extensions/contract/ConfigurableContractExtension';
|
|
6
|
-
import {
|
|
7
|
-
import { AsymmetricEncryptionExtension
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
6
|
+
import { AESExtension } from '../protocol/extensions/crypto/AESExtension';
|
|
7
|
+
import { AsymmetricEncryptionExtension } from '../protocol/extensions/crypto/AsymmetricEncryptionExtension';
|
|
8
|
+
import { SignMessageExtension } from '../protocol/extensions/crypto/SignMessageExtension';
|
|
9
|
+
import { MultiTokenSubProtocolExtension } from '../protocol/extensions/sub-protocol/MultiTokenSubProtocolExtension';
|
|
10
|
+
import { SingleTokenSubProtocolExtension } from '../protocol/extensions/sub-protocol/SingleTokenSubProtocolExtension';
|
|
11
11
|
import { SubProtocol } from '../protocol/extensions/sub-protocol/SubProtocolExtension';
|
|
12
12
|
import { ConfigurableTransactionInjectorProtocol } from '../protocol/extensions/transaction/ConfigurableTransactionInjectorExtension';
|
|
13
|
-
import {
|
|
14
|
-
import { AnyProtocol,
|
|
13
|
+
import { TransactionStatusCheckerExtension } from '../protocol/extensions/transaction/TransactionStatusCheckerExtension';
|
|
14
|
+
import { AnyProtocol, OfflineProtocol, OnlineProtocol } from '../protocol/protocol';
|
|
15
15
|
import { ProtocolNetwork } from '../types/protocol';
|
|
16
|
-
|
|
17
|
-
export declare
|
|
18
|
-
export declare const offlineProtocolSchema: Schema<OfflineProtocol>;
|
|
19
|
-
export declare const onlineProtocolSchema: Schema<OnlineProtocol>;
|
|
20
|
-
export declare const bip32BaseProtocolSchema: Schema<BaseBip32Protocol>;
|
|
21
|
-
export declare const bip32OfflineProtocolSchema: Schema<OfflineBip32Protocol>;
|
|
22
|
-
export declare const bip32OnlineProtocolSchema: Schema<OnlineBip32Protocol>;
|
|
23
|
-
export declare const subProtocolSchema: Schema<SubProtocol>;
|
|
24
|
-
export declare const singleTokenSubProtocolSchema: Schema<SingleTokenSubProtocol>;
|
|
25
|
-
export declare const multiTokenSubProtocolBaseSchema: Schema<BaseMultiTokenSubProtocol>;
|
|
26
|
-
export declare const multiTokenSubProtocolOnlineSchema: Schema<OnlineMultiTokenSubProtocol>;
|
|
27
|
-
export declare const fetchDataForAddressProtocolSchema: Schema<FetchDataForAddressProtocol>;
|
|
28
|
-
export declare const fetchDataForMultipleAddressesProtocolSchema: Schema<FetchDataForMultipleAddressesProtocol>;
|
|
29
|
-
export declare const multiAddressPublicKeyProtocolSchema: Schema<MultiAddressPublicKeyProtocol>;
|
|
30
|
-
export declare const configurableContractProtocolSchema: Schema<ConfigurableContractProtocol>;
|
|
31
|
-
export declare const aesEncryptionSchema: Schema<AES>;
|
|
32
|
-
export declare const asymmetricEncryptionBaseSchema: Schema<BaseAsymmetricEncryption>;
|
|
33
|
-
export declare const asymmetricEncryptionOfflineSchema: Schema<OfflineAsymmetricEncryption>;
|
|
34
|
-
export declare const signMessageBaseSchema: Schema<BaseSignMessage>;
|
|
35
|
-
export declare const signMessageOfflineSchema: Schema<OfflineSignMessage>;
|
|
36
|
-
export declare const configurableTransactionInjectorSchema: Schema<ConfigurableTransactionInjectorProtocol>;
|
|
37
|
-
export declare const transactionStatusCheckerSchema: Schema<TransactionStatusChecker>;
|
|
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;
|
|
16
|
+
export declare function isOfflineProtocol(object: AnyProtocol): object is OfflineProtocol;
|
|
17
|
+
export declare function isOnlineProtocol(object: AnyProtocol): object is OnlineProtocol;
|
|
41
18
|
export declare function isBip32Protocol<T extends AnyProtocol>(protocol: T): protocol is T & Bip32Extension<T>;
|
|
42
19
|
export declare function isSubProtocol<T extends AnyProtocol>(protocol: T): protocol is T & SubProtocol;
|
|
43
20
|
export declare function isSingleTokenSubProtocol<T extends AnyProtocol>(protocol: T): protocol is T & SingleTokenSubProtocolExtension<T>;
|
package/utils/protocol.js
CHANGED
|
@@ -11,82 +11,77 @@ 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 =
|
|
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 = 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");
|
|
18
18
|
// Schemas
|
|
19
|
-
|
|
19
|
+
var baseProtocolSchema = {
|
|
20
20
|
getAddressFromPublicKey: 'required',
|
|
21
21
|
getDetailsFromTransaction: 'required',
|
|
22
22
|
getMetadata: 'required'
|
|
23
23
|
};
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
var offlineProtocolSchema = __assign(__assign({}, baseProtocolSchema), { getCryptoConfiguration: 'required', getKeyPairFromDerivative: 'required', signTransactionWithSecretKey: 'required' });
|
|
25
|
+
var onlineProtocolSchema = __assign(__assign({}, baseProtocolSchema), { broadcastTransaction: 'required', getBalanceOfPublicKey: 'required', getNetwork: 'required', getTransactionFeeWithPublicKey: 'required', getTransactionMaxAmountWithPublicKey: 'required', getTransactionsForPublicKey: 'required', prepareTransactionWithPublicKey: 'required' });
|
|
26
|
+
var bip32BaseProtocolSchema = __assign(__assign({}, baseProtocolSchema), { deriveFromExtendedPublicKey: 'required' });
|
|
27
|
+
var bip32OfflineProtocolSchema = __assign(__assign(__assign({}, bip32BaseProtocolSchema), offlineProtocolSchema), { getExtendedKeyPairFromDerivative: 'required', deriveFromExtendedSecretKey: 'required' });
|
|
28
|
+
var bip32OnlineProtocolSchema = __assign(__assign({}, bip32BaseProtocolSchema), onlineProtocolSchema);
|
|
29
|
+
var subProtocolSchema = {
|
|
30
30
|
getType: 'required',
|
|
31
31
|
mainProtocol: 'required'
|
|
32
32
|
};
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
var singleTokenSubProtocolSchema = __assign(__assign({}, subProtocolSchema), { getContractAddress: 'required' });
|
|
34
|
+
var multiTokenSubProtocolBaseSchema = singleTokenSubProtocolSchema;
|
|
35
|
+
var multiTokenSubProtocolOnlineSchema = __assign(__assign({}, multiTokenSubProtocolBaseSchema), onlineProtocolSchema);
|
|
36
|
+
var fetchDataForAddressProtocolSchema = {
|
|
37
37
|
getBalanceOfAddress: 'required',
|
|
38
38
|
getTransactionsForAddress: 'required'
|
|
39
39
|
};
|
|
40
|
-
|
|
40
|
+
var fetchDataForMultipleAddressesProtocolSchema = {
|
|
41
41
|
getBalanceOfAddresses: 'required',
|
|
42
42
|
getTransactionsForAddresses: 'required'
|
|
43
43
|
};
|
|
44
|
-
|
|
45
|
-
getInitialAddressesFromPublicKey: 'required',
|
|
44
|
+
var multiAddressPublicKeyProtocolSchema = {
|
|
46
45
|
getNextAddressFromPublicKey: 'required'
|
|
47
46
|
};
|
|
48
|
-
|
|
47
|
+
var configurableContractProtocolSchema = {
|
|
49
48
|
isContractValid: 'required',
|
|
50
49
|
getContractAddress: 'required',
|
|
51
50
|
setContractAddress: 'required'
|
|
52
51
|
};
|
|
53
|
-
|
|
52
|
+
var aesEncryptionSchema = {
|
|
54
53
|
decryptAESWithSecretKey: 'required',
|
|
55
54
|
encryptAESWithSecretKey: 'required'
|
|
56
55
|
};
|
|
57
|
-
|
|
56
|
+
var asymmetricEncryptionBaseSchema = {
|
|
58
57
|
encryptAsymmetricWithPublicKey: 'required'
|
|
59
58
|
};
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
var asymmetricEncryptionOfflineSchema = __assign(__assign({}, asymmetricEncryptionBaseSchema), { decryptAsymmetricWithKeyPair: 'required' });
|
|
60
|
+
var signMessageBaseSchema = {
|
|
62
61
|
verifyMessageWithPublicKey: 'required'
|
|
63
62
|
};
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
var signMessageOfflineSchema = __assign(__assign({}, signMessageBaseSchema), { signMessageWithKeyPair: 'required' });
|
|
64
|
+
var configurableTransactionInjectorSchema = {
|
|
66
65
|
getInjectorUrl: 'required',
|
|
67
66
|
setInjectorUrl: 'required'
|
|
68
67
|
};
|
|
69
|
-
|
|
68
|
+
var transactionStatusCheckerSchema = {
|
|
70
69
|
getTransactionStatus: 'required'
|
|
71
70
|
};
|
|
72
71
|
// Implementation Checks
|
|
73
|
-
function isAnyProtocol(object) {
|
|
74
|
-
return isOfflineProtocol(object) || isOnlineProtocol(object);
|
|
75
|
-
}
|
|
76
|
-
exports.isAnyProtocol = isAnyProtocol;
|
|
77
72
|
function isOfflineProtocol(object) {
|
|
78
|
-
return (0, interface_1.implementsInterface)(object,
|
|
73
|
+
return (0, interface_1.implementsInterface)(object, offlineProtocolSchema);
|
|
79
74
|
}
|
|
80
75
|
exports.isOfflineProtocol = isOfflineProtocol;
|
|
81
76
|
function isOnlineProtocol(object) {
|
|
82
|
-
return (0, interface_1.implementsInterface)(object,
|
|
77
|
+
return (0, interface_1.implementsInterface)(object, onlineProtocolSchema);
|
|
83
78
|
}
|
|
84
79
|
exports.isOnlineProtocol = isOnlineProtocol;
|
|
85
80
|
function isOfflineBip32Protocol(protocol) {
|
|
86
|
-
return (0, interface_1.implementsInterface)(protocol,
|
|
81
|
+
return (0, interface_1.implementsInterface)(protocol, bip32OfflineProtocolSchema);
|
|
87
82
|
}
|
|
88
83
|
function isOnlineBip32Protocol(protocol) {
|
|
89
|
-
return (0, interface_1.implementsInterface)(protocol,
|
|
84
|
+
return (0, interface_1.implementsInterface)(protocol, bip32OnlineProtocolSchema);
|
|
90
85
|
}
|
|
91
86
|
function isBip32Protocol(protocol) {
|
|
92
87
|
var extendedWithBip32 = false;
|
|
@@ -100,63 +95,63 @@ function isBip32Protocol(protocol) {
|
|
|
100
95
|
}
|
|
101
96
|
exports.isBip32Protocol = isBip32Protocol;
|
|
102
97
|
function isSubProtocol(protocol) {
|
|
103
|
-
return (0, interface_1.implementsInterface)(protocol,
|
|
98
|
+
return (0, interface_1.implementsInterface)(protocol, subProtocolSchema);
|
|
104
99
|
}
|
|
105
100
|
exports.isSubProtocol = isSubProtocol;
|
|
106
101
|
function isSingleTokenSubProtocol(protocol) {
|
|
107
|
-
return (0, interface_1.implementsInterface)(protocol,
|
|
102
|
+
return (0, interface_1.implementsInterface)(protocol, singleTokenSubProtocolSchema);
|
|
108
103
|
}
|
|
109
104
|
exports.isSingleTokenSubProtocol = isSingleTokenSubProtocol;
|
|
110
105
|
function isMultiTokenSubProtocol(protocol) {
|
|
111
|
-
var extendedWithMultiTokenSubProtocol = (0, interface_1.implementsInterface)(protocol,
|
|
106
|
+
var extendedWithMultiTokenSubProtocol = (0, interface_1.implementsInterface)(protocol, multiTokenSubProtocolBaseSchema);
|
|
112
107
|
if (isOnlineProtocol(protocol)) {
|
|
113
|
-
extendedWithMultiTokenSubProtocol && (extendedWithMultiTokenSubProtocol = (0, interface_1.implementsInterface)(protocol,
|
|
108
|
+
extendedWithMultiTokenSubProtocol && (extendedWithMultiTokenSubProtocol = (0, interface_1.implementsInterface)(protocol, multiTokenSubProtocolOnlineSchema));
|
|
114
109
|
}
|
|
115
110
|
return extendedWithMultiTokenSubProtocol;
|
|
116
111
|
}
|
|
117
112
|
exports.isMultiTokenSubProtocol = isMultiTokenSubProtocol;
|
|
118
113
|
function canFetchDataForAddress(protocol) {
|
|
119
|
-
return (0, interface_1.implementsInterface)(protocol,
|
|
114
|
+
return (0, interface_1.implementsInterface)(protocol, fetchDataForAddressProtocolSchema);
|
|
120
115
|
}
|
|
121
116
|
exports.canFetchDataForAddress = canFetchDataForAddress;
|
|
122
117
|
function canFetchDataForMultipleAddresses(protocol) {
|
|
123
|
-
return (0, interface_1.implementsInterface)(protocol,
|
|
118
|
+
return (0, interface_1.implementsInterface)(protocol, fetchDataForMultipleAddressesProtocolSchema);
|
|
124
119
|
}
|
|
125
120
|
exports.canFetchDataForMultipleAddresses = canFetchDataForMultipleAddresses;
|
|
126
121
|
function hasMultiAddressPublicKeys(protocol) {
|
|
127
|
-
return (0, interface_1.implementsInterface)(protocol,
|
|
122
|
+
return (0, interface_1.implementsInterface)(protocol, multiAddressPublicKeyProtocolSchema);
|
|
128
123
|
}
|
|
129
124
|
exports.hasMultiAddressPublicKeys = hasMultiAddressPublicKeys;
|
|
130
125
|
function hasConfigurableContract(protocol) {
|
|
131
|
-
return (0, interface_1.implementsInterface)(protocol,
|
|
126
|
+
return (0, interface_1.implementsInterface)(protocol, configurableContractProtocolSchema);
|
|
132
127
|
}
|
|
133
128
|
exports.hasConfigurableContract = hasConfigurableContract;
|
|
134
129
|
function canEncryptAES(protocol) {
|
|
135
|
-
return (0, interface_1.implementsInterface)(protocol,
|
|
130
|
+
return (0, interface_1.implementsInterface)(protocol, aesEncryptionSchema);
|
|
136
131
|
}
|
|
137
132
|
exports.canEncryptAES = canEncryptAES;
|
|
138
133
|
function canEncryptAsymmetric(protocol) {
|
|
139
|
-
var extendedWithAsymmetricEncryption = (0, interface_1.implementsInterface)(protocol,
|
|
134
|
+
var extendedWithAsymmetricEncryption = (0, interface_1.implementsInterface)(protocol, asymmetricEncryptionBaseSchema);
|
|
140
135
|
if (isOfflineProtocol(protocol)) {
|
|
141
|
-
extendedWithAsymmetricEncryption && (extendedWithAsymmetricEncryption = (0, interface_1.implementsInterface)(protocol,
|
|
136
|
+
extendedWithAsymmetricEncryption && (extendedWithAsymmetricEncryption = (0, interface_1.implementsInterface)(protocol, asymmetricEncryptionOfflineSchema));
|
|
142
137
|
}
|
|
143
138
|
return extendedWithAsymmetricEncryption;
|
|
144
139
|
}
|
|
145
140
|
exports.canEncryptAsymmetric = canEncryptAsymmetric;
|
|
146
141
|
function canSignMessage(protocol) {
|
|
147
|
-
var extendedWithSignMessage = (0, interface_1.implementsInterface)(protocol,
|
|
142
|
+
var extendedWithSignMessage = (0, interface_1.implementsInterface)(protocol, signMessageBaseSchema);
|
|
148
143
|
if (isOfflineProtocol(protocol)) {
|
|
149
|
-
extendedWithSignMessage && (extendedWithSignMessage = (0, interface_1.implementsInterface)(protocol,
|
|
144
|
+
extendedWithSignMessage && (extendedWithSignMessage = (0, interface_1.implementsInterface)(protocol, signMessageOfflineSchema));
|
|
150
145
|
}
|
|
151
146
|
return extendedWithSignMessage;
|
|
152
147
|
}
|
|
153
148
|
exports.canSignMessage = canSignMessage;
|
|
154
149
|
function hasConfigurableTransactionInjector(protocol) {
|
|
155
|
-
return (0, interface_1.implementsInterface)(protocol,
|
|
150
|
+
return (0, interface_1.implementsInterface)(protocol, configurableTransactionInjectorSchema);
|
|
156
151
|
}
|
|
157
152
|
exports.hasConfigurableTransactionInjector = hasConfigurableTransactionInjector;
|
|
158
153
|
function isTransactionStatusChecker(protocol) {
|
|
159
|
-
return (0, interface_1.implementsInterface)(protocol,
|
|
154
|
+
return (0, interface_1.implementsInterface)(protocol, transactionStatusCheckerSchema);
|
|
160
155
|
}
|
|
161
156
|
exports.isTransactionStatusChecker = isTransactionStatusChecker;
|
|
162
157
|
// Identifier
|
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;
|
|
1
|
+
{"version":3,"file":"protocol.js","sourceRoot":"","sources":["../../src/utils/protocol.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,aAAa;AACb,0FAA4F;AAsC5F,yCAAyD;AAEzD,UAAU;AAEV,IAAM,kBAAkB,GAAyB;IAC/C,uBAAuB,EAAE,UAAU;IACnC,yBAAyB,EAAE,UAAU;IACrC,WAAW,EAAE,UAAU;CACxB,CAAA;AAED,IAAM,qBAAqB,yBACtB,kBAAkB,KACrB,sBAAsB,EAAE,UAAU,EAClC,wBAAwB,EAAE,UAAU,EACpC,4BAA4B,EAAE,UAAU,GACzC,CAAA;AAED,IAAM,oBAAoB,yBACrB,kBAAkB,KACrB,oBAAoB,EAAE,UAAU,EAChC,qBAAqB,EAAE,UAAU,EACjC,UAAU,EAAE,UAAU,EAC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,8DAIC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AirGapDelegateProtocol.js","sourceRoot":"","sources":["../../../src/internal/protocol/AirGapDelegateProtocol.ts"],"names":[],"mappings":""}
|
|
@@ -1,5 +0,0 @@
|
|
|
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;
|
|
@@ -1,24 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
File without changes
|