Documentation ¶
Overview ¶
Copyright 2014 The Go Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
Index ¶
- Constants
- Variables
- func CalculateMessage(message base.Message, isHW bool) float64
- func CalculateMinimum(numNem float64) float64
- func CalculateMosaics(multiplier float64, mosaics map[string]base.MosaicDefinition, ...) float64
- func CalculateXemEquivalent(multiplier, q, sup, divisibility float64) float64
- func Char2Id(startChar string) int
- func GetVersion(val, network int) int
- func Id2Char(id int) string
- func Id2Prefix(id int) byte
- func NewChain(v int) (ch base.Chain, err error)
- func ToAddress(publicKey string, networkId int) string
- func Verify(publicKey, message, sig []byte) bool
- type KeyPair
- type NetNode
- type SearchTestnet
Constants ¶
const ( // PrivateBytes stores the private key length in bytes. PrivateBytes = 32 // PublicBytes stores the public key length in bytes. PublicBytes = 32 )
const ApostilleAuditServer = `http://185.117.22.58:4567/verify`
The server verifying signed apostilles
const BtcPrice = `https://blockchain.info/ticker`
The API to get BTC/USD market data
const CurrentFeeFactor = 0.05
The Fee structure's Fee factor type float64
const DefaultMainnet = `http://alice6.nem.ninja`
The default mainnet node
const DefaultMijin = ``
The default mijin node
const DefaultPort = 7890
The default endpoint port
const DefaultTestnet = `http://192.3.61.243`
The default testnet node const DefaultTestnet = `http://bigalice2.nem.ninja`
const ImportanceTransfer = 0x801 // 2049
The importance transfer type
const MainnetExplorer = `http://chain.nem.ninja/#/transfer/`
The default mainnet block explorer
const MarketInfo = `https://poloniex.com/public`
The API to get XEM/BTC market data
const MijinExplorer = ``
The default mijin block explorer
const MosaicDefinition = 0x4001 // 16385
The mosaic definition transaction type
const MosaicDefinitionTransaction = 10 * 1000000
The mosaic definition transaction fee type float64
const MosaicSupply = 0x4002 // 16386
const MultiSignSignature = 0x1002 // 4098
The multisignature signature transaction type
const MultiSignTransaction = 0x1004 // 4100
The multisignature transaction type
const MultisigModification = 0x1001 // 4097
The aggregate modification transaction type
const ProvisionNamespace = 0x2001 // 8193
The provision namespace transaction type
const RootProvisionNamespaceTransaction = 100 * 1000000
The provision namespace transaction rental fee for root namespace type float64
const SubProvisionNamespaceTransaction = 10 * 1000000
The provision namespace transaction rental fee for sub-namespace type float64
const Supernodes = `https://supernodes.nem.io/nodes`
The API to get all supernodes
const TestnetExplorer = `http://bob.nem.ninja:8765/#/transfer/`
The default testnet block explorer
const Transfer = 0x101 // 257
The transfer transaction type
const WebsocketPort = 7778
The websocket port
Variables ¶
var Apostille = map[int]string{
-104: "TC7MCY-5AGJQX-ZQ4BN3-BOPNXU-VIGDJC-OHBPGU-M2GE",
104: "NCZSJH-LTIMES-ERVBVK-OW6US6-4YDZG2-PFGQCS-V23J",
96: "MCGDK2-J46BOD-GGKMPI-KCBGTB-BIWL6A-L5ZKLK-Q56A",
}
var Data = base.Data{ Testnet: base.Chain{-104, 98, "T"}, Mainnet: base.Chain{104, 68, "N"}, Mijin: base.Chain{96, 60, "M"}, }
Supported predefined chains.
var ImportanceTransferTransaction = math.Floor((baseTransactionFee * CurrentFeeFactor) * 1000000)
The importance transfer transaction fee type float64
var MainnetNode = []NetNode{
{Uri: `http: //62.75.171.41`},
{Uri: `ttp: //san.nem.ninja`},
{Uri: `http: //go.nem.ninja`},
{Uri: `http: //hachi.nem.ninja`},
{Uri: `http: //jusan.nem.ninja`},
{Uri: `http: //nijuichi.nem.ninja`},
{Uri: `http: //alice2.nem.ninja`},
{Uri: `http: //alice3.nem.ninja`},
{Uri: `http: //alice4.nem.ninja`},
{Uri: `http: //alice5.nem.ninja`},
{Uri: `http: //alice6.nem.ninja`},
{Uri: `http: //alice7.nem.ninja`},
{Uri: `http: //localhost`},
}
The mainnet nodes type slice
var MijinNode = []NetNode{
{
Uri: ``,
},
}
The mijin nodes type slice
var Mosaic = map[int]string{
-104: "TBMOSA-ICOD4F-54EE5C-DMR23C-CBGOAM-2XSJBR-5OLC",
104: "NBMOSA-ICOD4F-54EE5C-DMR23C-CBGOAM-2XSIUX-6TRS",
96: "MBMOSA-ICOD4F-54EE5C-DMR23C-CBGOAM-2XSKYH-TOJD",
}
var MultisigAggregateModificationTransaction = math.Floor((10 * CurrentFeeFactor) * 1000000)
The multisignature aggregate modification transaction fee type float64
var Multisigtransaction = math.Floor((baseTransactionFee * CurrentFeeFactor) * 1000000)
The multisignature transaction fee type float64
var Namespace = map[int]string{
-104: "TAMESP-ACEWH4-MKFMBC-VFERDP-OOP4FK-7MTDJE-YP35",
104: "NAMESP-ACEWH4-MKFMBC-VFERDP-OOP4FK-7MTBXD-PZZA",
96: "MAMESP-ACEWH4-MKFMBC-VFERDP-OOP4FK-7MTCZT-G5E7",
}
var NamespaceAndMosaicCommon = math.Floor((baseTransactionFee * CurrentFeeFactor) * 1000000)
The common transaction fee for namespaces and mosaics type float64
var SearchOnMainnet = []SearchTestnet{
{
Url: `http: //62.75.171.41`,
Location: `Germany`,
}, {
Url: `http: //104.251.212.131`,
Location: `USA`,
}, {
Url: `http: //45.124.65.125`,
Location: `Hong Kong`,
}, {
Url: `http: //185.53.131.101`,
Location: `Netherlands`,
}, {
Url: `http: //sz.nemchina.com`,
Location: `China`,
},
}
The nodes allowing search by transaction hash on mainnet type slice
var SearchOnMijin = []SearchTestnet{
{
Url: ``,
Location: ``,
},
}
The nodes allowing search by transaction hash on mijin type slice
var SearchOnTestnet = []SearchTestnet{
{
Url: `http://bigalice2.nem.ninja`,
Location: `America / New_York`,
}, {
Url: `http://192.3.61.243`,
Location: `America / Los_Angeles`,
}, {
Url: `http://23.228.67.85`,
Location: `America / Los_Angeles`,
},
}
The nodes allowing search by transaction hash on testnet type slice Location
var SignatureTransaction = math.Floor((baseTransactionFee * CurrentFeeFactor) * 1000000)
The cosignature transaction fee type float64
var TestnetNode = []NetNode{
{Uri: `http://104.128.226.60`},
{Uri: `http: //23.228.67.85`},
{Uri: `http: //192.3.61.243`},
{Uri: `http: //50.3.87.123`},
{Uri: `http: //localhost`},
}
The testnet nodes type slice
Functions ¶
func CalculateMessage ¶
Calculate message fee. 0.05 XEM per commenced 32 bytes If the message is empty, the fee will be 0 param message - An message struct param isHW - True if hardware wallet, false otherwise return - The message fee
func CalculateMinimum ¶
Calculate fees from an amount of XEM param numNem - An amount of XEM return - The minimum fee
func CalculateMosaics ¶
func CalculateMosaics(multiplier float64, mosaics map[string]base.MosaicDefinition, attachedMosaics []base.Mosaic, supplys map[string]float64) float64
Calculate fees for mosaics included in a transfer transaction param multiplier - A quantity multiplier param mosaics - A mosaicDefinitionMetaDataPair struct param attachedMosaics - An array of mosaics to send return - The fee amount for the mosaics in the transaction
func CalculateXemEquivalent ¶
Calculate mosaic quantity equivalent in XEM param multiplier - A mosaic multiplier param q - A mosaic quantity param sup - A mosaic supply param divisibility - A mosaic divisibility return - The XEM equivalent of a mosaic quantity
func Char2Id ¶
Gets the network id from the starting char of an address param startChar - A starting char from an address return - The network id
func GetVersion ¶
Gets the network version param val - A version number (1 or 2) param network - A network id return A network version
func Id2Char ¶
Gets the starting char of the addresses of a network id param id - A network id return - The starting char of addresses
func Id2Prefix ¶
Gets a network prefix from network id param id - A network id return - The network prefix
Types ¶
type KeyPair ¶
KeyPair is a private/public crypto key pair.
func FromSeed ¶
FromSeed generates a new private/public key pair using specified private key. param pk - A PrivateBytes return - The NEM KeyPair
func KeyPairCreate ¶
KeyPairCreate generates a KeyPair using specified string 32 length or empty param pk - A string 32 length or nil return - The NEM KeyPair
func (*KeyPair) PrivateString ¶
func (*KeyPair) PublicString ¶
type SearchTestnet ¶
type SearchTestnet struct {
Url, Location string
}