@enclave-hq/wallet-sdk 1.1.4 → 1.1.6

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.
@@ -36,7 +36,11 @@ interface Account {
36
36
  balance?: string;
37
37
  name?: string;
38
38
  }
39
- interface IWalletAdapter {
39
+ interface ISigner {
40
+ signMessage(message: string): Promise<string>;
41
+ getAddress(): Promise<string>;
42
+ }
43
+ interface IWalletAdapter extends ISigner {
40
44
  readonly type: WalletType;
41
45
  readonly chainType: ChainType;
42
46
  readonly name: string;
@@ -36,7 +36,11 @@ interface Account {
36
36
  balance?: string;
37
37
  name?: string;
38
38
  }
39
- interface IWalletAdapter {
39
+ interface ISigner {
40
+ signMessage(message: string): Promise<string>;
41
+ getAddress(): Promise<string>;
42
+ }
43
+ interface IWalletAdapter extends ISigner {
40
44
  readonly type: WalletType;
41
45
  readonly chainType: ChainType;
42
46
  readonly name: string;
@@ -120,6 +120,17 @@ var WalletAdapter = class extends EventEmitter__default.default {
120
120
  this.state = "disconnected" /* DISCONNECTED */;
121
121
  this.currentAccount = null;
122
122
  }
123
+ /**
124
+ * Get the signer's address (implements ISigner interface)
125
+ * Returns the native address of the current account
126
+ */
127
+ async getAddress() {
128
+ this.ensureConnected();
129
+ if (!this.currentAccount) {
130
+ throw new WalletNotConnectedError(this.type);
131
+ }
132
+ return this.currentAccount.nativeAddress;
133
+ }
123
134
  signTransaction(_transaction) {
124
135
  throw new MethodNotSupportedError("signTransaction", this.type);
125
136
  }