-
Notifications
You must be signed in to change notification settings - Fork 6
Get Mosaic Levy info
Yevhen edited this page Jul 29, 2021
·
1 revision
- Following parameters required:
- MosaicID - mosaic identifier
package main
package catapult_acceptance_tests
import (
"context"
"math/rand"
"github.com/proximax-storage/go-xpx-chain-sdk/sdk"
)
const (
// Sirius api rest server
baseUrl = "http://localhost:3000"
// A valid private key
ownerPrivateKey = "819F72066B17FFD71B8B4142C5AEAE4B997B0882ABDF2C263B02869382BD93A0"
)
func main() {
random := rand.Rand{}
// Testnet default config
config, err := sdk.NewConfig(context.Background(), []string{baseUrl})
if err != nil {
panic(err)
}
// Use the default http client
client := sdk.NewClient(nil, config)
// Create owner from private key
owner, err := client.NewAccountFromPrivateKey(ownerPrivateKey)
if err != nil {
panic(err)
}
// suppose a mosaicId of created mosaic before
mosaicId, err := sdk.NewMosaicIdFromNonceAndOwner(random.Uint32(), owner.PublicAccount.PublicKey)
if err != nil {
panic(err)
}
//Get levy info
levyInfo, err := client.Mosaic.GetMosaicLevy(Ctx, mosaicId)
if err != nil {
panic(err)
}
print(levyInfo.String())
}
- 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