Skip to content

Commit 20e67e3

Browse files
authored
expose session config (#517)
* expose session config to users of WalletSDKRelay
1 parent 3bea824 commit 20e67e3

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

src/relay/WalletSDKRelay.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import {
1717

1818
import { EventListener, EVENTS } from "../connection/EventListener";
1919
import { ServerMessageEvent } from "../connection/ServerMessage";
20+
import { SessionConfig } from "../connection/SessionConfig";
2021
import { WalletSDKConnection } from "../connection/WalletSDKConnection";
2122
import { ScopedLocalStorage } from "../lib/ScopedLocalStorage";
2223
import { WalletUI, WalletUIOptions } from "../provider/WalletUI";
@@ -122,6 +123,19 @@ export class WalletSDKRelay extends WalletSDKRelayAbstract {
122123
this.eventListener,
123124
);
124125

126+
this.subscriptions.add(
127+
this.connection.sessionConfig$.subscribe({
128+
next: sessionConfig => {
129+
this.onSessionConfigChanged(sessionConfig);
130+
},
131+
error: () => {
132+
this.eventListener?.onEvent(EVENTS.GENERAL_ERROR, {
133+
message: "error while invoking session config callback",
134+
});
135+
},
136+
}),
137+
);
138+
125139
this.subscriptions.add(
126140
this.connection.incomingEvent$
127141
.pipe(filter(m => m.event === "Web3Response"))
@@ -1166,4 +1180,6 @@ export class WalletSDKRelay extends WalletSDKRelayAbstract {
11661180
break;
11671181
}
11681182
}
1183+
1184+
protected onSessionConfigChanged(_nextSessionConfig: SessionConfig): void {}
11691185
}

0 commit comments

Comments
 (0)