@cordystackx/cordy_minikit 0.4.1 → 0.4.5
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/README.md +1 -1
- package/dist/config/walletConfig.d.ts +2 -1
- package/dist/config/walletConfig.d.ts.map +1 -1
- package/dist/config/walletConfig.js +10 -9
- package/dist/controllers/Get_Balance.js +1 -1
- package/dist/controllers/WagmiButton.js +0 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -2
package/README.md
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { createConfig } from 'wagmi';
|
|
2
|
-
|
|
2
|
+
import type { Chain } from 'wagmi/chains';
|
|
3
|
+
export default function getConfig(chains?: Record<string, Chain>): ReturnType<typeof createConfig>;
|
|
3
4
|
export declare const config: ReturnType<typeof createConfig>;
|
|
4
5
|
//# sourceMappingURL=walletConfig.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"walletConfig.d.ts","sourceRoot":"","sources":["../../config/walletConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,YAAY,
|
|
1
|
+
{"version":3,"file":"walletConfig.d.ts","sourceRoot":"","sources":["../../config/walletConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,YAAY,EAAE,MAAM,OAAO,CAAC;AAG3C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAK1C,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,MAAM,GAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAM,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAsBrG;AAED,eAAO,MAAM,MAAM,EAAE,UAAU,CAAC,OAAO,YAAY,CAEV,CAAC"}
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import { http, createConfig } from 'wagmi';
|
|
2
2
|
import { mainnet, base } from 'wagmi/chains';
|
|
3
3
|
import { walletConnect, metaMask, coinbaseWallet } from 'wagmi/connectors';
|
|
4
|
-
import { BaseSepolia } from "../chains";
|
|
5
4
|
const projectId = process.env.NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID;
|
|
6
5
|
// Function to create config - only called on client side
|
|
7
|
-
export function getConfig() {
|
|
6
|
+
export default function getConfig(chains = {}) {
|
|
7
|
+
// Combine default chains with custom chains
|
|
8
|
+
const allChains = [mainnet, base, ...Object.values(chains)];
|
|
9
|
+
// Create transports dynamically for all chains
|
|
10
|
+
const transports = allChains.reduce((acc, chain) => {
|
|
11
|
+
acc[chain.id] = http();
|
|
12
|
+
return acc;
|
|
13
|
+
}, {});
|
|
8
14
|
return createConfig({
|
|
9
|
-
chains:
|
|
15
|
+
chains: allChains,
|
|
10
16
|
connectors: [
|
|
11
17
|
metaMask(),
|
|
12
18
|
walletConnect({ projectId }),
|
|
@@ -15,14 +21,9 @@ export function getConfig() {
|
|
|
15
21
|
version: "3"
|
|
16
22
|
})
|
|
17
23
|
],
|
|
18
|
-
transports
|
|
19
|
-
[mainnet.id]: http(),
|
|
20
|
-
[base.id]: http(),
|
|
21
|
-
[BaseSepolia().id]: http()
|
|
22
|
-
},
|
|
24
|
+
transports,
|
|
23
25
|
});
|
|
24
26
|
}
|
|
25
|
-
// Create config only on client side
|
|
26
27
|
export const config = typeof window !== 'undefined'
|
|
27
28
|
? getConfig()
|
|
28
29
|
: {};
|
|
@@ -4,7 +4,7 @@ export default async function getTokenBalance(address, tokenAddress) {
|
|
|
4
4
|
if (!address)
|
|
5
5
|
return "0";
|
|
6
6
|
try {
|
|
7
|
-
const provider = new ethers.JsonRpcProvider(process.env.
|
|
7
|
+
const provider = new ethers.JsonRpcProvider(process.env.NEXT_PUBLIC_LINK_PROJECT_ID_COINBASED);
|
|
8
8
|
const contract = new ethers.Contract(tokenAddress, ERC20_ABI, provider);
|
|
9
9
|
const balance = await contract.balanceOf(address);
|
|
10
10
|
return ethers.formatUnits(balance, 18);
|
|
@@ -32,7 +32,6 @@ export default function WalletButton({ onStatusChange }) {
|
|
|
32
32
|
}, isPending: pendingConnector?.uid === connector.uid && isPending }, connector.uid))) }));
|
|
33
33
|
}
|
|
34
34
|
function WalletOption({ connector, onClick, isPending }) {
|
|
35
|
-
const [ready, setReady] = React.useState(true); // ✅ default to true so it still renders
|
|
36
35
|
const [installed, setInstalled] = React.useState(true);
|
|
37
36
|
React.useEffect(() => {
|
|
38
37
|
(async () => {
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAGvE,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAG7D,cAAc,cAAc,CAAC;AAG7B,cAAc,eAAe,CAAC"}
|