Namespace: walletV5
Functions
requestAccounts
▸ requestAccounts(walletWSF, silent_mode?): Promise<Address[]>
Request Permission for wallet account, return addresses that are allowed by user
Parameters
| Name | Type | Default value | Description |
|---|---|---|---|
walletWSF | WalletWithStarknetFeatures | undefined | The get-starknet V5 wallet object to use. |
silent_mode? | boolean | false | false: request user interaction allowance. true: return only pre-allowed |
Returns
Promise<Address[]>
allowed accounts addresses
Defined in
getPermissions
▸ getPermissions(walletWSF): Promise<Permission[]>
Request if DAPP is connected to wallet.
Parameters
| Name | Type | Description |
|---|---|---|
walletWSF | WalletWithStarknetFeatures | The get-starknet V5 wallet object to use. |
Returns
Promise<Permission[]>
"accounts" if permission granted
Defined in
watchAsset
▸ watchAsset(walletWSF, asset): Promise<boolean>
Request adding an ERC20 Token to the Wallet List
Parameters
| Name | Type | Description |
|---|---|---|
walletWSF | WalletWithStarknetFeatures | The get-starknet V5 wallet object to use. |
asset | WatchAssetParameters | description of the token to add. |
Returns
Promise<boolean>
true if the token was added successfully
Defined in
addStarknetChain
▸ addStarknetChain(walletWSF, chain): Promise<boolean>
Request adding custom Starknet chain
Parameters
| Name | Type | Description |
|---|---|---|
walletWSF | WalletWithStarknetFeatures | The get-starknet V5 wallet object to use. |
chain | AddStarknetChainParameters | description of the chain to add. |
Returns
Promise<boolean>
true if the chain was added successfully
Defined in
switchStarknetChain
▸ switchStarknetChain(walletWSF, chainId): Promise<boolean>
Request Wallet Network change
Parameters
| Name | Type | Description |
|---|---|---|
walletWSF | WalletWithStarknetFeatures | The get-starknet V5 wallet object to use. |
chainId | string | encoded name of the chain requested. |
Returns
Promise<boolean>
true if the chain was changed successfully
Defined in
requestChainId
▸ requestChainId(walletWSF): Promise<ChainId>
Request the current chain ID from the wallet.
Parameters
| Name | Type | Description |
|---|---|---|
walletWSF | WalletWithStarknetFeatures | The get-starknet V5 wallet object to use. |
Returns
Promise<ChainId>
The current Starknet chain ID.
Defined in
deploymentData
▸ deploymentData(walletWSF): Promise<AccountDeploymentData>
Get deployment data for a contract.
Parameters
| Name | Type | Description |
|---|---|---|
walletWSF | WalletWithStarknetFeatures | The get-starknet V5 wallet object to use. |
Returns
Promise<AccountDeploymentData>
The deployment data result.
Defined in
addInvokeTransaction
▸ addInvokeTransaction(walletWSF, params): Promise<AddInvokeTransactionResult>
Add an invoke transaction to the wallet.
Parameters
| Name | Type | Description |
|---|---|---|
walletWSF | WalletWithStarknetFeatures | The get-starknet V5 wallet object to use. |
params | AddInvokeTransactionParameters | The parameters required for the invoke transaction. |
Returns
Promise<AddInvokeTransactionResult>
The result of adding the invoke transaction.
Defined in
addDeclareTransaction
▸ addDeclareTransaction(walletWSF, params): Promise<AddDeclareTransactionResult>
Add a declare transaction to the wallet.
Parameters
| Name | Type | Description |
|---|---|---|
walletWSF | WalletWithStarknetFeatures | The get-starknet V5 wallet object to use. |
params | AddDeclareTransactionParameters | The parameters required for the declare transaction. |
Returns
Promise<AddDeclareTransactionResult>
The result of adding the declare transaction.
Defined in
signMessage
▸ signMessage(walletWSF, typedData): Promise<Signature>
Sign typed data using the wallet.
Parameters
| Name | Type | Description |
|---|---|---|
walletWSF | WalletWithStarknetFeatures | The get-starknet V5 wallet object to use. |
typedData | TypedData | The typed data to sign. |
Returns
Promise<Signature>
An array of signatures as strings.
Defined in
supportedSpecs
▸ supportedSpecs(walletWSF): Promise<SpecVersion[]>
Get the list of supported Wallet API specifications.
Parameters
| Name | Type | Description |
|---|---|---|
walletWSF | WalletWithStarknetFeatures | The get-starknet V5 wallet object to use. |
Returns
Promise<SpecVersion[]>
An array of wallet API supported specification strings.
Defined in
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
| Name | Type | Description |
|---|---|---|
walletWSF | WalletWithStarknetFeatures | The get-starknet V5 wallet object to use. |
callback | (change: StandardEventsChangeProperties) => void | The function to be called when the account/network are changed. |
Returns
fn
function to execute to unsubscribe events.
▸ (): void
Returns
void