Documentation ¶
Index ¶
- Variables
- type AccountInit
- func ConstructAccount(code, data *boc.Cell) (*AccountInit, error)
- func ConstructGatewayAccount(authority ton.AccountID, tss eth.Address) (*AccountInit, error)
- func ConstructWalletFromPrivateKey(pk ed25519.PrivateKey, client blockchain) (*AccountInit, *wallet.Wallet, error)
- func ConstructWalletFromSeed(seed string, client blockchain) (*AccountInit, *wallet.Wallet, error)
- type Client
- type Deployer
- func (d *Deployer) CreateWallet(ctx context.Context, amount math.Uint) (*wallet.Wallet, error)
- func (d *Deployer) Deploy(ctx context.Context, account *AccountInit, amount math.Uint) error
- func (d *Deployer) Fund(ctx context.Context, recipient ton.AccountID, amount math.Uint) (ton.Bits256, error)
- func (d *Deployer) GetBalanceOf(ctx context.Context, id ton.AccountID, wait bool) (math.Uint, error)
- func (d *Deployer) Seqno(ctx context.Context) (uint32, error)
- type Faucet
- type SidecarClient
Constants ¶
This section is empty.
Variables ¶
var ErrNotHealthy = fmt.Errorf("TON node is not healthy yet")
Functions ¶
This section is empty.
Types ¶
type AccountInit ¶
func ConstructAccount ¶
func ConstructAccount(code, data *boc.Cell) (*AccountInit, error)
func ConstructGatewayAccount ¶
ConstructGatewayAccount constructs gateway AccountInit. - Authority is the address of the gateway "admin". - TSS is the EVM address of TSS. - Deposits are enabled by default.
func ConstructWalletFromPrivateKey ¶
func ConstructWalletFromPrivateKey(pk ed25519.PrivateKey, client blockchain) (*AccountInit, *wallet.Wallet, error)
func ConstructWalletFromSeed ¶
func ConstructWalletFromSeed(seed string, client blockchain) (*AccountInit, *wallet.Wallet, error)
ConstructWalletFromSeed constructs wallet AccountInit from seed. Used for wallets deployment.
type Client ¶
type Client struct { *ton.Client *SidecarClient }
type Deployer ¶
Deployer represents a wrapper around ton Wallet with some helpful methods.
func NewDeployer ¶
NewDeployer deployer constructor.
func (*Deployer) CreateWallet ¶
func (*Deployer) Deploy ¶
Deploy deploys AccountInit with the given amount of coins. Returns tx hash and error.
func (*Deployer) Fund ¶
func (d *Deployer) Fund(ctx context.Context, recipient ton.AccountID, amount math.Uint) (ton.Bits256, error)
Fund sends the given amount of coins to the recipient. Returns tx hash and error.
type Faucet ¶
type Faucet struct { InitialBalance int64 `json:"initialBalance"` PrivateKey string `json:"privateKey"` PublicKey string `json:"publicKey"` WalletRawAddress string `json:"walletRawAddress"` Mnemonic string `json:"mnemonic"` WalletVersion string `json:"walletVersion"` WorkChain int32 `json:"workChain"` SubWalletId int `json:"subWalletId"` Created bool `json:"created"` }
Faucet represents the faucet information.
type SidecarClient ¶
type SidecarClient struct {
// contains filtered or unexported fields
}
func NewSidecarClient ¶
func NewSidecarClient(baseURL string) *SidecarClient
func (*SidecarClient) GetFaucet ¶
func (c *SidecarClient) GetFaucet(ctx context.Context) (Faucet, error)
GetFaucet returns the faucet information.
func (*SidecarClient) LiteServerURL ¶
func (c *SidecarClient) LiteServerURL() string
LiteServerURL returns the URL to the lite server config