nblib2

1.1.32 • Public • Published

nblib2

Library for NBdomain

Functions

setOpay(opay)

Set opay object to be used in webpage.

sha256(string)string
getDomain(root)object
setPrivateKey(privateKey)
makePublic(domain)json

Make a domain as public, so everyone can write to it. inreversible.

writePublicDomain(option)json

Write contents to a public domain

updateKey2(option)json
verifySig(data_hash, strSig)bool
buy(option)json
getNodeInfo()json
queryDomain(domain, full)json
domainFromAddress(address)json

setOpay(opay)

Set opay object to be used in webpage.

Kind: global function

Param Type Description
opay object opay or opay2 object

sha256(string) ⇒ string

Kind: global function
Returns: string - hashed string

Param Type Description
string string to hash

getDomain(root) ⇒ object

Kind: global function
Returns: object - domain object

Param Type Description
root string domain name

setPrivateKey(privateKey)

Kind: global function

Param Type Description
privateKey string to be used with nodeJS app

makePublic(domain) ⇒ json

Make a domain as public, so everyone can write to it. inreversible.

Kind: global function
Returns: json - result

Param Type Description
domain string to set as public

writePublicDomain(option) ⇒ json

Write contents to a public domain

Kind: global function
Returns: json - result of the update

Param Type Description
option object option of the update
option.kv object key/value pairs. eg: for key {abc:{abc:"234"}} or {abc:{def:100}} or for keys ab and cd {ab:100,cd:200}
option.isUser Boolean indicate it's for key.domain.tld or key@domain.tld
option.pay Array.<object> object array. eg: [{address:"dfdaf"},value:1000}]. some blockchain, like ar, only supports one receiver per tx

updateKey2(option) ⇒ json

Kind: global function
Returns: json - result of the update

Param Type Description
option object option of the update
option.kv object key/value pairs. eg: for key {abc:{abc:"234"}} or {abc:{def:100}} or for keys ab and cd {ab:100,cd:200}
option.tags string string. eg: for key {abc:{abc:"234"}} or {abc:{def:100}} or for keys ab and cd {ab:100,cd:200}
option.isUser Boolean indicate it's for key.domain.tld or key@domain.tld
option.pay Array.<object> object array. eg: [{address:"dfdaf"},value:1000}]. some blockchain, like ar, only supports one receiver per tx

verifySig(data_hash, strSig) ⇒ bool

Kind: global function
Returns: bool - result of verify

Param Type Description
data_hash string hasded string of data
strSig string signature

buy(option) ⇒ json

Kind: global function
Returns: json - result

Param Type Description
option object -
option.domain domain domain to buy

getNodeInfo() ⇒ json

Kind: global function
Returns: json - nodeInfo from node

queryDomain(domain, full) ⇒ json

Kind: global function

Param Type Default Description
domain string one or more domains, separated by ',' .eg "test.b" "test.b,www.abc.b" "aaa.test886.test/all,aaa.test886.test/1"
full Boolean false

domainFromAddress(address) ⇒ json

Kind: global function
Returns: json - result

Param Type Description
address string address of the domains

Readme

Keywords

Package Sidebar

Install

npm i nblib2

Weekly Downloads

23

Version

1.1.32

License

MIT

Unpacked Size

73.3 kB

Total Files

5

Last publish

Collaborators

  • bloodchen