示例#1
0
// MutateCreateAccount for NativeAmount sets the CreateAccountOp's
// StartingBalance field
func (m NativeAmount) MutateCreateAccount(o *xdr.CreateAccountOp) error {
	o.StartingBalance = xdr.Int64(m.Amount)
	return nil
}
示例#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
}