Skip to main content
Version: Next

Namespace: walletV5

Functions

requestAccounts

requestAccounts(walletWSF, silent_mode?): Promise<Address[]>

Request Permission for wallet account, return addresses that are allowed by user

Parameters

NameTypeDefault valueDescription
walletWSFWalletWithStarknetFeaturesundefinedThe get-starknet V5 wallet object to use.
silent_mode?booleanfalsefalse: request user interaction allowance. true: return only pre-allowed

Returns

Promise<Address[]>

allowed accounts addresses

Defined in

src/wallet/connectV5.ts:25


getPermissions

getPermissions(walletWSF): Promise<Permission[]>

Request if DAPP is connected to wallet.

Parameters

NameTypeDescription
walletWSFWalletWithStarknetFeaturesThe get-starknet V5 wallet object to use.

Returns

Promise<Permission[]>

"accounts" if permission granted

Defined in

src/wallet/connectV5.ts:40


watchAsset

watchAsset(walletWSF, asset): Promise<boolean>

Request adding an ERC20 Token to the Wallet List

Parameters

NameTypeDescription
walletWSFWalletWithStarknetFeaturesThe get-starknet V5 wallet object to use.
assetWatchAssetParametersdescription of the token to add.

Returns

Promise<boolean>

true if the token was added successfully

Defined in

src/wallet/connectV5.ts:50


addStarknetChain

addStarknetChain(walletWSF, chain): Promise<boolean>

Request adding custom Starknet chain

Parameters

NameTypeDescription
walletWSFWalletWithStarknetFeaturesThe get-starknet V5 wallet object to use.
chainAddStarknetChainParametersdescription of the chain to add.

Returns

Promise<boolean>

true if the chain was added successfully

Defined in

src/wallet/connectV5.ts:66


switchStarknetChain

switchStarknetChain(walletWSF, chainId): Promise<boolean>

Request Wallet Network change

Parameters

NameTypeDescription
walletWSFWalletWithStarknetFeaturesThe get-starknet V5 wallet object to use.
chainIdstringencoded name of the chain requested.

Returns

Promise<boolean>

true if the chain was changed successfully

Defined in

src/wallet/connectV5.ts:82


requestChainId

requestChainId(walletWSF): Promise<ChainId>

Request the current chain ID from the wallet.

Parameters

NameTypeDescription
walletWSFWalletWithStarknetFeaturesThe get-starknet V5 wallet object to use.

Returns

Promise<ChainId>

The current Starknet chain ID.

Defined in

src/wallet/connectV5.ts:97


deploymentData

deploymentData(walletWSF): Promise<AccountDeploymentData>

Get deployment data for a contract.

Parameters

NameTypeDescription
walletWSFWalletWithStarknetFeaturesThe get-starknet V5 wallet object to use.

Returns

Promise<AccountDeploymentData>

The deployment data result.

Defined in

src/wallet/connectV5.ts:106


addInvokeTransaction

addInvokeTransaction(walletWSF, params): Promise<AddInvokeTransactionResult>

Add an invoke transaction to the wallet.

Parameters

NameTypeDescription
walletWSFWalletWithStarknetFeaturesThe get-starknet V5 wallet object to use.
paramsAddInvokeTransactionParametersThe parameters required for the invoke transaction.

Returns

Promise<AddInvokeTransactionResult>

The result of adding the invoke transaction.

Defined in

src/wallet/connectV5.ts:118


addDeclareTransaction

addDeclareTransaction(walletWSF, params): Promise<AddDeclareTransactionResult>

Add a declare transaction to the wallet.

Parameters

NameTypeDescription
walletWSFWalletWithStarknetFeaturesThe get-starknet V5 wallet object to use.
paramsAddDeclareTransactionParametersThe parameters required for the declare transaction.

Returns

Promise<AddDeclareTransactionResult>

The result of adding the declare transaction.

Defined in

src/wallet/connectV5.ts:134


signMessage

signMessage(walletWSF, typedData): Promise<Signature>

Sign typed data using the wallet.

Parameters

NameTypeDescription
walletWSFWalletWithStarknetFeaturesThe get-starknet V5 wallet object to use.
typedDataTypedDataThe typed data to sign.

Returns

Promise<Signature>

An array of signatures as strings.

Defined in

src/wallet/connectV5.ts:150


supportedSpecs

supportedSpecs(walletWSF): Promise<SpecVersion[]>

Get the list of supported Wallet API specifications.

Parameters

NameTypeDescription
walletWSFWalletWithStarknetFeaturesThe get-starknet V5 wallet object to use.

Returns

Promise<SpecVersion[]>

An array of wallet API supported specification strings.

Defined in

src/wallet/connectV5.ts:165


subscribeWalletEvent

subscribeWalletEvent(walletWSF, callback): () => void

Attaches an event handler function for the changes of network and account. When the account/network are changed, the specified callback function will be called.

Parameters

NameTypeDescription
walletWSFWalletWithStarknetFeaturesThe get-starknet V5 wallet object to use.
callback(change: StandardEventsChangeProperties) => voidThe function to be called when the account/network are changed.

Returns

fn

function to execute to unsubscribe events.

▸ (): void

Returns

void

Defined in

src/wallet/connectV5.ts:176