@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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.8.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#61](https://github.com/openfort-xyz/openfort-node/pull/61) [`8618e2248ef6f0cd92c0cb469c20562c27d2761c`](https://github.com/openfort-xyz/openfort-node/commit/8618e2248ef6f0cd92c0cb469c20562c27d2761c) Thanks [@jamalavedra](https://github.com/jamalavedra)! - fix signing
|
|
8
|
+
|
|
3
9
|
## 0.8.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
package/dist/index.js
CHANGED
|
@@ -830,7 +830,7 @@ function requiresWalletAuth(requestMethod, requestPath) {
|
|
|
830
830
|
}
|
|
831
831
|
|
|
832
832
|
// src/version.ts
|
|
833
|
-
var VERSION = "0.8.
|
|
833
|
+
var VERSION = "0.8.1";
|
|
834
834
|
var PACKAGE = "@openfort/openfort-node";
|
|
835
835
|
|
|
836
836
|
// src/openapi-client/openfortApiClient.ts
|
|
@@ -899,6 +899,10 @@ var configure = (options) => {
|
|
|
899
899
|
retryDelay: import_axios_retry.exponentialDelay,
|
|
900
900
|
retries: 3,
|
|
901
901
|
retryCondition: (error) => {
|
|
902
|
+
const hasWalletAuth = error.config?.headers?.["X-Wallet-Auth"] !== void 0;
|
|
903
|
+
if (hasWalletAuth) {
|
|
904
|
+
return false;
|
|
905
|
+
}
|
|
902
906
|
return import_axios_retry.default.isNetworkOrIdempotentRequestError(error) || error.response?.status !== void 0 && error.response.status >= 500;
|
|
903
907
|
}
|
|
904
908
|
});
|
|
@@ -1034,7 +1038,8 @@ function handleResponseError(statusCode, responseData, cause) {
|
|
|
1034
1038
|
const correlationId = isOpenfortError(responseData) ? responseData.correlationId : void 0;
|
|
1035
1039
|
let errorMessage;
|
|
1036
1040
|
if (isOpenfortError(responseData)) {
|
|
1037
|
-
|
|
1041
|
+
const nestedMessage = responseData.error && typeof responseData.error === "object" ? responseData.error.message : void 0;
|
|
1042
|
+
errorMessage = responseData.message || nestedMessage || (typeof responseData.error === "string" ? responseData.error : void 0) || "Unknown error";
|
|
1038
1043
|
} else if (typeof responseData === "string") {
|
|
1039
1044
|
errorMessage = responseData;
|
|
1040
1045
|
} else if (responseData) {
|
|
@@ -1060,7 +1065,7 @@ function handleResponseError(statusCode, responseData, cause) {
|
|
|
1060
1065
|
throw new APIError(
|
|
1061
1066
|
statusCode,
|
|
1062
1067
|
"unauthorized",
|
|
1063
|
-
"Unauthorized. Check your API key.",
|
|
1068
|
+
errorMessage || "Unauthorized. Check your API key.",
|
|
1064
1069
|
correlationId,
|
|
1065
1070
|
`${ERROR_DOCS_URL}#unauthorized`,
|
|
1066
1071
|
cause
|
|
@@ -4238,7 +4243,8 @@ function toEvmAccount(data) {
|
|
|
4238
4243
|
},
|
|
4239
4244
|
async signTransaction(transaction) {
|
|
4240
4245
|
const serialized = (0, import_viem.serializeTransaction)(transaction);
|
|
4241
|
-
const
|
|
4246
|
+
const hash = (0, import_viem.keccak256)(serialized);
|
|
4247
|
+
const response = await sign(id, { data: hash });
|
|
4242
4248
|
const signature2 = (0, import_viem.parseSignature)(response.signature);
|
|
4243
4249
|
const signedTransaction = (0, import_viem.serializeTransaction)(
|
|
4244
4250
|
transaction,
|