@vleap/warps-adapter-fastset 0.1.0-beta.42 → 0.1.0-beta.43

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/index.js CHANGED
@@ -2953,10 +2953,19 @@ var WarpFastsetWallet = class {
2953
2953
  }
2954
2954
  getPublicKey() {
2955
2955
  const privateKey = (0, import_warps5.getWarpWalletPrivateKeyFromConfig)(this.config, this.chain.name);
2956
- if (!privateKey) return null;
2957
- const privateKeyBytes = hexToUint8Array(privateKey);
2958
- const publicKey = ed25519_exports.getPublicKey(privateKeyBytes);
2959
- return uint8ArrayToHex(publicKey);
2956
+ if (privateKey) {
2957
+ const privateKeyBytes = hexToUint8Array(privateKey);
2958
+ const publicKey = ed25519_exports.getPublicKey(privateKeyBytes);
2959
+ return uint8ArrayToHex(publicKey);
2960
+ }
2961
+ const address = (0, import_warps5.getWarpWalletAddressFromConfig)(this.config, this.chain.name);
2962
+ if (!address) return null;
2963
+ try {
2964
+ const addressBytes = FastsetClient.decodeBech32Address(address);
2965
+ return uint8ArrayToHex(addressBytes);
2966
+ } catch {
2967
+ return null;
2968
+ }
2960
2969
  }
2961
2970
  };
2962
2971