Skip to content

Commit

Permalink
feature: higher level AENS supports NameFee
Browse files Browse the repository at this point in the history
  • Loading branch information
randomshinichi committed Nov 11, 2019
1 parent 8d9962d commit d7bf5fd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions aeternity/aens.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package aeternity

import (
"math/big"

"github.com/aeternity/aepp-sdk-go/v6/account"
"github.com/aeternity/aepp-sdk-go/v6/config"
"github.com/aeternity/aepp-sdk-go/v6/naet"
Expand All @@ -9,7 +11,7 @@ import (

// RegisterName allows one to easily register a name on AENS. It does the
// preclaim, transaction sending, confirmation and claim for you.
func RegisterName(n naet.NodeInterface, acc *account.Account, name string) (signedTxStr, hash, signature string, blockHeight uint64, blockHash string, err error) {
func RegisterName(n naet.NodeInterface, acc *account.Account, name string, nameFee *big.Int) (signedTxStr, hash, signature string, blockHeight uint64, blockHash string, err error) {
status, err := n.GetStatus()
if err != nil {
return
Expand All @@ -33,7 +35,7 @@ func RegisterName(n naet.NodeInterface, acc *account.Account, name string) (sign
if err != nil {
return
}
claimTx := transactions.NewNameClaimTx(acc.Address, name, nameSalt, config.Client.Fee, ttl, nonce)
claimTx := transactions.NewNameClaimTx(acc.Address, name, nameSalt, nameFee, config.Client.Fee, ttl, nonce)
transactions.CalculateFee(claimTx)
signedTxStr, hash, signature, blockHeight, blockHash, err = SignBroadcastWaitTransaction(claimTx, acc, n.(*naet.Node), networkID, config.Client.WaitBlocks)
if err != nil {
Expand Down

0 comments on commit d7bf5fd

Please sign in to comment.