chains

package
v0.0.2-gowrapper-mobile Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TONChain

type TONChain struct {
	*chain_abstraction.BaseChain
}

TONChain implements the Chain interface for TON (The Open Network) blockchain

func NewTONChain

func NewTONChain() *TONChain

NewTONChain creates a new TON chain instance

func (*TONChain) BuildJettonTransferMessage

func (c *TONChain) BuildJettonTransferMessage(
	dest string,
	amount uint64,
	jettonAmount uint64,
	toOwner string,
	responseAddress string,
	forwardAmount uint64,
) *theopennetwork.Transfer

BuildJettonTransferMessage creates a TON Jetton transfer message

func (*TONChain) BuildJettonTransferSigningInput

func (c *TONChain) BuildJettonTransferSigningInput(input *TONJettonTransferInput) (*theopennetwork.SigningInput, error)

BuildJettonTransferSigningInput creates a signing input for Jetton transfer using struct

func (*TONChain) BuildNativeTransferSigningInput

func (c *TONChain) BuildNativeTransferSigningInput(input *TONTransferInput) (*theopennetwork.SigningInput, error)

BuildNativeTransferSigningInput creates a signing input for native TON transfer using struct

func (*TONChain) BuildSigningInput

func (c *TONChain) BuildSigningInput(
	privateKey []byte,
	messages []*theopennetwork.Transfer,
	sequenceNumber uint32,
	expireAt uint32,
	walletVersion theopennetwork.WalletVersion,
) (*theopennetwork.SigningInput, error)

BuildSigningInput creates a TON signing input from parameters

func (*TONChain) BuildTransferMessage

func (c *TONChain) BuildTransferMessage(
	dest string,
	amount uint64,
	mode uint32,
	comment string,
	bounceable bool,
) *theopennetwork.Transfer

BuildTransferMessage creates a TON transfer message

func (*TONChain) CompileTransaction

func (c *TONChain) CompileTransaction(txInput *chain_abstraction.TransactionInput, signatures [][]byte, publicKeys [][]byte) ([]byte, error)

CompileTransaction compiles a transaction with external signatures

func (*TONChain) CreateAndSignTransaction

func (c *TONChain) CreateAndSignTransaction(input interface{}, privateKey []byte) ([]byte, error)

CreateAndSignTransaction creates and signs a transaction directly

func (*TONChain) GetDefaultSendMode

func (c *TONChain) GetDefaultSendMode() uint32

GetDefaultSendMode returns the default send mode for TON transfers

func (*TONChain) GetDefaultWalletVersion

func (c *TONChain) GetDefaultWalletVersion() theopennetwork.WalletVersion

GetDefaultWalletVersion returns the default wallet version for TON

func (*TONChain) GetPreimageHash

func (c *TONChain) GetPreimageHash(txInput *chain_abstraction.TransactionInput) ([]byte, []byte, error)

GetPreimageHash gets the preimage hash for external signing

func (*TONChain) GetPublicKeyFromPrivateKey

func (c *TONChain) GetPublicKeyFromPrivateKey(privateKey []byte) ([]byte, error)

GetPublicKeyFromPrivateKey derives public key from private key

func (*TONChain) GetTransactionHash

func (c *TONChain) GetTransactionHash(encodedTx []byte) (string, error)

GetTransactionHash gets the transaction hash from encoded transaction

func (*TONChain) PrepareTransaction

func (c *TONChain) PrepareTransaction(input interface{}) (*chain_abstraction.TransactionInput, error)

PrepareTransaction prepares a transaction for external signing

func (*TONChain) Sign

func (c *TONChain) Sign(data []byte, privateKey []byte) ([]byte, error)

Sign signs data with a private key

func (*TONChain) ValidateTransactionInput

func (c *TONChain) ValidateTransactionInput(input interface{}) error

ValidateTransactionInput validates TON transaction input

type TONJettonTransferInput

type TONJettonTransferInput struct {
	PrivateKey      []byte
	Dest            string
	Amount          uint64 // TON amount for fees in nanotons
	JettonAmount    uint64 // Jetton token amount
	ToOwner         string
	ResponseAddress string
	ForwardAmount   uint64 // TON amount to forward in nanotons
	SequenceNumber  uint32
	ExpireAt        uint32
	WalletVersion   theopennetwork.WalletVersion
}

TONJettonTransferInput represents input parameters for a Jetton transfer

type TONTransferInput

type TONTransferInput struct {
	PrivateKey     []byte
	Dest           string
	Amount         uint64 // in nanotons
	Comment        string
	Bounceable     bool
	SequenceNumber uint32
	ExpireAt       uint32
	WalletVersion  theopennetwork.WalletVersion
}

TONTransferInput represents input parameters for a native TON transfer

Jump to

Keyboard shortcuts

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