ethereumjs-tx-keyvault
Advanced tools
Comparing version 1.0.1 to 1.0.2
36
index.js
@@ -17,3 +17,3 @@ "use strict" | ||
var makeCanonical = function(buffer) { | ||
var makeCanonical = function (buffer) { | ||
var r = new BN(buffer.slice(0, 32)) | ||
@@ -25,13 +25,5 @@ var s = new BN(buffer.slice(32, 64)) | ||
} | ||
return Buffer.concat([ r.toBuffer(), s.toBuffer() ]) | ||
return Buffer.concat([r.toBuffer(), s.toBuffer()]) | ||
} | ||
const txParams = { | ||
nonce: '0x34f', // Replace by nonce for your account on geth node | ||
gasPrice: '0x09184e72a000', | ||
gasLimit: '0x27100', | ||
to: '0x0d8e50b8849f59f25078bb9e2d9014b9a540dcab', | ||
value: '0xde0b6b3a7640000' | ||
}; | ||
var Extensions = function () { | ||
@@ -41,11 +33,11 @@ function Extensions() { | ||
/** | ||
* Signs a transaction using azure key vault | ||
* @param {EthereumTx} tx the transaction object to sign | ||
* @param {KeyVault.KeyVaultClient} client the key vault client object | ||
* @param {String} vaultUri the vault URI | ||
* @param {String} keyName the name of the EC key | ||
* @param {String} keyVersion the version of the key | ||
* @return {Buffer} the signed transaction object | ||
*/ | ||
/** | ||
* Signs a transaction using azure key vault | ||
* @param {EthereumTx} tx the transaction object to sign | ||
* @param {KeyVault.KeyVaultClient} client the key vault client object | ||
* @param {String} vaultUri the vault URI | ||
* @param {String} keyName the name of the EC key | ||
* @param {String} keyVersion the version of the key | ||
* @return {Buffer} the signed transaction object | ||
*/ | ||
Extensions.prototype.sign = function (tx, client, vaultUri, keyName, keyVersion) { | ||
@@ -68,7 +60,7 @@ assert.equal(true, tx instanceof EthereumTx, "Transaction must be of type 'require(\"ethereumjs-tx\")'") | ||
} | ||
const pubKey = Buffer.concat([ Uint8Array.from([4]), getKeyBundle.key.x, getKeyBundle.key.y]) | ||
const pubKey = Buffer.concat([Uint8Array.from([4]), getKeyBundle.key.x, getKeyBundle.key.y]) | ||
const sig = makeCanonical(Buffer.from(signature.result)) | ||
var sigObj = { | ||
r: sig.slice(0, 32), | ||
var sigObj = { | ||
r: sig.slice(0, 32), | ||
s: sig.slice(32, 64) | ||
@@ -75,0 +67,0 @@ } |
{ | ||
"name": "ethereumjs-tx-keyvault", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Azure Key Vault extensions for ethereumjs-tx", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
5808
4
1
32
68