@secondlayer/stacks 6.1.0 → 6.1.1
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-0pc6tmf0.js +50 -0
- package/dist/shared/{stacks-esm-743jfh10.js.map → stacks-esm-0pc6tmf0.js.map} +2 -2
- package/dist/shared/{stacks-esm-0rdxcta7.js → stacks-esm-16d82wyc.js} +10 -10
- package/dist/shared/{stacks-esm-0rdxcta7.js.map → stacks-esm-16d82wyc.js.map} +2 -2
- package/dist/shared/{stacks-esm-cvhazvhd.js → stacks-esm-7a0ehykf.js} +43 -43
- package/dist/shared/{stacks-esm-cvhazvhd.js.map → stacks-esm-7a0ehykf.js.map} +2 -2
- package/dist/shared/{stacks-esm-1jae0a3r.js → stacks-esm-7v18h5dk.js} +4 -4
- package/dist/shared/{stacks-esm-1jae0a3r.js.map → stacks-esm-7v18h5dk.js.map} +2 -2
- package/dist/shared/{stacks-esm-9rnx0zxr.js → stacks-esm-8f5catbf.js} +126 -126
- package/dist/shared/{stacks-esm-9rnx0zxr.js.map → stacks-esm-8f5catbf.js.map} +2 -2
- package/dist/shared/{stacks-esm-7fpqgtyx.js → stacks-esm-8jt6k8p3.js} +13 -13
- package/dist/shared/{stacks-esm-7fpqgtyx.js.map → stacks-esm-8jt6k8p3.js.map} +2 -2
- package/dist/shared/{stacks-esm-hr7fpxtj.js → stacks-esm-a20wyky3.js} +92 -92
- package/dist/shared/{stacks-esm-hr7fpxtj.js.map → stacks-esm-a20wyky3.js.map} +2 -2
- package/dist/shared/{stacks-esm-3pv5avgr.js → stacks-esm-b54n1jdx.js} +54 -54
- package/dist/shared/{stacks-esm-3pv5avgr.js.map → stacks-esm-b54n1jdx.js.map} +2 -2
- package/dist/shared/{stacks-esm-r9q4wnyw.js → stacks-esm-cmtj5vky.js} +162 -162
- package/dist/shared/{stacks-esm-r9q4wnyw.js.map → stacks-esm-cmtj5vky.js.map} +2 -2
- package/dist/shared/{stacks-esm-wv67m4g6.js → stacks-esm-e2qhfgke.js} +36 -36
- package/dist/shared/{stacks-esm-wv67m4g6.js.map → stacks-esm-e2qhfgke.js.map} +2 -2
- package/dist/shared/{stacks-esm-qk0p9fr6.js → stacks-esm-ea4m4bk7.js} +117 -117
- package/dist/shared/{stacks-esm-qk0p9fr6.js.map → stacks-esm-ea4m4bk7.js.map} +2 -2
- package/dist/shared/{stacks-esm-fcfdn2zx.js → stacks-esm-hkw1kvd4.js} +140 -140
- package/dist/shared/{stacks-esm-fcfdn2zx.js.map → stacks-esm-hkw1kvd4.js.map} +2 -2
- package/dist/shared/{stacks-esm-qkj67g80.js → stacks-esm-k108pemv.js} +4 -4
- package/dist/shared/{stacks-esm-qkj67g80.js.map → stacks-esm-k108pemv.js.map} +2 -2
- package/dist/shared/stacks-esm-kbz5s6v8.js +84 -0
- package/dist/shared/{stacks-esm-2mc7ebrm.js.map → stacks-esm-kbz5s6v8.js.map} +2 -2
- package/dist/shared/{stacks-esm-n53kvwmt.js → stacks-esm-mt1thm7k.js} +9 -9
- package/dist/shared/{stacks-esm-n53kvwmt.js.map → stacks-esm-mt1thm7k.js.map} +2 -2
- package/dist/shared/{stacks-esm-v45990hx.js → stacks-esm-n1mekwnb.js} +9 -9
- package/dist/shared/{stacks-esm-v45990hx.js.map → stacks-esm-n1mekwnb.js.map} +2 -2
- package/dist/shared/{stacks-esm-r6dejrgr.js → stacks-esm-nt5hf8ht.js} +34 -34
- package/dist/shared/{stacks-esm-r6dejrgr.js.map → stacks-esm-nt5hf8ht.js.map} +2 -2
- package/dist/shared/{stacks-esm-skmcf5n2.js → stacks-esm-phgy8yqf.js} +210 -210
- package/dist/shared/{stacks-esm-skmcf5n2.js.map → stacks-esm-phgy8yqf.js.map} +2 -2
- package/dist/shared/{stacks-esm-kds4n82p.js → stacks-esm-pxv6ny92.js} +116 -116
- package/dist/shared/{stacks-esm-kds4n82p.js.map → stacks-esm-pxv6ny92.js.map} +2 -2
- package/dist/shared/{stacks-esm-3g33bqsm.js → stacks-esm-qfzxhdqz.js} +19 -19
- package/dist/shared/{stacks-esm-3g33bqsm.js.map → stacks-esm-qfzxhdqz.js.map} +2 -2
- package/dist/shared/{stacks-esm-aw2mj3sj.js → stacks-esm-snj9s2q8.js} +43 -43
- package/dist/shared/{stacks-esm-aw2mj3sj.js.map → stacks-esm-snj9s2q8.js.map} +2 -2
- package/dist/shared/{stacks-esm-q19a17fd.js → stacks-esm-ss9ap75h.js} +28 -28
- package/dist/shared/{stacks-esm-q19a17fd.js.map → stacks-esm-ss9ap75h.js.map} +2 -2
- package/dist/shared/{stacks-esm-x1r01353.js → stacks-esm-t88hc019.js} +18 -18
- package/dist/shared/{stacks-esm-x1r01353.js.map → stacks-esm-t88hc019.js.map} +2 -2
- package/dist/shared/stacks-esm-tdrdye4y.js +48 -0
- package/dist/shared/{stacks-esm-pxhfqfff.js.map → stacks-esm-tdrdye4y.js.map} +2 -2
- package/dist/src/accounts/index.cjs +15 -13
- package/dist/src/accounts/index.cjs.map +2 -2
- package/dist/src/accounts/index.d.cts +1 -1
- package/dist/src/accounts/index.d.ts +1 -1
- package/dist/src/accounts/index.js +26 -26
- package/dist/src/accounts/index.js.map +2 -2
- package/dist/src/actions/index.cjs +83 -81
- package/dist/src/actions/index.cjs.map +2 -2
- package/dist/src/actions/index.d.cts +1 -1
- package/dist/src/actions/index.d.ts +1 -1
- package/dist/src/actions/index.js +102 -103
- package/dist/src/actions/index.js.map +1 -1
- package/dist/src/bitcoin/index.cjs +2035 -2036
- package/dist/src/bitcoin/index.cjs.map +8 -8
- package/dist/src/bitcoin/index.d.cts +92 -92
- package/dist/src/bitcoin/index.d.ts +92 -92
- package/dist/src/bitcoin/index.js +88 -90
- package/dist/src/bitcoin/index.js.map +2 -2
- package/dist/src/bns/index.cjs +3313 -3310
- package/dist/src/bns/index.cjs.map +13 -13
- package/dist/src/bns/index.d.cts +1 -1
- package/dist/src/bns/index.d.ts +1 -1
- package/dist/src/bns/index.js +39 -41
- package/dist/src/bns/index.js.map +2 -2
- package/dist/src/chains/index.cjs +14 -12
- package/dist/src/chains/index.cjs.map +2 -2
- package/dist/src/chains/index.d.cts +1 -1
- package/dist/src/chains/index.d.ts +1 -1
- package/dist/src/chains/index.js +12 -12
- package/dist/src/chains/index.js.map +1 -1
- package/dist/src/clarity/index.cjs +98 -96
- package/dist/src/clarity/index.cjs.map +2 -2
- package/dist/src/clarity/index.d.cts +1 -1
- package/dist/src/clarity/index.d.ts +1 -1
- package/dist/src/clarity/index.js +170 -171
- package/dist/src/clarity/index.js.map +1 -1
- package/dist/src/connect/index.cjs +19 -19
- package/dist/src/connect/index.cjs.map +2 -2
- package/dist/src/connect/index.d.cts +1 -1
- package/dist/src/connect/index.d.ts +1 -1
- package/dist/src/connect/index.js +19 -19
- package/dist/src/connect/index.js.map +2 -2
- package/dist/src/connect/walletconnect/index.cjs +6 -46
- package/dist/src/connect/walletconnect/index.cjs.map +3 -4
- package/dist/src/connect/walletconnect/index.d.cts +1 -1
- package/dist/src/connect/walletconnect/index.d.ts +1 -1
- package/dist/src/connect/walletconnect/index.js +6 -46
- package/dist/src/connect/walletconnect/index.js.map +3 -4
- package/dist/src/filters/index.cjs +22 -20
- package/dist/src/filters/index.cjs.map +2 -2
- package/dist/src/filters/index.d.cts +1 -1
- package/dist/src/filters/index.d.ts +1 -1
- package/dist/src/filters/index.js +30 -30
- package/dist/src/filters/index.js.map +1 -1
- package/dist/src/index.cjs +1411 -1410
- package/dist/src/index.cjs.map +11 -11
- package/dist/src/index.d.cts +724 -724
- package/dist/src/index.d.ts +724 -724
- package/dist/src/index.js +219 -219
- package/dist/src/index.js.map +2 -2
- package/dist/src/postconditions/index.cjs +26 -24
- package/dist/src/postconditions/index.cjs.map +2 -2
- package/dist/src/postconditions/index.d.cts +1 -1
- package/dist/src/postconditions/index.d.ts +1 -1
- package/dist/src/postconditions/index.js +16 -17
- package/dist/src/postconditions/index.js.map +1 -1
- package/dist/src/pox/index.cjs +722 -721
- package/dist/src/pox/index.cjs.map +9 -9
- package/dist/src/pox/index.d.cts +1 -1
- package/dist/src/pox/index.d.ts +1 -1
- package/dist/src/pox/index.js +40 -41
- package/dist/src/pox/index.js.map +2 -2
- package/dist/src/pox5/index.cjs +141 -137
- package/dist/src/pox5/index.cjs.map +3 -3
- package/dist/src/pox5/index.d.cts +9 -1
- package/dist/src/pox5/index.d.ts +9 -1
- package/dist/src/pox5/index.js +210 -209
- package/dist/src/pox5/index.js.map +3 -3
- package/dist/src/sbtc/index.cjs +71 -69
- package/dist/src/sbtc/index.cjs.map +2 -2
- package/dist/src/sbtc/index.d.cts +1 -1
- package/dist/src/sbtc/index.d.ts +1 -1
- package/dist/src/sbtc/index.js +39 -40
- package/dist/src/sbtc/index.js.map +2 -2
- package/dist/src/simnet/index.cjs +16 -16
- package/dist/src/simnet/index.cjs.map +2 -2
- package/dist/src/simnet/index.d.cts +1 -1
- package/dist/src/simnet/index.d.ts +1 -1
- package/dist/src/simnet/index.js +16 -16
- package/dist/src/simnet/index.js.map +2 -2
- package/dist/src/stackingdao/index.cjs +716 -715
- package/dist/src/stackingdao/index.cjs.map +9 -9
- package/dist/src/stackingdao/index.d.cts +1 -1
- package/dist/src/stackingdao/index.d.ts +1 -1
- package/dist/src/stackingdao/index.js +26 -27
- package/dist/src/stackingdao/index.js.map +2 -2
- package/dist/src/subscriptions/index.cjs +15 -13
- package/dist/src/subscriptions/index.cjs.map +2 -2
- package/dist/src/subscriptions/index.d.cts +1 -1
- package/dist/src/subscriptions/index.d.ts +1 -1
- package/dist/src/subscriptions/index.js +14 -15
- package/dist/src/subscriptions/index.js.map +1 -1
- package/dist/src/transactions/index.cjs +79 -77
- package/dist/src/transactions/index.cjs.map +2 -2
- package/dist/src/transactions/index.d.cts +1 -1
- package/dist/src/transactions/index.d.ts +1 -1
- package/dist/src/transactions/index.js +104 -105
- package/dist/src/transactions/index.js.map +1 -1
- package/dist/src/utils/index.cjs +76 -74
- package/dist/src/utils/index.cjs.map +2 -2
- package/dist/src/utils/index.d.cts +1 -1
- package/dist/src/utils/index.d.ts +1 -1
- package/dist/src/utils/index.js +131 -131
- package/dist/src/utils/index.js.map +2 -2
- package/package.json +1 -1
- package/dist/shared/stacks-esm-2mc7ebrm.js +0 -84
- package/dist/shared/stacks-esm-743jfh10.js +0 -50
- package/dist/shared/stacks-esm-pxhfqfff.js +0 -48
|
@@ -19,13 +19,15 @@ var __toESM = (mod, isNodeMode, target) => {
|
|
|
19
19
|
return cached;
|
|
20
20
|
}
|
|
21
21
|
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
22
|
-
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
const to = isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
23
|
+
if (mod && typeof mod === "object" || typeof mod === "function") {
|
|
24
|
+
for (let key of __getOwnPropNames(mod))
|
|
25
|
+
if (!__hasOwnProp.call(to, key))
|
|
26
|
+
__defProp(to, key, {
|
|
27
|
+
get: __accessProp.bind(mod, key),
|
|
28
|
+
enumerable: true
|
|
29
|
+
});
|
|
30
|
+
}
|
|
29
31
|
if (canCache)
|
|
30
32
|
cache.set(mod, to);
|
|
31
33
|
return to;
|
|
@@ -64,50 +66,50 @@ var __export = (target, all) => {
|
|
|
64
66
|
// src/actions/index.ts
|
|
65
67
|
var exports_actions = {};
|
|
66
68
|
__export(exports_actions, {
|
|
67
|
-
|
|
68
|
-
watchNftEvent: () => watchNftEvent,
|
|
69
|
-
watchMempool: () => watchMempool,
|
|
70
|
-
watchBlocks: () => watchBlocks,
|
|
71
|
-
watchAddressBalance: () => watchAddressBalance,
|
|
72
|
-
watchAddress: () => watchAddress,
|
|
73
|
-
waitForTransactionReceipt: () => waitForTransactionReceipt,
|
|
74
|
-
transferStx: () => transferStx,
|
|
75
|
-
sponsorTransaction: () => sponsorTransaction,
|
|
76
|
-
simulateTransaction: () => simulateTransaction,
|
|
77
|
-
simulateCall: () => simulateCall,
|
|
78
|
-
signTransactionAction: () => signTransactionAction,
|
|
79
|
-
signMessage: () => signMessage,
|
|
80
|
-
sendTransaction: () => sendTransaction,
|
|
81
|
-
resolveFee: () => resolveFee,
|
|
82
|
-
readContract: () => readContract,
|
|
83
|
-
multicall: () => multicall,
|
|
84
|
-
minimumFee: () => minimumFee,
|
|
85
|
-
isResponseOutput: () => isResponseOutput,
|
|
86
|
-
isProviderAccount: () => isProviderAccount,
|
|
87
|
-
isNoEstimateAvailable: () => isNoEstimateAvailable,
|
|
88
|
-
isFeeTier: () => isFeeTier,
|
|
89
|
-
indexTxSource: () => indexTxSource,
|
|
90
|
-
getTransaction: () => getTransaction,
|
|
91
|
-
getRawBlock: () => getRawBlock,
|
|
92
|
-
getNonce: () => getNonce,
|
|
93
|
-
getNftHoldings: () => getNftHoldings,
|
|
94
|
-
getMempoolStats: () => getMempoolStats,
|
|
95
|
-
getMapEntry: () => getMapEntry,
|
|
96
|
-
getDataVar: () => getDataVar,
|
|
97
|
-
getContractSource: () => getContractSource,
|
|
98
|
-
getContractAbi: () => getContractAbi,
|
|
99
|
-
getContract: () => getContract,
|
|
100
|
-
getBlockHeight: () => getBlockHeight,
|
|
101
|
-
getBlock: () => getBlock,
|
|
102
|
-
getBalance: () => getBalance,
|
|
103
|
-
getAccountInfo: () => getAccountInfo,
|
|
104
|
-
getAccountHistory: () => getAccountHistory,
|
|
105
|
-
extendedApiSource: () => extendedApiSource,
|
|
106
|
-
estimateFee: () => estimateFee,
|
|
107
|
-
deployContract: () => deployContract,
|
|
108
|
-
callContract: () => callContract,
|
|
69
|
+
ContractResponseError: () => ContractResponseError,
|
|
109
70
|
buildFunctionArgs: () => buildFunctionArgs,
|
|
110
|
-
|
|
71
|
+
callContract: () => callContract,
|
|
72
|
+
deployContract: () => deployContract,
|
|
73
|
+
estimateFee: () => estimateFee,
|
|
74
|
+
extendedApiSource: () => extendedApiSource,
|
|
75
|
+
getAccountHistory: () => getAccountHistory,
|
|
76
|
+
getAccountInfo: () => getAccountInfo,
|
|
77
|
+
getBalance: () => getBalance,
|
|
78
|
+
getBlock: () => getBlock,
|
|
79
|
+
getBlockHeight: () => getBlockHeight,
|
|
80
|
+
getContract: () => getContract,
|
|
81
|
+
getContractAbi: () => getContractAbi,
|
|
82
|
+
getContractSource: () => getContractSource,
|
|
83
|
+
getDataVar: () => getDataVar,
|
|
84
|
+
getMapEntry: () => getMapEntry,
|
|
85
|
+
getMempoolStats: () => getMempoolStats,
|
|
86
|
+
getNftHoldings: () => getNftHoldings,
|
|
87
|
+
getNonce: () => getNonce,
|
|
88
|
+
getRawBlock: () => getRawBlock,
|
|
89
|
+
getTransaction: () => getTransaction,
|
|
90
|
+
indexTxSource: () => indexTxSource,
|
|
91
|
+
isFeeTier: () => isFeeTier,
|
|
92
|
+
isNoEstimateAvailable: () => isNoEstimateAvailable,
|
|
93
|
+
isProviderAccount: () => isProviderAccount,
|
|
94
|
+
isResponseOutput: () => isResponseOutput,
|
|
95
|
+
minimumFee: () => minimumFee,
|
|
96
|
+
multicall: () => multicall,
|
|
97
|
+
readContract: () => readContract,
|
|
98
|
+
resolveFee: () => resolveFee,
|
|
99
|
+
sendTransaction: () => sendTransaction,
|
|
100
|
+
signMessage: () => signMessage,
|
|
101
|
+
signTransactionAction: () => signTransactionAction,
|
|
102
|
+
simulateCall: () => simulateCall,
|
|
103
|
+
simulateTransaction: () => simulateTransaction,
|
|
104
|
+
sponsorTransaction: () => sponsorTransaction,
|
|
105
|
+
transferStx: () => transferStx,
|
|
106
|
+
waitForTransactionReceipt: () => waitForTransactionReceipt,
|
|
107
|
+
watchAddress: () => watchAddress,
|
|
108
|
+
watchAddressBalance: () => watchAddressBalance,
|
|
109
|
+
watchBlocks: () => watchBlocks,
|
|
110
|
+
watchMempool: () => watchMempool,
|
|
111
|
+
watchNftEvent: () => watchNftEvent,
|
|
112
|
+
watchTransaction: () => watchTransaction
|
|
111
113
|
});
|
|
112
114
|
module.exports = __toCommonJS(exports_actions);
|
|
113
115
|
|
|
@@ -707,8 +709,8 @@ function withTypeId(type, bytes) {
|
|
|
707
709
|
return concatBytes(new Uint8Array([typeIdByte(type)]), bytes);
|
|
708
710
|
}
|
|
709
711
|
function serializeAddress(c32Address) {
|
|
710
|
-
const [version,
|
|
711
|
-
return concatBytes(new Uint8Array([version]), hexToBytes(
|
|
712
|
+
const [version, hash160] = c32addressDecode(c32Address);
|
|
713
|
+
return concatBytes(new Uint8Array([version]), hexToBytes(hash160));
|
|
712
714
|
}
|
|
713
715
|
function serializeLPString(str, prefixBytes = 1) {
|
|
714
716
|
const content = utf8ToBytes(str);
|
|
@@ -815,13 +817,13 @@ function bufferCV(buffer) {
|
|
|
815
817
|
return { type: "buffer", value: bytesToHex(buffer) };
|
|
816
818
|
}
|
|
817
819
|
function standardPrincipalCV(address) {
|
|
818
|
-
const [version,
|
|
819
|
-
const normalized = c32address(version,
|
|
820
|
+
const [version, hash160] = c32addressDecode(address);
|
|
821
|
+
const normalized = c32address(version, hash160);
|
|
820
822
|
return { type: "address", value: normalized };
|
|
821
823
|
}
|
|
822
824
|
function contractPrincipalCV(address, contractName) {
|
|
823
|
-
const [version,
|
|
824
|
-
const normalized = c32address(version,
|
|
825
|
+
const [version, hash160] = c32addressDecode(address);
|
|
826
|
+
const normalized = c32address(version, hash160);
|
|
825
827
|
if (utf8ToBytes(contractName).byteLength >= 128) {
|
|
826
828
|
throw new Error("Contract name must be less than 128 bytes");
|
|
827
829
|
}
|
|
@@ -892,8 +894,8 @@ var Cl = {
|
|
|
892
894
|
// src/clarity/deserialize.ts
|
|
893
895
|
function readAddress(reader) {
|
|
894
896
|
const version = reader.readUInt8();
|
|
895
|
-
const
|
|
896
|
-
return c32address(version,
|
|
897
|
+
const hash160 = bytesToHex(reader.readBytes(20));
|
|
898
|
+
return c32address(version, hash160);
|
|
897
899
|
}
|
|
898
900
|
function readLPString(reader, prefixBytes = 1) {
|
|
899
901
|
let length = 0;
|
|
@@ -1145,8 +1147,8 @@ var TenureChangeCause = {
|
|
|
1145
1147
|
|
|
1146
1148
|
// src/transactions/wire/serialize.ts
|
|
1147
1149
|
function serializeAddress2(c32Address) {
|
|
1148
|
-
const [version,
|
|
1149
|
-
return concatBytes(new Uint8Array([version]), hexToBytes(
|
|
1150
|
+
const [version, hash160] = c32addressDecode(c32Address);
|
|
1151
|
+
return concatBytes(new Uint8Array([version]), hexToBytes(hash160));
|
|
1150
1152
|
}
|
|
1151
1153
|
function serializeLPString2(str, prefixBytes = 1) {
|
|
1152
1154
|
const content = utf8ToBytes(str);
|
|
@@ -1185,8 +1187,8 @@ function serializeSpendingCondition(condition) {
|
|
|
1185
1187
|
}
|
|
1186
1188
|
function serializeAuthField(field) {
|
|
1187
1189
|
if (field.type === "publicKey") {
|
|
1188
|
-
const
|
|
1189
|
-
return concatBytes(writeUInt8(
|
|
1190
|
+
const typeId = field.pubKeyEncoding === 0 ? 0 : 1;
|
|
1191
|
+
return concatBytes(writeUInt8(typeId), hexToBytes(field.data));
|
|
1190
1192
|
}
|
|
1191
1193
|
const typeId = field.pubKeyEncoding === 0 ? 2 : 3;
|
|
1192
1194
|
return concatBytes(writeUInt8(typeId), hexToBytes(field.data));
|
|
@@ -1455,7 +1457,7 @@ async function simulateTransaction(client, params) {
|
|
|
1455
1457
|
if (payload.payloadType === PayloadType.ContractCall) {
|
|
1456
1458
|
const sender = params.sender ?? extractSender(transaction, client);
|
|
1457
1459
|
const contract = `${payload.contractAddress}.${payload.contractName}`;
|
|
1458
|
-
const [execution,
|
|
1460
|
+
const [execution, fees] = await Promise.all([
|
|
1459
1461
|
simulateCall(client, {
|
|
1460
1462
|
contract,
|
|
1461
1463
|
functionName: payload.functionName,
|
|
@@ -1465,7 +1467,7 @@ async function simulateTransaction(client, params) {
|
|
|
1465
1467
|
}),
|
|
1466
1468
|
estimateFee(client, { transaction })
|
|
1467
1469
|
]);
|
|
1468
|
-
return { type: "contract-call", execution, fees
|
|
1470
|
+
return { type: "contract-call", execution, fees };
|
|
1469
1471
|
}
|
|
1470
1472
|
const fees = await estimateFee(client, { transaction });
|
|
1471
1473
|
if (payload.payloadType === PayloadType.SmartContract || payload.payloadType === PayloadType.VersionedSmartContract) {
|
|
@@ -2075,11 +2077,11 @@ function replayMultiSigSigHash(tx) {
|
|
|
2075
2077
|
const condition = tx.auth.spendingCondition;
|
|
2076
2078
|
if (isNonSequential(condition.hashMode)) {
|
|
2077
2079
|
const preSign = nonSequentialPreSignHash(tx);
|
|
2078
|
-
let
|
|
2080
|
+
let curSigHash = preSign;
|
|
2079
2081
|
for (const field of condition.fields) {
|
|
2080
|
-
|
|
2082
|
+
curSigHash = sigHashPostSign(curSigHash, field.pubKeyEncoding, field.data);
|
|
2081
2083
|
}
|
|
2082
|
-
return
|
|
2084
|
+
return curSigHash;
|
|
2083
2085
|
}
|
|
2084
2086
|
let curSigHash = initialSigHash(tx);
|
|
2085
2087
|
for (const field of condition.fields) {
|
|
@@ -2200,8 +2202,8 @@ async function signSequentialWithAccount(tx, condition, account, publicKeys, sig
|
|
|
2200
2202
|
const fields = [...condition.fields];
|
|
2201
2203
|
let curSigHash = initialSigHash(tx);
|
|
2202
2204
|
for (const field of fields) {
|
|
2203
|
-
const
|
|
2204
|
-
curSigHash = sigHashPostSign(
|
|
2205
|
+
const preSign = sigHashPreSign(curSigHash, AuthType.Standard, condition.fee, condition.nonce);
|
|
2206
|
+
curSigHash = sigHashPostSign(preSign, field.pubKeyEncoding, field.data);
|
|
2205
2207
|
}
|
|
2206
2208
|
for (let i = fields.length;i < signerIndex; i++) {
|
|
2207
2209
|
const pubKeyField = {
|
|
@@ -2210,8 +2212,8 @@ async function signSequentialWithAccount(tx, condition, account, publicKeys, sig
|
|
|
2210
2212
|
data: publicKeys[i]
|
|
2211
2213
|
};
|
|
2212
2214
|
fields.push(pubKeyField);
|
|
2213
|
-
const
|
|
2214
|
-
curSigHash = sigHashPostSign(
|
|
2215
|
+
const preSign = sigHashPreSign(curSigHash, AuthType.Standard, condition.fee, condition.nonce);
|
|
2216
|
+
curSigHash = sigHashPostSign(preSign, pubKeyField.pubKeyEncoding, pubKeyField.data);
|
|
2215
2217
|
}
|
|
2216
2218
|
const preSign = sigHashPreSign(curSigHash, AuthType.Standard, condition.fee, condition.nonce);
|
|
2217
2219
|
const sigBytes = await account.sign(hexToBytes(preSign));
|
|
@@ -2347,9 +2349,9 @@ function getOriginSigHash(tx) {
|
|
|
2347
2349
|
if ("fields" in condition) {
|
|
2348
2350
|
return replayMultiSigSigHash(tx);
|
|
2349
2351
|
}
|
|
2350
|
-
const
|
|
2352
|
+
const initialSigHash = signBegin(tx);
|
|
2351
2353
|
const sc = condition;
|
|
2352
|
-
const preSign = sigHashPreSign(
|
|
2354
|
+
const preSign = sigHashPreSign(initialSigHash, AuthType.Standard, sc.fee, sc.nonce);
|
|
2353
2355
|
return sigHashPostSign(preSign, sc.keyEncoding, sc.signature);
|
|
2354
2356
|
}
|
|
2355
2357
|
function signSponsor(tx, privateKey) {
|
|
@@ -2415,11 +2417,11 @@ async function sendTransaction(client, params) {
|
|
|
2415
2417
|
throw error;
|
|
2416
2418
|
}
|
|
2417
2419
|
} else if (error instanceof TimeoutError) {
|
|
2418
|
-
const
|
|
2419
|
-
const receipt = await getTransaction(client, { txid
|
|
2420
|
+
const txid = getTransactionId(params.transaction);
|
|
2421
|
+
const receipt = await getTransaction(client, { txid }).catch(() => null);
|
|
2420
2422
|
if (receipt === null)
|
|
2421
2423
|
throw error;
|
|
2422
|
-
data = { txid
|
|
2424
|
+
data = { txid };
|
|
2423
2425
|
} else {
|
|
2424
2426
|
throw error;
|
|
2425
2427
|
}
|
|
@@ -2431,16 +2433,16 @@ async function sendTransaction(client, params) {
|
|
|
2431
2433
|
txid: data.txid ?? getTransactionId(params.transaction)
|
|
2432
2434
|
});
|
|
2433
2435
|
}
|
|
2434
|
-
const
|
|
2436
|
+
const txid = typeof data === "string" ? data.replace(/"/g, "") : data.txid ?? getTransactionId(params.transaction);
|
|
2435
2437
|
if (params.wait) {
|
|
2436
2438
|
const confirmations = params.wait === true ? 1 : params.wait;
|
|
2437
2439
|
const receipt = await waitForTransactionReceipt(client, {
|
|
2438
|
-
txid
|
|
2440
|
+
txid,
|
|
2439
2441
|
confirmations
|
|
2440
2442
|
});
|
|
2441
|
-
return { txid
|
|
2443
|
+
return { txid, receipt };
|
|
2442
2444
|
}
|
|
2443
|
-
return { txid
|
|
2445
|
+
return { txid };
|
|
2444
2446
|
}
|
|
2445
2447
|
// src/transactions/wire/deserialize.ts
|
|
2446
2448
|
function readSpendingCondition(r) {
|
|
@@ -3862,5 +3864,5 @@ class ContractResponseError extends Error {
|
|
|
3862
3864
|
}
|
|
3863
3865
|
}
|
|
3864
3866
|
|
|
3865
|
-
//# debugId=
|
|
3867
|
+
//# debugId=6C9CD0240204CF6764756E2164756E21
|
|
3866
3868
|
//# sourceMappingURL=index.cjs.map
|