Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@masa-finance/masa-cli

Package Overview
Dependencies
Maintainers
5
Versions
114
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@masa-finance/masa-cli - npm Package Compare versions

Comparing version 0.3.0 to 0.3.1

16

CHANGELOG.md

@@ -7,2 +7,18 @@ ### Changelog

#### [v0.3.1](https://github.com/masa-finance/masa-cli/compare/v0.3.0...v0.3.1)
> 8 November 2022
- full 2fa support [`f5d6fe7`](https://github.com/masa-finance/masa-cli/commit/f5d6fe74fb733d218e849e8e2af7780df5f1cb8e)
- added phone number as a parameter for 2fa [`4c6052d`](https://github.com/masa-finance/masa-cli/commit/4c6052d8c31741205468ffc3953448876c593e74)
- optimize logging [`f37a645`](https://github.com/masa-finance/masa-cli/commit/f37a6454f6038f018e0c3c2070b3f3806363f799)
#### [v0.3.0](https://github.com/masa-finance/masa-cli/compare/v0.2.3...v0.3.0)
> 3 November 2022
- update sdk [`ee6b71c`](https://github.com/masa-finance/masa-cli/commit/ee6b71c6fccc8975f4232b2d5b89cdb2dde80f2e)
- rollback docs [`1acdeef`](https://github.com/masa-finance/masa-cli/commit/1acdeefcfa025e250151e1038f87bb0980c24e8f)
- automate readme deployment [`a9b27be`](https://github.com/masa-finance/masa-cli/commit/a9b27be16faaa48ddba54d18bfb0ccf190a6ca96)
#### [v0.2.3](https://github.com/masa-finance/masa-cli/compare/v0.2.2...v0.2.3)

@@ -9,0 +25,0 @@

4

dist/package.json
{
"name": "@masa-finance/masa-cli",
"version": "0.2.3",
"version": "0.3.1",
"description": "The Masa CLI",

@@ -19,3 +19,3 @@ "main": "index.js",

"dependencies": {
"@masa-finance/masa-sdk": "^0.2.0",
"@masa-finance/masa-sdk": "^0.3.0",
"@types/clear": "^0.1.2",

@@ -22,0 +22,0 @@ "@types/figlet": "^1.5.5",

@@ -126,10 +126,10 @@ "use strict";

{
const twofa = commander_1.program.command("2fa").description("2fa Commands");
const twofa = commander_1.program.command("2fa").description("2FA Commands");
twofa
.command("info")
.description("Shows info about all 2fas")
.description("Shows info about all 2FAs")
.action(() => __awaiter(void 0, void 0, void 0, function* () { return yield (0, _2fa_1.twofaInfo)(); }));
twofa
.command("list")
.description("Lists your 2fas")
.description("Lists your 2FAs")
.option("-a, --address <address>", "Address override")

@@ -139,8 +139,9 @@ .action(({ address }) => __awaiter(void 0, void 0, void 0, function* () { return yield (0, _2fa_1.twofaList)(address); }));

.command("create")
.description("Creates a 2fa Token")
.action(() => __awaiter(void 0, void 0, void 0, function* () { return yield (0, _2fa_1.twofaCreate)(); }));
.argument("<phone-number>", "The phone number to verify")
.description("Creates a 2FA Token")
.action((phoneNumber) => __awaiter(void 0, void 0, void 0, function* () { return yield (0, _2fa_1.twofaCreate)(phoneNumber); }));
twofa
.command("burn")
.argument("<2fa-id>", "ID of the 2fa to burn")
.description("Burns a 2fa")
.argument("<2fa-id>", "ID of the 2FA to burn")
.description("Burns a 2FA")
.action((twofaId) => __awaiter(void 0, void 0, void 0, function* () { return yield (0, _2fa_1.twofaBurn)(twofaId); }));

@@ -147,0 +148,0 @@ }

@@ -1,1 +0,1 @@

export declare const create: () => Promise<void>;
export declare const create: (phoneNumber: string) => Promise<void>;
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

@@ -14,5 +37,25 @@ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }

const masa_1 = require("../../helpers/masa");
const create = () => __awaiter(void 0, void 0, void 0, function* () {
yield masa_1.masa.twofa.create();
const readline = __importStar(require("readline"));
const process_1 = require("process");
const read = (question) => {
const rl = readline.createInterface({ input: process_1.stdin, output: process_1.stdout });
return new Promise((resolve) => {
rl.question(question, (result) => {
rl.close();
return resolve(result);
});
});
};
const create = (phoneNumber) => __awaiter(void 0, void 0, void 0, function* () {
if (yield masa_1.masa.session.checkLogin()) {
const address = yield masa_1.masa.config.wallet.getAddress();
console.log(`Creating 2FA for phone number: '${phoneNumber}'`);
const identityId = yield masa_1.masa.identity.load(address);
if (!identityId)
return;
yield masa_1.masa.twofa.generate(phoneNumber);
const code = yield read("The code that has been sent to your Phonenumber: ");
yield masa_1.masa.twofa.create(phoneNumber, code);
}
});
exports.create = create;

@@ -16,6 +16,6 @@ "use strict";

const identityContracts = yield masa_1.masa.contracts.loadIdentityContracts();
console.log("Soulbound 2fa");
console.log(`Contract Address: ${identityContracts.Soulbound2FA.address}`);
console.log(`Total 2fas: ${(yield identityContracts.Soulbound2FA.totalSupply()).toNumber()}`);
console.log("Soulbound 2FA");
console.log(`Contract Address: '${identityContracts.Soulbound2FA.address}'`);
console.log(`Total 2FAs: ${(yield identityContracts.Soulbound2FA.totalSupply()).toNumber()}`);
});
exports.info = info;

@@ -17,5 +17,5 @@ "use strict";

console.log("Soulbound Credit Report");
console.log(`Contract Address: ${identityContracts.SoulboundCreditReportContract.address}`);
console.log(`Contract Address: '${identityContracts.SoulboundCreditReportContract.address}'`);
console.log(`Total Credit Reports: ${(yield identityContracts.SoulboundCreditReportContract.totalSupply()).toNumber()}`);
});
exports.info = info;

@@ -17,5 +17,5 @@ "use strict";

console.log("Soulbound Identity");
console.log(`Contract Address: ${identityContracts.SoulboundIdentityContract.address}`);
console.log(`Contract Address: '${identityContracts.SoulboundIdentityContract.address}'`);
console.log(`Total Identities: ${(yield identityContracts.SoulboundIdentityContract.totalSupply()).toNumber()}`);
});
exports.info = info;

@@ -18,3 +18,2 @@ "use strict";

if (result) {
console.log("cookie", result.cookie);
config_1.config.set("cookie", result.cookie);

@@ -21,0 +20,0 @@ }

@@ -9,2 +9,8 @@ "use strict";

console.log(`Key '${key}' successfully set!`);
switch (key) {
case "private-key":
case "network":
case "environment":
config_1.config.delete("cookie");
}
};

@@ -15,2 +21,4 @@ exports.settingsSet = settingsSet;

if (preset) {
// delete cookie on env change
config_1.config.delete("cookie");
config_1.config.set("api-url", preset.apiUrl);

@@ -17,0 +25,0 @@ config_1.config.set("environment", preset.environment);

@@ -17,5 +17,5 @@ "use strict";

console.log("Soul Name");
console.log(`Contract Address: ${identityContracts.SoulNameContract.address}`);
console.log(`Contract Address: '${identityContracts.SoulNameContract.address}'`);
console.log(`Total Soul Names: ${(yield identityContracts.SoulNameContract.totalSupply()).toNumber()}`);
});
exports.info = info;
{
"name": "@masa-finance/masa-cli",
"version": "0.3.0",
"version": "0.3.1",
"description": "The Masa CLI",

@@ -19,3 +19,3 @@ "main": "index.js",

"dependencies": {
"@masa-finance/masa-sdk": "^0.2.0",
"@masa-finance/masa-sdk": "^0.3.0",
"@types/clear": "^0.1.2",

@@ -22,0 +22,0 @@ "@types/figlet": "^1.5.5",

@@ -86,6 +86,6 @@ # Masa CLI

2fa 2fa Commands
2fa info Shows info about all 2fas
2fa list [options] Lists your 2fas
2fa create Creates a 2fa Token
2fa burn <2fa-id> Burns a 2fa
2fa info Shows info about all 2FAs
2fa list [options] Lists your 2FAs
2fa create <phone-number> Creates a 2FA Token
2fa burn <2fa-id> Burns a 2FA
settings Set config settings

@@ -245,11 +245,11 @@ settings set <key> <value> Changes setting <key> to <value>

2fa Commands
2FA Commands
#### `masa 2fa info`
Shows info about all 2fas
Shows info about all 2FAs
#### `masa 2fa list`
Lists your 2fas
Lists your 2FAs

@@ -261,11 +261,13 @@ Options:

#### `masa 2fa create`
#### `masa 2fa create <phone-number>`
Creates a 2fa Token
Creates a 2FA Token
- `<phone-number> The phone number to verify`
#### `masa 2fa burn <2fa-id>`
Burns a 2fa
Burns a 2FA
- `<2fa-id> ID of the 2fa to burn`
- `<2fa-id> ID of the 2FA to burn`

@@ -272,0 +274,0 @@ ### `masa settings`

Sorry, the diff of this file is not supported yet

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