@airgap/ethereum 0.13.20-beta.7 → 0.13.21-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/package.json +7 -7
  2. package/v1/clients/info/EthereumInfoClient.d.ts +7 -9
  3. package/v1/clients/info/EthereumInfoClient.js.map +1 -1
  4. package/v1/clients/info/EtherscanInfoClient.d.ts +1 -2
  5. package/v1/clients/info/EtherscanInfoClient.js +2 -0
  6. package/v1/clients/info/EtherscanInfoClient.js.map +1 -1
  7. package/v1/index.d.ts +5 -18
  8. package/v1/index.js +1 -16
  9. package/v1/index.js.map +1 -1
  10. package/v1/module/ERC20Tokens.d.ts +1 -1
  11. package/v1/module/EthereumModule.d.ts +4 -4
  12. package/v1/module/EthereumModule.js.map +1 -1
  13. package/v1/protocol/EthereumBaseProtocol.d.ts +8 -84
  14. package/v1/protocol/EthereumBaseProtocol.js +7 -777
  15. package/v1/protocol/EthereumBaseProtocol.js.map +1 -1
  16. package/v1/protocol/EthereumProtocol.d.ts +7 -6
  17. package/v1/protocol/EthereumProtocol.js +3 -3
  18. package/v1/protocol/EthereumProtocol.js.map +1 -1
  19. package/v1/protocol/erc20/ERC20Token.d.ts +10 -15
  20. package/v1/protocol/erc20/ERC20Token.js +35 -26
  21. package/v1/protocol/erc20/ERC20Token.js.map +1 -1
  22. package/v1/serializer/v3/serializer-companion.js +9 -10
  23. package/v1/serializer/v3/serializer-companion.js.map +1 -1
  24. package/v1/utils/protocol.d.ts +5 -4
  25. package/v1/utils/protocol.js.map +1 -1
  26. package/v1/clients/crypto/EthereumCryptoClient.d.ts +0 -7
  27. package/v1/clients/crypto/EthereumCryptoClient.js +0 -147
  28. package/v1/clients/crypto/EthereumCryptoClient.js.map +0 -1
  29. package/v1/clients/node/EthereumNodeClient.d.ts +0 -18
  30. package/v1/clients/node/EthereumNodeClient.js +0 -3
  31. package/v1/clients/node/EthereumNodeClient.js.map +0 -1
  32. package/v1/clients/node/HttpEthereumNodeClient.d.ts +0 -66
  33. package/v1/clients/node/HttpEthereumNodeClient.js +0 -443
  34. package/v1/clients/node/HttpEthereumNodeClient.js.map +0 -1
  35. package/v1/data/EthereumAddress.d.ts +0 -7
  36. package/v1/data/EthereumAddress.js +0 -46
  37. package/v1/data/EthereumAddress.js.map +0 -1
  38. package/v1/protocol/EthereumChainIds.d.ts +0 -1
  39. package/v1/protocol/EthereumChainIds.js +0 -340
  40. package/v1/protocol/EthereumChainIds.js.map +0 -1
  41. package/v1/protocol/erc20/ERC20Protocol.d.ts +0 -32
  42. package/v1/protocol/erc20/ERC20Protocol.js +0 -397
  43. package/v1/protocol/erc20/ERC20Protocol.js.map +0 -1
  44. package/v1/serializer/v3/schemas/converter/transaction-converter.d.ts +0 -8
  45. package/v1/serializer/v3/schemas/converter/transaction-converter.js +0 -76
  46. package/v1/serializer/v3/schemas/converter/transaction-converter.js.map +0 -1
  47. package/v1/serializer/v3/schemas/definitions/transaction-sign-request-ethereum-typed.d.ts +0 -10
  48. package/v1/serializer/v3/schemas/definitions/transaction-sign-request-ethereum-typed.js +0 -3
  49. package/v1/serializer/v3/schemas/definitions/transaction-sign-request-ethereum-typed.js.map +0 -1
  50. package/v1/serializer/v3/schemas/definitions/transaction-sign-request-ethereum.d.ts +0 -14
  51. package/v1/serializer/v3/schemas/definitions/transaction-sign-request-ethereum.js +0 -3
  52. package/v1/serializer/v3/schemas/definitions/transaction-sign-request-ethereum.js.map +0 -1
  53. package/v1/serializer/v3/schemas/definitions/transaction-sign-response-ethereum.d.ts +0 -3
  54. package/v1/serializer/v3/schemas/definitions/transaction-sign-response-ethereum.js +0 -3
  55. package/v1/serializer/v3/schemas/definitions/transaction-sign-response-ethereum.js.map +0 -1
  56. package/v1/serializer/v3/schemas/generated/transaction-sign-request-ethereum-typed.json +0 -41
  57. package/v1/serializer/v3/schemas/generated/transaction-sign-request-ethereum.json +0 -58
  58. package/v1/serializer/v3/schemas/generated/transaction-sign-response-ethereum.json +0 -19
  59. package/v1/serializer/v3/validators/transaction-validator.d.ts +0 -7
  60. package/v1/serializer/v3/validators/transaction-validator.js +0 -71
  61. package/v1/serializer/v3/validators/transaction-validator.js.map +0 -1
  62. package/v1/types/crypto.d.ts +0 -2
  63. package/v1/types/crypto.js +0 -3
  64. package/v1/types/crypto.js.map +0 -1
  65. package/v1/types/protocol.d.ts +0 -35
  66. package/v1/types/protocol.js +0 -3
  67. package/v1/types/protocol.js.map +0 -1
  68. package/v1/types/transaction.d.ts +0 -24
  69. package/v1/types/transaction.js +0 -3
  70. package/v1/types/transaction.js.map +0 -1
  71. package/v1/utils/EthereumUtils.d.ts +0 -16
  72. package/v1/utils/EthereumUtils.js +0 -155
  73. package/v1/utils/EthereumUtils.js.map +0 -1
  74. package/v1/utils/key.d.ts +0 -5
  75. package/v1/utils/key.js +0 -101
  76. package/v1/utils/key.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@airgap/ethereum",
3
- "version": "0.13.20-beta.7",
3
+ "version": "0.13.21-beta.0",
4
4
  "description": "The @airgap/ethereum is an Ethereum implementation of the ICoinProtocol interface from @airgap/coinlib-core.",
5
5
  "keywords": [
6
6
  "airgap",
@@ -30,13 +30,13 @@
30
30
  },
31
31
  "author": "Papers AG <contact@papers.ch> (https://papers.ch)",
32
32
  "dependencies": {
33
- "@airgap/coinlib-core": "^0.13.20-beta.7",
34
- "@airgap/crypto": "^0.13.20-beta.7",
35
- "@airgap/module-kit": "^0.13.20-beta.7",
36
- "@airgap/serializer": "^0.13.20-beta.7",
33
+ "@airgap/coinlib-core": "^0.13.21-beta.0",
34
+ "@airgap/crypto": "^0.13.21-beta.0",
35
+ "@airgap/evm": "^0.13.21-beta.0",
36
+ "@airgap/module-kit": "^0.13.21-beta.0",
37
+ "@airgap/serializer": "^0.13.21-beta.0",
37
38
  "@ethereumjs/common": "2.6.5",
38
- "@ethereumjs/tx": "3.4.0",
39
- "@metamask/eth-sig-util": "4.0.0"
39
+ "@ethereumjs/tx": "3.4.0"
40
40
  },
41
41
  "localDependencies": {
42
42
  "ethereumjs-tx": "1.3.7",
@@ -1,13 +1,11 @@
1
- import { AirGapTransaction } from '@airgap/module-kit';
2
- import { EthereumTransactionCursor } from '../../types/transaction';
3
- export declare type EthereumInfoClientTransaction = Omit<AirGapTransaction, 'network'>;
4
- export interface EthereumInfoClientTransactionsResult {
5
- transactions: EthereumInfoClientTransaction[];
6
- cursor: {
7
- page: number;
8
- };
1
+ import { EvmInfoClient, EvmInfoClientTransactionsResult } from '@airgap/evm';
2
+ import { TransactionCursor } from '@airgap/module-kit';
3
+ export interface EthereumTransactionCursor extends TransactionCursor {
4
+ page?: number;
9
5
  }
10
- export declare abstract class EthereumInfoClient {
6
+ export interface EthereumInfoClientTransactionsResult extends EvmInfoClientTransactionsResult<EthereumTransactionCursor> {
7
+ }
8
+ export declare abstract class EthereumInfoClient implements EvmInfoClient<EthereumTransactionCursor, EthereumInfoClientTransactionsResult> {
11
9
  baseURL: string;
12
10
  constructor(baseURL: string);
13
11
  abstract fetchTransactions(address: string, limit: number, cursor?: EthereumTransactionCursor): Promise<EthereumInfoClientTransactionsResult>;
@@ -1 +1 @@
1
- {"version":3,"file":"EthereumInfoClient.js","sourceRoot":"","sources":["../../../../src/v1/clients/info/EthereumInfoClient.ts"],"names":[],"mappings":";;;AAYA;IAGE,4BAAY,OAAe;QACzB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IACxB,CAAC;IAaH,yBAAC;AAAD,CAAC,AAlBD,IAkBC;AAlBqB,gDAAkB"}
1
+ {"version":3,"file":"EthereumInfoClient.js","sourceRoot":"","sources":["../../../../src/v1/clients/info/EthereumInfoClient.ts"],"names":[],"mappings":";;;AASA;IAGE,4BAAY,OAAe;QACzB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IACxB,CAAC;IAaH,yBAAC;AAAD,CAAC,AAlBD,IAkBC;AAlBqB,gDAAkB"}
@@ -1,5 +1,4 @@
1
- import { EthereumTransactionCursor } from '../../types/transaction';
2
- import { EthereumInfoClient, EthereumInfoClientTransactionsResult } from './EthereumInfoClient';
1
+ import { EthereumInfoClient, EthereumInfoClientTransactionsResult, EthereumTransactionCursor } from './EthereumInfoClient';
3
2
  export declare class EtherscanInfoClient extends EthereumInfoClient {
4
3
  private readonly apiKey?;
5
4
  constructor(baseURL: string, apiKey?: string | undefined);
@@ -111,6 +111,7 @@ var EtherscanInfoClient = /** @class */ (function (_super) {
111
111
  return [2 /*return*/, {
112
112
  transactions: airGapTransactions,
113
113
  cursor: {
114
+ hasNext: limit == airGapTransactions.length,
114
115
  page: page + 1
115
116
  }
116
117
  }];
@@ -160,6 +161,7 @@ var EtherscanInfoClient = /** @class */ (function (_super) {
160
161
  return [2 /*return*/, {
161
162
  transactions: airGapTransactions,
162
163
  cursor: {
164
+ hasNext: limit == airGapTransactions.length,
163
165
  page: page + 1
164
166
  }
165
167
  }];
@@ -1 +1 @@
1
- {"version":3,"file":"EtherscanInfoClient.js","sourceRoot":"","sources":["../../../../src/v1/clients/info/EtherscanInfoClient.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oGAAsE;AACtE,gGAA8F;AAC9F,8FAA2F;AAC3F,sDAA0D;AAC1D,2EAAkE;AAClE,iDAA8C;AAI9C,2DAA8H;AAE9H;IAAyC,uCAAkB;IACzD,6BAAY,OAAe,EAAmB,MAAe;QAA7D,YACE,kBAAM,OAAO,CAAC,SACf;QAF6C,YAAM,GAAN,MAAM,CAAS;;IAE7D,CAAC;IAEY,+CAAiB,GAA9B,UACE,OAAe,EACf,KAAU,EACV,MAAkC;;;;;;;wBAE5B,kBAAkB,GAAoC,EAAE,CAAA;wBAExD,IAAI,GAAW,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,mCAAI,CAAC,CAAA;wBAClC,GAAG,GAAW,UAAG,IAAI,CAAC,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AM,EAAE,IAAA,sBAAS,EAAC,IAAI,qBAAS,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE,YAAY,CAAC;gCACjE,GAAG,EAAE,IAAA,sBAAS,EAAC,GAAG,EAAE,YAAY,CAAC;gCAEjC,SAAS,EAAE,QAAQ,CAAC,WAAW,CAAC,SAAS,EAAE,EAAE,CAAC;gCAC9C,MAAM,EAAE;oCACN,IAAI,EAAE,WAAW,CAAC,gBAAgB,KAAK,SAAS,IAAI,WAAW,CAAC,gBAAgB,KAAK,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ;oCAC/G,IAAI,EAAE,WAAW,CAAC,IAAI;oCACtB,KAAK,EAAE,WAAW,CAAC,WAAW;iCAC/B;6BACF,CAAA;4BAED,kBAAkB,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAA;yBAC3C;wBAED,sBAAO;gCACL,YAAY,EAAE,kBAAkB;gCAChC,MAAM,EAAE;oCACN,OAAO,EAAE,KAAK,IAAI,kBAAkB,CAAC,MAAM;oCAC3C,IAAI,EAAE,IAAI,GAAG,CAAC;iCACf;6BACF,EAAA;;;;KACF;IACH,0BAAC;AAAD,CAAC,AAvGD,CAAyC,uCAAkB,GAuG1D;AAvGY,kDAAmB"}
package/v1/index.d.ts CHANGED
@@ -1,30 +1,17 @@
1
1
  import { EtherscanBlockExplorer } from './block-explorer/EtherscanBlockExplorer';
2
2
  import { EthereumInfoClient } from './clients/info/EthereumInfoClient';
3
3
  import { EtherscanInfoClient } from './clients/info/EtherscanInfoClient';
4
- import { HttpEthereumNodeClient, EthereumRPCBody, EthereumRPCData, EthereumRPCResponse } from './clients/node/HttpEthereumNodeClient';
5
- import { EthereumNodeClient } from './clients/node/EthereumNodeClient';
6
4
  import { erc20Tokens } from './module/ERC20Tokens';
7
5
  import { EthereumModule } from './module/EthereumModule';
8
- import { ERC20Protocol, ERC20ProtocolImpl } from './protocol/erc20/ERC20Protocol';
9
6
  import { createERC20Token, ERC20Token, ERC20TokenImpl } from './protocol/erc20/ERC20Token';
10
- import { DEFAULT_ETHEREUM_UNITS_METADATA, EthereumBaseProtocol, EthereumBaseProtocolImpl } from './protocol/EthereumBaseProtocol';
7
+ import { DEFAULT_ETHEREUM_UNITS_METADATA, EthereumBaseProtocol, EthereumBaseProtocolImpl, EthereumUnits } from './protocol/EthereumBaseProtocol';
11
8
  import { createEthereumProtocol, createEthereumProtocolOptions, EthereumProtocol } from './protocol/EthereumProtocol';
12
- import { ethereumSignedTransactionToResponse, ethereumTransactionSignRequestToUnsigned, ethereumTransactionSignResponseToSigned, ethereumUnsignedTransactionToRequest } from './serializer/v3/schemas/converter/transaction-converter';
13
- import { EthereumTransactionValidator } from './serializer/v3/validators/transaction-validator';
14
- import { EthereumTransactionSignRequest } from './serializer/v3/schemas/definitions/transaction-sign-request-ethereum';
15
- import { EthereumTypedTransactionSignRequest } from './serializer/v3/schemas/definitions/transaction-sign-request-ethereum-typed';
16
- import { EthereumTransactionSignResponse } from './serializer/v3/schemas/definitions/transaction-sign-response-ethereum';
17
- import { EthereumCryptoConfiguration } from './types/crypto';
18
- import { ERC20TokenMetadata, ERC20TokenOptions, EthereumBaseProtocolOptions, EthereumProtocolNetwork, EthereumProtocolOptions, EthereumUnits } from './types/protocol';
19
- import { EthereumRawUnsignedTransaction, EthereumSignedTransaction, EthereumTransactionCursor, EthereumTypedUnsignedTransaction, EthereumUnsignedTransaction } from './types/transaction';
20
- import { EthereumUtils } from './utils/EthereumUtils';
21
9
  import { isAnyEthereumProtocol, isEthereumERC20Protocol, isEthereumERC20Token, isEthereumProtocol } from './utils/protocol';
22
10
  export { EthereumModule };
23
- export { EthereumBaseProtocol, EthereumBaseProtocolImpl, EthereumProtocol, createEthereumProtocol, createEthereumProtocolOptions, ERC20Protocol, ERC20ProtocolImpl, ERC20Token, ERC20TokenImpl, createERC20Token };
11
+ export { EthereumBaseProtocol, EthereumBaseProtocolImpl, EthereumProtocol, createEthereumProtocol, createEthereumProtocolOptions, ERC20Token, ERC20TokenImpl, createERC20Token };
24
12
  export { EtherscanBlockExplorer };
25
13
  export { DEFAULT_ETHEREUM_UNITS_METADATA };
26
- export { EthereumNodeClient, HttpEthereumNodeClient, EthereumInfoClient, EtherscanInfoClient };
27
- export { EthereumCryptoConfiguration, EthereumUnits, EthereumProtocolNetwork, EthereumProtocolOptions, ERC20TokenMetadata, ERC20TokenOptions, EthereumBaseProtocolOptions, EthereumUnsignedTransaction, EthereumTypedUnsignedTransaction, EthereumRawUnsignedTransaction, EthereumSignedTransaction, EthereumTransactionCursor, EthereumRPCData, EthereumRPCBody, EthereumRPCResponse };
28
- export { EthereumTransactionSignRequest, EthereumTypedTransactionSignRequest, EthereumTransactionSignResponse, ethereumUnsignedTransactionToRequest, ethereumSignedTransactionToResponse, ethereumTransactionSignRequestToUnsigned, ethereumTransactionSignResponseToSigned, EthereumTransactionValidator };
29
- export { EthereumUtils, isAnyEthereumProtocol, isEthereumProtocol, isEthereumERC20Protocol, isEthereumERC20Token };
14
+ export { EthereumInfoClient, EtherscanInfoClient };
15
+ export { EthereumUnits };
16
+ export { isAnyEthereumProtocol, isEthereumProtocol, isEthereumERC20Protocol, isEthereumERC20Token };
30
17
  export { erc20Tokens };
package/v1/index.js CHANGED
@@ -1,22 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.erc20Tokens = exports.isEthereumERC20Token = exports.isEthereumERC20Protocol = exports.isEthereumProtocol = exports.isAnyEthereumProtocol = exports.EthereumUtils = exports.EthereumTransactionValidator = exports.ethereumTransactionSignResponseToSigned = exports.ethereumTransactionSignRequestToUnsigned = exports.ethereumSignedTransactionToResponse = exports.ethereumUnsignedTransactionToRequest = exports.EthereumRPCBody = exports.EthereumRPCData = exports.EtherscanInfoClient = exports.EthereumInfoClient = exports.HttpEthereumNodeClient = exports.DEFAULT_ETHEREUM_UNITS_METADATA = exports.EtherscanBlockExplorer = exports.createERC20Token = exports.ERC20TokenImpl = exports.ERC20ProtocolImpl = exports.createEthereumProtocolOptions = exports.createEthereumProtocol = exports.EthereumBaseProtocolImpl = exports.EthereumModule = void 0;
3
+ exports.erc20Tokens = exports.isEthereumERC20Token = exports.isEthereumERC20Protocol = exports.isEthereumProtocol = exports.isAnyEthereumProtocol = exports.EtherscanInfoClient = exports.EthereumInfoClient = exports.DEFAULT_ETHEREUM_UNITS_METADATA = exports.EtherscanBlockExplorer = exports.createERC20Token = exports.ERC20TokenImpl = exports.createEthereumProtocolOptions = exports.createEthereumProtocol = exports.EthereumBaseProtocolImpl = exports.EthereumModule = void 0;
4
4
  var EtherscanBlockExplorer_1 = require("./block-explorer/EtherscanBlockExplorer");
5
5
  Object.defineProperty(exports, "EtherscanBlockExplorer", { enumerable: true, get: function () { return EtherscanBlockExplorer_1.EtherscanBlockExplorer; } });
6
6
  var EthereumInfoClient_1 = require("./clients/info/EthereumInfoClient");
7
7
  Object.defineProperty(exports, "EthereumInfoClient", { enumerable: true, get: function () { return EthereumInfoClient_1.EthereumInfoClient; } });
8
8
  var EtherscanInfoClient_1 = require("./clients/info/EtherscanInfoClient");
9
9
  Object.defineProperty(exports, "EtherscanInfoClient", { enumerable: true, get: function () { return EtherscanInfoClient_1.EtherscanInfoClient; } });
10
- var HttpEthereumNodeClient_1 = require("./clients/node/HttpEthereumNodeClient");
11
- Object.defineProperty(exports, "HttpEthereumNodeClient", { enumerable: true, get: function () { return HttpEthereumNodeClient_1.HttpEthereumNodeClient; } });
12
- Object.defineProperty(exports, "EthereumRPCBody", { enumerable: true, get: function () { return HttpEthereumNodeClient_1.EthereumRPCBody; } });
13
- Object.defineProperty(exports, "EthereumRPCData", { enumerable: true, get: function () { return HttpEthereumNodeClient_1.EthereumRPCData; } });
14
10
  var ERC20Tokens_1 = require("./module/ERC20Tokens");
15
11
  Object.defineProperty(exports, "erc20Tokens", { enumerable: true, get: function () { return ERC20Tokens_1.erc20Tokens; } });
16
12
  var EthereumModule_1 = require("./module/EthereumModule");
17
13
  Object.defineProperty(exports, "EthereumModule", { enumerable: true, get: function () { return EthereumModule_1.EthereumModule; } });
18
- var ERC20Protocol_1 = require("./protocol/erc20/ERC20Protocol");
19
- Object.defineProperty(exports, "ERC20ProtocolImpl", { enumerable: true, get: function () { return ERC20Protocol_1.ERC20ProtocolImpl; } });
20
14
  var ERC20Token_1 = require("./protocol/erc20/ERC20Token");
21
15
  Object.defineProperty(exports, "createERC20Token", { enumerable: true, get: function () { return ERC20Token_1.createERC20Token; } });
22
16
  Object.defineProperty(exports, "ERC20TokenImpl", { enumerable: true, get: function () { return ERC20Token_1.ERC20TokenImpl; } });
@@ -26,15 +20,6 @@ Object.defineProperty(exports, "EthereumBaseProtocolImpl", { enumerable: true, g
26
20
  var EthereumProtocol_1 = require("./protocol/EthereumProtocol");
27
21
  Object.defineProperty(exports, "createEthereumProtocol", { enumerable: true, get: function () { return EthereumProtocol_1.createEthereumProtocol; } });
28
22
  Object.defineProperty(exports, "createEthereumProtocolOptions", { enumerable: true, get: function () { return EthereumProtocol_1.createEthereumProtocolOptions; } });
29
- var transaction_converter_1 = require("./serializer/v3/schemas/converter/transaction-converter");
30
- Object.defineProperty(exports, "ethereumSignedTransactionToResponse", { enumerable: true, get: function () { return transaction_converter_1.ethereumSignedTransactionToResponse; } });
31
- Object.defineProperty(exports, "ethereumTransactionSignRequestToUnsigned", { enumerable: true, get: function () { return transaction_converter_1.ethereumTransactionSignRequestToUnsigned; } });
32
- Object.defineProperty(exports, "ethereumTransactionSignResponseToSigned", { enumerable: true, get: function () { return transaction_converter_1.ethereumTransactionSignResponseToSigned; } });
33
- Object.defineProperty(exports, "ethereumUnsignedTransactionToRequest", { enumerable: true, get: function () { return transaction_converter_1.ethereumUnsignedTransactionToRequest; } });
34
- var transaction_validator_1 = require("./serializer/v3/validators/transaction-validator");
35
- Object.defineProperty(exports, "EthereumTransactionValidator", { enumerable: true, get: function () { return transaction_validator_1.EthereumTransactionValidator; } });
36
- var EthereumUtils_1 = require("./utils/EthereumUtils");
37
- Object.defineProperty(exports, "EthereumUtils", { enumerable: true, get: function () { return EthereumUtils_1.EthereumUtils; } });
38
23
  var protocol_1 = require("./utils/protocol");
39
24
  Object.defineProperty(exports, "isAnyEthereumProtocol", { enumerable: true, get: function () { return protocol_1.isAnyEthereumProtocol; } });
40
25
  Object.defineProperty(exports, "isEthereumERC20Protocol", { enumerable: true, get: function () { return protocol_1.isEthereumERC20Protocol; } });
package/v1/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/v1/index.ts"],"names":[],"mappings":";;;AAAA,kFAAgF;AA6DvE,uGA7DA,+CAAsB,OA6DA;AA5D/B,wEAAsE;AAoEjB,mGApE5C,uCAAkB,OAoE4C;AAnEvE,0EAAwE;AAmEC,oGAnEhE,yCAAmB,OAmEgE;AAlE5F,gFAAqI;AAkExG,uGAlEpB,+CAAsB,OAkEoB;AAkBjD,gGApF+B,wCAAe,OAoF/B;AADf,gGAnFgD,wCAAe,OAmFhD;AAjFjB,oDAAkD;AAyGzC,4FAzGA,yBAAW,OAyGA;AAxGpB,0DAAwD;AAoC/C,+FApCA,+BAAc,OAoCA;AAnCvB,gEAAiF;AA8C/E,kGA9CsB,iCAAiB,OA8CtB;AA7CnB,0DAA0F;AAgDxF,iGAhDO,6BAAgB,OAgDP;AADhB,+FA/CqC,2BAAc,OA+CrC;AA9ChB,wEAAiI;AAwDxH,gHAxDA,sDAA+B,OAwDA;AAjBtC,yGAvC8D,+CAAwB,OAuC9D;AAtC1B,gEAAqH;AAwCnH,uGAxCO,yCAAsB,OAwCP;AACtB,8GAzC+B,gDAA6B,OAyC/B;AAxC/B,iGAKgE;AAkF9D,oHAtFA,2DAAmC,OAsFA;AACnC,yHAtFA,gEAAwC,OAsFA;AACxC,wHAtFA,+DAAuC,OAsFA;AAHvC,qHAlFA,4DAAoC,OAkFA;AAhFtC,0FAA+F;AAoF7F,6GApFO,oDAA4B,OAoFP;AAhE9B,uDAAqD;AAqE5C,8FArEA,6BAAa,OAqEA;AApEtB,6CAA2H;AAoEnG,sGApEf,gCAAqB,OAoEe;AAAsB,wGApEnC,kCAAuB,OAoEmC;AAAE,qGApEnC,+BAAoB,OAoEmC;AAAjE,mGApEgC,6BAAkB,OAoEhC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/v1/index.ts"],"names":[],"mappings":";;;AAAA,kFAAgF;AAkCvE,uGAlCA,+CAAsB,OAkCA;AAjC/B,wEAAsE;AAyC7D,mGAzCA,uCAAkB,OAyCA;AAxC3B,0EAAwE;AAwC3C,oGAxCpB,yCAAmB,OAwCoB;AAvChD,oDAAkD;AAmDzC,4FAnDA,yBAAW,OAmDA;AAlDpB,0DAAwD;AAa/C,+FAbA,+BAAc,OAaA;AAZvB,0DAA0F;AAwBxF,iGAxBO,6BAAgB,OAwBP;AADhB,+FAvBqC,2BAAc,OAuBrC;AAtBhB,wEAKwC;AA2B/B,gHA/BP,sDAA+B,OA+BO;AAftC,yGAdA,+CAAwB,OAcA;AAX1B,gEAAqH;AAanH,uGAbO,yCAAsB,OAaP;AACtB,8GAd+B,gDAA6B,OAc/B;AAb/B,6CAA2H;AAqClH,sGArCA,gCAAqB,OAqCA;AAAsB,wGArCpB,kCAAuB,OAqCoB;AAAE,qGArCpB,+BAAoB,OAqCoB;AAAjE,mGArC+C,6BAAkB,OAqC/C"}
@@ -1,3 +1,3 @@
1
- import { ERC20TokenMetadata } from '../types/protocol';
1
+ import { ERC20TokenMetadata } from '@airgap/evm';
2
2
  export declare const erc20Tokens: Record<string, ERC20TokenMetadata>;
3
3
  export declare const erc20TokensIdentifiers: string[];
@@ -1,16 +1,16 @@
1
1
  import { AirGapModule, AirGapV3SerializerCompanion, ProtocolConfiguration } from '@airgap/module-kit';
2
2
  import { BlockExplorer } from '@airgap/module-kit/block-explorer/block-explorer';
3
3
  import { OfflineProtocol, OnlineProtocol } from '@airgap/module-kit/protocol/protocol';
4
- import { EthereumProtocolNetwork } from '../types/protocol';
4
+ import { EvmProtocolNetwork } from '@airgap/evm';
5
5
  export declare class EthereumModule implements AirGapModule<{
6
- ProtocolNetwork: EthereumProtocolNetwork;
6
+ ProtocolNetwork: EvmProtocolNetwork;
7
7
  }> {
8
8
  private readonly networkRegistries;
9
9
  readonly supportedProtocols: Record<string, ProtocolConfiguration>;
10
10
  constructor();
11
11
  createOfflineProtocol(identifier: string): Promise<OfflineProtocol | undefined>;
12
- createOnlineProtocol(identifier: string, networkOrId?: EthereumProtocolNetwork | string): Promise<OnlineProtocol | undefined>;
13
- createBlockExplorer(identifier: string, networkOrId?: EthereumProtocolNetwork | string): Promise<BlockExplorer | undefined>;
12
+ createOnlineProtocol(identifier: string, networkOrId?: EvmProtocolNetwork | string): Promise<OnlineProtocol | undefined>;
13
+ createBlockExplorer(identifier: string, networkOrId?: EvmProtocolNetwork | string): Promise<BlockExplorer | undefined>;
14
14
  createV3SerializerCompanion(): Promise<AirGapV3SerializerCompanion>;
15
15
  private createProtocol;
16
16
  }
@@ -1 +1 @@
1
- {"version":3,"file":"EthereumModule.js","sourceRoot":"","sources":["../../../src/v1/module/EthereumModule.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qDAAkE;AAClE,sDAAqE;AACrE,iDAO2B;AAI3B,mFAAiF;AACjF,2DAAwG;AACxG,iEAAwG;AACxG,8EAAqF;AAGrF,6CAAmE;AAEnE;IAIE;;QACE,IAAM,eAAe,GAA0B,IAAI,kCAAqB,CAAC;YACvE,iBAAiB,EAAE,CAAC,oDAAiC,CAAC;SACvD,CAAC,CAAA;QACF,IAAM,oBAAoB,GAA0B,IAAI,kCAAqB,CAAC;YAC5E,iBAAiB,EAAE,CAAC,oDAAuC,CAAC;SAC7D,CAAC,CAAA;QAEF,IAAI,CAAC,iBAAiB,yBACnB,kCAAmB,CAAC,GAAG,IAAG,eAAe,OACvC,oCAAsB,CAAC,MAAM,CAC9B,UAAC,GAA0C,EAA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I,UAAU,KAAK,kCAAmB,CAAC,GAAG,EAAE;YAC1C,OAAO,IAAA,yCAAsB,EAAC,EAAE,OAAO,SAAA,EAAE,CAAC,CAAA;SAC3C;QAED,IAAI,yBAAW,CAAC,UAAU,CAAC,KAAK,SAAS,EAAE;YACzC,IAAM,aAAa,GAAuB,yBAAW,CAAC,UAAU,CAAC,CAAA;YAEjE,OAAO,IAAA,6BAAgB,EAAC,aAAa,EAAE,EAAE,OAAO,SAAA,EAAE,CAAC,CAAA;SACpD;QAED,MAAM,IAAI,gCAAuB,CAAC,qBAAM,CAAC,QAAQ,EAAE,mBAAY,UAAU,oBAAiB,CAAC,CAAA;IAC7F,CAAC;IACH,qBAAC;AAAD,CAAC,AAjED,IAiEC;AAjEY,wCAAc"}
@@ -1,87 +1,11 @@
1
- import { BigNumber } from '@airgap/coinlib-core/dependencies/src/bignumber.js-9.0.0/bignumber';
2
- import { Address, AirGapProtocol, AirGapTransaction, AirGapTransactionStatus, AirGapTransactionsWithCursor, Amount, Balance, CryptoDerivative, ExtendedKeyPair, ExtendedPublicKey, ExtendedSecretKey, FeeDefaults, KeyPair, ProtocolMetadata, ProtocolUnitsMetadata, PublicKey, SecretKey, Signature, TokenDetails, TransactionFullConfiguration, TransactionDetails, TransactionSimpleConfiguration, WalletConnectRequest } from '@airgap/module-kit';
3
- import { EthereumCryptoClient } from '../clients/crypto/EthereumCryptoClient';
4
- import { EthereumInfoClient } from '../clients/info/EthereumInfoClient';
5
- import { EthereumNodeClient } from '../clients/node/EthereumNodeClient';
6
- import { EthereumCryptoConfiguration } from '../types/crypto';
7
- import { EthereumBaseProtocolOptions, EthereumProtocolNetwork, EthereumProtocolOptions, EthereumUnits } from '../types/protocol';
8
- import { EthereumRawUnsignedTransaction, EthereumSignedTransaction, EthereumTransactionCursor, EthereumTypedUnsignedTransaction, EthereumUnsignedTransaction } from '../types/transaction';
9
- export interface EthereumBaseProtocol<_Units extends string = EthereumUnits, _ProtocolNetwork extends EthereumProtocolNetwork = EthereumProtocolNetwork> extends AirGapProtocol<{
10
- AddressResult: Address;
11
- ProtocolNetwork: _ProtocolNetwork;
12
- CryptoConfiguration: EthereumCryptoConfiguration;
13
- Units: _Units;
14
- FeeUnits: EthereumUnits;
15
- FeeEstimation: FeeDefaults<EthereumUnits>;
16
- SignedTransaction: EthereumSignedTransaction;
17
- UnsignedTransaction: EthereumUnsignedTransaction;
18
- TransactionCursor: EthereumTransactionCursor;
19
- }, 'Bip32', 'Crypto', 'FetchDataForAddress', 'FetchDataForMultipleAddresses', 'GetTokenBalances', 'TransactionStatusChecker', 'WalletConnect'> {
20
- }
1
+ import { AirGapTransactionsWithCursor, ProtocolUnitsMetadata } from '@airgap/module-kit';
2
+ import { EthNodeClient, EvmBaseProtocol, EvmBaseProtocolImpl, EvmBaseProtocolOptions, EvmProtocolNetwork, EvmProtocolOptions } from '@airgap/evm';
3
+ import { EthereumInfoClient, EthereumInfoClientTransactionsResult, EthereumTransactionCursor } from '../clients/info/EthereumInfoClient';
4
+ export declare type EthereumUnits = 'ETH' | 'GWEI' | 'WEI';
21
5
  export declare const DEFAULT_ETHEREUM_UNITS_METADATA: ProtocolUnitsMetadata<EthereumUnits>;
22
- export declare class EthereumBaseProtocolImpl<_Units extends string = EthereumUnits, _ProtocolNetwork extends EthereumProtocolNetwork = EthereumProtocolNetwork> implements EthereumBaseProtocol<_Units, _ProtocolNetwork> {
23
- protected readonly options: EthereumProtocolOptions<_ProtocolNetwork>;
24
- protected readonly nodeClient: EthereumNodeClient;
25
- protected readonly infoClient: EthereumInfoClient;
26
- protected readonly cryptoClient: EthereumCryptoClient;
27
- protected readonly bitcoinJS: {
28
- lib: any;
29
- config: {
30
- network: any;
31
- };
32
- };
33
- constructor(nodeClient: EthereumNodeClient, infoClient: EthereumInfoClient, options: EthereumBaseProtocolOptions<_Units, _ProtocolNetwork>);
34
- readonly units: ProtocolUnitsMetadata<_Units>;
35
- readonly feeUnits: ProtocolUnitsMetadata<EthereumUnits>;
36
- protected readonly feeDefaults: FeeDefaults<EthereumUnits>;
37
- protected readonly metadata: ProtocolMetadata<_Units, EthereumUnits>;
38
- getMetadata(): Promise<ProtocolMetadata<_Units, EthereumUnits>>;
39
- getAddressFromPublicKey(publicKey: PublicKey | ExtendedPublicKey): Promise<string>;
40
- deriveFromExtendedPublicKey(extendedPublicKey: ExtendedPublicKey, visibilityIndex: number, addressIndex: number): Promise<PublicKey>;
41
- getDetailsFromTransaction(transaction: EthereumSignedTransaction | EthereumUnsignedTransaction, publicKey: PublicKey | ExtendedPublicKey): Promise<AirGapTransaction<_Units, EthereumUnits>[]>;
42
- private getDetailsFromTransactionWithPublicKey;
43
- private getDetailsFromTransactionWithExtendedPublicKey;
44
- protected getDetailsFromSignedTransaction(transaction: EthereumSignedTransaction): Promise<AirGapTransaction<_Units, EthereumUnits>[]>;
45
- protected getDetailsFromTypedUnsignedTransaction(transaction: EthereumTypedUnsignedTransaction, ownAddress: string): Promise<AirGapTransaction<_Units, EthereumUnits>[]>;
46
- protected getDetailsFromRawUnsignedTransaction(transaction: EthereumRawUnsignedTransaction, ownAddress: string): Promise<AirGapTransaction<_Units, EthereumUnits>[]>;
47
- verifyMessageWithPublicKey(message: string, signature: Signature, publicKey: PublicKey | ExtendedPublicKey): Promise<boolean>;
48
- encryptAsymmetricWithPublicKey(payload: string, publicKey: PublicKey | ExtendedPublicKey): Promise<string>;
49
- private readonly cryptoConfiguration;
50
- getCryptoConfiguration(): Promise<EthereumCryptoConfiguration>;
51
- getKeyPairFromDerivative(derivative: CryptoDerivative): Promise<KeyPair>;
52
- getExtendedKeyPairFromDerivative(derivative: CryptoDerivative): Promise<ExtendedKeyPair>;
53
- deriveFromExtendedSecretKey(extendedSecretKey: ExtendedSecretKey, visibilityIndex: number, addressIndex: number): Promise<SecretKey>;
54
- signTransactionWithSecretKey(transaction: EthereumUnsignedTransaction, secretKey: SecretKey | ExtendedSecretKey): Promise<EthereumSignedTransaction>;
55
- private signTypedUnsignedTransactionWithSecretKey;
56
- private signRawUnsignedTransactionWithSecretKey;
57
- private signTypedTransactionWithSecretKey;
58
- signMessageWithKeyPair(message: string, keyPair: KeyPair | ExtendedKeyPair): Promise<Signature>;
59
- decryptAsymmetricWithKeyPair(payload: string, keyPair: KeyPair | ExtendedKeyPair): Promise<string>;
60
- encryptAESWithSecretKey(payload: string, secretKey: SecretKey | ExtendedSecretKey): Promise<string>;
61
- decryptAESWithSecretKey(payload: string, secretKey: SecretKey | ExtendedSecretKey): Promise<string>;
62
- getNetwork(): Promise<_ProtocolNetwork>;
63
- getTransactionsForPublicKey(publicKey: PublicKey | ExtendedPublicKey, limit: number, cursor?: EthereumTransactionCursor): Promise<AirGapTransactionsWithCursor<EthereumTransactionCursor, _Units, EthereumUnits>>;
64
- getTransactionsForAddress(address: string, limit: number, cursor?: EthereumTransactionCursor): Promise<AirGapTransactionsWithCursor<EthereumTransactionCursor, _Units, EthereumUnits>>;
65
- getTransactionsForAddresses(addresses: string[], limit: number, cursor?: EthereumTransactionCursor): Promise<AirGapTransactionsWithCursor<EthereumTransactionCursor, _Units, EthereumUnits>>;
66
- getTransactionStatus(transactionIds: string[]): Promise<Record<string, AirGapTransactionStatus>>;
67
- getBalanceOfPublicKey(publicKey: PublicKey | ExtendedPublicKey): Promise<Balance<_Units>>;
68
- getBalanceOfAddress(address: string): Promise<Balance<_Units>>;
69
- getBalanceOfAddresses(addresses: string[]): Promise<Balance<_Units>>;
70
- getTokenBalancesOfPublicKey(publicKey: PublicKey | ExtendedPublicKey, tokens: TokenDetails[]): Promise<Record<string, Amount>>;
71
- getTransactionMaxAmountWithPublicKey(publicKey: PublicKey | ExtendedPublicKey, to: string[], configuration?: TransactionFullConfiguration<EthereumUnits>): Promise<Amount<_Units>>;
72
- getTransactionFeeWithPublicKey(publicKey: PublicKey | ExtendedPublicKey, details: TransactionDetails<_Units>[], configuration?: TransactionSimpleConfiguration): Promise<FeeDefaults<EthereumUnits>>;
73
- prepareTransactionWithPublicKey(publicKey: PublicKey | ExtendedPublicKey, details: TransactionDetails<_Units>[], configuration?: TransactionFullConfiguration<EthereumUnits>): Promise<EthereumUnsignedTransaction>;
74
- getWalletConnectChain(): Promise<string>;
75
- prepareWalletConnectTransactionWithPublicKey(publicKey: PublicKey | ExtendedPublicKey, request: WalletConnectRequest): Promise<EthereumUnsignedTransaction>;
76
- broadcastTransaction(transaction: EthereumSignedTransaction): Promise<string>;
77
- private nonExtendedPublicKey;
78
- private nonExtendedSecretKey;
79
- private getPublicKeyFromExtendedPublicKey;
80
- private getSecretKeyFromExtendedSecretKey;
81
- private deriveNode;
82
- protected estimateGas(fromAddress: string, toAddress: string, amount: string | number | BigNumber | Amount<_Units>, data?: string): Promise<BigNumber>;
83
- private derivativeToBip32Node;
6
+ export interface EthereumBaseProtocol<_Units extends string = EthereumUnits, _ProtocolNetwork extends EvmProtocolNetwork = EvmProtocolNetwork> extends EvmBaseProtocol<EthereumTransactionCursor, _Units, EthereumUnits, _ProtocolNetwork> {
84
7
  }
85
- export declare abstract class DefaultEthereumBaseProtocolImpl extends EthereumBaseProtocolImpl {
86
- protected constructor(nodeClient: EthereumNodeClient, infoClient: EthereumInfoClient, options: EthereumProtocolOptions & Partial<EthereumBaseProtocolOptions>);
8
+ export declare class EthereumBaseProtocolImpl<_ProtocolNetwork extends EvmProtocolNetwork = EvmProtocolNetwork> extends EvmBaseProtocolImpl<EthereumTransactionCursor, EthereumInfoClientTransactionsResult, EthereumInfoClient, EthereumUnits, EthereumUnits, _ProtocolNetwork> implements EthereumBaseProtocol<EthereumUnits, _ProtocolNetwork> {
9
+ constructor(nodeClient: EthNodeClient, infoClient: EthereumInfoClient, options: EvmProtocolOptions<_ProtocolNetwork> & Partial<EvmBaseProtocolOptions<EthereumUnits>>);
10
+ getTransactionsForAddresses(addresses: string[], limit: number, cursor?: EthereumTransactionCursor): Promise<AirGapTransactionsWithCursor<EthereumTransactionCursor, EthereumUnits, EthereumUnits>>;
87
11
  }