@@ -26,6 +26,8 @@ import {PrivateKey, PublicKey, UInt64} from '@wharfkit/antelope'
2626import { sealMessage } from '@wharfkit/sealed-messages'
2727import WebSocket from 'isomorphic-ws'
2828
29+ import defaultTranslations from './translations'
30+
2931interface WebAuthenticatorOptions {
3032 /** The URL of the web authenticator service */
3133 webAuthenticatorUrl ?: string
@@ -79,6 +81,11 @@ export class WalletPluginWebAuthenticator extends AbstractWalletPlugin implement
7981 return 'web-authenticator'
8082 }
8183
84+ /**
85+ * The translations for this plugin
86+ */
87+ translations = defaultTranslations
88+
8289 /**
8390 * Opens a popup window with the given URL and waits for it to complete
8491 */
@@ -92,6 +99,8 @@ export class WalletPluginWebAuthenticator extends AbstractWalletPlugin implement
9299 // Show status message using WharfKit UI
93100 ui ?. status ( 'Opening authenticator popup...' )
94101
102+ const t = ui ?. getTranslate ( this . id )
103+
95104 let popup : Window | null = null
96105
97106 popup = window . open ( url , 'Web Authenticator' , 'width=450,height=750' )
@@ -115,7 +124,7 @@ export class WalletPluginWebAuthenticator extends AbstractWalletPlugin implement
115124 }
116125 } , 1000 )
117126
118- waitForCallback ( receiveOptions , this . buoyWs , 30000 )
127+ waitForCallback ( receiveOptions , this . buoyWs , t )
119128 . then ( ( response ) => {
120129 clearInterval ( checkClosed )
121130 popup ?. close ( )
@@ -276,7 +285,7 @@ export class WalletPluginWebAuthenticator extends AbstractWalletPlugin implement
276285
277286 const signUrl = `${ this . webAuthenticatorUrl } /sign?sealed=${ sealedRequest . toString (
278287 'hex'
279- ) } &nonce=${ nonce . toString ( ) } &chain=${ context . chain ?. name } &accountName=${
288+ ) } &nonce=${ nonce . toString ( ) } &chain=${ context . chain ?. id } &accountName=${
280289 context . accountName
281290 } &permissionName=${ context . permissionName } &appName=${
282291 context . appName
0 commit comments