@hashgraph/hedera-wallet-connect 2.0.4-canary.f71fa76.0 → 2.0.5-canary.09073be.0

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.
Files changed (70) hide show
  1. package/README.md +141 -8
  2. package/package.json +4 -2
  3. package/dist/index.d.ts +0 -2
  4. package/dist/index.js +0 -21
  5. package/dist/lib/dapp/DAppSigner.d.ts +0 -60
  6. package/dist/lib/dapp/DAppSigner.js +0 -301
  7. package/dist/lib/dapp/SessionNotFoundError.d.ts +0 -3
  8. package/dist/lib/dapp/SessionNotFoundError.js +0 -6
  9. package/dist/lib/dapp/index.d.ts +0 -216
  10. package/dist/lib/dapp/index.js +0 -580
  11. package/dist/lib/index.d.ts +0 -3
  12. package/dist/lib/index.js +0 -22
  13. package/dist/lib/shared/chainIds.d.ts +0 -11
  14. package/dist/lib/shared/chainIds.js +0 -31
  15. package/dist/lib/shared/errors.d.ts +0 -48
  16. package/dist/lib/shared/errors.js +0 -51
  17. package/dist/lib/shared/events.d.ts +0 -7
  18. package/dist/lib/shared/events.js +0 -27
  19. package/dist/lib/shared/extensionController.d.ts +0 -21
  20. package/dist/lib/shared/extensionController.js +0 -42
  21. package/dist/lib/shared/index.d.ts +0 -7
  22. package/dist/lib/shared/index.js +0 -26
  23. package/dist/lib/shared/logger.d.ts +0 -18
  24. package/dist/lib/shared/logger.js +0 -33
  25. package/dist/lib/shared/methods.d.ts +0 -12
  26. package/dist/lib/shared/methods.js +0 -32
  27. package/dist/lib/shared/payloads.d.ts +0 -101
  28. package/dist/lib/shared/payloads.js +0 -20
  29. package/dist/lib/shared/utils.d.ts +0 -275
  30. package/dist/lib/shared/utils.js +0 -420
  31. package/dist/lib/wallet/index.d.ts +0 -39
  32. package/dist/lib/wallet/index.js +0 -306
  33. package/dist/lib/wallet/provider.d.ts +0 -17
  34. package/dist/lib/wallet/provider.js +0 -58
  35. package/dist/lib/wallet/types.d.ts +0 -31
  36. package/dist/lib/wallet/types.js +0 -20
  37. package/dist/reown/adapter.d.ts +0 -59
  38. package/dist/reown/adapter.js +0 -261
  39. package/dist/reown/connectors/HederaConnector.d.ts +0 -31
  40. package/dist/reown/connectors/HederaConnector.js +0 -38
  41. package/dist/reown/connectors/index.d.ts +0 -1
  42. package/dist/reown/connectors/index.js +0 -1
  43. package/dist/reown/index.d.ts +0 -4
  44. package/dist/reown/index.js +0 -4
  45. package/dist/reown/providers/EIP155Provider.d.ts +0 -32
  46. package/dist/reown/providers/EIP155Provider.js +0 -187
  47. package/dist/reown/providers/HIP820Provider.d.ts +0 -26
  48. package/dist/reown/providers/HIP820Provider.js +0 -69
  49. package/dist/reown/providers/HederaProvider.d.ts +0 -164
  50. package/dist/reown/providers/HederaProvider.js +0 -471
  51. package/dist/reown/providers/index.d.ts +0 -3
  52. package/dist/reown/providers/index.js +0 -3
  53. package/dist/reown/utils/account.d.ts +0 -2
  54. package/dist/reown/utils/account.js +0 -20
  55. package/dist/reown/utils/chains.d.ts +0 -18
  56. package/dist/reown/utils/chains.js +0 -152
  57. package/dist/reown/utils/constants.d.ts +0 -16
  58. package/dist/reown/utils/constants.js +0 -18
  59. package/dist/reown/utils/helpers.d.ts +0 -12
  60. package/dist/reown/utils/helpers.js +0 -25
  61. package/dist/reown/utils/index.d.ts +0 -5
  62. package/dist/reown/utils/index.js +0 -5
  63. package/dist/reown/utils/types.d.ts +0 -9
  64. package/dist/reown/utils/types.js +0 -1
  65. package/dist/reown/wallets/EIP155Wallet.d.ts +0 -46
  66. package/dist/reown/wallets/EIP155Wallet.js +0 -124
  67. package/dist/reown/wallets/HIP820Wallet.d.ts +0 -53
  68. package/dist/reown/wallets/HIP820Wallet.js +0 -236
  69. package/dist/reown/wallets/index.d.ts +0 -2
  70. package/dist/reown/wallets/index.js +0 -2
@@ -1,216 +0,0 @@
1
- import { AccountId, LedgerId, Transaction } from '@hashgraph/sdk';
2
- import { SessionTypes, SignClientTypes } from '@walletconnect/types';
3
- import { WalletConnectModal } from '@walletconnect/modal';
4
- import SignClient from '@walletconnect/sign-client';
5
- import { LogLevel } from '../shared/logger';
6
- import { GetNodeAddressesResult, ExecuteTransactionParams, ExecuteTransactionResult, SignMessageParams, SignMessageResult, SignAndExecuteQueryResult, SignAndExecuteQueryParams, SignAndExecuteTransactionParams, SignAndExecuteTransactionResult, SignTransactionParams, SignTransactionResult, ExtensionData } from '../shared';
7
- import { DAppSigner } from './DAppSigner';
8
- export * from './DAppSigner';
9
- export { SessionNotFoundError } from './SessionNotFoundError';
10
- type BaseLogger = 'error' | 'warn' | 'info' | 'debug' | 'trace' | 'fatal';
11
- export declare class DAppConnector {
12
- private logger;
13
- dAppMetadata: SignClientTypes.Metadata;
14
- network: LedgerId;
15
- projectId: string;
16
- supportedMethods: string[];
17
- supportedEvents: string[];
18
- supportedChains: string[];
19
- extensions: ExtensionData[];
20
- onSessionIframeCreated: ((session: SessionTypes.Struct) => void) | null;
21
- walletConnectClient: SignClient | undefined;
22
- walletConnectModal: WalletConnectModal;
23
- signers: DAppSigner[];
24
- isInitializing: boolean;
25
- /**
26
- * Initializes the DAppConnector instance.
27
- * @param metadata - SignClientTypes.Metadata object for the DApp metadata.
28
- * @param network - LedgerId representing the network (default: LedgerId.TESTNET).
29
- * @param projectId - Project ID for the WalletConnect client.
30
- * @param methods - Array of supported methods for the DApp (optional).
31
- * @param events - Array of supported events for the DApp (optional).
32
- * @param chains - Array of supported chains for the DApp (optional).
33
- * @param logLevel - Logging level for the DAppConnector (optional).
34
- */
35
- constructor(metadata: SignClientTypes.Metadata, network: LedgerId, projectId: string, methods?: string[], events?: string[], chains?: string[], logLevel?: LogLevel);
36
- /**
37
- * Sets the logging level for the DAppConnector
38
- * @param level - The logging level to set
39
- */
40
- setLogLevel(level: LogLevel): void;
41
- /**
42
- * Initializes the DAppConnector instance.
43
- * @param logger - `BaseLogger` for logging purposes (optional).
44
- */
45
- init({ logger }?: {
46
- logger?: BaseLogger;
47
- }): Promise<void>;
48
- /**
49
- * Retrieves a DAppSigner for the specified Hedera Account ID.
50
- *
51
- * @param {AccountId} accountId - The Hedera Account ID to find the associated signer.
52
- * @returns {DAppSigner} - The signer object of type {@link DAppSigner} corresponding to the provided account ID.
53
- * @throws {Error} - If no signer is found for the provided account ID.
54
- */
55
- getSigner(accountId: AccountId): DAppSigner;
56
- /**
57
- * Initiates the WalletConnect connection flow using a QR code.
58
- * @param pairingTopic - The pairing topic for the connection (optional).
59
- * @param throwErrorOnReject - Whether to show an error when the user rejects the pairing (default: false).
60
- * @returns {Promise<SessionTypes.Struct>} - A Promise that resolves when the connection process is complete.
61
- */
62
- openModal(pairingTopic?: string, throwErrorOnReject?: boolean): Promise<SessionTypes.Struct>;
63
- /**
64
- * Initiates the WallecConnect connection flow using URI.
65
- * @param pairingTopic - The pairing topic for the connection (optional).
66
- * @param extensionId - The id for the extension used to connect (optional).
67
- * @returns A Promise that resolves when the connection process is complete.
68
- */
69
- connect(launchCallback: (uri: string) => void, pairingTopic?: string, extensionId?: string): Promise<SessionTypes.Struct>;
70
- /**
71
- * Initiates the WallecConnect connection flow sending a message to the extension.
72
- * @param extensionId - The id for the extension used to connect.
73
- * @param pairingTopic - The pairing topic for the connection (optional).
74
- * @returns A Promise that resolves when the connection process is complete.
75
- */
76
- connectExtension(extensionId: string, pairingTopic?: string): Promise<SessionTypes.Struct>;
77
- /**
78
- * Validates the session by checking if the session exists and is valid.
79
- * Also ensures the signer exists for the session.
80
- * @param topic - The topic of the session to validate.
81
- * @returns {boolean} - True if the session exists and has a valid signer, false otherwise.
82
- */
83
- private validateSession;
84
- /**
85
- * Validates the session and refreshes the signers by removing the invalid ones.
86
- */
87
- private validateAndRefreshSigners;
88
- /**
89
- * Initiates the WallecConnect connection if the wallet in iframe mode is detected.
90
- */
91
- private checkIframeConnect;
92
- private abortableConnect;
93
- /**
94
- * Disconnects the current session associated with the specified topic.
95
- * @param topic - The topic of the session to disconnect.
96
- * @returns A Promise that resolves when the session is disconnected.
97
- */
98
- disconnect(topic: string): Promise<boolean>;
99
- /**
100
- * Disconnects all active sessions and pairings.
101
- *
102
- * Throws error when WalletConnect is not initialized or there are no active sessions/pairings.
103
- * @returns A Promise that resolves when all active sessions and pairings are disconnected.
104
- */
105
- disconnectAll(): Promise<void>;
106
- private createSigners;
107
- private onSessionConnected;
108
- private connectURI;
109
- private request;
110
- /**
111
- * Retrieves the node addresses associated with the current Hedera network.
112
- *
113
- * When there is no active session or an error occurs during the request.
114
- * @returns Promise\<{@link GetNodeAddressesResult}\>
115
- */
116
- getNodeAddresses(): Promise<GetNodeAddressesResult>;
117
- /**
118
- * Executes a transaction on the Hedera network.
119
- *
120
- * @param {ExecuteTransactionParams} params - The parameters of type {@link ExecuteTransactionParams | `ExecuteTransactionParams`} required for the transaction execution.
121
- * @param {string[]} params.signedTransaction - Array of Base64-encoded `Transaction`'s
122
- * @returns Promise\<{@link ExecuteTransactionResult}\>
123
- * @example
124
- * Use helper `transactionToBase64String` to encode `Transaction` to Base64 string
125
- * ```ts
126
- * const params = {
127
- * signedTransaction: [transactionToBase64String(transaction)]
128
- * }
129
- *
130
- * const result = await dAppConnector.executeTransaction(params)
131
- * ```
132
- */
133
- executeTransaction(params: ExecuteTransactionParams): Promise<ExecuteTransactionResult>;
134
- /**
135
- * Signs a provided `message` with provided `signerAccountId`.
136
- *
137
- * @param {SignMessageParams} params - The parameters of type {@link SignMessageParams | `SignMessageParams`} required for signing message.
138
- * @param {string} params.signerAccountId - a signer Hedera Account identifier in {@link https://hips.hedera.com/hip/hip-30 | HIP-30} (`<nework>:<shard>.<realm>.<num>`) form.
139
- * @param {string} params.message - a plain UTF-8 string
140
- * @returns Promise\<{@link SignMessageResult}\>
141
- * @example
142
- * ```ts
143
- * const params = {
144
- * signerAccountId: 'hedera:testnet:0.0.12345',
145
- * message: 'Hello World!'
146
- * }
147
- *
148
- * const result = await dAppConnector.signMessage(params)
149
- * ```
150
- */
151
- signMessage(params: SignMessageParams): Promise<SignMessageResult>;
152
- /**
153
- * Signs and send `Query` on the Hedera network.
154
- *
155
- * @param {SignAndExecuteQueryParams} params - The parameters of type {@link SignAndExecuteQueryParams | `SignAndExecuteQueryParams`} required for the Query execution.
156
- * @param {string} params.signerAccountId - a signer Hedera Account identifier in {@link https://hips.hedera.com/hip/hip-30 | HIP-30} (`<nework>:<shard>.<realm>.<num>`) form.
157
- * @param {string} params.query - `Query` object represented as Base64 string
158
- * @returns Promise\<{@link SignAndExecuteQueryResult}\>
159
- * @example
160
- * Use helper `queryToBase64String` to encode `Query` to Base64 string
161
- * ```ts
162
- * const params = {
163
- * signerAccountId: '0.0.12345',
164
- * query: queryToBase64String(query),
165
- * }
166
- *
167
- * const result = await dAppConnector.signAndExecuteQuery(params)
168
- * ```
169
- */
170
- signAndExecuteQuery(params: SignAndExecuteQueryParams): Promise<SignAndExecuteQueryResult>;
171
- /**
172
- * Signs and executes Transactions on the Hedera network.
173
- *
174
- * @param {SignAndExecuteTransactionParams} params - The parameters of type {@link SignAndExecuteTransactionParams | `SignAndExecuteTransactionParams`} required for `Transaction` signing and execution.
175
- * @param {string} params.signerAccountId - a signer Hedera Account identifier in {@link https://hips.hedera.com/hip/hip-30 | HIP-30} (`<nework>:<shard>.<realm>.<num>`) form.
176
- * @param {string[]} params.transaction - Array of Base64-encoded `Transaction`'s
177
- * @returns Promise\<{@link SignAndExecuteTransactionResult}\>
178
- * @example
179
- * Use helper `transactionToBase64String` to encode `Transaction` to Base64 string
180
- * ```ts
181
- * const params = {
182
- * signerAccountId: '0.0.12345'
183
- * transaction: [transactionToBase64String(transaction)]
184
- * }
185
- *
186
- * const result = await dAppConnector.signAndExecuteTransaction(params)
187
- * ```
188
- */
189
- signAndExecuteTransaction(params: SignAndExecuteTransactionParams): Promise<SignAndExecuteTransactionResult>;
190
- /**
191
- * Signs and executes Transactions on the Hedera network.
192
- *
193
- * @param {SignTransactionParams} params - The parameters of type {@link SignTransactionParams | `SignTransactionParams`} required for `Transaction` signing.
194
- * @param {string} params.signerAccountId - a signer Hedera Account identifier in {@link https://hips.hedera.com/hip/hip-30 | HIP-30} (`<nework>:<shard>.<realm>.<num>`) form.
195
- * @param {Transaction | string} params.transactionBody - a built Transaction object, or a base64 string of a transaction body( HIP-820).
196
- * HIP-820 calls for a base64 encoded proto.TransactionBody and many wallets support a serialized Transaction object generated by the Hedera Javascript SDK.
197
- * Both options are supported here for backwards compatibility.
198
- * @returns Promise\<{@link SignTransactionResult}\>
199
- * @example
200
- * ```ts
201
- *
202
- * const params = {
203
- * signerAccountId: '0.0.12345',
204
- * transactionBody
205
- * }
206
- *
207
- * const result = await dAppConnector.signTransaction(params)
208
- * ```
209
- */
210
- signTransaction(params: SignTransactionParams): Promise<Transaction | SignTransactionResult>;
211
- private handleSessionEvent;
212
- private handleSessionUpdate;
213
- private handleSessionDelete;
214
- private handlePairingDelete;
215
- }
216
- export default DAppConnector;