@canton-network/core-ledger-client 0.22.0 → 0.23.1
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/acs/acs-helper.d.ts.map +1 -1
- package/dist/amulet-service.d.ts.map +1 -1
- package/dist/generated-clients/asyncapi-3.4.7.d.ts +994 -0
- package/dist/generated-clients/asyncapi-3.4.7.d.ts.map +1 -0
- package/dist/index.cjs +168 -62
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +168 -64
- package/dist/index.js.map +1 -1
- package/dist/ledger-client.d.ts.map +1 -1
- package/dist/token-standard-service.d.ts +3 -2
- package/dist/token-standard-service.d.ts.map +1 -1
- package/dist/txparse/instrumentmap.d.ts +18 -0
- package/dist/txparse/instrumentmap.d.ts.map +1 -0
- package/dist/txparse/parser.d.ts.map +1 -1
- package/dist/txparse/types.d.ts +14 -1
- package/dist/txparse/types.d.ts.map +1 -1
- package/package.json +6 -6
package/dist/index.d.ts
CHANGED
|
@@ -5,5 +5,7 @@ export * from './generated-clients/openapi-3.3.0-SNAPSHOT.js';
|
|
|
5
5
|
export * from './acs/acs-container.js';
|
|
6
6
|
export * from './acs/ws-support.js';
|
|
7
7
|
export type { Transaction, TokenStandardEvent, Holding, HoldingLock, HoldingsChange, HoldingsChangeSummary, TransferInstructionView, TokenStandardChoice, PrettyTransactions, PrettyContract, ViewValue, Label, TransferIn, TransferOut, MergeSplit, Burn, Mint, Unlock, ExpireDust, RawArchive, RawCreate, } from './txparse/types.js';
|
|
8
|
+
export { TransactionParser } from './txparse/parser.js';
|
|
9
|
+
export { TokenStandardTransactionInterfaces } from './constants.js';
|
|
8
10
|
export { awaitCompletion, promiseWithTimeout, isJsCantonError, asJsCantonError, JsCantonError, JSContractEntry, defaultRetryableOptions, } from './ledger-api-utils.js';
|
|
9
11
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,cAAc,6BAA6B,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACnD,cAAc,oBAAoB,CAAA;AAClC,cAAc,+CAA+C,CAAA;AAC7D,cAAc,wBAAwB,CAAA;AACtC,cAAc,qBAAqB,CAAA;AACnC,YAAY,EACR,WAAW,EACX,kBAAkB,EAClB,OAAO,EACP,WAAW,EACX,cAAc,EACd,qBAAqB,EACrB,uBAAuB,EACvB,mBAAmB,EACnB,kBAAkB,EAClB,cAAc,EACd,SAAS,EACT,KAAK,EACL,UAAU,EACV,WAAW,EACX,UAAU,EACV,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,UAAU,EACV,UAAU,EACV,SAAS,GACZ,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,cAAc,6BAA6B,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACnD,cAAc,oBAAoB,CAAA;AAClC,cAAc,+CAA+C,CAAA;AAC7D,cAAc,wBAAwB,CAAA;AACtC,cAAc,qBAAqB,CAAA;AACnC,YAAY,EACR,WAAW,EACX,kBAAkB,EAClB,OAAO,EACP,WAAW,EACX,cAAc,EACd,qBAAqB,EACrB,uBAAuB,EACvB,mBAAmB,EACnB,kBAAkB,EAClB,cAAc,EACd,SAAS,EACT,KAAK,EACL,UAAU,EACV,WAAW,EACX,UAAU,EACV,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,UAAU,EACV,UAAU,EACV,SAAS,GACZ,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,EAAE,kCAAkC,EAAE,MAAM,gBAAgB,CAAA;AAEnE,OAAO,EACH,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,aAAa,EACb,eAAe,EACf,uBAAuB,GAC1B,MAAM,uBAAuB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { HOLDING_INTERFACE_ID, TRANSFER_FACTORY_INTERFACE_ID, TRANSFER_INSTRUCTION_INTERFACE_ID, ALLOCATION_FACTORY_INTERFACE_ID, ALLOCATION_INSTRUCTION_INTERFACE_ID, ALLOCATION_INTERFACE_ID, ALLOCATION_REQUEST_INTERFACE_ID, TokenStandardClient, FEATURED_APP_DELEGATE_PROXY_INTERFACE_ID } from '@canton-network/core-token-standard';
|
|
2
2
|
import { ErrorInfo, RetryInfo } from '@canton-network/core-ledger-proto';
|
|
3
3
|
import BigNumber from 'bignumber.js';
|
|
4
4
|
import createClient from 'openapi-fetch';
|
|
@@ -351,56 +351,36 @@ var asGrpcError = (e) => {
|
|
|
351
351
|
return { code, message, errorInfo, retryInfo };
|
|
352
352
|
};
|
|
353
353
|
|
|
354
|
-
// src/txparse/
|
|
355
|
-
var
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
outputAmount: "0",
|
|
360
|
-
amountChange: "0"
|
|
361
|
-
};
|
|
362
|
-
var renderTransaction = (t) => {
|
|
363
|
-
return { ...t, events: t.events.map(renderTransactionEvent) };
|
|
364
|
-
};
|
|
365
|
-
var renderTransactionEvent = (e) => {
|
|
366
|
-
const lockedHoldingsChangeSummary = renderHoldingsChangeSummary(
|
|
367
|
-
e.lockedHoldingsChangeSummary
|
|
368
|
-
);
|
|
369
|
-
const unlockedHoldingsChangeSummary = renderHoldingsChangeSummary(
|
|
370
|
-
e.unlockedHoldingsChangeSummary
|
|
371
|
-
);
|
|
372
|
-
const lockedHoldingsChange = renderHoldingsChange(e.lockedHoldingsChange);
|
|
373
|
-
const unlockedHoldingsChange = renderHoldingsChange(
|
|
374
|
-
e.unlockedHoldingsChange
|
|
375
|
-
);
|
|
376
|
-
return {
|
|
377
|
-
...e,
|
|
378
|
-
lockedHoldingsChange,
|
|
379
|
-
unlockedHoldingsChange,
|
|
380
|
-
lockedHoldingsChangeSummary,
|
|
381
|
-
unlockedHoldingsChangeSummary
|
|
382
|
-
};
|
|
383
|
-
};
|
|
384
|
-
var renderHoldingsChangeSummary = (s) => {
|
|
385
|
-
if (s.numInputs === 0 && s.numOutputs === 0 && s.inputAmount === "0" && s.outputAmount === "0" && s.amountChange === "0") {
|
|
386
|
-
return null;
|
|
354
|
+
// src/txparse/instrumentmap.ts
|
|
355
|
+
var InstrumentMap = class {
|
|
356
|
+
constructor() {
|
|
357
|
+
__publicField(this, "map");
|
|
358
|
+
this.map = /* @__PURE__ */ new Map();
|
|
387
359
|
}
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
360
|
+
encodeKey(instrumentId) {
|
|
361
|
+
return JSON.stringify([instrumentId.admin, instrumentId.id]);
|
|
362
|
+
}
|
|
363
|
+
decodeKey(key) {
|
|
364
|
+
const [admin, id] = JSON.parse(key);
|
|
365
|
+
return { admin, id };
|
|
366
|
+
}
|
|
367
|
+
set(key, value) {
|
|
368
|
+
this.map.set(this.encodeKey(key), value);
|
|
369
|
+
}
|
|
370
|
+
get(key) {
|
|
371
|
+
return this.map.get(this.encodeKey(key));
|
|
372
|
+
}
|
|
373
|
+
has(key) {
|
|
374
|
+
return this.map.has(this.encodeKey(key));
|
|
375
|
+
}
|
|
376
|
+
delete(key) {
|
|
377
|
+
return this.map.delete(this.encodeKey(key));
|
|
378
|
+
}
|
|
379
|
+
*entries() {
|
|
380
|
+
for (const [key, value] of this.map.entries()) {
|
|
381
|
+
yield [this.decodeKey(key), value];
|
|
382
|
+
}
|
|
399
383
|
}
|
|
400
|
-
return {
|
|
401
|
-
...c.creates.length !== 0 && { creates: c.creates },
|
|
402
|
-
...c.archives.length !== 0 && { archives: c.archives }
|
|
403
|
-
};
|
|
404
384
|
};
|
|
405
385
|
function currentStatusFromChoiceOrResult(choice, resultTag) {
|
|
406
386
|
if (resultTag === "TransferInstructionResult_Failed") return "Failed";
|
|
@@ -494,7 +474,11 @@ var TransactionParser = class {
|
|
|
494
474
|
parseRawCreate(create, parentChoice) {
|
|
495
475
|
return this.buildRawEvent(create, create.nodeId, (result) => {
|
|
496
476
|
return {
|
|
497
|
-
|
|
477
|
+
// TODO: this code currently only looks at the first instrument
|
|
478
|
+
// to determine the type of the Event.
|
|
479
|
+
type: Number(
|
|
480
|
+
result.lockedHoldingsChangeSummaries[0]?.amountChange
|
|
481
|
+
) > 0 ? "Lock" : "Create",
|
|
498
482
|
parentChoice,
|
|
499
483
|
contractId: create.contractId,
|
|
500
484
|
offset: create.offset,
|
|
@@ -539,12 +523,15 @@ var TransactionParser = class {
|
|
|
539
523
|
} else {
|
|
540
524
|
const isLocked = !!holdingView.lock;
|
|
541
525
|
const summary = {
|
|
526
|
+
instrumentId: holdingView.instrumentId,
|
|
542
527
|
amountChange: holdingView.amount,
|
|
543
528
|
numInputs: 0,
|
|
544
529
|
inputAmount: "0",
|
|
545
530
|
numOutputs: 1,
|
|
546
531
|
outputAmount: holdingView.amount
|
|
547
532
|
};
|
|
533
|
+
const lockedHoldingsChangeSummaries = isLocked ? [summary] : [];
|
|
534
|
+
const unlockedHoldingsChangeSummaries = isLocked ? [] : [summary];
|
|
548
535
|
result = {
|
|
549
536
|
payload: holdingView,
|
|
550
537
|
unlockedHoldingsChange: {
|
|
@@ -555,8 +542,10 @@ var TransactionParser = class {
|
|
|
555
542
|
creates: isLocked ? [holdingView] : [],
|
|
556
543
|
archives: []
|
|
557
544
|
},
|
|
558
|
-
|
|
559
|
-
|
|
545
|
+
lockedHoldingsChangeSummaries,
|
|
546
|
+
lockedHoldingsChangeSummary: lockedHoldingsChangeSummaries[0] ?? emptyHoldingsChangeSummary,
|
|
547
|
+
unlockedHoldingsChangeSummaries,
|
|
548
|
+
unlockedHoldingsChangeSummary: unlockedHoldingsChangeSummaries[0] ?? emptyHoldingsChangeSummary,
|
|
560
549
|
transferInstruction: null
|
|
561
550
|
};
|
|
562
551
|
}
|
|
@@ -590,8 +579,10 @@ var TransactionParser = class {
|
|
|
590
579
|
},
|
|
591
580
|
unlockedHoldingsChange: { creates: [], archives: [] },
|
|
592
581
|
lockedHoldingsChange: { creates: [], archives: [] },
|
|
593
|
-
|
|
594
|
-
|
|
582
|
+
unlockedHoldingsChangeSummaries: [],
|
|
583
|
+
unlockedHoldingsChangeSummary: emptyHoldingsChangeSummary,
|
|
584
|
+
lockedHoldingsChangeSummaries: [],
|
|
585
|
+
lockedHoldingsChangeSummary: emptyHoldingsChangeSummary
|
|
595
586
|
};
|
|
596
587
|
}
|
|
597
588
|
break;
|
|
@@ -605,7 +596,9 @@ var TransactionParser = class {
|
|
|
605
596
|
label: buildLabel(result),
|
|
606
597
|
unlockedHoldingsChange: result.unlockedHoldingsChange,
|
|
607
598
|
lockedHoldingsChange: result.lockedHoldingsChange,
|
|
599
|
+
lockedHoldingsChangeSummaries: result.lockedHoldingsChangeSummaries,
|
|
608
600
|
lockedHoldingsChangeSummary: result.lockedHoldingsChangeSummary,
|
|
601
|
+
unlockedHoldingsChangeSummaries: result.unlockedHoldingsChangeSummaries,
|
|
609
602
|
unlockedHoldingsChangeSummary: result.unlockedHoldingsChangeSummary,
|
|
610
603
|
transferInstruction: result.transferInstruction
|
|
611
604
|
}
|
|
@@ -669,19 +662,23 @@ var TransactionParser = class {
|
|
|
669
662
|
(h) => !h.lock && h.owner === this.partyId
|
|
670
663
|
)
|
|
671
664
|
};
|
|
665
|
+
const lockedHoldingsChangeSummaries = computeSummaries(
|
|
666
|
+
lockedHoldingsChange,
|
|
667
|
+
this.partyId
|
|
668
|
+
);
|
|
669
|
+
const unlockedHoldingsChangeSummaries = computeSummaries(
|
|
670
|
+
unlockedHoldingsChange,
|
|
671
|
+
this.partyId
|
|
672
|
+
);
|
|
672
673
|
return {
|
|
673
674
|
event: {
|
|
674
675
|
label: result.label,
|
|
675
676
|
lockedHoldingsChange,
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
this.partyId
|
|
679
|
-
),
|
|
677
|
+
lockedHoldingsChangeSummaries,
|
|
678
|
+
lockedHoldingsChangeSummary: lockedHoldingsChangeSummaries[0] ?? emptyHoldingsChangeSummary,
|
|
680
679
|
unlockedHoldingsChange,
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
this.partyId
|
|
684
|
-
),
|
|
680
|
+
unlockedHoldingsChangeSummaries,
|
|
681
|
+
unlockedHoldingsChangeSummary: unlockedHoldingsChangeSummaries[0] ?? emptyHoldingsChangeSummary,
|
|
685
682
|
transferInstruction: result.transferInstruction
|
|
686
683
|
},
|
|
687
684
|
continueAfterNodeId: exercise.lastDescendantNodeId
|
|
@@ -1055,6 +1052,16 @@ function sumHoldingsChange(change, filter) {
|
|
|
1055
1052
|
);
|
|
1056
1053
|
}
|
|
1057
1054
|
function sumHoldings(holdings) {
|
|
1055
|
+
if (holdings.length > 0) {
|
|
1056
|
+
const instrumentId = holdings[0].instrumentId;
|
|
1057
|
+
for (const holding of holdings) {
|
|
1058
|
+
if (holding.instrumentId.admin !== instrumentId.admin || holding.instrumentId.id !== instrumentId.id) {
|
|
1059
|
+
throw new Error(
|
|
1060
|
+
`Attempted to call sumHoldings on heterogeneous instruments: ${JSON.stringify(instrumentId)} != ${JSON.stringify(holding.instrumentId)}`
|
|
1061
|
+
);
|
|
1062
|
+
}
|
|
1063
|
+
}
|
|
1064
|
+
}
|
|
1058
1065
|
return BigNumber.sum(
|
|
1059
1066
|
...holdings.map((h) => h.amount).concat(["0"])
|
|
1060
1067
|
// avoid NaN
|
|
@@ -1076,7 +1083,7 @@ function computeAmountChanges(children, meta, partyId) {
|
|
|
1076
1083
|
mintAmount: mintAmount.toString()
|
|
1077
1084
|
};
|
|
1078
1085
|
}
|
|
1079
|
-
function computeSummary(changes, partyId) {
|
|
1086
|
+
function computeSummary(instrumentId, changes, partyId) {
|
|
1080
1087
|
const amountChange = sumHoldingsChange(
|
|
1081
1088
|
changes,
|
|
1082
1089
|
(owner) => owner === partyId
|
|
@@ -1084,6 +1091,7 @@ function computeSummary(changes, partyId) {
|
|
|
1084
1091
|
const outputAmount = sumHoldings(changes.creates);
|
|
1085
1092
|
const inputAmount = sumHoldings(changes.archives);
|
|
1086
1093
|
return {
|
|
1094
|
+
instrumentId,
|
|
1087
1095
|
amountChange: amountChange.toString(),
|
|
1088
1096
|
numOutputs: changes.creates.length,
|
|
1089
1097
|
outputAmount: outputAmount.toString(),
|
|
@@ -1091,9 +1099,97 @@ function computeSummary(changes, partyId) {
|
|
|
1091
1099
|
inputAmount: inputAmount.toString()
|
|
1092
1100
|
};
|
|
1093
1101
|
}
|
|
1102
|
+
function holdingsChangeByInstrument(changes) {
|
|
1103
|
+
const map = new InstrumentMap();
|
|
1104
|
+
for (const create of changes.creates) {
|
|
1105
|
+
if (map.has(create.instrumentId)) {
|
|
1106
|
+
map.get(create.instrumentId).creates.push(create);
|
|
1107
|
+
} else {
|
|
1108
|
+
map.set(create.instrumentId, { creates: [create], archives: [] });
|
|
1109
|
+
}
|
|
1110
|
+
}
|
|
1111
|
+
for (const archive of changes.archives) {
|
|
1112
|
+
if (map.has(archive.instrumentId)) {
|
|
1113
|
+
map.get(archive.instrumentId).archives.push(archive);
|
|
1114
|
+
} else {
|
|
1115
|
+
map.set(archive.instrumentId, { creates: [], archives: [archive] });
|
|
1116
|
+
}
|
|
1117
|
+
}
|
|
1118
|
+
return map;
|
|
1119
|
+
}
|
|
1120
|
+
function computeSummaries(changes, partyId) {
|
|
1121
|
+
const byInstrument = holdingsChangeByInstrument(changes);
|
|
1122
|
+
return [...byInstrument.entries()].map(
|
|
1123
|
+
([instrumentId, change]) => computeSummary(instrumentId, change, partyId)
|
|
1124
|
+
);
|
|
1125
|
+
}
|
|
1094
1126
|
function holdingChangesNonEmpty(event) {
|
|
1095
1127
|
return event.unlockedHoldingsChange.creates.length > 0 || event.unlockedHoldingsChange.archives.length > 0 || event.lockedHoldingsChange.creates.length > 0 || event.lockedHoldingsChange.archives.length > 0;
|
|
1096
1128
|
}
|
|
1129
|
+
var emptyHoldingsChangeSummary = {
|
|
1130
|
+
// This is obviously incorrect, but the field was introduced at the same
|
|
1131
|
+
// time at which we introduced the more correct per-instrument summaries,
|
|
1132
|
+
// so we know that old code couldn't use this (broken) field, and new code
|
|
1133
|
+
// should use the correct summaries.
|
|
1134
|
+
instrumentId: { admin: "", id: "" },
|
|
1135
|
+
numInputs: 0,
|
|
1136
|
+
numOutputs: 0,
|
|
1137
|
+
inputAmount: "0",
|
|
1138
|
+
outputAmount: "0",
|
|
1139
|
+
amountChange: "0"
|
|
1140
|
+
};
|
|
1141
|
+
|
|
1142
|
+
// src/txparse/types.ts
|
|
1143
|
+
var renderTransaction = (t) => {
|
|
1144
|
+
return { ...t, events: t.events.map(renderTransactionEvent) };
|
|
1145
|
+
};
|
|
1146
|
+
var renderTransactionEvent = (e) => {
|
|
1147
|
+
const lockedHoldingsChangeSummaries = e.lockedHoldingsChangeSummaries.map(renderHoldingsChangeSummary).filter((s) => s !== null);
|
|
1148
|
+
const unlockedHoldingsChangeSummaries = e.unlockedHoldingsChangeSummaries.map(renderHoldingsChangeSummary).filter((s) => s !== null);
|
|
1149
|
+
const lockedHoldingsChange = renderHoldingsChange(e.lockedHoldingsChange);
|
|
1150
|
+
const unlockedHoldingsChange = renderHoldingsChange(
|
|
1151
|
+
e.unlockedHoldingsChange
|
|
1152
|
+
);
|
|
1153
|
+
return {
|
|
1154
|
+
...e,
|
|
1155
|
+
lockedHoldingsChange,
|
|
1156
|
+
unlockedHoldingsChange,
|
|
1157
|
+
lockedHoldingsChangeSummaries,
|
|
1158
|
+
// Deprecated
|
|
1159
|
+
lockedHoldingsChangeSummary: renderHoldingsChangeSummary(
|
|
1160
|
+
e.lockedHoldingsChangeSummary
|
|
1161
|
+
),
|
|
1162
|
+
unlockedHoldingsChangeSummaries,
|
|
1163
|
+
// Deprecated
|
|
1164
|
+
unlockedHoldingsChangeSummary: renderHoldingsChangeSummary(
|
|
1165
|
+
e.unlockedHoldingsChangeSummary
|
|
1166
|
+
)
|
|
1167
|
+
};
|
|
1168
|
+
};
|
|
1169
|
+
var renderHoldingsChangeSummary = (s) => {
|
|
1170
|
+
if (s.numInputs === 0 && s.numOutputs === 0 && s.inputAmount === "0" && s.outputAmount === "0" && s.amountChange === "0") {
|
|
1171
|
+
return null;
|
|
1172
|
+
}
|
|
1173
|
+
return {
|
|
1174
|
+
...(s.instrumentId.admin !== "" || s.instrumentId.id !== "") && {
|
|
1175
|
+
instrumentId: s.instrumentId
|
|
1176
|
+
},
|
|
1177
|
+
...s.numInputs !== 0 && { numInputs: s.numInputs },
|
|
1178
|
+
...s.inputAmount !== "0" && { inputAmount: s.inputAmount },
|
|
1179
|
+
...s.numOutputs !== 0 && { numOutputs: s.numOutputs },
|
|
1180
|
+
...s.outputAmount !== "0" && { outputAmount: s.outputAmount },
|
|
1181
|
+
...s.amountChange !== "0" && { amountChange: s.amountChange }
|
|
1182
|
+
};
|
|
1183
|
+
};
|
|
1184
|
+
var renderHoldingsChange = (c) => {
|
|
1185
|
+
if (c.creates.length === 0 && c.archives.length === 0) {
|
|
1186
|
+
return null;
|
|
1187
|
+
}
|
|
1188
|
+
return {
|
|
1189
|
+
...c.creates.length !== 0 && { creates: c.creates },
|
|
1190
|
+
...c.archives.length !== 0 && { archives: c.archives }
|
|
1191
|
+
};
|
|
1192
|
+
};
|
|
1097
1193
|
|
|
1098
1194
|
// src/token-standard-service.ts
|
|
1099
1195
|
var REQUESTED_AT_SKEW_MS = 6e4;
|
|
@@ -2088,6 +2184,14 @@ var TokenStandardService = class {
|
|
|
2088
2184
|
disclosedContracts
|
|
2089
2185
|
];
|
|
2090
2186
|
}
|
|
2187
|
+
static isHoldingLocked(holding, currentTime = /* @__PURE__ */ new Date()) {
|
|
2188
|
+
const lock = holding.lock;
|
|
2189
|
+
if (!lock) return false;
|
|
2190
|
+
const expiresAt = lock.expiresAt;
|
|
2191
|
+
if (!expiresAt) return true;
|
|
2192
|
+
const expiresAtDate = new Date(expiresAt);
|
|
2193
|
+
return currentTime < expiresAtDate;
|
|
2194
|
+
}
|
|
2091
2195
|
};
|
|
2092
2196
|
__publicField(TokenStandardService, "MEMO_KEY", "splice.lfdecentralizedtrust.org/reason");
|
|
2093
2197
|
|
|
@@ -3336,6 +3440,6 @@ var WSSupportWithBackOffSwitch = class {
|
|
|
3336
3440
|
}
|
|
3337
3441
|
};
|
|
3338
3442
|
|
|
3339
|
-
export { ACSContainer, ACS_UPDATE_CONFIG, AmuletService, CoreService, LedgerClient, TokenStandardService, WSSupportWithBackOffSwitch, asJsCantonError, awaitCompletion, defaultRetryableOptions, isJsCantonError, promiseWithTimeout, supportedVersions };
|
|
3443
|
+
export { ACSContainer, ACS_UPDATE_CONFIG, AmuletService, CoreService, LedgerClient, TokenStandardService, TokenStandardTransactionInterfaces, TransactionParser, WSSupportWithBackOffSwitch, asJsCantonError, awaitCompletion, defaultRetryableOptions, isJsCantonError, promiseWithTimeout, supportedVersions };
|
|
3340
3444
|
//# sourceMappingURL=index.js.map
|
|
3341
3445
|
//# sourceMappingURL=index.js.map
|