codec

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2026 License: MIT Imports: 22 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidWorkchain = errors.New("workchain value outside valid int8 range [-128, 127]")
View Source
var LeafDomainSeparator [32]byte

0x0000000000000000000000000000000000000000000000000000000000000000

Functions

func AddressBytesToStringWithBurning

func AddressBytesToStringWithBurning(bytes []byte) *address.Address

AddressBytesToStringWithBurning converts a byte slice representing a TON address into its string representation. It first attempts to parse the bytes with `4 byte workchain (int32) + 32 byte data` TON address If that fails, we expect user-friendly format (36 bytes): 1 byte flags + 1 byte workchain + 32 bytes data + 2 bytes CRC16, by validating the format and CRC16 checksum. If parsing fails (invalid format, length, or CRC16), returns the zero address to indicate funds should be burned. This is only used in the hot path in plugin (executecodec.go and msghasher.go) where we want to avoid errors and just burn funds if the address is invalid

func AddressBytesToTONAddress

func AddressBytesToTONAddress(bytes []byte) (*address.Address, error)

This method is not part of the interface as it's TON specific AddressBytesToAddress converts a byte slice representing a TON address into its ton address representation, only supporting standard TON addresses.

func NewCommitPluginCodecV1

func NewCommitPluginCodecV1() cciptypes.CommitPluginCodec

func NewExecutePluginCodecV1

func NewExecutePluginCodecV1(extraDataCodec ccipocr3.ExtraDataCodecBundle) ccipocr3.ExecutePluginCodec

func NewExtraDataDecoder

func NewExtraDataDecoder() ccipocr3.SourceChainExtraDataCodec

NewExtraDataDecoder creates a new ExtraDataDecoder

func NewMessageHasherV1

func NewMessageHasherV1(lg logger.Logger, extraDataCodec ccipocr3.ExtraDataCodecBundle) ccipocr3.MessageHasher

Types

type RawAddr

type RawAddr [tvm.AddressLength]byte

RawAddr is a fixed-size byte array representing a TON standard address

func ToRawAddr

func ToRawAddr(addr *address.Address) (RawAddr, error)

ToRawAddr converts an address.Address to a RawAddr. Returns an error if the address is nil, not a standard address, or has invalid data length.

type TokenDataEncoder

type TokenDataEncoder struct{}

func NewTokenDataEncoder

func NewTokenDataEncoder() TokenDataEncoder

func (TokenDataEncoder) EncodeUSDC

func (t TokenDataEncoder) EncodeUSDC(_ context.Context, message ccipocr3.Bytes, attestation ccipocr3.Bytes) (ccipocr3.Bytes, error)

Jump to

Keyboard shortcuts

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