Namespace: wallet
Functions
requestAccounts
▸ requestAccounts(swo
, silent_mode?
): Promise
<Address
[]>
Request Permission for wallet account, return addresses that are allowed by user
Parameters
Name | Type | Default value | Description |
---|---|---|---|
swo | StarknetWindowObject | undefined | - |
silent_mode? | boolean | false | false: request user interaction allowance. true: return only pre-allowed |
Returns
Promise
<Address
[]>
allowed accounts addresses
Defined in
getPermissions
▸ getPermissions(swo
): Promise
<Permission
[]>
Request Permission for wallet account
Parameters
Name | Type |
---|---|
swo | StarknetWindowObject |
Returns
Promise
<Permission
[]>
allowed accounts addresses
Defined in
watchAsset
▸ watchAsset(swo
, asset
): Promise
<boolean
>
Request adding ERC20 Token to Wallet List
Parameters
Name | Type | Description |
---|---|---|
swo | StarknetWindowObject | - |
asset | WatchAssetParameters | WatchAssetParameters |
Returns
Promise
<boolean
>
boolean
Defined in
addStarknetChain
▸ addStarknetChain(swo
, chain
): Promise
<boolean
>
Request adding custom Starknet chain
Parameters
Name | Type | Description |
---|---|---|
swo | StarknetWindowObject | - |
chain | AddStarknetChainParameters | AddStarknetChainParameters |
Returns
Promise
<boolean
>
boolean
Defined in
switchStarknetChain
▸ switchStarknetChain(swo
, chainId
): Promise
<boolean
>
Request Wallet Network change
Parameters
Name | Type | Description |
---|---|---|
swo | StarknetWindowObject | - |
chainId | string | StarknetChainId |
Returns
Promise
<boolean
>
boolean
Defined in
requestChainId
▸ requestChainId(swo
): Promise
<ChainId
>
Request the current chain ID from the wallet.
Parameters
Name | Type |
---|---|
swo | StarknetWindowObject |
Returns
Promise
<ChainId
>
The current Starknet chain ID.
Defined in
deploymentData
▸ deploymentData(swo
): Promise
<AccountDeploymentData
>
Get deployment data for a contract.
Parameters
Name | Type |
---|---|
swo | StarknetWindowObject |
Returns
Promise
<AccountDeploymentData
>
The deployment data result.
Defined in
addInvokeTransaction
▸ addInvokeTransaction(swo
, params
): Promise
<AddInvokeTransactionResult
>
Add an invoke transaction to the wallet.
Parameters
Name | Type | Description |
---|---|---|
swo | StarknetWindowObject | - |
params | AddInvokeTransactionParameters | The parameters required for the invoke transaction. |
Returns
Promise
<AddInvokeTransactionResult
>
The result of adding the invoke transaction.
Defined in
addDeclareTransaction
▸ addDeclareTransaction(swo
, params
): Promise
<AddDeclareTransactionResult
>
Add a declare transaction to the wallet.
Parameters
Name | Type | Description |
---|---|---|
swo | StarknetWindowObject | - |
params | AddDeclareTransactionParameters | The parameters required for the declare transaction. |
Returns
Promise
<AddDeclareTransactionResult
>
The result of adding the declare transaction.
Defined in
signMessage
▸ signMessage(swo
, typedData
): Promise
<Signature
>
Sign typed data using the wallet.
Parameters
Name | Type | Description |
---|---|---|
swo | StarknetWindowObject | the starknet (wallet) window object to request the signature. |
typedData | TypedData | The typed data to sign. |
Returns
Promise
<Signature
>
An array of signatures as strings.
Defined in
supportedSpecs
▸ supportedSpecs(swo
): Promise
<SpecVersion
[]>
Get the list of supported specifications.
Parameters
Name | Type |
---|---|
swo | StarknetWindowObject |
Returns
Promise
<SpecVersion
[]>
An array of supported specification strings.
Defined in
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
Name | Type | Description |
---|---|---|
swo | StarknetWindowObject | The StarknetWindowObject to attach the event handler to. |
callback | AccountChangeEventHandler | The function to be called when the accounts are changed. It will receive the changed accounts as a parameter. |
Returns
void
Defined in
onNetworkChanged
▸ onNetworkChanged(swo
, callback
): void
Register a callback function to be called when the network is changed.
Parameters
Name | Type | Description |
---|---|---|
swo | StarknetWindowObject | The StarknetWindowObject instance. |
callback | NetworkChangeEventHandler | The callback function to be called when the network is changed. |
Returns
void