edge-currency-plugins 1.1.6 → 1.2.0

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.
@@ -275,6 +275,8 @@ var _utils = require('./utils');
275
275
  options
276
276
  ) {
277
277
  const { spendTargets } = edgeSpendInfo
278
+ const { outputSort = 'bip69' } = _nullishCoalesce(edgeSpendInfo.otherParams, () => ( {}))
279
+
278
280
  if (_optionalChain([options, 'optionalAccess', _5 => _5.CPFP]) == null && spendTargets.length < 1) {
279
281
  throw new Error('Need to provide Spend Targets')
280
282
  }
@@ -397,7 +399,8 @@ var _utils = require('./utils');
397
399
  setRBF,
398
400
  freshChangeAddress,
399
401
  subtractFee,
400
- log
402
+ log,
403
+ outputSort
401
404
  })
402
405
  if (tx.changeUsed) {
403
406
  ourReceiveAddresses.push(freshChangeAddress)
@@ -233,6 +233,7 @@ var VerifyAddressEnum; (function (VerifyAddressEnum) {
233
233
 
234
234
 
235
235
 
236
+
236
237
 
237
238
 
238
239
  function bip43PurposeNumberToTypeEnum(
@@ -829,7 +830,7 @@ const wifToPrivateKeyInternal = (
829
830
  } exports.signMessageBase64 = signMessageBase64;
830
831
 
831
832
  function makeTx(args) {
832
- const { log } = args
833
+ const { log, outputSort } = args
833
834
  let sequence = 0xffffffff
834
835
  if (args.setRBF) {
835
836
  sequence -= 2
@@ -962,7 +963,14 @@ const wifToPrivateKeyInternal = (
962
963
  }
963
964
 
964
965
  const sortedInputs = _bip69.sortInputs.call(void 0, result.inputs)
965
- const sortedOutputs = _bip69.sortOutputs.call(void 0, result.outputs)
966
+ const sortedOutputs = (() => {
967
+ switch (outputSort) {
968
+ case 'bip69':
969
+ return _bip69.sortOutputs.call(void 0, result.outputs)
970
+ case 'targets':
971
+ return result.outputs
972
+ }
973
+ })()
966
974
 
967
975
  const psbt = new bitcoin.Psbt()
968
976
  try {
@@ -133,6 +133,7 @@ export interface MakeTxArgs {
133
133
  freshChangeAddress: string;
134
134
  subtractFee?: boolean;
135
135
  log?: EdgeLog;
136
+ outputSort: 'bip69' | 'targets';
136
137
  }
137
138
  export interface MakeTxTarget {
138
139
  address?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "edge-currency-plugins",
3
- "version": "1.1.6",
3
+ "version": "1.2.0",
4
4
  "description": "Edge currency plugins to fetch and process wallet accounts, balances and transactions.",
5
5
  "repository": "https://github.com/EdgeApp/edge-currency-plugins",
6
6
  "license": "MIT",