@secretkeylabs/stacks-tools 0.4.0-da5eb9d → 0.4.0-da98468

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 CHANGED
@@ -1151,7 +1151,10 @@ async function mapEntry(args) {
1151
1151
  };
1152
1152
  }
1153
1153
  init.method = "POST";
1154
- init.body = args.mapKey;
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,9 +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
- bodyParseResult: await safePromise(res.json())
1168
+ endpoint,
1169
+ bodyParseResult: await safePromise(res.text())
1165
1170
  }
1166
1171
  });
1167
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 = args.mapKey;
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,9 +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
- bodyParseResult: await safePromise(res.json())
1124
+ endpoint,
1125
+ bodyParseResult: await safePromise(res.text())
1121
1126
  }
1122
1127
  });
1123
1128
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@secretkeylabs/stacks-tools",
3
- "version": "0.4.0-da5eb9d",
3
+ "version": "0.4.0-da98468",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"