@airgap/module-kit 0.13.8-beta.4 → 0.13.8-beta.6
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/airgap-module-kit.min.js +7 -3
- package/index.d.ts +2 -2
- package/index.js +3 -1
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/protocol/extensions/bip/Bip32Extension.d.ts +1 -0
- package/types/protocol.d.ts +6 -11
- package/types/transaction.d.ts +1 -0
- package/utils/protocol.d.ts +2 -0
- package/utils/protocol.js +4 -2
- package/utils/protocol.js.map +1 -1
package/airgap-module-kit.min.js
CHANGED
|
@@ -29716,7 +29716,7 @@ exports.newPlainUIText = newPlainUIText;
|
|
|
29716
29716
|
},{}],196:[function(require,module,exports){
|
|
29717
29717
|
"use strict";
|
|
29718
29718
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29719
|
-
exports.normalizeToUndefined = exports.protocolNetworkIdentifier = exports.isTransactionStatusChecker = exports.hasConfigurableTransactionInjector = exports.canSignMessage = exports.canEncryptAsymmetric = exports.canEncryptAES = exports.hasConfigurableContract = exports.hasMultiAddressPublicKeys = exports.canFetchDataForMultipleAddresses = exports.isMultiTokenSubProtocol = exports.isSingleTokenSubProtocol = exports.isSubProtocol = exports.isBip32Protocol = 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;
|
|
29719
|
+
exports.normalizeToUndefined = exports.protocolNetworkIdentifier = exports.isTransactionStatusChecker = exports.hasConfigurableTransactionInjector = exports.canSignMessage = exports.canEncryptAsymmetric = exports.canEncryptAES = exports.hasConfigurableContract = exports.hasMultiAddressPublicKeys = exports.canFetchDataForMultipleAddresses = 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;
|
|
29720
29720
|
var amount_1 = require("./factories/amount");
|
|
29721
29721
|
Object.defineProperty(exports, "newAmount", { enumerable: true, get: function () { return amount_1.newAmount; } });
|
|
29722
29722
|
var key_1 = require("./factories/key");
|
|
@@ -29762,6 +29762,8 @@ Object.defineProperty(exports, "hasConfigurableTransactionInjector", { enumerabl
|
|
|
29762
29762
|
Object.defineProperty(exports, "hasMultiAddressPublicKeys", { enumerable: true, get: function () { return protocol_1.hasMultiAddressPublicKeys; } });
|
|
29763
29763
|
Object.defineProperty(exports, "isBip32Protocol", { enumerable: true, get: function () { return protocol_1.isBip32Protocol; } });
|
|
29764
29764
|
Object.defineProperty(exports, "isMultiTokenSubProtocol", { enumerable: true, get: function () { return protocol_1.isMultiTokenSubProtocol; } });
|
|
29765
|
+
Object.defineProperty(exports, "isOfflineProtocol", { enumerable: true, get: function () { return protocol_1.isOfflineProtocol; } });
|
|
29766
|
+
Object.defineProperty(exports, "isOnlineProtocol", { enumerable: true, get: function () { return protocol_1.isOnlineProtocol; } });
|
|
29765
29767
|
Object.defineProperty(exports, "isSingleTokenSubProtocol", { enumerable: true, get: function () { return protocol_1.isSingleTokenSubProtocol; } });
|
|
29766
29768
|
Object.defineProperty(exports, "isSubProtocol", { enumerable: true, get: function () { return protocol_1.isSubProtocol; } });
|
|
29767
29769
|
Object.defineProperty(exports, "isTransactionStatusChecker", { enumerable: true, get: function () { return protocol_1.isTransactionStatusChecker; } });
|
|
@@ -29939,7 +29941,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
29939
29941
|
return __assign.apply(this, arguments);
|
|
29940
29942
|
};
|
|
29941
29943
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29942
|
-
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 = void 0;
|
|
29944
|
+
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;
|
|
29943
29945
|
// @ts-ignore
|
|
29944
29946
|
var createHash = require("@airgap/coinlib-core/dependencies/src/create-hash-1.2.0/index");
|
|
29945
29947
|
var interface_1 = require("./interface");
|
|
@@ -29952,7 +29954,7 @@ var baseProtocolSchema = {
|
|
|
29952
29954
|
var offlineProtocolSchema = __assign(__assign({}, baseProtocolSchema), { getKeyPairFromSecret: 'required', signTransactionWithSecretKey: 'required' });
|
|
29953
29955
|
var onlineProtocolSchema = __assign(__assign({}, baseProtocolSchema), { broadcastTransaction: 'required', getBalanceOfPublicKey: 'required', getNetwork: 'required', getTransactionFeeWithPublicKey: 'required', getTransactionMaxAmountWithPublicKey: 'required', getTransactionsForPublicKey: 'required', prepareTransactionWithPublicKey: 'required' });
|
|
29954
29956
|
var bip32BaseProtocolSchema = __assign(__assign({}, baseProtocolSchema), { deriveFromExtendedPublicKey: 'required' });
|
|
29955
|
-
var bip32OfflineProtocolSchema = __assign(__assign(__assign({}, bip32BaseProtocolSchema), offlineProtocolSchema), { getExtendedKeyPairFromSecret: 'required' });
|
|
29957
|
+
var bip32OfflineProtocolSchema = __assign(__assign(__assign({}, bip32BaseProtocolSchema), offlineProtocolSchema), { getExtendedKeyPairFromSecret: 'required', deriveFromExtendedSecretKey: 'required' });
|
|
29956
29958
|
var bip32OnlineProtocolSchema = __assign(__assign({}, bip32BaseProtocolSchema), onlineProtocolSchema);
|
|
29957
29959
|
var subProtocolSchema = {
|
|
29958
29960
|
getType: 'required',
|
|
@@ -30000,9 +30002,11 @@ var transactionStatusCheckerSchema = {
|
|
|
30000
30002
|
function isOfflineProtocol(object) {
|
|
30001
30003
|
return (0, interface_1.implementsInterface)(object, offlineProtocolSchema);
|
|
30002
30004
|
}
|
|
30005
|
+
exports.isOfflineProtocol = isOfflineProtocol;
|
|
30003
30006
|
function isOnlineProtocol(object) {
|
|
30004
30007
|
return (0, interface_1.implementsInterface)(object, onlineProtocolSchema);
|
|
30005
30008
|
}
|
|
30009
|
+
exports.isOnlineProtocol = isOnlineProtocol;
|
|
30006
30010
|
function isOfflineBip32Protocol(protocol) {
|
|
30007
30011
|
return (0, interface_1.implementsInterface)(protocol, bip32OfflineProtocolSchema);
|
|
30008
30012
|
}
|
package/index.d.ts
CHANGED
|
@@ -42,11 +42,11 @@ import { implementsInterface, Schema } from './utils/interface';
|
|
|
42
42
|
import { isAnyKey, isExtendedPublicKey, isExtendedSecretKey, isPublicKey, isSecretKey } from './utils/key';
|
|
43
43
|
import { createSupportedProtocols } from './utils/module';
|
|
44
44
|
import { normalizeToUndefined } from './utils/normalize';
|
|
45
|
-
import { canEncryptAES, canEncryptAsymmetric, canFetchDataForMultipleAddresses, canSignMessage, hasConfigurableContract, hasConfigurableTransactionInjector, hasMultiAddressPublicKeys, isBip32Protocol, isMultiTokenSubProtocol, isSingleTokenSubProtocol, isSubProtocol, isTransactionStatusChecker, protocolNetworkIdentifier } from './utils/protocol';
|
|
45
|
+
import { canEncryptAES, canEncryptAsymmetric, canFetchDataForMultipleAddresses, canSignMessage, hasConfigurableContract, hasConfigurableTransactionInjector, hasMultiAddressPublicKeys, isBip32Protocol, isMultiTokenSubProtocol, isOfflineProtocol, isOnlineProtocol, isSingleTokenSubProtocol, isSubProtocol, isTransactionStatusChecker, protocolNetworkIdentifier } from './utils/protocol';
|
|
46
46
|
export { AirGapBlockExplorer, BlockExplorerMetadata };
|
|
47
47
|
export { newSuccessUIAlert, newInfoUIAlert, newWarningUIAlert, newErrorUIAlert, newPlainUIText, newAmount, newSecretKey, newExtendedSecretKey, newPublicKey, newExtendedPublicKey, newSignature, newUnsignedTransaction, newSignedTransaction };
|
|
48
48
|
export { AirGapModule, ModuleNetworkRegistry, ProtocolConfiguration, OfflineProtocolConfiguration, OnlineProtocolConfiguration, FullProtocolConfiguration };
|
|
49
49
|
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, ProtocolNetworkType, ProtocolNetwork, SubProtocolType };
|
|
50
50
|
export { AirGapInterface };
|
|
51
51
|
export { AirGapUIAction, AirGapUIAlert, AirGapUIText, Address, AddressCursor, AddressWithCursor, Amount, Balance, MultiTokenBalanceConfiguration, BytesStringFormat, BytesString, HexString, FeeDefaults, FeeEstimation, KeyType, SecretKey, ExtendedSecretKey, PublicKey, ExtendedPublicKey, KeyPair, ExtendedKeyPair, SecretType, MnemonicSecret, HexSecret, Secret, Signature, TransactionType, UnsignedTransaction, SignedTransaction, AirGapTransaction, TransactionCursor, AirGapTransactionsWithCursor, TransactionDetails, TransactionConfiguration, AirGapTransactionStatus, RecursivePartial };
|
|
52
|
-
export { isAmount, Schema, implementsInterface, isAnyKey, isSecretKey, isExtendedSecretKey, isPublicKey, isExtendedPublicKey, createSupportedProtocols, isBip32Protocol, isSubProtocol, isSingleTokenSubProtocol, isMultiTokenSubProtocol, canFetchDataForMultipleAddresses, hasMultiAddressPublicKeys, hasConfigurableContract, canEncryptAES, canEncryptAsymmetric, canSignMessage, hasConfigurableTransactionInjector, isTransactionStatusChecker, protocolNetworkIdentifier, normalizeToUndefined };
|
|
52
|
+
export { isAmount, Schema, implementsInterface, isAnyKey, isSecretKey, isExtendedSecretKey, isPublicKey, isExtendedPublicKey, createSupportedProtocols, isOfflineProtocol, isOnlineProtocol, isBip32Protocol, isSubProtocol, isSingleTokenSubProtocol, isMultiTokenSubProtocol, canFetchDataForMultipleAddresses, hasMultiAddressPublicKeys, hasConfigurableContract, canEncryptAES, canEncryptAsymmetric, canSignMessage, hasConfigurableTransactionInjector, isTransactionStatusChecker, protocolNetworkIdentifier, normalizeToUndefined };
|
package/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.normalizeToUndefined = exports.protocolNetworkIdentifier = exports.isTransactionStatusChecker = exports.hasConfigurableTransactionInjector = exports.canSignMessage = exports.canEncryptAsymmetric = exports.canEncryptAES = exports.hasConfigurableContract = exports.hasMultiAddressPublicKeys = exports.canFetchDataForMultipleAddresses = exports.isMultiTokenSubProtocol = exports.isSingleTokenSubProtocol = exports.isSubProtocol = exports.isBip32Protocol = 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;
|
|
3
|
+
exports.normalizeToUndefined = exports.protocolNetworkIdentifier = exports.isTransactionStatusChecker = exports.hasConfigurableTransactionInjector = exports.canSignMessage = exports.canEncryptAsymmetric = exports.canEncryptAES = exports.hasConfigurableContract = exports.hasMultiAddressPublicKeys = exports.canFetchDataForMultipleAddresses = 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;
|
|
4
4
|
var amount_1 = require("./factories/amount");
|
|
5
5
|
Object.defineProperty(exports, "newAmount", { enumerable: true, get: function () { return amount_1.newAmount; } });
|
|
6
6
|
var key_1 = require("./factories/key");
|
|
@@ -46,6 +46,8 @@ Object.defineProperty(exports, "hasConfigurableTransactionInjector", { enumerabl
|
|
|
46
46
|
Object.defineProperty(exports, "hasMultiAddressPublicKeys", { enumerable: true, get: function () { return protocol_1.hasMultiAddressPublicKeys; } });
|
|
47
47
|
Object.defineProperty(exports, "isBip32Protocol", { enumerable: true, get: function () { return protocol_1.isBip32Protocol; } });
|
|
48
48
|
Object.defineProperty(exports, "isMultiTokenSubProtocol", { enumerable: true, get: function () { return protocol_1.isMultiTokenSubProtocol; } });
|
|
49
|
+
Object.defineProperty(exports, "isOfflineProtocol", { enumerable: true, get: function () { return protocol_1.isOfflineProtocol; } });
|
|
50
|
+
Object.defineProperty(exports, "isOnlineProtocol", { enumerable: true, get: function () { return protocol_1.isOnlineProtocol; } });
|
|
49
51
|
Object.defineProperty(exports, "isSingleTokenSubProtocol", { enumerable: true, get: function () { return protocol_1.isSingleTokenSubProtocol; } });
|
|
50
52
|
Object.defineProperty(exports, "isSubProtocol", { enumerable: true, get: function () { return protocol_1.isSubProtocol; } });
|
|
51
53
|
Object.defineProperty(exports, "isTransactionStatusChecker", { enumerable: true, get: function () { return protocol_1.isTransactionStatusChecker; } });
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AACA,6CAA8C;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AACA,6CAA8C;AAmG5C,0FAnGO,kBAAS,OAmGP;AAlGX,uCAAwG;AAsGtG,qGAtGO,0BAAoB,OAsGP;AAFpB,qGApG6B,0BAAoB,OAoG7B;AACpB,6FArGmD,kBAAY,OAqGnD;AAFZ,6FAnGiE,kBAAY,OAmGjE;AAlGd,mDAAoD;AAsGlD,6FAtGO,wBAAY,OAsGP;AArGd,uDAAsF;AAuGpF,qGAvGO,kCAAoB,OAuGP;AADpB,uGAtG6B,oCAAsB,OAsG7B;AArGxB,8CAA4G;AA6F1G,gGA7FO,uBAAe,OA6FP;AAFf,+FA3FwB,sBAAc,OA2FxB;AADd,kGA1FwC,yBAAiB,OA0FxC;AAEjB,kGA5F2D,yBAAiB,OA4F3D;AA3FnB,4CAAoD;AA6FlD,+FA7FO,qBAAc,OA6FP;AA3FhB,4EAAwE;AA0GtE,sGA1GO,+CAAqB,OA0GP;AAjDvB,yCAAyC;AA4IvC,yFA5IO,iBAAQ,OA4IP;AA3IV,+CAA+D;AA6I7D,oGA7IO,+BAAmB,OA6IP;AA5IrB,mCAA0G;AA6IxG,yFA7IO,cAAQ,OA6IP;AAIR,oGAjJiB,yBAAmB,OAiJjB;AAFnB,oGA/IsC,yBAAmB,OA+ItC;AACnB,4FAhJ2D,iBAAW,OAgJ3D;AAFX,4FA9IwE,iBAAW,OA8IxE;AA7Ib,yCAAyD;AAiJvD,yGAjJO,iCAAwB,OAiJP;AAhJ1B,+CAAwD;AAgKtD,qGAhKO,gCAAoB,OAgKP;AA/JtB,6CAgByB;AAyIvB,8FAxJA,wBAAa,OAwJA;AACb,qGAxJA,+BAAoB,OAwJA;AAJpB,iHAnJA,2CAAgC,OAmJA;AAKhC,+FAvJA,yBAAc,OAuJA;AAHd,wGAnJA,kCAAuB,OAmJA;AAIvB,mHAtJA,6CAAkC,OAsJA;AALlC,0GAhJA,oCAAyB,OAgJA;AALzB,gGA1IA,0BAAe,OA0IA;AAGf,wGA5IA,kCAAuB,OA4IA;AALvB,kGAtIA,4BAAiB,OAsIA;AACjB,iGAtIA,2BAAgB,OAsIA;AAGhB,yGAxIA,mCAAwB,OAwIA;AADxB,8FAtIA,wBAAa,OAsIA;AAUb,2GA/IA,qCAA0B,OA+IA;AAC1B,0GA/IA,oCAAyB,OA+IA"}
|
package/package.json
CHANGED
|
@@ -9,6 +9,7 @@ export interface BaseBip32Protocol<_AddressCursor extends BaseGeneric['AddressCu
|
|
|
9
9
|
}
|
|
10
10
|
export interface OfflineBip32Protocol<_AddressCursor extends OfflineGeneric['AddressCursor'] = OfflineGeneric['AddressCursor'], _AddressResult extends OfflineGeneric['AddressResult'] = OfflineGeneric['AddressResult'], _Units extends OfflineGeneric['Units'] = OfflineGeneric['Units'], _FeeUnits extends OfflineGeneric['FeeUnits'] = OfflineGeneric['FeeUnits'], _SignedTransaction extends OfflineGeneric['SignedTransaction'] = OfflineGeneric['SignedTransaction'], _UnsignedTransaction extends OfflineGeneric['UnsignedTransaction'] = OfflineGeneric['UnsignedTransaction']> extends BaseBip32Protocol<_AddressCursor, _AddressResult, _Units, _FeeUnits, _SignedTransaction, _UnsignedTransaction>, _OfflineProtocol<_AddressCursor, _AddressResult, _Units, _FeeUnits, _SignedTransaction, _UnsignedTransaction, PublicKey | ExtendedPublicKey, SecretKey | ExtendedSecretKey, KeyPair | ExtendedKeyPair> {
|
|
11
11
|
getExtendedKeyPairFromSecret(secret: Secret, derivationPath?: string): Promise<ExtendedKeyPair>;
|
|
12
|
+
deriveFromExtendedSecretKey(extendedSecretKey: ExtendedSecretKey, visibilityIndex: number, addressIndex: number): Promise<SecretKey>;
|
|
12
13
|
}
|
|
13
14
|
export interface OnlineBip32Protocol<_AddressCursor extends OnlineGeneric['AddressCursor'] = OnlineGeneric['AddressCursor'], _AddressResult extends OnlineGeneric['AddressResult'] = OnlineGeneric['AddressResult'], _ProtocolNetwork extends OnlineGeneric['ProtocolNetwork'] = OnlineGeneric['ProtocolNetwork'], _Units extends OnlineGeneric['Units'] = OnlineGeneric['Units'], _FeeUnits extends OnlineGeneric['FeeUnits'] = OnlineGeneric['FeeUnits'], _FeeEstimation extends OnlineGeneric['FeeEstimation'] = OnlineGeneric['FeeEstimation'], _SignedTransaction extends OnlineGeneric['SignedTransaction'] = OnlineGeneric['SignedTransaction'], _UnsignedTransaction extends OnlineGeneric['UnsignedTransaction'] = OnlineGeneric['UnsignedTransaction'], _TransactionCursor extends OnlineGeneric['TransactionCursor'] = OnlineGeneric['TransactionCursor'], _BalanceConfiguration extends Object | undefined = undefined> extends BaseBip32Protocol<_AddressCursor, _AddressResult, _Units, _FeeUnits, _SignedTransaction, _UnsignedTransaction>, _OnlineProtocol<_AddressCursor, _AddressResult, _ProtocolNetwork, _Units, _FeeUnits, _FeeEstimation, _SignedTransaction, _UnsignedTransaction, _TransactionCursor, PublicKey | ExtendedPublicKey, _BalanceConfiguration> {
|
|
14
15
|
}
|
package/types/protocol.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Amount } from './amount';
|
|
2
2
|
import { FeeDefaults } from './fee';
|
|
3
|
-
export interface ProtocolMetadata<_Units extends string, _FeeUnits extends string = _Units> {
|
|
3
|
+
export interface ProtocolMetadata<_Units extends string = string, _FeeUnits extends string = _Units> {
|
|
4
4
|
name: string;
|
|
5
5
|
identifier: string;
|
|
6
6
|
units: ProtocolUnitsMetadata<_Units>;
|
|
@@ -9,7 +9,7 @@ export interface ProtocolMetadata<_Units extends string, _FeeUnits extends strin
|
|
|
9
9
|
account?: ProtocolAccountMetadata;
|
|
10
10
|
transaction?: ProtocolTransactionMetadata<_Units>;
|
|
11
11
|
}
|
|
12
|
-
export declare type ProtocolUnitsMetadata<_Units extends string> = {
|
|
12
|
+
export declare type ProtocolUnitsMetadata<_Units extends string = string> = {
|
|
13
13
|
[key in _Units]: {
|
|
14
14
|
symbol: ProtocolSymbol;
|
|
15
15
|
decimals: number;
|
|
@@ -19,15 +19,11 @@ export interface ProtocolSymbol {
|
|
|
19
19
|
value: string;
|
|
20
20
|
market?: string;
|
|
21
21
|
}
|
|
22
|
-
interface
|
|
23
|
-
units: ProtocolUnitsMetadata<_FeeUnits>;
|
|
24
|
-
mainUnit: _FeeUnits;
|
|
22
|
+
export interface ProtocolFeeMetadata<_FeeUnits extends string = string> {
|
|
25
23
|
defaults?: FeeDefaults<_FeeUnits>;
|
|
24
|
+
units?: ProtocolUnitsMetadata<_FeeUnits>;
|
|
25
|
+
mainUnit?: _FeeUnits;
|
|
26
26
|
}
|
|
27
|
-
interface ProtocolFeeMetadataWithoutUnits<_FeeUnits extends string> {
|
|
28
|
-
defaults?: FeeDefaults<_FeeUnits>;
|
|
29
|
-
}
|
|
30
|
-
export declare type ProtocolFeeMetadata<_FeeUnits extends string> = ProtocolFeeMetadataWithoutUnits<_FeeUnits> | ProtocolFeeMetadataWithUnits<_FeeUnits>;
|
|
31
27
|
export interface ProtocolAccountMetadata {
|
|
32
28
|
standardDerivationPath?: string;
|
|
33
29
|
address?: {
|
|
@@ -36,7 +32,7 @@ export interface ProtocolAccountMetadata {
|
|
|
36
32
|
regex?: string;
|
|
37
33
|
};
|
|
38
34
|
}
|
|
39
|
-
export interface ProtocolTransactionMetadata<_Units extends string> {
|
|
35
|
+
export interface ProtocolTransactionMetadata<_Units extends string = string> {
|
|
40
36
|
arbitraryData?: ProtocolTransactionArbitraryDataMetadata | {
|
|
41
37
|
root?: ProtocolTransactionArbitraryDataMetadata;
|
|
42
38
|
inner?: ProtocolTransactionArbitraryDataMetadata;
|
|
@@ -57,4 +53,3 @@ export interface ProtocolNetwork {
|
|
|
57
53
|
type: ProtocolNetworkType;
|
|
58
54
|
rpcUrl: string;
|
|
59
55
|
}
|
|
60
|
-
export {};
|
package/types/transaction.d.ts
CHANGED
|
@@ -28,6 +28,7 @@ export interface AirGapTransaction<_Units extends string = string, _FeeUnits ext
|
|
|
28
28
|
uiAlerts?: AirGapUIAlert[];
|
|
29
29
|
arbitraryData?: string | [AirGapUIText, string];
|
|
30
30
|
json?: any;
|
|
31
|
+
extra?: any;
|
|
31
32
|
}
|
|
32
33
|
export interface TransactionCursor extends BaseCursor {
|
|
33
34
|
}
|
package/utils/protocol.d.ts
CHANGED
|
@@ -13,6 +13,8 @@ import { ConfigurableTransactionInjectorProtocol } from '../protocol/extensions/
|
|
|
13
13
|
import { TransactionStatusCheckerExtension } from '../protocol/extensions/transaction/TransactionStatusCheckerExtension';
|
|
14
14
|
import { AnyProtocol, OfflineProtocol, OnlineProtocol } from '../protocol/protocol';
|
|
15
15
|
import { ProtocolNetwork } from '../types/protocol';
|
|
16
|
+
export declare function isOfflineProtocol(object: AnyProtocol): object is OfflineProtocol;
|
|
17
|
+
export declare function isOnlineProtocol(object: AnyProtocol): object is OnlineProtocol;
|
|
16
18
|
export declare function isBip32Protocol<T extends AnyProtocol>(protocol: T): protocol is T & Bip32Extension<T>;
|
|
17
19
|
export declare function isSubProtocol<T extends AnyProtocol>(protocol: T): protocol is T & SubProtocol;
|
|
18
20
|
export declare function isSingleTokenSubProtocol<T extends AnyProtocol>(protocol: T): protocol is T & SingleTokenSubProtocolExtension<T>;
|
package/utils/protocol.js
CHANGED
|
@@ -11,7 +11,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.protocolNetworkIdentifier = exports.isTransactionStatusChecker = exports.hasConfigurableTransactionInjector = exports.canSignMessage = exports.canEncryptAsymmetric = exports.canEncryptAES = exports.hasConfigurableContract = exports.hasMultiAddressPublicKeys = exports.canFetchDataForMultipleAddresses = exports.canFetchDataForAddress = exports.isMultiTokenSubProtocol = exports.isSingleTokenSubProtocol = exports.isSubProtocol = exports.isBip32Protocol = void 0;
|
|
14
|
+
exports.protocolNetworkIdentifier = exports.isTransactionStatusChecker = exports.hasConfigurableTransactionInjector = exports.canSignMessage = exports.canEncryptAsymmetric = exports.canEncryptAES = exports.hasConfigurableContract = exports.hasMultiAddressPublicKeys = exports.canFetchDataForMultipleAddresses = exports.canFetchDataForAddress = exports.isMultiTokenSubProtocol = exports.isSingleTokenSubProtocol = exports.isSubProtocol = exports.isBip32Protocol = exports.isOnlineProtocol = exports.isOfflineProtocol = 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");
|
|
@@ -24,7 +24,7 @@ var baseProtocolSchema = {
|
|
|
24
24
|
var offlineProtocolSchema = __assign(__assign({}, baseProtocolSchema), { getKeyPairFromSecret: 'required', signTransactionWithSecretKey: 'required' });
|
|
25
25
|
var onlineProtocolSchema = __assign(__assign({}, baseProtocolSchema), { broadcastTransaction: 'required', getBalanceOfPublicKey: 'required', getNetwork: 'required', getTransactionFeeWithPublicKey: 'required', getTransactionMaxAmountWithPublicKey: 'required', getTransactionsForPublicKey: 'required', prepareTransactionWithPublicKey: 'required' });
|
|
26
26
|
var bip32BaseProtocolSchema = __assign(__assign({}, baseProtocolSchema), { deriveFromExtendedPublicKey: 'required' });
|
|
27
|
-
var bip32OfflineProtocolSchema = __assign(__assign(__assign({}, bip32BaseProtocolSchema), offlineProtocolSchema), { getExtendedKeyPairFromSecret: 'required' });
|
|
27
|
+
var bip32OfflineProtocolSchema = __assign(__assign(__assign({}, bip32BaseProtocolSchema), offlineProtocolSchema), { getExtendedKeyPairFromSecret: 'required', deriveFromExtendedSecretKey: 'required' });
|
|
28
28
|
var bip32OnlineProtocolSchema = __assign(__assign({}, bip32BaseProtocolSchema), onlineProtocolSchema);
|
|
29
29
|
var subProtocolSchema = {
|
|
30
30
|
getType: 'required',
|
|
@@ -72,9 +72,11 @@ var transactionStatusCheckerSchema = {
|
|
|
72
72
|
function isOfflineProtocol(object) {
|
|
73
73
|
return (0, interface_1.implementsInterface)(object, offlineProtocolSchema);
|
|
74
74
|
}
|
|
75
|
+
exports.isOfflineProtocol = isOfflineProtocol;
|
|
75
76
|
function isOnlineProtocol(object) {
|
|
76
77
|
return (0, interface_1.implementsInterface)(object, onlineProtocolSchema);
|
|
77
78
|
}
|
|
79
|
+
exports.isOnlineProtocol = isOnlineProtocol;
|
|
78
80
|
function isOfflineBip32Protocol(protocol) {
|
|
79
81
|
return (0, interface_1.implementsInterface)(protocol, bip32OfflineProtocolSchema);
|
|
80
82
|
}
|
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,0FAA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