blockchain

package
v1.42.1 Latest Latest
Warning

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

Go to latest
Published: May 6, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoPayment = errors.New("blockchain: no payment function registered for chain type")

ErrNoPayment is returned when MakePayment is called for a chain type whose payment function hasn't been registered (e.g. an EVM chain without the thirdparty/ethereum sub-module wired in).

Functions

func GetUserOrderByWallet added in v1.40.0

func GetUserOrderByWallet(db *datastore.Datastore, walletId string) (*user.User, *order.Order, *wallet.Wallet, error)

GetUserOrderByWallet returns the (user, order, wallet) triple associated with walletId. Chain-agnostic — used by Bitcoin pay task in-tree and by the Ethereum pay task in the thirdparty/ethereum sub-module.

func MakeBitcoinPayment

func MakeBitcoinPayment(ctx context.Context, from wallet.Account, to string, amount, feePerByte currency.Cents, password []byte) (string, error)

func MakePayment

func MakePayment(ctx context.Context, from wallet.Account, to string, amount, fee currency.Cents, password []byte) (string, error)

func RegisterPayment added in v1.40.0

func RegisterPayment(typ blockchains.Type, fn PaymentFn)

RegisterPayment wires a payment function for a chain type. Later registrations override earlier ones; callers should register once at init time.

Types

type PaymentFn added in v1.40.0

type PaymentFn func(ctx context.Context, from wallet.Account, to string, amount, fee currency.Cents, password []byte) (string, error)

PaymentFn is the per-chain payment dispatcher. EVM payment support ships in github.com/hanzoai/commerce/thirdparty/ethereum and registers itself on import; consumers who don't need EVM never link geth.

Jump to

Keyboard shortcuts

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