Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var CommitCallData = func( rawReportCtx [64]byte, report ocr3types.ReportWithInfo[[]byte], signatures [][96]byte, ) (*cell.Cell, error) { reportCell, err := cell.FromBOC(report.Report) if err != nil { return nil, err } var commitReport ocr.CommitReport if err = tlb.LoadFromCell(&commitReport, reportCell.BeginParse()); err != nil { return nil, fmt.Errorf("cannot decode commit report from cell: %w", err) } sigs := make(common.SnakedCell[ocr.SignatureEd25519], len(signatures)) for i, sig := range signatures { sigs[i] = ocr.SignatureEd25519{Data: sig[:]} } commit := offramp.Commit{ QueryID: 0, ConfigDigest: rawReportCtx[:], CommitReport: commitReport, SignatureEd25519: sigs, } commitCell, err := tlb.ToCell(commit) if err != nil { return nil, fmt.Errorf("failed to encode commit to cell: %w", err) } return commitCell, nil }
CommitCallData creates the call data for the OffRamp_Commit method
View Source
var DefaultConfigSet = Config{
CommitPriceUpdateOnlyCostTON: 0.05,
CommitPriceAndRootCostTON: 0.07,
ExecuteCostTON: 0.085,
}
View Source
var ExecuteCallData = func( rawReportCtx [64]byte, report ocr3types.ReportWithInfo[[]byte], signatures [][96]byte, ) (*cell.Cell, error) { reportCell, err := cell.FromBOC(report.Report) if err != nil { return nil, fmt.Errorf("failed to decode BOC (len=%d, hex=%x): %w", len(report.Report), report.Report, err) } // Decode as single ExecuteReport (not array) since TON supports single chain only var executeReport ocr.ExecuteReport if err = tlb.LoadFromCell(&executeReport, reportCell.BeginParse()); err != nil { return nil, fmt.Errorf("cannot decode execute report from cell (reportLen=%d, cellBits=%d, cellRefs=%d): %w", len(report.Report), reportCell.BitsSize(), reportCell.RefsNum(), err) } execute := offramp.Execute{ QueryID: 0, ConfigDigest: rawReportCtx[:], ExecuteReport: executeReport, } executeCell, err := tlb.ToCell(execute) if err != nil { return nil, fmt.Errorf("failed to encode execute to cell: %w", err) } return executeCell, nil }
ExecuteCallData creates the call data for the OffRamp_Execute method
Functions ¶
func NewCCIPTransmitter ¶
Types ¶
type Config ¶
type Config struct {
CommitPriceUpdateOnlyCostTON float64 // Cost in TON for commit price update only (no merkle roots)
CommitPriceAndRootCostTON float64 // Cost in TON for commit price update with merkle roots
ExecuteCostTON float64 // Cost in TON for execute
}
Config holds configuration parameters for the Contract Transmitter. NOTE: when adding new fields, please update ApplyDefaults, DefaultConfigSet, and ValidateConfig accordingly. Also check toml_test.go TestNewDecodedTOMLConfig() to ensure new fields are tested there.
func (*Config) ApplyDefaults ¶
func (c *Config) ApplyDefaults()
func (*Config) ValidateConfig ¶
type ToEd25519CalldataFunc ¶
Click to show internal directories.
Click to hide internal directories.