923f84722a
Signed-off-by: Pavel Karpy <p.karpy@yadro.com>
40 lines
793 B
Go
40 lines
793 B
Go
package balance
|
|
|
|
import (
|
|
"github.com/TrueCloudLab/frostfs-node/pkg/morph/client"
|
|
"github.com/nspcc-dev/neo-go/pkg/util"
|
|
)
|
|
|
|
// MintPrm groups parameters of Mint operation.
|
|
type MintPrm struct {
|
|
to util.Uint160
|
|
amount int64
|
|
id []byte
|
|
|
|
client.InvokePrmOptional
|
|
}
|
|
|
|
// SetTo sets receiver of the transfer.
|
|
func (m *MintPrm) SetTo(to util.Uint160) {
|
|
m.to = to
|
|
}
|
|
|
|
// SetAmount sets amount of the transfer.
|
|
func (m *MintPrm) SetAmount(amount int64) {
|
|
m.amount = amount
|
|
}
|
|
|
|
// SetID sets ID.
|
|
func (m *MintPrm) SetID(id []byte) {
|
|
m.id = id
|
|
}
|
|
|
|
// Mint sends funds to the account.
|
|
func (c *Client) Mint(p MintPrm) error {
|
|
prm := client.InvokePrm{}
|
|
prm.SetMethod(mintMethod)
|
|
prm.SetArgs(p.to, p.amount, p.id)
|
|
prm.InvokePrmOptional = p.InvokePrmOptional
|
|
|
|
return c.client.Invoke(prm)
|
|
}
|