@airgap/module-kit 0.13.16 → 0.13.17-beta.0
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 +8 -5
- package/index.js +4 -2
- package/index.js.map +1 -1
- package/package.json +3 -3
- package/protocol/extensions/address/MultiAddressPublicKeyExtension.d.ts +1 -1
- package/protocol/extensions/dapp/WalletConnectProtocol.d.ts +17 -0
- package/protocol/extensions/dapp/WalletConnectProtocol.js +3 -0
- package/protocol/extensions/dapp/WalletConnectProtocol.js.map +1 -0
- package/protocol/extensions/extensions.d.ts +2 -0
- package/utils/protocol.d.ts +3 -0
- package/utils/protocol.js +9 -1
- package/utils/protocol.js.map +1 -1
package/index.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ import { AESExtension } from './protocol/extensions/crypto/AESExtension';
|
|
|
15
15
|
import { AsymmetricEncryptionExtension } from './protocol/extensions/crypto/AsymmetricEncryptionExtension';
|
|
16
16
|
import { CryptoExtension } from './protocol/extensions/crypto/CryptoExtension';
|
|
17
17
|
import { SignMessageExtension } from './protocol/extensions/crypto/SignMessageExtension';
|
|
18
|
+
import { WalletConnectExtension, WalletConnectProtocol, WalletConnectRequest } from './protocol/extensions/dapp/WalletConnectProtocol';
|
|
18
19
|
import { BaseMultiTokenSubProtocol, MultiTokenBalanceConfiguration, MultiTokenSubProtocolExtension, OnlineMultiTokenSubProtocol } from './protocol/extensions/sub-protocol/MultiTokenSubProtocolExtension';
|
|
19
20
|
import { SingleTokenSubProtocol, SingleTokenSubProtocolExtension } from './protocol/extensions/sub-protocol/SingleTokenSubProtocolExtension';
|
|
20
21
|
import { SubProtocol, SubProtocolExtension } from './protocol/extensions/sub-protocol/SubProtocolExtension';
|
|
@@ -45,13 +46,15 @@ import { implementsInterface, Schema } from './utils/interface';
|
|
|
45
46
|
import { isAnyKey, isExtendedPublicKey, isExtendedSecretKey, isPublicKey, isSecretKey } from './utils/key';
|
|
46
47
|
import { canSerializeProtocols, createSupportedProtocols, protocolSerializerSchema } from './utils/module';
|
|
47
48
|
import { normalizeToUndefined } from './utils/normalize';
|
|
48
|
-
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';
|
|
49
|
+
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, supportsWalletConnect, transactionStatusCheckerSchema, walletConnectProtocolSchema } from './utils/protocol';
|
|
49
50
|
export { AirGapBlockExplorer, BlockExplorerMetadata };
|
|
50
51
|
export { newSuccessUIAlert, newInfoUIAlert, newWarningUIAlert, newErrorUIAlert, newPlainUIText, newAmount, newSecretKey, newExtendedSecretKey, newPublicKey, newExtendedPublicKey, newSignature, newUnsignedTransaction, newSignedTransaction };
|
|
51
|
-
export { AirGapModule, ModuleNetworkRegistry, ProtocolConfiguration, OfflineProtocolConfiguration, OnlineProtocolConfiguration, FullProtocolConfiguration,
|
|
52
|
-
export {
|
|
52
|
+
export { AirGapModule, ModuleNetworkRegistry, ProtocolConfiguration, OfflineProtocolConfiguration, OnlineProtocolConfiguration, FullProtocolConfiguration, AirGapSerializedOfflineProtocol, AirGapSerializedOnlineProtocol, AirGapSerializedAnyProtocol };
|
|
53
|
+
export { ProtocolSerializerExtension, ProtocolSerializerModule };
|
|
54
|
+
export { AirGapOfflineProtocol, AirGapOnlineProtocol, AirGapProtocol, AirGapAnyProtocol, ProtocolMetadata, ProtocolUnitsMetadata, ProtocolSymbol, ProtocolFeeMetadata, ProtocolAccountMetadata, ProtocolTransactionMetadata, ProtocolNetworkType, ProtocolNetwork, SubProtocolType };
|
|
55
|
+
export { FetchDataForMultipleAddressesExtension, FetchDataForMultipleAddressesProtocol, MultiAddressPublicKeyExtension, MultiAddressPublicKeyProtocol, Bip32Extension, OfflineBip32Protocol, OnlineBip32Protocol, SubProtocolExtension, SubProtocol, SingleTokenSubProtocolExtension, SingleTokenSubProtocol, MultiTokenSubProtocolExtension, BaseMultiTokenSubProtocol, OnlineMultiTokenSubProtocol, CryptoExtension, AESExtension, AsymmetricEncryptionExtension, SignMessageExtension, TransactionStatusCheckerExtension, WalletConnectRequest, WalletConnectExtension, WalletConnectProtocol };
|
|
53
56
|
export { AirGapV3SerializerCompanion, V3SchemaConfiguration };
|
|
54
57
|
export { AirGapInterface };
|
|
55
58
|
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 };
|
|
56
|
-
export { isAmount, Schema, implementsInterface, isAnyKey, isSecretKey, isExtendedSecretKey, isPublicKey, isExtendedPublicKey, createSupportedProtocols, canSerializeProtocols, isAnyProtocol, isOfflineProtocol, isOnlineProtocol, isBip32Protocol, isSubProtocol, isSingleTokenSubProtocol, isMultiTokenSubProtocol, canFetchDataForAddress, canFetchDataForMultipleAddresses, hasMultiAddressPublicKeys, hasConfigurableContract, canEncryptAES, canEncryptAsymmetric, canSignMessage, hasConfigurableTransactionInjector, isTransactionStatusChecker, protocolNetworkIdentifier, normalizeToUndefined };
|
|
57
|
-
export { protocolSerializerSchema, baseProtocolSchema, offlineProtocolSchema, onlineProtocolSchema, bip32BaseProtocolSchema, bip32OfflineProtocolSchema, bip32OnlineProtocolSchema, subProtocolSchema, singleTokenSubProtocolSchema, multiTokenSubProtocolBaseSchema, fetchDataForAddressProtocolSchema, fetchDataForMultipleAddressesProtocolSchema, multiAddressPublicKeyProtocolSchema, configurableContractProtocolSchema, aesEncryptionSchema, asymmetricEncryptionBaseSchema, asymmetricEncryptionOfflineSchema, signMessageBaseSchema, signMessageOfflineSchema, configurableTransactionInjectorSchema, transactionStatusCheckerSchema };
|
|
59
|
+
export { isAmount, Schema, implementsInterface, isAnyKey, isSecretKey, isExtendedSecretKey, isPublicKey, isExtendedPublicKey, createSupportedProtocols, canSerializeProtocols, isAnyProtocol, isOfflineProtocol, isOnlineProtocol, isBip32Protocol, isSubProtocol, isSingleTokenSubProtocol, isMultiTokenSubProtocol, canFetchDataForAddress, canFetchDataForMultipleAddresses, hasMultiAddressPublicKeys, hasConfigurableContract, canEncryptAES, canEncryptAsymmetric, canSignMessage, hasConfigurableTransactionInjector, isTransactionStatusChecker, supportsWalletConnect, protocolNetworkIdentifier, normalizeToUndefined };
|
|
60
|
+
export { protocolSerializerSchema, baseProtocolSchema, offlineProtocolSchema, onlineProtocolSchema, bip32BaseProtocolSchema, bip32OfflineProtocolSchema, bip32OnlineProtocolSchema, subProtocolSchema, singleTokenSubProtocolSchema, multiTokenSubProtocolBaseSchema, fetchDataForAddressProtocolSchema, fetchDataForMultipleAddressesProtocolSchema, multiAddressPublicKeyProtocolSchema, configurableContractProtocolSchema, aesEncryptionSchema, asymmetricEncryptionBaseSchema, asymmetricEncryptionOfflineSchema, signMessageBaseSchema, signMessageOfflineSchema, configurableTransactionInjectorSchema, transactionStatusCheckerSchema, walletConnectProtocolSchema };
|
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 = exports.fetchDataForMultipleAddressesProtocolSchema = exports.fetchDataForAddressProtocolSchema = exports.multiTokenSubProtocolBaseSchema = void 0;
|
|
3
|
+
exports.subProtocolSchema = exports.bip32OnlineProtocolSchema = exports.bip32OfflineProtocolSchema = exports.bip32BaseProtocolSchema = exports.onlineProtocolSchema = exports.offlineProtocolSchema = exports.baseProtocolSchema = exports.protocolSerializerSchema = exports.normalizeToUndefined = exports.protocolNetworkIdentifier = exports.supportsWalletConnect = exports.isTransactionStatusChecker = exports.hasConfigurableTransactionInjector = exports.canSignMessage = exports.canEncryptAsymmetric = exports.canEncryptAES = exports.hasConfigurableContract = exports.hasMultiAddressPublicKeys = exports.canFetchDataForMultipleAddresses = exports.canFetchDataForAddress = exports.isMultiTokenSubProtocol = exports.isSingleTokenSubProtocol = exports.isSubProtocol = exports.isBip32Protocol = exports.isOnlineProtocol = exports.isOfflineProtocol = exports.isAnyProtocol = exports.canSerializeProtocols = exports.createSupportedProtocols = exports.isExtendedPublicKey = exports.isPublicKey = exports.isExtendedSecretKey = exports.isSecretKey = exports.isAnyKey = exports.implementsInterface = exports.isAmount = exports.ModuleNetworkRegistry = exports.newSignedTransaction = exports.newUnsignedTransaction = exports.newSignature = exports.newExtendedPublicKey = exports.newPublicKey = exports.newExtendedSecretKey = exports.newSecretKey = exports.newAmount = exports.newPlainUIText = exports.newErrorUIAlert = exports.newWarningUIAlert = exports.newInfoUIAlert = exports.newSuccessUIAlert = void 0;
|
|
4
|
+
exports.walletConnectProtocolSchema = exports.transactionStatusCheckerSchema = exports.configurableTransactionInjectorSchema = exports.signMessageOfflineSchema = exports.signMessageBaseSchema = exports.asymmetricEncryptionOfflineSchema = exports.asymmetricEncryptionBaseSchema = exports.aesEncryptionSchema = exports.configurableContractProtocolSchema = exports.multiAddressPublicKeyProtocolSchema = exports.fetchDataForMultipleAddressesProtocolSchema = exports.fetchDataForAddressProtocolSchema = exports.multiTokenSubProtocolBaseSchema = exports.singleTokenSubProtocolSchema = 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");
|
|
@@ -76,5 +76,7 @@ Object.defineProperty(exports, "signMessageBaseSchema", { enumerable: true, get:
|
|
|
76
76
|
Object.defineProperty(exports, "signMessageOfflineSchema", { enumerable: true, get: function () { return protocol_1.signMessageOfflineSchema; } });
|
|
77
77
|
Object.defineProperty(exports, "singleTokenSubProtocolSchema", { enumerable: true, get: function () { return protocol_1.singleTokenSubProtocolSchema; } });
|
|
78
78
|
Object.defineProperty(exports, "subProtocolSchema", { enumerable: true, get: function () { return protocol_1.subProtocolSchema; } });
|
|
79
|
+
Object.defineProperty(exports, "supportsWalletConnect", { enumerable: true, get: function () { return protocol_1.supportsWalletConnect; } });
|
|
79
80
|
Object.defineProperty(exports, "transactionStatusCheckerSchema", { enumerable: true, get: function () { return protocol_1.transactionStatusCheckerSchema; } });
|
|
81
|
+
Object.defineProperty(exports, "walletConnectProtocolSchema", { enumerable: true, get: function () { return protocol_1.walletConnectProtocolSchema; } });
|
|
80
82
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAEA,6CAA8C;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAEA,6CAA8C;AAgJ5C,0FAhJO,kBAAS,OAgJP;AA/IX,uCAAwG;AAmJtG,qGAnJO,0BAAoB,OAmJP;AAFpB,qGAjJ6B,0BAAoB,OAiJ7B;AACpB,6FAlJmD,kBAAY,OAkJnD;AAFZ,6FAhJiE,kBAAY,OAgJjE;AA/Id,mDAAoD;AAmJlD,6FAnJO,wBAAY,OAmJP;AAlJd,uDAAsF;AAoJpF,qGApJO,kCAAoB,OAoJP;AADpB,uGAnJ6B,oCAAsB,OAmJ7B;AAlJxB,8CAA4G;AA0I1G,gGA1IO,uBAAe,OA0IP;AAFf,+FAxIwB,sBAAc,OAwIxB;AADd,kGAvIwC,yBAAiB,OAuIxC;AAEjB,kGAzI2D,yBAAiB,OAyI3D;AAxInB,4CAAoD;AA0IlD,+FA1IO,qBA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AgB,OA4KA;AAGhB,yGA9KA,mCAAwB,OA8KA;AADxB,8FA5KA,wBAAa,OA4KA;AAWb,2GAtLA,qCAA0B,OAsLA;AAqB1B,oHA1MA,8CAAmC,OA0MA;AAHnC,gHAtMA,0CAA+B,OAsMA;AAP/B,sGA9LA,gCAAqB,OA8LA;AACrB,qGA9LA,+BAAoB,OA8LA;AAVpB,0GAnLA,oCAAyB,OAmLA;AAwBzB,sGA1MA,gCAAqB,OA0MA;AACrB,yGA1MA,mCAAwB,OA0MA;AAVxB,6GA/LA,uCAA4B,OA+LA;AAD5B,kGA7LA,4BAAiB,OA6LA;AAfjB,sGA7KA,gCAAqB,OA6KA;AA4BrB,+GAxMA,yCAA8B,OAwMA;AAC9B,4GAxMA,sCAA2B,OAwMA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@airgap/module-kit",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.17-beta.0",
|
|
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": "^0.13.17-beta.0",
|
|
33
|
+
"@airgap/serializer": "^0.13.17-beta.0"
|
|
34
34
|
},
|
|
35
35
|
"nyc": {
|
|
36
36
|
"include": [
|
|
@@ -2,7 +2,7 @@ import { AddressWithCursor } from '../../../types/address';
|
|
|
2
2
|
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
|
-
export interface MultiAddressPublicKeyProtocol<_AddressCursor extends BaseGeneric['AddressCursor'] = BaseGeneric['AddressCursor'], _PublicKey extends PublicKey | ExtendedPublicKey = PublicKey> {
|
|
5
|
+
export interface MultiAddressPublicKeyProtocol<_AddressCursor extends BaseGeneric['AddressCursor'] = BaseGeneric['AddressCursor'], _PublicKey extends PublicKey | ExtendedPublicKey = PublicKey | ExtendedPublicKey> {
|
|
6
6
|
getInitialAddressesFromPublicKey(publicKey: _PublicKey): Promise<AddressWithCursor<_AddressCursor>[]>;
|
|
7
7
|
getNextAddressFromPublicKey(publicKey: _PublicKey, cursor: _AddressCursor): Promise<AddressWithCursor<_AddressCursor> | undefined>;
|
|
8
8
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ExtendedPublicKey, PublicKey } from '../../../types/key';
|
|
2
|
+
import { UnsignedTransaction } from '../../../types/transaction';
|
|
3
|
+
import { _OnlineProtocol } from '../../protocol';
|
|
4
|
+
export declare type WalletConnectExtension<T extends _OnlineProtocol> = T extends _OnlineProtocol<any, any, any, any, any, any, any, infer _UnsignedTransaction, any, infer _PublicKey> ? WalletConnectProtocol<_UnsignedTransaction, _PublicKey> : never;
|
|
5
|
+
export interface WalletConnectRequest {
|
|
6
|
+
from?: string;
|
|
7
|
+
to?: string;
|
|
8
|
+
data?: string;
|
|
9
|
+
gasLimit?: string;
|
|
10
|
+
gasPrice?: string;
|
|
11
|
+
value?: string;
|
|
12
|
+
nonce?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface WalletConnectProtocol<_UnsignedTransaction extends UnsignedTransaction = UnsignedTransaction, _PublicKey extends PublicKey | ExtendedPublicKey = PublicKey | ExtendedPublicKey> {
|
|
15
|
+
getWalletConnectChainId(): Promise<number>;
|
|
16
|
+
prepareWalletConnectTransactionWithPublicKey(publicKey: _PublicKey, request: WalletConnectRequest): Promise<_UnsignedTransaction>;
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WalletConnectProtocol.js","sourceRoot":"","sources":["../../../../src/protocol/extensions/dapp/WalletConnectProtocol.ts"],"names":[],"mappings":""}
|
|
@@ -8,6 +8,7 @@ import { AESExtension } from './crypto/AESExtension';
|
|
|
8
8
|
import { AsymmetricEncryptionExtension } from './crypto/AsymmetricEncryptionExtension';
|
|
9
9
|
import { CryptoExtension } from './crypto/CryptoExtension';
|
|
10
10
|
import { SignMessageExtension } from './crypto/SignMessageExtension';
|
|
11
|
+
import { WalletConnectExtension } from './dapp/WalletConnectProtocol';
|
|
11
12
|
import { MultiTokenSubProtocolExtension } from './sub-protocol/MultiTokenSubProtocolExtension';
|
|
12
13
|
import { SingleTokenSubProtocolExtension } from './sub-protocol/SingleTokenSubProtocolExtension';
|
|
13
14
|
import { SubProtocolExtension } from './sub-protocol/SubProtocolExtension';
|
|
@@ -33,5 +34,6 @@ interface OnlineExtensions<T extends _OnlineProtocol> extends OfflineAndOnlineEx
|
|
|
33
34
|
FetchDataForMultipleAddresses: FetchDataForMultipleAddressesExtension<T>;
|
|
34
35
|
ConfigurableTransactionInjector: ConfigurableTransactionInjectorExtension<T>;
|
|
35
36
|
TransactionStatusChecker: TransactionStatusCheckerExtension<T>;
|
|
37
|
+
WalletConnect: WalletConnectExtension<T>;
|
|
36
38
|
}
|
|
37
39
|
export {};
|
package/utils/protocol.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { ConfigurableContractProtocol } from '../protocol/extensions/contract/Co
|
|
|
6
6
|
import { AES, AESExtension } from '../protocol/extensions/crypto/AESExtension';
|
|
7
7
|
import { AsymmetricEncryptionExtension, BaseAsymmetricEncryption, OfflineAsymmetricEncryption } from '../protocol/extensions/crypto/AsymmetricEncryptionExtension';
|
|
8
8
|
import { BaseSignMessage, OfflineSignMessage, SignMessageExtension } from '../protocol/extensions/crypto/SignMessageExtension';
|
|
9
|
+
import { WalletConnectExtension, WalletConnectProtocol } from '../protocol/extensions/dapp/WalletConnectProtocol';
|
|
9
10
|
import { BaseMultiTokenSubProtocol, MultiTokenSubProtocolExtension, OnlineMultiTokenSubProtocol } from '../protocol/extensions/sub-protocol/MultiTokenSubProtocolExtension';
|
|
10
11
|
import { SingleTokenSubProtocol, SingleTokenSubProtocolExtension } from '../protocol/extensions/sub-protocol/SingleTokenSubProtocolExtension';
|
|
11
12
|
import { SubProtocol } from '../protocol/extensions/sub-protocol/SubProtocolExtension';
|
|
@@ -35,6 +36,7 @@ export declare const signMessageBaseSchema: Schema<BaseSignMessage>;
|
|
|
35
36
|
export declare const signMessageOfflineSchema: Schema<OfflineSignMessage>;
|
|
36
37
|
export declare const configurableTransactionInjectorSchema: Schema<ConfigurableTransactionInjectorProtocol>;
|
|
37
38
|
export declare const transactionStatusCheckerSchema: Schema<TransactionStatusChecker>;
|
|
39
|
+
export declare const walletConnectProtocolSchema: Schema<WalletConnectProtocol>;
|
|
38
40
|
export declare function isAnyProtocol(object: unknown): object is AnyProtocol;
|
|
39
41
|
export declare function isOfflineProtocol(object: unknown): object is OfflineProtocol;
|
|
40
42
|
export declare function isOnlineProtocol(object: unknown): object is OnlineProtocol;
|
|
@@ -51,4 +53,5 @@ export declare function canEncryptAsymmetric<T extends AnyProtocol>(protocol: T)
|
|
|
51
53
|
export declare function canSignMessage<T extends AnyProtocol>(protocol: T): protocol is T & SignMessageExtension<T>;
|
|
52
54
|
export declare function hasConfigurableTransactionInjector<T extends OnlineProtocol>(protocol: T): protocol is T & ConfigurableTransactionInjectorProtocol;
|
|
53
55
|
export declare function isTransactionStatusChecker<T extends OnlineProtocol>(protocol: T): protocol is T & TransactionStatusCheckerExtension<T>;
|
|
56
|
+
export declare function supportsWalletConnect<T extends OnlineProtocol>(protocol: T): protocol is T & WalletConnectExtension<T>;
|
|
54
57
|
export declare function protocolNetworkIdentifier(network: ProtocolNetwork): string;
|
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.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;
|
|
14
|
+
exports.protocolNetworkIdentifier = exports.supportsWalletConnect = 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.walletConnectProtocolSchema = 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");
|
|
@@ -69,6 +69,10 @@ exports.configurableTransactionInjectorSchema = {
|
|
|
69
69
|
exports.transactionStatusCheckerSchema = {
|
|
70
70
|
getTransactionStatus: 'required'
|
|
71
71
|
};
|
|
72
|
+
exports.walletConnectProtocolSchema = {
|
|
73
|
+
getWalletConnectChainId: 'required',
|
|
74
|
+
prepareWalletConnectTransactionWithPublicKey: 'required'
|
|
75
|
+
};
|
|
72
76
|
// Implementation Checks
|
|
73
77
|
function isAnyProtocol(object) {
|
|
74
78
|
return isOfflineProtocol(object) || isOnlineProtocol(object);
|
|
@@ -159,6 +163,10 @@ function isTransactionStatusChecker(protocol) {
|
|
|
159
163
|
return (0, interface_1.implementsInterface)(protocol, exports.transactionStatusCheckerSchema);
|
|
160
164
|
}
|
|
161
165
|
exports.isTransactionStatusChecker = isTransactionStatusChecker;
|
|
166
|
+
function supportsWalletConnect(protocol) {
|
|
167
|
+
return (0, interface_1.implementsInterface)(protocol, exports.walletConnectProtocolSchema);
|
|
168
|
+
}
|
|
169
|
+
exports.supportsWalletConnect = supportsWalletConnect;
|
|
162
170
|
// Identifier
|
|
163
171
|
var sha256hashShort = function (input) {
|
|
164
172
|
var hash = createHash('sha256');
|
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;
|
|
1
|
+
{"version":3,"file":"protocol.js","sourceRoot":"","sources":["../../src/utils/protocol.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,aAAa;AACb,0FAA4F;AAuC5F,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,EAAE,UAAU,EACvC,+BAA+B,EAAE,UAAU,IAC5C;AAEY,QAAA,uBAAuB,yBAC/B,0BAAkB,KACrB,2BAA2B,EAAE,UAAU,IACxC;AAEY,QAAA,0BAA0B,kCAClC,+BAAuB,GACvB,6BAAqB,KACxB,gCAAgC,EAAE,UAAU,EAC5C,2BAA2B,EAAE,UAAU,IACxC;AAEY,QAAA,yBAAyB,yBACjC,+BAAuB,GACvB,4BAAoB,EACxB;AAEY,QAAA,iBAAiB,GAAwB;IACpD,OAAO,EA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