addAbi(abiMap: AbiMap): Promise<boolean>
addAsset(asset: Asset): Promise<boolean>
addAssets(asset: Asset[]): Promise<boolean>
addNetwork(url: string): Promise<boolean>
clean(): void
connect(): Promise<boolean>
currentAccount(): Promise<string | null>
currentConnector(): FuelConnector
currentNetwork(): Promise<Network>
destroy(): void
disconnect(): Promise<boolean>
on
method. EventEmitter
enabling, on
, once
, and off
.
The events enum FuelConnectorEventTypes
can be imported from the @fuels
package. fuel
object has an events
property which is an enum of all the events that can be listened to. on
method takes two arguments, the event name and a callback function. The callback function receives data associated with the event. fuel.on(fuel.events.connection, (connectionState) => {
console.log(connectionState);
});
Event | Trigger | Params |
---|---|---|
connectors | connectors change | Array<FuelConnector> |
currentConnector | current connector change | FuelConnector |
accounts | accounts available change | Array<string> |
currentAccount | current account change | string | null |
connection | connection state change | boolean |
currentNetwork | current network change | Network |
assets | assets metadata change | Array<Asset> |
getABI(contractId: string): Promise<JsonAbi>
isConnected(): Promise<boolean>
getConnector(connectorName: string): FuelConnector
getWallet(address: string | AbstractAddress, provider?: Provider): Promise<Account>
Account
instance, which can be used for contracts, transfers, and other interactions. hasABI(contractId: string): Promise<boolean>
hasConnector(connectorName?: string | FuelConnector): Promise<boolean>
accounts(): Promise<Array<string>>
assets(): Promise<Array<Asset>>
connectors(): Promise<Array<FuelConnector>>
networks(): Promise<Array<Network>>
async signMessage(address: string, message: string): Promise<string>
selectConnector(connectorName: string): Promise<boolean>
selectNetwork(url: string): Promise<boolean>
async sendTransaction(address: string, transaction: TransactionRequestLike): Promise<string>
unsubscribe(): void
version(): Promise<string>