@dynamic-labs/solana-core 4.5.0 → 4.5.2
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 +22 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +8 -8
- package/src/connector/SolanaWalletConnector.cjs +8 -0
- package/src/connector/SolanaWalletConnector.d.ts +2 -0
- package/src/connector/SolanaWalletConnector.js +8 -0
- package/src/utils/createSolTransfer/createSolTransfer.cjs +1 -1
- package/src/utils/createSolTransfer/createSolTransfer.js +1 -1
- package/src/wallet/SolanaWallet.cjs +1 -1
- package/src/wallet/SolanaWallet.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,26 @@
|
|
|
1
1
|
|
|
2
|
+
### [4.5.2](https://github.com/dynamic-labs/dynamic-auth/compare/v4.5.1...v4.5.2) (2025-02-08)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* add getEnabledNetworks method to wallet connectors ([#8000](https://github.com/dynamic-labs/dynamic-auth/issues/8000)) ([450cdcd](https://github.com/dynamic-labs/dynamic-auth/commit/450cdcd98b11c734fb9c9d97bb1813cf5538e85e))
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* add fallback for exchange rate lookup failure ([#7994](https://github.com/dynamic-labs/dynamic-auth/issues/7994)) ([1359724](https://github.com/dynamic-labs/dynamic-auth/commit/1359724ec2931c61324bfe8d73110d862ebc016f))
|
|
13
|
+
* add USDT and USDC as hardcoded to 1 ([#8012](https://github.com/dynamic-labs/dynamic-auth/issues/8012)) ([92dcd2f](https://github.com/dynamic-labs/dynamic-auth/commit/92dcd2f6a90e8eeca034edf1682336896180281e))
|
|
14
|
+
* underflow bigint issue with small sol transfers ([#8006](https://github.com/dynamic-labs/dynamic-auth/issues/8006)) ([3fd00c2](https://github.com/dynamic-labs/dynamic-auth/commit/3fd00c2f0d0e10333f0206cb80197375de836003))
|
|
15
|
+
* view address react 17 compatibility ([#8002](https://github.com/dynamic-labs/dynamic-auth/issues/8002)) ([782e0f3](https://github.com/dynamic-labs/dynamic-auth/commit/782e0f323f388cac1d0773420ae45595aa806c26))
|
|
16
|
+
|
|
17
|
+
### [4.5.1](https://github.com/dynamic-labs/dynamic-auth/compare/v4.5.0...v4.5.1) (2025-02-05)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* improve sdk performance ([#7992](https://github.com/dynamic-labs/dynamic-auth/issues/7992)) ([7c541d4](https://github.com/dynamic-labs/dynamic-auth/commit/7c541d498b3afe708e468327e53c839826029490))
|
|
23
|
+
|
|
2
24
|
## [4.5.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.4.4...v4.5.0) (2025-02-04)
|
|
3
25
|
|
|
4
26
|
|
package/package.cjs
CHANGED
package/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/solana-core",
|
|
3
|
-
"version": "4.5.
|
|
3
|
+
"version": "4.5.2",
|
|
4
4
|
"description": "Core package for utilities and types for solana",
|
|
5
5
|
"author": "Dynamic Labs, Inc.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -18,15 +18,15 @@
|
|
|
18
18
|
},
|
|
19
19
|
"homepage": "https://www.dynamic.xyz/",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@dynamic-labs/sdk-api-core": "0.0.
|
|
21
|
+
"@dynamic-labs/sdk-api-core": "0.0.613",
|
|
22
22
|
"@solana/web3.js": "1.92.1",
|
|
23
23
|
"@solana/spl-token": "0.4.6",
|
|
24
|
-
"@dynamic-labs/assert-package-version": "4.5.
|
|
25
|
-
"@dynamic-labs/rpc-providers": "4.5.
|
|
26
|
-
"@dynamic-labs/types": "4.5.
|
|
27
|
-
"@dynamic-labs/utils": "4.5.
|
|
28
|
-
"@dynamic-labs/wallet-book": "4.5.
|
|
29
|
-
"@dynamic-labs/wallet-connector-core": "4.5.
|
|
24
|
+
"@dynamic-labs/assert-package-version": "4.5.2",
|
|
25
|
+
"@dynamic-labs/rpc-providers": "4.5.2",
|
|
26
|
+
"@dynamic-labs/types": "4.5.2",
|
|
27
|
+
"@dynamic-labs/utils": "4.5.2",
|
|
28
|
+
"@dynamic-labs/wallet-book": "4.5.2",
|
|
29
|
+
"@dynamic-labs/wallet-connector-core": "4.5.2",
|
|
30
30
|
"eventemitter3": "5.0.1"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {}
|
|
@@ -169,6 +169,14 @@ class SolanaWalletConnector extends walletConnectorCore.WalletConnectorBase {
|
|
|
169
169
|
isLedgerAddress(address) {
|
|
170
170
|
return utils.isLedgerAddressViaVerifiedCredentials(address, this.verifiedCredentials);
|
|
171
171
|
}
|
|
172
|
+
getBlockExplorerUrlsForCurrentNetwork() {
|
|
173
|
+
return _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
174
|
+
return ['https://solscan.io/'];
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
getEnabledNetworks() {
|
|
178
|
+
return this.solNetworks;
|
|
179
|
+
}
|
|
172
180
|
}
|
|
173
181
|
|
|
174
182
|
exports.SolanaWalletConnector = SolanaWalletConnector;
|
|
@@ -37,4 +37,6 @@ export declare abstract class SolanaWalletConnector extends WalletConnectorBase<
|
|
|
37
37
|
private buildAuthTx;
|
|
38
38
|
setVerifiedCredentials(verifiedCredentials: JwtVerifiedCredential[]): void;
|
|
39
39
|
isLedgerAddress(address: string): boolean;
|
|
40
|
+
getBlockExplorerUrlsForCurrentNetwork(): Promise<string[]>;
|
|
41
|
+
getEnabledNetworks(): GenericNetwork[];
|
|
40
42
|
}
|
|
@@ -165,6 +165,14 @@ class SolanaWalletConnector extends WalletConnectorBase {
|
|
|
165
165
|
isLedgerAddress(address) {
|
|
166
166
|
return isLedgerAddressViaVerifiedCredentials(address, this.verifiedCredentials);
|
|
167
167
|
}
|
|
168
|
+
getBlockExplorerUrlsForCurrentNetwork() {
|
|
169
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
170
|
+
return ['https://solscan.io/'];
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
getEnabledNetworks() {
|
|
174
|
+
return this.solNetworks;
|
|
175
|
+
}
|
|
168
176
|
}
|
|
169
177
|
|
|
170
178
|
export { SolanaWalletConnector };
|
|
@@ -12,7 +12,7 @@ const createSolTransfer = (_a) => _tslib.__awaiter(void 0, [_a], void 0, functio
|
|
|
12
12
|
instructions: [
|
|
13
13
|
web3_js.SystemProgram.transfer({
|
|
14
14
|
fromPubkey: new web3_js.PublicKey(fromAddress),
|
|
15
|
-
lamports: utils.solToLamports(amount),
|
|
15
|
+
lamports: Math.round(utils.solToLamports(amount)),
|
|
16
16
|
toPubkey: new web3_js.PublicKey(toAddress),
|
|
17
17
|
}),
|
|
18
18
|
],
|
|
@@ -8,7 +8,7 @@ const createSolTransfer = (_a) => __awaiter(void 0, [_a], void 0, function* ({ f
|
|
|
8
8
|
instructions: [
|
|
9
9
|
SystemProgram.transfer({
|
|
10
10
|
fromPubkey: new PublicKey(fromAddress),
|
|
11
|
-
lamports: solToLamports(amount),
|
|
11
|
+
lamports: Math.round(solToLamports(amount)),
|
|
12
12
|
toPubkey: new PublicKey(toAddress),
|
|
13
13
|
}),
|
|
14
14
|
],
|
|
@@ -24,7 +24,7 @@ class SolanaWallet extends walletConnectorCore.Wallet {
|
|
|
24
24
|
const connection = yield this.getConnection();
|
|
25
25
|
const signer = yield this.getSigner();
|
|
26
26
|
const { blockhash, lastValidBlockHeight } = yield connection.getLatestBlockhash('finalized');
|
|
27
|
-
if (token
|
|
27
|
+
if (token === null || token === void 0 ? void 0 : token.address) {
|
|
28
28
|
transaction = yield createNonNativeTokenTransfer.createNonNativeTokenTransfer({
|
|
29
29
|
amount: Number(amount),
|
|
30
30
|
blockhash,
|
|
@@ -20,7 +20,7 @@ class SolanaWallet extends Wallet {
|
|
|
20
20
|
const connection = yield this.getConnection();
|
|
21
21
|
const signer = yield this.getSigner();
|
|
22
22
|
const { blockhash, lastValidBlockHeight } = yield connection.getLatestBlockhash('finalized');
|
|
23
|
-
if (token
|
|
23
|
+
if (token === null || token === void 0 ? void 0 : token.address) {
|
|
24
24
|
transaction = yield createNonNativeTokenTransfer({
|
|
25
25
|
amount: Number(amount),
|
|
26
26
|
blockhash,
|