@secretkeylabs/stacks-tools 0.4.0-56be0c9 → 0.4.0-94660ad
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/index.cjs +6 -2
- package/dist/index.js +6 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1151,7 +1151,10 @@ async function mapEntry(args) {
|
|
|
1151
1151
|
};
|
|
1152
1152
|
}
|
|
1153
1153
|
init.method = "POST";
|
|
1154
|
-
init.body =
|
|
1154
|
+
init.body = JSON.stringify(
|
|
1155
|
+
args.mapKey.startsWith("0x") ? args.mapKey : `0x${args.mapKey}`
|
|
1156
|
+
);
|
|
1157
|
+
init.headers = { ...init.headers, "Content-Type": "application/json" };
|
|
1155
1158
|
const endpoint = `${args.baseUrl}/v2/map_entry/${args.contractAddress}/${args.contractName}/${args.mapName}?${search}`;
|
|
1156
1159
|
const res = await fetch(endpoint, init);
|
|
1157
1160
|
if (!res.ok) {
|
|
@@ -1159,10 +1162,11 @@ async function mapEntry(args) {
|
|
|
1159
1162
|
name: "FetchMapEntryError",
|
|
1160
1163
|
message: "Failed to fetch map entry.",
|
|
1161
1164
|
data: {
|
|
1165
|
+
init,
|
|
1162
1166
|
status: res.status,
|
|
1163
1167
|
statusText: res.statusText,
|
|
1164
1168
|
endpoint,
|
|
1165
|
-
bodyParseResult: await safePromise(res.
|
|
1169
|
+
bodyParseResult: await safePromise(res.text())
|
|
1166
1170
|
}
|
|
1167
1171
|
});
|
|
1168
1172
|
}
|
package/dist/index.js
CHANGED
|
@@ -1107,7 +1107,10 @@ async function mapEntry(args) {
|
|
|
1107
1107
|
};
|
|
1108
1108
|
}
|
|
1109
1109
|
init.method = "POST";
|
|
1110
|
-
init.body =
|
|
1110
|
+
init.body = JSON.stringify(
|
|
1111
|
+
args.mapKey.startsWith("0x") ? args.mapKey : `0x${args.mapKey}`
|
|
1112
|
+
);
|
|
1113
|
+
init.headers = { ...init.headers, "Content-Type": "application/json" };
|
|
1111
1114
|
const endpoint = `${args.baseUrl}/v2/map_entry/${args.contractAddress}/${args.contractName}/${args.mapName}?${search}`;
|
|
1112
1115
|
const res = await fetch(endpoint, init);
|
|
1113
1116
|
if (!res.ok) {
|
|
@@ -1115,10 +1118,11 @@ async function mapEntry(args) {
|
|
|
1115
1118
|
name: "FetchMapEntryError",
|
|
1116
1119
|
message: "Failed to fetch map entry.",
|
|
1117
1120
|
data: {
|
|
1121
|
+
init,
|
|
1118
1122
|
status: res.status,
|
|
1119
1123
|
statusText: res.statusText,
|
|
1120
1124
|
endpoint,
|
|
1121
|
-
bodyParseResult: await safePromise(res.
|
|
1125
|
+
bodyParseResult: await safePromise(res.text())
|
|
1122
1126
|
}
|
|
1123
1127
|
});
|
|
1124
1128
|
}
|