Пример #1
0
// 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
// 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
}