tonpaygo

package
v0.0.0-...-d967bcc Latest Latest
Warning

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

Go to latest
Published: May 20, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InvoiceCode    = "" /* 1368-byte string literal not displayed */
	InvoiceVersion = 9
	StoreCode      = "" /* 1956-byte string literal not displayed */
	StoreVersion   = 11
)
View Source
const (
	EditInvoice       = 0x48c504f3
	DeactivateInvoice = 0x1cc0b11e
	ActivateInvoice   = 0xc285952f
	PayInvoice        = 0xf53a02d3
)

OpCodes

View Source
const (
	IssueInvoice       = 0x4b4e70b0
	RequestPurchase    = 0x36b795b5
	EditStore          = 0xa0b2b61d
	DeleteStore        = 0xfb4aca1a // UNUSED
	DeactivateStore    = 0xf9bf9637
	ActivateStore      = 0x97500daf
	UpgradeCodeFull    = 0xb43bbb52
	UpgradeCodeStore   = 0xacb08f28
	UpgradeCodeInvoice = 0xb5f1424f
)

OpCodes

View Source
const ZeroAddress string = "EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM9c"

Variables

View Source
var (
	DeployInvoiceFee   = tlb.MustFromTON("0.005").NanoTON().Uint64()
	EditInvoiceFee     = tlb.MustFromTON("0.005").NanoTON().Uint64()
	ActiveInvoiceFee   = tlb.MustFromTON("0.005").NanoTON().Uint64()
	DeactiveInvoiceFee = tlb.MustFromTON("0.005").NanoTON().Uint64()
)
View Source
var (
	DeployStoreFee     = tlb.MustFromTON("0.005").NanoTON().Uint64()
	EditStoreFee       = tlb.MustFromTON("0.005").NanoTON().Uint64()
	ActivateStoreFee   = tlb.MustFromTON("0.005").NanoTON().Uint64()
	DeactivateStoreFee = tlb.MustFromTON("0.005").NanoTON().Uint64()
	IssueInvoiceFee    = tlb.MustFromTON("0.02").NanoTON().Uint64()
	RequestPurchaseFee = tlb.MustFromTON("0.05").NanoTON().Uint64()
	FullUpgradeFee     = tlb.MustFromTON("0.006").NanoTON().Uint64()
	InvoiceUpgradeFee  = tlb.MustFromTON("0.006").NanoTON().Uint64()
)

Functions

func ActivateInvoiceMessage

func ActivateInvoiceMessage() (*cell.Cell, error)

func ActivateStoreMessage

func ActivateStoreMessage() (*cell.Cell, error)

func BuildURLForWallet

func BuildURLForWallet(reciver string, cell_ *cell.Cell, amount uint64, comission uint64) string

func DeactivateInvoiceMessage

func DeactivateInvoiceMessage() (*cell.Cell, error)

func DeactivateStoreMessage

func DeactivateStoreMessage() (*cell.Cell, error)

func EditInvoiceMessage

func EditInvoiceMessage(hasCustomer bool, customer string, invoiceID string, metadata string, amount uint64) (*cell.Cell, error)

func EditStoreMessage

func EditStoreMessage(storeName string, storeDescription string, storeImage string, storeWebhook string, mccCode uint64) (*cell.Cell, error)

func GetAmount

func GetAmount(api *ton.APIClient, block *ton.BlockIDExt, addr *address.Address) (uint64, error)

func GetCustomer

func GetCustomer(api *ton.APIClient, block *ton.BlockIDExt, addr *address.Address) (*address.Address, error)

func GetDescription

func GetDescription(api *ton.APIClient, block *ton.BlockIDExt, addr *address.Address) (string, error)

func GetImage

func GetImage(api *ton.APIClient, block *ton.BlockIDExt, addr *address.Address) (string, error)

func GetInvoiceID

func GetInvoiceID(api *ton.APIClient, block *ton.BlockIDExt, addr *address.Address) (string, error)

func GetInvoiceMetadata

func GetInvoiceMetadata(api *ton.APIClient, block *ton.BlockIDExt, addr *address.Address) (string, error)

func GetInvoiceVersion

func GetInvoiceVersion(api *ton.APIClient, block *ton.BlockIDExt, addr *address.Address) (uint64, error)

func GetIsActive

func GetIsActive(api *ton.APIClient, block *ton.BlockIDExt, addr *address.Address) (bool, error)

func GetMccCode

func GetMccCode(api *ton.APIClient, block *ton.BlockIDExt, addr *address.Address) (int64, error)

func GetMerchant

func GetMerchant(api *ton.APIClient, block *ton.BlockIDExt, addr *address.Address) (*address.Address, error)

func GetName

func GetName(api *ton.APIClient, block *ton.BlockIDExt, addr *address.Address) (string, error)

func GetOwner

func GetOwner(api *ton.APIClient, block *ton.BlockIDExt, addr *address.Address) (*address.Address, error)

func GetStore

func GetStore(api *ton.APIClient, block *ton.BlockIDExt, addr *address.Address) (*address.Address, error)

func GetStoreVersion

func GetStoreVersion(api *ton.APIClient, block *ton.BlockIDExt, addr *address.Address) (uint64, error)

func GetStoreWebhook

func GetStoreWebhook(api *ton.APIClient, block *ton.BlockIDExt, addr *address.Address) (string, error)

func HasCustomer

func HasCustomer(api *ton.APIClient, block *ton.BlockIDExt, addr *address.Address) (bool, error)

func InvoiceConfigToCell

func InvoiceConfigToCell(config InvoiceData) (*cell.Cell, error)

func IsActive

func IsActive(api *ton.APIClient, block *ton.BlockIDExt, addr *address.Address) (bool, error)

func IsPaid

func IsPaid(api *ton.APIClient, block *ton.BlockIDExt, addr *address.Address) (bool, error)

func IssueInvoiceMessage

func IssueInvoiceMessage(customer *address.Address, invoiceHasCustomer bool, invoiceID string, metadata string, amount uint64) (*cell.Cell, error)

func PayInvoiceMessage

func PayInvoiceMessage() (*cell.Cell, error)

func PrecalculateContractAddress

func PrecalculateContractAddress(workchain int, code *cell.Cell, data *cell.Cell) string

func PrecalculateInvoiceAddress

func PrecalculateInvoiceAddress(workchain int, config InvoiceData) (string, error)

func RequestPurchaseMessage

func RequestPurchaseMessage(invoiceID string, metadata string, amount uint64) (*cell.Cell, error)

func StoreDataToCell

func StoreDataToCell(storeConfig StoreData) (*cell.Cell, error)

func UpgradeCodeFullMessage

func UpgradeCodeFullMessage(storeCode *cell.Cell, invoiceCode *cell.Cell, hasNewData bool, newData *cell.Cell) (*cell.Cell, error)

func UpgradeCodeInvoiceMessage

func UpgradeCodeInvoiceMessage(invoiceCode *cell.Cell) (*cell.Cell, error)

func UpgradeCodeStoreMessage

func UpgradeCodeStoreMessage(storeCode *cell.Cell, hasNewData bool, newData *cell.Cell) (*cell.Cell, error)

Types

type InvoiceData

type InvoiceData struct {
	Store       string
	Merchant    string
	Beneficiary string
	HasCustomer bool
	Customer    string
	InvoiceID   string
	Metadata    string
	Amount      uint64
	Paid        bool
	Active      bool
	Version     int64
}

func GetInvoiceData

func GetInvoiceData(api *ton.APIClient, block *ton.BlockIDExt, addr *address.Address) (InvoiceData, error)

type StoreData

type StoreData struct {
	Owner       *address.Address
	Name        string
	Description string
	Image       string
	Webhook     string
	MccCode     uint64
	IsActive    bool
	InvoiceCode *cell.Cell
	Version     int64
}

func GetStoreData

func GetStoreData(api *ton.APIClient, block *ton.BlockIDExt, addr *address.Address) (StoreData, error)

Jump to

Keyboard shortcuts

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