apinow-sdk 0.11.13 → 0.11.16

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.
Files changed (2) hide show
  1. package/dist/index.js +5 -1
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -175,7 +175,11 @@ class ApiNow {
175
175
  // --- POST/PUT/etc.: Set data as body ---
176
176
  if (opts.data) {
177
177
  console.error(`txResponse: Setting data as body for ${method} request:`, opts.data);
178
- fetchOptions.body = JSON.stringify(opts.data);
178
+ const requestBodyString = JSON.stringify(opts.data);
179
+ const bodyBytes = new TextEncoder().encode(requestBodyString); // Convert to Uint8Array
180
+ fetchOptions.body = bodyBytes; // Use Uint8Array as the body
181
+ // Set Content-Length header from the byte length of the Uint8Array
182
+ fetchOptions.headers['Content-Length'] = String(bodyBytes.length);
179
183
  }
180
184
  }
181
185
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apinow-sdk",
3
- "version": "0.11.13",
3
+ "version": "0.11.16",
4
4
  "description": "ApiNow SDK · The endpoint vending machine",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -21,7 +21,7 @@
21
21
  "author": "ApiNow.fun",
22
22
  "license": "MIT",
23
23
  "dependencies": {
24
- "apinow-sdk": "^0.11.10",
24
+ "apinow-sdk": "^0.11.14",
25
25
  "ethers": "^6.13.5"
26
26
  },
27
27
  "devDependencies": {