Skip to main content
Version: 6.11.0

Namespace: wallet

Functions​

requestAccounts​

â–¸ requestAccounts(swo, silent_mode?): Promise<string[]>

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

Parameters​

NameTypeDefault valueDescription
swoStarknetWindowObjectundefined-
silent_mode?booleanfalsefalse: request user interaction allowance. true: return only pre-allowed

Returns​

Promise<string[]>

allowed accounts addresses

Defined in​

src/wallet/connect.ts:20


getPermissions​

â–¸ getPermissions(swo): Promise<[] | "accounts"[]>

Request Permission for wallet account

Parameters​

NameType
swoStarknetWindowObject

Returns​

Promise<[] | "accounts"[]>

allowed accounts addresses

Defined in​

src/wallet/connect.ts:33


watchAsset​

â–¸ watchAsset(swo, asset): Promise<boolean>

Request adding ERC20 Token to Wallet List

Parameters​

NameTypeDescription
swoStarknetWindowObject-
assetWatchAssetParametersWatchAssetParameters

Returns​

Promise<boolean>

boolean

Defined in​

src/wallet/connect.ts:42


addStarknetChain​

â–¸ addStarknetChain(swo, chain): Promise<boolean>

Request adding custom Starknet chain

Parameters​

NameTypeDescription
swoStarknetWindowObject-
chainAddStarknetChainParametersAddStarknetChainParameters

Returns​

Promise<boolean>

boolean

Defined in​

src/wallet/connect.ts:54


switchStarknetChain​

â–¸ switchStarknetChain(swo, chainId): Promise<boolean>

Request Wallet Network change

Parameters​

NameTypeDescription
swoStarknetWindowObject-
chainIdstringStarknetChainId

Returns​

Promise<boolean>

boolean

Defined in​

src/wallet/connect.ts:67


requestChainId​

â–¸ requestChainId(swo): Promise<string>

Request the current chain ID from the wallet.

Parameters​

NameType
swoStarknetWindowObject

Returns​

Promise<string>

The current Starknet chain ID.

Defined in​

src/wallet/connect.ts:80


deploymentData​

â–¸ deploymentData(swo): Promise<AccountDeploymentData>

Get deployment data for a contract.

Parameters​

NameType
swoStarknetWindowObject

Returns​

Promise<AccountDeploymentData>

The deployment data result.

Defined in​

src/wallet/connect.ts:88


addInvokeTransaction​

â–¸ addInvokeTransaction(swo, params): Promise<AddInvokeTransactionResult>

Add an invoke transaction to the wallet.

Parameters​

NameTypeDescription
swoStarknetWindowObject-
paramsAddInvokeTransactionParametersThe parameters required for the invoke transaction.

Returns​

Promise<AddInvokeTransactionResult>

The result of adding the invoke transaction.

Defined in​

src/wallet/connect.ts:97


addDeclareTransaction​

â–¸ addDeclareTransaction(swo, params): Promise<AddDeclareTransactionResult>

Add a declare transaction to the wallet.

Parameters​

NameTypeDescription
swoStarknetWindowObject-
paramsAddDeclareTransactionParametersThe parameters required for the declare transaction.

Returns​

Promise<AddDeclareTransactionResult>

The result of adding the declare transaction.

Defined in​

src/wallet/connect.ts:112


signMessage​

â–¸ signMessage(swo, typedData): Promise<SIGNATURE>

Sign typed data using the wallet.

Parameters​

NameTypeDescription
swoStarknetWindowObjectthe starknet (wallet) window object to request the signature.
typedDataTypedDataThe typed data to sign.

Returns​

Promise<SIGNATURE>

An array of signatures as strings.

Defined in​

src/wallet/connect.ts:128


supportedSpecs​

â–¸ supportedSpecs(swo): Promise<string[]>

Get the list of supported specifications.

Parameters​

NameType
swoStarknetWindowObject

Returns​

Promise<string[]>

An array of supported specification strings.

Defined in​

src/wallet/connect.ts:139


onAccountChange​

â–¸ onAccountChange(swo, callback): void

Attaches an event handler function to the "accountsChanged" event of a StarknetWindowObject. When the accounts are changed, the specified callback function will be called.

Parameters​

NameTypeDescription
swoStarknetWindowObjectThe StarknetWindowObject to attach the event handler to.
callbackAccountChangeEventHandlerThe function to be called when the accounts are changed. It will receive the changed accounts as a parameter.

Returns​

void

Defined in​

src/wallet/connect.ts:152


onNetworkChanged​

â–¸ onNetworkChanged(swo, callback): void

Register a callback function to be called when the network is changed.

Parameters​

NameTypeDescription
swoStarknetWindowObjectThe StarknetWindowObject instance.
callbackNetworkChangeEventHandlerThe callback function to be called when the network is changed.

Returns​

void

Defined in​

src/wallet/connect.ts:166