6 "github.com/vapor/blockchain/txbuilder"
9 type AccountFilter struct {
10 AccountID string `json:"account_id"`
11 AccountAlias string `json:"account_alias"`
14 func (a *API) createAccountReceiver(ctx context.Context, ins AccountFilter) Response {
15 accountID := ins.AccountID
16 if ins.AccountAlias != "" {
17 account, err := a.wallet.AccountMgr.FindByAlias(ins.AccountAlias)
19 return NewErrorResponse(err)
22 accountID = account.ID
25 program, err := a.wallet.AccountMgr.CreateAddress(accountID, false)
27 return NewErrorResponse(err)
30 return NewSuccessResponse(&txbuilder.Receiver{
31 ControlProgram: program.ControlProgram,
32 Address: program.Address,