-
Notifications
You must be signed in to change notification settings - Fork 6
Get Account properties info
Alexander Popov edited this page Jun 4, 2019
·
9 revisions
package main
import (
"context"
"fmt"
"github.com/proximax-storage/go-xpx-catapult-sdk/sdk"
)
const (
networkType = sdk.MijinTest
// A valid private key
privateKey = "3B9670B5CB19C893694FC49B461CE489BF9588BE16DBE8DC29CF06338133DEE6"
)
func main() {
conf, err := sdk.NewConfig("http://localhost:3000", networkType)
if err != nil {
panic(err)
}
// Use the default http client
client := sdk.NewClient(nil, conf)
// Create an account from a private key
account, err := sdk.NewAccountFromPrivateKey(privateKey, networkType)
if err != nil {
panic(err)
}
info, err := client.Account.GetAccountProperties(context.Background(), account.Address)
if err != nil {
fmt.Printf("Account.GetAccountProperties returned error: %s", err)
return
}
fmt.Printf("Address %s\n", info.Address)
fmt.Printf("Allowed Addresses %s\n", info.AllowedAddresses)
fmt.Printf("Allowed MosaicId %s\n", info.AllowedMosaicId)
fmt.Printf("Allowed EntityTypes %s\n", info.AllowedEntityTypes)
fmt.Printf("Blocked Addresses %s\n", info.AllowedAddresses)
fmt.Printf("Blocked MosaicId %s\n", info.AllowedMosaicId)
fmt.Printf("Blocked EntityTypes %s\n", info.AllowedEntityTypes)
}
- Home
- Installation
-
Examples
- Basic functions
- Get Accounts info
- Get Transactions info
- Get Mosaic info
- Get Mosaic Levy info
- Get Namespace info
- Get BlockChain info
- Get Network info
- Get Metadata info
- Get Nem Metadata info
- Get Account Properties info
- Get Exchange info
- Get SDA-SDA Exchange info
- Get Secret lock info
- Get Storage info
- Announces a transaction
- Websocket