@dynamic-labs/waas 4.22.3 → 4.22.4
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 +7 -0
- package/_virtual/_tslib.cjs +36 -0
- package/_virtual/_tslib.js +32 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +7 -7
- package/src/DynamicWaasMixin.cjs +26 -19
- package/src/DynamicWaasMixin.d.ts +2 -2
- package/src/DynamicWaasMixin.js +26 -19
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
|
|
2
|
+
### [4.22.4](https://github.com/dynamic-labs/dynamic-auth/compare/v4.22.3...v4.22.4) (2025-07-08)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* intialize waas wallet client in react sdk ([#9125](https://github.com/dynamic-labs/dynamic-auth/issues/9125)) ([c59a3d6](https://github.com/dynamic-labs/dynamic-auth/commit/c59a3d6aeeb3cc001949354a218f1fafc08bd448))
|
|
8
|
+
|
|
2
9
|
### [4.22.3](https://github.com/dynamic-labs/dynamic-auth/compare/v4.22.2...v4.22.3) (2025-07-08)
|
|
3
10
|
|
|
4
11
|
### [4.22.2](https://github.com/dynamic-labs/dynamic-auth/compare/v4.22.1...v4.22.2) (2025-07-08)
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
/******************************************************************************
|
|
7
|
+
Copyright (c) Microsoft Corporation.
|
|
8
|
+
|
|
9
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
10
|
+
purpose with or without fee is hereby granted.
|
|
11
|
+
|
|
12
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
13
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
14
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
15
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
16
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
17
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
18
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
19
|
+
***************************************************************************** */
|
|
20
|
+
|
|
21
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
22
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
23
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
24
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
25
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
26
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
27
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
32
|
+
var e = new Error(message);
|
|
33
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
exports.__awaiter = __awaiter;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
/******************************************************************************
|
|
3
|
+
Copyright (c) Microsoft Corporation.
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
purpose with or without fee is hereby granted.
|
|
7
|
+
|
|
8
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
9
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
10
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
11
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
12
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
+
***************************************************************************** */
|
|
16
|
+
|
|
17
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
18
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
28
|
+
var e = new Error(message);
|
|
29
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export { __awaiter };
|
package/package.cjs
CHANGED
package/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/waas",
|
|
3
|
-
"version": "4.22.
|
|
3
|
+
"version": "4.22.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"author": "Dynamic Labs, Inc.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -16,12 +16,12 @@
|
|
|
16
16
|
"./package.json": "./package.json"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@dynamic-labs/assert-package-version": "4.22.
|
|
20
|
-
"@dynamic-labs-wallet/browser-wallet-client": "0.0.
|
|
21
|
-
"@dynamic-labs/ethereum-core": "4.22.
|
|
22
|
-
"@dynamic-labs/solana-core": "4.22.
|
|
23
|
-
"@dynamic-labs/sui-core": "4.22.
|
|
24
|
-
"@dynamic-labs/wallet-book": "4.22.
|
|
19
|
+
"@dynamic-labs/assert-package-version": "4.22.4",
|
|
20
|
+
"@dynamic-labs-wallet/browser-wallet-client": "0.0.114",
|
|
21
|
+
"@dynamic-labs/ethereum-core": "4.22.4",
|
|
22
|
+
"@dynamic-labs/solana-core": "4.22.4",
|
|
23
|
+
"@dynamic-labs/sui-core": "4.22.4",
|
|
24
|
+
"@dynamic-labs/wallet-book": "4.22.4"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {}
|
|
27
27
|
}
|
package/src/DynamicWaasMixin.cjs
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
|
+
var _tslib = require('../_virtual/_tslib.cjs');
|
|
6
7
|
var browserWalletClient = require('@dynamic-labs-wallet/browser-wallet-client');
|
|
7
8
|
var _package = require('../package.cjs');
|
|
8
9
|
var constants = require('../utils/constants.cjs');
|
|
@@ -44,28 +45,34 @@ const withDynamicWaas = (BaseClass) => {
|
|
|
44
45
|
this.chainName = chainName;
|
|
45
46
|
}
|
|
46
47
|
createDynamicWaasClient() {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
48
|
+
return _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
49
|
+
var _a;
|
|
50
|
+
const authToken = (_a = this.getAuthToken) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
51
|
+
if (!authToken) {
|
|
52
|
+
throw new Error('Auth token is required');
|
|
53
|
+
}
|
|
54
|
+
if (!this.environmentId) {
|
|
55
|
+
throw new Error('Environment ID is required');
|
|
56
|
+
}
|
|
57
|
+
const client = new browserWalletClient.DynamicWalletClient({
|
|
58
|
+
authToken,
|
|
59
|
+
baseApiUrl: this.baseApiUrl || constants.DEFAULT_BASE_API_URL,
|
|
60
|
+
baseMPCRelayApiUrl: this.relayUrl || constants.DEFAULT_BASE_MPC_RELAY_API_URL,
|
|
61
|
+
chainName: this.chainName,
|
|
62
|
+
environmentId: this.environmentId,
|
|
63
|
+
sdkVersion: _package.version,
|
|
64
|
+
});
|
|
65
|
+
yield client.initialize();
|
|
66
|
+
return client;
|
|
62
67
|
});
|
|
63
68
|
}
|
|
64
69
|
getWaasWalletClient() {
|
|
65
|
-
|
|
66
|
-
this.dynamicWaasClient
|
|
67
|
-
|
|
68
|
-
|
|
70
|
+
return _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
71
|
+
if (!this.dynamicWaasClient) {
|
|
72
|
+
this.dynamicWaasClient = yield this.createDynamicWaasClient();
|
|
73
|
+
}
|
|
74
|
+
return this.dynamicWaasClient;
|
|
75
|
+
});
|
|
69
76
|
}
|
|
70
77
|
}
|
|
71
78
|
return DynamicWaasMixin;
|
|
@@ -16,6 +16,6 @@ export declare const withDynamicWaas: <T extends abstract new (...args: any[]) =
|
|
|
16
16
|
setBaseApiUrl(baseApiUrl: string): void;
|
|
17
17
|
setRelayUrl(relayUrl: string): void;
|
|
18
18
|
setGetSignedSessionIdFunction(getSignedSessionId: () => Promise<string>): void;
|
|
19
|
-
createDynamicWaasClient(): DynamicWalletClient
|
|
20
|
-
getWaasWalletClient(): DynamicWalletClient
|
|
19
|
+
createDynamicWaasClient(): Promise<DynamicWalletClient>;
|
|
20
|
+
getWaasWalletClient(): Promise<DynamicWalletClient>;
|
|
21
21
|
}) & T;
|
package/src/DynamicWaasMixin.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
'use client'
|
|
2
|
+
import { __awaiter } from '../_virtual/_tslib.js';
|
|
2
3
|
import { DynamicWalletClient } from '@dynamic-labs-wallet/browser-wallet-client';
|
|
3
4
|
import { version } from '../package.js';
|
|
4
5
|
import { DEFAULT_BASE_API_URL, DEFAULT_BASE_MPC_RELAY_API_URL } from '../utils/constants.js';
|
|
@@ -40,28 +41,34 @@ const withDynamicWaas = (BaseClass) => {
|
|
|
40
41
|
this.chainName = chainName;
|
|
41
42
|
}
|
|
42
43
|
createDynamicWaasClient() {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
44
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
45
|
+
var _a;
|
|
46
|
+
const authToken = (_a = this.getAuthToken) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
47
|
+
if (!authToken) {
|
|
48
|
+
throw new Error('Auth token is required');
|
|
49
|
+
}
|
|
50
|
+
if (!this.environmentId) {
|
|
51
|
+
throw new Error('Environment ID is required');
|
|
52
|
+
}
|
|
53
|
+
const client = new DynamicWalletClient({
|
|
54
|
+
authToken,
|
|
55
|
+
baseApiUrl: this.baseApiUrl || DEFAULT_BASE_API_URL,
|
|
56
|
+
baseMPCRelayApiUrl: this.relayUrl || DEFAULT_BASE_MPC_RELAY_API_URL,
|
|
57
|
+
chainName: this.chainName,
|
|
58
|
+
environmentId: this.environmentId,
|
|
59
|
+
sdkVersion: version,
|
|
60
|
+
});
|
|
61
|
+
yield client.initialize();
|
|
62
|
+
return client;
|
|
58
63
|
});
|
|
59
64
|
}
|
|
60
65
|
getWaasWalletClient() {
|
|
61
|
-
|
|
62
|
-
this.dynamicWaasClient
|
|
63
|
-
|
|
64
|
-
|
|
66
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
67
|
+
if (!this.dynamicWaasClient) {
|
|
68
|
+
this.dynamicWaasClient = yield this.createDynamicWaasClient();
|
|
69
|
+
}
|
|
70
|
+
return this.dynamicWaasClient;
|
|
71
|
+
});
|
|
65
72
|
}
|
|
66
73
|
}
|
|
67
74
|
return DynamicWaasMixin;
|