@secondlayer/stacks 6.5.4 → 6.6.0

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.
Files changed (39) hide show
  1. package/dist/shared/{stacks-esm-s3natb0x.js → stacks-esm-75qv0d9h.js} +4 -4
  2. package/dist/shared/{stacks-esm-s3natb0x.js.map → stacks-esm-75qv0d9h.js.map} +3 -3
  3. package/dist/shared/{stacks-esm-jm688fhe.js → stacks-esm-8chm2wtn.js} +13 -5
  4. package/dist/shared/{stacks-esm-jm688fhe.js.map → stacks-esm-8chm2wtn.js.map} +4 -4
  5. package/dist/shared/{stacks-esm-17adzt3x.js → stacks-esm-p3rrvmd8.js} +2 -2
  6. package/dist/src/actions/index.cjs +12 -4
  7. package/dist/src/actions/index.cjs.map +5 -5
  8. package/dist/src/actions/index.d.cts +2 -0
  9. package/dist/src/actions/index.d.ts +2 -0
  10. package/dist/src/actions/index.js +3 -3
  11. package/dist/src/bns/index.cjs +12 -4
  12. package/dist/src/bns/index.cjs.map +5 -5
  13. package/dist/src/bns/index.js +2 -2
  14. package/dist/src/index.cjs +32 -5
  15. package/dist/src/index.cjs.map +6 -6
  16. package/dist/src/index.d.cts +8 -0
  17. package/dist/src/index.d.ts +8 -0
  18. package/dist/src/index.js +32 -6
  19. package/dist/src/index.js.map +4 -4
  20. package/dist/src/pox/index.cjs +12 -4
  21. package/dist/src/pox/index.cjs.map +5 -5
  22. package/dist/src/pox/index.js +2 -2
  23. package/dist/src/pox5/index.cjs +12 -4
  24. package/dist/src/pox5/index.cjs.map +5 -5
  25. package/dist/src/pox5/index.js +2 -2
  26. package/dist/src/sbtc/index.cjs +12 -4
  27. package/dist/src/sbtc/index.cjs.map +5 -5
  28. package/dist/src/sbtc/index.js +2 -2
  29. package/dist/src/stackingdao/index.cjs +12 -4
  30. package/dist/src/stackingdao/index.cjs.map +5 -5
  31. package/dist/src/stackingdao/index.js +2 -2
  32. package/dist/src/utils/index.cjs +7 -2
  33. package/dist/src/utils/index.cjs.map +3 -3
  34. package/dist/src/utils/index.d.cts +8 -1
  35. package/dist/src/utils/index.d.ts +8 -1
  36. package/dist/src/utils/index.js +7 -2
  37. package/dist/src/utils/index.js.map +3 -3
  38. package/package.json +2 -2
  39. /package/dist/shared/{stacks-esm-17adzt3x.js.map → stacks-esm-p3rrvmd8.js.map} +0 -0
@@ -35,7 +35,7 @@ import {
35
35
  } from "../../shared/stacks-esm-51sysw9g.js";
36
36
  import {
37
37
  getContract2
38
- } from "../../shared/stacks-esm-s3natb0x.js";
38
+ } from "../../shared/stacks-esm-75qv0d9h.js";
39
39
  import {
40
40
  getBalance2,
41
41
  getDataVar2,
@@ -43,7 +43,7 @@ import {
43
43
  } from "../../shared/stacks-esm-1nfzrepv.js";
44
44
  import {
45
45
  getMapEntry2
46
- } from "../../shared/stacks-esm-jm688fhe.js";
46
+ } from "../../shared/stacks-esm-8chm2wtn.js";
47
47
  import"../../shared/stacks-esm-hm7kb2cp.js";
48
48
 
49
49
  // src/pox5/constants.ts
@@ -3190,6 +3190,13 @@ function assertNoFeeTierForProvider(fee) {
3190
3190
  throw new Error(`Fee tier '${fee}' requires local signing; provider (wallet) accounts set their own fee`);
3191
3191
  }
3192
3192
  }
3193
+ function resolveCallArgs(params) {
3194
+ const { args, functionArgs } = params;
3195
+ if (args !== undefined && functionArgs !== undefined) {
3196
+ throw new Error("Pass args or functionArgs, not both (functionArgs is deprecated)");
3197
+ }
3198
+ return args ?? functionArgs ?? [];
3199
+ }
3193
3200
 
3194
3201
  // src/actions/wallet/callContract.ts
3195
3202
  async function callContract(client, params) {
@@ -3197,12 +3204,13 @@ async function callContract(client, params) {
3197
3204
  if (!account)
3198
3205
  throw new Error("Account required");
3199
3206
  const [contractAddress, contractName] = parseContractId(params.contract);
3207
+ const args = resolveCallArgs(params);
3200
3208
  if (isProviderAccount(account)) {
3201
3209
  assertNoFeeTierForProvider(params.fee);
3202
3210
  const result = await account.provider.request("stx_callContract", {
3203
3211
  contract: params.contract,
3204
3212
  functionName: params.functionName,
3205
- functionArgs: params.functionArgs ?? []
3213
+ functionArgs: args
3206
3214
  });
3207
3215
  return result.txid;
3208
3216
  }
@@ -3214,7 +3222,7 @@ async function callContract(client, params) {
3214
3222
  contractAddress,
3215
3223
  contractName,
3216
3224
  functionName: params.functionName,
3217
- functionArgs: params.functionArgs ?? [],
3225
+ functionArgs: args,
3218
3226
  fee: needsFeeResolution ? 0n : params.fee,
3219
3227
  nonce,
3220
3228
  publicKey: account.publicKey,
@@ -3296,7 +3304,7 @@ function getContract(params) {
3296
3304
  return callContract(client, {
3297
3305
  contract: contractId,
3298
3306
  functionName: fn.name,
3299
- functionArgs: clarityArgs,
3307
+ args: clarityArgs,
3300
3308
  ...options
3301
3309
  });
3302
3310
  };
@@ -4122,5 +4130,5 @@ function sbtc() {
4122
4130
  });
4123
4131
  }
4124
4132
 
4125
- //# debugId=927653E908E859A364756E2164756E21
4133
+ //# debugId=B4F991801FEF400064756E2164756E21
4126
4134
  //# sourceMappingURL=index.cjs.map