@dynamic-labs-wallet/browser 0.0.28 → 0.0.30
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 +49 -15
- package/index.esm.js +49 -15
- package/package.json +2 -2
- package/src/client.d.ts +5 -6
- package/src/client.d.ts.map +1 -1
- package/src/utils.d.ts +5 -0
- package/src/utils.d.ts.map +1 -1
package/index.cjs.js
CHANGED
|
@@ -36,6 +36,10 @@ const getMPCSigner = ({ chainName, baseRelayUrl })=>{
|
|
|
36
36
|
return signatureScheme;
|
|
37
37
|
};
|
|
38
38
|
|
|
39
|
+
const DEFAULT_LOG_LEVEL = 'INFO';
|
|
40
|
+
const STORAGE_KEY = 'dynamic-waas-wallet-client';
|
|
41
|
+
const CLIENT_KEYSHARE_EXPORT_FILENAME_PREFIX = 'dynamicWalletKeyShareBackup';
|
|
42
|
+
|
|
39
43
|
const bytesToBase64 = (arr)=>{
|
|
40
44
|
return btoa(Array.from(arr, (b)=>String.fromCharCode(b)).join(''));
|
|
41
45
|
};
|
|
@@ -56,6 +60,9 @@ const isHexString = (str)=>{
|
|
|
56
60
|
// Check if string contains only hex characters
|
|
57
61
|
return /^[0-9A-Fa-f]+$/.test(hex);
|
|
58
62
|
};
|
|
63
|
+
const getClientKeyShareExportFileName = ({ thresholdSignatureScheme, accountAddress })=>{
|
|
64
|
+
return `${CLIENT_KEYSHARE_EXPORT_FILENAME_PREFIX}-${thresholdSignatureScheme}-${accountAddress}.json`;
|
|
65
|
+
};
|
|
59
66
|
|
|
60
67
|
const getKey = async ({ password, salt })=>{
|
|
61
68
|
const passwordBytes = stringToBytes(password);
|
|
@@ -198,11 +205,6 @@ const downloadFileFromGoogleDrive = async ({ accessToken, name })=>{
|
|
|
198
205
|
return JSON.parse(fileRawData);
|
|
199
206
|
};
|
|
200
207
|
|
|
201
|
-
const DEFAULT_LOG_LEVEL = 'INFO';
|
|
202
|
-
const STORAGE_KEY = 'dynamic-waas-wallet-client';
|
|
203
|
-
const BACKUP_FILENAME = 'dynamicWalletKeyShareBackup.json';
|
|
204
|
-
const CLIENT_KEYSHARE_EXPORT_FILENAME_PREFIX = 'dynamicWalletKeyShareBackup';
|
|
205
|
-
|
|
206
208
|
const localStorageWriteTest = {
|
|
207
209
|
tested: false,
|
|
208
210
|
writable: false
|
|
@@ -682,14 +684,15 @@ class DynamicWalletClient {
|
|
|
682
684
|
const deserializedKeyShare = JSON.parse(decryptedKeyShare);
|
|
683
685
|
return deserializedKeyShare;
|
|
684
686
|
}
|
|
685
|
-
async recoverEncryptedBackupByWallet({ accountAddress, password
|
|
687
|
+
async recoverEncryptedBackupByWallet({ accountAddress, password }) {
|
|
686
688
|
const wallet = this.walletMap[accountAddress];
|
|
687
689
|
this.logger.debug('recoverEncryptedBackupByWallet wallet', wallet);
|
|
688
690
|
const data = await this.apiClient.recoverEncryptedBackupByWallet({
|
|
689
|
-
walletId: wallet.walletId
|
|
690
|
-
keyShareIds
|
|
691
|
+
walletId: wallet.walletId
|
|
691
692
|
});
|
|
692
|
-
|
|
693
|
+
// TODO: allow handling backup from other sources
|
|
694
|
+
const dynamicKeyShares = data.keyShares.filter((keyShare)=>keyShare.encryptedAccountCredential !== null && keyShare.backupLocation === 'dynamic');
|
|
695
|
+
const decryptedKeyShares = await Promise.all(dynamicKeyShares.map((keyShare)=>this.decryptKeyShare({
|
|
693
696
|
keyShare: keyShare.encryptedAccountCredential,
|
|
694
697
|
password: password != null ? password : this.environmentId
|
|
695
698
|
})));
|
|
@@ -726,17 +729,29 @@ class DynamicWalletClient {
|
|
|
726
729
|
};
|
|
727
730
|
await this.storage.setItem(this.storageKey, JSON.stringify(this.walletMap));
|
|
728
731
|
}
|
|
729
|
-
async backupKeySharesToGoogleDrive({ accountAddress, fileName
|
|
730
|
-
|
|
732
|
+
async backupKeySharesToGoogleDrive({ accountAddress, fileName, oauthAccountId, password }) {
|
|
733
|
+
await this.getWallet({
|
|
734
|
+
accountAddress
|
|
735
|
+
});
|
|
736
|
+
const clientKeyShares = this.walletMap[accountAddress].clientKeyShares;
|
|
737
|
+
if (clientKeyShares.length === 0) {
|
|
738
|
+
throw new Error('No key shares found');
|
|
739
|
+
}
|
|
740
|
+
const encryptedKeyShares = await Promise.all(clientKeyShares.map((keyShare)=>this.encryptKeyShare({
|
|
731
741
|
keyShare,
|
|
732
742
|
password
|
|
733
743
|
})));
|
|
734
744
|
const accessToken = await this.apiClient.getAccessToken({
|
|
735
745
|
oauthAccountId
|
|
736
746
|
});
|
|
747
|
+
const thresholdSignatureScheme = this.walletMap[accountAddress].thresholdSignatureScheme;
|
|
748
|
+
const suggestedFileName = getClientKeyShareExportFileName({
|
|
749
|
+
thresholdSignatureScheme,
|
|
750
|
+
accountAddress
|
|
751
|
+
});
|
|
737
752
|
const uploadMetadata = await uploadFileToGoogleDrive({
|
|
738
753
|
accessToken,
|
|
739
|
-
fileName,
|
|
754
|
+
fileName: fileName != null ? fileName : suggestedFileName,
|
|
740
755
|
jsonData: encryptedKeyShares
|
|
741
756
|
});
|
|
742
757
|
await this.apiClient.markKeySharesAsBackedUpGoogleDrive({
|
|
@@ -744,13 +759,21 @@ class DynamicWalletClient {
|
|
|
744
759
|
});
|
|
745
760
|
return uploadMetadata;
|
|
746
761
|
}
|
|
747
|
-
async restoreBackupFromGoogleDrive({ oauthAccountId, name
|
|
762
|
+
async restoreBackupFromGoogleDrive({ accountAddress, oauthAccountId, name, password }) {
|
|
763
|
+
await this.getWallet({
|
|
764
|
+
accountAddress
|
|
765
|
+
});
|
|
748
766
|
const accessToken = await this.apiClient.getAccessToken({
|
|
749
767
|
oauthAccountId
|
|
750
768
|
});
|
|
769
|
+
const thresholdSignatureScheme = this.walletMap[accountAddress].thresholdSignatureScheme;
|
|
770
|
+
const suggestedFileName = getClientKeyShareExportFileName({
|
|
771
|
+
thresholdSignatureScheme,
|
|
772
|
+
accountAddress
|
|
773
|
+
});
|
|
751
774
|
const file = await downloadFileFromGoogleDrive({
|
|
752
775
|
accessToken,
|
|
753
|
-
name
|
|
776
|
+
name: name != null ? name : suggestedFileName
|
|
754
777
|
});
|
|
755
778
|
if (!file) {
|
|
756
779
|
throw new Error('No file found');
|
|
@@ -760,8 +783,19 @@ class DynamicWalletClient {
|
|
|
760
783
|
];
|
|
761
784
|
const decryptedKeyShares = await Promise.all(fileArray.map((keyShare)=>this.decryptKeyShare({
|
|
762
785
|
keyShare,
|
|
763
|
-
password
|
|
786
|
+
password
|
|
764
787
|
})));
|
|
788
|
+
const existingKeyShares = this.walletMap[accountAddress].clientKeyShares || [];
|
|
789
|
+
const uniqueKeyShares = decryptedKeyShares.filter((newShare)=>!existingKeyShares.some((existingShare)=>{
|
|
790
|
+
if (!(newShare == null ? void 0 : newShare.pubkey) || !(existingShare == null ? void 0 : existingShare.pubkey)) return false;
|
|
791
|
+
return newShare.pubkey.toString() === existingShare.pubkey.toString() && newShare.secretShare === existingShare.secretShare;
|
|
792
|
+
}));
|
|
793
|
+
this.walletMap[accountAddress] = _extends({}, this.walletMap[accountAddress], {
|
|
794
|
+
clientKeyShares: [
|
|
795
|
+
...existingKeyShares,
|
|
796
|
+
...uniqueKeyShares
|
|
797
|
+
]
|
|
798
|
+
});
|
|
765
799
|
return decryptedKeyShares;
|
|
766
800
|
}
|
|
767
801
|
async importRawPrivateKey({ chainName, privateKey, thresholdSignatureScheme }) {
|
package/index.esm.js
CHANGED
|
@@ -36,6 +36,10 @@ const getMPCSigner = ({ chainName, baseRelayUrl })=>{
|
|
|
36
36
|
return signatureScheme;
|
|
37
37
|
};
|
|
38
38
|
|
|
39
|
+
const DEFAULT_LOG_LEVEL = 'INFO';
|
|
40
|
+
const STORAGE_KEY = 'dynamic-waas-wallet-client';
|
|
41
|
+
const CLIENT_KEYSHARE_EXPORT_FILENAME_PREFIX = 'dynamicWalletKeyShareBackup';
|
|
42
|
+
|
|
39
43
|
const bytesToBase64 = (arr)=>{
|
|
40
44
|
return btoa(Array.from(arr, (b)=>String.fromCharCode(b)).join(''));
|
|
41
45
|
};
|
|
@@ -56,6 +60,9 @@ const isHexString = (str)=>{
|
|
|
56
60
|
// Check if string contains only hex characters
|
|
57
61
|
return /^[0-9A-Fa-f]+$/.test(hex);
|
|
58
62
|
};
|
|
63
|
+
const getClientKeyShareExportFileName = ({ thresholdSignatureScheme, accountAddress })=>{
|
|
64
|
+
return `${CLIENT_KEYSHARE_EXPORT_FILENAME_PREFIX}-${thresholdSignatureScheme}-${accountAddress}.json`;
|
|
65
|
+
};
|
|
59
66
|
|
|
60
67
|
const getKey = async ({ password, salt })=>{
|
|
61
68
|
const passwordBytes = stringToBytes(password);
|
|
@@ -198,11 +205,6 @@ const downloadFileFromGoogleDrive = async ({ accessToken, name })=>{
|
|
|
198
205
|
return JSON.parse(fileRawData);
|
|
199
206
|
};
|
|
200
207
|
|
|
201
|
-
const DEFAULT_LOG_LEVEL = 'INFO';
|
|
202
|
-
const STORAGE_KEY = 'dynamic-waas-wallet-client';
|
|
203
|
-
const BACKUP_FILENAME = 'dynamicWalletKeyShareBackup.json';
|
|
204
|
-
const CLIENT_KEYSHARE_EXPORT_FILENAME_PREFIX = 'dynamicWalletKeyShareBackup';
|
|
205
|
-
|
|
206
208
|
const localStorageWriteTest = {
|
|
207
209
|
tested: false,
|
|
208
210
|
writable: false
|
|
@@ -682,14 +684,15 @@ class DynamicWalletClient {
|
|
|
682
684
|
const deserializedKeyShare = JSON.parse(decryptedKeyShare);
|
|
683
685
|
return deserializedKeyShare;
|
|
684
686
|
}
|
|
685
|
-
async recoverEncryptedBackupByWallet({ accountAddress, password
|
|
687
|
+
async recoverEncryptedBackupByWallet({ accountAddress, password }) {
|
|
686
688
|
const wallet = this.walletMap[accountAddress];
|
|
687
689
|
this.logger.debug('recoverEncryptedBackupByWallet wallet', wallet);
|
|
688
690
|
const data = await this.apiClient.recoverEncryptedBackupByWallet({
|
|
689
|
-
walletId: wallet.walletId
|
|
690
|
-
keyShareIds
|
|
691
|
+
walletId: wallet.walletId
|
|
691
692
|
});
|
|
692
|
-
|
|
693
|
+
// TODO: allow handling backup from other sources
|
|
694
|
+
const dynamicKeyShares = data.keyShares.filter((keyShare)=>keyShare.encryptedAccountCredential !== null && keyShare.backupLocation === 'dynamic');
|
|
695
|
+
const decryptedKeyShares = await Promise.all(dynamicKeyShares.map((keyShare)=>this.decryptKeyShare({
|
|
693
696
|
keyShare: keyShare.encryptedAccountCredential,
|
|
694
697
|
password: password != null ? password : this.environmentId
|
|
695
698
|
})));
|
|
@@ -726,17 +729,29 @@ class DynamicWalletClient {
|
|
|
726
729
|
};
|
|
727
730
|
await this.storage.setItem(this.storageKey, JSON.stringify(this.walletMap));
|
|
728
731
|
}
|
|
729
|
-
async backupKeySharesToGoogleDrive({ accountAddress, fileName
|
|
730
|
-
|
|
732
|
+
async backupKeySharesToGoogleDrive({ accountAddress, fileName, oauthAccountId, password }) {
|
|
733
|
+
await this.getWallet({
|
|
734
|
+
accountAddress
|
|
735
|
+
});
|
|
736
|
+
const clientKeyShares = this.walletMap[accountAddress].clientKeyShares;
|
|
737
|
+
if (clientKeyShares.length === 0) {
|
|
738
|
+
throw new Error('No key shares found');
|
|
739
|
+
}
|
|
740
|
+
const encryptedKeyShares = await Promise.all(clientKeyShares.map((keyShare)=>this.encryptKeyShare({
|
|
731
741
|
keyShare,
|
|
732
742
|
password
|
|
733
743
|
})));
|
|
734
744
|
const accessToken = await this.apiClient.getAccessToken({
|
|
735
745
|
oauthAccountId
|
|
736
746
|
});
|
|
747
|
+
const thresholdSignatureScheme = this.walletMap[accountAddress].thresholdSignatureScheme;
|
|
748
|
+
const suggestedFileName = getClientKeyShareExportFileName({
|
|
749
|
+
thresholdSignatureScheme,
|
|
750
|
+
accountAddress
|
|
751
|
+
});
|
|
737
752
|
const uploadMetadata = await uploadFileToGoogleDrive({
|
|
738
753
|
accessToken,
|
|
739
|
-
fileName,
|
|
754
|
+
fileName: fileName != null ? fileName : suggestedFileName,
|
|
740
755
|
jsonData: encryptedKeyShares
|
|
741
756
|
});
|
|
742
757
|
await this.apiClient.markKeySharesAsBackedUpGoogleDrive({
|
|
@@ -744,13 +759,21 @@ class DynamicWalletClient {
|
|
|
744
759
|
});
|
|
745
760
|
return uploadMetadata;
|
|
746
761
|
}
|
|
747
|
-
async restoreBackupFromGoogleDrive({ oauthAccountId, name
|
|
762
|
+
async restoreBackupFromGoogleDrive({ accountAddress, oauthAccountId, name, password }) {
|
|
763
|
+
await this.getWallet({
|
|
764
|
+
accountAddress
|
|
765
|
+
});
|
|
748
766
|
const accessToken = await this.apiClient.getAccessToken({
|
|
749
767
|
oauthAccountId
|
|
750
768
|
});
|
|
769
|
+
const thresholdSignatureScheme = this.walletMap[accountAddress].thresholdSignatureScheme;
|
|
770
|
+
const suggestedFileName = getClientKeyShareExportFileName({
|
|
771
|
+
thresholdSignatureScheme,
|
|
772
|
+
accountAddress
|
|
773
|
+
});
|
|
751
774
|
const file = await downloadFileFromGoogleDrive({
|
|
752
775
|
accessToken,
|
|
753
|
-
name
|
|
776
|
+
name: name != null ? name : suggestedFileName
|
|
754
777
|
});
|
|
755
778
|
if (!file) {
|
|
756
779
|
throw new Error('No file found');
|
|
@@ -760,8 +783,19 @@ class DynamicWalletClient {
|
|
|
760
783
|
];
|
|
761
784
|
const decryptedKeyShares = await Promise.all(fileArray.map((keyShare)=>this.decryptKeyShare({
|
|
762
785
|
keyShare,
|
|
763
|
-
password
|
|
786
|
+
password
|
|
764
787
|
})));
|
|
788
|
+
const existingKeyShares = this.walletMap[accountAddress].clientKeyShares || [];
|
|
789
|
+
const uniqueKeyShares = decryptedKeyShares.filter((newShare)=>!existingKeyShares.some((existingShare)=>{
|
|
790
|
+
if (!(newShare == null ? void 0 : newShare.pubkey) || !(existingShare == null ? void 0 : existingShare.pubkey)) return false;
|
|
791
|
+
return newShare.pubkey.toString() === existingShare.pubkey.toString() && newShare.secretShare === existingShare.secretShare;
|
|
792
|
+
}));
|
|
793
|
+
this.walletMap[accountAddress] = _extends({}, this.walletMap[accountAddress], {
|
|
794
|
+
clientKeyShares: [
|
|
795
|
+
...existingKeyShares,
|
|
796
|
+
...uniqueKeyShares
|
|
797
|
+
]
|
|
798
|
+
});
|
|
765
799
|
return decryptedKeyShares;
|
|
766
800
|
}
|
|
767
801
|
async importRawPrivateKey({ chainName, privateKey, thresholdSignatureScheme }) {
|
package/package.json
CHANGED
package/src/client.d.ts
CHANGED
|
@@ -132,11 +132,10 @@ export declare class DynamicWalletClient {
|
|
|
132
132
|
decryptKeyShare({ keyShare, password, }: {
|
|
133
133
|
keyShare: string;
|
|
134
134
|
password?: string;
|
|
135
|
-
}): Promise<
|
|
136
|
-
recoverEncryptedBackupByWallet({ accountAddress, password,
|
|
135
|
+
}): Promise<ClientKeyShare>;
|
|
136
|
+
recoverEncryptedBackupByWallet({ accountAddress, password, }: {
|
|
137
137
|
accountAddress: string;
|
|
138
138
|
password?: string;
|
|
139
|
-
keyShareIds?: string[];
|
|
140
139
|
}): Promise<any[]>;
|
|
141
140
|
restoreWallets(): Promise<void>;
|
|
142
141
|
restoreBackupShare({ walletId, accountAddress, chainName, keyShare, thresholdSignatureScheme, }: {
|
|
@@ -146,14 +145,14 @@ export declare class DynamicWalletClient {
|
|
|
146
145
|
keyShare: ClientKeyShare;
|
|
147
146
|
thresholdSignatureScheme: ThresholdSignatureScheme;
|
|
148
147
|
}): Promise<void>;
|
|
149
|
-
backupKeySharesToGoogleDrive({ accountAddress, fileName,
|
|
148
|
+
backupKeySharesToGoogleDrive({ accountAddress, fileName, oauthAccountId, password, }: {
|
|
150
149
|
accountAddress: string;
|
|
151
150
|
fileName?: string;
|
|
152
|
-
keyShares: ClientKeyShare[];
|
|
153
151
|
oauthAccountId: string;
|
|
154
152
|
password?: string;
|
|
155
153
|
}): Promise<any>;
|
|
156
|
-
restoreBackupFromGoogleDrive({ oauthAccountId, name, password, }: {
|
|
154
|
+
restoreBackupFromGoogleDrive({ accountAddress, oauthAccountId, name, password, }: {
|
|
155
|
+
accountAddress: string;
|
|
157
156
|
oauthAccountId: string;
|
|
158
157
|
name?: string;
|
|
159
158
|
password?: string;
|
package/src/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../packages/src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,wBAAwB,EACxB,gBAAgB,EAIjB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAIL,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAElB,cAAc,EACf,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../packages/src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,wBAAwB,EACxB,gBAAgB,EAIjB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAIL,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAElB,cAAc,EACf,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAWrE,OAAO,EAGL,gBAAgB,EAEjB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,wBAAwB,EACxB,gBAAgB,EAChB,gBAAgB,EACjB,MAAM,SAAS,CAAC;AAIjB,qBAAa,mBAAmB;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,OAAO,CAAC;IAEtB,SAAS,CAAC,iBAAiB,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAAG,IAAI,CAAQ;IACrE,SAAS,CAAC,MAAM,wCAAU;IAC1B,SAAS,CAAC,SAAS,EAAE,gBAAgB,CAAC;IACtC,SAAS,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAM;IAC3D,SAAS,CAAC,OAAO,EAAE,gBAAg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nC,CAAC;IAkEI,qBAAqB,CAAC,EAAE,cAAc,EAAE,EAAE;QAAE,cAAc,CAAC,EAAE,MAAM,CAAA;KAAE;IAarE,kBAAkB,CAAC,EAAE,cAAc,EAAE,EAAE;QAAE,cAAc,CAAC,EAAE,MAAM,CAAA;KAAE;IAKlE,SAAS,CAAC,EAAE,cAAc,EAAE,EAAE;QAAE,cAAc,CAAC,EAAE,MAAM,CAAA;KAAE;IA6DzD,UAAU;CA0BjB"}
|
package/src/utils.d.ts
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
|
+
import { ThresholdSignatureScheme } from "@dynamic-labs-wallet/core";
|
|
1
2
|
export declare const bytesToBase64: (arr: Uint8Array) => string;
|
|
2
3
|
export declare const stringToBytes: (str: string) => Uint8Array;
|
|
3
4
|
export declare const base64ToBytes: (base64: string) => Uint8Array;
|
|
4
5
|
export declare const ensureBase64Padding: (str: string) => string;
|
|
5
6
|
export declare const isBrowser: () => boolean;
|
|
6
7
|
export declare const isHexString: (str: string) => boolean;
|
|
8
|
+
export declare const getClientKeyShareExportFileName: ({ thresholdSignatureScheme, accountAddress, }: {
|
|
9
|
+
thresholdSignatureScheme: ThresholdSignatureScheme;
|
|
10
|
+
accountAddress: string;
|
|
11
|
+
}) => string;
|
|
7
12
|
//# sourceMappingURL=utils.d.ts.map
|
package/src/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../packages/src/utils.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,QAAS,UAAU,WAE5C,CAAC;AAEF,eAAO,MAAM,aAAa,QAAS,MAAM,eAExC,CAAC;AAEF,eAAO,MAAM,aAAa,WAAY,MAAM,eAE3C,CAAC;AAGF,eAAO,MAAM,mBAAmB,QAAS,MAAM,KAAG,MAEjD,CAAC;AAEF,eAAO,MAAM,SAAS,eAAsC,CAAC;AAE7D,eAAO,MAAM,WAAW,QAAS,MAAM,YAKtC,CAAC"}
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../packages/src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAGrE,eAAO,MAAM,aAAa,QAAS,UAAU,WAE5C,CAAC;AAEF,eAAO,MAAM,aAAa,QAAS,MAAM,eAExC,CAAC;AAEF,eAAO,MAAM,aAAa,WAAY,MAAM,eAE3C,CAAC;AAGF,eAAO,MAAM,mBAAmB,QAAS,MAAM,KAAG,MAEjD,CAAC;AAEF,eAAO,MAAM,SAAS,eAAsC,CAAC;AAE7D,eAAO,MAAM,WAAW,QAAS,MAAM,YAKtC,CAAC;AAEF,eAAO,MAAM,+BAA+B,kDAGzC;IACD,wBAAwB,EAAE,wBAAwB,CAAC;IACnD,cAAc,EAAE,MAAM,CAAC;CACxB,WAEE,CAAC"}
|