@dynamic-labs/starknet 4.9.1-preview.0 → 4.9.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 +11 -2
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +9 -9
- package/src/wallet/StarknetWallet.cjs +3 -3
- package/src/wallet/StarknetWallet.d.ts +5 -1
- package/src/wallet/StarknetWallet.js +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,11 +1,20 @@
|
|
|
1
1
|
|
|
2
|
-
### [4.9.1
|
|
2
|
+
### [4.9.1](https://github.com/dynamic-labs/dynamic-auth/compare/v4.9.0...v4.9.1) (2025-03-11)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* waas svm connector ([#8191](https://github.com/dynamic-labs/dynamic-auth/issues/8191)) ([049a360](https://github.com/dynamic-labs/dynamic-auth/commit/049a360642d6aa2122676c7a29d36a7baef9e49b))
|
|
3
8
|
|
|
4
9
|
|
|
5
10
|
### Bug Fixes
|
|
6
11
|
|
|
7
12
|
* 7702 on sepolia ([#8242](https://github.com/dynamic-labs/dynamic-auth/issues/8242)) ([8e1c63f](https://github.com/dynamic-labs/dynamic-auth/commit/8e1c63f240024f419e12787636dd2ebaacf8da94))
|
|
8
|
-
*
|
|
13
|
+
* close auth flow when promptExport enabled but createWallet is false ([#8239](https://github.com/dynamic-labs/dynamic-auth/issues/8239)) ([f82429f](https://github.com/dynamic-labs/dynamic-auth/commit/f82429f85e729a76c2516f0db112033fdd2a36d5))
|
|
14
|
+
* fix solana genesis hashes bug that was causing a breaking change ([#8250](https://github.com/dynamic-labs/dynamic-auth/issues/8250)) ([731c93b](https://github.com/dynamic-labs/dynamic-auth/commit/731c93bea4b8b95caa8cc665f2ecb53f9948ef8e))
|
|
15
|
+
* move setup-inside-iframe utility method to the utils package ([#8256](https://github.com/dynamic-labs/dynamic-auth/issues/8256)) ([d34eb6d](https://github.com/dynamic-labs/dynamic-auth/commit/d34eb6d211baecb496b84fefaee8179a5fb1b52a))
|
|
16
|
+
* **QNTM-2952:** support headless social sign in ([#8226](https://github.com/dynamic-labs/dynamic-auth/issues/8226)) ([0c3082d](https://github.com/dynamic-labs/dynamic-auth/commit/0c3082d593c633519c9eed20be15186f18f65c09))
|
|
17
|
+
* sign message with trust wallet on solana ([#8249](https://github.com/dynamic-labs/dynamic-auth/issues/8249)) ([99a7917](https://github.com/dynamic-labs/dynamic-auth/commit/99a791796f7d2c83b9f18e45367aa9689c67869d))
|
|
9
18
|
|
|
10
19
|
## [4.9.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.8.6...v4.9.0) (2025-03-07)
|
|
11
20
|
|
package/package.cjs
CHANGED
package/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/starknet",
|
|
3
|
-
"version": "4.9.1
|
|
3
|
+
"version": "4.9.1",
|
|
4
4
|
"description": "A React SDK for implementing wallet web3 authentication and authorization to your website.",
|
|
5
5
|
"author": "Dynamic Labs, Inc.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -24,14 +24,14 @@
|
|
|
24
24
|
"starknetkit": "2.6.2",
|
|
25
25
|
"text-encoding": "0.7.0",
|
|
26
26
|
"@dynamic-labs/sdk-api-core": "0.0.638",
|
|
27
|
-
"@dynamic-labs/assert-package-version": "4.9.1
|
|
28
|
-
"@dynamic-labs/logger": "4.9.1
|
|
29
|
-
"@dynamic-labs/rpc-providers": "4.9.1
|
|
30
|
-
"@dynamic-labs/starknet-core": "4.9.1
|
|
31
|
-
"@dynamic-labs/types": "4.9.1
|
|
32
|
-
"@dynamic-labs/utils": "4.9.1
|
|
33
|
-
"@dynamic-labs/wallet-book": "4.9.1
|
|
34
|
-
"@dynamic-labs/wallet-connector-core": "4.9.1
|
|
27
|
+
"@dynamic-labs/assert-package-version": "4.9.1",
|
|
28
|
+
"@dynamic-labs/logger": "4.9.1",
|
|
29
|
+
"@dynamic-labs/rpc-providers": "4.9.1",
|
|
30
|
+
"@dynamic-labs/starknet-core": "4.9.1",
|
|
31
|
+
"@dynamic-labs/types": "4.9.1",
|
|
32
|
+
"@dynamic-labs/utils": "4.9.1",
|
|
33
|
+
"@dynamic-labs/wallet-book": "4.9.1",
|
|
34
|
+
"@dynamic-labs/wallet-connector-core": "4.9.1",
|
|
35
35
|
"assert": "2.1.0"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {}
|
|
@@ -18,16 +18,16 @@ class StarknetWallet extends walletConnectorCore.Wallet {
|
|
|
18
18
|
* @returns The signature of the sent transaction.
|
|
19
19
|
*/
|
|
20
20
|
sendBalance(_a) {
|
|
21
|
-
return _tslib.__awaiter(this, arguments, void 0, function* ({ amount, toAddress, }) {
|
|
21
|
+
return _tslib.__awaiter(this, arguments, void 0, function* ({ amount, toAddress, token, }) {
|
|
22
22
|
yield this._connector.connect();
|
|
23
23
|
const account = yield this._connector.getWalletAccount();
|
|
24
24
|
if (!account) {
|
|
25
25
|
throw new Error('unable to retrieve Starknet wallet account');
|
|
26
26
|
}
|
|
27
|
-
const contract = new starknet.Contract(ethereumContractAbi, constants.ETH_STARKNET_ADDRESS, account);
|
|
27
|
+
const contract = new starknet.Contract(ethereumContractAbi, (token === null || token === void 0 ? void 0 : token.address) || constants.ETH_STARKNET_ADDRESS, account);
|
|
28
28
|
const transfer = yield contract.invoke('transfer', [
|
|
29
29
|
toAddress,
|
|
30
|
-
starknet.cairo.uint256(Number(amount) *
|
|
30
|
+
starknet.cairo.uint256(Number(amount) * Math.pow(10, ((token === null || token === void 0 ? void 0 : token.decimals) || 18))),
|
|
31
31
|
]);
|
|
32
32
|
return transfer === null || transfer === void 0 ? void 0 : transfer.transaction_hash;
|
|
33
33
|
});
|
|
@@ -8,9 +8,13 @@ export declare class StarknetWallet extends Wallet<StarknetWalletConnector> {
|
|
|
8
8
|
* @param toAddress - The address to send the balance to.
|
|
9
9
|
* @returns The signature of the sent transaction.
|
|
10
10
|
*/
|
|
11
|
-
sendBalance({ amount, toAddress, }: {
|
|
11
|
+
sendBalance({ amount, toAddress, token, }: {
|
|
12
12
|
amount: string;
|
|
13
13
|
toAddress: string;
|
|
14
|
+
token?: {
|
|
15
|
+
address: string;
|
|
16
|
+
decimals?: number;
|
|
17
|
+
};
|
|
14
18
|
}): Promise<string>;
|
|
15
19
|
getWalletAccount(): Promise<WalletAccount>;
|
|
16
20
|
getProvider(): Promise<RpcProvider>;
|
|
@@ -14,16 +14,16 @@ class StarknetWallet extends Wallet {
|
|
|
14
14
|
* @returns The signature of the sent transaction.
|
|
15
15
|
*/
|
|
16
16
|
sendBalance(_a) {
|
|
17
|
-
return __awaiter(this, arguments, void 0, function* ({ amount, toAddress, }) {
|
|
17
|
+
return __awaiter(this, arguments, void 0, function* ({ amount, toAddress, token, }) {
|
|
18
18
|
yield this._connector.connect();
|
|
19
19
|
const account = yield this._connector.getWalletAccount();
|
|
20
20
|
if (!account) {
|
|
21
21
|
throw new Error('unable to retrieve Starknet wallet account');
|
|
22
22
|
}
|
|
23
|
-
const contract = new Contract(ETH_CONTRACT_ABI, ETH_STARKNET_ADDRESS, account);
|
|
23
|
+
const contract = new Contract(ETH_CONTRACT_ABI, (token === null || token === void 0 ? void 0 : token.address) || ETH_STARKNET_ADDRESS, account);
|
|
24
24
|
const transfer = yield contract.invoke('transfer', [
|
|
25
25
|
toAddress,
|
|
26
|
-
cairo.uint256(Number(amount) *
|
|
26
|
+
cairo.uint256(Number(amount) * Math.pow(10, ((token === null || token === void 0 ? void 0 : token.decimals) || 18))),
|
|
27
27
|
]);
|
|
28
28
|
return transfer === null || transfer === void 0 ? void 0 : transfer.transaction_hash;
|
|
29
29
|
});
|