Skip to main content
Version: Next

Namespace: wallet

Functions

requestAccounts

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

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<Address[]>

allowed accounts addresses

Defined in

src/wallet/connect.ts:25


getPermissions

getPermissions(swo): Promise<Permission[]>

Request Permission for wallet account

Parameters

NameType
swoStarknetWindowObject

Returns

Promise<Permission[]>

allowed accounts addresses

Defined in

src/wallet/connect.ts:39


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:48


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:60


switchStarknetChain

switchStarknetChain(swo, chainId): Promise<boolean>

Request Wallet Network change

Parameters

NameTypeDescription
swoStarknetWindowObject-
chainIdstringStarknetChainId

Returns

Promise<boolean>

boolean

Defined in

src/wallet/connect.ts:73


requestChainId

requestChainId(swo): Promise<ChainId>

Request the current chain ID from the wallet.

Parameters

NameType
swoStarknetWindowObject

Returns

Promise<ChainId>

The current Starknet chain ID.

Defined in

src/wallet/connect.ts:84


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:92


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:101


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:113


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:126


supportedSpecs

supportedSpecs(swo): Promise<SpecVersion[]>

Get the list of supported specifications.

Parameters

NameType
swoStarknetWindowObject

Returns

Promise<SpecVersion[]>

An array of supported specification strings.

Defined in

src/wallet/connect.ts:134


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:147


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:161