@veridex/sdk 1.1.2 → 1.1.3

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.
@@ -1251,14 +1251,28 @@ var EVMClient = class {
1251
1251
  return { receipt };
1252
1252
  }
1253
1253
  async getTransactionPolicy(identityKeyHash) {
1254
- const result = await this.hubContract.getTransactionPolicy(identityKeyHash);
1255
- return {
1256
- enabled: result.enabled,
1257
- threshold: Number(result.threshold),
1258
- protectedActionMask: Number(result.protectedActionMask),
1259
- proposalTtl: Number(result.proposalTtl),
1260
- disableSessions: result.disableSessions
1261
- };
1254
+ try {
1255
+ const result = await this.hubContract.getTransactionPolicy(identityKeyHash);
1256
+ return {
1257
+ enabled: result.enabled,
1258
+ threshold: Number(result.threshold),
1259
+ protectedActionMask: Number(result.protectedActionMask),
1260
+ proposalTtl: Number(result.proposalTtl),
1261
+ disableSessions: result.disableSessions
1262
+ };
1263
+ } catch (error) {
1264
+ const code = error?.code;
1265
+ if (code === "CALL_EXCEPTION" || code === "BAD_DATA") {
1266
+ return {
1267
+ enabled: false,
1268
+ threshold: 0,
1269
+ protectedActionMask: 0,
1270
+ proposalTtl: 0,
1271
+ disableSessions: false
1272
+ };
1273
+ }
1274
+ throw error;
1275
+ }
1262
1276
  }
1263
1277
  async createTransactionProposal(signature, publicKeyX, publicKeyY, targetChain, actionPayload, signer) {
1264
1278
  const s = signer;