mobilestacks 0.1.19 → 0.1.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -19,10 +19,12 @@ function containsSecret(obj) {
|
|
|
19
19
|
.addParam('contractName', 'Name of the contract', { type: 'string', required: true })
|
|
20
20
|
.addParam('file', 'Path to Clarity contract file', { type: 'string', required: true })
|
|
21
21
|
.addParam('network', 'Network to deploy to (mainnet|testnet)', { type: 'string', required: false, defaultValue: 'testnet' })
|
|
22
|
+
.addParam('clarityVersion', 'Version of Clarity to use (1|2|3|4)', { type: 'number', required: false, defaultValue: 2 })
|
|
22
23
|
.setAction(async (args, env) => {
|
|
23
24
|
const contractName = args.contractName;
|
|
24
25
|
const file = args.file;
|
|
25
26
|
const network = args.network;
|
|
27
|
+
const clarityVersion = args.clarityVersion;
|
|
26
28
|
let codeBody = fs_1.default.readFileSync(file, 'utf8');
|
|
27
29
|
codeBody = codeBody.replace(/\r\n/g, '\n').replace(/\r/g, '\n');
|
|
28
30
|
codeBody = codeBody.replace(/^\uFEFF/, '').replace(/[^\x20-\x7E\n\t]/g, '');
|
|
@@ -32,12 +34,14 @@ function containsSecret(obj) {
|
|
|
32
34
|
else {
|
|
33
35
|
env.network = (0, network_1.createNetwork)({ network: 'testnet', client: { baseUrl: env.config.networks.testnet.url } });
|
|
34
36
|
}
|
|
35
|
-
const
|
|
37
|
+
const txOptions = {
|
|
36
38
|
contractName,
|
|
37
39
|
codeBody,
|
|
40
|
+
clarityVersion,
|
|
38
41
|
senderKey: env.wallet.privateKey,
|
|
39
42
|
network: env.network,
|
|
40
|
-
}
|
|
43
|
+
};
|
|
44
|
+
const tx = await (0, transactions_1.makeContractDeploy)(txOptions);
|
|
41
45
|
const result = await (0, transactions_1.broadcastTransaction)({ transaction: tx, network: env.network });
|
|
42
46
|
if (containsSecret(result)) {
|
|
43
47
|
console.warn('[mobilestacks] Warning: Output may contain sensitive data.');
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mobilestacks",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.1.21",
|
|
4
|
+
"description": "Task Runner & CLI for the Stacks Blockchain",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"bin": {
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
61
|
"@stacks/network": "latest",
|
|
62
|
-
"@stacks/transactions": "
|
|
62
|
+
"@stacks/transactions": "^7.3.1",
|
|
63
63
|
"@stacks/wallet-sdk": "latest",
|
|
64
64
|
"chalk": "^4.1.2",
|
|
65
65
|
"commander": "^11.0.0",
|