Skip to content

Commit

Permalink
add networks accesible from txjs
Browse files Browse the repository at this point in the history
so we dont have to pull in sjs lib for just the network settings, useful for notary server
  • Loading branch information
jagdeep sidhu committed Mar 26, 2021
1 parent 5ebf71d commit d650e6f
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 5 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "syscointx-js",
"version": "1.0.81",
"version": "1.0.82",
"description": "A transaction creation library interfacing with coin selection for Syscoin.",
"keywords": [
"coinselect",
Expand Down
30 changes: 28 additions & 2 deletions utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,31 @@ const ASSET_UPDATE_AUXFEE = 32 // can you update aux fees?
const ASSET_UPDATE_CAPABILITYFLAGS = 64 // can you update capability flags?
const ASSET_CAPABILITY_ALL = 127
const ASSET_INIT = 128 // upon asset creation
const bitcoinNetworks = { mainnet: bitcoin.networks.bitcoin, testnet: bitcoin.networks.testnet }
const syscoinNetworks = {
mainnet: {
messagePrefix: '\x18Syscoin Signed Message:\n',
bech32: 'sys',
bip32: {
public: 0x0488b21e,
private: 0x0488ade4
},
pubKeyHash: 0x3f,
scriptHash: 0x05,
wif: 0x80
},
testnet: {
messagePrefix: '\x18Syscoin Signed Message:\n',
bech32: 'tsys',
bip32: {
public: 0x043587cf,
private: 0x04358394
},
pubKeyHash: 0x41,
scriptHash: 0xc4,
wif: 0xef
}
}
function isNonAssetFunded (txVersion) {
return txVersion === SYSCOIN_TX_VERSION_ASSET_ACTIVATE || txVersion === SYSCOIN_TX_VERSION_SYSCOIN_BURN_TO_ALLOCATION || txVersion === SYSCOIN_TX_VERSION_ALLOCATION_MINT
}
Expand Down Expand Up @@ -184,6 +209,7 @@ module.exports = {
isAssetAllocationTx: isAssetAllocationTx,
isSyscoinTx: isSyscoinTx,
signHash: signHash,
MAX_BIP125_RBF_SEQUENCE: MAX_BIP125_RBF_SEQUENCE

MAX_BIP125_RBF_SEQUENCE: MAX_BIP125_RBF_SEQUENCE,
syscoinNetworks: syscoinNetworks,
bitcoinNetworks: bitcoinNetworks
}

0 comments on commit d650e6f

Please sign in to comment.