@dynamic-labs-wallet/node 1.1.68 → 1.1.70
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 +193 -45
- package/index.esm.js +193 -45
- package/package.json +4 -4
- package/src/delegatedClient/modules/sign.d.ts +8 -4
- package/src/delegatedClient/modules/sign.d.ts.map +1 -1
- package/src/observability/signRaceTelemetry.d.ts +42 -0
- package/src/observability/signRaceTelemetry.d.ts.map +1 -0
package/index.cjs
CHANGED
|
@@ -88,7 +88,7 @@ function _object_without_properties_loose(source, excluded) {
|
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
var version = "1.1.
|
|
91
|
+
var version = "1.1.70";
|
|
92
92
|
|
|
93
93
|
const MAX_CAUSE_CHAIN_LENGTH = 4;
|
|
94
94
|
const SAFE_ERROR_NAME_PATTERN = /^[A-Za-z][A-Za-z0-9_.-]{0,63}$/;
|
|
@@ -2691,14 +2691,151 @@ const createDelegatedWalletClient = ({ environmentId, baseApiUrl, baseMPCRelayAp
|
|
|
2691
2691
|
return client;
|
|
2692
2692
|
};
|
|
2693
2693
|
|
|
2694
|
-
|
|
2695
|
-
|
|
2694
|
+
// Matches wallet-service's [WaasStall] threshold.
|
|
2695
|
+
const RELAY_SIGN_STALL_WARN_MS = 10000;
|
|
2696
|
+
const MAX_ERROR_MESSAGE_LENGTH = 200;
|
|
2697
|
+
const TIMEOUT_PATTERN = /timed?[\s_-]?out/i;
|
|
2698
|
+
const JWT_PATTERN = /eyJ[\w-]+\.[\w-]+\.[\w-]*/g;
|
|
2699
|
+
const HEX_PATTERN = /(?:0x)?[0-9a-fA-F]{32,}/g;
|
|
2700
|
+
const OPAQUE_TOKEN_PATTERN = /[A-Za-z0-9+/_-]{40,}={0,2}/g;
|
|
2701
|
+
// Error codes are short enums (e.g. policy_violation); anything else is dropped.
|
|
2702
|
+
const SAFE_ERROR_CODE_PATTERN = /^[A-Za-z0-9_.:-]{1,64}$/;
|
|
2703
|
+
/** Strips anything token-, key- or payload-shaped and caps length. */ const sanitizeErrorMessage = (message)=>message.replace(JWT_PATTERN, '[redacted]').replace(HEX_PATTERN, '[redacted]').replace(OPAQUE_TOKEN_PATTERN, '[redacted]').slice(0, MAX_ERROR_MESSAGE_LENGTH);
|
|
2704
|
+
const getSignErrorDetails = (error)=>{
|
|
2705
|
+
if (!(error instanceof Error)) {
|
|
2706
|
+
return {
|
|
2707
|
+
errorMessage: sanitizeErrorMessage(String(error))
|
|
2708
|
+
};
|
|
2709
|
+
}
|
|
2710
|
+
const { code, status, response } = error;
|
|
2711
|
+
const errorStatus = typeof status === 'number' ? status : response == null ? void 0 : response.status;
|
|
2712
|
+
return _extends({
|
|
2713
|
+
errorMessage: sanitizeErrorMessage(error.message)
|
|
2714
|
+
}, typeof code === 'string' && SAFE_ERROR_CODE_PATTERN.test(code) ? {
|
|
2715
|
+
errorCode: code
|
|
2716
|
+
} : {}, typeof errorStatus === 'number' ? {
|
|
2717
|
+
errorStatus
|
|
2718
|
+
} : {});
|
|
2719
|
+
};
|
|
2720
|
+
/** A copy carrying only name and sanitized message: raw axios errors hold request headers (wallet API key). */ const toLoggableSignError = (error)=>{
|
|
2721
|
+
const safe = new Error(getSignErrorDetails(error).errorMessage);
|
|
2722
|
+
if (error instanceof Error) {
|
|
2723
|
+
safe.name = error.name;
|
|
2724
|
+
}
|
|
2725
|
+
return safe;
|
|
2726
|
+
};
|
|
2727
|
+
const isTimeout = ({ errorMessage, errorCode })=>TIMEOUT_PATTERN.test(errorMessage) || errorCode !== undefined && TIMEOUT_PATTERN.test(errorCode);
|
|
2728
|
+
/**
|
|
2729
|
+
* Times an SSE-handshake + relay-sign ceremony and logs one settle event, so a
|
|
2730
|
+
* late relay join or a lost race is visible in client logs and forwarded errors.
|
|
2731
|
+
* Context must hold identifiers only — never key shares, messages, API keys or JWTs.
|
|
2732
|
+
*/ class SignRaceTelemetry {
|
|
2733
|
+
markRoomReady(roomId) {
|
|
2734
|
+
this.roomReadyAt = Date.now();
|
|
2735
|
+
this.context = _extends({}, this.context, {
|
|
2736
|
+
roomId
|
|
2737
|
+
});
|
|
2738
|
+
}
|
|
2739
|
+
recordServerError(error) {
|
|
2740
|
+
var _this_serverError;
|
|
2741
|
+
(_this_serverError = this.serverError) != null ? _this_serverError : this.serverError = error;
|
|
2742
|
+
}
|
|
2743
|
+
/** Races the relay sign against the SSE error gate, logging which branch won. */ async race(startRelaySign, serverErrorGate) {
|
|
2744
|
+
const relaySign = this.trackRelaySign(startRelaySign);
|
|
2745
|
+
// The losing branch's rejection must not surface as unhandled.
|
|
2746
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
2747
|
+
relaySign.catch(()=>{});
|
|
2748
|
+
try {
|
|
2749
|
+
const result = await Promise.race([
|
|
2750
|
+
relaySign,
|
|
2751
|
+
serverErrorGate
|
|
2752
|
+
]);
|
|
2753
|
+
this.raceWinner = 'relay_sign';
|
|
2754
|
+
this.logger.info(`${this.eventPrefix} settled`, _extends({}, this.buildFields(), {
|
|
2755
|
+
outcome: 'signed'
|
|
2756
|
+
}));
|
|
2757
|
+
return result;
|
|
2758
|
+
} catch (error) {
|
|
2759
|
+
this.raceWinner = error === this.serverError ? 'sse_error' : 'relay_sign';
|
|
2760
|
+
this.fail(error);
|
|
2761
|
+
throw error;
|
|
2762
|
+
}
|
|
2763
|
+
}
|
|
2764
|
+
/** Logs a failed settle; also used when the handshake fails before any race. */ fail(error) {
|
|
2765
|
+
const details = getSignErrorDetails(error);
|
|
2766
|
+
const relayFailed = this.raceWinner === 'relay_sign';
|
|
2767
|
+
// Only a server response, the SSE error event or a delivered room proves the backend was reached.
|
|
2768
|
+
const backendReached = relayFailed || this.roomReadyAt !== undefined || this.serverError !== undefined && error === this.serverError || details.errorStatus !== undefined;
|
|
2769
|
+
let outcome = relayFailed ? 'relay_error' : backendReached ? 'server_error' : 'transport_error';
|
|
2770
|
+
if (isTimeout(details)) {
|
|
2771
|
+
outcome = 'timeout';
|
|
2772
|
+
}
|
|
2773
|
+
const failurePhase = relayFailed ? 'mpc_sign' : backendReached ? 'backend_sign' : 'transport';
|
|
2774
|
+
this.logger.error(`${this.eventPrefix} settled`, _extends({}, this.buildFields(), details, {
|
|
2775
|
+
outcome,
|
|
2776
|
+
backendReached,
|
|
2777
|
+
failurePhase
|
|
2778
|
+
}), toLoggableSignError(error));
|
|
2779
|
+
}
|
|
2780
|
+
async trackRelaySign(startRelaySign) {
|
|
2781
|
+
this.relayStartedAt = Date.now();
|
|
2782
|
+
const stallTimer = setTimeout(()=>{
|
|
2783
|
+
var _this_relayStartedAt;
|
|
2784
|
+
this.logger.warn(`${this.eventPrefix} relay sign still in flight`, _extends({}, this.context, {
|
|
2785
|
+
sdkVersion: version,
|
|
2786
|
+
elapsedMs: Date.now() - ((_this_relayStartedAt = this.relayStartedAt) != null ? _this_relayStartedAt : this.startedAt),
|
|
2787
|
+
stallWarnMs: this.stallWarnMs
|
|
2788
|
+
}));
|
|
2789
|
+
}, this.stallWarnMs);
|
|
2790
|
+
// Never keep the host process alive just to warn.
|
|
2791
|
+
stallTimer.unref == null ? void 0 : stallTimer.unref.call(stallTimer);
|
|
2792
|
+
let relayOutcome = 'error';
|
|
2793
|
+
try {
|
|
2794
|
+
const result = await startRelaySign();
|
|
2795
|
+
relayOutcome = 'signed';
|
|
2796
|
+
return result;
|
|
2797
|
+
} finally{
|
|
2798
|
+
clearTimeout(stallTimer);
|
|
2799
|
+
this.relaySettledAt = Date.now();
|
|
2800
|
+
if (this.raceWinner === 'sse_error') {
|
|
2801
|
+
this.logger.info(`${this.eventPrefix} relay sign settled after race lost`, _extends({}, this.buildFields(), {
|
|
2802
|
+
relayOutcome
|
|
2803
|
+
}));
|
|
2804
|
+
}
|
|
2805
|
+
}
|
|
2806
|
+
}
|
|
2807
|
+
buildFields() {
|
|
2808
|
+
const { roomReadyAt, relayStartedAt, relaySettledAt, startedAt } = this;
|
|
2809
|
+
return _extends({}, this.context, {
|
|
2810
|
+
sdkVersion: version
|
|
2811
|
+
}, roomReadyAt !== undefined ? {
|
|
2812
|
+
roomReadyMs: roomReadyAt - startedAt
|
|
2813
|
+
} : {}, relayStartedAt !== undefined && relaySettledAt !== undefined ? {
|
|
2814
|
+
relaySignMs: relaySettledAt - relayStartedAt
|
|
2815
|
+
} : {}, relayStartedAt !== undefined ? {
|
|
2816
|
+
relaySettled: relaySettledAt !== undefined
|
|
2817
|
+
} : {}, {
|
|
2818
|
+
durationMs: Date.now() - startedAt
|
|
2819
|
+
}, this.raceWinner ? {
|
|
2820
|
+
raceWinner: this.raceWinner
|
|
2821
|
+
} : {});
|
|
2822
|
+
}
|
|
2823
|
+
constructor(logger, eventPrefix, context, stallWarnMs = RELAY_SIGN_STALL_WARN_MS){
|
|
2824
|
+
this.logger = logger;
|
|
2825
|
+
this.eventPrefix = eventPrefix;
|
|
2826
|
+
this.stallWarnMs = stallWarnMs;
|
|
2827
|
+
this.startedAt = Date.now();
|
|
2828
|
+
this.context = _extends({}, context);
|
|
2829
|
+
}
|
|
2830
|
+
}
|
|
2831
|
+
|
|
2832
|
+
const dynamicDelegatedSign = async (client, { walletId, shareSetId, message, isFormatted, walletApiKey, onError, context, dynamicRequestId = uuid.v4(), traceContext })=>{
|
|
2696
2833
|
// Convert message to hex if it's a Uint8Array
|
|
2697
2834
|
if (typeof message !== 'string') {
|
|
2698
2835
|
message = '0x' + Buffer.from(message).toString('hex');
|
|
2699
2836
|
}
|
|
2700
2837
|
const apiClient = createDelegatedApiClientWithWalletKey(client, walletApiKey);
|
|
2701
|
-
const data = await apiClient.delegatedSignMessage({
|
|
2838
|
+
const data = await apiClient.delegatedSignMessage(_extends({
|
|
2702
2839
|
walletId,
|
|
2703
2840
|
shareSetId,
|
|
2704
2841
|
message,
|
|
@@ -2706,22 +2843,18 @@ const dynamicDelegatedSign = async (client, { walletId, shareSetId, message, isF
|
|
|
2706
2843
|
dynamicRequestId,
|
|
2707
2844
|
onError,
|
|
2708
2845
|
context: context ? JSON.parse(JSON.stringify(context, (_key, value)=>typeof value === 'bigint' ? String(value) : value)) : undefined
|
|
2709
|
-
}
|
|
2846
|
+
}, traceContext ? {
|
|
2847
|
+
traceContext
|
|
2848
|
+
} : {}));
|
|
2710
2849
|
return data;
|
|
2711
2850
|
};
|
|
2712
|
-
const
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
const signature = await mpcSigner.sign(roomId, keyShare, formattedMessage, derivationPath);
|
|
2720
|
-
return signature;
|
|
2721
|
-
} catch (error) {
|
|
2722
|
-
client.logger.error('Error in delegatedSign', error);
|
|
2723
|
-
throw error;
|
|
2724
|
-
}
|
|
2851
|
+
const signWithRelay = async (client, { chainName, message, roomId, keyShare, derivationPath, isFormatted })=>{
|
|
2852
|
+
const mpcSigner = getMPCSigner({
|
|
2853
|
+
chainName,
|
|
2854
|
+
baseRelayUrl: client.baseMPCRelayApiUrl
|
|
2855
|
+
});
|
|
2856
|
+
const formattedMessage = isFormatted ? new node.MessageHash(message) : formatMessage(chainName, message);
|
|
2857
|
+
return mpcSigner.sign(roomId, keyShare, formattedMessage, derivationPath);
|
|
2725
2858
|
};
|
|
2726
2859
|
const delegatedSignMessage = async (client, { walletId, shareSetId, walletApiKey, keyShare, message, chainName, derivationPath, isFormatted = false, onError, context })=>{
|
|
2727
2860
|
if (!walletId) {
|
|
@@ -2741,38 +2874,53 @@ const delegatedSignMessage = async (client, { walletId, shareSetId, walletApiKey
|
|
|
2741
2874
|
// through onError. Feed it into a gate raced against the relay join so a
|
|
2742
2875
|
// rejection throws immediately instead of hanging until the relay timeout.
|
|
2743
2876
|
const sseErrorGate = core$1.createRejectablePromise();
|
|
2744
|
-
const
|
|
2877
|
+
const dynamicRequestId = uuid.v4();
|
|
2878
|
+
// W3C trace ids are 32 hex chars; the server drops anything else.
|
|
2879
|
+
const traceId = uuid.v4().replaceAll('-', '');
|
|
2880
|
+
const telemetry = new SignRaceTelemetry(client.logger, '[WaasDelegatedSign]', {
|
|
2881
|
+
operation: 'delegated_sign',
|
|
2882
|
+
chain: chainName,
|
|
2745
2883
|
walletId,
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
isFormatted,
|
|
2750
|
-
onError: (error)=>{
|
|
2751
|
-
sseErrorGate.reject(error);
|
|
2752
|
-
onError == null ? void 0 : onError(error);
|
|
2753
|
-
},
|
|
2754
|
-
context
|
|
2884
|
+
environmentId: client.environmentId,
|
|
2885
|
+
dynamicRequestId,
|
|
2886
|
+
traceId
|
|
2755
2887
|
});
|
|
2888
|
+
let data;
|
|
2889
|
+
try {
|
|
2890
|
+
data = await dynamicDelegatedSign(client, {
|
|
2891
|
+
walletId,
|
|
2892
|
+
shareSetId,
|
|
2893
|
+
walletApiKey,
|
|
2894
|
+
message,
|
|
2895
|
+
isFormatted,
|
|
2896
|
+
onError: (error)=>{
|
|
2897
|
+
telemetry.recordServerError(error);
|
|
2898
|
+
sseErrorGate.reject(error);
|
|
2899
|
+
onError == null ? void 0 : onError(error);
|
|
2900
|
+
},
|
|
2901
|
+
context,
|
|
2902
|
+
dynamicRequestId,
|
|
2903
|
+
traceContext: {
|
|
2904
|
+
traceId,
|
|
2905
|
+
startTime: Date.now()
|
|
2906
|
+
}
|
|
2907
|
+
});
|
|
2908
|
+
} catch (error) {
|
|
2909
|
+
telemetry.fail(error);
|
|
2910
|
+
throw error;
|
|
2911
|
+
}
|
|
2912
|
+
telemetry.markRoomReady(data.roomId);
|
|
2756
2913
|
// The wallet's pubkey was derived along the chain default at keygen,
|
|
2757
2914
|
// so signing with anything else produces a non-verifying signature.
|
|
2758
2915
|
const resolvedDerivationPath = derivationPath != null ? derivationPath : new Uint32Array(core$1.getMPCChainConfig(chainName).derivationPath);
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
// The losing branch's rejection (e.g. the relay timeout after a policy
|
|
2768
|
-
// denial already won the race) must not surface as unhandled.
|
|
2769
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
2770
|
-
signPromise.catch(()=>{});
|
|
2771
|
-
const signature = await Promise.race([
|
|
2772
|
-
signPromise,
|
|
2773
|
-
sseErrorGate.promise
|
|
2774
|
-
]);
|
|
2775
|
-
return signature;
|
|
2916
|
+
return telemetry.race(()=>signWithRelay(client, {
|
|
2917
|
+
chainName,
|
|
2918
|
+
message,
|
|
2919
|
+
roomId: data.roomId,
|
|
2920
|
+
keyShare,
|
|
2921
|
+
derivationPath: resolvedDerivationPath,
|
|
2922
|
+
isFormatted
|
|
2923
|
+
}), sseErrorGate.promise);
|
|
2776
2924
|
};
|
|
2777
2925
|
|
|
2778
2926
|
// TODO: wire to apiClient.revokeDelegation once the server method ships.
|
package/index.esm.js
CHANGED
|
@@ -88,7 +88,7 @@ function _object_without_properties_loose(source, excluded) {
|
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
var version = "1.1.
|
|
91
|
+
var version = "1.1.70";
|
|
92
92
|
|
|
93
93
|
const MAX_CAUSE_CHAIN_LENGTH = 4;
|
|
94
94
|
const SAFE_ERROR_NAME_PATTERN = /^[A-Za-z][A-Za-z0-9_.-]{0,63}$/;
|
|
@@ -2691,14 +2691,151 @@ const createDelegatedWalletClient = ({ environmentId, baseApiUrl, baseMPCRelayAp
|
|
|
2691
2691
|
return client;
|
|
2692
2692
|
};
|
|
2693
2693
|
|
|
2694
|
-
|
|
2695
|
-
|
|
2694
|
+
// Matches wallet-service's [WaasStall] threshold.
|
|
2695
|
+
const RELAY_SIGN_STALL_WARN_MS = 10000;
|
|
2696
|
+
const MAX_ERROR_MESSAGE_LENGTH = 200;
|
|
2697
|
+
const TIMEOUT_PATTERN = /timed?[\s_-]?out/i;
|
|
2698
|
+
const JWT_PATTERN = /eyJ[\w-]+\.[\w-]+\.[\w-]*/g;
|
|
2699
|
+
const HEX_PATTERN = /(?:0x)?[0-9a-fA-F]{32,}/g;
|
|
2700
|
+
const OPAQUE_TOKEN_PATTERN = /[A-Za-z0-9+/_-]{40,}={0,2}/g;
|
|
2701
|
+
// Error codes are short enums (e.g. policy_violation); anything else is dropped.
|
|
2702
|
+
const SAFE_ERROR_CODE_PATTERN = /^[A-Za-z0-9_.:-]{1,64}$/;
|
|
2703
|
+
/** Strips anything token-, key- or payload-shaped and caps length. */ const sanitizeErrorMessage = (message)=>message.replace(JWT_PATTERN, '[redacted]').replace(HEX_PATTERN, '[redacted]').replace(OPAQUE_TOKEN_PATTERN, '[redacted]').slice(0, MAX_ERROR_MESSAGE_LENGTH);
|
|
2704
|
+
const getSignErrorDetails = (error)=>{
|
|
2705
|
+
if (!(error instanceof Error)) {
|
|
2706
|
+
return {
|
|
2707
|
+
errorMessage: sanitizeErrorMessage(String(error))
|
|
2708
|
+
};
|
|
2709
|
+
}
|
|
2710
|
+
const { code, status, response } = error;
|
|
2711
|
+
const errorStatus = typeof status === 'number' ? status : response == null ? void 0 : response.status;
|
|
2712
|
+
return _extends({
|
|
2713
|
+
errorMessage: sanitizeErrorMessage(error.message)
|
|
2714
|
+
}, typeof code === 'string' && SAFE_ERROR_CODE_PATTERN.test(code) ? {
|
|
2715
|
+
errorCode: code
|
|
2716
|
+
} : {}, typeof errorStatus === 'number' ? {
|
|
2717
|
+
errorStatus
|
|
2718
|
+
} : {});
|
|
2719
|
+
};
|
|
2720
|
+
/** A copy carrying only name and sanitized message: raw axios errors hold request headers (wallet API key). */ const toLoggableSignError = (error)=>{
|
|
2721
|
+
const safe = new Error(getSignErrorDetails(error).errorMessage);
|
|
2722
|
+
if (error instanceof Error) {
|
|
2723
|
+
safe.name = error.name;
|
|
2724
|
+
}
|
|
2725
|
+
return safe;
|
|
2726
|
+
};
|
|
2727
|
+
const isTimeout = ({ errorMessage, errorCode })=>TIMEOUT_PATTERN.test(errorMessage) || errorCode !== undefined && TIMEOUT_PATTERN.test(errorCode);
|
|
2728
|
+
/**
|
|
2729
|
+
* Times an SSE-handshake + relay-sign ceremony and logs one settle event, so a
|
|
2730
|
+
* late relay join or a lost race is visible in client logs and forwarded errors.
|
|
2731
|
+
* Context must hold identifiers only — never key shares, messages, API keys or JWTs.
|
|
2732
|
+
*/ class SignRaceTelemetry {
|
|
2733
|
+
markRoomReady(roomId) {
|
|
2734
|
+
this.roomReadyAt = Date.now();
|
|
2735
|
+
this.context = _extends({}, this.context, {
|
|
2736
|
+
roomId
|
|
2737
|
+
});
|
|
2738
|
+
}
|
|
2739
|
+
recordServerError(error) {
|
|
2740
|
+
var _this_serverError;
|
|
2741
|
+
(_this_serverError = this.serverError) != null ? _this_serverError : this.serverError = error;
|
|
2742
|
+
}
|
|
2743
|
+
/** Races the relay sign against the SSE error gate, logging which branch won. */ async race(startRelaySign, serverErrorGate) {
|
|
2744
|
+
const relaySign = this.trackRelaySign(startRelaySign);
|
|
2745
|
+
// The losing branch's rejection must not surface as unhandled.
|
|
2746
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
2747
|
+
relaySign.catch(()=>{});
|
|
2748
|
+
try {
|
|
2749
|
+
const result = await Promise.race([
|
|
2750
|
+
relaySign,
|
|
2751
|
+
serverErrorGate
|
|
2752
|
+
]);
|
|
2753
|
+
this.raceWinner = 'relay_sign';
|
|
2754
|
+
this.logger.info(`${this.eventPrefix} settled`, _extends({}, this.buildFields(), {
|
|
2755
|
+
outcome: 'signed'
|
|
2756
|
+
}));
|
|
2757
|
+
return result;
|
|
2758
|
+
} catch (error) {
|
|
2759
|
+
this.raceWinner = error === this.serverError ? 'sse_error' : 'relay_sign';
|
|
2760
|
+
this.fail(error);
|
|
2761
|
+
throw error;
|
|
2762
|
+
}
|
|
2763
|
+
}
|
|
2764
|
+
/** Logs a failed settle; also used when the handshake fails before any race. */ fail(error) {
|
|
2765
|
+
const details = getSignErrorDetails(error);
|
|
2766
|
+
const relayFailed = this.raceWinner === 'relay_sign';
|
|
2767
|
+
// Only a server response, the SSE error event or a delivered room proves the backend was reached.
|
|
2768
|
+
const backendReached = relayFailed || this.roomReadyAt !== undefined || this.serverError !== undefined && error === this.serverError || details.errorStatus !== undefined;
|
|
2769
|
+
let outcome = relayFailed ? 'relay_error' : backendReached ? 'server_error' : 'transport_error';
|
|
2770
|
+
if (isTimeout(details)) {
|
|
2771
|
+
outcome = 'timeout';
|
|
2772
|
+
}
|
|
2773
|
+
const failurePhase = relayFailed ? 'mpc_sign' : backendReached ? 'backend_sign' : 'transport';
|
|
2774
|
+
this.logger.error(`${this.eventPrefix} settled`, _extends({}, this.buildFields(), details, {
|
|
2775
|
+
outcome,
|
|
2776
|
+
backendReached,
|
|
2777
|
+
failurePhase
|
|
2778
|
+
}), toLoggableSignError(error));
|
|
2779
|
+
}
|
|
2780
|
+
async trackRelaySign(startRelaySign) {
|
|
2781
|
+
this.relayStartedAt = Date.now();
|
|
2782
|
+
const stallTimer = setTimeout(()=>{
|
|
2783
|
+
var _this_relayStartedAt;
|
|
2784
|
+
this.logger.warn(`${this.eventPrefix} relay sign still in flight`, _extends({}, this.context, {
|
|
2785
|
+
sdkVersion: version,
|
|
2786
|
+
elapsedMs: Date.now() - ((_this_relayStartedAt = this.relayStartedAt) != null ? _this_relayStartedAt : this.startedAt),
|
|
2787
|
+
stallWarnMs: this.stallWarnMs
|
|
2788
|
+
}));
|
|
2789
|
+
}, this.stallWarnMs);
|
|
2790
|
+
// Never keep the host process alive just to warn.
|
|
2791
|
+
stallTimer.unref == null ? void 0 : stallTimer.unref.call(stallTimer);
|
|
2792
|
+
let relayOutcome = 'error';
|
|
2793
|
+
try {
|
|
2794
|
+
const result = await startRelaySign();
|
|
2795
|
+
relayOutcome = 'signed';
|
|
2796
|
+
return result;
|
|
2797
|
+
} finally{
|
|
2798
|
+
clearTimeout(stallTimer);
|
|
2799
|
+
this.relaySettledAt = Date.now();
|
|
2800
|
+
if (this.raceWinner === 'sse_error') {
|
|
2801
|
+
this.logger.info(`${this.eventPrefix} relay sign settled after race lost`, _extends({}, this.buildFields(), {
|
|
2802
|
+
relayOutcome
|
|
2803
|
+
}));
|
|
2804
|
+
}
|
|
2805
|
+
}
|
|
2806
|
+
}
|
|
2807
|
+
buildFields() {
|
|
2808
|
+
const { roomReadyAt, relayStartedAt, relaySettledAt, startedAt } = this;
|
|
2809
|
+
return _extends({}, this.context, {
|
|
2810
|
+
sdkVersion: version
|
|
2811
|
+
}, roomReadyAt !== undefined ? {
|
|
2812
|
+
roomReadyMs: roomReadyAt - startedAt
|
|
2813
|
+
} : {}, relayStartedAt !== undefined && relaySettledAt !== undefined ? {
|
|
2814
|
+
relaySignMs: relaySettledAt - relayStartedAt
|
|
2815
|
+
} : {}, relayStartedAt !== undefined ? {
|
|
2816
|
+
relaySettled: relaySettledAt !== undefined
|
|
2817
|
+
} : {}, {
|
|
2818
|
+
durationMs: Date.now() - startedAt
|
|
2819
|
+
}, this.raceWinner ? {
|
|
2820
|
+
raceWinner: this.raceWinner
|
|
2821
|
+
} : {});
|
|
2822
|
+
}
|
|
2823
|
+
constructor(logger, eventPrefix, context, stallWarnMs = RELAY_SIGN_STALL_WARN_MS){
|
|
2824
|
+
this.logger = logger;
|
|
2825
|
+
this.eventPrefix = eventPrefix;
|
|
2826
|
+
this.stallWarnMs = stallWarnMs;
|
|
2827
|
+
this.startedAt = Date.now();
|
|
2828
|
+
this.context = _extends({}, context);
|
|
2829
|
+
}
|
|
2830
|
+
}
|
|
2831
|
+
|
|
2832
|
+
const dynamicDelegatedSign = async (client, { walletId, shareSetId, message, isFormatted, walletApiKey, onError, context, dynamicRequestId = v4(), traceContext })=>{
|
|
2696
2833
|
// Convert message to hex if it's a Uint8Array
|
|
2697
2834
|
if (typeof message !== 'string') {
|
|
2698
2835
|
message = '0x' + Buffer.from(message).toString('hex');
|
|
2699
2836
|
}
|
|
2700
2837
|
const apiClient = createDelegatedApiClientWithWalletKey(client, walletApiKey);
|
|
2701
|
-
const data = await apiClient.delegatedSignMessage({
|
|
2838
|
+
const data = await apiClient.delegatedSignMessage(_extends({
|
|
2702
2839
|
walletId,
|
|
2703
2840
|
shareSetId,
|
|
2704
2841
|
message,
|
|
@@ -2706,22 +2843,18 @@ const dynamicDelegatedSign = async (client, { walletId, shareSetId, message, isF
|
|
|
2706
2843
|
dynamicRequestId,
|
|
2707
2844
|
onError,
|
|
2708
2845
|
context: context ? JSON.parse(JSON.stringify(context, (_key, value)=>typeof value === 'bigint' ? String(value) : value)) : undefined
|
|
2709
|
-
}
|
|
2846
|
+
}, traceContext ? {
|
|
2847
|
+
traceContext
|
|
2848
|
+
} : {}));
|
|
2710
2849
|
return data;
|
|
2711
2850
|
};
|
|
2712
|
-
const
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
const signature = await mpcSigner.sign(roomId, keyShare, formattedMessage, derivationPath);
|
|
2720
|
-
return signature;
|
|
2721
|
-
} catch (error) {
|
|
2722
|
-
client.logger.error('Error in delegatedSign', error);
|
|
2723
|
-
throw error;
|
|
2724
|
-
}
|
|
2851
|
+
const signWithRelay = async (client, { chainName, message, roomId, keyShare, derivationPath, isFormatted })=>{
|
|
2852
|
+
const mpcSigner = getMPCSigner({
|
|
2853
|
+
chainName,
|
|
2854
|
+
baseRelayUrl: client.baseMPCRelayApiUrl
|
|
2855
|
+
});
|
|
2856
|
+
const formattedMessage = isFormatted ? new MessageHash(message) : formatMessage(chainName, message);
|
|
2857
|
+
return mpcSigner.sign(roomId, keyShare, formattedMessage, derivationPath);
|
|
2725
2858
|
};
|
|
2726
2859
|
const delegatedSignMessage = async (client, { walletId, shareSetId, walletApiKey, keyShare, message, chainName, derivationPath, isFormatted = false, onError, context })=>{
|
|
2727
2860
|
if (!walletId) {
|
|
@@ -2741,38 +2874,53 @@ const delegatedSignMessage = async (client, { walletId, shareSetId, walletApiKey
|
|
|
2741
2874
|
// through onError. Feed it into a gate raced against the relay join so a
|
|
2742
2875
|
// rejection throws immediately instead of hanging until the relay timeout.
|
|
2743
2876
|
const sseErrorGate = createRejectablePromise();
|
|
2744
|
-
const
|
|
2877
|
+
const dynamicRequestId = v4();
|
|
2878
|
+
// W3C trace ids are 32 hex chars; the server drops anything else.
|
|
2879
|
+
const traceId = v4().replaceAll('-', '');
|
|
2880
|
+
const telemetry = new SignRaceTelemetry(client.logger, '[WaasDelegatedSign]', {
|
|
2881
|
+
operation: 'delegated_sign',
|
|
2882
|
+
chain: chainName,
|
|
2745
2883
|
walletId,
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
isFormatted,
|
|
2750
|
-
onError: (error)=>{
|
|
2751
|
-
sseErrorGate.reject(error);
|
|
2752
|
-
onError == null ? void 0 : onError(error);
|
|
2753
|
-
},
|
|
2754
|
-
context
|
|
2884
|
+
environmentId: client.environmentId,
|
|
2885
|
+
dynamicRequestId,
|
|
2886
|
+
traceId
|
|
2755
2887
|
});
|
|
2888
|
+
let data;
|
|
2889
|
+
try {
|
|
2890
|
+
data = await dynamicDelegatedSign(client, {
|
|
2891
|
+
walletId,
|
|
2892
|
+
shareSetId,
|
|
2893
|
+
walletApiKey,
|
|
2894
|
+
message,
|
|
2895
|
+
isFormatted,
|
|
2896
|
+
onError: (error)=>{
|
|
2897
|
+
telemetry.recordServerError(error);
|
|
2898
|
+
sseErrorGate.reject(error);
|
|
2899
|
+
onError == null ? void 0 : onError(error);
|
|
2900
|
+
},
|
|
2901
|
+
context,
|
|
2902
|
+
dynamicRequestId,
|
|
2903
|
+
traceContext: {
|
|
2904
|
+
traceId,
|
|
2905
|
+
startTime: Date.now()
|
|
2906
|
+
}
|
|
2907
|
+
});
|
|
2908
|
+
} catch (error) {
|
|
2909
|
+
telemetry.fail(error);
|
|
2910
|
+
throw error;
|
|
2911
|
+
}
|
|
2912
|
+
telemetry.markRoomReady(data.roomId);
|
|
2756
2913
|
// The wallet's pubkey was derived along the chain default at keygen,
|
|
2757
2914
|
// so signing with anything else produces a non-verifying signature.
|
|
2758
2915
|
const resolvedDerivationPath = derivationPath != null ? derivationPath : new Uint32Array(getMPCChainConfig(chainName).derivationPath);
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
// The losing branch's rejection (e.g. the relay timeout after a policy
|
|
2768
|
-
// denial already won the race) must not surface as unhandled.
|
|
2769
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
2770
|
-
signPromise.catch(()=>{});
|
|
2771
|
-
const signature = await Promise.race([
|
|
2772
|
-
signPromise,
|
|
2773
|
-
sseErrorGate.promise
|
|
2774
|
-
]);
|
|
2775
|
-
return signature;
|
|
2916
|
+
return telemetry.race(()=>signWithRelay(client, {
|
|
2917
|
+
chainName,
|
|
2918
|
+
message,
|
|
2919
|
+
roomId: data.roomId,
|
|
2920
|
+
keyShare,
|
|
2921
|
+
derivationPath: resolvedDerivationPath,
|
|
2922
|
+
isFormatted
|
|
2923
|
+
}), sseErrorGate.promise);
|
|
2776
2924
|
};
|
|
2777
2925
|
|
|
2778
2926
|
// TODO: wire to apiClient.revokeDelegation once the server method ships.
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs-wallet/node",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.70",
|
|
4
4
|
"license": "Licensed under the Dynamic Labs, Inc. Terms Of Service (https://www.dynamic.xyz/terms-conditions)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@dynamic-labs-wallet/core": "1.1.
|
|
7
|
+
"@dynamic-labs-wallet/core": "1.1.70",
|
|
8
8
|
"@dynamic-labs-wallet/forward-mpc-client": "2.0.2",
|
|
9
|
-
"@dynamic-labs-wallet/primitives": "1.1.
|
|
9
|
+
"@dynamic-labs-wallet/primitives": "1.1.70",
|
|
10
10
|
"@dynamic-labs/logger": "^5.9.4",
|
|
11
|
-
"@dynamic-labs/sdk-api-core": "0.
|
|
11
|
+
"@dynamic-labs/sdk-api-core": "0.167.0",
|
|
12
12
|
"uuid": "11.1.1",
|
|
13
13
|
"@noble/hashes": "1.7.1"
|
|
14
14
|
},
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { EcdsaSignature } from '#internal/node';
|
|
2
|
-
import { type SignMessageContext } from '@dynamic-labs-wallet/core';
|
|
2
|
+
import { type SignMessageContext, type TraceContext } from '@dynamic-labs-wallet/core';
|
|
3
3
|
import type { ServerKeyShare } from '../../mpc/types.js';
|
|
4
4
|
import type { DelegatedWalletClient } from '../createDelegatedClient.js';
|
|
5
|
-
export declare const dynamicDelegatedSign: (client: DelegatedWalletClient, { walletId, shareSetId, message, isFormatted, walletApiKey, onError, context, }: {
|
|
5
|
+
export declare const dynamicDelegatedSign: (client: DelegatedWalletClient, { walletId, shareSetId, message, isFormatted, walletApiKey, onError, context, dynamicRequestId, traceContext, }: {
|
|
6
6
|
walletId: string;
|
|
7
7
|
/**
|
|
8
8
|
* Optional. The `shareSetId` from the `wallet.delegation.created`
|
|
@@ -17,15 +17,18 @@ export declare const dynamicDelegatedSign: (client: DelegatedWalletClient, { wal
|
|
|
17
17
|
walletApiKey: string;
|
|
18
18
|
onError?: (error: Error) => void;
|
|
19
19
|
context?: SignMessageContext;
|
|
20
|
+
dynamicRequestId?: string;
|
|
21
|
+
traceContext?: TraceContext;
|
|
20
22
|
}) => Promise<import("@dynamic-labs/sdk-api-core").OpenRoomResponseWithServerKeygenIds>;
|
|
21
|
-
|
|
23
|
+
type RelaySignParams = {
|
|
22
24
|
chainName: string;
|
|
23
25
|
message: string | Uint8Array;
|
|
24
26
|
roomId: string;
|
|
25
27
|
keyShare: ServerKeyShare;
|
|
26
28
|
derivationPath: Uint32Array | undefined;
|
|
27
29
|
isFormatted?: boolean;
|
|
28
|
-
}
|
|
30
|
+
};
|
|
31
|
+
export declare const delegatedSign: (client: DelegatedWalletClient, params: RelaySignParams) => Promise<Uint8Array | EcdsaSignature>;
|
|
29
32
|
export declare const delegatedSignMessage: (client: DelegatedWalletClient, { walletId, shareSetId, walletApiKey, keyShare, message, chainName, derivationPath, isFormatted, onError, context, }: {
|
|
30
33
|
walletId: string;
|
|
31
34
|
/**
|
|
@@ -45,4 +48,5 @@ export declare const delegatedSignMessage: (client: DelegatedWalletClient, { wal
|
|
|
45
48
|
onError?: (error: Error) => void;
|
|
46
49
|
context?: SignMessageContext;
|
|
47
50
|
}) => Promise<Uint8Array | EcdsaSignature>;
|
|
51
|
+
export {};
|
|
48
52
|
//# sourceMappingURL=sign.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sign.d.ts","sourceRoot":"","sources":["../../../src/delegatedClient/modules/sign.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD,OAAO,
|
|
1
|
+
{"version":3,"file":"sign.d.ts","sourceRoot":"","sources":["../../../src/delegatedClient/modules/sign.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD,OAAO,EAGL,KAAK,kBAAkB,EACvB,KAAK,YAAY,EAClB,MAAM,2BAA2B,CAAC;AAInC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGzD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAEzE,eAAO,MAAM,oBAAoB,WACvB,qBAAqB,mHAW1B;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,GAAG,UAAU,CAAC;IAC7B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,OAAO,CAAC,EAAE,kBAAkB,CAAC;IAC7B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,YAAY,CAAC;CAC7B,sFAsBF,CAAC;AAEF,KAAK,eAAe,GAAG;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,GAAG,UAAU,CAAC;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,cAAc,CAAC;IACzB,cAAc,EAAE,WAAW,GAAG,SAAS,CAAC;IACxC,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAgBF,eAAO,MAAM,aAAa,WAChB,qBAAqB,UACrB,eAAe,KACtB,OAAO,CAAC,UAAU,GAAG,cAAc,CAOrC,CAAC;AAEF,eAAO,MAAM,oBAAoB,WACvB,qBAAqB,wHAY1B;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,cAAc,CAAC;IACzB,OAAO,EAAE,MAAM,GAAG,UAAU,CAAC;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,WAAW,CAAC;IAC7B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,OAAO,CAAC,EAAE,kBAAkB,CAAC;CAC9B,KACA,OAAO,CAAC,UAAU,GAAG,cAAc,CAsErC,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { ILogger } from '@dynamic-labs-wallet/core';
|
|
2
|
+
export type SignOutcome = 'signed' | 'server_error' | 'relay_error' | 'transport_error' | 'timeout';
|
|
3
|
+
export type SignRaceWinner = 'relay_sign' | 'sse_error';
|
|
4
|
+
export declare const RELAY_SIGN_STALL_WARN_MS = 10000;
|
|
5
|
+
/** Strips anything token-, key- or payload-shaped and caps length. */
|
|
6
|
+
export declare const sanitizeErrorMessage: (message: string) => string;
|
|
7
|
+
type ErrorDetails = {
|
|
8
|
+
errorMessage: string;
|
|
9
|
+
errorCode?: string;
|
|
10
|
+
errorStatus?: number;
|
|
11
|
+
};
|
|
12
|
+
export declare const getSignErrorDetails: (error: unknown) => ErrorDetails;
|
|
13
|
+
/** A copy carrying only name and sanitized message: raw axios errors hold request headers (wallet API key). */
|
|
14
|
+
export declare const toLoggableSignError: (error: unknown) => Error;
|
|
15
|
+
/**
|
|
16
|
+
* Times an SSE-handshake + relay-sign ceremony and logs one settle event, so a
|
|
17
|
+
* late relay join or a lost race is visible in client logs and forwarded errors.
|
|
18
|
+
* Context must hold identifiers only — never key shares, messages, API keys or JWTs.
|
|
19
|
+
*/
|
|
20
|
+
export declare class SignRaceTelemetry {
|
|
21
|
+
private readonly logger;
|
|
22
|
+
private readonly eventPrefix;
|
|
23
|
+
private readonly stallWarnMs;
|
|
24
|
+
private readonly startedAt;
|
|
25
|
+
private roomReadyAt?;
|
|
26
|
+
private relayStartedAt?;
|
|
27
|
+
private relaySettledAt?;
|
|
28
|
+
private serverError?;
|
|
29
|
+
private raceWinner?;
|
|
30
|
+
private context;
|
|
31
|
+
constructor(logger: ILogger, eventPrefix: string, context: Record<string, unknown>, stallWarnMs?: number);
|
|
32
|
+
markRoomReady(roomId: string): void;
|
|
33
|
+
recordServerError(error: Error): void;
|
|
34
|
+
/** Races the relay sign against the SSE error gate, logging which branch won. */
|
|
35
|
+
race<T>(startRelaySign: () => Promise<T>, serverErrorGate: Promise<never>): Promise<T>;
|
|
36
|
+
/** Logs a failed settle; also used when the handshake fails before any race. */
|
|
37
|
+
fail(error: unknown): void;
|
|
38
|
+
private trackRelaySign;
|
|
39
|
+
private buildFields;
|
|
40
|
+
}
|
|
41
|
+
export {};
|
|
42
|
+
//# sourceMappingURL=signRaceTelemetry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signRaceTelemetry.d.ts","sourceRoot":"","sources":["../../src/observability/signRaceTelemetry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAGzD,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,cAAc,GAAG,aAAa,GAAG,iBAAiB,GAAG,SAAS,CAAC;AACpG,MAAM,MAAM,cAAc,GAAG,YAAY,GAAG,WAAW,CAAC;AAGxD,eAAO,MAAM,wBAAwB,QAAS,CAAC;AAU/C,sEAAsE;AACtE,eAAO,MAAM,oBAAoB,YAAa,MAAM,KAAG,MAKhB,CAAC;AAExC,KAAK,YAAY,GAAG;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEvF,eAAO,MAAM,mBAAmB,UAAW,OAAO,KAAG,YAepD,CAAC;AAEF,+GAA+G;AAC/G,eAAO,MAAM,mBAAmB,UAAW,OAAO,KAAG,KAMpD,CAAC;AAKF;;;;GAIG;AACH,qBAAa,iBAAiB;IAU1B,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,WAAW;IAE5B,OAAO,CAAC,QAAQ,CAAC,WAAW;IAZ9B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAc;IACxC,OAAO,CAAC,WAAW,CAAC,CAAS;IAC7B,OAAO,CAAC,cAAc,CAAC,CAAS;IAChC,OAAO,CAAC,cAAc,CAAC,CAAS;IAChC,OAAO,CAAC,WAAW,CAAC,CAAQ;IAC5B,OAAO,CAAC,UAAU,CAAC,CAAiB;IACpC,OAAO,CAAC,OAAO,CAA0B;gBAGtB,MAAM,EAAE,OAAO,EACf,WAAW,EAAE,MAAM,EACpC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACf,WAAW,GAAE,MAAiC;IAKjE,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAKnC,iBAAiB,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IAIrC,iFAAiF;IAC3E,IAAI,CAAC,CAAC,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EAAE,eAAe,EAAE,OAAO,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IAkB5F,gFAAgF;IAChF,IAAI,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI;YAqBZ,cAAc;IA8B5B,OAAO,CAAC,WAAW;CAcpB"}
|