pull/481/head
Yannick Huard 3 years ago
parent 874c9cccaa
commit b992a91ca8
  1. 1
      .babelrc
  2. 13
      dist/es/tx-data-by-compiled.js
  3. 4
      dist/lib/create-identity.js
  4. 6
      dist/lib/index.js
  5. 4
      dist/lib/recover.js
  6. 4
      dist/lib/sign-transaction.js
  7. 18
      dist/lib/tx-data-by-compiled.js
  8. 2
      package.json

@ -1,5 +1,6 @@
{
"presets": ["@babel/preset-env"],
"plugins": ["@babel/plugin-transform-runtime"],
"env": {
"es6": {
"presets": [

@ -1,15 +1,4 @@
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
import { ContractFactory } from 'ethers';
export default function txDataByCompiled(abi, bytecode, args) {
// solc returns a string which is often passed instead of the json

@ -1,5 +1,7 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
@ -14,8 +16,6 @@ var _hash = require("eth-lib/lib/hash");
var _bytes = _interopRequireDefault(require("eth-lib/lib/bytes"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
var MIN_ENTROPY_SIZE = 128;
/**
* create a privateKey from the given entropy or a new one

6
dist/lib/index.js vendored

@ -1,6 +1,8 @@
"use strict";
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _typeof = require("@babel/runtime/helpers/typeof");
Object.defineProperty(exports, "__esModule", {
value: true
@ -115,8 +117,6 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
var _default = {
createIdentity: _createIdentity["default"],
publicKey: publicKey,

@ -1,5 +1,7 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
@ -9,8 +11,6 @@ var _recoverPublicKey = _interopRequireDefault(require("./recover-public-key"));
var _publicKey = require("./public-key");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
/**
* returns the adress with which the messageHash was signed
* @param {string} sigString

@ -1,5 +1,7 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
@ -11,8 +13,6 @@ var _publicKeyByPrivateKey = _interopRequireDefault(require("./public-key-by-pri
var _publicKey = require("./public-key");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function signTransaction(rawTx, privateKey) {
var txOptions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
// check if privateKey->address matches rawTx.from

@ -1,29 +1,21 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = txDataByCompiled;
var _ethers = require("ethers");
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
var _ethers = require("ethers");
function txDataByCompiled(abi, bytecode, args) {
// solc returns a string which is often passed instead of the json
if (typeof abi === 'string') abi = JSON.parse(abi); // Construct a Contract Factory
var factory = new _ethers.ContractFactory(abi, '0x' + bytecode);
var deployTransaction = factory.getDeployTransaction.apply(factory, _toConsumableArray(args));
var deployTransaction = factory.getDeployTransaction.apply(factory, (0, _toConsumableArray2["default"])(args));
return deployTransaction.data;
}

@ -51,6 +51,7 @@
"devDependencies": {
"@babel/cli": "^7.15.4",
"@babel/core": "^7.0.0",
"@babel/plugin-transform-runtime": "^7.15.0",
"@babel/preset-env": "^7.0.0",
"assert": "2.0.0",
"async-test-util": "1.7.3",
@ -93,6 +94,7 @@
"webpack-cli": "4.8.0"
},
"dependencies": {
"@babel/runtime": "^7.15.4",
"@ethereumjs/tx": "3.3.0",
"@types/bn.js": "5.1.0",
"eccrypto": "1.1.6",

Loading…
Cancel
Save