Bitcoin Cash Name Service SDK
This repository is fork from Wormholecash.
Install
npm install bcns --save
Usage
let BCNS = default;let bcns = restURL: `https://bcns-api.portal.network/v1/`;
DataRetrieval
Info
Return information about BCNS
Example
async { try const info = await bcnsDataRetrieval console; catch error console }
Result
ResolutionAddress
Return resolution address for the given domain.
Example
async { try const resolutionAddress = await bcnsDataRetrieval console; catch error console }
Result
ResolutionMultihash
Return resolution multihash for the given domain.
Example
async { try const resolutionMultihash = await bcnsDataRetrieval console; catch error console }
Result
DataWrite
Register
Creates a transaction to register BCNS.
Example
async { try const register = await bcnsDataWrite console; catch error console }
Result
SetAddress
Creates a transaction to set address with BCNS.
Example
async { try const register = await bcnsDataWrite console; catch error console }
Result
SetMultihash
Creates a transaction to set multihash with BCNS.
Example
async { try const register = await bcnsDataWrite console; catch error console }
Result
PayloadCreation
Register
Return the payload of register.
Example
async { try const register = await bcnsPayloadCreation console; catch error console }
Result
"000001f4626974636f696e6361736800626368746573743a7171326a3967703937676d3961366c7776687863347a7532387176716d3078346a356537327637656a6700"
SetAddress
Return the payload of set address.
Example
async { try const register = await bcnsPayloadCreation console; catch error console }
Result
"00000212706f7274616c6e6574776f726b00626368746573743a717a666b6c7a66747865676d6d3438636d73386861393964656d336d7a3067686579737167667675657800"
SetMultihash
Return the payload of set multihash.
Example
async { try const register = await bcnsPayloadCreation console; catch error console }
Result
"00000213626974636f696e6361736800516d53707577656a55476a52456d6773766d386571335a647353376d5654484352505a6d4c69557138345339783800"