Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
@ton/blueprint
Advanced tools
A development environment for TON blockchain for writing, testing, and deploying smart contracts.
Run the following in terminal to create a new project and follow the on-screen instructions:
npm create ton@latest
npm create ton@latest
ton://
deeplinknode -v
npm create ton@latest
or npx create-ton@latest
npm install
or yarn install
contracts/
- Source code in FunC for all smart contracts and their importswrappers/
- TypeScript interface classes for all contracts (implementing Contract
from @ton/core)
tests/
- TypeScript test suite for all contracts (relying on Sandbox for in-process tests)scripts/
- Deployment scripts to mainnet/testnet and other scripts interacting with live contractsbuild/
- Compilation artifacts created here after running a build commandwrappers/<CONTRACT>.compile.ts
- examplenpx blueprint build
or yarn blueprint build
npx/yarn blueprint build <CONTRACT>
OR build all contracts yarn blueprint build --all
yarn blueprint build counter
build/<CONTRACT>.compiled.json
npx blueprint test
or yarn blueprint test
npm test
or yarn test
Learn more about writing tests from the Sandbox's documentation - here.
scripts/deploy<CONTRACT>.ts
- examplenpx blueprint run
or yarn blueprint run
npx/yarn blueprint run <CONTRACT> --<NETWORK> --<DEPLOY_METHOD>
yarn blueprint run deployCounter --mainnet --tonconnect
Run in terminal: npx blueprint help
or yarn blueprint help
npx blueprint create
or yarn blueprint create
npx/yarn blueprint create <CONTRACT> --type <TYPE>
(type can be func-empty
, func-counter
, tact-empty
, tact-counter
)
yarn blueprint create MyNewContract --type func-empty
contracts/<CONTRACT>.fc
contracts/imports/*.fc
wrappers/<CONTRACT>.ts
to encode messages and decode getterstests/<CONTRACT>.spec.ts
wrappers/<CONTRACT>.ts
to interact with the contractLearn more about writing tests from the Sandbox's documentation - here.
wrappers/<CONTRACT>.compile.ts
scripts/deploy<CONTRACT>.ts
wrappers/<CONTRACT>.ts
to initialize the contractA config may be created in order to control some of blueprint's features. If a config is needed, create a blueprint.config.ts
file in the root of your project with something like this:
import { Config } from '@ton/blueprint';
export const config: Config = {
// config contents
};
It is important that the config is exported, is named config
, and is not default
exported.
Config's features are explained below.
Blueprint has a plugin system to allow the community to develop their own additions for the ecosystem without the need to change blueprint's code.
In order 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 shows how to add the scaffold plugin)
Here are some of the plugins developed by the community:
A custom network may be specified by using the --custom
flags, which you can read about by running blueprint help run
, but it can be tiresome to use these at all times. Instead, to specify a custom network to always be used (unless --custom
flags are present), add a network
object to your config:
import { Config } from '@ton/blueprint';
export const config: Config = {
network: {
endpoint: 'https://toncenter.com/api/v2/',
type: 'mainnet',
version: 'v2',
key: 'YOUR_API_KEY',
},
};
Properties of the network
object have the same semantics as the --custom
flags with respective names (see blueprint help run
).
Special thanks to @qdevstudio for their logo for blueprint.
MIT
TON - EQAQR1d1Q4NaE5EefwUMdrr1QvXg-8mDB0XI2-fwDBD0nYxC
[0.16.0] - 2024-02-15
network
entry to the global config, which allows one to specify a custom network to be used instead of having to add --custom
flags on each runconvert
command which attempts to convert a legacy bash build script into a blueprint .compile.ts
fileverify
commandFAQs
Framework for development of TON smart contracts
The npm package @ton/blueprint receives a total of 3,016 weekly downloads. As such, @ton/blueprint popularity was classified as popular.
We found that @ton/blueprint demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.