@airgap/module-kit 0.13.16-beta.13 → 0.13.16-beta.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 +5 -8
- package/index.js +2 -4
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/protocol/extensions/address/MultiAddressPublicKeyExtension.d.ts +1 -1
- package/protocol/extensions/extensions.d.ts +0 -2
- package/utils/protocol.d.ts +0 -3
- package/utils/protocol.js +1 -9
- package/utils/protocol.js.map +1 -1
- package/protocol/extensions/dapp/WalletConnectProtocol.d.ts +0 -25
- package/protocol/extensions/dapp/WalletConnectProtocol.js +0 -3
- package/protocol/extensions/dapp/WalletConnectProtocol.js.map +0 -1
package/index.d.ts
CHANGED
|
@@ -15,7 +15,6 @@ 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, WalletConnectTransaction } from './protocol/extensions/dapp/WalletConnectProtocol';
|
|
19
18
|
import { BaseMultiTokenSubProtocol, MultiTokenBalanceConfiguration, MultiTokenSubProtocolExtension, OnlineMultiTokenSubProtocol } from './protocol/extensions/sub-protocol/MultiTokenSubProtocolExtension';
|
|
20
19
|
import { SingleTokenSubProtocol, SingleTokenSubProtocolExtension } from './protocol/extensions/sub-protocol/SingleTokenSubProtocolExtension';
|
|
21
20
|
import { SubProtocol, SubProtocolExtension } from './protocol/extensions/sub-protocol/SubProtocolExtension';
|
|
@@ -46,15 +45,13 @@ import { implementsInterface, Schema } from './utils/interface';
|
|
|
46
45
|
import { isAnyKey, isExtendedPublicKey, isExtendedSecretKey, isPublicKey, isSecretKey } from './utils/key';
|
|
47
46
|
import { canSerializeProtocols, createSupportedProtocols, protocolSerializerSchema } from './utils/module';
|
|
48
47
|
import { normalizeToUndefined } from './utils/normalize';
|
|
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,
|
|
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';
|
|
50
49
|
export { AirGapBlockExplorer, BlockExplorerMetadata };
|
|
51
50
|
export { newSuccessUIAlert, newInfoUIAlert, newWarningUIAlert, newErrorUIAlert, newPlainUIText, newAmount, newSecretKey, newExtendedSecretKey, newPublicKey, newExtendedPublicKey, newSignature, newUnsignedTransaction, newSignedTransaction };
|
|
52
|
-
export { AirGapModule, ModuleNetworkRegistry, ProtocolConfiguration, OfflineProtocolConfiguration, OnlineProtocolConfiguration, FullProtocolConfiguration, AirGapSerializedOfflineProtocol, AirGapSerializedOnlineProtocol, AirGapSerializedAnyProtocol };
|
|
53
|
-
export {
|
|
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, WalletConnectTransaction, WalletConnectExtension, WalletConnectProtocol };
|
|
51
|
+
export { AirGapModule, ModuleNetworkRegistry, ProtocolConfiguration, OfflineProtocolConfiguration, OnlineProtocolConfiguration, FullProtocolConfiguration, ProtocolSerializerExtension, ProtocolSerializerModule, AirGapSerializedOfflineProtocol, AirGapSerializedOnlineProtocol, AirGapSerializedAnyProtocol };
|
|
52
|
+
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 };
|
|
56
53
|
export { AirGapV3SerializerCompanion, V3SchemaConfiguration };
|
|
57
54
|
export { AirGapInterface };
|
|
58
55
|
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 };
|
|
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,
|
|
60
|
-
export { protocolSerializerSchema, baseProtocolSchema, offlineProtocolSchema, onlineProtocolSchema, bip32BaseProtocolSchema, bip32OfflineProtocolSchema, bip32OnlineProtocolSchema, subProtocolSchema, singleTokenSubProtocolSchema, multiTokenSubProtocolBaseSchema, fetchDataForAddressProtocolSchema, fetchDataForMultipleAddressesProtocolSchema, multiAddressPublicKeyProtocolSchema, configurableContractProtocolSchema, aesEncryptionSchema, asymmetricEncryptionBaseSchema, asymmetricEncryptionOfflineSchema, signMessageBaseSchema, signMessageOfflineSchema, configurableTransactionInjectorSchema, transactionStatusCheckerSchema
|
|
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 };
|
package/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.subProtocolSchema = exports.bip32OnlineProtocolSchema = exports.bip32OfflineProtocolSchema = exports.bip32BaseProtocolSchema = exports.onlineProtocolSchema = exports.offlineProtocolSchema = exports.baseProtocolSchema = exports.protocolSerializerSchema = exports.normalizeToUndefined = exports.protocolNetworkIdentifier = exports.
|
|
4
|
-
exports.
|
|
3
|
+
exports.singleTokenSubProtocolSchema = exports.subProtocolSchema = exports.bip32OnlineProtocolSchema = exports.bip32OfflineProtocolSchema = exports.bip32BaseProtocolSchema = exports.onlineProtocolSchema = exports.offlineProtocolSchema = exports.baseProtocolSchema = exports.protocolSerializerSchema = exports.normalizeToUndefined = exports.protocolNetworkIdentifier = exports.isTransactionStatusChecker = exports.hasConfigurableTransactionInjector = exports.canSignMessage = exports.canEncryptAsymmetric = exports.canEncryptAES = exports.hasConfigurableContract = exports.hasMultiAddressPublicKeys = exports.canFetchDataForMultipleAddresses = exports.canFetchDataForAddress = exports.isMultiTokenSubProtocol = exports.isSingleTokenSubProtocol = exports.isSubProtocol = exports.isBip32Protocol = exports.isOnlineProtocol = exports.isOfflineProtocol = exports.isAnyProtocol = exports.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.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;
|
|
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,7 +76,5 @@ 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; } });
|
|
80
79
|
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; } });
|
|
82
80
|
//# 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;AA6I5C,0FA7IO,kBAAS,OA6IP;AA5IX,uCAAwG;AAgJtG,qGAhJO,0BAAoB,OAgJP;AAFpB,qGA9I6B,0BAAoB,OA8I7B;AACpB,6FA/ImD,kBAAY,OA+InD;AAFZ,6F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AkC,OA6MA;AAMlC,sHAlNA,gDAAqC,OAkNA;AATrC,kHAxMA,4CAAiC,OAwMA;AACjC,4HAxMA,sDAA2C,OAwMA;AAxB3C,wGA/KA,kCAAuB,OA+KA;AAIvB,mHAlLA,6CAAkC,OAkLA;AALlC,0GA5KA,oCAAyB,OA4KA;AATzB,8FAlKA,wBAAa,OAkKA;AAGb,gGApKA,0BAAe,OAoKA;AAGf,wGAtKA,kCAAuB,OAsKA;AALvB,kGAhKA,4BAAiB,OAgKA;AACjB,iGAhKA,2BAAgB,OAgKA;AAGhB,yGAlKA,mCAAwB,OAkKA;AADxB,8FAhKA,wBAAa,OAgKA;AAWb,2GA1KA,qCAA0B,OA0KA;AAoB1B,oHA7LA,8CAAmC,OA6LA;AAHnC,gHAzLA,0CAA+B,OAyLA;AAP/B,sGAjLA,gCAAqB,OAiLA;AACrB,qGAjLA,+BAAoB,OAiLA;AAVpB,0GAtKA,oCAAyB,OAsKA;AAwBzB,sGA7LA,gCAAqB,OA6LA;AACrB,yGA7LA,mCAAwB,OA6LA;AAVxB,6GAlLA,uCAA4B,OAkLA;AAD5B,kGAhLA,4BAAiB,OAgLA;AAajB,+GA5LA,yCAA8B,OA4LA"}
|
package/package.json
CHANGED
|
@@ -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> {
|
|
6
6
|
getInitialAddressesFromPublicKey(publicKey: _PublicKey): Promise<AddressWithCursor<_AddressCursor>[]>;
|
|
7
7
|
getNextAddressFromPublicKey(publicKey: _PublicKey, cursor: _AddressCursor): Promise<AddressWithCursor<_AddressCursor> | undefined>;
|
|
8
8
|
}
|
|
@@ -8,7 +8,6 @@ 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';
|
|
12
11
|
import { MultiTokenSubProtocolExtension } from './sub-protocol/MultiTokenSubProtocolExtension';
|
|
13
12
|
import { SingleTokenSubProtocolExtension } from './sub-protocol/SingleTokenSubProtocolExtension';
|
|
14
13
|
import { SubProtocolExtension } from './sub-protocol/SubProtocolExtension';
|
|
@@ -34,6 +33,5 @@ interface OnlineExtensions<T extends _OnlineProtocol> extends OfflineAndOnlineEx
|
|
|
34
33
|
FetchDataForMultipleAddresses: FetchDataForMultipleAddressesExtension<T>;
|
|
35
34
|
ConfigurableTransactionInjector: ConfigurableTransactionInjectorExtension<T>;
|
|
36
35
|
TransactionStatusChecker: TransactionStatusCheckerExtension<T>;
|
|
37
|
-
WalletConnect: WalletConnectExtension<T>;
|
|
38
36
|
}
|
|
39
37
|
export {};
|
package/utils/protocol.d.ts
CHANGED
|
@@ -6,7 +6,6 @@ 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';
|
|
10
9
|
import { BaseMultiTokenSubProtocol, MultiTokenSubProtocolExtension, OnlineMultiTokenSubProtocol } from '../protocol/extensions/sub-protocol/MultiTokenSubProtocolExtension';
|
|
11
10
|
import { SingleTokenSubProtocol, SingleTokenSubProtocolExtension } from '../protocol/extensions/sub-protocol/SingleTokenSubProtocolExtension';
|
|
12
11
|
import { SubProtocol } from '../protocol/extensions/sub-protocol/SubProtocolExtension';
|
|
@@ -36,7 +35,6 @@ export declare const signMessageBaseSchema: Schema<BaseSignMessage>;
|
|
|
36
35
|
export declare const signMessageOfflineSchema: Schema<OfflineSignMessage>;
|
|
37
36
|
export declare const configurableTransactionInjectorSchema: Schema<ConfigurableTransactionInjectorProtocol>;
|
|
38
37
|
export declare const transactionStatusCheckerSchema: Schema<TransactionStatusChecker>;
|
|
39
|
-
export declare const walletConnectProtocolSchema: Schema<WalletConnectProtocol>;
|
|
40
38
|
export declare function isAnyProtocol(object: unknown): object is AnyProtocol;
|
|
41
39
|
export declare function isOfflineProtocol(object: unknown): object is OfflineProtocol;
|
|
42
40
|
export declare function isOnlineProtocol(object: unknown): object is OnlineProtocol;
|
|
@@ -53,5 +51,4 @@ export declare function canEncryptAsymmetric<T extends AnyProtocol>(protocol: T)
|
|
|
53
51
|
export declare function canSignMessage<T extends AnyProtocol>(protocol: T): protocol is T & SignMessageExtension<T>;
|
|
54
52
|
export declare function hasConfigurableTransactionInjector<T extends OnlineProtocol>(protocol: T): protocol is T & ConfigurableTransactionInjectorProtocol;
|
|
55
53
|
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>;
|
|
57
54
|
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.
|
|
14
|
+
exports.protocolNetworkIdentifier = exports.isTransactionStatusChecker = exports.hasConfigurableTransactionInjector = exports.canSignMessage = exports.canEncryptAsymmetric = exports.canEncryptAES = exports.hasConfigurableContract = exports.hasMultiAddressPublicKeys = exports.canFetchDataForMultipleAddresses = exports.canFetchDataForAddress = exports.isMultiTokenSubProtocol = exports.isSingleTokenSubProtocol = exports.isSubProtocol = exports.isBip32Protocol = exports.isOnlineProtocol = exports.isOfflineProtocol = exports.isAnyProtocol = exports.transactionStatusCheckerSchema = exports.configurableTransactionInjectorSchema = exports.signMessageOfflineSchema = exports.signMessageBaseSchema = exports.asymmetricEncryptionOfflineSchema = exports.asymmetricEncryptionBaseSchema = exports.aesEncryptionSchema = exports.configurableContractProtocolSchema = exports.multiAddressPublicKeyProtocolSchema = exports.fetchDataForMultipleAddressesProtocolSchema = exports.fetchDataForAddressProtocolSchema = exports.multiTokenSubProtocolOnlineSchema = exports.multiTokenSubProtocolBaseSchema = exports.singleTokenSubProtocolSchema = exports.subProtocolSchema = exports.bip32OnlineProtocolSchema = exports.bip32OfflineProtocolSchema = exports.bip32BaseProtocolSchema = exports.onlineProtocolSchema = exports.offlineProtocolSchema = exports.baseProtocolSchema = void 0;
|
|
15
15
|
// @ts-ignore
|
|
16
16
|
var createHash = require("@airgap/coinlib-core/dependencies/src/create-hash-1.2.0/index");
|
|
17
17
|
var interface_1 = require("./interface");
|
|
@@ -69,10 +69,6 @@ exports.configurableTransactionInjectorSchema = {
|
|
|
69
69
|
exports.transactionStatusCheckerSchema = {
|
|
70
70
|
getTransactionStatus: 'required'
|
|
71
71
|
};
|
|
72
|
-
exports.walletConnectProtocolSchema = {
|
|
73
|
-
getWalletConnectChainId: 'required',
|
|
74
|
-
prepareWalletConnectTransactionWithPublicKey: 'required'
|
|
75
|
-
};
|
|
76
72
|
// Implementation Checks
|
|
77
73
|
function isAnyProtocol(object) {
|
|
78
74
|
return isOfflineProtocol(object) || isOnlineProtocol(object);
|
|
@@ -163,10 +159,6 @@ function isTransactionStatusChecker(protocol) {
|
|
|
163
159
|
return (0, interface_1.implementsInterface)(protocol, exports.transactionStatusCheckerSchema);
|
|
164
160
|
}
|
|
165
161
|
exports.isTransactionStatusChecker = isTransactionStatusChecker;
|
|
166
|
-
function supportsWalletConnect(protocol) {
|
|
167
|
-
return (0, interface_1.implementsInterface)(protocol, exports.walletConnectProtocolSchema);
|
|
168
|
-
}
|
|
169
|
-
exports.supportsWalletConnect = supportsWalletConnect;
|
|
170
162
|
// Identifier
|
|
171
163
|
var sha256hashShort = function (input) {
|
|
172
164
|
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;AAsC5F,yCAAyD;AAEzD,UAAU;AAEG,QAAA,kBAAkB,GAAyB;IACtD,uBAAuB,EAAE,UAAU;IACnC,yBAAyB,EAAE,UAAU;IACrC,WAAW,EAAE,UAAU;CACxB,CAAA;AAEY,QAAA,qBAAqB,yBAC7B,0BAAkB,KACrB,sBAAsB,EAAE,UAAU,EAClC,wBAAwB,EAAE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,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,25 +0,0 @@
|
|
|
1
|
-
import { ExtendedPublicKey, PublicKey } from '../../../types/key';
|
|
2
|
-
import { _OnlineProtocol } from '../../protocol';
|
|
3
|
-
export declare type WalletConnectExtension<T extends _OnlineProtocol> = T extends _OnlineProtocol<any, any, any, any, any, any, any, any, any, infer _PublicKey> ? WalletConnectProtocol<_PublicKey> : never;
|
|
4
|
-
export interface WalletConnectRequest {
|
|
5
|
-
from?: string;
|
|
6
|
-
to?: string;
|
|
7
|
-
data?: string;
|
|
8
|
-
gasLimit?: string;
|
|
9
|
-
gasPrice?: string;
|
|
10
|
-
value?: string;
|
|
11
|
-
nonce?: string;
|
|
12
|
-
}
|
|
13
|
-
export interface WalletConnectTransaction {
|
|
14
|
-
to: string;
|
|
15
|
-
data?: string;
|
|
16
|
-
gasLimit: string;
|
|
17
|
-
gasPrice: string;
|
|
18
|
-
value: string;
|
|
19
|
-
nonce: string;
|
|
20
|
-
chainId: number;
|
|
21
|
-
}
|
|
22
|
-
export interface WalletConnectProtocol<_PublicKey extends PublicKey | ExtendedPublicKey = PublicKey | ExtendedPublicKey> {
|
|
23
|
-
getWalletConnectChainId(): Promise<number>;
|
|
24
|
-
prepareWalletConnectTransactionWithPublicKey(publicKey: _PublicKey, request: WalletConnectRequest): Promise<WalletConnectTransaction>;
|
|
25
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"WalletConnectProtocol.js","sourceRoot":"","sources":["../../../../src/protocol/extensions/dapp/WalletConnectProtocol.ts"],"names":[],"mappings":""}
|