Socket
Socket
Sign inDemoInstall

suidouble

Package Overview
Dependencies
Maintainers
0
Versions
60
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

suidouble - npm Package Compare versions

Comparing version 1.6.0-1 to 1.6.0-2

12

lib/SuiMaster.js

@@ -17,2 +17,3 @@ const SuiCommonMethods = require('./SuiCommonMethods.js');

const { Transaction, Commands } = require('@mysten/sui/transactions');
const { decodeSuiPrivateKey } = require('@mysten/sui/cryptography');

@@ -40,2 +41,13 @@

this._keypair = params.keypair;
} else if (params.privateKey) {
const parsed = decodeSuiPrivateKey(params.privateKey);
if (parsed && parsed.schema) {
if (parsed.schema === 'ED25519') {
this._keypair = Ed25519Keypair.fromSecretKey(parsed.secretKey);
} else if (parsed.schema == 'Secp256k1') {
this._keypair = Secp256k1Keypair.fromSecretKey(parsed.secretKey);
} else if (parsed.schema == 'Secp256r1') {
this._keypair = Secp256r1Keypair.fromSecretKey(parsed.secretKey);
}
}
} else if (params.phrase) {

@@ -42,0 +54,0 @@ if (params.keypairAlgo && (''+params.keypairAlgo).toLowerCase() == 'secp256r1') {

5

package.json
{
"name": "suidouble",
"version": "1.6.0-1",
"version": "1.6.0-2",
"description": "Set of provider, package and object classes for javascript representation of Sui Move smart contracts. Use same code for publishing, upgrading, integration testing, interaction with smart contracts and integration in browser web3 dapps",

@@ -36,4 +36,3 @@ "main": "index.js",

},
"tap": {
}
"tap": {}
}

7

README.md

@@ -49,3 +49,3 @@ # suidouble

You can initialize it directly, if you have keypair, secret phrase and can use it in code (so on node.js side - server side or CLI apps):
You can initialize it directly, if you have keypair, secret phrase, or privateKey and can use it in code (so on node.js side - server side or CLI apps):
```javascript

@@ -59,2 +59,7 @@ const suiMaster = new SuiMaster({

debug: false,
privateKey: 'suiprivkey1qpwly9xrfsv50mqug706s40l58klez5q6mpchq4f5ldzktjyr4x7yhj9lf2',
client: 'dev',
});
const suiMaster = new SuiMaster({
debug: false,
phrase: 'thrive mean two thrive mean two thrive mean two thrive mean two', // secret phrase to generate keypair

@@ -61,0 +66,0 @@ client: 'dev',

@@ -42,2 +42,11 @@ 'use strict'

test('keypair generation with privateKey works ok', async t => {
const privateKey = 'suiprivkey1qpwly9xrfsv50mqug706s40l58klez5q6mpchq4f5ldzktjyr4x7yhj9lf2';
const suiMaster = new SuiMaster({client: 'test', privateKey: privateKey});
await suiMaster.initialize();
t.equal(`${suiMaster.address}`, `0x4d07e4a382dcb69288a8a4589e8fc0534378dad76b75565fda0c1e9ada45b7d1`, 'by privateKey generated ok');
});
test('keypair generation with seed phrase works ok', async t => {

@@ -44,0 +53,0 @@ // Ed25519

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc