@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.
package/dist/index.d.mts CHANGED
@@ -37,7 +37,11 @@ interface Account {
37
37
  balance?: string;
38
38
  name?: string;
39
39
  }
40
- interface IWalletAdapter {
40
+ interface ISigner {
41
+ signMessage(message: string): Promise<string>;
42
+ getAddress(): Promise<string>;
43
+ }
44
+ interface IWalletAdapter extends ISigner {
41
45
  readonly type: WalletType;
42
46
  readonly chainType: ChainType$1;
43
47
  readonly name: string;
@@ -261,6 +265,7 @@ declare abstract class WalletAdapter extends EventEmitter implements IWalletAdap
261
265
  abstract disconnect(): Promise<void>;
262
266
  abstract isAvailable(): Promise<boolean>;
263
267
  abstract signMessage(message: string): Promise<string>;
268
+ getAddress(): Promise<string>;
264
269
  signTransaction?(_transaction: any): Promise<string>;
265
270
  signTypedData?(_typedData: any): Promise<string>;
266
271
  switchChain?(_chainId: number): Promise<void>;
@@ -465,4 +470,4 @@ declare function hexToNumber(hex: string): number;
465
470
  declare function ensureHexPrefix(value: string): string;
466
471
  declare function removeHexPrefix(value: string): string;
467
472
 
468
- export { type Account, AdapterRegistry, type AddChainParams, AuthMessageGenerator, type AuthMessageParams, BrowserWalletAdapter, CHAIN_INFO, type ChainInfo, ChainNotSupportedError, ChainType$1 as ChainType, ConfigurationError, type ConnectedWallet, ConnectionRejectedError, type ContractReadParams, type ContractWriteParams, EVMPrivateKeyAdapter, type EVMTransaction, type IWalletAdapter, MetaMaskAdapter, MethodNotSupportedError, NetworkError, SUPPORTED_WALLETS, SignatureRejectedError, SignatureVerifier, type StorageData, type Transaction, TransactionFailedError, type TransactionReceipt, TronLinkAdapter, type TronTransaction, type UniversalAddress, WalletAdapter, type WalletAvailability, WalletDetector, type WalletHistoryRecord, WalletManager, type WalletManagerConfig, type WalletManagerEvents, type WalletMetadata, WalletNotAvailableError, WalletNotConnectedError, WalletSDKError, WalletState, WalletType, compareEVMAddresses, compareTronAddresses, compareUniversalAddresses, createUniversalAddress, WalletManager as default, ensureHexPrefix, formatEVMAddress, fromHex, getAddressFromUniversalAddress, getChainIdFromUniversalAddress, getChainInfo, getChainType, getEVMWallets, getTronWallets, getWalletMetadata, hexToNumber, isEVMChain, isHex, isTronChain, isValidChainId, isValidEVMAddress, isValidSignature, isValidTransactionHash, isValidTronAddress, isValidTronHexAddress, isValidUniversalAddress, numberToHex, parseUniversalAddress, removeHexPrefix, shortenAddress, shortenTronAddress, toHex, validateAddress, validateAddressForChain };
473
+ export { type Account, AdapterRegistry, type AddChainParams, AuthMessageGenerator, type AuthMessageParams, BrowserWalletAdapter, CHAIN_INFO, type ChainInfo, ChainNotSupportedError, ChainType$1 as ChainType, ConfigurationError, type ConnectedWallet, ConnectionRejectedError, type ContractReadParams, type ContractWriteParams, EVMPrivateKeyAdapter, type EVMTransaction, type ISigner, type IWalletAdapter, MetaMaskAdapter, MethodNotSupportedError, NetworkError, SUPPORTED_WALLETS, SignatureRejectedError, SignatureVerifier, type StorageData, type Transaction, TransactionFailedError, type TransactionReceipt, TronLinkAdapter, type TronTransaction, type UniversalAddress, WalletAdapter, type WalletAvailability, WalletDetector, type WalletHistoryRecord, WalletManager, type WalletManagerConfig, type WalletManagerEvents, type WalletMetadata, WalletNotAvailableError, WalletNotConnectedError, WalletSDKError, WalletState, WalletType, compareEVMAddresses, compareTronAddresses, compareUniversalAddresses, createUniversalAddress, WalletManager as default, ensureHexPrefix, formatEVMAddress, fromHex, getAddressFromUniversalAddress, getChainIdFromUniversalAddress, getChainInfo, getChainType, getEVMWallets, getTronWallets, getWalletMetadata, hexToNumber, isEVMChain, isHex, isTronChain, isValidChainId, isValidEVMAddress, isValidSignature, isValidTransactionHash, isValidTronAddress, isValidTronHexAddress, isValidUniversalAddress, numberToHex, parseUniversalAddress, removeHexPrefix, shortenAddress, shortenTronAddress, toHex, validateAddress, validateAddressForChain };
package/dist/index.d.ts CHANGED
@@ -37,7 +37,11 @@ interface Account {
37
37
  balance?: string;
38
38
  name?: string;
39
39
  }
40
- interface IWalletAdapter {
40
+ interface ISigner {
41
+ signMessage(message: string): Promise<string>;
42
+ getAddress(): Promise<string>;
43
+ }
44
+ interface IWalletAdapter extends ISigner {
41
45
  readonly type: WalletType;
42
46
  readonly chainType: ChainType$1;
43
47
  readonly name: string;
@@ -261,6 +265,7 @@ declare abstract class WalletAdapter extends EventEmitter implements IWalletAdap
261
265
  abstract disconnect(): Promise<void>;
262
266
  abstract isAvailable(): Promise<boolean>;
263
267
  abstract signMessage(message: string): Promise<string>;
268
+ getAddress(): Promise<string>;
264
269
  signTransaction?(_transaction: any): Promise<string>;
265
270
  signTypedData?(_typedData: any): Promise<string>;
266
271
  switchChain?(_chainId: number): Promise<void>;
@@ -465,4 +470,4 @@ declare function hexToNumber(hex: string): number;
465
470
  declare function ensureHexPrefix(value: string): string;
466
471
  declare function removeHexPrefix(value: string): string;
467
472
 
468
- export { type Account, AdapterRegistry, type AddChainParams, AuthMessageGenerator, type AuthMessageParams, BrowserWalletAdapter, CHAIN_INFO, type ChainInfo, ChainNotSupportedError, ChainType$1 as ChainType, ConfigurationError, type ConnectedWallet, ConnectionRejectedError, type ContractReadParams, type ContractWriteParams, EVMPrivateKeyAdapter, type EVMTransaction, type IWalletAdapter, MetaMaskAdapter, MethodNotSupportedError, NetworkError, SUPPORTED_WALLETS, SignatureRejectedError, SignatureVerifier, type StorageData, type Transaction, TransactionFailedError, type TransactionReceipt, TronLinkAdapter, type TronTransaction, type UniversalAddress, WalletAdapter, type WalletAvailability, WalletDetector, type WalletHistoryRecord, WalletManager, type WalletManagerConfig, type WalletManagerEvents, type WalletMetadata, WalletNotAvailableError, WalletNotConnectedError, WalletSDKError, WalletState, WalletType, compareEVMAddresses, compareTronAddresses, compareUniversalAddresses, createUniversalAddress, WalletManager as default, ensureHexPrefix, formatEVMAddress, fromHex, getAddressFromUniversalAddress, getChainIdFromUniversalAddress, getChainInfo, getChainType, getEVMWallets, getTronWallets, getWalletMetadata, hexToNumber, isEVMChain, isHex, isTronChain, isValidChainId, isValidEVMAddress, isValidSignature, isValidTransactionHash, isValidTronAddress, isValidTronHexAddress, isValidUniversalAddress, numberToHex, parseUniversalAddress, removeHexPrefix, shortenAddress, shortenTronAddress, toHex, validateAddress, validateAddressForChain };
473
+ export { type Account, AdapterRegistry, type AddChainParams, AuthMessageGenerator, type AuthMessageParams, BrowserWalletAdapter, CHAIN_INFO, type ChainInfo, ChainNotSupportedError, ChainType$1 as ChainType, ConfigurationError, type ConnectedWallet, ConnectionRejectedError, type ContractReadParams, type ContractWriteParams, EVMPrivateKeyAdapter, type EVMTransaction, type ISigner, type IWalletAdapter, MetaMaskAdapter, MethodNotSupportedError, NetworkError, SUPPORTED_WALLETS, SignatureRejectedError, SignatureVerifier, type StorageData, type Transaction, TransactionFailedError, type TransactionReceipt, TronLinkAdapter, type TronTransaction, type UniversalAddress, WalletAdapter, type WalletAvailability, WalletDetector, type WalletHistoryRecord, WalletManager, type WalletManagerConfig, type WalletManagerEvents, type WalletMetadata, WalletNotAvailableError, WalletNotConnectedError, WalletSDKError, WalletState, WalletType, compareEVMAddresses, compareTronAddresses, compareUniversalAddresses, createUniversalAddress, WalletManager as default, ensureHexPrefix, formatEVMAddress, fromHex, getAddressFromUniversalAddress, getChainIdFromUniversalAddress, getChainInfo, getChainType, getEVMWallets, getTronWallets, getWalletMetadata, hexToNumber, isEVMChain, isHex, isTronChain, isValidChainId, isValidEVMAddress, isValidSignature, isValidTransactionHash, isValidTronAddress, isValidTronHexAddress, isValidUniversalAddress, numberToHex, parseUniversalAddress, removeHexPrefix, shortenAddress, shortenTronAddress, toHex, validateAddress, validateAddressForChain };
package/dist/index.js CHANGED
@@ -158,6 +158,17 @@ var WalletAdapter = class extends EventEmitter__default.default {
158
158
  this.state = "disconnected" /* DISCONNECTED */;
159
159
  this.currentAccount = null;
160
160
  }
161
+ /**
162
+ * Get the signer's address (implements ISigner interface)
163
+ * Returns the native address of the current account
164
+ */
165
+ async getAddress() {
166
+ this.ensureConnected();
167
+ if (!this.currentAccount) {
168
+ throw new WalletNotConnectedError(this.type);
169
+ }
170
+ return this.currentAccount.nativeAddress;
171
+ }
161
172
  signTransaction(_transaction) {
162
173
  throw new MethodNotSupportedError("signTransaction", this.type);
163
174
  }