blockchain

package
v1.42.21 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2026 License: MIT Imports: 13 Imported by: 2 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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