@secondlayer/stacks 5.1.1 → 5.1.3

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.
@@ -2510,7 +2510,7 @@ function getContract(params) {
2510
2510
  const fn = fnByName.get(fnName);
2511
2511
  if (!fn || fn.access !== "read-only")
2512
2512
  return;
2513
- return async (args) => {
2513
+ return async (args = {}) => {
2514
2514
  const clarityArgs = buildFunctionArgs(fn, args);
2515
2515
  const result = await readContract(client, {
2516
2516
  contract: contractId,
@@ -2534,7 +2534,7 @@ function getContract(params) {
2534
2534
  const fn = fnByName.get(fnName);
2535
2535
  if (!fn || fn.access !== "public")
2536
2536
  return;
2537
- return async (args, options) => {
2537
+ return async (args = {}, options) => {
2538
2538
  const clarityArgs = buildFunctionArgs(fn, args);
2539
2539
  return callContract(client, {
2540
2540
  contract: contractId,
@@ -2551,7 +2551,7 @@ function getContract(params) {
2551
2551
  const fn = fnByName.get(fnName);
2552
2552
  if (!fn || fn.access !== "public")
2553
2553
  return;
2554
- return async (args, options) => {
2554
+ return async (args = {}, options) => {
2555
2555
  const publicKey = options?.publicKey ?? client.account?.publicKey;
2556
2556
  if (!publicKey) {
2557
2557
  throw new Error("buildCall requires a publicKey (pass options.publicKey or configure a client account)");
@@ -2612,7 +2612,7 @@ function resolveNetworkContract(client, contracts) {
2612
2612
  }
2613
2613
  return contracts[client.chain.network];
2614
2614
  }
2615
- function buildFunctionArgs(fn, args) {
2615
+ function buildFunctionArgs(fn, args = {}) {
2616
2616
  return fn.args.map((arg) => {
2617
2617
  const camelKey = toCamelCase(arg.name);
2618
2618
  const hasOriginal = arg.name in args;
@@ -3823,5 +3823,5 @@ export {
3823
3823
  bnsResolve
3824
3824
  };
3825
3825
 
3826
- //# debugId=9F434A47DB8B89AF64756E2164756E21
3826
+ //# debugId=BF92A0AEA897CFBD64756E2164756E21
3827
3827
  //# sourceMappingURL=index.js.map