@airgap/ethereum 0.13.10 → 0.13.11-beta.1
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/package.json +11 -9
- package/airgap-coinlib-ethereum.min.js +0 -117080
- package/index.d.ts +0 -1
- package/index.js +0 -18
- package/index.js.map +0 -1
- package/v0/index.d.ts +0 -12
- package/v0/index.js +0 -39
- package/v0/index.js.map +0 -1
- package/v0/protocol/BaseEthereumProtocol.d.ts +0 -98
- package/v0/protocol/BaseEthereumProtocol.js +0 -939
- package/v0/protocol/BaseEthereumProtocol.js.map +0 -1
- package/v0/protocol/EthereumAddress.d.ts +0 -8
- package/v0/protocol/EthereumAddress.js +0 -43
- package/v0/protocol/EthereumAddress.js.map +0 -1
- package/v0/protocol/EthereumChainIDs.d.ts +0 -1
- package/v0/protocol/EthereumChainIDs.js +0 -340
- package/v0/protocol/EthereumChainIDs.js.map +0 -1
- package/v0/protocol/EthereumClassicProtocol.d.ts +0 -6
- package/v0/protocol/EthereumClassicProtocol.js +0 -30
- package/v0/protocol/EthereumClassicProtocol.js.map +0 -1
- package/v0/protocol/EthereumCryptoClient.d.ts +0 -12
- package/v0/protocol/EthereumCryptoClient.js +0 -148
- package/v0/protocol/EthereumCryptoClient.js.map +0 -1
- package/v0/protocol/EthereumProtocol.d.ts +0 -10
- package/v0/protocol/EthereumProtocol.js +0 -34
- package/v0/protocol/EthereumProtocol.js.map +0 -1
- package/v0/protocol/EthereumProtocolOptions.d.ts +0 -46
- package/v0/protocol/EthereumProtocolOptions.js +0 -150
- package/v0/protocol/EthereumProtocolOptions.js.map +0 -1
- package/v0/protocol/EthereumRopstenProtocol.d.ts +0 -6
- package/v0/protocol/EthereumRopstenProtocol.js +0 -30
- package/v0/protocol/EthereumRopstenProtocol.js.map +0 -1
- package/v0/protocol/EthereumTypes.d.ts +0 -14
- package/v0/protocol/EthereumTypes.js +0 -3
- package/v0/protocol/EthereumTypes.js.map +0 -1
- package/v0/protocol/clients/info-clients/EtherscanInfoClient.d.ts +0 -8
- package/v0/protocol/clients/info-clients/EtherscanInfoClient.js +0 -195
- package/v0/protocol/clients/info-clients/EtherscanInfoClient.js.map +0 -1
- package/v0/protocol/clients/info-clients/InfoClient.d.ts +0 -8
- package/v0/protocol/clients/info-clients/InfoClient.js +0 -11
- package/v0/protocol/clients/info-clients/InfoClient.js.map +0 -1
- package/v0/protocol/clients/node-clients/AirGapNodeClient.d.ts +0 -41
- package/v0/protocol/clients/node-clients/AirGapNodeClient.js +0 -353
- package/v0/protocol/clients/node-clients/AirGapNodeClient.js.map +0 -1
- package/v0/protocol/clients/node-clients/NodeClient.d.ts +0 -17
- package/v0/protocol/clients/node-clients/NodeClient.js +0 -11
- package/v0/protocol/clients/node-clients/NodeClient.js.map +0 -1
- package/v0/protocol/erc20/ERC20.d.ts +0 -3
- package/v0/protocol/erc20/ERC20.js +0 -9
- package/v0/protocol/erc20/ERC20.js.map +0 -1
- package/v0/protocol/erc20/GenericERC20.d.ts +0 -32
- package/v0/protocol/erc20/GenericERC20.js +0 -335
- package/v0/protocol/erc20/GenericERC20.js.map +0 -1
- package/v0/protocol/utils/utils.d.ts +0 -13
- package/v0/protocol/utils/utils.js +0 -140
- package/v0/protocol/utils/utils.js.map +0 -1
- package/v0/serializer/schemas/v2/transaction-sign-request-ethereum.json +0 -50
- package/v0/serializer/schemas/v2/transaction-sign-response-ethereum.json +0 -19
- package/v0/serializer/schemas/v3/transaction-sign-request-ethereum-typed.json +0 -38
- package/v0/serializer/schemas/v3/transaction-sign-request-ethereum.json +0 -50
- package/v0/serializer/schemas/v3/transaction-sign-response-ethereum.json +0 -19
- package/v0/serializer/validators/transaction-validator.d.ts +0 -15
- package/v0/serializer/validators/transaction-validator.js +0 -96
- package/v0/serializer/validators/transaction-validator.js.map +0 -1
- package/v0/serializer/validators/validators.d.ts +0 -1
- package/v0/serializer/validators/validators.js +0 -78
- package/v0/serializer/validators/validators.js.map +0 -1
- package/v0/types/signed-transaction-ethereum.d.ts +0 -5
- package/v0/types/signed-transaction-ethereum.js +0 -3
- package/v0/types/signed-transaction-ethereum.js.map +0 -1
- package/v0/types/transaction-ethereum.d.ts +0 -14
- package/v0/types/transaction-ethereum.js +0 -3
- package/v0/types/transaction-ethereum.js.map +0 -1
- package/v0/types/unsigned-transaction-ethereum-typed.d.ts +0 -11
- package/v0/types/unsigned-transaction-ethereum-typed.js +0 -3
- package/v0/types/unsigned-transaction-ethereum-typed.js.map +0 -1
- package/v0/types/unsigned-transaction-ethereum.d.ts +0 -15
- package/v0/types/unsigned-transaction-ethereum.js +0 -3
- package/v0/types/unsigned-transaction-ethereum.js.map +0 -1
- package/v1/block-explorer/EtherscanBlockExplorer.d.ts +0 -9
- package/v1/block-explorer/EtherscanBlockExplorer.js +0 -74
- package/v1/block-explorer/EtherscanBlockExplorer.js.map +0 -1
- package/v1/clients/crypto/EthereumCryptoClient.d.ts +0 -7
- package/v1/clients/crypto/EthereumCryptoClient.js +0 -147
- package/v1/clients/crypto/EthereumCryptoClient.js.map +0 -1
- package/v1/clients/info/EthereumInfoClient.d.ts +0 -15
- package/v1/clients/info/EthereumInfoClient.js +0 -11
- package/v1/clients/info/EthereumInfoClient.js.map +0 -1
- package/v1/clients/info/EtherscanInfoClient.d.ts +0 -7
- package/v1/clients/info/EtherscanInfoClient.js +0 -165
- package/v1/clients/info/EtherscanInfoClient.js.map +0 -1
- package/v1/clients/node/AirGapNodeClient.d.ts +0 -41
- package/v1/clients/node/AirGapNodeClient.js +0 -351
- package/v1/clients/node/AirGapNodeClient.js.map +0 -1
- package/v1/clients/node/EthereumNodeClient.d.ts +0 -17
- package/v1/clients/node/EthereumNodeClient.js +0 -11
- package/v1/clients/node/EthereumNodeClient.js.map +0 -1
- package/v1/data/EthereumAddress.d.ts +0 -7
- package/v1/data/EthereumAddress.js +0 -46
- package/v1/data/EthereumAddress.js.map +0 -1
- package/v1/index.d.ts +0 -10
- package/v1/index.js +0 -13
- package/v1/index.js.map +0 -1
- package/v1/module/ERC20Tokens.d.ts +0 -3
- package/v1/module/ERC20Tokens.js +0 -815
- package/v1/module/ERC20Tokens.js.map +0 -1
- package/v1/module/EthereumModule.d.ts +0 -13
- package/v1/module/EthereumModule.js +0 -125
- package/v1/module/EthereumModule.js.map +0 -1
- package/v1/protocol/EthereumBaseProtocol.d.ts +0 -83
- package/v1/protocol/EthereumBaseProtocol.js +0 -866
- package/v1/protocol/EthereumBaseProtocol.js.map +0 -1
- package/v1/protocol/EthereumChainIds.d.ts +0 -1
- package/v1/protocol/EthereumChainIds.js +0 -340
- package/v1/protocol/EthereumChainIds.js.map +0 -1
- package/v1/protocol/EthereumProtocol.d.ts +0 -8
- package/v1/protocol/EthereumProtocol.js +0 -64
- package/v1/protocol/EthereumProtocol.js.map +0 -1
- package/v1/protocol/erc20/ERC20Token.d.ts +0 -8
- package/v1/protocol/erc20/ERC20Token.js +0 -421
- package/v1/protocol/erc20/ERC20Token.js.map +0 -1
- package/v1/serializer/v3/schemas/converter/transaction-converter.d.ts +0 -12
- package/v1/serializer/v3/schemas/converter/transaction-converter.js +0 -80
- package/v1/serializer/v3/schemas/converter/transaction-converter.js.map +0 -1
- package/v1/serializer/v3/schemas/definitions/transaction-sign-request-ethereum-typed.d.ts +0 -10
- package/v1/serializer/v3/schemas/definitions/transaction-sign-request-ethereum-typed.js +0 -3
- package/v1/serializer/v3/schemas/definitions/transaction-sign-request-ethereum-typed.js.map +0 -1
- package/v1/serializer/v3/schemas/definitions/transaction-sign-request-ethereum.d.ts +0 -14
- package/v1/serializer/v3/schemas/definitions/transaction-sign-request-ethereum.js +0 -3
- package/v1/serializer/v3/schemas/definitions/transaction-sign-request-ethereum.js.map +0 -1
- package/v1/serializer/v3/schemas/definitions/transaction-sign-response-ethereum.d.ts +0 -3
- package/v1/serializer/v3/schemas/definitions/transaction-sign-response-ethereum.js +0 -3
- package/v1/serializer/v3/schemas/definitions/transaction-sign-response-ethereum.js.map +0 -1
- package/v1/serializer/v3/schemas/generated/transaction-sign-request-ethereum-typed.json +0 -41
- package/v1/serializer/v3/schemas/generated/transaction-sign-request-ethereum.json +0 -58
- package/v1/serializer/v3/schemas/generated/transaction-sign-response-ethereum.json +0 -19
- package/v1/serializer/v3/serializer-companion.d.ts +0 -13
- package/v1/serializer/v3/serializer-companion.js +0 -190
- package/v1/serializer/v3/serializer-companion.js.map +0 -1
- package/v1/serializer/v3/validators/transaction-validator.d.ts +0 -7
- package/v1/serializer/v3/validators/transaction-validator.js +0 -71
- package/v1/serializer/v3/validators/transaction-validator.js.map +0 -1
- package/v1/types/protocol.d.ts +0 -32
- package/v1/types/protocol.js +0 -3
- package/v1/types/protocol.js.map +0 -1
- package/v1/types/transaction.d.ts +0 -24
- package/v1/types/transaction.js +0 -3
- package/v1/types/transaction.js.map +0 -1
- package/v1/utils/EthereumUtils.d.ts +0 -13
- package/v1/utils/EthereumUtils.js +0 -140
- package/v1/utils/EthereumUtils.js.map +0 -1
- package/v1/utils/key.d.ts +0 -5
- package/v1/utils/key.js +0 -88
- package/v1/utils/key.js.map +0 -1
package/v1/utils/key.js
DELETED
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.convertExtendedPublicKey = exports.convertPublicKey = exports.convertExtendedSecretKey = exports.convertSecretKey = void 0;
|
|
27
|
-
var coinlib_core_1 = require("@airgap/coinlib-core");
|
|
28
|
-
// @ts-ignore
|
|
29
|
-
var bs58check = __importStar(require("@airgap/coinlib-core/dependencies/src/bs58check-2.1.2"));
|
|
30
|
-
var errors_1 = require("@airgap/coinlib-core/errors");
|
|
31
|
-
var module_kit_1 = require("@airgap/module-kit");
|
|
32
|
-
var EXT_PK_PREFIX = '0488b21e'; // xpub
|
|
33
|
-
function convertSecretKey(secretKey, targetFormat) {
|
|
34
|
-
if (secretKey.format === targetFormat) {
|
|
35
|
-
return secretKey;
|
|
36
|
-
}
|
|
37
|
-
// 'encoded' -> 'hex'
|
|
38
|
-
// 'hex' -> 'encoded'
|
|
39
|
-
throw new errors_1.UnsupportedError(coinlib_core_1.Domain.ETHEREUM, 'Unsupported secret key format.');
|
|
40
|
-
}
|
|
41
|
-
exports.convertSecretKey = convertSecretKey;
|
|
42
|
-
function convertExtendedSecretKey(extendedSecretKey, targetFormat) {
|
|
43
|
-
if (extendedSecretKey.format === targetFormat) {
|
|
44
|
-
return extendedSecretKey;
|
|
45
|
-
}
|
|
46
|
-
// 'encoded' -> 'hex'
|
|
47
|
-
// 'hex' -> 'encoded'
|
|
48
|
-
throw new errors_1.UnsupportedError(coinlib_core_1.Domain.ETHEREUM, 'Unsupported secret key format.');
|
|
49
|
-
}
|
|
50
|
-
exports.convertExtendedSecretKey = convertExtendedSecretKey;
|
|
51
|
-
function convertPublicKey(publicKey, targetFormat) {
|
|
52
|
-
if (publicKey.format === targetFormat) {
|
|
53
|
-
return publicKey;
|
|
54
|
-
}
|
|
55
|
-
// 'encoded' -> 'hex'
|
|
56
|
-
// 'hex' -> 'encoded'
|
|
57
|
-
throw new errors_1.UnsupportedError(coinlib_core_1.Domain.ETHEREUM, 'Unsupported public key format.');
|
|
58
|
-
}
|
|
59
|
-
exports.convertPublicKey = convertPublicKey;
|
|
60
|
-
function convertExtendedPublicKey(extendedPublicKey, targetFormat) {
|
|
61
|
-
if (extendedPublicKey.format === targetFormat) {
|
|
62
|
-
return extendedPublicKey;
|
|
63
|
-
}
|
|
64
|
-
switch (extendedPublicKey.format) {
|
|
65
|
-
case 'encoded':
|
|
66
|
-
return (0, module_kit_1.newExtendedPublicKey)(convertEncodedExtendedPublicKey(extendedPublicKey.value, targetFormat));
|
|
67
|
-
case 'hex':
|
|
68
|
-
return (0, module_kit_1.newExtendedPublicKey)(convertHexExtendedPublicKey(extendedPublicKey.value, targetFormat));
|
|
69
|
-
default:
|
|
70
|
-
(0, coinlib_core_1.assertNever)(extendedPublicKey.format);
|
|
71
|
-
throw new errors_1.UnsupportedError(coinlib_core_1.Domain.ETHEREUM, 'Unuspported extended public key format.');
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
exports.convertExtendedPublicKey = convertExtendedPublicKey;
|
|
75
|
-
function convertEncodedExtendedPublicKey(extendedPublicKey, targetFormat) {
|
|
76
|
-
if (targetFormat === 'encoded') {
|
|
77
|
-
return extendedPublicKey;
|
|
78
|
-
}
|
|
79
|
-
var prefixBytes = Buffer.from(EXT_PK_PREFIX, 'hex').length;
|
|
80
|
-
return bs58check.decode(extendedPublicKey).slice(prefixBytes).toString('hex');
|
|
81
|
-
}
|
|
82
|
-
function convertHexExtendedPublicKey(extendedPublicKey, targetFormat) {
|
|
83
|
-
if (targetFormat === 'hex') {
|
|
84
|
-
return extendedPublicKey;
|
|
85
|
-
}
|
|
86
|
-
return bs58check.encode(Buffer.concat([Buffer.from(EXT_PK_PREFIX, 'hex'), Buffer.from(extendedPublicKey, 'hex')]));
|
|
87
|
-
}
|
|
88
|
-
//# sourceMappingURL=key.js.map
|
package/v1/utils/key.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"key.js","sourceRoot":"","sources":["../../../src/v1/utils/key.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qDAA0D;AAC1D,aAAa;AACb,+FAAkF;AAClF,sDAA8D;AAC9D,iDAAqH;AAErH,IAAM,aAAa,GAAW,UAAU,CAAA,CAAC,OAAO;AAEhD,SAAgB,gBAAgB,CAAC,SAAoB,EAAE,YAAiC;IACtF,IAAI,SAAS,CAAC,MAAM,KAAK,YAAY,EAAE;QACrC,OAAO,SAAS,CAAA;KACjB;IAED,qBAAqB;IACrB,yBAAyB;IACzB,MAAM,IAAI,yBAAgB,CAAC,qBAAM,CAAC,QAAQ,EAAE,gCAAgC,CAAC,CAAA;AAC/E,CAAC;AARD,4CAQC;AAED,SAAgB,wBAAwB,CACtC,iBAAoC,EACpC,YAAyC;IAEzC,IAAI,iBAAiB,CAAC,MAAM,KAAK,YAAY,EAAE;QAC7C,OAAO,iBAAiB,CAAA;KACzB;IAED,qBAAqB;IACrB,yBAAyB;IACzB,MAAM,IAAI,yBAAgB,CAAC,qBAAM,CAAC,QAAQ,EAAE,gCAAgC,CAAC,CAAA;AAC/E,CAAC;AAXD,4DAWC;AAED,SAAgB,gBAAgB,CAAC,SAAoB,EAAE,YAAiC;IACtF,IAAI,SAAS,CAAC,MAAM,KAAK,YAAY,EAAE;QACrC,OAAO,SAAS,CAAA;KACjB;IAED,qBAAqB;IACrB,yBAAyB;IACzB,MAAM,IAAI,yBAAgB,CAAC,qBAAM,CAAC,QAAQ,EAAE,gCAAgC,CAAC,CAAA;AAC/E,CAAC;AAR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