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