Icon LinkClass: WalletLocked

@fuel-ts/wallet.WalletLocked

WalletLocked provides the functionalities for a locked wallet.

Icon LinkHierarchy

Icon LinkConstructors

Icon Linkconstructor

new WalletLocked(address, provider?)

Creates a new Account instance.

Icon LinkParameters

NameTypeDefault valueDescription
addressstring | AbstractAddressundefinedThe address of the account.
providerstring | ProviderFUEL_NETWORK_URLThe provider URL or a Provider instance.

Icon LinkInherited from

Account.constructor

Icon LinkDefined in

account.ts:57 Icon Link

Icon LinkProperties

Icon Linkaddress

Readonly address: AbstractAddress

The address associated with the account.

Icon LinkInherited from

Account.address

Icon LinkDefined in

account.ts:44 Icon Link


Icon Linkprovider

provider: Provider

The provider used to interact with the network.

Icon LinkInherited from

Account.provider

Icon LinkDefined in

account.ts:49 Icon Link

Icon LinkMethods

Icon Linkconnect

connect(provider): Provider

Changes the provider connection for the account.

Icon LinkParameters

NameTypeDescription
providerstring | ProviderThe provider URL or a Provider instance.

Icon LinkReturns

Provider

The updated Provider instance.

Icon LinkInherited from

Account.connect

Icon LinkDefined in

account.ts:69 Icon Link


Icon Linkfund

fund<T>(request): Promise<void>

Adds resources to the transaction enough to fund it.

Icon LinkType parameters

NameType
Textends TransactionRequest

Icon LinkParameters

NameTypeDescription
requestTThe transaction request.

Icon LinkReturns

Promise<void>

A promise that resolves when the resources are added to the transaction.

Icon LinkInherited from

Account.fund

Icon LinkDefined in

account.ts:207 Icon Link


Icon LinkgetBalance

getBalance(assetId?): Promise<BN>

Retrieves the balance of the account for the given asset.

Icon LinkParameters

NameTypeDefault valueDescription
assetIdBytesLikeBaseAssetIdThe asset ID to check the balance for.

Icon LinkReturns

Promise<BN>

A promise that resolves to the balance amount.

Icon LinkInherited from

Account.getBalance

Icon LinkDefined in

account.ts:165 Icon Link


Icon LinkgetBalances

getBalances(): Promise<CoinQuantity[]>

Retrieves all the balances for the account.

Icon LinkReturns

Promise<CoinQuantity[]>

A promise that resolves to an array of Coins and their quantities.

Icon LinkInherited from

Account.getBalances

Icon LinkDefined in

account.ts:175 Icon Link


Icon LinkgetCoins

getCoins(assetId?): Promise<Coin[]>

Retrieves coins owned by the account.

Icon LinkParameters

NameTypeDescription
assetId?BytesLikeThe asset ID of the coins to retrieve.

Icon LinkReturns

Promise<Coin[]>

A promise that resolves to an array of Coins.

Icon LinkInherited from

Account.getCoins

Icon LinkDefined in

account.ts:102 Icon Link


Icon LinkgetMessages

getMessages(): Promise<Message[]>

Retrieves messages owned by the account.

Icon LinkReturns

Promise<Message[]>

A promise that resolves to an array of Messages.

Icon LinkInherited from

Account.getMessages

Icon LinkDefined in

account.ts:133 Icon Link


Icon LinkgetResourcesToSpend

getResourcesToSpend(quantities, excludedIds?): Promise<Resource[]>

Retrieves resources satisfying the spend query for the account.

Icon LinkParameters

NameTypeDescription
quantitiesCoinQuantityLike[]IDs of coins to exclude.
excludedIds?ExcludeResourcesOptionIDs of resources to be excluded from the query.

Icon LinkReturns

Promise<Resource[]>

A promise that resolves to an array of Resources.

Icon LinkInherited from

Account.getResourcesToSpend

Icon LinkDefined in

account.ts:89 Icon Link


Icon LinksendTransaction

sendTransaction(transactionRequestLike): Promise<TransactionResponse>

Sends a transaction to the network.

Icon LinkParameters

NameTypeDescription
transactionRequestLikeTransactionRequestLikeThe transaction request to be sent.

Icon LinkReturns

Promise<TransactionResponse>

A promise that resolves to the transaction response.

Icon LinkInherited from

Account.sendTransaction

Icon LinkDefined in

account.ts:354 Icon Link


Icon LinksimulateTransaction

simulateTransaction(transactionRequestLike): Promise<CallResult>

Simulates a transaction.

Icon LinkParameters

NameTypeDescription
transactionRequestLikeTransactionRequestLikeThe transaction request to be simulated.

Icon LinkReturns

Promise<CallResult>

A promise that resolves to the call result.

Icon LinkInherited from

Account.simulateTransaction

Icon LinkDefined in

account.ts:368 Icon Link


Icon Linktransfer

transfer(destination, amount, assetId?, txParams?): Promise<TransactionResponse>

Transfers coins to a destination address.

Icon LinkParameters

NameTypeDefault valueDescription
destinationAbstractAddressundefinedThe address of the destination.
amountBigNumberishundefinedThe amount of coins to transfer.
assetIdBytesLikeBaseAssetIdThe asset ID of the coins to transfer.
txParamsTxParamsType{}The transaction parameters (gasLimit, gasPrice, maturity).

Icon LinkReturns

Promise<TransactionResponse>

A promise that resolves to the transaction response.

Icon LinkInherited from

Account.transfer

Icon LinkDefined in

account.ts:223 Icon Link


Icon LinktransferToContract

transferToContract(contractId, amount, assetId?, txParams?): Promise<TransactionResponse>

Transfers coins to a contract address.

Icon LinkParameters

NameTypeDefault valueDescription
contractIdAbstractAddressundefinedThe address of the contract.
amountBigNumberishundefinedThe amount of coins to transfer.
assetIdBytesLikeBaseAssetIdThe asset ID of the coins to transfer.
txParamsTxParamsType{}The optional transaction parameters.

Icon LinkReturns

Promise<TransactionResponse>

A promise that resolves to the transaction response.

Icon LinkInherited from

Account.transferToContract

Icon LinkDefined in

account.ts:262 Icon Link


Icon Linkunlock

unlock(privateKey): WalletUnlocked

Unlocks the wallet using the provided private key and returns an instance of WalletUnlocked.

Icon LinkParameters

NameTypeDescription
privateKeyBytesLikeThe private key used to unlock the wallet.

Icon LinkReturns

WalletUnlocked

An instance of WalletUnlocked.

Icon LinkDefined in

wallets.ts:27 Icon Link


Icon LinkwithdrawToBaseLayer

withdrawToBaseLayer(recipient, amount, txParams?): Promise<TransactionResponse>

Withdraws an amount of the base asset to the base chain.

Icon LinkParameters

NameTypeDescription
recipientAbstractAddressAddress of the recipient on the base chain.
amountBigNumberishAmount of base asset.
txParamsTxParamsTypeThe optional transaction parameters.

Icon LinkReturns

Promise<TransactionResponse>

A promise that resolves to the transaction response.

Icon LinkInherited from

Account.withdrawToBaseLayer

Icon LinkDefined in

account.ts:314 Icon Link