@wallfree-dev/ethereum 0.13.42

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 (167) hide show
  1. package/LICENSE.md +7 -0
  2. package/index.d.ts +1 -0
  3. package/index.js +18 -0
  4. package/index.js.map +1 -0
  5. package/package.json +67 -0
  6. package/readme.md +121 -0
  7. package/v0/index.d.ts +12 -0
  8. package/v0/index.js +39 -0
  9. package/v0/index.js.map +1 -0
  10. package/v0/protocol/BaseEthereumProtocol.d.ts +99 -0
  11. package/v0/protocol/BaseEthereumProtocol.js +946 -0
  12. package/v0/protocol/BaseEthereumProtocol.js.map +1 -0
  13. package/v0/protocol/EthereumAddress.d.ts +8 -0
  14. package/v0/protocol/EthereumAddress.js +43 -0
  15. package/v0/protocol/EthereumAddress.js.map +1 -0
  16. package/v0/protocol/EthereumChainIDs.d.ts +1 -0
  17. package/v0/protocol/EthereumChainIDs.js +340 -0
  18. package/v0/protocol/EthereumChainIDs.js.map +1 -0
  19. package/v0/protocol/EthereumClassicProtocol.d.ts +6 -0
  20. package/v0/protocol/EthereumClassicProtocol.js +30 -0
  21. package/v0/protocol/EthereumClassicProtocol.js.map +1 -0
  22. package/v0/protocol/EthereumCryptoClient.d.ts +12 -0
  23. package/v0/protocol/EthereumCryptoClient.js +148 -0
  24. package/v0/protocol/EthereumCryptoClient.js.map +1 -0
  25. package/v0/protocol/EthereumProtocol.d.ts +10 -0
  26. package/v0/protocol/EthereumProtocol.js +34 -0
  27. package/v0/protocol/EthereumProtocol.js.map +1 -0
  28. package/v0/protocol/EthereumProtocolOptions.d.ts +46 -0
  29. package/v0/protocol/EthereumProtocolOptions.js +150 -0
  30. package/v0/protocol/EthereumProtocolOptions.js.map +1 -0
  31. package/v0/protocol/EthereumRopstenProtocol.d.ts +6 -0
  32. package/v0/protocol/EthereumRopstenProtocol.js +30 -0
  33. package/v0/protocol/EthereumRopstenProtocol.js.map +1 -0
  34. package/v0/protocol/EthereumTypes.d.ts +14 -0
  35. package/v0/protocol/EthereumTypes.js +3 -0
  36. package/v0/protocol/EthereumTypes.js.map +1 -0
  37. package/v0/protocol/clients/info-clients/EtherscanInfoClient.d.ts +8 -0
  38. package/v0/protocol/clients/info-clients/EtherscanInfoClient.js +195 -0
  39. package/v0/protocol/clients/info-clients/EtherscanInfoClient.js.map +1 -0
  40. package/v0/protocol/clients/info-clients/InfoClient.d.ts +8 -0
  41. package/v0/protocol/clients/info-clients/InfoClient.js +11 -0
  42. package/v0/protocol/clients/info-clients/InfoClient.js.map +1 -0
  43. package/v0/protocol/clients/node-clients/AirGapNodeClient.d.ts +41 -0
  44. package/v0/protocol/clients/node-clients/AirGapNodeClient.js +353 -0
  45. package/v0/protocol/clients/node-clients/AirGapNodeClient.js.map +1 -0
  46. package/v0/protocol/clients/node-clients/NodeClient.d.ts +17 -0
  47. package/v0/protocol/clients/node-clients/NodeClient.js +11 -0
  48. package/v0/protocol/clients/node-clients/NodeClient.js.map +1 -0
  49. package/v0/protocol/erc20/ERC20.d.ts +3 -0
  50. package/v0/protocol/erc20/ERC20.js +9 -0
  51. package/v0/protocol/erc20/ERC20.js.map +1 -0
  52. package/v0/protocol/erc20/GenericERC20.d.ts +32 -0
  53. package/v0/protocol/erc20/GenericERC20.js +335 -0
  54. package/v0/protocol/erc20/GenericERC20.js.map +1 -0
  55. package/v0/protocol/utils/utils.d.ts +13 -0
  56. package/v0/protocol/utils/utils.js +140 -0
  57. package/v0/protocol/utils/utils.js.map +1 -0
  58. package/v0/serializer/schemas/v2/transaction-sign-request-ethereum.json +50 -0
  59. package/v0/serializer/schemas/v2/transaction-sign-response-ethereum.json +19 -0
  60. package/v0/serializer/schemas/v3/transaction-sign-request-ethereum-typed.json +38 -0
  61. package/v0/serializer/schemas/v3/transaction-sign-request-ethereum.json +50 -0
  62. package/v0/serializer/schemas/v3/transaction-sign-response-ethereum.json +19 -0
  63. package/v0/serializer/validators/transaction-validator.d.ts +15 -0
  64. package/v0/serializer/validators/transaction-validator.js +96 -0
  65. package/v0/serializer/validators/transaction-validator.js.map +1 -0
  66. package/v0/serializer/validators/validators.d.ts +1 -0
  67. package/v0/serializer/validators/validators.js +78 -0
  68. package/v0/serializer/validators/validators.js.map +1 -0
  69. package/v0/types/signed-transaction-ethereum.d.ts +5 -0
  70. package/v0/types/signed-transaction-ethereum.js +3 -0
  71. package/v0/types/signed-transaction-ethereum.js.map +1 -0
  72. package/v0/types/transaction-ethereum.d.ts +14 -0
  73. package/v0/types/transaction-ethereum.js +3 -0
  74. package/v0/types/transaction-ethereum.js.map +1 -0
  75. package/v0/types/unsigned-transaction-ethereum-typed.d.ts +11 -0
  76. package/v0/types/unsigned-transaction-ethereum-typed.js +3 -0
  77. package/v0/types/unsigned-transaction-ethereum-typed.js.map +1 -0
  78. package/v0/types/unsigned-transaction-ethereum.d.ts +15 -0
  79. package/v0/types/unsigned-transaction-ethereum.js +3 -0
  80. package/v0/types/unsigned-transaction-ethereum.js.map +1 -0
  81. package/v1/block-explorer/EtherscanBlockExplorer.d.ts +9 -0
  82. package/v1/block-explorer/EtherscanBlockExplorer.js +72 -0
  83. package/v1/block-explorer/EtherscanBlockExplorer.js.map +1 -0
  84. package/v1/clients/crypto/EthereumCryptoClient.d.ts +7 -0
  85. package/v1/clients/crypto/EthereumCryptoClient.js +147 -0
  86. package/v1/clients/crypto/EthereumCryptoClient.js.map +1 -0
  87. package/v1/clients/info/EthereumInfoClient.d.ts +15 -0
  88. package/v1/clients/info/EthereumInfoClient.js +11 -0
  89. package/v1/clients/info/EthereumInfoClient.js.map +1 -0
  90. package/v1/clients/info/EtherscanInfoClient.d.ts +8 -0
  91. package/v1/clients/info/EtherscanInfoClient.js +173 -0
  92. package/v1/clients/info/EtherscanInfoClient.js.map +1 -0
  93. package/v1/clients/node/EthereumNodeClient.d.ts +18 -0
  94. package/v1/clients/node/EthereumNodeClient.js +3 -0
  95. package/v1/clients/node/EthereumNodeClient.js.map +1 -0
  96. package/v1/clients/node/HttpEthereumNodeClient.d.ts +66 -0
  97. package/v1/clients/node/HttpEthereumNodeClient.js +451 -0
  98. package/v1/clients/node/HttpEthereumNodeClient.js.map +1 -0
  99. package/v1/data/EthereumAddress.d.ts +7 -0
  100. package/v1/data/EthereumAddress.js +46 -0
  101. package/v1/data/EthereumAddress.js.map +1 -0
  102. package/v1/index.d.ts +30 -0
  103. package/v1/index.js +43 -0
  104. package/v1/index.js.map +1 -0
  105. package/v1/module/ERC20Tokens.d.ts +3 -0
  106. package/v1/module/ERC20Tokens.js +847 -0
  107. package/v1/module/ERC20Tokens.js.map +1 -0
  108. package/v1/module/EthereumModule.d.ts +16 -0
  109. package/v1/module/EthereumModule.js +127 -0
  110. package/v1/module/EthereumModule.js.map +1 -0
  111. package/v1/module.d.ts +3 -0
  112. package/v1/module.js +24 -0
  113. package/v1/module.js.map +1 -0
  114. package/v1/protocol/EthereumBaseProtocol.d.ts +87 -0
  115. package/v1/protocol/EthereumBaseProtocol.js +892 -0
  116. package/v1/protocol/EthereumBaseProtocol.js.map +1 -0
  117. package/v1/protocol/EthereumChainIds.d.ts +1 -0
  118. package/v1/protocol/EthereumChainIds.js +340 -0
  119. package/v1/protocol/EthereumChainIds.js.map +1 -0
  120. package/v1/protocol/EthereumProtocol.d.ts +8 -0
  121. package/v1/protocol/EthereumProtocol.js +65 -0
  122. package/v1/protocol/EthereumProtocol.js.map +1 -0
  123. package/v1/protocol/erc20/ERC20Protocol.d.ts +32 -0
  124. package/v1/protocol/erc20/ERC20Protocol.js +397 -0
  125. package/v1/protocol/erc20/ERC20Protocol.js.map +1 -0
  126. package/v1/protocol/erc20/ERC20Token.d.ts +19 -0
  127. package/v1/protocol/erc20/ERC20Token.js +131 -0
  128. package/v1/protocol/erc20/ERC20Token.js.map +1 -0
  129. package/v1/serializer/v3/schemas/converter/transaction-converter.d.ts +8 -0
  130. package/v1/serializer/v3/schemas/converter/transaction-converter.js +82 -0
  131. package/v1/serializer/v3/schemas/converter/transaction-converter.js.map +1 -0
  132. package/v1/serializer/v3/schemas/definitions/transaction-sign-request-ethereum-typed.d.ts +10 -0
  133. package/v1/serializer/v3/schemas/definitions/transaction-sign-request-ethereum-typed.js +3 -0
  134. package/v1/serializer/v3/schemas/definitions/transaction-sign-request-ethereum-typed.js.map +1 -0
  135. package/v1/serializer/v3/schemas/definitions/transaction-sign-request-ethereum.d.ts +14 -0
  136. package/v1/serializer/v3/schemas/definitions/transaction-sign-request-ethereum.js +3 -0
  137. package/v1/serializer/v3/schemas/definitions/transaction-sign-request-ethereum.js.map +1 -0
  138. package/v1/serializer/v3/schemas/definitions/transaction-sign-response-ethereum.d.ts +3 -0
  139. package/v1/serializer/v3/schemas/definitions/transaction-sign-response-ethereum.js +3 -0
  140. package/v1/serializer/v3/schemas/definitions/transaction-sign-response-ethereum.js.map +1 -0
  141. package/v1/serializer/v3/schemas/generated/transaction-sign-request-ethereum-typed.json +41 -0
  142. package/v1/serializer/v3/schemas/generated/transaction-sign-request-ethereum.json +58 -0
  143. package/v1/serializer/v3/schemas/generated/transaction-sign-response-ethereum.json +19 -0
  144. package/v1/serializer/v3/serializer-companion.d.ts +13 -0
  145. package/v1/serializer/v3/serializer-companion.js +182 -0
  146. package/v1/serializer/v3/serializer-companion.js.map +1 -0
  147. package/v1/serializer/v3/validators/transaction-validator.d.ts +7 -0
  148. package/v1/serializer/v3/validators/transaction-validator.js +71 -0
  149. package/v1/serializer/v3/validators/transaction-validator.js.map +1 -0
  150. package/v1/types/crypto.d.ts +2 -0
  151. package/v1/types/crypto.js +3 -0
  152. package/v1/types/crypto.js.map +1 -0
  153. package/v1/types/protocol.d.ts +35 -0
  154. package/v1/types/protocol.js +3 -0
  155. package/v1/types/protocol.js.map +1 -0
  156. package/v1/types/transaction.d.ts +24 -0
  157. package/v1/types/transaction.js +3 -0
  158. package/v1/types/transaction.js.map +1 -0
  159. package/v1/utils/EthereumUtils.d.ts +16 -0
  160. package/v1/utils/EthereumUtils.js +155 -0
  161. package/v1/utils/EthereumUtils.js.map +1 -0
  162. package/v1/utils/key.d.ts +5 -0
  163. package/v1/utils/key.js +101 -0
  164. package/v1/utils/key.js.map +1 -0
  165. package/v1/utils/protocol.d.ts +13 -0
  166. package/v1/utils/protocol.js +38 -0
  167. package/v1/utils/protocol.js.map +1 -0
@@ -0,0 +1,451 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
18
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
19
+ return new (P || (P = Promise))(function (resolve, reject) {
20
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
21
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
22
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
23
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
24
+ });
25
+ };
26
+ var __generator = (this && this.__generator) || function (thisArg, body) {
27
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
28
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
29
+ function verb(n) { return function (v) { return step([n, v]); }; }
30
+ function step(op) {
31
+ if (f) throw new TypeError("Generator is already executing.");
32
+ while (_) try {
33
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
34
+ if (y = 0, t) op = [op[0] & 2, t.value];
35
+ switch (op[0]) {
36
+ case 0: case 1: t = op; break;
37
+ case 4: _.label++; return { value: op[1], done: false };
38
+ case 5: _.label++; y = op[1]; op = [0]; continue;
39
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
40
+ default:
41
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
42
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
43
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
44
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
45
+ if (t[2]) _.ops.pop();
46
+ _.trys.pop(); continue;
47
+ }
48
+ op = body.call(thisArg, _);
49
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
50
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
51
+ }
52
+ };
53
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
54
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
55
+ if (ar || !(i in from)) {
56
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
57
+ ar[i] = from[i];
58
+ }
59
+ }
60
+ return to.concat(ar || Array.prototype.slice.call(from));
61
+ };
62
+ var __importDefault = (this && this.__importDefault) || function (mod) {
63
+ return (mod && mod.__esModule) ? mod : { "default": mod };
64
+ };
65
+ Object.defineProperty(exports, "__esModule", { value: true });
66
+ exports.HttpEthereumNodeClient = exports.EthereumRPCDataTransfer = exports.EthereumRPCDataBalanceOf = exports.EthereumRPCData = exports.EthereumRPCBody = void 0;
67
+ // tslint:disable: max-classes-per-file
68
+ var RPCBody_1 = require("@wallfree-dev/coinlib-core/data/RPCBody");
69
+ var axios_0_19_0_1 = __importDefault(require("@wallfree-dev/coinlib-core/dependencies/src/axios-0.19.0"));
70
+ var bignumber_1 = require("@wallfree-dev/coinlib-core/dependencies/src/bignumber.js-9.0.0/bignumber");
71
+ var errors_1 = require("@wallfree-dev/coinlib-core/errors");
72
+ var coinlib_error_1 = require("@wallfree-dev/coinlib-core/errors/coinlib-error");
73
+ var coinlib_core_1 = require("@wallfree-dev/coinlib-core");
74
+ var EthereumUtils_1 = require("../../utils/EthereumUtils");
75
+ var EthereumRPCBody = /** @class */ (function (_super) {
76
+ __extends(EthereumRPCBody, _super);
77
+ function EthereumRPCBody() {
78
+ return _super !== null && _super.apply(this, arguments) || this;
79
+ }
80
+ EthereumRPCBody.prototype.toRPCBody = function () {
81
+ return JSON.stringify(this.toJSON());
82
+ };
83
+ EthereumRPCBody.prototype.toJSON = function () {
84
+ return {
85
+ jsonrpc: this.jsonrpc,
86
+ method: this.method,
87
+ params: this.params,
88
+ id: this.id
89
+ };
90
+ };
91
+ EthereumRPCBody.blockEarliest = 'earliest';
92
+ EthereumRPCBody.blockLatest = 'latest';
93
+ EthereumRPCBody.blockPending = 'pending';
94
+ return EthereumRPCBody;
95
+ }(RPCBody_1.RPCBody));
96
+ exports.EthereumRPCBody = EthereumRPCBody;
97
+ var EthereumRPCData = /** @class */ (function () {
98
+ function EthereumRPCData(methodSignature) {
99
+ this.methodSignature = methodSignature;
100
+ }
101
+ EthereumRPCData.prototype.abiEncoded = function () {
102
+ var hash = EthereumUtils_1.EthereumUtils.sha3(this.methodSignature);
103
+ if (hash === null) {
104
+ return '';
105
+ }
106
+ return "0x".concat(hash.slice(2, 10));
107
+ };
108
+ EthereumRPCData.addLeadingZeroPadding = function (value, targetLength) {
109
+ if (targetLength === void 0) { targetLength = EthereumRPCData.parametersLength; }
110
+ var result = value;
111
+ while (result.length < targetLength || result.length % 2 !== 0) {
112
+ result = '0' + result;
113
+ }
114
+ return result;
115
+ };
116
+ EthereumRPCData.removeLeadingZeroPadding = function (value, isAddress) {
117
+ if (isAddress === void 0) { isAddress = false; }
118
+ var result = value;
119
+ if (isAddress) {
120
+ return value.slice(-40);
121
+ }
122
+ else {
123
+ while (result.startsWith('0')) {
124
+ result = result.slice(1);
125
+ }
126
+ return result;
127
+ }
128
+ return result;
129
+ };
130
+ EthereumRPCData.abiDecoded = function (value, encodedType) {
131
+ switch (encodedType) {
132
+ case 'bytes':
133
+ if (value.startsWith('0x')) {
134
+ value = value.slice(2);
135
+ }
136
+ var buffer = Buffer.from(value, 'hex');
137
+ var offset = new bignumber_1.BigNumber(buffer.slice(0, 32).toString('hex'), 16).toNumber();
138
+ var length_1 = new bignumber_1.BigNumber(buffer.slice(offset, offset + 32).toString('hex'), 16).toNumber();
139
+ return buffer.slice(offset + 32, offset + 32 + length_1).toString('hex');
140
+ default:
141
+ (0, coinlib_core_1.assertNever)(encodedType);
142
+ throw new errors_1.UnsupportedError(coinlib_error_1.Domain.ETHEREUM, 'Unsupported ABI encoded type');
143
+ }
144
+ };
145
+ // 2 chars = 1 byte hence to get to 32 bytes we need 64 chars
146
+ EthereumRPCData.parametersLength = 64;
147
+ return EthereumRPCData;
148
+ }());
149
+ exports.EthereumRPCData = EthereumRPCData;
150
+ var EthereumRPCDataBalanceOf = /** @class */ (function (_super) {
151
+ __extends(EthereumRPCDataBalanceOf, _super);
152
+ function EthereumRPCDataBalanceOf(address) {
153
+ var _this = _super.call(this, "".concat(EthereumRPCDataBalanceOf.methodName, "(address)")) || this;
154
+ _this.address = address;
155
+ return _this;
156
+ }
157
+ EthereumRPCDataBalanceOf.prototype.abiEncoded = function () {
158
+ var srcAddress = this.address;
159
+ if (srcAddress.startsWith('0x')) {
160
+ srcAddress = srcAddress.slice(2);
161
+ }
162
+ return _super.prototype.abiEncoded.call(this) + EthereumRPCData.addLeadingZeroPadding(srcAddress);
163
+ };
164
+ EthereumRPCDataBalanceOf.methodName = 'balanceOf';
165
+ return EthereumRPCDataBalanceOf;
166
+ }(EthereumRPCData));
167
+ exports.EthereumRPCDataBalanceOf = EthereumRPCDataBalanceOf;
168
+ var EthereumRPCDataTransfer = /** @class */ (function (_super) {
169
+ __extends(EthereumRPCDataTransfer, _super);
170
+ function EthereumRPCDataTransfer(toAddressOrData, amount) {
171
+ var _this = _super.call(this, "".concat(EthereumRPCDataTransfer.methodName, "(address,uint256)")) || this;
172
+ if (amount) {
173
+ var toAddress = toAddressOrData;
174
+ _this.recipient = toAddress;
175
+ _this.amount = amount;
176
+ }
177
+ else {
178
+ var data = toAddressOrData;
179
+ var methodID = _super.prototype.abiEncoded.call(_this);
180
+ if (!data.startsWith(methodID)) {
181
+ throw new errors_1.InvalidValueError(coinlib_error_1.Domain.ETHEREUM, 'unexpected method ID');
182
+ }
183
+ var params = data.slice(methodID.length);
184
+ var recipient = EthereumRPCData.removeLeadingZeroPadding(params.slice(0, EthereumRPCData.parametersLength), true);
185
+ var parsedAmount = EthereumRPCData.removeLeadingZeroPadding(params.slice(EthereumRPCData.parametersLength));
186
+ _this.recipient = "0x".concat(recipient);
187
+ _this.amount = "0x".concat(parsedAmount);
188
+ }
189
+ return _this;
190
+ }
191
+ EthereumRPCDataTransfer.prototype.abiEncoded = function () {
192
+ var dstAddress = this.recipient;
193
+ if (dstAddress.startsWith('0x')) {
194
+ dstAddress = dstAddress.slice(2);
195
+ }
196
+ var transferAmount = this.amount;
197
+ if (transferAmount.startsWith('0x')) {
198
+ transferAmount = transferAmount.slice(2);
199
+ }
200
+ return (_super.prototype.abiEncoded.call(this) +
201
+ EthereumRPCData.addLeadingZeroPadding(dstAddress.toLowerCase()) +
202
+ EthereumRPCData.addLeadingZeroPadding(transferAmount.toLowerCase()));
203
+ };
204
+ EthereumRPCDataTransfer.methodName = 'transfer';
205
+ return EthereumRPCDataTransfer;
206
+ }(EthereumRPCData));
207
+ exports.EthereumRPCDataTransfer = EthereumRPCDataTransfer;
208
+ var HttpEthereumNodeClient = /** @class */ (function () {
209
+ function HttpEthereumNodeClient(baseURL, headers) {
210
+ if (headers === void 0) { headers = { 'Content-Type': 'application/json' }; }
211
+ this.baseURL = baseURL;
212
+ this.headers = headers;
213
+ }
214
+ HttpEthereumNodeClient.prototype.fetchBalance = function (address) {
215
+ return __awaiter(this, void 0, void 0, function () {
216
+ var body, response;
217
+ return __generator(this, function (_a) {
218
+ switch (_a.label) {
219
+ case 0:
220
+ body = new EthereumRPCBody('eth_getBalance', [address, EthereumRPCBody.blockLatest]);
221
+ return [4 /*yield*/, this.send(body)];
222
+ case 1:
223
+ response = _a.sent();
224
+ return [2 /*return*/, new bignumber_1.BigNumber(response.result)];
225
+ }
226
+ });
227
+ });
228
+ };
229
+ HttpEthereumNodeClient.prototype.fetchTransactionCount = function (address) {
230
+ return __awaiter(this, void 0, void 0, function () {
231
+ var body, response;
232
+ return __generator(this, function (_a) {
233
+ switch (_a.label) {
234
+ case 0:
235
+ body = new EthereumRPCBody('eth_getTransactionCount', [address, EthereumRPCBody.blockLatest]);
236
+ return [4 /*yield*/, this.send(body)];
237
+ case 1:
238
+ response = _a.sent();
239
+ return [2 /*return*/, new bignumber_1.BigNumber(response.result).toNumber()];
240
+ }
241
+ });
242
+ });
243
+ };
244
+ HttpEthereumNodeClient.prototype.sendSignedTransaction = function (transaction) {
245
+ return __awaiter(this, void 0, void 0, function () {
246
+ var body;
247
+ return __generator(this, function (_a) {
248
+ switch (_a.label) {
249
+ case 0:
250
+ body = new EthereumRPCBody('eth_sendRawTransaction', [transaction]);
251
+ return [4 /*yield*/, this.send(body)];
252
+ case 1: return [2 /*return*/, (_a.sent()).result];
253
+ }
254
+ });
255
+ });
256
+ };
257
+ HttpEthereumNodeClient.prototype.getTransactionStatus = function (transactionHash) {
258
+ return __awaiter(this, void 0, void 0, function () {
259
+ var body, response;
260
+ return __generator(this, function (_a) {
261
+ switch (_a.label) {
262
+ case 0:
263
+ body = new EthereumRPCBody('eth_getTransactionReceipt', [transactionHash]);
264
+ return [4 /*yield*/, this.send(body)];
265
+ case 1:
266
+ response = _a.sent();
267
+ return [2 /*return*/, response.result.status === '0x1' ? { type: 'applied' } : { type: 'failed' }];
268
+ }
269
+ });
270
+ });
271
+ };
272
+ HttpEthereumNodeClient.prototype.callBalanceOf = function (contractAddress, address) {
273
+ return __awaiter(this, void 0, void 0, function () {
274
+ var body, response;
275
+ return __generator(this, function (_a) {
276
+ switch (_a.label) {
277
+ case 0:
278
+ body = this.balanceOfBody(contractAddress, address);
279
+ return [4 /*yield*/, this.send(body)];
280
+ case 1:
281
+ response = _a.sent();
282
+ return [2 /*return*/, new bignumber_1.BigNumber(response.result)];
283
+ }
284
+ });
285
+ });
286
+ };
287
+ HttpEthereumNodeClient.prototype.callBalanceOfOnContracts = function (contractAddresses, address) {
288
+ return __awaiter(this, void 0, void 0, function () {
289
+ var bodies, responses, result;
290
+ var _this = this;
291
+ return __generator(this, function (_a) {
292
+ switch (_a.label) {
293
+ case 0:
294
+ bodies = contractAddresses.map(function (contractAddress, index) { return _this.balanceOfBody(contractAddress, address, index); });
295
+ return [4 /*yield*/, this.batchSend(bodies)];
296
+ case 1:
297
+ responses = _a.sent();
298
+ result = {};
299
+ responses.forEach(function (response) {
300
+ var _a;
301
+ result[contractAddresses[response.id]] = new bignumber_1.BigNumber((_a = response.result) !== null && _a !== void 0 ? _a : 0);
302
+ });
303
+ return [2 /*return*/, result];
304
+ }
305
+ });
306
+ });
307
+ };
308
+ HttpEthereumNodeClient.prototype.balanceOfBody = function (contractAddress, address, id) {
309
+ if (id === void 0) { id = 0; }
310
+ var data = new EthereumRPCDataBalanceOf(address);
311
+ return this.contractCallBody(contractAddress, data, [EthereumRPCBody.blockLatest], id);
312
+ };
313
+ HttpEthereumNodeClient.prototype.estimateTransactionGas = function (fromAddress, toAddress, amount, data, gas) {
314
+ return __awaiter(this, void 0, void 0, function () {
315
+ var body, response;
316
+ return __generator(this, function (_a) {
317
+ switch (_a.label) {
318
+ case 0:
319
+ body = new EthereumRPCBody('eth_estimateGas', [{ from: fromAddress, to: toAddress, gas: gas, value: amount, data: data }]);
320
+ return [4 /*yield*/, this.send(body)];
321
+ case 1:
322
+ response = _a.sent();
323
+ return [2 /*return*/, new bignumber_1.BigNumber(response.result)];
324
+ }
325
+ });
326
+ });
327
+ };
328
+ HttpEthereumNodeClient.prototype.estimateTransferGas = function (contractAddress, fromAddress, toAddress, hexAmount) {
329
+ return __awaiter(this, void 0, void 0, function () {
330
+ var data, result;
331
+ return __generator(this, function (_a) {
332
+ data = new EthereumRPCDataTransfer(toAddress, hexAmount);
333
+ result = this.estimateTransactionGas(fromAddress, contractAddress, undefined, data.abiEncoded());
334
+ return [2 /*return*/, result];
335
+ });
336
+ });
337
+ };
338
+ HttpEthereumNodeClient.prototype.getGasPrice = function () {
339
+ return __awaiter(this, void 0, void 0, function () {
340
+ var body, response;
341
+ return __generator(this, function (_a) {
342
+ switch (_a.label) {
343
+ case 0:
344
+ body = new EthereumRPCBody('eth_gasPrice', []);
345
+ return [4 /*yield*/, this.send(body)];
346
+ case 1:
347
+ response = _a.sent();
348
+ return [2 /*return*/, new bignumber_1.BigNumber(response.result)];
349
+ }
350
+ });
351
+ });
352
+ };
353
+ HttpEthereumNodeClient.prototype.getContractName = function (contractAddress) {
354
+ return __awaiter(this, void 0, void 0, function () {
355
+ var data, body, response, result;
356
+ return __generator(this, function (_a) {
357
+ switch (_a.label) {
358
+ case 0:
359
+ data = new EthereumRPCData('name()');
360
+ body = this.contractCallBody(contractAddress, data, [EthereumRPCBody.blockLatest]);
361
+ return [4 /*yield*/, this.send(body)];
362
+ case 1:
363
+ response = _a.sent();
364
+ if (!response.result) {
365
+ return [2 /*return*/, undefined];
366
+ }
367
+ result = EthereumRPCData.abiDecoded(response.result, 'bytes');
368
+ return [2 /*return*/, EthereumUtils_1.EthereumUtils.hexToUtf8(result)];
369
+ }
370
+ });
371
+ });
372
+ };
373
+ HttpEthereumNodeClient.prototype.getContractSymbol = function (contractAddress) {
374
+ return __awaiter(this, void 0, void 0, function () {
375
+ var data, body, response, result;
376
+ return __generator(this, function (_a) {
377
+ switch (_a.label) {
378
+ case 0:
379
+ data = new EthereumRPCData('symbol()');
380
+ body = this.contractCallBody(contractAddress, data, [EthereumRPCBody.blockLatest]);
381
+ return [4 /*yield*/, this.send(body)];
382
+ case 1:
383
+ response = _a.sent();
384
+ if (!response.result) {
385
+ return [2 /*return*/, undefined];
386
+ }
387
+ result = EthereumRPCData.abiDecoded(response.result, 'bytes');
388
+ return [2 /*return*/, EthereumUtils_1.EthereumUtils.hexToUtf8(result)];
389
+ }
390
+ });
391
+ });
392
+ };
393
+ HttpEthereumNodeClient.prototype.getContractDecimals = function (contractAddress) {
394
+ return __awaiter(this, void 0, void 0, function () {
395
+ var data, body, response;
396
+ return __generator(this, function (_a) {
397
+ switch (_a.label) {
398
+ case 0:
399
+ data = new EthereumRPCData('decimals()');
400
+ body = this.contractCallBody(contractAddress, data, [EthereumRPCBody.blockLatest]);
401
+ return [4 /*yield*/, this.send(body)];
402
+ case 1:
403
+ response = _a.sent();
404
+ if (!response.result) {
405
+ return [2 /*return*/, undefined];
406
+ }
407
+ return [2 /*return*/, EthereumUtils_1.EthereumUtils.hexToNumber(response.result).toNumber()];
408
+ }
409
+ });
410
+ });
411
+ };
412
+ HttpEthereumNodeClient.prototype.contractCallBody = function (contractAddress, data, extraParams, id, jsonrpc) {
413
+ if (extraParams === void 0) { extraParams = []; }
414
+ return new EthereumRPCBody('eth_call', __spreadArray([{ to: contractAddress, data: data.abiEncoded() }], extraParams, true), id, jsonrpc);
415
+ };
416
+ HttpEthereumNodeClient.prototype.send = function (body) {
417
+ return __awaiter(this, void 0, void 0, function () {
418
+ var response;
419
+ return __generator(this, function (_a) {
420
+ switch (_a.label) {
421
+ case 0: return [4 /*yield*/, axios_0_19_0_1.default.post(this.baseURL, body.toRPCBody(), { headers: this.headers }).catch(function (error) {
422
+ throw new errors_1.NetworkError(coinlib_error_1.Domain.ETHEREUM, error);
423
+ })];
424
+ case 1:
425
+ response = _a.sent();
426
+ return [2 /*return*/, response.data];
427
+ }
428
+ });
429
+ });
430
+ };
431
+ HttpEthereumNodeClient.prototype.batchSend = function (bodies) {
432
+ return __awaiter(this, void 0, void 0, function () {
433
+ var response;
434
+ return __generator(this, function (_a) {
435
+ switch (_a.label) {
436
+ case 0: return [4 /*yield*/, axios_0_19_0_1.default
437
+ .post(this.baseURL, JSON.stringify(bodies.map(function (body) { return body.toJSON(); })), { headers: this.headers })
438
+ .catch(function (error) {
439
+ throw new errors_1.NetworkError(coinlib_error_1.Domain.ETHEREUM, error);
440
+ })];
441
+ case 1:
442
+ response = _a.sent();
443
+ return [2 /*return*/, response.data];
444
+ }
445
+ });
446
+ });
447
+ };
448
+ return HttpEthereumNodeClient;
449
+ }());
450
+ exports.HttpEthereumNodeClient = HttpEthereumNodeClient;
451
+ //# sourceMappingURL=HttpEthereumNodeClient.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HttpEthereumNodeClient.js","sourceRoot":"","sources":["../../../../src/v1/clients/node/HttpEthereumNodeClient.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAuC;AACvC,mEAAiE;AACjE,0GAA4F;AAC5F,sGAAoG;AACpG,4DAAqG;AACrG,iFAAwE;AAExE,2DAAwD;AAGxD,2DAAyD;AAIzD;IAAqC,mCAAO;IAA5C;;IAiBA,CAAC;IAZQ,mCAAS,GAAhB;QACE,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAA;IACtC,CAAC;IAEM,gCAAM,GAAb;QACE,OAAO;YACL,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,EAAE,EAAE,IAAI,CAAC,EAAE;SACZ,CAAA;IACH,CAAC;IAfa,6BAAa,GAAW,U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,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,SAAS,EAAE,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,UAAC,KAAK;4BACvG,MAAM,IAAI,qBAAY,CAAC,sBAAM,CAAC,QAAQ,EAAE,KAAmB,CAAC,CAAA;wBAC9D,CAAC,CAAC,EAAA;;wBAFI,QAAQ,GAAG,SAEf;wBAEF,sBAAO,QAAQ,CAAC,IAAI,EAAA;;;;KACrB;IAEe,0CAAS,GAAzB,UAA0B,MAAyB;;;;;4BAChC,qBAAM,sBAAK;6BACzB,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,UAAC,IAAI,IAAK,OAAA,IAAI,CAAC,MAAM,EAAE,EAAb,CAAa,CAAC,CAAC,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC;6BAClG,KAAK,CAAC,UAAC,KAAK;4BACX,MAAM,IAAI,qBAAY,CAAC,sBAAM,CAAC,QAAQ,EAAE,KAAmB,CAAC,CAAA;wBAC9D,CAAC,CAAC,EAAA;;wBAJE,QAAQ,GAAG,SAIb;wBAEJ,sBAAO,QAAQ,CAAC,IAAI,EAAA;;;;KACrB;IACH,6BAAC;AAAD,CAAC,AA5JD,IA4JC;AA5JY,wDAAsB"}
@@ -0,0 +1,7 @@
1
+ import { ExtendedPublicKey, PublicKey } from '@wallfree-dev/module-kit';
2
+ export declare class EthereumAddress {
3
+ private readonly value;
4
+ private constructor();
5
+ static from(publicKey: PublicKey | ExtendedPublicKey): EthereumAddress;
6
+ asString(): string;
7
+ }
@@ -0,0 +1,46 @@
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.EthereumAddress = void 0;
27
+ // @ts-ignore
28
+ var ethUtil = __importStar(require("@wallfree-dev/coinlib-core/dependencies/src/ethereumjs-util-5.2.0"));
29
+ var key_1 = require("../utils/key");
30
+ var EthereumAddress = /** @class */ (function () {
31
+ function EthereumAddress(value) {
32
+ this.value = value;
33
+ }
34
+ EthereumAddress.from = function (publicKey) {
35
+ var hexPublicKey = publicKey.type === 'pub' ? (0, key_1.convertPublicKey)(publicKey, 'hex') : (0, key_1.convertExtendedPublicKey)(publicKey, 'hex');
36
+ var bufferPublicKey = Buffer.from(hexPublicKey.value, 'hex');
37
+ var address = ethUtil.toChecksumAddress(ethUtil.pubToAddress(bufferPublicKey, true).toString('hex'));
38
+ return new EthereumAddress(address);
39
+ };
40
+ EthereumAddress.prototype.asString = function () {
41
+ return this.value;
42
+ };
43
+ return EthereumAddress;
44
+ }());
45
+ exports.EthereumAddress = EthereumAddress;
46
+ //# sourceMappingURL=EthereumAddress.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EthereumAddress.js","sourceRoot":"","sources":["../../../src/v1/data/EthereumAddress.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,aAAa;AACb,yGAA4F;AAG5F,oCAAyE;AAEzE;IACE,yBAAqC,KAAa;QAAb,UAAK,GAAL,KAAK,CAAQ;IAAG,CAAC;IAExC,oBAAI,GAAlB,UAAmB,SAAwC;QACzD,IAAM,YAAY,GAChB,SAAS,CAAC,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,IAAA,sBAAgB,EAAC,SAAS,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,IAAA,8BAAwB,EAAC,SAAS,EAAE,KAAK,CAAC,CAAA;QAC5G,IAAM,eAAe,GAAW,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;QAEtE,IAAM,OAAO,GAAW,OAAO,CAAC,iBAAiB,CAAC,OAAO,CAAC,YAAY,CAAC,eAAe,EAAE,IAAI,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAA;QAE9G,OAAO,IAAI,eAAe,CAAC,OAAO,CAAC,CAAA;IACrC,CAAC;IAEM,kCAAQ,GAAf;QACE,OAAO,IAAI,CAAC,KAAK,CAAA;IACnB,CAAC;IACH,sBAAC;AAAD,CAAC,AAhBD,IAgBC;AAhBY,0CAAe"}
package/v1/index.d.ts ADDED
@@ -0,0 +1,30 @@
1
+ import { EtherscanBlockExplorer } from './block-explorer/EtherscanBlockExplorer';
2
+ import { EthereumInfoClient } from './clients/info/EthereumInfoClient';
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
+ import { erc20Tokens } from './module/ERC20Tokens';
7
+ import { EthereumModule } from './module/EthereumModule';
8
+ import { ERC20Protocol, ERC20ProtocolImpl } from './protocol/erc20/ERC20Protocol';
9
+ import { createERC20Token, ERC20Token, ERC20TokenImpl } from './protocol/erc20/ERC20Token';
10
+ import { DEFAULT_ETHEREUM_UNITS_METADATA, EthereumBaseProtocol, EthereumBaseProtocolImpl } from './protocol/EthereumBaseProtocol';
11
+ 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
+ import { isAnyEthereumProtocol, isEthereumERC20Protocol, isEthereumERC20Token, isEthereumProtocol } from './utils/protocol';
22
+ export { EthereumModule };
23
+ export { EthereumBaseProtocol, EthereumBaseProtocolImpl, EthereumProtocol, createEthereumProtocol, createEthereumProtocolOptions, ERC20Protocol, ERC20ProtocolImpl, ERC20Token, ERC20TokenImpl, createERC20Token };
24
+ export { EtherscanBlockExplorer };
25
+ 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 };
30
+ export { erc20Tokens };
package/v1/index.js ADDED
@@ -0,0 +1,43 @@
1
+ "use strict";
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;
4
+ var EtherscanBlockExplorer_1 = require("./block-explorer/EtherscanBlockExplorer");
5
+ Object.defineProperty(exports, "EtherscanBlockExplorer", { enumerable: true, get: function () { return EtherscanBlockExplorer_1.EtherscanBlockExplorer; } });
6
+ var EthereumInfoClient_1 = require("./clients/info/EthereumInfoClient");
7
+ Object.defineProperty(exports, "EthereumInfoClient", { enumerable: true, get: function () { return EthereumInfoClient_1.EthereumInfoClient; } });
8
+ var EtherscanInfoClient_1 = require("./clients/info/EtherscanInfoClient");
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
+ var ERC20Tokens_1 = require("./module/ERC20Tokens");
15
+ Object.defineProperty(exports, "erc20Tokens", { enumerable: true, get: function () { return ERC20Tokens_1.erc20Tokens; } });
16
+ var EthereumModule_1 = require("./module/EthereumModule");
17
+ 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
+ var ERC20Token_1 = require("./protocol/erc20/ERC20Token");
21
+ Object.defineProperty(exports, "createERC20Token", { enumerable: true, get: function () { return ERC20Token_1.createERC20Token; } });
22
+ Object.defineProperty(exports, "ERC20TokenImpl", { enumerable: true, get: function () { return ERC20Token_1.ERC20TokenImpl; } });
23
+ var EthereumBaseProtocol_1 = require("./protocol/EthereumBaseProtocol");
24
+ Object.defineProperty(exports, "DEFAULT_ETHEREUM_UNITS_METADATA", { enumerable: true, get: function () { return EthereumBaseProtocol_1.DEFAULT_ETHEREUM_UNITS_METADATA; } });
25
+ Object.defineProperty(exports, "EthereumBaseProtocolImpl", { enumerable: true, get: function () { return EthereumBaseProtocol_1.EthereumBaseProtocolImpl; } });
26
+ var EthereumProtocol_1 = require("./protocol/EthereumProtocol");
27
+ Object.defineProperty(exports, "createEthereumProtocol", { enumerable: true, get: function () { return EthereumProtocol_1.createEthereumProtocol; } });
28
+ 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
+ var protocol_1 = require("./utils/protocol");
39
+ Object.defineProperty(exports, "isAnyEthereumProtocol", { enumerable: true, get: function () { return protocol_1.isAnyEthereumProtocol; } });
40
+ Object.defineProperty(exports, "isEthereumERC20Protocol", { enumerable: true, get: function () { return protocol_1.isEthereumERC20Protocol; } });
41
+ Object.defineProperty(exports, "isEthereumERC20Token", { enumerable: true, get: function () { return protocol_1.isEthereumERC20Token; } });
42
+ Object.defineProperty(exports, "isEthereumProtocol", { enumerable: true, get: function () { return protocol_1.isEthereumProtocol; } });
43
+ //# sourceMappingURL=index.js.map
@@ -0,0 +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"}
@@ -0,0 +1,3 @@
1
+ import { ERC20TokenMetadata } from '../types/protocol';
2
+ export declare const erc20Tokens: Record<string, ERC20TokenMetadata>;
3
+ export declare const erc20TokensIdentifiers: string[];