@masa-finance/masa-cli
Advanced tools
Comparing version 1.6.1 to 1.7.1
@@ -7,2 +7,27 @@ ### Changelog | ||
#### [v1.7.0](https://github.com/masa-finance/masa-cli/compare/v1.6.1...v1.7.0) | ||
> 28 March 2023 | ||
- Bump @typescript-eslint/eslint-plugin from 5.55.0 to 5.56.0 [`#36`](https://github.com/masa-finance/masa-cli/pull/36) | ||
- Bump @types/node from 18.15.3 to 18.15.10 [`#35`](https://github.com/masa-finance/masa-cli/pull/35) | ||
- Bump @typescript-eslint/parser from 5.55.0 to 5.56.0 [`#34`](https://github.com/masa-finance/masa-cli/pull/34) | ||
- Bump prettier from 2.8.5 to 2.8.7 [`#33`](https://github.com/masa-finance/masa-cli/pull/33) | ||
- Bump prettier from 2.8.4 to 2.8.5 [`#32`](https://github.com/masa-finance/masa-cli/pull/32) | ||
- Bump @typescript-eslint/parser from 5.54.1 to 5.55.0 [`#29`](https://github.com/masa-finance/masa-cli/pull/29) | ||
- Bump typescript from 4.9.5 to 5.0.2 [`#30`](https://github.com/masa-finance/masa-cli/pull/30) | ||
- Bump @types/node from 18.15.1 to 18.15.3 [`#31`](https://github.com/masa-finance/masa-cli/pull/31) | ||
- Bump @typescript-eslint/eslint-plugin from 5.54.1 to 5.55.0 [`#28`](https://github.com/masa-finance/masa-cli/pull/28) | ||
- update sdk [`7f65cf4`](https://github.com/masa-finance/masa-cli/commit/7f65cf4570ef467cd7ff852e997ffdf079d1c092) | ||
- adapt changes from the sdk [`d68a7a7`](https://github.com/masa-finance/masa-cli/commit/d68a7a7d5636810b2a2c05d14c1cdce82aae5591) | ||
- update sdk [`aa07c2b`](https://github.com/masa-finance/masa-cli/commit/aa07c2b2ce1fa16d6ce36d10909113ded01d570f) | ||
#### [v1.6.1](https://github.com/masa-finance/masa-cli/compare/v1.6.0...v1.6.1) | ||
> 15 March 2023 | ||
- added preset network feature [`12b671b`](https://github.com/masa-finance/masa-cli/commit/12b671ba366aadb2bb6bc0b14abd643eca458223) | ||
- added network flag to the cli [`75cc23b`](https://github.com/masa-finance/masa-cli/commit/75cc23bf5a3248c38cfdb4579bf1ddb0b1ccaa48) | ||
- update masa sdk [`70f1cc0`](https://github.com/masa-finance/masa-cli/commit/70f1cc0640d25f249c13178ff38677709c1149f7) | ||
#### [v1.6.0](https://github.com/masa-finance/masa-cli/compare/v1.5.0...v1.6.0) | ||
@@ -9,0 +34,0 @@ |
{ | ||
"name": "@masa-finance/masa-cli", | ||
"version": "1.6.0", | ||
"version": "1.7.0", | ||
"description": "The Masa CLI", | ||
@@ -19,3 +19,3 @@ "main": "index.js", | ||
"dependencies": { | ||
"@masa-finance/masa-sdk": "^1.9.5", | ||
"@masa-finance/masa-sdk": "^1.11.5", | ||
"@types/clear": "^0.1.2", | ||
@@ -37,4 +37,4 @@ "@types/figlet": "^1.5.5", | ||
"prettier": "^2.7.1", | ||
"typescript": "^4.8.4" | ||
"typescript": "^5.0.2" | ||
} | ||
} |
@@ -26,3 +26,3 @@ "use strict"; | ||
verbose: undefined, | ||
defaultNetwork: undefined, | ||
networkName: undefined, | ||
}; | ||
@@ -45,3 +45,3 @@ commander_1.program | ||
.option("-n, --network <network>", "Address override", (networkName) => { | ||
overrides.defaultNetwork = networkName; | ||
overrides.networkName = networkName; | ||
(0, helpers_1.reloadMasa)(overrides); | ||
@@ -80,3 +80,3 @@ }) | ||
.description("Creates a masa identity with soul name") | ||
.action((soulName, duration) => __awaiter(void 0, void 0, void 0, function* () { return yield (0, commands_1.identityCreate)("eth", soulName, duration); })); | ||
.action((soulName, duration) => __awaiter(void 0, void 0, void 0, function* () { return yield (0, commands_1.identityCreate)("ETH", soulName, duration); })); | ||
identity | ||
@@ -124,3 +124,3 @@ .command("register") | ||
.description("Creates a new soul name") | ||
.action((soulName, duration) => __awaiter(void 0, void 0, void 0, function* () { return yield (0, commands_1.soulNameCreate)("eth", soulName, duration); })); | ||
.action((soulName, duration) => __awaiter(void 0, void 0, void 0, function* () { return yield (0, commands_1.soulNameCreate)("ETH", soulName, duration); })); | ||
soulName | ||
@@ -164,3 +164,3 @@ .command("burn") | ||
.description("Creates a Credit Score") | ||
.action(() => __awaiter(void 0, void 0, void 0, function* () { return yield (0, commands_1.creditScoreCreate)("eth"); })); | ||
.action(() => __awaiter(void 0, void 0, void 0, function* () { return yield (0, commands_1.creditScoreCreate)("ETH"); })); | ||
creditScore | ||
@@ -189,3 +189,3 @@ .command("burn") | ||
.description("Establishes a link to a Credit Score") | ||
.action((passport) => __awaiter(void 0, void 0, void 0, function* () { return yield (0, commands_1.creditScoreLinkEstablish)("eth", passport); })); | ||
.action((passport) => __awaiter(void 0, void 0, void 0, function* () { return yield (0, commands_1.creditScoreLinkEstablish)("ETH", passport); })); | ||
creditScoreLink | ||
@@ -195,3 +195,3 @@ .command("query") | ||
.description("Queries a link to a Credit Score") | ||
.action((passport) => __awaiter(void 0, void 0, void 0, function* () { return yield (0, commands_1.creditScoreLinkQuery)("eth", passport); })); | ||
.action((passport) => __awaiter(void 0, void 0, void 0, function* () { return yield (0, commands_1.creditScoreLinkQuery)("ETH", passport); })); | ||
creditScoreLink | ||
@@ -230,3 +230,3 @@ .command("list") | ||
.description("Creates a Green Token") | ||
.action((phoneNumber) => __awaiter(void 0, void 0, void 0, function* () { return yield (0, commands_1.greenCreate)("eth", phoneNumber); })); | ||
.action((phoneNumber) => __awaiter(void 0, void 0, void 0, function* () { return yield (0, commands_1.greenCreate)("ETH", phoneNumber); })); | ||
green | ||
@@ -269,3 +269,3 @@ .command("burn") | ||
.action((contractAddress, name, types, value, authorityAddress, signature) => __awaiter(void 0, void 0, void 0, function* () { | ||
return yield (0, commands_1.sbtPrepareMint)("eth", contractAddress, name, types, value, authorityAddress, signature); | ||
return yield (0, commands_1.sbtPrepareMint)("ETH", contractAddress, name, types, value, authorityAddress, signature); | ||
})); | ||
@@ -272,0 +272,0 @@ sbt |
@@ -13,3 +13,2 @@ "use strict"; | ||
exports.account = void 0; | ||
const ethers_1 = require("ethers"); | ||
const helpers_1 = require("../helpers"); | ||
@@ -34,13 +33,10 @@ const account = () => __awaiter(void 0, void 0, void 0, function* () { | ||
// balances | ||
console.log("\nBalances"); | ||
console.log(`ETH '${parseFloat(ethers_1.ethers.utils.formatEther(balances.ethBalance)).toFixed(precision)}'`); | ||
console.log(`MASA '${parseFloat(ethers_1.ethers.utils.formatEther(balances.masaBalance)).toFixed(precision)}'`); | ||
console.log(`USDC '${parseFloat(ethers_1.ethers.utils.formatEther(balances.usdcBalance)).toFixed(precision)}'`); | ||
console.log(`WETH '${parseFloat(ethers_1.ethers.utils.formatEther(balances.wethBalance)).toFixed(precision)}'`); | ||
console.log(`Identity: ${balances.identityBalance.toNumber()}`); | ||
console.log(`Soul Names: ${balances.soulNameBalance.toNumber()}`); | ||
console.log(`Credit Scores: ${balances.soulboundCreditScoreBalance.toNumber()}`); | ||
console.log(`Greens: ${balances.soulboundGreenBalance.toNumber()}`); | ||
console.log("\nBalances:\n"); | ||
for (const [symbol, balance] of Object.entries(balances)) { | ||
if (!isNaN(balance)) { | ||
console.log(`${symbol}: '${balance % 1 === 0 ? balance : balance.toFixed(precision)}'`); | ||
} | ||
} | ||
} | ||
}); | ||
exports.account = account; |
@@ -15,4 +15,7 @@ "use strict"; | ||
const create = (paymentMethod) => __awaiter(void 0, void 0, void 0, function* () { | ||
yield helpers_1.masa.creditScore.create(paymentMethod); | ||
const { success, message } = yield helpers_1.masa.creditScore.create(paymentMethod); | ||
if (!success) { | ||
console.error(message); | ||
} | ||
}); | ||
exports.create = create; |
@@ -18,4 +18,4 @@ "use strict"; | ||
console.log(`Total Credit Scores: ${(yield helpers_1.masa.contracts.instances.SoulboundCreditScoreContract.totalSupply()).toNumber()}`); | ||
console.log(`Network: '${helpers_1.masa.config.network}'`); | ||
console.log(`Network: '${helpers_1.masa.config.networkName}'`); | ||
}); | ||
exports.info = info; |
@@ -16,4 +16,7 @@ "use strict"; | ||
const create = (creditReportId, readerIdentityId) => __awaiter(void 0, void 0, void 0, function* () { | ||
yield helpers_1.masa.creditScore.links.create(ethers_1.BigNumber.from(creditReportId), ethers_1.BigNumber.from(readerIdentityId)); | ||
const { success, message } = yield helpers_1.masa.creditScore.links.create(ethers_1.BigNumber.from(creditReportId), ethers_1.BigNumber.from(readerIdentityId)); | ||
if (!success) { | ||
console.error(message); | ||
} | ||
}); | ||
exports.create = create; |
@@ -38,6 +38,6 @@ "use strict"; | ||
do { | ||
console.log(`Minting Green on '${helpers_1.masa.config.network}'`); | ||
console.log(`Minting Green on '${helpers_1.masa.config.networkName}'`); | ||
mintGreenResult = yield helpers_1.masa.green.mint(paymentMethod, verifyGreenResult.authorityAddress, verifyGreenResult.signatureDate, verifyGreenResult.signature); | ||
if (mintGreenResult && mintGreenResult.tokenId) { | ||
console.log(`Green successfully minted on '${helpers_1.masa.config.network}' with token ID: '${mintGreenResult.tokenId}'`); | ||
console.log(`Green successfully minted on '${helpers_1.masa.config.networkName}' with token ID: '${mintGreenResult.tokenId}'`); | ||
} | ||
@@ -44,0 +44,0 @@ } while (!(mintGreenResult === null || mintGreenResult === void 0 ? void 0 : mintGreenResult.tokenId)); |
@@ -18,4 +18,4 @@ "use strict"; | ||
console.log(`Total Greens: ${(yield helpers_1.masa.contracts.instances.SoulboundGreenContract.totalSupply()).toNumber()}`); | ||
console.log(`Network: '${helpers_1.masa.config.network}'`); | ||
console.log(`Network: '${helpers_1.masa.config.networkName}'`); | ||
}); | ||
exports.info = info; |
@@ -15,8 +15,14 @@ "use strict"; | ||
const create = (paymentMethod, soulName, duration) => __awaiter(void 0, void 0, void 0, function* () { | ||
yield helpers_1.masa.identity.createWithSoulName(paymentMethod, soulName, duration); | ||
const { success, message } = yield helpers_1.masa.identity.createWithSoulName(paymentMethod, soulName, duration); | ||
if (!success) { | ||
console.error(message); | ||
} | ||
}); | ||
exports.create = create; | ||
const register = () => __awaiter(void 0, void 0, void 0, function* () { | ||
yield helpers_1.masa.identity.create(); | ||
const { success, message } = yield helpers_1.masa.identity.create(); | ||
if (!success) { | ||
console.error(message); | ||
} | ||
}); | ||
exports.register = register; |
@@ -18,4 +18,4 @@ "use strict"; | ||
console.log(`Total Identities: ${(yield helpers_1.masa.contracts.instances.SoulboundIdentityContract.totalSupply()).toNumber()}`); | ||
console.log(`Network: '${helpers_1.masa.config.network}'`); | ||
console.log(`Network: '${helpers_1.masa.config.networkName}'`); | ||
}); | ||
exports.info = info; |
@@ -22,3 +22,3 @@ "use strict"; | ||
console.log(`Total SBTs: ${(yield selfSovereignSBT.totalSupply()).toNumber()}`); | ||
console.log(`Network: '${helpers_1.masa.config.network}'`); | ||
console.log(`Network: '${helpers_1.masa.config.networkName}'`); | ||
} | ||
@@ -25,0 +25,0 @@ else { |
@@ -34,3 +34,3 @@ "use strict"; | ||
config_1.config.set("environment", presetEnvironment.environment); | ||
config_1.config.set("network", presetEnvironment.defaultNetwork); | ||
config_1.config.set("network", presetEnvironment.networkName); | ||
if (presetEnvironment.arweave) { | ||
@@ -42,4 +42,4 @@ config_1.config.set("arweave-host", presetEnvironment.arweave.host); | ||
} | ||
if (presetEnvironment.defaultNetwork) { | ||
const network = masa_sdk_1.SupportedNetworks[presetEnvironment.defaultNetwork]; | ||
if (presetEnvironment.networkName) { | ||
const network = masa_sdk_1.SupportedNetworks[presetEnvironment.networkName]; | ||
if (network) { | ||
@@ -46,0 +46,0 @@ config_1.config.set("rpc-url", network.rpcUrls[0]); |
@@ -15,4 +15,7 @@ "use strict"; | ||
const create = (paymentMethod, soulName, duration) => __awaiter(void 0, void 0, void 0, function* () { | ||
yield helpers_1.masa.soulName.create(paymentMethod, soulName, duration); | ||
const { success, message } = yield helpers_1.masa.soulName.create(paymentMethod, soulName, duration); | ||
if (!success) { | ||
console.error(message); | ||
} | ||
}); | ||
exports.create = create; |
@@ -17,5 +17,6 @@ "use strict"; | ||
console.log(`Contract Address: '${helpers_1.masa.contracts.instances.SoulNameContract.address}'`); | ||
console.log(`Extension: '${yield helpers_1.masa.contracts.instances.SoulNameContract.extension()}'`); | ||
console.log(`Total Soul Names: ${(yield helpers_1.masa.contracts.instances.SoulNameContract.totalSupply()).toNumber()}`); | ||
console.log(`Network: '${helpers_1.masa.config.network}'`); | ||
console.log(`Network: '${helpers_1.masa.config.networkName}'`); | ||
}); | ||
exports.info = info; |
@@ -14,5 +14,6 @@ "use strict"; | ||
const helpers_1 = require("../../helpers"); | ||
const masa_sdk_1 = require("@masa-finance/masa-sdk"); | ||
const list = (address) => __awaiter(void 0, void 0, void 0, function* () { | ||
yield helpers_1.masa.soulName.list(address); | ||
yield (0, masa_sdk_1.listSoulNamesAndPrint)(helpers_1.masa, address); | ||
}); | ||
exports.list = list; |
@@ -30,5 +30,3 @@ "use strict"; | ||
console.log("Soul names:", "\n"); | ||
soulNames.map((soulName) => { | ||
console.log(`${soulName}${extension}`); | ||
}); | ||
soulNames.forEach((soulName) => console.log(`${soulName}${extension}`)); | ||
} | ||
@@ -35,0 +33,0 @@ else { |
@@ -1,8 +0,3 @@ | ||
import { Masa, NetworkName } from "@masa-finance/masa-sdk"; | ||
import { Wallet } from "ethers"; | ||
export declare const reloadMasa: (overrideConfig: { | ||
verbose?: boolean; | ||
defaultNetwork?: NetworkName; | ||
wallet?: Wallet; | ||
}) => void; | ||
import { Masa, MasaArgs } from "@masa-finance/masa-sdk"; | ||
export declare const reloadMasa: (overrideConfig: Partial<MasaArgs>) => void; | ||
export declare let masa: Masa; |
@@ -7,8 +7,9 @@ "use strict"; | ||
const ethers_1 = require("ethers"); | ||
const loadWallet = (rpcUrl) => new ethers_1.Wallet(config_1.config.get("private-key"), new ethers_1.providers.JsonRpcProvider(rpcUrl || config_1.config.get("rpc-url"))); | ||
const masaArgs = { | ||
cookie: config_1.config.get("cookie"), | ||
wallet: new ethers_1.Wallet(config_1.config.get("private-key"), new ethers_1.providers.JsonRpcProvider(config_1.config.get("rpc-url"))), | ||
wallet: loadWallet(), | ||
apiUrl: config_1.config.get("api-url"), | ||
environment: config_1.config.get("environment"), | ||
defaultNetwork: config_1.config.get("network"), | ||
networkName: config_1.config.get("network"), | ||
verbose: config_1.config.get("verbose"), | ||
@@ -23,10 +24,11 @@ arweave: { | ||
const reloadMasa = (overrideConfig) => { | ||
if (overrideConfig.defaultNetwork) { | ||
const network = masa_sdk_1.SupportedNetworks[overrideConfig.defaultNetwork]; | ||
if (overrideConfig.networkName) { | ||
const network = masa_sdk_1.SupportedNetworks[overrideConfig.networkName]; | ||
if (network) { | ||
overrideConfig.wallet = new ethers_1.Wallet(config_1.config.get("private-key"), new ethers_1.providers.JsonRpcProvider(network.rpcUrls[0])); | ||
overrideConfig.wallet = loadWallet(network.rpcUrls[0]); | ||
} | ||
else { | ||
console.error(`Network '${overrideConfig.networkName}' not found! Using '${masaArgs.networkName}'`); | ||
// network not found | ||
delete overrideConfig.defaultNetwork; | ||
delete overrideConfig.networkName; | ||
} | ||
@@ -33,0 +35,0 @@ } |
{ | ||
"name": "@masa-finance/masa-cli", | ||
"version": "1.6.1", | ||
"version": "1.7.1", | ||
"description": "The Masa CLI", | ||
@@ -19,3 +19,3 @@ "main": "index.js", | ||
"dependencies": { | ||
"@masa-finance/masa-sdk": "^1.9.5", | ||
"@masa-finance/masa-sdk": "^1.11.5", | ||
"@types/clear": "^0.1.2", | ||
@@ -37,4 +37,4 @@ "@types/figlet": "^1.5.5", | ||
"prettier": "^2.7.1", | ||
"typescript": "^4.8.4" | ||
"typescript": "^5.0.2" | ||
} | ||
} |
# Masa CLI | ||
--- | ||
**🌽🌽 THIS IS BETA SOFTWARE. IT COULD LEAD TO RAPID UNSCHEDULED DISASSEMBLY. If you run into problems, please open up a new issue. 🌽🌽** | ||
--- | ||
<!-- TOC --> | ||
@@ -10,0 +4,0 @@ * [Masa CLI](#masa-cli) |
Sorry, the diff of this file is not supported yet
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
165208
167
2150
487