@dynamic-labs-wallet/core 1.0.19 → 1.0.20
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/index.cjs +15 -2
- package/index.esm.js +15 -2
- package/package.json +2 -2
- package/src/eventStream/utils.d.ts.map +1 -1
package/index.cjs
CHANGED
|
@@ -758,6 +758,7 @@ const getElapsedTime = (startTime)=>{
|
|
|
758
758
|
const decoder = new TextDecoder();
|
|
759
759
|
let buffer = '';
|
|
760
760
|
let settled = false;
|
|
761
|
+
let ceremonyCompleteSeen = false;
|
|
761
762
|
const processEvents = (events)=>{
|
|
762
763
|
for (const event of events){
|
|
763
764
|
if (event.type === successEventType) {
|
|
@@ -765,6 +766,7 @@ const getElapsedTime = (startTime)=>{
|
|
|
765
766
|
resolve(event.data);
|
|
766
767
|
}
|
|
767
768
|
if (event.type === SuccessEventType.CeremonyComplete) {
|
|
769
|
+
ceremonyCompleteSeen = true;
|
|
768
770
|
const { accountAddress, walletId, shareSetId, shareSetType } = event.data;
|
|
769
771
|
onCeremonyComplete == null ? void 0 : onCeremonyComplete(accountAddress, walletId, shareSetId, shareSetType);
|
|
770
772
|
}
|
|
@@ -796,6 +798,12 @@ const getElapsedTime = (startTime)=>{
|
|
|
796
798
|
const error = new Error('SSE stream ended without a success or error event');
|
|
797
799
|
reject(error);
|
|
798
800
|
onError == null ? void 0 : onError(error);
|
|
801
|
+
} else if (onCeremonyComplete && !ceremonyCompleteSeen) {
|
|
802
|
+
// A ceremony op resolved early on its room-created event, but the
|
|
803
|
+
// stream closed before ceremony_complete — the server-side ceremony
|
|
804
|
+
// did not finish (or the event was dropped). Surface via onError so
|
|
805
|
+
// callers gating backup on completion abort instead of hanging.
|
|
806
|
+
onError == null ? void 0 : onError(new Error('SSE stream ended before ceremony_complete'));
|
|
799
807
|
}
|
|
800
808
|
return;
|
|
801
809
|
}
|
|
@@ -813,7 +821,12 @@ const getElapsedTime = (startTime)=>{
|
|
|
813
821
|
}
|
|
814
822
|
processStream();
|
|
815
823
|
} catch (err) {
|
|
816
|
-
|
|
824
|
+
const error = err instanceof Error ? err : new Error(String(err));
|
|
825
|
+
reject(error);
|
|
826
|
+
// A transport drop after the API promise already resolved (on
|
|
827
|
+
// room_created) would otherwise leave a ceremony backer hanging — surface
|
|
828
|
+
// it so onError-gated callers abort.
|
|
829
|
+
onError == null ? void 0 : onError(error);
|
|
817
830
|
}
|
|
818
831
|
};
|
|
819
832
|
processStream();
|
|
@@ -901,7 +914,7 @@ const getRequiredExternalKeyShareId = (ks)=>{
|
|
|
901
914
|
* before it is posted and surfaces in Datadog exactly as the recovery path does.
|
|
902
915
|
*/ const assertDynamicLocationsHaveExternalKeyShareId = (locations)=>locations.filter((location)=>location.location === BackupLocation.DYNAMIC).forEach((location)=>getRequiredExternalKeyShareId(location));
|
|
903
916
|
|
|
904
|
-
var version = "1.0.
|
|
917
|
+
var version = "1.0.20";
|
|
905
918
|
|
|
906
919
|
class BaseClient {
|
|
907
920
|
/**
|
package/index.esm.js
CHANGED
|
@@ -758,6 +758,7 @@ const getElapsedTime = (startTime)=>{
|
|
|
758
758
|
const decoder = new TextDecoder();
|
|
759
759
|
let buffer = '';
|
|
760
760
|
let settled = false;
|
|
761
|
+
let ceremonyCompleteSeen = false;
|
|
761
762
|
const processEvents = (events)=>{
|
|
762
763
|
for (const event of events){
|
|
763
764
|
if (event.type === successEventType) {
|
|
@@ -765,6 +766,7 @@ const getElapsedTime = (startTime)=>{
|
|
|
765
766
|
resolve(event.data);
|
|
766
767
|
}
|
|
767
768
|
if (event.type === SuccessEventType.CeremonyComplete) {
|
|
769
|
+
ceremonyCompleteSeen = true;
|
|
768
770
|
const { accountAddress, walletId, shareSetId, shareSetType } = event.data;
|
|
769
771
|
onCeremonyComplete == null ? void 0 : onCeremonyComplete(accountAddress, walletId, shareSetId, shareSetType);
|
|
770
772
|
}
|
|
@@ -796,6 +798,12 @@ const getElapsedTime = (startTime)=>{
|
|
|
796
798
|
const error = new Error('SSE stream ended without a success or error event');
|
|
797
799
|
reject(error);
|
|
798
800
|
onError == null ? void 0 : onError(error);
|
|
801
|
+
} else if (onCeremonyComplete && !ceremonyCompleteSeen) {
|
|
802
|
+
// A ceremony op resolved early on its room-created event, but the
|
|
803
|
+
// stream closed before ceremony_complete — the server-side ceremony
|
|
804
|
+
// did not finish (or the event was dropped). Surface via onError so
|
|
805
|
+
// callers gating backup on completion abort instead of hanging.
|
|
806
|
+
onError == null ? void 0 : onError(new Error('SSE stream ended before ceremony_complete'));
|
|
799
807
|
}
|
|
800
808
|
return;
|
|
801
809
|
}
|
|
@@ -813,7 +821,12 @@ const getElapsedTime = (startTime)=>{
|
|
|
813
821
|
}
|
|
814
822
|
processStream();
|
|
815
823
|
} catch (err) {
|
|
816
|
-
|
|
824
|
+
const error = err instanceof Error ? err : new Error(String(err));
|
|
825
|
+
reject(error);
|
|
826
|
+
// A transport drop after the API promise already resolved (on
|
|
827
|
+
// room_created) would otherwise leave a ceremony backer hanging — surface
|
|
828
|
+
// it so onError-gated callers abort.
|
|
829
|
+
onError == null ? void 0 : onError(error);
|
|
817
830
|
}
|
|
818
831
|
};
|
|
819
832
|
processStream();
|
|
@@ -901,7 +914,7 @@ const getRequiredExternalKeyShareId = (ks)=>{
|
|
|
901
914
|
* before it is posted and surfaces in Datadog exactly as the recovery path does.
|
|
902
915
|
*/ const assertDynamicLocationsHaveExternalKeyShareId = (locations)=>locations.filter((location)=>location.location === BackupLocation.DYNAMIC).forEach((location)=>getRequiredExternalKeyShareId(location));
|
|
903
916
|
|
|
904
|
-
var version = "1.0.
|
|
917
|
+
var version = "1.0.20";
|
|
905
918
|
|
|
906
919
|
class BaseClient {
|
|
907
920
|
/**
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs-wallet/core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.20",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@dynamic-labs/sdk-api-core": "^0.0.984",
|
|
8
|
-
"@dynamic-labs-wallet/primitives": "1.0.
|
|
8
|
+
"@dynamic-labs-wallet/primitives": "1.0.20",
|
|
9
9
|
"axios": "1.16.0",
|
|
10
10
|
"uuid": "11.1.0"
|
|
11
11
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/eventStream/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,KAAK,YAAY,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAUrF,eAAO,MAAM,cAAc,eAAgB,MAAM,KAAG,MAAM,GAAG,SAE5D,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,wBAAwB,GAAI,CAAC,oMAcvC;IACD,SAAS,EAAE,aAAa,CAAC;IACzB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;IAC1C,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,kBAAkB,CAAC,EAAE,CACnB,cAAc,EAAE,MAAM,EACtB,QAAQ,EAAE,MAAM,EAChB,UAAU,CAAC,EAAE,MAAM,EACnB,YAAY,CAAC,EAAE,YAAY,KACxB,IAAI,CAAC;IACV,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,YAA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