@dynamic-labs-wallet/core 0.0.144 → 0.0.155

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 CHANGED
@@ -68,7 +68,7 @@ var BackupLocation = /*#__PURE__*/ function(BackupLocation) {
68
68
  return BackupLocation;
69
69
  }({});
70
70
  const IFRAME_DOMAIN_MAP = {
71
- development: 'http://localhost:4200',
71
+ development: 'http://localhost:8090',
72
72
  preprod: 'https://app.dynamic-preprod.xyz',
73
73
  production: 'https://app.dynamicauth.com'
74
74
  };
@@ -881,6 +881,71 @@ class DynamicApiClient extends BaseClient {
881
881
  }
882
882
  }
883
883
 
884
+ const SDK_NAMESPACE = {
885
+ REACT: 'WalletKit',
886
+ CLIENT: 'ClientSDK'
887
+ };
888
+ /**
889
+ * Parses a potentially namespaced SDK version string
890
+ * @param sdkVersion - The SDK version string, optionally namespaced
891
+ * @returns Parsed SDK version with namespace and version
892
+ * @example
893
+ * parseNamespacedVersion("WalletKit/1.0.0") // { namespace: "WalletKit", version: "1.0.0", raw: "WalletKit/1.0.0" }
894
+ * parseNamespacedVersion("1.0.0") // { namespace: "WalletKit", version: "1.0.0", raw: "1.0.0" }
895
+ */ function parseNamespacedVersion(sdkVersion) {
896
+ if (!sdkVersion || sdkVersion === '') {
897
+ return null;
898
+ }
899
+ // Check if the version contains a namespace
900
+ const colonIndex = sdkVersion.indexOf('/');
901
+ if (colonIndex !== -1) {
902
+ const namespace = sdkVersion.substring(0, colonIndex);
903
+ const version = sdkVersion.substring(colonIndex + 1);
904
+ // Validate namespace
905
+ if (!Object.values(SDK_NAMESPACE).includes(namespace)) {
906
+ return {
907
+ namespace: SDK_NAMESPACE.REACT,
908
+ version,
909
+ raw: sdkVersion
910
+ };
911
+ }
912
+ return {
913
+ namespace: namespace,
914
+ version,
915
+ raw: sdkVersion
916
+ };
917
+ }
918
+ // No namespace found, default to react-sdk for backward compatibility
919
+ return {
920
+ namespace: 'WalletKit',
921
+ version: sdkVersion,
922
+ raw: sdkVersion
923
+ };
924
+ }
925
+ /**
926
+ * Formats a parsed SDK version back to string format
927
+ * @param parsedVersion - The parsed SDK version object
928
+ * @returns Formatted SDK version string
929
+ */ function formatNamespacedVersion(parsedVersion) {
930
+ return `${parsedVersion.namespace}/${parsedVersion.version}`;
931
+ }
932
+ /**
933
+ * Gets the version string without namespace
934
+ * @param sdkVersion - The SDK version string, optionally namespaced
935
+ * @returns Version string without namespace
936
+ */ function getVersionWithoutNamespace(sdkVersion) {
937
+ const parsed = parseNamespacedVersion(sdkVersion);
938
+ return parsed ? parsed.version : null;
939
+ }
940
+ /**
941
+ * Gets the namespace from a potentially namespaced SDK version
942
+ * @param sdkVersion - The SDK version string, optionally namespaced
943
+ * @returns The namespace or default namespace
944
+ */ function getVersionNamespace(sdkVersion) {
945
+ const parsed = parseNamespacedVersion(sdkVersion);
946
+ return parsed ? parsed.namespace : null;
947
+ }
948
+
884
949
  exports.AuthMode = AuthMode;
885
950
  exports.BITCOIN_DERIVATION_PATHS = BITCOIN_DERIVATION_PATHS;
886
951
  exports.BackupLocation = BackupLocation;
@@ -910,6 +975,7 @@ exports.MPC_CONFIG = MPC_CONFIG;
910
975
  exports.MPC_RELAY_DEV_API_URL = MPC_RELAY_DEV_API_URL;
911
976
  exports.MPC_RELAY_PREPROD_API_URL = MPC_RELAY_PREPROD_API_URL;
912
977
  exports.MPC_RELAY_PROD_API_URL = MPC_RELAY_PROD_API_URL;
978
+ exports.SDK_NAMESPACE = SDK_NAMESPACE;
913
979
  exports.SOLANA_RPC_URL = SOLANA_RPC_URL;
914
980
  exports.SigningAlgorithm = SigningAlgorithm;
915
981
  exports.SuccessEventType = SuccessEventType;
@@ -918,6 +984,7 @@ exports.URL_PATTERNS = URL_PATTERNS;
918
984
  exports.WalletOperation = WalletOperation;
919
985
  exports.chain = chain;
920
986
  exports.chainEnumToVerifiedCredentialName = chainEnumToVerifiedCredentialName;
987
+ exports.formatNamespacedVersion = formatNamespacedVersion;
921
988
  exports.getClientThreshold = getClientThreshold;
922
989
  exports.getDynamicServerThreshold = getDynamicServerThreshold;
923
990
  exports.getEnvironmentFromUrl = getEnvironmentFromUrl;
@@ -925,4 +992,7 @@ exports.getMPCChainConfig = getMPCChainConfig;
925
992
  exports.getReshareConfig = getReshareConfig;
926
993
  exports.getServerWalletReshareConfig = getServerWalletReshareConfig;
927
994
  exports.getTSSConfig = getTSSConfig;
995
+ exports.getVersionNamespace = getVersionNamespace;
996
+ exports.getVersionWithoutNamespace = getVersionWithoutNamespace;
997
+ exports.parseNamespacedVersion = parseNamespacedVersion;
928
998
  exports.verifiedCredentialNameToChainEnum = verifiedCredentialNameToChainEnum;
package/index.esm.js CHANGED
@@ -66,7 +66,7 @@ var BackupLocation = /*#__PURE__*/ function(BackupLocation) {
66
66
  return BackupLocation;
67
67
  }({});
68
68
  const IFRAME_DOMAIN_MAP = {
69
- development: 'http://localhost:4200',
69
+ development: 'http://localhost:8090',
70
70
  preprod: 'https://app.dynamic-preprod.xyz',
71
71
  production: 'https://app.dynamicauth.com'
72
72
  };
@@ -879,4 +879,69 @@ class DynamicApiClient extends BaseClient {
879
879
  }
880
880
  }
881
881
 
882
- export { AuthMode, BITCOIN_DERIVATION_PATHS, BackupLocation, CreateRoomPartiesOptions, DELEGATED_SHARE_COUNT, DYNAMIC_AUTH_BASE_API_URL_MAP, DYNAMIC_AUTH_DEV_BASE_API_URL, DYNAMIC_AUTH_PREPROD_BASE_API_URL, DYNAMIC_AUTH_PROD_BASE_API_URL, DYNAMIC_CLIENT_RELAY_DEV_BASE_API_URL, DYNAMIC_CLIENT_RELAY_DEV_REDCOAST_API_URL, DYNAMIC_CLIENT_RELAY_PREPROD_BASE_API_URL, DYNAMIC_CLIENT_RELAY_PREPROD_REDCOAST_API_URL, DYNAMIC_CLIENT_RELAY_PROD_BASE_API_URL, DYNAMIC_CLIENT_RELAY_PROD_REDCOAST_API_URL, DYNAMIC_CLIENT_RELAY_REDCOAST_MAP, DYNAMIC_CLIENT_USER_SHARE_RELAY_MAP, DynamicApiClient, DynamicClientSessionSignature, DynamicMfaTokenHeader, DynamicRequestIdHeader, ENVIRONMENT_ENUM, FEATURE_FLAGS, IFRAME_DOMAIN_MAP, MPC_CHAIN_CONFIG, MPC_CONFIG, MPC_RELAY_DEV_API_URL, MPC_RELAY_PREPROD_API_URL, MPC_RELAY_PROD_API_URL, SOLANA_RPC_URL, SigningAlgorithm, SuccessEventType, ThresholdSignatureScheme, URL_PATTERNS, WalletOperation, chain, chainEnumToVerifiedCredentialName, getClientThreshold, getDynamicServerThreshold, getEnvironmentFromUrl, getMPCChainConfig, getReshareConfig, getServerWalletReshareConfig, getTSSConfig, verifiedCredentialNameToChainEnum };
882
+ const SDK_NAMESPACE = {
883
+ REACT: 'WalletKit',
884
+ CLIENT: 'ClientSDK'
885
+ };
886
+ /**
887
+ * Parses a potentially namespaced SDK version string
888
+ * @param sdkVersion - The SDK version string, optionally namespaced
889
+ * @returns Parsed SDK version with namespace and version
890
+ * @example
891
+ * parseNamespacedVersion("WalletKit/1.0.0") // { namespace: "WalletKit", version: "1.0.0", raw: "WalletKit/1.0.0" }
892
+ * parseNamespacedVersion("1.0.0") // { namespace: "WalletKit", version: "1.0.0", raw: "1.0.0" }
893
+ */ function parseNamespacedVersion(sdkVersion) {
894
+ if (!sdkVersion || sdkVersion === '') {
895
+ return null;
896
+ }
897
+ // Check if the version contains a namespace
898
+ const colonIndex = sdkVersion.indexOf('/');
899
+ if (colonIndex !== -1) {
900
+ const namespace = sdkVersion.substring(0, colonIndex);
901
+ const version = sdkVersion.substring(colonIndex + 1);
902
+ // Validate namespace
903
+ if (!Object.values(SDK_NAMESPACE).includes(namespace)) {
904
+ return {
905
+ namespace: SDK_NAMESPACE.REACT,
906
+ version,
907
+ raw: sdkVersion
908
+ };
909
+ }
910
+ return {
911
+ namespace: namespace,
912
+ version,
913
+ raw: sdkVersion
914
+ };
915
+ }
916
+ // No namespace found, default to react-sdk for backward compatibility
917
+ return {
918
+ namespace: 'WalletKit',
919
+ version: sdkVersion,
920
+ raw: sdkVersion
921
+ };
922
+ }
923
+ /**
924
+ * Formats a parsed SDK version back to string format
925
+ * @param parsedVersion - The parsed SDK version object
926
+ * @returns Formatted SDK version string
927
+ */ function formatNamespacedVersion(parsedVersion) {
928
+ return `${parsedVersion.namespace}/${parsedVersion.version}`;
929
+ }
930
+ /**
931
+ * Gets the version string without namespace
932
+ * @param sdkVersion - The SDK version string, optionally namespaced
933
+ * @returns Version string without namespace
934
+ */ function getVersionWithoutNamespace(sdkVersion) {
935
+ const parsed = parseNamespacedVersion(sdkVersion);
936
+ return parsed ? parsed.version : null;
937
+ }
938
+ /**
939
+ * Gets the namespace from a potentially namespaced SDK version
940
+ * @param sdkVersion - The SDK version string, optionally namespaced
941
+ * @returns The namespace or default namespace
942
+ */ function getVersionNamespace(sdkVersion) {
943
+ const parsed = parseNamespacedVersion(sdkVersion);
944
+ return parsed ? parsed.namespace : null;
945
+ }
946
+
947
+ export { AuthMode, BITCOIN_DERIVATION_PATHS, BackupLocation, CreateRoomPartiesOptions, DELEGATED_SHARE_COUNT, DYNAMIC_AUTH_BASE_API_URL_MAP, DYNAMIC_AUTH_DEV_BASE_API_URL, DYNAMIC_AUTH_PREPROD_BASE_API_URL, DYNAMIC_AUTH_PROD_BASE_API_URL, DYNAMIC_CLIENT_RELAY_DEV_BASE_API_URL, DYNAMIC_CLIENT_RELAY_DEV_REDCOAST_API_URL, DYNAMIC_CLIENT_RELAY_PREPROD_BASE_API_URL, DYNAMIC_CLIENT_RELAY_PREPROD_REDCOAST_API_URL, DYNAMIC_CLIENT_RELAY_PROD_BASE_API_URL, DYNAMIC_CLIENT_RELAY_PROD_REDCOAST_API_URL, DYNAMIC_CLIENT_RELAY_REDCOAST_MAP, DYNAMIC_CLIENT_USER_SHARE_RELAY_MAP, DynamicApiClient, DynamicClientSessionSignature, DynamicMfaTokenHeader, DynamicRequestIdHeader, ENVIRONMENT_ENUM, FEATURE_FLAGS, IFRAME_DOMAIN_MAP, MPC_CHAIN_CONFIG, MPC_CONFIG, MPC_RELAY_DEV_API_URL, MPC_RELAY_PREPROD_API_URL, MPC_RELAY_PROD_API_URL, SDK_NAMESPACE, SOLANA_RPC_URL, SigningAlgorithm, SuccessEventType, ThresholdSignatureScheme, URL_PATTERNS, WalletOperation, chain, chainEnumToVerifiedCredentialName, formatNamespacedVersion, getClientThreshold, getDynamicServerThreshold, getEnvironmentFromUrl, getMPCChainConfig, getReshareConfig, getServerWalletReshareConfig, getTSSConfig, getVersionNamespace, getVersionWithoutNamespace, parseNamespacedVersion, verifiedCredentialNameToChainEnum };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs-wallet/core",
3
- "version": "0.0.144",
3
+ "version": "0.0.155",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "dependencies": {
@@ -61,7 +61,7 @@ export declare enum BackupLocation {
61
61
  EXTERNAL = "external"
62
62
  }
63
63
  export declare const IFRAME_DOMAIN_MAP: {
64
- readonly development: "http://localhost:4200";
64
+ readonly development: "http://localhost:8090";
65
65
  readonly preprod: "https://app.dynamic-preprod.xyz";
66
66
  readonly production: "https://app.dynamicauth.com";
67
67
  };
package/src/index.d.ts CHANGED
@@ -2,4 +2,5 @@ export * from './constants';
2
2
  export * from './mpc/index';
3
3
  export * from './api/index';
4
4
  export * from './types';
5
+ export * from './utils/index';
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../packages/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../packages/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './sdkVersion';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
@@ -0,0 +1,38 @@
1
+ export declare const SDK_NAMESPACE: {
2
+ readonly REACT: "WalletKit";
3
+ readonly CLIENT: "ClientSDK";
4
+ };
5
+ export type SdkNamespace = (typeof SDK_NAMESPACE)[keyof typeof SDK_NAMESPACE];
6
+ export interface ParsedSdkVersion {
7
+ namespace: SdkNamespace;
8
+ version: string;
9
+ raw: string;
10
+ }
11
+ /**
12
+ * Parses a potentially namespaced SDK version string
13
+ * @param sdkVersion - The SDK version string, optionally namespaced
14
+ * @returns Parsed SDK version with namespace and version
15
+ * @example
16
+ * parseNamespacedVersion("WalletKit/1.0.0") // { namespace: "WalletKit", version: "1.0.0", raw: "WalletKit/1.0.0" }
17
+ * parseNamespacedVersion("1.0.0") // { namespace: "WalletKit", version: "1.0.0", raw: "1.0.0" }
18
+ */
19
+ export declare function parseNamespacedVersion(sdkVersion: string | undefined | null): ParsedSdkVersion | null;
20
+ /**
21
+ * Formats a parsed SDK version back to string format
22
+ * @param parsedVersion - The parsed SDK version object
23
+ * @returns Formatted SDK version string
24
+ */
25
+ export declare function formatNamespacedVersion(parsedVersion: ParsedSdkVersion): string;
26
+ /**
27
+ * Gets the version string without namespace
28
+ * @param sdkVersion - The SDK version string, optionally namespaced
29
+ * @returns Version string without namespace
30
+ */
31
+ export declare function getVersionWithoutNamespace(sdkVersion: string | undefined | null): string | null;
32
+ /**
33
+ * Gets the namespace from a potentially namespaced SDK version
34
+ * @param sdkVersion - The SDK version string, optionally namespaced
35
+ * @returns The namespace or default namespace
36
+ */
37
+ export declare function getVersionNamespace(sdkVersion: string | undefined | null): SdkNamespace | null;
38
+ //# sourceMappingURL=sdkVersion.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sdkVersion.d.ts","sourceRoot":"","sources":["../../src/utils/sdkVersion.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa;;;CAGhB,CAAC;AAEX,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,OAAO,aAAa,CAAC,CAAC;AAE9E,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,YAAY,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GACpC,gBAAgB,GAAG,IAAI,CAkCzB;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CACrC,aAAa,EAAE,gBAAgB,GAC9B,MAAM,CAER;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CACxC,UAAU,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GACpC,MAAM,GAAG,IAAI,CAGf;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,UAAU,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GACpC,YAAY,GAAG,IAAI,CAGrB"}