Documentation
¶
Index ¶
- Variables
- func GetUserOrderByWallet(db *datastore.Datastore, walletId string) (*user.User, *order.Order, *wallet.Wallet, error)
- func MakeBitcoinPayment(ctx context.Context, from wallet.Account, to string, ...) (string, error)
- func MakePayment(ctx context.Context, from wallet.Account, to string, ...) (string, error)
- func RegisterPayment(typ blockchains.Type, fn PaymentFn)
- type PaymentFn
Constants ¶
This section is empty.
Variables ¶
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 MakePayment ¶
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.