示例#1
0
文件: payment.go 项目: lackac/horizon
// MutatePayment for Destination sets the PaymentOp's Destination field
func (m Destination) MutatePayment(o *xdr.PaymentOp) error {
	aid, err := stellarbase.AddressToAccountId(m.Address)
	o.Destination = aid
	return err
}
示例#2
0
文件: payment.go 项目: lackac/horizon
// MutatePayment for NativeAmount sets the PaymentOp's currency field to
// native and sets its amount to the provided integer
func (m NativeAmount) MutatePayment(o *xdr.PaymentOp) error {
	asset, err := xdr.NewAsset(xdr.AssetTypeAssetTypeNative, nil)
	o.Asset = asset
	o.Amount = xdr.Int64(m.Amount)
	return err
}
示例#3
0
// MutatePayment for NativeAmount sets the PaymentOp's currency field to
// native and sets its amount to the provided integer
func (m NativeAmount) MutatePayment(o *xdr.PaymentOp) error {
	o.Currency = xdr.NewCurrencyCurrencyTypeNative()
	o.Amount = xdr.Int64(m.Amount)
	return nil
}