Skip to content

Commit 6fcb73e

Browse files
committed
feat: updated magic-router tx confirmation from polling to websocket subscription signatureSubscribe
1 parent d5c1642 commit 6fcb73e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ts/src/magic-router.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export async function getClosestValidator(routerConnection: Connection) : Promis
4949

5050
const identityData = (await response.json())?.result;
5151

52-
if (identityData == undefined || identityData.identity == undefined) {
52+
if ((identityData == null) || (identityData.identity == null)) {
5353
throw new Error("Invalid response");
5454
}
5555

@@ -208,13 +208,13 @@ export async function sendAndConfirmMagicTransaction(
208208
signature
209209
}, options?.commitment)).value;
210210
} else {
211-
if (options?.abortSignal !== undefined) {
211+
if (options?.abortSignal !== null) {
212212
console.warn('sendAndConfirmTransaction(): A transaction with a deprecated confirmation strategy was ' + 'supplied along with an `abortSignal`. Only transactions having `lastValidBlockHeight` ' + 'or a combination of `nonceInfo` and `minNonceContextSlot` are abortable.');
213213
}
214214
status = (await connection.confirmTransaction(signature, options?.commitment)).value;
215215
}
216216
if (status.err) {
217-
if (signature !== undefined) {
217+
if (signature !== null) {
218218
throw new SendTransactionError({
219219
action: 'send',
220220
signature: signature,

0 commit comments

Comments
 (0)