@b3dotfun/sdk 0.0.50-alpha.0 → 0.0.50-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/dist/cjs/bondkit/bondkitToken.js +2 -2
- package/dist/cjs/global-account/react/hooks/useFirstEOA.d.ts +1 -7663
- package/dist/cjs/global-account/react/hooks/useFirstEOA.js +1 -21
- package/dist/esm/bondkit/bondkitToken.js +2 -2
- package/dist/esm/global-account/react/hooks/useFirstEOA.d.ts +1 -7663
- package/dist/esm/global-account/react/hooks/useFirstEOA.js +2 -22
- package/dist/types/global-account/react/hooks/useFirstEOA.d.ts +1 -7663
- package/package.json +2 -2
- package/src/bondkit/bondkitToken.ts +2 -2
- package/src/global-account/react/hooks/useFirstEOA.tsx +2 -20
|
@@ -3,12 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.useFirstEOA = useFirstEOA;
|
|
4
4
|
const react_1 = require("../../../global-account/react");
|
|
5
5
|
const debug_1 = require("../../../shared/utils/debug");
|
|
6
|
-
const thirdweb_1 = require("../../../shared/utils/thirdweb");
|
|
7
6
|
const react_2 = require("react");
|
|
8
|
-
const viem_1 = require("thirdweb/adapters/viem");
|
|
9
7
|
const react_3 = require("thirdweb/react");
|
|
10
8
|
const debug = (0, debug_1.debugB3React)("useFirstEOA");
|
|
11
|
-
function useFirstEOA(
|
|
9
|
+
function useFirstEOA() {
|
|
12
10
|
const wallets = (0, react_3.useConnectedWallets)();
|
|
13
11
|
const isConnected = (0, react_1.useAuthStore)(state => state.isConnected);
|
|
14
12
|
const [firstEOA, setFirstEOA] = (0, react_2.useState)(undefined);
|
|
@@ -35,27 +33,9 @@ function useFirstEOA(chain) {
|
|
|
35
33
|
};
|
|
36
34
|
autoSelectFirstEOAWallet();
|
|
37
35
|
}, [isConnected, wallets]);
|
|
38
|
-
const walletClient = (0, react_2.useMemo)(() => {
|
|
39
|
-
if (!firstEOA)
|
|
40
|
-
return undefined;
|
|
41
|
-
if (!chain)
|
|
42
|
-
return undefined;
|
|
43
|
-
try {
|
|
44
|
-
const viemClientWallet = viem_1.viemAdapter.wallet.toViem({
|
|
45
|
-
client: thirdweb_1.client,
|
|
46
|
-
chain,
|
|
47
|
-
wallet: firstEOA,
|
|
48
|
-
});
|
|
49
|
-
return viemClientWallet;
|
|
50
|
-
}
|
|
51
|
-
catch (err) {
|
|
52
|
-
console.error("Error setting wallet client", err);
|
|
53
|
-
}
|
|
54
|
-
}, [firstEOA, chain]);
|
|
55
36
|
return {
|
|
56
37
|
account: firstEOA,
|
|
57
38
|
address,
|
|
58
39
|
info: walletInfo,
|
|
59
|
-
walletClient,
|
|
60
40
|
};
|
|
61
41
|
}
|
|
@@ -58,7 +58,7 @@ export class BondkitToken {
|
|
|
58
58
|
});
|
|
59
59
|
this.publicClient = createPublicClient({
|
|
60
60
|
chain: this.chain,
|
|
61
|
-
transport,
|
|
61
|
+
transport: http(this.rpcUrl),
|
|
62
62
|
});
|
|
63
63
|
this.contract = getContract({
|
|
64
64
|
address: this.contractAddress,
|
|
@@ -105,7 +105,7 @@ export class BondkitToken {
|
|
|
105
105
|
});
|
|
106
106
|
this.publicClient = createPublicClient({
|
|
107
107
|
chain: this.chain,
|
|
108
|
-
transport,
|
|
108
|
+
transport: http(this.rpcUrl),
|
|
109
109
|
});
|
|
110
110
|
this.contract = getContract({
|
|
111
111
|
address: this.contractAddress,
|