@airgap/module-kit 0.13.8-beta.7 → 0.13.8-beta.8
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 -44
- package/index.d.ts +3 -8
- package/index.js +1 -5
- package/index.js.map +1 -1
- package/module/module.d.ts +9 -18
- package/package.json +2 -3
- package/protocol/extensions/bip/Bip32Extension.d.ts +0 -1
- package/protocol/extensions/sub-protocol/SubProtocolExtension.d.ts +0 -1
- package/types/airgap.d.ts +2 -2
- package/types/protocol.d.ts +11 -6
- package/types/transaction.d.ts +0 -1
- package/utils/protocol.d.ts +0 -2
- package/utils/protocol.js +3 -6
- package/utils/protocol.js.map +1 -1
- package/serializer/serializer.d.ts +0 -12
- package/serializer/serializer.js +0 -3
- package/serializer/serializer.js.map +0 -1
- package/types/module.d.ts +0 -14
- package/types/module.js +0 -3
- package/types/module.js.map +0 -1
- package/types/serializer.d.ts +0 -6
- package/types/serializer.js +0 -3
- package/types/serializer.js.map +0 -1
- package/utils/module.d.ts +0 -4
- package/utils/module.js +0 -29
- package/utils/module.js.map +0 -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.
|
|
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.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");
|
|
@@ -29748,8 +29748,6 @@ Object.defineProperty(exports, "isExtendedPublicKey", { enumerable: true, get: f
|
|
|
29748
29748
|
Object.defineProperty(exports, "isExtendedSecretKey", { enumerable: true, get: function () { return key_2.isExtendedSecretKey; } });
|
|
29749
29749
|
Object.defineProperty(exports, "isPublicKey", { enumerable: true, get: function () { return key_2.isPublicKey; } });
|
|
29750
29750
|
Object.defineProperty(exports, "isSecretKey", { enumerable: true, get: function () { return key_2.isSecretKey; } });
|
|
29751
|
-
var module_1 = require("./utils/module");
|
|
29752
|
-
Object.defineProperty(exports, "createSupportedProtocols", { enumerable: true, get: function () { return module_1.createSupportedProtocols; } });
|
|
29753
29751
|
var normalize_1 = require("./utils/normalize");
|
|
29754
29752
|
Object.defineProperty(exports, "normalizeToUndefined", { enumerable: true, get: function () { return normalize_1.normalizeToUndefined; } });
|
|
29755
29753
|
var protocol_1 = require("./utils/protocol");
|
|
@@ -29762,14 +29760,12 @@ Object.defineProperty(exports, "hasConfigurableTransactionInjector", { enumerabl
|
|
|
29762
29760
|
Object.defineProperty(exports, "hasMultiAddressPublicKeys", { enumerable: true, get: function () { return protocol_1.hasMultiAddressPublicKeys; } });
|
|
29763
29761
|
Object.defineProperty(exports, "isBip32Protocol", { enumerable: true, get: function () { return protocol_1.isBip32Protocol; } });
|
|
29764
29762
|
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; } });
|
|
29767
29763
|
Object.defineProperty(exports, "isSingleTokenSubProtocol", { enumerable: true, get: function () { return protocol_1.isSingleTokenSubProtocol; } });
|
|
29768
29764
|
Object.defineProperty(exports, "isSubProtocol", { enumerable: true, get: function () { return protocol_1.isSubProtocol; } });
|
|
29769
29765
|
Object.defineProperty(exports, "isTransactionStatusChecker", { enumerable: true, get: function () { return protocol_1.isTransactionStatusChecker; } });
|
|
29770
29766
|
Object.defineProperty(exports, "protocolNetworkIdentifier", { enumerable: true, get: function () { return protocol_1.protocolNetworkIdentifier; } });
|
|
29771
29767
|
|
|
29772
|
-
},{"./factories/amount":190,"./factories/key":191,"./factories/signature":192,"./factories/transaction":193,"./factories/ui/alert":194,"./factories/ui/text":195,"./module/module-network-registry":197,"./utils/amount":199,"./utils/interface":200,"./utils/key":201,"./utils/
|
|
29768
|
+
},{"./factories/amount":190,"./factories/key":191,"./factories/signature":192,"./factories/transaction":193,"./factories/ui/alert":194,"./factories/ui/text":195,"./module/module-network-registry":197,"./utils/amount":199,"./utils/interface":200,"./utils/key":201,"./utils/normalize":202,"./utils/protocol":203}],197:[function(require,module,exports){
|
|
29773
29769
|
"use strict";
|
|
29774
29770
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29775
29771
|
exports.ModuleNetworkRegistry = void 0;
|
|
@@ -29792,7 +29788,7 @@ var ModuleNetworkRegistry = /** @class */ (function () {
|
|
|
29792
29788
|
}());
|
|
29793
29789
|
exports.ModuleNetworkRegistry = ModuleNetworkRegistry;
|
|
29794
29790
|
|
|
29795
|
-
},{"../utils/protocol":
|
|
29791
|
+
},{"../utils/protocol":203}],198:[function(require,module,exports){
|
|
29796
29792
|
"use strict";
|
|
29797
29793
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
29798
29794
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -29891,43 +29887,13 @@ exports.isExtendedPublicKey = isExtendedPublicKey;
|
|
|
29891
29887
|
},{"./interface":200}],202:[function(require,module,exports){
|
|
29892
29888
|
"use strict";
|
|
29893
29889
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29894
|
-
exports.createSupportedProtocols = void 0;
|
|
29895
|
-
function createSupportedProtocols(online, offline) {
|
|
29896
|
-
var onlineIdentifiers = new Set(Object.keys(online));
|
|
29897
|
-
var offlineIdentifiers = offline ? new Set(offline) : onlineIdentifiers;
|
|
29898
|
-
var identifiers = new Set(Array.from(onlineIdentifiers).concat(Array.from(onlineIdentifiers)));
|
|
29899
|
-
return Array.from(identifiers).reduce(function (obj, next) {
|
|
29900
|
-
var _a;
|
|
29901
|
-
var offlineConfiguration = offlineIdentifiers.has(next) ? { type: 'offline' } : undefined;
|
|
29902
|
-
var onlineConfiguration = online[next]
|
|
29903
|
-
? createOnlineProtocolConfiguration(online[next])
|
|
29904
|
-
: undefined;
|
|
29905
|
-
var configuration = offlineConfiguration !== undefined && onlineConfiguration !== undefined
|
|
29906
|
-
? { type: 'full', offline: offlineConfiguration, online: onlineConfiguration }
|
|
29907
|
-
: (offlineConfiguration !== null && offlineConfiguration !== void 0 ? offlineConfiguration : onlineConfiguration);
|
|
29908
|
-
return Object.assign(obj, (_a = {}, _a[next] = configuration, _a));
|
|
29909
|
-
// tslint:disable-next-line: no-object-literal-type-assertion
|
|
29910
|
-
}, {});
|
|
29911
|
-
}
|
|
29912
|
-
exports.createSupportedProtocols = createSupportedProtocols;
|
|
29913
|
-
function createOnlineProtocolConfiguration(networks) {
|
|
29914
|
-
var _a;
|
|
29915
|
-
return {
|
|
29916
|
-
type: 'online',
|
|
29917
|
-
networks: (_a = networks.supportedNetworks) !== null && _a !== void 0 ? _a : networks
|
|
29918
|
-
};
|
|
29919
|
-
}
|
|
29920
|
-
|
|
29921
|
-
},{}],203:[function(require,module,exports){
|
|
29922
|
-
"use strict";
|
|
29923
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29924
29890
|
exports.normalizeToUndefined = void 0;
|
|
29925
29891
|
function normalizeToUndefined(value) {
|
|
29926
29892
|
return value !== null ? value : undefined;
|
|
29927
29893
|
}
|
|
29928
29894
|
exports.normalizeToUndefined = normalizeToUndefined;
|
|
29929
29895
|
|
|
29930
|
-
},{}],
|
|
29896
|
+
},{}],203:[function(require,module,exports){
|
|
29931
29897
|
"use strict";
|
|
29932
29898
|
var __assign = (this && this.__assign) || function () {
|
|
29933
29899
|
__assign = Object.assign || function(t) {
|
|
@@ -29941,7 +29907,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
29941
29907
|
return __assign.apply(this, arguments);
|
|
29942
29908
|
};
|
|
29943
29909
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
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 =
|
|
29910
|
+
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;
|
|
29945
29911
|
// @ts-ignore
|
|
29946
29912
|
var createHash = require("@airgap/coinlib-core/dependencies/src/create-hash-1.2.0/index");
|
|
29947
29913
|
var interface_1 = require("./interface");
|
|
@@ -29954,11 +29920,10 @@ var baseProtocolSchema = {
|
|
|
29954
29920
|
var offlineProtocolSchema = __assign(__assign({}, baseProtocolSchema), { getKeyPairFromSecret: 'required', signTransactionWithSecretKey: 'required' });
|
|
29955
29921
|
var onlineProtocolSchema = __assign(__assign({}, baseProtocolSchema), { broadcastTransaction: 'required', getBalanceOfPublicKey: 'required', getNetwork: 'required', getTransactionFeeWithPublicKey: 'required', getTransactionMaxAmountWithPublicKey: 'required', getTransactionsForPublicKey: 'required', prepareTransactionWithPublicKey: 'required' });
|
|
29956
29922
|
var bip32BaseProtocolSchema = __assign(__assign({}, baseProtocolSchema), { deriveFromExtendedPublicKey: 'required' });
|
|
29957
|
-
var bip32OfflineProtocolSchema = __assign(__assign(__assign({}, bip32BaseProtocolSchema), offlineProtocolSchema), { getExtendedKeyPairFromSecret: 'required'
|
|
29923
|
+
var bip32OfflineProtocolSchema = __assign(__assign(__assign({}, bip32BaseProtocolSchema), offlineProtocolSchema), { getExtendedKeyPairFromSecret: 'required' });
|
|
29958
29924
|
var bip32OnlineProtocolSchema = __assign(__assign({}, bip32BaseProtocolSchema), onlineProtocolSchema);
|
|
29959
29925
|
var subProtocolSchema = {
|
|
29960
|
-
getType: 'required'
|
|
29961
|
-
mainProtocol: 'required'
|
|
29926
|
+
getType: 'required'
|
|
29962
29927
|
};
|
|
29963
29928
|
var singleTokenSubProtocolSchema = __assign(__assign({}, subProtocolSchema), { getContractAddress: 'required' });
|
|
29964
29929
|
var multiTokenSubProtocolBaseSchema = singleTokenSubProtocolSchema;
|
|
@@ -30002,11 +29967,9 @@ var transactionStatusCheckerSchema = {
|
|
|
30002
29967
|
function isOfflineProtocol(object) {
|
|
30003
29968
|
return (0, interface_1.implementsInterface)(object, offlineProtocolSchema);
|
|
30004
29969
|
}
|
|
30005
|
-
exports.isOfflineProtocol = isOfflineProtocol;
|
|
30006
29970
|
function isOnlineProtocol(object) {
|
|
30007
29971
|
return (0, interface_1.implementsInterface)(object, onlineProtocolSchema);
|
|
30008
29972
|
}
|
|
30009
|
-
exports.isOnlineProtocol = isOnlineProtocol;
|
|
30010
29973
|
function isOfflineBip32Protocol(protocol) {
|
|
30011
29974
|
return (0, interface_1.implementsInterface)(protocol, bip32OfflineProtocolSchema);
|
|
30012
29975
|
}
|
package/index.d.ts
CHANGED
|
@@ -19,7 +19,6 @@ import { SingleTokenSubProtocol, SingleTokenSubProtocolExtension } from './proto
|
|
|
19
19
|
import { SubProtocol, SubProtocolExtension } from './protocol/extensions/sub-protocol/SubProtocolExtension';
|
|
20
20
|
import { TransactionStatusCheckerExtension } from './protocol/extensions/transaction/TransactionStatusCheckerExtension';
|
|
21
21
|
import { AirGapAnyProtocol, AirGapOfflineProtocol, AirGapOnlineProtocol, AirGapProtocol } from './protocol/protocol';
|
|
22
|
-
import { AirGapV3SerializerCompanion } from './serializer/serializer';
|
|
23
22
|
import { Address, AddressCursor, AddressWithCursor } from './types/address';
|
|
24
23
|
import { AirGapInterface } from './types/airgap';
|
|
25
24
|
import { Amount } from './types/amount';
|
|
@@ -29,10 +28,8 @@ import { BytesString, BytesStringFormat, HexString } from './types/bytes';
|
|
|
29
28
|
import { FeeDefaults, FeeEstimation } from './types/fee';
|
|
30
29
|
import { ExtendedKeyPair, ExtendedPublicKey, ExtendedSecretKey, KeyPair, KeyType, PublicKey, SecretKey } from './types/key';
|
|
31
30
|
import { RecursivePartial } from './types/meta/utility-types';
|
|
32
|
-
import { FullProtocolConfiguration, OfflineProtocolConfiguration, OnlineProtocolConfiguration, ProtocolConfiguration } from './types/module';
|
|
33
31
|
import { ProtocolAccountMetadata, ProtocolFeeMetadata, ProtocolMetadata, ProtocolNetwork, ProtocolNetworkType, ProtocolSymbol, ProtocolUnitsMetadata } from './types/protocol';
|
|
34
32
|
import { HexSecret, MnemonicSecret, Secret, SecretType } from './types/secret';
|
|
35
|
-
import { V3SchemaConfiguration } from './types/serializer';
|
|
36
33
|
import { Signature } from './types/signature';
|
|
37
34
|
import { SubProtocolType } from './types/sub-protocol';
|
|
38
35
|
import { AirGapTransaction, AirGapTransactionStatus, AirGapTransactionsWithCursor, SignedTransaction, TransactionConfiguration, TransactionCursor, TransactionDetails, TransactionType, UnsignedTransaction } from './types/transaction';
|
|
@@ -42,14 +39,12 @@ import { AirGapUIText } from './types/ui/text';
|
|
|
42
39
|
import { isAmount } from './utils/amount';
|
|
43
40
|
import { implementsInterface, Schema } from './utils/interface';
|
|
44
41
|
import { isAnyKey, isExtendedPublicKey, isExtendedSecretKey, isPublicKey, isSecretKey } from './utils/key';
|
|
45
|
-
import { createSupportedProtocols } from './utils/module';
|
|
46
42
|
import { normalizeToUndefined } from './utils/normalize';
|
|
47
|
-
import { canEncryptAES, canEncryptAsymmetric, canFetchDataForMultipleAddresses, canSignMessage, hasConfigurableContract, hasConfigurableTransactionInjector, hasMultiAddressPublicKeys, isBip32Protocol, isMultiTokenSubProtocol,
|
|
43
|
+
import { canEncryptAES, canEncryptAsymmetric, canFetchDataForMultipleAddresses, canSignMessage, hasConfigurableContract, hasConfigurableTransactionInjector, hasMultiAddressPublicKeys, isBip32Protocol, isMultiTokenSubProtocol, isSingleTokenSubProtocol, isSubProtocol, isTransactionStatusChecker, protocolNetworkIdentifier } from './utils/protocol';
|
|
48
44
|
export { AirGapBlockExplorer, BlockExplorerMetadata };
|
|
49
45
|
export { newSuccessUIAlert, newInfoUIAlert, newWarningUIAlert, newErrorUIAlert, newPlainUIText, newAmount, newSecretKey, newExtendedSecretKey, newPublicKey, newExtendedPublicKey, newSignature, newUnsignedTransaction, newSignedTransaction };
|
|
50
|
-
export { AirGapModule, ModuleNetworkRegistry
|
|
46
|
+
export { AirGapModule, ModuleNetworkRegistry };
|
|
51
47
|
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 };
|
|
52
|
-
export { AirGapV3SerializerCompanion, V3SchemaConfiguration };
|
|
53
48
|
export { AirGapInterface };
|
|
54
49
|
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 };
|
|
55
|
-
export { isAmount, Schema, implementsInterface, isAnyKey, isSecretKey, isExtendedSecretKey, isPublicKey, isExtendedPublicKey,
|
|
50
|
+
export { isAmount, Schema, implementsInterface, isAnyKey, isSecretKey, isExtendedSecretKey, isPublicKey, isExtendedPublicKey, 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.
|
|
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.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");
|
|
@@ -32,8 +32,6 @@ Object.defineProperty(exports, "isExtendedPublicKey", { enumerable: true, get: f
|
|
|
32
32
|
Object.defineProperty(exports, "isExtendedSecretKey", { enumerable: true, get: function () { return key_2.isExtendedSecretKey; } });
|
|
33
33
|
Object.defineProperty(exports, "isPublicKey", { enumerable: true, get: function () { return key_2.isPublicKey; } });
|
|
34
34
|
Object.defineProperty(exports, "isSecretKey", { enumerable: true, get: function () { return key_2.isSecretKey; } });
|
|
35
|
-
var module_1 = require("./utils/module");
|
|
36
|
-
Object.defineProperty(exports, "createSupportedProtocols", { enumerable: true, get: function () { return module_1.createSupportedProtocols; } });
|
|
37
35
|
var normalize_1 = require("./utils/normalize");
|
|
38
36
|
Object.defineProperty(exports, "normalizeToUndefined", { enumerable: true, get: function () { return normalize_1.normalizeToUndefined; } });
|
|
39
37
|
var protocol_1 = require("./utils/protocol");
|
|
@@ -46,8 +44,6 @@ Object.defineProperty(exports, "hasConfigurableTransactionInjector", { enumerabl
|
|
|
46
44
|
Object.defineProperty(exports, "hasMultiAddressPublicKeys", { enumerable: true, get: function () { return protocol_1.hasMultiAddressPublicKeys; } });
|
|
47
45
|
Object.defineProperty(exports, "isBip32Protocol", { enumerable: true, get: function () { return protocol_1.isBip32Protocol; } });
|
|
48
46
|
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; } });
|
|
51
47
|
Object.defineProperty(exports, "isSingleTokenSubProtocol", { enumerable: true, get: function () { return protocol_1.isSingleTokenSubProtocol; } });
|
|
52
48
|
Object.defineProperty(exports, "isSubProtocol", { enumerable: true, get: function () { return protocol_1.isSubProtocol; } });
|
|
53
49
|
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;AA+F5C,0FA/FO,kBAAS,OA+FP;AA9FX,uCAAwG;AAkGtG,qGAlGO,0BAAoB,OAkGP;AAFpB,qGAhG6B,0BAAoB,OAgG7B;AACpB,6FAjGmD,kBAAY,OAiGnD;AAFZ,6FA/FiE,kBAAY,OA+FjE;AA9Fd,mDAAoD;AAkGlD,6FAlGO,wBAAY,OAkGP;AAjGd,uDAAsF;AAmGpF,qGAnGO,kCAAoB,OAmGP;AADpB,uGAlG6B,oCAAsB,OAkG7B;AAjGxB,8CAA4G;AAyF1G,gGAzFO,uBAAe,OAyFP;AAFf,+FAvFwB,sBAAc,OAuFxB;AADd,kGAtFwC,yBAAiB,OAsFxC;AAEjB,kGAxF2D,yBAAiB,OAwF3D;AAvFnB,4CAAoD;AAyFlD,+FAzFO,qBAAc,OAyFP;AAvFhB,4EAAwE;AAoGjD,sGApGd,+CAAqB,OAoGc;AA5C5C,yCAAyC;AAkIvC,yFAlIO,iBAAQ,OAkIP;AAjIV,+CAA+D;AAmI7D,oGAnIO,+BAAmB,OAmIP;AAlIrB,mCAA0G;AAmIxG,yFAnIO,cAAQ,OAmIP;AAIR,oGAvIiB,yBAAmB,OAuIjB;AAFnB,oGArIsC,yBAAmB,OAqItC;AACnB,4FAtI2D,iBAAW,OAsI3D;AAFX,4FApIwE,iBAAW,OAoIxE;AAnIb,+CAAwD;AAoJtD,qGApJO,gCAAoB,OAoJP;AAnJtB,6CAcyB;AA+HvB,8FA5IA,wBAAa,OA4IA;AACb,qGA5IA,+BAAoB,OA4IA;AAJpB,iHAvIA,2CAAgC,OAuIA;AAKhC,+FA3IA,yBAAc,OA2IA;AAHd,wGAvIA,kCAAuB,OAuIA;AAIvB,mHA1IA,6CAAkC,OA0IA;AALlC,0GApIA,oCAAyB,OAoIA;AALzB,gGA9HA,0BAAe,OA8HA;AAGf,wGAhIA,kCAAuB,OAgIA;AADvB,yGA9HA,mCAAwB,OA8HA;AADxB,8FA5HA,wBAAa,OA4HA;AAUb,2GArIA,qCAA0B,OAqIA;AAC1B,0GArIA,oCAAyB,OAqIA"}
|
package/module/module.d.ts
CHANGED
|
@@ -1,20 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { AirGapV3SerializerCompanion } from '../serializer/serializer';
|
|
1
|
+
import { BlockExplorer } from '../block-explorer/block-explorer';
|
|
2
|
+
import { OfflineProtocol, OnlineProtocol } from '../protocol/protocol';
|
|
4
3
|
import { AirGapInterface } from '../types/airgap';
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
import { ProtocolNetwork } from '../types/protocol';
|
|
5
|
+
export interface Module {
|
|
6
|
+
supportedNetworks: Record<string, ProtocolNetwork>;
|
|
7
|
+
createOfflineProtocol(): Promise<OfflineProtocol | undefined>;
|
|
8
|
+
createOnlineProtocol(networkId?: string): Promise<OnlineProtocol | undefined>;
|
|
9
|
+
createBlockExplorer(networkId?: string): Promise<BlockExplorer | undefined>;
|
|
9
10
|
}
|
|
10
|
-
declare type
|
|
11
|
-
interface _Module<_Protocols extends ModuleGeneric['Protocols'] = any> {
|
|
12
|
-
supportedProtocols: Record<_Protocols, ProtocolConfiguration>;
|
|
13
|
-
createOfflineProtocol(identifier: _Protocols): Promise<AirGapOfflineProtocol | undefined>;
|
|
14
|
-
createOnlineProtocol(identifier: _Protocols, networkId?: string): Promise<AirGapOnlineProtocol | undefined>;
|
|
15
|
-
createBlockExplorer(identifier: _Protocols, networkId?: string): Promise<AirGapBlockExplorer | undefined>;
|
|
16
|
-
createV3SerializerCompanion(): Promise<AirGapV3SerializerCompanion>;
|
|
17
|
-
}
|
|
18
|
-
export declare type Module<G extends Partial<ModuleGeneric> = {}> = _Module<TypedProtocols<G>>;
|
|
19
|
-
export declare type AirGapModule<G extends Partial<ModuleGeneric> = {}> = AirGapInterface<Module<G>>;
|
|
20
|
-
export {};
|
|
11
|
+
export declare type AirGapModule = AirGapInterface<Module>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@airgap/module-kit",
|
|
3
|
-
"version": "0.13.8-beta.
|
|
3
|
+
"version": "0.13.8-beta.8",
|
|
4
4
|
"description": "TODO",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"airgap",
|
|
@@ -30,8 +30,7 @@
|
|
|
30
30
|
},
|
|
31
31
|
"author": "Papers GmbH <contact@papers.ch> (https://papers.ch)",
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"@airgap/coinlib-core": "^0.13.8-beta.
|
|
34
|
-
"@airgap/serializer": "^0.13.8-beta.6"
|
|
33
|
+
"@airgap/coinlib-core": "^0.13.8-beta.7"
|
|
35
34
|
},
|
|
36
35
|
"nyc": {
|
|
37
36
|
"include": [
|
|
@@ -9,7 +9,6 @@ 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>;
|
|
13
12
|
}
|
|
14
13
|
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> {
|
|
15
14
|
}
|
package/types/airgap.d.ts
CHANGED
|
@@ -5,8 +5,8 @@ import { Module } from '../module/module';
|
|
|
5
5
|
import { ProtocolExtensions } from '../protocol/extensions/extensions';
|
|
6
6
|
import { _AnyProtocol } from '../protocol/protocol';
|
|
7
7
|
import { Override } from './meta/utility-types';
|
|
8
|
-
export declare type AirGapInterface<T, E0 extends ApplicableExtension<T> = undefined, E1 extends ApplicableExtension<T> = undefined, E2 extends ApplicableExtension<T> = undefined, E3 extends ApplicableExtension<T> = undefined, E4 extends ApplicableExtension<T> = undefined, E5 extends ApplicableExtension<T> = undefined, E6 extends ApplicableExtension<T> = undefined, E7 extends ApplicableExtension<T> = undefined, E8 extends ApplicableExtension<T> = undefined, E9 extends ApplicableExtension<T> = undefined> = _Interface<T,
|
|
9
|
-
declare type _Interface<T,
|
|
8
|
+
export declare type AirGapInterface<T, E0 extends ApplicableExtension<T> = undefined, E1 extends ApplicableExtension<T> = undefined, E2 extends ApplicableExtension<T> = undefined, E3 extends ApplicableExtension<T> = undefined, E4 extends ApplicableExtension<T> = undefined, E5 extends ApplicableExtension<T> = undefined, E6 extends ApplicableExtension<T> = undefined, E7 extends ApplicableExtension<T> = undefined, E8 extends ApplicableExtension<T> = undefined, E9 extends ApplicableExtension<T> = undefined> = _Interface<T, E0, E1, E2, E3, E4, E5, E6, E7, E8, E9>;
|
|
9
|
+
declare type _Interface<T, E0 = undefined, E1 = undefined, E2 = undefined, E3 = undefined, E4 = undefined, E5 = undefined, E6 = undefined, E7 = undefined, E8 = undefined, E9 = undefined> = E0 extends keyof AirGapExtensions<T> ? _Interface<Override<T, AirGapExtensions<T>[E0]>, E1, E2, E3, E4, E5, E6, E7, E8, E9> : T;
|
|
10
10
|
export declare type ApplicableExtension<T> = keyof AirGapExtensions<T> | undefined;
|
|
11
11
|
export declare type ApplicableBlockExplorerExtension<T> = keyof BlockExplorerExtensions<T> | undefined;
|
|
12
12
|
export declare type ApplicableModuleExtension<T> = keyof ModuleExtensions<T> | undefined;
|
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
|
|
3
|
+
export interface ProtocolMetadata<_Units extends 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 = string, _FeeUnits exte
|
|
|
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> = {
|
|
13
13
|
[key in _Units]: {
|
|
14
14
|
symbol: ProtocolSymbol;
|
|
15
15
|
decimals: number;
|
|
@@ -19,11 +19,15 @@ export interface ProtocolSymbol {
|
|
|
19
19
|
value: string;
|
|
20
20
|
market?: string;
|
|
21
21
|
}
|
|
22
|
-
|
|
22
|
+
interface ProtocolFeeMetadataWithUnits<_FeeUnits extends string> {
|
|
23
|
+
units: ProtocolUnitsMetadata<_FeeUnits>;
|
|
24
|
+
mainUnit: _FeeUnits;
|
|
23
25
|
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>;
|
|
27
31
|
export interface ProtocolAccountMetadata {
|
|
28
32
|
standardDerivationPath?: string;
|
|
29
33
|
address?: {
|
|
@@ -32,7 +36,7 @@ export interface ProtocolAccountMetadata {
|
|
|
32
36
|
regex?: string;
|
|
33
37
|
};
|
|
34
38
|
}
|
|
35
|
-
export interface ProtocolTransactionMetadata<_Units extends string
|
|
39
|
+
export interface ProtocolTransactionMetadata<_Units extends string> {
|
|
36
40
|
arbitraryData?: ProtocolTransactionArbitraryDataMetadata | {
|
|
37
41
|
root?: ProtocolTransactionArbitraryDataMetadata;
|
|
38
42
|
inner?: ProtocolTransactionArbitraryDataMetadata;
|
|
@@ -53,3 +57,4 @@ export interface ProtocolNetwork {
|
|
|
53
57
|
type: ProtocolNetworkType;
|
|
54
58
|
rpcUrl: string;
|
|
55
59
|
}
|
|
60
|
+
export {};
|
package/types/transaction.d.ts
CHANGED
|
@@ -28,7 +28,6 @@ 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;
|
|
32
31
|
}
|
|
33
32
|
export interface TransactionCursor extends BaseCursor {
|
|
34
33
|
}
|
package/utils/protocol.d.ts
CHANGED
|
@@ -13,8 +13,6 @@ 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;
|
|
18
16
|
export declare function isBip32Protocol<T extends AnyProtocol>(protocol: T): protocol is T & Bip32Extension<T>;
|
|
19
17
|
export declare function isSubProtocol<T extends AnyProtocol>(protocol: T): protocol is T & SubProtocol;
|
|
20
18
|
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 =
|
|
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;
|
|
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,11 +24,10 @@ 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' });
|
|
28
28
|
var bip32OnlineProtocolSchema = __assign(__assign({}, bip32BaseProtocolSchema), onlineProtocolSchema);
|
|
29
29
|
var subProtocolSchema = {
|
|
30
|
-
getType: 'required'
|
|
31
|
-
mainProtocol: 'required'
|
|
30
|
+
getType: 'required'
|
|
32
31
|
};
|
|
33
32
|
var singleTokenSubProtocolSchema = __assign(__assign({}, subProtocolSchema), { getContractAddress: 'required' });
|
|
34
33
|
var multiTokenSubProtocolBaseSchema = singleTokenSubProtocolSchema;
|
|
@@ -72,11 +71,9 @@ var transactionStatusCheckerSchema = {
|
|
|
72
71
|
function isOfflineProtocol(object) {
|
|
73
72
|
return (0, interface_1.implementsInterface)(object, offlineProtocolSchema);
|
|
74
73
|
}
|
|
75
|
-
exports.isOfflineProtocol = isOfflineProtocol;
|
|
76
74
|
function isOnlineProtocol(object) {
|
|
77
75
|
return (0, interface_1.implementsInterface)(object, onlineProtocolSchema);
|
|
78
76
|
}
|
|
79
|
-
exports.isOnlineProtocol = isOnlineProtocol;
|
|
80
77
|
function isOfflineBip32Protocol(protocol) {
|
|
81
78
|
return (0, interface_1.implementsInterface)(protocol, bip32OfflineProtocolSchema);
|
|
82
79
|
}
|
package/utils/protocol.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol.js","sourceRoot":"","sources":["../../src/utils/protocol.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,aAAa;AACb,0FAA4F;AAsC5F,yCAAyD;AAEzD,UAAU;AAEV,IAAM,kBAAkB,GAAyB;IAC/C,uBAAuB,EAAE,UAAU;IACnC,yBAAyB,EAAE,UAAU;IACrC,WAAW,EAAE,UAAU;CACxB,CAAA;AAED,IAAM,qBAAqB,yBACtB,kBAAkB,KACrB,oBAAoB,EAAE,UAAU,EAChC,4BAA4B,EAAE,UAAU,GACzC,CAAA;AAED,IAAM,oBAAoB,yBACrB,kBAAkB,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,GAC5C,CAAA;AAED,IAAM,uBAAuB,yBACxB,kBAAkB,KACrB,2BAA2B,EAAE,UAAU,GACxC,CAAA;AAED,IAAM,0BAA0B,kCAC3B,uBAAuB,GACvB,qBAAqB,KACxB,4BAA4B,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"protocol.js","sourceRoot":"","sources":["../../src/utils/protocol.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,aAAa;AACb,0FAA4F;AAsC5F,yCAAyD;AAEzD,UAAU;AAEV,IAAM,kBAAkB,GAAyB;IAC/C,uBAAuB,EAAE,UAAU;IACnC,yBAAyB,EAAE,UAAU;IACrC,WAAW,EAAE,UAAU;CACxB,CAAA;AAED,IAAM,qBAAqB,yBACtB,kBAAkB,KACrB,oBAAoB,EAAE,UAAU,EAChC,4BAA4B,EAAE,UAAU,GACzC,CAAA;AAED,IAAM,oBAAoB,yBACrB,kBAAkB,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,GAC5C,CAAA;AAED,IAAM,uBAAuB,yBACxB,kBAAkB,KACrB,2BAA2B,EAAE,UAAU,GACxC,CAAA;AAED,IAAM,0BAA0B,kCAC3B,uBAAuB,GACvB,qBAAqB,KACxB,4BAA4B,EAAE,UAAU,GACzC,CAAA;AAED,IAAM,yBAAyB,yBAC1B,uBAAuB,GACvB,oBAAoB,CACxB,CAAA;AAED,IAAM,iBAAiB,GAAwB;IAC7C,OAAO,EAAE,UAAU;CACpB,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AARD,wCAQC;AAED,SAAgB,kCAAkC,CAChD,QAAW;IAEX,OAAO,IAAA,+BAAmB,EAA0C,QAAQ,EAAE,qCAAqC,CAAC,CAAA;AACtH,CAAC;AAJD,gFAIC;AAED,SAAgB,0BAA0B,CAA2B,QAAW;IAC9E,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,12 +0,0 @@
|
|
|
1
|
-
import { TransactionSignRequest, TransactionSignResponse } from '@airgap/serializer';
|
|
2
|
-
import { V3SchemaConfiguration } from '../types/serializer';
|
|
3
|
-
import { SignedTransaction, UnsignedTransaction } from '../types/transaction';
|
|
4
|
-
export interface AirGapV3SerializerCompanion {
|
|
5
|
-
schemas: V3SchemaConfiguration[];
|
|
6
|
-
toTransactionSignRequest(identifier: string, unsignedTransaction: UnsignedTransaction, publicKey: string, callbackUrl?: string): Promise<TransactionSignRequest>;
|
|
7
|
-
fromTransactionSignRequest(identifier: string, transactionSignRequest: TransactionSignRequest): Promise<UnsignedTransaction>;
|
|
8
|
-
validateTransactionSignRequest(identifier: string, transactionSignRequest: TransactionSignRequest): Promise<boolean>;
|
|
9
|
-
toTransactionSignResponse(identifier: string, signedTransaction: SignedTransaction, accountIdentifier: string): Promise<TransactionSignResponse>;
|
|
10
|
-
fromTransactionSignResponse(identifier: string, transactionSignResponse: TransactionSignResponse): Promise<SignedTransaction>;
|
|
11
|
-
validateTransactionSignResponse(identifier: string, transactionSignResponse: TransactionSignResponse): Promise<boolean>;
|
|
12
|
-
}
|
package/serializer/serializer.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"serializer.js","sourceRoot":"","sources":["../../src/serializer/serializer.ts"],"names":[],"mappings":""}
|
package/types/module.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { ProtocolNetwork } from './protocol';
|
|
2
|
-
export interface OfflineProtocolConfiguration {
|
|
3
|
-
type: 'offline';
|
|
4
|
-
}
|
|
5
|
-
export interface OnlineProtocolConfiguration {
|
|
6
|
-
type: 'online';
|
|
7
|
-
networks: Record<string, ProtocolNetwork>;
|
|
8
|
-
}
|
|
9
|
-
export interface FullProtocolConfiguration {
|
|
10
|
-
type: 'full';
|
|
11
|
-
offline: OfflineProtocolConfiguration;
|
|
12
|
-
online: OnlineProtocolConfiguration;
|
|
13
|
-
}
|
|
14
|
-
export declare type ProtocolConfiguration = OfflineProtocolConfiguration | OnlineProtocolConfiguration | FullProtocolConfiguration;
|
package/types/module.js
DELETED
package/types/module.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../src/types/module.ts"],"names":[],"mappings":""}
|
package/types/serializer.d.ts
DELETED
package/types/serializer.js
DELETED
package/types/serializer.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"serializer.js","sourceRoot":"","sources":["../../src/types/serializer.ts"],"names":[],"mappings":""}
|
package/utils/module.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { ModuleNetworkRegistry } from '../module/module-network-registry';
|
|
2
|
-
import { ProtocolConfiguration } from '../types/module';
|
|
3
|
-
import { ProtocolNetwork } from '../types/protocol';
|
|
4
|
-
export declare function createSupportedProtocols<P extends string = string>(online: Record<P, ModuleNetworkRegistry> | Record<P, Record<string, ProtocolNetwork>>, offline?: P[]): Record<P, ProtocolConfiguration>;
|
package/utils/module.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createSupportedProtocols = void 0;
|
|
4
|
-
function createSupportedProtocols(online, offline) {
|
|
5
|
-
var onlineIdentifiers = new Set(Object.keys(online));
|
|
6
|
-
var offlineIdentifiers = offline ? new Set(offline) : onlineIdentifiers;
|
|
7
|
-
var identifiers = new Set(Array.from(onlineIdentifiers).concat(Array.from(onlineIdentifiers)));
|
|
8
|
-
return Array.from(identifiers).reduce(function (obj, next) {
|
|
9
|
-
var _a;
|
|
10
|
-
var offlineConfiguration = offlineIdentifiers.has(next) ? { type: 'offline' } : undefined;
|
|
11
|
-
var onlineConfiguration = online[next]
|
|
12
|
-
? createOnlineProtocolConfiguration(online[next])
|
|
13
|
-
: undefined;
|
|
14
|
-
var configuration = offlineConfiguration !== undefined && onlineConfiguration !== undefined
|
|
15
|
-
? { type: 'full', offline: offlineConfiguration, online: onlineConfiguration }
|
|
16
|
-
: (offlineConfiguration !== null && offlineConfiguration !== void 0 ? offlineConfiguration : onlineConfiguration);
|
|
17
|
-
return Object.assign(obj, (_a = {}, _a[next] = configuration, _a));
|
|
18
|
-
// tslint:disable-next-line: no-object-literal-type-assertion
|
|
19
|
-
}, {});
|
|
20
|
-
}
|
|
21
|
-
exports.createSupportedProtocols = createSupportedProtocols;
|
|
22
|
-
function createOnlineProtocolConfiguration(networks) {
|
|
23
|
-
var _a;
|
|
24
|
-
return {
|
|
25
|
-
type: 'online',
|
|
26
|
-
networks: (_a = networks.supportedNetworks) !== null && _a !== void 0 ? _a : networks
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
//# sourceMappingURL=module.js.map
|
package/utils/module.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../src/utils/module.ts"],"names":[],"mappings":";;;AAIA,SAAgB,wBAAwB,CACtC,MAAqF,EACrF,OAAa;IAEb,IAAM,iBAAiB,GAAW,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAQ,CAAC,CAAA;IACrE,IAAM,kBAAkB,GAAW,OAAO,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAA;IAEjF,IAAM,WAAW,GAAW,IAAI,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAA;IAExG,OAAO,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,MAAM,CAAC,UAAC,GAAqC,EAAE,IAAO;;QACnF,IAAM,oBAAoB,GAA6C,kBAAkB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,SAAS,CAAA;QACrI,IAAM,mBAAmB,GAA4C,MAAM,CAAC,IAAI,CAAC;YAC/E,CAAC,CAAC,iCAAiC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;YACjD,CAAC,CAAC,SAAS,CAAA;QAEb,IAAM,aAAa,GACjB,oBAAoB,KAAK,SAAS,IAAI,mBAAmB,KAAK,SAAS;YACrE,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,oBAAoB,EAAE,MAAM,EAAE,mBAAmB,EAAE;YAC9E,CAAC,CAAE,CAAC,oBAAoB,aAApB,oBAAoB,cAApB,oBAAoB,GAAI,mBAAmB,CAAgE,CAAA;QAEnH,OAAO,M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