config

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TestnetConfig = "" /* 7940-byte string literal not displayed */
	MainnetConfig = "" /* 62348-byte string literal not displayed */
)
View Source
const JettonProxyContractCode = "" /* 140-byte string literal not displayed */

JettonProxyContractCode source code at https://github.com/gobicycle/ton-proxy-contract

Variables

View Source
var (
	JettonTransferTonAmount = tlb.FromNanoTONU(100_000_000)
	JettonForwardAmount     = tlb.FromNanoTONU(20_000_000) // must be < JettonTransferTonAmount

	DefaultHotWalletHysteresis = decimal.NewFromFloat(0.95) // `hot_wallet_residual_balance` = `hot_wallet_max_balance` * `hysteresis`

	ExternalMessageLifetime = 50 * time.Second

	ExternalWithdrawalPeriod  = 80 * time.Second // must be ExternalWithdrawalPeriod > ExternalMessageLifetime and some time for balance update
	InternalWithdrawalPeriod  = 30 * time.Second
	ExpirationProcessorPeriod = 5 * time.Second

	AllowableBlockchainLagging     = 15 * time.Second // TODO: use env var
	AllowableServiceToNodeTimeDiff = 2 * time.Second
)
View Source
var Config = struct {
	LiteServer               string `env:"LITESERVER,required"`
	LiteServerKey            string `env:"LITESERVER_KEY,required"`
	Seed                     string `env:"SEED,required"`
	DatabaseURI              string `env:"DB_URI,required"`
	APIHost                  string `env:"API_HOST" envDefault:"0.0.0.0:8081"`
	APIToken                 string `env:"API_TOKEN,required"`
	Testnet                  bool   `env:"IS_TESTNET" envDefault:"true"`
	ColdWalletString         string `env:"COLD_WALLET"`
	JettonString             string `env:"JETTONS"`
	TonString                string `env:"TON_CUTOFFS,required"`
	IsDepositSideCalculation bool   `env:"DEPOSIT_SIDE_BALANCE" envDefault:"true"` // TODO: rename to DEPOSIT_SIDE_CALCULATION
	QueueURI                 string `env:"QUEUE_URI"`
	QueueName                string `env:"QUEUE_NAME"`
	QueueEnabled             bool   `env:"QUEUE_ENABLED" envDefault:"false"`
	WebhookEndpoint          string `env:"WEBHOOK_ENDPOINT"`
	WebhookToken             string `env:"WEBHOOK_TOKEN"`
	AllowableLaggingSec      int    `env:"ALLOWABLE_LAG"`
	Jettons                  map[string]Jetton
	Ton                      Cutoffs
	ColdWallet               *address.Address
	BlockchainConfig         *boc.Cell
}{}

Functions

func GetConfig

func GetConfig()

Types

type Cutoffs

type Cutoffs struct {
	HotWalletMin      *big.Int
	HotWalletMax      *big.Int
	Withdrawal        *big.Int
	HotWalletResidual *big.Int
}

type Jetton

type Jetton struct {
	Master             *address.Address
	WithdrawalCutoff   *big.Int
	HotWalletMaxCutoff *big.Int
	HotWalletResidual  *big.Int
}

Jump to

Keyboard shortcuts

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