@gala-chain/connect ∙ API
API > BrowserConnectClient
Class: BrowserConnectClient
Contents
- Extends
- Constructors
- new BrowserConnectClient(provider, options)
- Properties
- address
- isInitialized
- options
- provider
- Accessors
- ethereumAddress
- galaChainAddress
- Methods
- calculatePersonalSignPrefix()
- connect()
- disconnect()
- emit()
- getPublicKey()
- initializeListeners()
- off()
- on()
- onAccountsChanged()
- sign()
- signMessage()
- submit()
Extends
Constructors
new BrowserConnectClient(provider, options)
new BrowserConnectClient(
provider
?,options
?):BrowserConnectClient
Parameters
▪ provider?: Eip1193Provider
▪ options?: GalaChainProviderOptions
Overrides
Source
chain-connect/src/customClients/BrowserConnectClient.ts:32
Properties
address
protected
address:string
Inherited from
Source
chain-connect/src/GalaChainClient.ts:153
isInitialized
protected
isInitialized:boolean
=false
Source
chain-connect/src/customClients/BrowserConnectClient.ts:30
options
protected
options?:GalaChainProviderOptions
Inherited from
Source
chain-connect/src/GalaChainClient.ts:39
provider
protected
provider:undefined
|BrowserProvider
Inherited from
Source
chain-connect/src/GalaChainClient.ts:154
Accessors
ethereumAddress
get
ethereumAddress():string
set
ethereumAddress(val
):void
Parameters
▪ val: string
Source
chain-connect/src/GalaChainClient.ts:166
galaChainAddress
get
galaChainAddress():string
Source
chain-connect/src/GalaChainClient.ts:170
Methods
calculatePersonalSignPrefix()
calculatePersonalSignPrefix(
payload
):string
Parameters
▪ payload: object
Inherited from
WebSigner
.calculatePersonalSignPrefix
Source
chain-connect/src/GalaChainClient.ts:138
connect()
connect():
Promise
\<string
>
Overrides
Source
chain-connect/src/customClients/BrowserConnectClient.ts:70
disconnect()
disconnect():
void
Source
chain-connect/src/customClients/BrowserConnectClient.ts:86
emit()
emit(
event
,data
):boolean
Parameters
▪ event: keyof MetaMaskEvents
▪ data: null
| string
| string
[]
Inherited from
Source
chain-connect/src/GalaChainClient.ts:186
getPublicKey()
getPublicKey():
Promise
\<object
>
Inherited from
Source
chain-connect/src/GalaChainClient.ts:190
initializeListeners()
protected
initializeListeners():void
Initializes the listeners to watch for events from the provider. Not all providers may support every event
Source
chain-connect/src/customClients/BrowserConnectClient.ts:48
off()
off(
event
,listener
):BrowserConnectClient
Parameters
▪ event: keyof MetaMaskEvents
▪ listener: Listener
\<null
| string
| string
[]>
Inherited from
Source
chain-connect/src/GalaChainClient.ts:181
on()
on(
event
,listener
):BrowserConnectClient
Parameters
▪ event: keyof MetaMaskEvents
▪ listener: Listener
\<null
| string
| string
[]>
Inherited from
Source
chain-connect/src/GalaChainClient.ts:176
onAccountsChanged()
protected
onAccountsChanged(accounts
):void
Parameters
▪ accounts: string
[]
Source
chain-connect/src/customClients/BrowserConnectClient.ts:58
sign()
sign\<
T
>(method
,payload
,signingType
):Promise
\<T
&object
>
Type parameters
▪ T extends object
Parameters
▪ method: string
▪ payload: T
▪ signingType: SigningType
= SigningType.SIGN_TYPED_DATA
Overrides
Source
chain-connect/src/customClients/BrowserConnectClient.ts:94
signMessage()
signMessage(
message
):Promise
\<string
>
Parameters
▪ message: string
Inherited from
Source
chain-connect/src/GalaChainClient.ts:204
submit()
submit\<
T
,U
>(__namedParameters
):Promise
\<GalaChainResponseSuccess
\<T
>>
Type parameters
▪ T
▪ U extends object
Parameters
▪ __namedParameters: object
▪ __namedParameters.headers?: Record
\<string
, string
>
▪ __namedParameters.method: string
▪ __namedParameters.payload: ConstructorArgs
\<U
>
▪ __namedParameters.requestConstructor?: ClassConstructor
\<ChainCallDTO
>
▪ __namedParameters.responseConstructor?: NonArrayClassConstructor
\<T
>
▪ __namedParameters.sign?: boolean
▪ __namedParameters.signingType?: SigningType
▪ __namedParameters.url: string