@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.
- package/dist/shared/{stacks-esm-s3natb0x.js → stacks-esm-75qv0d9h.js} +4 -4
- package/dist/shared/{stacks-esm-s3natb0x.js.map → stacks-esm-75qv0d9h.js.map} +3 -3
- package/dist/shared/{stacks-esm-jm688fhe.js → stacks-esm-8chm2wtn.js} +13 -5
- package/dist/shared/{stacks-esm-jm688fhe.js.map → stacks-esm-8chm2wtn.js.map} +4 -4
- package/dist/shared/{stacks-esm-17adzt3x.js → stacks-esm-p3rrvmd8.js} +2 -2
- package/dist/src/actions/index.cjs +12 -4
- package/dist/src/actions/index.cjs.map +5 -5
- package/dist/src/actions/index.d.cts +2 -0
- package/dist/src/actions/index.d.ts +2 -0
- package/dist/src/actions/index.js +3 -3
- package/dist/src/bns/index.cjs +12 -4
- package/dist/src/bns/index.cjs.map +5 -5
- package/dist/src/bns/index.js +2 -2
- package/dist/src/index.cjs +32 -5
- package/dist/src/index.cjs.map +6 -6
- package/dist/src/index.d.cts +8 -0
- package/dist/src/index.d.ts +8 -0
- package/dist/src/index.js +32 -6
- package/dist/src/index.js.map +4 -4
- package/dist/src/pox/index.cjs +12 -4
- package/dist/src/pox/index.cjs.map +5 -5
- package/dist/src/pox/index.js +2 -2
- package/dist/src/pox5/index.cjs +12 -4
- package/dist/src/pox5/index.cjs.map +5 -5
- package/dist/src/pox5/index.js +2 -2
- package/dist/src/sbtc/index.cjs +12 -4
- package/dist/src/sbtc/index.cjs.map +5 -5
- package/dist/src/sbtc/index.js +2 -2
- package/dist/src/stackingdao/index.cjs +12 -4
- package/dist/src/stackingdao/index.cjs.map +5 -5
- package/dist/src/stackingdao/index.js +2 -2
- package/dist/src/utils/index.cjs +7 -2
- package/dist/src/utils/index.cjs.map +3 -3
- package/dist/src/utils/index.d.cts +8 -1
- package/dist/src/utils/index.d.ts +8 -1
- package/dist/src/utils/index.js +7 -2
- package/dist/src/utils/index.js.map +3 -3
- package/package.json +2 -2
- /package/dist/shared/{stacks-esm-17adzt3x.js.map → stacks-esm-p3rrvmd8.js.map} +0 -0
package/dist/src/bns/index.js
CHANGED
|
@@ -17,8 +17,8 @@ import {
|
|
|
17
17
|
getContract2,
|
|
18
18
|
resolveNetworkContract,
|
|
19
19
|
ContractResponseError2
|
|
20
|
-
} from "../../shared/stacks-esm-
|
|
21
|
-
import"../../shared/stacks-esm-
|
|
20
|
+
} from "../../shared/stacks-esm-75qv0d9h.js";
|
|
21
|
+
import"../../shared/stacks-esm-8chm2wtn.js";
|
|
22
22
|
import"../../shared/stacks-esm-hm7kb2cp.js";
|
|
23
23
|
|
|
24
24
|
// src/bns/abi.ts
|
package/dist/src/index.cjs
CHANGED
|
@@ -3322,6 +3322,13 @@ function assertNoFeeTierForProvider(fee) {
|
|
|
3322
3322
|
throw new Error(`Fee tier '${fee}' requires local signing; provider (wallet) accounts set their own fee`);
|
|
3323
3323
|
}
|
|
3324
3324
|
}
|
|
3325
|
+
function resolveCallArgs(params) {
|
|
3326
|
+
const { args, functionArgs } = params;
|
|
3327
|
+
if (args !== undefined && functionArgs !== undefined) {
|
|
3328
|
+
throw new Error("Pass args or functionArgs, not both (functionArgs is deprecated)");
|
|
3329
|
+
}
|
|
3330
|
+
return args ?? functionArgs ?? [];
|
|
3331
|
+
}
|
|
3325
3332
|
|
|
3326
3333
|
// src/actions/wallet/callContract.ts
|
|
3327
3334
|
async function callContract(client, params) {
|
|
@@ -3329,12 +3336,13 @@ async function callContract(client, params) {
|
|
|
3329
3336
|
if (!account)
|
|
3330
3337
|
throw new Error("Account required");
|
|
3331
3338
|
const [contractAddress, contractName] = parseContractId(params.contract);
|
|
3339
|
+
const args = resolveCallArgs(params);
|
|
3332
3340
|
if (isProviderAccount(account)) {
|
|
3333
3341
|
assertNoFeeTierForProvider(params.fee);
|
|
3334
3342
|
const result = await account.provider.request("stx_callContract", {
|
|
3335
3343
|
contract: params.contract,
|
|
3336
3344
|
functionName: params.functionName,
|
|
3337
|
-
functionArgs:
|
|
3345
|
+
functionArgs: args
|
|
3338
3346
|
});
|
|
3339
3347
|
return result.txid;
|
|
3340
3348
|
}
|
|
@@ -3346,7 +3354,7 @@ async function callContract(client, params) {
|
|
|
3346
3354
|
contractAddress,
|
|
3347
3355
|
contractName,
|
|
3348
3356
|
functionName: params.functionName,
|
|
3349
|
-
functionArgs:
|
|
3357
|
+
functionArgs: args,
|
|
3350
3358
|
fee: needsFeeResolution ? 0n : params.fee,
|
|
3351
3359
|
nonce,
|
|
3352
3360
|
publicKey: account.publicKey,
|
|
@@ -3601,8 +3609,27 @@ function walletActions(client) {
|
|
|
3601
3609
|
}
|
|
3602
3610
|
|
|
3603
3611
|
// src/clients/createWalletClient.ts
|
|
3612
|
+
function alignAccountToChain(account, chain) {
|
|
3613
|
+
if (!chain || account.type === "provider")
|
|
3614
|
+
return account;
|
|
3615
|
+
try {
|
|
3616
|
+
const [version, hash] = c32addressDecode(account.address);
|
|
3617
|
+
const keyHash = bytesToHex(hash160(hexToBytes(account.publicKey)));
|
|
3618
|
+
if (hash !== keyHash)
|
|
3619
|
+
return account;
|
|
3620
|
+
const target = chain.addressVersion.singleSig;
|
|
3621
|
+
if (version === target)
|
|
3622
|
+
return account;
|
|
3623
|
+
return { ...account, address: c32address(target, hash) };
|
|
3624
|
+
} catch {
|
|
3625
|
+
return account;
|
|
3626
|
+
}
|
|
3627
|
+
}
|
|
3604
3628
|
function createWalletClient(config) {
|
|
3605
|
-
return createClient(
|
|
3629
|
+
return createClient({
|
|
3630
|
+
...config,
|
|
3631
|
+
account: alignAccountToChain(config.account, config.chain)
|
|
3632
|
+
}).extend(walletActions);
|
|
3606
3633
|
}
|
|
3607
3634
|
// src/clients/decorators/multisig.ts
|
|
3608
3635
|
function multisigActions(client) {
|
|
@@ -3650,7 +3677,7 @@ function multisigActions(client) {
|
|
|
3650
3677
|
contractAddress,
|
|
3651
3678
|
contractName,
|
|
3652
3679
|
functionName: params.functionName,
|
|
3653
|
-
functionArgs: params
|
|
3680
|
+
functionArgs: resolveCallArgs(params),
|
|
3654
3681
|
fee: params.fee ?? 0n,
|
|
3655
3682
|
nonce,
|
|
3656
3683
|
publicKeys: signers,
|
|
@@ -4603,5 +4630,5 @@ function parseStx(stx) {
|
|
|
4603
4630
|
return parseUnits(stx, 6);
|
|
4604
4631
|
}
|
|
4605
4632
|
|
|
4606
|
-
//# debugId=
|
|
4633
|
+
//# debugId=C6D5879CCBDF8CEC64756E2164756E21
|
|
4607
4634
|
//# sourceMappingURL=index.cjs.map
|