Configuration


CreateConfig

Creates new Config object.

Import

import { createConfig } from '@arkproject/core'

Usage

Create a configuration using mainnet pre-deployed contracts.

import { createConfig, networks } from '@arkproject/core'

export const config = createConfig({
  network: networks.mainnet,
})

Create a configuration with local contracts, see development quickstart.

import { createConfig, networks } from '@arkproject/core'

export const config = createConfig({
  network: networks.dev,
  executorContract: '0x0',
  currencyContract: '0x0',
})

Parameters

import { type ConfigParameters } from '@arkproject/core'

network

mainnet | sepolia | dev

Specifies the Starknet network to be used.

rpcUrl (optional)

string

Custom RPC URL for the Starknet network. If not provided, a default URL based on the specified network is used.

provider (optional)

ProviderInterface

The provider interface for Starknet. If not provided, a new RpcProvider instance is created using the rpcUrl.

executorContract (optional)

string

The address of the Starknet executor contract. If not provided, a default contract address based on the network is used.

currencyContract (optional)

string

The address of the Starknet currency contract. If not provided, a default contract address based on the network 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'

network

mainnet | sepolia | dev

Network passed to createConfig.

rpcUrl

string

Current Starknet RPC url.

provider

ProviderInterface

Current Starknet Provider.

executorContract

string

Current Starknet executor contract address.

currencyContract

string

Current Starknet currency contract address.