Skip to content

Commit e0928e0

Browse files
committed
use solana provider for interchain from interchain-kit
1 parent 051e739 commit e0928e0

File tree

4 files changed

+100
-33
lines changed

4 files changed

+100
-33
lines changed

examples/solana/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"@interchain-kit/phantom-extension": "0.3.46",
1414
"@interchain-kit/react": "0.3.46",
1515
"@interchain-ui/react": "1.26.3",
16-
"@interchainjs/solana": "1.16.1",
16+
"@interchainjs/solana": "1.17.3",
1717
"chain-registry": "2.0.31",
1818
"next": "15.3.5",
1919
"react": "^19.0.0",

examples/solana/src/app/page.tsx

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
} from '@interchainjs/solana';
1313
import { useChain, useWalletManager } from '@interchain-kit/react';
1414

15-
type StatusContent = ReactNode;
15+
type StatusContent = string | ReactNode;
1616

1717
export default function Home() {
1818
const [client, setClient] = useState<PhantomSigningClient | null>(null);
@@ -57,19 +57,22 @@ export default function Home() {
5757
setLoading(true);
5858
setStatus('Connecting to Phantom wallet...');
5959

60+
// console.log('wallet 2', wallet)
61+
const provider = await wallet.getProvider()
62+
// console.log('provider', provider)
63+
// setClient(provider)
64+
6065
const newClient = await PhantomSigningClient.connectWithPhantom(
6166
DEVNET_ENDPOINT,
6267
{
6368
commitment: 'confirmed',
64-
broadcast: { checkTx: true, timeout: 60000 }
65-
}
69+
broadcast: { checkTx: true, timeout: 60000 },
70+
provider
71+
},
6672
);
6773

6874
setClient(newClient); // original
69-
// console.log('wallet 2', wallet)
70-
// const provider = await wallet.getProvider()
71-
// console.log('provider', provider)
72-
// setClient(provider)
75+
7376
const walletAddress = newClient.signerAddress.toString();
7477
setWalletAddress(walletAddress);
7578
setRecipient(walletAddress);
@@ -349,7 +352,7 @@ export default function Home() {
349352
<h2 className="text-lg font-semibold text-gray-700 mb-3">Status</h2>
350353
<div className="bg-gray-50 p-3 rounded min-h-[60px]">
351354
<p className="text-sm text-gray-700">
352-
{loading ? 'Loading...' : status || 'Ready to use'}
355+
{loading ? 'Loading...' : (status ? status : 'Ready to use')}
353356
</p>
354357
</div>
355358
</div>

packages/create-interchain-app/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
"build:chmod": "chmod +x ./dist/create-interchain-app.js",
2626
"build": "npm run build:clean && npm run build:dist && npm run build:copy && npm run build:chmod",
2727
"build:win": "npm run build:clean && npm run build:dist && npm run build:copy",
28-
"prepare": "npm run build",
2928
"dev": "node ./dist/create-interchain-app",
3029
"lint": "eslint .",
3130
"format": "eslint --fix .",

pnpm-lock.yaml

Lines changed: 88 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)