@alephium/web3 1.2.2 → 1.2.4
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/src/api/utils.js
CHANGED
|
@@ -21,8 +21,8 @@ exports.isBalanceEqual = exports.convertHttpResponse = void 0;
|
|
|
21
21
|
require("cross-fetch/polyfill");
|
|
22
22
|
function convertHttpResponse(response) {
|
|
23
23
|
if (response.error) {
|
|
24
|
-
const errorMessage = response.error.detail ?? `
|
|
25
|
-
throw new Error(`[API Error] - ${errorMessage}`);
|
|
24
|
+
const errorMessage = response.error.detail ?? `Unknown error`;
|
|
25
|
+
throw new Error(`[API Error] - ${errorMessage} - Status code: ${response.status}`);
|
|
26
26
|
}
|
|
27
27
|
else {
|
|
28
28
|
return response.data;
|
|
@@ -1253,7 +1253,7 @@ async function multicallMethods(contract, instance, calls, getContractByCodeHash
|
|
|
1253
1253
|
const callsResult = {};
|
|
1254
1254
|
callsParams.forEach((call, index) => {
|
|
1255
1255
|
const methodIndex = call.methodIndex;
|
|
1256
|
-
const callResult = result.results[`${
|
|
1256
|
+
const callResult = result.results[`${index}`];
|
|
1257
1257
|
const methodName = callEntries[`${index}`][`0`];
|
|
1258
1258
|
callsResult[`${methodName}`] = contract.contract.fromApiCallContractResult(callResult, call.txId, methodIndex, getContractByCodeHash);
|
|
1259
1259
|
});
|
package/package.json
CHANGED
package/src/api/utils.ts
CHANGED
|
@@ -21,8 +21,8 @@ import * as node from '../api/api-alephium'
|
|
|
21
21
|
|
|
22
22
|
export function convertHttpResponse<T>(response: { status: number; data: T; error?: { detail: string } }): T {
|
|
23
23
|
if (response.error) {
|
|
24
|
-
const errorMessage = response.error.detail ?? `
|
|
25
|
-
throw new Error(`[API Error] - ${errorMessage}`)
|
|
24
|
+
const errorMessage = response.error.detail ?? `Unknown error`
|
|
25
|
+
throw new Error(`[API Error] - ${errorMessage} - Status code: ${response.status}`)
|
|
26
26
|
} else {
|
|
27
27
|
return response.data
|
|
28
28
|
}
|
package/src/contract/contract.ts
CHANGED
|
@@ -1940,7 +1940,7 @@ export async function multicallMethods<I extends ContractInstance, F extends Fie
|
|
|
1940
1940
|
const callsResult: Record<string, CallContractResult<any>> = {}
|
|
1941
1941
|
callsParams.forEach((call, index) => {
|
|
1942
1942
|
const methodIndex = call.methodIndex
|
|
1943
|
-
const callResult = result.results[`${
|
|
1943
|
+
const callResult = result.results[`${index}`]
|
|
1944
1944
|
const methodName = callEntries[`${index}`][`0`]
|
|
1945
1945
|
callsResult[`${methodName}`] = contract.contract.fromApiCallContractResult(
|
|
1946
1946
|
callResult,
|