Skip to main content

starknet-service

Functions

<dl> <dt><a href="#getChainConfig">getChainConfig()</a></dt> <dd><p>Get chain config by name</p> </dd> <dt><a href="#createProvider">createProvider()</a></dt> <dd><p>Create a StarkNet provider with fallback RPCs</p> </dd> <dt><a href="#getSupportedChains">getSupportedChains()</a></dt> <dd><p>Get supported chains</p> </dd> <dt><a href="#generateKeypair">generateKeypair()</a></dt> <dd><p>Generate a random keypair</p> </dd> <dt><a href="#createWallet">createWallet()</a></dt> <dd><p>Create a new wallet on StarkNet</p> </dd> <dt><a href="#getAccount">getAccount()</a></dt> <dd><p>Get Account instance from encrypted or raw private key</p> </dd> <dt><a href="#getBalance">getBalance()</a></dt> <dd><p>Get wallet balance (native ETH)</p> </dd> <dt><a href="#getNativeBalance">getNativeBalance()</a></dt> <dd><p>Get native token balance (ETH)</p> </dd> <dt><a href="#transfer">transfer()</a></dt> <dd><p>Transfer native tokens (ETH) Note: StarkNet uses account abstraction, so we need to deploy an account first or use thefee transfer mechanism</p> </dd> <dt><a href="#getTokenBalance">getTokenBalance()</a></dt> <dd><p>Get ERC20 token balance</p> </dd> <dt><a href="#transferToken">transferToken()</a></dt> <dd><p>Transfer ERC20 tokens</p> </dd> <dt><a href="#deployAccount">deployAccount()</a></dt> <dd><p>Deploy account (account abstraction)</p> <p>Note: On StarkNet, all wallets are smart contract accounts. This function creates and deploys an account contract.</p> </dd> <dt><a href="#getTransactionReceipt">getTransactionReceipt()</a></dt> <dd><p>Get transaction receipt/status</p> </dd> <dt><a href="#estimateFee">estimateFee()</a></dt> <dd><p>Estimate fee for a transaction</p> </dd> <dt><a href="#getChainId">getChainId()</a></dt> <dd><p>Get chain ID</p> </dd> <dt><a href="#isValidAddress">isValidAddress()</a></dt> <dd><p>Validate address format (StarkNet address)</p> </dd> <dt><a href="#getSupportedTokens">getSupportedTokens()</a></dt> <dd><p>Get supported tokens</p> </dd> </dl>

<a name="getChainConfig"></a>

getChainConfig()

Get chain config by name

Kind: global function
<a name="createProvider"></a>

createProvider()

Create a StarkNet provider with fallback RPCs

Kind: global function
<a name="getSupportedChains"></a>

getSupportedChains()

Get supported chains

Kind: global function
<a name="generateKeypair"></a>

generateKeypair()

Generate a random keypair

Kind: global function
<a name="createWallet"></a>

createWallet()

Create a new wallet on StarkNet

Kind: global function
<a name="getAccount"></a>

getAccount()

Get Account instance from encrypted or raw private key

Kind: global function
<a name="getBalance"></a>

getBalance()

Get wallet balance (native ETH)

Kind: global function
<a name="getNativeBalance"></a>

getNativeBalance()

Get native token balance (ETH)

Kind: global function
<a name="transfer"></a>

transfer()

Transfer native tokens (ETH) Note: StarkNet uses account abstraction, so we need to deploy an account first or use thefee transfer mechanism

Kind: global function
<a name="getTokenBalance"></a>

getTokenBalance()

Get ERC20 token balance

Kind: global function
<a name="transferToken"></a>

transferToken()

Transfer ERC20 tokens

Kind: global function
<a name="deployAccount"></a>

deployAccount()

Deploy account (account abstraction)

Note: On StarkNet, all wallets are smart contract accounts. This function creates and deploys an account contract.

Kind: global function
<a name="getTransactionReceipt"></a>

getTransactionReceipt()

Get transaction receipt/status

Kind: global function
<a name="estimateFee"></a>

estimateFee()

Estimate fee for a transaction

Kind: global function
<a name="getChainId"></a>

getChainId()

Get chain ID

Kind: global function
<a name="isValidAddress"></a>

isValidAddress()

Validate address format (StarkNet address)

Kind: global function
<a name="getSupportedTokens"></a>

getSupportedTokens()

Get supported tokens

Kind: global function