@airgap/module-kit 0.13.13-beta.4 → 0.13.13
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 +1 -2
- package/index.js +1 -22
- 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 +3 -3
- package/protocol/extensions/address/MultiAddressPublicKeyExtension.d.ts +0 -1
- package/types/protocol.d.ts +0 -1
- package/utils/protocol.d.ts +11 -33
- package/utils/protocol.js +41 -42
- 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
|
@@ -44,7 +44,7 @@ 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 };
|
|
@@ -53,4 +53,3 @@ export { AirGapV3SerializerCompanion, V3SchemaConfiguration };
|
|
|
53
53
|
export { AirGapInterface };
|
|
54
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
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 };
|
|
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,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 = 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,22 +37,11 @@ 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; } });
|
|
@@ -64,14 +52,5 @@ Object.defineProperty(exports, "isOnlineProtocol", { enumerable: true, get: func
|
|
|
64
52
|
Object.defineProperty(exports, "isSingleTokenSubProtocol", { enumerable: true, get: function () { return protocol_1.isSingleTokenSubProtocol; } });
|
|
65
53
|
Object.defineProperty(exports, "isSubProtocol", { enumerable: true, get: function () { return protocol_1.isSubProtocol; } });
|
|
66
54
|
Object.defineProperty(exports, "isTransactionStatusChecker", { enumerable: true, get: function () { return protocol_1.isTransactionStatusChecker; } });
|
|
67
|
-
Object.defineProperty(exports, "multiAddressPublicKeyProtocolSchema", { enumerable: true, get: function () { return protocol_1.multiAddressPublicKeyProtocolSchema; } });
|
|
68
|
-
Object.defineProperty(exports, "multiTokenSubProtocolBaseSchema", { enumerable: true, get: function () { return protocol_1.multiTokenSubProtocolBaseSchema; } });
|
|
69
|
-
Object.defineProperty(exports, "offlineProtocolSchema", { enumerable: true, get: function () { return protocol_1.offlineProtocolSchema; } });
|
|
70
|
-
Object.defineProperty(exports, "onlineProtocolSchema", { enumerable: true, get: function () { return protocol_1.onlineProtocolSchema; } });
|
|
71
55
|
Object.defineProperty(exports, "protocolNetworkIdentifier", { enumerable: true, get: function () { return protocol_1.protocolNetworkIdentifier; } });
|
|
72
|
-
Object.defineProperty(exports, "signMessageBaseSchema", { enumerable: true, get: function () { return protocol_1.signMessageBaseSchema; } });
|
|
73
|
-
Object.defineProperty(exports, "signMessageOfflineSchema", { enumerable: true, get: function () { return protocol_1.signMessageOfflineSchema; } });
|
|
74
|
-
Object.defineProperty(exports, "singleTokenSubProtocolSchema", { enumerable: true, get: function () { return protocol_1.singleTokenSubProtocolSchema; } });
|
|
75
|
-
Object.defineProperty(exports, "subProtocolSchema", { enumerable: true, get: function () { return protocol_1.subProtocolSchema; } });
|
|
76
|
-
Object.defineProperty(exports, "transactionStatusCheckerSchema", { enumerable: true, get: function () { return protocol_1.transactionStatusCheckerSchema; } });
|
|
77
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;AA0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
|
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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@airgap/module-kit",
|
|
3
|
-
"version": "0.13.13
|
|
3
|
+
"version": "0.13.13",
|
|
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": [
|
|
@@ -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/types/protocol.d.ts
CHANGED
package/utils/protocol.d.ts
CHANGED
|
@@ -1,40 +1,18 @@
|
|
|
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
|
-
import { Schema } from './interface';
|
|
17
|
-
export declare const baseProtocolSchema: Schema<BaseProtocol>;
|
|
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
16
|
export declare function isOfflineProtocol(object: AnyProtocol): object is OfflineProtocol;
|
|
39
17
|
export declare function isOnlineProtocol(object: AnyProtocol): object is OnlineProtocol;
|
|
40
18
|
export declare function isBip32Protocol<T extends AnyProtocol>(protocol: T): protocol is T & Bip32Extension<T>;
|
package/utils/protocol.js
CHANGED
|
@@ -11,78 +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
72
|
function isOfflineProtocol(object) {
|
|
74
|
-
return (0, interface_1.implementsInterface)(object,
|
|
73
|
+
return (0, interface_1.implementsInterface)(object, offlineProtocolSchema);
|
|
75
74
|
}
|
|
76
75
|
exports.isOfflineProtocol = isOfflineProtocol;
|
|
77
76
|
function isOnlineProtocol(object) {
|
|
78
|
-
return (0, interface_1.implementsInterface)(object,
|
|
77
|
+
return (0, interface_1.implementsInterface)(object, onlineProtocolSchema);
|
|
79
78
|
}
|
|
80
79
|
exports.isOnlineProtocol = isOnlineProtocol;
|
|
81
80
|
function isOfflineBip32Protocol(protocol) {
|
|
82
|
-
return (0, interface_1.implementsInterface)(protocol,
|
|
81
|
+
return (0, interface_1.implementsInterface)(protocol, bip32OfflineProtocolSchema);
|
|
83
82
|
}
|
|
84
83
|
function isOnlineBip32Protocol(protocol) {
|
|
85
|
-
return (0, interface_1.implementsInterface)(protocol,
|
|
84
|
+
return (0, interface_1.implementsInterface)(protocol, bip32OnlineProtocolSchema);
|
|
86
85
|
}
|
|
87
86
|
function isBip32Protocol(protocol) {
|
|
88
87
|
var extendedWithBip32 = false;
|
|
@@ -96,63 +95,63 @@ function isBip32Protocol(protocol) {
|
|
|
96
95
|
}
|
|
97
96
|
exports.isBip32Protocol = isBip32Protocol;
|
|
98
97
|
function isSubProtocol(protocol) {
|
|
99
|
-
return (0, interface_1.implementsInterface)(protocol,
|
|
98
|
+
return (0, interface_1.implementsInterface)(protocol, subProtocolSchema);
|
|
100
99
|
}
|
|
101
100
|
exports.isSubProtocol = isSubProtocol;
|
|
102
101
|
function isSingleTokenSubProtocol(protocol) {
|
|
103
|
-
return (0, interface_1.implementsInterface)(protocol,
|
|
102
|
+
return (0, interface_1.implementsInterface)(protocol, singleTokenSubProtocolSchema);
|
|
104
103
|
}
|
|
105
104
|
exports.isSingleTokenSubProtocol = isSingleTokenSubProtocol;
|
|
106
105
|
function isMultiTokenSubProtocol(protocol) {
|
|
107
|
-
var extendedWithMultiTokenSubProtocol = (0, interface_1.implementsInterface)(protocol,
|
|
106
|
+
var extendedWithMultiTokenSubProtocol = (0, interface_1.implementsInterface)(protocol, multiTokenSubProtocolBaseSchema);
|
|
108
107
|
if (isOnlineProtocol(protocol)) {
|
|
109
|
-
extendedWithMultiTokenSubProtocol && (extendedWithMultiTokenSubProtocol = (0, interface_1.implementsInterface)(protocol,
|
|
108
|
+
extendedWithMultiTokenSubProtocol && (extendedWithMultiTokenSubProtocol = (0, interface_1.implementsInterface)(protocol, multiTokenSubProtocolOnlineSchema));
|
|
110
109
|
}
|
|
111
110
|
return extendedWithMultiTokenSubProtocol;
|
|
112
111
|
}
|
|
113
112
|
exports.isMultiTokenSubProtocol = isMultiTokenSubProtocol;
|
|
114
113
|
function canFetchDataForAddress(protocol) {
|
|
115
|
-
return (0, interface_1.implementsInterface)(protocol,
|
|
114
|
+
return (0, interface_1.implementsInterface)(protocol, fetchDataForAddressProtocolSchema);
|
|
116
115
|
}
|
|
117
116
|
exports.canFetchDataForAddress = canFetchDataForAddress;
|
|
118
117
|
function canFetchDataForMultipleAddresses(protocol) {
|
|
119
|
-
return (0, interface_1.implementsInterface)(protocol,
|
|
118
|
+
return (0, interface_1.implementsInterface)(protocol, fetchDataForMultipleAddressesProtocolSchema);
|
|
120
119
|
}
|
|
121
120
|
exports.canFetchDataForMultipleAddresses = canFetchDataForMultipleAddresses;
|
|
122
121
|
function hasMultiAddressPublicKeys(protocol) {
|
|
123
|
-
return (0, interface_1.implementsInterface)(protocol,
|
|
122
|
+
return (0, interface_1.implementsInterface)(protocol, multiAddressPublicKeyProtocolSchema);
|
|
124
123
|
}
|
|
125
124
|
exports.hasMultiAddressPublicKeys = hasMultiAddressPublicKeys;
|
|
126
125
|
function hasConfigurableContract(protocol) {
|
|
127
|
-
return (0, interface_1.implementsInterface)(protocol,
|
|
126
|
+
return (0, interface_1.implementsInterface)(protocol, configurableContractProtocolSchema);
|
|
128
127
|
}
|
|
129
128
|
exports.hasConfigurableContract = hasConfigurableContract;
|
|
130
129
|
function canEncryptAES(protocol) {
|
|
131
|
-
return (0, interface_1.implementsInterface)(protocol,
|
|
130
|
+
return (0, interface_1.implementsInterface)(protocol, aesEncryptionSchema);
|
|
132
131
|
}
|
|
133
132
|
exports.canEncryptAES = canEncryptAES;
|
|
134
133
|
function canEncryptAsymmetric(protocol) {
|
|
135
|
-
var extendedWithAsymmetricEncryption = (0, interface_1.implementsInterface)(protocol,
|
|
134
|
+
var extendedWithAsymmetricEncryption = (0, interface_1.implementsInterface)(protocol, asymmetricEncryptionBaseSchema);
|
|
136
135
|
if (isOfflineProtocol(protocol)) {
|
|
137
|
-
extendedWithAsymmetricEncryption && (extendedWithAsymmetricEncryption = (0, interface_1.implementsInterface)(protocol,
|
|
136
|
+
extendedWithAsymmetricEncryption && (extendedWithAsymmetricEncryption = (0, interface_1.implementsInterface)(protocol, asymmetricEncryptionOfflineSchema));
|
|
138
137
|
}
|
|
139
138
|
return extendedWithAsymmetricEncryption;
|
|
140
139
|
}
|
|
141
140
|
exports.canEncryptAsymmetric = canEncryptAsymmetric;
|
|
142
141
|
function canSignMessage(protocol) {
|
|
143
|
-
var extendedWithSignMessage = (0, interface_1.implementsInterface)(protocol,
|
|
142
|
+
var extendedWithSignMessage = (0, interface_1.implementsInterface)(protocol, signMessageBaseSchema);
|
|
144
143
|
if (isOfflineProtocol(protocol)) {
|
|
145
|
-
extendedWithSignMessage && (extendedWithSignMessage = (0, interface_1.implementsInterface)(protocol,
|
|
144
|
+
extendedWithSignMessage && (extendedWithSignMessage = (0, interface_1.implementsInterface)(protocol, signMessageOfflineSchema));
|
|
146
145
|
}
|
|
147
146
|
return extendedWithSignMessage;
|
|
148
147
|
}
|
|
149
148
|
exports.canSignMessage = canSignMessage;
|
|
150
149
|
function hasConfigurableTransactionInjector(protocol) {
|
|
151
|
-
return (0, interface_1.implementsInterface)(protocol,
|
|
150
|
+
return (0, interface_1.implementsInterface)(protocol, configurableTransactionInjectorSchema);
|
|
152
151
|
}
|
|
153
152
|
exports.hasConfigurableTransactionInjector = hasConfigurableTransactionInjector;
|
|
154
153
|
function isTransactionStatusChecker(protocol) {
|
|
155
|
-
return (0, interface_1.implementsInterface)(protocol,
|
|
154
|
+
return (0, interface_1.implementsInterface)(protocol, transactionStatusCheckerSchema);
|
|
156
155
|
}
|
|
157
156
|
exports.isTransactionStatusChecker = isTransactionStatusChecker;
|
|
158
157
|
// Identifier
|
package/utils/protocol.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol.js","sourceRoot":"","sources":["../../src/utils/protocol.ts"],"names":[],"mappings":";;;;;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C9E,OAAO,IAAA,+BAAmB,EAA2B,QAAQ,EAAE,8BAA8B,CAAC,CAAA;AAChG,CAAC;AAFD,gEAEC;AAED,aAAa;AAEb,IAAM,eAAe,GAA8B,UAAC,KAAa;IAC/D,IAAM,IAAI,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAA;IACjC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;IAElB,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;AAC3C,CAAC,CAAA;AAED,SAAgB,yBAAyB,CAAC,OAAwB;IAChE,IAAM,MAAM,GAAW,eAAe,CAAC,UAAG,OAAO,CAAC,IAAI,cAAI,OAAO,CAAC,MAAM,CAAE,CAAC,CAAA;IAE3E,OAAO,UAAG,OAAO,CAAC,IAAI,cAAI,MAAM,CAAE,CAAA;AACpC,CAAC;AAJD,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
|