provider

package
v0.91.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 26, 2026 License: MIT Imports: 21 Imported by: 4 modules, 3 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrivateKeyFromRaw added in v0.42.0

func PrivateKeyFromRaw(privateKey string) *privateKeyFromRaw

PrivateKeyFromRaw creates a new instance of the privateKeyFromRaw generator with the raw private key.

func PrivateKeyRandom added in v0.42.0

func PrivateKeyRandom() *privateKeyRandom

Types

type CTFChainProvider

type CTFChainProvider struct {
	// contains filtered or unexported fields
}

CTFChainProvider manages a Ton chain instance running inside a Chainlink Testing Framework (CTF) Docker container.

This provider requires Docker to be installed and operational. Spinning up a new container can be slow, so it is recommended to initialize the provider only once per test suite or parent test to optimize performance.

func NewCTFChainProvider

func NewCTFChainProvider(
	t *testing.T, selector uint64, config CTFChainProviderConfig,
) *CTFChainProvider

NewCTFChainProvider creates a new CTFChainProvider with the given selector and configuration.

func (*CTFChainProvider) BlockChain

func (p *CTFChainProvider) BlockChain() chain.BlockChain

BlockChain returns the Ton chain instance managed by this provider. You must call Initialize before using this method to ensure the chain is properly set up.

func (*CTFChainProvider) ChainSelector

func (p *CTFChainProvider) ChainSelector() uint64

ChainSelector returns the chain selector of the TON chain managed by this provider.

func (*CTFChainProvider) Initialize

func (p *CTFChainProvider) Initialize(ctx context.Context) (chain.BlockChain, error)

Initialize sets up the Ton chain by validating the configuration, starting a CTF container, generating a deployer signer account, and constructing the chain instance.

func (*CTFChainProvider) Name

func (*CTFChainProvider) Name() string

Name returns the name of the CTFChainProvider.

type CTFChainProviderConfig

type CTFChainProviderConfig struct {
	// Required: A sync.Once instance to ensure that the CTF framework only sets up the new
	// DefaultNetwork once
	Once *sync.Once

	// Optional: Docker image to use for the TON localnet. If empty, defaults to defaultTONImage.
	// Note: Only images from supportedTONImageRepository are supported.
	Image string

	// Optional: Custom environment variables to pass to the TON container.
	// Example: map[string]string{"NEXT_BLOCK_GENERATION_DELAY": "0.5"}
	CustomEnv map[string]string

	// Optional: Port to expose the TON container on. If 0 or not specified, a free port will be
	// automatically selected using freeport.
	Port int
}

CTFChainProviderConfig holds the configuration to initialize the CTFChainProvider.

type PrivateKeyGenerator added in v0.42.0

type PrivateKeyGenerator interface {
	Generate() (ed25519.PrivateKey, error)
}

PrivateKeyGenerator is an interface for generating Ton keypairs.

type RPCChainProvider added in v0.42.0

type RPCChainProvider struct {
	// contains filtered or unexported fields
}

RPCChainProvider is a chain provider that provides a chain that connects to an TON node via RPC.

func NewRPCChainProvider added in v0.42.0

func NewRPCChainProvider(selector uint64, config RPCChainProviderConfig) *RPCChainProvider

func (*RPCChainProvider) BlockChain added in v0.42.0

func (p *RPCChainProvider) BlockChain() chain.BlockChain

BlockChain returns the TON chain instance managed by this provider. You must call Initialize before using this method to ensure the chain is properly set up.

func (*RPCChainProvider) ChainSelector added in v0.42.0

func (p *RPCChainProvider) ChainSelector() uint64

ChainSelector returns the chain selector of the TON chain managed by this provider.

func (*RPCChainProvider) Initialize added in v0.42.0

func (p *RPCChainProvider) Initialize(ctx context.Context) (chain.BlockChain, error)

Initialize initializes the RPCChainProvider.

func (*RPCChainProvider) Name added in v0.42.0

func (*RPCChainProvider) Name() string

Name returns the name of the RPCChainProvider.

type RPCChainProviderConfig added in v0.42.0

type RPCChainProviderConfig struct {
	// Required: The liteserver URL to connect to the Ton node (format: liteserver://publickey@host:port).
	HTTPURL string
	// Optional: The WebSocket URL to connect to the Ton node.
	WSURL string
	// Required: A generator for the deployer key. Use PrivateKeyFromRaw to create a deployer
	// key from a private key.
	DeployerSignerGen PrivateKeyGenerator
	// Optional: The TON wallet version to use. Supported versions are: V1R1, V1R2, V1R3, V2R1,
	// V2R2, V3R1, V3R2, V4R1, V4R2 and V5R1. If no value provided, V5R1 is used as default.
	WalletVersion WalletVersion
}

RPCChainProviderConfig holds the configuration to initialize the RPCChainProvider.

type WalletVersion added in v0.42.0

type WalletVersion string
const (
	WalletVersionV3R2    WalletVersion = "V3R2"
	WalletVersionV4R2    WalletVersion = "V4R2"
	WalletVersionV5R1    WalletVersion = "V5R1"
	WalletVersionDefault WalletVersion = ""
)

Allowed TON wallet versions

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL