@solana/connector 0.1.2 → 0.1.3
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/dist/{chunk-JS4KJ2KK.js → chunk-7CKCRY25.js} +22 -36
- package/dist/chunk-7CKCRY25.js.map +1 -0
- package/dist/{chunk-SJEZHNYF.js → chunk-FTD7F7CS.js} +11 -11
- package/dist/{chunk-SJEZHNYF.js.map → chunk-FTD7F7CS.js.map} +1 -1
- package/dist/{chunk-WXYUUCSD.mjs → chunk-HPENTIPE.mjs} +8 -22
- package/dist/chunk-HPENTIPE.mjs.map +1 -0
- package/dist/{chunk-F2QJH5ED.mjs → chunk-MPZFJEJK.mjs} +3 -3
- package/dist/{chunk-F2QJH5ED.mjs.map → chunk-MPZFJEJK.mjs.map} +1 -1
- package/dist/{chunk-RIBOPAOD.js → chunk-TIW3EQPC.js} +31 -20
- package/dist/chunk-TIW3EQPC.js.map +1 -0
- package/dist/{chunk-4K6QY4HR.mjs → chunk-TKJSKXSA.mjs} +31 -20
- package/dist/chunk-TKJSKXSA.mjs.map +1 -0
- package/dist/headless.js +111 -111
- package/dist/headless.mjs +2 -2
- package/dist/index.js +126 -126
- package/dist/index.mjs +3 -3
- package/dist/react.js +16 -16
- package/dist/react.mjs +2 -2
- package/package.json +1 -1
- package/dist/chunk-4K6QY4HR.mjs.map +0 -1
- package/dist/chunk-JS4KJ2KK.js.map +0 -1
- package/dist/chunk-RIBOPAOD.js.map +0 -1
- package/dist/chunk-WXYUUCSD.mjs.map +0 -1
|
@@ -1086,24 +1086,26 @@ var logger4 = createLogger("AutoConnector"), MIN_ADDRESS_LENGTH = 30, AutoConnec
|
|
|
1086
1086
|
if (this.debug && (logger4.debug("Direct wallet connect result", { result }), logger4.debug("Direct wallet publicKey property", { publicKey: directWallet.publicKey })), result && typeof result == "object" && "accounts" in result && Array.isArray(result.accounts))
|
|
1087
1087
|
return result;
|
|
1088
1088
|
let legacyResult = result;
|
|
1089
|
-
if (legacyResult?.publicKey && typeof legacyResult.publicKey.toString == "function")
|
|
1089
|
+
if (legacyResult?.publicKey && typeof legacyResult.publicKey.toString == "function") {
|
|
1090
|
+
let address = legacyResult.publicKey.toString(), publicKeyBytes = legacyResult.publicKey.toBytes ? legacyResult.publicKey.toBytes() : new Uint8Array();
|
|
1090
1091
|
return {
|
|
1091
1092
|
accounts: [
|
|
1092
1093
|
{
|
|
1093
|
-
address
|
|
1094
|
-
publicKey:
|
|
1094
|
+
address,
|
|
1095
|
+
publicKey: publicKeyBytes,
|
|
1095
1096
|
chains: ["solana:mainnet", "solana:devnet", "solana:testnet"],
|
|
1096
1097
|
features: []
|
|
1097
1098
|
}
|
|
1098
1099
|
]
|
|
1099
1100
|
};
|
|
1101
|
+
}
|
|
1100
1102
|
if (directWallet.publicKey && typeof directWallet.publicKey.toString == "function") {
|
|
1101
|
-
let address = directWallet.publicKey.toString();
|
|
1103
|
+
let address = directWallet.publicKey.toString(), publicKeyBytes = directWallet.publicKey.toBytes ? directWallet.publicKey.toBytes() : new Uint8Array();
|
|
1102
1104
|
return this.debug && logger4.debug("Using legacy wallet pattern - publicKey from wallet object"), {
|
|
1103
1105
|
accounts: [
|
|
1104
1106
|
{
|
|
1105
1107
|
address,
|
|
1106
|
-
publicKey:
|
|
1108
|
+
publicKey: publicKeyBytes,
|
|
1107
1109
|
chains: ["solana:mainnet", "solana:devnet", "solana:testnet"],
|
|
1108
1110
|
features: []
|
|
1109
1111
|
}
|
|
@@ -1111,16 +1113,20 @@ var logger4 = createLogger("AutoConnector"), MIN_ADDRESS_LENGTH = 30, AutoConnec
|
|
|
1111
1113
|
};
|
|
1112
1114
|
}
|
|
1113
1115
|
let publicKeyResult = result;
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1116
|
+
if (publicKeyResult && typeof publicKeyResult.toString == "function" && publicKeyResult.toString().length > MIN_ADDRESS_LENGTH) {
|
|
1117
|
+
let address = publicKeyResult.toString(), publicKeyBytes = publicKeyResult.toBytes ? publicKeyResult.toBytes() : new Uint8Array();
|
|
1118
|
+
return {
|
|
1119
|
+
accounts: [
|
|
1120
|
+
{
|
|
1121
|
+
address,
|
|
1122
|
+
publicKey: publicKeyBytes,
|
|
1123
|
+
chains: ["solana:mainnet", "solana:devnet", "solana:testnet"],
|
|
1124
|
+
features: []
|
|
1125
|
+
}
|
|
1126
|
+
]
|
|
1127
|
+
};
|
|
1128
|
+
}
|
|
1129
|
+
return this.debug && logger4.error("Legacy wallet: No valid publicKey found in any expected location"), { accounts: [] };
|
|
1124
1130
|
}
|
|
1125
1131
|
}), directWallet.disconnect) {
|
|
1126
1132
|
let disconnectFn = directWallet.disconnect;
|
|
@@ -1156,7 +1162,7 @@ var logger4 = createLogger("AutoConnector"), MIN_ADDRESS_LENGTH = 30, AutoConnec
|
|
|
1156
1162
|
features,
|
|
1157
1163
|
accounts: []
|
|
1158
1164
|
};
|
|
1159
|
-
|
|
1165
|
+
this.stateManager.updateState(
|
|
1160
1166
|
{
|
|
1161
1167
|
wallets: [
|
|
1162
1168
|
{
|
|
@@ -1167,8 +1173,13 @@ var logger4 = createLogger("AutoConnector"), MIN_ADDRESS_LENGTH = 30, AutoConnec
|
|
|
1167
1173
|
]
|
|
1168
1174
|
},
|
|
1169
1175
|
true
|
|
1170
|
-
)
|
|
1171
|
-
|
|
1176
|
+
);
|
|
1177
|
+
let walletsApi = getWalletsRegistry(), registryWallet = walletsApi.get().find((w) => w.name === storedWalletName), walletToUse = registryWallet || wallet;
|
|
1178
|
+
return this.debug && logger4.info("Attempting to connect via instant auto-connect", {
|
|
1179
|
+
walletName: storedWalletName,
|
|
1180
|
+
usingRegistry: !!registryWallet
|
|
1181
|
+
}), await this.connectionManager.connect(walletToUse, storedWalletName), this.debug && logger4.info("Instant auto-connect successful", { walletName: storedWalletName }), setTimeout(() => {
|
|
1182
|
+
let ws = walletsApi.get();
|
|
1172
1183
|
this.debug && logger4.debug("Checking for wallet standard update", {
|
|
1173
1184
|
wsLength: ws.length,
|
|
1174
1185
|
currentWalletsLength: this.stateManager.getSnapshot().wallets.length,
|
|
@@ -2415,5 +2426,5 @@ function createGillTransactionSigner(connectorSigner) {
|
|
|
2415
2426
|
}
|
|
2416
2427
|
|
|
2417
2428
|
export { ClipboardErrorType, ConfigurationError, ConnectionError, ConnectorClient, ConnectorError, ConnectorErrorBoundary, DEFAULT_MAX_RETRIES, Errors, NetworkError, PUBLIC_RPC_ENDPOINTS, TransactionError, TransactionSignerError, ValidationError, WalletErrorType, copyAddressToClipboard, copySignatureToClipboard, copyToClipboard, createGillTransactionSigner, createTransactionSigner, formatAddress, formatNumber, formatSOL, formatTokenAmount, getAddressUrl, getBlockUrl, getChainIdForWalletStandard, getClusterChainId, getClusterExplorerUrl, getClusterName, getClusterRpcUrl, getClusterType, getDefaultRpcUrl, getNetworkDisplayName, getPolyfillStatus, getTokenUrl, getTransactionUrl, getUserFriendlyMessage, getWalletsRegistry, installPolyfills, isClipboardAvailable, isConfigurationError, isConnectionError, isConnectorError, isCryptoAvailable, isDevnet, isDevnetCluster, isLocalCluster, isLocalnet, isMainnet, isMainnetCluster, isNetworkError, isPolyfillInstalled, isTestnet, isTestnetCluster, isTransactionError, isTransactionSignerError, isValidationError, normalizeNetwork, toClusterId, toConnectorError, truncate, withErrorBoundary };
|
|
2418
|
-
//# sourceMappingURL=chunk-
|
|
2419
|
-
//# sourceMappingURL=chunk-
|
|
2429
|
+
//# sourceMappingURL=chunk-TKJSKXSA.mjs.map
|
|
2430
|
+
//# sourceMappingURL=chunk-TKJSKXSA.mjs.map
|