@dynamic-labs-wallet/browser 0.0.21 → 0.0.22
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 +18 -12
- package/index.esm.js +18 -12
- package/package.json +2 -2
- package/src/client.d.ts.map +1 -1
- package/src/constants.d.ts +2 -1
- package/src/constants.d.ts.map +1 -1
- package/src/localStorage.d.ts +0 -32
- package/src/localStorage.d.ts.map +0 -1
- package/src/logger.d.ts +0 -3
- package/src/logger.d.ts.map +0 -1
package/index.cjs.js
CHANGED
|
@@ -194,7 +194,8 @@ const downloadFileFromGoogleDrive = async ({ accessToken, name })=>{
|
|
|
194
194
|
|
|
195
195
|
const DEFAULT_LOG_LEVEL = 'INFO';
|
|
196
196
|
const STORAGE_KEY = 'dynamic-waas-wallet-client';
|
|
197
|
-
const BACKUP_FILENAME = '
|
|
197
|
+
const BACKUP_FILENAME = 'dynamicWalletKeyShareBackup.json';
|
|
198
|
+
const CLIENT_KEYSHARE_EXPORT_FILENAME_PREFIX = 'dynamicWalletKeyShareBackup';
|
|
198
199
|
|
|
199
200
|
const localStorageWriteTest = {
|
|
200
201
|
tested: false,
|
|
@@ -664,8 +665,10 @@ class DynamicWalletClient {
|
|
|
664
665
|
return deserializedKeyShare;
|
|
665
666
|
}
|
|
666
667
|
async recoverEncryptedBackupByWallet({ accountAddress, password, keyShareIds }) {
|
|
668
|
+
const wallet = this.walletMap[accountAddress];
|
|
669
|
+
this.logger.debug('recoverEncryptedBackupByWallet wallet', wallet);
|
|
667
670
|
const data = await this.apiClient.recoverEncryptedBackupByWallet({
|
|
668
|
-
walletId:
|
|
671
|
+
walletId: wallet.walletId,
|
|
669
672
|
keyShareIds
|
|
670
673
|
});
|
|
671
674
|
const decryptedKeyShares = await Promise.all(data.keyShares.map((keyShare)=>this.decryptKeyShare({
|
|
@@ -674,7 +677,7 @@ class DynamicWalletClient {
|
|
|
674
677
|
})));
|
|
675
678
|
decryptedKeyShares.forEach((keyShare)=>{
|
|
676
679
|
this.restoreBackupShare({
|
|
677
|
-
walletId:
|
|
680
|
+
walletId: wallet.walletId,
|
|
678
681
|
accountAddress,
|
|
679
682
|
chainName: data.chainName,
|
|
680
683
|
keyShare,
|
|
@@ -790,7 +793,7 @@ class DynamicWalletClient {
|
|
|
790
793
|
const url = URL.createObjectURL(blob);
|
|
791
794
|
const a = document.createElement('a');
|
|
792
795
|
a.href = url;
|
|
793
|
-
a.download =
|
|
796
|
+
a.download = `${CLIENT_KEYSHARE_EXPORT_FILENAME_PREFIX}-${accountAddress}.txt`;
|
|
794
797
|
a.click();
|
|
795
798
|
}
|
|
796
799
|
async getClientKeyShares({ accountAddress }) {
|
|
@@ -802,27 +805,30 @@ class DynamicWalletClient {
|
|
|
802
805
|
async getWallet({ accountAddress }) {
|
|
803
806
|
if (accountAddress) {
|
|
804
807
|
if (this.walletMap[accountAddress] && this.walletMap[accountAddress].clientKeyShares.length > 0) {
|
|
808
|
+
this.logger.debug('Wallet already exists', this.walletMap[accountAddress]);
|
|
805
809
|
return this.walletMap[accountAddress];
|
|
806
810
|
} else {
|
|
807
811
|
var _user_verifiedCredentials;
|
|
812
|
+
this.logger.debug('Wallet needs to be restored', this.walletMap[accountAddress]);
|
|
808
813
|
const user = await this.apiClient.getUser();
|
|
809
814
|
const wallet = (_user_verifiedCredentials = user.verifiedCredentials) == null ? void 0 : _user_verifiedCredentials.find((vc)=>vc.address === accountAddress);
|
|
810
|
-
this.logger.debug('
|
|
811
|
-
console.log('need to restore wallet', wallet);
|
|
815
|
+
this.logger.debug('Restoring wallet', wallet);
|
|
812
816
|
const clientShares = wallet.walletProperties.keyShares.filter((ks)=>ks.backupLocation === 'dynamic');
|
|
813
817
|
this.logger.debug('clientShares', clientShares);
|
|
818
|
+
const walletProperties = wallet.walletProperties;
|
|
819
|
+
this.walletMap[accountAddress] = _extends({}, this.walletMap[accountAddress], {
|
|
820
|
+
walletId: wallet.id,
|
|
821
|
+
chainName: wallet.chainName,
|
|
822
|
+
accountAddress,
|
|
823
|
+
thresholdSignatureScheme: walletProperties.thresholdSignatureScheme
|
|
824
|
+
});
|
|
814
825
|
// restore backup
|
|
815
826
|
const decryptedKeyShares = await this.recoverEncryptedBackupByWallet({
|
|
816
827
|
accountAddress,
|
|
817
828
|
password: this.environmentId
|
|
818
829
|
});
|
|
819
|
-
// update threshold signature scheme
|
|
820
|
-
const thresholdSignatureScheme = wallet.walletProperties.thresholdSignatureScheme;
|
|
821
|
-
this.walletMap[accountAddress] = _extends({}, this.walletMap[accountAddress], {
|
|
822
|
-
thresholdSignatureScheme
|
|
823
|
-
});
|
|
824
830
|
//todo: check to see if their are other backups ie google drive, etc
|
|
825
|
-
this.logger.debug('
|
|
831
|
+
this.logger.debug('Recovered backup', decryptedKeyShares);
|
|
826
832
|
}
|
|
827
833
|
}
|
|
828
834
|
const walletCount = Object.keys(this.walletMap).length;
|
package/index.esm.js
CHANGED
|
@@ -194,7 +194,8 @@ const downloadFileFromGoogleDrive = async ({ accessToken, name })=>{
|
|
|
194
194
|
|
|
195
195
|
const DEFAULT_LOG_LEVEL = 'INFO';
|
|
196
196
|
const STORAGE_KEY = 'dynamic-waas-wallet-client';
|
|
197
|
-
const BACKUP_FILENAME = '
|
|
197
|
+
const BACKUP_FILENAME = 'dynamicWalletKeyShareBackup.json';
|
|
198
|
+
const CLIENT_KEYSHARE_EXPORT_FILENAME_PREFIX = 'dynamicWalletKeyShareBackup';
|
|
198
199
|
|
|
199
200
|
const localStorageWriteTest = {
|
|
200
201
|
tested: false,
|
|
@@ -664,8 +665,10 @@ class DynamicWalletClient {
|
|
|
664
665
|
return deserializedKeyShare;
|
|
665
666
|
}
|
|
666
667
|
async recoverEncryptedBackupByWallet({ accountAddress, password, keyShareIds }) {
|
|
668
|
+
const wallet = this.walletMap[accountAddress];
|
|
669
|
+
this.logger.debug('recoverEncryptedBackupByWallet wallet', wallet);
|
|
667
670
|
const data = await this.apiClient.recoverEncryptedBackupByWallet({
|
|
668
|
-
walletId:
|
|
671
|
+
walletId: wallet.walletId,
|
|
669
672
|
keyShareIds
|
|
670
673
|
});
|
|
671
674
|
const decryptedKeyShares = await Promise.all(data.keyShares.map((keyShare)=>this.decryptKeyShare({
|
|
@@ -674,7 +677,7 @@ class DynamicWalletClient {
|
|
|
674
677
|
})));
|
|
675
678
|
decryptedKeyShares.forEach((keyShare)=>{
|
|
676
679
|
this.restoreBackupShare({
|
|
677
|
-
walletId:
|
|
680
|
+
walletId: wallet.walletId,
|
|
678
681
|
accountAddress,
|
|
679
682
|
chainName: data.chainName,
|
|
680
683
|
keyShare,
|
|
@@ -790,7 +793,7 @@ class DynamicWalletClient {
|
|
|
790
793
|
const url = URL.createObjectURL(blob);
|
|
791
794
|
const a = document.createElement('a');
|
|
792
795
|
a.href = url;
|
|
793
|
-
a.download =
|
|
796
|
+
a.download = `${CLIENT_KEYSHARE_EXPORT_FILENAME_PREFIX}-${accountAddress}.txt`;
|
|
794
797
|
a.click();
|
|
795
798
|
}
|
|
796
799
|
async getClientKeyShares({ accountAddress }) {
|
|
@@ -802,27 +805,30 @@ class DynamicWalletClient {
|
|
|
802
805
|
async getWallet({ accountAddress }) {
|
|
803
806
|
if (accountAddress) {
|
|
804
807
|
if (this.walletMap[accountAddress] && this.walletMap[accountAddress].clientKeyShares.length > 0) {
|
|
808
|
+
this.logger.debug('Wallet already exists', this.walletMap[accountAddress]);
|
|
805
809
|
return this.walletMap[accountAddress];
|
|
806
810
|
} else {
|
|
807
811
|
var _user_verifiedCredentials;
|
|
812
|
+
this.logger.debug('Wallet needs to be restored', this.walletMap[accountAddress]);
|
|
808
813
|
const user = await this.apiClient.getUser();
|
|
809
814
|
const wallet = (_user_verifiedCredentials = user.verifiedCredentials) == null ? void 0 : _user_verifiedCredentials.find((vc)=>vc.address === accountAddress);
|
|
810
|
-
this.logger.debug('
|
|
811
|
-
console.log('need to restore wallet', wallet);
|
|
815
|
+
this.logger.debug('Restoring wallet', wallet);
|
|
812
816
|
const clientShares = wallet.walletProperties.keyShares.filter((ks)=>ks.backupLocation === 'dynamic');
|
|
813
817
|
this.logger.debug('clientShares', clientShares);
|
|
818
|
+
const walletProperties = wallet.walletProperties;
|
|
819
|
+
this.walletMap[accountAddress] = _extends({}, this.walletMap[accountAddress], {
|
|
820
|
+
walletId: wallet.id,
|
|
821
|
+
chainName: wallet.chainName,
|
|
822
|
+
accountAddress,
|
|
823
|
+
thresholdSignatureScheme: walletProperties.thresholdSignatureScheme
|
|
824
|
+
});
|
|
814
825
|
// restore backup
|
|
815
826
|
const decryptedKeyShares = await this.recoverEncryptedBackupByWallet({
|
|
816
827
|
accountAddress,
|
|
817
828
|
password: this.environmentId
|
|
818
829
|
});
|
|
819
|
-
// update threshold signature scheme
|
|
820
|
-
const thresholdSignatureScheme = wallet.walletProperties.thresholdSignatureScheme;
|
|
821
|
-
this.walletMap[accountAddress] = _extends({}, this.walletMap[accountAddress], {
|
|
822
|
-
thresholdSignatureScheme
|
|
823
|
-
});
|
|
824
830
|
//todo: check to see if their are other backups ie google drive, etc
|
|
825
|
-
this.logger.debug('
|
|
831
|
+
this.logger.debug('Recovered backup', decryptedKeyShares);
|
|
826
832
|
}
|
|
827
833
|
}
|
|
828
834
|
const walletCount = Object.keys(this.walletMap).length;
|
package/package.json
CHANGED
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":"A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,MAAM,CAAC;QAClB,QAAQ,EAAE,iBAAiB,CAAC;QAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB;IAgBK,4BAA4B,CAAC,EACjC,cAAc,EACd,IAAsB,EACtB,QAAQ,GACT,EAAE;QACD,cAAc,EAAE,MAAM,CAAC;QACvB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,GAAG,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC;IAmB5B,mBAAmB,CAAC,EACxB,SAAS,EACT,UAAU,EACV,wBAAwB,GACzB,EAAE;QACD,SAAS,EAAE,MAAM,CAAC;QAClB,UAAU,EAAE,MAAM,CAAC;QACnB,wBAAwB,EAAE,wBAAwB,CAAC;KACpD,GAAG,OAAO,CAAC;QACV,YAAY,EAAE,cAAc,GAAG,UAAU,GAAG,SAAS,CAAC;QACtD,eAAe,EAAE,cAAc,EAAE,CAAC;KACnC,CAAC;IA6DI,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;IAwDzD,UAAU;CA0BjB"}
|
package/src/constants.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export declare const DEFAULT_LOG_LEVEL = "INFO";
|
|
2
2
|
export declare const STORAGE_KEY = "dynamic-waas-wallet-client";
|
|
3
|
-
export declare const BACKUP_FILENAME = "
|
|
3
|
+
export declare const BACKUP_FILENAME = "dynamicWalletKeyShareBackup.json";
|
|
4
|
+
export declare const CLIENT_KEYSHARE_EXPORT_FILENAME_PREFIX = "dynamicWalletKeyShareBackup";
|
|
4
5
|
export declare const ChainEnumToVerifiedCredentialName: {
|
|
5
6
|
[key: string]: string;
|
|
6
7
|
};
|
package/src/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../packages/src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,SAAS,CAAC;AAExC,eAAO,MAAM,WAAW,+BAA+B,CAAC;AAExD,eAAO,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../packages/src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,SAAS,CAAC;AAExC,eAAO,MAAM,WAAW,+BAA+B,CAAC;AAExD,eAAO,MAAM,eAAe,qCAAqC,CAAC;AAElE,eAAO,MAAM,sCAAsC,gCAAgC,CAAC;AAEpF,eAAO,MAAM,iCAAiC,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CAKtE,CAAC;AAEF,eAAO,MAAM,iCAAiC,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CAItE,CAAC"}
|
package/src/localStorage.d.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
type AnyFunction = (...args: any[]) => any;
|
|
2
|
-
type MaybePromisify<T> = T | Promise<T>;
|
|
3
|
-
type PromisifyMethods<T> = {
|
|
4
|
-
[K in keyof T]: T[K] extends AnyFunction ? (...args: Parameters<T[K]>) => MaybePromisify<ReturnType<T[K]>> : T[K];
|
|
5
|
-
};
|
|
6
|
-
export type SupportedStorage = PromisifyMethods<Pick<Storage, 'getItem' | 'setItem' | 'removeItem'>> & {
|
|
7
|
-
/**
|
|
8
|
-
* If set to `true` signals to the library that the storage medium is used
|
|
9
|
-
* on a server and the values may not be authentic, such as reading from
|
|
10
|
-
* request cookies. Implementations should not set this to true if the client
|
|
11
|
-
* is used on a server that reads storage information from authenticated
|
|
12
|
-
* sources, such as a secure database or file.
|
|
13
|
-
*/
|
|
14
|
-
isServer?: boolean;
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* Checks whether localStorage is supported on this browser.
|
|
18
|
-
*/
|
|
19
|
-
export declare const supportsLocalStorage: () => boolean;
|
|
20
|
-
/**
|
|
21
|
-
* Provides safe access to the globalThis.localStorage property.
|
|
22
|
-
*/
|
|
23
|
-
export declare const localStorageAdapter: SupportedStorage;
|
|
24
|
-
/**
|
|
25
|
-
* Returns a localStorage-like object that stores the key-value pairs in
|
|
26
|
-
* memory.
|
|
27
|
-
*/
|
|
28
|
-
export declare const memoryLocalStorageAdapter: (store?: {
|
|
29
|
-
[key: string]: string;
|
|
30
|
-
}) => SupportedStorage;
|
|
31
|
-
export {};
|
|
32
|
-
//# sourceMappingURL=localStorage.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"localStorage.d.ts","sourceRoot":"","sources":["../../packages/src/localStorage.ts"],"names":[],"mappings":"AAEA,KAAK,WAAW,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC;AAC3C,KAAK,cAAc,CAAC,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;AAExC,KAAK,gBAAgB,CAAC,CAAC,IAAI;KACxB,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,WAAW,GACpC,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,cAAc,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAC/D,CAAC,CAAC,CAAC,CAAC;CACT,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,gBAAgB,CAC7C,IAAI,CAAC,OAAO,EAAE,SAAS,GAAG,SAAS,GAAG,YAAY,CAAC,CACpD,GAAG;IACF;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAOF;;GAEG;AACH,eAAO,MAAM,oBAAoB,eAiChC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,mBAAmB,EAAE,gBAsBjC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,yBAAyB,WAC7B;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,KAC/B,gBAUD,CAAC"}
|
package/src/logger.d.ts
DELETED
package/src/logger.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../packages/src/logger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,eAAO,MAAM,MAAM,QAAwC,CAAC"}
|