@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.
- package/README.md +16 -333
- package/dist/shared/{stacks-w9t61fra.cjs → stacks-f35mnrmg.cjs} +6 -6
- package/dist/shared/stacks-f35mnrmg.cjs.map +10 -0
- package/dist/shared/{stacks-gyp5ax89.js → stacks-fd4rx56e.js} +6 -6
- package/dist/shared/stacks-fd4rx56e.js.map +10 -0
- package/dist/src/actions/index.d.cts +19 -7
- package/dist/src/actions/index.d.ts +19 -7
- package/dist/src/actions/index.js +1 -1
- package/dist/src/bns/index.js +1 -1
- package/dist/src/filters/index.d.cts +3 -3
- package/dist/src/filters/index.d.ts +3 -3
- package/dist/src/index.d.cts +2 -2
- package/dist/src/index.d.ts +2 -2
- package/dist/src/pox/index.js +1 -1
- package/dist/src/pox5/index.js +1 -1
- package/dist/src/sbtc/index.js +1 -1
- package/dist/src/stackingdao/index.js +1 -1
- package/dist/src/tools/index.cjs +5 -5
- package/dist/src/tools/index.cjs.map +3 -3
- package/dist/src/tools/index.js +5 -5
- package/dist/src/tools/index.js.map +3 -3
- package/package.json +2 -2
- package/dist/shared/stacks-gyp5ax89.js.map +0 -10
- package/dist/shared/stacks-w9t61fra.cjs.map +0 -10
package/dist/src/tools/index.js
CHANGED
|
@@ -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=
|
|
3826
|
+
//# debugId=BF92A0AEA897CFBD64756E2164756E21
|
|
3827
3827
|
//# sourceMappingURL=index.js.map
|