@dynamic-labs/utils 0.18.100-viem.0 → 0.19.0-alpha.1
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/CHANGELOG.md +24 -47
- package/package.json +4 -6
- package/src/CancellablePromise/CancellablePromise.cjs +26 -26
- package/src/CancellablePromise/CancellablePromise.d.ts +9 -9
- package/src/CancellablePromise/CancellablePromise.js +26 -26
- package/src/CancellablePromise/index.d.ts +1 -1
- package/src/bufferToBase64.cjs +5 -5
- package/src/bufferToBase64.d.ts +1 -1
- package/src/bufferToBase64.js +5 -5
- package/src/errors/AccountExistsError.cjs +6 -6
- package/src/errors/AccountExistsError.d.ts +13 -13
- package/src/errors/AccountExistsError.js +6 -6
- package/src/errors/ChainalysisError.cjs +5 -5
- package/src/errors/ChainalysisError.d.ts +5 -5
- package/src/errors/ChainalysisError.js +5 -5
- package/src/errors/CustomError.cjs +16 -16
- package/src/errors/CustomError.d.ts +11 -11
- package/src/errors/CustomError.js +16 -16
- package/src/errors/DynamicError.cjs +1 -1
- package/src/errors/DynamicError.d.ts +3 -3
- package/src/errors/DynamicError.js +1 -1
- package/src/errors/EmailAlreadyExistsError.cjs +4 -4
- package/src/errors/EmailAlreadyExistsError.d.ts +4 -4
- package/src/errors/EmailAlreadyExistsError.js +4 -4
- package/src/errors/EmailProviderError.cjs +4 -4
- package/src/errors/EmailProviderError.d.ts +4 -4
- package/src/errors/EmailProviderError.js +4 -4
- package/src/errors/EmailVerificationError.cjs +4 -4
- package/src/errors/EmailVerificationError.d.ts +4 -4
- package/src/errors/EmailVerificationError.js +4 -4
- package/src/errors/GateBlockedError.cjs +5 -5
- package/src/errors/GateBlockedError.d.ts +5 -5
- package/src/errors/GateBlockedError.js +5 -5
- package/src/errors/MissingEnvironmentIdError.cjs +4 -4
- package/src/errors/MissingEnvironmentIdError.d.ts +4 -4
- package/src/errors/MissingEnvironmentIdError.js +4 -4
- package/src/errors/NoAccessError.cjs +6 -6
- package/src/errors/NoAccessError.d.ts +9 -9
- package/src/errors/NoAccessError.js +6 -6
- package/src/errors/NotSupportedError.cjs +1 -1
- package/src/errors/NotSupportedError.d.ts +3 -3
- package/src/errors/NotSupportedError.js +1 -1
- package/src/errors/UserHasAccountWithEmailError.cjs +14 -0
- package/src/errors/UserHasAccountWithEmailError.d.ts +5 -0
- package/src/errors/UserHasAccountWithEmailError.js +10 -0
- package/src/errors/UsernameAlreadyExistsError.cjs +4 -4
- package/src/errors/UsernameAlreadyExistsError.d.ts +4 -4
- package/src/errors/UsernameAlreadyExistsError.js +4 -4
- package/src/errors/WalletNotDeployedError.cjs +4 -4
- package/src/errors/WalletNotDeployedError.d.ts +4 -4
- package/src/errors/WalletNotDeployedError.js +4 -4
- package/src/errors/WalletUsedError.cjs +4 -4
- package/src/errors/WalletUsedError.d.ts +4 -4
- package/src/errors/WalletUsedError.js +4 -4
- package/src/errors/index.d.ts +15 -14
- package/src/index.cjs +2 -4
- package/src/index.d.ts +8 -9
- package/src/index.js +1 -1
- package/src/isFunction/index.d.ts +1 -1
- package/src/isFunction/isFunction.cjs +1 -1
- package/src/isFunction/isFunction.d.ts +1 -1
- package/src/isFunction/isFunction.js +1 -1
- package/src/isMobile.cjs +56 -56
- package/src/isMobile.d.ts +15 -15
- package/src/isMobile.js +56 -56
- package/src/localStorageAsync.cjs +17 -17
- package/src/localStorageAsync.d.ts +3 -3
- package/src/localStorageAsync.js +17 -17
- package/src/parseChainId.d.ts +1 -1
- package/src/parseEvmNetworks.cjs +6 -6
- package/src/parseEvmNetworks.d.ts +2 -2
- package/src/parseEvmNetworks.js +6 -6
- package/src/getOrMapViemChain.cjs +0 -77
- package/src/getOrMapViemChain.d.ts +0 -11
- package/src/getOrMapViemChain.js +0 -51
package/CHANGELOG.md
CHANGED
|
@@ -1,59 +1,36 @@
|
|
|
1
1
|
|
|
2
|
-
## [0.
|
|
2
|
+
## [0.19.0-alpha.1](https://github.com/dynamic-labs/DynamicAuth/compare/v0.19.0-alpha.0...v0.19.0-alpha.1) (2023-08-10)
|
|
3
3
|
|
|
4
|
-
### Bug Fixes
|
|
5
|
-
|
|
6
|
-
* add improves to wallet events handling
|
|
7
|
-
|
|
8
|
-
## [0.18.0-beta.29](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.0-beta.28...v0.18.0-beta.29) (2023-08-03)
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
### ⚠ BREAKING CHANGES
|
|
12
|
-
|
|
13
|
-
* remove deprecated multiwallet prop (#2821)
|
|
14
|
-
|
|
15
|
-
### Bug Fixes
|
|
16
|
-
|
|
17
|
-
* array of dynamicWagmiSettings not being sent, must be turned into object ([#2837](https://github.com/dynamic-labs/DynamicAuth/issues/2837)) ([fc5051d](https://github.com/dynamic-labs/DynamicAuth/commit/fc5051d3ce4c5e28d54a74cc9d74424748b52df9)), closes [#2835](https://github.com/dynamic-labs/DynamicAuth/issues/2835)
|
|
18
|
-
* change network modal doesn't pop on secondary wallet, when primaryWallet was disconnected ([#2831](https://github.com/dynamic-labs/DynamicAuth/issues/2831)) ([4a78cc8](https://github.com/dynamic-labs/DynamicAuth/commit/4a78cc8c9004e6716fa9e35d8572c57bfd8bdc22))
|
|
19
|
-
* connectSuccess callback is not being called when connecting new wallet after unlink ([#2829](https://github.com/dynamic-labs/DynamicAuth/issues/2829)) ([37795e5](https://github.com/dynamic-labs/DynamicAuth/commit/37795e5304d65766968ae6168d329b899c0afdfa))
|
|
20
|
-
* **wcv2:** simulate chain change event in switchNetwork ([#2827](https://github.com/dynamic-labs/DynamicAuth/issues/2827)) ([98cff76](https://github.com/dynamic-labs/DynamicAuth/commit/98cff7687112ddbf2971fa4e42cc959f5be62014)), closes [#2809](https://github.com/dynamic-labs/DynamicAuth/issues/2809)
|
|
21
|
-
* wrong wallet list is showing after disconnecting and network change ([#2832](https://github.com/dynamic-labs/DynamicAuth/issues/2832)) ([b7af548](https://github.com/dynamic-labs/DynamicAuth/commit/b7af5480a0f05b851cf9accb3ab0870fd2836a92))
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
* remove deprecated multiwallet prop ([#2821](https://github.com/dynamic-labs/DynamicAuth/issues/2821)) ([d95173d](https://github.com/dynamic-labs/DynamicAuth/commit/d95173de890104b1b94b612976682c9d86ec4b17))
|
|
25
|
-
|
|
26
|
-
## [0.18.0-beta.28](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.0-RC.27...v0.18.0-beta.28) (2023-08-03)
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
### Bug Fixes
|
|
30
|
-
|
|
31
|
-
* gracefully handle walletbook fallbacks ([#2812](https://github.com/dynamic-labs/DynamicAuth/issues/2812)) ([#2822](https://github.com/dynamic-labs/DynamicAuth/issues/2822)) ([8e737d6](https://github.com/dynamic-labs/DynamicAuth/commit/8e737d602d64fa2414ba136799b8878e975a40a2))
|
|
32
|
-
|
|
33
|
-
## [0.18.0-RC.27](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.0-RC.26...v0.18.0-RC.27) (2023-08-03)
|
|
34
|
-
|
|
35
|
-
### Bug Fixes
|
|
36
|
-
|
|
37
|
-
* fixes circular dependency issues on usePromise
|
|
38
|
-
|
|
39
|
-
## [0.18.0-RC.26](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.0-RC.24...v0.18.0-RC.26) (2023-08-02)
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
### ⚠ BREAKING CHANGES
|
|
43
|
-
|
|
44
|
-
* displayTermsOfService prop set to false breaks message verfication (#2751)
|
|
45
4
|
|
|
46
5
|
### Features
|
|
47
6
|
|
|
48
|
-
*
|
|
7
|
+
* cleaning up email input field - delete continue button ([#2833](https://github.com/dynamic-labs/DynamicAuth/issues/2833)) ([baa399e](https://github.com/dynamic-labs/DynamicAuth/commit/baa399e387bce9570a7e7774d68dc3c92f86be1b))
|
|
8
|
+
* disable social buttons after provider is selected ([#2875](https://github.com/dynamic-labs/DynamicAuth/issues/2875)) ([6296ce1](https://github.com/dynamic-labs/DynamicAuth/commit/6296ce13062a8589cf6fb4741957dc9bf84552a2))
|
|
9
|
+
* **GVTY-65:** Allow Merging accounts when duplicated email in KYC step ([#2772](https://github.com/dynamic-labs/DynamicAuth/issues/2772)) ([8efb6ae](https://github.com/dynamic-labs/DynamicAuth/commit/8efb6aecc9445ef1798a5c6358eac27b16f661b6))
|
|
10
|
+
* hide network from nav if hideNetworkInDynamicWidget setting is true ([#2842](https://github.com/dynamic-labs/DynamicAuth/issues/2842)) ([f3dc9ba](https://github.com/dynamic-labs/DynamicAuth/commit/f3dc9ba987781d5d0540336f351bb9f148400eac))
|
|
11
|
+
* show email submit button on focus ([#2860](https://github.com/dynamic-labs/DynamicAuth/issues/2860)) ([87d8ae0](https://github.com/dynamic-labs/DynamicAuth/commit/87d8ae0806425a25835efda5f9b9abc58e5de18e))
|
|
49
12
|
|
|
50
13
|
|
|
51
14
|
### Bug Fixes
|
|
52
15
|
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
16
|
+
* account already exist message not displaying automatically ([#2896](https://github.com/dynamic-labs/DynamicAuth/issues/2896)) ([ba56c93](https://github.com/dynamic-labs/DynamicAuth/commit/ba56c936546428b0a1111ab5ef6e8d0d9a463bb5))
|
|
17
|
+
* array of dynamicWagmiSettings not being sent, must be turned into object ([#2835](https://github.com/dynamic-labs/DynamicAuth/issues/2835)) ([092c45a](https://github.com/dynamic-labs/DynamicAuth/commit/092c45afd3676fbd7c3d28f51818470de7f95768))
|
|
18
|
+
* change network modal doesn't pop on secondary wallet, when primaryWallet was disconnected ([#2817](https://github.com/dynamic-labs/DynamicAuth/issues/2817)) ([b68c156](https://github.com/dynamic-labs/DynamicAuth/commit/b68c1565f936d2f4275b104a0881ba5720101abd))
|
|
19
|
+
* connectSuccess callback is not being called when connecting new wallet after unlink ([#2814](https://github.com/dynamic-labs/DynamicAuth/issues/2814)) ([d5b34d8](https://github.com/dynamic-labs/DynamicAuth/commit/d5b34d8a073436ce39280766608578fd97567fac))
|
|
20
|
+
* css variables are being ignored for ConnectButton component ([#2869](https://github.com/dynamic-labs/DynamicAuth/issues/2869)) ([a54fb46](https://github.com/dynamic-labs/DynamicAuth/commit/a54fb46648758001450a33e6d86cf04765507701))
|
|
21
|
+
* css variables for the ConnectButton are being ignored ([#2856](https://github.com/dynamic-labs/DynamicAuth/issues/2856)) ([65a342f](https://github.com/dynamic-labs/DynamicAuth/commit/65a342f828b6a16f714fc6b6e2066e1b742b2c0a))
|
|
22
|
+
* don't let user update email if it's linked to an embedded wallet ([#2883](https://github.com/dynamic-labs/DynamicAuth/issues/2883)) ([99aa303](https://github.com/dynamic-labs/DynamicAuth/commit/99aa3033e62c0dee14657cb811db8d5b3597f7de))
|
|
23
|
+
* **GVTY-150:** blocto pop up to sign after disconnect ([#2854](https://github.com/dynamic-labs/DynamicAuth/issues/2854)) ([df5481b](https://github.com/dynamic-labs/DynamicAuth/commit/df5481b2d5438848ad96cdee402f40b520bead08))
|
|
24
|
+
* **GVTY-155:** update to the new design ([#2889](https://github.com/dynamic-labs/DynamicAuth/issues/2889)) ([31f7f54](https://github.com/dynamic-labs/DynamicAuth/commit/31f7f54444c623fe7d5bcf8a42f94ee22eedc3e1))
|
|
25
|
+
* **GVTY-159:** email update view not showing email used error ([#2887](https://github.com/dynamic-labs/DynamicAuth/issues/2887)) ([bd40e4c](https://github.com/dynamic-labs/DynamicAuth/commit/bd40e4c77cda42752d44e42b98bfcea4cfd77a80))
|
|
26
|
+
* **OTPOverviewView:** enable close only on close button click ([#2877](https://github.com/dynamic-labs/DynamicAuth/issues/2877)) ([2be23e7](https://github.com/dynamic-labs/DynamicAuth/commit/2be23e7ddefe67c971d863ad9069ac5b8a74f4e5))
|
|
27
|
+
* **transaction:** improve gas estimate in transaction confirmation ([#2767](https://github.com/dynamic-labs/DynamicAuth/issues/2767)) ([7180ae5](https://github.com/dynamic-labs/DynamicAuth/commit/7180ae50559f924ae9769b2b8d87eadc6604c754))
|
|
28
|
+
* use findSocialIcon instead getSocialIcon to avoid render errors ([#2834](https://github.com/dynamic-labs/DynamicAuth/issues/2834)) ([2c57f98](https://github.com/dynamic-labs/DynamicAuth/commit/2c57f98fd5c461ae4acbe2836f719ebe18bc21fc))
|
|
29
|
+
* **useWalletConnectorEvent:** ensure connector is initialized ([#2849](https://github.com/dynamic-labs/DynamicAuth/issues/2849)) ([9137131](https://github.com/dynamic-labs/DynamicAuth/commit/913713166af8a6e6cc15a8e362e57b328fc0a76f))
|
|
30
|
+
* **wcv2:** simulate chain change event in switchNetwork ([#2809](https://github.com/dynamic-labs/DynamicAuth/issues/2809)) ([2329b80](https://github.com/dynamic-labs/DynamicAuth/commit/2329b808f57644cebb664be536bc41e256d108d8))
|
|
31
|
+
* wrong wallet list is showing after disconnecting and network change ([#2815](https://github.com/dynamic-labs/DynamicAuth/issues/2815)) ([6cae101](https://github.com/dynamic-labs/DynamicAuth/commit/6cae1019f40be4ffe7ab0426aa159c652a770a82))
|
|
32
|
+
|
|
33
|
+
## [0.19.0-alpha.0](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.0-RC.25...v0.19.0-alpha.0) (2023-08-01)
|
|
57
34
|
|
|
58
35
|
## [0.18.0-RC.25](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.0-RC.24...v0.18.0-RC.25) (2023-08-01)
|
|
59
36
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/utils",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.19.0-alpha.1",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/dynamic-labs/DynamicAuth.git",
|
|
@@ -25,10 +25,8 @@
|
|
|
25
25
|
},
|
|
26
26
|
"./package.json": "./package.json"
|
|
27
27
|
},
|
|
28
|
-
"peerDependencies": {
|
|
29
|
-
"viem": "^1.5.3"
|
|
30
|
-
},
|
|
31
28
|
"dependencies": {
|
|
32
|
-
"@dynamic-labs/types": "0.
|
|
33
|
-
}
|
|
29
|
+
"@dynamic-labs/types": "0.19.0-alpha.1"
|
|
30
|
+
},
|
|
31
|
+
"peerDependencies": {}
|
|
34
32
|
}
|
|
@@ -2,32 +2,32 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
class CancellablePromise extends Promise {
|
|
6
|
-
constructor(executor) {
|
|
7
|
-
super((resolve, reject) => {
|
|
8
|
-
executor((val) => {
|
|
9
|
-
if (this.isCancelled)
|
|
10
|
-
return;
|
|
11
|
-
resolve(val);
|
|
12
|
-
}, (err) => {
|
|
13
|
-
if (this.isCancelled)
|
|
14
|
-
return;
|
|
15
|
-
reject(err);
|
|
16
|
-
});
|
|
17
|
-
});
|
|
18
|
-
this._controller = new AbortController();
|
|
19
|
-
}
|
|
20
|
-
get isCancelled() {
|
|
21
|
-
return this._controller.signal.aborted;
|
|
22
|
-
}
|
|
23
|
-
cancel() {
|
|
24
|
-
this._controller.abort();
|
|
25
|
-
}
|
|
26
|
-
static fromPromise(promise) {
|
|
27
|
-
return new CancellablePromise((resolve, reject) => {
|
|
28
|
-
promise.then(resolve).catch(reject);
|
|
29
|
-
});
|
|
30
|
-
}
|
|
5
|
+
class CancellablePromise extends Promise {
|
|
6
|
+
constructor(executor) {
|
|
7
|
+
super((resolve, reject) => {
|
|
8
|
+
executor((val) => {
|
|
9
|
+
if (this.isCancelled)
|
|
10
|
+
return;
|
|
11
|
+
resolve(val);
|
|
12
|
+
}, (err) => {
|
|
13
|
+
if (this.isCancelled)
|
|
14
|
+
return;
|
|
15
|
+
reject(err);
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
this._controller = new AbortController();
|
|
19
|
+
}
|
|
20
|
+
get isCancelled() {
|
|
21
|
+
return this._controller.signal.aborted;
|
|
22
|
+
}
|
|
23
|
+
cancel() {
|
|
24
|
+
this._controller.abort();
|
|
25
|
+
}
|
|
26
|
+
static fromPromise(promise) {
|
|
27
|
+
return new CancellablePromise((resolve, reject) => {
|
|
28
|
+
promise.then(resolve).catch(reject);
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
exports.CancellablePromise = CancellablePromise;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
type Executor<T> = (resolve: (value: T | PromiseLike<T>) => void, reject: (reason?: unknown) => void) => void;
|
|
2
|
-
export declare class CancellablePromise<T> extends Promise<T> {
|
|
3
|
-
_controller: AbortController;
|
|
4
|
-
constructor(executor: Executor<T>);
|
|
5
|
-
get isCancelled(): boolean;
|
|
6
|
-
cancel(): void;
|
|
7
|
-
static fromPromise<T>(promise: Promise<T>): CancellablePromise<T>;
|
|
8
|
-
}
|
|
9
|
-
export {};
|
|
1
|
+
type Executor<T> = (resolve: (value: T | PromiseLike<T>) => void, reject: (reason?: unknown) => void) => void;
|
|
2
|
+
export declare class CancellablePromise<T> extends Promise<T> {
|
|
3
|
+
_controller: AbortController;
|
|
4
|
+
constructor(executor: Executor<T>);
|
|
5
|
+
get isCancelled(): boolean;
|
|
6
|
+
cancel(): void;
|
|
7
|
+
static fromPromise<T>(promise: Promise<T>): CancellablePromise<T>;
|
|
8
|
+
}
|
|
9
|
+
export {};
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
class CancellablePromise extends Promise {
|
|
2
|
-
constructor(executor) {
|
|
3
|
-
super((resolve, reject) => {
|
|
4
|
-
executor((val) => {
|
|
5
|
-
if (this.isCancelled)
|
|
6
|
-
return;
|
|
7
|
-
resolve(val);
|
|
8
|
-
}, (err) => {
|
|
9
|
-
if (this.isCancelled)
|
|
10
|
-
return;
|
|
11
|
-
reject(err);
|
|
12
|
-
});
|
|
13
|
-
});
|
|
14
|
-
this._controller = new AbortController();
|
|
15
|
-
}
|
|
16
|
-
get isCancelled() {
|
|
17
|
-
return this._controller.signal.aborted;
|
|
18
|
-
}
|
|
19
|
-
cancel() {
|
|
20
|
-
this._controller.abort();
|
|
21
|
-
}
|
|
22
|
-
static fromPromise(promise) {
|
|
23
|
-
return new CancellablePromise((resolve, reject) => {
|
|
24
|
-
promise.then(resolve).catch(reject);
|
|
25
|
-
});
|
|
26
|
-
}
|
|
1
|
+
class CancellablePromise extends Promise {
|
|
2
|
+
constructor(executor) {
|
|
3
|
+
super((resolve, reject) => {
|
|
4
|
+
executor((val) => {
|
|
5
|
+
if (this.isCancelled)
|
|
6
|
+
return;
|
|
7
|
+
resolve(val);
|
|
8
|
+
}, (err) => {
|
|
9
|
+
if (this.isCancelled)
|
|
10
|
+
return;
|
|
11
|
+
reject(err);
|
|
12
|
+
});
|
|
13
|
+
});
|
|
14
|
+
this._controller = new AbortController();
|
|
15
|
+
}
|
|
16
|
+
get isCancelled() {
|
|
17
|
+
return this._controller.signal.aborted;
|
|
18
|
+
}
|
|
19
|
+
cancel() {
|
|
20
|
+
this._controller.abort();
|
|
21
|
+
}
|
|
22
|
+
static fromPromise(promise) {
|
|
23
|
+
return new CancellablePromise((resolve, reject) => {
|
|
24
|
+
promise.then(resolve).catch(reject);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
export { CancellablePromise };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { CancellablePromise } from './CancellablePromise';
|
|
1
|
+
export { CancellablePromise } from './CancellablePromise';
|
package/src/bufferToBase64.cjs
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const bufferToBase64 = (buf) => {
|
|
6
|
-
const binstr = Array.prototype.map
|
|
7
|
-
.call(buf, (ch) => String.fromCharCode(ch))
|
|
8
|
-
.join('');
|
|
9
|
-
return Buffer.from(binstr, 'binary').toString('base64');
|
|
5
|
+
const bufferToBase64 = (buf) => {
|
|
6
|
+
const binstr = Array.prototype.map
|
|
7
|
+
.call(buf, (ch) => String.fromCharCode(ch))
|
|
8
|
+
.join('');
|
|
9
|
+
return Buffer.from(binstr, 'binary').toString('base64');
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
exports.bufferToBase64 = bufferToBase64;
|
package/src/bufferToBase64.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const bufferToBase64: (buf: Uint8Array) => string;
|
|
1
|
+
export declare const bufferToBase64: (buf: Uint8Array) => string;
|
package/src/bufferToBase64.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const bufferToBase64 = (buf) => {
|
|
2
|
-
const binstr = Array.prototype.map
|
|
3
|
-
.call(buf, (ch) => String.fromCharCode(ch))
|
|
4
|
-
.join('');
|
|
5
|
-
return Buffer.from(binstr, 'binary').toString('base64');
|
|
1
|
+
const bufferToBase64 = (buf) => {
|
|
2
|
+
const binstr = Array.prototype.map
|
|
3
|
+
.call(buf, (ch) => String.fromCharCode(ch))
|
|
4
|
+
.join('');
|
|
5
|
+
return Buffer.from(binstr, 'binary').toString('base64');
|
|
6
6
|
};
|
|
7
7
|
|
|
8
8
|
export { bufferToBase64 };
|
|
@@ -4,12 +4,12 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var DynamicError = require('./DynamicError.cjs');
|
|
6
6
|
|
|
7
|
-
class AccountExistsError extends DynamicError.DynamicError {
|
|
8
|
-
constructor(errorMessage, errorPayload) {
|
|
9
|
-
super(errorMessage);
|
|
10
|
-
this.errorMessage = errorMessage;
|
|
11
|
-
this.errorPayload = errorPayload;
|
|
12
|
-
}
|
|
7
|
+
class AccountExistsError extends DynamicError.DynamicError {
|
|
8
|
+
constructor(errorMessage, errorPayload) {
|
|
9
|
+
super(errorMessage);
|
|
10
|
+
this.errorMessage = errorMessage;
|
|
11
|
+
this.errorPayload = errorPayload;
|
|
12
|
+
}
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
exports.AccountExistsError = AccountExistsError;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { DynamicError } from './DynamicError';
|
|
2
|
-
type AccountExistsPayload = {
|
|
3
|
-
email: string;
|
|
4
|
-
embeddedSocialSigninProvider: string;
|
|
5
|
-
embeddedWalletName: string;
|
|
6
|
-
loginProvider: string;
|
|
7
|
-
};
|
|
8
|
-
export declare class AccountExistsError extends DynamicError {
|
|
9
|
-
errorMessage: string;
|
|
10
|
-
errorPayload: AccountExistsPayload;
|
|
11
|
-
constructor(errorMessage: string, errorPayload: AccountExistsPayload);
|
|
12
|
-
}
|
|
13
|
-
export {};
|
|
1
|
+
import { DynamicError } from './DynamicError';
|
|
2
|
+
type AccountExistsPayload = {
|
|
3
|
+
email: string;
|
|
4
|
+
embeddedSocialSigninProvider: string;
|
|
5
|
+
embeddedWalletName: string;
|
|
6
|
+
loginProvider: string;
|
|
7
|
+
};
|
|
8
|
+
export declare class AccountExistsError extends DynamicError {
|
|
9
|
+
errorMessage: string;
|
|
10
|
+
errorPayload: AccountExistsPayload;
|
|
11
|
+
constructor(errorMessage: string, errorPayload: AccountExistsPayload);
|
|
12
|
+
}
|
|
13
|
+
export {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { DynamicError } from './DynamicError.js';
|
|
2
2
|
|
|
3
|
-
class AccountExistsError extends DynamicError {
|
|
4
|
-
constructor(errorMessage, errorPayload) {
|
|
5
|
-
super(errorMessage);
|
|
6
|
-
this.errorMessage = errorMessage;
|
|
7
|
-
this.errorPayload = errorPayload;
|
|
8
|
-
}
|
|
3
|
+
class AccountExistsError extends DynamicError {
|
|
4
|
+
constructor(errorMessage, errorPayload) {
|
|
5
|
+
super(errorMessage);
|
|
6
|
+
this.errorMessage = errorMessage;
|
|
7
|
+
this.errorPayload = errorPayload;
|
|
8
|
+
}
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
export { AccountExistsError };
|
|
@@ -4,11 +4,11 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var DynamicError = require('./DynamicError.cjs');
|
|
6
6
|
|
|
7
|
-
class ChainalysisError extends DynamicError.DynamicError {
|
|
8
|
-
constructor(walletPublicKey) {
|
|
9
|
-
super('This address is not approved for access');
|
|
10
|
-
this.walletPublicKey = walletPublicKey;
|
|
11
|
-
}
|
|
7
|
+
class ChainalysisError extends DynamicError.DynamicError {
|
|
8
|
+
constructor(walletPublicKey) {
|
|
9
|
+
super('This address is not approved for access');
|
|
10
|
+
this.walletPublicKey = walletPublicKey;
|
|
11
|
+
}
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
exports.ChainalysisError = ChainalysisError;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DynamicError } from './DynamicError';
|
|
2
|
-
export declare class ChainalysisError extends DynamicError {
|
|
3
|
-
walletPublicKey: string | undefined;
|
|
4
|
-
constructor(walletPublicKey: string);
|
|
5
|
-
}
|
|
1
|
+
import { DynamicError } from './DynamicError';
|
|
2
|
+
export declare class ChainalysisError extends DynamicError {
|
|
3
|
+
walletPublicKey: string | undefined;
|
|
4
|
+
constructor(walletPublicKey: string);
|
|
5
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { DynamicError } from './DynamicError.js';
|
|
2
2
|
|
|
3
|
-
class ChainalysisError extends DynamicError {
|
|
4
|
-
constructor(walletPublicKey) {
|
|
5
|
-
super('This address is not approved for access');
|
|
6
|
-
this.walletPublicKey = walletPublicKey;
|
|
7
|
-
}
|
|
3
|
+
class ChainalysisError extends DynamicError {
|
|
4
|
+
constructor(walletPublicKey) {
|
|
5
|
+
super('This address is not approved for access');
|
|
6
|
+
this.walletPublicKey = walletPublicKey;
|
|
7
|
+
}
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
export { ChainalysisError };
|
|
@@ -2,22 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
/**
|
|
6
|
-
* Extend this class to allow usage of instanceof
|
|
7
|
-
*/
|
|
8
|
-
class CustomError extends Error {
|
|
9
|
-
constructor(message, code) {
|
|
10
|
-
super(message);
|
|
11
|
-
this.code = undefined;
|
|
12
|
-
this.code = code;
|
|
13
|
-
Object.setPrototypeOf(this, this.constructor.prototype);
|
|
14
|
-
}
|
|
15
|
-
toJSON() {
|
|
16
|
-
return {
|
|
17
|
-
code: this.code,
|
|
18
|
-
error: this.message,
|
|
19
|
-
};
|
|
20
|
-
}
|
|
5
|
+
/**
|
|
6
|
+
* Extend this class to allow usage of instanceof
|
|
7
|
+
*/
|
|
8
|
+
class CustomError extends Error {
|
|
9
|
+
constructor(message, code) {
|
|
10
|
+
super(message);
|
|
11
|
+
this.code = undefined;
|
|
12
|
+
this.code = code;
|
|
13
|
+
Object.setPrototypeOf(this, this.constructor.prototype);
|
|
14
|
+
}
|
|
15
|
+
toJSON() {
|
|
16
|
+
return {
|
|
17
|
+
code: this.code,
|
|
18
|
+
error: this.message,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
exports.CustomError = CustomError;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Extend this class to allow usage of instanceof
|
|
3
|
-
*/
|
|
4
|
-
export declare class CustomError extends Error {
|
|
5
|
-
code: string | undefined;
|
|
6
|
-
constructor(message?: string | undefined, code?: string);
|
|
7
|
-
toJSON(): {
|
|
8
|
-
code: string | undefined;
|
|
9
|
-
error: string;
|
|
10
|
-
};
|
|
11
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Extend this class to allow usage of instanceof
|
|
3
|
+
*/
|
|
4
|
+
export declare class CustomError extends Error {
|
|
5
|
+
code: string | undefined;
|
|
6
|
+
constructor(message?: string | undefined, code?: string);
|
|
7
|
+
toJSON(): {
|
|
8
|
+
code: string | undefined;
|
|
9
|
+
error: string;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Extend this class to allow usage of instanceof
|
|
3
|
-
*/
|
|
4
|
-
class CustomError extends Error {
|
|
5
|
-
constructor(message, code) {
|
|
6
|
-
super(message);
|
|
7
|
-
this.code = undefined;
|
|
8
|
-
this.code = code;
|
|
9
|
-
Object.setPrototypeOf(this, this.constructor.prototype);
|
|
10
|
-
}
|
|
11
|
-
toJSON() {
|
|
12
|
-
return {
|
|
13
|
-
code: this.code,
|
|
14
|
-
error: this.message,
|
|
15
|
-
};
|
|
16
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Extend this class to allow usage of instanceof
|
|
3
|
+
*/
|
|
4
|
+
class CustomError extends Error {
|
|
5
|
+
constructor(message, code) {
|
|
6
|
+
super(message);
|
|
7
|
+
this.code = undefined;
|
|
8
|
+
this.code = code;
|
|
9
|
+
Object.setPrototypeOf(this, this.constructor.prototype);
|
|
10
|
+
}
|
|
11
|
+
toJSON() {
|
|
12
|
+
return {
|
|
13
|
+
code: this.code,
|
|
14
|
+
error: this.message,
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
export { CustomError };
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var CustomError = require('./CustomError.cjs');
|
|
6
6
|
|
|
7
|
-
class DynamicError extends CustomError.CustomError {
|
|
7
|
+
class DynamicError extends CustomError.CustomError {
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
exports.DynamicError = DynamicError;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { CustomError } from './CustomError';
|
|
2
|
-
export declare class DynamicError extends CustomError {
|
|
3
|
-
}
|
|
1
|
+
import { CustomError } from './CustomError';
|
|
2
|
+
export declare class DynamicError extends CustomError {
|
|
3
|
+
}
|
|
@@ -4,10 +4,10 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var DynamicError = require('./DynamicError.cjs');
|
|
6
6
|
|
|
7
|
-
class EmailAlreadyExistsError extends DynamicError.DynamicError {
|
|
8
|
-
constructor() {
|
|
9
|
-
super('Email already exists');
|
|
10
|
-
}
|
|
7
|
+
class EmailAlreadyExistsError extends DynamicError.DynamicError {
|
|
8
|
+
constructor() {
|
|
9
|
+
super('Email already exists');
|
|
10
|
+
}
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
exports.EmailAlreadyExistsError = EmailAlreadyExistsError;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DynamicError } from './DynamicError';
|
|
2
|
-
export declare class EmailAlreadyExistsError extends DynamicError {
|
|
3
|
-
constructor();
|
|
4
|
-
}
|
|
1
|
+
import { DynamicError } from './DynamicError';
|
|
2
|
+
export declare class EmailAlreadyExistsError extends DynamicError {
|
|
3
|
+
constructor();
|
|
4
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { DynamicError } from './DynamicError.js';
|
|
2
2
|
|
|
3
|
-
class EmailAlreadyExistsError extends DynamicError {
|
|
4
|
-
constructor() {
|
|
5
|
-
super('Email already exists');
|
|
6
|
-
}
|
|
3
|
+
class EmailAlreadyExistsError extends DynamicError {
|
|
4
|
+
constructor() {
|
|
5
|
+
super('Email already exists');
|
|
6
|
+
}
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
export { EmailAlreadyExistsError };
|
|
@@ -4,10 +4,10 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var DynamicError = require('./DynamicError.cjs');
|
|
6
6
|
|
|
7
|
-
class EmailProviderError extends DynamicError.DynamicError {
|
|
8
|
-
constructor(code) {
|
|
9
|
-
super('EmailProviderError', code);
|
|
10
|
-
}
|
|
7
|
+
class EmailProviderError extends DynamicError.DynamicError {
|
|
8
|
+
constructor(code) {
|
|
9
|
+
super('EmailProviderError', code);
|
|
10
|
+
}
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
exports.EmailProviderError = EmailProviderError;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DynamicError } from './DynamicError';
|
|
2
|
-
export declare class EmailProviderError extends DynamicError {
|
|
3
|
-
constructor(code: string);
|
|
4
|
-
}
|
|
1
|
+
import { DynamicError } from './DynamicError';
|
|
2
|
+
export declare class EmailProviderError extends DynamicError {
|
|
3
|
+
constructor(code: string);
|
|
4
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { DynamicError } from './DynamicError.js';
|
|
2
2
|
|
|
3
|
-
class EmailProviderError extends DynamicError {
|
|
4
|
-
constructor(code) {
|
|
5
|
-
super('EmailProviderError', code);
|
|
6
|
-
}
|
|
3
|
+
class EmailProviderError extends DynamicError {
|
|
4
|
+
constructor(code) {
|
|
5
|
+
super('EmailProviderError', code);
|
|
6
|
+
}
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
export { EmailProviderError };
|
|
@@ -4,10 +4,10 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var DynamicError = require('./DynamicError.cjs');
|
|
6
6
|
|
|
7
|
-
class EmailVerificationError extends DynamicError.DynamicError {
|
|
8
|
-
constructor(code) {
|
|
9
|
-
super('EmailVerificationError', code);
|
|
10
|
-
}
|
|
7
|
+
class EmailVerificationError extends DynamicError.DynamicError {
|
|
8
|
+
constructor(code) {
|
|
9
|
+
super('EmailVerificationError', code);
|
|
10
|
+
}
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
exports.EmailVerificationError = EmailVerificationError;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DynamicError } from './DynamicError';
|
|
2
|
-
export declare class EmailVerificationError extends DynamicError {
|
|
3
|
-
constructor(code: string);
|
|
4
|
-
}
|
|
1
|
+
import { DynamicError } from './DynamicError';
|
|
2
|
+
export declare class EmailVerificationError extends DynamicError {
|
|
3
|
+
constructor(code: string);
|
|
4
|
+
}
|