UNPKG

@0xcert/ethereum-gateway-contracts

Version:

Smart contracts used by the gateway on the Ethereum blockchain.

25 lines 1.24 kB
"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.getSignature = void 0; function getSignature(web3, claim, address) { return __awaiter(this, void 0, void 0, function* () { const signature = yield web3.eth.sign(claim, address); return { r: signature.substr(0, 66), s: `0x${signature.substr(66, 64)}`, v: parseInt(`0x${signature.substr(130, 2)}`) + 27, kind: 0, }; }); } exports.getSignature = getSignature; //# sourceMappingURL=signature.js.map