@dynamic-labs-wallet/core 0.0.323 → 0.0.325
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 +84 -20
- package/index.esm.js +84 -20
- 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 +133 -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 +511 -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
|
@@ -128,7 +128,7 @@ const DYNAMIC_FORWARD_MPC_DEV_ENCLAVE_URL = 'ws://localhost:8008/ws';
|
|
|
128
128
|
const DYNAMIC_FORWARD_MPC_ENCLAVE_URL_MAP = {
|
|
129
129
|
["production"]: DYNAMIC_FORWARD_MPC_PROD_ENCLAVE_URL,
|
|
130
130
|
["preprod"]: DYNAMIC_FORWARD_MPC_PREPROD_ENCLAVE_URL,
|
|
131
|
-
["development"]:
|
|
131
|
+
["development"]: DYNAMIC_FORWARD_MPC_PREPROD_ENCLAVE_URL
|
|
132
132
|
};
|
|
133
133
|
const DYNAMIC_FORWARD_MPC_ENCLAVE_ATTESTATION_CONFIG_MAP = {
|
|
134
134
|
["production"]: {
|
|
@@ -139,7 +139,10 @@ const DYNAMIC_FORWARD_MPC_ENCLAVE_ATTESTATION_CONFIG_MAP = {
|
|
|
139
139
|
expectedPcr8: 'acc59ec98dbf7ecb43f9a6b9890866141868c079aa879e05e3675e1a10e187259a64951e72cc531541b02dbdcd780770',
|
|
140
140
|
strictCertValidation: true
|
|
141
141
|
},
|
|
142
|
-
["development"]:
|
|
142
|
+
["development"]: {
|
|
143
|
+
expectedPcr8: 'acc59ec98dbf7ecb43f9a6b9890866141868c079aa879e05e3675e1a10e187259a64951e72cc531541b02dbdcd780770',
|
|
144
|
+
strictCertValidation: true
|
|
145
|
+
}
|
|
143
146
|
};
|
|
144
147
|
|
|
145
148
|
var SigningAlgorithm = /*#__PURE__*/ function(SigningAlgorithm) {
|
|
@@ -670,30 +673,72 @@ const getElapsedTime = (startTime)=>{
|
|
|
670
673
|
* @returns {function} A response handler function that processes the event stream
|
|
671
674
|
*/ const createSuccessErrorEventStreamHandler = ({ resolve, reject, successEventType, onError, onCeremonyComplete })=>{
|
|
672
675
|
return (response)=>{
|
|
676
|
+
// Reject immediately for non-2xx HTTP responses (e.g. 429 rate limit).
|
|
677
|
+
// With axios fetch adapter + responseType: 'stream', non-2xx responses
|
|
678
|
+
// may not be rejected automatically and arrive here as a stream of
|
|
679
|
+
// non-SSE content that would never parse into success/error events.
|
|
680
|
+
if (response.status && (response.status < 200 || response.status >= 300)) {
|
|
681
|
+
const error = new Error(`Request failed with status ${response.status}`);
|
|
682
|
+
reject(error);
|
|
683
|
+
onError == null ? void 0 : onError(error);
|
|
684
|
+
return;
|
|
685
|
+
}
|
|
673
686
|
const reader = response.data.getReader();
|
|
674
687
|
const decoder = new TextDecoder();
|
|
675
688
|
let buffer = '';
|
|
689
|
+
let settled = false;
|
|
690
|
+
const processEvents = (events)=>{
|
|
691
|
+
for (const event of events){
|
|
692
|
+
if (event.type === successEventType) {
|
|
693
|
+
settled = true;
|
|
694
|
+
resolve(event.data);
|
|
695
|
+
}
|
|
696
|
+
if (event.type === SuccessEventType.CeremonyComplete) {
|
|
697
|
+
const { accountAddress, walletId } = event.data;
|
|
698
|
+
onCeremonyComplete == null ? void 0 : onCeremonyComplete(accountAddress, walletId);
|
|
699
|
+
}
|
|
700
|
+
if (event.type === 'error') {
|
|
701
|
+
settled = true;
|
|
702
|
+
const error = createErrorFromEventData(event.data);
|
|
703
|
+
reject(error);
|
|
704
|
+
onError == null ? void 0 : onError(error);
|
|
705
|
+
return true;
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
return false;
|
|
709
|
+
};
|
|
676
710
|
const processStream = async ()=>{
|
|
677
711
|
try {
|
|
678
712
|
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);
|
|
713
|
+
if (done) {
|
|
714
|
+
// Flush any remaining data in the decoder
|
|
715
|
+
const remaining = decoder.decode();
|
|
716
|
+
if (remaining) {
|
|
717
|
+
buffer += remaining;
|
|
687
718
|
}
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
719
|
+
// Process any remaining complete events in the buffer
|
|
720
|
+
const { events } = parseEventStream(buffer);
|
|
721
|
+
processEvents(events);
|
|
722
|
+
// Stream ended without a success or error event — reject so the
|
|
723
|
+
// caller does not hang indefinitely.
|
|
724
|
+
if (!settled) {
|
|
725
|
+
const error = new Error('SSE stream ended without a success or error event');
|
|
694
726
|
reject(error);
|
|
695
727
|
onError == null ? void 0 : onError(error);
|
|
696
728
|
}
|
|
729
|
+
return;
|
|
730
|
+
}
|
|
731
|
+
buffer += decoder.decode(value, {
|
|
732
|
+
stream: true
|
|
733
|
+
});
|
|
734
|
+
const { events, remaining } = parseEventStream(buffer);
|
|
735
|
+
buffer = remaining;
|
|
736
|
+
const hadError = processEvents(events);
|
|
737
|
+
// Stop reading if an error event was processed.
|
|
738
|
+
// For success events, continue reading to allow subsequent
|
|
739
|
+
// events (like CeremonyComplete or error) to be processed.
|
|
740
|
+
if (hadError) {
|
|
741
|
+
return;
|
|
697
742
|
}
|
|
698
743
|
processStream();
|
|
699
744
|
} catch (err) {
|
|
@@ -717,15 +762,28 @@ const getElapsedTime = (startTime)=>{
|
|
|
717
762
|
};
|
|
718
763
|
/**
|
|
719
764
|
* Parses a Server-Sent Events (SSE) stream into structured event objects.
|
|
765
|
+
* Returns both the parsed events and any remaining unparsed data (incomplete events)
|
|
766
|
+
* so the caller can keep the unconsumed portion in its buffer.
|
|
767
|
+
*
|
|
768
|
+
* Events are only considered "consumed" once we see their terminating blank line.
|
|
769
|
+
* This handles the case where an event is split across multiple chunks:
|
|
770
|
+
* Chunk 1: "event:error\n"
|
|
771
|
+
* Chunk 2: "data:{...}\n\n"
|
|
772
|
+
* The first chunk returns no events and remaining="event:error\n".
|
|
773
|
+
* The second chunk (after buffer concatenation) returns the full event.
|
|
720
774
|
*
|
|
721
775
|
* @param input - Raw string data from an event stream
|
|
722
|
-
* @returns
|
|
776
|
+
* @returns Object with parsed events array and remaining unparsed string
|
|
723
777
|
*/ const parseEventStream = (input)=>{
|
|
724
778
|
const lines = input.split('\n');
|
|
725
779
|
const events = [];
|
|
726
780
|
let currentEvent = {};
|
|
727
781
|
let inEvent = false;
|
|
728
|
-
|
|
782
|
+
let lastConsumedIndex = 0;
|
|
783
|
+
let currentLineStart = 0;
|
|
784
|
+
for(let i = 0; i < lines.length; i++){
|
|
785
|
+
const line = lines[i];
|
|
786
|
+
const lineEnd = currentLineStart + line.length + (i < lines.length - 1 ? 1 : 0);
|
|
729
787
|
// Empty line marks the end of an event
|
|
730
788
|
if (line === '') {
|
|
731
789
|
if (currentEvent.type && currentEvent.data) {
|
|
@@ -733,9 +791,11 @@ const getElapsedTime = (startTime)=>{
|
|
|
733
791
|
type: currentEvent.type,
|
|
734
792
|
data: JSON.parse(currentEvent.data)
|
|
735
793
|
});
|
|
794
|
+
lastConsumedIndex = lineEnd;
|
|
736
795
|
currentEvent = {};
|
|
737
796
|
inEvent = false;
|
|
738
797
|
}
|
|
798
|
+
currentLineStart = lineEnd;
|
|
739
799
|
continue;
|
|
740
800
|
}
|
|
741
801
|
// Process event fields
|
|
@@ -748,11 +808,15 @@ const getElapsedTime = (startTime)=>{
|
|
|
748
808
|
} else if (inEvent && currentEvent.data) {
|
|
749
809
|
currentEvent.data += line;
|
|
750
810
|
}
|
|
811
|
+
currentLineStart = lineEnd;
|
|
751
812
|
}
|
|
752
|
-
return
|
|
813
|
+
return {
|
|
814
|
+
events,
|
|
815
|
+
remaining: input.substring(lastConsumedIndex)
|
|
816
|
+
};
|
|
753
817
|
};
|
|
754
818
|
|
|
755
|
-
var version = "0.0.
|
|
819
|
+
var version = "0.0.325";
|
|
756
820
|
|
|
757
821
|
class BaseClient {
|
|
758
822
|
get forwardMPCClient() {
|
package/index.esm.js
CHANGED
|
@@ -127,7 +127,7 @@ const DYNAMIC_FORWARD_MPC_DEV_ENCLAVE_URL = 'ws://localhost:8008/ws';
|
|
|
127
127
|
const DYNAMIC_FORWARD_MPC_ENCLAVE_URL_MAP = {
|
|
128
128
|
["production"]: DYNAMIC_FORWARD_MPC_PROD_ENCLAVE_URL,
|
|
129
129
|
["preprod"]: DYNAMIC_FORWARD_MPC_PREPROD_ENCLAVE_URL,
|
|
130
|
-
["development"]:
|
|
130
|
+
["development"]: DYNAMIC_FORWARD_MPC_PREPROD_ENCLAVE_URL
|
|
131
131
|
};
|
|
132
132
|
const DYNAMIC_FORWARD_MPC_ENCLAVE_ATTESTATION_CONFIG_MAP = {
|
|
133
133
|
["production"]: {
|
|
@@ -138,7 +138,10 @@ const DYNAMIC_FORWARD_MPC_ENCLAVE_ATTESTATION_CONFIG_MAP = {
|
|
|
138
138
|
expectedPcr8: 'acc59ec98dbf7ecb43f9a6b9890866141868c079aa879e05e3675e1a10e187259a64951e72cc531541b02dbdcd780770',
|
|
139
139
|
strictCertValidation: true
|
|
140
140
|
},
|
|
141
|
-
["development"]:
|
|
141
|
+
["development"]: {
|
|
142
|
+
expectedPcr8: 'acc59ec98dbf7ecb43f9a6b9890866141868c079aa879e05e3675e1a10e187259a64951e72cc531541b02dbdcd780770',
|
|
143
|
+
strictCertValidation: true
|
|
144
|
+
}
|
|
142
145
|
};
|
|
143
146
|
|
|
144
147
|
var SigningAlgorithm = /*#__PURE__*/ function(SigningAlgorithm) {
|
|
@@ -669,30 +672,72 @@ const getElapsedTime = (startTime)=>{
|
|
|
669
672
|
* @returns {function} A response handler function that processes the event stream
|
|
670
673
|
*/ const createSuccessErrorEventStreamHandler = ({ resolve, reject, successEventType, onError, onCeremonyComplete })=>{
|
|
671
674
|
return (response)=>{
|
|
675
|
+
// Reject immediately for non-2xx HTTP responses (e.g. 429 rate limit).
|
|
676
|
+
// With axios fetch adapter + responseType: 'stream', non-2xx responses
|
|
677
|
+
// may not be rejected automatically and arrive here as a stream of
|
|
678
|
+
// non-SSE content that would never parse into success/error events.
|
|
679
|
+
if (response.status && (response.status < 200 || response.status >= 300)) {
|
|
680
|
+
const error = new Error(`Request failed with status ${response.status}`);
|
|
681
|
+
reject(error);
|
|
682
|
+
onError == null ? void 0 : onError(error);
|
|
683
|
+
return;
|
|
684
|
+
}
|
|
672
685
|
const reader = response.data.getReader();
|
|
673
686
|
const decoder = new TextDecoder();
|
|
674
687
|
let buffer = '';
|
|
688
|
+
let settled = false;
|
|
689
|
+
const processEvents = (events)=>{
|
|
690
|
+
for (const event of events){
|
|
691
|
+
if (event.type === successEventType) {
|
|
692
|
+
settled = true;
|
|
693
|
+
resolve(event.data);
|
|
694
|
+
}
|
|
695
|
+
if (event.type === SuccessEventType.CeremonyComplete) {
|
|
696
|
+
const { accountAddress, walletId } = event.data;
|
|
697
|
+
onCeremonyComplete == null ? void 0 : onCeremonyComplete(accountAddress, walletId);
|
|
698
|
+
}
|
|
699
|
+
if (event.type === 'error') {
|
|
700
|
+
settled = true;
|
|
701
|
+
const error = createErrorFromEventData(event.data);
|
|
702
|
+
reject(error);
|
|
703
|
+
onError == null ? void 0 : onError(error);
|
|
704
|
+
return true;
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
return false;
|
|
708
|
+
};
|
|
675
709
|
const processStream = async ()=>{
|
|
676
710
|
try {
|
|
677
711
|
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);
|
|
712
|
+
if (done) {
|
|
713
|
+
// Flush any remaining data in the decoder
|
|
714
|
+
const remaining = decoder.decode();
|
|
715
|
+
if (remaining) {
|
|
716
|
+
buffer += remaining;
|
|
686
717
|
}
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
718
|
+
// Process any remaining complete events in the buffer
|
|
719
|
+
const { events } = parseEventStream(buffer);
|
|
720
|
+
processEvents(events);
|
|
721
|
+
// Stream ended without a success or error event — reject so the
|
|
722
|
+
// caller does not hang indefinitely.
|
|
723
|
+
if (!settled) {
|
|
724
|
+
const error = new Error('SSE stream ended without a success or error event');
|
|
693
725
|
reject(error);
|
|
694
726
|
onError == null ? void 0 : onError(error);
|
|
695
727
|
}
|
|
728
|
+
return;
|
|
729
|
+
}
|
|
730
|
+
buffer += decoder.decode(value, {
|
|
731
|
+
stream: true
|
|
732
|
+
});
|
|
733
|
+
const { events, remaining } = parseEventStream(buffer);
|
|
734
|
+
buffer = remaining;
|
|
735
|
+
const hadError = processEvents(events);
|
|
736
|
+
// Stop reading if an error event was processed.
|
|
737
|
+
// For success events, continue reading to allow subsequent
|
|
738
|
+
// events (like CeremonyComplete or error) to be processed.
|
|
739
|
+
if (hadError) {
|
|
740
|
+
return;
|
|
696
741
|
}
|
|
697
742
|
processStream();
|
|
698
743
|
} catch (err) {
|
|
@@ -716,15 +761,28 @@ const getElapsedTime = (startTime)=>{
|
|
|
716
761
|
};
|
|
717
762
|
/**
|
|
718
763
|
* Parses a Server-Sent Events (SSE) stream into structured event objects.
|
|
764
|
+
* Returns both the parsed events and any remaining unparsed data (incomplete events)
|
|
765
|
+
* so the caller can keep the unconsumed portion in its buffer.
|
|
766
|
+
*
|
|
767
|
+
* Events are only considered "consumed" once we see their terminating blank line.
|
|
768
|
+
* This handles the case where an event is split across multiple chunks:
|
|
769
|
+
* Chunk 1: "event:error\n"
|
|
770
|
+
* Chunk 2: "data:{...}\n\n"
|
|
771
|
+
* The first chunk returns no events and remaining="event:error\n".
|
|
772
|
+
* The second chunk (after buffer concatenation) returns the full event.
|
|
719
773
|
*
|
|
720
774
|
* @param input - Raw string data from an event stream
|
|
721
|
-
* @returns
|
|
775
|
+
* @returns Object with parsed events array and remaining unparsed string
|
|
722
776
|
*/ const parseEventStream = (input)=>{
|
|
723
777
|
const lines = input.split('\n');
|
|
724
778
|
const events = [];
|
|
725
779
|
let currentEvent = {};
|
|
726
780
|
let inEvent = false;
|
|
727
|
-
|
|
781
|
+
let lastConsumedIndex = 0;
|
|
782
|
+
let currentLineStart = 0;
|
|
783
|
+
for(let i = 0; i < lines.length; i++){
|
|
784
|
+
const line = lines[i];
|
|
785
|
+
const lineEnd = currentLineStart + line.length + (i < lines.length - 1 ? 1 : 0);
|
|
728
786
|
// Empty line marks the end of an event
|
|
729
787
|
if (line === '') {
|
|
730
788
|
if (currentEvent.type && currentEvent.data) {
|
|
@@ -732,9 +790,11 @@ const getElapsedTime = (startTime)=>{
|
|
|
732
790
|
type: currentEvent.type,
|
|
733
791
|
data: JSON.parse(currentEvent.data)
|
|
734
792
|
});
|
|
793
|
+
lastConsumedIndex = lineEnd;
|
|
735
794
|
currentEvent = {};
|
|
736
795
|
inEvent = false;
|
|
737
796
|
}
|
|
797
|
+
currentLineStart = lineEnd;
|
|
738
798
|
continue;
|
|
739
799
|
}
|
|
740
800
|
// Process event fields
|
|
@@ -747,11 +807,15 @@ const getElapsedTime = (startTime)=>{
|
|
|
747
807
|
} else if (inEvent && currentEvent.data) {
|
|
748
808
|
currentEvent.data += line;
|
|
749
809
|
}
|
|
810
|
+
currentLineStart = lineEnd;
|
|
750
811
|
}
|
|
751
|
-
return
|
|
812
|
+
return {
|
|
813
|
+
events,
|
|
814
|
+
remaining: input.substring(lastConsumedIndex)
|
|
815
|
+
};
|
|
752
816
|
};
|
|
753
817
|
|
|
754
|
-
var version = "0.0.
|
|
818
|
+
var version = "0.0.325";
|
|
755
819
|
|
|
756
820
|
class BaseClient {
|
|
757
821
|
get forwardMPCClient() {
|
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.325",
|
|
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":["../../src/api/api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAClF,OAAO,KAAK,EACV,YAAY,EACZ,yBAAyB,EACzB,2BAA2B,EAC3B,yBAAyB,EAC1B,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAML,KAAK,cAAc,EACpB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AACpE,OAAO,EACL,QAAQ,EAER,KAAK,oCAAoC,EACzC,KAAK,aAAa,EAClB,KAAK,kCAAkC,EACvC,KAAK,OAAO,EACZ,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACxB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,qBAAa,gBAAiB,SAAQ,UAAU;gBAClC,EACV,aAAa,EACb,SAAS,EACT,sBAAsB,EACtB,UAAU,EACV,QAA0B,E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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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