Configuring Blueprint
Acton is the recommended tool for new smart contract projects. Blueprint remains supported for existing projects.
A configuration file allows customizing certain Blueprint features.
Create a blueprint.config.ts file in the root of the project, and export the configuration as a named config. Do not use a default export. Instead, use a named export:
import { Config } from '@ton/blueprint';
export const config: Config = {
// configuration options
};The configuration supports the following options:
| Field | Type/Values | Description |
|---|---|---|
plugins | Plugin[] | Extend or customize the behavior. |
network | 'mainnet' 'testnet' CustomNetwork | Specifies the target network for deployment or interaction. |
separateCompilables | boolean | If true, *.compile.ts files go to compilables/. If false, to wrappers/. |
requestTimeout | number | HTTP request timeout in milliseconds. |
recursiveWrappers | boolean | If true, searches wrappers/ or compilables/ recursively for contracts. |
manifestUrl | string | Overrides the default TON Connect manifest URL. |
Plugins
Blueprint includes a plugin system, allowing the community to extend its functionality without modifying Blueprint’s core code.
To use plugins, add a plugins array to your config:
import { Config } from '@ton/blueprint';
import { ScaffoldPlugin } from 'blueprint-scaffold';
export const config: Config = {
plugins: [new ScaffoldPlugin()],
};This example adds the scaffold plugin.
Some community-developed plugins include:
- scaffold – creates a simple DApp using the wrappers’ code.
- misti – simplifies workflow with the Misti static analyzer.
Custom network
A custom network can be set as the default by adding a network object to your configuration:
import { Config } from '@ton/blueprint';
export const config: Config = {
network: {
endpoint: 'https://toncenter.com/api/v2/jsonRPC',
type: 'mainnet',
version: 'v2',
key: <YOUR_API_KEY>,
},
};Using the --custom flags achieves the same result, but it can be tiresome to provide them every time.
The above configuration is equivalent to running:
npx blueprint run \
--custom https://toncenter.com/api/v2/jsonRPC \
--custom-version v2 \
--custom-type mainnet \
--custom-key <YOUR_API_KEY>Each property of the network object has the same meaning as its corresponding --custom flag. See the blueprint help run for details.
Liteclient support
Liteclient can be configured using the network object in your configuration:
import { Config } from '@ton/blueprint';
export const config: Config = {
network: {
endpoint: 'https://ton.org/testnet-global.config.json', // Use https://ton.org/global.config.json for Mainnet or any custom configuration
version: 'liteclient',
type: 'testnet',
}
};You can also specify these parameters using CLI:
npx blueprint run \
--custom https://ton.org/testnet-global.config.json \
--custom-version liteclient \
--custom-type testnetRequest timeouts
You can configure how long HTTP requests should wait before timing out using the requestTimeout field.
This is useful when working with unstable or slow networks.
import { Config } from '@ton/blueprint';
export const config: Config = {
requestTimeout: 10000, // 10 seconds
};Recursive wrappers
The recursiveWrappers field controls whether the wrappers directory is searched recursively for contract configurations.
import { Config } from '@ton/blueprint';
export const config: Config = {
recursiveWrappers: true,
};By default, it's set to false.
TON Connect manifest
If you're using a TON Connect provider, you can override the default manifest URL by setting the manifestUrl field:
import { Config } from '@ton/blueprint';
export const config: Config = {
manifestUrl: 'https://yourdomain.com/custom-manifest.json',
};By default, the manifest URL is:
https://raw.githubusercontent.com/ton-org/blueprint/main/tonconnect/manifest.jsonLast updated on