Configuration
CreateConfig
Creates new Config object.
Import
import { createConfig } from '@arkproject/core'
Usage
Create a mainnet configuration using pre-deployed contracts.
import { createConfig, networks } from '@arkproject/core'
export const config = createConfig({
starknetNetwork: networks.mainnet,
arkchainNetwork: networks.mainnet,
})
Create a local configuration with development contracts. See development quickstart for more information.
import { createConfig, networks } from '@arkproject/core'
export const config = createConfig({
starknetNetwork: networks.dev,
starknetExecutorContract: '0x0',
starknetCurrencyContract: '0x0',
arkchainNetwork: networks.dev,
arkchainOrderbookContract: '0x0',
})
Parameters
import { type ConfigParameters } from '@arkproject/core'
starknetNetwork
mainnet | sepolia | dev
Specifies the Starknet network to be used.
starknetRpcUrl
string | undefined
Custom RPC URL for the Starknet network. If not provided, a default URL based on the specified starknetNetwork
is used.
starknetProvider
ProviderInterface | undefined
The provider interface for Starknet. If not provided, a new RpcProvider
instance is created using the starknetRpcUrl
.
arkchainNetwork
mainnet | sepolia | dev
Specifies Arkchain network to be used.
arkchainRpcUrl
string | undefined
Custom RPC URL for the Arkchain network. If not provided, a default URL based on the specified arkchainNetwork
is used.
arkProvider
ProviderInterface | undefined
The provider interface for Arkchain. If not provided, a new RpcProvider
instance is created using the arkchainRpcUrl
.
starknetExecutorContract
string | undefined
The address of the Starknet executor contract. If not provided, a default contract address based on the starknetNetwork
is used.
starknetCurrencyContract
string | undefined
The address of the Starknet currency contract. If not provided, a default contract address based on the starknetNetwork
is used.
starknetCurrencyAddress
string | undefined
The address of the currency contract on Starknet. If not provided, defaults to a eth address.
arkchainOrderbookContract
string | undefined
The address of the Arkchain orderbook contract. If not provided, a default contract address based on the arkchainNetwork
is used.
Return Type
import { type Config } from '@arkproject/core'
Config
Object responsible for managing the configuration of the SDK.
import { type Config } from '@arkproject/core'
starknetNetwork
mainnet | sepolia | dev
Network
passed to createConfig
.
starknetRpcUrl
string
Current Starknet RPC url.
starknetProvider
ProviderInterface
Current Starknet Provider.
arkchainNetwork
mainnet | sepolia | dev
Current arkchain network.
arkchainRpcUrl
string
Current Arkchain RPC url.
arkProvider
ProviderInterface
Current Arkchain Provider.
starknetExecutorContract
string
Current Starknet executor contract address.
starknetCurrencyContract
string
Current Starknet currency contract address.
arkchainOrderbookContract
string
Current Arkchain orderbook contract address.