@dynamic-labs-wallet/core 0.0.322 → 0.0.324
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.js +101 -18
- package/index.esm.js +101 -18
- package/package.json +2 -2
- package/src/api/api.d.ts +195 -0
- package/src/api/api.d.ts.map +1 -0
- package/src/api/client.d.ts +30 -0
- package/src/api/client.d.ts.map +1 -0
- package/src/api/index.d.ts +2 -0
- package/src/api/index.d.ts.map +1 -0
- package/src/constants.d.ts +130 -0
- package/src/constants.d.ts.map +1 -0
- package/src/eventStream/utils.d.ts +57 -0
- package/src/eventStream/utils.d.ts.map +1 -0
- package/src/index.d.ts +8 -0
- package/src/index.d.ts.map +1 -0
- package/src/mpc/constants.d.ts +51 -0
- package/src/mpc/constants.d.ts.map +1 -0
- package/src/mpc/index.d.ts +3 -0
- package/src/mpc/index.d.ts.map +1 -0
- package/src/mpc/utils.d.ts +75 -0
- package/src/mpc/utils.d.ts.map +1 -0
- package/src/services/axiosErrorResponse.d.ts +10 -0
- package/src/services/axiosErrorResponse.d.ts.map +1 -0
- package/src/services/logger.d.ts +19 -0
- package/src/services/logger.d.ts.map +1 -0
- package/src/types.d.ts +510 -0
- package/src/types.d.ts.map +1 -0
- package/src/utils/index.d.ts +4 -0
- package/src/utils/index.d.ts.map +1 -0
- package/src/utils/keyShare.d.ts +3 -0
- package/src/utils/keyShare.d.ts.map +1 -0
- package/src/utils/messageSerialization.d.ts +6 -0
- package/src/utils/messageSerialization.d.ts.map +1 -0
- package/src/utils/sdkVersion.d.ts +38 -0
- package/src/utils/sdkVersion.d.ts.map +1 -0
package/index.cjs.js
CHANGED
|
@@ -670,30 +670,72 @@ const getElapsedTime = (startTime)=>{
|
|
|
670
670
|
* @returns {function} A response handler function that processes the event stream
|
|
671
671
|
*/ const createSuccessErrorEventStreamHandler = ({ resolve, reject, successEventType, onError, onCeremonyComplete })=>{
|
|
672
672
|
return (response)=>{
|
|
673
|
+
// Reject immediately for non-2xx HTTP responses (e.g. 429 rate limit).
|
|
674
|
+
// With axios fetch adapter + responseType: 'stream', non-2xx responses
|
|
675
|
+
// may not be rejected automatically and arrive here as a stream of
|
|
676
|
+
// non-SSE content that would never parse into success/error events.
|
|
677
|
+
if (response.status && (response.status < 200 || response.status >= 300)) {
|
|
678
|
+
const error = new Error(`Request failed with status ${response.status}`);
|
|
679
|
+
reject(error);
|
|
680
|
+
onError == null ? void 0 : onError(error);
|
|
681
|
+
return;
|
|
682
|
+
}
|
|
673
683
|
const reader = response.data.getReader();
|
|
674
684
|
const decoder = new TextDecoder();
|
|
675
685
|
let buffer = '';
|
|
686
|
+
let settled = false;
|
|
687
|
+
const processEvents = (events)=>{
|
|
688
|
+
for (const event of events){
|
|
689
|
+
if (event.type === successEventType) {
|
|
690
|
+
settled = true;
|
|
691
|
+
resolve(event.data);
|
|
692
|
+
}
|
|
693
|
+
if (event.type === SuccessEventType.CeremonyComplete) {
|
|
694
|
+
const { accountAddress, walletId } = event.data;
|
|
695
|
+
onCeremonyComplete == null ? void 0 : onCeremonyComplete(accountAddress, walletId);
|
|
696
|
+
}
|
|
697
|
+
if (event.type === 'error') {
|
|
698
|
+
settled = true;
|
|
699
|
+
const error = createErrorFromEventData(event.data);
|
|
700
|
+
reject(error);
|
|
701
|
+
onError == null ? void 0 : onError(error);
|
|
702
|
+
return true;
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
return false;
|
|
706
|
+
};
|
|
676
707
|
const processStream = async ()=>{
|
|
677
708
|
try {
|
|
678
709
|
const { value, done } = await reader.read();
|
|
679
|
-
if (done)
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
for (const event of events){
|
|
685
|
-
if (event.type === successEventType) {
|
|
686
|
-
resolve(event.data);
|
|
687
|
-
}
|
|
688
|
-
if (event.type === SuccessEventType.CeremonyComplete) {
|
|
689
|
-
const { accountAddress, walletId } = event.data;
|
|
690
|
-
onCeremonyComplete == null ? void 0 : onCeremonyComplete(accountAddress, walletId);
|
|
710
|
+
if (done) {
|
|
711
|
+
// Flush any remaining data in the decoder
|
|
712
|
+
const remaining = decoder.decode();
|
|
713
|
+
if (remaining) {
|
|
714
|
+
buffer += remaining;
|
|
691
715
|
}
|
|
692
|
-
|
|
693
|
-
|
|
716
|
+
// Process any remaining complete events in the buffer
|
|
717
|
+
const { events } = parseEventStream(buffer);
|
|
718
|
+
processEvents(events);
|
|
719
|
+
// Stream ended without a success or error event — reject so the
|
|
720
|
+
// caller does not hang indefinitely.
|
|
721
|
+
if (!settled) {
|
|
722
|
+
const error = new Error('SSE stream ended without a success or error event');
|
|
694
723
|
reject(error);
|
|
695
724
|
onError == null ? void 0 : onError(error);
|
|
696
725
|
}
|
|
726
|
+
return;
|
|
727
|
+
}
|
|
728
|
+
buffer += decoder.decode(value, {
|
|
729
|
+
stream: true
|
|
730
|
+
});
|
|
731
|
+
const { events, remaining } = parseEventStream(buffer);
|
|
732
|
+
buffer = remaining;
|
|
733
|
+
const hadError = processEvents(events);
|
|
734
|
+
// Stop reading if an error event was processed.
|
|
735
|
+
// For success events, continue reading to allow subsequent
|
|
736
|
+
// events (like CeremonyComplete or error) to be processed.
|
|
737
|
+
if (hadError) {
|
|
738
|
+
return;
|
|
697
739
|
}
|
|
698
740
|
processStream();
|
|
699
741
|
} catch (err) {
|
|
@@ -717,15 +759,28 @@ const getElapsedTime = (startTime)=>{
|
|
|
717
759
|
};
|
|
718
760
|
/**
|
|
719
761
|
* Parses a Server-Sent Events (SSE) stream into structured event objects.
|
|
762
|
+
* Returns both the parsed events and any remaining unparsed data (incomplete events)
|
|
763
|
+
* so the caller can keep the unconsumed portion in its buffer.
|
|
764
|
+
*
|
|
765
|
+
* Events are only considered "consumed" once we see their terminating blank line.
|
|
766
|
+
* This handles the case where an event is split across multiple chunks:
|
|
767
|
+
* Chunk 1: "event:error\n"
|
|
768
|
+
* Chunk 2: "data:{...}\n\n"
|
|
769
|
+
* The first chunk returns no events and remaining="event:error\n".
|
|
770
|
+
* The second chunk (after buffer concatenation) returns the full event.
|
|
720
771
|
*
|
|
721
772
|
* @param input - Raw string data from an event stream
|
|
722
|
-
* @returns
|
|
773
|
+
* @returns Object with parsed events array and remaining unparsed string
|
|
723
774
|
*/ const parseEventStream = (input)=>{
|
|
724
775
|
const lines = input.split('\n');
|
|
725
776
|
const events = [];
|
|
726
777
|
let currentEvent = {};
|
|
727
778
|
let inEvent = false;
|
|
728
|
-
|
|
779
|
+
let lastConsumedIndex = 0;
|
|
780
|
+
let currentLineStart = 0;
|
|
781
|
+
for(let i = 0; i < lines.length; i++){
|
|
782
|
+
const line = lines[i];
|
|
783
|
+
const lineEnd = currentLineStart + line.length + (i < lines.length - 1 ? 1 : 0);
|
|
729
784
|
// Empty line marks the end of an event
|
|
730
785
|
if (line === '') {
|
|
731
786
|
if (currentEvent.type && currentEvent.data) {
|
|
@@ -733,9 +788,11 @@ const getElapsedTime = (startTime)=>{
|
|
|
733
788
|
type: currentEvent.type,
|
|
734
789
|
data: JSON.parse(currentEvent.data)
|
|
735
790
|
});
|
|
791
|
+
lastConsumedIndex = lineEnd;
|
|
736
792
|
currentEvent = {};
|
|
737
793
|
inEvent = false;
|
|
738
794
|
}
|
|
795
|
+
currentLineStart = lineEnd;
|
|
739
796
|
continue;
|
|
740
797
|
}
|
|
741
798
|
// Process event fields
|
|
@@ -748,11 +805,15 @@ const getElapsedTime = (startTime)=>{
|
|
|
748
805
|
} else if (inEvent && currentEvent.data) {
|
|
749
806
|
currentEvent.data += line;
|
|
750
807
|
}
|
|
808
|
+
currentLineStart = lineEnd;
|
|
751
809
|
}
|
|
752
|
-
return
|
|
810
|
+
return {
|
|
811
|
+
events,
|
|
812
|
+
remaining: input.substring(lastConsumedIndex)
|
|
813
|
+
};
|
|
753
814
|
};
|
|
754
815
|
|
|
755
|
-
var version = "0.0.
|
|
816
|
+
var version = "0.0.324";
|
|
756
817
|
|
|
757
818
|
class BaseClient {
|
|
758
819
|
get forwardMPCClient() {
|
|
@@ -1177,6 +1238,28 @@ class DynamicApiClient extends BaseClient {
|
|
|
1177
1238
|
});
|
|
1178
1239
|
return data;
|
|
1179
1240
|
}
|
|
1241
|
+
async requestSvmSponsoredTransaction({ transaction, traceContext }) {
|
|
1242
|
+
try {
|
|
1243
|
+
const { data } = await this.apiClient.post(`/api/v0/sdk/${this.environmentId}/solana/sponsorTransaction`, {
|
|
1244
|
+
transaction
|
|
1245
|
+
}, {
|
|
1246
|
+
headers: {
|
|
1247
|
+
[DynamicRequestIdHeader]: uuid.v4().replace('-', ''),
|
|
1248
|
+
[DynamicTraceIdHeader]: traceContext == null ? void 0 : traceContext.traceId,
|
|
1249
|
+
[DynamicTraceElapsedTimeHeader]: getElapsedTime(traceContext == null ? void 0 : traceContext.startTime)
|
|
1250
|
+
}
|
|
1251
|
+
});
|
|
1252
|
+
return data;
|
|
1253
|
+
} catch (error) {
|
|
1254
|
+
var _error_response, _error_response1;
|
|
1255
|
+
const status = error == null ? void 0 : (_error_response = error.response) == null ? void 0 : _error_response.status;
|
|
1256
|
+
const rawData = error == null ? void 0 : (_error_response1 = error.response) == null ? void 0 : _error_response1.data;
|
|
1257
|
+
var _rawData_error, _ref;
|
|
1258
|
+
const detail = (_ref = (_rawData_error = rawData == null ? void 0 : rawData.error) != null ? _rawData_error : typeof rawData === 'string' ? rawData : JSON.stringify(rawData)) != null ? _ref : error == null ? void 0 : error.message;
|
|
1259
|
+
const statusStr = status ? ` (${status})` : '';
|
|
1260
|
+
throw new Error(`SVM sponsorship failed${statusStr}: ${detail}`);
|
|
1261
|
+
}
|
|
1262
|
+
}
|
|
1180
1263
|
constructor({ environmentId, authToken, backupServiceAuthToken, baseApiUrl, authMode = AuthMode.HEADER, // Represents the version of the client SDK used by developer
|
|
1181
1264
|
sdkVersion, forwardMPCClient, baseClientKeysharesRelayApiUrl, logger }){
|
|
1182
1265
|
super({
|
package/index.esm.js
CHANGED
|
@@ -669,30 +669,72 @@ const getElapsedTime = (startTime)=>{
|
|
|
669
669
|
* @returns {function} A response handler function that processes the event stream
|
|
670
670
|
*/ const createSuccessErrorEventStreamHandler = ({ resolve, reject, successEventType, onError, onCeremonyComplete })=>{
|
|
671
671
|
return (response)=>{
|
|
672
|
+
// Reject immediately for non-2xx HTTP responses (e.g. 429 rate limit).
|
|
673
|
+
// With axios fetch adapter + responseType: 'stream', non-2xx responses
|
|
674
|
+
// may not be rejected automatically and arrive here as a stream of
|
|
675
|
+
// non-SSE content that would never parse into success/error events.
|
|
676
|
+
if (response.status && (response.status < 200 || response.status >= 300)) {
|
|
677
|
+
const error = new Error(`Request failed with status ${response.status}`);
|
|
678
|
+
reject(error);
|
|
679
|
+
onError == null ? void 0 : onError(error);
|
|
680
|
+
return;
|
|
681
|
+
}
|
|
672
682
|
const reader = response.data.getReader();
|
|
673
683
|
const decoder = new TextDecoder();
|
|
674
684
|
let buffer = '';
|
|
685
|
+
let settled = false;
|
|
686
|
+
const processEvents = (events)=>{
|
|
687
|
+
for (const event of events){
|
|
688
|
+
if (event.type === successEventType) {
|
|
689
|
+
settled = true;
|
|
690
|
+
resolve(event.data);
|
|
691
|
+
}
|
|
692
|
+
if (event.type === SuccessEventType.CeremonyComplete) {
|
|
693
|
+
const { accountAddress, walletId } = event.data;
|
|
694
|
+
onCeremonyComplete == null ? void 0 : onCeremonyComplete(accountAddress, walletId);
|
|
695
|
+
}
|
|
696
|
+
if (event.type === 'error') {
|
|
697
|
+
settled = true;
|
|
698
|
+
const error = createErrorFromEventData(event.data);
|
|
699
|
+
reject(error);
|
|
700
|
+
onError == null ? void 0 : onError(error);
|
|
701
|
+
return true;
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
return false;
|
|
705
|
+
};
|
|
675
706
|
const processStream = async ()=>{
|
|
676
707
|
try {
|
|
677
708
|
const { value, done } = await reader.read();
|
|
678
|
-
if (done)
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
for (const event of events){
|
|
684
|
-
if (event.type === successEventType) {
|
|
685
|
-
resolve(event.data);
|
|
686
|
-
}
|
|
687
|
-
if (event.type === SuccessEventType.CeremonyComplete) {
|
|
688
|
-
const { accountAddress, walletId } = event.data;
|
|
689
|
-
onCeremonyComplete == null ? void 0 : onCeremonyComplete(accountAddress, walletId);
|
|
709
|
+
if (done) {
|
|
710
|
+
// Flush any remaining data in the decoder
|
|
711
|
+
const remaining = decoder.decode();
|
|
712
|
+
if (remaining) {
|
|
713
|
+
buffer += remaining;
|
|
690
714
|
}
|
|
691
|
-
|
|
692
|
-
|
|
715
|
+
// Process any remaining complete events in the buffer
|
|
716
|
+
const { events } = parseEventStream(buffer);
|
|
717
|
+
processEvents(events);
|
|
718
|
+
// Stream ended without a success or error event — reject so the
|
|
719
|
+
// caller does not hang indefinitely.
|
|
720
|
+
if (!settled) {
|
|
721
|
+
const error = new Error('SSE stream ended without a success or error event');
|
|
693
722
|
reject(error);
|
|
694
723
|
onError == null ? void 0 : onError(error);
|
|
695
724
|
}
|
|
725
|
+
return;
|
|
726
|
+
}
|
|
727
|
+
buffer += decoder.decode(value, {
|
|
728
|
+
stream: true
|
|
729
|
+
});
|
|
730
|
+
const { events, remaining } = parseEventStream(buffer);
|
|
731
|
+
buffer = remaining;
|
|
732
|
+
const hadError = processEvents(events);
|
|
733
|
+
// Stop reading if an error event was processed.
|
|
734
|
+
// For success events, continue reading to allow subsequent
|
|
735
|
+
// events (like CeremonyComplete or error) to be processed.
|
|
736
|
+
if (hadError) {
|
|
737
|
+
return;
|
|
696
738
|
}
|
|
697
739
|
processStream();
|
|
698
740
|
} catch (err) {
|
|
@@ -716,15 +758,28 @@ const getElapsedTime = (startTime)=>{
|
|
|
716
758
|
};
|
|
717
759
|
/**
|
|
718
760
|
* Parses a Server-Sent Events (SSE) stream into structured event objects.
|
|
761
|
+
* Returns both the parsed events and any remaining unparsed data (incomplete events)
|
|
762
|
+
* so the caller can keep the unconsumed portion in its buffer.
|
|
763
|
+
*
|
|
764
|
+
* Events are only considered "consumed" once we see their terminating blank line.
|
|
765
|
+
* This handles the case where an event is split across multiple chunks:
|
|
766
|
+
* Chunk 1: "event:error\n"
|
|
767
|
+
* Chunk 2: "data:{...}\n\n"
|
|
768
|
+
* The first chunk returns no events and remaining="event:error\n".
|
|
769
|
+
* The second chunk (after buffer concatenation) returns the full event.
|
|
719
770
|
*
|
|
720
771
|
* @param input - Raw string data from an event stream
|
|
721
|
-
* @returns
|
|
772
|
+
* @returns Object with parsed events array and remaining unparsed string
|
|
722
773
|
*/ const parseEventStream = (input)=>{
|
|
723
774
|
const lines = input.split('\n');
|
|
724
775
|
const events = [];
|
|
725
776
|
let currentEvent = {};
|
|
726
777
|
let inEvent = false;
|
|
727
|
-
|
|
778
|
+
let lastConsumedIndex = 0;
|
|
779
|
+
let currentLineStart = 0;
|
|
780
|
+
for(let i = 0; i < lines.length; i++){
|
|
781
|
+
const line = lines[i];
|
|
782
|
+
const lineEnd = currentLineStart + line.length + (i < lines.length - 1 ? 1 : 0);
|
|
728
783
|
// Empty line marks the end of an event
|
|
729
784
|
if (line === '') {
|
|
730
785
|
if (currentEvent.type && currentEvent.data) {
|
|
@@ -732,9 +787,11 @@ const getElapsedTime = (startTime)=>{
|
|
|
732
787
|
type: currentEvent.type,
|
|
733
788
|
data: JSON.parse(currentEvent.data)
|
|
734
789
|
});
|
|
790
|
+
lastConsumedIndex = lineEnd;
|
|
735
791
|
currentEvent = {};
|
|
736
792
|
inEvent = false;
|
|
737
793
|
}
|
|
794
|
+
currentLineStart = lineEnd;
|
|
738
795
|
continue;
|
|
739
796
|
}
|
|
740
797
|
// Process event fields
|
|
@@ -747,11 +804,15 @@ const getElapsedTime = (startTime)=>{
|
|
|
747
804
|
} else if (inEvent && currentEvent.data) {
|
|
748
805
|
currentEvent.data += line;
|
|
749
806
|
}
|
|
807
|
+
currentLineStart = lineEnd;
|
|
750
808
|
}
|
|
751
|
-
return
|
|
809
|
+
return {
|
|
810
|
+
events,
|
|
811
|
+
remaining: input.substring(lastConsumedIndex)
|
|
812
|
+
};
|
|
752
813
|
};
|
|
753
814
|
|
|
754
|
-
var version = "0.0.
|
|
815
|
+
var version = "0.0.324";
|
|
755
816
|
|
|
756
817
|
class BaseClient {
|
|
757
818
|
get forwardMPCClient() {
|
|
@@ -1176,6 +1237,28 @@ class DynamicApiClient extends BaseClient {
|
|
|
1176
1237
|
});
|
|
1177
1238
|
return data;
|
|
1178
1239
|
}
|
|
1240
|
+
async requestSvmSponsoredTransaction({ transaction, traceContext }) {
|
|
1241
|
+
try {
|
|
1242
|
+
const { data } = await this.apiClient.post(`/api/v0/sdk/${this.environmentId}/solana/sponsorTransaction`, {
|
|
1243
|
+
transaction
|
|
1244
|
+
}, {
|
|
1245
|
+
headers: {
|
|
1246
|
+
[DynamicRequestIdHeader]: v4().replace('-', ''),
|
|
1247
|
+
[DynamicTraceIdHeader]: traceContext == null ? void 0 : traceContext.traceId,
|
|
1248
|
+
[DynamicTraceElapsedTimeHeader]: getElapsedTime(traceContext == null ? void 0 : traceContext.startTime)
|
|
1249
|
+
}
|
|
1250
|
+
});
|
|
1251
|
+
return data;
|
|
1252
|
+
} catch (error) {
|
|
1253
|
+
var _error_response, _error_response1;
|
|
1254
|
+
const status = error == null ? void 0 : (_error_response = error.response) == null ? void 0 : _error_response.status;
|
|
1255
|
+
const rawData = error == null ? void 0 : (_error_response1 = error.response) == null ? void 0 : _error_response1.data;
|
|
1256
|
+
var _rawData_error, _ref;
|
|
1257
|
+
const detail = (_ref = (_rawData_error = rawData == null ? void 0 : rawData.error) != null ? _rawData_error : typeof rawData === 'string' ? rawData : JSON.stringify(rawData)) != null ? _ref : error == null ? void 0 : error.message;
|
|
1258
|
+
const statusStr = status ? ` (${status})` : '';
|
|
1259
|
+
throw new Error(`SVM sponsorship failed${statusStr}: ${detail}`);
|
|
1260
|
+
}
|
|
1261
|
+
}
|
|
1179
1262
|
constructor({ environmentId, authToken, backupServiceAuthToken, baseApiUrl, authMode = AuthMode.HEADER, // Represents the version of the client SDK used by developer
|
|
1180
1263
|
sdkVersion, forwardMPCClient, baseClientKeysharesRelayApiUrl, logger }){
|
|
1181
1264
|
super({
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs-wallet/core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.324",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@dynamic-labs/sdk-api-core": "^0.0.900",
|
|
8
|
-
"axios": "1.
|
|
8
|
+
"axios": "1.15.0",
|
|
9
9
|
"uuid": "11.1.0"
|
|
10
10
|
},
|
|
11
11
|
"peerDependencies": {
|
package/src/api/api.d.ts
ADDED
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import type { ForwardMPCClientV2 } from '@dynamic-labs-wallet/forward-mpc-client';
|
|
2
|
+
import type { RoomTypeEnum, SignMessageEvmTransaction, SignMessageEvmUserOperation, SignMessageSvmTransaction } from '@dynamic-labs/sdk-api-core';
|
|
3
|
+
import { type BackupLocation } from '../constants.js';
|
|
4
|
+
import type { ThresholdSignatureScheme } from '../mpc/constants.js';
|
|
5
|
+
import { AuthMode, type BackupLocationWithExternalKeyShareId, type BitcoinConfig, type EncryptedDelegatedKeyShareEnvelope, type ILogger, type KeygenCompleteResponse, type OpenRoomResponse, type ReshareResponse, type TraceContext, type WaasWalletResponse } from '../types.js';
|
|
6
|
+
import { BaseClient } from './client.js';
|
|
7
|
+
export declare class DynamicApiClient extends BaseClient {
|
|
8
|
+
constructor({ environmentId, authToken, backupServiceAuthToken, baseApiUrl, authMode, sdkVersion, forwardMPCClient, baseClientKeysharesRelayApiUrl, logger, }: {
|
|
9
|
+
environmentId: string;
|
|
10
|
+
authToken?: string;
|
|
11
|
+
backupServiceAuthToken?: string;
|
|
12
|
+
baseApiUrl?: string;
|
|
13
|
+
authMode?: AuthMode;
|
|
14
|
+
sdkVersion?: string;
|
|
15
|
+
forwardMPCClient?: ForwardMPCClientV2;
|
|
16
|
+
baseClientKeysharesRelayApiUrl?: string;
|
|
17
|
+
logger?: ILogger;
|
|
18
|
+
});
|
|
19
|
+
getBackupRelayToken({ traceContext }: {
|
|
20
|
+
traceContext?: TraceContext;
|
|
21
|
+
}): Promise<any>;
|
|
22
|
+
authenticateApiToken({ environmentId }: {
|
|
23
|
+
environmentId: string;
|
|
24
|
+
}): Promise<import("axios").AxiosResponse<any, any, {}>>;
|
|
25
|
+
createWalletAccount({ chainName, clientKeygenIds, dynamicRequestId, thresholdSignatureScheme, skipLock, bitcoinConfig, onError, onCeremonyComplete, traceContext, }: {
|
|
26
|
+
chainName: string;
|
|
27
|
+
dynamicRequestId?: string;
|
|
28
|
+
clientKeygenIds: string[];
|
|
29
|
+
thresholdSignatureScheme: ThresholdSignatureScheme;
|
|
30
|
+
skipLock?: boolean;
|
|
31
|
+
bitcoinConfig?: BitcoinConfig;
|
|
32
|
+
onError?: (error: Error) => void;
|
|
33
|
+
onCeremonyComplete?: (accountAddress: string, walletId: string) => void;
|
|
34
|
+
traceContext?: TraceContext;
|
|
35
|
+
}): Promise<KeygenCompleteResponse>;
|
|
36
|
+
signMessage({ dynamicRequestId, walletId, message, onError, isFormatted, mfaToken, elevatedAccessToken, roomId, context, forwardMPCClientEnabled, traceContext, bitcoinConfig, }: {
|
|
37
|
+
dynamicRequestId?: string;
|
|
38
|
+
walletId: string;
|
|
39
|
+
message: string;
|
|
40
|
+
onError?: (error: Error) => void;
|
|
41
|
+
isFormatted?: boolean;
|
|
42
|
+
mfaToken?: string;
|
|
43
|
+
elevatedAccessToken?: string;
|
|
44
|
+
roomId?: string;
|
|
45
|
+
context?: SignMessageEvmTransaction | SignMessageSvmTransaction | SignMessageEvmUserOperation;
|
|
46
|
+
forwardMPCClientEnabled?: boolean;
|
|
47
|
+
traceContext?: TraceContext;
|
|
48
|
+
bitcoinConfig?: BitcoinConfig;
|
|
49
|
+
}): Promise<OpenRoomResponse>;
|
|
50
|
+
refreshWalletAccountShares({ dynamicRequestId, walletId, onError, mfaToken, elevatedAccessToken, traceContext, }: {
|
|
51
|
+
dynamicRequestId?: string;
|
|
52
|
+
walletId: string;
|
|
53
|
+
onError?: (error: Error) => void;
|
|
54
|
+
mfaToken?: string;
|
|
55
|
+
elevatedAccessToken?: string;
|
|
56
|
+
traceContext?: TraceContext;
|
|
57
|
+
}): Promise<{
|
|
58
|
+
roomId: string;
|
|
59
|
+
serverKeygenIds: string[];
|
|
60
|
+
}>;
|
|
61
|
+
reshare({ walletId, dynamicRequestId, clientKeygenIds, oldThresholdSignatureScheme, newThresholdSignatureScheme, delegateToProjectEnvironment, revokeDelegation, mfaToken, elevatedAccessToken, onError, traceContext, }: {
|
|
62
|
+
dynamicRequestId?: string;
|
|
63
|
+
walletId: string;
|
|
64
|
+
clientKeygenIds: string[];
|
|
65
|
+
oldThresholdSignatureScheme: ThresholdSignatureScheme;
|
|
66
|
+
newThresholdSignatureScheme: ThresholdSignatureScheme;
|
|
67
|
+
delegateToProjectEnvironment?: boolean;
|
|
68
|
+
revokeDelegation?: boolean;
|
|
69
|
+
mfaToken?: string;
|
|
70
|
+
elevatedAccessToken?: string;
|
|
71
|
+
onError?: (error: Error) => void;
|
|
72
|
+
traceContext?: TraceContext;
|
|
73
|
+
}): Promise<ReshareResponse>;
|
|
74
|
+
exportKey({ mfaToken, elevatedAccessToken, dynamicRequestId, walletId, exportId, bitcoinConfig, onError, traceContext, }: {
|
|
75
|
+
mfaToken?: string;
|
|
76
|
+
elevatedAccessToken?: string;
|
|
77
|
+
dynamicRequestId?: string;
|
|
78
|
+
walletId: string;
|
|
79
|
+
exportId: string;
|
|
80
|
+
bitcoinConfig?: BitcoinConfig;
|
|
81
|
+
onError?: (error: Error) => void;
|
|
82
|
+
traceContext?: TraceContext;
|
|
83
|
+
}): Promise<OpenRoomResponse>;
|
|
84
|
+
getDelegatedEncryptionKey({ environmentId, traceContext, }: {
|
|
85
|
+
environmentId: string;
|
|
86
|
+
traceContext?: TraceContext;
|
|
87
|
+
}): Promise<any>;
|
|
88
|
+
publishDelegatedKeyShare({ walletId, encryptedKeyShare, signedSessionId, requiresSignedSessionId, dynamicRequestId, traceContext, }: {
|
|
89
|
+
walletId: string;
|
|
90
|
+
encryptedKeyShare: EncryptedDelegatedKeyShareEnvelope;
|
|
91
|
+
dynamicRequestId: string;
|
|
92
|
+
signedSessionId?: string;
|
|
93
|
+
requiresSignedSessionId?: boolean;
|
|
94
|
+
traceContext?: TraceContext;
|
|
95
|
+
}): Promise<{
|
|
96
|
+
data: any;
|
|
97
|
+
status: number;
|
|
98
|
+
}>;
|
|
99
|
+
storeEncryptedBackupByWallet({ walletId, encryptedKeyShares, passwordEncrypted, signedSessionId, encryptionVersion, requiresSignedSessionId, dynamicRequestId, traceContext, }: {
|
|
100
|
+
walletId: string;
|
|
101
|
+
encryptedKeyShares: string[];
|
|
102
|
+
passwordEncrypted: boolean;
|
|
103
|
+
dynamicRequestId: string;
|
|
104
|
+
signedSessionId?: string;
|
|
105
|
+
encryptionVersion?: string;
|
|
106
|
+
requiresSignedSessionId?: boolean;
|
|
107
|
+
traceContext?: TraceContext;
|
|
108
|
+
}): Promise<any>;
|
|
109
|
+
markKeySharesAsBackedUp({ walletId, locations, dynamicRequestId, traceContext, passwordUpdateBatchId, }: {
|
|
110
|
+
walletId: string;
|
|
111
|
+
locations: BackupLocationWithExternalKeyShareId[];
|
|
112
|
+
dynamicRequestId: string;
|
|
113
|
+
traceContext?: TraceContext;
|
|
114
|
+
passwordUpdateBatchId?: string;
|
|
115
|
+
}): Promise<{
|
|
116
|
+
message: string;
|
|
117
|
+
walletId: string;
|
|
118
|
+
passwordUpdateStatus?: 'pending' | 'activated';
|
|
119
|
+
locationsWithKeyShares: {
|
|
120
|
+
location: BackupLocation;
|
|
121
|
+
id: string;
|
|
122
|
+
keygenId: string;
|
|
123
|
+
externalKeyShareId?: string;
|
|
124
|
+
}[];
|
|
125
|
+
}>;
|
|
126
|
+
recoverEncryptedBackupByWallet({ walletId, externalKeyShareIds, signedSessionId, mfaToken, requiresSignedSessionId, traceContext, userId, }: {
|
|
127
|
+
walletId: string;
|
|
128
|
+
externalKeyShareIds?: string[];
|
|
129
|
+
signedSessionId?: string;
|
|
130
|
+
mfaToken?: string;
|
|
131
|
+
requiresSignedSessionId?: boolean;
|
|
132
|
+
traceContext?: TraceContext;
|
|
133
|
+
userId?: string;
|
|
134
|
+
}): Promise<any>;
|
|
135
|
+
getAccessToken({ oauthAccountId, traceContext }: {
|
|
136
|
+
oauthAccountId: string;
|
|
137
|
+
traceContext?: TraceContext;
|
|
138
|
+
}): Promise<any>;
|
|
139
|
+
importPrivateKey({ chainName, dynamicRequestId, clientKeygenIds, thresholdSignatureScheme, bitcoinConfig, onError, onCeremonyComplete, traceContext, legacyWalletId, }: {
|
|
140
|
+
dynamicRequestId?: string;
|
|
141
|
+
chainName: string;
|
|
142
|
+
clientKeygenIds: string[];
|
|
143
|
+
thresholdSignatureScheme: ThresholdSignatureScheme;
|
|
144
|
+
bitcoinConfig?: BitcoinConfig;
|
|
145
|
+
onError?: (error: Error) => void;
|
|
146
|
+
onCeremonyComplete?: (accountAddress: string, walletId: string) => void;
|
|
147
|
+
traceContext?: TraceContext;
|
|
148
|
+
/** ID of the legacy embedded wallet being upgraded to v3 */
|
|
149
|
+
legacyWalletId?: string;
|
|
150
|
+
}): Promise<KeygenCompleteResponse>;
|
|
151
|
+
getUser(dynamicRequestId: string, traceContext?: TraceContext): Promise<any>;
|
|
152
|
+
refreshUser(traceContext?: TraceContext): Promise<any>;
|
|
153
|
+
getEnvironmentSettings(traceContext?: TraceContext): Promise<any>;
|
|
154
|
+
getWaasWalletById({ walletId, traceContext, }: {
|
|
155
|
+
walletId: string;
|
|
156
|
+
traceContext?: TraceContext;
|
|
157
|
+
}): Promise<WaasWalletResponse>;
|
|
158
|
+
/**
|
|
159
|
+
* Fetch a single WaaS wallet by ID using the /sdk/{environmentId}/waas/{walletId} endpoint.
|
|
160
|
+
* This endpoint returns user information with verified credentials filtered to only include the specified WaaS wallet.
|
|
161
|
+
*/
|
|
162
|
+
getWaasWalletByAddress({ walletAddress, traceContext, }: {
|
|
163
|
+
walletAddress: string;
|
|
164
|
+
traceContext?: TraceContext;
|
|
165
|
+
}): Promise<WaasWalletResponse>;
|
|
166
|
+
delegatedSignMessage({ walletId, message, isFormatted, dynamicRequestId, onError, context, traceContext, }: {
|
|
167
|
+
walletId: string;
|
|
168
|
+
message: string;
|
|
169
|
+
isFormatted?: boolean;
|
|
170
|
+
dynamicRequestId: string;
|
|
171
|
+
onError?: (error: Error) => void;
|
|
172
|
+
context?: SignMessageEvmTransaction | SignMessageSvmTransaction | SignMessageEvmUserOperation;
|
|
173
|
+
traceContext?: TraceContext;
|
|
174
|
+
}): Promise<OpenRoomResponse>;
|
|
175
|
+
createRooms({ walletId, roomType, roomCount, traceContext, }: {
|
|
176
|
+
walletId: string;
|
|
177
|
+
roomType?: RoomTypeEnum;
|
|
178
|
+
roomCount?: number;
|
|
179
|
+
traceContext?: TraceContext;
|
|
180
|
+
}): Promise<any>;
|
|
181
|
+
createRoomsWithoutWalletId({ roomType, thresholdSignatureScheme, roomCount, traceContext, }: {
|
|
182
|
+
roomType: RoomTypeEnum;
|
|
183
|
+
thresholdSignatureScheme: ThresholdSignatureScheme;
|
|
184
|
+
roomCount?: number;
|
|
185
|
+
traceContext?: TraceContext;
|
|
186
|
+
}): Promise<any>;
|
|
187
|
+
requestSvmSponsoredTransaction({ transaction, traceContext, }: {
|
|
188
|
+
/** Base64-encoded unsigned Solana transaction. */
|
|
189
|
+
transaction: string;
|
|
190
|
+
traceContext?: TraceContext;
|
|
191
|
+
}): Promise<{
|
|
192
|
+
transaction: string;
|
|
193
|
+
}>;
|
|
194
|
+
}
|
|
195
|
+
//# sourceMappingURL=api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["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AAC;QACjC,OAAO,CAAC,EAAE,yBAAyB,GAAG,yBAAyB,GAAG,2BAA2B,CAAC;QAC9F,YAAY,CAAC,EAAE,YAAY,CAAC;KAC7B;IAiBK,WAAW,CAAC,EAChB,QAAQ,EACR,QAAQ,EACR,SAAa,EACb,YAAY,GACb,EAAE;QACD,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,CAAC,EAAE,YAAY,CAAC;QACxB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,YAAY,CAAC,EAAE,YAAY,CAAC;KAC7B;IAkBK,0BAA0B,CAAC,EAC/B,QAAQ,EACR,wBAAwB,EACxB,SAAa,EACb,YAAY,GACb,EAAE;QACD,QAAQ,EAAE,YAAY,CAAC;QACvB,wBAAwB,EAAE,wBAAwB,CAAC;QACnD,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,YAAY,CAAC,EAAE,YAAY,CAAC;KAC7B;IAmBK,8BAA8B,CAAC,EACnC,WAAW,EACX,YAAY,GACb,EAAE;QACD,kDAAkD;QAClD,WAAW,EAAE,MAAM,CAAC;QACpB,YAAY,CAAC,EAAE,YAAY,CAAC;KAC7B,GAAG,OAAO,CAAC;QAAE,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC;CAuBrC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type AxiosInstance } from 'axios';
|
|
2
|
+
import { AuthMode, type ILogger } from '../types.js';
|
|
3
|
+
import type { ForwardMPCClientV2 } from '@dynamic-labs-wallet/forward-mpc-client';
|
|
4
|
+
export declare class BaseClient {
|
|
5
|
+
apiClient: AxiosInstance;
|
|
6
|
+
baseApiUrl: string;
|
|
7
|
+
environmentId: string;
|
|
8
|
+
clientKeysharesRelayBaseApiUrl: string;
|
|
9
|
+
clientRelayApiClient: AxiosInstance;
|
|
10
|
+
_forwardMpcClient: ForwardMPCClientV2 | undefined;
|
|
11
|
+
logger: ILogger;
|
|
12
|
+
protected authMode: AuthMode;
|
|
13
|
+
protected backupServiceAuthToken?: string;
|
|
14
|
+
constructor({ environmentId, baseApiUrl, authToken, backupServiceAuthToken, baseClientKeysharesRelayApiUrl, authMode, sdkVersion, forwardMPCClient, logger, }: {
|
|
15
|
+
environmentId: string;
|
|
16
|
+
baseApiUrl?: string;
|
|
17
|
+
authToken?: string;
|
|
18
|
+
backupServiceAuthToken?: string;
|
|
19
|
+
baseClientKeysharesRelayApiUrl?: string;
|
|
20
|
+
authMode?: AuthMode;
|
|
21
|
+
sdkVersion?: string;
|
|
22
|
+
forwardMPCClient?: ForwardMPCClientV2;
|
|
23
|
+
logger?: ILogger;
|
|
24
|
+
});
|
|
25
|
+
get forwardMPCClient(): ForwardMPCClientV2;
|
|
26
|
+
set forwardMPCClient(forwardMPCClient: ForwardMPCClientV2 | undefined);
|
|
27
|
+
syncAuthToken(authToken: string): void;
|
|
28
|
+
syncBackupServiceAuthToken(backupServiceAuthToken: string): void;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":"AAAA,OAAc,EAAE,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AAWlD,OAAO,EAAE,QAAQ,EAAc,KAAK,OAAO,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAElF,qBAAa,UAAU;IACd,SAAS,EAAE,aAAa,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,8BAA8B,EAAE,MAAM,CAAC;IACvC,oBAAoB,EAAE,aAAa,CAAC;IACpC,iBAAiB,EAAE,kBAAkB,GAAG,SAAS,CAAC;IAClD,MAAM,EAAE,OAAO,CAAC;IACvB,SAAS,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC7B,SAAS,CAAC,sBAAsB,CAAC,EAAE,M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