diff --git a/.yarn/cache/@emurgo-cardano-serialization-lib-browser-npm-12.1.0-fbdef021c7-70ef63f6d3.zip b/.yarn/cache/@emurgo-cardano-serialization-lib-browser-npm-12.1.0-fbdef021c7-70ef63f6d3.zip deleted file mode 100644 index f9ae878..0000000 Binary files a/.yarn/cache/@emurgo-cardano-serialization-lib-browser-npm-12.1.0-fbdef021c7-70ef63f6d3.zip and /dev/null differ diff --git a/.yarn/cache/@emurgo-cardano-serialization-lib-browser-npm-13.2.0-0e33a49f3b-f60f47b7df.zip b/.yarn/cache/@emurgo-cardano-serialization-lib-browser-npm-13.2.0-0e33a49f3b-f60f47b7df.zip new file mode 100644 index 0000000..d7572ad Binary files /dev/null and b/.yarn/cache/@emurgo-cardano-serialization-lib-browser-npm-13.2.0-0e33a49f3b-f60f47b7df.zip differ diff --git a/.yarn/cache/@emurgo-cardano-serialization-lib-nodejs-npm-12.1.0-854ce1b991-cf1f07468c.zip b/.yarn/cache/@emurgo-cardano-serialization-lib-nodejs-npm-12.1.0-854ce1b991-cf1f07468c.zip deleted file mode 100644 index adbacf2..0000000 Binary files a/.yarn/cache/@emurgo-cardano-serialization-lib-nodejs-npm-12.1.0-854ce1b991-cf1f07468c.zip and /dev/null differ diff --git a/.yarn/cache/@emurgo-cardano-serialization-lib-nodejs-npm-13.2.0-1a4901e829-b8483dd74e.zip b/.yarn/cache/@emurgo-cardano-serialization-lib-nodejs-npm-13.2.0-1a4901e829-b8483dd74e.zip new file mode 100644 index 0000000..a549465 Binary files /dev/null and b/.yarn/cache/@emurgo-cardano-serialization-lib-nodejs-npm-13.2.0-1a4901e829-b8483dd74e.zip differ diff --git a/CHANGELOG.MD b/CHANGELOG.MD index c277757..a73dbe7 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -13,7 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed -- Upgraded cardano-serialization-lib to Chang-compatible release (v12) +- Upgraded cardano-serialization-lib to Chang-compatible release (v13) +- All set types are now serialized with a tag "258", which will become mandatory after the next hard fork (HF) ## [2.2.1] - 2023-11-29 diff --git a/package.json b/package.json index dbfa62d..fd2d94e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@fivebinaries/coin-selection", - "version": "2.2.1", + "version": "3.0.0-beta.0", "description": "", "keywords": [ "coin selection" @@ -48,8 +48,8 @@ "typescript-eslint": "^8.8.0" }, "dependencies": { - "@emurgo/cardano-serialization-lib-browser": "^12.1.0", - "@emurgo/cardano-serialization-lib-nodejs": "12.1.0" + "@emurgo/cardano-serialization-lib-browser": "^13.2.0", + "@emurgo/cardano-serialization-lib-nodejs": "13.2.0" }, "packageManager": "yarn@4.5.0" } diff --git a/src/methods/largestFirst.ts b/src/methods/largestFirst.ts index b39ea5c..b70cbf5 100644 --- a/src/methods/largestFirst.ts +++ b/src/methods/largestFirst.ts @@ -267,9 +267,12 @@ export const largestFirst = ( txBuilder.set_fee(totalFeesAmount); const txBody = txBuilder.build(); - const txHash = Buffer.from( - CardanoWasm.hash_transaction(txBody).to_bytes(), - ).toString('hex'); + + const txHash = CardanoWasm.FixedTransaction.new_from_body_bytes( + txBody.to_bytes(), + ) + .transaction_hash() + .to_hex(); const txBodyHex = Buffer.from(txBody.to_bytes()).toString('hex'); const totalSpent = totalUserOutputsAmount.checked_add(totalFeesAmount); diff --git a/src/methods/randomImprove.ts b/src/methods/randomImprove.ts index 5ea339e..f35157b 100644 --- a/src/methods/randomImprove.ts +++ b/src/methods/randomImprove.ts @@ -254,9 +254,11 @@ export const randomImprove = ( txBuilder.set_fee(fee); const txBody = txBuilder.build(); - const txHash = Buffer.from( - CardanoWasm.hash_transaction(txBody).to_bytes(), - ).toString('hex'); + const txHash = CardanoWasm.FixedTransaction.new_from_body_bytes( + txBody.to_bytes(), + ) + .transaction_hash() + .to_hex(); const txBodyHex = Buffer.from(txBody.to_bytes()).toString('hex'); // reorder inputs to match order within tx diff --git a/tests/methods/fixtures/largestFirst.ts b/tests/methods/fixtures/largestFirst.ts index aa2627b..3f9eba3 100644 --- a/tests/methods/fixtures/largestFirst.ts +++ b/tests/methods/fixtures/largestFirst.ts @@ -36,8 +36,8 @@ export const nonFinalCompose = [ 'ec8fdf616242f430855ad7477acda53395eb30c295f5a7ef038712578877375b5a2f00353c9c5cc88c7ff18e71dc08724d90fc238213b789c0b02438e336be07', options: {}, result: { - totalSpent: '168053', - fee: '168053', + totalSpent: '168317', + fee: '168317', }, }, { @@ -58,8 +58,8 @@ export const nonFinalCompose = [ 'ec8fdf616242f430855ad7477acda53395eb30c295f5a7ef038712578877375b5a2f00353c9c5cc88c7ff18e71dc08724d90fc238213b789c0b02438e336be07', options: {}, result: { - totalSpent: '2168053', - fee: '168053', + totalSpent: '2168317', + fee: '168317', }, }, { @@ -88,8 +88,8 @@ export const nonFinalCompose = [ 'ec8fdf616242f430855ad7477acda53395eb30c295f5a7ef038712578877375b5a2f00353c9c5cc88c7ff18e71dc08724d90fc238213b789c0b02438e336be07', options: {}, result: { - totalSpent: '2170913', - fee: '170913', + totalSpent: '2171177', + fee: '171177', }, }, { @@ -116,8 +116,8 @@ export const nonFinalCompose = [ 'ec8fdf616242f430855ad7477acda53395eb30c295f5a7ef038712578877375b5a2f00353c9c5cc88c7ff18e71dc08724d90fc238213b789c0b02438e336be07', options: {}, result: { - totalSpent: '1307609', - fee: '169769', + totalSpent: '1307873', + fee: '170033', }, }, ]; @@ -144,18 +144,18 @@ export const coinSelection = [ options: {}, result: { totalSpent: '5222414726', - fee: '176721', + fee: '176985', tx: { - body: 'a40088825820d6de3f33c3b421167eb1726c48129990ec16512dd829ad2239751ba49773b30c02825820d6de3f33c3b421167eb1726c48129990ec16512dd829ad2239751ba49773b30c05825820d6de3f33c3b421167eb1726c48129990ec16512dd829ad2239751ba49773b30c08825820d6de3f33c3b421167eb1726c48129990ec16512dd829ad2239751ba49773b30c0b825820d6de3f33c3b421167eb1726c48129990ec16512dd829ad2239751ba49773b30c0e825820d6de3f33c3b421167eb1726c48129990ec16512dd829ad2239751ba49773b30c11825820d6de3f33c3b421167eb1726c48129990ec16512dd829ad2239751ba49773b30c15825820d6de3f33c3b421167eb1726c48129990ec16512dd829ad2239751ba49773b30c16018182583900cabe98b23096fa1354d9cdd9cd134475bbfae14aa3225226711a5250122a946b9ad3d2ddf029d3a828f0468aece76895f15c9efbd69b42771b0000000137450735021a0002b251031a03f7e7bf', - hash: '74a66a069530d96224b56d955eb1e58dde84774168f3d1fb4b5a972431cc18fa', - size: 481, + body: 'a400d9010288825820d6de3f33c3b421167eb1726c48129990ec16512dd829ad2239751ba49773b30c02825820d6de3f33c3b421167eb1726c48129990ec16512dd829ad2239751ba49773b30c05825820d6de3f33c3b421167eb1726c48129990ec16512dd829ad2239751ba49773b30c08825820d6de3f33c3b421167eb1726c48129990ec16512dd829ad2239751ba49773b30c0b825820d6de3f33c3b421167eb1726c48129990ec16512dd829ad2239751ba49773b30c0e825820d6de3f33c3b421167eb1726c48129990ec16512dd829ad2239751ba49773b30c11825820d6de3f33c3b421167eb1726c48129990ec16512dd829ad2239751ba49773b30c15825820d6de3f33c3b421167eb1726c48129990ec16512dd829ad2239751ba49773b30c16018182583900cabe98b23096fa1354d9cdd9cd134475bbfae14aa3225226711a5250122a946b9ad3d2ddf029d3a828f0468aece76895f15c9efbd69b42771b000000013745062d021a0002b359031a03f7e7bf', + hash: '7ec409e0d2e14769547cf3911f6d9faf3f7411327926baa26154f39508e6956c', + size: 487, }, inputs: setMaxAdaInputs, outputs: [ { address: 'addr_test1qr9tax9jxzt05y65m8xanngng36mh7hpf23jy53xwyd9y5qj922xhxkn6twlq2wn4q50q352annk3903tj00h45mgfms0kcepv', - amount: '5222238005', + amount: '5222237741', assets: [], }, ], @@ -217,12 +217,12 @@ export const coinSelection = [ ttl: 66578367, options: {}, result: { - totalSpent: '1357441', - fee: '176501', + totalSpent: '1357705', + fee: '176765', tx: { - body: 'a4008282582006227a5ee5640d26224470ad195c82941bfa49386a85149c09c465c4edb0edc0008258209ed3ef581f545f2143eca490d7f20a511100add747bb3d651cc2aa5815f77b1d010182825839013af9d8434bea8de03cd698d5fa1c6b82b991146a755f509e95d6b53b15ab05b40d24d39c9d14dfec04d87ed071f2c66484b3ab83ab3d603d821a0012050ca1581c9a9693a9a37912a5097918f97918d15240c92ab729a0b7c4aa144d77a14653554e4441451b00000001524ba55882583901f8a4be8308c12b910252b6fd6ee4a98730300009382becc049a6e618476aacdafaf01e68c2f072270f078c9689da6139eba4b309e1d5615f1a009865cd021a0002b175031a03f7e7bf', - hash: '37b4fe1cd8bcb4315e8465d05b8b77f7b7368aa073dc3e555f0eccf3215b4003', - size: 476, + body: 'a400d901028282582006227a5ee5640d26224470ad195c82941bfa49386a85149c09c465c4edb0edc0008258209ed3ef581f545f2143eca490d7f20a511100add747bb3d651cc2aa5815f77b1d010182825839013af9d8434bea8de03cd698d5fa1c6b82b991146a755f509e95d6b53b15ab05b40d24d39c9d14dfec04d87ed071f2c66484b3ab83ab3d603d821a0012050ca1581c9a9693a9a37912a5097918f97918d15240c92ab729a0b7c4aa144d77a14653554e4441451b00000001524ba55882583901f8a4be8308c12b910252b6fd6ee4a98730300009382becc049a6e618476aacdafaf01e68c2f072270f078c9689da6139eba4b309e1d5615f1a009864c5021a0002b27d031a03f7e7bf', + hash: 'ce3aa8b670058ac029ad30cb572598f4c35ae3e67199b94ec1cf1654127b0dcf', + size: 482, }, inputs: [ { @@ -271,7 +271,7 @@ export const coinSelection = [ }, { address: changeAddress, - amount: '9987533', + amount: '9987269', assets: [], }, ], @@ -312,9 +312,9 @@ export const coinSelection = [ ], ttl: 123456789, tx: { - body: 'a400818258203c388acb799a37a4f1cc99bec7626637b0b80626b9ef7c7a687282cab701178d000181825839013af9d8434bea8de03cd698d5fa1c6b82b991146a755f509e95d6b53b15ab05b40d24d39c9d14dfec04d87ed071f2c66484b3ab83ab3d603d1a00498c20021a0002bf20031a075bcd15', - hash: '9dcf7d216b0f8a87194ca8fe33484d63744ae68e419d20ebab8e22a824d2ed5c', - size: 225, + body: 'a400d90102818258203c388acb799a37a4f1cc99bec7626637b0b80626b9ef7c7a687282cab701178d000181825839013af9d8434bea8de03cd698d5fa1c6b82b991146a755f509e95d6b53b15ab05b40d24d39c9d14dfec04d87ed071f2c66484b3ab83ab3d603d1a00498c20021a0002bf20031a075bcd15', + hash: '055d468ab5f751e4a807372a92b2c82b7d6ed4508e3cc49f5550f1e28a904751', + size: 231, }, }, }, @@ -343,13 +343,13 @@ export const coinSelection = [ ttl: undefined, options: {}, result: { - totalSpent: '1315263', + totalSpent: '1315527', tx: { - body: 'a300818258209e63fddf20cb7b5472e2c9a1bb4bbe3112b8f2b22e45bc441206bcddde5c58a0070182825839013af9d8434bea8de03cd698d5fa1c6b82b991146a755f509e95d6b53b15ab05b40d24d39c9d14dfec04d87ed071f2c66484b3ab83ab3d603d821a00116d86a1581c02477d7c23b4c2834b0be8ca8578dde47af0cc82a964688f6fc95a7aa14447524943183282583901f8a4be8308c12b910252b6fd6ee4a98730300009382becc049a6e618476aacdafaf01e68c2f072270f078c9689da6139eba4b309e1d5615f821a0028f741a2581c02477d7c23b4c2834b0be8ca8578dde47af0cc82a964688f6fc95a7aa1444752494319079e581cc6207cbbc916fa3bbb4b91cc7789c7d7ddfb84264fa76f7ee627a9d8a1401864021a0002a439', - hash: '1a53ffb7eb300446fc492a6920f9d121a184a95f7eca380d39ac0392fb2bb413', - size: 399, + body: 'a300d90102818258209e63fddf20cb7b5472e2c9a1bb4bbe3112b8f2b22e45bc441206bcddde5c58a0070182825839013af9d8434bea8de03cd698d5fa1c6b82b991146a755f509e95d6b53b15ab05b40d24d39c9d14dfec04d87ed071f2c66484b3ab83ab3d603d821a00116d86a1581c02477d7c23b4c2834b0be8ca8578dde47af0cc82a964688f6fc95a7aa14447524943183282583901f8a4be8308c12b910252b6fd6ee4a98730300009382becc049a6e618476aacdafaf01e68c2f072270f078c9689da6139eba4b309e1d5615f821a0028f639a2581c02477d7c23b4c2834b0be8ca8578dde47af0cc82a964688f6fc95a7aa1444752494319079e581cc6207cbbc916fa3bbb4b91cc7789c7d7ddfb84264fa76f7ee627a9d8a1401864021a0002a541', + hash: 'fe7f5393044fbf142d10cc74ff7c630a76ca0d554c453f91ac9e933cb6be622d', + size: 405, }, - fee: '173113', + fee: '173377', ttl: undefined, inputs: [utxo6], outputs: [ @@ -368,7 +368,7 @@ export const coinSelection = [ { isChange: true, address: changeAddress, - amount: '2684737', + amount: '2684473', assets: [ { unit: '02477d7c23b4c2834b0be8ca8578dde47af0cc82a964688f6fc95a7a47524943', @@ -408,12 +408,12 @@ export const coinSelection = [ options: { _maxTokensPerOutput: 1 }, result: { tx: { - body: 'a300828258209e63fddf20cb7b5472e2c9a1bb4bbe3112b8f2b22e45bc441206bcddde5c58a0018258209e63fddf20cb7b5472e2c9a1bb4bbe3112b8f2b22e45bc441206bcddde5c58a0070183825839013af9d8434bea8de03cd698d5fa1c6b82b991146a755f509e95d6b53b15ab05b40d24d39c9d14dfec04d87ed071f2c66484b3ab83ab3d603d821a00116d86a1581c02477d7c23b4c2834b0be8ca8578dde47af0cc82a964688f6fc95a7aa14447524943183282583901f8a4be8308c12b910252b6fd6ee4a98730300009382becc049a6e618476aacdafaf01e68c2f072270f078c9689da6139eba4b309e1d5615f821a00117e5ca1581c02477d7c23b4c2834b0be8ca8578dde47af0cc82a964688f6fc95a7aa14447524943190b8682583901f8a4be8308c12b910252b6fd6ee4a98730300009382becc049a6e618476aacdafaf01e68c2f072270f078c9689da6139eba4b309e1d5615f821a00452df1a1581cc6207cbbc916fa3bbb4b91cc7789c7d7ddfb84264fa76f7ee627a9d8a1401864021a0002b5ed', - hash: '2432c899ff9abd9d6d11f861a8644da7f016ca4d530506a697907872bd6f22bf', - size: 502, + body: 'a300d90102828258209e63fddf20cb7b5472e2c9a1bb4bbe3112b8f2b22e45bc441206bcddde5c58a0018258209e63fddf20cb7b5472e2c9a1bb4bbe3112b8f2b22e45bc441206bcddde5c58a0070183825839013af9d8434bea8de03cd698d5fa1c6b82b991146a755f509e95d6b53b15ab05b40d24d39c9d14dfec04d87ed071f2c66484b3ab83ab3d603d821a00116d86a1581c02477d7c23b4c2834b0be8ca8578dde47af0cc82a964688f6fc95a7aa14447524943183282583901f8a4be8308c12b910252b6fd6ee4a98730300009382becc049a6e618476aacdafaf01e68c2f072270f078c9689da6139eba4b309e1d5615f821a00117e5ca1581c02477d7c23b4c2834b0be8ca8578dde47af0cc82a964688f6fc95a7aa14447524943190b8682583901f8a4be8308c12b910252b6fd6ee4a98730300009382becc049a6e618476aacdafaf01e68c2f072270f078c9689da6139eba4b309e1d5615f821a00452ce9a1581cc6207cbbc916fa3bbb4b91cc7789c7d7ddfb84264fa76f7ee627a9d8a1401864021a0002b6f5', + hash: 'f450b09570c608269a680d244b3c52821b6da3b6c45557a5cc718c403856b0dc', + size: 508, }, - totalSpent: '1319795', - fee: '177645', + totalSpent: '1320059', + fee: '177909', inputs: [utxo2, utxo8], outputs: [ { @@ -442,7 +442,7 @@ export const coinSelection = [ { isChange: true, address: changeAddress, - amount: '4533745', + amount: '4533481', assets: [ { quantity: '100', @@ -474,12 +474,12 @@ export const coinSelection = [ options: {}, result: { tx: { - body: 'a300828258203c388acb799a37a4f1cc99bec7626637b0b80626b9ef7c7a687282cab701178d038258203c388acb799a37a4f1cc99bec7626637b0b80626b9ef7c7a687282cab701178d040182825839013af9d8434bea8de03cd698d5fa1c6b82b991146a755f509e95d6b53b15ab05b40d24d39c9d14dfec04d87ed071f2c66484b3ab83ab3d603d1a000f424082583901f8a4be8308c12b910252b6fd6ee4a98730300009382becc049a6e618476aacdafaf01e68c2f072270f078c9689da6139eba4b309e1d5615f1a001beddb021a000296a5', - hash: 'b08162d0b0458ec5c25688215f56e4a730cc3d591f5e032db851174ab22c7610', - size: 320, + body: 'a300d90102828258203c388acb799a37a4f1cc99bec7626637b0b80626b9ef7c7a687282cab701178d038258203c388acb799a37a4f1cc99bec7626637b0b80626b9ef7c7a687282cab701178d040182825839013af9d8434bea8de03cd698d5fa1c6b82b991146a755f509e95d6b53b15ab05b40d24d39c9d14dfec04d87ed071f2c66484b3ab83ab3d603d1a000f424082583901f8a4be8308c12b910252b6fd6ee4a98730300009382becc049a6e618476aacdafaf01e68c2f072270f078c9689da6139eba4b309e1d5615f1a001becd3021a000297ad', + hash: '62f300ab828a6414c37ca91abdf661b1ffe88bbfd61603acf1b8874164286e8b', + size: 326, }, - totalSpent: '1169637', - fee: '169637', + totalSpent: '1169901', + fee: '169901', inputs: [utxo4, utxo5], outputs: [ { @@ -492,7 +492,7 @@ export const coinSelection = [ { isChange: true, address: changeAddress, - amount: '1830363', + amount: '1830099', assets: [], }, ], @@ -518,9 +518,9 @@ export const coinSelection = [ options: { feeParams: { a: '0' } }, result: { tx: { - body: 'a300818258203c388acb799a37a4f1cc99bec7626637b0b80626b9ef7c7a687282cab701178d000182825839013af9d8434bea8de03cd698d5fa1c6b82b991146a755f509e95d6b53b15ab05b40d24d39c9d14dfec04d87ed071f2c66484b3ab83ab3d603d1a002dc6c082583901f8a4be8308c12b910252b6fd6ee4a98730300009382becc049a6e618476aacdafaf01e68c2f072270f078c9689da6139eba4b309e1d5615f1a001c258b021a00025ef5', - hash: 'e6186b479212e677bea51b5108e669fe4d99cfb632e951880bfdf98b9dbc56ab', - size: 284, + body: 'a300d90102818258203c388acb799a37a4f1cc99bec7626637b0b80626b9ef7c7a687282cab701178d000182825839013af9d8434bea8de03cd698d5fa1c6b82b991146a755f509e95d6b53b15ab05b40d24d39c9d14dfec04d87ed071f2c66484b3ab83ab3d603d1a002dc6c082583901f8a4be8308c12b910252b6fd6ee4a98730300009382becc049a6e618476aacdafaf01e68c2f072270f078c9689da6139eba4b309e1d5615f1a001c258b021a00025ef5', + hash: '66a743f7275683799070935d33932319f82467be2eb4bea5b33ab36aaa15c8d6', + size: 290, }, totalSpent: '3155381', fee: '155381', // since we set cost per byte to 0, the tx cost wll be equal to fee param B @@ -562,19 +562,19 @@ export const coinSelection = [ options: {}, result: { tx: { - body: 'a300828258203c388acb799a37a4f1cc99bec7626637b0b80626b9ef7c7a687282cab701178d008258203c388acb799a37a4f1cc99bec7626637b0b80626b9ef7c7a687282cab701178d020181825839013af9d8434bea8de03cd698d5fa1c6b82b991146a755f509e95d6b53b15ab05b40d24d39c9d14dfec04d87ed071f2c66484b3ab83ab3d603d1a00e25647021a00028b79', - hash: '4b2a77115ccb6af30822fc058bdb7bdf5a75be239779e5530e3c50302be82ee3', - size: 255, + body: 'a300d90102828258203c388acb799a37a4f1cc99bec7626637b0b80626b9ef7c7a687282cab701178d008258203c388acb799a37a4f1cc99bec7626637b0b80626b9ef7c7a687282cab701178d020181825839013af9d8434bea8de03cd698d5fa1c6b82b991146a755f509e95d6b53b15ab05b40d24d39c9d14dfec04d87ed071f2c66484b3ab83ab3d603d1a00e2553f021a00028c81', + hash: 'c00afada3a077ccf79bc4cf3b9b3613f6b8cda19409fe984be696e38188c7cfa', + size: 261, }, - max: '14833223', + max: '14832959', totalSpent: '15000000', - fee: '166777', + fee: '167041', inputs: [utxo1, utxo3], outputs: [ { address: 'addr1qya0nkzrf04gmcpu66vdt7sudwptnyg5df6475y7jhtt2wc44vzmgrfy6wwf69xlaszdslksw8evveyykw4c82eavq7sx29tlc', - amount: '14833223', + amount: '14832959', assets: [], setMax: true, }, @@ -601,19 +601,19 @@ export const coinSelection = [ options: {}, result: { tx: { - body: 'a300828258203c388acb799a37a4f1cc99bec7626637b0b80626b9ef7c7a687282cab701178d008258209e63fddf20cb7b5472e2c9a1bb4bbe3112b8f2b22e45bc441206bcddde5c58a0010182825839013af9d8434bea8de03cd698d5fa1c6b82b991146a755f509e95d6b53b15ab05b40d24d39c9d14dfec04d87ed071f2c66484b3ab83ab3d603d1a00847a7382583901f8a4be8308c12b910252b6fd6ee4a98730300009382becc049a6e618476aacdafaf01e68c2f072270f078c9689da6139eba4b309e1d5615f821a00117e5ca1581c02477d7c23b4c2834b0be8ca8578dde47af0cc82a964688f6fc95a7aa144475249431903e8021a00029db1', - hash: '28b67745f005944607a86f03443a759873029e4e336857b100d04fcceeaf6622', - size: 361, + body: 'a300d90102828258203c388acb799a37a4f1cc99bec7626637b0b80626b9ef7c7a687282cab701178d008258209e63fddf20cb7b5472e2c9a1bb4bbe3112b8f2b22e45bc441206bcddde5c58a0010182825839013af9d8434bea8de03cd698d5fa1c6b82b991146a755f509e95d6b53b15ab05b40d24d39c9d14dfec04d87ed071f2c66484b3ab83ab3d603d1a0084796b82583901f8a4be8308c12b910252b6fd6ee4a98730300009382becc049a6e618476aacdafaf01e68c2f072270f078c9689da6139eba4b309e1d5615f821a00117e5ca1581c02477d7c23b4c2834b0be8ca8578dde47af0cc82a964688f6fc95a7aa144475249431903e8021a00029eb9', + hash: '9f458c1293fec11c82addef7319e69816d90aeb5dd8aadc051109f929f498497', + size: 367, }, - max: '8682099', + max: '8681835', totalSpent: '8853540', // plus 1344798 in change output = 10000000 - fee: '171441', + fee: '171705', inputs: [utxo1, utxo2], outputs: [ { address: 'addr1qya0nkzrf04gmcpu66vdt7sudwptnyg5df6475y7jhtt2wc44vzmgrfy6wwf69xlaszdslksw8evveyykw4c82eavq7sx29tlc', - amount: '8682099', + amount: '8681835', assets: [], setMax: true, }, @@ -658,13 +658,13 @@ export const coinSelection = [ options: {}, result: { tx: { - body: 'a300828258203c388acb799a37a4f1cc99bec7626637b0b80626b9ef7c7a687282cab701178d008258209e63fddf20cb7b5472e2c9a1bb4bbe3112b8f2b22e45bc441206bcddde5c58a0010183825839013af9d8434bea8de03cd698d5fa1c6b82b991146a755f509e95d6b53b15ab05b40d24d39c9d14dfec04d87ed071f2c66484b3ab83ab3d603d1a000f4240825839013af9d8434bea8de03cd698d5fa1c6b82b991146a755f509e95d6b53b15ab05b40d24d39c9d14dfec04d87ed071f2c66484b3ab83ab3d603d1a00752d0782583901f8a4be8308c12b910252b6fd6ee4a98730300009382becc049a6e618476aacdafaf01e68c2f072270f078c9689da6139eba4b309e1d5615f821a00117e5ca1581c02477d7c23b4c2834b0be8ca8578dde47af0cc82a964688f6fc95a7aa144475249431903e8021a0002a8dd', - hash: '4ba68db040d5501d420012f36c33733f5ab2d50ecfbecb574e451db0a2604c4a', - size: 426, + body: 'a300d90102828258203c388acb799a37a4f1cc99bec7626637b0b80626b9ef7c7a687282cab701178d008258209e63fddf20cb7b5472e2c9a1bb4bbe3112b8f2b22e45bc441206bcddde5c58a0010183825839013af9d8434bea8de03cd698d5fa1c6b82b991146a755f509e95d6b53b15ab05b40d24d39c9d14dfec04d87ed071f2c66484b3ab83ab3d603d1a000f4240825839013af9d8434bea8de03cd698d5fa1c6b82b991146a755f509e95d6b53b15ab05b40d24d39c9d14dfec04d87ed071f2c66484b3ab83ab3d603d1a00752bff82583901f8a4be8308c12b910252b6fd6ee4a98730300009382becc049a6e618476aacdafaf01e68c2f072270f078c9689da6139eba4b309e1d5615f821a00117e5ca1581c02477d7c23b4c2834b0be8ca8578dde47af0cc82a964688f6fc95a7aa144475249431903e8021a0002a9e5', + hash: 'c5a511df10142ce8c189164143bde1472f1df48a82f4818dd9f82786c2ce841f', + size: 432, }, - max: '7679239', + max: '7678975', totalSpent: '8853540', // plus 1146460 in change output = 10000000 - fee: '174301', + fee: '174565', inputs: [utxo1, utxo2], outputs: [ { @@ -677,7 +677,7 @@ export const coinSelection = [ { address: 'addr1qya0nkzrf04gmcpu66vdt7sudwptnyg5df6475y7jhtt2wc44vzmgrfy6wwf69xlaszdslksw8evveyykw4c82eavq7sx29tlc', - amount: '7679239', + amount: '7678975', assets: [], setMax: true, }, @@ -720,13 +720,13 @@ export const coinSelection = [ options: {}, result: { tx: { - body: 'a300828258203c388acb799a37a4f1cc99bec7626637b0b80626b9ef7c7a687282cab701178d008258209e63fddf20cb7b5472e2c9a1bb4bbe3112b8f2b22e45bc441206bcddde5c58a0080182825839013af9d8434bea8de03cd698d5fa1c6b82b991146a755f509e95d6b53b15ab05b40d24d39c9d14dfec04d87ed071f2c66484b3ab83ab3d603d821a00117e5ca1581c02477d7c23b4c2834b0be8ca8578dde47af0cc82a964688f6fc95a7aa144475249431903e882583901f8a4be8308c12b910252b6fd6ee4a98730300009382becc049a6e618476aacdafaf01e68c2f072270f078c9689da6139eba4b309e1d5615f1a004db303021a00029db1', - hash: '316246128e30216ca6b52da6f8fe294754a7e6fb12f5e2e68cca3d3be2216cf5', - size: 361, + body: 'a300d90102828258203c388acb799a37a4f1cc99bec7626637b0b80626b9ef7c7a687282cab701178d008258209e63fddf20cb7b5472e2c9a1bb4bbe3112b8f2b22e45bc441206bcddde5c58a0080182825839013af9d8434bea8de03cd698d5fa1c6b82b991146a755f509e95d6b53b15ab05b40d24d39c9d14dfec04d87ed071f2c66484b3ab83ab3d603d821a00117e5ca1581c02477d7c23b4c2834b0be8ca8578dde47af0cc82a964688f6fc95a7aa144475249431903e882583901f8a4be8308c12b910252b6fd6ee4a98730300009382becc049a6e618476aacdafaf01e68c2f072270f078c9689da6139eba4b309e1d5615f1a004db1fb021a00029eb9', + hash: '9f1a8906f54674180707eef5d42bfcf9e0baea67b6ce730e974022175bb823bb', + size: 367, }, max: '1000', - totalSpent: '1317901', // plus amount in change output = 6410000 - fee: '171441', + totalSpent: '1318165', // plus amount in change output = 6410000 + fee: '171705', inputs: [utxo1, utxo7], outputs: [ { @@ -744,7 +744,7 @@ export const coinSelection = [ { isChange: true, address: changeAddress, - amount: '5092099', + amount: '5091835', assets: [], }, ], @@ -769,18 +769,18 @@ export const coinSelection = [ options: {}, result: { tx: { - body: 'a400818258203c388acb799a37a4f1cc99bec7626637b0b80626b9ef7c7a687282cab701178d00018182583901f8a4be8308c12b910252b6fd6ee4a98730300009382becc049a6e618476aacdafaf01e68c2f072270f078c9689da6139eba4b309e1d5615f1a00e24493021a00029d2d05a1581de1c968b71c91c84fb993108b48938186b7be316f62e5b37d48da3190481a00989680', - hash: 'abb31a05d06c33d67455b9be93e4fb1f6778c063a29e11a9489997a8b7fdbacf', - size: 358, + body: 'a400d90102818258203c388acb799a37a4f1cc99bec7626637b0b80626b9ef7c7a687282cab701178d00018182583901f8a4be8308c12b910252b6fd6ee4a98730300009382becc049a6e618476aacdafaf01e68c2f072270f078c9689da6139eba4b309e1d5615f1a00e2438b021a00029e3505a1581de1c968b71c91c84fb993108b48938186b7be316f62e5b37d48da3190481a00989680', + hash: '1b252c5dad4cdf492bec64c76936d0ac8e8c9c4b4a06c3fd908c2c3bf2797aef', + size: 364, }, - totalSpent: '171309', - fee: '171309', + totalSpent: '171573', + fee: '171573', inputs: [utxo1], outputs: [ { isChange: true, address: changeAddress, - amount: '14828691', + amount: '14828427', assets: [], }, ], @@ -814,19 +814,19 @@ export const coinSelection = [ options: {}, result: { tx: { - body: 'a500818258203c388acb799a37a4f1cc99bec7626637b0b80626b9ef7c7a687282cab701178d00018182583901f8a4be8308c12b910252b6fd6ee4a98730300009382becc049a6e618476aacdafaf01e68c2f072270f078c9689da6139eba4b309e1d5615f1a00e22787021a0002ba39048183098200581cfb52d3055a3a3a3238ce219a3fc13fe4d8797d5062e8dd4670c7d29b8200581c4519f294d80b0fcc6697bde8f36629be8ebf9527be023fe73673f1a905a1581de1c968b71c91c84fb993108b48938186b7be316f62e5b37d48da3190481a00989680', - hash: 'b05209422a811ccfc5a1795b2b65c39437611f615799e430a7968ee53c47e908', - size: 527, + body: 'a500d90102818258203c388acb799a37a4f1cc99bec7626637b0b80626b9ef7c7a687282cab701178d00018182583901f8a4be8308c12b910252b6fd6ee4a98730300009382becc049a6e618476aacdafaf01e68c2f072270f078c9689da6139eba4b309e1d5615f1a00e225fb021a0002bbc504d901028183098200581cfb52d3055a3a3a3238ce219a3fc13fe4d8797d5062e8dd4670c7d29b8200581c4519f294d80b0fcc6697bde8f36629be8ebf9527be023fe73673f1a905a1581de1c968b71c91c84fb993108b48938186b7be316f62e5b37d48da3190481a00989680', + hash: '8a3a95b836262421593b301c131edf9075adf4ec9d9aa4ef7b738f77da892ad3', + size: 536, }, - totalSpent: '178745', - fee: '178745', + totalSpent: '179141', + fee: '179141', deposit: '0', inputs: [utxo1], outputs: [ { isChange: true, address: changeAddress, - amount: '14821255', + amount: '14820859', assets: [], }, ], @@ -859,19 +859,19 @@ export const coinSelection = [ options: {}, result: { tx: { - body: 'a500818258203c388acb799a37a4f1cc99bec7626637b0b80626b9ef7c7a687282cab701178d00018182583901f8a4be8308c12b910252b6fd6ee4a98730300009382becc049a6e618476aacdafaf01e68c2f072270f078c9689da6139eba4b309e1d5615f1a00e22caf021a0002b511048183098200581cfb52d3055a3a3a3238ce219a3fc13fe4d8797d5062e8dd4670c7d29b810205a1581de1c968b71c91c84fb993108b48938186b7be316f62e5b37d48da3190481a00989680', - hash: 'b2db184413b50a57cc7d95bbe10682186bc2d374f7e92ebbe95ffdb726f6836f', - size: 497, + body: 'a500d90102818258203c388acb799a37a4f1cc99bec7626637b0b80626b9ef7c7a687282cab701178d00018182583901f8a4be8308c12b910252b6fd6ee4a98730300009382becc049a6e618476aacdafaf01e68c2f072270f078c9689da6139eba4b309e1d5615f1a00e22b23021a0002b69d04d901028183098200581cfb52d3055a3a3a3238ce219a3fc13fe4d8797d5062e8dd4670c7d29b810205a1581de1c968b71c91c84fb993108b48938186b7be316f62e5b37d48da3190481a00989680', + hash: '03e9fc7cf58569d36d5e3bd61a5d588121e2a13818ad29920b17dfe186a9bc5b', + size: 506, }, - totalSpent: '177425', - fee: '177425', + totalSpent: '177821', + fee: '177821', deposit: '0', inputs: [utxo1], outputs: [ { isChange: true, address: changeAddress, - amount: '14822575', + amount: '14822179', assets: [], }, ], @@ -905,19 +905,19 @@ export const coinSelection = [ options: {}, result: { tx: { - body: 'a500818258203c388acb799a37a4f1cc99bec7626637b0b80626b9ef7c7a687282cab701178d00018182583901f8a4be8308c12b910252b6fd6ee4a98730300009382becc049a6e618476aacdafaf01e68c2f072270f078c9689da6139eba4b309e1d5615f1a00e22787021a0002ba39048183098200581cfb52d3055a3a3a3238ce219a3fc13fe4d8797d5062e8dd4670c7d29b8200581c3a7f09d3df4cf66a7399c2b05bfa234d5a29560c311fc5db4c49071105a1581de1c968b71c91c84fb993108b48938186b7be316f62e5b37d48da3190481a00989680', - hash: 'fa63ef301262a2b72c430d8234987073aa3199aaa1a5480230a562eae84d1b2c', - size: 527, + body: 'a500d90102818258203c388acb799a37a4f1cc99bec7626637b0b80626b9ef7c7a687282cab701178d00018182583901f8a4be8308c12b910252b6fd6ee4a98730300009382becc049a6e618476aacdafaf01e68c2f072270f078c9689da6139eba4b309e1d5615f1a00e225fb021a0002bbc504d901028183098200581cfb52d3055a3a3a3238ce219a3fc13fe4d8797d5062e8dd4670c7d29b8200581c3a7f09d3df4cf66a7399c2b05bfa234d5a29560c311fc5db4c49071105a1581de1c968b71c91c84fb993108b48938186b7be316f62e5b37d48da3190481a00989680', + hash: '761e3e27851f05504dc58a792a47681fe97e6defaea637fddd485c0b468789b9', + size: 536, }, - totalSpent: '178745', - fee: '178745', + totalSpent: '179141', + fee: '179141', deposit: '0', inputs: [utxo1], outputs: [ { isChange: true, address: changeAddress, - amount: '14821255', + amount: '14820859', assets: [], }, ], @@ -949,18 +949,18 @@ export const coinSelection = [ options: {}, result: { tx: { - body: 'a400818258203c388acb799a37a4f1cc99bec7626637b0b80626b9ef7c7a687282cab701178d00018182583901f8a4be8308c12b910252b6fd6ee4a98730300009382becc049a6e618476aacdafaf01e68c2f072270f078c9689da6139eba4b309e1d5615f1a017adb13021a00029d2d05a1581de1c968b71c91c84fb993108b48938186b7be316f62e5b37d48da3190481a00989680', - hash: 'db24027f5f9ad900e506a10b237fb22436645b33c3d057bac2f7d6d941c8039a', - size: 358, + body: 'a400d90102818258203c388acb799a37a4f1cc99bec7626637b0b80626b9ef7c7a687282cab701178d00018182583901f8a4be8308c12b910252b6fd6ee4a98730300009382becc049a6e618476aacdafaf01e68c2f072270f078c9689da6139eba4b309e1d5615f1a017ada0b021a00029e3505a1581de1c968b71c91c84fb993108b48938186b7be316f62e5b37d48da3190481a00989680', + hash: '796c2a23b17593c090d2b6b343cdf14dedd1eb417c9a5b583567e44b52ed2888', + size: 364, }, - totalSpent: '171309', - fee: '171309', + totalSpent: '171573', + fee: '171573', inputs: [utxo1], outputs: [ { isChange: true, address: changeAddress, - amount: '24828691', + amount: '24828427', assets: [], }, ], @@ -982,18 +982,18 @@ export const coinSelection = [ options: {}, result: { tx: { - body: 'a400818258203c388acb799a37a4f1cc99bec7626637b0b80626b9ef7c7a687282cab701178d00018182583901f8a4be8308c12b910252b6fd6ee4a98730300009382becc049a6e618476aacdafaf01e68c2f072270f078c9689da6139eba4b309e1d5615f1a002b3b47021a00028b79048182008200581cfb52d3055a3a3a3238ce219a3fc13fe4d8797d5062e8dd4670c7d29b', - hash: '98a5fc454e1d995708172084d1c8e19000015ef0fef2ddc92cbf60de16443005', - size: 255, + body: 'a400d90102818258203c388acb799a37a4f1cc99bec7626637b0b80626b9ef7c7a687282cab701178d00018182583901f8a4be8308c12b910252b6fd6ee4a98730300009382becc049a6e618476aacdafaf01e68c2f072270f078c9689da6139eba4b309e1d5615f1a002b39bb021a00028d0504d901028182008200581cfb52d3055a3a3a3238ce219a3fc13fe4d8797d5062e8dd4670c7d29b', + hash: '981b99d39e65e2697ab277c8dabf39a779a862480e2e214d5d55251ba6d94f52', + size: 264, }, - totalSpent: '2166777', - fee: '166777', + totalSpent: '2167173', + fee: '167173', inputs: [utxo1], outputs: [ { isChange: true, address: changeAddress, - amount: '2833223', + amount: '2832827', assets: [], }, ], @@ -1017,18 +1017,18 @@ export const coinSelection = [ options: {}, result: { tx: { - body: 'a400818258203c388acb799a37a4f1cc99bec7626637b0b80626b9ef7c7a687282cab701178d00018182583901f8a4be8308c12b910252b6fd6ee4a98730300009382becc049a6e618476aacdafaf01e68c2f072270f078c9689da6139eba4b309e1d5615f1a0049a943021a0002a1fd048183028200581cfb52d3055a3a3a3238ce219a3fc13fe4d8797d5062e8dd4670c7d29b581c0f292fcaa02b8b2f9b3c8f9fd8e0bb21abedb692a6d5058df3ef2735', - hash: '8c764ce502653f5970d1e687ec067f9f9e5f6bb11eaf8462846a7b7adabbebb5', - size: 386, + body: 'a400d90102818258203c388acb799a37a4f1cc99bec7626637b0b80626b9ef7c7a687282cab701178d00018182583901f8a4be8308c12b910252b6fd6ee4a98730300009382becc049a6e618476aacdafaf01e68c2f072270f078c9689da6139eba4b309e1d5615f1a0049a7b7021a0002a38904d901028183028200581cfb52d3055a3a3a3238ce219a3fc13fe4d8797d5062e8dd4670c7d29b581c0f292fcaa02b8b2f9b3c8f9fd8e0bb21abedb692a6d5058df3ef2735', + hash: '37717824e17580f9a47b4753cedd8ae74d0ada1290087a4cca038faa2979a70e', + size: 395, }, - totalSpent: '172541', - fee: '172541', + totalSpent: '172937', + fee: '172937', inputs: [utxo1], outputs: [ { isChange: true, address: changeAddress, - amount: '4827459', + amount: '4827063', assets: [], }, ], @@ -1050,18 +1050,18 @@ export const coinSelection = [ options: {}, result: { tx: { - body: 'a400818258203c388acb799a37a4f1cc99bec7626637b0b80626b9ef7c7a687282cab701178d00018182583901f8a4be8308c12b910252b6fd6ee4a98730300009382becc049a6e618476aacdafaf01e68c2f072270f078c9689da6139eba4b309e1d5615f1a006832eb021a00029cd5048182018200581cfb52d3055a3a3a3238ce219a3fc13fe4d8797d5062e8dd4670c7d29b', - hash: 'd940832a02c87da9af39ed1396a03b4e5df9b20483473a6ac7959653a2e3746c', - size: 356, + body: 'a400d90102818258203c388acb799a37a4f1cc99bec7626637b0b80626b9ef7c7a687282cab701178d00018182583901f8a4be8308c12b910252b6fd6ee4a98730300009382becc049a6e618476aacdafaf01e68c2f072270f078c9689da6139eba4b309e1d5615f1a0068315f021a00029e6104d901028182018200581cfb52d3055a3a3a3238ce219a3fc13fe4d8797d5062e8dd4670c7d29b', + hash: 'bdfac46c16d64db6e5952cc9a579660394ff8cb2386678dd635fbf8243fa89c4', + size: 365, }, - totalSpent: '171221', - fee: '171221', + totalSpent: '171617', + fee: '171617', inputs: [utxo1], outputs: [ { isChange: true, address: changeAddress, - amount: '6828779', + amount: '6828383', assets: [], }, ], @@ -1152,12 +1152,12 @@ export const coinSelection = [ options: {}, result: { tx: { - body: 'a300818258201bfb8b1d06bd28fb33493afaa5b22dec02bb8e292bbd7a6965c9037b5964a808010183825839013af9d8434bea8de03cd698d5fa1c6b82b991146a755f509e95d6b53b15ab05b40d24d39c9d14dfec04d87ed071f2c66484b3ab83ab3d603d1a000f4240825839013af9d8434bea8de03cd698d5fa1c6b82b991146a755f509e95d6b53b15ab05b40d24d39c9d14dfec04d87ed071f2c66484b3ab83ab3d603d1a001e848082583901f8a4be8308c12b910252b6fd6ee4a98730300009382becc049a6e618476aacdafaf01e68c2f072270f078c9689da6139eba4b309e1d5615f821ae42aa6f5a1581c02477d7c23b4c2834b0be8ca8578dde47af0cc82a964688f6fc95a7aa144475249431a000f3df4021a0002a305', - hash: 'd94325dbdb650c049bc98e2692373725edd345a1049cdfdd6c0597a5841b3e4f', - size: 392, + body: 'a300d90102818258201bfb8b1d06bd28fb33493afaa5b22dec02bb8e292bbd7a6965c9037b5964a808010183825839013af9d8434bea8de03cd698d5fa1c6b82b991146a755f509e95d6b53b15ab05b40d24d39c9d14dfec04d87ed071f2c66484b3ab83ab3d603d1a000f4240825839013af9d8434bea8de03cd698d5fa1c6b82b991146a755f509e95d6b53b15ab05b40d24d39c9d14dfec04d87ed071f2c66484b3ab83ab3d603d1a001e848082583901f8a4be8308c12b910252b6fd6ee4a98730300009382becc049a6e618476aacdafaf01e68c2f072270f078c9689da6139eba4b309e1d5615f821ae42aa5eda1581c02477d7c23b4c2834b0be8ca8578dde47af0cc82a964688f6fc95a7aa144475249431a000f3df4021a0002a40d', + hash: '458c3316af1e157a1d5576f381bbff2dc26af3c6ea9c87b951b08777255699d3', + size: 398, }, - totalSpent: '3172805', - fee: '172805', + totalSpent: '3173069', + fee: '173069', inputs: [ { address: @@ -1193,7 +1193,7 @@ export const coinSelection = [ setMax: false, }, { - amount: '3828000501', + amount: '3828000237', isChange: true, address: changeAddress, assets: [ @@ -1289,12 +1289,12 @@ export const coinSelection = [ options: {}, result: { tx: { - body: 'a3008382582005cf0d8c9824b6e1bf403329d159cc57d89b4c22d93835bbdee46687f7c69c6900825820280c49a69c0fc24c3fdcdbcdd4030da3533a87e4378639bcd4a8841b3d2c6e2102825820d8ff7a39d1daf80ae2e99351c51fbb823f223e717cee09d23bc1b2691092632d00018382583900960ad1294eb27ab1e0c2e620a0fafcc87127d333ffb9d7c18ee16a2d8e38024e1bcbdd6341cb96a3403d5a64ada057798094d2383172b1d4821a0011a008a1581c3b746b6a5f8c43acc6bed9259ff7fc5f0b9e0be8adc3d63edfea98c7a14870726573737572650182583900960ad1294eb27ab1e0c2e620a0fafcc87127d333ffb9d7c18ee16a2d8e38024e1bcbdd6341cb96a3403d5a64ada057798094d2383172b1d4821a00118f32a1581c4f740e06506c0b8a1584760780ce3c61aea3b6061d5596d580e9aae6a1476265726e6172640182583901f8a4be8308c12b910252b6fd6ee4a98730300009382becc049a6e618476aacdafaf01e68c2f072270f078c9689da6139eba4b309e1d5615f1a00179827021a0002c7f9', - hash: '5cefbb1598171f91bc1b66bce90cfdb872c29b155b6db637ed13fc855b5ee43b', - size: 607, + body: 'a300d901028382582005cf0d8c9824b6e1bf403329d159cc57d89b4c22d93835bbdee46687f7c69c6900825820280c49a69c0fc24c3fdcdbcdd4030da3533a87e4378639bcd4a8841b3d2c6e2102825820d8ff7a39d1daf80ae2e99351c51fbb823f223e717cee09d23bc1b2691092632d00018382583900960ad1294eb27ab1e0c2e620a0fafcc87127d333ffb9d7c18ee16a2d8e38024e1bcbdd6341cb96a3403d5a64ada057798094d2383172b1d4821a0011a008a1581c3b746b6a5f8c43acc6bed9259ff7fc5f0b9e0be8adc3d63edfea98c7a14870726573737572650182583900960ad1294eb27ab1e0c2e620a0fafcc87127d333ffb9d7c18ee16a2d8e38024e1bcbdd6341cb96a3403d5a64ada057798094d2383172b1d4821a00118f32a1581c4f740e06506c0b8a1584760780ce3c61aea3b6061d5596d580e9aae6a1476265726e6172640182583901f8a4be8308c12b910252b6fd6ee4a98730300009382becc049a6e618476aacdafaf01e68c2f072270f078c9689da6139eba4b309e1d5615f1a0017971f021a0002c901', + hash: '439134fd244df14ce5c2b0e17f5b6a73b51f850ed617e9b15439dbe917e37a97', + size: 613, }, - totalSpent: '2488115', - fee: '182265', + totalSpent: '2488379', + fee: '182529', inputs: [ { address: @@ -1372,7 +1372,7 @@ export const coinSelection = [ { address: 'addr1q8u2f05rprqjhygz22m06mhy4xrnqvqqpyuzhmxqfxnwvxz8d2kd47hsre5v9urjyu8s0ryk38dxzw0t5jesncw4v90s22tk0f', - amount: '1546279', + amount: '1546015', assets: [], isChange: true, }, diff --git a/tests/methods/fixtures/randomImprove.ts b/tests/methods/fixtures/randomImprove.ts index f6c3500..a024c60 100644 --- a/tests/methods/fixtures/randomImprove.ts +++ b/tests/methods/fixtures/randomImprove.ts @@ -136,8 +136,8 @@ export const nonFinalCompose = [ 'ec8fdf616242f430855ad7477acda53395eb30c295f5a7ef038712578877375b5a2f00353c9c5cc88c7ff18e71dc08724d90fc238213b789c0b02438e336be07', options: {}, result: { - totalSpent: '168053', - fee: '168053', + totalSpent: '168317', + fee: '168317', }, }, { @@ -158,8 +158,8 @@ export const nonFinalCompose = [ 'ec8fdf616242f430855ad7477acda53395eb30c295f5a7ef038712578877375b5a2f00353c9c5cc88c7ff18e71dc08724d90fc238213b789c0b02438e336be07', options: {}, result: { - totalSpent: '2168053', - fee: '168053', + totalSpent: '2168317', + fee: '168317', }, }, { @@ -188,8 +188,8 @@ export const nonFinalCompose = [ 'ec8fdf616242f430855ad7477acda53395eb30c295f5a7ef038712578877375b5a2f00353c9c5cc88c7ff18e71dc08724d90fc238213b789c0b02438e336be07', options: {}, result: { - totalSpent: '6174301', - fee: '174301', + totalSpent: '6174565', + fee: '174565', }, }, ]; @@ -294,8 +294,8 @@ export const coinSelection = [ 'ec8fdf616242f430855ad7477acda53395eb30c295f5a7ef038712578877375b5a2f00353c9c5cc88c7ff18e71dc08724d90fc238213b789c0b02438e336be07', options: {}, result: { - totalSpent: '2884313', - fee: '194717', + totalSpent: '2884577', + fee: '194981', inputs: UTXO_REAL_SAME_POLICY, outputs: [ // external @@ -327,7 +327,7 @@ export const coinSelection = [ // change { isChange: true, - amount: '699786705', + amount: '699786441', address: 'addr_test1qq43pzxxgfdvffrw6jnrej9840nuylaykv7uzcy56t02xv8m2tfs2k368ger3n3pngluz0lympuh65rzarw5vux862dszv2e9w', assets: [ diff --git a/tests/utils/trezor/fixtures/sign.ts b/tests/utils/trezor/fixtures/sign.ts index 177754c..93c1d3f 100644 --- a/tests/utils/trezor/fixtures/sign.ts +++ b/tests/utils/trezor/fixtures/sign.ts @@ -30,7 +30,7 @@ export const sign = [ }, ], signedTx: - '84a4008382582018cc7d96f92d506dd112d101c8e33a80d0258f6b7b1aabd676e0a4ee6af08943008258201e8ba20994b708f668784eadc5a583ef090998545ebd0b357cca1098bf4112ce00825820c1654e963a73c12eea189a521fa994c8ef2d12efcfbceceb5e0e80a48988a3f601018282583900b52332e05067c86346bbf650afc120e443114358606f7e70c45542bfd7bd25149cb78c6085ca07e881870ca2dff95287e33f9edefd9b1f0d1a0016e36082583900a99f2c10c266cf5cf289f32b6b429cded9b94fe037dd0bcde73e408ca271492bbb4cf84ad488cf85b84c3b960d5ca912e93cd70cac2ae60b821a00203c89a1581c2bd1de9a0ede8302f7b860792d4fcfa9a34cafa6d0cc54d20e5b5374a1445345414c01021a0002c749031a03e2a117a10083825820687d090fa9ea2ca54ab7a881202031c02a78595bd023e7e145d174e4aeb35d365840456b0c26401f2a0a55c5273a9fd1380074a4e231c6ff531c1dccbce886632ba3d9d331f67935182563c57496b89ff1251995efd23b8506f1bed194210472d400825820b236a3556ad2a2be78339cd520c8c784d1b3e54fc77935f4e96183eeddf701ab5840ee4a17f8b2d37d4e1edc309c9c44b08edc94920fac36fe675f88245153948533dc6d8c24744cdd6327027477649aa06e3824c0dc3aa6cbcb1246440c29a2860082582005d3360b3af91ec66ff5ab77b9f40f568b1f5a24fd7350019f5a50a67c883e645840a943f85e313cc907f1bc1d31b0c2cc0160c44232eb6b2cda44568cc690821d6a02a0632e864d4ef26828efd28719cb4dd63e9400dc0c0e6d7a8dccc7a414db0ef5f6', - txHash: '2c83d970d818ed4a09d11105ab061e8ba9a8e52e0e411f3e0f48af2a5958056d', + '84a400d901028382582018cc7d96f92d506dd112d101c8e33a80d0258f6b7b1aabd676e0a4ee6af08943008258201e8ba20994b708f668784eadc5a583ef090998545ebd0b357cca1098bf4112ce00825820c1654e963a73c12eea189a521fa994c8ef2d12efcfbceceb5e0e80a48988a3f601018282583900b52332e05067c86346bbf650afc120e443114358606f7e70c45542bfd7bd25149cb78c6085ca07e881870ca2dff95287e33f9edefd9b1f0d1a0016e36082583900a99f2c10c266cf5cf289f32b6b429cded9b94fe037dd0bcde73e408ca271492bbb4cf84ad488cf85b84c3b960d5ca912e93cd70cac2ae60b821a00203c89a1581c2bd1de9a0ede8302f7b860792d4fcfa9a34cafa6d0cc54d20e5b5374a1445345414c01021a0002c749031a03e2a117a100d9010283825820687d090fa9ea2ca54ab7a881202031c02a78595bd023e7e145d174e4aeb35d365840456b0c26401f2a0a55c5273a9fd1380074a4e231c6ff531c1dccbce886632ba3d9d331f67935182563c57496b89ff1251995efd23b8506f1bed194210472d400825820b236a3556ad2a2be78339cd520c8c784d1b3e54fc77935f4e96183eeddf701ab5840ee4a17f8b2d37d4e1edc309c9c44b08edc94920fac36fe675f88245153948533dc6d8c24744cdd6327027477649aa06e3824c0dc3aa6cbcb1246440c29a2860082582005d3360b3af91ec66ff5ab77b9f40f568b1f5a24fd7350019f5a50a67c883e645840a943f85e313cc907f1bc1d31b0c2cc0160c44232eb6b2cda44568cc690821d6a02a0632e864d4ef26828efd28719cb4dd63e9400dc0c0e6d7a8dccc7a414db0ef5f6', + txHash: '0690e4c93d5f5f2c3379f113bdca1bc26db8364f422549f99f94ae3a597c716b', }, ]; diff --git a/tests/utils/trezor/sign.test.ts b/tests/utils/trezor/sign.test.ts index f35539d..361b65f 100644 --- a/tests/utils/trezor/sign.test.ts +++ b/tests/utils/trezor/sign.test.ts @@ -15,9 +15,11 @@ describe('trezor sign utils', () => { const tx = CardanoWasm.Transaction.from_bytes( Buffer.from(signedTx, 'hex'), ); - const txhash = Buffer.from( - CardanoWasm.hash_transaction(tx.body()).to_bytes(), - ).toString('hex'); + const txhash = CardanoWasm.FixedTransaction.new_from_body_bytes( + tx.body().to_bytes(), + ) + .transaction_hash() + .to_hex(); // just sanity check, signing shouldn't change the hash expect(txhash).toBe(f.txHash); diff --git a/yarn.lock b/yarn.lock index 9e2bf9a..f40fe8f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -940,17 +940,17 @@ __metadata: languageName: node linkType: hard -"@emurgo/cardano-serialization-lib-browser@npm:^12.1.0": - version: 12.1.0 - resolution: "@emurgo/cardano-serialization-lib-browser@npm:12.1.0" - checksum: 10/70ef63f6d34e49987740c06254b9abc405f646aac0ef1f18e201fead51ff3a862b5e0142e9cd4dbfe59c8b5e2b64ae7b8f3be3a860ece5fc6283bdcffa65d56e +"@emurgo/cardano-serialization-lib-browser@npm:^13.2.0": + version: 13.2.0 + resolution: "@emurgo/cardano-serialization-lib-browser@npm:13.2.0" + checksum: 10/f60f47b7df9e1e783302921d9f225696d09e01b124a75dd8672effae17acdd42779da66a068c923261aabead52ac7aae9426ef13c875f48b5ef7b9d629b8b993 languageName: node linkType: hard -"@emurgo/cardano-serialization-lib-nodejs@npm:12.1.0": - version: 12.1.0 - resolution: "@emurgo/cardano-serialization-lib-nodejs@npm:12.1.0" - checksum: 10/cf1f07468cf60af873375368e9d4b2d605758835de56fb314879230f11086c1474426ab2b540a218ed447f40005cc9c49f7f7f47e2d331d10d2c12140ede0737 +"@emurgo/cardano-serialization-lib-nodejs@npm:13.2.0": + version: 13.2.0 + resolution: "@emurgo/cardano-serialization-lib-nodejs@npm:13.2.0" + checksum: 10/b8483dd74ec902da607f0ee00259674ba1794784fafd322948043dd4dfdbddecc81f6546fc98c9a57810639f91110cf76be7755a138a3506af6233954cfe449e languageName: node linkType: hard @@ -1034,8 +1034,8 @@ __metadata: version: 0.0.0-use.local resolution: "@fivebinaries/coin-selection@workspace:." dependencies: - "@emurgo/cardano-serialization-lib-browser": "npm:^12.1.0" - "@emurgo/cardano-serialization-lib-nodejs": "npm:12.1.0" + "@emurgo/cardano-serialization-lib-browser": "npm:^13.2.0" + "@emurgo/cardano-serialization-lib-nodejs": "npm:13.2.0" "@eslint/js": "npm:^9.11.1" "@swc-node/jest": "npm:^1.8.12" "@swc/core": "npm:1.7.26"