@totemsdk/omnia-splice 0.3.3 → 0.3.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.
- package/dist/cjs/successor.js +2 -1
- package/dist/successor.js +2 -1
- package/package.json +5 -5
package/dist/cjs/successor.js
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
exports.observeSpliceSuccessor = observeSpliceSuccessor;
|
|
14
14
|
exports.recoverInterruptedSplices = recoverInterruptedSplices;
|
|
15
|
+
const core_1 = require("@totemsdk/core");
|
|
15
16
|
const defaultSleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
16
17
|
/**
|
|
17
18
|
* Find the successor coin at the channel address, excluding the spent old
|
|
@@ -31,7 +32,7 @@ async function observeSpliceSuccessor(chain, options) {
|
|
|
31
32
|
const candidates = coins.filter((coin) => !coin.spent
|
|
32
33
|
&& coin.address.toLowerCase() === options.address.toLowerCase()
|
|
33
34
|
&& coin.tokenid.toLowerCase() === options.tokenId.toLowerCase()
|
|
34
|
-
&&
|
|
35
|
+
&& (0, core_1.coinAmountAtoms)(coin) === options.amount);
|
|
35
36
|
// CAN-012: the channel input floats (COINID_ELTOO), so the coin id cannot be
|
|
36
37
|
// predicted from the transaction. Two coins matching the same address, token
|
|
37
38
|
// and amount are indistinguishable here; picking the first would silently
|
package/dist/successor.js
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
* provides that observation plus a small journal seam so a process that dies
|
|
9
9
|
* between broadcast and confirmation can finish or retry safely.
|
|
10
10
|
*/
|
|
11
|
+
import { coinAmountAtoms } from '@totemsdk/core';
|
|
11
12
|
const defaultSleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
12
13
|
/**
|
|
13
14
|
* Find the successor coin at the channel address, excluding the spent old
|
|
@@ -27,7 +28,7 @@ export async function observeSpliceSuccessor(chain, options) {
|
|
|
27
28
|
const candidates = coins.filter((coin) => !coin.spent
|
|
28
29
|
&& coin.address.toLowerCase() === options.address.toLowerCase()
|
|
29
30
|
&& coin.tokenid.toLowerCase() === options.tokenId.toLowerCase()
|
|
30
|
-
&&
|
|
31
|
+
&& coinAmountAtoms(coin) === options.amount);
|
|
31
32
|
// CAN-012: the channel input floats (COINID_ELTOO), so the coin id cannot be
|
|
32
33
|
// predicted from the transaction. Two coins matching the same address, token
|
|
33
34
|
// and amount are indistinguishable here; picking the first would silently
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@totemsdk/omnia-splice",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.4",
|
|
4
4
|
"description": "Channel splicing for @totemsdk/omnia — resize Minima eltoo channels without a close+reopen cycle",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"types": "dist/cjs/index.d.ts",
|
|
@@ -25,11 +25,11 @@
|
|
|
25
25
|
"NOTICE"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@totemsdk/omnia": "^
|
|
29
|
-
"@totemsdk/core": "^1.
|
|
30
|
-
"@totemsdk/wots-lease": "^1.0.3",
|
|
28
|
+
"@totemsdk/omnia": "^3.0.0",
|
|
29
|
+
"@totemsdk/core": "^1.6.0",
|
|
31
30
|
"@totemsdk/txpow": "^1.1.1",
|
|
32
|
-
"@totemsdk/tx-builder": "^0.3.
|
|
31
|
+
"@totemsdk/tx-builder": "^0.3.4",
|
|
32
|
+
"@totemsdk/wots-lease": "^1.0.3",
|
|
33
33
|
"@totemsdk/storage": "^0.2.2"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|