@openfort/openfort-node 0.8.0 → 0.8.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/CHANGELOG.md +6 -0
- package/dist/index.js +10 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -374,7 +374,7 @@ function requiresWalletAuth(requestMethod, requestPath) {
|
|
|
374
374
|
}
|
|
375
375
|
|
|
376
376
|
// src/version.ts
|
|
377
|
-
var VERSION = "0.8.
|
|
377
|
+
var VERSION = "0.8.1";
|
|
378
378
|
var PACKAGE = "@openfort/openfort-node";
|
|
379
379
|
|
|
380
380
|
// src/openapi-client/openfortApiClient.ts
|
|
@@ -443,6 +443,10 @@ var configure = (options) => {
|
|
|
443
443
|
retryDelay: exponentialDelay,
|
|
444
444
|
retries: 3,
|
|
445
445
|
retryCondition: (error) => {
|
|
446
|
+
const hasWalletAuth = error.config?.headers?.["X-Wallet-Auth"] !== void 0;
|
|
447
|
+
if (hasWalletAuth) {
|
|
448
|
+
return false;
|
|
449
|
+
}
|
|
446
450
|
return axiosRetry.isNetworkOrIdempotentRequestError(error) || error.response?.status !== void 0 && error.response.status >= 500;
|
|
447
451
|
}
|
|
448
452
|
});
|
|
@@ -578,7 +582,8 @@ function handleResponseError(statusCode, responseData, cause) {
|
|
|
578
582
|
const correlationId = isOpenfortError(responseData) ? responseData.correlationId : void 0;
|
|
579
583
|
let errorMessage;
|
|
580
584
|
if (isOpenfortError(responseData)) {
|
|
581
|
-
|
|
585
|
+
const nestedMessage = responseData.error && typeof responseData.error === "object" ? responseData.error.message : void 0;
|
|
586
|
+
errorMessage = responseData.message || nestedMessage || (typeof responseData.error === "string" ? responseData.error : void 0) || "Unknown error";
|
|
582
587
|
} else if (typeof responseData === "string") {
|
|
583
588
|
errorMessage = responseData;
|
|
584
589
|
} else if (responseData) {
|
|
@@ -604,7 +609,7 @@ function handleResponseError(statusCode, responseData, cause) {
|
|
|
604
609
|
throw new APIError(
|
|
605
610
|
statusCode,
|
|
606
611
|
"unauthorized",
|
|
607
|
-
"Unauthorized. Check your API key.",
|
|
612
|
+
errorMessage || "Unauthorized. Check your API key.",
|
|
608
613
|
correlationId,
|
|
609
614
|
`${ERROR_DOCS_URL}#unauthorized`,
|
|
610
615
|
cause
|
|
@@ -3753,6 +3758,7 @@ import {
|
|
|
3753
3758
|
getTypesForEIP712Domain,
|
|
3754
3759
|
hashMessage,
|
|
3755
3760
|
hashTypedData,
|
|
3761
|
+
keccak256,
|
|
3756
3762
|
parseSignature,
|
|
3757
3763
|
serializeTransaction
|
|
3758
3764
|
} from "viem";
|
|
@@ -3793,7 +3799,8 @@ function toEvmAccount(data) {
|
|
|
3793
3799
|
},
|
|
3794
3800
|
async signTransaction(transaction) {
|
|
3795
3801
|
const serialized = serializeTransaction(transaction);
|
|
3796
|
-
const
|
|
3802
|
+
const hash = keccak256(serialized);
|
|
3803
|
+
const response = await sign(id, { data: hash });
|
|
3797
3804
|
const signature2 = parseSignature(response.signature);
|
|
3798
3805
|
const signedTransaction = serializeTransaction(
|
|
3799
3806
|
transaction,
|
|
@@ -4595,7 +4602,7 @@ import { hashMessage as hashMessage2, toHex } from "viem";
|
|
|
4595
4602
|
|
|
4596
4603
|
// src/wallets/evm/actions/signTransaction.ts
|
|
4597
4604
|
import {
|
|
4598
|
-
keccak256,
|
|
4605
|
+
keccak256 as keccak2562,
|
|
4599
4606
|
parseSignature as parseSignature2,
|
|
4600
4607
|
serializeTransaction as serializeTransaction2
|
|
4601
4608
|
} from "viem";
|