mobilestacks 0.1.21 → 0.1.22

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.
@@ -20,11 +20,13 @@ function containsSecret(obj) {
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
22
  .addParam('clarityVersion', 'Version of Clarity to use (1|2|3|4)', { type: 'number', required: false, defaultValue: 2 })
23
+ .addParam('fee', 'Custom fee in microSTX', { type: 'number', required: false })
23
24
  .setAction(async (args, env) => {
24
25
  const contractName = args.contractName;
25
26
  const file = args.file;
26
27
  const network = args.network;
27
28
  const clarityVersion = args.clarityVersion;
29
+ const fee = args.fee;
28
30
  let codeBody = fs_1.default.readFileSync(file, 'utf8');
29
31
  codeBody = codeBody.replace(/\r\n/g, '\n').replace(/\r/g, '\n');
30
32
  codeBody = codeBody.replace(/^\uFEFF/, '').replace(/[^\x20-\x7E\n\t]/g, '');
@@ -38,6 +40,7 @@ function containsSecret(obj) {
38
40
  contractName,
39
41
  codeBody,
40
42
  clarityVersion,
43
+ fee: fee !== undefined ? fee : undefined,
41
44
  senderKey: env.wallet.privateKey,
42
45
  network: env.network,
43
46
  };
@@ -30,12 +30,14 @@ function containsSecret(obj) {
30
30
  .addParam('functionName', 'Function name', { type: 'string', required: true })
31
31
  .addParam('args', 'Comma-separated args e.g. u1,"hello",ST...', { type: 'string', required: false, defaultValue: '' })
32
32
  .addParam('network', 'Network (mainnet|testnet)', { type: 'string', required: false, defaultValue: 'testnet' })
33
+ .addParam('fee', 'Custom fee in microSTX', { type: 'number', required: false })
33
34
  .setAction(async (args, env) => {
34
35
  const contractAddress = args.contractAddress;
35
36
  const contractName = args.contractName;
36
37
  const functionName = args.functionName;
37
38
  const fnArgs = args.args;
38
39
  const networkName = args.network;
40
+ const fee = args.fee;
39
41
  const wallet = env.wallet;
40
42
  const networkUrl = networkName === 'mainnet'
41
43
  ? env.config.networks.mainnet.url
@@ -53,6 +55,7 @@ function containsSecret(obj) {
53
55
  contractName,
54
56
  functionName,
55
57
  functionArgs: parsedArgs,
58
+ fee: fee !== undefined ? fee : undefined,
56
59
  senderKey: wallet.privateKey,
57
60
  validateWithAbi: false,
58
61
  network,
@@ -16,11 +16,13 @@ function containsSecret(obj) {
16
16
  .addParam('amount', 'Amount in STX (e.g. 10.5)', { type: 'number', required: true })
17
17
  .addParam('memo', 'Optional memo', { type: 'string', required: false, defaultValue: '' })
18
18
  .addParam('network', 'Network (mainnet|testnet)', { type: 'string', required: false, defaultValue: 'testnet' })
19
+ .addParam('fee', 'Custom fee in microSTX', { type: 'number', required: false })
19
20
  .setAction(async (args, env) => {
20
21
  const to = args.to;
21
22
  const amountSTX = args.amount;
22
23
  const memo = args.memo;
23
24
  const networkName = args.network;
25
+ const fee = args.fee;
24
26
  const wallet = env.wallet;
25
27
  const networkUrl = networkName === 'mainnet'
26
28
  ? env.config.networks.mainnet.url
@@ -31,13 +33,17 @@ function containsSecret(obj) {
31
33
  });
32
34
  // Convert STX to microSTX (1 STX = 1,000,000 microSTX)
33
35
  const amountMicroStx = BigInt(Math.floor(amountSTX * 1_000_000));
34
- const tx = await (0, transactions_1.makeSTXTokenTransfer)({
36
+ const txOptions = {
35
37
  recipient: to,
36
38
  amount: amountMicroStx,
37
39
  senderKey: wallet.privateKey,
38
40
  network,
39
41
  memo: memo || undefined
40
- });
42
+ };
43
+ if (fee !== undefined) {
44
+ txOptions.fee = fee;
45
+ }
46
+ const tx = await (0, transactions_1.makeSTXTokenTransfer)(txOptions);
41
47
  const result = await (0, transactions_1.broadcastTransaction)({ transaction: tx, network });
42
48
  if (containsSecret(result)) {
43
49
  console.warn('[mobilestacks] Warning: Output may contain sensitive data.');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mobilestacks",
3
- "version": "0.1.21",
3
+ "version": "0.1.22",
4
4
  "description": "Task Runner & CLI for the Stacks Blockchain",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",