cashscript 0.7.2 → 0.7.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,8 @@
1
- export { Contract } from './Contract.js';
1
+ import SignatureTemplate from './SignatureTemplate.js';
2
+ export { SignatureTemplate };
3
+ export { Contract, ContractFunction } from './Contract.js';
2
4
  export { Transaction } from './Transaction.js';
3
5
  export { Argument } from './Argument.js';
4
- export { default as SignatureTemplate } from './SignatureTemplate.js';
5
6
  export { Artifact, AbiFunction, AbiInput } from '@cashscript/utils';
6
7
  export * as utils from '@cashscript/utils';
7
8
  export { Utxo, Recipient, SignatureAlgorithm, HashType, Network, } from './interfaces.js';
@@ -29,13 +29,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
29
29
  return (mod && mod.__esModule) ? mod : { "default": mod };
30
30
  };
31
31
  Object.defineProperty(exports, "__esModule", { value: true });
32
- exports.FullStackNetworkProvider = exports.ElectrumNetworkProvider = exports.BitcoinRpcNetworkProvider = exports.BitboxNetworkProvider = exports.Network = exports.HashType = exports.SignatureAlgorithm = exports.utils = exports.SignatureTemplate = exports.Transaction = exports.Contract = void 0;
32
+ exports.FullStackNetworkProvider = exports.ElectrumNetworkProvider = exports.BitcoinRpcNetworkProvider = exports.BitboxNetworkProvider = exports.Network = exports.HashType = exports.SignatureAlgorithm = exports.utils = exports.Transaction = exports.Contract = exports.SignatureTemplate = void 0;
33
+ const SignatureTemplate_js_1 = __importDefault(require("./SignatureTemplate.js"));
34
+ exports.SignatureTemplate = SignatureTemplate_js_1.default;
33
35
  var Contract_js_1 = require("./Contract.js");
34
36
  Object.defineProperty(exports, "Contract", { enumerable: true, get: function () { return Contract_js_1.Contract; } });
35
37
  var Transaction_js_1 = require("./Transaction.js");
36
38
  Object.defineProperty(exports, "Transaction", { enumerable: true, get: function () { return Transaction_js_1.Transaction; } });
37
- var SignatureTemplate_js_1 = require("./SignatureTemplate.js");
38
- Object.defineProperty(exports, "SignatureTemplate", { enumerable: true, get: function () { return __importDefault(SignatureTemplate_js_1).default; } });
39
39
  exports.utils = __importStar(require("@cashscript/utils"));
40
40
  var interfaces_js_1 = require("./interfaces.js");
41
41
  Object.defineProperty(exports, "SignatureAlgorithm", { enumerable: true, get: function () { return interfaces_js_1.SignatureAlgorithm; } });
@@ -29,6 +29,9 @@ export declare enum HashType {
29
29
  }
30
30
  export declare const Network: {
31
31
  MAINNET: "mainnet";
32
+ TESTNET3: "testnet3";
33
+ TESTNET4: "testnet4";
34
+ CHIPNET: "chipnet";
32
35
  TESTNET: "testnet";
33
36
  STAGING: "staging";
34
37
  REGTEST: "regtest";
@@ -22,6 +22,9 @@ var HashType;
22
22
  const literal = (l) => l;
23
23
  exports.Network = {
24
24
  MAINNET: literal('mainnet'),
25
+ TESTNET3: literal('testnet3'),
26
+ TESTNET4: literal('testnet4'),
27
+ CHIPNET: literal('chipnet'),
25
28
  TESTNET: literal('testnet'),
26
29
  STAGING: literal('staging'),
27
30
  REGTEST: literal('regtest'),
@@ -35,7 +35,7 @@ class ElectrumNetworkProvider {
35
35
  this.electrum.addServer('bch.loping.net', 50004, electrum_cash_1.ElectrumTransport.WSS.Scheme, false);
36
36
  this.electrum.addServer('electrum.imaginary.cash', 50004, electrum_cash_1.ElectrumTransport.WSS.Scheme, false);
37
37
  }
38
- else if (network === interfaces_js_1.Network.TESTNET) {
38
+ else if (network === interfaces_js_1.Network.TESTNET || network === interfaces_js_1.Network.TESTNET3) {
39
39
  // Initialise a 1-of-2 Electrum Cluster with 2 hardcoded servers
40
40
  this.electrum = new electrum_cash_1.ElectrumCluster('CashScript Application', '1.4.1', 1, 2, electrum_cash_1.ClusterOrder.PRIORITY);
41
41
  this.electrum.addServer('blackie.c3-soft.com', 60004, electrum_cash_1.ElectrumTransport.WSS.Scheme, false);
@@ -43,10 +43,14 @@ class ElectrumNetworkProvider {
43
43
  // this.electrum.addServer('bch.loping.net', 60004, ElectrumTransport.WSS.Scheme, false);
44
44
  // this.electrum.addServer('testnet.imaginary.cash', 50004, ElectrumTransport.WSS.Scheme);
45
45
  }
46
- else if (network === interfaces_js_1.Network.STAGING) {
46
+ else if (network === interfaces_js_1.Network.STAGING || network === interfaces_js_1.Network.TESTNET4) {
47
47
  this.electrum = new electrum_cash_1.ElectrumCluster('CashScript Application', '1.4.1', 1, 1, electrum_cash_1.ClusterOrder.PRIORITY);
48
48
  this.electrum.addServer('testnet4.imaginary.cash', 50004, electrum_cash_1.ElectrumTransport.WSS.Scheme, false);
49
49
  }
50
+ else if (network === interfaces_js_1.Network.CHIPNET) {
51
+ this.electrum = new electrum_cash_1.ElectrumCluster('CashScript Application', '1.4.1', 1, 1, electrum_cash_1.ClusterOrder.PRIORITY);
52
+ this.electrum.addServer('chipnet.imaginary.cash/', 50004, electrum_cash_1.ElectrumTransport.WSS.Scheme, false);
53
+ }
50
54
  else {
51
55
  throw new Error(`Tried to instantiate an ElectrumNetworkProvider for unsupported network ${network}`);
52
56
  }
@@ -169,8 +169,10 @@ function getNetworkPrefix(network) {
169
169
  case interfaces_js_1.Network.MAINNET:
170
170
  return 'bitcoincash';
171
171
  case interfaces_js_1.Network.STAGING:
172
- return 'bchtest';
172
+ case interfaces_js_1.Network.TESTNET4:
173
173
  case interfaces_js_1.Network.TESTNET:
174
+ case interfaces_js_1.Network.TESTNET3:
175
+ case interfaces_js_1.Network.CHIPNET:
174
176
  return 'bchtest';
175
177
  case interfaces_js_1.Network.REGTEST:
176
178
  return 'bchreg';
@@ -1,7 +1,8 @@
1
- export { Contract } from './Contract.js';
1
+ import SignatureTemplate from './SignatureTemplate.js';
2
+ export { SignatureTemplate };
3
+ export { Contract, ContractFunction } from './Contract.js';
2
4
  export { Transaction } from './Transaction.js';
3
5
  export { Argument } from './Argument.js';
4
- export { default as SignatureTemplate } from './SignatureTemplate.js';
5
6
  export { Artifact, AbiFunction, AbiInput } from '@cashscript/utils';
6
7
  export * as utils from '@cashscript/utils';
7
8
  export { Utxo, Recipient, SignatureAlgorithm, HashType, Network, } from './interfaces.js';
@@ -1,6 +1,7 @@
1
+ import SignatureTemplate from './SignatureTemplate.js';
2
+ export { SignatureTemplate };
1
3
  export { Contract } from './Contract.js';
2
4
  export { Transaction } from './Transaction.js';
3
- export { default as SignatureTemplate } from './SignatureTemplate.js';
4
5
  import * as utils_1 from '@cashscript/utils';
5
6
  export { utils_1 as utils };
6
7
  export { SignatureAlgorithm, HashType, Network, } from './interfaces.js';
@@ -29,6 +29,9 @@ export declare enum HashType {
29
29
  }
30
30
  export declare const Network: {
31
31
  MAINNET: "mainnet";
32
+ TESTNET3: "testnet3";
33
+ TESTNET4: "testnet4";
34
+ CHIPNET: "chipnet";
32
35
  TESTNET: "testnet";
33
36
  STAGING: "staging";
34
37
  REGTEST: "regtest";
@@ -18,6 +18,9 @@ export var HashType;
18
18
  const literal = (l) => l;
19
19
  export const Network = {
20
20
  MAINNET: literal('mainnet'),
21
+ TESTNET3: literal('testnet3'),
22
+ TESTNET4: literal('testnet4'),
23
+ CHIPNET: literal('chipnet'),
21
24
  TESTNET: literal('testnet'),
22
25
  STAGING: literal('staging'),
23
26
  REGTEST: literal('regtest'),
@@ -33,7 +33,7 @@ export default class ElectrumNetworkProvider {
33
33
  this.electrum.addServer('bch.loping.net', 50004, ElectrumTransport.WSS.Scheme, false);
34
34
  this.electrum.addServer('electrum.imaginary.cash', 50004, ElectrumTransport.WSS.Scheme, false);
35
35
  }
36
- else if (network === Network.TESTNET) {
36
+ else if (network === Network.TESTNET || network === Network.TESTNET3) {
37
37
  // Initialise a 1-of-2 Electrum Cluster with 2 hardcoded servers
38
38
  this.electrum = new ElectrumCluster('CashScript Application', '1.4.1', 1, 2, ClusterOrder.PRIORITY);
39
39
  this.electrum.addServer('blackie.c3-soft.com', 60004, ElectrumTransport.WSS.Scheme, false);
@@ -41,10 +41,14 @@ export default class ElectrumNetworkProvider {
41
41
  // this.electrum.addServer('bch.loping.net', 60004, ElectrumTransport.WSS.Scheme, false);
42
42
  // this.electrum.addServer('testnet.imaginary.cash', 50004, ElectrumTransport.WSS.Scheme);
43
43
  }
44
- else if (network === Network.STAGING) {
44
+ else if (network === Network.STAGING || network === Network.TESTNET4) {
45
45
  this.electrum = new ElectrumCluster('CashScript Application', '1.4.1', 1, 1, ClusterOrder.PRIORITY);
46
46
  this.electrum.addServer('testnet4.imaginary.cash', 50004, ElectrumTransport.WSS.Scheme, false);
47
47
  }
48
+ else if (network === Network.CHIPNET) {
49
+ this.electrum = new ElectrumCluster('CashScript Application', '1.4.1', 1, 1, ClusterOrder.PRIORITY);
50
+ this.electrum.addServer('chipnet.imaginary.cash/', 50004, ElectrumTransport.WSS.Scheme, false);
51
+ }
48
52
  else {
49
53
  throw new Error(`Tried to instantiate an ElectrumNetworkProvider for unsupported network ${network}`);
50
54
  }
@@ -154,8 +154,10 @@ export function getNetworkPrefix(network) {
154
154
  case Network.MAINNET:
155
155
  return 'bitcoincash';
156
156
  case Network.STAGING:
157
- return 'bchtest';
157
+ case Network.TESTNET4:
158
158
  case Network.TESTNET:
159
+ case Network.TESTNET3:
160
+ case Network.CHIPNET:
159
161
  return 'bchtest';
160
162
  case Network.REGTEST:
161
163
  return 'bchreg';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cashscript",
3
- "version": "0.7.2",
3
+ "version": "0.7.4",
4
4
  "description": "Easily write and interact with Bitcoin Cash contracts",
5
5
  "keywords": [
6
6
  "bitcoin cash",
@@ -42,7 +42,7 @@
42
42
  },
43
43
  "dependencies": {
44
44
  "@bitauth/libauth": "^1.18.1",
45
- "@cashscript/utils": "^0.7.2",
45
+ "@cashscript/utils": "^0.7.4",
46
46
  "bip68": "^1.0.4",
47
47
  "bitcoin-rpc-promise-retry": "^1.3.0",
48
48
  "delay": "^5.0.0",
@@ -56,5 +56,5 @@
56
56
  "ts-jest": "^26.5.1",
57
57
  "typescript": "^4.1.5"
58
58
  },
59
- "gitHead": "0ec0bd1447e2f89e396c3b7e2c027a121e11f4e1"
59
+ "gitHead": "21624782464044609cb6e018a8d8afd028db01d5"
60
60
  }