@hashgraph/hedera-wallet-connect 1.3.7-canary.519a0db.0 → 1.3.7-canary.689bd9f.0
Sign up to get free protection for your applications and to get access to all the features.
@@ -99,20 +99,17 @@ export class DAppConnector {
|
|
99
99
|
if (!this.projectId) {
|
100
100
|
throw new Error('Project ID is not defined');
|
101
101
|
}
|
102
|
-
|
102
|
+
this.walletConnectClient = await SignClient.init({
|
103
103
|
logger,
|
104
104
|
relayUrl: 'wss://relay.walletconnect.com',
|
105
105
|
projectId: this.projectId,
|
106
106
|
metadata: this.dAppMetadata,
|
107
107
|
});
|
108
|
-
this.walletConnectClient = signClient;
|
109
108
|
const existingSessions = this.walletConnectClient.session.getAll();
|
110
|
-
if (existingSessions.length > 0)
|
109
|
+
if (existingSessions.length > 0)
|
111
110
|
this.signers = existingSessions.flatMap((session) => this.createSigners(session));
|
112
|
-
|
113
|
-
|
114
|
-
await this.checkIframeConnect();
|
115
|
-
}
|
111
|
+
else
|
112
|
+
this.checkIframeConnect();
|
116
113
|
this.walletConnectClient.on('session_event', (event) => {
|
117
114
|
// Handle session events, such as "chainChanged", "accountsChanged", etc.
|
118
115
|
this.logger.debug('Session event received:', event);
|
@@ -355,7 +352,7 @@ export class DAppConnector {
|
|
355
352
|
// Filter out any existing signers with duplicate AccountIds
|
356
353
|
for (const newSigner of newSigners) {
|
357
354
|
// We check if any signers have the same account, extension + metadata name.
|
358
|
-
const existingSigners = this.signers.filter(
|
355
|
+
const existingSigners = this.signers.filter((currentSigner) => {
|
359
356
|
var _a, _b;
|
360
357
|
const matchingAccountId = ((_a = currentSigner === null || currentSigner === void 0 ? void 0 : currentSigner.getAccountId()) === null || _a === void 0 ? void 0 : _a.toString()) === ((_b = newSigner === null || newSigner === void 0 ? void 0 : newSigner.getAccountId()) === null || _b === void 0 ? void 0 : _b.toString());
|
361
358
|
const matchingExtensionId = newSigner.extensionId === currentSigner.extensionId;
|
@@ -49,8 +49,8 @@ export declare function base64StringToTransaction<T extends Transaction>(transac
|
|
49
49
|
* @param transaction - a base64 encoded string of proto.TransactionBody.encode().finish()
|
50
50
|
* @returns `string`
|
51
51
|
* */
|
52
|
-
export declare function transactionToTransactionBody<T extends Transaction>(transaction: T, nodeAccountId: AccountId):
|
53
|
-
export declare function transactionBodyToBase64String(transactionBody:
|
52
|
+
export declare function transactionToTransactionBody<T extends Transaction>(transaction: T, nodeAccountId: AccountId): Uint8Array | null | undefined;
|
53
|
+
export declare function transactionBodyToBase64String(transactionBody: Uint8Array): string;
|
54
54
|
/**
|
55
55
|
* @param transactionList - a proto.TransactionList object
|
56
56
|
* @returns `string`
|
@@ -86,10 +86,10 @@ export function base64StringToTransaction(transactionBytes) {
|
|
86
86
|
export function transactionToTransactionBody(transaction, nodeAccountId) {
|
87
87
|
// This is a private function, though provides the capabilities to construct a proto.TransactionBody
|
88
88
|
//@ts-ignore
|
89
|
-
return transaction.
|
89
|
+
return transaction._signedTransactions.current.bodyBytes;
|
90
90
|
}
|
91
91
|
export function transactionBodyToBase64String(transactionBody) {
|
92
|
-
return Uint8ArrayToBase64String(
|
92
|
+
return Uint8ArrayToBase64String(transactionBody);
|
93
93
|
}
|
94
94
|
/**
|
95
95
|
* @param transactionList - a proto.TransactionList object
|
package/package.json
CHANGED